
/* Layout: landing = hero grid (pitch + live example | sign-in card) over story bands (about, how, quotes, plans, FAQ, CTA).
   App = Claude-style shell: left sidebar (new chat, recents, plan, account) + centered conversation column.
   Dark-first in AI Fire near-black, with a full light theme. */
:root {
  --bg: #0f0a0c;
  --surface: #1a1115;
  --surface-2: #23171c;
  --sidebar: #140d10;
  --line: #34242b;
  --line-strong: #4b3540;
  --text: #f7eef1;
  --text-2: #cdbcc2;
  --muted: #9a868e;
  --accent: #f2468f;
  --on-accent: #ffffff;
  --term-bg: rgba(248, 174, 82, 0.13);
  --term-line: #f8ae52;
  --warn-bg: #3a2912;
  --warn-text: #ffcf8a;
  --error: #ff6b8e;
  --glow-1: rgba(234, 37, 128, 0.22);
  --glow-2: rgba(248, 174, 82, 0.16);
  --scrim: rgba(8, 4, 6, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --grad: linear-gradient(115deg, #f8ae52 0%, #ea2580 55%, #cc1d52 100%);
  --grad-btn: linear-gradient(115deg, #cc1d52 0%, #d81f68 100%);
  --on-grad: #1a0710;

  --display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --step-3: clamp(2rem, 1.2rem + 2.8vw, 3.3rem);
  --radius: 14px;

  /* Motion: short and decisive so nothing waits on an animation. */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms;
  --t: 220ms;
  --t-slow: 280ms;
  --move: 14px;
  --sb-w: 272px;
  color-scheme: dark;
  interpolate-size: allow-keywords;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbf7f6; --surface: #ffffff; --surface-2: #f5edef; --sidebar: #f6f0f1; --line: #ecdfe3; --line-strong: #d8c3cb;
    --text: #170d11; --text-2: #46363c; --muted: #76646c; --accent: #c21a4e; --on-accent: #ffffff;
    --term-bg: rgba(248, 174, 82, 0.24); --term-line: #d9831c; --warn-bg: #fff0d9; --warn-text: #7a4600; --error: #b3123f;
    --glow-1: rgba(234, 37, 128, 0.12); --glow-2: rgba(248, 174, 82, 0.16); --scrim: rgba(30, 10, 18, 0.35);
    --shadow: 0 1px 2px rgba(60, 20, 35, 0.06), 0 12px 32px rgba(60, 20, 35, 0.08);
    --grad: linear-gradient(115deg, #e0780f 0%, #ea2580 55%, #cc1d52 100%);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #fbf7f6; --surface: #ffffff; --surface-2: #f5edef; --sidebar: #f6f0f1; --line: #ecdfe3; --line-strong: #d8c3cb;
  --text: #170d11; --text-2: #46363c; --muted: #76646c; --accent: #c21a4e; --on-accent: #ffffff;
  --term-bg: rgba(248, 174, 82, 0.24); --term-line: #d9831c; --warn-bg: #fff0d9; --warn-text: #7a4600; --error: #b3123f;
  --glow-1: rgba(234, 37, 128, 0.12); --glow-2: rgba(248, 174, 82, 0.16); --scrim: rgba(30, 10, 18, 0.35);
  --shadow: 0 1px 2px rgba(60, 20, 35, 0.06), 0 12px 32px rgba(60, 20, 35, 0.08);
  --grad: linear-gradient(115deg, #e0780f 0%, #ea2580 55%, #cc1d52 100%);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body.in-app { overflow: hidden; }
/* Ambient ember glow behind the landing page */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto;
  height: 80vh;
  background:
    radial-gradient(40% 50% at 72% 28%, var(--glow-1), transparent 70%),
    radial-gradient(35% 45% at 22% 8%, var(--glow-2), transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: drift 24s ease-in-out infinite alternate;
}
body.in-app::before { display: none; }
@keyframes drift { to { transform: translate3d(-4%, 3%, 0) scale(1.06); } }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p, dl, dd, figure, blockquote { margin: 0; }
.wrap { max-width: 1160px; margin-inline: auto; }
.muted { color: var(--text-2); }
.fine { color: var(--muted); font-size: var(--step--1); display: flex; gap: 6px; align-items: center; }
.row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i-sm { width: 16px; height: 16px; flex: none; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.06; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn-primary, .btn-ghost {
  position: relative; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  font: 600 var(--step-0)/1.2 var(--body); border-radius: 11px; padding: 12px 20px; text-decoration: none; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-primary {
  border: 0; color: var(--on-accent); background: var(--grad-btn);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 20px -8px rgba(234, 37, 128, 0.65);
}
.btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-primary .i-sm { transition: transform var(--t) var(--ease); }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 12px 28px -10px rgba(234, 37, 128, 0.75); }
  .btn-primary:hover .i-sm { transform: translateX(3px); }
  .btn-ghost:hover { background: var(--surface-2); border-color: var(--text-2); }
}
.btn-primary:active, .btn-ghost:active { transform: scale(0.97); transition-duration: 60ms; }
/* Loading: keep the button's size, swap the label for a spinner. */
[aria-busy="true"].btn-primary { color: transparent; pointer-events: none; }
[aria-busy="true"].btn-primary::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-text { border: 0; background: none; color: var(--text-2); padding: 4px 0; font: 500 var(--step-0) var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color var(--t-fast); }
.btn-text:hover { color: var(--text); }
.btn-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; position: relative;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.btn-icon svg { width: 20px; height: 20px; }
@media (hover: hover) { .btn-icon:hover:not(:disabled) { background: var(--surface-2); color: var(--text); } }
.btn-icon:active:not(:disabled) { transform: scale(0.92); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- inputs ---------- */
label { display: block; font-weight: 600; font-size: var(--step--1); color: var(--text-2); }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow-1); }
.error { color: var(--error); font-size: var(--step--1); }
.error:empty { display: none; }
.error:not(:empty) { animation: nudge var(--t) var(--ease); }
@keyframes nudge { 30% { transform: translateX(-3px); } 60% { transform: translateX(2px); } }

/* ---------- landing header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.brand-by { font-size: var(--step--1); color: var(--muted); }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav > a:not(.btn-ghost):not(.btn-primary) { color: var(--text-2); text-decoration: none; font-weight: 500; transition: color var(--t-fast); }
.site-nav > a:not(.btn-ghost):not(.btn-primary):hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  grid-template-areas: "copy auth" "preview auth";
  column-gap: clamp(28px, 5vw, 72px); row-gap: 36px; align-items: start;
  padding-block: clamp(36px, 7vw, 84px) clamp(48px, 7vw, 88px);
}
.hero-copy { grid-area: copy; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero-copy > * { animation: rise 0.5s var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: 50ms; }
.hero-copy > :nth-child(3) { animation-delay: 100ms; }
.hero-copy > :nth-child(4) { animation-delay: 150ms; }
.hero-copy > :nth-child(5) { animation-delay: 200ms; }
.hero h1 { font-size: var(--step-3); }
.lede { font-size: var(--step-1); color: var(--text-2); max-width: 36ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { color: var(--muted); font-size: 0.92rem; }
.trust strong { color: var(--text); font-weight: 600; }

.preview {
  grid-area: preview; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; max-width: 560px; animation: rise 0.6s var(--ease-out) 250ms both;
}
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.preview-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.preview-bar p { margin-left: 8px; font: 500 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.preview-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 196px; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.preview-body.swap { opacity: 0; transform: translateY(6px); }
.preview-q { align-self: flex-end; background: var(--surface-2); border-radius: 14px 14px 4px 14px; padding: 8px 12px; font-size: 0.95rem; max-width: 90%; }
.preview-a { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; color: var(--text-2); }
.preview-a p { min-width: 0; }
.avatar-mark { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.preview-src { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--muted); padding-top: 12px; border-top: 1px dashed var(--line); }
.src-num {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; flex: none;
  font: 500 0.7rem/1 var(--mono); background: var(--term-bg); color: var(--text); border: 1px solid var(--term-line); text-decoration: none;
}

.auth { grid-area: auth; position: sticky; top: 88px; min-width: 0; animation: rise 0.5s var(--ease-out) 120ms both; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; position: relative;
}
.auth-card::before, .plan-featured::before, .limit::before, .cta-band .cta-inner::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.auth-card::before { opacity: 0.55; }
.auth-card h2 { font-family: var(--display); font-size: 1.6rem; letter-spacing: -0.015em; }
.signed-in-card #signed-in-email { overflow-wrap: anywhere; }
.signed-in-detail { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.signed-in-card > .btn-primary { width: 100%; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.auth-card .btn-primary { width: 100%; margin-top: 4px; }
.step-chip { font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.code-input { font: 500 1.5rem/1 var(--mono); letter-spacing: 0.4em; text-align: center; }
.dev-note { background: var(--warn-bg); color: var(--warn-text); padding: 10px 12px; border-radius: 10px; font-size: var(--step--1); }

/* ---------- story bands ---------- */
.band { padding-block: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); }
.band .wrap > .eyebrow { margin-bottom: 10px; }
.section-title { font-family: var(--display); font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.12; max-width: 24ch; }
.section-sub { margin-top: 12px; max-width: 60ch; font-size: 1.05rem; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stats > div { background: var(--bg); padding: 22px 20px; display: flex; flex-direction: column-reverse; gap: 4px; }
.stats dt { color: var(--muted); font-size: var(--step--1); }
.stats dd { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats > div:first-child dd { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px; transition: transform var(--t) var(--ease), border-color var(--t);
}
@media (hover: hover) { .pillar:hover { transform: translateY(-3px); border-color: var(--line-strong); } }
.pillar-icon { width: 40px; height: 40px; padding: 9px; border-radius: 11px; background: var(--term-bg); color: var(--term-line); }
.pillar h3 { font-size: var(--step-1); font-weight: 600; margin-top: 4px; }
.pillar p { color: var(--text-2); flex: 1; }
.pillar a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; }
.pillar a:hover { text-decoration: underline; }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps li { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 2px solid var(--line-strong); position: relative; }
.steps li::before { content: ""; position: absolute; top: -2px; left: 0; width: 40px; height: 2px; background: var(--grad); }
.steps li h3 { font-size: var(--step-1); font-weight: 600; }
.steps li p { color: var(--text-2); }
.step-num { font: 500 0.8rem var(--mono); color: var(--accent); }

.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.quote blockquote { font-family: var(--display); font-weight: 500; font-size: 1.2rem; line-height: 1.35; letter-spacing: -0.01em; }
.quote figcaption { display: flex; flex-direction: column; font-size: var(--step--1); color: var(--muted); }
.quote figcaption strong { color: var(--text); font-size: var(--step-0); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; align-items: stretch; }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  display: flex; flex-direction: column; gap: 8px; position: relative; transition: transform var(--t) var(--ease), border-color var(--t);
}
@media (hover: hover) { .plan:hover { transform: translateY(-3px); border-color: var(--line-strong); } }
.plan h3 { font-size: var(--step-1); font-weight: 600; }
.plan-featured { border-color: transparent; box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -11px; left: 24px; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: var(--grad); color: var(--on-grad); }
.price { font-family: var(--display); font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price span { font-family: var(--body); font-size: var(--step-0); font-weight: 500; color: var(--muted); }
.price-note { color: var(--muted); font-size: var(--step--1); }
.plan ul { list-style: none; padding: 16px 0 0; margin: 8px 0 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; color: var(--text-2); flex: 1; }
.plan ul strong { color: var(--text); font-variant-numeric: tabular-nums; }
.plan-cta { width: 100%; }
.plans-note { margin-top: 16px; }

.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); }
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: linear-gradient(var(--text-2), var(--text-2)) center / 12px 2px no-repeat, linear-gradient(var(--text-2), var(--text-2)) center / 2px 12px no-repeat;
  transition: transform var(--t) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); padding-bottom: 18px; max-width: 60ch; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size var(--t) var(--ease), content-visibility var(--t) allow-discrete; }
.faq details[open]::details-content { block-size: auto; }

.cta-band { border-top: 0; }
.cta-inner {
  position: relative; border-radius: 24px; padding: clamp(32px, 6vw, 64px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 24px; background: var(--surface); overflow: hidden;
}
.cta-inner::after {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%;
  background: radial-gradient(50% 50% at 50% 0%, var(--glow-1), transparent 70%); pointer-events: none;
}
.cta-inner > * { position: relative; z-index: 1; }
.cta-inner h2 { font-size: var(--step-3); max-width: 16ch; }

.site-footer { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--text); }

/* ---------- app shell (signed in) ---------- */
.app-shell {
  position: fixed; inset: 0; display: flex; background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
}
.sidebar {
  width: var(--sb-w); flex: none; display: flex; flex-direction: column; gap: 6px;
  background: var(--sidebar); border-right: 1px solid var(--line);
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  transition: margin-left var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  z-index: 40;
}
.app-shell.sb-collapsed .sidebar { margin-left: calc(-1 * var(--sb-w)); }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px 6px; }
.sb-top .brand-name { font-size: 1.15rem; }
.sb-top .brand-mark { width: 24px; height: 24px; }
.sb-new {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text); font: 600 0.95rem var(--body); cursor: pointer; text-align: left;
  transition: background-color var(--t-fast);
}
.sb-new-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-btn); color: var(--on-accent); transition: transform var(--t) var(--ease); }
@media (hover: hover) { .sb-new:hover { background: var(--surface-2); } .sb-new:hover .sb-new-icon { transform: rotate(90deg); } }
.sb-new:active { transform: scale(0.98); }

.sb-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); font: 500 0.92rem var(--body); cursor: pointer; text-align: left;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.i-md { width: 20px; height: 20px; flex: none; margin-inline: 4px; }
@media (hover: hover) { .sb-link:hover { background: var(--surface-2); color: var(--text); } }
.sb-link[aria-current="true"] { background: var(--surface-2); color: var(--text); }

.sb-lists { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; padding-right: 2px; display: flex; flex-direction: column; gap: 12px; }
.sb-label { font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px; }
.chat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.sb-empty { color: var(--muted); font-size: var(--step--1); padding: 4px 10px; }
.chat-row { position: relative; display: flex; align-items: center; border-radius: 9px; transition: background-color var(--t-fast); }
.chat-row.new { animation: slot-in var(--t) var(--ease-out); }
@keyframes slot-in { from { opacity: 0; transform: translateY(-6px); } }
.recent {
  flex: 1; min-width: 0; display: block; text-align: left; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent;
  color: var(--text-2); font: 400 0.92rem/1.35 var(--body); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--t-fast);
}
@media (hover: hover) { .chat-row:hover { background: var(--surface-2); } .chat-row:hover .recent { color: var(--text); } }
.chat-row:has(.recent[aria-current="true"]) { background: var(--surface-2); }
.recent[aria-current="true"] { color: var(--text); font-weight: 500; }
.row-more {
  flex: none; width: 30px; height: 30px; margin-right: 3px; border-radius: 7px; border: 0; background: transparent;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer; opacity: 0;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}
.row-more svg { width: 18px; height: 18px; }
.chat-row:hover .row-more, .chat-row:focus-within .row-more, .row-more[aria-expanded="true"],
.chat-row:has(.recent[aria-current="true"]) .row-more { opacity: 1; }
@media (hover: none) { .row-more { opacity: 0.7; } }
.row-more:hover, .row-more[aria-expanded="true"] { background: var(--line); color: var(--text); }
.row-pin { width: 13px; height: 13px; flex: none; color: var(--muted); margin-left: -4px; margin-right: 2px; }
.rename-input { flex: 1; min-width: 0; margin: 2px; padding: 6px 8px; font-size: 0.92rem; border-radius: 8px; }
.sb-archived {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; background: none; color: var(--muted);
  font: 500 var(--step--1) var(--body); cursor: pointer; border-radius: 8px; text-align: left;
}
.sb-archived:hover { color: var(--text); background: var(--surface-2); }

.sb-bottom { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.plan-card { padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.plan-card-head { display: flex; justify-content: space-between; align-items: center; }
.upgrade-link { font-size: var(--step--1); font-weight: 600; text-decoration: none; }
.upgrade-link:hover { text-decoration: underline; }
.tier-badge {
  font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text);
}
.tier-badge[data-tier="Spark"], .tier-badge[data-tier="Premium"] { border-color: transparent; background: var(--grad); color: var(--on-grad); }
.meters { display: flex; flex-direction: column; gap: 8px; }
.meter { display: flex; flex-direction: column; gap: 4px; border-radius: 6px; transition: background-color var(--t); }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.meter-value { font: 500 0.75rem var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.meter-bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: var(--fill, 100%); background: var(--grad); border-radius: inherit; transition: width var(--t-slow) var(--ease-out); }
.meter.bump .meter-value { animation: tick 0.5s var(--ease); }
@keyframes tick { 30% { color: var(--accent); transform: translateY(-1px); } }
.account {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); cursor: pointer; text-align: left; min-width: 0; font: inherit;
  transition: background-color var(--t-fast);
}
@media (hover: hover) { .account:hover { background: var(--surface-2); } }
.account[aria-expanded="true"] { background: var(--surface-2); }
.account:active { transform: scale(0.99); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad); color: var(--on-grad); font: 700 0.88rem var(--body); }
.acct-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.acct-email { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-plan { font-size: 0.75rem; color: var(--muted); }
.acct-chev { color: var(--muted); }

/* ---------- menus (account, chat, project) ---------- */
.menu {
  position: fixed; z-index: 100; min-width: 232px; max-width: calc(100vw - 24px); padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 1px; transform-origin: var(--origin, top left);
  animation: menu-in var(--t-fast) var(--ease-out) both;
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } }
.menu-header { padding: 8px 10px 6px; font-size: var(--step--1); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 0;
  background: transparent; color: var(--text); font: 400 0.93rem var(--body); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.menu-item .menu-end { margin-left: auto; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible, .menu-item[aria-expanded="true"] { background: var(--surface-2); outline: none; }
.menu-item.danger, .menu-item.danger > svg { color: var(--error); }
.menu-item[aria-checked="true"] .menu-end { color: var(--accent); }
.menu-item:disabled { opacity: 0.5; cursor: default; background: none; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; border: 0; }

/* ---------- dialogs ---------- */
.dialog {
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text);
  width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow);
  opacity: 1; transform: none; transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out), overlay var(--t-fast) allow-discrete, display var(--t-fast) allow-discrete;
}
.dialog-wide { width: min(520px, calc(100vw - 32px)); }
.dialog:not([open]) { opacity: 0; transform: scale(0.97); }
@starting-style { .dialog[open] { opacity: 0; transform: scale(0.97); } }
.dialog::backdrop { background: var(--scrim); transition: opacity var(--t-fast); }
@starting-style { .dialog[open]::backdrop { opacity: 0; } }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body h2 { font-family: var(--display); font-size: 1.3rem; letter-spacing: -0.01em; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin: -6px -8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; padding: 8px 14px;
  background: #c4153f; color: #ffffff; font: 600 0.9rem var(--body); cursor: pointer;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast);
}
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger:active { transform: scale(0.97); }
.setting { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.setting h3 { font-size: 0.95rem; font-weight: 600; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.segmented button {
  border: 0; background: transparent; color: var(--text-2); padding: 6px 14px; border-radius: 8px; font: 500 0.88rem var(--body); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.kv { display: flex; flex-direction: column; gap: 6px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; text-align: right; }
.usage-meters { gap: 14px; }
.usage-meters .meter-top { font-size: 0.88rem; }

/* ---------- pages (projects, archived) ---------- */
.view { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page { width: 100%; max-width: 880px; margin-inline: auto; padding-block: 20px 56px; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); overflow-wrap: anywhere; }
.page-head .muted { margin-top: 6px; }
.min0 { min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-2); font: 500 0.9rem var(--body); cursor: pointer; padding: 4px 0; align-self: flex-start; }
.back-link:hover { color: var(--text); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.project-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer; font: inherit; min-height: 118px;
  transition: border-color var(--t-fast), transform var(--t) var(--ease);
  animation: rise var(--t) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms);
}
@media (hover: hover) { .project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); } }
.project-card:active { transform: scale(0.99); }
.project-card svg { width: 22px; height: 22px; color: var(--term-line); }
.project-card strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.project-card span { color: var(--muted); font-size: var(--step--1); margin-top: auto; }
.row-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.row-list li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; animation: rise var(--t) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.row-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border: 0; background: none; color: var(--text);
  text-align: left; cursor: pointer; border-radius: 10px; font: inherit; transition: background-color var(--t-fast);
}
.row-open:hover { background: var(--surface-2); }
.row-open strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-open span { color: var(--muted); font-size: var(--step--1); }
.row-list .row-more { opacity: 1; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 16px; border: 1px dashed var(--line-strong); border-radius: 16px; }
.empty h2 { font-size: 1.15rem; }
.empty .muted { max-width: 42ch; }
.empty-icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--term-bg); color: var(--term-line); }
.empty .btn-ghost { margin-top: 8px; }
.project-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--term-bg); color: var(--text); font-size: 0.85rem; font-weight: 500; }
.project-chip svg { color: var(--term-line); }
.crumb { border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.crumb:hover { color: var(--text); text-decoration: underline; }
.crumb-sep { color: var(--muted); margin-inline: 6px; }

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 35; animation: fade-in var(--t) var(--ease); }

.main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px; min-height: 56px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding-inline: 10px;
}
.chat-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.app-shell:not(.sb-collapsed) #btn-open-sidebar { visibility: hidden; }
.thread, .dock { width: 100%; max-width: 760px; margin-inline: auto; }
.thread { flex: 1; display: flex; flex-direction: column; }

/* App entrance and step transitions (classes added by app.js) */
.enter-fwd { animation: step-in-fwd var(--t) var(--ease-out) both; }
.enter-back { animation: step-in-back var(--t) var(--ease-out) both; }
.enter-app .sidebar { animation: sb-in var(--t-slow) var(--ease-out) both; }
.enter-app .main { animation: main-in var(--t-slow) var(--ease-out) both; }
.enter-chat { animation: chat-in var(--t) var(--ease-out) both; }
@keyframes step-in-fwd { from { opacity: 0; transform: translateX(var(--move)); } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(calc(-1 * var(--move))); } }
@keyframes sb-in { from { opacity: 0; transform: translateX(-12px); } }
@keyframes main-in { from { opacity: 0; transform: scale(0.99); } }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } }
.landing.leaving { opacity: 0; transform: scale(0.99); transition: opacity 160ms var(--ease), transform 160ms var(--ease); }

.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-block: clamp(32px, 12vh, 120px) 24px; }
.welcome-mark { width: 44px; height: 44px; animation: flicker 3.5s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.06) rotate(-2deg); filter: drop-shadow(0 0 10px var(--glow-1)); } }
.welcome h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 18px; text-align: left; }
.example {
  padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: flex; flex-direction: column; gap: 4px; font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t) var(--ease), background-color var(--t-fast);
  animation: rise 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 80ms);
}
@media (hover: hover) { .example:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-2px); } }
.example:active { transform: scale(0.98); }
.example-tag { font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

.messages { list-style: none; margin: 16px 0 24px; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.msg { animation: rise var(--t) var(--ease-out) both; min-width: 0; }
.msg.static { animation: none; }
.msg.has-pop, .points li.has-pop { position: relative; z-index: 5; }
.msg.user { align-self: flex-end; max-width: min(85%, 560px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.msg.user .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.msg-images img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); animation: pop-in var(--t) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.img-chip { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.9); } }

.msg.bot { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.msg.bot .avatar-mark { width: 28px; height: 28px; margin-top: 2px; }
.answer { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.answer-body { display: flex; flex-direction: column; gap: 10px; }
.answer-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-body .note { color: var(--muted); font-size: 0.92rem; }
.points { margin: 0; padding: 0; list-style: none; counter-reset: pt; display: flex; flex-direction: column; gap: 10px; }
.points li { counter-increment: pt; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; overflow-wrap: anywhere; }
.points li::before { content: counter(pt); font: 500 0.75rem/1.9 var(--mono); color: var(--muted); }
.points li:not(.shown) { opacity: 0; }
.points li.shown { animation: fade-in 0.2s ease both; }

.status { display: flex; align-items: center; gap: 10px; color: var(--muted); min-height: 28px; }
.status-text {
  background: linear-gradient(90deg, var(--muted) 0%, var(--text) 45%, var(--muted) 90%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #cc1d52; animation: dot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.14s; background: #ea2580; }
.dots i:nth-child(3) { animation-delay: 0.28s; background: #f8ae52; }
@keyframes dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Key-term citations */
.term-wrap { position: relative; display: inline; }
.term {
  font: inherit; color: inherit; cursor: pointer; padding: 0 2px; margin: 0 -1px; border: 0; border-radius: 4px;
  background: linear-gradient(var(--term-bg), var(--term-bg)) no-repeat 0 100% / 0% 100%;
  box-shadow: inset 0 -1.5px 0 transparent;
  transition: background-size 0.5s var(--ease-out), box-shadow var(--t);
}
.lit .term, .demo-term { background-size: 100% 100%; box-shadow: inset 0 -1.5px 0 var(--term-line); }
.term:hover, .term[aria-expanded="true"] { box-shadow: inset 0 -2.5px 0 var(--term-line); }
.term sup, .demo-term sup { font: 500 0.62rem var(--mono); color: var(--accent); margin-left: 1px; vertical-align: super; line-height: 0; }
.demo-term { padding: 0 2px; border-radius: 4px; color: var(--text); }
.term-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: var(--dx, 0px);
  width: min(320px, calc(100vw - 32px)); padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; white-space: normal;
  animation: pop-in var(--t-fast) var(--ease-out) both; transform-origin: top left;
}
.pop-source { font: 500 0.7rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.pop-snippet { color: var(--text); border-left: 2px solid var(--term-line); padding-left: 10px; }
.pop-link { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; text-decoration: none; }
.pop-link:hover { text-decoration: underline; }
.cite { margin-left: 4px; vertical-align: 1px; transition: transform var(--t-fast) var(--ease); }
.cite:hover { transform: translateY(-1px); }

.sources-label { font: 500 0.72rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sources { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.source { animation: rise var(--t) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); min-width: 0; }
.static .source { animation: none; }
.source a {
  height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t) var(--ease);
}
@media (hover: hover) { .source a:hover { border-color: var(--line-strong); transform: translateY(-2px); } }
.source-head { display: flex; gap: 8px; align-items: flex-start; }
.source-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; overflow-wrap: anywhere; }
.source .meta { color: var(--muted); font-size: var(--step--1); margin-top: auto; }
.outdated { align-self: flex-start; background: var(--warn-bg); color: var(--warn-text); font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; }

.rating { display: flex; gap: 8px; }
.rating button {
  border: 1px solid var(--line); background: transparent; color: var(--text-2); border-radius: 999px; padding: 4px 12px;
  font: 500 var(--step--1) var(--body); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
@media (hover: hover) { .rating button:hover { color: var(--text); border-color: var(--line-strong); } }
.rating button:active { transform: scale(0.94); }
.rating button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.retry-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Dock & composer */
.dock {
  position: sticky; bottom: 0; z-index: 10; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--bg) 24%);
  display: flex; flex-direction: column; gap: 10px;
}
.limit {
  position: relative; padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; animation: slide-up var(--t-slow) var(--ease-out) both;
}
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } }
.composer {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; padding: 8px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; transition: border-color var(--t-fast), box-shadow var(--t);
}
.composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--glow-1); }
.composer .error { padding-inline: 8px; }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; background: transparent; padding: 10px 6px; max-height: 180px; line-height: 1.5; }
.composer textarea:focus { box-shadow: none; }
.composer textarea.flash { animation: flash 0.6s var(--ease); }
@keyframes flash { 30% { background: var(--term-bg); } }
.attach-count { position: absolute; bottom: 1px; right: 1px; font: 500 0.6rem var(--mono); color: var(--muted); }
.btn-send {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; border: 0; cursor: pointer;
  background: var(--grad-btn); color: var(--on-accent);
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast), opacity var(--t-fast);
}
.btn-send svg { width: 20px; height: 20px; transition: transform var(--t) var(--ease); }
@media (hover: hover) { .btn-send:hover:not(:disabled) { filter: brightness(1.08); } .btn-send:hover:not(:disabled) svg { transform: translateY(-2px); } }
.btn-send:active:not(:disabled) { transform: scale(0.92); }
.dock-fine { text-align: center; color: var(--muted); font-size: 0.75rem; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 0; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 60px; height: 60px; animation: pop-in var(--t) var(--ease-out) both; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumb .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); overflow: hidden; transition: opacity var(--t) 150ms; }
.thumb .bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--grad); transition: width 150ms; }
.thumb.done .bar { opacity: 0; }
.thumb .remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; line-height: 1;
}

/* ---------- shared keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(var(--move)); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "auth" "preview"; }
  .auth { position: static; }
  .preview { max-width: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillars, .quotes, .steps, .plans { grid-template-columns: minmax(0, 1fr); }
  .plans { gap: 26px; }
  .faq-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  /* Sidebar becomes a drawer */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); padding-top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-102%); box-shadow: var(--shadow); }
  .app-shell.sb-collapsed .sidebar { margin-left: 0; }
  .app-shell.sb-open .sidebar { transform: none; }
  .app-shell:not(.never) #btn-open-sidebar { visibility: visible; }
  .enter-app .sidebar { animation: none; }
}
@media (max-width: 600px) {
  :root { --move: 8px; }
  .site-nav > a:not(.btn-ghost):not(.btn-primary) { display: none; }
  .brand-by { display: none; }
  .examples { grid-template-columns: minmax(0, 1fr); }
  .hero-ctas .btn-primary, .hero-ctas .btn-ghost { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .points li:not(.shown) { opacity: 1; }
  .landing.leaving { opacity: 1; transform: none; }
}

/* ---------- work trace ("Thinking" timeline) ---------- */
.trace { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.trace-head {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; margin-left: -4px;
  border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 500 0.92rem var(--body); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.trace-head:hover { background: var(--surface-2); color: var(--text); }
.trace-chev { transform: rotate(90deg); transition: transform var(--t) var(--ease); color: var(--muted); }
.trace.collapsed .trace-chev { transform: rotate(0deg); }
.trace-time { color: var(--muted); font: 500 0.78rem var(--mono); font-variant-numeric: tabular-nums; }
.trace.running .trace-title {
  background: linear-gradient(90deg, var(--text-2) 0%, var(--text) 40%, var(--text-2) 80%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
.trace-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-slow) var(--ease-out), opacity var(--t) var(--ease); }
.trace.collapsed .trace-panel { grid-template-rows: 0fr; opacity: 0; }
.trace-inner { overflow: hidden; min-height: 0; }
.trace-steps { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; animation: step-in var(--t) var(--ease-out) both; }
.step:last-child { padding-bottom: 2px; }
/* the thread line linking each step to the next */
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 10.5px; top: 22px; bottom: 0; width: 1px; background: var(--line-strong);
}
@keyframes step-in { from { opacity: 0; transform: translateY(-4px); } }
.step-mark { position: relative; width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); }
.step-icon { width: 15px; height: 15px; }
.step.done .step-icon { color: var(--text-2); }
.step-spin { display: none; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.step.running .step-icon { display: none; }
.step.running .step-spin { display: block; }
.step-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 1px; }
.step-text { font-size: 0.9rem; color: var(--text-2); line-height: 1.45; }
.step.running .step-text {
  background: linear-gradient(90deg, var(--muted) 0%, var(--text) 45%, var(--muted) 90%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
.step.dead .step-text { color: var(--muted); }
.step.dead .step-icon { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 0.78rem var(--body);
  text-decoration: none; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast) var(--ease);
  animation: chip-in var(--t) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.chip span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; }
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip:active { transform: scale(0.97); }
.chip-icon { width: 13px; height: 13px; flex: none; color: var(--term-line); }
.chip-more { background: transparent; box-shadow: none; color: var(--muted); border-color: transparent; padding-inline: 6px; }
.chip-more:hover { color: var(--text); }
@keyframes chip-in { from { opacity: 0; transform: scale(0.94); } }

/* ---------- conversion landing additions ---------- */
.btn-lg { padding: 14px 22px; font-size: 1.02rem; }
.cta-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--step--1); }
.cta-note svg { color: var(--term-line); }
.cta-inner .cta-note { justify-content: center; }

.audience { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.audience-label { color: var(--muted); font-size: 0.9rem; margin-right: 2px; }
.pill {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); border-radius: 999px;
  padding: 6px 14px; font: 500 0.9rem var(--body); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
@media (hover: hover) { .pill:hover { color: var(--text); border-color: var(--text-2); } }
.pill:active { transform: scale(0.96); }
.pill[aria-pressed="true"] { background: var(--grad); color: var(--on-grad); border-color: transparent; font-weight: 600; }
.lede.swap, .preview-body.swap { opacity: 0; transform: translateY(4px); }
.lede { transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }

.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-2); }
.auth-points li { display: flex; gap: 8px; align-items: center; }
.auth-points svg { color: var(--term-line); }

.proof-strip { padding-block: 0 clamp(40px, 6vw, 64px); }
.proof-strip .stats { margin-top: 0; }
.proof-note { margin-top: 12px; }

.problem { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.loop { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.loop li {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
}
.loop-num { font: 500 0.75rem var(--mono); color: var(--muted); width: 18px; flex: none; }
.loop-break { border-color: var(--error) !important; color: var(--text) !important; font-weight: 600; }
.loop-break .loop-num { color: var(--error); }

.vs-wrap { margin-top: 32px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.vs { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 0.95rem; }
.vs th, .vs td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vs tbody tr:last-child th, .vs tbody tr:last-child td { border-bottom: 0; }
.vs thead th { font: 500 0.75rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.vs tbody th { font-weight: 600; color: var(--text); width: 26%; }
.vs td { color: var(--text-2); }
.vs .vs-ember { background: var(--term-bg); color: var(--text); font-weight: 500; }
.vs thead .vs-ember { color: var(--accent); }

.benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.benefit { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.benefit-icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--term-bg); color: var(--term-line); }
.benefit h3 { font-size: var(--step-1); font-weight: 600; margin-top: 4px; }
.benefit p { color: var(--text-2); }

.audiences { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.aud-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color var(--t), transform var(--t) var(--ease);
}
.aud-card.active { border-color: var(--term-line); }
@media (hover: hover) { .aud-card:hover { transform: translateY(-3px); border-color: var(--line-strong); } }
.aud-card h3 { font-size: var(--step-1); font-weight: 600; }
.aud-card p { color: var(--text-2); font-size: 0.95rem; }
.aud-q { color: var(--text) !important; background: var(--surface-2); border-radius: 12px 12px 4px 12px; padding: 10px 12px; flex: 1; }
.aud-card .btn-ghost { width: 100%; }

.plan-flag-quiet { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-strong); }
.pillars { margin-top: 28px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.slogan { font-family: var(--display); font-weight: 600; color: var(--text-2); }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: none;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  animation: slide-up var(--t) var(--ease-out) both;
}
.sticky-cta .btn-primary { width: 100%; }

@media (max-width: 960px) {
  .problem { grid-template-columns: minmax(0, 1fr); }
  .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audiences { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .benefits, .audiences { grid-template-columns: minmax(0, 1fr); }
  .sticky-cta:not([hidden]) { display: block; }
  .site-nav .btn-primary { padding: 8px 12px; font-size: 0.85rem; }
  .landing { padding-bottom: 72px; }
}
@media (max-width: 600px) {
  .vs-wrap { border: 0; overflow: visible; }
  .vs { min-width: 0; }
  .vs thead { display: none; }
  .vs, .vs tbody, .vs tr, .vs th, .vs td { display: block; width: 100%; }
  .vs tr { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
  .vs tbody th { width: 100%; background: var(--surface); padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .vs td { padding: 10px 14px; border-bottom: 0; }
  .vs td::before { content: attr(data-label); display: block; font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .vs td.vs-ember::before { color: var(--accent); }
  .vs tbody tr:last-child th { border-bottom: 1px solid var(--line); }
}

/* =====================================================================
   STYLE v7: clean light studio look (inspired by clueso.io), AI Fire colors.
   Light is the default. Dark applies when chosen in Settings, or with System on a dark device.
   ===================================================================== */
:root:not([data-theme="dark"]):not([data-theme="system"]),
:root[data-theme="system"] {
  --bg: #f7f6f6; --surface: #ffffff; --surface-2: #f1efef; --sidebar: #f3f1f1;
  --line: #e7e3e4; --line-strong: #d6d0d2;
  --text: #131012; --text-2: #554d51; --muted: #8a8186; --head-soft: #8d858a;
  --accent: #cc1d52; --on-accent: #ffffff;
  --term-bg: rgba(248, 174, 82, 0.2); --term-line: #dd8418;
  --warn-bg: #fff1dc; --warn-text: #7a4600; --error: #c0123f;
  --glow-1: rgba(234, 37, 128, 0.14); --glow-2: rgba(248, 174, 82, 0.14); --scrim: rgba(20, 8, 14, 0.32);
  --shadow: 0 1px 2px rgba(20, 8, 14, 0.05), 0 8px 24px rgba(20, 8, 14, 0.06);
  --grad: linear-gradient(115deg, #e0780f 0%, #ea2580 55%, #cc1d52 100%);
  --grad-btn: linear-gradient(225deg, #ea2580 0%, #cc1d52 100%);
  --grid-line: rgba(19, 16, 18, 0.045); --grid-tint: rgba(234, 37, 128, 0.07); --grid-tint-2: rgba(248, 174, 82, 0.1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0f0a0c; --surface: #1a1115; --surface-2: #23171c; --sidebar: #140d10; --line: #34242b; --line-strong: #4b3540;
    --text: #f7eef1; --text-2: #cdbcc2; --muted: #9a868e; --head-soft: #8f7c84; --accent: #f2468f;
    --term-bg: rgba(248, 174, 82, 0.13); --term-line: #f8ae52; --warn-bg: #3a2912; --warn-text: #ffcf8a; --error: #ff6b8e;
    --glow-1: rgba(234, 37, 128, 0.22); --glow-2: rgba(248, 174, 82, 0.16); --scrim: rgba(8, 4, 6, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --grid-line: rgba(255, 255, 255, 0.04); --grid-tint: rgba(234, 37, 128, 0.12); --grid-tint-2: rgba(248, 174, 82, 0.1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { --head-soft: #8f7c84; --grid-line: rgba(255, 255, 255, 0.04); --grid-tint: rgba(234, 37, 128, 0.12); --grid-tint-2: rgba(248, 174, 82, 0.1); }
:root {
  --display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 8px;
}

/* Type: big, tight, quiet. Second half of headlines fades instead of a gradient. */
.display { font-weight: 500; letter-spacing: -0.035em; line-height: 1.04; }
.hero h1 { font-size: clamp(2.4rem, 1.3rem + 3.6vw, 4.4rem); }
.section-title { font-weight: 500; letter-spacing: -0.03em; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 3rem); line-height: 1.08; max-width: 22ch; }
.eyebrow { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 500; color: var(--accent); }
.lede { font-size: 1.15rem; max-width: 44ch; }
.auth-card h2, .dialog-body h2, .welcome h1, .page-head h1 { font-weight: 500; letter-spacing: -0.025em; }
.brand-name { font-weight: 600; letter-spacing: -0.03em; }
.price { font-weight: 500; letter-spacing: -0.03em; }
.quote blockquote { font-weight: 400; letter-spacing: -0.01em; }

/* Buttons: compact, 6px corners, flat. */
.btn-primary, .btn-ghost { border-radius: 6px; font-weight: 500; padding: 11px 18px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-sm { padding: 7px 13px; font-size: 0.88rem; }
.btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
@media (hover: hover) {
  .btn-primary:hover { transform: none; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 18px -8px rgba(234, 37, 128, 0.55); }
  .btn-primary:hover .i-sm { transform: translateX(3px); }
}
.hero-ctas .btn-ghost, .cta-inner .btn-ghost { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); background: var(--surface); }
@media (hover: hover) { .hero-ctas .btn-ghost:hover, .cta-inner .btn-ghost:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: var(--accent); } }
.btn-ghost { background: var(--surface); }
.btn-danger { border-radius: 6px; }
input, textarea { border-radius: 6px; background: var(--surface); }
.pill { border-radius: 6px; background: var(--surface); }
.pill[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tier-badge, .chip, .project-chip, .img-chip, .rating button, .plan-flag { border-radius: 6px; }

/* Announcement bar */
.announce {
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; text-align: center;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding: 9px max(16px, env(safe-area-inset-right, 0px)) 9px max(16px, env(safe-area-inset-left, 0px));
  background: var(--text); color: var(--bg); font-size: 0.86rem; font-weight: 500; text-decoration: none;
}
.announce-tag { background: var(--grad-btn); color: #fff; border-radius: 4px; padding: 1px 7px; font-size: 0.75rem; }
.announce .i-sm { transition: transform var(--t) var(--ease); }
.announce:hover .i-sm { transform: translateX(3px); }

/* Header: light bar, hairline, actions on the right */
.site-header { background: color-mix(in srgb, var(--bg) 85%, transparent); }
.site-nav { gap: 28px; }
.nav-actions { display: flex; gap: 8px; margin-left: 8px; }

/* Hero: faint drafting grid with a few tinted squares */
body::before { display: none; }
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -40px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(70% 70% at 40% 30%, #000 30%, transparent 85%); mask-image: radial-gradient(70% 70% at 40% 30%, #000 30%, transparent 85%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; top: 4px; left: 0; width: 43px; height: 43px; pointer-events: none;
  box-shadow:
    176px 44px 0 var(--grid-tint), 528px 88px 0 var(--grid-tint-2), 880px 0 0 var(--grid-tint),
    968px 176px 0 var(--grid-tint-2), 44px 352px 0 var(--grid-tint), 1100px 308px 0 var(--grid-tint),
    660px 396px 0 var(--grid-tint-2), 308px 572px 0 var(--grid-tint), 1012px 528px 0 var(--grid-tint-2);
}
.cta-note svg, .auth-points svg { color: var(--accent); }

/* Sign-in card: flat white panel with a hairline */
.auth-card { border-radius: 12px; box-shadow: var(--shadow); }
.auth-card::before { opacity: 0; }

/* Product window: dark app mockup with a soft brand glow, in both themes */
.preview {
  --pv-bg: #141013; --pv-2: #1f191d; --pv-line: #2e2629; --pv-text: #f3ecef; --pv-muted: #9d9097;
  border-radius: 12px; background: var(--pv-bg); border-color: var(--pv-line); color: var(--pv-text);
  box-shadow: 0 0 0 1px rgba(234, 37, 128, 0.25), -18px -10px 60px -20px rgba(234, 37, 128, 0.55), 22px 20px 60px -24px rgba(248, 174, 82, 0.5);
}
.preview-bar { background: var(--pv-2); border-color: var(--pv-line); }
.preview-bar span { background: #3a3035; }
.preview-bar p { color: var(--pv-muted); }
.preview-q { background: var(--pv-2); color: var(--pv-text); }
.preview-a { color: #d9ced3; }
.preview .demo-term { color: var(--pv-text); background: rgba(248, 174, 82, 0.16); box-shadow: inset 0 -1.5px 0 #f8ae52; }
.preview-src { color: var(--pv-muted); border-color: var(--pv-line); }
.preview .src-num { color: var(--pv-text); background: rgba(248, 174, 82, 0.14); border-color: #f8ae52; }

/* Sections: hairline-divided cells instead of floating cards */
.band { border-top: 1px solid var(--line); }
.stats { border-radius: 0; border-left: 0; border-right: 0; background: var(--line); }
.stats > div { background: var(--bg); padding: 26px 22px; }
.stats dd { font-weight: 500; letter-spacing: -0.04em; }

.benefits, .pillars, .quotes {
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.benefit, .pillar, .quote { border: 0; border-radius: 0; background: var(--surface); }
.benefit-icon, .pillar-icon, .empty-icon { border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }
@media (hover: hover) { .pillar:hover { transform: none; background: var(--surface-2); } }

.loop li { border-radius: 8px; background: var(--surface); }
.vs-wrap { border-radius: 10px; background: var(--surface); }
.vs thead th { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 0.85rem; font-weight: 500; }
.vs .vs-ember { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }

.aud-card, .plan, .project-card, .source a, .example, .limit, .menu, .dialog { border-radius: 10px; }
.aud-card, .plan { box-shadow: none; }
.aud-q { border-radius: 8px 8px 3px 8px; }
.plan-featured { box-shadow: var(--shadow); }
.plan-flag { background: var(--text); color: var(--bg); }
.plan-flag-quiet { background: var(--surface); color: var(--text-2); }

.steps li { border-top-width: 1px; }
.steps li::before { height: 1px; width: 56px; }
.faq summary { font-weight: 500; }
.cta-inner { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.cta-inner::before { opacity: 0; }
.cta-inner::after { background: radial-gradient(45% 60% at 50% 0%, var(--glow-1), transparent 70%); }
.cta-inner h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.6rem); }

/* App shell inherits the tokens; a few flatter details */
.composer { border-radius: 14px; }
.btn-send, .sb-new-icon { border-radius: 8px; }
.welcome h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); }
.msg.user .bubble { border-radius: 12px 12px 4px 12px; }
.trace-head, .recent, .chat-row, .sb-link, .sb-new, .account, .menu-item { border-radius: 6px; }

@media (max-width: 860px) { .nav-signin { display: none; } }
@media (max-width: 600px) {
  .announce { font-size: 0.8rem; }
  .hero::after { display: none; }
}


.demo-bar {
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--warn-bg); color: var(--warn-text); font-size: 0.8rem; text-align: center;
}
.demo-bar strong { font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin-right: 8px; }
.accounts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; font-weight: 600; }
.chip:hover { border-color: var(--accent); }

.skip-link{position:absolute;left:1rem;top:-4rem;z-index:1000;background:var(--surface);color:var(--text);padding:.65rem 1rem;border-radius:.5rem}.skip-link:focus{top:1rem}
