/* ==========================================================================
   VISIONFI CORE SYSTEM v4.0
   usage: <link rel="stylesheet" href="/assets/css/visionfi-core.css">

   v4.0 aligns the design system with what actually shipped. The Scout Notebook
   Electron app (apps/electron/src/renderer/src/theme.css) moved to a black
   action color, neutral surfaces, self-hosted Poppins headings over a system
   body stack, and a mono-inflected label style. v3.3 still described an
   orange-primary, Soft-Sand brand the product no longer uses.

   What changed from v3.3:
     - Action color is #0d0d0d, not #F26334. Orange is an accent, never a button.
     - Soft Sand #F9F7F2 retired (zero occurrences in the app) -> --color-surface #f9f9f9.
     - --font-mono is now DEFINED. In the app it was referenced but never set,
       so it silently fell back to bare `monospace` in five places while other
       rules hardcoded `ui-monospace, SFMono-Regular, Menlo`.
     - Body font is the native system stack, not Inter.
     - Adds the marketing layer (ribbon, eyebrow, hero-art, grain, ticker,
       statement, numbers strip, path diagram, tagpills, dark footer).
     - Deep Charcoal #2D2A26 RETAINED for text, matching the app. Concept F's
       cooler #1a1c1f is available as --color-ink-cool for marketing surfaces.
     - v3.3 token names still resolve. See section 14.
   ========================================================================== */

/* 1. DESIGN TOKENS (The Source of Truth) */
:root {
    /* -- Action. Black, not orange. This is the single biggest v3.3 change. -- */
    --color-action: #0d0d0d;
    --color-action-hover: #2a2a2a;
    --color-action-light: #f2f2f2;

    /* -- Brand accents. For artwork, tiles, and status. NOT action colors. -- */
    --color-scout-orange: #F26334;
    --color-scout-orange-hover: #D95225;
    --color-scout-orange-tint: #FCEFE9;
    --color-scout-navy: #1A2238;
    --color-branch-brown: #6B4C3E;
    --color-teal: #008C95;
    --color-teal-hi: #17b3bd;

    /* -- Ink -- */
    --color-ink: #2D2A26;           /* Deep Charcoal — app text, warm */
    --color-ink-cool: #1a1c1f;      /* marketing surfaces only */
    --color-text-light: #6B6B6B;
    --color-text-dim: #8a8a8a;
    --color-text-disabled: #A1A1AA;
    --color-text-inv: #FFFFFF;

    /* -- Surfaces -- */
    --color-bg-main: #FFFFFF;
    --color-surface: #f9f9f9;       /* replaces Soft Sand #F9F7F2 */
    --color-border: #E5E5E5;
    --color-border-strong: #bdbdbd;

    /* -- Dark chrome (footers, ribbons, hero artwork) -- */
    --color-dk-bg: #0d0d0d;
    --color-dk-border: #2f2f2f;
    --color-dk-text: #ececec;
    --color-dk-muted: #8e8e8e;

    /* -- Semantic / Status -- */
    --color-info: #008C95;
    --color-info-bg: #E0F7FA;
    --color-success: #2E7D32;
    --color-success-bg: #E8F5E9;
    --color-warning: #ED6C02;
    --color-warning-bg: #FFF3E0;
    --color-error: #D32F2F;
    --color-error-bg: #FFEBEE;

    /* -- Notebook / card tile accents (mirrors app theme.css) -- */
    --card-red: #F26334;
    --card-orange: #F26334;
    --card-green: #2ECC71;
    --card-blue: #4A90D9;
    --card-yellow: #E8B931;
    --card-purple: #7B68EE;
    --card-teal: #008C95;

    /* -- Typography -- */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* -- Dimensions & Physics -- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    --band: 88px;
    --band-lg: 120px;
    --wrap-max: 1160px;

    --shadow-card: 0 4px 12px rgba(45, 42, 38, 0.08);
    --shadow-float: 0 10px 30px rgba(45, 42, 38, 0.12);
    --focus-ring: 0 0 0 3px rgba(0, 0, 0, 0.12);
    --focus-ring-strong: 0 0 0 3px rgba(0, 0, 0, 0.45);
}

/* 2. BASE RESETS */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--color-ink);
    background-color: var(--color-bg-main);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-ink);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
    text-wrap: balance;
}
p { margin-bottom: 1rem; color: var(--color-text-light); }
small { font-size: 0.85rem; color: var(--color-text-light); }
a { color: inherit; }
::selection { background: var(--color-action); color: #fff; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* 3. LAYOUT PRIMITIVES */
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 0 28px; }
.band { padding: var(--band) 0; }
.band--lg { padding: var(--band-lg) 0; }
.band--flush { padding-top: 0; }
.band--panel {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* Ribbon — thin dark strip for context labels above the nav */
.ribbon {
    background: var(--color-dk-bg); color: var(--color-dk-muted);
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.08em; text-transform: uppercase;
    text-align: center; padding: 9px 16px;
}
.ribbon b { color: var(--color-dk-text); font-weight: 700; }

/* Eyebrow — the mono kicker above a heading. Used everywhere. */
.eyebrow {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--color-text-light); margin-bottom: 16px;
}

/* 4. TYPE SCALE */
.t-display { font-family: var(--font-heading); font-weight: 700;
    font-size: clamp(44px, 8.2vw, 110px); line-height: 0.98; letter-spacing: -0.03em; }
.t-h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; }
.t-h2-long { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.15; }
.lede { color: var(--color-text-light); max-width: 62ch; font-size: 16px; }
.t-mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sub { color: var(--color-text-light); font-size: 0.9rem; }

/* 5. ATOMS: BUTTONS
   Pill by default. Action is black; orange is not a button color. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--radius-pill);
    font-family: var(--font-heading); font-weight: 600; font-size: 13px;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
    border: 1px solid transparent; text-decoration: none; line-height: 1;
}
.btn:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring-strong); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--color-action); color: #fff; }
.btn-primary:hover { background: var(--color-action-hover); }

.btn-secondary { background: #fff; border-color: var(--color-border-strong); color: var(--color-ink); }
.btn-secondary:hover { background: #f5f5f5; }

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

/* On dark artwork only */
.btn-inverse { background: #fff; color: var(--color-dk-bg); }
.btn-inverse:hover { background: #ececec; }
.btn-onart { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.28); color: #fff; }
.btn-onart:hover { background: rgba(255,255,255,.14); }

/* Square-cornered variant for dense application chrome (app uses 8px) */
.btn-square { border-radius: var(--radius-md); }
.btn-sm { font-size: 12px; padding: 8px 16px; }
.btn-xs { font-size: 11px; padding: 4px 10px; border-radius: var(--radius-md); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* 6. ATOMS: PILLS, CHIPS, TAGS */
.pill {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.pill-success { background: var(--color-success-bg); color: var(--color-success); }
.pill-warn    { background: var(--color-warning-bg); color: var(--color-warning); }
.pill-error   { background: var(--color-error-bg);   color: var(--color-error); }
.pill-info    { background: var(--color-info-bg);    color: var(--color-info); }
.pill-neutral { background: var(--color-border);     color: var(--color-ink); }

/* Chip — outlined mono marker, yes/no variants */
.chip {
    display: inline-block;
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: var(--radius-pill); padding: 4px 12px;
    border: 1px solid var(--color-border); color: var(--color-text-light);
}
.chip--yes { border-color: #9a9a9a; color: var(--color-ink); }
.chip--yes::before { content: "\2713\00a0"; }
.chip--no::before  { content: "\2715\00a0"; }

/* Tagpill — status marker for ledgers and claim tables */
.tagpill {
    display: inline-block;
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    border-radius: var(--radius-pill); padding: 4px 10px; text-align: center;
    border: 1px solid var(--color-border); color: var(--color-text-light);
    white-space: nowrap;
}
.tagpill--solid { border-color: #0d8f6f; color: #0d6b54; background: #f0faf6; }
.tagpill--care  { border-color: #c98a1e; color: #8a5f10; background: #fdf7ec; }
.tagpill--none  { border-color: #c9c9c9; color: #8a8a8a; background: #f7f7f7; }

/* 7. MOLECULES: CARDS & CONTAINERS

   ACCENT MODEL
   ------------
   One token, --card-accent, drives every accented card. Two percentages
   control how much of it surfaces: --accent-fill (interior) and --accent-edge
   (perimeter). No card ever carries the accent at full saturation on a single
   edge — the color is distributed evenly or not used at all.

   The percentages are per-hue on purpose. Black needs far less than orange to
   register, and teal needs slightly more; a single shared value makes black
   look dirty and teal look absent.

       black   fill  4%   edge 16%
       orange  fill  8%   edge 32%
       teal    fill  9%   edge 32%

   Each rule declares a solid pre-computed fallback first, then the color-mix
   override, so the system degrades cleanly where color-mix is unsupported. */
:root {
    --card-accent: var(--color-action);
    --accent-fill: 4%;
    --accent-edge: 16%;
}

/* Accent hue modifiers — compose onto any accented card */
.accent-orange { --card-accent: var(--color-scout-orange); --accent-fill: 8%; --accent-edge: 32%; }
.accent-teal   { --card-accent: var(--color-teal);         --accent-fill: 9%; --accent-edge: 32%; }
.accent-black  { --card-accent: var(--color-action);       --accent-fill: 4%; --accent-edge: 16%; }

.card {
    background: #fff; border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 25px;
}
.card--raised { box-shadow: var(--shadow-card); }
.card--hover { transition: border-color .15s; }
.card--hover:hover { border-color: #c9c9c9; }

/* .card--accent — tinted hairline only, white fill. The quietest accent in the
   system, so the workhorse card stays visibly below .rule. */
.card--accent { border-color: #d8d8d8; }
@supports (color: color-mix(in srgb, red 10%, white)) {
    .card--accent { border-color: color-mix(in srgb, var(--card-accent) var(--accent-edge), #fff); }
}

/* .rule — editorial statement card. Fill and perimeter carry the same hue at
   low saturation, so nothing spikes and the color reads as a property of the
   card rather than a marker stuck to its side. */
.rule {
    border: 1px solid #d8d8d8; background: #f5f5f5;
    border-radius: var(--radius-md); padding: 16px 18px;
}
.rule b { display: block; font-family: var(--font-heading); font-size: 14px; margin-bottom: 5px; color: var(--color-ink); }
.rule p { font-size: 13px; margin: 0; }
.rule.accent-orange { border-color: #fbcdbe; background: #fef3ef; }
.rule.accent-teal   { border-color: #addadd; background: #e8f5f6; }
@supports (color: color-mix(in srgb, red 10%, white)) {
    .rule {
        border-color: color-mix(in srgb, var(--card-accent) var(--accent-edge), #fff);
        background:   color-mix(in srgb, var(--card-accent) var(--accent-fill), #fff);
    }
}
/* Legacy alias — .rule.no was the orange variant in v4.0's first draft */
.rule.no { --card-accent: var(--color-scout-orange); --accent-fill: 8%; --accent-edge: 32%; }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--color-border);
}

/* Node — bordered list block used in diagrams and comparisons.
   Same tinted hairline as .card--accent, but keeps the dot at full saturation.
   The dot is what distinguishes a node from an accented card. */
.node { background: #fff; border: 1px solid #d8d8d8; border-radius: var(--radius-lg); padding: 22px; }
@supports (color: color-mix(in srgb, red 10%, white)) {
    .node { border-color: color-mix(in srgb, var(--card-accent) var(--accent-edge), #fff); }
}
.node .tag {
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px; color: var(--color-ink);
}
.node .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--card-accent); }
.node--orange { --card-accent: var(--color-scout-orange); --accent-fill: 8%; --accent-edge: 32%; border-color: #fbcdbe; }
.node--teal   { --card-accent: var(--color-teal);         --accent-fill: 9%; --accent-edge: 32%; border-color: #addadd; }

/* On dark artwork the white-based mix disappears. Swap to a low-alpha white
   perimeter and keep the dot at full strength. */
.node--on-dark {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.22) !important;
    color: rgba(255,255,255,.82);
}
.node--on-dark .tag { color: #fff; }
.node--on-dark ul { color: rgba(255,255,255,.72); }
.node--on-dark ul b { color: #fff; }
.node ul { list-style: none; padding: 0; display: grid; gap: 7px; font-size: 13px; color: var(--color-text-light); }
.node ul b { color: var(--color-ink); font-weight: 600; }

/* Callout — dashed emphasis block */
.callout {
    border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg);
    padding: 28px 30px; background: #fff;
}
.callout p { font-size: 14px; max-width: 70ch; }
.filechip {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--font-mono); font-size: 12.5px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    padding: 9px 14px; background: var(--color-surface); color: var(--color-ink);
}
.filechip::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--color-scout-orange); }

/* 8. FORMS & INPUTS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 6px; color: var(--color-ink); }
.input-control {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.95rem; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.input-control:focus { outline: none; border-color: var(--color-action); box-shadow: var(--focus-ring); }
.input-control::placeholder { color: var(--color-text-disabled); }
.check-group { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.95rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-action); width: 16px; height: 16px; cursor: pointer; }

/* 9. NAVIGATION: TREE / FOLDER */
.tree-nav { background: var(--color-bg-main); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px; }
.tree-root, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-children { margin-left: 18px; padding-left: 12px; border-left: 1px solid var(--color-border); }
.tree-item + .tree-item { margin-top: 4px; }
.tree-row {
    display: flex; align-items: center; gap: 8px; min-height: 34px;
    padding: 6px 8px; border-radius: var(--radius-md); color: var(--color-ink);
}
.tree-row[aria-current="page"] { background: var(--color-action-light); color: var(--color-ink); font-weight: 600; }
.tree-toggle {
    width: 18px; height: 18px; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); background: var(--color-bg-main);
    color: var(--color-text-light); font-size: 0.8rem; line-height: 1; cursor: pointer;
}
.tree-toggle:hover { border-color: var(--color-action); color: var(--color-action); }
.tree-toggle:focus { outline: none; border-color: var(--color-action); box-shadow: var(--focus-ring); }
.tree-icon { min-width: 18px; font-size: 0.9rem; }
.tree-label { flex: 1; font-size: 0.9rem; }
.tree-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-text-light); }

.tree-nav-dense .tree-row { min-height: 30px; padding: 4px 6px; gap: 6px; }
.tree-nav-dense .tree-meta { font-size: 0.68rem; }
.tree-nav-compact .tree-row { min-height: 28px; padding: 4px; }
.tree-nav-compact .tree-meta { display: none; }
.tree-nav-compact .tree-icon { min-width: 14px; font-size: 0.8rem; }
.tree-nav-compliance .tree-row { border: 1px solid transparent; }
.tree-nav-compliance .tree-row:hover { border-color: var(--color-border); background: var(--color-surface); }

.tree-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); }
.tree-status-dot.is-complete { background: var(--color-success); }
.tree-status-dot.is-review   { background: var(--color-warning); }
.tree-status-dot.is-alert    { background: var(--color-error); }

/* 10. MARKETING LAYER
   Dark artwork on a light page. Used for heroes and feature tiles. */
.grain { position: relative; }
.grain::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    opacity: .5; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.hero-art {
    position: relative; border-radius: var(--radius-xl); overflow: hidden; color: #fff;
    background:
      radial-gradient(120% 90% at 82% 8%, rgba(242,99,52,.85) 0%, rgba(242,99,52,0) 42%),
      radial-gradient(90% 110% at 10% 100%, rgba(0,140,149,.55) 0%, rgba(0,140,149,0) 48%),
      radial-gradient(140% 120% at 30% 20%, #26314e 0%, var(--color-scout-navy) 46%, #0c1120 100%);
}
.hero-inner { position: relative; z-index: 1; padding: clamp(48px,6.5vw,96px) clamp(28px,5vw,72px) clamp(44px,5vw,64px); }
.hero-art .eyebrow { color: rgba(255,255,255,.62); }
.hero-art h1 { color: #fff; font-size: clamp(44px,8.2vw,110px); line-height: .98; letter-spacing: -.03em; max-width: 14ch; margin-bottom: 28px; }
.hero-art h1 .dim { color: rgba(255,255,255,.5); }
.hero-art p { font-size: clamp(15px,1.5vw,18px); color: rgba(255,255,255,.82); max-width: 54ch; margin-bottom: 34px; }

/* Proof strip — mono statement bar docked to the bottom of the artwork */
.proof {
    position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(rgba(12,17,32,0), rgba(12,17,32,.55));
    padding: 18px clamp(28px,5vw,72px);
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: clamp(13px,1.4vw,15px);
}
.proof .in { color: rgba(255,255,255,.7); }
.proof .arrow { color: rgba(255,255,255,.5); }
.proof .out {
    font-weight: 700; background: linear-gradient(100deg,#ff8a5f,#45c8d1);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.proof .note { color: rgba(255,255,255,.66); font-size: 12px; margin-left: auto; }
@media (max-width: 640px) { .proof .note { margin-left: 0; flex-basis: 100%; } }

/* Artwork gradients for tiles */
.art--ember { background: radial-gradient(130% 130% at 80% 0%, #F26334 0%, #8a2f14 55%, #1A2238 100%); }
.art--tide  { background: radial-gradient(130% 130% at 20% 0%, #17b3bd 0%, #008C95 45%, #0c2a3e 100%); }
.art--dusk  { background: radial-gradient(130% 130% at 70% 10%, #55618c 0%, #1A2238 60%, #0c1120 100%); }
.art--dawn  { background: radial-gradient(130% 140% at 30% 0%, #f2a34e 0%, #F26334 40%, #431a3f 100%); }

/* Ticker — scrolling mono vocabulary rail */
.ticker { overflow: hidden; border-bottom: 1px solid var(--color-border); padding: 16px 0; position: relative; }
.ticker-inner {
    display: flex; white-space: nowrap; width: max-content;
    font-family: var(--font-mono); font-size: 13px; color: var(--color-text-light);
    letter-spacing: .08em; animation: vf-tick 52s linear infinite;
}
.ticker-inner span { padding-right: 52px; }
.ticker-inner span b { color: var(--color-ink); font-weight: 600; }
.ticker-inner span.no { color: #b9b9b9; text-decoration: line-through; }
.ticker:hover .ticker-inner { animation-play-state: paused; }
@keyframes vf-tick { to { transform: translateX(-50%); } }

/* Statement — full-bleed typographic band */
.statement {
    text-align: center; padding: var(--band-lg) 0;
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.statement p {
    font-family: var(--font-heading); font-weight: 700; letter-spacing: -.03em;
    font-size: clamp(30px,5.2vw,64px); line-height: 1.06; color: var(--color-text-dim);
    margin-bottom: 0;
}
.statement p b { color: var(--color-ink); font-weight: 700; }
.statement small {
    display: block; margin-top: 26px; font-family: var(--font-mono);
    font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}

/* Numbers strip — hairline-separated metric row */
.strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px;
    border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    overflow: hidden; background: var(--color-border);
}
.strip > div { padding: 22px 26px; background: #fff; }
.strip b {
    display: block; font-family: var(--font-heading); font-weight: 700;
    font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--color-ink);
}
.strip span { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-light); letter-spacing: .04em; }

/* Path diagram — two nodes with an animated conduit between them */
.path-grid { display: grid; grid-template-columns: 1fr 180px 1fr; gap: 22px; align-items: stretch; }
.conduit { display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; }
.conduit small { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--color-text-light); text-transform: uppercase; }
.rail { position: relative; height: 2px; background: #d4d4d4; border-radius: 1px; }
.rail .pulse {
    position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
    transform: translate(-50%,-50%); animation: vf-travel 2.8s ease-in-out infinite; animation-fill-mode: backwards;
}
.rail--req .pulse { background: var(--color-scout-orange); }
.rail--res .pulse { background: var(--color-teal); animation-name: vf-travel-back; animation-delay: 1.4s; }
@keyframes vf-travel      { 0%{left:0%;opacity:0} 12%{opacity:1} 88%{opacity:1} 100%{left:100%;opacity:0} }
@keyframes vf-travel-back { 0%{left:100%;opacity:0} 12%{opacity:1} 88%{opacity:1} 100%{left:0%;opacity:0} }
@media (max-width: 760px) {
    .path-grid { grid-template-columns: 1fr; }
    .rail { width: 2px; height: 56px; margin: 0 auto; }
    .rail .pulse { left: 50% !important; }
}

/* Ledger — claim / status table */
.ledger { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.ledger .lrow {
    display: grid; grid-template-columns: 104px 1fr minmax(200px, 30%); gap: 20px;
    padding: 16px 20px; border-top: 1px solid var(--color-border); align-items: baseline;
}
.ledger .lrow:first-child { border-top: 0; }
.ledger .what { font-size: 14px; color: var(--color-ink); }
.ledger .what em { font-style: normal; color: var(--color-text-light); }
.ledger .src { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-dim); word-break: break-word; }
@media (max-width: 860px) { .ledger .lrow { grid-template-columns: 104px 1fr; } .ledger .src { grid-column: 2; } }

/* Lexicon — say / never-say columns */
.lex { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .lex { grid-template-columns: 1fr; } }
.lexcol { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
/* The header strip takes the accent instead of neutral grey. It already holds
   a label, so the color earns its area. */
.lexcol header {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
    padding: 12px 18px; border-bottom: 1px solid var(--color-border);
    background: var(--color-surface); color: var(--color-ink); font-weight: 600;
}
.lexcol--yes header { background: #e8f5f6; border-bottom-color: #addadd; color: #0a5c60; }
.lexcol--no  header { background: #fef3ef; border-bottom-color: #fbcdbe; color: #a8461f; }
.lexcol ul { list-style: none; padding: 14px 18px 18px; display: grid; gap: 9px; font-family: var(--font-mono); font-size: 13px; }
.lexcol li { display: flex; gap: 10px; align-items: baseline; color: var(--color-ink); }
.lexcol li em { font-style: normal; color: var(--color-text-light); font-family: var(--font-body); font-size: 12.5px; }
.lexcol--yes li::before { content: "+"; color: var(--color-teal); font-weight: 700; }
.lexcol--no li::before  { content: "\00d7"; color: var(--color-scout-orange); font-weight: 700; }
.lexcol--no li { color: var(--color-text-light); }

/* 11. APPLICATION: CHAT INTERFACE */
.chat-window {
    display: flex; flex-direction: column; gap: 12px;
    background: #fff; border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 20px;
    max-height: 600px; overflow-y: auto;
}
.chat-bubble { max-width: 85%; padding: 12px 16px; border-radius: 12px; font-size: 0.95rem; line-height: 1.5; position: relative; }
.chat-bubble-ai {
    align-self: flex-start; background: var(--color-surface); color: var(--color-ink);
    border-bottom-left-radius: 2px; border: 1px solid var(--color-border);
}
.chat-bubble-user { align-self: flex-end; background: var(--color-action); color: #fff; border-bottom-right-radius: 2px; }
.chat-label {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--color-text-light);
    font-weight: 700; margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: .08em;
}

/* 12. APPLICATION: ACTIVITY FEED (SSE event log) */
.activity-feed {
    background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float); width: 320px; max-height: 360px;
    display: flex; flex-direction: column; overflow: hidden; font-size: 0.85rem;
}
.activity-feed-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid var(--color-border);
    background: var(--color-surface); cursor: pointer; user-select: none;
}
.activity-feed-title {
    font-family: var(--font-heading); font-weight: 600; font-size: 0.8rem;
    color: var(--color-ink); display: flex; align-items: center; gap: 8px;
}
.activity-feed-badge {
    background: var(--color-action); color: #fff; font-family: var(--font-mono);
    font-size: 0.65rem; font-weight: 700; padding: 1px 6px;
    border-radius: 10px; min-width: 18px; text-align: center;
}
.activity-feed-toggle { border: none; background: transparent; color: var(--color-text-light); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px; }
.activity-feed-toggle:hover { color: var(--color-ink); }
.activity-feed-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.activity-feed.is-collapsed .activity-feed-body { display: none; }

.activity-event { display: flex; align-items: flex-start; gap: 10px; padding: 7px 14px; animation: vf-event-in .25s ease-out; }
.activity-event + .activity-event { border-top: 1px solid rgba(0,0,0,.04); }
.activity-event-icon { flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.activity-event-body { flex: 1; min-width: 0; }
.activity-event-msg { color: var(--color-ink); line-height: 1.4; }
.activity-event-detail { color: var(--color-text-light); font-size: 0.78rem; line-height: 1.3; margin-top: 1px; }
.activity-event-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--color-text-light); margin-top: 2px; }

.pulse-dot { display: inline-block; width: 8px; height: 8px; background: var(--color-info); border-radius: 50%; animation: vf-pulse 1.5s infinite; }
.check-dot { display: inline-block; width: 16px; height: 16px; background: var(--color-success-bg); color: var(--color-success); border-radius: 50%; font-size: 0.65rem; font-weight: 700; line-height: 16px; text-align: center; }
.error-dot { display: inline-block; width: 16px; height: 16px; background: var(--color-error-bg); color: var(--color-error); border-radius: 50%; font-size: 0.65rem; font-weight: 700; line-height: 16px; text-align: center; }

@keyframes vf-event-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vf-pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } 100% { opacity: 1; transform: scale(1); } }

/* Motion: honour the OS setting across every animated component */
@media (prefers-reduced-motion: reduce) {
    .ticker-inner, .rail .pulse, .pulse-dot, .activity-event { animation: none; }
    .rail .pulse { opacity: 1; }
}

/* 13. DARK FOOTER — grounds a light page */
.site-footer {
    background: var(--color-dk-bg); border-top: 1px solid var(--color-dk-border);
    padding: 52px 0 44px; font-size: 13px; color: var(--color-dk-muted);
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--color-dk-text); }
.site-footer nav { display: grid; gap: 8px; font-family: var(--font-mono); font-size: 12px; }
.site-footer .legal {
    margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--color-dk-border);
    font-family: var(--font-mono); font-size: 11px;
}
.wordmark { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--color-action); text-decoration: none; }
.wordmark span { color: var(--color-text-light); }
.site-footer .wordmark { color: #fff; }
.site-footer .wordmark span { color: var(--color-dk-muted); }

/* 14. DEPRECATED — v3.3 token names. Retained so existing pages keep rendering.
   Migrate to the v4 names above; these will be removed in v5.
   NOTE: --color-primary now resolves to BLACK, not orange. If a page genuinely
   needs the orange fill, use --color-scout-orange explicitly. */
:root {
    --color-primary: var(--color-action);
    --color-primary-hover: var(--color-action-hover);
    --color-primary-light: var(--color-action-light);
    --color-text-main: var(--color-ink);
    --color-bg-alt: var(--color-surface);              /* was Soft Sand #F9F7F2 */
    --color-bg-dark: var(--color-dk-bg);
    --color-accent: var(--color-branch-brown);
    --shadow: var(--shadow-card);
}

/* 15. UTILITIES */
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 2rem; }  .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 2rem; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
