/* ===========================================================================
   FARFOLD — unified design system.
   Precise, calm, premium research aesthetic. Dense navy + teal
   (anchored on #1E3A5F / #3AAFA9 — see docs/design/regimeone-rebrand/design-spec.md).
   Light = quiet editorial. Black = premium near-black, no neon/glass.

   Theming is driven by [data-theme] on <html>:
     :root / [data-theme="light"]  -> light tokens (default)
     [data-theme="black"]          -> black tokens
   Legacy variable names (--blue, --ink, --bg, --surface, --text, --muted,
   --line, --shadow, --ok/--warn/--risk/--neutral, --radius) are mapped onto
   the new design tokens so existing templates restyle with no markup changes.
   Red/green stay risk/repair tones — never buy/sell cues.
   =========================================================================== */

/* ------------------------------- Color tokens ---------------------------- */
/* Metric-matched local fallbacks (TASK-095 perf). fonts.css loads off the critical path, so first paint uses these; their
   size-adjust makes the system face set the same line widths as Pretendard / Inter, so the swap does not re-wrap text (CLS).
   Measured 2026-11-07 with canvas measureText on the main text of /, /lab, /weekly-map, a lesson, /education, /today
   (19k chars, 59% Hangul) at 400: Pretendard/Malgun Gothic 0.860, Pretendard/Noto Sans KR 0.955, Inter/Arial 1.019 (0.98 at 600).
   Overrides = Pretendard hhea 1950/-494/0 (Inter 1984/-494/0) per 2048 upm, divided by size-adjust.
   Apple SD Gothic Neo is not measurable here, so Apple platforms fall through to system-ui unadjusted. */
@font-face { font-family: "Pretendard Fallback M"; src: local("Malgun Gothic"), local("MalgunGothic"); font-weight: 400;
  size-adjust: 86%; ascent-override: 110.7%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Pretendard Fallback M"; src: local("Malgun Gothic Bold"), local("MalgunGothicBold"); font-weight: 700;
  size-adjust: 86%; ascent-override: 110.7%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Pretendard Fallback N"; src: local("Noto Sans CJK KR"), local("NotoSansCJKkr-Regular"), local("Noto Sans KR"), local("NotoSansKR-Regular"); font-weight: 400;
  size-adjust: 95.5%; ascent-override: 99.7%; descent-override: 25.2%; line-gap-override: 0%; }
@font-face { font-family: "Pretendard Fallback N"; src: local("Noto Sans CJK KR Bold"), local("NotoSansCJKkr-Bold"), local("Noto Sans KR Bold"), local("NotoSansKR-Bold"); font-weight: 700;
  size-adjust: 95.5%; ascent-override: 99.7%; descent-override: 25.2%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); font-weight: 400;
  size-adjust: 102%; ascent-override: 95%; descent-override: 23.6%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"); font-weight: 700;
  size-adjust: 98%; ascent-override: 98.9%; descent-override: 24.6%; line-gap-override: 0%; }

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #F4F7FA;
  --color-surface: #FFFFFF;
  --color-surface-elevated: #F7FAFC;

  --color-text-primary: #102238;
  --color-text-secondary: #42566E;
  --color-text-muted: #62758B;

  --color-border: #D6E0E9;
  --color-border-strong: #BAC9D8;

  --color-primary: #1E3A5F;
  --color-primary-hover: #18314F;
  --color-primary-soft: #E8EEF5;

  --color-accent: #2E7D78;
  --color-accent-soft: #E5F5F3;

  --color-success: #1F825A;
  --color-warning: #9A6700;
  --color-error: #C2413C;
  --color-info: #0F6F8F;

  --shadow-sm: 0 1px 2px rgba(16, 34, 56, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 34, 56, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 34, 56, 0.12);

  --ink-solid: #18314F;   /* inverse surface (logo / ink button) */

  --focus-ring: var(--color-primary);   /* L25: 3px ring, >=3:1 on bg/surface/primary-soft (WCAG 1.4.11) */

  /* L37: badge tone text = 75% tone + 25% text-primary, >=4.5:1 on its 14% tint over bg/surface/elevated
     (FarfoldCssContrastTest computes the ratios from these hex values) */
  --badge-text-ok: #1B6A52;
  --badge-text-warn: #78560E;
  --badge-text-risk: #96393B;
  --badge-text-neutral: #4E6076;
}

:root[data-theme="black"] {
  color-scheme: dark;
  --color-bg: #04111E;
  --color-surface: #0A1A2B;
  --color-surface-elevated: #102235;

  --color-text-primary: #F2F7FA;
  --color-text-secondary: #B7C5D6;
  --color-text-muted: #8C9AAF;

  --color-border: #203246;
  --color-border-strong: #355069;

  --color-primary: #5D85B1;
  --color-primary-hover: #7098C2;
  --color-primary-soft: #16304A;

  --color-accent: #62C8C0;
  --color-accent-soft: #123D40;

  --color-success: #4CC38A;
  --color-warning: #E7B34C;
  --color-error: #F07C73;
  --color-info: #5DB4D4;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 0 0 1px rgba(93, 133, 177, 0.10), 0 16px 40px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 0 0 1px rgba(93, 133, 177, 0.16), 0 24px 60px rgba(0, 0, 0, 0.46);

  --ink-solid: #2D4E71;

  --focus-ring: var(--color-primary);   /* L25: ~4.6:1 on surface, 3.5:1 on primary-soft */

  --badge-text-ok: #76D0A6;
  --badge-text-warn: #EAC478;
  --badge-text-risk: #F09B95;
  --badge-text-neutral: #A6B1C2;
}

/* -------------------- Scales + legacy aliases (theme-independent) --------- */
:root {
  /* radius */
  /* Wave O (L66): controls (buttons, inputs, tabs) use md and below = max 4px; cards lg = 8px; sheets xl = 10px. */
  --radius-xs: 2px; --radius-sm: 3px; --radius-md: 4px;
  --radius-lg: 8px; --radius-xl: 10px; --radius-full: 999px;

  /* spacing (4px grid) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* type */
  --font-sans: "Pretendard", "Pretendard Fallback M", "Pretendard Fallback N", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-num: "Inter", "Inter Fallback", "Pretendard", "Pretendard Fallback M", "Pretendard Fallback N", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Wave O: serif for h1/h2 only (Noto Serif KR 600 unicode-range slices, vendor/fonts). Falls back to system sans, not a system serif.
     No Pretendard/Inter in this chain: a late narrower sans slice re-wraps the heading before the serif lands (CLS, TASK-095 perf). */
  --font-display: "Noto Serif KR", "Noto Serif CJK KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Legacy aliases -> design tokens (resolve per active theme) */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --text: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --line: var(--color-border);
  --shadow: var(--shadow-md);
  --blue: var(--color-primary);
  --ink: var(--ink-solid);
  --ok: var(--color-success);
  --warn: var(--color-warning);
  --risk: var(--color-error);
  --neutral: var(--color-text-muted);
  --radius: var(--radius-lg);

  /* motion v2 (L62, docs/design/visual-refresh/motion-research.md §5.1). The only place raw times and curves live
     (FarfoldMotionCssTest). Times stay in ms so JS can parseFloat them (FF.dur, chart theme). No spring/overshoot. */
  --motion-dur-micro: 120ms;     /* hover · press · colour */
  --motion-dur-short: 180ms;     /* state change: tab · filter · toggle · dim */
  --motion-dur-medium: 240ms;    /* enter: reveal · panel · popover · shared-element morph */
  --motion-dur-exit: 160ms;      /* exit is shorter than enter */
  --motion-dur-draw: 400ms;      /* data drawing: first chart render · path beam, once per view */
  --motion-dur-count: 600ms;     /* number count-up, first view only */
  --motion-dur-shimmer: 1400ms;  /* one skeleton shimmer pass (2 passes max, then static) */
  --motion-stagger: 40ms;        /* x at most 6 siblings */
  --motion-dist-sm: 4px;         /* popover · copy label */
  --motion-dist-md: 8px;         /* reveal (L59 cap) */
  --motion-ease-enter: cubic-bezier(0.2, 0, 0, 1);
  --motion-ease-exit: cubic-bezier(0.3, 0, 1, 1);
  --motion-ease-move: cubic-bezier(0.2, 0, 0.38, 0.9);
}
/* reduced motion: every duration and distance is 0, so tokenised transitions never start */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-dur-micro: 0ms; --motion-dur-short: 0ms; --motion-dur-medium: 0ms; --motion-dur-exit: 0ms;
    --motion-dur-draw: 0ms; --motion-dur-count: 0ms; --motion-dur-shimmer: 0ms; --motion-stagger: 0ms;
    --motion-dist-sm: 0px; --motion-dist-md: 0px;
  }
}

/* Cross-document View Transitions (L-M3): CSS only, no blocking=render, off under reduced motion; browsers without
   support (Firefox) simply navigate. Root crossfade only (no slide/zoom); the topbar stays put.
   Shared elements: FF.vtName(el, name) in ff-ui.js (one element per name per page); morph = medium (<= 280ms). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(*) { animation-duration: var(--motion-dur-medium); animation-timing-function: var(--motion-ease-move); }
::view-transition-group(root) { animation-duration: var(--motion-dur-short); }
::view-transition-old(root) { animation-duration: var(--motion-dur-micro); animation-timing-function: var(--motion-ease-exit); }
::view-transition-new(root) { animation-duration: var(--motion-dur-short); animation-timing-function: var(--motion-ease-enter); }
.topbar { view-transition-name: ff-topbar; }
::view-transition-old(ff-topbar) { animation: none; opacity: 0; }
::view-transition-new(ff-topbar) { animation: none; }

/* ---------------------------------- Base --------------------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.57;
  word-break: keep-all; /* Korean copy wraps on word boundaries */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--motion-dur-short) var(--motion-ease-move), color var(--motion-dur-short) var(--motion-ease-move);
}
/* Legacy body theme classes are now cosmetic no-ops; theme comes from [data-theme]. */

a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Long URLs / tickers / machine terms only — never whole Korean paragraphs. */
.break-any { overflow-wrap: anywhere; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grow { flex: 1; }

/* ------------------------------ Typography ------------------------------- */
/* Korean heading tracking: h1/h2 -0.01em, h3 0 (design-spec §10). */
/* Wave O: serif display face, one step smaller with more leading. 600 is the only shipped weight (no faux bold). */
h1, h2 { font-family: var(--font-display); font-weight: 600; }
h1 { font-size: 30px; line-height: 42px; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 32px; letter-spacing: -0.005em; margin: 0 0 10px; }
h1, h2 { text-wrap: balance; } /* AT-07 */
/* Wave O r1 + TASK-078: card- and panel-level h2 (15–20px) stay sans so a card title never out-ranks the sans h3 beside it. */
.market-card-title, .lens-legal-title, .thesis-aside-title, .edu-panel-title, .edu-warnings h2, .edu-downloads h2,
.ff-glance-head h2, .rc-h2-inline, .waitlist-card h2,
.lens-regime-title, .nc-h, .rc-h2, .edu-subhead { font-family: var(--font-sans); }
h3 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0; margin: 0 0 8px; }
p { margin: 0 0 10px; }

/* -------------------------------- Topbar (identical bar on every page) ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--motion-dur-short) var(--motion-ease-move), box-shadow var(--motion-dur-short) var(--motion-ease-move), border-color var(--motion-dur-short) var(--motion-ease-move);
}
/* Sticky-scroll state: once the page scrolls past the top, raise surface opacity
   and add a soft shadow so the bar separates cleanly from content (both themes). */
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--color-surface) 97%, transparent);
  border-bottom-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 62px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.brand .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft); }
/* Theme-swapped brand mark (logo.svg light / logo-dark.svg black). */
.brand img.brand-logo { height: 20px; width: auto; display: inline-block; }
.brand img.brand-logo--dark { display: none; }
[data-theme="black"] .brand img.brand-logo--light { display: none; }
[data-theme="black"] .brand img.brand-logo--dark { display: inline-block; }
/* Footer horizontal lockup (logo-wordmark*.svg at 22px). */
img.brand-wordmark { height: 22px; width: auto; display: block; margin-bottom: 12px; }
img.brand-wordmark--dark { display: none; }
[data-theme="black"] img.brand-wordmark--light { display: none; }
[data-theme="black"] img.brand-wordmark--dark { display: block; }
@media (max-width: 768px) { .brand img.brand-logo { height: 18px; } }
.nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.nav > a { padding: 4px 0; font-weight: 500; font-size: 14px; color: var(--color-text-secondary); transition: color var(--motion-dur-micro) var(--motion-ease-enter); }
.nav > a:hover { color: var(--text); }
.nav > a.active { color: var(--color-primary); font-weight: 600; }
.navactions { display: flex; gap: 10px; align-items: center; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px; padding: 0; justify-content: center;
  border-radius: var(--radius-sm);
}
.theme-toggle .theme-ico { width: 18px; height: 18px; }
/* light shows the moon (switch to black), black shows the sun */
.theme-toggle .theme-ico--sun, [data-theme="black"] .theme-toggle .theme-ico--moon { display: none; }
[data-theme="black"] .theme-toggle .theme-ico--sun { display: block; }

/* Fixed menu dropdowns (TASK-033): MARKET▾ · 리서치▾ · 계정▾ — disclosure pattern. */
.nav > a:focus-visible { outline: none; border-radius: var(--radius-sm); box-shadow: 0 0 0 3px var(--focus-ring); }
.nav-dd { position: relative; display: inline-flex; align-items: center; }
.nav-dd-btn {
  padding: 4px 0; font: inherit; font-weight: 500; font-size: 14px;
  color: var(--color-text-secondary); background: transparent; border: none; cursor: pointer;
  border-radius: var(--radius-sm); transition: color var(--motion-dur-micro) var(--motion-ease-enter);
}
.nav-dd-btn span { font-size: 10px; margin-left: 2px; }
.nav-dd-btn:hover, .nav-dd.open .nav-dd-btn { color: var(--text); }
.nav-dd.is-active > .nav-dd-btn { color: var(--color-primary); font-weight: 600; }
.nav-dd-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
/* Account trigger sits beside the theme toggle — button-like chrome to match .btn height. */
.nav-dd-btn--account {
  padding: 8px 12px; border: 1px solid var(--color-border); background: var(--color-surface);
  font-weight: 600; color: var(--text);
}
.nav-dd-btn--account:hover { border-color: var(--color-border-strong); background: var(--color-surface-elevated); }
.nav-dd-menu {
  position: absolute; left: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.nav-dd--end .nav-dd-menu { left: auto; right: 0; }
.nav-dd.open .nav-dd-menu { display: block; }
.nav-dd-menu a, .nav-dd-menu .nav-dd-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 13px; color: var(--color-text-secondary);
  background: transparent; border: none; cursor: pointer;
}
.nav-dd-menu form { margin: 0; }
.nav-dd-menu a:hover, .nav-dd-menu .nav-dd-item:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.nav-dd-menu a:focus-visible, .nav-dd-menu .nav-dd-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus-ring); }
.nav-dd-menu a[aria-current="page"] { color: var(--color-primary); background: var(--color-primary-soft); }
.nav-dd-menu .sep { height: 1px; background: var(--color-border); margin: 6px 4px; }
.nav-dd-menu .grouplabel {
  font-size: 10px; font-weight: 700;
  color: var(--color-text-muted); padding: 8px 12px 3px;
}
/* Mobile (no tab bar): brand + actions on row 1, menu on its own row 2. */
@media (max-width: 768px) {
  .topbar-inner { row-gap: 6px; }
  .topbar .nav { order: 3; flex-basis: 100%; gap: 6px 16px; }
  .nav > a, .nav-dd-btn { min-height: 36px; display: inline-flex; align-items: center; }
  .nav-dd-btn--account { min-height: 44px; }
}
@media (max-width: 420px) {
  .topbar .nav { gap: 4px 12px; }
  .nav > a, .nav-dd-btn:not(.nav-dd-btn--account) { font-size: 13px; }
}

/* Footer site menu — same IA as the top bar. */
.footer-nav {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px;
  border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px;
  font-size: 13px; line-height: 20px;
}
.footer-nav-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.footer-nav-head { font-weight: 700; font-size: 12px; color: var(--text); }
.footer-nav a, .footer-nav-btn { color: var(--color-text-secondary); }
.footer-nav a:hover, .footer-nav-btn:hover { color: var(--color-primary); }
.footer-nav a.footer-nav-head { color: var(--text); }
.footer-nav form { margin: 0; }
.footer-nav-btn { padding: 0; font: inherit; background: transparent; border: none; cursor: pointer; text-align: left; }
.footer-nav a:focus-visible, .footer-nav-btn:focus-visible { outline: none; border-radius: var(--radius-sm); box-shadow: 0 0 0 3px var(--focus-ring); }
.footer-nav + .disclaimer { margin-top: 20px; }
@media (max-width: 768px) { .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-weight: 600; font-size: 14px; line-height: 20px; cursor: pointer; color: var(--text);
  transition: background-color var(--motion-dur-micro) var(--motion-ease-enter), border-color var(--motion-dur-micro) var(--motion-ease-enter), color var(--motion-dur-micro) var(--motion-ease-enter), transform var(--motion-dur-micro) var(--motion-ease-enter);
}
.btn:hover { background: var(--color-surface-elevated); border-color: var(--color-border-strong); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.btn:disabled { opacity: 0.56; cursor: not-allowed; box-shadow: none; transition: none; }

.btn.primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn.primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
/* Black theme: primary is tuned as a foreground color — white label would fall
   below 4.5:1, so filled-button labels use the page background ink instead. */
[data-theme="black"] .btn.primary { color: var(--color-bg); }
/* L37: two-tone ring — a bg-coloured gap keeps the ring visible against the primary fill (WCAG 2.4.7) */
.btn.primary:focus-visible { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 5px var(--focus-ring); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--color-text-secondary); }
.btn.ghost:hover { background: var(--color-primary-soft); color: var(--color-primary); }

.btn.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ink:hover { filter: brightness(1.08); }

.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn.lg { padding: 13px 20px; font-size: 15px; }

/* ------------------------------ Cards & grid ----------------------------- */
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 20px; /* AC-09: no resting shadow — border only; shadow is for hover/floating UI */
}
.card h2, .card h3 { margin: 0 0 12px 0; }
/* Informational label (status, date, step) — Wave O: no uppercase, no tracking; decorative eyebrows were removed. */
.kicker { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }

/* ------------------------------ Metric card ------------------------------ */
.metric .value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
}
.metric .label { color: var(--muted); font-size: 12px; font-weight: 600; }
/* Pricing plan cards: KRW strings (₩199,000/월) run longer than USD. Keep them fitting
   inside the 4-up plan cards at the tightest column width without page overflow. */
.metric .value.price { font-size: 26px; letter-spacing: -0.01em; overflow-wrap: anywhere; }

/* --------------------------------- Tones --------------------------------- */
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-risk { color: var(--risk); }
.tone-neutral { color: var(--neutral); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--neutral); }
.dot.tone-ok { background: var(--ok); }
.dot.tone-warn { background: var(--warn); }
.dot.tone-risk { background: var(--risk); }
.dot.tone-neutral { background: var(--neutral); }

/* ------------------------------- Phase badge ----------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--radius-xs); font-weight: 600; font-size: 12px; border: 1px solid var(--line);
}
.badge.tone-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--badge-text-ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.badge.tone-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--badge-text-warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.badge.tone-risk { background: color-mix(in srgb, var(--risk) 14%, transparent); color: var(--badge-text-risk); border-color: color-mix(in srgb, var(--risk) 32%, transparent); }
.badge.tone-neutral { background: color-mix(in srgb, var(--neutral) 14%, transparent); color: var(--badge-text-neutral); border-color: color-mix(in srgb, var(--neutral) 32%, transparent); }
/* L65: squared tag — tone badges carry a left accent rule instead of a capsule shape */
.badge[class*="tone-"] { border-left: 2px solid currentColor; }

/* -------------------------------- Score bar ------------------------------ */
.scorebar { background: var(--line); border-radius: 0; height: 6px; overflow: hidden; margin-top: 6px; }
.scorebar > span { display: block; height: 100%; background: var(--blue); }
.scorebar.tone-ok > span { background: var(--ok); }
.scorebar.tone-warn > span { background: var(--warn); }
.scorebar.tone-risk > span { background: var(--risk); }

/* ------------------------------- Signal pill ----------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; margin: 3px 3px 0 0;
  border-radius: var(--radius-xs); border: 1px solid var(--line); font-size: 12px; font-weight: 600;
}

/* ---------------------------- Locked / upgrade --------------------------- */
.locked { position: relative; border-style: dashed; opacity: 0.92; }
.locked .lock-note { color: var(--muted); font-weight: 600; }
.cta {
  border: 1px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border-radius: var(--radius-lg); padding: 20px;
}

/* --------------------------------- Tables -------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--color-text-secondary); font-size: 11px; font-weight: 600; }
table.data td { color: var(--text); }
table.data tr:hover td { background: var(--color-surface-elevated); }
table.data td.mono, table.data td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ------------------------------- Disclaimer ------------------------------ */
.disclaimer {
  font-size: 12px; line-height: 18px; color: var(--muted); border-top: 1px solid var(--line);
  margin-top: 32px; padding-top: 16px;
}
.disclaimer strong { color: var(--text); }

/* -------------------------------- Checklist ------------------------------ */
ul.checklist { list-style: none; padding: 0; margin: 0; }
ul.checklist li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.check { font-weight: 700; }
.check.yes { color: var(--ok); }
.check.no { color: var(--risk); }
.check.na { color: var(--neutral); }

/* ----------------------------- Transmission ------------------------------ */
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.path .step { padding: 5px 10px; border-radius: var(--radius-sm); background: var(--color-surface-elevated); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.path .arrow { color: var(--muted); }

/* ------------------------------ Graph canvas ----------------------------- */
#graph, .graph-panel { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

/* --------------------------------- Hero ---------------------------------- */
.hero { padding: 48px 0 24px 0; }
.hero h1 { font-size: 36px; line-height: 48px; margin: 0 0 12px 0; letter-spacing: -0.01em; }
.hero p.sub { font-size: 16px; line-height: 26px; color: var(--muted); max-width: 640px; }
@media (max-width: 720px) { .hero h1 { font-size: 28px; line-height: 38px; } }

/* --------------------------------- Legend -------------------------------- */
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ------------------------------- Chart boxes ----------------------------- */
.chartbox { height: 240px; }
.chartbox.tall { height: 320px; }

/* -------------------------------- News tape ------------------------------ */
.newsitem { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.newsitem:last-child { border-bottom: 0; }
.newsitem .meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.newsitem .hl { font-weight: 600; font-size: 13px; margin-top: 2px; }

/* ---------------------------- Flash / forms ------------------------------ */
.flash {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border: 1px solid var(--color-primary); border-radius: var(--radius-md);
  padding: 10px 14px; margin-top: 12px; font-weight: 600; color: var(--text);
}
.error { color: var(--risk); font-weight: 600; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--color-text-secondary); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--text); font-size: 16px; /* 16px: iOS zooms the page on focus below this (TASK-138 #14) */
  transition: border-color var(--motion-dur-micro) var(--motion-ease-enter);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--focus-ring);
}
.field input::placeholder, .field textarea::placeholder { color: var(--color-text-muted); }

/* Global focus ring (L25: one token, no per-page overrides; low specificity). */
:where(a, button, [tabindex], summary, input, select, textarea):focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: var(--radius-xs); }

/* --------------------- Data table horizontal scroll ---------------------- */
/* Wrap wide tables in .table-scroll so the page body never scrolls sideways. */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll > table.data { min-width: 560px; }
/* TASK-138 #7: when a table or code block runs past an edge, that edge fades, so the part off screen is discoverable.
   Scroll-driven, CSS only: with no sideways overflow the timeline is inactive and nothing fades (same @supports gate as .edu-readbar).
   shortcut: browsers without animation-timeline, and reduced-motion (site-kit turns animations off), keep the plain scroll area;
   upgrade to a JS-toggled class if that share matters. #000 below is mask alpha, not a colour. */
@property --ff-edge-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --ff-edge-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes ff-scroll-edge { 0% { --ff-edge-l: 0px; --ff-edge-r: 32px; } 4%, 96% { --ff-edge-l: 32px; --ff-edge-r: 32px; } 100% { --ff-edge-l: 32px; --ff-edge-r: 0px; } }
@supports (animation-timeline: scroll()) {
  .table-scroll, .ff-code-pre, .code-excerpt {
    animation: ff-scroll-edge linear both; animation-timeline: scroll(self inline);
    mask-image: linear-gradient(to right, transparent, #000 var(--ff-edge-l), #000 calc(100% - var(--ff-edge-r)), transparent);
  }
  :is(.table-scroll, .ff-code-pre, .code-excerpt):focus-visible { mask-image: none; } /* a mask would clip the focus ring */
}

/* inserted by ff-ui.js above a scroll box that overflows sideways; .ff-site prefix beats the site-kit paragraph reset */
.ff-site .lens-legal-title { font-size: 16px; line-height: 24px; font-weight: 600; } /* TASK-138 1c: the legal notice heading reads as a note on site pages, as studio.css already does */
.scroll-hint, .ff-site .scroll-hint { margin: 0 0 var(--space-1); font-size: 12px; line-height: 16px; color: var(--color-text-secondary); text-align: right; }

/* ---------------------- Bottom tab bar (≤768px app nav) ------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: none;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border);
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 6px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.tabbar-items {
  display: flex; align-items: stretch; justify-content: space-between; gap: 4px;
  max-width: 560px; margin: 0 auto; height: 100%;
}
.tabbar-item {
  flex: 1; min-width: 44px; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-md); padding: 4px 6px;
  color: var(--color-text-muted); font-family: inherit;
  font-size: 11px; font-weight: 600; line-height: 1.2; text-decoration: none;
}
.tabbar-item .tabbar-icon { width: 22px; height: 22px; display: block; }
.tabbar-item .tabbar-icon svg { width: 100%; height: 100%; display: block; }
.tabbar-item.active, .tabbar-item[aria-current="page"] {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

/* Home "메뉴" tab bottom sheet (same IA as the top bar fixed menu). */
.tabbar-sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.tabbar-sheet.open { display: block; }
.tabbar-sheet .sheet-scrim { position: absolute; inset: 0; background: rgba(4, 17, 30, 0.5); }
.tabbar-sheet .sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--color-surface); border: 1px solid var(--color-border); border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 70vh; overflow-y: auto;
}
.tabbar-sheet .sheet-handle { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--color-border-strong); margin: 0 auto 10px; }
.tabbar-sheet .sheet-panel a, .tabbar-sheet .sheet-panel .sheet-item {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; color: var(--color-text-secondary);
}
.tabbar-sheet .sheet-panel .sheet-item { width: 100%; text-align: left; font-family: inherit; background: transparent; border: none; cursor: pointer; }
.tabbar-sheet .sheet-panel form { margin: 0; }
.tabbar-sheet .sheet-panel a:hover, .tabbar-sheet .sheet-panel .sheet-item:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.tabbar-sheet .sheet-panel .sheet-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus-ring); }
.tabbar-sheet .sheet-panel .sep { height: 1px; background: var(--color-border); margin: 8px 4px; }
.tabbar-sheet .sheet-panel .grouplabel {
  font-size: 11px; font-weight: 700;
  color: var(--color-text-muted); padding: 10px 12px 4px;
}

/* ----------------------- Mobile (≤768px) app rules ------------------------ */
@media (max-width: 768px) {
  body { font-size: 16px; }                     /* Korean body minimum 16px */
  .small { font-size: 14px; }
  table.data { font-size: 14px; }               /* never below 14px */
  .tabbar { display: block; }
  /* Tab bar height + 24px clearance so the compliance footer stays reachable. */
  body:has(.tabbar), body.has-tabbar { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  /* Top nav collapses once the tab bar is present (More sheet covers the rest). body.has-tabbar applies it at first
     paint; :has() alone waits until the tab bar at the end of a long page is parsed (layout shift, TASK-095 perf). */
  body:has(.tabbar) .topbar .nav, body.has-tabbar .topbar .nav { display: none; }
  .theme-toggle { width: 44px; height: 44px; }
}

/* ======================================================================
   Market Intelligence (/market) — additive only. Tokens only.
   ====================================================================== */

/* -- accessibility helper -- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------- data-state fragments ------------------------ */
.ds-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  white-space: nowrap;
}
.ds-badge:is(.ds-live, .ds-delayed, .ds-eod, .ds-stale) { border-left-width: 2px; }
.ds-badge .ds-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); flex: 0 0 auto; }
.ds-live    { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 40%, transparent);   background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.ds-live    .ds-dot { background: var(--ok); }
.ds-delayed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.ds-delayed .ds-dot { background: var(--warn); }
.ds-eod     { color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 40%, transparent); background: color-mix(in srgb, var(--color-info) 12%, var(--surface)); }
.ds-eod     .ds-dot { background: var(--color-info); }
/* L27: STALE is warn toned, never --risk (non-signal); text darkened for AA on the tint */
.ds-stale   { color: color-mix(in srgb, var(--warn) 75%, var(--text)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.ds-stale   .ds-dot { background: var(--warn); }
/* FIXTURE: deliberately loud + dashed so it can never read as real data. */
.ds-fixture {
  color: var(--color-warning); font-weight: 800;
  border: 1px dashed color-mix(in srgb, var(--color-warning) 60%, transparent);
  background: color-mix(in srgb, var(--color-warning) 14%, var(--surface));
}
.ds-fixture .ds-dot { background: var(--color-warning); }

.fixture-banner {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 10px 0; padding: 8px 12px;
  border: 1px dashed color-mix(in srgb, var(--color-warning) 55%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-warning) 10%, var(--surface));
  color: var(--color-text-secondary); font-size: 12px; line-height: 1.5;
}
.fixture-banner-icon { color: var(--color-warning); font-weight: 800; flex: 0 0 auto; }
.fixture-banner strong { color: var(--color-warning); }

.source-line { margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.source-line-val { color: var(--color-text-secondary); }

.state-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 24px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
}
.state-block .state-icon { font-size: 20px; color: var(--muted); }
.state-error { border-color: color-mix(in srgb, var(--risk) 40%, transparent); }
.state-error .state-icon { color: var(--risk); }

.stale-warning { /* L27: warn toned, never --risk */
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  color: color-mix(in srgb, var(--warn) 75%, var(--text)); font-size: 12px;
}

/* ------------------------------ layout -------------------------------- */
.market-intro {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 6px;
}
.market-h1 { margin: 2px 0 0; }
.market-sub { margin: 6px 0 0; max-width: 62ch; }
.market-intro-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px; align-items: start; margin-top: 16px;
}
.market-header-card { grid-column: 1 / -1; }
.market-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.market-rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Tablet / mobile: rail drops below main, cards reorder for reading priority. */
@media (max-width: 1024px) {
  .market-grid { grid-template-columns: 1fr; }
  .market-main, .market-rail { display: contents; }
  .market-grid > * { order: 50; }
  .market-header-card { order: 0; grid-column: 1 / -1; }
  [data-card="what-changed"]    { order: 1; }
  [data-card="upcoming-events"] { order: 2; }
  [data-card="chart"]           { order: 3; }
  [data-card="sector-regime"]   { order: 4; }
  [data-card="watchlist"]       { order: 5; }
  [data-card="structural"]      { order: 6; }
  [data-card="factor"]          { order: 7; }
  [data-card="rates"]           { order: 8; }
}

/* ------------------------------ cards --------------------------------- */
.market-card { min-width: 0; }
.market-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 12px;
}
.market-card-head .kicker { margin-bottom: 2px; }
.market-card-title { margin: 0; font-size: 16px; }
.market-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.badge.sm { padding: 1px 7px; font-size: 10px; }

/* ------------------------- market header card ------------------------- */
.header-regime-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.regime-badge { font-size: 13px; font-weight: 800; }
.header-read { margin: 12px 0 14px; font-size: 15px; line-height: 1.55; color: var(--text); max-width: 80ch; }
.header-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .header-metrics { grid-template-columns: repeat(2, 1fr); } }
.hm-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--line);
  border-left-width: 4px; border-radius: var(--radius-sm); background: var(--color-surface-elevated);
}
.hm-tile.tone-ok   { border-left-color: var(--ok); }
.hm-tile.tone-warn { border-left-color: var(--warn); }
.hm-tile.tone-risk { border-left-color: var(--risk); }
.hm-k { font-size: 11px; font-weight: 700; color: var(--muted); }
.hm-v { font-size: 22px; font-weight: 800; }
.hm-s { font-size: 11px; color: var(--muted); }

/* ------------------------- TradingView widget ------------------------- */
.tv-widget-shell {
  /* TradingView autosize 위젯이 mount에 인라인 height:100%를 지정하므로
     부모는 min-height가 아닌 명시 height가 있어야 %가 해석된다 */
  position: relative; width: 100%; height: 480px; min-height: 480px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--color-surface-elevated);
}
.tv-widget-mount, .tv-widget-mount .tradingview-widget-container__widget { width: 100%; height: 480px; }
.tv-skeleton {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; z-index: 1;
}
.tv-skeleton-glow {
  width: 70%; height: 60%; border-radius: var(--radius-sm);
  background: linear-gradient(100deg,
    var(--color-surface-elevated) 30%,
    color-mix(in srgb, var(--color-border) 60%, var(--color-surface-elevated)) 50%,
    var(--color-surface-elevated) 70%);
  background-size: 200% 100%; animation: tvShimmer var(--motion-dur-shimmer) var(--motion-ease-move) 2;
}
.tv-skeleton-label { position: relative; }
@keyframes tvShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.tv-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 24px; z-index: 2; background: var(--color-surface-elevated);
}
.tv-fallback .state-icon { font-size: 24px; color: var(--muted); }
/* display:flex가 hidden 속성의 UA display:none을 이기지 않도록 명시적으로 숨김 */
.tv-fallback[hidden] { display: none; }
.tv-note { margin: 8px 0 0; }

/* --------------------------- sector regime map ------------------------ */
.legend-glyph { font-size: 12px; line-height: 1; }
.sector-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sector-tile {
  padding: 12px; border: 1px solid var(--line); border-top-width: 3px;
  border-radius: var(--radius-sm); background: var(--color-surface-elevated);
}
.sector-tile.tone-ok   { border-top-color: var(--ok); }
.sector-tile.tone-warn { border-top-color: var(--warn); }
.sector-tile.tone-risk { border-top-color: var(--risk); }
.sector-tile.tone-neutral { border-top-color: var(--neutral); }
.sector-tile-head { display: flex; align-items: center; gap: 6px; }
.sector-glyph { font-size: 12px; line-height: 1; }
.sector-tile.tone-ok   .sector-glyph { color: var(--ok); }
.sector-tile.tone-warn .sector-glyph { color: var(--warn); }
.sector-tile.tone-risk .sector-glyph { color: var(--risk); }
.sector-tile.tone-neutral .sector-glyph { color: var(--neutral); }
.sector-ticker { font-weight: 800; font-size: 13px; }
.sector-phase { margin-left: auto; font-size: 11px; font-weight: 700; }
.sector-name { display: block; margin: 2px 0 8px; }
.sector-bars { display: flex; flex-direction: column; gap: 6px; }
.sector-bar-row { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; }
.sb-k { font-size: 10px; color: var(--muted); }
.sector-bars .sbar { height: 6px; border-radius: 0; background: var(--line); overflow: hidden; }
.sector-bars .sbar > span { display: block; height: 100%; }

/* ------------------------------ watchlist ----------------------------- */
.wl-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.wl-filter input {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; min-width: 220px;
}
.wl-filter input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--color-border-strong); }
table.data th[data-sort] { cursor: pointer; user-select: none; }
table.data th[data-sort]::after { content: ' ↕'; opacity: 0.4; font-size: 10px; }
table.data th[data-sort][aria-sort="ascending"]::after { content: ' ↑'; opacity: 1; }
table.data th[data-sort][aria-sort="descending"]::after { content: ' ↓'; opacity: 1; }
table.data tbody tr[data-symbol], table.data tbody tr[data-tv-symbol] { cursor: pointer; }
table.data tbody tr[aria-selected="true"] td { background: var(--color-primary-soft); }
table.data tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }

/* --------------------- structural change (tabs) ----------------------- */
.sc-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sc-tab {
  padding: 8px 14px; border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.sc-tab:hover { color: var(--text); background: var(--color-surface-elevated); }
.sc-tab[aria-selected="true"] { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.sc-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.sc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-item { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.sc-glyph { font-size: 18px; line-height: 1.1; }
.sc-glyph.tone-ok { color: var(--ok); } .sc-glyph.tone-warn { color: var(--warn); }
.sc-glyph.tone-risk { color: var(--risk); } .sc-glyph.tone-neutral { color: var(--neutral); }
.sc-body { min-width: 0; }
.sc-row { display: flex; align-items: baseline; gap: 8px; }
.sc-body p { margin: 2px 0 0; }
.sc-empty { padding: 16px 0; text-align: center; }

/* ----------------------------- factor grid ---------------------------- */
.factor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .factor-grid { grid-template-columns: repeat(2, 1fr); } }
.factor-tile {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px; border: 1px solid var(--line); border-left-width: 4px;
  border-radius: var(--radius-sm); background: var(--color-surface-elevated);
}
.factor-tile.tone-ok   { border-left-color: var(--ok); }
.factor-tile.tone-warn { border-left-color: var(--warn); }
.factor-tile.tone-risk { border-left-color: var(--risk); }
.factor-tile.tone-neutral { border-left-color: var(--neutral); }
.factor-tile-head { display: flex; align-items: center; gap: 6px; }
.factor-glyph { font-size: 11px; line-height: 1; }
.factor-tile.tone-ok   .factor-glyph { color: var(--ok); }
.factor-tile.tone-warn .factor-glyph { color: var(--warn); }
.factor-tile.tone-risk .factor-glyph { color: var(--risk); }
.factor-tile.tone-neutral .factor-glyph { color: var(--neutral); }
.factor-name { font-size: 12px; font-weight: 700; }
.factor-state { font-size: 14px; font-weight: 800; }

/* ------------------------------ what changed -------------------------- */
.wc-list, .ue-list, .rate-list { list-style: none; margin: 0; padding: 0; }
.wc-list { display: flex; flex-direction: column; gap: 6px; }
.wc-btn {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.wc-btn:hover { background: var(--color-surface-elevated); border-color: var(--color-border-strong); }
.wc-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.wc-glyph { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.wc-glyph.tone-ok { color: var(--ok); } .wc-glyph.tone-warn { color: var(--warn); }
.wc-glyph.tone-risk { color: var(--risk); } .wc-glyph.tone-neutral { color: var(--neutral); }
.wc-content { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.wc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wc-title { font-size: 13px; }
.wc-chevron { color: var(--muted); font-size: 18px; flex: 0 0 auto; }

/* ---------------------------- upcoming events ------------------------- */
.ue-list { display: flex; flex-direction: column; gap: 8px; }
.ue-item { display: flex; align-items: center; gap: 10px; }
.ue-dday { flex: 0 0 auto; min-width: 48px; justify-content: center; text-align: center; font-variant-numeric: tabular-nums; }
.ue-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ue-title { font-weight: 700; }

/* --------------------------- rates & liquidity ------------------------ */
.rate-list { display: flex; flex-direction: column; }
.rate-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: none; }
.rate-label { font-size: 13px; color: var(--muted); }
.rate-value { font-size: 15px; font-weight: 800; }

/* ------------------------- evidence drawer (P1) ----------------------- */
.evidence-drawer { position: fixed; inset: 0; z-index: 80; }
.evidence-scrim { position: absolute; inset: 0; background: rgba(4, 17, 30, 0.5); opacity: 0; transition: opacity var(--motion-dur-exit) var(--motion-ease-exit); }
.evidence-drawer.open .evidence-scrim { opacity: 1; transition-duration: var(--motion-dur-short); transition-timing-function: var(--motion-ease-enter); }
.evidence-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--motion-dur-exit) var(--motion-ease-exit);
}
.evidence-drawer.open .evidence-panel { transform: translateX(0); transition-duration: var(--motion-dur-medium); transition-timing-function: var(--motion-ease-enter); }
.evidence-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.evidence-panel-body { padding: 20px; overflow-y: auto; }
@media (max-width: 520px) { .evidence-panel { width: 100%; } }

/* ------------------------- reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tv-skeleton-glow { animation: none; }
  .evidence-scrim, .evidence-panel { transition: none; }
  .topbar { transition: none; }
}

/* ======================================================================
   Stock Intelligence — /company/{ticker} extension (ADDITIVE ONLY).
   Reuses existing tokens + market card/badge/tile/scorebar primitives.
   Red/green stay risk/repair tones — never buy/sell cues.
   ====================================================================== */

/* --- section sub-nav (scroll anchors) --------------------------------- */
.stock-subnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 14px 0 4px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius-md);
}
.stock-subnav a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.stock-subnav a:hover { color: var(--text); background: var(--color-surface-elevated); }
.stock-subnav a[aria-current="true"] { color: var(--color-primary); background: var(--color-primary-soft); }
.stock-subnav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
@media (max-width: 640px) { .stock-subnav { flex-wrap: nowrap; overflow-x: auto; } }
/* offset anchor targets so the sticky nav doesn't overlap section tops */
[id^="sec-"] { scroll-margin-top: 64px; }

/* --- header meta strip ------------------------------------------------ */
.stock-headmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stock-headmeta .stat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-xs);
  font-size: 12px; background: var(--color-surface-elevated);
}
.stock-headmeta .stat b { font-weight: 800; }
.stock-headmeta .stat .k { color: var(--muted); }

/* --- inline help tooltip (keyboard + hover) --------------------------- */
.tip { position: relative; border-bottom: 1px dotted var(--color-border-strong); cursor: help; }
.tip:hover::after, .tip:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 6px);
  z-index: 30; width: max-content; max-width: 260px; padding: 8px 10px;
  font-size: 12px; font-weight: 500; line-height: 1.45; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.tip:focus-visible { outline: none; }

/* --- regime summary --------------------------------------------------- */
.regime-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 720px) { .regime-metrics { grid-template-columns: repeat(2, 1fr); } }

/* --- event rail ------------------------------------------------------- */
.event-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.event-filter:empty { display: none; }
.ev-chip {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: color var(--motion-dur-micro) var(--motion-ease-enter), background-color var(--motion-dur-micro) var(--motion-ease-enter), border-color var(--motion-dur-micro) var(--motion-ease-enter);
}
.ev-chip:hover { color: var(--text); border-color: var(--color-border-strong); }
.ev-chip[aria-pressed="true"] { color: var(--color-primary); background: var(--color-primary-soft); border-color: var(--color-primary); border-bottom-width: 2px; padding-bottom: 4px; }
[data-theme="black"] .ev-chip[aria-pressed="true"] { color: var(--color-text-primary); } /* QA 2026-11-29: 3.5:1 → 13:1 */
.ev-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--color-surface-elevated); color: var(--text); font: inherit; cursor: pointer;
}
.ev-item:hover { border-color: var(--color-border-strong); }
.ev-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.ev-glyph {
  flex: 0 0 auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-weight: 800; font-size: 13px;
  background: var(--color-primary-soft); color: var(--color-primary);
}
.ev-item.tone-ok   .ev-glyph { background: color-mix(in srgb, var(--ok) 16%, transparent);   color: var(--ok); }
.ev-item.tone-warn .ev-glyph { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ev-item.tone-risk .ev-glyph { background: color-mix(in srgb, var(--risk) 16%, transparent); color: var(--risk); }
.ev-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.ev-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ev-type { font-size: 11px; font-weight: 700; color: var(--muted); }
.ev-date { margin-left: auto; font-size: 11px; color: var(--muted); }

/* --- scenario matrix -------------------------------------------------- */
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .scenario-grid { grid-template-columns: 1fr; } }
.scenario-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border: 1px solid var(--line); border-top-width: 3px;
  border-radius: var(--radius-sm); background: var(--color-surface-elevated);
}
.scenario-card.tone-ok      { border-top-color: var(--ok); }
.scenario-card.tone-risk    { border-top-color: var(--risk); }
.scenario-card.tone-neutral { border-top-color: var(--neutral); }
.scenario-card.is-base { border-color: var(--color-primary); border-top-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.scenario-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scenario-type { font-size: 14px; font-weight: 800; }
.scenario-narr { font-size: 13px; margin: 0; }
.scenario-sub { font-size: 11px; font-weight: 700; color: var(--muted); margin: 6px 0 0; }
.scenario-cond { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.scenario-cond li { display: flex; gap: 6px; font-size: 12px; }
.scenario-cond .ck { flex: 0 0 auto; font-weight: 800; }
.scenario-cond.confirm .ck { color: var(--ok); }
.scenario-cond.invalidate .ck { color: var(--risk); }

/* --- related entities + impact path ----------------------------------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.related-cat { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.related-cat h4 { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.related-item { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.related-item .r-glyph { flex: 0 0 auto; }
.related-item .r-glyph.tone-ok { color: var(--ok); } .related-item .r-glyph.tone-warn { color: var(--warn); }
.related-item .r-glyph.tone-risk { color: var(--risk); } .related-item .r-glyph.tone-neutral { color: var(--neutral); }
.impact-steps { list-style: none; margin: 6px 0 0; padding: 0; }
.impact-step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.impact-step:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.impact-num {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; background: var(--color-primary-soft); color: var(--color-primary);
}
.impact-body strong { font-size: 13px; }
.impact-body p { margin: 2px 0 0; }

/* --- financial health ------------------------------------------------- */
.fh-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.fh-score { font-size: 40px; font-weight: 800; line-height: 1; }
.fh-score.tone-ok { color: var(--ok); } .fh-score.tone-warn { color: var(--warn); } .fh-score.tone-risk { color: var(--risk); }
.fh-score small { font-size: 15px; color: var(--muted); font-weight: 600; }
.fh-sub { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.fh-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: start; }
@media (max-width: 560px) { .fh-row { grid-template-columns: 1fr; gap: 4px; } }
.fh-k { font-size: 13px; font-weight: 700; }
.fh-reason { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* --- factor profile --------------------------------------------------- */
.factor-profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 780px) { .factor-profile { grid-template-columns: 1fr; } }
.factor-radar-box { position: relative; min-height: 260px; }
.factor-radar-box canvas { max-width: 100%; }
.factor-table { width: 100%; border-collapse: collapse; }
.factor-table caption { text-align: left; }
.factor-table th, .factor-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.factor-table thead th { color: var(--muted); font-weight: 700; }
.factor-dir { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* --- evidence panel --------------------------------------------------- */
.evd-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 780px) { .evd-cols { grid-template-columns: 1fr; } }
.evd-col { padding: 12px; border: 1px solid var(--line); border-top-width: 3px; border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.evd-col.supporting    { border-top-color: var(--ok); }
.evd-col.contradicting { border-top-color: var(--risk); }
.evd-col.missing       { border-top-color: var(--neutral); }
.evd-col h4 { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.evd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.evd-item { font-size: 13px; padding-left: 14px; position: relative; }
.evd-item::before { content: '•'; position: absolute; left: 0; color: var(--muted); }
.evd-src { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* --- filings timeline ------------------------------------------------- */
.filings-tl { list-style: none; margin: 0; padding: 0; }
.filing-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.filing-item:last-child { border-bottom: none; }
.filing-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filing-type { font-size: 11px; font-weight: 700; color: var(--color-primary); }

@media (prefers-reduced-motion: reduce) {
  .stock-subnav { scroll-behavior: auto; }
}

/* ======================================================================
   Real-data conversion (ADDITIVE ONLY — 2026-07-30).
   Tokens only; red/green stay risk/repair tones — never buy/sell cues.
   ====================================================================== */

/* rates card: real treasury rows carry 1D/5D bp-change cells (4 columns) */
.rate-row.rate-row--deltas { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.rate-delta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rate-delta .rd-k { font-size: 10px; font-weight: 700; color: var(--muted); margin-right: 3px; }
.rate-note { margin: 10px 0 0; }

/* company regime summary: three real score tiles (no fixture confidence tile) */
.regime-metrics--three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .regime-metrics--three { grid-template-columns: 1fr; } }

/* ======================================================================
   ===== news-events =====  (ADDITIVE ONLY — 2026-07-30)
   /news-events list + detail + impact-path graph. Tokens only.
   Red/green stay risk/repair tones — never buy/sell cues.
   Vocabulary: Track/Watch/Confirm/Invalidate/Monitor.
   ====================================================================== */

.ne-wrap { max-width: 1280px; }

/* ---------------- list: summary strip ---------------- */
.ne-sumstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 920px) { .ne-sumstrip { grid-template-columns: repeat(2, 1fr); } }
.ne-sum {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
}
.ne-sum .k { font-size: 11px; font-weight: 700; color: var(--muted); }
.ne-sum .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ne-sum .s { font-size: 11px; color: var(--muted); }

/* ---------------- list: filter bar ---------------- */
.ne-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end;
  margin-top: 14px; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--color-surface);
}
.ne-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ne-f > label { font-size: 11px; font-weight: 700; color: var(--muted); }
.ne-f input, .ne-f select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; min-width: 0;
}
.ne-f input:focus-visible, .ne-f select:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--color-border-strong);
}
.ne-f--query input { min-width: 200px; }
.ne-f--sm select, .ne-f--sm input { max-width: 128px; }
.ne-filters .ne-f-actions { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 768px) {
  .ne-filters { padding: 10px; }
  .ne-f { flex: 1 1 45%; }
  .ne-f--query { flex: 1 1 100%; }
  .ne-filters .ne-f-actions { margin-left: 0; flex: 1 1 100%; }
}

/* ---------------- list: refresh row + new-events badge ---------------- */
.ne-refreshrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.ne-newbadge {
  display: none; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-xs);
  border: 1px solid var(--color-primary); color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ne-newbadge.on { display: inline-flex; }
.ne-newbadge:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------------- list: event cards ---------------- */
.ne-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ne-item {
  display: block; padding: 14px 16px;
  border: 1px solid var(--line); border-left-width: 4px; border-left-color: var(--neutral);
  border-radius: var(--radius-md); background: var(--color-surface);
  color: var(--text); transition: border-color var(--motion-dur-micro) var(--motion-ease-enter), background-color var(--motion-dur-micro) var(--motion-ease-enter);
}
.ne-item:hover { background: var(--color-surface-elevated); border-color: var(--color-border-strong); }
.ne-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.ne-item.exp-pos { border-left-color: var(--ok); }
.ne-item.exp-neg { border-left-color: var(--risk); }
.ne-item.exp-mixed { border-left-color: var(--color-info); }
.ne-item.is-new { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, transparent); }
.ne-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ne-item-title {
  margin: 4px 0 2px; font-size: 16px; line-height: 1.4; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ne-item-sum {
  margin: 0 0 8px; font-size: 13px; color: var(--color-text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ne-item-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ne-item-meta .sep { color: var(--color-border-strong); }
.ne-entchip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--radius-xs); border: 1px solid var(--line);
  background: var(--color-surface-elevated); font-size: 11px; font-weight: 600; color: var(--color-text-secondary);
}
.ne-tgt {
  display: inline-flex; padding: 1px 7px; border-radius: var(--radius-xs);
  background: var(--color-primary-soft); color: var(--color-primary);
  font-family: var(--font-num); font-size: 11px; font-weight: 700;
}
.ne-mini { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ne-minibar { width: 42px; height: 5px; border-radius: 0; background: var(--line); overflow: hidden; display: inline-block; vertical-align: middle; }
.ne-minibar > span { display: block; height: 100%; background: var(--blue); }

/* status badge tones reuse .badge; extra semantic labels handled in JS text */
.ne-status { font-size: 11px; padding: 2px 8px; }

/* Expected / Observed markers — always text, never colour-only */
.ne-exp-badge, .ne-obs-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: var(--radius-xs);
  font-size: 10px; font-weight: 800;
}
.ne-exp-badge { color: var(--muted); border: 1px dashed var(--color-border-strong); background: transparent; }
.ne-obs-badge { color: var(--color-text-primary); border: 1px solid var(--color-border-strong); background: var(--color-surface-elevated); }

/* direction badges: glyph + text + tone */
.ne-dir { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.ne-dir .g { font-size: 11px; }

/* skeleton rows */
.ne-skel { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; }
.ne-skel .bar {
  height: 12px; border-radius: var(--radius-xs); margin: 6px 0;
  background: linear-gradient(100deg,
    var(--color-surface-elevated) 30%,
    color-mix(in srgb, var(--color-border) 60%, var(--color-surface-elevated)) 50%,
    var(--color-surface-elevated) 70%);
  background-size: 200% 100%; animation: tvShimmer var(--motion-dur-shimmer) var(--motion-ease-move) 2;
}
.ne-skel .bar.w40 { width: 40%; } .ne-skel .bar.w70 { width: 70%; } .ne-skel .bar.w90 { width: 90%; }

/* pagination */
.ne-pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 6px; flex-wrap: wrap; }
.ne-pager .pg {
  min-width: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--color-text-secondary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ne-pager .pg[aria-current="page"] { color: var(--color-primary); border-color: var(--color-primary); background: var(--color-primary-soft); }
.ne-pager .pg:disabled { opacity: .45; cursor: not-allowed; }
.ne-pager .pg:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------------- detail: sections ---------------- */
.ne-sec { margin-top: 16px; }
.ne-sec > .card { min-width: 0; }
.ne-headrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.ne-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 720px) { .ne-scores { grid-template-columns: 1fr; } }
.ne-score { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.ne-score .k { font-size: 11px; font-weight: 700; color: var(--muted); }
.ne-facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }

/* low-confidence rows: dimmed but the number stays printed next to it */
.ne-lowconf { opacity: 0.62; }

/* timeline */
.ne-tl { list-style: none; margin: 0; padding: 0; }
.ne-tl li { display: grid; grid-template-columns: 148px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ne-tl li:last-child { border-bottom: none; }
.ne-tl .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ne-tl .ty { font-size: 10.5px; font-weight: 800; color: var(--color-primary); }
@media (max-width: 560px) { .ne-tl li { grid-template-columns: 1fr; gap: 2px; } }

/* articles */
.ne-articles { list-style: none; margin: 0; padding: 0; }
.ne-articles li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ne-articles li:last-child { border-bottom: none; }
.ne-articles .meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.ne-articles .hl { font-weight: 600; font-size: 13.5px; margin: 2px 0; }
.ne-articles a.out { color: var(--color-primary); font-weight: 600; font-size: 12px; }

/* ---------------- detail: graph area ---------------- */
.ne-graph-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ne-graph-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.ne-graph-shell { display: grid; grid-template-columns: minmax(0, 7fr) minmax(240px, 3fr); gap: 14px; align-items: start; }
.ne-graph-box {
  position: relative; overflow: auto; min-height: 320px; max-height: 560px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.ne-graph-box:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.ne-graph-box svg { display: block; }

/* column headers inside svg */
.ne-collabel { font-size: 10px; font-weight: 700; fill: var(--color-text-muted); }
.ne-colline { stroke: var(--line); stroke-dasharray: 2 4; }

/* nodes: neutral surface + left strip carries direction tone (never full fill) */
.ne-node { cursor: pointer; }
.ne-node .box { fill: var(--color-surface-elevated); stroke: var(--color-border-strong); stroke-width: 1; }
.ne-node.kind-event .box { fill: var(--color-primary-soft); stroke: var(--color-primary); stroke-width: 1.4; }
.ne-node.is-expected .box { stroke-dasharray: 4 3; }
.ne-node .strip { fill: var(--neutral); }
.ne-node.dir-pos .strip { fill: var(--ok); }
.ne-node.dir-neg .strip { fill: var(--risk); }
.ne-node.dir-mixed .strip { fill: var(--color-info); }
.ne-node.dir-unc .strip { fill: var(--neutral); }
.ne-node text { fill: var(--color-text-primary); font-family: var(--font-sans); }
.ne-node .lbl { font-size: 11.5px; font-weight: 700; }
.ne-node .sub { font-size: 10px; fill: var(--color-text-muted); }
.ne-node .glyph { font-size: 10px; font-weight: 800; }
.ne-node.dir-pos .glyph { fill: var(--ok); }
.ne-node.dir-neg .glyph { fill: var(--risk); }
.ne-node.dir-mixed .glyph { fill: var(--color-info); }
.ne-node.dir-unc .glyph { fill: var(--color-text-muted); }
.ne-node.is-selected .box { stroke: var(--color-accent); stroke-width: 2; stroke-dasharray: none; }
.ne-node:focus { outline: none; }
.ne-node:focus .box, .ne-node:hover .box { stroke: var(--color-primary); }
.ne-node .morebadge { fill: var(--color-text-muted); font-size: 9.5px; }

/* edges */
.ne-edge { cursor: pointer; }
.ne-edge .line { fill: none; stroke: var(--neutral); }
.ne-edge.dir-pos .line { stroke: var(--ok); }
.ne-edge.dir-neg .line { stroke: var(--risk); }
.ne-edge.dir-mixed .line { stroke: var(--color-info); }
.ne-edge.dir-unc .line { stroke: var(--neutral); }
.ne-edge.is-expected .line { stroke-dasharray: 5 4; }
.ne-edge .hit { fill: none; stroke: transparent; stroke-width: 12; }
.ne-edge text { font-size: 9.5px; fill: var(--color-text-muted); }
.ne-edge.is-selected .line { stroke: var(--color-accent); }
.ne-arrow-pos { fill: var(--ok); } .ne-arrow-neg { fill: var(--risk); }
.ne-arrow-mixed { fill: var(--color-info); } .ne-arrow-unc { fill: var(--neutral); }
.ne-arrow-sel { fill: var(--color-accent); }

/* hover / selection dimming */
.ne-dimmable { transition: opacity var(--motion-dur-short) var(--motion-ease-move); }
.ne-dimmable.is-dim { opacity: 0.24; }

/* path reveal animation (first view only; disabled under reduced motion).
   NOTE: opacity only — CSS transform would override the SVG translate() attribute. */
.ne-anim .ne-node { opacity: 0; }
.ne-anim.ne-anim-run .ne-node { opacity: 1; transition: opacity var(--motion-dur-medium) var(--motion-ease-enter); transition-delay: var(--ne-delay, 0ms); }
.ne-anim .ne-edge .line { stroke-dashoffset: var(--ne-len, 0); }
.ne-anim.ne-anim-run .ne-edge .line { stroke-dashoffset: 0; transition: stroke-dashoffset var(--motion-dur-draw) var(--motion-ease-move); transition-delay: var(--ne-delay, 0ms); }
@keyframes nePulse { 0% { stroke-width: 2; } 50% { stroke-width: 3.4; } 100% { stroke-width: 2; } }
.ne-edge.pulse-once .line { animation: nePulse var(--motion-dur-draw) var(--motion-ease-move) 1; }

/* inspector (desktop right rail / mobile bottom sheet) */
.ne-inspector {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--color-surface);
  padding: 14px 16px; max-height: 560px; overflow-y: auto;
}
.ne-inspector h4 { margin: 0 0 4px; font-size: 14px; }
.ne-inspector .k { font-size: 10.5px; font-weight: 700; color: var(--muted); margin: 10px 0 2px; }
.ne-inspector dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.ne-inspector dt { color: var(--muted); }
.ne-inspector dd { margin: 0; font-variant-numeric: tabular-nums; }
.ne-inspector-close { display: none; float: right; border: none; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
@media (max-width: 860px) {
  .ne-graph-shell { grid-template-columns: 1fr; }
  .ne-inspector {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 55vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform var(--motion-dur-medium) var(--motion-ease-enter);
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .ne-inspector.open { transform: translateY(0); }
  .ne-inspector-close { display: block; }
}

/* graph timeline slider */
.ne-tlslider { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ne-tlslider input[type="range"] { flex: 1; accent-color: var(--color-primary); }
.ne-tlslider .cur { font-size: 12px; color: var(--color-text-secondary); min-width: 0; }

/* graph alt table */
.ne-alt-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); padding: 6px 0; }
.ne-alt-table summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: var(--radius-xs); }

/* ---------------- detail: reactions ---------------- */
.ne-react-note { margin: 8px 0 0; }
.ne-judge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.ne-judge.match { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.ne-judge.diverge { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.ne-judge.pending { color: var(--muted); }

/* reduced motion: all news-events animation off */
@media (prefers-reduced-motion: reduce) {
  .ne-skel .bar { animation: none; }
  .ne-anim .ne-node, .ne-anim.ne-anim-run .ne-node { opacity: 1; transition: none; }
  .ne-anim .ne-edge .line, .ne-anim.ne-anim-run .ne-edge .line { stroke-dashoffset: 0; transition: none; }
  .ne-edge.pulse-once .line { animation: none; }
  .ne-dimmable { transition: none; }
  .ne-inspector { transition: none; }
}

/* ---------------- quant-lens shared components C1–C12 (TASK-060, components.md §3) ---------------- */
/* Existing tokens only. State colours stay neutral (L16); warn is reserved for 임계 미검증 / 최신 아님. */
.lens-meta { margin: 4px 0 0; }
.lens-release { overflow-wrap: anywhere; word-break: break-all; }
/* AT-07: dates never break mid-value; the compact card shows the release id on one line, full id in title= */
.lens-regime time, .lens-meta time { white-space: nowrap; }
.lens-regime--compact .lens-release, .lens-meta .lens-release { display: inline-block; max-width: min(100%, 32ch); vertical-align: bottom;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.lens-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.lens-tip { display: inline-block; }
.lens-tip > summary { cursor: pointer; list-style: none; }
.lens-tip > summary::-webkit-details-marker { display: none; }
.lens-tip > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.lens-tip-body {
  display: block; max-width: 36ch; margin-top: 6px; padding: 8px 10px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface-elevated); color: var(--color-text-secondary);
}
.lens-chip { white-space: normal; }
.lens-state, .lens-gate { margin: 12px 0; }
.lens-gate { border-style: solid; border-color: var(--color-border-strong); }
.lens-path { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lens-legal { margin-top: 24px; font-size: 13px; line-height: 20px; color: var(--color-text-secondary); }
.lens-legal-title { font-size: 15px; margin: 0 0 8px; color: var(--color-text-primary); }
.lens-legal-list { margin: 0 0 8px; padding-left: 18px; }
.lens-legal-list li + li { margin-top: 4px; }
.lens-sources { list-style: none; margin: 12px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.lens-sources li + li { margin-top: 4px; }
.lens-oneway, .lens-notsignal { margin: 8px 0 0; }
.lens-regime-title { font-size: 18px; }
.lens-page-head h1 { margin: 2px 0 0; overflow-wrap: anywhere; }
.lens-placeholder { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .lens-tip > summary { transition: none; } }

/* ---------------- regime card (TASK-060 regime-card stage, docs/design/regime-card) — existing tokens only ---------------- */
.lens-regime + .lens-regime-history, .lens-regime-history { margin-top: 16px; }
.lens-regime-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.lens-regime-head .kicker { margin: 0; }
.lens-regime-state { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; margin-top: 8px; }
.lens-regime-state h2 { margin: 0; }
.lens-regime-line { margin: 8px 0 4px; }
.lens-regime-slot { margin-top: 12px; }
.lens-regime--compact a { display: inline-block; min-height: 24px; line-height: 24px; }
.lens-regime-basis, .lens-regime-conds { margin-top: 12px; gap: 12px; }
.lens-readout { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.lens-readout p { margin: 0; }
.lens-readout .k { font-size: 11px; font-weight: 700; color: var(--muted); }
.lens-readout .v { margin-top: 4px; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; }
.lens-readout .s { margin-top: 4px; }
.lens-cond { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.lens-cond > summary { cursor: pointer; min-height: 24px; }
.lens-cond > p { margin: 6px 0; }
.lens-regime--compact .lens-cond { margin: 8px 0; }
.lens-cond-item { flex-wrap: wrap; }
.lens-cond-item > span:not(.ck) { flex: 1; min-width: 0; } /* keep the glyph beside its sentence at 360px */
.lens-tree-sub { flex-basis: 100%; padding-left: 16px; margin-top: 4px; }
/* C4/Q-S10: lens condition glyphs stay neutral; same specificity as .scenario-cond.confirm .ck, wins by order */
.scenario-cond.lens-tree .ck { color: var(--color-text-secondary); }
.lens-strength { margin-top: 12px; }
.lens-regime-sub { font-size: 15px; margin: 16px 0 8px; }
.lens-regime-table table.data td { vertical-align: top; word-break: keep-all; }
.lens-regime-table table.data td:nth-child(1), .lens-regime-table table.data td:nth-child(5) { white-space: nowrap; }
.lens-regime-table table.data td:last-child { overflow-wrap: anywhere; word-break: normal; }
.lens-regime-table a.mono, .lens-regime-list a.mono { display: inline-block; min-width: 24px; min-height: 24px; line-height: 24px; }
.lens-regime-list { list-style: none; margin: 0; padding: 0; display: none; }
.lens-regime-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lens-regime-list dl, .lens-regime-list dd { margin: 0; }
.lens-regime-list dd { margin-top: 2px; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .lens-regime-table { display: none; }
  .lens-regime-list { display: block; }
}
.lens-regime-links { margin-top: 12px; }
.lens-regime-timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); }
/* standalone text links: 24px target on touch (2.5.8 headroom) */
.lens-regime p > a:only-child, .lens-regime-links a { display: inline-block; min-height: 24px; line-height: 24px; }
.lens-node-state .lens-badges { margin-left: 4px; }

/* ---------------- pricing-waitlist (design-spec §3–§4): user Ledger fake-door card ---------------- */
/* Accent top border only (no accent-soft fill); controls get a 44px touch row; no new breakpoints. */
#ledger-waitlist { margin-top: 24px; scroll-margin-top: 72px; }
.waitlist-card { border-top: 2px solid var(--color-accent); }
.waitlist-card [hidden] { display: none !important; } /* .btn/.state-block set display, which beats the hidden attribute */
.waitlist-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.waitlist-card h2 { font-size: 20px; line-height: 28px; letter-spacing: 0; margin: 0 0 8px; } /* h3 look, h2 outline level */
.waitlist-note { font-weight: 600; color: var(--color-text-primary); }
.waitlist-form fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.waitlist-form legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: 14px; color: var(--color-text-primary); }
.waitlist-opts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.waitlist-opts label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.waitlist-opts input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.waitlist-form fieldset:disabled label { cursor: default; color: var(--color-text-secondary); }
.waitlist-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.waitlist-actions .btn, .waitlist-card > .btn { min-height: 44px; }
.waitlist-form #wl-error { margin-top: 8px; }

/* === Visual refresh components (CP-008, docs/design/visual-refresh/design-spec.md §1) ===
   Tokens only (no new colour, font or shadow). Behaviour: static/js/ui/ff-ui.js, code blocks static/js/ui/ff-code.js.
   Motion is opt-in (html.js-motion, set by ff-ui.js) and fully off under prefers-reduced-motion. */
.ff-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -0.2em; }
.ff-icon.sm { width: 16px; height: 16px; }
.ff-icon.lg { width: 24px; height: 24px; }
.ff-icon-box { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: var(--radius-sm); background: var(--color-primary-soft); color: var(--color-primary); }
.ff-icon-tile { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; flex: 0 0 auto;
  border-radius: var(--radius-md); background: var(--color-primary-soft); color: var(--color-primary); }
.ff-icon-tile .ff-icon { width: 32px; height: 32px; }

/* 1.1 hero */
.ff-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-4);
  padding: var(--space-8); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.ff-hero.has-media { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: var(--space-8); }
.ff-hero h1 { margin: 0 0 var(--space-2); font-size: 30px; line-height: 42px; letter-spacing: -0.01em; }
.ff-hero-lede { margin: 0; font-size: 16px; line-height: 26px; color: var(--color-text-secondary); max-width: 60ch; }
.ff-hero-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
.ff-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-5); }
.ff-hero-media { min-width: 0; }
.ff-hero-media .edu-cover, .ff-hero-media .ff-media { margin: 0; }
@media (max-width: 1023px) { .ff-hero.has-media { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .ff-hero { padding: var(--space-5); } .ff-hero h1 { font-size: 24px; line-height: 34px; } }

/* 1.7 stat tiles (counts, periods, minutes; never returns or hit rates) */
.ff-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin: var(--space-5) 0 0; padding: 0; list-style: none; }
@media (max-width: 400px) { .ff-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ff-stat { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); min-width: 0; }
.ff-stat-k { display: block; font-size: 11px; font-weight: 700; color: var(--color-text-secondary); }
.ff-stat-v { display: block; font-family: var(--font-num); font-size: 22px; line-height: 30px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
.ff-stat-s { display: block; font-size: 11px; color: var(--color-text-secondary); }

/* 1.2 section header */
.ff-section-head { display: flex; align-items: flex-start; gap: var(--space-3); margin: 0 0 var(--space-4); }
.ff-section-head > div { min-width: 0; flex: 1 1 auto; }
.ff-section-head h2 { margin: 2px 0 0; font-size: 20px; line-height: 28px; }
.ff-section-sub { margin: var(--space-1) 0 0; font-size: 13px; line-height: 20px; color: var(--color-text-secondary); }
.ff-section-head > .badge { align-self: center; }

/* 1.3 card grid; a card whose only link is its title is clickable as a whole */
.ff-card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ff-card { position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
  transition: border-color var(--motion-dur-micro) var(--motion-ease-enter), box-shadow var(--motion-dur-micro) var(--motion-ease-enter); }
@media (hover: hover) { .ff-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); } }
.ff-card.is-link:focus-within { box-shadow: 0 0 0 3px var(--focus-ring); transition: none; } /* focus ring is never animated */
.ff-card.is-link .ff-card-link:focus-visible { box-shadow: none; }
.ff-card.is-link .ff-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ff-card-link { color: inherit; text-decoration: none; }
.ff-card.is-link:hover .ff-card-link { text-decoration: underline; text-underline-offset: 3px; }
.ff-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; font-size: 12px; line-height: 18px; color: var(--color-text-secondary); }
.ff-card-meta .ff-icon { color: var(--color-text-secondary); }
.ff-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* 1.4 glance box */
.ff-glance { margin: var(--space-6) 0 0; padding: var(--space-5); background: var(--color-primary-soft);
  border-left: 4px solid var(--color-primary); border-radius: var(--radius-md); }
.ff-glance-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); align-items: baseline; }
.ff-glance-head h2 { margin: 0; font-size: 15px; line-height: 22px; }
.ff-glance-q { margin: var(--space-3) 0 0; font-size: 16px; line-height: 26px; font-weight: 600; color: var(--color-text-primary); }
.ff-glance-points { list-style: none; counter-reset: ffg; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ff-glance-points li { counter-increment: ffg; position: relative; padding-left: 32px; font-size: 14px; line-height: 22px; }
.ff-glance-points li::before { content: counter(ffg); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: var(--radius-full);
  background: var(--color-primary); color: #fff; font-family: var(--font-num); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.ff-glance-data { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 0; font-size: 13px; color: var(--color-text-secondary); }
@media (max-width: 720px) { .ff-glance-points { grid-template-columns: minmax(0, 1fr); } }

/* chips (data sources, notebook variables) */
.ff-chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 26px; padding: 2px 10px; border-radius: var(--radius-xs);
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-primary); font-size: 12px; font-weight: 600; }

/* 1.5 callouts: body text stays text-primary; only the label carries the tone */
.ff-callout { display: flex; gap: var(--space-3); margin: var(--space-4) 0 0; padding: var(--space-4); border-radius: var(--radius-md);
  border-left: 4px solid var(--color-info); background: color-mix(in srgb, var(--color-info) 8%, var(--color-surface)); color: var(--color-text-primary); }
.ff-callout > .ff-icon { color: var(--color-info); margin-top: 2px; }
.ff-callout > div { min-width: 0; }
.ff-callout p, .ff-callout ul { margin: 0; font-size: 14px; line-height: 22px; }
.ff-callout p + p, .ff-callout p + ul { margin-top: var(--space-2); }
.ff-callout ul { padding-left: 1.2em; }
.ff-callout-label { display: block; margin-bottom: var(--space-1); font-size: 12px; font-weight: 700; color: var(--badge-text-neutral); }
.ff-callout-title { font-weight: 700; }
.ff-callout--caution { border-left-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 8%, var(--color-surface)); }
.ff-callout--caution > .ff-icon { color: var(--color-warning); }
.ff-callout--caution .ff-callout-label { color: var(--badge-text-warn); }
.ff-callout--pitfall { border-left-color: var(--color-error); background: color-mix(in srgb, var(--color-error) 6%, var(--color-surface)); }
.ff-callout--pitfall > .ff-icon { color: var(--color-error); }
.ff-callout--pitfall .ff-callout-label { color: var(--badge-text-risk); }
.ff-callout-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ff-callout-grid > .ff-callout { margin: 0; }
@media (max-width: 720px) { .ff-callout-grid { grid-template-columns: minmax(0, 1fr); } }

/* 1.6 numbered steps (vertical; .ff-steps--row = horizontal from 1024px) */
.ff-steps { list-style: none; margin: 0; padding: 0; }
.ff-step { position: relative; display: flex; gap: var(--space-4); padding-bottom: var(--space-5); }
.ff-step:last-child { padding-bottom: 0; }
.ff-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--color-border); }
.ff-step[data-state="done"]:not(:last-child)::before { background: var(--color-primary); }
.ff-step-num { position: relative; flex: 0 0 auto; width: 28px; height: 28px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-primary);
  font-family: var(--font-num); font-size: 13px; font-weight: 600; transition: background-color var(--motion-dur-short) var(--motion-ease-enter), border-color var(--motion-dur-short) var(--motion-ease-enter), color var(--motion-dur-short) var(--motion-ease-enter); }
.ff-step[data-state="current"] .ff-step-num { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
[data-theme="black"] .ff-step[data-state="current"] .ff-step-num { color: var(--color-bg); }
.ff-step[data-state="done"] .ff-step-num { background: var(--color-primary-soft); border-color: var(--color-primary); }
.ff-step-body { min-width: 0; padding-top: 2px; }
.ff-step-body h3 { margin: 0; font-size: 16px; line-height: 24px; }
.ff-step-body p { margin: var(--space-1) 0 0; font-size: 14px; line-height: 22px; color: var(--color-text-secondary); }
.ff-step-body a { color: inherit; }
@media (min-width: 1024px) {
  .ff-steps--row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-4); }
  .ff-steps--row .ff-step { flex-direction: column; gap: var(--space-2); padding-bottom: 0; }
  .ff-steps--row .ff-step:not(:last-child)::before { left: 34px; right: 6px; top: 13px; bottom: auto; width: auto; height: 2px; }
}
.ff-steps-meter { margin: 0 0 var(--space-3); font-size: 13px; color: var(--color-text-secondary); }

/* 1.8 comparison: two neutral columns */
.ff-compare { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ff-compare > .card { margin: 0; }
.ff-compare h3 { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: 15px; line-height: 22px; color: var(--color-text-primary); }
.ff-compare ul { margin: 0; padding-left: 1.2em; }
@media (max-width: 720px) { .ff-compare { grid-template-columns: minmax(0, 1fr); } }

/* 1.9 glossary term + popover (canonical text = .ff-glossary dl) */
.ff-term { position: relative; display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: help;
  text-decoration: underline dotted var(--color-text-muted) 1px; text-underline-offset: 3px; }
.ff-term-pop { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: max-content; max-width: min(280px, 80vw);
  padding: var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface);
  box-shadow: var(--shadow-md); color: var(--color-text-primary); font-size: 13px; line-height: 20px; font-weight: 400; text-align: left; white-space: normal; }
.ff-term-pop[data-place="top"] { top: auto; bottom: calc(100% + 6px); }
.ff-term-pop { transition: opacity var(--motion-dur-medium) var(--motion-ease-enter), transform var(--motion-dur-medium) var(--motion-ease-enter); }
@starting-style { .ff-term-pop { opacity: 0; transform: translateY(var(--motion-dist-sm)); } }
.ff-term-pop[data-align="right"] { left: auto; right: 0; }
.ff-glossary { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin: 0; }
.ff-glossary div { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.ff-glossary dt { font-weight: 700; }
.ff-glossary dd { margin: var(--space-1) 0 0; font-size: 14px; line-height: 22px; color: var(--color-text-secondary); }
.ff-glossary div:target { border-color: var(--color-primary); }
@media (min-width: 768px) { .ff-glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 1.10 tabs (no JS: every panel shows, tablist hidden) */
.ff-tabs [role="tablist"] { position: relative; display: flex; gap: var(--space-1); border-bottom: 1px solid var(--color-border); overflow-x: auto; scrollbar-width: none; }
html:not(.js) .ff-tabs [role="tablist"] { display: none; }
.ff-tabs [role="tab"] { flex: 0 0 auto; min-height: 40px; padding: 0 var(--space-3); border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); cursor: pointer; }
.ff-tabs [role="tab"][aria-selected="true"] { color: var(--color-text-primary); border-bottom-color: var(--color-primary); }
.ff-tabs [role="tabpanel"] { padding-top: var(--space-3); }
.ff-tabs [role="tab"] { transition: color var(--motion-dur-micro) var(--motion-ease-enter); }
.ff-tab-ind { position: absolute; left: 0; bottom: 0; width: 1px; height: 2px; background: var(--color-primary); transform-origin: 0 0;
  pointer-events: none; transition: transform var(--motion-dur-short) var(--motion-ease-move); }
.ff-tabs.has-ind [role="tab"][aria-selected="true"] { border-bottom-color: transparent; }
.ff-tabs.is-ready [role="tabpanel"] { transition: opacity var(--motion-dur-short) var(--motion-ease-enter); }
@starting-style { .ff-tabs.is-ready [role="tabpanel"] { opacity: 0; } }

/* 1.11 code block: no wrap, own horizontal scroll; highlight colours from the spec table (no success/error/warning) */
.ff-code { margin: 0; min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; }
.ff-code-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border); font-size: 12px; color: var(--color-text-secondary); }
.ff-code-cell { font-weight: 700; color: var(--color-text-primary); }
.ff-code-title { font-weight: 600; color: var(--color-text-primary); }
.ff-code-head .ff-code-copy { margin-left: auto; }
.ff-code-pre { margin: 0; padding: var(--space-3) var(--space-4); overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 20px;
  tab-size: 4; white-space: pre; color: var(--color-text-primary); background: var(--color-surface); }
.ff-code-pre code { font: inherit; display: block; min-width: max-content; }
.ff-code-pre.has-lines { padding-left: 0; }
.ff-code-pre .ln { display: block; padding-right: var(--space-4); border-left: 3px solid transparent; }
.ff-code-pre .ln::before { content: attr(data-n); display: inline-block; width: 3ch; margin-right: 2ch; text-align: right;
  color: var(--color-text-muted); user-select: none; -webkit-user-select: none; }
.ff-code-pre .ln[hidden] { display: none; }
.ff-code-pre .ln.is-focus { border-left-color: var(--color-primary); }
.ff-code-pre .ln.is-focus::before { color: var(--color-primary); font-weight: 700; }
.tk-k { color: var(--color-primary); font-weight: 600; }
.tk-s { color: var(--color-accent); }
.tk-n { color: var(--color-info); }
.tk-c { color: var(--color-text-muted); font-style: italic; }
.tk-b { color: var(--color-text-secondary); font-weight: 600; }
.ff-code-more { display: flex; align-items: center; gap: var(--space-1); width: 100%; min-height: 40px; padding: 0 var(--space-3);
  border: 0; border-top: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-primary);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
[data-theme="black"] .ff-code-more { color: var(--color-text-primary); }
.ff-code-more[aria-expanded="true"] .ff-icon { transform: rotate(180deg); }
@media (max-width: 720px) { .ff-code-pre { font-size: 12.5px; line-height: 19px; } }

/* 1.12 result panel */
.ff-result { margin: 0; min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.ff-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0;
  font-size: 13px; font-weight: 700; color: var(--color-text-primary); }
.ff-result-head .ff-icon { color: var(--color-text-secondary); }
.ff-result-head .badge { margin-left: auto; }
.ff-result > * + * { margin-top: var(--space-3); }
.ff-result-text { margin: 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--color-bg); overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--color-text-primary); }
.ff-result .table-scroll { max-height: 360px; overflow: auto; }
.ff-result table.data caption { caption-side: top; text-align: left; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); padding-bottom: var(--space-2); }
.ff-result-chart { position: relative; height: 240px; }
.ff-result-chart-title { margin: 0 0 var(--space-2); font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.ff-result-cap { font-size: 12px; color: var(--color-text-secondary); }
.ff-result summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--color-primary); }
[data-theme="black"] .ff-result summary { color: var(--color-text-primary); }
@media (max-width: 720px) { .ff-result-chart { height: 200px; } }

/* 1.16 media slots: rendered only for approved assets */
.ff-media { margin: 0; }
.ff-media img { display: block; width: 100%; height: auto; object-fit: cover; object-position: 50% 50%; border-radius: var(--radius-md); }
.ff-media video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius-md); background: var(--color-surface); }
.ff-media figcaption { margin-top: var(--space-2); font-size: 14px; color: var(--color-text-secondary); }

/* 1.14 motion: hidden start only with html.js-motion (ff-ui.js); markup opts in below the fold only */
.js-motion .ff-reveal { opacity: 0; transform: translateY(var(--motion-dist-md)); transition: opacity var(--motion-dur-medium) var(--motion-ease-enter), transform var(--motion-dur-medium) var(--motion-ease-enter); }
.js-motion .ff-reveal.is-in { opacity: 1; transform: none; }
@media print { .js-motion .ff-reveal { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js-motion .ff-reveal { opacity: 1; transform: none; }
  .ff-reveal, .ff-card, .ff-step-num, .ff-code-more .ff-icon { transition: none !important; animation: none !important; }
}
/* motion v2 entry helpers (L62). .ff-enter: content that replaces a same-size skeleton or goes hidden -> shown fades in
   once (add it from JS, not to server-rendered first-screen markup). .ff-copied: copy label (ff-code.js).
   .ff-count-v: count-up copy (ff-ui.js [data-ff-count]); its width is pinned to the final value so nothing shifts. */
.ff-enter { transition: opacity var(--motion-dur-short) var(--motion-ease-enter); }
@starting-style { .ff-enter { opacity: 0; } }
.ff-copied { display: inline-block; transition: opacity var(--motion-dur-medium) var(--motion-ease-enter), transform var(--motion-dur-medium) var(--motion-ease-enter); }
@starting-style { .ff-copied { opacity: 0; transform: translateY(var(--motion-dist-sm)); } }
.ff-count-v { display: inline-block; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- House Thesis (docs/design/house-thesis/design-spec.md §4) — existing tokens only, no new colours ---- */
.thesis-lead { margin: 4px 0 0; color: var(--color-text-secondary); }
.thesis-global { margin-top: var(--space-2); align-items: center; }
.thesis-section { margin-top: var(--space-8); }
.thesis-tabs { display: flex; gap: var(--space-2); margin: var(--space-6) 0 var(--space-4); }
.thesis-tabs .btn { flex: 1 1 0; justify-content: center; text-align: center; min-height: 44px; }
.thesis-tabs .btn[aria-current="page"] { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-soft); }
.thesis-cards { list-style: none; padding: 0; margin: 0; }
.thesis-card { display: flex; flex-direction: column; gap: var(--space-2); height: 100%; color: inherit; text-decoration: none;
  transition: border-color var(--motion-dur-micro) var(--motion-ease-enter), box-shadow var(--motion-dur-micro) var(--motion-ease-enter); }
.thesis-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
.thesis-card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.thesis-card .pill { margin: 0; background: var(--color-primary-soft); color: var(--color-primary); border-color: transparent; }
.thesis-card-title { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.thesis-more { color: var(--color-primary); margin-top: auto; }
.thesis-legal-short { margin: var(--space-2) 0 0; }
.thesis-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--space-8); align-items: start; }
.thesis-main { min-width: 0; }
.thesis-aside { position: sticky; top: var(--space-4); margin-top: var(--space-8); }
.thesis-aside-title { font-size: 15px; }
.thesis-aside-fold { display: none; margin-top: var(--space-6); }
.thesis-aside-fold > summary { cursor: pointer; min-height: 24px; }
.thesis-aside-fold > summary .thesis-aside-title { display: inline; margin: 0; }
/* WCAG 2.5.8: badge tips are 20px tall at 360px — make the target itself 24px */
.thesis .lens-tip > summary { min-height: 24px; display: inline-flex; align-items: center; }
.thesis-aside-sub { font-size: 13px; margin: var(--space-4) 0 4px; }
.thesis-links { padding-left: 18px; margin: 0; }
.thesis-aside p > span + span::before, .thesis-aside-fold p > span + span::before { content: " · "; }
.thesis-nodes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.thesis-node-name { margin: 0 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.thesis-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.thesis-cell .lens-state { margin: 0; }
.thesis-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.table-scroll > table.data.thesis-table { min-width: 720px; }
.thesis-table td { vertical-align: top; }
.thesis-table td p { margin: 0 0 4px; }
.thesis-kinds { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--space-3); margin: 0 0 var(--space-4); }
.thesis-kinds dd { margin: 0; color: var(--color-text-secondary); }
.thesis-obs-on { background: var(--color-accent-soft); color: var(--color-text-primary); border-color: var(--color-border); }
.thesis-obs-off { background: transparent; color: var(--color-text-secondary); border-color: var(--color-border-strong); }
.thesis-history { padding-left: 18px; }
.thesis-versions a[aria-current="page"] { font-weight: 700; }
.thesis-src > summary { cursor: pointer; min-height: 24px; }
.thesis-path-text { list-style: none; padding: 0 0 6px; }
.thesis-notadvice { margin-top: var(--space-8); }
.thesis-lock { margin-top: var(--space-6); }
/* black: --color-primary on --color-primary-soft is 3.5:1 */
.thesis-card .pill, .thesis-tabs .btn[aria-current="page"] { color: color-mix(in srgb, var(--color-primary) 60%, var(--text)); }
.thesis-table th .lens-release { text-transform: none; letter-spacing: 0; }
.thesis-table .badge, .thesis-table .lens-badges { white-space: nowrap; }
.thesis-table .lens-badges { flex-wrap: nowrap; }
.thesis-cond-cards { display: none; list-style: none; padding: 0; margin: 0; }
.thesis-cond-cards li + li { margin-top: var(--space-3); }
.thesis-cond-cards p { margin: 0 0 var(--space-2); }
.thesis-cond-cards dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-3); margin: 0; }
.thesis-cond-cards dt { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }
.thesis-cond-cards dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .thesis-table-wrap { display: none; }
  .thesis-cond-cards { display: block; }
}
@media (max-width: 1023px) {
  .thesis-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .thesis-aside { display: none; }
  .thesis-aside-fold { display: block; }
}
@media (max-width: 600px) { .thesis-section { margin-top: var(--space-6); } }
@media (prefers-reduced-motion: reduce) { .thesis-card { transition: none; } }

/* CP-008 shared: dot grid (P5), bento cell sizes, pointer spotlight, release strip (pages/home/DESIGN.md §5.2) */
.ff-dotgrid { position: relative; isolation: isolate; }
.ff-dotgrid::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent); mask-image: linear-gradient(to bottom, black 40%, transparent); }
.ff-dotgrid--24::before { background-size: 24px 24px; }
:where(.ff-dotgrid) > * { position: relative; z-index: 1; }
@media (max-width: 720px) { .ff-dotgrid--24::before { background-size: 16px 16px; } }

.ff-card-grid > .ff-bento-wide { grid-column: span 2; }
.ff-card-grid > .ff-bento-tall { grid-row: span 2; }
@media (max-width: 767px) { .ff-card-grid > .ff-bento-wide, .ff-card-grid > .ff-bento-tall { grid-column: auto; grid-row: auto; } }

.ff-rstrip { --days: 5; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(var(--days), minmax(0, 1fr)); }
.ff-rstrip[data-days="6"] { --days: 6; }
.ff-rstrip[data-days="7"] { --days: 7; }
.ff-rstrip-day { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface); font-size: 13px; line-height: 20px; }
.ff-rstrip-day.is-today { border-top: 2px solid var(--color-accent); }
.ff-rstrip-date { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
.ff-rstrip-n { color: var(--color-text-secondary); }
.ff-rstrip-name { color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-rstrip-more { font-size: 12px; color: var(--color-text-secondary); }
@media (max-width: 767px) {
  .ff-rstrip { display: flex; padding-right: var(--space-8); }
  .ff-rstrip-day { flex: 0 0 132px; scroll-snap-align: start; }
}

/* ---- Wave M (anti-AI audit) ---- */
/* question/destination rows: a list with hairlines instead of a card grid (about, pricing) */
.ff-linkrows { list-style: none; margin: var(--space-6) 0 0; padding: 0; max-width: 880px; }
.ff-linkrows > li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-6);
  padding: var(--space-4) 0; border-top: 1px solid var(--color-border); }
.ff-linkrows > li:last-child { border-bottom: 1px solid var(--color-border); }
.ff-linkrows h3 { margin: 0; font-size: 17px; line-height: 25px; }
.ff-linkrows p { margin: 0; flex: 1 1 100%; color: var(--color-text-secondary); }
.ff-linkrows a { font-weight: 600; color: var(--color-primary); }
[data-theme="black"] .ff-linkrows a { color: var(--color-text-primary); }

/* /today: wide calendar + one sticky aside (rates, watchlist, alerts) */
.today-notice { margin-bottom: var(--space-3); }
.today-flush { margin: 0; }
.today-head { align-items: flex-end; }
.today-head h1 { margin: 2px 0 0; }
.today-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-4); align-items: start; margin-top: var(--space-4); }
.today-aside { display: grid; gap: var(--space-4); min-width: 0; }
@media (min-width: 1024px) { .today-aside { position: sticky; top: var(--space-4); } }
@media (max-width: 1023px) { .today-layout { grid-template-columns: minmax(0, 1fr); } }
.today-aside .grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.today-rate-v { font-size: 1.3em; margin: 2px 0; }
.today-src { margin: var(--space-2) 0 0; }
.today-more { margin: var(--space-3) 0 0; }
.today-more a { font-weight: 700; }
.today-wl-form { gap: 6px; margin-top: var(--space-2); }
.today-wl-form input { flex: 1; min-width: 0; }
.today-note { margin: 4px 0 0; }

/* calendar rows: fixed time column so a wrapped long title aligns under the title, not under the time */
.rc .rc-item { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: var(--space-3); align-items: baseline; }
.rc .rc-item > .small:first-child { overflow-wrap: anywhere; }
/* TASK-088 B-3: "10:00 ET" over "00:00 KST 화" — two fixed lines, no break between ET and KST (TODAY shares the fragment).
   The column stays 7.5em: at 6.5em the upper-bound form "늦어도 16:30 ET / 05:30 KST 금까지 공표" wrapped to 3 lines at 390. */
.rc-t { display: block; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
.rc-t small { display: block; font-size: 12px; color: var(--color-text-secondary); }
.rc .rc-body { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; min-width: 0; }

/* /methodology: a reading page — sections separated by space and one hairline, no card stack */
.meth-section { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.meth-section > h2 { font-size: 20px; line-height: 28px; }
.meth-section table.data td:first-child { white-space: nowrap; } /* the page sets overflow-wrap:anywhere, which split short state names per character on a phone (TASK-138 item 7) */
.meth-section > summary { cursor: pointer; }
.meth-sub { margin-top: var(--space-6); }

/* ===========================================================================
   Wave P (TASK-087): editorial-studio layer. Display only, existing tokens only (no new hex, font, shadow or radius).
   Direction (user, 2026-11-04): paper + ink + one accent, hairline rules instead of boxed cards, serif display
   headings with clear scale contrast, more whitespace, quieter chips and chrome. Audit: docs/design/wave-p-impeccable/audit.md
   =========================================================================== */

/* paper ground: the light page is the surface itself, so sections read as print rather than tiles on a grey desk */
:root[data-theme="light"] body, :root:not([data-theme]) body { background: var(--color-surface); }

/* quiet chrome: opaque bar, hairline only (AC-03: no glass) */
.topbar, .topbar.is-scrolled { background: var(--color-surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.topbar.is-scrolled { border-bottom-color: var(--color-border); }
.tabbar-item { color: var(--color-text-secondary); } /* 11px label: muted fell to 4.4:1 on the bar (WCAG 1.4.3) */

/* display scale: one confident h1, a calmer h2, body stays sans */
h1, .ff-hero h1 { font-size: clamp(28px, 1.6vw + 18px, 42px); line-height: 1.32; letter-spacing: -0.015em; }
.ff-hero h1 { margin-bottom: var(--space-4); }
h2 { font-size: clamp(21px, 0.6vw + 17px, 26px); line-height: 1.38; }
.ff-section-head h2, .home-block > h2, .meth-section > h2 { font-size: clamp(21px, 0.6vw + 17px, 26px); line-height: 1.38; }
.ff-hero-lede { font-size: 17px; line-height: 28px; max-width: 56ch; }
p, li, dd { text-wrap: pretty; }

/* whitespace: sections breathe more than the blocks inside them (AL-06) */
main.wrap { padding-top: var(--space-10); padding-bottom: var(--space-12); }
.home-block { margin-top: var(--space-16); }
.ff-section-head { margin-bottom: var(--space-6); }

/* boxed cards become ruled sections: a hairline on top, no fill, no side frame (AL-03, AC-09).
   Reading pages only: operational screens (admin, account, /today — main.ff-ops) keep the framed card for tables and forms. */
:where(main:not(.ff-ops)) .card, :where(main:not(.ff-ops)) .ff-card {
  background: transparent; border: 0; border-top: 1px solid var(--color-border-strong);
  border-radius: 0; padding: var(--space-5) 0 0; box-shadow: none;
}
:where(main:not(.ff-ops)) .card.locked { border-top-style: dashed; }
:where(main:not(.ff-ops)) .card.waitlist-card { border-top: 2px solid var(--color-accent); } /* keeps its accent rule (same specificity as the ruled card) */
@media (hover: hover) { :where(main:not(.ff-ops)) .ff-card:hover { box-shadow: none; border-top-color: var(--color-text-primary); } }
.ff-card.is-link:focus-within { box-shadow: 0 0 0 3px var(--focus-ring); }

/* stat tiles: figures with a rule, not boxes */
.ff-stat { background: transparent; border: 0; border-top: 1px solid var(--color-border-strong); border-radius: 0; padding: var(--space-3) 0 0; }
.ff-stat-v { font-weight: 600; }

/* chips and badges: words with a short rule, no tinted capsule (fewer chips, AK-01) */
.badge, .badge[class*="tone-"] { background: transparent; border: 0; border-left: 2px solid var(--color-border-strong); padding: 1px 0 1px 8px; font-weight: 500; }
.badge[class*="tone-"] { border-left-color: currentColor; }
.badge.sm, .badge.sm[class*="tone-"] { padding: 1px 0 1px 8px; } /* same inset as the regular badge (was 7px) */
.pill, .thesis-card .pill { background: transparent; border: 0; border-left: 2px solid var(--color-border-strong); padding: 1px 0 1px 8px; }

/* callouts: plain (info) callouts take the neutral paper tone and a thin rule; caution and pitfall keep their
   tint and 4px rule so the warning hierarchy stays readable */
.ff-callout:not(.ff-callout--caution):not(.ff-callout--pitfall) { background: var(--color-surface-elevated); border-left-width: 2px; }
[data-theme="black"] .ff-callout:not(.ff-callout--caution):not(.ff-callout--pitfall) { background: var(--color-surface); }

/* auth forms sit in a 460px column: one step under the page h1 */
.auth-title { font-size: clamp(26px, 0.8vw + 20px, 30px); }
/* TASK-138 item 14: auth forms on a phone — 44px targets and readable consent rows (.auth-title marks the auth card; markup untouched) */
.card:has(> .auth-title) .btn, .card:has(> .auth-title) .field :is(input:not([type=checkbox]), select) { min-height: 44px; }
.card:has(> .auth-title) > p.small { font-size: 14px; }
/* 1b: secondary links read as text links in both themes (was the primary colour inline) */
.card:has(> .auth-title) a:not(.btn) { color: var(--color-text-primary); text-decoration: underline; text-underline-offset: 3px; }
.card:has(> .auth-title) > p.small a { display: inline-flex; align-items: center; min-height: 44px; }
/* consent row: the whole label is the target; the box sits in the left gutter so the sentence wraps as one block */
.card:has(> .auth-title) div.field > label:has(> input[type=checkbox]) { position: relative; min-height: 44px; margin: 0; padding: var(--space-3) 0 var(--space-3) var(--space-8); font-size: 14px; line-height: 1.6; font-weight: 400; color: var(--text); cursor: pointer; }
.card:has(> .auth-title) div.field > label > input[type=checkbox] { position: absolute; left: 0; top: var(--space-3); width: 22px; height: 22px; margin: 0; }
.card:has(> .auth-title) div.field > label:has(> input[type=checkbox]) a { padding-block: var(--space-3); }
.card:has(> .auth-title) div.field:has(> label > input[type=checkbox]) { margin-bottom: 0; }
/* the optional marketing consent is ruled off from the required ones */
.card:has(> .auth-title) div.field:has(> label > input[name="marketingAgree"]) { margin-top: var(--space-3); border-top: 1px solid var(--color-border); }
.card:has(> .auth-title) details.field { margin-top: var(--space-3); }
.card:has(> .auth-title) details.field > summary { padding-block: var(--space-3); font-size: 14px; cursor: pointer; }

/* figure captions: "그림 n — …" style, secondary ink, small, ruled */
figcaption { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--color-border); font-size: 12.5px; line-height: 19px; color: var(--color-text-secondary); }

/* touch targets (WCAG 2.5.8): checkboxes and stacked footer links reach 24px */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--color-primary); }
@media (max-width: 768px) { .footer-nav a, .footer-nav-btn { display: inline-block; padding: 2px 0; } }

/* Wave P: the hero regime panel sits on the folded art, so it keeps an opaque paper panel for contrast */
.home-hero-regime .lens-regime-slot > * { background: var(--color-surface); padding: var(--space-5); border-top: 1px solid var(--color-border-strong); }
/* calendar strip and proof counters: ruled columns instead of boxed tiles */
.ff-rstrip-day { border: 0; border-top: 1px solid var(--color-border-strong); border-radius: 0; background: transparent; padding: var(--space-3) var(--space-3) 0 0; }
.ff-rstrip-day.is-today { border-top: 2px solid var(--color-accent); }
.home-evidence-grid > .home-evidence-counter { border: 0; border-top: 1px solid var(--color-border-strong); border-radius: 0; background: transparent; padding: var(--space-3) 0 0; }
/* page mastheads: open on the paper with one rule under them; only the home hero keeps its framed art */
.ff-hero:not(.home-hero) { padding: 0 0 var(--space-8); background: none; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; }
/* lesson "한눈에 보기": a quiet paper panel with a thin ink rule, not a blue-tinted alert box */
.ff-glance { background: var(--color-surface-elevated); border-left-width: 2px; }
/* disclosure badges (summary.badge tooltips) stay >= 24px tall after the capsule padding went away (WCAG 2.5.8) */
summary.badge, button.badge, a.badge { min-height: 24px; }
/* muted ink is 4.7:1 on the paper ground but 4.4:1 on --color-bg and 4.1:1 on primary-soft (WCAG 1.4.3):
   light containers filled with those tones use secondary ink for muted text (scoped token remap, no new value) */
:root[data-theme="light"] :is(.about-on-bg, .about-hero, .about-on-soft, .edu-stages, .edu-path-stages, .ff-result-text),
:root:not([data-theme]) :is(.about-on-bg, .about-hero, .about-on-soft, .edu-stages, .edu-path-stages, .ff-result-text) {
  --color-text-muted: var(--color-text-secondary); --neutral: var(--color-text-secondary);
}

/* CEO 2026-11-28 sign-up consent (fragments/consent.html): agree-to-all on top, one row per item, "내용 보기" folds */
.consent-box { margin: var(--space-4) 0; padding: 0; border: 1px solid var(--color-border); border-radius: 0; }
.consent-all { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-bottom: 1px solid var(--color-border); background: var(--color-primary-soft); cursor: pointer; }
.consent-all input, .consent-item input { margin-top: 3px; flex: none; }
.consent-item { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
.consent-item:last-child { border-bottom: 0; }
.consent-item > label { display: flex; gap: var(--space-2); align-items: flex-start; }
.consent-req { color: var(--color-primary); font-weight: 700; flex: none; }
.consent-opt { color: var(--color-text-secondary); flex: none; }
.consent-more { margin: var(--space-2) 0 0 26px; font-size: 13px; }
.consent-more > summary { cursor: pointer; color: var(--color-text-secondary); }
.consent-more > p, .consent-facts { margin: var(--space-2) 0 0; color: var(--color-text-secondary); line-height: 1.6; }
.consent-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-3); }
.consent-facts dt { font-weight: 700; color: var(--color-text-primary); }
.consent-facts dd { margin: 0; }
/* CEO 2026-12-05 consent screen: one card, quiet notice panel, required/optional group labels, full-width start button */
.consent-all-note { display: block; margin-top: 2px; font-size: 13px; color: var(--color-text-secondary); }
.consent-group { margin: 0; padding: var(--space-3) var(--space-4) 0; font-size: 12px; font-weight: 700; color: var(--color-text-secondary); }
.consent-group + .consent-item { padding-top: var(--space-2); }
.ack-wrap { max-width: 560px; padding-block: var(--space-8); }
.ack-card { padding: var(--space-8); }
.ack-lead { margin: var(--space-2) 0 0; color: var(--color-text-secondary); }
.ack-notice { margin: var(--space-6) 0 0; padding: var(--space-4) var(--space-5); background: var(--color-surface-elevated); border-left: 2px solid var(--color-border-strong); }
.ack-notice h2 { margin: 0 0 var(--space-2); font-size: 14px; }
.ack-notice ul { margin: 0; padding-left: 1.1em; font-size: 13.5px; line-height: 1.7; color: var(--color-text-secondary); }
.ack-form { margin-top: var(--space-5); }
.ack-error { margin: 0 0 var(--space-3); font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.ack-submit { width: 100%; }
.ack-version { margin: var(--space-3) 0 0; font-size: 12px; color: var(--color-text-muted); text-align: center; }
.ack-cancel { margin-top: var(--space-2); text-align: center; }
.ack-cancel-btn { min-height: 44px; padding: 0 var(--space-3); border: 0; background: none; font: inherit; font-size: 13px; color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 480px) { .ack-wrap { padding-block: var(--space-4); } .ack-card { padding: var(--space-5) var(--space-4); } .ack-notice { padding: var(--space-3) var(--space-4); } }

/* CEO 2026-11-29: email sign-up folds behind one full-width button under the social buttons */
.email-signup > summary { list-style:none; width:100%; justify-content:center; cursor:pointer; }
.email-signup > summary::-webkit-details-marker { display:none; }
.email-signup[open] > summary { display:none; }

