/* ==========================================================================
   Parlova — "Calm precision"
   Light first (white + charcoal), one turquoise accent, very subtle 3D.
   Every colour is a token; components never use raw hex.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Surfaces. Canvas is a hair off-white so white cards read as raised without heavy shadows. */
  --canvas: #f6f7f8;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #eef0f2;
  /* Ink. Charcoal, not black: softer on white, still 16:1. */
  --ink: #16191c;
  --ink-2: #475059;            /* 8.2:1 on white */
  --muted: #677079;            /* 5.0:1 on white, 4.7:1 on canvas */
  --line: #e3e6ea;
  --line-strong: #8a939c;      /* 3.1:1 — visible control borders (WCAG non-text) */
  /* Accent. Bright turquoise fills carry a charcoal label (8.8:1); white text on it would fail (2.1:1). */
  --accent: #22c7be;
  --accent-hover: #14b8b0;
  --accent-press: #12a69f;
  --accent-on: #0f1a1a;
  --accent-ink: #0b7f7c;       /* accent text / links / focus on white: 4.8:1 */
  --accent-ink-strong: #0b716f;/* on tinted backgrounds: 5.4:1 */
  --accent-50: #e6faf8;
  --accent-100: #c9f3ef;
  --accent-glow: #5eead4;      /* decorative only */
  --success: #067647;
  --success-bg: #e8f6ee;
  --warning: #b54708;
  --warning-bg: #fdf1e6;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --code-bg: #16191c;
  --code-ink: #e6e9ec;

  /* Depth: one light source, top-left. Two layers: a tight contact shadow + a soft ambient one. */
  --shadow-1: 0 1px 2px rgba(22, 25, 28, .06), 0 1px 1px rgba(22, 25, 28, .04);
  --shadow-2: 0 2px 4px rgba(22, 25, 28, .05), 0 8px 24px -6px rgba(22, 25, 28, .10);
  --shadow-3: 0 4px 8px rgba(22, 25, 28, .06), 0 24px 48px -12px rgba(22, 25, 28, .18);
  --shadow-accent: 0 6px 20px -6px rgba(34, 199, 190, .55);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .7);
  --edge: inset 0 -1px 0 rgba(22, 25, 28, .06);
  --overlay: rgba(22, 25, 28, .36);
  --glass: rgba(255, 255, 255, .78);

  --font-sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: clamp(17px, 1.1vw + 13px, 19px);
  --text-xl: clamp(20px, 1.4vw + 15px, 24px);
  --text-2xl: clamp(24px, 2vw + 17px, 32px);
  --text-3xl: clamp(32px, 3.4vw + 20px, 48px);
  --text-display: clamp(40px, 5.6vw + 20px, 76px);

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 600ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --rail-w: 248px;
  --rail-current: 0px;
  --gutter: 16px;

  /* Speaker colours: muted, distinguishable, always paired with a name. */
  --spk-0: #0b7f7c;
  --spk-1: #7c5cc4;
  --spk-2: #c2410c;
  --spk-3: #2563a8;
  --spk-4: #a3367a;
  --spk-5: #5b7a12;

  color-scheme: light;
}

/* Dark ("Charcoal"): follows the system unless the user picked light; or forced with data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0f1113; --surface: #16191c; --surface-raised: #1e2226; --surface-sunken: #0b0d0f;
    --ink: #eceff2; --ink-2: #c3c9d0; --muted: #9aa3ad; --line: #2a2f35; --line-strong: #4a525b;
    --accent: #2dd4bf; --accent-hover: #3ee0cb; --accent-press: #22c7be; --accent-on: #0b1514;
    --accent-ink: #2dd4bf; --accent-ink-strong: #5eead4; --accent-50: rgba(45, 212, 191, .12); --accent-100: rgba(45, 212, 191, .22);
    --success: #4ade80; --success-bg: rgba(74, 222, 128, .12); --warning: #fdba74; --warning-bg: rgba(253, 186, 116, .12);
    --danger: #fca5a5; --danger-bg: rgba(252, 165, 165, .12); --code-bg: #0b0d0f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .55);
    --shadow-3: 0 24px 48px -12px rgba(0, 0, 0, .7); --highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
    --edge: inset 0 -1px 0 rgba(0, 0, 0, .3); --overlay: rgba(0, 0, 0, .6); --glass: rgba(22, 25, 28, .78);
    --spk-0: #2dd4bf; --spk-1: #b9a3f0; --spk-2: #fdba74; --spk-3: #93c5fd; --spk-4: #f0a3d0; --spk-5: #bef264;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0f1113; --surface: #16191c; --surface-raised: #1e2226; --surface-sunken: #0b0d0f;
  --ink: #eceff2; --ink-2: #c3c9d0; --muted: #9aa3ad; --line: #2a2f35; --line-strong: #4a525b;
  --accent: #2dd4bf; --accent-hover: #3ee0cb; --accent-press: #22c7be; --accent-on: #0b1514;
  --accent-ink: #2dd4bf; --accent-ink-strong: #5eead4; --accent-50: rgba(45, 212, 191, .12); --accent-100: rgba(45, 212, 191, .22);
  --success: #4ade80; --success-bg: rgba(74, 222, 128, .12); --warning: #fdba74; --warning-bg: rgba(253, 186, 116, .12);
  --danger: #fca5a5; --danger-bg: rgba(252, 165, 165, .12); --code-bg: #0b0d0f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .55);
  --shadow-3: 0 24px 48px -12px rgba(0, 0, 0, .7); --highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
  --edge: inset 0 -1px 0 rgba(0, 0, 0, .3); --overlay: rgba(0, 0, 0, .6); --glass: rgba(22, 25, 28, .78);
  --spk-0: #2dd4bf; --spk-1: #b9a3f0; --spk-2: #fdba74; --spk-3: #93c5fd; --spk-4: #f0a3d0; --spk-5: #bef264;
  color-scheme: dark;
}

@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-landing { background: var(--surface); }
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink-strong); }
img, svg { display: block; }
svg { width: 1em; height: 1em; flex: none; }
code, pre, kbd { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code {
  padding: .1em .4em;
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--ink);
  overflow-wrap: anywhere;
}
::selection { background: var(--accent-100); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
mark { background: var(--accent-100); color: var(--ink); border-radius: 3px; padding: 0 1px; }
mark.is-current { background: var(--accent); color: var(--accent-on); box-shadow: 0 0 0 2px var(--accent); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--surface); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.hide-sm { }
@media (max-width: 639px) { .hide-sm { display: none !important; } }

/* ---------------------------------------------------------------- brand */

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 650; letter-spacing: -0.03em; font-size: 19px;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(160deg, #4fe0d6 0%, var(--accent) 55%, #17aaa2 100%);
  color: #0f1a1a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 2px 6px -2px rgba(20, 150, 145, .6);
}
.brand-mark svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------- buttons */

.btn {
  --btn-h: 42px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 15px; font-weight: 560; line-height: 1; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-sm { --btn-h: 36px; padding: 0 13px; font-size: 14px; border-radius: 9px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { --btn-h: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

/* Primary: turquoise with a charcoal label, a top highlight and a tinted shadow — the one raised thing. */
.btn-primary {
  background: var(--accent); color: var(--accent-on);
  box-shadow: var(--highlight), var(--edge), 0 1px 2px rgba(15, 120, 115, .25);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-on); box-shadow: var(--highlight), var(--edge), var(--shadow-accent); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .12); }
.btn-cta { box-shadow: var(--highlight), var(--edge), var(--shadow-accent); }

/* Secondary (".btn-ghost" kept as the class name app code already uses). */
.btn-ghost {
  background: var(--surface); color: var(--ink);
  border-color: var(--line); box-shadow: var(--shadow-1);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:active:not(:disabled) { box-shadow: inset 0 1px 2px rgba(22, 25, 28, .08); }

.btn-tertiary { background: transparent; color: var(--ink-2); }
.btn-tertiary:hover:not(:disabled) { background: var(--surface-sunken); color: var(--ink); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent-on) transparent var(--accent-on) transparent;
  animation: spin .8s linear infinite;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--ink); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn-sm svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .4; cursor: default; }

.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent-ink); font-weight: 560; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-ink-strong); }

.btn-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; transition: background-color var(--dur-1), color var(--dur-1);
}
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon:hover { background: var(--surface-sunken); color: var(--ink); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------------------------------------------------------------- pills */

.lock {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--accent-50); color: var(--accent-ink-strong);
  font-size: 11px; font-style: normal; font-weight: 650; letter-spacing: .02em; text-transform: uppercase;
  vertical-align: middle;
}
.plan-tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-sunken); color: var(--ink-2);
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
}
.plan-tag.tier-plus, .plan-tag.tier-pro { background: var(--accent-50); color: var(--accent-ink-strong); }

/* ---------------------------------------------------------------- forms */

.field, .auth-field { display: grid; gap: 6px; }
.field > span, .auth-field > span { font-size: 14px; font-weight: 560; color: var(--ink); }
.field small, .auth-field small { color: var(--muted); font-size: 13px; }
input[type="email"], input[type="password"], input[type="text"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.4;
  transition: border-color var(--dur-1), box-shadow var(--dur-2);
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; font-family: var(--font-sans); }
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23677079' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-50); }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-sunken); color: var(--muted); cursor: not-allowed; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.auth-error {
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--danger); font-size: 14px;
}
.auth-note { color: var(--muted); font-size: 14px; text-align: center; }
.auth-note.left { text-align: left; }

/* Switch toggles (the checkbox stays real for keyboard and screen readers). */
.toggle {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; width: 36px; height: 22px; margin-top: 1px; border-radius: var(--r-pill);
  background: var(--line-strong); transition: background-color var(--dur-2) var(--ease-out);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform var(--dur-2) var(--ease-spring);
}
.toggle input:checked + .switch { background: var(--accent-ink); }
.toggle input:checked + .switch::after { transform: translateX(14px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.toggle-text { display: grid; gap: 2px; }
.toggle-text strong { font-size: 15px; font-weight: 560; }
.toggle-text small { color: var(--muted); font-size: 13px; }
.toggle.is-locked { cursor: not-allowed; }
.toggle.is-locked .switch, .toggle.is-locked .toggle-text { opacity: .55; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent-ink); }

/* Segmented controls: interval toggle, tabs, code language tabs, OS tabs. */
.interval-toggle, .seg, .segmented, .code-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 12px; background: var(--surface-sunken);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.interval-toggle::-webkit-scrollbar, .seg::-webkit-scrollbar, .segmented::-webkit-scrollbar, .code-tabs::-webkit-scrollbar { display: none; }
.interval, .seg button, .segmented button, .code-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 560; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2), box-shadow var(--dur-2);
}
.interval:hover, .seg button:hover, .segmented button:hover, .code-tabs button:hover { color: var(--ink); }
.interval.is-active, .seg button.is-active, .segmented button.is-active, .code-tabs button.is-active {
  background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-1), var(--highlight);
}
.interval small { color: var(--accent-ink-strong); font-size: 12px; font-weight: 650; }
.seg svg, .segmented svg { width: 15px; height: 15px; }

/* ----------------------------------------------------------------- menus */

.menu {
  position: absolute; z-index: 30; min-width: 220px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-raised); box-shadow: var(--shadow-2);
  animation: pop-in var(--dur-2) var(--ease-out);
}
.menu a, .menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--surface-sunken); }
.menu .is-locked { color: var(--muted); }
.menu-label { padding: 8px 12px 6px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: fixed; }

/* ---------------------------------------------------------------- modals */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: var(--overlay);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity var(--dur-3) var(--ease-out);
  overflow-y: auto;
}
.modal-overlay.open { opacity: 1; }
.modal {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 28px; border-radius: var(--r-xl);
  background: var(--surface-raised); box-shadow: var(--shadow-3), var(--highlight);
  transform: translateY(8px) scale(.97); transition: transform var(--dur-3) var(--ease-out);
}
.modal-overlay.open .modal { transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-sm h2 { font-size: 20px; margin-bottom: 8px; }
.modal-sm p { color: var(--ink-2); white-space: pre-line; }
.modal-wide { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { font-size: var(--text-2xl); }
.modal-head p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal .interval-toggle { margin-bottom: 18px; }

@media (max-width: 639px) {
  .modal-overlay:has(.sheet) { place-items: end stretch; padding: 0; }
  .sheet {
    width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--surface);
  box-shadow: var(--shadow-3); font-size: 14px; pointer-events: auto;
  animation: toast-in var(--dur-2) var(--ease-out);
}
.toast::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
}
.toast.success::before { background: var(--accent); }
.toast.error::before { background: #f87171; }
.toast span { flex: 1; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 160ms, transform 160ms; }
.toast-action {
  flex: none; padding: 6px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: inherit; font-weight: 600; font-size: 13px;
}
.toast-action:hover { background: rgba(255, 255, 255, .2); }
@media (min-width: 1024px) {
  .toasts { left: auto; right: 24px; bottom: 24px; transform: none; }
}
.shell:not([hidden]) ~ .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .shell:not([hidden]) ~ .toasts { bottom: 24px; } }

/* =================================================================== LANDING */

html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
  transition-delay: var(--stagger, 0ms);
}

.landing { background: var(--surface); }
.landing-main { overflow-x: clip; }

.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.site-nav.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-1); }
.site-nav-inner {
  max-width: 1200px; height: 64px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-links { display: none; gap: 4px; }
.site-links a {
  padding: 8px 12px; border-radius: 8px; color: var(--ink-2);
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.site-links a:hover { color: var(--ink); background: var(--surface-sunken); }
.site-actions { display: flex; align-items: center; gap: 8px; }
.site-menu {
  padding: 8px var(--gutter) 20px; border-top: 1px solid var(--line);
  display: grid; gap: 2px; animation: fade-down var(--dur-2) var(--ease-out);
}
.site-menu > a {
  padding: 14px 4px; color: var(--ink); font-size: 17px; font-weight: 560; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-menu-actions { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 900px) {
  .site-links { display: flex; }
  .site-menu-btn, .site-menu { display: none !important; }
}

/* Hero */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(48px, 7vw, 88px);
  display: grid; gap: clamp(40px, 6vw, 64px); align-items: center;
}
@media (min-width: 1024px) { .hero { grid-template-columns: 1.05fr .95fr; } }
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 560;
  box-shadow: var(--shadow-1);
}
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: ping 2.4s var(--ease-out) infinite;
}
.hero-title {
  margin-top: 22px; font-size: var(--text-display); font-weight: 680; line-height: 1.02; letter-spacing: -0.04em;
}
.hero-line { display: block; min-height: 1.02em; }
.rotator {
  position: relative; display: inline-block; vertical-align: bottom;
  transition: width 450ms var(--ease-out); white-space: nowrap;
}
.rotator .word { display: inline-block; position: relative; color: var(--ink); }
.rotator .word::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .09em; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  transform-origin: left; animation: draw 600ms var(--ease-out) 150ms both;
}
.rotator .word i { display: inline-block; font-style: normal; }
.rotator .word.out i { animation: letter-out 260ms var(--ease-in-out) both; animation-delay: calc(var(--i) * 18ms); }
.rotator .word.in i { animation: letter-in 420ms var(--ease-out) both; animation-delay: calc(var(--i) * 22ms); }
.rotator .word.out::after { transform: scaleX(0); transition: transform 200ms; animation: none; }
.hero-sub { margin-top: 22px; max-width: 34em; color: var(--ink-2); font-size: var(--text-lg); line-height: 1.6; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.hero-trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 16px; height: 16px; color: var(--accent-ink); }
@media (max-width: 479px) {
  .hero-ctas .btn { flex: 1 1 100%; }
}

/* Hero art: frosted glass cards floating over a turquoise panel of flowing sound lines. */
.hero { position: relative; }
.hero-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 70% 40%, #000, transparent 75%);
  mask-image: radial-gradient(70% 60% at 70% 40%, #000, transparent 75%);
  opacity: .5;
}
.hero-art { perspective: 1600px; animation: float 7s ease-in-out infinite; }
.hero-art, .hero-art * { animation-play-state: var(--play, running); }
.stage {
  --rx: 6deg; --ry: -10deg;
  position: relative; width: min(560px, 100%); aspect-ratio: 1 / 1.02; margin: 0 auto;
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 700ms var(--ease-out);
}
.panel {
  position: absolute; inset: 0 4% 6% 8%; overflow: hidden; border-radius: 30px;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(255, 255, 255, .85), transparent 55%),
    linear-gradient(155deg, #e8fbf8 0%, #a6efe6 34%, #36cfc5 70%, #109a93 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 40px 80px -36px rgba(16, 120, 115, .55), 0 2px 6px rgba(22, 25, 28, .06);
  transform: translateZ(-40px);
}
.panel .lines { position: absolute; inset: -6% -4%; width: 108%; height: 112%; color: rgba(255, 255, 255, .75); }
.panel .lines path:nth-child(3n) { color: rgba(11, 113, 111, .35); }
.streaks {
  position: absolute; inset: -20%;
  background: repeating-linear-gradient(115deg, transparent 0 60px, rgba(255, 255, 255, .16) 60px 120px, transparent 120px 220px);
  mix-blend-mode: soft-light; animation: streak 14s linear infinite;
}
.lines { display: block; }
.lines path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lines g { transform-origin: 50% 50%; animation: breathe 6s var(--ease-in-out) infinite alternate; }

/* Technical marks: crosshairs and small monospaced labels. */
.mark { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.mark::before, .mark::after { content: ""; position: absolute; background: currentColor; }
.mark::before { left: 6px; top: 0; width: 1.5px; height: 14px; }
.mark::after { top: 6px; left: 0; height: 1.5px; width: 14px; }
.panel .mark { color: rgba(15, 26, 26, .55); }
.mark-tl { top: 16px; left: 16px; } .mark-tr { top: 16px; right: 16px; }
.mark-bl { bottom: 16px; left: 16px; } .mark-br { bottom: 16px; right: 16px; }
.micro {
  position: absolute; margin: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(15, 26, 26, .62);
}
.micro-tl { top: 18px; left: 40px; } .micro-tr { top: 18px; right: 40px; } .micro-br { bottom: 18px; right: 40px; }

.glass {
  position: absolute; padding: 16px 18px; border-radius: 20px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(22, 25, 28, .05), 0 28px 50px -24px rgba(12, 60, 58, .45);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.g-file { top: 12%; left: 0; width: 58%; transform: translateZ(40px); }
.g-text { right: 0; bottom: 16%; width: 80%; transform: translateZ(80px); }
.slab-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.file-chip, .lang-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r-pill);
  background: rgba(15, 26, 26, .06); color: #2b3237; font-size: 12px; font-weight: 560;
}
.file-chip svg { width: 14px; height: 14px; color: #0b7f7c; }
.lang-chip { background: rgba(34, 199, 190, .16); color: #0b716f; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; }
.slab-title { font-size: 13px; font-weight: 650; color: #16191c; }
.wave { display: flex; align-items: center; gap: 4px; height: 64px; margin-top: 12px; }
.wave i {
  flex: 1; height: 100%; border-radius: 99px;
  background: linear-gradient(180deg, #5eead4, #22c7be 60%, #0b7f7c);
  transform: scaleY(.25); transform-origin: center;
  animation: bar 1.6s var(--ease-in-out) infinite alternate;
}
.wave i:nth-child(3n) { animation-delay: -.4s; }
.wave i:nth-child(3n+1) { animation-delay: -.9s; }
.wave i:nth-child(4n) { animation-duration: 1.2s; }
.wave i:nth-child(5n) { animation-duration: 2s; }
.wave i:nth-child(7n) { animation-delay: -1.3s; }
.t-line {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px;
  padding: 9px 0; border-top: 1px solid rgba(15, 26, 26, .08); font-size: 13.5px;
}
.t-line:first-of-type { border-top: 0; }
.t-who { padding: 2px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 650; }
.t-who.s1 { background: rgba(34, 199, 190, .16); color: #0b716f; }
.t-who.s2 { background: rgba(124, 92, 196, .14); color: #6a4bb3; }
.t-ts { font-family: var(--font-mono); font-size: 11.5px; color: #677079; }
.t-text { color: #16191c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-line:nth-of-type(2) .t-text { animation: type-2 8s var(--ease-out) infinite; }
.t-line:nth-of-type(3) .t-text { animation: type-3 8s var(--ease-out) infinite; }
.t-line:nth-of-type(4) .t-text { animation: type-4 8s var(--ease-out) infinite; }
.chip-float {
  position: absolute; left: 6%; bottom: 3%; transform: translateZ(120px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px;
  background: #16191c; color: #f4f6f7; font-size: 13px; font-weight: 560;
  box-shadow: 0 18px 40px -14px rgba(22, 25, 28, .55);
  animation: chip 8s var(--ease-out) infinite;
}
.chip-float svg { width: 16px; height: 16px; color: #2dd4bf; }
@media (max-width: 639px) {
  .stage { aspect-ratio: 1 / 1.1; }
  .t-line { font-size: 12px; }
  .t-ts { display: none; }
  .wave { height: 44px; }
  .micro-tr { display: none; }
}

/* Languages strip */
.proof { padding: 8px 0 clamp(56px, 8vw, 96px); text-align: center; }
.marquee {
  overflow: hidden; padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2); font-size: 15px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow-1);
}
.proof-note { max-width: 640px; margin: 22px auto 0; padding: 0 var(--gutter); color: var(--muted); font-size: 14px; }
.proof-note strong { color: var(--ink); font-weight: 600; }

/* Sections */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 9vw, 112px) var(--gutter); position: relative; }
.section-intro { max-width: 640px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-intro h2 { font-size: var(--text-3xl); letter-spacing: -0.035em; }
.section-intro p:not(.kicker) { margin-top: 14px; color: var(--ink-2); font-size: var(--text-lg); }
.kicker {
  display: inline-block; margin-bottom: 12px; color: var(--accent-ink);
  font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
}
.anchor { position: absolute; top: 0; }

/* Interactive sample */
.demo {
  max-width: 920px; margin: 0 auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface-raised); box-shadow: var(--shadow-3), var(--highlight);
}
.demo-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); background: var(--canvas);
}
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-title { flex: 1; min-width: 0; }
.demo-title b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-title span { color: var(--muted); font-size: 13px; }
.demo-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.demo-body { height: 420px; overflow-y: auto; padding: 8px 20px 24px; scroll-behavior: smooth; }
.demo-badge { padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--muted); font-size: 12px; font-weight: 600; }

/* Steps */
.steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.step {
  position: relative; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1); counter-increment: step;
}
.step::after {
  content: counter(step, decimal-leading-zero); position: absolute; top: 24px; right: 24px;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
}
.step h3 { margin-top: 20px; font-size: 19px; }
.step p { margin-top: 8px; color: var(--ink-2); }

/* 3D icon tile: raised rounded square, top highlight, turquoise glyph. */
.tile3d {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(160deg, var(--surface-raised), var(--surface-sunken));
  border: 1px solid var(--line);
  box-shadow: var(--highlight), var(--edge), 0 1px 2px rgba(22, 25, 28, .06), 0 10px 20px -8px rgba(22, 25, 28, .18);
  color: var(--accent-ink);
}
.tile3d svg { width: 24px; height: 24px; }
.tile3d-lg { width: 60px; height: 60px; border-radius: 16px; }
.tile3d-lg svg { width: 28px; height: 28px; }

/* Bento */
.bento { display: grid; gap: 16px; }
@media (min-width: 768px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento { grid-template-columns: repeat(3, 1fr); gap: 20px; } .tile-wide { grid-column: span 2; } }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  min-height: 240px; padding: 26px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.tile h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.tile h3 svg { width: 20px; height: 20px; color: var(--accent-ink); }
.tile p { margin-top: 8px; color: var(--ink-2); }
.tile-art { display: flex; flex-wrap: wrap; gap: 8px; }
.langs span, .formats span {
  padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--canvas); color: var(--ink-2); font-size: 13px; font-weight: 560;
}
.formats span { font-family: var(--font-mono); font-size: 12px; border-radius: 8px; }
.formats.vocab span { font-family: var(--font-sans); background: var(--accent-50); border-color: transparent; color: var(--accent-ink-strong); }
.speakers { display: grid; gap: 10px; }
.speakers p { display: flex; align-items: center; gap: 10px; margin: 0; }
.speakers b { width: 56px; font-size: 12px; font-weight: 650; }
.speakers b.s1 { color: var(--spk-0); }
.speakers b.s2 { color: var(--spk-1); }
.speakers i { height: 8px; width: var(--w); border-radius: 99px; background: var(--surface-sunken); }
.todo { display: grid; gap: 10px; }
.todo p { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink); font-size: 14px; }
.box { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); }
.box.is-done { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.box svg { width: 12px; height: 12px; }
.tile-dark { background: #16191c; border-color: #2a2f35; color: #eceff2; }
.tile-dark h3 { color: #eceff2; }
.tile-dark h3 svg { color: #2dd4bf; }
.tile-dark p { color: #b7bfc7; }
.term { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 13px; color: #eceff2; }
.term p { margin: 0; color: #eceff2; overflow-wrap: anywhere; }
.term .prompt, .term .ok { color: #2dd4bf; }
.term .dim { color: #8a939c; }
@media (hover: hover) {
  .tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
}

/* Plans (landing and modal) */
.plans-section { text-align: center; }
.plans {
  display: grid; gap: 16px; margin-top: 28px; text-align: left;
}
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; } }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
}
.plan-plus {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent-ink), var(--shadow-2);
}
@media (max-width: 899px) { .plans .plan-plus { order: -1; } }
.plan.is-current { background: linear-gradient(180deg, var(--accent-50), var(--surface-raised) 140px); }
.plan-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-title h3 { font-size: 20px; }
.plan-badge {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-on);
  font-size: 12px; font-weight: 650; box-shadow: var(--highlight);
}
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; min-height: 52px; }
.plan-price b { font-size: 44px; font-weight: 680; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; animation: num-in var(--dur-3) var(--ease-out); }
.plan-price span { color: var(--muted); font-size: 15px; }
.plan-price s { color: var(--muted); font-size: 22px; }
.plan-tagline { margin-top: 6px; color: var(--muted); font-size: 14px; min-height: 21px; }
.plan h4 { margin: 22px 0 10px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.plan ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.plan li svg { width: 18px; height: 18px; margin-top: 1px; color: var(--accent-ink); }
.plan-btn { width: 100%; margin-top: 24px; }
.plan-note + .plan-btn { margin-top: 10px; }
.plan-note { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 13px; }
.plan > :last-child { margin-top: auto; }
.plan ul + .plan-btn, .plan ul + .plan-note { margin-top: auto; padding-top: 0; }
.plan ul { margin-bottom: 24px; }
.plans-foot { margin-top: 22px; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); interpolate-size: allow-keywords; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; color: var(--muted); transition: transform var(--dur-3) var(--ease-in-out); }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details::details-content { height: 0; overflow: clip; transition: height var(--dur-3) var(--ease-in-out), content-visibility var(--dur-3) allow-discrete; }
.faq details[open]::details-content { height: auto; }
.faq-a { padding: 0 4px 22px; color: var(--ink-2); line-height: 1.65; max-width: 62ch; }

/* Final CTA */
.cta-band {
  position: relative; overflow: hidden;
  max-width: 1136px; margin: 0 var(--gutter) clamp(56px, 8vw, 96px); padding: clamp(48px, 8vw, 88px) var(--gutter);
  border-radius: 28px; text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, #20262b, #111417 70%);
  color: #eceff2;
  box-shadow: var(--shadow-3);
}
@media (min-width: 1200px) { .cta-band { margin-left: auto; margin-right: auto; } }
.cta-band h2 { position: relative; font-size: var(--text-3xl); letter-spacing: -0.035em; color: #fff; }
.cta-band p { position: relative; margin: 14px 0 28px; color: #b7bfc7; font-size: var(--text-lg); }
.cta-band .btn { position: relative; }
/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--canvas); }
.site-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 48px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  display: grid; gap: 32px;
}
@media (min-width: 768px) { .site-footer-inner { grid-template-columns: 1.3fr 2fr auto; align-items: start; } }
.footer-brand p { margin-top: 12px; color: var(--muted); font-size: 14px; max-width: 28ch; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-links h3 { margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.footer-links a { display: block; padding: 5px 0; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-sunken); justify-self: start; }
.theme-switch button {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button.is-active { background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-1); }

/* Auth dialog */
.auth-card { display: grid; gap: 16px; text-align: left; }
.auth-mark { width: 40px; height: 40px; border-radius: 11px; }
.auth-mark svg { width: 24px; height: 24px; }
.auth-title { font-size: 24px; letter-spacing: -0.03em; padding-right: 40px; }
.auth-plan {
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--accent-50); color: var(--ink); font-size: 14px;
}
.auth-switch { color: var(--muted); font-size: 14px; text-align: center; }
.auth-legal { color: var(--muted); font-size: 12.5px; text-align: center; }

/* ===================================================================== APP SHELL */

.shell { min-height: 100dvh; }
.rail { display: none; }
.mobile-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.mobile-top .brand { font-size: 17px; }
.mobile-top .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.mobile-top .brand-mark svg { width: 17px; height: 17px; }
.mobile-top-right { display: flex; align-items: center; gap: 10px; }
.shell-main { min-width: 0; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab-item {
  display: grid; justify-items: center; gap: 3px; padding: 8px 0;
  color: var(--muted); font-size: 11px; font-weight: 560; text-decoration: none;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.is-active { color: var(--accent-ink); }
.tab-item:hover { color: var(--ink); }
.tab-new {
  justify-self: center; display: grid; place-items: center;
  width: 52px; height: 52px; margin-top: -18px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-on);
  box-shadow: var(--highlight), var(--edge), var(--shadow-accent), 0 0 0 5px var(--canvas);
  transition: transform var(--dur-1) var(--ease-out);
}
.tab-new svg { width: 24px; height: 24px; }
.tab-new:active { transform: translateY(1px) scale(.97); }
body.keyboard-open .tabbar { display: none; }

@media (min-width: 1024px) {
  body.in-app { --rail-current: var(--rail-w); }
  body.in-app.rail-collapsed { --rail-current: 76px; }
  .shell { display: grid; grid-template-columns: var(--rail-current) 1fr; transition: grid-template-columns var(--dur-3) var(--ease-out); }
  .mobile-top, .tabbar { display: none; }
  .shell-main { padding-bottom: 0; display: flex; flex-direction: column; min-height: 100dvh; }
  .rail {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px;
    padding: 18px 14px; overflow: hidden;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .rail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; min-height: 40px; }
  .rail-new { width: 100%; justify-content: flex-start; padding: 0 14px; }
  .rail-nav { display: grid; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--r-md);
    color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
    transition: background-color var(--dur-1), color var(--dur-1);
  }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item:hover { background: var(--surface-sunken); color: var(--ink); }
  .nav-item.is-active { background: var(--accent-50); color: var(--accent-ink-strong); font-weight: 600; }
  .nav-lock { margin-left: auto; }
  .rail-foot { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rail > * { min-width: 0; }
  .usage-card {
    padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
    background: var(--canvas);
  }
  .usage-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .usage-card .link-btn { font-size: 13px; }
  .usage { margin: 10px 0 8px; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
  .usage.warn { color: var(--warning); }
  .account-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px;
    border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer; text-align: left;
  }
  .account-btn:hover { background: var(--surface-sunken); }
  .account-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-2); }
  .account-chev { width: 16px; height: 16px; color: var(--muted); }

  body.rail-collapsed .rail .brand-name, body.rail-collapsed .rail-new span, body.rail-collapsed .nav-item span,
  body.rail-collapsed .nav-lock, body.rail-collapsed .usage-card, body.rail-collapsed .account-email, body.rail-collapsed .account-chev { display: none !important; }
  body.rail-collapsed .rail-top { flex-direction: column; }
  body.rail-collapsed .rail-new { justify-content: center; padding: 0; }
  body.rail-collapsed .nav-item, body.rail-collapsed .account-btn { justify-content: center; padding: 0; }
}
.avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-100), var(--accent-50));
  color: var(--accent-ink-strong); font-size: 14px; font-weight: 700; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--line);
}
.account-btn-mobile { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.meter-fill {
  height: 100%; width: 0; border-radius: inherit; background: var(--accent);
  transition: width var(--dur-4) var(--ease-out);
}
.meter-fill.warn { background: var(--warning); }

.app-footer {
  margin-top: auto; padding: 28px var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  color: var(--muted); font-size: 13px;
}
.app-footer span:last-child { display: flex; gap: 16px; flex-wrap: wrap; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); }

/* Pages */
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) var(--gutter) 24px; animation: page-in var(--dur-3) var(--ease-out); }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: var(--text-2xl); letter-spacing: -0.03em; }
.page-eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }

/* Composer */
.composer {
  display: grid; gap: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface-raised); box-shadow: var(--shadow-1), var(--highlight);
}
.dropzone {
  display: grid; justify-items: center; gap: 16px; text-align: center;
  margin: 12px; padding: clamp(24px, 5vw, 44px) 20px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: radial-gradient(120% 100% at 50% 0%, var(--accent-50), transparent 70%);
  transition: border-color var(--dur-2), background-color var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.dropzone.is-attention { animation: attention 900ms var(--ease-out); }
.dz-title { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.dz-help { margin-top: 6px; color: var(--muted); font-size: 14px; max-width: 52ch; }
@media (min-width: 768px) {
  .dropzone { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; gap: 20px; }
}
.upload-status { padding: 0 24px 18px; }
.upload-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.upload-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.track { height: 6px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 300ms linear; }
.link-row { display: grid; gap: 8px; padding: 4px 24px 18px; }
.link-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 560; }
.link-label svg { width: 18px; height: 18px; color: var(--muted); }
.link-input { display: flex; gap: 8px; }
.link-input input { flex: 1; min-width: 0; }
@media (max-width: 479px) { .link-input { flex-direction: column; } }
.more-options { border-top: 1px solid var(--line); }
.more-options summary {
  display: flex; align-items: center; gap: 8px; padding: 14px 24px; cursor: pointer; list-style: none;
  color: var(--ink-2); font-size: 14px; font-weight: 560;
}
.more-options summary::-webkit-details-marker { display: none; }
.more-options summary:hover { color: var(--ink); }
.sum-chev { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform var(--dur-2) var(--ease-out); }
.more-options[open] .sum-chev { transform: none; }
.options-grid { display: grid; gap: 12px; padding: 0 24px 22px; }
@media (min-width: 768px) { .options-grid { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.model-line { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

/* Continue reading */
.resume {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-raised); box-shadow: var(--shadow-1);
  animation: page-in var(--dur-3) var(--ease-out);
}
.resume-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-50); color: var(--accent-ink); flex: none; }
.resume-icon svg { width: 20px; height: 20px; }
.resume-text { flex: 1; min-width: 0; }
.resume-text small { display: block; color: var(--muted); font-size: 12.5px; }
.resume-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Recordings */
.queue-section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title h2 { font-size: 20px; }
.count { padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.section-tools { display: flex; align-items: center; gap: 8px; }
.mini-search { position: relative; display: block; }
.mini-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.mini-search input { min-height: 38px; padding-left: 34px; width: min(240px, 52vw); font-size: 15px; }
.job-list { display: grid; gap: 10px; }
.job {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-2), box-shadow var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.job.is-new { animation: row-in var(--dur-3) var(--ease-out) both; }
.job.is-clickable { cursor: pointer; }
@media (hover: hover) {
  .job.is-clickable:hover { border-color: color-mix(in srgb, var(--line-strong) 50%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
}
.job.just-done { animation: done-flash 1.4s var(--ease-out); }
.job-icon {
  position: relative; display: grid; place-items: center; overflow: hidden;
  width: 56px; height: 56px; border-radius: 12px; background: var(--surface-sunken); color: var(--muted);
}
.job-icon svg { width: 24px; height: 24px; }
.job-icon img { width: 100%; height: 100%; object-fit: cover; }
.job-main { min-width: 0; }
.job-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.job-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { margin-top: 3px; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta .dot { margin: 0 6px; }
.job-error { margin-top: 4px; color: var(--danger); font-size: 14px; }
.job-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.job-progress .track { flex: 1; }
.job-progress .fill { background: linear-gradient(90deg, var(--accent), var(--accent-glow)); }
.percent { min-width: 38px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.job-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
@media (min-width: 640px) {
  .job { grid-template-columns: auto 1fr auto; }
  .job-actions { grid-column: auto; }
}
.status {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 9px 3px 7px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  background: var(--surface-sunken); color: var(--ink-2);
}
.status svg { width: 14px; height: 14px; }
.status-completed { background: var(--success-bg); color: var(--success); }
.status-failed { background: var(--danger-bg); color: var(--danger); }
.status-running { background: var(--accent-50); color: var(--accent-ink-strong); }
.status-queued .dot-pulse, .status-running .dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }

/* Empty state */
.empty {
  display: grid; justify-items: center; gap: 14px; padding: clamp(36px, 7vw, 64px) 20px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.empty h3 { font-size: 18px; }
.empty p { max-width: 40ch; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }

/* Drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--dur-2) var(--ease-out);
}
.drop-target {
  display: grid; justify-items: center; gap: 16px; width: min(560px, 100%); padding: 64px 24px;
  border: 2px dashed var(--accent-ink); border-radius: 24px; background: var(--surface);
  box-shadow: var(--shadow-3); font-size: 20px; font-weight: 650;
  animation: scale-in var(--dur-3) var(--ease-out);
}

/* Skeleton */
.skeleton { display: grid; gap: 14px; padding: 8px 0; }
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-sunken) 0%, color-mix(in srgb, var(--surface-sunken) 40%, var(--surface)) 50%, var(--surface-sunken) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

/* ===================================================================== VIEWER */

.drawer-overlay {
  position: fixed; inset: 0; z-index: 44; background: var(--overlay);
  opacity: 0; transition: opacity var(--dur-3) var(--ease-out);
}
.drawer-overlay.open { opacity: 1; }
.viewer {
  position: fixed; z-index: 45; inset: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  transform: translateY(100%); transition: transform var(--dur-3) var(--ease-out);
}
.viewer.open { transform: none; }
.sheet-handle { display: none; }
@media (max-width: 1023px) {
  .viewer { top: max(12px, env(safe-area-inset-top)); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); }
  .sheet-handle { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 99px; background: var(--line); flex: none; }
}
@media (min-width: 1024px) {
  .drawer-overlay { left: var(--rail-current); }
  .viewer {
    left: var(--rail-current); transform: translateY(12px); opacity: 0;
    transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out);
    background: var(--canvas);
  }
  .viewer.open { opacity: 1; }
}
.viewer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--gutter); border-bottom: 1px solid var(--line); background: var(--surface);
}
.drawer-thumb { flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-sunken); }
.drawer-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drawer-thumb.no-thumb { display: none; }
.viewer-titles { flex: 1; min-width: 0; }
.viewer-titles h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-meta { margin-top: 2px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.download-wrap { position: relative; }
.download-menu { right: 0; top: calc(100% + 6px); }
.viewer-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px var(--gutter); border-bottom: 1px solid var(--line); background: var(--surface);
}
.watch-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 560; text-decoration: none; }
.watch-link svg { width: 18px; height: 18px; }
.find {
  position: relative; display: flex; align-items: center; gap: 2px; margin-left: auto;
  min-width: 0; flex: 1 1 240px; max-width: 360px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); padding-right: 4px;
}
.find:focus-within { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-50); }
.find > svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); }
.find input { flex: 1; min-width: 0; min-height: 38px; border: 0; padding-left: 34px; background: transparent; box-shadow: none !important; font-size: 15px; }
.find-count { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 4px; }
@media (max-width: 639px) { .find { flex-basis: 100%; max-width: none; margin-left: 0; } }
.speakers-editor { padding: 16px var(--gutter); border-bottom: 1px solid var(--line); background: var(--canvas); display: grid; gap: 12px; }
.speakers-help { color: var(--ink-2); font-size: 14px; }
.speakers-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.speakers-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.speakers-actions .check { margin-right: auto; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .viewer-head, .viewer-tools { padding-left: max(var(--gutter), calc((100% - 880px) / 2)); padding-right: max(var(--gutter), calc((100% - 880px) / 2)); }
  .drawer-body > * { max-width: 880px; margin-left: auto; margin-right: auto; }
}

/* Transcript text: the best typography on the site. */
.transcript { max-width: 880px; }
.para {
  position: relative; display: grid; gap: 4px 20px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  content-visibility: auto; contain-intrinsic-size: auto 96px;
}
.para:last-child { border-bottom: 0; }
@media (min-width: 768px) { .para { grid-template-columns: 64px 1fr; } }
.para-head { display: flex; align-items: center; gap: 10px; }
@media (min-width: 768px) { .para-head { display: contents; } }
.ts {
  align-self: start; padding-top: 6px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums;
}
a.ts:hover, button.ts:hover { color: var(--accent-ink); }
button.ts { border: 0; background: none; cursor: pointer; text-align: left; padding-left: 0; }
.para-text { max-width: 68ch; font-size: var(--text-lg); line-height: 1.75; color: var(--ink); }
.who {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px;
  font-size: 13px; font-weight: 650; color: var(--spk);
}
.who i {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: color-mix(in srgb, var(--spk) 16%, transparent); color: var(--spk);
  font-size: 11px; font-style: normal; font-weight: 700;
}
.spk-0 { --spk: var(--spk-0); } .spk-1 { --spk: var(--spk-1); } .spk-2 { --spk: var(--spk-2); }
.spk-3 { --spk: var(--spk-3); } .spk-4 { --spk: var(--spk-4); } .spk-5 { --spk: var(--spk-5); }
.para-copy {
  position: absolute; right: 0; top: 12px; opacity: 0;
  transition: opacity var(--dur-1);
}
.para:hover .para-copy, .para:focus-within .para-copy { opacity: 1; }
@media (hover: none) { .para-copy { opacity: .7; } }
.para.is-current { background: linear-gradient(90deg, var(--accent-50), transparent 70%); border-radius: 10px; }
.transcript.is-raw .para { grid-template-columns: 1fr; }
.body-empty { padding: 56px 16px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.body-empty strong { color: var(--ink); font-size: 17px; }
.upsell {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-50); color: var(--ink); font-size: 14px;
}

/* AI summary */
.insights { display: grid; gap: 14px; padding: 16px 0; }
.ins-card {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
  animation: row-in var(--dur-3) var(--ease-out) both;
}
.ins-card:nth-child(2) { animation-delay: 60ms; } .ins-card:nth-child(3) { animation-delay: 120ms; }
.ins-card:nth-child(4) { animation-delay: 180ms; } .ins-card:nth-child(5) { animation-delay: 240ms; }
.ins-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; color: var(--muted); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.ins-card h3 svg { width: 16px; height: 16px; color: var(--accent-ink); }
.ins-card p { font-size: var(--text-lg); line-height: 1.7; }
.ins-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ins-card li { position: relative; padding-left: 18px; line-height: 1.6; color: var(--ink); }
.ins-card li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ins-todo li { padding-left: 0; }
.ins-todo li::before { display: none; }
.ins-todo label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ins-todo input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent-ink); flex: none; }
.ins-todo input:checked + span { color: var(--muted); text-decoration: line-through; }
.insights-note { color: var(--muted); font-size: 13px; text-align: center; }
.ins-locked { position: relative; }
.ins-locked .insights { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; }
.ins-lock-card {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%);
  width: min(380px, calc(100% - 16px)); padding: 24px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface-raised); box-shadow: var(--shadow-3);
  display: grid; justify-items: center; gap: 10px;
}
.ins-lock-card p { color: var(--ink-2); font-size: 14px; }

/* =================================================================== SETTINGS */

.settings-page { max-width: 1040px; }
.settings-head { margin-bottom: 22px; }
.settings-head h1 { font-size: var(--text-2xl); letter-spacing: -0.03em; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--ink); }
@media (min-width: 1024px) { .back-link { display: none; } }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.settings-tabs {
  position: sticky; top: 56px; z-index: 5;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab, .settings-subtab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.settings-tab:hover, .settings-subtab:hover { background: var(--surface-sunken); color: var(--ink); }
.settings-tab.is-active, .settings-subtab.is-active { background: var(--accent-50); color: var(--accent-ink-strong); font-weight: 600; }
.tab-group { display: contents; }
.tab-group-toggle { display: none; }
.settings-subtabs { display: contents; }
.settings-subtabs[hidden] { display: contents !important; }
.tab-group-toggle.has-active { color: var(--accent-ink-strong); }
@media (min-width: 900px) {
  .settings-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
  .settings-tabs { flex-direction: column; top: 24px; margin: 0; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
  .tab-group { display: grid; gap: 2px; }
  .tab-group-toggle { display: flex; justify-content: space-between; }
  .tab-group-toggle svg { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease-out); }
  .tab-group.is-open .tab-group-toggle svg { transform: rotate(180deg); }
  .settings-subtabs { display: grid; gap: 2px; padding-left: 12px; margin-left: 12px; border-left: 1px solid var(--line); }
  .settings-subtabs[hidden] { display: none !important; }
  .settings-tab, .settings-subtab { width: 100%; }
}
.settings-panels { min-width: 0; }
.settings-panel { display: grid; gap: 16px; min-width: 0; animation: page-in var(--dur-3) var(--ease-out); }
.settings-form {
  display: grid; gap: 14px; min-width: 0;
  padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-1);
}
.settings-form h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.settings-form > .btn, .settings-form form > .btn { justify-self: start; }
.settings-form.is-locked textarea { opacity: .6; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.danger-zone h3 { color: var(--danger); }
.account-facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.account-facts dt { color: var(--muted); font-size: 14px; }
.account-facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-seg { justify-self: start; }

/* Usage */
.usage-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.usage-big b { font-size: 40px; font-weight: 680; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.usage-big span { color: var(--muted); }
.usage-meter { height: 10px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.usage-meter div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-glow)); transition: width var(--dur-4) var(--ease-out); }
.usage-meter div.warn { background: var(--warning); }
.usage-chart { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 220px; padding-top: 18px; }
.usage-scale { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 24px; color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.usage-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(3px, 1vw, 10px); align-items: end; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 50%; }
.usage-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.usage-bar {
  width: 100%; max-width: 32px; min-height: 0; border-radius: 6px 6px 2px 2px;
  background: color-mix(in srgb, var(--accent) 45%, var(--surface-sunken));
  transform-origin: bottom; animation: grow var(--dur-4) var(--ease-out) both;
}
.usage-col.is-current .usage-bar { background: var(--accent); box-shadow: var(--highlight); }
.usage-month { position: absolute; bottom: -22px; color: var(--muted); font-size: 11.5px; }
.usage-value { position: absolute; top: -20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.usage-col::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px);
  padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--surface);
  font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 2;
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.usage-col::after { display: none; }
.usage-col:hover::after, .usage-col:focus-visible::after { display: block; opacity: 1; transform: translate(-50%, 0); animation: pop-in var(--dur-2) var(--ease-out); }
.usage-col:nth-child(-n+3):hover::after, .usage-col:nth-child(-n+3):focus-visible::after { left: 0; transform: none; }
.usage-col:nth-last-child(-n+3):hover::after, .usage-col:nth-last-child(-n+3):focus-visible::after { left: auto; right: 0; transform: none; }
.usage-table { width: 100%; margin-top: 24px; border-collapse: collapse; font-size: 14px; }
.usage-table th { text-align: left; color: var(--muted); font-weight: 560; padding: 8px 0; border-bottom: 1px solid var(--line); }
.usage-table td { padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.usage-table th:not(:first-child), .usage-table td:not(:first-child) { text-align: right; }
.usage-items { display: grid; }
.usage-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.usage-item:last-child { border-bottom: 0; }
.usage-item-main { min-width: 0; }
.usage-item-title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-item-meta { color: var(--muted); font-size: 13px; }
.usage-item-minutes { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent-50); color: var(--accent-ink-strong); font-size: 11.5px; font-weight: 600; }
.usage-tag.muted { background: var(--surface-sunken); color: var(--muted); }

/* Connect the CLI */
.connect-card { text-align: center; justify-items: center; }
.connect-code {
  padding: 14px 22px; border-radius: var(--r-lg); background: var(--surface-sunken);
  font-family: var(--font-mono); font-size: clamp(26px, 6vw, 36px); font-weight: 600; letter-spacing: .12em;
}
.connect-warn { max-width: 52ch; padding: 12px 14px; border-radius: var(--r-md); background: var(--warning-bg); color: var(--ink); font-size: 14px; text-align: left; }
.connect-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.connect-actions .btn { min-width: 140px; min-height: 48px; }
.dev-lock-inline { display: grid; justify-items: center; gap: 10px; }

/* Developers */
.dev-lock { background: linear-gradient(180deg, var(--accent-50), var(--surface-raised)); border-color: var(--accent-100); }
.token-label { display: block; font-size: 14px; font-weight: 560; margin-bottom: 6px; }
.token-label span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.token-create { display: flex; gap: 8px; }
.token-create input { flex: 1; min-width: 0; }
@media (max-width: 479px) { .token-create { flex-direction: column; } }
.token-new { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--accent-50); border: 1px solid var(--accent-100); }
.token-copy { display: flex; align-items: center; gap: 8px; min-width: 0; }
.token-copy code { flex: 1; min-width: 0; padding: 10px 12px !important; background: var(--surface) !important; overflow-x: auto; white-space: nowrap; overflow-wrap: normal !important; }
.token-list { display: grid; }
.token-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
.token-row:last-child { border-bottom: 0; }
.token-info { min-width: 0; flex: 1; }
.token-name { font-weight: 600; }
.token-meta { color: var(--muted); font-size: 13px; }
.token-actions { display: flex; gap: 6px; }
.token-rename { display: flex; gap: 6px; flex-wrap: wrap; }
.token-rename input { flex: 1; min-width: 160px; min-height: 36px; }
.dev-cards { display: grid; gap: 10px; }
@media (min-width: 768px) { .dev-cards { grid-template-columns: repeat(3, 1fr); } }
.dev-card {
  display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); text-decoration: none; transition: border-color var(--dur-1), box-shadow var(--dur-2);
}
.dev-card:hover { border-color: var(--accent-ink); color: var(--ink); box-shadow: var(--shadow-2); }
.dev-card span { color: var(--muted); font-size: 14px; }
.dev-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink-2); }
.dev-label { font-size: 14px; font-weight: 600; margin-top: 4px; }
.dev-steps-text { color: var(--ink-2); font-size: 14.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mcp-tools { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); font-size: 14.5px; }

/* Code: charcoal in both themes, so examples always look like a terminal. */
.code-wrap { position: relative; min-width: 0; }
.code-block {
  margin: 0; padding: 18px 20px; overflow-x: auto; max-width: 100%;
  border-radius: var(--r-md); background: var(--code-bg); color: var(--code-ink);
  font-size: 13px; line-height: 1.65; tab-size: 4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.code-sample { max-height: 520px; }
.code-short { padding-right: 84px; }
.code-copy {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: rgba(255, 255, 255, .08) !important; color: #e6e9ec !important; border-color: rgba(255, 255, 255, .12) !important; box-shadow: none !important;
}
.code-copy:hover { background: rgba(255, 255, 255, .16) !important; }
.tok-comment { color: #7d8792; font-style: italic; }
.tok-string { color: #5eead4; }
.tok-key { color: #93c5fd; }
.tok-number { color: #fdba74; }
.tok-keyword { color: #c4b5fd; }
.tok-function { color: #f0abfc; }
.tok-variable { color: #fcd34d; }
.tok-flag { color: #93c5fd; }
.endpoint-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.endpoint-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.endpoint-table th { text-align: left; padding: 10px 14px; background: var(--canvas); color: var(--muted); font-weight: 560; }
.endpoint-table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.endpoint-table td:first-child { white-space: nowrap; }

/* ===================================================================== LEGAL */

.legal-page { background: var(--surface); }
.legal-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 100%; padding: 14px var(--gutter);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.legal-top nav { display: flex; gap: 4px; }
.legal-top nav a { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.legal-top nav a:hover { background: var(--surface-sunken); color: var(--ink); }
.legal-top nav a[aria-current="page"] { background: var(--accent-50); color: var(--accent-ink-strong); font-weight: 600; }
.legal { max-width: 720px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) var(--gutter) 64px; line-height: 1.75; color: var(--ink-2); font-size: 16.5px; }
.legal h1 { font-size: var(--text-3xl); color: var(--ink); letter-spacing: -0.035em; }
.legal h2 { margin: 40px 0 10px; font-size: 21px; color: var(--ink); }
.legal p, .legal ul { margin: 12px 0; }
.legal li { margin: 6px 0; }
.legal strong { color: var(--ink); }
.legal-meta { color: var(--muted); font-size: 14px; }
.legal-summary { margin: 28px 0; padding: 20px 22px; border: 1px solid var(--accent-100); border-radius: var(--r-lg); background: var(--accent-50); color: var(--ink); }
.legal-summary p:first-child { margin-top: 0; }
.legal-summary ul { margin-bottom: 0; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  max-width: 720px; margin: 0 auto; padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px;
}
.footer a { color: var(--muted); }

/* ================================================================== MOTION */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } }
@keyframes scale-in { from { opacity: 0; transform: scale(.96); } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes num-in { from { opacity: 0; transform: translateY(40%); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes ping { 0% { opacity: .7; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes letter-out { to { opacity: 0; transform: translateY(-40%); filter: blur(2px); } }
@keyframes letter-in { from { opacity: 0; transform: translateY(45%); filter: blur(2px); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes bar { 0% { transform: scaleY(.18); } 100% { transform: scaleY(1); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes type-2 { 0%, 4% { clip-path: inset(0 100% 0 0); } 16%, 88% { clip-path: inset(0 0 0 0); } 96%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes type-3 { 0%, 20% { clip-path: inset(0 100% 0 0); } 32%, 88% { clip-path: inset(0 0 0 0); } 96%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes type-4 { 0%, 36% { clip-path: inset(0 100% 0 0); } 48%, 88% { clip-path: inset(0 0 0 0); } 96%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes chip { 0%, 50% { opacity: 0; transform: translateZ(100px) translateY(10px); } 58%, 88% { opacity: 1; transform: translateZ(100px); } 96%, 100% { opacity: 0; transform: translateZ(100px) translateY(10px); } }
@keyframes attention { 0% { transform: scale(1); } 30% { transform: scale(1.012); border-color: var(--accent-ink); } 100% { transform: scale(1); } }
@keyframes done-flash { 0% { background: var(--accent-50); border-color: var(--accent-ink); } 100% { background: var(--surface-raised); } }

/* Reduced motion: drop decoration, keep feedback (spinners, progress, quick fades). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  .hero-art, .wave i, .marquee-track, .pulse-dot::after, .chip-float, .t-text,
  .rotator .word::after, .job, .ins-card, .page, .settings-panel, .usage-bar, .plan-price b { animation: none !important; }
  .stage { transition: none; }
  .wave i { transform: scaleY(.6); }
  .marquee-track { flex-wrap: wrap; justify-content: center; width: auto; max-width: 900px; margin: 0 auto; }
  .marquee-track span:nth-child(n+17) { display: none; }
  .modal, .viewer, .tile, .job { transition-duration: 1ms !important; }
}

@media (forced-colors: active) {
  .btn, .tile, .plan, .job, .settings-form, .modal, .menu { border: 1px solid CanvasText; }
  .status, .lock, .plan-tag { border: 1px solid CanvasText; }
}

.demo-body { position: relative; }
@media (max-width: 479px) {
  .job { gap: 12px; padding: 12px; }
  .job-icon { width: 44px; height: 44px; border-radius: 10px; }
  .job-icon svg { width: 20px; height: 20px; }
}

.slogan { margin-top: 12px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.footer-brand .slogan + .name-origin { margin-top: 4px; }
.name-origin { font-size: 13.5px; }
.cta-slogan { position: relative; margin: 0 0 14px !important; color: #5eead4 !important; font-size: 13px !important; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }

/* Glass + panel in the charcoal theme: deep teal instead of mint. */
:root[data-theme="dark"] .panel {
  background: radial-gradient(120% 90% at 15% 0%, rgba(94, 234, 212, .22), transparent 55%), linear-gradient(155deg, #0f2524 0%, #0e3b39 40%, #0f6a65 75%, #13a59d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 80px -36px rgba(0, 0, 0, .8);
}
:root[data-theme="dark"] .panel .lines { color: rgba(94, 234, 212, .45); }
:root[data-theme="dark"] .panel .mark, :root[data-theme="dark"] .micro { color: rgba(236, 239, 242, .55); }
:root[data-theme="dark"] .glass { background: rgba(22, 25, 28, .62); border-color: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 50px -24px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .slab-title, :root[data-theme="dark"] .t-text { color: #eceff2; }
:root[data-theme="dark"] .file-chip { background: rgba(255, 255, 255, .08); color: #c3c9d0; }
:root[data-theme="dark"] .t-line { border-color: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .t-who.s2 { color: #b9a3f0; }
:root[data-theme="dark"] .t-who.s1, :root[data-theme="dark"] .lang-chip { color: #5eead4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .panel {
    background: radial-gradient(120% 90% at 15% 0%, rgba(94, 234, 212, .22), transparent 55%), linear-gradient(155deg, #0f2524 0%, #0e3b39 40%, #0f6a65 75%, #13a59d 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 80px -36px rgba(0, 0, 0, .8);
  }
  :root:not([data-theme="light"]) .panel .lines { color: rgba(94, 234, 212, .45); }
  :root:not([data-theme="light"]) .panel .mark, :root:not([data-theme="light"]) .micro { color: rgba(236, 239, 242, .55); }
  :root:not([data-theme="light"]) .glass { background: rgba(22, 25, 28, .62); border-color: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 50px -24px rgba(0, 0, 0, .8); }
  :root:not([data-theme="light"]) .slab-title, :root:not([data-theme="light"]) .t-text { color: #eceff2; }
  :root:not([data-theme="light"]) .file-chip { background: rgba(255, 255, 255, .08); color: #c3c9d0; }
  :root:not([data-theme="light"]) .t-line { border-color: rgba(255, 255, 255, .08); }
  :root:not([data-theme="light"]) .t-who.s2 { color: #b9a3f0; }
  :root:not([data-theme="light"]) .t-who.s1, :root:not([data-theme="light"]) .lang-chip { color: #5eead4; }
}

/* Numbered, monospaced section labels ("01 / Try it"). */
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; }
.kicker span { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.kicker span::after { content: ""; width: 22px; height: 1px; background: currentColor; }

/* Final call to action: flowing lines + crosshairs on charcoal. */
.cta-lines { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(94, 234, 212, .32); }
.cta-band .mark { color: rgba(236, 239, 242, .35); }
.cta-band .mark-tl, .cta-band .mark-tr { top: 22px; } .cta-band .mark-bl, .cta-band .mark-br { bottom: 22px; }
.cta-band .mark-tl, .cta-band .mark-bl { left: 22px; } .cta-band .mark-tr, .cta-band .mark-br { right: 22px; }

/* Charcoal active state: the one dark pill marks "you are here". */
@media (min-width: 1024px) {
  .nav-item.is-active { background: var(--ink); color: var(--surface); box-shadow: var(--shadow-1); }
  .nav-item.is-active .lock { background: color-mix(in srgb, var(--surface) 18%, transparent); color: var(--surface); }
}

/* Phones: a floating pill tab bar. The active tab grows into a charcoal pill with its label. */
@media (max-width: 1023px) {
  .tabbar {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between;
    height: 66px; padding: 7px; border-radius: 26px;
    border: 1px solid var(--line); background: var(--glass);
    box-shadow: var(--highlight), 0 20px 40px -16px rgba(22, 25, 28, .28), 0 2px 6px rgba(22, 25, 28, .06);
  }
  .tab-item {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px; min-width: 50px; padding: 0 14px; border-radius: 19px;
    color: var(--muted); font-size: 13.5px; font-weight: 600;
    transition: background-color var(--dur-3) var(--ease-out), color var(--dur-2), padding var(--dur-3) var(--ease-out);
  }
  .tab-item span {
    max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
    transition: max-width var(--dur-3) var(--ease-out), opacity var(--dur-2);
  }
  .tab-item.is-active { background: var(--ink); color: var(--surface); padding: 0 16px 0 14px; }
  .tab-item.is-active span { max-width: 110px; opacity: 1; }
  .tab-new { margin-top: 0; width: 50px; height: 50px; border-radius: 50%; box-shadow: var(--highlight), var(--edge), var(--shadow-accent); }
  .shell-main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .shell:not([hidden]) ~ .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 359px) { .tab-item.is-active span { max-width: 0; opacity: 0; } .tab-item.is-active { padding: 0 14px; } }

/* App canvas: a faint turquoise light from the top. */
.shell-main { background: radial-gradient(900px 360px at 50% -120px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%) no-repeat; }

@keyframes breathe { from { transform: scaleY(.9); } to { transform: scaleY(1.06); } }
@keyframes streak { to { transform: translateX(220px); } }
@media (prefers-reduced-motion: reduce) {
  .lines g, .streaks { animation: none !important; }
}

h1, h2, h3, .hero-sub, .section-intro p { text-wrap: balance; }
