/* Production geometry and regression guard. Keep one deterministic desktop sheet contract. */
@media (min-width: 931px) {
    body.desktop-preview-shell .bottom-sheet:not(.desktop-sheet-centered):not(#desktop-guided-filter-sheet) {
        top: var(--desktop-preview-header-height, 76px) !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        width: min(500px, calc(100vw - var(--desktop-preview-sidebar-width, 220px) - 24px)) !important;
        height: calc(100vh - var(--desktop-preview-header-height, 76px)) !important;
        max-height: calc(100vh - var(--desktop-preview-header-height, 76px)) !important;
        translate: 0 0 !important;
    }

    /* These are dialogs, not workspaces. They must never become right drawers. */
    body.desktop-preview-shell #payments-pass-purchase-sheet,
    body.desktop-preview-shell #payments-addon-deposit-purchase-sheet,
    body.desktop-preview-shell #bottom_sheet_absence_submit {
        top: calc(var(--desktop-preview-header-height, 76px) + (100vh - var(--desktop-preview-header-height, 76px)) / 2) !important;
        right: auto !important;
        bottom: auto !important;
        left: calc(var(--desktop-preview-sidebar-width, 220px) + (100vw - var(--desktop-preview-sidebar-width, 220px)) / 2) !important;
        width: min(640px, calc(100vw - var(--desktop-preview-sidebar-width, 220px) - 64px)) !important;
        height: auto !important;
        max-height: calc(100vh - var(--desktop-preview-header-height, 76px) - 48px) !important;
        translate: -50% -50% !important;
        transform: none !important;
        border-radius: 18px !important;
        overflow: hidden !important;
    }

    body.desktop-preview-shell #desktop-guided-filter-sheet {
        top: calc(var(--desktop-preview-header-height, 76px) + (100vh - var(--desktop-preview-header-height, 76px)) / 2) !important;
        left: calc(var(--desktop-preview-sidebar-width, 220px) + (100vw - var(--desktop-preview-sidebar-width, 220px)) / 2) !important;
        right: auto !important;
        bottom: auto !important;
        width: min(680px, calc(100vw - var(--desktop-preview-sidebar-width, 220px) - 64px)) !important;
        height: auto !important;
        max-height: calc(100vh - var(--desktop-preview-header-height, 76px) - 48px) !important;
        translate: -50% -50% !important;
        transform: scale(.985) !important;
    }
    body.desktop-preview-shell #desktop-guided-filter-sheet.active,
    body.desktop-preview-shell #desktop-guided-filter-sheet.open { transform: scale(1) !important; }

    /* Browser scrollbar is visible consistently on every desktop section. */
    body.desktop-preview-shell #main-scroll {
        overflow-y: auto !important;
        scrollbar-width: thin !important;
        scrollbar-color: #b8b8b8 transparent !important;
    }
    body.desktop-preview-shell #main-scroll::-webkit-scrollbar { width: 8px !important; }
    body.desktop-preview-shell #main-scroll::-webkit-scrollbar-thumb { background: #b8b8b8 !important; border-radius: 999px !important; }

    /* Pending applications are ordinary cards on desktop, never a translated card stack. */
    .desktop-mypayments-preview-body .p-mypayments-process-card.status-payment {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        margin: 0 0 12px !important;
        z-index: auto !important;
    }
    .desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-card-body {
        min-height: 0 !important;
        overflow: visible !important;
    }
}

/* Detail content owns the coloured deposit header: no blank canonical strip above it. */
#payments-detail-sheet.has-deposit-banner .bottom-sheet-header,
#payments-detail-sheet.has-additional-deposit-parts .bottom-sheet-header,
#payments-detail-sheet.has-pass-pool-entrances .bottom-sheet-header {
    position: absolute !important;
    inset: 0 0 auto 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
    z-index: 30 !important;
}
#payments-detail-sheet.has-deposit-banner .bottom-sheet-header > .px-6,
#payments-detail-sheet.has-additional-deposit-parts .bottom-sheet-header > .px-6,
#payments-detail-sheet.has-pass-pool-entrances .bottom-sheet-header > .px-6 {
    position: absolute !important;
    top: 8px !important;
    right: 12px !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

/* Makeup extension follows the same orange urgency language as the nearest deadline. */
[data-makeup-extension] {
    grid-column: 2 / -1 !important;
    justify-self: start !important;
    margin-top: 2px !important;
    border: 0 !important;
    background: transparent !important;
    color: #c56a11 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

/* Guest-specific finish. */
html.panel-public-guest .panel-public-guest-bar__login {
    border-color: #258568 !important;
    background: #258568 !important;
    color: #fff !important;
}
html.panel-public-guest #filters-container,
html.panel-public-guest #applied-filters { visibility: visible !important; }
html.panel-public-guest .panel-public-guest-field.is-invalid input,
html.panel-public-guest .panel-public-guest-sex.is-invalid span,
html.panel-public-guest .panel-public-guest-consent.is-invalid { border-color: #d7181c !important; }

@media (min-width: 931px) {
    html.panel-public-guest body.desktop-schedule-preview-body .bottom-sheet.desktop-sheet-centered,
    html.panel-public-guest body.desktop-schedule-preview-body .bottom-sheet.desktop-sheet-signup,
    html.panel-public-guest body.desktop-schedule-preview-body #bottom_sheet_activity_detail:has([data-activity-detail-view="form"]:not(.hidden)) {
        top: calc(76px + (100vh - 76px) / 2) !important;
        right: auto !important;
        bottom: auto !important;
        left: 50% !important;
        width: min(560px, calc(100vw - 64px)) !important;
        height: auto !important;
        max-height: calc(100vh - 112px) !important;
        translate: -50% -50% !important;
        transform: none !important;
        border-radius: 18px !important;
    }
    html.panel-public-guest body.desktop-schedule-preview-body #desktop-guided-filter-sheet {
        top: calc(76px + (100vh - 76px) / 2) !important;
        left: 50% !important;
        height: auto !important;
        max-height: calc(100vh - 112px) !important;
        translate: -50% -50% !important;
    }
}

/* Pending application card: fixed information/action grid; no content overlap. */
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment {
    border: 0 !important;
    border-radius: var(--radius-card, 16px) !important;
    background: var(--ui-surface, #fff) !important;
    box-shadow: var(--shadow-card) !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-card-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 12px !important;
    row-gap: 6px !important;
    padding: 16px !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-card-head {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    min-width: 0 !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-details-toggle { display: none !important; }
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-details,
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-details.is-hidden {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-obligation-date {
    grid-column: 1 !important;
    grid-row: 2 !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-description {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin: 0 !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-cancel,
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-pay-button {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-cancel { grid-row: 1 !important; }
.desktop-mypayments-preview-body .p-mypayments-process-card.status-payment .p-mypayments-pending-pay-button { grid-row: 2 !important; }

/* Final specificity guard against legacy desktop-preview-sheet-short transforms. */
@media (min-width: 931px) {
    body.desktop-preview-shell:has(#desktop-preview-frame) #payments-pass-purchase-sheet.bottom-sheet,
    body.desktop-preview-shell:has(#desktop-preview-frame) #payments-addon-deposit-purchase-sheet.bottom-sheet,
    body.desktop-preview-shell:has(#desktop-preview-frame) #bottom_sheet_absence_submit.bottom-sheet {
        position: fixed !important;
        top: calc(var(--desktop-preview-header-height, 76px) + (100vh - var(--desktop-preview-header-height, 76px)) / 2) !important;
        right: auto !important;
        bottom: auto !important;
        left: calc(var(--desktop-preview-sidebar-width, 220px) + (100vw - var(--desktop-preview-sidebar-width, 220px)) / 2) !important;
        width: min(640px, calc(100vw - var(--desktop-preview-sidebar-width, 220px) - 64px)) !important;
        height: auto !important;
        max-height: calc(100vh - var(--desktop-preview-header-height, 76px) - 48px) !important;
        translate: -50% -50% !important;
        transform: none !important;
        border-radius: 18px !important;
    }

    body.desktop-preview-shell:has(#desktop-preview-frame) #desktop-guided-filter-sheet.bottom-sheet {
        position: fixed !important;
        top: calc(var(--desktop-preview-header-height, 76px) + (100vh - var(--desktop-preview-header-height, 76px)) / 2) !important;
        right: auto !important;
        bottom: auto !important;
        left: calc(var(--desktop-preview-sidebar-width, 220px) + (100vw - var(--desktop-preview-sidebar-width, 220px)) / 2) !important;
        translate: -50% -50% !important;
    }
}

/* Activity details stay in the desktop right drawer. Signup remains centered. */
@media (min-width: 931px) {
    body.desktop-preview-shell #bottom_sheet_activity_detail.bottom-sheet.desktop-sheet-centered:not(.desktop-sheet-signup) {
        position: fixed !important;
        top: var(--desktop-preview-header-height, 76px) !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        width: min(500px, calc(100vw - var(--desktop-preview-sidebar-width, 220px) - 24px)) !important;
        height: calc(100vh - var(--desktop-preview-header-height, 76px)) !important;
        max-height: calc(100vh - var(--desktop-preview-header-height, 76px)) !important;
        translate: 0 0 !important;
        transform: translateY(0) !important;
        border-radius: 24px 0 0 0 !important;
    }
}
