#bf_boot_splash {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding:
        env(safe-area-inset-top, 0)
        env(safe-area-inset-right, 0)
        env(safe-area-inset-bottom, 0)
        env(safe-area-inset-left, 0);

    &.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    &.is-closing {
        opacity: 0;
        pointer-events: none;
    }

    & .bf-boot-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        color: var(--white);
        text-shadow: 0 0.0625rem 0.125rem var(--trans-a40);
    }
    & .bf-boot-logo {
        font-size: 1.22rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: lowercase;
        line-height: 0;

        & svg {
            display: block;
            width: min(17rem, 72vw);
            height: auto;
        }
    }
    & .bf-boot-spinner {
        width: 1.9rem;
        height: 1.9rem;
        border: 0.125rem solid var(--trans-a25);
        border-top-color: var(--white);
        border-radius: 50%;
        animation: bfBootSpin 0.8s linear infinite;
    }
}

@keyframes bfBootSpin {
    to { transform: rotate(360deg); }
}

/* SVG user icon */
svg[user] {
    width: 2.16rem;
	margin-right: 0.19rem;
	vertical-align: middle;

    @media (min-width: 64em) {
        width: 1.88rem;
    }

    & #back {
        fill: var(--surface-mid);
    }

    & #person {
        fill: var(--gray-soft);
    }

    & #status {
        fill: var(--gray-soft);
    }

    & #subscription {
        display: none;
        fill: var(--red);
        stroke: var(--gray-soft);
    }

    & #photo {
        fill: var(--surface-mid);
    }

    .online path {
        fill: var(--icon-online) ! important;
    }

    .away path {
        fill: var(--yellow-dark) ! important;
    }

    .favorite path {
        fill: var(--yellow-dark);
    }

    .blocked path {
        fill: var(--black);
    }

    .photo path {
        fill: var(--gray-soft);
    }

    .subscription {
        display: block ! important;
        & path {
            fill: var(--brand-pink);
        }
    }
}

/* User icon på infosider */
.info-status-legend {
    display: inline-block;

    .info-status-row {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
    }

    .info-status-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .info-status-icon svg[user='0'] {
        width: 4.32rem;
        margin-right: 0;

        @media (min-width: 64em) {
            width: 3.76rem;
        }
    }

    .info-status-icon svg[user='0'] #status,
    .info-status-icon svg[user='0'] #photo,
    .info-status-icon svg[user='0'] #back {
        fill: var(--surface-mid);
    }

    .info-status-icon svg[user='0'] #subscription {
        display: none;
    }

    .info-status-row.is-online .info-status-icon svg[user='0'] #status path {
        fill: var(--icon-online) !important;
    }

    .info-status-row.is-away .info-status-icon svg[user='0'] #status path {
        fill: var(--yellow-dark) !important;
    }

    .info-status-row.is-favorite .info-status-icon svg[user='0'] #person path {
        fill: var(--yellow-dark);
    }

    .info-status-row.is-blocked .info-status-icon svg[user='0'] #person path {
        fill: var(--black);
    }

    .info-status-row.is-photo .info-status-icon svg[user='0'] #photo path {
        fill: var(--gray-soft);
    }

    .info-status-row.is-vip .info-status-icon svg[user='0'] #subscription {
        display: block;
    }

    .info-status-row.is-vip .info-status-icon svg[user='0'] #subscription path {
        fill: var(--brand-pink);
    }
}

.cardlogos {
    width: max-content;
    display: flex;
    margin: 0 0 0 auto;
    padding: 0 0.5rem 0.25rem 0.5rem;
    background: var(--blue-light);
    border-radius: 0 0 0 1rem;

    & .payment-cardlogo {
        padding: 0.25rem 0.25rem;

        & svg {
            display: block;
            width: auto;
            height: 0.9rem;
        }

        &--visa svg {
            transform: scale(0.8);
            transform-origin: center;
        }
    }
}

.bf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;

    &.is-open {
        display: block;
    }

    & .lb-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.88);
    }

    & .lb-frame {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        padding: 3.5rem 4.5rem;

        body.is-mobile-layout & {
            padding: 3.25rem 0.5rem 5.125rem;
        }
    }

    & .lb-content {
        max-width: min(92vw, 80rem);
        max-height: calc(100vh - 8.75rem);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    & .lb-media {
        max-width: 100%;
        max-height: calc(100vh - 8.75rem);
        object-fit: contain;
        display: block;
    }

    & .lb-btn {
        position: absolute;
        border: 0;
        background: rgba(25, 25, 25, 0.7);
        color: #f8f8f8;
        cursor: pointer;
        font-size: 2.125rem;
        line-height: 1;
        width: 2.875rem;
        height: 2.875rem;
        border-radius: 0.5rem;

        &:hover {
            background: rgba(45, 45, 45, 0.9);
        }

        &.lb-btn-close {
            top: 0.75rem;
            right: 0.875rem;
            font-size: 2rem;
            font-weight: 300;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        &.lb-btn-prev {
            left: 0.875rem;
            top: 50%;
            transform: translateY(-50%);

            body.is-mobile-layout & {
                left: 0.375rem;
            }
        }

        &.lb-btn-next {
            right: 0.875rem;
            top: 50%;
            transform: translateY(-50%);

            body.is-mobile-layout & {
                right: 0.375rem;
            }
        }
    }

    & .lb-footer {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.875rem 1.125rem;
        color: #f2f2f2;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
        font-size: 0.875rem;
        pointer-events: none;
    }

    & .lb-caption {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    & .lb-counter {
        opacity: 0.9;
        flex-shrink: 0;
    }
}

body.bf-lightbox-open {
    overflow: hidden;
}

#qsort_filter_display {
    display: flex;
    justify-content: space-between;
    margin: 1.12rem 0 1.12rem 0;
}

.qsort_optionbox:has(.bf-vis-icons) > .qsort_optionbox_options {
    display: none !important;
}
.qsort_optionbox:has(.bf-vis-icons) > .left_arrow {
    display: none !important;
}

.qsort_optionbox {
    background-color: var(--blue-dark);
    border-radius: 0.75rem;
    position: relative;
    padding: 0 0.62rem 0 0.31rem;

    & div {
        float: left;
    }

    & div:nth-child(2) {
        padding: 0.31rem;
    }

    &:hover .qsort_optionbox_options,
    &:focus-within .qsort_optionbox_options {
        display: block;
    }

    & .qsort_optionbox_options {
        background-color: var(--white);
        display: none;
        text-align: left;
        padding: 0.62rem;
        position: absolute;
        border: 0.19rem solid var(--blue-dark);
        border-radius: 0.75rem;
        z-index: 9999;
        left: 0.62rem;
        top: 1.88rem;
        white-space: nowrap;

        & a {
            text-decoration: none;

            &:hover {
                text-decoration: underline;
            }
        }

        & label {
            display: block;
            padding: 0.12rem 0;
        }
    }
}

.qsort_direction,
.qsort_direction_selected {
    border: 1px solid var(--steel);
    border-radius: 50%;
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    font-size: var(--fs-xxs);
    text-align: center;
    line-height: 110%;
    margin-left: 0.4em;
}

.qsort_direction_selected {
    background-color: var(--white);
}

#modal_picture_folders {
    & .container {
        display: flex;
        flex-wrap: wrap;
        max-height: 20em;
        overflow: auto;

        & div {
            flex-grow: 2;
            padding: 1em 1.5em 1em 1.5em;
            margin: 0.3em;
        }
    }
}

#modal_picture_edit {
    & .grid25 {
        display: grid;
        grid-auto-flow: column;
        grid-template-columns: repeat(auto-fit, 33%);
    }

    & .grid5050 {
        display: grid;
        grid-auto-flow: column;
        grid-template-columns: repeat(auto-fit, 50%);
        margin-bottom: 3em;
        
        & div:nth-child(2) {
            text-align: center;
        }
    }

    & #edit_gallery_item {
        margin: 1em;
    }

    & .edit_image_container {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        grid-template-rows: 80px;
    }

    & .edit_image_container div {
        align-content: center;
        text-align: center;
    }

    & .edit_image_container div img {
        max-width: 100%;
        max-height: 100%;
        border: 0.31rem solid var(--white);
        border-radius: 0.31rem;
    }

    & input[type=radio] {
        display: none;
    }

    & .highlight {
        border: 0.31rem solid var(--rgb-15-112-168) ! important;
    }

    & label {
        font-weight: normal;
    }

    & label img {
        cursor: pointer;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--trans-a50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: var(--white);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px var(--trans-a10);
    overflow: hidden;
    /* Den inline width/maxHeight (fra _dialog.open) er desktop-fallback;
       begræns til viewporten så dialoger ikke flyder ud på mobil. */
    max-width: 92vw;
    max-height: 88dvh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-soft);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-text);
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

body.is-mobile-layout {
    & .modal-overlay {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
        background: rgba(9, 16, 33, 0.62);
        backdrop-filter: blur(0.15rem);
        -webkit-backdrop-filter: blur(0.15rem);
    }

    & .modal-dialog {
        width: 100% !important;
        max-width: 100%;
        max-height: min(74vh, 34rem) !important;
        border-radius: 1rem 1rem 0 0;
        background: linear-gradient(180deg, rgba(19, 28, 49, 0.98), rgba(13, 20, 38, 0.98));
        color: var(--white);
        box-shadow: 0 -0.38rem 1.12rem rgba(0, 0, 0, 0.45);
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    & .modal-header {
        padding: 0.75rem 0.88rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    }

    & .modal-header h3 {
        color: var(--white);
        font-size: 1.06rem;
        letter-spacing: 0.01em;
    }

    & .modal-close {
        min-width: 2.5rem;
        min-height: 2.5rem;
        border-radius: 999rem;
        color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.1);
        font-size: 1.62rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    & .modal-body {
        padding: 0.62rem 0.75rem 1.88rem;
    }

    & .modal-body p {
        margin: 0 0 0.75rem;
        line-height: 1.35;
        color: rgba(255, 255, 255, 0.9);
    }

    & .modal-body .btn_normal,
    & .modal-body .knap,
    & .modal-body button {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.75rem;
        font-size: 0.95rem;
    }

    /* Primær modal-handling (fx "Gem søgning"). Fuldbredde accent-knap der
       matcher "Søg" på søgesiden — i stedet for den lille dæmpede pille.
       .fright (float) neutraliseres så den fylder rækken. */
    & .modal-body .p2 {
        margin-top: 1rem;

        & .btn_normal {
            float: none;
            display: flex;
            width: 100%;
            background: var(--accent-blue);
            color: var(--white);
            font-weight: 600;
            box-shadow: 0 1px 2px var(--trans-a30);

            &:active {
                filter: brightness(0.95);
            }
        }
    }

    & .modal-body .btn_normal .left_arrow,
    & .modal-body .btn_normal .clear {
        display: none;
    }

    & .modal-body .btn_normal span:nth-child(2) {
        transform: none;
    }

    & .bf-block-choices {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    & .bf-block-choices > * {
        width: 100%;
    }

    & .bf-block-choices .btn_normal {
        width: 100%;
        padding: 0.5rem 0.75rem;
        background: rgba(208, 232, 255, 0.96);
        color: #0d2a4b;
        font-weight: 700;
        text-shadow: none;
        opacity: 1;
    }

    & .bf-block-choices .btn_normal span {
        color: #0d2a4b;
        opacity: 1;
        font-weight: 700;
        text-shadow: none;
    }

    & .bf-report-modal {
        display: grid;
        gap: 0.62rem;
    }

    & .bf-favorite-modal {
        display: grid;
        gap: 0.62rem;
    }

    & .bf-note-modal {
        display: grid;
        gap: 0.62rem;
    }

    & .bf-report-modal textarea {
        width: 100%;
        min-height: 7.5rem;
        border-radius: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(7, 13, 28, 0.72);
        color: rgba(255, 255, 255, 0.96);
        font-family: inherit;
        padding: 0.62rem 0.75rem;
        font-size: 0.98rem;
        line-height: 1.35;
        outline: none;
        resize: vertical;
    }

    & .bf-note-modal textarea {
        width: 100%;
        min-height: 7.5rem;
        border-radius: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(7, 13, 28, 0.72);
        color: rgba(255, 255, 255, 0.96);
        font-family: inherit;
        padding: 0.62rem 0.75rem;
        font-size: 0.98rem;
        line-height: 1.35;
        outline: none;
        resize: vertical;
    }

    & .bf-report-modal textarea::placeholder {
        color: rgba(214, 228, 248, 0.72);
    }

    & .bf-report-modal textarea:focus {
        border-color: rgba(173, 216, 255, 0.72);
        box-shadow: 0 0 0 0.12rem rgba(123, 193, 255, 0.35);
    }

    & .bf-note-modal textarea:focus {
        border-color: rgba(173, 216, 255, 0.72);
        box-shadow: 0 0 0 0.12rem rgba(123, 193, 255, 0.35);
    }

    & .bf-report-actions {
        width: 100%;
    }

    & .bf-favorite-actions {
        width: 100%;
    }

    & .bf-note-actions {
        width: 100%;
    }

    & .bf-report-actions > * {
        width: 100%;
    }

    & .bf-favorite-actions > * {
        width: 100%;
    }

    & .bf-note-actions > * {
        width: 100%;
    }

    & .bf-report-actions .btn_normal {
        width: 100%;
        padding: 0.5rem 0.75rem;
        background: rgba(208, 232, 255, 0.96);
        color: #0d2a4b;
        font-weight: 700;
        text-shadow: none;
        opacity: 1;
    }

    & .bf-favorite-actions .btn_normal {
        width: 100%;
        padding: 0.5rem 0.75rem;
        background: rgba(208, 232, 255, 0.96);
        color: #0d2a4b;
        font-weight: 700;
        text-shadow: none;
        opacity: 1;
    }

    & .bf-note-actions .btn_normal {
        width: 100%;
        padding: 0.5rem 0.75rem;
        background: rgba(208, 232, 255, 0.96);
        color: #0d2a4b;
        font-weight: 700;
        text-shadow: none;
        opacity: 1;
    }

    & .bf-report-actions .btn_normal span {
        color: #0d2a4b;
        opacity: 1;
        font-weight: 700;
    }

    & .bf-favorite-actions .btn_normal span {
        color: #0d2a4b;
        opacity: 1;
        font-weight: 700;
    }

    & .bf-note-actions .btn_normal span {
        color: #0d2a4b;
        opacity: 1;
        font-weight: 700;
    }

    & .bf-report-error {
        margin: 0;
        color: #ffd6d6 !important;
        font-weight: 700;
    }
}

.upload-area {
    margin-bottom: 1.25rem;

    & .upload-input {
        display: none;
    }

    & .upload-drop-zone {
        border: 0.12rem dashed var(--gray-line-soft);
        border-radius: 0.5rem;
        padding: 1.5em;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s;
    }

    & .upload-drop-zone:hover,
    .upload-drop-zone.drag-over {
        border-color: var(--icon-online);
        background-color: var(--white);
    }

    & .upload-queue {
        display: flex;
        flex-direction: column;
        gap: 0.62rem;
    }

    & .upload-file {
        border: 1px solid var(--gray-soft);
        border-radius: 0.25rem;
        padding: 0.94rem;
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 0.62rem;
        align-items: center;
    }

    & .upload-file-info {
        display: flex;
        flex-direction: column;
    }

    & .upload-file-name {
        font-weight: bold;
        margin-bottom: 0.31rem;
    }

    & .upload-file-size {
        font-size: 12px;
        color: var(--gray-text);
    }

    & .upload-progress {
        width: 12.5rem;
        height: 1.25rem;
        background: var(--white);
        border-radius: 0.62rem;
        overflow: hidden;
    }

    & .upload-progress-bar {
        height: 100%;
        width: 0%;
        background: var(--icon-online);
        transition: width 0.3s;
    }

    & .upload-file-status {
        font-size: 12px;
        color: var(--gray-text);
    }

}

#mail_form {
    & #attach_no {
        float: left;
        padding: 0.31rem 0.62rem 0 0;

        & a, input {
            line-height: 1.88rem;
            padding: 0.5rem 0.5rem 0.5rem 0;
        }
    }

    #attach {
        padding: 1.5em;
        background-color: var(--white);
    }

    & #mail_sent {

        & div {
            font-weight: bold;
            color: var(--black);
            text-align: center;
            font-size: large;
            padding: 1em;
        }
    }

    & .mail_write {
        display: grid;
        grid-template-columns: 80% auto;

        & div:nth-child(2) {
            margin: 0 0 0 auto;
        }

        & .mail_send_button_container {
            background-color: var(--white);
            border-radius: 0.94rem;
            padding: 0.62rem;
            width: 6.25rem;

            /* Report-CTA i mail-send-boksen: fjern den store top-padding (var
               2.81rem) så boksen ikke bliver unødigt høj, og hold lidt luft ned
               til Send-knappen. */
            & .report_container {
                padding: 0.62rem;
                margin-bottom: 0.75rem;
            }
        }

        & .bliv_her {
            text-align: center;
            display: grid;
            grid-template-columns: auto 20px auto auto;

            & div {
                align-content: center;
                margin-top: 0.5rem;
            }
        }

        & .bliv_her_tip {
            font-size: var(--fs-xs);
            text-align: center;
            margin-top: 0.62rem;
        }

        & .mail_send_button {
            /* Fyld containerens content-box (var width:6.25rem = containerens
               YDRE bredde, så knappen flød ud over de 0.62rem padding). */
            width: 100%;
            box-sizing: border-box;
            min-height: 2.94rem;
            padding: 0.55rem 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--blue-dark);
            border-radius: 0.94rem;
            text-align: center;
            cursor: pointer;
            color: var(--white);
            user-select: none;
            transition: background-color 0.12s, opacity 0.12s;

            &:hover {
                background-color: var(--white);
            }
            &[disabled],
            &.is-sending {
                opacity: 0.5;
                cursor: not-allowed;
            }

            & a:link {
                text-decoration: none;
            }
        }

    }

    & #queue {
        margin: 0 0 1.25rem 0;
    }

}

.subscription-teaser {
    border: 1px solid var(--blue-dark);
    padding: 0.5em;

    & .subscription-grid {
        display: grid;
        grid-template-columns: 1fr auto auto auto;
        gap: 0.19rem;
        width: 100%;

        & .header {
            background-color: var(--blue-dark);
            padding: 1em;
            font-weight: bold;
        }

        & .subscription-list-container {
            display: contents;
        }

        & .right {
            text-align: right;
        }

        &>div>div {
            background-color: var(--white);
            padding: 0.5em;
        }
    }
}

/* Mobil action-rail på højre kant af profil-siden (favorit/mail/note/blokér/
   anmeld). Bygges af _profile.#buildMobileActionRail() / #buildMobileOwnActionRail()
   og indsættes i DOM på alle viewports — vi skjuler den blot på desktop hvor
   de klassiske bokse (#profile_favorites osv.) er synlige i stedet. */
#bf_profile_action_rail {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
    position: fixed;
    right: 0;
    top: 14vh;
    bottom: auto;
    transform: none;
    z-index: 60;
    padding: 0.5em;
    background-color: var(--white);
    border: 1px solid var(--blue-dark);
    border-right: none;
    border-radius: 0.19rem 0 0 0.19rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;

    & > .bf-profile-action {
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        border: none;
        background: var(--trans-a00);
        color: var(--surface-dark);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        box-shadow: none;
        transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;

        & > div[data-auto="icon"] {
            display: flex;
            width: 1.25rem;
            height: 1.25rem;

            &[data-icon="report"] svg {
                padding: 0;
            }
        }

        & svg {
            width: 1.25rem;
            height: 1.25rem;
            display: block;
        }

        &:active {
            transform: scale(0.92);
            background: var(--trans-a10);
        }

        &.is-active {
            /* Favorit-aktiv = gul stjerne. */
            color: var(--orange);
        }

        &#bf_pa_block,
        &#bf_pa_unblock {
            color: var(--brand-pink);
        }

        &#bf_pa_mail {
            color: var(--black);
        }

        /* Note-knap med eksisterende note: gul prik i øverste højre hjørne. */
        &#bf_pa_note.has-note {
            position: relative;

            &::after {
                content: '';
                position: absolute;
                top: 0;
                right: 0;
                width: 0.69rem;
                height: 0.69rem;
                border-radius: 50%;
                background: var(--orange);
                border: 1px solid var(--white);
            }
        }
    }

    @media (min-width: 64em) {
        display: none;
    }
}
