/* Mobile navigation stays separate from the compiled design system so its cascade follows room-refinement.css. */
.mobile-account-overlay { display: none; }

@media (max-width: 1023px) {
  html, body, .app-shell, .app-frame { overflow-x: clip; }
  .mobile-nav { position: fixed; z-index: 901; inset: 0; display: block; min-height: 0; border: 0; background: transparent; padding: calc(8px + env(safe-area-inset-top)) 12px 0; box-shadow: none; pointer-events: none; }
  .mobile-nav-bar { display: flex; width: max-content; align-items: center; gap: 8px; pointer-events: auto; }
  .mobile-nav-brand, .mobile-nav-menu-toggle, .mobile-nav-drawer-close { display: grid; width: 44px; min-width: 44px; height: 44px; min-height: 44px; place-items: center; border: 1px solid rgb(255 255 255 / .78); border-radius: var(--radius-control); background: rgb(255 255 255 / .84); padding: 0; box-shadow: 0 6px 18px rgb(46 81 100 / .09), inset 0 1px 0 rgb(255 255 255 / .96); }
  .mobile-nav-brand img { display: block; width: 44px; height: 44px; object-fit: contain; border-radius: var(--radius-control); }
  .mobile-nav-menu-toggle .ui-icon, .mobile-nav-drawer-close .ui-icon { width: 19px; height: 19px; filter: var(--icon-filter-default); }
  .mobile-nav-scrim { position: fixed; z-index: 901; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0,0,0,0.45); opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms step-end; }
  .mobile-nav-drawer { position: fixed; z-index: 902; top: 0; bottom: 0; left: 0; display: grid; width: min(300px, 82vw); min-width: 0; height: 100dvh; grid-template-rows: auto minmax(0, 1fr) auto; overflow-y: auto; border: 1px solid rgb(255 255 255 / .82); border-radius: 0 var(--radius-surface) var(--radius-surface) 0; background: var(--white); box-shadow: 20px 0 48px rgb(31 55 68 / .18), inset 0 1px 0 rgb(255 255 255 / .98); padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); opacity: 0; pointer-events: none; transform: translateX(calc(-100% - 16px)); visibility: hidden; transition: transform 220ms cubic-bezier(.2, .75, .2, 1), opacity 170ms ease, visibility 220ms step-end; }
  .mobile-nav.is-open .mobile-nav-scrim { z-index: 901; opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 180ms ease; }
  .mobile-nav.is-open .mobile-nav-drawer { z-index: 902; opacity: 1; pointer-events: auto; transform: translateX(0); visibility: visible; transition: transform 220ms cubic-bezier(.2, .75, .2, 1), opacity 170ms ease; }
  .mobile-nav-drawer-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; padding: 0 0 14px; }
  .mobile-nav-drawer-heading > img { display: block; width: 94px; height: 28px; object-fit: contain; object-position: left center; }
  .mobile-nav-drawer-heading > span, .mobile-nav-label { margin: 0; color: var(--slate-4); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-nav-drawer, .mobile-nav-drawer button { color: var(--ink); opacity: 1; }
  .mobile-nav-drawer-body { display: grid; align-content: start; gap: 8px; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
  .mobile-nav-new-room, .mobile-nav-link { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 10px; justify-content: flex-start; text-align: left; }
  .mobile-nav-new-room { min-height: 42px; margin-bottom: 16px; justify-content: center; border: 1px solid var(--purple-1); border-radius: var(--radius-interactive); background: var(--white); padding: 0 12px; color: var(--purple-1); font-size: 13px; font-weight: 600; }
  .mobile-nav-new-room:hover, .mobile-nav-new-room:focus-visible { background: var(--purple-9); color: var(--purple-1); }
  .mobile-nav-link { border: 0; border-radius: var(--radius-interactive); background: transparent; padding: 10px; color: var(--slate-3); font: inherit; font-size: 14px; font-weight: 650; }
  .mobile-nav-link > span { display: block; color: var(--ink); opacity: 1; }
  .mobile-nav-link[aria-current="page"] { position: relative; border: 0; background: color-mix(in srgb, var(--purple-9) 56%, transparent); box-shadow: none; color: var(--purple-1); }
  .mobile-nav-link[aria-current="page"] > span { color: var(--purple-1); }
  .mobile-nav-link[aria-current="page"]::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 2px; border-radius: 2px; background: var(--purple-1); content: ""; }
  .mobile-nav-link[aria-current="page"]::after { display: none; }
  .mobile-nav-link .ui-icon, .mobile-nav-new-room .ui-icon { width: 18px; height: 18px; filter: var(--icon-filter-default); }
  .mobile-nav-link[aria-current="page"] .ui-icon { filter: var(--icon-filter-active); }
  .mobile-nav-rooms { margin-top: 10px; border-top: 1px solid rgb(96 110 117 / .12); padding-top: 10px; }
  .mobile-nav-rooms-link, .mobile-nav-rooms-link[aria-current="page"] { min-height: 34px; background: transparent; color: var(--ink); padding: 4px 10px; font-size: 15px; font-weight: 700; }
  .mobile-nav-room-groups { display: grid; gap: 14px; margin-top: 10px; }
  .mobile-nav-room-group { display: grid; gap: 4px; }
  .mobile-nav-room-group-heading { display: flex; min-height: 28px; align-items: center; justify-content: space-between; padding: 0 10px; color: var(--slate-4); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .mobile-nav-room-group-title { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
  .mobile-nav-room-group-title .ui-icon { width: 14px; height: 14px; filter: var(--icon-filter-default); }
  .mobile-nav-room-group-heading b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 999px; background: var(--slate-11); color: var(--slate-5); font-size: 11px; font-weight: 600; text-align: right; }
  .mobile-nav-recent-rooms { display: grid; gap: 2px; }
  .mobile-nav-recent-room { display: grid; width: 100%; min-width: 0; min-height: 40px; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; border: 0; border-radius: var(--radius-interactive); background: transparent; padding: 7px 10px; color: var(--ink); font: inherit; font-size: 13px; font-weight: 550; text-align: left; }
  .mobile-nav-recent-room.is-active { position: relative; background: color-mix(in srgb, var(--purple-9) 64%, transparent); color: var(--purple-1); }
  .mobile-nav-recent-room.is-active::before { position: absolute; top: 7px; bottom: 7px; left: 0; width: 2px; border-radius: 2px; background: var(--purple-1); content: ""; }
  .mobile-nav-recent-room.is-active .rail-glyph { background: var(--purple-1); color: var(--white); }
  .mobile-nav-recent-room > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-recent-room .rail-glyph { width: 24px; height: 24px; font-size: 9px; }
  .mobile-nav-drawer-footer { min-width: 0; border-top: 1px solid rgb(96 110 117 / .12); padding-top: 14px; }
  .mobile-nav-drawer-footer .mobile-nav-label { display: block; margin-bottom: 8px; }
  .mobile-nav-account { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); align-items: center; gap: 8px; }
  .mobile-nav-account .notifications, .mobile-nav-account .tier-control, .mobile-nav-account .user-menu { position: static; display: block; min-width: 0; }
  .mobile-nav-account :is(.notifications-toggle, .user-tier-badge, .user-control) { display: grid; width: 100%; min-width: 44px; height: 44px; min-height: 44px; place-items: center; border: 1px solid rgb(96 110 117 / .14); border-radius: var(--radius-interactive); background: rgb(255 255 255 / .7); padding: 0; }
  .mobile-nav-account .user-control { grid-template-columns: 30px minmax(0, 1fr); justify-content: start; gap: 9px; padding: 0 10px; text-align: left; }
  .mobile-nav-account .user-control-name { display: block; overflow: hidden; color: var(--slate-2); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-account .user-control-avatar { display: grid; width: 30px; height: 30px; place-items: center; }
  .mobile-account-overlay { position: fixed; z-index: 904; right: auto; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; display: block; width: min(280px, calc(100vw - 28px)); pointer-events: none; }
  .mobile-account-overlay > :is(.notifications-panel, .tier-performance-popover, .user-menu-panel) { position: absolute !important; top: auto !important; right: 0 !important; bottom: 0 !important; left: auto !important; display: block; width: 100% !important; max-width: none; max-height: calc(100dvh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow: auto; opacity: 1; pointer-events: auto; transform: none; }
  .mobile-account-overlay > :is(.notifications-panel, .tier-performance-popover, .user-menu-panel) { transform-origin: bottom left; }
  .mobile-account-overlay .notifications-panel { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mobile-account-overlay .notifications-panel-header { border: 1px solid rgb(96 110 117 / .28); padding: 17px 18px 14px; }
  .mobile-account-overlay .notifications-list { border: 1px solid rgb(96 110 117 / .28); padding: 7px; }
  @media (prefers-reduced-motion: no-preference) {
    .mobile-nav.is-open .mobile-nav-drawer-body > *, .mobile-nav.is-open .mobile-nav-drawer-footer { animation: mobile-nav-item-in 240ms cubic-bezier(.2, .75, .2, 1) both; }
    .mobile-nav.is-open .mobile-nav-drawer-body > :nth-child(2) { animation-delay: 25ms; }
    .mobile-nav.is-open .mobile-nav-drawer-body > :nth-child(3) { animation-delay: 50ms; }
    .mobile-nav.is-open .mobile-nav-drawer-body > :nth-child(4) { animation-delay: 75ms; }
    .mobile-account-overlay > :is(.notifications-panel, .tier-performance-popover, .user-menu-panel) { animation: mobile-account-surface-in 220ms cubic-bezier(.2, .75, .25, 1) both; }
  }
    body:has(.modal-backdrop:not([hidden])) .mobile-nav,
    body:has(.modal-backdrop:not([hidden])) .mobile-account-overlay {
        visibility: hidden;
    }
}

@keyframes mobile-nav-item-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes mobile-account-surface-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 767px) {
  .page-wrap, .page-wrap.narrow { padding-top: calc(68px + env(safe-area-inset-top)); }
  .room-coach-page { padding-top: calc(68px + env(safe-area-inset-top)); }
  .room-coach-page .room-header.is-collapsed, .room-page .room-header.is-collapsed { display: grid; min-height: 110px !important; gap: 6px; padding: 8px 56px 8px 10px; }
  .room-coach-page .room-header.is-collapsed .room-header-copy, .room-page .room-header.is-collapsed .room-header-copy { display: flex; min-width: 0; min-height: 28px; align-items: center; padding: 0; }
  .room-coach-page .room-header.is-collapsed .room-title, .room-page .room-header.is-collapsed .room-title { display: block; overflow: hidden; font-size: 18px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .room-coach-page .room-header.is-collapsed .room-mode, .room-page .room-header.is-collapsed .room-mode, .room-coach-page .room-header.is-collapsed .room-context-row, .room-page .room-header.is-collapsed .room-context-row { display: none; }
  .room-coach-page .room-header.is-collapsed .room-header-chair, .room-page .room-header.is-collapsed .room-header-chair { min-height: 58px !important; grid-template-columns: 58px minmax(0, 1fr); overflow: visible; }
  .room-coach-page .room-header.is-collapsed .room-header-avatar, .room-page .room-header.is-collapsed .room-header-avatar { width: 58px; height: 58px; min-height: 58px !important; border-radius: 50%; }
  .room-coach-page .room-header.is-collapsed .room-header-chair-content, .room-page .room-header.is-collapsed .room-header-chair-content { min-height: 58px; grid-template-columns: minmax(0, 1fr) 160px !important; grid-template-rows: 58px !important; gap: 8px; padding: 0 0 0 10px; }
  .room-coach-page .room-header.is-collapsed .room-header-persona, .room-page .room-header.is-collapsed .room-header-persona { align-self: center; min-width: 0; }
  .room-coach-page .room-header.is-collapsed .room-header-persona strong, .room-page .room-header.is-collapsed .room-header-persona strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .room-coach-page .room-header.is-collapsed .room-header-persona span, .room-page .room-header.is-collapsed .room-header-persona span, .room-coach-page .room-header.is-collapsed .room-header-schedule, .room-page .room-header.is-collapsed .room-header-schedule { display: none; }
  .room-coach-page .room-header.is-collapsed .room-header-rehearsal, .room-page .room-header.is-collapsed .room-header-rehearsal { display: block !important; min-width: 0; grid-column: 2; grid-row: 1; }
  .room-coach-page .room-header.is-collapsed .room-header-actions, .room-page .room-header.is-collapsed .room-header-actions { display: grid !important; width: 104px; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .room-coach-page .room-header.is-collapsed .room-header-actions .button, .room-page .room-header.is-collapsed .room-header-actions .button { min-width: 0; min-height: 44px; padding: 5px; font-size: 10px; line-height: 1.1; }
  .room-coach-page .room-header.is-collapsed .room-header-actions .button span, .room-page .room-header.is-collapsed .room-header-actions .button span { display: none; }
  .room-coach-page .room-header.is-collapsed .room-header-actions .button:only-child, .room-page .room-header.is-collapsed .room-header-actions .button:only-child { grid-column: 1 / -1; }
  .room-coach-page .room-header.is-collapsed .room-header-actions .button:only-child span, .room-page .room-header.is-collapsed .room-header-actions .button:only-child span { display: inline; }
  .room-coach-page .room-section-links, .room-page .room-section-links { min-height: 50px; padding: 5px 6px; }
  .room-coach-page .room-section-tabs button[aria-selected="true"]::after, .room-page .room-section-tabs button[aria-selected="true"]::after { right: 0; bottom: 0; left: 0; height: 2px; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) { .mobile-nav-scrim, .mobile-nav-drawer { transition: none !important; } }
@media (max-width: 1023px) and (prefers-reduced-transparency: reduce) { .mobile-nav-brand, .mobile-nav-menu-toggle, .mobile-nav-drawer-close, .mobile-nav-drawer, .mobile-nav-account :is(.notifications-toggle, .user-tier-badge, .user-control) { background: var(--white); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* =========================================
   MOBILE NAV DRAWER OPEN STATE
   ========================================= */

@media (max-width: 1023px) {

    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: #ffffff;
        z-index: 1200;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

        .mobile-nav-drawer.is-open {
            transform: translateX(0) !important;
        }


    .mobile-nav-scrim {
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.28);
        z-index: 1190;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    body.mobile-nav-open .mobile-nav-scrim {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


    body.mobile-nav-open {
        overflow: hidden;
    }

}

