/* Shared desktop-only sidebar and profile drawer for desktop preview routes. */
#desktop-preview-frame {
    --desktop-side-nav-width: 220px;
}

#desktop-preview-frame > .bottom-nav-responsive {
    width: var(--desktop-side-nav-width) !important;
    padding: 108px 12px 20px !important;
    gap: 6px !important;
    background: #303030 !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .10) !important;
}

#desktop-preview-frame > .bottom-nav-responsive::before {
    top: 30px !important;
    left: 24px !important;
    width: 172px !important;
    height: 52px !important;
    background-size: contain !important;
    background-position: center !important;
}

#desktop-preview-frame > .bottom-nav-responsive > a,
#desktop-preview-frame > .bottom-nav-responsive > button {
    min-height: 50px !important;
    height: 50px !important;
    padding: 0 14px !important;
    gap: 12px !important;
    border-radius: 12px !important;
    color: rgba(255,255,255,.80) !important;
    transition: background-color .15s ease, color .15s ease, transform .15s ease !important;
}

#desktop-preview-frame > .bottom-nav-responsive > a:hover,
#desktop-preview-frame > .bottom-nav-responsive > button:hover {
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
}

#desktop-preview-frame > .bottom-nav-responsive > a.text-red-600,
#desktop-preview-frame > .bottom-nav-responsive > button.text-red-600,
#desktop-preview-frame > .bottom-nav-responsive > [aria-current="page"] {
    background: var(--ui-brand-action, #d7181c) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(149, 12, 15, .24) !important;
}

#desktop-preview-frame > .bottom-nav-responsive .desktop-side-nav__icon,
#desktop-preview-frame > .bottom-nav-responsive > a > i,
#desktop-preview-frame > .bottom-nav-responsive > button > i {
    flex: 0 0 22px;
    width: 22px !important;
    margin: 0 !important;
    color: currentColor !important;
    font-size: 18px !important;
    line-height: 1 !important;
    text-align: center;
}

#desktop-preview-frame > .bottom-nav-responsive > a > span,
#desktop-preview-frame > .bottom-nav-responsive > button > span {
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
}

/* Profile right-side sheet. */
.desktop-profile-sheet-overlay {
    position: fixed;
    z-index: 118;
    top: 76px;
    right: 0;
    bottom: 0;
    left: 220px;
    background: rgba(25, 25, 25, .24);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    backdrop-filter: blur(2px);
}

.desktop-profile-sheet {
    position: fixed;
    z-index: 119;
    top: 76px;
    right: 0;
    bottom: 0;
    width: min(500px, calc(100vw - 220px));
    display: grid;
    grid-template-rows: 62px minmax(0, 1fr);
    overflow: hidden;
    border-radius: 24px 0 0 24px;
    background: #fff;
    box-shadow: -18px 0 48px rgba(25, 25, 25, .18);
    transform: translateX(104%);
    transition: transform .22s ease;
}

body.desktop-profile-sheet-open .desktop-profile-sheet-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.desktop-profile-sheet-open .desktop-profile-sheet {
    transform: translateX(0);
}

.desktop-profile-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 0 18px 0 22px;
    border-bottom: 1px solid var(--ui-line, #ececec);
    background: #fff;
}

.desktop-profile-sheet__title {
    margin: 0;
    color: var(--ui-text, #333333);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
}

.desktop-profile-sheet__close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ui-text-secondary, #636363);
    font-size: 15px;
    cursor: pointer;
}

.desktop-profile-sheet__close:hover {
    background: var(--ui-surface-muted, #f6f6f6);
    color: var(--ui-text, #333333);
}

.desktop-profile-sheet__body {
    position: relative;
    min-height: 0;
    background: var(--ui-page-bg, #f6f6f6);
}

.desktop-profile-sheet__loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ui-text-secondary, #636363);
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.desktop-profile-sheet.is-loaded .desktop-profile-sheet__loader {
    display: none;
}

.desktop-profile-sheet__frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: var(--ui-page-bg, #f6f6f6);
}

#header-profile-avatar[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(215, 24, 28, .12) !important;
}

@media (max-width: 1180px) {
    #desktop-preview-frame {
        --desktop-side-nav-width: 82px;
    }

    #desktop-preview-frame.phone-frame {
        grid-template-columns: 82px minmax(0, 1fr) !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive {
        width: 82px !important;
        padding: 84px 12px 16px !important;
        align-items: center !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive::before {
        top: 24px !important;
        left: 17px !important;
        width: 48px !important;
        height: 42px !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive > a,
    #desktop-preview-frame > .bottom-nav-responsive > button {
        width: 50px !important;
        min-width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        justify-content: center !important;
        gap: 0 !important;
        border-radius: 14px !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive > a > span,
    #desktop-preview-frame > .bottom-nav-responsive > button > span,
    #desktop-preview-frame > .bottom-nav-responsive .bottom-nav-fab-label {
        display: none !important;
    }

    .desktop-profile-sheet-overlay { left: 82px; }
    .desktop-profile-sheet { width: min(480px, calc(100vw - 82px)); }
}

@media (max-width: 930px) {
    #desktop-preview-frame {
        --desktop-side-nav-width: 72px;
    }

    #desktop-preview-frame.phone-frame {
        grid-template-columns: 72px minmax(0, 1fr) !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive {
        width: 72px !important;
        padding: 76px 10px 14px !important;
    }

    #desktop-preview-frame > .bottom-nav-responsive::before {
        top: 20px !important;
        left: 14px !important;
        width: 44px !important;
        height: 38px !important;
    }

    .desktop-schedule-preview-body #desktop-preview-frame > [data-global-modal-header],
    .desktop-myactivities-preview-body #desktop-preview-frame > [data-global-modal-header],
    .desktop-mypayments-preview-body #desktop-preview-frame > [data-global-modal-header] {
        left: 72px !important;
    }

    .desktop-schedule-preview-body #desktop-preview-frame > #main-scroll,
    .desktop-myactivities-preview-body #desktop-preview-frame > #view-list,
    .desktop-mypayments-preview-body #desktop-preview-frame > main {
        left: 72px !important;
    }

    .desktop-schedule-preview-body #desktop-preview-frame > .compact-header {
        left: 94px !important;
        right: 20px !important;
    }

    .desktop-myactivities-preview-body #desktop-preview-frame > .myactivities-makeup-alert,
    .desktop-mypayments-preview-body #desktop-preview-frame > #payments-makeup-section {
        left: 94px !important;
    }

    .desktop-schedule-preview-body .bottom-sheet-overlay,
    .desktop-myactivities-preview-body .bottom-sheet-overlay,
    .desktop-mypayments-preview-body .bottom-sheet-overlay,
    body:has(#desktop-preview-frame) .bottom-sheet-overlay {
        left: 72px !important;
    }

    .desktop-profile-sheet-overlay { left: 72px; }
    .desktop-profile-sheet { width: min(470px, calc(100vw - 72px)); }
}

@media (prefers-reduced-motion: reduce) {
    #desktop-preview-frame > .bottom-nav-responsive > a,
    #desktop-preview-frame > .bottom-nav-responsive > button,
    .desktop-profile-sheet-overlay,
    .desktop-profile-sheet {
        transition: none !important;
    }
}

/* Ultrawide desktop rail: keep work content readable instead of stretching to the monitor edges. */
#desktop-preview-frame {
    --desktop-content-max-width: 1440px;
}

@media (min-width: 1600px) {
    #desktop-preview-frame > [data-global-modal-header],
    #desktop-preview-frame > main .desktop-preview-page > [data-global-modal-header] {
        padding-right: max(40px, calc((100vw - 220px - var(--desktop-content-max-width)) / 2)) !important;
    }

    #desktop-preview-frame #header-greeting {
        left: max(40px, calc((100vw - 220px - var(--desktop-content-max-width)) / 2)) !important;
    }

    .desktop-schedule-preview-body #desktop-preview-frame > .compact-header {
        left: calc(50vw + 110px) !important;
        right: auto !important;
        width: min(var(--desktop-content-max-width), calc(100vw - 284px)) !important;
        transform: translateX(-50%);
    }

    .desktop-schedule-preview-body #main-scroll > .desktop-schedule-week-grid {
        width: min(var(--desktop-content-max-width), 100%);
        margin-right: auto;
        margin-left: auto;
    }

    .desktop-myactivities-preview-body #desktop-preview-frame > .myactivities-makeup-alert {
        left: calc(50vw + 110px) !important;
        right: auto !important;
        width: min(1340px, calc(100vw - 284px)) !important;
        transform: translateX(-50%);
    }

    .desktop-mypayments-preview-body #desktop-preview-frame > #payments-makeup-section {
        left: calc(50vw + 110px) !important;
        right: auto !important;
        width: min(1320px, calc(100vw - 284px)) !important;
        transform: translateX(-50%);
    }
}
