/* ===========================================================================
   siriusly.ai - navbar. Shared across every page (imported by
   design-system.css, which all templates load). Rendered from the
   _navbar.html partial. Auth-aware links set in the partial.

   Desktop (Claude Design "Navbar Desktop Ideas" 1b): a transparent full-width
   bar with one hairline underneath - wordmark left, links centred, actions right. Once the page scrolls
   (.is-scrolled, toggled by _navbar.html) it drops from 72px to 60px, loses
   the hairline and gets a frosted backdrop and a soft shadow.
   It follows the page theme; only the phone bar below re-scopes the dark
   tokens onto itself and stays dark in both themes.
   =========================================================================== */
.sr-nav {
  color: var(--text-body);
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: 72px;
  /* Shrinking the bar would pull the page up 12px under it; the margin keeps
     its slot in the flow at 72px. */
  /* Content lines up with the property landing's 980px sample-video row
     (landing-property.css .lp-prop-diagram, inside a 24px-padded section). */
  padding: 0 max(24px, calc((100% - 980px) / 2));
  background: transparent;
  /* Halfway between the default and strong border: the default read too faint. */
  border-bottom: 1px solid color-mix(in srgb, var(--border-default), var(--border-strong));
  transition: height 0.3s ease, margin-bottom 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.sr-nav.is-scrolled {
  height: 60px;
  margin-bottom: 12px;
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--surface-page) 66%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px -12px var(--sr-nav-shadow, rgba(26, 24, 22, 0.18));
}
:root:not([data-theme="light"]) .sr-nav { --sr-nav-shadow: rgba(0, 0, 0, 0.5); }
@media (prefers-reduced-motion: reduce) { .sr-nav { transition: none; } }

/* wordmark - the /branding lockup's word (branding.css's .bk-lockup), without
   the mark. Nudged up 2px to sit optically centred in the bar. */
.sr-brand { justify-self: start; display: inline-flex; align-items: center; gap: 9.5px; text-decoration: none; flex-shrink: 0; }
.sr-brand:hover { text-decoration: none; }
.sr-brand .word {
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 29px;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  line-height: 1;
  transform: translateY(-2px);
  transition: font-size 0.3s ease;
}
.sr-nav.is-scrolled .sr-brand .word { font-size: 26px; }
.sr-brand .word .dot,
.sr-brand .word .ai { color: var(--color-primary); }
/* Trademark sign after the wordmark (navbar + footer): small, body font,
   muted, sitting on the wordmark's baseline. The glyph is drawn high in its
   em (its foot is 0.295em up in Plus Jakarta 600), so it is moved down by that. */
.sr-tm { font-family: var(--font-body); font-size: 0.36em; font-weight: 600; letter-spacing: 0; color: var(--text-muted); vertical-align: baseline; position: relative; top: 0.295em; margin-left: 0.08em; line-height: 1; }

/* links */
.sr-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Padded so hover can show the link as a soft pill; the padding plus the
   8px gap keeps the links about as far apart as before. */
.sr-links a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  line-height: 1;
  border-radius: var(--radius-pill, 999px);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--weight-medium);
  color: var(--text-body);
  text-decoration: none;
  transition: color var(--duration-fast, 0.12s) ease, background var(--duration-fast, 0.12s) ease;
}
.sr-links a:hover { color: var(--text-strong); background: color-mix(in srgb, var(--text-strong) 6%, transparent); text-decoration: none; }
/* Current page, set by the partial from request.resolver_match.url_name */
.sr-links a.is-active { color: var(--text-strong); font-weight: var(--weight-semibold); }

/* actions - theme toggle, language, then Log in / Sign up or the user menu.
   The markup keeps the language picker after the user block
   (export_landing_static.py relies on that order), so order moves it. */
.sr-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sr-theme-toggle { order: -2; }
.sr-lang { order: -1; }
/* "Book intro call" (views.call): an outlined pill at the far right, drawn like
   the language circle (.sr-lang-btn) beside it - border, no fill, the same hover. */
.sr-call-btn {
  order: 1; height: 42px; padding: 0 16px 0 13px; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill, 999px); background: none; color: var(--text-body);
  font-family: var(--font-body); font-size: 15px; font-weight: var(--weight-semibold); white-space: nowrap; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sr-call-btn svg { width: 16px; height: 16px; }
.sr-call-btn:hover, .sr-call-btn.is-active { background: color-mix(in srgb, var(--text-strong) 6%, transparent); border-color: var(--text-muted); color: var(--text-strong); text-decoration: none; }
.sr-call-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.sr-nav.is-scrolled .sr-call-btn { height: 38px; }
/* Tablet widths: the centred links leave no room for the label, so the
   button shrinks to its phone glyph (the label stays for screen readers). */
@media (min-width: 901px) and (max-width: 1180px) {
  .sr-call-btn, .sr-nav.is-scrolled .sr-call-btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .sr-call-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.sr-login {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration-fast, 0.12s) ease;
}
.sr-login:hover { color: var(--color-primary-text); text-decoration: none; }
.sr-signup {
  height: 42px;
  padding: 0 22px;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-on-brand);
  background: var(--color-primary);
  border-radius: var(--radius-pill, 999px);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: height 0.3s ease, padding 0.3s ease, background var(--duration-fast, 0.12s) ease;
}
.sr-nav.is-scrolled .sr-signup { height: 38px; padding: 0 20px; }
.sr-signup:hover { background: var(--color-primary-hover); color: var(--text-on-brand); text-decoration: none; }

/* Phone: a dark full-width bar pinned to the top edge in both themes
   (Claude Design "Navbar Options"). "Phone" is <= 900px wide, or a short
   screen in landscape (any pointer - some phones and DevTools report a fine
   one) - a big phone turned sideways is ~930px wide,
   which would otherwise get the desktop bar. Every phone query in this file
   uses that same pair. The nav links and the theme toggle drop
   out - both reappear inside the user menu, which opens as a full-screen
   sheet under the bar (see "Phone menu" at the foot of this file). */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .sr-links { display: none; }
  /* Phone: a round icon button with the menu button's fill, between the
     language circle and the menu (the theme toggle, order -2, is hidden
     here). The label stays for screen readers; it does not fit on a phone. */
  .sr-call-btn, .sr-call-btn:hover, .sr-call-btn.is-active, .sr-nav.is-scrolled .sr-call-btn {
    order: -2; width: 38px; height: 38px; padding: 0; justify-content: center;
    border: 0; background: rgba(255, 255, 255, 0.12); color: rgba(255, 250, 244, 0.9);
  }
  .sr-call-btn svg { width: 18px; height: 18px; }
  .sr-call-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sr-nav, .sr-nav.is-scrolled {
    --text-strong: var(--white); --text-body: var(--coal-200); --text-muted: var(--coal-400); --text-subtle: var(--coal-500);
    --surface-card: var(--coal-800); --surface-hover: var(--coal-700);
    --border-subtle: var(--coal-700); --border-default: var(--coal-600); --border-strong: var(--coal-500);
    --color-primary-text: var(--orange-400);
    display: flex;
    height: auto;
    margin: 0;
    /* coal-800 at 72%, translucent so the backdrop's bloom carries through. */
    background: rgba(38, 35, 32, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    gap: 10px;
    justify-content: space-between;
    border: 0;
    border-radius: 0;
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    padding-top: calc(10px + env(safe-area-inset-top));
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  }
  /* Its own compositor layer: otherwise the sticky bar is re-rasterized at
     each fractional scroll offset and the wordmark and buttons (which sit at
     sub-pixel positions) snap a device pixel up and down while scrolling. */
  .sr-nav, .sr-nav.is-scrolled { transform: translateZ(0); will-change: transform; }
  /* Glyphs (the l's ascender to the y's descender, 0.93em in Outfit) run
     ~28px, inside the 38px buttons beside it; the 32px line-height keeps
     the wordmark from setting the bar's height (the buttons do), and the -3px
     puts the ink, not the line box, on the buttons' centre line. */
  .sr-brand .word, .sr-nav.is-scrolled .sr-brand .word { font-size: 30px; line-height: 32px; color: rgba(255, 250, 244, 0.9); transform: translateY(-3px); }
  .sr-actions { gap: 8px; }
}

/* Sub-360 phones (Fold outer screen, iPhone SE 1). */
@media (max-width: 360px) {
  .sr-signup { padding: 8px 14px 10px; }
}

/* ---------- Logged-in user dropdown ---------- */
.sr-user { position: relative; }
.sr-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill, 999px);
  background: var(--surface-card);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sr-user-btn:hover, .sr-user-btn.is-open { background: var(--surface-hover); }
.sr-av {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--gradient-signature, linear-gradient(150deg,#B8674A,#CF8467));
  color: var(--text-on-brand);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.sr-av--lg { width: 40px; height: 40px; font-size: 16px; }
.sr-user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; max-width: 160px; }
.sr-user-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}
.sr-user-plan {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--color-primary-text);
  margin-top: 1px;
}
.sr-user-caret { display: inline-flex; color: var(--text-muted); }
.sr-close, .sr-guest, .sr-lang-title, .sr-menu-tiles, .sr-menu-plan { display: none; }
.sr-user-caret svg { width: 15px; height: 15px; transition: transform 0.18s ease; }
.sr-user-btn.is-open .sr-user-caret svg { transform: rotate(180deg); }

.sr-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 244px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0,0,0,0.45));
  padding: 8px;
  z-index: 1000;
  animation: sr-menu-in 140ms ease;
}
/* The phone bar is dark in both themes, but its sheets follow the theme: in
   the light theme they take the light tokens back from .sr-nav's dark ones. */
:root[data-theme="light"] .sr-menu,
:root[data-theme="light"] .sr-lang-menu {
  --text-strong: var(--coal-950); --text-body: var(--coal-700); --text-muted: var(--coal-500); --text-subtle: var(--coal-400);
  --surface-card: var(--white); --surface-hover: var(--coal-100);
  --border-subtle: #E7E3DA; --border-default: var(--coal-200); --border-strong: var(--coal-300);
  --color-primary-text: var(--orange-700);
}
@keyframes sr-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sr-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 10px; }
.sr-menu-id { display: flex; flex-direction: column; min-width: 0; }
.sr-menu-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-menu-email { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-menu-sep { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.sr-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.sr-menu-item:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }
.sr-menu-ic { display: inline-flex; color: var(--text-muted); }
.sr-menu-ic svg { width: 18px; height: 18px; }
.sr-menu-item:hover .sr-menu-ic { color: var(--text-body); }
/* Stands in for a nav link the phone layout drops - hidden again as soon as
   .sr-links is back. Placed after .sr-menu-item's own display on purpose: a
   media query adds no specificity, so source order is what decides this. */
.sr-menu-item--mobile { display: none; }
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .sr-menu-item--mobile { display: flex; }
  .sr-menu-item--desktop { display: none; }
}
.sr-menu-badge {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--status-success, #4ea67a);
  background: var(--status-success-soft, rgba(78,166,122,0.12));
  border-radius: var(--radius-pill, 999px);
  padding: 2px 9px;
}
/* Out of credits - same pill, flipped to the danger palette so it still
   reads as a real balance, not an error state hiding a real number. */
.sr-menu-badge--empty {
  color: var(--status-danger, #d9534f);
  background: var(--status-danger-soft, rgba(217,83,79,0.12));
}
.sr-menu-item--danger { color: var(--status-danger, #d9534f); }
.sr-menu-item--danger .sr-menu-ic { color: var(--status-danger, #d9534f); }
.sr-menu-item--danger:hover { background: rgba(217,83,79,0.10); color: var(--status-danger, #d9534f); }


/* ---------- UI language picker ---------- */
.sr-lang { position: relative; flex: none; }
/* Desktop: the language code in the same outlined circle as the theme toggle. */
.sr-lang-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: none;
  color: var(--text-body);
  cursor: pointer;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sr-lang-btn:hover, .sr-lang-btn.is-open { background: color-mix(in srgb, var(--text-strong) 6%, transparent); border-color: var(--text-muted); color: var(--text-strong); }
.sr-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  max-height: min(420px, 70vh);
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0,0,0,0.45));
  padding: 6px;
  z-index: 1000;
  animation: sr-menu-in 140ms ease;
}
.sr-lang-menu .lang-dd-item { text-decoration: none; }
.sr-lang-menu .lang-dd-item[hidden] { display: none; }

/* ---------- Light/dark theme toggle ---------- */
.sr-theme-toggle {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: none;
  color: var(--text-body);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sr-theme-toggle:hover { background: color-mix(in srgb, var(--text-strong) 6%, transparent); border-color: var(--text-muted); color: var(--text-strong); }
.sr-theme-toggle svg { width: 18px; height: 18px; display: block; }
/* Thinner than the icons' own 1.5, to match the light weight of the language code beside it. */
.sr-theme-toggle svg path { stroke-width: 0.9; }
.sr-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .sr-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .sr-theme-toggle .icon-sun { display: block; }
/* Desktop: the language and theme circles match Log in's height (42px, 38px
   once the bar has scrolled); the phone bar sets its own 38px further down. */
.sr-lang-btn, .sr-theme-toggle { width: 42px; height: 42px; }
.sr-nav.is-scrolled .sr-lang-btn, .sr-nav.is-scrolled .sr-theme-toggle { width: 38px; height: 38px; }
/* The logged-in badge matches them too: 42px (38px scrolled), the avatar centred in it. */
@media (min-width: 901px) {
  .sr-user-btn { box-sizing: border-box; height: 42px; padding: 0 10px 0 5px; }
  .sr-nav.is-scrolled .sr-user-btn { height: 38px; padding-left: 4px; }
  .sr-nav.is-scrolled .sr-user-btn .sr-av { width: 28px; height: 28px; font-size: 12px; }
}

/* ---------- Phone bar and menu (<= 900px) ----------
   At the foot of the file on purpose: a media query adds no specificity, so
   these have to come after the desktop rules they override.

   Bar: the language picker turns into a round code button and the user button
   into a bare avatar ring; the theme toggle drops out (it is a switch in the
   menu, which clicks the hidden toggle). While the menu is open
   (html.sr-menu-open, set by _navbar.html) both give way to a close button.

   Menu: a sheet filling the screen under the bar, dark by default and light
   under [data-theme="light"] like the desktop dropdown. .sr-nav is its
   containing block (sticky, at the top), so top:100% is the bar's bottom edge
   and calc(100dvh - 100%) the rest of the screen. It scrolls when it does
   not fit, which also un-pins Log out (margin-top:auto collapses to 0). */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .sr-theme-toggle { display: none; }
  /* The language pill sits left of the avatar, though it follows the user
     block in the markup (export_landing_static.py relies on that order),
     with the call button (order -2) between them. */
  .sr-lang { order: -3; }
  /* Log in / Sign up move into the logged-out menu (.sr-guest). */
  .sr-login, .sr-signup { display: none; }
  .sr-guest { display: flex; align-items: center; }
  /* html.sr-lang-open is the language list open as a sheet (same layout as
     the menus, below). */
  html.sr-menu-open, html.sr-lang-open { overflow: hidden; }
  /* Above the floating support bubble (footer.css, z-index 900). */
  html.sr-menu-open .sr-nav, html.sr-lang-open .sr-nav { z-index: 1000; }
  html.sr-menu-open .sr-actions:has(#srUser) .sr-lang,
  html.sr-menu-open .sr-user-btn, html.sr-lang-open .sr-user-btn,
  html.sr-menu-open .sr-burger, html.sr-lang-open .sr-burger { display: none; }

  .sr-lang-btn,
  .sr-lang-btn:hover,
  .sr-lang-btn.is-open {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: rgba(255, 250, 244, 0.85);
    font-size: 13px;
    letter-spacing: 0;
  }
  .sr-lang-btn.is-open { border-color: transparent; background: rgba(255, 255, 255, 0.18); }

  .sr-user-btn,
  .sr-user-btn:hover,
  .sr-user-btn.is-open { padding: 1px; gap: 0; border-color: rgba(255, 255, 255, 0.18); background: transparent; }
  .sr-user-meta,
  .sr-user-caret { display: none; }
  .sr-user-btn .sr-av { width: 34px; height: 34px; font-size: 14px; }

  .sr-close,
  .sr-burger {
    display: none;
    width: 38px;
    height: 38px;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 250, 244, 0.9);
    cursor: pointer;
  }
  .sr-burger { display: inline-flex; }
  .sr-close svg, .sr-burger svg { width: 18px; height: 18px; }
  html.sr-menu-open .sr-close, html.sr-lang-open .sr-close { display: inline-flex; }
  /* The sheets are positioned off .sr-nav, not off their own block. */
  .sr-user, .sr-guest, .sr-lang { position: static; }

  .sr-menu, .sr-lang-menu {
    --sr-sheet: #1C1916; --sr-card: rgba(255, 255, 255, 0.07); --sr-line: rgba(255, 255, 255, 0.1);
    --sr-accent: #E9A88A; --sr-danger: #F0A58A; --sr-switch: rgba(255, 255, 255, 0.18);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 100%);
    height: calc(100dvh - 100%);
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    padding: 12px max(20px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--sr-sheet);
    color: #FAF6EF;
    --text-body: #FAF6EF; --text-strong: #FAF6EF; --text-muted: #FAF6EF;
    --sr-muted: rgba(250, 246, 239, 0.55); --sr-field: rgba(255, 255, 255, 0.08);
    --sr-on: rgba(184, 103, 74, 0.22); --sr-on-text: #F2C9B6;
    animation: none;
  }
  :root[data-theme="light"] .sr-menu,
  :root[data-theme="light"] .sr-lang-menu {
    --sr-muted: var(--coal-400); --sr-field: #EFEAE1; --sr-on: #F6E3D9; --sr-on-text: var(--orange-600);
    --sr-sheet: #FFFCF8; --sr-card: #F6EFE7; --sr-line: #E6DFD2;
    --sr-accent: var(--orange-600); --sr-danger: #B14A28; --sr-switch: #D9D1C5;
    color: var(--coal-950);
    --text-body: var(--coal-950); --text-strong: var(--coal-950); --text-muted: var(--coal-950);
  }
  .sr-menu:not([hidden]) { display: flex; }
  .sr-menu-sep { display: none; }

  .sr-menu-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sr-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-height: 74px;
    padding: 12px;
    border-radius: 16px;
    background: var(--sr-card);
    border: 1px solid var(--sr-line);
    color: inherit;
    text-decoration: none;
  }
  .sr-tile:hover { color: inherit; text-decoration: none; }
  .sr-tile--primary {
    background: var(--orange-500);
    border-color: var(--orange-500);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(184, 103, 74, 0.8);
  }
  .sr-tile--primary:hover { color: #fff; }
  .sr-tile-ic {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 103, 74, 0.24);
    color: #F2B49A;
  }
  :root[data-theme="light"] .sr-tile:not(.sr-tile--primary) { background: #fff; }
  :root[data-theme="light"] .sr-tile-ic { background: #F6E3D9; color: var(--orange-600); }
  .sr-tile--primary .sr-tile-ic,
  :root[data-theme="light"] .sr-tile--primary .sr-tile-ic { background: rgba(255, 255, 255, 0.2); color: #fff; }
  .sr-tile-ic svg { width: 22px; height: 22px; }
  .sr-tile-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
  }
  .sr-tile-label svg { width: 16px; height: 16px; opacity: 0.7; }

  .sr-menu-head { gap: 12px; margin-top: 10px; padding: 10px 14px; border-radius: 16px; background: var(--sr-card); }
  .sr-menu-id { gap: 3px; }
  .sr-menu-name { font-family: var(--font-body); font-size: 14px; }
  .sr-menu-email { display: none; }
  .sr-menu-plan { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--sr-accent); }

  .sr-menu-list { margin-top: 4px; }
  .sr-menu-item {
    gap: 14px;
    width: 100%;
    min-height: 40px;
    padding: 0 4px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    text-align: left;
    cursor: pointer;
  }
  .sr-menu-item:hover { background: none; color: inherit; }
  .sr-menu-ic, .sr-menu-item:hover .sr-menu-ic { color: inherit; }
  .sr-menu-ic svg { width: 20px; height: 20px; }
  .sr-menu-item > span:nth-child(2) { flex: 1; }
  .sr-menu-badge { font-size: 11.5px; padding: 5px 10px; color: #A6DA9C; background: rgba(46, 122, 40, 0.28); }
  :root[data-theme="light"] .sr-menu-badge { color: #2E7A28; background: #E2F0DE; }
  .sr-menu-badge--empty,
  :root[data-theme="light"] .sr-menu-badge--empty { color: var(--sr-danger); background: rgba(217, 83, 79, 0.14); }
  .sr-menu-value { display: flex; align-items: center; gap: 4px; font-size: 14px; opacity: 0.55; }
  .sr-menu-value svg { width: 16px; height: 16px; }
  .sr-switch {
    flex: none;
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: var(--radius-pill, 999px);
    background: var(--orange-500);
    transition: background 0.15s ease;
  }
  .sr-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 21px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.15s ease;
  }
  :root[data-theme="light"] .sr-switch { background: var(--sr-switch); }
  :root[data-theme="light"] .sr-switch::after { left: 3px; }

  .sr-menu-item--danger,
  .sr-menu-item--danger:hover,
  .sr-menu-item--danger .sr-menu-ic { color: var(--sr-danger); background: none; }
  .sr-menu-item--danger { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--sr-line); border-radius: 0; flex: none; }
  .sr-menu-list { flex: none; }

  /* Logged-out menu: pitch, Sign up / Log in, then the shared prefs rows. */
  .sr-guest-head { display: flex; flex-direction: column; gap: 6px; padding: 10px 4px 6px; }
  .sr-guest-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; }
  .sr-guest-sub { font-size: 14px; color: var(--sr-muted); }
  .sr-guest-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .sr-guest-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--sr-card);
    color: inherit;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
  }
  :root[data-theme="light"] .sr-guest-btn { background: #fff; border-color: #DDD5C9; }
  .sr-guest-btn:hover { color: inherit; text-decoration: none; }
  .sr-guest-btn svg { width: 18px; height: 18px; }
  .sr-guest-btn--primary,
  :root[data-theme="light"] .sr-guest-btn--primary,
  .sr-guest-btn--primary:hover {
    background: var(--orange-500);
    border-color: var(--orange-500);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 26px -14px rgba(184, 103, 74, 0.8);
  }
  .sr-guest-rows { margin-top: 22px; border-top: 1px solid var(--sr-line); }
  .sr-guest-rows .sr-menu-item { min-height: 48px; border-bottom: 1px solid var(--sr-line); }

  /* Language list as a sheet: title, search, then code + name rows. */
  .sr-lang-menu { width: auto; max-height: none; padding-top: 0; }
  .sr-lang-title { display: block; padding: 16px 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
  .sr-lang-menu .lang-dd-search {
    height: 46px;
    margin-bottom: 8px;
    padding: 0 14px 0 41px;
    border: 0;
    border-radius: 12px;
    background: var(--sr-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8379' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 17px;
    color: inherit;
    font-size: 16px;
  }
  .sr-lang-menu .lang-dd-search::placeholder { color: var(--sr-muted); }
  .sr-lang-menu .lang-dd-item { gap: 14px; min-height: 44px; padding: 0 14px; border-radius: 12px; color: inherit; font-size: 15px; }
  .sr-lang-menu .lang-dd-item:hover { background: none; }
  .sr-lang-menu .lang-dd-code { min-width: 26px; font-size: 11px; color: var(--sr-muted); }
  .sr-lang-menu .lang-dd-item.on { background: var(--sr-on); color: var(--sr-on-text); font-weight: 600; }
  .sr-lang-menu .lang-dd-item.on .lang-dd-code { color: var(--sr-muted); }
}

/* Landscape phone: only ~260px under the bar, so the menu splits in two -
   tiles, account card and a pinned Log out on the left, the rest of the list
   scrolling on its own on the right. The bar slims to 54px. */
@media (orientation: landscape) and (max-height: 500px) {
  .sr-nav { padding-top: calc(9px + env(safe-area-inset-top)); padding-bottom: 9px; }
  .sr-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr auto;
    column-gap: 28px;
    overflow: hidden;
    padding-top: 12px;
  }
  .sr-menu:not([hidden]) { display: grid; }
  .sr-menu-tiles { grid-column: 1; gap: 8px; }
  .sr-tile { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 14px; }
  .sr-tile-ic { width: 26px; height: 26px; border-radius: 8px; }
  .sr-tile-ic svg { width: 17px; height: 17px; }
  .sr-tile-label { font-size: 15px; }
  .sr-tile-label svg { display: none; }
  .sr-menu-head { grid-column: 1; margin-top: 8px; padding: 9px 12px; border-radius: 14px; }
  .sr-menu-head .sr-av--lg { width: 34px; height: 34px; font-size: 14px; }
  .sr-menu-list { grid-column: 2; grid-row: 1 / -1; margin-top: 0; min-height: 0; overflow-y: auto; }
  .sr-menu-list .sr-menu-item { min-height: 36px; font-size: 15px; }
  .sr-menu-item--danger { grid-column: 1; grid-row: 4; min-height: 36px; padding-top: 6px; }
  .sr-guest-head, .sr-guest-cta { grid-column: 1; }
  .sr-guest-head { padding-top: 0; }
  .sr-guest-title { font-size: 20px; }
  .sr-guest-cta { margin-top: 12px; gap: 8px; }
  .sr-guest-btn { height: 44px; }
  .sr-guest-rows { margin-top: 0; }
}
