/* ─── @odla-ai/ui css/tokens.css ─── */
/* ══════════════════════════════════════════════════════════════
   @odla-ai/ui — token defaults
   Every block is wrapped in :where() so it has ZERO specificity:
   a theme's plain `:root { … }` definitions always win, regardless
   of stylesheet load order. Without a theme, these neutral values
   (grayscale + restrained blue) render sanely on their own.
   Contract data lives in js/tokens.js; themes map their palettes
   onto the required tier in themes/<name>/ui.css.
   ══════════════════════════════════════════════════════════════ */

:where(:root) {
  /* ─── Required tier: neutral fallbacks (themes override all of these) ─── */
  --ui-bg: #f7f7f5;
  --ui-surface: #ffffff;
  --ui-surface-2: #efefec;
  --ui-text: #24272b;
  --ui-text-muted: #64686e;
  --ui-text-faint: #9b9fa6;
  --ui-border: #dfe0dc;
  --ui-border-strong: #b9bbb5;
  --ui-accent: #3b5e8c;
  --ui-accent-strong: #2e4a70;
  --ui-accent-soft: rgba(59, 94, 140, 0.1);
  --ui-on-accent: #ffffff;
  --ui-good: #4a7c59;
  --ui-good-soft: rgba(74, 124, 89, 0.12);
  --ui-warn: #a07d2e;
  --ui-warn-soft: rgba(160, 125, 46, 0.12);
  --ui-danger: #a8433a;
  --ui-danger-soft: rgba(168, 67, 58, 0.1);
  --ui-code-bg: #efefec;
  --ui-code-text: #33363b;
  --ui-hl-keyword: #7c3aed;
  --ui-hl-string: #15803d;
  --ui-hl-comment: #6b7280;
  --ui-hl-number: #b45309;
  --ui-hl-title: #1f2937;
  --ui-hl-attr: #0369a1;
  --ui-hl-type: #0f766e;
  --ui-hl-meta: #a16207;
  --ui-hl-addition: #15803d;
  --ui-hl-deletion: #b91c1c;
  --ui-shadow: 0 1px 2px rgba(36, 39, 43, 0.04), 0 8px 24px rgba(36, 39, 43, 0.06);
  --ui-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ui-font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ui-font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ─── Defaulted tier: universal scales ─── */
  /* Reading preferences. --ui-font-size-root defaults to 100% — a percentage,
     not a pixel value, so a reader who has raised their browser's default font
     size keeps that raise; hard-coding 16px would silently cancel it. Themes
     with their own body measure override it (the blog themes use 17px).
     --ui-font-scale is the reader's text-size multiplier and stays 1 until
     css/a11y.css turns it. Smoothing defaults to `auto` (subpixel on macOS):
     `antialiased` thins every stroke, which is the usual reason body copy
     reads too light — opt into it deliberately, per surface. */
  --ui-font-size-root: 100%;
  --ui-font-scale: 1;
  --ui-font-smoothing: auto;
  --ui-weight-body: 400;
  --ui-weight-medium: 500;
  --ui-weight-strong: 600;
  --ui-weight-heading: 700;
  /* Accent family extensions (derived; themes with richer palettes override).
     accent-2 collapses onto the single accent unless a theme separates them. */
  --ui-accent-glow: color-mix(in srgb, var(--ui-accent) 16%, transparent);
  --ui-accent-2: var(--ui-accent);
  --ui-accent-2-soft: color-mix(in srgb, var(--ui-accent-2) 10%, transparent);
  --ui-highlight: var(--ui-accent-strong);
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-space-7: 48px;
  --ui-space-8: 64px;
  --ui-space-9: 80px;
  --ui-space-10: 96px;
  --ui-space-11: 120px;
  --ui-radius-sm: 4px;
  --ui-radius-md: 7px;
  --ui-radius-lg: 10px;
  --ui-radius-pill: 999px;
  --ui-text-xs: 11px;
  --ui-text-sm: 12px;
  --ui-text-md: 13px;
  --ui-text-lg: 15px;
  /* Marketing body scale — app UI text stays on xs..lg. */
  --ui-text-xl: 17px;
  --ui-text-2xl: 19px;
  --ui-text-3xl: 20px;
  --ui-text-4xl: 22px;
  --ui-tracking-caps: 0.06em;
  --ui-tracking-tight: -0.03em;
  --ui-tracking-snug: -0.02em;
  --ui-tracking-wide: 0.02em;
  --ui-tracking-widest: 0.14em;
  --ui-tracking-ultra: 0.22em;
  --ui-leading-none: 1;
  --ui-leading-tight: 1.1;
  --ui-leading-snug: 1.3;
  --ui-leading-normal: 1.55;
  --ui-leading-relaxed: 1.7;
  --ui-leading-loose: 1.8;
  --ui-focus: 0 0 0 3px var(--ui-accent-soft);
  /* Elevated tier for hero-scale panels; derives from --ui-shadow so every
     theme gets a sane value, and themes may override for deeper lift. */
  --ui-shadow-strong: var(--ui-shadow);
  --ui-rail-width: 64px;
  --ui-sidebar-width: 240px;
  --ui-bottom-bar-height: 42px;
  --ui-dock-card-width: 320px;
  --ui-master-detail-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
  --ui-master-detail-min-height: 480px;
  --ui-layer-chrome: 50;
  --ui-layer-dock: 80;
  --ui-layer-toast: 110;
  --ui-layer-overlay: 1000;

  /* ─── Chart roles (derived; themes may override for richer palettes) ─── */
  --ui-chart-1: var(--ui-accent);
  --ui-chart-2: var(--ui-good);
  --ui-chart-3: var(--ui-warn);
  --ui-chart-4: var(--ui-danger);
  --ui-chart-5: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-text));
  --ui-chart-6: var(--ui-text-faint);
  --ui-chart-grid: color-mix(in srgb, var(--ui-text) 8%, transparent);
  --ui-chart-grid-zero: color-mix(in srgb, var(--ui-text) 22%, transparent);
  --ui-chart-axis: var(--ui-text-muted);
  --ui-chart-axis-faint: var(--ui-text-faint);
  --ui-chart-band: color-mix(in srgb, var(--ui-accent) 10%, transparent);
  --ui-chart-band-strong: color-mix(in srgb, var(--ui-accent) 22%, transparent);
  --ui-chart-pos: var(--ui-good);
  --ui-chart-neg: var(--ui-danger);
  /* Tooltips are themed popovers, not inverted/code surfaces. Keeping these
     on the semantic surface/text pair preserves contrast across every palette
     and lets the component border + shadow provide separation from the plot. */
  --ui-chart-tip-bg: var(--ui-surface);
  --ui-chart-tip-text: var(--ui-text);
  --ui-chart-dot-stroke: var(--ui-bg);
  /* Temporal/geo viz roles (maps, flow arcs, activity glow, heat ramp).
     Intensity is expressed with globalAlpha/blur at draw time, never by
     interpolating these colors — values may be unresolved color-mix(). */
  --ui-chart-geo-fill: color-mix(in srgb, var(--ui-text) 7%, transparent);
  --ui-chart-geo-line: var(--ui-border);
  --ui-chart-flow: var(--ui-accent);
  --ui-chart-glow: var(--ui-accent-strong);
  --ui-chart-heat-lo: var(--ui-good);
  --ui-chart-heat-mid: var(--ui-warn);
  --ui-chart-heat-hi: var(--ui-danger);

  /* ─── Chat roles (derived) ─── */
  --ui-chat-user-bg: var(--ui-accent-soft);
  --ui-chat-user-text: var(--ui-text);
  --ui-chat-assistant-bg: var(--ui-surface);
  --ui-chat-thinking-bg: var(--ui-surface-2);
  --ui-chat-thinking-text: var(--ui-text-muted);
  --ui-chat-tool-accent: var(--ui-accent);

  /* ─── Marketing roles: display type, section rhythm, decor hooks ───
     Decor defaults are inert (no grain, empty watermark) — a theme opts in
     with literals in its ui.css (see themes/salt). */
  --ui-display-h6: clamp(20px, 2.8vw, 28px);
  --ui-display-h5: clamp(22px, 3vw, 32px);
  --ui-display-h4: clamp(26px, 3.5vw, 36px);
  --ui-display-h3: clamp(28px, 4vw, 42px);
  --ui-display-h2: clamp(36px, 5.5vw, 56px);
  --ui-display-h1: clamp(48px, 7vw, 72px);
  --ui-display-xl: clamp(52px, 8vw, 108px);
  --ui-section-pad-y: var(--ui-space-10);
  --ui-section-pad-x: var(--ui-space-7);
  --ui-content-width: 1100px;
  --ui-content-narrow: 620px;
  --ui-grain: none;
  --ui-watermark-glyph: "";
  --ui-watermark-ink: color-mix(in srgb, var(--ui-text) 4%, transparent);
  --ui-nav-veil: color-mix(in srgb, var(--ui-bg) 92%, transparent);
}

/* ══════════════════════════════════════════════════════════════
   Scoped accent swap — [data-ui-accent="<name>"]
   Custom properties substitute var() at computed-value time ON THE
   DECLARING ELEMENT, so a scope that re-points --ui-accent must also
   re-declare every derived default that composes it — otherwise those
   composites keep the :root-computed values. Each declaration below is
   byte-identical to its :where(:root) twin (test-enforced) so the two
   can never drift. Themes ship the variant values themselves as plain
   [data-ui-accent="<name>"] blocks in ui.css (specificity 0,1,0 beats
   these zero-specificity re-derivations regardless of load order).
   ══════════════════════════════════════════════════════════════ */
:where([data-ui-accent]) {
  --ui-accent-glow: color-mix(in srgb, var(--ui-accent) 16%, transparent);
  --ui-accent-2: var(--ui-accent);
  --ui-accent-2-soft: color-mix(in srgb, var(--ui-accent-2) 10%, transparent);
  --ui-highlight: var(--ui-accent-strong);
  --ui-focus: 0 0 0 3px var(--ui-accent-soft);
  --ui-chart-1: var(--ui-accent);
  --ui-chart-5: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-text));
  --ui-chart-band: color-mix(in srgb, var(--ui-accent) 10%, transparent);
  --ui-chart-band-strong: color-mix(in srgb, var(--ui-accent) 22%, transparent);
  --ui-chart-flow: var(--ui-accent);
  --ui-chart-glow: var(--ui-accent-strong);
  --ui-chat-user-bg: var(--ui-accent-soft);
  --ui-chat-tool-accent: var(--ui-accent);
}

/* ══════════════════════════════════════════════════════════════
   Inverted island — .ui-invert
   The subtree renders in the dark palette regardless of the global
   mode (inside global dark it is a no-op). Same substitution rule as
   above: the island must re-declare the dark values AND every
   var()-composing derived default so composites recompute against the
   island's palette on the island element. The neutral values mirror
   :where([data-theme="dark"]) byte-for-byte (test-enforced); themes
   layer their own palettes via the generated themes/<name>/invert.css.
   ══════════════════════════════════════════════════════════════ */
:where(.ui-invert) {
  color-scheme: dark;
  --ui-bg: #17181b;
  --ui-surface: #1f2125;
  --ui-surface-2: #26282d;
  --ui-text: #e6e6e3;
  --ui-text-muted: #a2a6ad;
  --ui-text-faint: #6f737a;
  --ui-border: #33363c;
  --ui-border-strong: #4a4e56;
  --ui-accent: #7ba1d4;
  --ui-accent-strong: #97b7e2;
  --ui-accent-soft: rgba(123, 161, 212, 0.14);
  --ui-on-accent: #14161a;
  --ui-good: #7fae8e;
  --ui-good-soft: rgba(127, 174, 142, 0.14);
  --ui-warn: #c5a75e;
  --ui-warn-soft: rgba(197, 167, 94, 0.14);
  --ui-danger: #cf7a72;
  --ui-danger-soft: rgba(207, 122, 114, 0.14);
  --ui-code-bg: #26282d;
  --ui-code-text: #d4d5d2;
  --ui-hl-keyword: #c4b5fd;
  --ui-hl-string: #86efac;
  --ui-hl-comment: #9199a5;
  --ui-hl-number: #fcd34d;
  --ui-hl-title: #e5e7eb;
  --ui-hl-attr: #7dd3fc;
  --ui-hl-type: #5eead4;
  --ui-hl-meta: #fbbf24;
  --ui-hl-addition: #86efac;
  --ui-hl-deletion: #fca5a5;
  --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --ui-accent-glow: color-mix(in srgb, var(--ui-accent) 16%, transparent);
  --ui-accent-2: var(--ui-accent);
  --ui-accent-2-soft: color-mix(in srgb, var(--ui-accent-2) 10%, transparent);
  --ui-highlight: var(--ui-accent-strong);
  --ui-focus: 0 0 0 3px var(--ui-accent-soft);
  --ui-shadow-strong: var(--ui-shadow);
  --ui-chart-1: var(--ui-accent);
  --ui-chart-2: var(--ui-good);
  --ui-chart-3: var(--ui-warn);
  --ui-chart-4: var(--ui-danger);
  --ui-chart-5: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-text));
  --ui-chart-6: var(--ui-text-faint);
  --ui-chart-grid: color-mix(in srgb, var(--ui-text) 8%, transparent);
  --ui-chart-grid-zero: color-mix(in srgb, var(--ui-text) 22%, transparent);
  --ui-chart-axis: var(--ui-text-muted);
  --ui-chart-axis-faint: var(--ui-text-faint);
  --ui-chart-band: color-mix(in srgb, var(--ui-accent) 10%, transparent);
  --ui-chart-band-strong: color-mix(in srgb, var(--ui-accent) 22%, transparent);
  --ui-chart-pos: var(--ui-good);
  --ui-chart-neg: var(--ui-danger);
  --ui-chart-tip-bg: var(--ui-surface);
  --ui-chart-tip-text: var(--ui-text);
  --ui-chart-dot-stroke: var(--ui-bg);
  --ui-chart-geo-fill: color-mix(in srgb, var(--ui-text) 7%, transparent);
  --ui-chart-geo-line: var(--ui-border);
  --ui-chart-flow: var(--ui-accent);
  --ui-chart-glow: var(--ui-accent-strong);
  --ui-chart-heat-lo: var(--ui-good);
  --ui-chart-heat-mid: var(--ui-warn);
  --ui-chart-heat-hi: var(--ui-danger);
  --ui-chat-user-bg: var(--ui-accent-soft);
  --ui-chat-user-text: var(--ui-text);
  --ui-chat-assistant-bg: var(--ui-surface);
  --ui-chat-thinking-bg: var(--ui-surface-2);
  --ui-chat-thinking-text: var(--ui-text-muted);
  --ui-chat-tool-accent: var(--ui-accent);
  --ui-section-pad-y: var(--ui-space-10);
  --ui-section-pad-x: var(--ui-space-7);
  --ui-watermark-ink: color-mix(in srgb, var(--ui-text) 4%, transparent);
  --ui-nav-veil: color-mix(in srgb, var(--ui-bg) 92%, transparent);
}

/* Neutral dark fallbacks — only the required tier changes; the derived
   tiers track it automatically via var()/color-mix(). Themes that define
   their own dark palettes override these the same zero-specificity way. */
:where([data-theme="dark"]) {
  --ui-bg: #17181b;
  --ui-surface: #1f2125;
  --ui-surface-2: #26282d;
  --ui-text: #e6e6e3;
  --ui-text-muted: #a2a6ad;
  --ui-text-faint: #6f737a;
  --ui-border: #33363c;
  --ui-border-strong: #4a4e56;
  --ui-accent: #7ba1d4;
  --ui-accent-strong: #97b7e2;
  --ui-accent-soft: rgba(123, 161, 212, 0.14);
  --ui-on-accent: #14161a;
  --ui-good: #7fae8e;
  --ui-good-soft: rgba(127, 174, 142, 0.14);
  --ui-warn: #c5a75e;
  --ui-warn-soft: rgba(197, 167, 94, 0.14);
  --ui-danger: #cf7a72;
  --ui-danger-soft: rgba(207, 122, 114, 0.14);
  --ui-code-bg: #26282d;
  --ui-code-text: #d4d5d2;
  --ui-hl-keyword: #c4b5fd;
  --ui-hl-string: #86efac;
  --ui-hl-comment: #9199a5;
  --ui-hl-number: #fcd34d;
  --ui-hl-title: #e5e7eb;
  --ui-hl-attr: #7dd3fc;
  --ui-hl-type: #5eead4;
  --ui-hl-meta: #fbbf24;
  --ui-hl-addition: #86efac;
  --ui-hl-deletion: #fca5a5;
  --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) {
    --ui-bg: #17181b;
    --ui-surface: #1f2125;
    --ui-surface-2: #26282d;
    --ui-text: #e6e6e3;
    --ui-text-muted: #a2a6ad;
    --ui-text-faint: #6f737a;
    --ui-border: #33363c;
    --ui-border-strong: #4a4e56;
    --ui-accent: #7ba1d4;
    --ui-accent-strong: #97b7e2;
    --ui-accent-soft: rgba(123, 161, 212, 0.14);
    --ui-on-accent: #14161a;
    --ui-good: #7fae8e;
    --ui-good-soft: rgba(127, 174, 142, 0.14);
    --ui-warn: #c5a75e;
    --ui-warn-soft: rgba(197, 167, 94, 0.14);
    --ui-danger: #cf7a72;
    --ui-danger-soft: rgba(207, 122, 114, 0.14);
    --ui-code-bg: #26282d;
    --ui-code-text: #d4d5d2;
    --ui-hl-keyword: #c4b5fd;
    --ui-hl-string: #86efac;
    --ui-hl-comment: #9199a5;
    --ui-hl-number: #fcd34d;
    --ui-hl-title: #e5e7eb;
    --ui-hl-attr: #7dd3fc;
    --ui-hl-type: #5eead4;
    --ui-hl-meta: #fbbf24;
    --ui-hl-addition: #86efac;
    --ui-hl-deletion: #fca5a5;
    --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* ─── @odla-ai/ui css/a11y.css ─── */
/* ══════════════════════════════════════════════════════════════
   @odla-ai/ui — reading preferences
   Four axes a reader can set independently, each an attribute on
   <html>, each composing with the existing `data-theme` mode:

     data-ui-text    md | lg | xl        text size
     data-ui-weight  normal | medium | bold
     data-ui-motion  system | reduce | allow
     data-ui-palette default | mono | contrast   (css/palettes/*)

   Absent attribute == the default, so a page that never sets one
   renders exactly as it did before this sheet existed.

   js/prefs.js owns the model: it persists the choices and stamps
   the attributes before first paint. The axis names/values there
   and the selectors here are one contract — test-enforced.
   ══════════════════════════════════════════════════════════════ */

/* Base wiring, at ZERO specificity so any theme or app rule still wins a
   tie. A surface that sets its own `html { font-size }` opts out of the
   text-size axis entirely — the documented adoption step is to express that
   rule through these two custom properties instead. */
:where(html) {
  font-size: calc(var(--ui-font-size-root) * var(--ui-font-scale));
  font-weight: var(--ui-weight-body);
  -webkit-font-smoothing: var(--ui-font-smoothing);
}

/* ─── Text size ───────────────────────────────────────────────
   Two mechanisms, one axis, because odla surfaces size text two ways.
   Long-form content (the blog themes) is rem-based off the root font
   size, so --ui-font-scale carries it. App chrome reads the fixed
   --ui-text-* rungs, which no root-size change can reach — so each step
   also restates the ladder. Rungs are the base scale multiplied and
   rounded to whole pixels, never fractional: half-pixel type renders
   blurry at 1x. --ui-text-md is the body rung. */
html[data-ui-text="lg"] {
  --ui-font-scale: 1.125;
  --ui-text-xs: 12px;
  --ui-text-sm: 13px;
  --ui-text-md: 15px;
  --ui-text-lg: 17px;
  --ui-text-xl: 19px;
  --ui-text-2xl: 21px;
  --ui-text-3xl: 23px;
  --ui-text-4xl: 25px;
}

html[data-ui-text="xl"] {
  --ui-font-scale: 1.25;
  --ui-text-xs: 13px;
  --ui-text-sm: 15px;
  --ui-text-md: 16px;
  --ui-text-lg: 19px;
  --ui-text-xl: 21px;
  --ui-text-2xl: 24px;
  --ui-text-3xl: 25px;
  --ui-text-4xl: 28px;
}

/* ─── Text weight ─────────────────────────────────────────────
   The rungs stay ordered (body < medium <= strong <= heading) at every
   step so emphasis never inverts, and none exceeds 700: a step that asks
   for a weight the loaded font lacks gets a synthesized fake-bold, which
   looks worse than the weight it replaced. Themes that load a variable
   font, or static faces beyond 700, may extend these. */
html[data-ui-weight="medium"] {
  --ui-weight-body: 500;
  --ui-weight-medium: 600;
  --ui-weight-strong: 700;
  --ui-weight-heading: 700;
}

html[data-ui-weight="bold"] {
  --ui-weight-body: 600;
  --ui-weight-medium: 700;
  --ui-weight-strong: 700;
  --ui-weight-heading: 700;
}

/* ─── Motion ──────────────────────────────────────────────────
   The OS preference is honoured by default; "allow" is the reader's
   explicit opt-back-in, and "reduce" turns motion off on a machine that
   never asked the OS. Durations go to a hair above zero rather than
   zero so `transitionend`/`animationend` handlers still fire — a chain
   that waits on one would otherwise stall forever. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-ui-motion="allow"]) *,
  html:not([data-ui-motion="allow"]) *::before,
  html:not([data-ui-motion="allow"]) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-ui-motion="reduce"] *,
html[data-ui-motion="reduce"] *::before,
html[data-ui-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ─── Local colour scopes yield to an accessibility palette ───
   A reader who asked for monochrome or high contrast asked for the WHOLE
   page, and both of the ui's local-colour mechanisms would otherwise punch
   holes in it: `[data-ui-accent]` swaps the accent family inside a subtree,
   and `.ui-invert` renders a band in the dark palette regardless of mode.
   Both win by tree proximity, not specificity, so no amount of weight on the
   root reaches them — the scope element itself has to give the roles back.

   `inherit` on a custom property means "take the parent's computed value",
   which is precisely the palette in force one level up. Only the LITERAL
   declarations need cancelling: a derived role like --ui-surface-2, declared
   on the scope as a color-mix() of --ui-text, recomputes on its own once the
   ink it references is the inherited one. Keyed on any non-default palette so
   this sheet never has to know their names. */
html[data-ui-palette]:not([data-ui-palette="default"]) [data-ui-accent],
html[data-ui-palette]:not([data-ui-palette="default"]) .ui-invert {
  --ui-bg: inherit;
  --ui-surface: inherit;
  --ui-surface-2: inherit;
  --ui-text: inherit;
  --ui-text-muted: inherit;
  --ui-text-faint: inherit;
  --ui-border: inherit;
  --ui-border-strong: inherit;
  --ui-accent: inherit;
  --ui-accent-strong: inherit;
  --ui-accent-soft: inherit;
  --ui-accent-glow: inherit;
  --ui-accent-2: inherit;
  --ui-accent-2-soft: inherit;
  --ui-highlight: inherit;
  --ui-on-accent: inherit;
  --ui-good: inherit;
  --ui-good-soft: inherit;
  --ui-warn: inherit;
  --ui-warn-soft: inherit;
  --ui-danger: inherit;
  --ui-danger-soft: inherit;
  --ui-code-bg: inherit;
  --ui-code-text: inherit;
  --ui-shadow: inherit;
  --ui-hl-keyword: inherit;
  --ui-hl-string: inherit;
  --ui-hl-comment: inherit;
  --ui-hl-number: inherit;
  --ui-hl-title: inherit;
  --ui-hl-attr: inherit;
  --ui-hl-type: inherit;
  --ui-hl-meta: inherit;
  --ui-hl-addition: inherit;
  --ui-hl-deletion: inherit;
}

html[data-ui-palette]:not([data-ui-palette="default"]) .ui-invert {
  color-scheme: inherit;
}

/* ─── @odla-ai/ui css/palettes/mono.css ─── */
/* ══════════════════════════════════════════════════════════════
   @odla-ai/ui — monochrome palette   html[data-ui-palette="mono"]
   Every colour role collapses onto one neutral ink over one neutral
   ground. Layers over ANY theme rather than replacing it: only the
   colour roles move, so type, spacing, radii and layout stay the
   theme's own.

   Specificity is the whole trick. `html[data-ui-palette="mono"]` is
   (0,1,1), which outranks a theme's `:root` and its generated
   `[data-ui-theme="…"]` scope (both 0,1,0) no matter which stylesheet
   loads last. The dark twins carry one more attribute (0,2,1) so they
   also outrank a theme's `[data-ui-theme][data-theme="dark"]` (0,2,0).

   The dark blocks restate only the ink and the ground. Custom
   properties substitute var() on the DECLARING element, and every
   block here declares on <html>, so the derived roles below recompute
   against whichever ink won the cascade — no second copy needed.
   ══════════════════════════════════════════════════════════════ */

html[data-ui-palette="mono"] {
  color-scheme: light;
  --ui-bg: #ffffff;
  --ui-text: #111111;

  /* Surfaces separate by hairline, not by fill — with hue gone, a tinted
     panel and its page read as the same value anyway. */
  --ui-surface: var(--ui-bg);
  --ui-surface-2: color-mix(in srgb, var(--ui-text) 7%, var(--ui-bg));
  --ui-text-muted: color-mix(in srgb, var(--ui-text) 68%, var(--ui-bg));
  --ui-text-faint: color-mix(in srgb, var(--ui-text) 45%, var(--ui-bg));
  --ui-border: color-mix(in srgb, var(--ui-text) 22%, var(--ui-bg));
  --ui-border-strong: color-mix(in srgb, var(--ui-text) 45%, var(--ui-bg));

  --ui-accent: var(--ui-text);
  --ui-accent-strong: var(--ui-text);
  --ui-accent-soft: color-mix(in srgb, var(--ui-text) 10%, transparent);
  --ui-on-accent: var(--ui-bg);

  /* Status keeps a value ladder — danger is full ink, warn the lightest —
     so the three stay tellable apart. It is a ladder, not a language:
     monochrome is exactly the case that proves colour alone was never
     enough, so status must also carry an icon, a label, or a shape. */
  --ui-danger: var(--ui-text);
  --ui-danger-soft: color-mix(in srgb, var(--ui-text) 12%, transparent);
  --ui-good: color-mix(in srgb, var(--ui-text) 78%, var(--ui-bg));
  --ui-good-soft: color-mix(in srgb, var(--ui-text) 9%, transparent);
  --ui-warn: color-mix(in srgb, var(--ui-text) 58%, var(--ui-bg));
  --ui-warn-soft: color-mix(in srgb, var(--ui-text) 7%, transparent);

  --ui-code-bg: color-mix(in srgb, var(--ui-text) 6%, var(--ui-bg));
  --ui-code-text: var(--ui-text);
  --ui-shadow: 0 1px 2px color-mix(in srgb, var(--ui-text) 10%, transparent);

  /* Syntax highlighting: token classes that survive as weight/value
     differences instead of hues. Comments recede, titles hold full ink. */
  --ui-hl-keyword: var(--ui-text);
  --ui-hl-title: var(--ui-text);
  --ui-hl-string: color-mix(in srgb, var(--ui-text) 78%, var(--ui-code-bg));
  --ui-hl-number: color-mix(in srgb, var(--ui-text) 78%, var(--ui-code-bg));
  --ui-hl-type: color-mix(in srgb, var(--ui-text) 66%, var(--ui-code-bg));
  --ui-hl-attr: color-mix(in srgb, var(--ui-text) 66%, var(--ui-code-bg));
  --ui-hl-meta: color-mix(in srgb, var(--ui-text) 55%, var(--ui-code-bg));
  --ui-hl-comment: color-mix(in srgb, var(--ui-text) 48%, var(--ui-code-bg));
  --ui-hl-addition: color-mix(in srgb, var(--ui-text) 82%, var(--ui-code-bg));
  --ui-hl-deletion: color-mix(in srgb, var(--ui-text) 62%, var(--ui-code-bg));

  /* Series default to accent/good/warn/danger, which have just collapsed
     onto one ink — a mono chart needs its own ramp or every line is the
     same line. Six evenly-spaced steps; pair with dash/marker variation. */
  --ui-chart-1: color-mix(in srgb, var(--ui-text) 100%, var(--ui-bg));
  --ui-chart-2: color-mix(in srgb, var(--ui-text) 84%, var(--ui-bg));
  --ui-chart-3: color-mix(in srgb, var(--ui-text) 68%, var(--ui-bg));
  --ui-chart-4: color-mix(in srgb, var(--ui-text) 54%, var(--ui-bg));
  --ui-chart-5: color-mix(in srgb, var(--ui-text) 41%, var(--ui-bg));
  --ui-chart-6: color-mix(in srgb, var(--ui-text) 29%, var(--ui-bg));
  --ui-chart-pos: var(--ui-text);
  --ui-chart-neg: color-mix(in srgb, var(--ui-text) 55%, var(--ui-bg));
  --ui-chart-heat-lo: color-mix(in srgb, var(--ui-text) 30%, var(--ui-bg));
  --ui-chart-heat-mid: color-mix(in srgb, var(--ui-text) 62%, var(--ui-bg));
  --ui-chart-heat-hi: var(--ui-text);
}

html[data-ui-palette="mono"][data-theme="dark"] {
  color-scheme: dark;
  --ui-bg: #0b0b0b;
  --ui-text: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  html[data-ui-palette="mono"]:not([data-theme="light"]) {
    color-scheme: dark;
    --ui-bg: #0b0b0b;
    --ui-text: #f0f0f0;
  }
}

/* ─── @odla-ai/ui css/palettes/contrast.css ─── */
/* ══════════════════════════════════════════════════════════════
   @odla-ai/ui — high contrast   html[data-ui-palette="contrast"]
   SHARPENS the theme; it does not replace it. Every declaration here
   is a var() reference to a role the theme already owns, so the page
   keeps its own colours — a reader who chose high contrast on the
   green theme still gets the green theme.

   Three habits of a normal palette are inverted on purpose:
     · surfaces stop tinting and separate by border instead, because a
       wash light enough to sit under body text carries no contrast of
       its own to begin with;
     · muted text stops being muted — dimming is the exact thing a
       reader asking for contrast is asking us to stop doing;
     · shadows go away. Depth drawn in blurred alpha is invisible at
       this end of the scale and only softens the edges that aren't.

   What this sheet CANNOT do is move a hue. `--ui-accent: <something
   derived from --ui-accent>` on the same element is a self-reference,
   which CSS resolves as a cycle, so a theme whose accent sits at
   4:1 has to deepen it itself: each theme ships its own
   `html[data-ui-palette="contrast"]` block in ui.css, the same way it
   ships a dark block, with the hue held and only the lightness moved.
   test/palette-contrast.test.js measures every theme and fails the
   build if a role lands under 7:1 — the AAA claim is enforced per
   theme, not asserted here.

   No dark twin: every value is a reference, so the whole sheet tracks
   whatever mode the theme is in.
   ══════════════════════════════════════════════════════════════ */

html[data-ui-palette="contrast"] {
  --ui-text-muted: var(--ui-text);
  --ui-text-faint: var(--ui-text);

  --ui-surface: var(--ui-bg);
  --ui-surface-2: var(--ui-bg);
  --ui-border: var(--ui-text);
  --ui-border-strong: var(--ui-text);
  --ui-code-bg: var(--ui-bg);
  --ui-code-text: var(--ui-text);

  --ui-shadow: none;
  --ui-shadow-strong: none;

  /* Tone washes mark a region; they never carry the contrast. Mixed toward
     the page rather than toward transparent so full-ink text still clears
     7:1 on top of one whatever sits behind it. */
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 14%, var(--ui-bg));
  --ui-accent-2-soft: color-mix(in srgb, var(--ui-accent-2) 14%, var(--ui-bg));
  --ui-good-soft: color-mix(in srgb, var(--ui-good) 14%, var(--ui-bg));
  --ui-warn-soft: color-mix(in srgb, var(--ui-warn) 14%, var(--ui-bg));
  --ui-danger-soft: color-mix(in srgb, var(--ui-danger) 14%, var(--ui-bg));

  /* A focus ring that cannot be lost against either ground: an inner band in
     the page colour, an outer band in full ink. */
  --ui-focus: 0 0 0 3px var(--ui-bg), 0 0 0 6px var(--ui-text);

  /* Grid and axes come up off the usual whisper-alpha so the frame of a
     chart is legible too, not just the series drawn on it. */
  --ui-chart-grid: color-mix(in srgb, var(--ui-text) 35%, var(--ui-bg));
  --ui-chart-grid-zero: var(--ui-text);
  --ui-chart-axis: var(--ui-text);
  --ui-chart-axis-faint: var(--ui-text);
  --ui-chart-tip-bg: var(--ui-bg);
  --ui-chart-tip-text: var(--ui-text);
}

/* ─── @odla-ai/ui css/components/prefs.css ─── */
/* @odla-ai/ui — reading-preferences popover
   Built from the design system's own parts rather than a private look: the
   panel is the `.card` contract (surface, hairline, radius-lg, shadow), each
   axis is a `.segmented` pill track, and the axis captions are the same
   uppercase micro-label `.card h4` uses. Nothing here invents a control — a
   new look belongs in a theme, not in this sheet.

   The disclosure is a native <details>. That matters more here than anywhere
   else in the system: this is what a reader reaches for when the defaults are
   failing them, and it is the last thing that should wait on a script.
   js/prefs.js only adds persistence.

   Sizing is in px and --ui-space-*, deliberately NOT rem: this is chrome, and
   chrome must not grow when the reader turns the text-size axis up. */

.ui-prefs {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.ui-prefs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: transparent;
  color: var(--ui-text-muted);
  cursor: pointer;
  /* Kill the disclosure triangle in every engine: `display` for WebKit's
     pseudo-element, `list-style` for the modern marker. */
  list-style: none;
}
.ui-prefs-trigger::-webkit-details-marker {
  display: none;
}
.ui-prefs-trigger:hover {
  color: var(--ui-text);
  border-color: var(--ui-border-strong);
}
.ui-prefs-trigger:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus);
}
.ui-prefs[open] > .ui-prefs-trigger {
  color: var(--ui-text);
  border-color: var(--ui-border-strong);
}

/* Sliders glyph in currentColor: tracks the trigger's state, costs no request. */
.ui-prefs-icon {
  width: 15px;
  height: 15px;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    radial-gradient(circle 2.5px at center, currentColor 98%, transparent 100%),
    radial-gradient(circle 2.5px at center, currentColor 98%, transparent 100%);
  background-size: 13px 1.5px, 13px 1.5px, 5px 5px, 5px 5px;
  background-position: 1px 4.25px, 1px 9.75px, 2.5px 2px, 7.5px 7.5px;
  background-repeat: no-repeat;
}

.ui-prefs-panel {
  position: absolute;
  top: calc(100% + var(--ui-space-2));
  right: 0;
  z-index: var(--ui-layer-overlay);
  /* Sized by its widest pill track, floored so short axes do not look ragged
     and capped so it never scrolls the page sideways from the right edge. */
  width: max-content;
  min-width: 240px;
  max-width: min(340px, calc(100vw - var(--ui-space-5)));
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  padding: var(--ui-space-4);
  text-align: left;
  font-family: var(--ui-font-sans);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-strong);
  /* The trigger lives in a top bar, and bars are routinely set in tracked
     uppercase — which the panel would inherit, turning "High contrast" into a
     label half again as wide and pushing every row into wrapping. A popover
     speaks in its own voice. */
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--ui-weight-body);
  font-style: normal;
}

.ui-prefs-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* The `.card h4` micro-label: uppercase, tracked, muted. */
.ui-prefs-legend {
  padding: 0 0 var(--ui-space-2);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-strong);
  text-transform: uppercase;
  letter-spacing: var(--ui-tracking-caps);
  color: var(--ui-text-muted);
}

/* The `.segmented-track` contract, re-declared for labels rather than the
   buttons Segmented uses — the radios are the accessible control here, so the
   selected state hangs off `input:checked + span` instead of aria-checked.
   Values stay in step with css/components/segmented.css (test-enforced). */
.ui-prefs-options {
  /* flex, not Segmented's inline-flex: there the track sits inline beside a
     caption, here each axis owns its row and a content-width track leaves the
     panel looking ragged. */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  max-width: 100%;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-pill);
}

/* grow 1 / shrink 0 / basis auto. The shrink is load-bearing: left
   shrinkable, an over-long row does not wrap — the options squeeze below
   their own labels and the text spills across the neighbouring pill.
   Refusing to shrink pushes the option that does not fit onto a second line,
   where it then grows to fill it. */
.ui-prefs-option {
  flex: 1 0 auto;
  max-width: 100%;
  display: flex;
  cursor: pointer;
}

/* The radio stays in the accessibility tree — clipped, never `display: none`,
   which would drop it from tab order and from the group semantics. All of the
   selected/focused styling therefore hangs off the adjacent <span>, via plain
   sibling combinators rather than :has(), so the control is never one
   unsupported selector away from having no visible selection at all. */
.ui-prefs-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ui-prefs-option span {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading-snug);
  color: var(--ui-text-muted);
  border-radius: var(--ui-radius-pill);
  text-align: center;
  white-space: nowrap;
}
.ui-prefs-option:hover span {
  color: var(--ui-text);
}
.ui-prefs-option input:checked + span {
  color: var(--ui-on-accent);
  background: var(--ui-accent);
  font-weight: var(--ui-weight-strong);
}
.ui-prefs-option input:focus-visible + span {
  outline: none;
  box-shadow: var(--ui-focus);
}

/* ══════════════════════════════════════════════════════════════
   o16g — broadsheet on survey-grid paper
   odla-brand palette · IBM Plex Sans body · IBM Plex Mono chrome
   Light: mineral paper, growth-green accent, faint survey grid.
   Dark: night instrument panel, brightened green.
   Shadows the packaged chalk theme; theme/custom.css layers the
   o16g dashboard/manifesto/analytics components on top. The
   "compat aliases" block maps the tokens custom.css was written
   against (chalk names) onto this palette so it reskins in place.
   ══════════════════════════════════════════════════════════════ */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap");

/* ─── Tokens (palette: odla-ai/ui odla-brand) ─── */
:root {
  --bg: #e9e4d8;
  --panel: #f8f4ea;
  --border: #b9b3a7;
  --border-strong: #7b827f;
  --text: #172229;
  --muted: #536168;
  --faint: #7d8788;
  --accent: #197a4e;
  --accent-strong: #0f5836;
  --accent-soft: rgba(25, 122, 78, 0.12);
  --accent-2: #1f6f86;

  /* Derived from the ink rather than restated per mode: these follow whatever
     --text is in force, which is also what lets a reading palette reach them.
     Left as literals, the masthead rules would stay near-black on monochrome
     dark — a 4px double rule you cannot see. */
  --grid-line: color-mix(in srgb, var(--text) 4.5%, transparent);
  --rule: var(--text);
  --accent-border: color-mix(in srgb, var(--accent) 30%, transparent);

  --code-bg: #10191e;
  --code-text: #ece7da;
  --code-inline-bg: color-mix(in srgb, var(--text) 7%, transparent);
  --code-inline-text: var(--text);
  --hl-keyword: #37b47c;
  --hl-string: #65c6b9;
  --hl-comment: #8c9899;
  --hl-number: #e0b45a;
  --hl-title: #f5f0e4;
  --hl-attr: #8db8d0;
  --hl-type: #73c7ca;
  --hl-meta: #d89b73;
  --hl-addition: #79bd8e;
  --hl-deletion: #f07870;

  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Body measure. The reader's text-size axis scales it; see the html rule. */
  --font-size-root: 17px;

  /* Layout measures multiply the BASE size, not the scaled root: in rem they
     would ride --ui-font-scale, so the reader's text-size choice would widen
     the columns and the header rules too — which is page zoom, not a text
     setting. Pinned like this, larger text means fewer words per line. */
  --measure: calc(46 * var(--font-size-root));   /* reading column */
  --wide: calc(64 * var(--font-size-root));      /* dashboard, listings, analytics */
  --chrome: calc(74 * var(--font-size-root));    /* header rules, footer */

  /* compat aliases — the token names theme/custom.css was authored
     against (chalk), mapped onto the odla-brand palette. var()-based
     aliases resolve per theme automatically; concrete-color aliases
     (--accent-2, --accent-border) are re-declared in the dark blocks. */
  --text-dim: var(--muted);
  --text-faint: var(--faint);
  --accent-glow: var(--accent-soft);
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-wordmark: var(--font-sans);
  --max-width: var(--wide);
}

[data-theme="dark"] {
  --bg: #0b1115;
  --panel: #121b20;
  --border: #304149;
  --border-strong: #566970;
  --text: #ece7da;
  --muted: #a5afac;
  --faint: #6d7b7e;
  --accent: #33b579;
  --accent-strong: #64d49c;
  --accent-soft: rgba(51, 181, 121, 0.16);
  --accent-2: #5cbcd0;

  --code-bg: #070c0f;
  --code-text: #ece7da;
  --hl-keyword: #64d49c;
  --hl-string: #65c6b9;
  --hl-comment: #738386;
  --hl-number: #e0b45a;
  --hl-title: #f5f0e4;
  --hl-attr: #8db8d0;
  --hl-type: #73c7ca;
  --hl-meta: #d89b73;
  --hl-addition: #79bd8e;
  --hl-deletion: #f07870;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1115;
    --panel: #121b20;
    --border: #304149;
    --border-strong: #566970;
    --text: #ece7da;
    --muted: #a5afac;
    --faint: #6d7b7e;
    --accent: #33b579;
    --accent-strong: #64d49c;
    --accent-soft: rgba(51, 181, 121, 0.16);
    --accent-2: #5cbcd0;

    --code-bg: #070c0f;
    --code-text: #ece7da;
    --hl-keyword: #64d49c;
    --hl-string: #65c6b9;
    --hl-comment: #738386;
    --hl-number: #e0b45a;
    --hl-title: #f5f0e4;
    --hl-attr: #8db8d0;
    --hl-type: #73c7ca;
    --hl-meta: #d89b73;
    --hl-addition: #79bd8e;
    --hl-deletion: #f07870;
  }
}

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

html {
  font-family: var(--font-sans);
  font-size: calc(var(--font-size-root) * var(--ui-font-scale, 1));
  font-weight: var(--ui-weight-body, 400);
  -webkit-font-smoothing: var(--ui-font-smoothing, auto);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: color 0.2s ease, background-color 0.2s ease;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

::selection {
  background: var(--accent-soft);
}

main {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.6rem 1.5rem 5rem;
  flex: 1;
}

/* ─── Header: issue bar · masthead · ruled nav ─── */
.site-header {
  width: 100%;
  max-width: var(--chrome);
  margin: 0 auto;
  padding: 1.4rem 1.5rem 0;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.8rem;
  border-bottom: 3px solid var(--rule);
}

.topbar-issue,
.topbar-date,
.topbar-tools {
  flex: 1;
  white-space: nowrap;
}

.topbar-date {
  text-align: center;
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
}

.topbar-rss {
  color: var(--muted);
  text-decoration: none;
}

.topbar-rss:hover {
  color: var(--accent);
}

/* Reading-preferences menu. The panel and its pill tracks are the ui
   component layer as shipped; only the trigger is restyled, to keep the round
   hairline the old light/dark button wore in the issue bar. Sized in px, not
   rem — chrome must not grow when the reader turns the text size up. */
.ui-prefs-trigger {
  width: 26px;
  height: 26px;
  border-color: var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
}

.ui-prefs-trigger:hover,
.ui-prefs[open] > .ui-prefs-trigger {
  border-color: var(--accent);
  color: var(--accent);
}

.ui-prefs-panel {
  right: -6px;
}

.masthead {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.site-title {
  font-family: var(--font-sans);
  font-size: 3.4rem;
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}

.site-title-accent {
  color: var(--accent);
}

.site-title:hover .site-title-accent {
  color: var(--accent-strong);
}

.site-tagline {
  font-style: italic;
  font-size: 1.02rem;
  color: var(--muted);
  margin: 0.9rem 0 0;
}

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 2.2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 4px double var(--rule);
}

.site-nav a {
  font-size: 0.78rem;
  font-weight: var(--ui-weight-strong, 600);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

/* ─── Scroll position indicator (fixed to viewport top) ─── */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  pointer-events: none;
}

.scroll-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
}

.scroll-dot {
  display: none;
}

[id] {
  scroll-margin-top: 2rem;
}

/* ─── Single post / page ─── */
.post,
.page {
  max-width: var(--measure);
  margin: 0 auto;
}

.post > .post-header {
  text-align: center;
  margin-bottom: 2.4rem;
}

.post-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.2rem 0 1.3rem;
}

h1.post-title {
  font-size: 2.5rem;
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 0.9rem;
}

.page-title {
  font-size: 2rem;
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.post-deck {
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.post > .prose > p:first-child::first-letter {
  float: left;
  font-size: 3.3em;
  font-weight: var(--ui-weight-heading, 700);
  line-height: 0.8;
  padding: 0.08em 0.14em 0 0;
  color: var(--accent);
}

.post-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-tags {
  display: inline;
}

.post-tag {
  color: var(--accent);
  text-decoration: none;
}

.post-tag:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ─── Prose ─── */
.prose {
  font-size: 1.02rem;
  line-height: 1.75;
  overflow-wrap: break-word;
  display: flow-root;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text);
  margin: 2.2rem 0 0.8rem;
}

.prose h1 { font-size: 1.55rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.2rem; }
.prose h4 { font-size: 1.05rem; }

.prose p {
  margin: 0 0 1.4rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.prose a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

.prose ul,
.prose ol {
  margin: 0 0 1.4rem;
  padding-left: 1.6rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.prose hr {
  border: none;
  border-top: 4px double var(--border-strong);
  margin: 3rem auto;
  width: 8rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--ui-weight-strong, 600);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border-strong);
}

/* ─── Code ─── */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background-color: var(--code-inline-bg);
  color: var(--code-inline-text);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1.2rem 1.4rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 0 0 1.4rem;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 1em;
}

.hljs { color: var(--code-text); }
.hljs-keyword, .hljs-selector-tag, .hljs-tag { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp { color: var(--hl-string); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: var(--hl-number); }
.hljs-title, .hljs-section, .hljs-name { color: var(--hl-title); font-weight: var(--ui-weight-strong, 600); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: var(--hl-attr); }
.hljs-type, .hljs-built_in, .hljs-selector-class, .hljs-selector-id { color: var(--hl-type); }
.hljs-meta, .hljs-doctag { color: var(--hl-meta); }
.hljs-addition { color: var(--hl-addition); }
.hljs-deletion { color: var(--hl-deletion); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: var(--ui-weight-heading, 700); }

/* ─── Archive & tags (packaged templates) ─── */
.archive-year {
  font-size: 1.7rem;
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 3rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-strong);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-item time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 8.5rem;
}

.archive-item a {
  color: var(--text);
  font-weight: var(--ui-weight-medium, 500);
  text-decoration: none;
}

.archive-item a:hover {
  color: var(--accent-strong);
}

.tag-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
}

.tag-cloud .post-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
}

.tag-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ─── Footnotes ─── */
.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 4px double var(--border-strong);
  font-size: 0.88em;
  color: var(--muted);
}

.footnote-ref a,
.footnote-backref {
  text-decoration: none;
}

/* ─── Footer (colophon) ─── */
.site-footer {
  width: 100%;
  max-width: var(--chrome);
  margin: 0 auto;
  padding: 1.3rem 1.5rem 2.2rem;
  text-align: center;
  border-top: 4px double var(--rule);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer .copyright a {
  text-decoration: none;
}

.site-footer .copyright a:hover {
  text-decoration: underline;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .site-title {
    font-size: 2.5rem;
  }

  .site-nav {
    gap: 0.4rem 1.4rem;
  }

  .topbar-date {
    display: none;
  }

  .topbar-issue,
  .topbar-tools {
    flex: none;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .site-title {
    font-size: 2.1rem;
  }

  .archive-item {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.7rem 0;
  }
}

/* ─── chalk/ui.css (odla-ui token aliases) ─── */
/* o16g/ui.css — maps this site's palette onto the @odla-ai/ui token
   contract. Shadows the packaged chalk/ui.css, which resolved here only
   through the compat aliases at the top of theme/styles.css and mapped
   chalk's token names, not this site's — so --panel, the surface every card
   and panel is painted on, was never on the contract at all.

   That is also what earns the reading palettes. The build inverts these
   aliases into a `html[data-ui-palette]:not([data-ui-palette="default"])`
   block, so under monochrome or high contrast the page tokens take their
   values from the palette instead of the other way round — which is what
   makes the dashboard change, not just the buttons. A page token the mapping
   omits keeps its themed colour, which is exactly how --panel would have
   stayed cream on a monochrome page.

   Plain var() aliases track dark mode for free; any LITERAL that differs by
   mode must be restated identically in BOTH dark blocks. */
:root {
  --ui-bg: var(--bg);
  --ui-surface: var(--panel);
  --ui-surface-2: color-mix(in srgb, var(--text) 6%, var(--bg));
  --ui-text: var(--text);
  --ui-text-muted: var(--muted);
  --ui-text-faint: var(--faint);
  --ui-border: var(--border);
  --ui-border-strong: var(--border-strong);
  --ui-accent: var(--accent);
  --ui-accent-strong: var(--accent-strong);
  --ui-accent-soft: var(--accent-soft);
  --ui-accent-2: var(--accent-2);
  --ui-accent-2-soft: color-mix(in srgb, var(--accent-2) 12%, transparent);
  --ui-on-accent: #ffffff;
  --ui-good: #1f7a4a;
  --ui-good-soft: color-mix(in srgb, var(--ui-good) 12%, transparent);
  --ui-warn: #8a6a1f;
  --ui-warn-soft: color-mix(in srgb, var(--ui-warn) 12%, transparent);
  --ui-danger: #a33a30;
  --ui-danger-soft: color-mix(in srgb, var(--ui-danger) 11%, transparent);
  --ui-code-bg: var(--code-bg);
  --ui-code-text: var(--code-text);
  --ui-hl-keyword: var(--hl-keyword);
  --ui-hl-string: var(--hl-string);
  --ui-hl-comment: var(--hl-comment);
  --ui-hl-number: var(--hl-number);
  --ui-hl-title: var(--hl-title);
  --ui-hl-attr: var(--hl-attr);
  --ui-hl-type: var(--hl-type);
  --ui-hl-meta: var(--hl-meta);
  --ui-hl-addition: var(--hl-addition);
  --ui-hl-deletion: var(--hl-deletion);
  --ui-shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);
  --ui-font-sans: var(--font-sans);
  --ui-font-serif: Georgia, "Iowan Old Style", Palatino, serif;
  --ui-font-mono: var(--font-mono);
  --ui-font-display: var(--font-sans);
  --ui-font-size-root: var(--font-size-root);
}

[data-theme="dark"] {
  --ui-on-accent: #07110c;
  --ui-good: #4cc487;
  --ui-warn: #d9b45e;
  --ui-danger: #ef8078;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ui-on-accent: #07110c;
    --ui-good: #4cc487;
    --ui-warn: #d9b45e;
    --ui-danger: #ef8078;
  }
}

/* High contrast — this site's own hues held, only the lightness moved, until
   each role clears WCAG AAA (7:1) on the mineral paper. The generic
   @odla-ai/ui contrast palette sharpens structure (no dimming, full-ink
   hairlines, flat surfaces, no shadow) but cannot move a hue: deriving
   --ui-accent from --ui-accent on one element is a cycle. The base block is
   unqualified, so it applies in dark too — every role is restated in both dark
   blocks, even the ones already past 7:1. Ratios are before → after. */
html[data-ui-palette="contrast"] {
  --ui-accent: #00532a;          /* 4.2 → 7.3 on #e9e4d8 */
  --ui-accent-strong: #065331;   /* 6.7 → 7.2 */
  --ui-good: #005326;            /* 4.2 → 7.3 */
  --ui-warn: #604200;            /* 4.0 → 7.3 */
  --ui-danger: #882019;          /* 5.2 → 7.3 */
}

html[data-ui-palette="contrast"][data-theme="dark"] {
  --ui-accent: #33b579;          /* already 7.3 on #0b1115 */
  --ui-accent-strong: #64d49c;   /* already 10.4 */
  --ui-good: #4cc487;            /* already 8.6 */
  --ui-warn: #d9b45e;            /* already 9.6 */
  --ui-danger: #ef8078;          /* already 7.3 */
}

@media (prefers-color-scheme: dark) {
  html[data-ui-palette="contrast"]:not([data-theme="light"]) {
    --ui-accent: #33b579;          /* already 7.3 on #0b1115 */
    --ui-accent-strong: #64d49c;   /* already 10.4 */
    --ui-good: #4cc487;            /* already 8.6 */
    --ui-warn: #d9b45e;            /* already 9.6 */
    --ui-danger: #ef8078;          /* already 7.3 */
  }
}

/* ─── accessibility palettes drive the theme's own page tokens ─── */
html[data-ui-palette="mono"]:not([data-ui-palette="default"]) {
  --bg: var(--ui-bg);
  --panel: var(--ui-surface);
  --text: var(--ui-text);
  --muted: var(--ui-text-muted);
  --faint: var(--ui-text-faint);
  --border: var(--ui-border);
  --border-strong: var(--ui-border-strong);
  --accent: var(--ui-accent);
  --accent-strong: var(--ui-accent-strong);
  --accent-soft: var(--ui-accent-soft);
  --code-bg: var(--ui-code-bg);
  --code-text: var(--ui-code-text);
  --hl-keyword: var(--ui-hl-keyword);
  --hl-string: var(--ui-hl-string);
  --hl-comment: var(--ui-hl-comment);
  --hl-number: var(--ui-hl-number);
  --hl-title: var(--ui-hl-title);
  --hl-attr: var(--ui-hl-attr);
  --hl-type: var(--ui-hl-type);
  --hl-meta: var(--ui-hl-meta);
  --hl-addition: var(--ui-hl-addition);
  --hl-deletion: var(--ui-hl-deletion);
}

html[data-ui-palette="contrast"]:not([data-ui-palette="default"]) {
  --panel: var(--ui-surface);
  --muted: var(--ui-text-muted);
  --faint: var(--ui-text-faint);
  --border: var(--ui-border);
  --border-strong: var(--ui-border-strong);
  --accent: var(--ui-accent);
  --accent-strong: var(--ui-accent-strong);
  --accent-soft: var(--ui-accent-soft);
  --code-bg: var(--ui-code-bg);
  --code-text: var(--ui-code-text);
}

/* ─── search ─── */
/* Search UI. Written entirely against the @odla-ai/ui --ui-* token contract,
   which every bundled theme's ui.css maps onto its own palette — so search
   inherits each theme's colours, fonts, and dark mode without any theme
   shipping search-specific CSS, and a custom theme gets it for free by
   defining the same tokens. Appended to assets/styles.css by the build. */

.site-search {
  position: relative;
  display: flex;
  align-items: center;
}

.site-search-input {
  font: inherit;
  font-family: var(--ui-font-sans);
  font-size: 0.9rem;
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  width: 9rem;
  transition: width 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.site-search-input::placeholder {
  color: var(--ui-text-faint);
}

.site-search-input:focus {
  outline: none;
  width: 14rem;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.site-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: min(28rem, calc(100vw - 2rem));
  max-height: min(28rem, calc(100vh - 6rem));
  overflow-y: auto;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 0.6rem;
  box-shadow: var(--ui-shadow);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0.3rem;
}

.search-result {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.4rem;
  text-decoration: none;
  color: var(--ui-text);
}

.search-result.is-active,
.search-result:hover {
  background: var(--ui-accent-soft);
}

.search-result-title {
  display: block;
  font-family: var(--ui-font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.search-result-meta {
  display: block;
  font-family: var(--ui-font-sans);
  font-size: 0.75rem;
  color: var(--ui-text-faint);
  margin-top: 0.15rem;
}

.search-result-lead {
  display: block;
  font-family: var(--ui-font-sans);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ui-text-muted);
  margin-top: 0.25rem;
  /* Two lines is enough to judge a hit; more turns the panel into a wall. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result mark {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
  border-radius: 2px;
  padding: 0 1px;
}

.search-empty {
  margin: 0;
  padding: 0.9rem 1rem;
  font-family: var(--ui-font-sans);
  font-size: 0.85rem;
  color: var(--ui-text-muted);
}

@media (max-width: 34rem) {
  /* The input would crowd the nav on a phone; the results panel still works
     for anyone who focuses it via the keyboard. */
  .site-search-input {
    width: 6.5rem;
  }
  .site-search-input:focus {
    width: 9rem;
  }
}

/* ─── site custom.css ─── */
/* o16g additions on top of the chalk theme. Everything uses theme tokens
   so light and dark modes both work. */

/* ─── Home lead: kicker + mission (masthead now carries the wordmark) ─── */
.hero-home {
  padding: 1.75rem 0 2.5rem;
  text-align: center;
}

.hero-pre {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 15px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.5rem;
}

.hero-wordmark {
  font-family: var(--font-wordmark);
  font-size: clamp(72px, 12vw, 140px);
  font-weight: var(--ui-weight-heading, 700);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  opacity: 0.35;
  margin: 0 0 1.5rem;
}

.hero-sub {
  font-style: italic;
  font-weight: var(--ui-weight-body, 400);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-faint);
  max-width: 34rem;
  margin: 0 auto;
}

.hero-sub a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
}

.hero-sub a:hover {
  color: var(--accent-strong);
}

/* ─── Most recent ticker line ─── */
.most-recent {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 3rem 0 0;
}

.most-recent-label {
  color: var(--accent);
}

.most-recent-title {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
}

.most-recent-title.part-warm { color: var(--accent); }
.most-recent-title.part-cool { color: var(--accent-2); }

/* ─── Section labels & panels ─── */
.home-section-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: var(--ui-weight-medium, 500);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 3rem 0 1rem;
}

.home-panel {
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem 1.5rem;
  margin: 0 0 2rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.home-panel .home-section-label {
  margin: 0 0 0.25rem;
}

.home-panel-sub {
  font-style: italic;
  font-weight: var(--ui-weight-body, 400);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 1.25rem;
}

.home-more a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
}

.home-more a:hover {
  color: var(--accent);
}

/* ─── Must read card ─── */
.mustread-card {
  border: 1px solid var(--accent-border);
  background: var(--accent-glow);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mustread-card.mustread-cool {
  border-color: color-mix(in srgb, var(--accent-2) 35%, transparent);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
}

.mustread-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.mustread-card.mustread-cool:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent-2) 16%, transparent);
}

.mustread-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: var(--ui-weight-strong, 600);
  line-height: 1.15;
  margin: 0.75rem 0 0.6rem;
}

.mustread-title a {
  color: var(--text);
  text-decoration: none;
}

.mustread-title a:hover {
  color: var(--accent);
}

.mustread-source,
.briefing-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

.mustread-link a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
}

/* ─── Daily briefing ─── */
.briefing {
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.briefing summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.briefing summary::-webkit-details-marker {
  display: none;
}

.briefing-toggle {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.briefing-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: var(--ui-weight-strong, 600);
  line-height: 1.1;
  margin: 0.75rem 0 1rem;
}

.briefing-body {
  font-size: 0.92rem;
}

/* ─── Influence leaderboards ─── */
.influence-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.influence-tab {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.influence-tab.on {
  color: var(--accent);
  border-color: var(--accent-border);
}

.influence-panel {
  display: none;
}

.influence-panel.on {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 720px) {
  .influence-panel.on {
    grid-template-columns: 1fr;
  }
}

.influence-col-title {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.5rem;
}

.influence-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.influence-rows li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  counter-increment: rank;
}

.influence-rows li::before {
  content: counter(rank);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  min-width: 1.1rem;
}

.influence-name {
  flex: 1;
  color: var(--text-dim);
}

.influence-value {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text);
}

/* ─── Charts ─── */
.home-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--text);
}

.chart-axis {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-faint);
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  opacity: 0.55;
}

.home-panel-legend {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

.legend-item {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 10px;
  height: 2px;
  display: inline-block;
}

/* ─── Principle pulse ─── */
.pulse-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pulse-row {
  display: grid;
  grid-template-columns: 1.6rem 7.5rem 1fr 2.2rem;
  align-items: center;
  gap: 0.75rem;
}

.pulse-num,
.pulse-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
}

.pulse-tag {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.8rem;
}

.pulse-tag.part-warm { color: var(--accent); }
.pulse-tag.part-cool { color: var(--accent-2); }

.pulse-bar {
  height: 3px;
  min-width: 2px;
}

.pulse-bar.part-warm { background: var(--accent); }
.pulse-bar.part-cool { background: var(--accent-2); }

/* ─── Updates page: masthead + THE FIELD rail ─── */
.updates-masthead {
  text-align: center;
  padding: 3rem 0 2.5rem;
}

.updates-title {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: var(--ui-weight-body, 400);
  line-height: 1;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.updates-the {
  font-family: var(--font-display);
}

.updates-mark {
  font-family: var(--font-wordmark);
  font-weight: var(--ui-weight-heading, 700);
}

.updates-em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
}

.updates-sub {
  font-style: italic;
  font-weight: var(--ui-weight-body, 400);
  color: var(--text-dim);
  margin: 0;
}

.field-rail {
  display: none;
}

@media (min-width: 1200px) {
  .field-rail {
    display: block;
    position: absolute;
    left: max(1.5rem, calc((100% - var(--max-width)) / 2 - 15rem));
    width: 11rem;
  }
}

body {
  position: relative;
}

.field-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
}

.field-stat {
  margin-bottom: 0.75rem;
}

.field-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: var(--ui-weight-body, 400);
  color: var(--text);
}

.field-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.field-principle {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.field-principle-word {
  font-family: var(--font-body);
  font-style: italic;
}

.field-principle-word.part-warm { color: var(--accent); }
.field-principle-word.part-cool { color: var(--accent-2); }

.field-principle-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
}

.update-stamp {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.update-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: var(--ui-weight-strong, 600);
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.update-prev-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.update-prev a {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: var(--ui-weight-strong, 600);
  color: var(--text);
  text-decoration: none;
}

.update-prev a:hover {
  color: var(--accent);
}

/* ─── Resources & predictions (JS pages over collections) ─── */
.resource-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.resource-filter {
  width: 100%;
  margin: 1rem 0 2rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
}

.resource-filter::placeholder {
  color: var(--text-faint);
}

.resource-filter:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 30px var(--accent-glow);
}

.resource-card,
.prediction {
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  transition: border-color 0.3s;
}

.resource-card:hover,
.prediction:hover {
  border-color: var(--accent-border);
}

.resource-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: var(--ui-weight-strong, 600);
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.resource-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
}

.resource-title a:hover {
  color: var(--accent);
}

.resource-meta,
.prediction-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.6rem;
}

.resource-body {
  font-size: 0.9rem;
  font-weight: var(--ui-weight-body, 400);
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.resource-chips {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.chip-warm {
  color: var(--accent);
  border-color: var(--accent-border);
}

.chip-cool {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 35%, transparent);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.stat-tile {
  border: 1px solid var(--border);
  padding: 0.9rem 1.25rem;
  min-width: 7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: var(--ui-weight-body, 400);
  color: var(--text);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.pred-status {
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
}

.pred-status-pending { color: #d4a017; }
.pred-status-confirmed { color: #22c55e; }
.pred-status-disproved { color: #ef4444; }
.pred-status-expired { color: var(--text-faint); }

.prediction-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 0.6rem;
}

.prediction-reasoning {
  font-size: 0.85rem;
  font-weight: var(--ui-weight-body, 400);
  font-style: italic;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

/* ─── Chart hover: guide + tooltip ─── */
.chart-wrap {
  position: relative;
}

/* the guide/tip toggle via the [hidden] attribute; their display rules
   below would otherwise win over hidden's UA display:none and stick. */
.chart-guide[hidden],
.chart-tip[hidden] {
  display: none;
}

.chart-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text-faint);
  pointer-events: none;
}

.chart-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.chart-tip-date {
  color: var(--text);
  margin-bottom: 0.2rem;
}

.chart-tip-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-tip-row b {
  color: var(--text);
  font-weight: var(--ui-weight-medium, 500);
}

/* ─── Manifesto (structure mirrors src/pages/manifesto.astro) ─── */
.m-hero {
  position: relative;
  margin-inline: calc(50% - 50vw);
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 clamp(24px, 6vw, 120px);
}

.m-hero .hero-pre { margin: 0; }

.m-hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 120px);
  font-weight: var(--ui-weight-heading, 700);
  line-height: 0.95;
  color: var(--text);
  margin: 24px 0 16px;
}

.m-hero-mark { font-family: var(--font-wordmark); letter-spacing: -0.02em; }

.m-hero-title em {
  font-style: italic;
  font-weight: var(--ui-weight-body, 400);
  color: var(--accent);
}

.m-hero-sub {
  font-style: italic;
  font-weight: var(--ui-weight-body, 400);
  font-size: clamp(16px, 1.8vw, 22px);
  color: color-mix(in srgb, var(--accent) 40%, var(--text-dim));
  margin: 0;
}

.m-hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.m-hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 28px;
  background: var(--accent);
  margin: 8px auto 0;
}

.m-preamble {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 60px) 6vh;
  text-align: center;
}

.m-preamble p {
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: var(--ui-weight-body, 400);
  color: var(--text-dim);
  line-height: 1.9;
}

.m-preamble p + p { margin-top: 20px; }
.m-preamble strong { color: var(--accent); font-weight: var(--ui-weight-medium, 500); }
.m-preamble a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-border); }

.m-preamble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px auto;
  max-width: 480px;
}

/* 4) ghost author fades in after the closing enters view */
.m-ghost {
  opacity: 0;
  transition: opacity 2.5s ease;
}

.m-ghost.visible {
  opacity: 1;
}

.m-breakout-zone {
  margin-inline: calc(50% - 50vw);
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(24px, 4vw, 60px);
}

.m-breakout {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .m-breakout {
    white-space: normal;
  }
}

.m-breakout {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: var(--ui-weight-heading, 700);
  line-height: 1.15;
  color: var(--text);
  margin: 0;
}

.m-callout {
  margin: 128px 0;
  padding: 24px 0;
}

.m-callout p {
  font-size: clamp(16px, 1.7vw, 21px);
}

.m-callout strong { color: var(--accent); }
.m-callout em { font-style: italic; }

.m-afterword { margin-top: 28px; }

.m-part {
  min-height: 35vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6vh clamp(24px, 4vw, 60px);
}

.m-part-label {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: 8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.m-warm .m-part-label, .m-warm.m-part .m-part-label { color: var(--accent); }
.m-cool .m-part-label, .m-cool.m-part .m-part-label { color: var(--accent-2); }

.m-part-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: var(--ui-weight-heading, 700);
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 16px;
}

.m-part-subtitle {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: var(--ui-weight-body, 400);
  font-style: italic;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0;
}

.m-principle {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 5vh, 80px) clamp(24px, 4vw, 60px);
  position: relative;
  text-align: left;
}

.m-principle-header {
  display: block;
  width: fit-content;
  text-decoration: none;
  color: inherit;
}

.m-num {
  font-family: var(--font-mono);
  font-size: clamp(60px, 8vw, 100px);
  font-weight: var(--ui-weight-body, 400);
  line-height: 1;
  margin: 0 0 -8px;
  -webkit-text-stroke: 1px currentColor;
  -webkit-text-fill-color: transparent;
}

.m-warm .m-num { color: color-mix(in srgb, var(--accent) 50%, transparent); }
.m-cool .m-num { color: color-mix(in srgb, var(--accent-2) 50%, transparent); }

.m-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(9px, 0.9vw, 12px);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin: 12px 0 8px;
}

.m-warm .m-tag { color: var(--accent); }
.m-cool .m-tag { color: var(--accent-2); }

.m-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: var(--ui-weight-heading, 700);
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 20px;
}

.m-principle-body {
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: var(--ui-weight-body, 400);
  line-height: 1.85;
  color: var(--text-dim);
}

.m-principle-body strong { font-weight: var(--ui-weight-medium, 500); }
.m-warm .m-principle-body strong { color: var(--accent); }
.m-cool .m-principle-body strong { color: var(--accent-2); }

.m-stories {
  display: block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  margin-top: 24px;
}

.m-warm .m-stories { color: var(--accent); }
.m-cool .m-stories { color: var(--accent-2); }
.m-stories:hover { color: var(--text); }

.m-divider {
  height: 1px;
  margin-top: clamp(40px, 5vh, 80px);
}

.m-warm .m-divider { background: var(--accent-border); }
.m-cool .m-divider { background: color-mix(in srgb, var(--accent-2) 35%, transparent); }

.m-transition {
  height: 15vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-transition-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  opacity: 0.6;
}

.m-closing {
  margin-inline: calc(50% - 50vw);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10vh clamp(24px, 4vw, 60px) 6vh;
}

.m-closing-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: var(--ui-weight-heading, 700);
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 20px;
}

.m-closing-body {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: var(--ui-weight-body, 400);
  font-style: italic;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.8;
}

.m-ghost {
  margin-top: 48px;
  font-size: 0.8rem;
  font-weight: var(--ui-weight-body, 400);
  line-height: 1.8;
  color: var(--text-faint);
  max-width: 560px;
}

.m-ghost a { color: var(--text-dim); }

.m-copyright {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Pointer from the manifesto's close to Outcome Development. */
.m-closing-next {
  margin-top: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.m-closing-next a {
  color: var(--accent-2);
  text-decoration: none;
}

.m-closing-next a:hover { color: var(--text); }

/* ─── Analytics pages: health / scores / trends / briefs (JS pages) ─── */

/* Health */
.stat-tile-alert { border-color: #ef4444; }
.stat-tile-alert .stat-value { color: #ef4444; }

.health-feeds { margin: 1.5rem 0 0; overflow-x: auto; }
.health-feed-header,
.health-feed-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 0.7fr repeat(5, 0.6fr);
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  min-width: 640px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.health-feed-header {
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.health-feed-name { font-family: var(--font-body); font-size: 0.9rem; color: var(--text); }
.health-feed-category {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.health-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  width: fit-content;
  border: 1px solid transparent;
}
.health-status-healthy { color: var(--accent); border-color: var(--accent-border); background: var(--accent-glow); }
.health-status-empty { color: var(--text-faint); border-color: var(--border); }
.health-status-error { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }

/* Scores */
.scores-table-wrap { overflow-x: auto; margin: 1rem 0 0; }
.scores-table { width: 100%; border-collapse: collapse; }
.scores-table th {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
  white-space: nowrap;
}
.scores-table th:hover { color: var(--accent); }
.scores-table td {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.scores-table td:first-child { font-family: var(--font-body); font-size: 0.9rem; color: var(--text); max-width: 22rem; }
.scores-table td a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.3s, border-color 0.3s; }
.scores-table td a:hover { color: var(--accent); border-bottom-color: var(--accent-border); }

.scores-empty {
  text-align: center;
  padding: 4rem 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-faint);
}

/* Trends — lifecycle table */
.lifecycle-section { margin: 0 0 3rem; }
.lifecycle-heading { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: var(--ui-weight-strong, 600); margin: 0 0 0.25rem; }
.lifecycle-subtitle { font-family: var(--font-body); font-size: 0.85rem; font-style: italic; color: var(--text-dim); margin: 0 0 1.5rem; }
.lifecycle-table-wrap { overflow-x: auto; }
.lifecycle-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.lifecycle-table thead th {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.lifecycle-table tbody tr { border-bottom: 1px solid var(--border); }
.lifecycle-table td { padding: 0.35rem 0.5rem; vertical-align: middle; }
.lc-name-col { width: 17rem; }
.lc-num-col { width: 4rem; text-align: right; }
.lc-date-col { width: 5rem; }
.lc-spark-col { width: 320px; }
.lc-name { font-family: var(--font-body); font-size: 0.85rem; color: var(--text); max-width: 17rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-num { font-family: var(--font-mono); color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.lc-date { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-faint); white-space: nowrap; }
.lc-peak { color: var(--text-dim); }
.lc-peak-count { font-size: 0.58rem; color: var(--accent); opacity: 0.8; }
.lc-spark svg { display: block; }

/* Trends — daily themes */
.trends-list { display: flex; flex-direction: column; gap: 3rem; margin: 0; }
.trends-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.trends-themes { display: flex; flex-direction: column; gap: 1.25rem; }
.trends-theme { padding: 1.25rem 1.5rem; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 55%, transparent); }
.trends-theme-header { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.5rem; }
.trends-theme-arrow { font-size: 1rem; color: var(--accent); }
.trends-theme-name { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: var(--ui-weight-strong, 600); margin: 0; }
.trends-theme-desc { font-family: var(--font-body); font-size: 0.95rem; font-weight: var(--ui-weight-body, 400); line-height: 1.7; color: var(--text-dim); margin: 0 0 0.75rem; }
.trends-theme-desc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-border); }
.trends-theme-desc a:hover { color: var(--text); }

/* Briefs */
.briefs-section { display: flex; flex-direction: column; gap: 1.25rem; margin: 0 0 2rem; }
.briefs-card { border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 55%, transparent); }
.briefs-summary { display: block; cursor: pointer; padding: 1.25rem 1.5rem; list-style: none; position: relative; }
.briefs-summary::-webkit-details-marker { display: none; }
.briefs-summary::marker { content: ""; }
.briefs-toggle {
  position: absolute;
  top: 1.4rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.briefs-toggle::after { content: "expand"; }
.briefs-card[open] .briefs-toggle::after { content: "collapse"; }
.briefs-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.briefs-title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.5vw, 1.75rem); font-weight: var(--ui-weight-heading, 700); line-height: 1.2; color: var(--text); margin: 0; padding-right: 5rem; }
.briefs-body { padding: 0 1.5rem 1.5rem; font-size: 0.95rem; font-weight: var(--ui-weight-body, 400); color: var(--text-dim); line-height: 1.8; }
.briefs-body p { margin: 0 0 1rem; }
.briefs-body p:last-child { margin-bottom: 0; }
.briefs-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-border); }
.briefs-body a:hover { color: var(--text); }
.briefs-older { margin-top: 1.5rem; }
.briefs-older-heading {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
  font-weight: var(--ui-weight-body, 400);
}
.briefs-older-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.briefs-older-item { display: flex; gap: 1rem; align-items: baseline; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.briefs-older-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.briefs-older-title { font-family: var(--font-display); font-size: 1rem; font-weight: var(--ui-weight-strong, 600); color: var(--text); line-height: 1.3; }

.pipeline-attr {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 2rem 0 0;
}

@media (max-width: 600px) {
  .briefs-summary { padding: 1rem 1.15rem; }
  .briefs-toggle { top: 1.1rem; right: 1.15rem; }
  .briefs-body { padding: 0 1.15rem 1.15rem; }
  .briefs-title { padding-right: 4rem; }
  .briefs-older-item { flex-direction: column; gap: 0.25rem; }
}

/* ─── Home carousels: Must Read + Data panels (rotating, slide-in) ─── */
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.carousel-dot:hover { border-color: var(--accent); }
.carousel-dot.is-active { background: var(--accent); border-color: var(--accent); }

/* A horizontal flex track slides between slides; the viewport's height is
   set (by JS) to the active slide, so each graph fills its box and the
   layout below animates smoothly instead of sitting in a tall dead box. */
.mustread-carousel,
.home-panels {
  position: relative;
  overflow-x: clip;      /* clip the horizontal slides... */
  overflow-y: visible;   /* ...but let a card's hover glow show top/bottom */
  transition: height 0.45s ease;
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;     /* dragging shouldn't select text */
}

.mustread-carousel.dragging,
.home-panels.dragging {
  cursor: grabbing;
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  will-change: transform;
}

.carousel-track > * {
  flex: 0 0 100%;
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .mustread-carousel,
  .home-panels {
    transition: none;
  }
  .carousel-track {
    transition: none !important;
  }
}
