/* ============================================================================
   Search Magic — theme.css
   The single styling source of truth. Direct implementation of the tokens in
   DESIGN-coinbase.md (Coinbase-style institutional/fintech system).

   Restyle the whole app by editing the variables in :root below.
   Everything else derives from them.

   Loaded by every page via:  <link rel="stylesheet" href="assets/theme.css">
   No build step. No imports of HTML. Opens from file:// by double-click.
   ============================================================================ */

/* Fonts — CDN with system fallback so the app still renders offline.
   CoinbaseDisplay/Sans -> Inter ;  CoinbaseMono -> JetBrains Mono. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

/* ----------------------------------------------------------------------------
   1. TOKENS  (the one place to restyle the app)
   ---------------------------------------------------------------------------- */
:root {
  /* Brand & accent — Coinbase Blue is the ONLY action color. Used scarcely. */
  --primary:           #0052ff;
  --primary-active:    #003ecc;
  --primary-disabled:  #a8b8cc;
  --accent-yellow:     #f4b000;   /* illustrative only, never an action color */
  --tint-soft:         #eef2ff;   /* soft accent fill (nudge panels) */
  --tint-border:       #d8e0ff;   /* soft accent border */
  --tint-bar:          #c9d4f7;   /* non-active chart bars */

  /* Ink / text */
  --ink:          #0a0b0d;
  --body:         #5b616e;
  --muted:        #7c828a;
  --muted-soft:   #a8acb3;
  --on-primary:   #ffffff;
  --on-dark:      #ffffff;
  --on-dark-soft: #a8acb3;

  /* Surfaces */
  --canvas:              #ffffff;
  --surface-soft:        #f7f7f7;
  --surface-strong:      #eef0f3;
  --surface-dark:        #0a0b0d;
  --surface-dark-elev:   #16181c;

  /* Hairlines */
  --hairline:      #dee1e6;
  --hairline-soft: #eef0f3;
  --hairline-dark: #23262c;   /* divider on dark surfaces */

  /* Trading semantics — TEXT COLOR ONLY, never a button fill */
  --up:   #05b169;
  --down: #cf202f;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 100px;
  --r-full: 9999px;

  /* Spacing — 4px base scale */
  --s-xxs: 4px;
  --s-xs:  8px;
  --s-sm:  12px;
  --s-base:16px;
  --s-md:  20px;
  --s-lg:  24px;
  --s-xl:  32px;
  --s-xxl: 48px;
  --s-section: 96px;

  /* Type families */
  --font-display: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-sans:    'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Depth — ONE shadow tier only */
  --shadow: 0 4px 12px rgba(0,0,0,.04);
  --shadow-lift: 0 8px 28px rgba(0,0,0,.10);   /* drawers / modals only */

  /* App-shell layout */
  --sidebar-w: 256px;
  --topbar-h:  64px;
  --content-max: 1200px;

  /* Z layers */
  --z-panel:  60;
  --z-modal:  70;
  --z-toast:  90;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  .22s;
}

/* ----------------------------------------------------------------------------
   2. RESET / BASE
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5,h6,p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(0,82,255,.14); }

/* ----------------------------------------------------------------------------
   3. TYPOGRAPHY  (display weight stays 400 — the calm-institutional signature)
   ---------------------------------------------------------------------------- */
.display-mega { font-family: var(--font-display); font-weight: 400; font-size: 80px; line-height: 1.0;  letter-spacing: -2px;   color: var(--ink); }
.display-xl   { font-family: var(--font-display); font-weight: 400; font-size: 64px; line-height: 1.0;  letter-spacing: -1.6px; color: var(--ink); }
.display-lg   { font-family: var(--font-display); font-weight: 400; font-size: 52px; line-height: 1.0;  letter-spacing: -1.3px; color: var(--ink); }
.display-md   { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.09; letter-spacing: -1px;   color: var(--ink); }
.display-sm   { font-family: var(--font-sans);    font-weight: 400; font-size: 36px; line-height: 1.11; letter-spacing: -.5px;  color: var(--ink); }
.title-lg     { font-family: var(--font-sans);    font-weight: 400; font-size: 32px; line-height: 1.13; letter-spacing: -.4px;  color: var(--ink); }
.title-md     { font-family: var(--font-sans);    font-weight: 600; font-size: 18px; line-height: 1.33; color: var(--ink); }
.title-sm     { font-family: var(--font-sans);    font-weight: 600; font-size: 16px; line-height: 1.25; color: var(--ink); }
.body-md      { font-size: 16px; font-weight: 400; line-height: 1.5; }
.body-strong  { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.body-sm      { font-size: 14px; font-weight: 400; line-height: 1.5; }
.caption      { font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--muted); }
.caption-strong { font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: .02em; }

/* Numbers always render in mono. */
.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.num-lg { font-family: var(--font-mono); font-weight: 500; font-size: 32px; line-height: 1.1; letter-spacing: -.5px; color: var(--ink); }

/* Ink helpers */
.t-ink   { color: var(--ink); }
.t-body  { color: var(--body); }
.t-muted { color: var(--muted); }
.t-up    { color: var(--up); }
.t-down  { color: var(--down); }
.t-primary { color: var(--primary); }

/* ----------------------------------------------------------------------------
   4. LAYOUT — bands, container, grid
   ---------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding-left: var(--s-lg); padding-right: var(--s-lg); }
.band       { padding-top: var(--s-section); padding-bottom: var(--s-section); }
.band-soft  { background: var(--surface-soft); }
.band-dark  { background: var(--surface-dark); color: var(--on-dark); }
.band-dark .display-mega, .band-dark .display-xl, .band-dark .display-lg,
.band-dark .display-md, .band-dark .display-sm, .band-dark .title-lg,
.band-dark .title-md, .band-dark .title-sm { color: var(--on-dark); }
.band-dark .body-md, .band-dark p { color: var(--on-dark-soft); }
.hero .display-mega, .hero .display-xl, .hero .display-lg,
.hero .display-md, .hero .display-sm { color: var(--on-dark); }

.stack-xs  > * + * { margin-top: var(--s-xs); }
.stack-sm  > * + * { margin-top: var(--s-sm); }
.stack     > * + * { margin-top: var(--s-base); }
.stack-lg  > * + * { margin-top: var(--s-lg); }
.stack-xl  > * + * { margin-top: var(--s-xl); }

.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-xs { gap: var(--s-xs); } .gap-sm { gap: var(--s-sm); } .gap { gap: var(--s-base); } .gap-lg { gap: var(--s-lg); }
.wrap { flex-wrap: wrap; }

.grid { display: grid; gap: var(--s-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ----------------------------------------------------------------------------
   5. BUTTONS — every CTA is a pill. Primary blue used scarcely.
   ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs);
  font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.15;
  height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--surface-strong); color: var(--ink);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .06s var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }

.btn-primary   { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover  { background: var(--primary-active); }
.btn-primary:active { background: var(--primary-active); }
.btn-primary[disabled], .btn[disabled] { background: var(--primary-disabled); color: var(--on-primary); cursor: not-allowed; }

.btn-secondary { background: var(--surface-strong); color: var(--ink); }
.btn-secondary:hover { background: #e4e7ec; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-strong); }

.btn-text  { background: transparent; color: var(--primary); height: auto; padding: 0; }
.btn-text:hover { text-decoration: underline; }

/* On dark surfaces */
.btn-on-dark        { background: var(--surface-dark-elev); color: var(--on-dark); }
.btn-on-dark:hover  { background: #20242b; }
.btn-outline-dark   { background: transparent; color: var(--on-dark); border-color: rgba(255,255,255,.4); }
.btn-outline-dark:hover { border-color: #fff; }

/* Sizes */
.btn-lg  { height: 56px; padding: 0 32px; }      /* hero "Get started" */
.btn-sm  { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }

/* ----------------------------------------------------------------------------
   6. FORMS / INPUTS
   ---------------------------------------------------------------------------- */
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: var(--s-xs); }
.field-hint  { font-size: 13px; color: var(--muted); }

.input, .textarea {
  width: 100%; font-family: var(--font-sans); font-size: 16px; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 14px 16px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input { height: 48px; }
.textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted-soft); }
.input:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* Pill search field */
.search-pill {
  display: inline-flex; align-items: center; gap: var(--s-xs);
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--surface-strong); color: var(--ink);
}
.search-pill input { border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); width: 100%; }
.search-pill input::placeholder { color: var(--muted); }
.search-pill svg, .search-pill .icon { color: var(--muted); }

/* Big URL entry used on landing */
.url-entry {
  display: flex; gap: var(--s-xs); align-items: center; background: var(--canvas);
  border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow); max-width: 540px;
}
.url-entry input { flex: 1; border: 0; outline: none; font-size: 16px; color: var(--ink); background: transparent; height: 48px; }
.url-entry input::placeholder { color: var(--muted-soft); }

/* ----------------------------------------------------------------------------
   7. BADGES / PILLS
   ---------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-strong); color: var(--ink);
  border-radius: var(--r-pill); padding: 4px 12px;
}
.badge-dark { background: var(--surface-dark-elev); color: var(--on-dark); }
.badge-up   { background: rgba(5,177,105,.12);  color: var(--up);   text-transform: none; }
.badge-down { background: rgba(207,32,47,.12);   color: var(--down); text-transform: none; }
.badge-dot::before { content:""; width:6px; height:6px; border-radius:var(--r-full); background: currentColor; display:inline-block; }

/* ----------------------------------------------------------------------------
   8. CARDS
   ---------------------------------------------------------------------------- */
.card {
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-xl);
}
.card-pad-lg { padding: var(--s-xl); }
.card-pad-md { padding: var(--s-lg); }
.card-hover { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card-hover:hover { box-shadow: var(--shadow); }

.card-dark { background: var(--surface-dark-elev); color: var(--on-dark); border: 0; border-radius: var(--r-xl); padding: var(--s-xl); }

/* Floating product-ui card stack used inside dark heroes */
.product-card { background: var(--surface-dark-elev); color: var(--on-dark); border-radius: var(--r-xl); padding: var(--s-xl); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.product-card-light { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-xl); box-shadow: var(--shadow-lift); }

/* ----------------------------------------------------------------------------
   9. APP SHELL — sidebar + topbar + main content
   ---------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* Sidebar (dark near-black surface, blue reserved for the active item) */
.sidebar {
  background: var(--surface-dark); color: var(--on-dark-soft);
  display: flex; flex-direction: column; padding: var(--s-md) var(--s-sm);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--s-xs); padding: var(--s-xs) var(--s-sm) var(--s-md); }
.sidebar-brand .mark { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; }
.sidebar-brand .name { color: #fff; font-weight: 600; font-size: 16px; letter-spacing: -.2px; }

.nav-group { margin-top: var(--s-md); }
.nav-group-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5b616e; padding: 0 var(--s-sm) var(--s-xs); }
.nav-item {
  display: flex; align-items: center; gap: var(--s-sm);
  padding: 10px var(--s-sm); border-radius: var(--r-md); color: var(--on-dark-soft);
  font-size: 14px; font-weight: 500; line-height: 1.4; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover { background: var(--surface-dark-elev); color: #fff; text-decoration: none; }
.nav-item .ico { width: 18px; height: 18px; opacity: .9; flex: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item.active .ico { opacity: 1; }
.nav-item .tag { margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }

/* account chip pinned to bottom */
.sidebar-foot { margin-top: auto; padding-top: var(--s-md); }
.acct-chip { display: flex; align-items: center; gap: var(--s-sm); padding: var(--s-xs) var(--s-sm); border-radius: var(--r-md); cursor: pointer; }
.acct-chip:hover { background: var(--surface-dark-elev); }
.acct-chip .avatar { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--surface-strong); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.acct-chip .meta { line-height: 1.2; overflow: hidden; }
.acct-chip .meta .co { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-chip .meta .plan { color: var(--muted); font-size: 12px; }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--surface-soft); }
.topbar {
  height: var(--topbar-h); background: var(--canvas); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: var(--s-base); padding: 0 var(--s-xl);
  position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 18px; font-weight: 600; color: var(--ink); }
.topbar .spacer { flex: 1; }
.content { padding: var(--s-xl); max-width: 1280px; width: 100%; }

/* ----------------------------------------------------------------------------
   10. KPI / STAT CARDS
   ---------------------------------------------------------------------------- */
.stat { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-lg); }
.stat .label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { margin-top: var(--s-xs); font-family: var(--font-mono); font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -1px; color: var(--ink); }
.stat .delta { margin-top: 6px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: var(--up); } .stat .delta.down { color: var(--down); }

/* ----------------------------------------------------------------------------
   11. CHART CARDS  (expandable to large view via expand())
   ---------------------------------------------------------------------------- */
.chart-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-lg); }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--s-base); }
.chart-head .title { font-size: 16px; font-weight: 600; color: var(--ink); }
.chart-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.expand-btn { background: var(--surface-strong); border: 0; border-radius: var(--r-md); width: 32px; height: 32px; display: grid; place-items: center; color: var(--body); }
.expand-btn:hover { background: #e4e7ec; }
.chart-plot { width: 100%; }

/* simple bar list (engine breakdown) */
.bar-row { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: var(--s-sm); padding: 10px 0; }
.bar-row + .bar-row { border-top: 1px solid var(--hairline-soft); }
.bar-row .name { font-size: 14px; color: var(--ink); font-weight: 500; }
.bar-track { height: 8px; background: var(--surface-strong); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: var(--r-pill); }
.bar-row .pct { text-align: right; font-family: var(--font-mono); font-weight: 500; font-size: 14px; color: var(--ink); }

/* ----------------------------------------------------------------------------
   12. TOGGLE SWITCH
   ---------------------------------------------------------------------------- */
.toggle { position: relative; width: 40px; height: 24px; flex: none; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track { position: absolute; inset: 0; background: var(--muted-soft); border-radius: var(--r-pill); transition: background var(--dur) var(--ease); }
.toggle .knob  { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: var(--r-full); transition: transform var(--dur) var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--primary); }
.toggle input:checked + .track + .knob { transform: translateX(16px); }

/* ----------------------------------------------------------------------------
   13. TABLE / ASSET ROWS
   ---------------------------------------------------------------------------- */
.list-row { display: flex; align-items: center; gap: var(--s-base); padding: var(--s-base) 0; border-bottom: 1px solid var(--hairline-soft); }
.list-row .ico-circ { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--surface-strong); display: grid; place-items: center; flex: none; font-size: 14px; font-weight: 600; color: var(--ink); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .primary { font-size: 15px; font-weight: 600; color: var(--ink); }
.list-row .secondary { font-size: 13px; color: var(--muted); }

/* ----------------------------------------------------------------------------
   14. ONBOARDING WIZARD
   ---------------------------------------------------------------------------- */
.wizard { max-width: 720px; margin: 0 auto; padding: var(--s-xl) var(--s-lg) var(--s-xxl); }
.wizard-progress { display: flex; align-items: center; gap: var(--s-sm); margin-bottom: var(--s-xl); }
.wizard-progress .step-label { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.progress-track { flex: 1; height: 4px; background: var(--surface-strong); border-radius: var(--r-pill); overflow: hidden; }
.progress-fill  { height: 100%; background: var(--primary); border-radius: var(--r-pill); transition: width var(--dur) var(--ease); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-step-head { margin-bottom: var(--s-xl); }
.wizard-step-head .kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.wizard-step-head h2 { margin-top: var(--s-xs); }

.question { padding: var(--s-lg) 0; border-top: 1px solid var(--hairline-soft); }
.question:first-of-type { border-top: 0; padding-top: 0; }
.question .q-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.question .q-sub   { font-size: 14px; color: var(--muted); margin-top: 2px; margin-bottom: var(--s-base); }

.wizard-nav { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-xl); padding-top: var(--s-lg); border-top: 1px solid var(--hairline); }

/* — Component ① Card → editable text — */
.suggest-cards { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--s-sm); margin-top: var(--s-base); }
.suggest-card {
  text-align: left; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: var(--s-base); cursor: pointer; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.suggest-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.suggest-card .sc-label { font-size: 12px; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.suggest-card .sc-text  { font-size: 14px; color: var(--body); margin-top: 6px; line-height: 1.45; }
.suggest-card.used { opacity: .4; pointer-events: none; }

/* — Component ② Pill → token in textarea — */
.pill-field {
  border: 1px solid var(--hairline); border-radius: var(--r-md); padding: var(--s-sm); background: var(--canvas);
  display: flex; flex-wrap: wrap; gap: var(--s-xs); min-height: 96px; align-content: flex-start;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pill-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pill-token {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px;
  background: var(--surface-strong); color: var(--ink); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
}
.pill-token .x { width: 18px; height: 18px; border-radius: var(--r-full); border: 0; background: rgba(10,11,13,.08); color: var(--body); display: grid; place-items: center; font-size: 13px; line-height: 1; cursor: pointer; }
.pill-token .x:hover { background: rgba(207,32,47,.14); color: var(--down); }
.pill-field .pill-input { flex: 1; min-width: 120px; border: 0; outline: none; font-size: 15px; color: var(--ink); background: transparent; height: 32px; }
.pill-field .pill-input::placeholder { color: var(--muted-soft); }

.suggest-pills { display: flex; flex-wrap: wrap; gap: var(--s-xs); margin-top: var(--s-sm); }
.suggest-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  background: var(--canvas); border: 1px dashed var(--hairline); color: var(--body);
  border-radius: var(--r-pill); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.suggest-pill::before { content: "+"; font-weight: 600; color: var(--primary); }
.suggest-pill:hover { border-color: var(--primary); color: var(--ink); }
.suggest-pill.used { opacity: .35; pointer-events: none; }

/* — Component ③ URL rows with toggles — */
.url-rows { display: flex; flex-direction: column; gap: var(--s-xs); margin-top: var(--s-base); }
.url-row {
  display: grid; grid-template-columns: 1.2fr 1fr auto auto; align-items: center; gap: var(--s-sm);
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: var(--s-sm);
  transition: opacity var(--dur) var(--ease);
}
.url-row.off { opacity: .5; }
.url-row .input { height: 40px; padding: 8px 12px; font-size: 14px; }
.url-row .row-x { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-md); display: grid; place-items: center; cursor: pointer; }
.url-row .row-x:hover { background: var(--surface-strong); color: var(--down); }
.url-add { align-self: flex-start; margin-top: var(--s-xs); }

/* ----------------------------------------------------------------------------
   15. SIDE PANEL / DRAWER  (openPanel / closePanel)
   ---------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(10,11,13,.4); opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease); z-index: var(--z-panel); }
.scrim.open { opacity: 1; visibility: visible; }

.panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 480px; max-width: 92vw;
  background: var(--canvas); box-shadow: var(--shadow-lift); z-index: var(--z-panel);
  transform: translateX(100%); transition: transform var(--dur) var(--ease);
  display: flex; flex-direction: column;
}
.panel.open { transform: translateX(0); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-lg); border-bottom: 1px solid var(--hairline); }
.panel-body { padding: var(--s-lg); overflow-y: auto; flex: 1; }
.panel-foot { padding: var(--s-lg); border-top: 1px solid var(--hairline); display: flex; gap: var(--s-sm); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-md); border: 0; background: transparent; color: var(--body); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-strong); }

/* ----------------------------------------------------------------------------
   16. MODAL / EXPAND OVERLAY  (expand)
   ---------------------------------------------------------------------------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(10,11,13,.55); display: none; place-items: center; padding: var(--s-xl); z-index: var(--z-modal); }
.modal-scrim.open { display: grid; }
.modal {
  background: var(--canvas); border-radius: var(--r-xl); width: 100%; max-width: 880px;
  max-height: 88vh; overflow: auto; padding: var(--s-xl); box-shadow: var(--shadow-lift);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--s-base); }

/* Google signup mockup card */
.auth-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: var(--s-xxl); max-width: 400px; width: 100%; box-shadow: var(--shadow); text-align: center; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--s-sm); width: 100%; height: 48px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background var(--dur) var(--ease);
}
.google-btn:hover { background: var(--surface-soft); }

/* ----------------------------------------------------------------------------
   17. TOAST  (toast)
   ---------------------------------------------------------------------------- */
.toast-stack { position: fixed; right: var(--s-lg); bottom: var(--s-lg); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--s-sm); }
.toast {
  display: flex; align-items: flex-start; gap: var(--s-sm); background: var(--surface-dark); color: #fff;
  border-radius: var(--r-md); padding: var(--s-base); min-width: 280px; max-width: 380px; box-shadow: var(--shadow-lift);
  transform: translateY(8px); opacity: 0; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .dot { width: 8px; height: 8px; border-radius: var(--r-full); margin-top: 7px; flex: none; background: var(--muted-soft); }
.toast.success .dot { background: var(--up); }
.toast.error   .dot { background: var(--down); }
.toast.info    .dot { background: var(--primary); }
.toast .t-title { font-size: 14px; font-weight: 600; color: #fff; }
.toast .t-msg   { font-size: 13px; color: var(--on-dark-soft); margin-top: 2px; }

/* ----------------------------------------------------------------------------
   18. CROSS-CUTTING STATES — loading / empty
   ---------------------------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--surface-strong) 25%, #e7eaef 37%, var(--surface-strong) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 12px; margin-bottom: 10px; } .sk-line.w-60 { width: 60%; } .sk-line.w-40 { width: 40%; } .sk-line.w-80 { width: 80%; }

.empty { text-align: center; padding: var(--s-xxl) var(--s-lg); }
.empty .empty-ico { width: 56px; height: 56px; border-radius: var(--r-full); background: var(--surface-strong); display: grid; place-items: center; margin: 0 auto var(--s-base); color: var(--muted); }
.empty h3 { color: var(--ink); }
.empty p { color: var(--muted); margin-top: var(--s-xs); }
.empty .btn { margin-top: var(--s-base); }

/* ----------------------------------------------------------------------------
   18b. THEME SWITCH — segmented toggle (Coinbase / Linear). Styled from tokens
   so it looks correct in either theme. Use data-action="set-theme".
   ---------------------------------------------------------------------------- */
.theme-switch { display:inline-flex; align-items:center; gap:2px; padding:3px; background:var(--surface-strong); border:1px solid var(--hairline); border-radius:var(--r-pill); }
.theme-switch button { border:0; background:transparent; color:var(--muted); font-size:12px; font-weight:600; padding:5px 12px; border-radius:var(--r-pill); cursor:pointer; line-height:1; transition:background var(--dur) var(--ease), color var(--dur) var(--ease); }
.theme-switch button:hover { color:var(--ink); }
[data-theme="coinbase"] .theme-switch button[data-theme="coinbase"],
[data-theme="linear"]   .theme-switch button[data-theme="linear"] { background:var(--canvas); color:var(--ink); box-shadow:var(--shadow); }
/* on-dark variant for the marketing hero nav */
.theme-switch.on-dark { background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.16); }
.theme-switch.on-dark button { color:var(--on-dark-soft); }
.theme-switch.on-dark button:hover { color:#fff; }
[data-theme="coinbase"] .theme-switch.on-dark button[data-theme="coinbase"],
[data-theme="linear"]   .theme-switch.on-dark button[data-theme="linear"] { background:rgba(255,255,255,.16); color:#fff; box-shadow:none; }

/* ----------------------------------------------------------------------------
   18c. DEMO SETUP PANEL — landing.html ONLY. Lets you pick which file a
   routable step (e.g. "onboarding") should open, without copying/overwriting
   any canonical file. See behaviors.js SM.routeTo / VARIANTS. This block is
   intentionally separate from the marketing page above it — quiet, technical,
   not styled to look like a product feature.
   ---------------------------------------------------------------------------- */
.demo-setup { background: var(--surface-soft); border-top: 1px solid var(--hairline); padding: var(--s-xxl) 0; }
.demo-setup .eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.demo-setup h3 { margin-top: var(--s-xs); }
.demo-setup .row-group { display: flex; align-items: center; justify-content: space-between; gap: var(--s-lg); flex-wrap: wrap; margin-top: var(--s-lg); padding: var(--s-base) var(--s-lg); background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.demo-setup .row-group .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.demo-setup .row-group .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.variant-picker { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface-strong); border: 1px solid var(--hairline); border-radius: var(--r-pill); }
.variant-picker button { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; line-height: 1; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.variant-picker button:hover { color: var(--ink); }
.variant-picker button.active { background: var(--canvas); color: var(--primary); box-shadow: var(--shadow); }

/* ----------------------------------------------------------------------------
   19. UTILITIES
   ---------------------------------------------------------------------------- */
.flex { display: flex; } .inline-flex { display: inline-flex; } .block { display: block; } .hidden { display: none !important; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; } .flex-1 { flex: 1; } .grow { flex: 1; }
.text-center { text-align: center; } .text-right { text-align: right; }
.full { width: 100%; }
.mt-xs{margin-top:var(--s-xs)} .mt-sm{margin-top:var(--s-sm)} .mt{margin-top:var(--s-base)} .mt-lg{margin-top:var(--s-lg)} .mt-xl{margin-top:var(--s-xl)}
.mb-xs{margin-bottom:var(--s-xs)} .mb-sm{margin-bottom:var(--s-sm)} .mb{margin-bottom:var(--s-base)} .mb-lg{margin-bottom:var(--s-lg)} .mb-xl{margin-bottom:var(--s-xl)}
.pointer { cursor: pointer; }

/* ----------------------------------------------------------------------------
   20. RESPONSIVE
   ---------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .display-mega { font-size: 64px; }
  .display-xl   { font-size: 52px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* Typography */
  .display-mega { font-size: 44px; letter-spacing: -1px; }
  .display-xl   { font-size: 40px; }
  .display-lg   { font-size: 36px; }
  .display-md   { font-size: 32px; letter-spacing: -.6px; }
  .display-sm   { font-size: 28px; letter-spacing: -.3px; }
  .title-lg     { font-size: 26px; letter-spacing: -.3px; }

  /* Spacing */
  .band { padding-top: 56px; padding-bottom: 56px; }
  .container { padding-left: var(--s-base); padding-right: var(--s-base); }

  /* App shell — sidebar slides off, main fills width */
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: var(--z-panel); transform: translateX(-100%); transition: transform var(--dur) var(--ease); width: 256px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 var(--s-base); }
  .content { padding: var(--s-base); }

  /* Grids collapse to single column */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .suggest-cards { grid-template-columns: 1fr; }

  /* URL entry goes full width and stacks */
  .url-entry { max-width: 100%; flex-direction: column; align-items: stretch; padding: var(--s-sm); border-radius: var(--r-xl); gap: var(--s-sm); }
  .url-entry input { height: 40px; }
  .url-entry .btn { width: 100%; }

  /* URL rows in wizard */
  .url-row { grid-template-columns: 1fr auto; }

  /* Wizard padding tighter on small screens */
  .wizard { padding: var(--s-lg) var(--s-base) var(--s-xl); }

  /* Panels go full-width on mobile */
  .panel { width: 100%; max-width: 100%; }

  /* Modals fill screen */
  .modal-scrim { padding: var(--s-base); align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }

  /* Toasts full width */
  .toast-stack { left: var(--s-base); right: var(--s-base); }
  .toast { min-width: 0; max-width: 100%; }

  /* Visibility helpers */
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
}

@media (max-width: 480px) {
  .display-mega { font-size: 36px; }
  .display-xl   { font-size: 32px; }
  .display-lg   { font-size: 28px; }
  .display-md   { font-size: 26px; letter-spacing: -.4px; }
  .display-sm   { font-size: 24px; }
  .title-lg     { font-size: 22px; }

  .btn-lg { height: 48px; padding: 0 24px; }
  .card { padding: var(--s-lg); }
  .auth-card { padding: var(--s-xl); }
  .band { padding-top: 40px; padding-bottom: 40px; }
}
