/* The live account menu becomes a right drawer through tablet widths. */
@media (max-width:1050px) {
  body #accountMobileSheet { --account-menu-paper:var(--workspace-chrome,#f2f4f6); }
  body #accountMobileSheet .mobile-menu-shell {
    width:min(88vw,280px); border-radius:0; border-left:1px solid #e3e9ef;
    background:var(--account-menu-paper); box-shadow:none;
  }
  body #accountMobileSheet .mobile-menu-scrim { background:#112d4859; }
  body #accountMobileSheet .mobile-menu-header {
    min-height:72px; padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 12px 16px;
    gap:10px; border-bottom:1px solid #e3e9ef; background:var(--account-menu-paper);
  }
  body #accountMobileSheet .mobile-menu-header.has-menu-content { min-height:72px; }
  body #accountMobileSheet .has-menu-content .mobile-menu-header-copy > :is(.mobile-menu-title,.mobile-menu-caption) { display:none; }
  body #accountMobileSheet .mobile-menu-close {
    border:1px solid #e3e9ef; border-radius:8px; background:#fff; color:#64748b; box-shadow:none;
  }
  body #accountMobileSheet .mobile-menu-close:hover { background:#f4f6fb; color:#334155; border-color:#d5dce7; }
  body #accountMobileSheet .mobile-menu-body { display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:0; background:var(--account-menu-paper); }
  body #accountMobileSheet #userMenuPanel {
    --account-menu-paper:var(--workspace-chrome,#f2f4f6); --account-menu-glow:transparent;
    position:static; inset:auto; display:flex; flex-direction:column; flex:1 1 auto; box-sizing:border-box;
    min-width:0; min-height:0; width:100%; max-width:none; max-height:none;
    margin:0; padding:24px 14px max(16px,env(safe-area-inset-bottom)); gap:0;
    border:0; border-radius:0; box-shadow:none; overflow:hidden; transform:none;
    background:var(--account-menu-paper); background-image:none;
  }
  body #accountMobileSheet :is(#userMenuIdentity,#guestAccountActions) {
    box-sizing:border-box; width:100%; min-width:0; padding:0; margin:0; border:0;
  }
  body #accountMobileSheet #userMenuIdentity { display:grid; grid-template-columns:40px minmax(0,1fr); align-items:center; gap:10px; }
  body #accountMobileSheet #userMenuIdentity .nav-user-avatar { width:40px; height:40px; }
  body #accountMobileSheet #userMenuIdentityName {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
    overflow:hidden; overflow-wrap:anywhere; white-space:normal; font-size:15px; line-height:19px;
  }
  body #accountMobileSheet #userMenuIdentityRole { font-size:12px; line-height:16px; }
  body #accountMobileSheet #guestAccountActions {
    display:grid; grid-template-columns:minmax(0,3fr) 1px minmax(0,2fr); align-items:center; gap:0;
  }
  body #accountMobileSheet #guestAccountActions a {
    min-height:44px; padding:6px 2px; font-size:12px; line-height:16px;
    white-space:nowrap; text-align:center; border-radius:6px;
  }
  body #accountMobileSheet #guestAccountActions .guest-account-login {
    display:grid; grid-template-columns:18px max-content 18px; justify-content:center; column-gap:5px;
    font-size:13px; font-weight:650;
  }
  body #accountMobileSheet #guestAccountActions .guest-account-login-icon { display:block; width:18px; height:18px; }
  body #accountMobileSheet #guestAccountActions a:is(:hover,:focus-visible) { background:#f6f7fc; color:var(--outlo-brand-text,#4338ca); }
  body #accountMobileSheet #userMenuScrollFrame,
  body #accountMobileSheet #userMenuScroll { flex:1 1 auto; min-height:0; }
  body #accountMobileSheet #userMenuScroll { gap:16px; scroll-padding-block:22px 50px; }
  body #accountMobileSheet #userMenuScroll > .user-menu-group { display:grid; gap:3px; }
  body #accountMobileSheet #userMenuScroll .user-menu-group-title {
    display:block; margin:0 12px 5px; padding:0; border:0;
    color:#7b8897; font-size:11px; font-weight:600; line-height:1.5; text-transform:uppercase;
  }
  body #accountMobileSheet #menuWorkspaceLabel { display:none !important; }
  body #accountMobileSheet #userMenuScrollFrame::before,
  body #accountMobileSheet #userMenuScrollFrame::after { content:""; }
  body #accountMobileSheet #userMenuScrollFrame::before { height:20px; }
  body #accountMobileSheet #userMenuScrollFrame::after {
    height:48px;
    background:linear-gradient(to bottom,transparent,var(--account-menu-paper) 30%);
  }
  body #accountMobileSheet #userMenuPanel #userMenuScrollHint {
    inset:auto 8px 2px; width:calc(100% - 16px); height:44px; min-height:44px;
    display:none; gap:6px; padding:0 12px;
    border:0; border-radius:0;
    background:transparent; color:#625f86;
    box-shadow:none;
    font-size:12px; font-weight:400; line-height:1.35; touch-action:manipulation;
  }
  body #accountMobileSheet #userMenuPanel #userMenuScrollHint svg { width:12px; height:12px; }
  body #accountMobileSheet #userMenuPanel #userMenuScrollHint:is(:hover,:focus-visible) {
    background:transparent; color:var(--outlo-brand-text,#4338ca); text-decoration:underline; text-underline-offset:3px;
  }
  body #accountMobileSheet #userMenuScrollFrame[data-scroll-after="true"] #userMenuScrollHint:not([hidden]) { display:flex; }
  body #accountMobileSheet #userMenuPanel > :is(.user-menu-identity,.user-menu-footer) { flex:0 0 auto; }
  /* One row treatment for both drawers, including legacy add/promotion overrides. */
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link),
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event) {
    box-sizing:border-box; width:100%; height:auto !important; min-height:44px !important;
    margin:0; padding:9px 12px !important; gap:0 10px !important;
    border:0; border-radius:6px !important; background:transparent;
    color:#4b5a6c; box-shadow:none; transform:none;
    font-family:var(--outlo-font-family,Inter,system-ui,sans-serif); font-size:13px; font-weight:500; line-height:20px;
    text-align:left; text-decoration:none; white-space:normal !important;
    transition:background-color .12s ease,color .12s ease;
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link):not(.active):not([aria-current="page"]):is(:hover,:focus-visible),
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):not(.active):not([aria-current="page"]):is(:hover,:focus-visible) {
    background:#f6f7fc; color:#313a4c; box-shadow:none;
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link):is(.active,[aria-current="page"]),
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):is(.active,[aria-current="page"]) {
    background:linear-gradient(90deg,#eeedff 0%,#f8f8ff 100%); color:var(--outlo-brand-text,#4338ca);
    box-shadow:inset 3px 0 var(--outlo-brand-accent,#4f46e5),0 1px 0 rgb(79 70 229 / .05); font-weight:650;
  }
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):is(.active,[aria-current="page"]) {
    box-shadow:inset 3px 0 var(--outlo-brand-accent,#4f46e5);
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link):focus-visible {
    outline:3px solid var(--outlo-brand-accent,#4f46e5); outline-offset:2px;
  }
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):focus-visible {
    outline:3px solid var(--outlo-brand-accent,#4f46e5); outline-offset:-3px;
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link) .admin-nav-icon,
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event) > .nav-icon {
    display:inline-grid; place-items:center; flex:0 0 18px !important;
    width:18px !important; min-width:18px !important; height:18px !important;
    margin:0; padding:0 !important; border:0; border-radius:0 !important;
    background:transparent; color:#8090a0; box-shadow:none; stroke-width:1.8;
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link):is(.active,[aria-current="page"]) .admin-nav-icon,
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):is(.active,[aria-current="page"]) > .nav-icon {
    color:var(--outlo-brand-accent,#4f46e5);
  }
  body.admin-modern:not(.organizer-modern) .admin-menu .admin-nav-label,
  body #accountMobileSheet #userMenuPanel .menu-item > span:not(.nav-icon):not(.nav-count),
  body #accountMobileSheet #userMenuPanel .menu-add-event-copy > span {
    min-width:0; overflow:visible; text-overflow:clip; white-space:normal;
  }
  body #accountMobileSheet #userMenuPanel .menu-item > .nav-icon > svg { display:block; width:18px; height:18px; }
  /* Hidden counters occupy no grid column, just as in the admin flex rows. */
  body #accountMobileSheet #userMenuPanel .menu-item.has-badge:not(.requires-login) {
    grid-template-columns:18px minmax(0,1fr);
  }
  body #accountMobileSheet #userMenuPanel .menu-item.has-badge:not(.requires-login):has(> .nav-count:not([hidden])) {
    grid-template-columns:18px minmax(0,1fr) auto;
  }
  body #accountMobileSheet #userMenuPanel .feedback-menu-item::before { content:none; }
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event).danger-menu:not(.active):not([aria-current="page"]):is(:hover,:focus-visible) {
    background:#fff1f2; color:#b42336;
  }
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event).danger-menu:not(.active):not([aria-current="page"]):is(:hover,:focus-visible) > .nav-icon { color:#b42336; }
  body #accountMobileSheet #userMenuPanel .user-menu-section-label {
    margin:16px 12px 5px; padding:0; border:0;
    color:#7b8897; font-size:11px; font-weight:600; line-height:1.5; text-transform:uppercase;
  }
  body #accountMobileSheet #userMenuPanel .user-menu-footer {
    margin-top:8px; padding:9px 0 0; border-top:1px solid #e3e9ef; background:var(--account-menu-paper);
  }
}

@media (max-width:640px) {
  body #accountMobileSheet #userMenuPanel { padding:16px 12px max(12px,env(safe-area-inset-bottom)); }
  body #accountMobileSheet #userMenuScroll { gap:10px; }
  body #accountMobileSheet #userMenuScroll > .user-menu-group { gap:1px; }
  body #accountMobileSheet #userMenuScroll .user-menu-group-title { margin-bottom:3px; }
}

/* Signed-out navigation stays compact; signed-in groups keep their hierarchy. */
@media (max-width:1050px) {
  body #userMenu.is-guest #accountMobileSheet .mobile-menu-header {
    min-height:64px; padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px 16px;
    gap:10px;
  }
  body #userMenu.is-guest #accountMobileSheet #userMenuPanel #guestAccountActions {
    grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:8px;
    margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid #e3e9ef;
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions a {
    display:flex; align-items:center; justify-content:center; gap:6px;
    box-sizing:border-box; height:44px; min-height:44px; padding:8px 6px;
    border:1px solid #dfe4eb; border-radius:8px;
    background:transparent; color:#475569;
    font-size:13px; font-weight:500; line-height:20px; text-align:center; text-decoration:none;
    box-shadow:none; transform:none;
    transition:background-color .12s ease,border-color .12s ease,color .12s ease;
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions .guest-account-login {
    background:#fff; border-color:#c7d2fe; color:var(--outlo-brand-text,#4338ca); font-weight:650;
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions .guest-account-login-icon { flex:0 0 18px; color:inherit; }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions .guest-account-divider { display:none; }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions a:is(:hover,:focus-visible) {
    background:#f8fafc; border-color:#cbd5e1; color:#334155; text-decoration:none;
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions .guest-account-login:is(:hover,:focus-visible) {
    background:#f8f9ff; border-color:#a5b4fc; color:var(--outlo-brand-text-hover,#3730a3);
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions a:focus-visible {
    outline:2px solid var(--outlo-brand-accent,#4f46e5); outline-offset:2px;
  }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions a:active { background:#eef1f5; }
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions .guest-account-login:active { background:#eef2ff; }


  body #userMenu.is-guest #accountMobileSheet #userMenuScroll,
  body #userMenu.is-guest #accountMobileSheet #userMenuScroll > .user-menu-group { gap:3px; }
  body #userMenu.is-guest #accountMobileSheet #userMenuScroll .user-menu-group-title { display:none; }
  body #userMenu.is-guest #accountMobileSheet #userMenuScroll > .user-menu-group:has(> #menuOrganizerRequest) {
    margin-top:10px; padding-top:10px; border-top:1px solid #e3e9ef;
  }
}

@media (max-width:640px) {
  body #userMenu.is-guest #accountMobileSheet #userMenuScroll,
  body #userMenu.is-guest #accountMobileSheet #userMenuScroll > .user-menu-group { gap:1px; }
}

@media (max-width:1050px) and (prefers-reduced-motion:reduce) {
  body #userMenu.is-guest #accountMobileSheet #guestAccountActions a { transition:none; }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link),
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event) { transition:none; }
}

@media (max-width:340px) {
  body #accountMobileSheet #guestAccountActions { grid-template-columns:1fr; }
  body #accountMobileSheet #guestAccountActions .guest-account-divider { display:none; }
}

@media (max-width:1050px) and (forced-colors:active) {
  body #accountMobileSheet :is(.mobile-menu-shell,.mobile-menu-header,.mobile-menu-body,#userMenuPanel,.user-menu-footer) {
    background:Canvas; color:CanvasText; border-color:CanvasText;
  }
  body.admin-modern:not(.organizer-modern) .admin-menu :is(button,.admin-artist-link,.admin-legal-requests-link):is(.active,[aria-current="page"]),
  body #accountMobileSheet #userMenuPanel :is(.menu-item,#newEventButton.menu-add-event):is(.active,[aria-current="page"]) {
    background:Highlight; color:HighlightText; box-shadow:inset 3px 0 HighlightText;
  }
}

/* Notification bottom sheets keep their phone-only behavior. */
@media (max-width:640px) {
  body #notificationBell.is-open:has(#notificationMobileSheet[open])::after { display:none; }
  body #notificationMobileSheet .mobile-menu-body {
    display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:0;
  }
  body #notificationMobileSheet #notificationPanel {
    position:static; inset:auto; display:flex; flex-direction:column; flex:1 1 auto; box-sizing:border-box;
    width:100%; min-width:0; min-height:0; max-width:none; max-height:none;
    margin:0; padding:0 0 env(safe-area-inset-bottom); border:0; border-radius:0;
    overflow:hidden; transform:none; box-shadow:none; animation:none;
  }
  body #notificationMobileSheet #notificationPanel .notification-panel-header { display:none; }
  body #notificationMobileSheet #notificationPanelItems { flex:1 1 auto; min-height:80px; overflow-y:auto; overscroll-behavior:contain; }
  body #notificationMobileSheet #notificationScrollFrame {
    position:relative; display:flex; flex-direction:column; flex:1 1 auto; min-width:0; min-height:80px; overflow:hidden;
  }
  body #notificationMobileSheet #notificationPanelItems { scroll-padding-block:22px 50px; }
  body #notificationMobileSheet #notificationScrollFrame::before,
  body #notificationMobileSheet #notificationScrollFrame::after {
    content:""; position:absolute; z-index:2; inset-inline:0; pointer-events:none; opacity:0;
  }
  body #notificationMobileSheet #notificationScrollFrame::before {
    inset-block-start:0; height:20px; background:linear-gradient(to bottom,var(--notification-panel-paper,#f2f4fb),transparent);
  }
  body #notificationMobileSheet #notificationScrollFrame::after {
    inset-block-end:0; height:48px; background:linear-gradient(to bottom,transparent,var(--notification-panel-paper,#f2f4fb) 30%);
  }
  body #notificationMobileSheet #notificationScrollFrame[data-scroll-before="true"]::before,
  body #notificationMobileSheet #notificationScrollFrame[data-scroll-after="true"]::after { opacity:1; }
  body #notificationMobileSheet #notificationScrollHint {
    position:absolute; z-index:3; inset:auto 8px 2px; display:none; box-sizing:border-box;
    align-items:center; justify-content:center; gap:6px; width:calc(100% - 16px); height:44px; min-height:44px;
    margin:0; padding:0 12px; border:0; border-radius:0; background:transparent; color:#625f86;
    box-shadow:none; transform:none; font:inherit; font-size:12px; font-weight:400; line-height:18px;
    cursor:pointer; touch-action:pan-y;
  }
  body #notificationMobileSheet #notificationScrollHint svg {
    flex:none; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
  }
  body #notificationMobileSheet #notificationScrollHint:is(:hover,:focus-visible) {
    background:transparent; color:var(--outlo-brand-text,#4338ca); text-decoration:underline; text-underline-offset:3px;
  }
  body #notificationMobileSheet #notificationScrollHint:focus-visible {
    outline:2px solid var(--outlo-brand-accent,#4f46e5); outline-offset:-3px;
  }
  body #notificationMobileSheet #notificationScrollFrame[data-scroll-after="true"] #notificationScrollHint:not([hidden]) { display:flex; }
  body #notificationMobileSheet .mobile-menu-shell { max-height:min(86%,720px); }
  body #notificationMobileSheet .notification-group-title:first-child { padding-top:10px; }
}

