@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Archivo:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ==========================================================================
   CLINICAL INSTRUMENT — design tokens
   Precision instrumentation, not a rounded-card SaaS dashboard.
   Confidence ramp (teal/amber/coral) is RESERVED. Nothing decorative uses it,
   so a coloured pixel always means a confidence signal.
   ========================================================================== */

:root {
  /* --- graphite ink scale ------------------------------------------------ */
  --ink-900: #101318;
  --ink-800: #191D24;
  --ink-700: #252A33;
  --ink-600: #373D48;
  --ink-500: #545C6B;
  --ink-400: #79818F;
  --ink-300: #A5ACB8;
  --ink-200: #CFD4DC;
  --ink-150: #E0E4EA;
  --ink-100: #EBEEF2;
  --ink-050: #F4F6F9;

  /* --- chrome (light default) ------------------------------------------- */
  --bg:         #EDEFF3;
  --surface:    #FFFFFF;
  --surface-2:  #F7F8FB;
  --surface-3:  #EFF1F5;
  --rail:       #191D24;
  --rail-text:  #A5ACB8;
  --rail-text-active: #FFFFFF;
  --rail-hover: #252A33;

  --line:       #DDE1E8;
  --line-soft:  #E9ECF1;
  --line-strong:#C3C9D3;

  --text:       #101318;
  --text-2:     #444B57;
  --text-3:     #6C7484;
  --text-4:     #939BA8;
  --text-inv:   #FFFFFF;

  /* --- document surface: warm paper, identical in both chromes ----------- */
  --paper:      #FAF7F1;
  --paper-2:    #F3EFE6;
  --paper-line: #DED5C4;
  --paper-rule: #C8BCA5;
  --paper-ink:  #1A1712;
  --paper-ink-2:#5C5446;

  /* --- confidence ramp — RESERVED --------------------------------------- */
  --conf-hi:      #0B6E62;
  --conf-hi-bg:   #D6EBE7;
  --conf-hi-line: #7FC4B9;
  --conf-md:      #9A5B08;
  --conf-md-bg:   #FAEBD3;
  --conf-md-line: #E0AC5E;
  --conf-lo:      #A81F2A;
  --conf-lo-bg:   #F9DEDF;
  --conf-lo-line: #E08A90;

  /* --- interactive accent (never teal/amber/coral) ----------------------- */
  --accent:       #2F3E9E;
  --accent-hover: #26327F;
  --accent-soft:  #E5E8F7;
  --accent-line:  #A9B3E4;

  /* --- geometry: hairlines, near-zero radius ---------------------------- */
  --r:    3px;
  --r-sm: 2px;
  --r-lg: 5px;
  --hair: 1px;

  /* --- type ------------------------------------------------------------- */
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-xs:   11px;
  --t-sm:   12px;
  --t-base: 13px;
  --t-md:   14px;
  --t-lg:   16px;
  --t-xl:   20px;
  --t-2xl:  26px;
  --t-3xl:  36px;
  --t-4xl:  52px;

  /* --- spacing ---------------------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 44px; --s9: 64px;

  /* --- elevation: tight, low-spread. No soft SaaS blobs. ---------------- */
  --sh-1: 0 1px 2px rgba(16, 19, 24, .06);
  --sh-2: 0 2px 6px rgba(16, 19, 24, .09), 0 0 0 1px rgba(16, 19, 24, .04);
  --sh-3: 0 12px 32px rgba(16, 19, 24, .16), 0 0 0 1px rgba(16, 19, 24, .06);
  --sh-paper: 0 1px 1px rgba(60, 50, 30, .08), 0 8px 28px rgba(60, 50, 30, .10);

  /* --- layout ----------------------------------------------------------- */
  --rail-w: 232px;
  --topbar-h: 52px;

  /* --- motion ----------------------------------------------------------- */
  --e-out: cubic-bezier(.22, .61, .36, 1);
  --e-io:  cubic-bezier(.65, 0, .35, 1);
  --d-fast: 140ms;
  --d-base: 200ms;
  --d-slow: 320ms;

  --z-rail: 40; --z-sticky: 30; --z-drawer: 60; --z-modal: 70; --z-toast: 80;
}

  /* --- brand gradient — landing + hero accents only. Teal→indigo reads as
         medical-tech and dodges the purple-on-white cliché. --------------- */
  --brand-1: #0EA896;
  --brand-2: #1C6FD6;
  --brand-3: #3B4CC0;
  --brand-glow: rgba(14, 168, 150, .22);

/* --- dark chrome. Paper tokens deliberately unchanged: reading a document
       on a dark surface is worse, and the document is the point. ---------- */
[data-chrome="dark"] {
  --bg:        #0C0F13;
  --surface:   #14181E;
  --surface-2: #191E25;
  --surface-3: #1F252D;
  --rail:      #090B0F;
  --rail-hover:#171C23;

  --line:       #2A313B;
  --line-soft:  #21272F;
  --line-strong:#3A424E;

  --text:   #F1F3F6;
  --text-2: #BFC6D1;
  --text-3: #8B94A2;
  --text-4: #69717E;

  --conf-hi:      #58C4B2;
  --conf-hi-bg:   #0E2A27;
  --conf-hi-line: #1F5C53;
  --conf-md:      #E8A94E;
  --conf-md-bg:   #2E2210;
  --conf-md-line: #6B4E1C;
  --conf-lo:      #F0888F;
  --conf-lo-bg:   #331519;
  --conf-lo-line: #75323A;

  --accent:      #8B9BEF;
  --accent-hover:#A5B2F4;
  --accent-soft: #1A1F3D;
  --accent-line: #39447A;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 2px 6px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
  --sh-3: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.07);
}

/* ==========================================================================
   reset + base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

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

/* scrollbars — thin, chrome-matched */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 8px;
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-4); background-clip: content-box; }

/* ==========================================================================
   typography primitives
   ========================================================================== */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.06;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

/* the small uppercase label that runs above every section */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-4);
}

.h1 { font-family: var(--font-display); font-size: var(--t-3xl); line-height: 1.04; letter-spacing: -.015em; }
.h2 { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.12; letter-spacing: -.01em; }
.h3 { font-size: var(--t-md); font-weight: 600; letter-spacing: -.005em; }
.h4 { font-size: var(--t-base); font-weight: 600; }

.muted   { color: var(--text-3); }
.muted-2 { color: var(--text-4); }
.tnum    { font-variant-numeric: tabular-nums; }

.lede { font-size: var(--t-md); line-height: 1.6; color: var(--text-2); max-width: 68ch; }

/* ==========================================================================
   app shell
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

/* --- left rail --------------------------------------------------------- */
.rail {
  position: fixed; inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail);
  border-right: var(--hair) solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  z-index: var(--z-rail);
  transition: transform var(--d-base) var(--e-out);
}

.rail__brand {
  padding: var(--s5) var(--s5) var(--s4);
  border-bottom: var(--hair) solid rgba(255,255,255,.07);
}
.rail__mark {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
}
.rail__glyph {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  border-radius: 7px; color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 14px var(--brand-glow);
}
[data-chrome="dark"] .rail__glyph { background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); }
.rail__name {
  display: block;
  font-family: var(--font-display); font-size: 20px; line-height: 1; color: #fff;
}
.rail__sub {
  display: block;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .13em;
  text-transform: uppercase; color: #6B7382; margin-top: 4px;
}

.rail__nav { flex: 1; overflow-y: auto; padding: var(--s4) 0 var(--s6); }
.rail__group { padding: 0 var(--s3); margin-bottom: var(--s5); }
.rail__grouplabel {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: #5A6272;
  padding: 0 var(--s3) var(--s2);
}

.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--s3); min-height: 34px;
  color: var(--rail-text); text-decoration: none;
  font-size: var(--t-base); font-weight: 500;
  border-radius: var(--r); cursor: pointer;
  border-left: 2px solid transparent; margin-left: -2px;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.navlink:hover { background: var(--rail-hover); color: #E4E7EC; }
.navlink[aria-current="page"] {
  background: var(--rail-hover); color: var(--rail-text-active);
  border-left-color: var(--conf-hi);
}
.navlink svg { flex: none; opacity: .75; }
.navlink[aria-current="page"] svg { opacity: 1; }
.navlink__count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  color: #7A8393; background: rgba(255,255,255,.07);
  padding: 1px 5px; border-radius: 20px;
}

.rail__foot {
  padding: var(--s4) var(--s5);
  border-top: var(--hair) solid rgba(255,255,255,.07);
}

/* the HIPAA marker — doubles as a signal that we think about PHI by default */
.phi-chip {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .05em;
  color: #7A8393; line-height: 1.4;
}
.phi-chip__dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--conf-hi); box-shadow: 0 0 0 3px rgba(11,110,98,.18);
}

/* --- main column ------------------------------------------------------- */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--rail-w);
  display: flex; flex-direction: column;
  position: relative;
  /* atmospheric canvas — a faint grid and two soft glows so the working
     surface reads as a considered environment, not a flat gray box. Kept
     low-contrast so data density stays calm. */
  background:
    radial-gradient(1100px 620px at 82% -8%, var(--brand-glow), transparent 60%),
    radial-gradient(900px 600px at -6% 108%, rgba(28,111,214,.10), transparent 55%),
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 34px 100%,
    var(--bg);
}
[data-chrome="dark"] .main {
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(14,168,150,.14), transparent 60%),
    radial-gradient(900px 600px at -6% 108%, rgba(28,111,214,.12), transparent 55%),
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 34px 100%,
    var(--bg);
}
/* the grid must not bleed over the document workspace, which has its own texture */
.main:has(.console) { background: var(--bg); }
/* console pages are viewport-bound so the document and inspector scroll
   independently instead of the whole page growing */
.main--fixed { height: 100vh; overflow: hidden; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s6);
  background: var(--surface);
  border-bottom: var(--hair) solid var(--line);
}
.topbar__crumbs {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--text-4); min-width: 0;
}
.topbar__crumbs b { font-weight: 500; color: var(--text-2); }
.topbar__spacer { flex: 1; }
.topbar__tools { display: flex; align-items: center; gap: var(--s2); }

.railtoggle { display: none; }

.page { padding: var(--s6); flex: 1; min-width: 0; }
.page--flush { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.page__head { margin-bottom: var(--s6); }
.page__title { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }

/* ==========================================================================
   panels + surfaces
   ========================================================================== */

.panel {
  min-width: 0;
  background: var(--surface);
  border: var(--hair) solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.panel--flat { box-shadow: none; }
.panel--quiet { background: var(--surface-2); box-shadow: none; }
.panel__head {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: var(--hair) solid var(--line-soft);
  min-height: 42px; flex-wrap: wrap;
}
.panel__head .eyebrow { flex: none; }
.panel__head-actions {
  margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
}
.panel__body { padding: var(--s4); }
.panel__body--tight { padding: var(--s3); }
.panel__body--none { padding: 0; }
.panel__foot {
  padding: var(--s3) var(--s4);
  border-top: var(--hair) solid var(--line-soft);
  background: var(--surface-2);
  font-size: var(--t-sm); color: var(--text-3);
}

/* ==========================================================================
   grid helpers
   ========================================================================== */

/* flex/grid children default to min-width:auto, which lets wide content push a
   container past the viewport. Every layout child opts out. */
.grid > *, .stack > * { min-width: 0; }

.grid { display: grid; gap: var(--s4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
/* content + fixed-width aside. Set the aside width with --aside; it collapses
   to a single column below the tablet breakpoint. */
.grid--aside   { grid-template-columns: minmax(0,1fr) var(--aside, 380px); }
.grid--aside-l { grid-template-columns: var(--aside, 320px) minmax(0,1fr); }
.stack   { display: flex; flex-direction: column; gap: var(--s4); }
.stack--sm { gap: var(--s2); }
.stack--md { gap: var(--s3); }
.row     { display: flex; align-items: center; gap: var(--s3); }
.row--wrap { flex-wrap: wrap; }
.row--tight { gap: var(--s2); }
.spacer  { flex: 1; }

/* ==========================================================================
   buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px;
  font-size: var(--t-base); font-weight: 500; font-family: var(--font-ui);
  color: var(--text-2); background: var(--surface);
  border: var(--hair) solid var(--line-strong);
  border-radius: var(--r); cursor: pointer;
  white-space: nowrap;
  transition: background var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out),
              color var(--d-fast) var(--e-out);
}
.btn:hover { background: var(--surface-3); border-color: var(--text-4); color: var(--text); }
.btn:active { background: var(--line-soft); }
.btn svg { flex: none; opacity: .8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--primary svg { opacity: 1; }
[data-chrome="dark"] .btn--primary { color: #0C0F13; }

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

.btn--sm { height: 26px; padding: 0 9px; font-size: var(--t-sm); }
.btn--lg { height: 38px; padding: 0 16px; font-size: var(--t-md); }
.btn--icon { width: 32px; padding: 0; }
.btn--icon.btn--sm { width: 26px; }

.btn--accept { border-color: var(--conf-hi-line); color: var(--conf-hi); background: var(--conf-hi-bg); }
.btn--accept:hover { background: var(--conf-hi); color: #fff; border-color: var(--conf-hi); }
.btn--reject { border-color: var(--conf-lo-line); color: var(--conf-lo); background: var(--conf-lo-bg); }
.btn--reject:hover { background: var(--conf-lo); color: #fff; border-color: var(--conf-lo); }

.btngroup { display: inline-flex; }
.btngroup .btn { border-radius: 0; margin-left: -1px; }
.btngroup .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btngroup .btn:last-child  { border-radius: 0 var(--r) var(--r) 0; }
.btngroup .btn[aria-pressed="true"] {
  background: var(--ink-800); color: #fff; border-color: var(--ink-800); z-index: 1;
}
[data-chrome="dark"] .btngroup .btn[aria-pressed="true"] {
  background: var(--surface-3); color: var(--text); border-color: var(--line-strong);
}

/* keycap — used everywhere to teach the keyboard triage */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--text-3); background: var(--surface-2);
  border: var(--hair) solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
}

/* ==========================================================================
   badges — confidence bands and status
   ========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .03em; text-transform: uppercase;
  border-radius: 20px; border: var(--hair) solid transparent;
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; flex: none; }

/* confidence bands. Colour is never the only channel — each carries a glyph. */
.badge--hi { color: var(--conf-hi); background: var(--conf-hi-bg); border-color: var(--conf-hi-line); }
.badge--md { color: var(--conf-md); background: var(--conf-md-bg); border-color: var(--conf-md-line); }
.badge--lo { color: var(--conf-lo); background: var(--conf-lo-bg); border-color: var(--conf-lo-line); }

/* neutral statuses use ink only, never the reserved ramp */
.badge--neutral { color: var(--text-3); background: var(--surface-3); border-color: var(--line); }
.badge--ink     { color: var(--text-inv); background: var(--ink-700); border-color: var(--ink-700); }
[data-chrome="dark"] .badge--ink { color: var(--ink-900); background: var(--ink-200); border-color: var(--ink-200); }
.badge--accent  { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

.badge--square { border-radius: var(--r-sm); }

/* tiny inline dot for band encoding inside dense tables */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot--hi { background: var(--conf-hi); }
.dot--md { background: var(--conf-md); }
.dot--lo { background: var(--conf-lo); }

/* ==========================================================================
   confidence meter
   ========================================================================== */

.meter {
  position: relative; height: 5px; border-radius: 3px;
  background: var(--line-soft); overflow: hidden;
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; width: var(--v, 0%);
  border-radius: 3px;
  transform-origin: left center;
  animation: meterIn var(--d-slow) var(--e-out) both;
}
.meter--hi .meter__fill { background: var(--conf-hi); }
.meter--md .meter__fill { background: var(--conf-md); }
.meter--lo .meter__fill { background: var(--conf-lo); }
.meter--ink .meter__fill { background: var(--ink-500); }
.meter--accent .meter__fill { background: var(--accent); }

/* the auto-accept threshold tick */
.meter__thresh {
  position: absolute; top: -2px; bottom: -2px; left: var(--t, 88%);
  width: 1px; background: var(--text); opacity: .55;
}

@keyframes meterIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* stacked factor bar — the confidence breakdown in the field inspector */
.factors { display: grid; gap: 7px; }
.factor { display: grid; grid-template-columns: 108px 1fr 38px; align-items: center; gap: var(--s3); }
.factor__label { font-size: var(--t-xs); color: var(--text-3); }
.factor__val { font-family: var(--font-mono); font-size: var(--t-xs); text-align: right; color: var(--text-2); }

/* ==========================================================================
   tables — dense by design
   ========================================================================== */

/* wide tables scroll inside their own container — the page body never does */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

.table { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
.table th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-weight: 500;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-4);
  padding: 9px var(--s3); white-space: nowrap;
  background: var(--surface-2);
  border-bottom: var(--hair) solid var(--line);
}
.table td {
  padding: 9px var(--s3);
  border-bottom: var(--hair) solid var(--line-soft);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--d-fast) var(--e-out); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr[data-clickable] { cursor: pointer; }
.table tbody tr[aria-selected="true"] { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); }
.table--compact td, .table--compact th { padding: 6px var(--s3); }

.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: var(--t-xs); color: var(--text-4); }

/* ==========================================================================
   form controls
   ========================================================================== */

.field { display: grid; gap: 5px; }
.field__label { font-size: var(--t-sm); font-weight: 500; color: var(--text-2); }
.field__hint  { font-size: var(--t-xs); color: var(--text-4); }

.input, .select, .textarea {
  width: 100%; min-height: 32px; padding: 6px 10px;
  font-size: var(--t-base); font-family: var(--font-ui);
  color: var(--text); background: var(--surface);
  border: var(--hair) solid var(--line-strong);
  border-radius: var(--r);
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input--mono { font-family: var(--font-mono); font-size: var(--t-sm); }
.textarea { min-height: 76px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2379818F' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}

.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.search .input { padding-left: 30px; }

/* segmented choice list — used for radio/checkbox fields in the inspector */
.choices { display: grid; gap: 5px; }
.choice {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; min-height: 34px;
  border: var(--hair) solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; font-size: var(--t-base);
  transition: border-color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
}
.choice:hover { border-color: var(--line-strong); background: var(--surface-2); }
.choice[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft); font-weight: 500;
}
.choice__key { margin-left: auto; }
.choice__mark {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center;
}
.choice[aria-checked="true"] .choice__mark { border-color: var(--accent); }
.choice[aria-checked="true"] .choice__mark::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ==========================================================================
   paper: the document surface
   ========================================================================== */

.paper {
  background: var(--paper);
  color: var(--paper-ink);
  border: var(--hair) solid var(--paper-line);
  border-radius: 2px;
  box-shadow: var(--sh-paper);
  position: relative;
  font-family: var(--font-ui);
}
/* subtle fibre grain so it reads as paper, not as a white div */
.paper::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 2px;
  opacity: .5; mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(140,120,90,.05) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 65%, rgba(140,120,90,.04) 0 1px, transparent 1px),
    radial-gradient(circle at 45% 85%, rgba(140,120,90,.05) 0 1px, transparent 1px);
  background-size: 37px 41px, 53px 47px, 61px 59px;
}
.paper__inner { position: relative; padding: 40px 44px; }

.paper h1, .paper h2, .paper h3 { font-family: var(--font-ui); }
.paper__formtitle {
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; text-transform: uppercase;
}
.paper__agency { font-size: 10px; color: var(--paper-ink-2); letter-spacing: .08em; text-transform: uppercase; }
.paper__omb { font-family: var(--font-mono); font-size: 9px; color: var(--paper-ink-2); }

.paper__rule { height: 1px; background: var(--paper-rule); border: none; margin: 14px 0; }
.paper__rule--heavy { height: 2px; background: var(--paper-ink); opacity: .7; }

.paper__section {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--paper-2); border-top: 1.5px solid var(--paper-ink);
  padding: 5px 8px; margin: 18px -8px 12px;
}
.paper__q { font-size: 11.5px; line-height: 1.5; color: var(--paper-ink); margin-bottom: 5px; }
.paper__qnum { font-weight: 700; margin-right: 4px; }
.paper__note { font-size: 10px; font-style: italic; color: var(--paper-ink-2); line-height: 1.45; }

/* --- the filled field overlay, tinted by confidence band ----------------- */
.pfield {
  position: relative; display: block; width: 100%;
  min-height: 26px; padding: 3px 7px;
  font-size: 12px; line-height: 1.5;
  text-align: left; cursor: pointer;
  background: transparent;
  border: none; border-bottom: 1px solid var(--paper-rule);
  border-radius: 2px 2px 0 0;
  color: var(--paper-ink);
  font-family: var(--font-ui);
  transition: background var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.pfield::after {
  content: ''; position: absolute; inset: 0; border-radius: 2px 2px 0 0;
  pointer-events: none; opacity: .5;
  transition: opacity var(--d-fast) var(--e-out);
}
.pfield__val { position: relative; }
.pfield--empty .pfield__val { color: #A79880; font-style: italic; }

.pfield--hi { background: rgba(11,110,98,.09);  box-shadow: inset 0 -2px 0 var(--conf-hi); }
.pfield--md { background: rgba(154,91,8,.11);   box-shadow: inset 0 -2px 0 var(--conf-md); }
.pfield--lo { background: rgba(168,31,42,.10);  box-shadow: inset 0 -2px 0 var(--conf-lo); }
.pfield--none { background: rgba(0,0,0,.035); box-shadow: inset 0 -2px 0 var(--paper-rule); }

.pfield:hover { filter: brightness(.97); }

.pfield[aria-current="true"] {
  box-shadow: inset 0 -2px 0 currentColor, 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft);
  z-index: 2;
}
.pfield[aria-current="true"] { animation: fieldPulse 600ms var(--e-out); }
@keyframes fieldPulse {
  0%   { box-shadow: inset 0 -2px 0 currentColor, 0 0 0 2px var(--accent), 0 0 0 3px var(--accent-soft); }
  50%  { box-shadow: inset 0 -2px 0 currentColor, 0 0 0 2px var(--accent), 0 0 0 9px var(--accent-soft); }
  100% { box-shadow: inset 0 -2px 0 currentColor, 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
}

/* accepted fields lose their tint — visual proof of progress */
.pfield[data-state="accepted"] { background: rgba(0,0,0,.03); box-shadow: inset 0 -2px 0 var(--paper-rule); }
.pfield[data-state="accepted"] .pfield__val { font-weight: 500; }

.pfield__flag {
  position: absolute; top: 2px; right: 3px;
  font-family: var(--font-mono); font-size: 8px; font-weight: 700;
  letter-spacing: .04em; opacity: .75;
}
.pfield--hi .pfield__flag { color: var(--conf-hi); }
.pfield--md .pfield__flag { color: var(--conf-md); }
.pfield--lo .pfield__flag { color: var(--conf-lo); }

/* checkbox rendered on paper */
.pcheck {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; cursor: pointer; padding: 2px 5px 2px 2px; border-radius: 2px;
  background: none; border: none; color: var(--paper-ink); font-family: var(--font-ui);
}
.pcheck__box {
  width: 13px; height: 13px; flex: none;
  border: 1.25px solid var(--paper-ink); border-radius: 1px;
  display: grid; place-items: center; background: var(--paper);
}
.pcheck[aria-checked="true"] .pcheck__box::after {
  content: '\2715'; font-size: 10px; line-height: 1; font-weight: 700;
}
.pcheck--filled .pcheck__box { background: rgba(11,110,98,.12); border-color: var(--conf-hi); }

/* ==========================================================================
   review console layout
   ========================================================================== */

.console {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 400px;
  flex: 1; min-height: 0;
}

/* page thumbnail rail */
.pagerail {
  border-right: var(--hair) solid var(--line);
  background: var(--surface-2);
  padding: var(--s3) 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
}
.pagethumb {
  width: 38px; height: 49px; flex: none; cursor: pointer;
  background: var(--paper); border: var(--hair) solid var(--paper-line);
  border-radius: 1px; position: relative; padding: 4px 3px;
  display: flex; flex-direction: column; gap: 2px;
  transition: box-shadow var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.pagethumb:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
.pagethumb[aria-current="page"] { box-shadow: 0 0 0 2px var(--accent); }
.pagethumb i { display: block; height: 1.5px; background: var(--paper-rule); border-radius: 1px; }
.pagethumb i:nth-child(3n) { width: 62%; }
.pagethumb__n {
  position: absolute; bottom: -1px; right: -1px;
  font-family: var(--font-mono); font-size: 8px;
  background: var(--ink-700); color: #fff; padding: 0 3px; border-radius: 2px 0 0 0;
}
.pagethumb__flags {
  position: absolute; top: 2px; left: 2px; display: flex; gap: 1.5px;
}

/* the scrolling document viewport */
.docview {
  overflow-y: auto; padding: var(--s6);
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(16,19,24,.012) 8px 16px),
    var(--surface-3);
  min-width: 0;
}
[data-chrome="dark"] .docview {
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255,255,255,.012) 8px 16px),
    var(--bg);
}
.docview__sheet { max-width: 760px; margin: 0 auto; }

/* right inspector */
.inspector {
  border-left: var(--hair) solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.inspector__scroll { overflow-y: auto; flex: 1; }
.inspector__sec { padding: var(--s4); border-bottom: var(--hair) solid var(--line-soft); }
.inspector__foot {
  padding: var(--s3) var(--s4); border-top: var(--hair) solid var(--line);
  background: var(--surface-2); flex: none;
}

/* the field-triage strip above the inspector */
.triagebar {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s4); flex: none;
  border-bottom: var(--hair) solid var(--line);
  background: var(--surface-2);
}
.triagebar__pos { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-3); }

/* budget timer — the 4:00 per-form argument, made visible */
.budget { display: flex; align-items: center; gap: 9px; }
.budget__ring { width: 30px; height: 30px; flex: none; transform: rotate(-90deg); }
.budget__ring circle { fill: none; stroke-width: 3.5; }
.budget__track { stroke: var(--line); }
.budget__arc { stroke: var(--conf-hi); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke var(--d-base); }
.budget--warn .budget__arc { stroke: var(--conf-md); }
.budget--over .budget__arc { stroke: var(--conf-lo); }
.budget__t { font-family: var(--font-mono); font-size: var(--t-base); font-weight: 500; line-height: 1.1; }
.budget__l { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-4); }

/* evidence drawer, bottom */
.drawer {
  position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: var(--z-drawer);
  background: var(--surface);
  border-top: var(--hair) solid var(--line-strong);
  box-shadow: 0 -8px 32px rgba(16,19,24,.13);
  max-height: 44vh; display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--d-slow) var(--e-out);
}
.drawer[data-open="true"] { transform: translateY(0); }
.drawer__head {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5); border-bottom: var(--hair) solid var(--line-soft);
  flex: none;
}
.drawer__body { padding: var(--s4) var(--s5) var(--s5); overflow-y: auto; }

/* ==========================================================================
   evidence rendering
   ========================================================================== */

.evidence {
  font-family: var(--font-ui); font-size: var(--t-base); line-height: 1.7;
  color: var(--paper-ink); background: var(--paper);
  border: var(--hair) solid var(--paper-line); border-radius: var(--r);
  padding: var(--s4) var(--s5);
}
.evidence mark {
  background: rgba(154,91,8,.20);
  box-shadow: 0 0 0 1px rgba(154,91,8,.32);
  border-radius: 2px; padding: 1px 2px; color: inherit;
}
.evidence mark.is-key {
  background: rgba(47,62,158,.16); box-shadow: 0 0 0 1px rgba(47,62,158,.34);
}
.evidence__meta {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  font-family: var(--font-mono); font-size: var(--t-xs); color: var(--paper-ink-2);
  padding-bottom: var(--s3); margin-bottom: var(--s3);
  border-bottom: 1px solid var(--paper-line);
}

/* provenance chain */
.chain { display: grid; gap: 0; }
.chain__node {
  display: grid; grid-template-columns: 26px 1fr; gap: var(--s3);
  padding-bottom: var(--s4); position: relative;
}
.chain__node:not(:last-child)::before {
  content: ''; position: absolute; left: 12.5px; top: 24px; bottom: 0;
  width: 1px; background: var(--line-strong);
}
.chain__dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--surface); border: var(--hair) solid var(--line-strong);
  color: var(--text-3); position: relative; z-index: 1;
}
.chain__node[data-tone="accent"] .chain__dot { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chain__node[data-tone="hi"] .chain__dot { background: var(--conf-hi-bg); border-color: var(--conf-hi-line); color: var(--conf-hi); }
.chain__title { font-size: var(--t-base); font-weight: 600; }
.chain__meta { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-4); }

/* ==========================================================================
   metric tiles
   ========================================================================== */

.tile { padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; position: relative; overflow: hidden; }
/* metric panels get a hairline top-rail in brand gradient + a faint corner
   glow, so a KPI reads as a considered object rather than a bordered div */
.panel.tile::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  opacity: .8;
}
.panel.tile::after {
  content: ''; position: absolute; inset: -40% -30% auto auto; width: 180px; height: 120px;
  background: radial-gradient(circle, var(--brand-glow), transparent 70%);
  opacity: .5; pointer-events: none;
}
.tile__label { display: flex; align-items: center; gap: 6px; }
.tile__value { font-family: var(--font-display); font-size: var(--t-3xl); line-height: 1; letter-spacing: -.02em; }
.tile__value small { font-family: var(--font-mono); font-size: var(--t-md); letter-spacing: -.02em; color: var(--text-3); }
.tile__delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: var(--t-xs); }
.tile__delta[data-dir="up"]   { color: var(--conf-hi); }
.tile__delta[data-dir="down"] { color: var(--conf-lo); }
.tile__delta[data-dir="flat"] { color: var(--text-4); }
.tile__foot { font-size: var(--t-xs); color: var(--text-4); }

/* hero stat — the throughput number */
.hero {
  display: grid; grid-template-columns: minmax(0,auto) 1fr; gap: var(--s7); align-items: center;
  padding: var(--s7); position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background:
    radial-gradient(680px 340px at 8% -30%, var(--brand-glow), transparent 62%),
    var(--surface);
}
.hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3));
}
.hero__num { font-family: var(--font-display); font-size: var(--t-4xl); line-height: .95; letter-spacing: -.03em; }
.hero__unit { font-family: var(--font-mono); font-size: var(--t-md); color: var(--text-3); letter-spacing: -.02em; }

/* ==========================================================================
   pipeline stages (intake)
   ========================================================================== */

.stages { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--r); overflow: hidden; }
.stage {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: var(--s3);
  padding: 10px var(--s4); background: var(--surface);
}
.stage__icon {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-4); border: var(--hair) solid var(--line);
}
.stage[data-state="done"] .stage__icon { background: var(--conf-hi-bg); border-color: var(--conf-hi-line); color: var(--conf-hi); }
.stage[data-state="active"] .stage__icon { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.stage[data-state="active"] { background: var(--accent-soft); }
.stage[data-state="skip"] { opacity: .6; }
.stage__name { font-size: var(--t-base); font-weight: 500; }
.stage__detail { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-4); }
.stage__time { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-3); }

.spin { animation: spin 900ms linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   dropzone
   ========================================================================== */

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  padding: var(--s8) var(--s6); text-align: center;
  background: var(--surface-2); cursor: pointer;
  transition: border-color var(--d-base) var(--e-out), background var(--d-base) var(--e-out);
}
.dropzone:hover, .dropzone[data-hot="true"] { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { color: var(--text-4); margin: 0 auto var(--s3); }
.dropzone:hover .dropzone__icon { color: var(--accent); }

/* ==========================================================================
   tabs
   ========================================================================== */

.tabs {
  display: flex; gap: 2px; border-bottom: var(--hair) solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px var(--s4); min-height: 38px;
  background: none; border: none; cursor: pointer;
  font-size: var(--t-base); font-weight: 500; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel[hidden] { display: none; }

/* ==========================================================================
   field graph overlay (template studio)
   ========================================================================== */

.fgraph { position: relative; }
.fgbox {
  position: absolute; cursor: pointer;
  border: 1.5px solid var(--accent); border-radius: 2px;
  background: rgba(47,62,158,.09);
  transition: background var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.fgbox:hover, .fgbox[aria-current="true"] { background: rgba(47,62,158,.20); box-shadow: 0 0 0 3px var(--accent-soft); }
.fgbox[data-mapped="false"] { border-color: var(--conf-lo); background: rgba(168,31,42,.10); border-style: dashed; }
.fgbox[data-mapped="false"]:hover { background: rgba(168,31,42,.20); }
.fgbox__tag {
  position: absolute; top: -15px; left: -1px;
  font-family: var(--font-mono); font-size: 8px; font-weight: 500;
  background: var(--accent); color: #fff; padding: 1px 4px; border-radius: 2px 2px 0 0;
  white-space: nowrap;
}
.fgbox[data-mapped="false"] .fgbox__tag { background: var(--conf-lo); }

/* scan texture for the "scanned raster" document */
.paper--scan .paper__inner { filter: contrast(1.02); }
.paper--scan::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 2px;
  background: linear-gradient(103deg, rgba(120,105,80,.07) 0%, transparent 22%, transparent 78%, rgba(120,105,80,.09) 100%);
  mix-blend-mode: multiply;
}

/* ==========================================================================
   mapping row (studio)
   ========================================================================== */

.maprow {
  display: grid; grid-template-columns: 1fr 20px 1fr auto; gap: var(--s3);
  align-items: center; padding: 9px var(--s4);
  border-bottom: var(--hair) solid var(--line-soft); cursor: pointer;
  transition: background var(--d-fast) var(--e-out);
}
.maprow:hover { background: var(--surface-2); }
.maprow[aria-current="true"] { background: var(--accent-soft); }
.maprow__arrow { color: var(--text-4); display: grid; place-items: center; }
.maprow__q { font-size: var(--t-sm); line-height: 1.4; }
.maprow__slot { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--accent); }
.maprow__slot--none { color: var(--conf-lo); }

/* ==========================================================================
   ledger slots
   ========================================================================== */

.slot {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s4);
  padding: 11px var(--s4); border-bottom: var(--hair) solid var(--line-soft);
  transition: background var(--d-fast) var(--e-out);
}
.slot:hover { background: var(--surface-2); }
.slot:last-child { border-bottom: none; }
.slot__key { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-4); }
.slot__val { font-size: var(--t-base); font-weight: 500; margin-top: 2px; }
.slot__val em { font-family: var(--font-mono); font-style: normal; font-weight: 400; color: var(--text-3); font-size: var(--t-sm); }
.slot__meta { display: flex; gap: var(--s3); font-family: var(--font-mono); font-size: 10px; color: var(--text-4); margin-top: 4px; flex-wrap: wrap; }
.slot--conflict { background: var(--conf-md-bg); }
.slot--conflict:hover { background: var(--conf-md-bg); }

/* ==========================================================================
   rule results (assurance)
   ========================================================================== */

.rule {
  display: grid; grid-template-columns: 20px 1fr auto; gap: var(--s3);
  padding: 11px var(--s4); border-bottom: var(--hair) solid var(--line-soft);
  align-items: start;
}
.rule:last-child { border-bottom: none; }
.rule__icon { margin-top: 1px; }
.rule__icon[data-tone="pass"] { color: var(--conf-hi); }
.rule__icon[data-tone="warn"] { color: var(--conf-md); }
.rule__icon[data-tone="fail"] { color: var(--conf-lo); }
.rule__name { font-size: var(--t-base); font-weight: 500; }
.rule__id { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }
.rule__msg { font-size: var(--t-sm); color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.rule__expr {
  font-family: var(--font-mono); font-size: var(--t-xs); color: var(--text-2);
  background: var(--surface-3); border: var(--hair) solid var(--line-soft);
  padding: 5px 8px; border-radius: var(--r-sm); margin-top: 6px;
  display: block; overflow-x: auto; white-space: pre;
}

/* ==========================================================================
   charts (inline SVG, hand-authored — no library)
   ========================================================================== */

.chart { width: 100%; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 9px; fill: var(--text-4); }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .series--hi { stroke: var(--conf-hi); }
.chart .series--md { stroke: var(--conf-md); }
.chart .series--ink { stroke: var(--text-3); stroke-dasharray: 3 3; }
.chart .area { fill: var(--accent); opacity: .08; }
.chart .bar { fill: var(--accent); }
.chart .bar--hi { fill: var(--conf-hi); }
.chart .bar--md { fill: var(--conf-md); }
.chart .bar--lo { fill: var(--conf-lo); }
.chart .bar--ink { fill: var(--ink-400); }
.chart .ref-line { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .ideal { stroke: var(--text-4); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }

.chart-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 900ms var(--e-out) 120ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: var(--t-xs); color: var(--text-3); }
.chart-legend i { width: 10px; height: 2px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 5px; }

/* ==========================================================================
   annotation callout — pitch narration, visible only on demo screens
   ========================================================================== */

.note {
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  padding: var(--s3) var(--s4);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: var(--t-sm); line-height: 1.6; color: var(--text-2);
}
.note b { color: var(--text); font-weight: 600; }
.note__tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 3px;
}

/* ==========================================================================
   staggered page-load reveal — one orchestrated moment per screen
   ========================================================================== */

.reveal > * { animation: rise 480ms var(--e-out) both; }
.reveal > *:nth-child(1) { animation-delay: 20ms; }
.reveal > *:nth-child(2) { animation-delay: 70ms; }
.reveal > *:nth-child(3) { animation-delay: 120ms; }
.reveal > *:nth-child(4) { animation-delay: 170ms; }
.reveal > *:nth-child(5) { animation-delay: 220ms; }
.reveal > *:nth-child(6) { animation-delay: 270ms; }
.reveal > *:nth-child(7) { animation-delay: 320ms; }
.reveal > *:nth-child(8) { animation-delay: 370ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   toast
   ========================================================================== */

.toasts {
  position: fixed; bottom: var(--s5); right: var(--s5); z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--s2); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s4); min-width: 240px;
  background: var(--ink-800); color: #fff;
  border-radius: var(--r); box-shadow: var(--sh-3);
  font-size: var(--t-base);
  animation: toastIn 260ms var(--e-out) both;
}
[data-chrome="dark"] .toast { background: var(--surface-3); border: var(--hair) solid var(--line-strong); }
.toast svg { flex: none; color: var(--conf-hi); }
[data-chrome="dark"] .toast svg { color: #58C4B2; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   modal
   ========================================================================== */

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: var(--s5);
  background: rgba(16,19,24,.5); backdrop-filter: blur(2px);
  animation: fade 180ms var(--e-out) both;
}
.modal__card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); width: min(560px, 100%); max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: rise 240ms var(--e-out) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* keyboard cheatsheet grid inside the modal */
.keys { display: grid; grid-template-columns: 96px 1fr; gap: 9px var(--s4); align-items: center; }
.keys dt { display: flex; gap: 3px; justify-content: flex-end; }
.keys dd { font-size: var(--t-base); color: var(--text-2); }

/* ==========================================================================
   utilities
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hr { height: 1px; background: var(--line-soft); border: none; }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 1360px) {
  .console { grid-template-columns: 62px minmax(0,1fr) 356px; }
  .grid--5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .console { grid-template-columns: 52px minmax(0,1fr) 330px; }
  .hero { grid-template-columns: 1fr; gap: var(--s5); }
}

@media (max-width: 1024px) {
  :root { --rail-w: 0px; }
  .rail { width: 232px; transform: translateX(-100%); box-shadow: var(--sh-3); }
  .rail[data-open="true"] { transform: none; }
  .main { margin-left: 0; }
  .railtoggle { display: inline-flex; }
  .drawer { left: 0; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--aside, .grid--aside-l { grid-template-columns: minmax(0,1fr); }
  .console { grid-template-columns: 1fr; }
  .pagerail {
    flex-direction: row; border-right: none;
    border-bottom: var(--hair) solid var(--line);
    padding: var(--s2) var(--s3); overflow-x: auto;
  }
  .inspector { border-left: none; border-top: var(--hair) solid var(--line); }
  .docview { max-height: 58vh; }
  /* scrim behind the open rail */
  .rail[data-open="true"] + .main::before {
    content: ''; position: fixed; inset: 0; z-index: 35; background: rgba(16,19,24,.4);
  }
}

@media (max-width: 760px) {
  :root { --t-3xl: 30px; --t-4xl: 40px; }
  .page { padding: var(--s4); }
  .grid--2, .grid--3, .grid--4, .grid--5 { grid-template-columns: minmax(0,1fr); }
  .paper__inner { padding: 24px 20px; }
  .topbar { padding: 0 var(--s4); }
  .topbar__crumbs { display: none; }
  .factor { grid-template-columns: 86px 1fr 34px; }
  .drawer { max-height: 60vh; }
  .maprow { grid-template-columns: 1fr; gap: var(--s2); }
  .maprow__arrow { display: none; }
  .hero { padding: var(--s5); }
  /* header controls stack full-width rather than fighting for one row */
  .panel__head-actions { margin-left: 0; width: 100%; }
  .panel__head-actions .search,
  .panel__head-actions .input { width: 100% !important; flex: 1 1 160px; }
  .btngroup { flex: 1 1 auto; }
  .btngroup .btn { flex: 1; }
  body { font-size: var(--t-md); }
  .input, .select, .textarea, .btn { min-height: 40px; }
  .btn { height: 40px; }
  .btn--sm { height: 32px; }
}

/* ==========================================================================
   reduced motion — full opt-out
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .chart-draw { stroke-dashoffset: 0; }
  .meter__fill { animation: none; }
}

/* ==========================================================================
   print
   ========================================================================== */

@media print {
  .rail, .topbar, .inspector, .pagerail, .drawer, .toasts { display: none !important; }
  .main { margin-left: 0; }
  .docview { padding: 0; background: none; overflow: visible; }
  .paper { box-shadow: none; border: none; }
  .pfield { background: none !important; box-shadow: none !important; border-bottom: 1px solid #999; }
}

/* ==========================================================================
   ==========================================================================
   LANDING PAGE — cinematic, dark, self-contained.
   A marketing surface, not an operator tool: it carries its own dark palette
   independent of the app chrome toggle, and it is allowed to be bold.
   Scoped under .lander so none of it can leak into the console screens.
   ==========================================================================
   ========================================================================== */

.lander {
  --lbg:      #070A0F;
  --lbg-2:    #0B0F16;
  --lsurf:    #10151E;
  --lsurf-2:  #151B26;
  --lline:    rgba(255,255,255,.09);
  --lline-2:  rgba(255,255,255,.14);
  --ltext:    #F3F6FA;
  --ltext-2:  #AEB7C6;
  --ltext-3:  #727C8C;
  --lb1: #17C3AC;   /* brighter on dark than the app brand tokens */
  --lb2: #2E86E6;
  --lb3: #5B6EF0;

  background: var(--lbg);
  color: var(--ltext);
  font-family: var(--font-ui);
  overflow-x: hidden;
  line-height: 1.6;
}
.lander ::selection { background: rgba(23,195,172,.28); color: #fff; }

/* --- atmosphere: fixed mesh + grid behind everything -------------------- */
.lbg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lbg::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(760px 520px at 78% -4%, rgba(23,195,172,.20), transparent 60%),
    radial-gradient(720px 560px at 12% 8%, rgba(46,134,230,.16), transparent 58%),
    radial-gradient(900px 700px at 90% 100%, rgba(91,110,240,.12), transparent 60%);
}
.lbg::after {
  content: ''; position: absolute; inset: -2px;
  background:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px) 0 0 / 46px 100%;
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
}
/* drifting particles layer */
.lbg__dots {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(23,195,172,.9), transparent),
    radial-gradient(1.4px 1.4px at 68% 18%, rgba(46,134,230,.8), transparent),
    radial-gradient(1.2px 1.2px at 44% 62%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.6px 1.6px at 85% 48%, rgba(91,110,240,.7), transparent),
    radial-gradient(1.2px 1.2px at 12% 78%, rgba(23,195,172,.6), transparent),
    radial-gradient(1.3px 1.3px at 72% 82%, rgba(255,255,255,.4), transparent);
  background-size: 100% 100%;
  animation: lfloat 24s ease-in-out infinite alternate;
}
@keyframes lfloat { from { transform: translateY(0); } to { transform: translateY(-24px); } }

.lander__wrap { position: relative; z-index: 1; overflow-x: clip; }
.lcontain { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* --- top nav ------------------------------------------------------------ */
.lnav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7,10,15,.68);
  border-bottom: 1px solid var(--lline);
}
.lnav__in { display: flex; align-items: center; gap: 20px; height: 66px; }
.lnav__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.lnav__glyph {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: linear-gradient(135deg, var(--lb1), var(--lb3)); color: #fff;
  box-shadow: 0 4px 16px rgba(23,195,172,.35);
}
.lnav__name { font-family: var(--font-display); font-size: 23px; line-height: 1; }
.lnav__links { display: flex; gap: 6px; margin-left: 18px; }
.lnav__links a {
  color: var(--ltext-2); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 7px; transition: color var(--d-fast), background var(--d-fast);
}
.lnav__links a:hover { color: #fff; background: rgba(255,255,255,.05); }
.lnav__spacer { flex: 1; }

.lbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 9px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; border: 1px solid transparent;
  transition: transform var(--d-fast) var(--e-out), box-shadow var(--d-base), background var(--d-base);
}
.lbtn svg { flex: none; }
.lbtn--primary {
  color: #04120F; background: linear-gradient(135deg, var(--lb1), var(--lb2));
  box-shadow: 0 6px 22px rgba(23,195,172,.34), inset 0 1px 0 rgba(255,255,255,.3);
}
.lbtn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(23,195,172,.44), inset 0 1px 0 rgba(255,255,255,.3); }
.lbtn--ghost { color: var(--ltext); background: rgba(255,255,255,.04); border-color: var(--lline-2); }
.lbtn--ghost:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.lbtn--lg { height: 52px; padding: 0 28px; font-size: 15.5px; border-radius: 11px; }
.lbtn--sm { height: 36px; padding: 0 15px; font-size: 13px; }

/* --- generic section rhythm -------------------------------------------- */
.lsec { padding: 96px 0; position: relative; }
.lsec--tight { padding: 64px 0; }
.leyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--lb1);
  padding: 6px 12px; border-radius: 40px;
  background: rgba(23,195,172,.09); border: 1px solid rgba(23,195,172,.22);
}
.lsec__head { max-width: 720px; margin-bottom: 52px; }
.lsec__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -.015em;
  margin-top: 20px;
}
.lsec__sub { font-size: 17px; color: var(--ltext-2); margin-top: 18px; max-width: 62ch; }
.ltx-grad {
  background: linear-gradient(105deg, var(--lb1), var(--lb2) 55%, var(--lb3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --- hero --------------------------------------------------------------- */
.lhero { padding: 84px 0 72px; }
.lhero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.lhero__eyebrow { margin-bottom: 26px; }
.lhero__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(40px, 6.4vw, 78px); line-height: .99; letter-spacing: -.02em;
}
.lhero__sub { font-size: clamp(16px, 1.5vw, 19px); color: var(--ltext-2); margin-top: 26px; max-width: 54ch; }
.lhero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.lhero__trust { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--lline); }
.lstat__v { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.lstat__v small { font-family: var(--font-mono); font-size: 15px; color: var(--lb1); }
.lstat__l { font-size: 12.5px; color: var(--ltext-3); margin-top: 6px; }

.reveal-up { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--e-out), transform .7s var(--e-out); }
.reveal-up.in { opacity: 1; transform: none; }

/* --- hero device: a form filling itself -------------------------------- */
.ldevice {
  position: relative; border-radius: 16px; padding: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
  border: 1px solid var(--lline-2);
  box-shadow: 0 40px 90px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.ldevice__glow {
  position: absolute; inset: -30% 0 auto; height: 60%; z-index: -1;
  background: radial-gradient(circle, rgba(23,195,172,.4), transparent 68%);
  filter: blur(30px);
}
.ldevice__bar { display: flex; align-items: center; gap: 7px; padding: 4px 6px 12px; }
.ldevice__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.16); }
.ldevice__title { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ltext-3); }
.ldevice__paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 9px; padding: 22px 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.ldevice__ph { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-ink-2); }
.ldevice__ttl { font-size: 14px; font-weight: 700; letter-spacing: -.01em; margin: 3px 0 14px; }
.lfrow { margin-bottom: 13px; }
.lfrow__q { font-size: 11px; color: var(--paper-ink-2); margin-bottom: 5px; }
.lfrow__f {
  position: relative; min-height: 26px; border-radius: 5px 5px 0 0;
  border-bottom: 1.5px solid var(--paper-rule); padding: 4px 8px;
  font-size: 12.5px; overflow: hidden;
}
.lfrow__f .lfill {
  display: inline-block; white-space: nowrap; overflow: hidden;
  border-right: 2px solid transparent;
}
.lfrow__badge {
  position: absolute; right: 6px; top: 5px; opacity: 0;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px; transition: opacity .3s;
}
.lfrow.done .lfrow__f { animation: lfieldfill .5s var(--e-out) forwards; }
.lfrow.done .lfill { animation: ltype .6s steps(24) forwards; }
.lfrow.done .lfrow__badge { animation: lbadge .3s .5s forwards; }
.lfrow--hi.done .lfrow__f { background: rgba(11,110,98,.10); box-shadow: inset 0 -2px 0 var(--conf-hi); }
.lfrow--hi .lfrow__badge { color: var(--conf-hi); background: rgba(11,110,98,.14); }
.lfrow--md.done .lfrow__f { background: rgba(154,91,8,.12); box-shadow: inset 0 -2px 0 var(--conf-md); }
.lfrow--md .lfrow__badge { color: var(--conf-md); background: rgba(154,91,8,.16); }
@keyframes lfieldfill { from { background: transparent; } }
@keyframes ltype { from { max-width: 0; } to { max-width: 100%; } }
@keyframes lbadge { to { opacity: 1; } }

.ldevice__foot {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  padding: 10px 12px; border-radius: 9px;
  background: rgba(23,195,172,.10); border: 1px solid rgba(23,195,172,.22);
  font-size: 12px; color: var(--lb1); font-weight: 500;
  opacity: 0; animation: lbadge .4s 3.4s forwards;
}
/* floating provenance chip */
.lchip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 11px;
  background: rgba(16,21,30,.92); border: 1px solid var(--lline-2);
  box-shadow: 0 14px 34px rgba(0,0,0,.5); backdrop-filter: blur(8px);
  font-size: 12px; color: var(--ltext); animation: lchipfloat 5s ease-in-out infinite alternate;
}
.lchip__ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--lb1), var(--lb3)); color: #fff; }
.lchip small { display: block; color: var(--ltext-3); font-family: var(--font-mono); font-size: 10px; }
.lchip--tr { top: 18%; right: -34px; }
.lchip--bl { bottom: 14%; left: -30px; animation-delay: -2.5s; }
@keyframes lchipfloat { from { transform: translateY(-6px); } to { transform: translateY(8px); } }

/* --- logo / trust strip ------------------------------------------------- */
.lstrip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 40px;
  padding: 26px 0; border-top: 1px solid var(--lline); border-bottom: 1px solid var(--lline);
}
.lstrip__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ltext-3); }
.lstrip__item { display: flex; align-items: center; gap: 9px; color: var(--ltext-2); font-weight: 600; font-size: 14px; }
.lstrip__item svg { color: var(--lb1); }

/* --- pillars ------------------------------------------------------------ */
.lgrid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lcard {
  position: relative; padding: 30px 26px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(165deg, var(--lsurf), var(--lsurf-2));
  border: 1px solid var(--lline);
  transition: transform var(--d-base) var(--e-out), border-color var(--d-base), box-shadow var(--d-base);
}
.lcard:hover { transform: translateY(-5px); border-color: var(--lline-2); box-shadow: 0 24px 50px rgba(0,0,0,.4); }
.lcard::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--lb1), var(--lb3)); opacity: 0;
  transition: opacity var(--d-base);
}
.lcard:hover::before { opacity: 1; }
.lcard__ic {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(23,195,172,.16), rgba(91,110,240,.12));
  border: 1px solid var(--lline-2); color: var(--lb1); margin-bottom: 20px;
}
.lcard__n { font-family: var(--font-mono); font-size: 11px; color: var(--ltext-3); letter-spacing: .1em; }
.lcard__t { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 8px 0 12px; }
.lcard__b { font-size: 14.5px; color: var(--ltext-2); line-height: 1.62; }
.lcard__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--lb1); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.lcard__link:hover { gap: 10px; }

/* --- pipeline ribbon ---------------------------------------------------- */
.lpipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.lpipe__step { padding: 24px 20px; position: relative; }
.lpipe__step:not(:last-child)::after {
  content: ''; position: absolute; top: 46px; right: -1px; width: 1px; bottom: 20px;
  background: var(--lline);
}
.lpipe__n {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; margin-bottom: 16px;
  background: rgba(255,255,255,.04); border: 1px solid var(--lline-2); color: var(--lb1);
}
.lpipe__t { font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.lpipe__b { font-size: 13px; color: var(--ltext-3); line-height: 1.55; }

/* --- split feature ------------------------------------------------------ */
.lsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.lsplit__list { margin-top: 26px; display: grid; gap: 16px; }
.lfeat { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; }
.lfeat__ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(23,195,172,.12); color: var(--lb1); flex: none; margin-top: 2px; }
.lfeat__t { font-weight: 600; font-size: 15px; }
.lfeat__b { font-size: 13.5px; color: var(--ltext-2); margin-top: 3px; line-height: 1.55; }

/* the ledger visual */
.lledger {
  border-radius: 16px; padding: 26px; background: linear-gradient(165deg, var(--lsurf), var(--lsurf-2));
  border: 1px solid var(--lline); box-shadow: 0 30px 70px rgba(0,0,0,.4);
}
.lledger__hub {
  text-align: center; padding: 16px; border-radius: 12px; margin: 0 auto 18px; max-width: 300px;
  background: linear-gradient(135deg, rgba(23,195,172,.16), rgba(91,110,240,.12));
  border: 1px solid rgba(23,195,172,.3);
}
.lledger__hub .mono { color: var(--lb1); font-size: 11px; }
.lledger__hub b { display: block; font-family: var(--font-display); font-size: 24px; margin-top: 4px; color: #fff; }
.lledger__forms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lledger__form {
  padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.03);
  border: 1px solid var(--lline); font-size: 13px;
}
.lledger__form .mono { color: var(--ltext-3); font-size: 11px; display: block; margin-top: 3px; }

/* --- metrics band ------------------------------------------------------- */
.lband {
  border-radius: 20px; padding: 52px 40px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(23,195,172,.1), rgba(46,134,230,.08));
  border: 1px solid var(--lline-2);
}
.lband__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.lband__v { font-family: var(--font-display); font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -.02em; }
.lband__v small { font-family: var(--font-mono); font-size: 18px; color: var(--lb1); letter-spacing: -.02em; }
.lband__l { font-size: 13.5px; color: var(--ltext-2); margin-top: 10px; }

/* --- security ----------------------------------------------------------- */
.lshield {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.lsi { padding: 22px; border-radius: 13px; background: var(--lsurf); border: 1px solid var(--lline); }
.lsi__ic { color: var(--lb1); margin-bottom: 13px; }
.lsi__t { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.lsi__b { font-size: 12.5px; color: var(--ltext-3); line-height: 1.55; }

/* --- final CTA ---------------------------------------------------------- */
.lcta {
  text-align: center; border-radius: 22px; padding: 72px 40px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--lsurf), var(--lbg-2));
  border: 1px solid var(--lline-2);
}
.lcta::before {
  content: ''; position: absolute; inset: -40% 20% auto; height: 80%;
  background: radial-gradient(circle, rgba(23,195,172,.28), transparent 66%); filter: blur(20px);
}
.lcta__in { position: relative; }
.lcta__t { font-family: var(--font-display); font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -.02em; }
.lcta__cta { display: flex; gap: 14px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* --- footer ------------------------------------------------------------- */
.lfoot { border-top: 1px solid var(--lline); padding: 40px 0; }
.lfoot__in { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.lfoot__note { font-size: 12.5px; color: var(--ltext-3); }
.lfoot__phi { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--ltext-3); }
.lfoot__phi::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lb1); box-shadow: 0 0 0 3px rgba(23,195,172,.2); }

/* --- landing responsive ------------------------------------------------- */
@media (max-width: 940px) {
  .lhero__grid, .lsplit { grid-template-columns: 1fr; gap: 40px; }
  .lgrid-3 { grid-template-columns: 1fr; }
  .lpipe { grid-template-columns: 1fr 1fr; }
  .lpipe__step::after { display: none; }
  .lband__grid, .lshield { grid-template-columns: repeat(2, 1fr); }
  .lnav__links { display: none; }
  .lchip { display: none; }
}
@media (max-width: 620px) {
  /* keep only the primary CTA in the bar so the nav never overflows */
  .lnav__in .lbtn--ghost { display: none; }
}
@media (max-width: 560px) {
  .lcontain { padding: 0 20px; }
  .lsec { padding: 64px 0; }
  .lband__grid, .lshield, .lpipe { grid-template-columns: 1fr; }
  .lband { padding: 36px 24px; }
  .lhero__trust { gap: 22px; }
  .lhero__cta .lbtn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .lbg__dots, .lchip, .lfrow.done .lfrow__f, .lfrow.done .lfill, .lfrow.done .lfrow__badge, .ldevice__foot { animation: none !important; }
  .lfrow .lfill { max-width: 100% !important; }
  .lfrow .lfrow__badge, .ldevice__foot { opacity: 1 !important; }
  .reveal-up { opacity: 1; transform: none; }
}
