/* Kriya UI kit 02 — built from the paperwork of the trade:
   chromatograms, certificates of analysis, GMP warehouse labels, CTD dossiers, technical drawings, lab-notebook grid. */
:root {
  color-scheme: light;
  --paper: #f2f3f0;
  --sheet: #ffffff;
  --ink: #0f1214;
  --ink-2: #4a5157;
  --ink-3: #868e93;
  --rule: #d2d6d6;
  --rule-2: #e6e8e7;
  --grid: rgba(15, 18, 20, .05);
  --signal: #ff4d00;
  --signal-t: #c43a00;
  --signal-bg: #fff0e8;
  --graphite: #121518;
  --graphite-2: #1b1f23;
  --trace: #eef1f0;
  --ok: #127a3e; --ok-bg: #dcf1e3;
  --qt: #6b5000; --qt-bg: #ffe27a;
  --ts: #1e4c99; --ts-bg: #dde7f8;
  --rj: #b42318; --rj-bg: #fce0dc;
  --display: 'Archivo', system-ui, sans-serif;
  --text: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --out: cubic-bezier(.22, .8, .3, 1);
  --side: max(20px, calc((100vw - 1280px) / 2));
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
  font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
button, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
input { font: inherit; color: inherit; }
sub { font-size: .7em; line-height: 0; vertical-align: -.22em; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.ic { display: block; flex: none; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.lbl { font: 600 10.5px/1.2 var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- atoms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; height: 48px; padding: 0 16px 0 18px;
  border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--sheet);
  font: 500 15px/1 var(--text); letter-spacing: -.005em; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn .k { font: 400 13px/1 var(--mono); opacity: .7; }
.btn:hover { background: var(--signal); border-color: var(--signal); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; gap: 12px; }
.btn[disabled] { opacity: .3; pointer-events: none; }
.btn.on { background: var(--signal); border-color: var(--signal); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border: 1px solid currentColor; border-radius: 1px;
  font: 700 9.5px/1 var(--display); font-stretch: 118%; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap;
}
.tag::before { content: ''; width: 6px; height: 6px; background: currentColor; flex: none; }
.t-ok { color: var(--ok); background: var(--ok-bg); }
.t-qt { color: var(--qt); background: var(--qt-bg); }
.t-ts { color: var(--ts); background: var(--ts-bg); }
.t-rj { color: var(--rj); background: var(--rj-bg); }
.t-nil { color: var(--ink-3); background: transparent; border-style: dashed; }
.t-nil::before { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

.box { display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 0 6px; border: 1px solid var(--ink); border-radius: 1px; font: 600 11px/1 var(--display); font-stretch: 118%; letter-spacing: .08em; }
.box.off { border-color: var(--rule); color: var(--ink-3); border-style: dashed; }
.box.ink { background: var(--ink); color: var(--sheet); }

.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--sheet); }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; height: 34px; padding: 0 12px; font: 500 13.5px/1 var(--text); color: var(--ink-2); border-right: 1px solid var(--rule); transition: background .15s, color .15s; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--sheet); }
.seg button:not(.on):hover { background: var(--paper); color: var(--ink); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 15px; user-select: none; -webkit-user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 1px; display: grid; place-items: center; flex: none; background: var(--sheet); transition: background .15s; }
.check i::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--sheet); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked + i { background: var(--ink); }
.check input:checked + i::after { opacity: 1; }
.check input:focus-visible + i { outline: 2px solid var(--signal); outline-offset: 2px; }
.check input:disabled ~ * { opacity: .55; }

.field { display: flex; flex-direction: column; gap: 6px; }
.input, .select {
  height: 44px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); outline: 0; font: 400 15px/1 var(--text); width: 100%;
}
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { box-shadow: 0 0 0 3px var(--signal-bg), inset 0 0 0 1px var(--ink); }
.input:disabled, .select:disabled { background-color: var(--paper); color: var(--ink-2); }

.addbtn {
  width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 2px; display: grid; place-items: center; flex: none; background: var(--sheet);
  transition: background .15s, color .15s, border-color .15s;
}
.addbtn:hover { background: var(--ink); color: var(--sheet); }
.addbtn.on { background: var(--signal); border-color: var(--signal); color: var(--sheet); }

.ruler { height: 10px; background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 60px); background-size: 100% 5px, 100% 10px; background-repeat: no-repeat; }

/* ---------- header ---------- */
.hd {
  position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 20px; padding: 0 var(--side);
  background: rgba(242, 243, 240, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.hd.scrolled { border-bottom-color: var(--rule); }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; background: var(--signal); display: grid; place-items: center; border-radius: 2px; }
.logo-mark svg { width: 22px; height: 22px; }
.logo-t { font: 700 19px/1 var(--display); font-stretch: 125%; letter-spacing: .02em; display: flex; flex-direction: column; gap: 3px; }
.logo-t small { font: 500 8.5px/1 var(--mono); letter-spacing: .26em; color: var(--ink-2); }
.hd-nav { display: none; gap: 2px; }
.hd-nav a { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 14.5px; color: var(--ink-2); border-radius: 2px; }
.hd-nav a:hover { color: var(--ink); background: rgba(15, 18, 20, .05); }
.hd-tag { display: none; margin-left: auto; font: 500 11px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.hd-list { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 12px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); font: 500 14px/1 var(--text); transition: background .15s; }
.hd-list:hover { background: var(--paper); }
.hd-list b { min-width: 26px; height: 26px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--ink); color: var(--sheet); font: 500 13px/1 var(--mono); border-radius: 1px; transition: background .2s; }
.hd-list.has b { background: var(--signal); }
.hd-list.tick b { animation: tick .5s var(--ease); }
@media (min-width: 980px) { .hd-nav { display: flex; margin-left: 20px; } .hd-tag { display: block; } .hd-list { margin-left: 0; } }
@media (max-width: 420px) { .hd-list .t { display: none; } }

/* scroll gauge: a graduated cylinder down the right edge that fills as you read */
.gauge { display: none; position: fixed; z-index: 30; right: 14px; top: 50%; height: 46vh; width: 30px; transform: translateY(-50%); pointer-events: none; }
.gauge::before { content: 'mL'; position: absolute; top: -20px; left: 0; font: 500 10px var(--mono); color: var(--ink-3); }
.gauge-tube { position: absolute; left: 0; top: 0; bottom: 0; width: 12px; border: 1px solid var(--ink); border-top: 0; border-radius: 0 0 6px 6px; overflow: hidden; background: rgba(255, 255, 255, .6); }
.gauge-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(255, 77, 0, .75); }
.gauge-fill::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 6px; border-radius: 50%; background: rgba(255, 77, 0, .9); }
.gauge-ticks { position: absolute; left: 14px; top: 0; bottom: 0; width: 8px; background-image: repeating-linear-gradient(0deg, var(--ink) 0 1px, transparent 1px 10%), repeating-linear-gradient(0deg, var(--ink-3) 0 1px, transparent 1px 2%); background-size: 8px 100%, 4px 100%; background-repeat: no-repeat; }
@media (min-width: 1200px) { .gauge { display: block; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 26px; }
.hero-l { display: flex; flex-direction: column; }
.kicker { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
.kicker span::before { content: '■ '; color: var(--signal); }
.h1 { font: 600 clamp(68px, 12vw, 176px)/.84 var(--display); font-stretch: 112%; letter-spacing: -.05em; margin-top: 22px; }
.h1 .o { color: var(--signal); }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 29em; margin-top: 26px; line-height: 1.45; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: auto; padding-top: 34px; }
.hero-meta div { border-top: 1px solid var(--ink); padding: 10px 0 0; }
.hero-meta div + div { padding-left: 14px; }
.hero-meta dt { font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.hero-meta dd { font: 500 14px/1.35 var(--mono); margin-top: 4px; }
@media (min-width: 1040px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 40px; padding-top: 44px; } }

/* instrument panel (HPLC) */
.inst { position: relative; display: flex; flex-direction: column; min-height: 500px; background: var(--graphite); color: var(--trace); border-radius: 2px; overflow: hidden; }
.inst-hd { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); font: 400 11.5px/1.3 var(--mono); color: rgba(238, 241, 240, .55); }
.inst-hd b { color: var(--trace); font-weight: 500; }
.inst-hd .sp { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(255, 77, 0, .22); animation: led 1.4s steps(2) infinite; flex: none; }
.inst-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid rgba(255, 255, 255, .1); }
.inst-tabs button { padding: 10px 14px 9px; text-align: left; border-right: 1px solid rgba(255, 255, 255, .1); color: rgba(238, 241, 240, .5); font: 500 14px/1.2 var(--text); transition: background .2s, color .2s; min-width: 0; }
.inst-tabs button:last-child { border-right: 0; }
.inst-tabs button small { display: block; font: 400 10.5px/1.4 var(--mono); color: rgba(238, 241, 240, .38); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-tabs button.on { background: var(--graphite-2); color: #fff; box-shadow: inset 0 -2px 0 var(--signal); }
.inst-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px 0; font: 400 10.5px var(--mono); color: rgba(238, 241, 240, .45); }
.inst-bar .seg { border-color: rgba(255, 255, 255, .25); background: transparent; }
.inst-bar .seg button { height: 26px; font: 400 11px/1 var(--mono); color: rgba(238, 241, 240, .6); border-right-color: rgba(255, 255, 255, .15); padding: 0 9px; }
.inst-bar .seg button.on { background: var(--trace); color: var(--graphite); }
.plot { position: relative; flex: 1; min-height: 270px; touch-action: pan-y; cursor: crosshair; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plot .ax { font: 400 10px var(--mono); fill: rgba(238, 241, 240, .42); }
.plot .pk-l { font: 500 10.5px var(--mono); fill: var(--trace); }
.plot .pk-l.main { fill: var(--signal); }
.peek { position: absolute; top: 10px; left: 0; pointer-events: none; transform: translateX(-50%); background: var(--trace); color: var(--graphite); padding: 7px 10px; border-radius: 2px; font: 400 11px/1.45 var(--mono); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.peek b { display: block; font: 600 12.5px/1.3 var(--text); }
.peek.on { opacity: 1; }
.inst-ro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, .1); }
.ro { padding: 10px 14px 12px; border-right: 1px solid rgba(255, 255, 255, .1); border-top: 1px solid rgba(255, 255, 255, .1); min-width: 0; }
.ro small { display: block; font: 600 9.5px/1.2 var(--display); font-stretch: 125%; letter-spacing: .14em; color: rgba(238, 241, 240, .42); text-transform: uppercase; }
.ro b { display: block; font: 300 28px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 3px; white-space: nowrap; }
.ro b em { font: 400 11.5px var(--mono); font-style: normal; color: rgba(238, 241, 240, .45); margin-left: 4px; letter-spacing: 0; }
.ro .tag { margin-top: 7px; }
@media (min-width: 640px) { .inst-ro { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ro { border-top: 0; } .ro:last-child { border-right: 0; } }

/* readout strip */
.strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 44px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--sheet); }
.strip > div { padding: 16px 16px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.strip > div:nth-child(2n) { border-right: 0; }
.strip > div:nth-child(n+3) { border-bottom: 0; }
.strip b { display: block; font: 200 clamp(46px, 6.5vw, 92px)/1 var(--display); font-stretch: 100%; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.strip span { display: block; font: 500 12px/1.4 var(--mono); color: var(--ink-2); margin-top: 8px; }
.strip-note { font: 400 11.5px var(--mono); color: var(--ink-3); margin-top: 8px; }
@media (min-width: 900px) {
  .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .strip > div { border-bottom: 0; }
  .strip > div:nth-child(2n) { border-right: 1px solid var(--rule); }
  .strip > div:last-child { border-right: 0; }
}

/* contents, like a monograph index */
.toc { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 48px; }
.toc h2 { grid-column: 1 / -1; margin-bottom: 8px; }
.toc a { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.toc a::after { content: ''; order: 2; flex: 1; border-bottom: 1px dotted var(--ink-3); transform: translateY(-4px); }
.toc a .n { order: 0; font: 500 12px var(--mono); color: var(--signal-t); width: 34px; flex: none; }
.toc a .t { order: 1; }
.toc a .p { order: 3; font: 400 12px var(--mono); color: var(--ink-3); }
.toc a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 760px) { .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .toc { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- section frame ---------- */
.sec { margin-top: clamp(100px, 12vw, 168px); }
.sh { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 22px; margin-bottom: 30px; border-top: 1px solid var(--ink); }
.sh::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 60px); background-size: 100% 4px, 100% 9px; background-repeat: no-repeat; }
.sh-no { display: flex; justify-content: space-between; gap: 10px; font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
.sh-no b { color: var(--signal-t); font-weight: 500; }
.sh h2 { font: 600 clamp(38px, 5.6vw, 76px)/.94 var(--display); font-stretch: 108%; letter-spacing: -.04em; text-wrap: balance; }
.sh p { font-size: 17px; color: var(--ink-2); max-width: 34em; line-height: 1.45; }
@media (min-width: 1000px) {
  .sh { grid-template-columns: 170px minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 32px; align-items: end; }
  .sh-no { flex-direction: column; align-self: start; padding-top: 8px; }
}
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; }
.note { font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 12px; }
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--out), transform .7s var(--out); }
.rv.in { opacity: 1; transform: none; }

/* ---------- §00 foundations ---------- */
.fd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.fd-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.swc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--sheet); }
.sw { display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; padding: 12px; text-align: left; background: var(--c); color: var(--on, var(--ink)); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); transition: filter .15s; }
.sw:hover { filter: brightness(.97); }
.sw b { font: 600 15px/1.2 var(--display); font-stretch: 112%; }
.sw small { display: block; font-size: 12.5px; opacity: .75; margin-top: 2px; }
.sw code { font: 400 11.5px var(--mono); opacity: .8; }
.gmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--rule); background: var(--sheet); }
.glabel { position: relative; padding: 10px 10px 8px; background: var(--bg); color: var(--fg); border: 1.5px solid var(--fg); font: 400 10.5px/1.25 var(--mono); }
.glabel h4 { font: 800 clamp(12.5px, 3.4vw, 17px)/1 var(--display); overflow-wrap: anywhere; font-stretch: 125%; letter-spacing: .04em; padding-bottom: 7px; margin-bottom: 6px; border-bottom: 1.5px solid var(--fg); }
.glabel dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; }
.glabel dt { opacity: .7; }
.glabel dd { border-bottom: 1px dotted currentColor; min-height: 1.2em; }
.gmp-cap { grid-column: 1 / -1; font: 400 12px/1.4 var(--mono); color: var(--ink-2); }
.types { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--rule); background: var(--sheet); }
.type { padding: 16px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.type:last-child { border-bottom: 0; }
.type-k { display: flex; justify-content: space-between; gap: 10px; }
.type-a { font: 600 64px/.9 var(--display); letter-spacing: -.04em; display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.type-a span:nth-child(1) { font-stretch: 70%; }
.type-a span:nth-child(2) { font-stretch: 100%; }
.type-a span:nth-child(3) { font-stretch: 125%; }
.type-b { font: 400 22px/1.3 var(--text); letter-spacing: -.01em; }
.type-c { font: 400 24px/1.2 var(--mono); letter-spacing: -.02em; }
.type > p:last-child { font-size: 14px; color: var(--ink-2); }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--sheet); }
.dt { padding: 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; min-height: 150px; }
.dt p { font-size: 13.5px; color: var(--ink-2); margin-top: auto; }
.chamf { width: 70px; height: 48px; background: var(--ink); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.hair { display: grid; gap: 6px; }
.hair i { display: block; height: 1px; background: var(--ink); }
.hair i:nth-child(2) { background: var(--rule); }
.hair i:nth-child(3) { height: 0; border-top: 1px dotted var(--ink-3); }
.mot { position: relative; height: 32px; border: 1px solid var(--ink); cursor: pointer; overflow: hidden; width: 100%; }
.mot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mot path.base { stroke: var(--rule); stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
.mot path { stroke: var(--signal); stroke-width: 1.5; fill: none; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 1.2s var(--ease); }
.mot.go path { stroke-dashoffset: 0; }
@media (min-width: 900px) {
  .fd-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .swc { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type { border-bottom: 0; border-right: 1px solid var(--rule); }
  .type:last-child { border-right: 0; }
  .details { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dt { border-bottom: 0; }
}

/* ---------- §01 lookup ---------- */
.lk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lk-in { padding: 18px; }
.lk-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cas { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.cas input {
  height: 64px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); outline: 0; text-align: center;
  font: 400 clamp(22px, 3.2vw, 34px)/1 var(--mono); letter-spacing: .06em; min-width: 0; padding: 0 6px;
}
.cas input:focus { box-shadow: 0 0 0 3px var(--signal-bg), inset 0 0 0 1px var(--ink); }
.cas .c1 { flex: 7 1 0; }
.cas .c2 { flex: 2.4 1 0; }
.cas .c3 { flex: 1.4 1 0; }
.cas.ok .c3 { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.cas.bad .c3 { background: var(--rj-bg); border-color: var(--rj); color: var(--rj); }
.cas span { font: 400 26px var(--mono); color: var(--ink-3); }
.txt-in { margin-top: 18px; height: 64px; font: 400 clamp(20px, 2.6vw, 28px)/1 var(--text); letter-spacing: -.01em; padding: 0 16px; }
.chk { margin-top: 14px; padding: 12px; border: 1px dashed var(--rule); border-radius: 2px; background: var(--paper); overflow-x: auto; scrollbar-width: none; }
.chk::-webkit-scrollbar { display: none; }
.chk-row { display: flex; align-items: flex-end; gap: 4px; min-width: max-content; }
.chk-d { display: flex; flex-direction: column; align-items: center; gap: 3px; font: 400 15px/1 var(--mono); }
.chk-d b { width: 24px; height: 28px; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--rule); font-weight: 500; }
.chk-d small { font-size: 10px; color: var(--ink-3); }
.chk-op { font: 400 13px var(--mono); color: var(--ink-3); padding: 0 4px 18px; }
.chk-res { font: 500 15px/1 var(--mono); padding: 0 0 22px 8px; white-space: nowrap; }
.chk-res.ok { color: var(--ok); }
.chk-res.bad { color: var(--rj); }
.chk-msg { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chk-msg b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.reg { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.reg th { text-align: left; font: 600 9.5px/1.2 var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.reg td { padding: 8px 10px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.reg tbody tr { cursor: pointer; transition: background .12s; animation: fadein .35s var(--out) both; }
.reg tbody tr:hover { background: #fafaf8; }
.reg tbody tr.sel { background: var(--signal-bg); }
.reg .st { width: 64px; padding: 4px 6px; }
.reg .st svg { width: 64px; height: 46px; display: block; }
.reg .nm b { display: block; font-weight: 500; letter-spacing: -.01em; }
.reg .nm small { display: block; color: var(--ink-3); font-size: 12.5px; }
.reg .cs, .reg .mw { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.reg .fm { white-space: nowrap; }
.reg .mw { text-align: right; }
.reg .hide-s { display: none; }
.reg mark { background: var(--qt-bg); color: inherit; padding: 0 1px; }
.reg-wrap { overflow-x: auto; }
.reg-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; font: 400 12px var(--mono); color: var(--ink-3); }
.empty { padding: 32px 16px; text-align: center; color: var(--ink-2); }
.empty b { display: block; font: 600 20px var(--display); font-stretch: 108%; color: var(--ink); margin-bottom: 4px; }
@media (min-width: 760px) { .reg .hide-s { display: table-cell; } }

/* ---------- §02 monograph ---------- */
.mono-g { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--rule); background: var(--sheet); }
.mg-idx { border-bottom: 1px solid var(--rule); padding: 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.mg-idx::-webkit-scrollbar { display: none; }
.mg-idx button { flex: none; text-align: left; padding: 7px 10px; font-size: 14px; border-radius: 2px; color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.mg-idx button:hover { color: var(--ink); background: var(--paper); }
.mg-idx button.on { border-color: var(--ink); color: var(--ink); background: var(--sheet); }
.mg-idx button small { font: 400 10.5px var(--mono); color: var(--ink-3); margin-left: 6px; }
.mg-fig { position: relative; padding: 16px; border-bottom: 1px solid var(--rule); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.mg-fig svg.mol { display: block; width: 100%; height: 300px; }
.mg-fig figcaption { display: flex; justify-content: space-between; gap: 10px; font: 400 11.5px var(--mono); color: var(--ink-3); }
.mg-fig .corner { position: absolute; width: 12px; height: 12px; border-color: var(--ink); border-style: solid; }
.mg-fig .tl { left: 8px; top: 8px; border-width: 1px 0 0 1px; } .mg-fig .tr { right: 8px; top: 8px; border-width: 1px 1px 0 0; }
.mg-fig .bl { left: 8px; bottom: 8px; border-width: 0 0 1px 1px; } .mg-fig .br { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }
.mg-txt { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mg-k { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mg-txt h3 { font: 600 clamp(32px, 4vw, 48px)/.98 var(--display); font-stretch: 106%; letter-spacing: -.035em; overflow-wrap: anywhere; }
.mg-id { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 400 14px/1.5 var(--mono); }
.mg-id span { color: var(--ink-3); }
.copy { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); border-bottom: 1px dotted var(--ink-3); font: 400 12px var(--mono); }
.copy:hover { color: var(--signal-t); border-color: var(--signal-t); }
.mg-def { font-family: var(--text); font-size: 15px; color: var(--ink-2); border-left: 2px solid var(--signal); padding-left: 12px; }
.mg-def em { font-style: normal; color: var(--ink); }
.mg-sub { font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.grades { display: flex; gap: 5px; flex-wrap: wrap; }
.tests { width: 100%; border-collapse: collapse; font-size: 14px; }
.tests td { padding: 7px 0; border-top: 1px solid var(--rule-2); vertical-align: top; }
.tests td:nth-child(2) { font: 400 12px var(--mono); color: var(--ink-3); padding: 8px 10px; white-space: nowrap; }
.tests td:last-child { text-align: right; font: 400 13px var(--mono); white-space: nowrap; }
.filings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.filings div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 400 12.5px var(--mono); padding: 5px 0; border-top: 1px solid var(--rule-2); }
.mg-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@media (min-width: 1040px) {
  .mono-g { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.05fr); }
  .mg-idx { flex-direction: column; border-bottom: 0; border-right: 1px solid var(--rule); overflow-x: hidden; overflow-y: auto; max-height: 640px; scrollbar-width: thin; }
  .mono-g { align-items: start; }
  .mg-fig { align-self: stretch; }
  .mg-idx button { white-space: normal; display: flex; justify-content: space-between; }
  .mg-fig { border-bottom: 0; border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; }
  .mg-fig svg.mol { height: 420px; }
}

/* ---------- §03 certificate of analysis ---------- */
.coa-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.coa-side { display: flex; flex-direction: column; gap: 10px; }
.batch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px; text-align: left; background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; transition: border-color .15s; }
.batch:hover { border-color: var(--ink-3); }
.batch.on { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); }
.batch b { font: 500 14px var(--mono); }
.batch small { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); }
.coa { position: relative; background: var(--sheet); border: 1px solid var(--rule); padding: 20px; clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%); overflow: hidden; }
.coa::after { content: ''; position: absolute; right: 0; top: 0; width: 26px; height: 26px; background: linear-gradient(225deg, var(--paper) 50%, var(--rule-2) 50%); }
.coa-hd { display: flex; justify-content: flex-start; gap: 12px; align-items: flex-start; padding: 0 196px 14px 0; min-height: 136px; border-bottom: 2px solid var(--ink); }
.coa-hd h3 { font: 700 13px/1.3 var(--display); font-stretch: 125%; letter-spacing: .12em; text-transform: uppercase; }
.coa-hd p { font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 4px; }
.coa-hd .logo-mark { width: 34px; height: 34px; flex: none; }
.coa-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--ink); }
.coa-meta div { padding: 8px 0; border-bottom: 1px solid var(--rule-2); min-width: 0; }
.coa-meta div:nth-child(odd) { padding-right: 10px; }
.coa-meta dt { font: 600 9.5px var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.coa-meta dd { font: 400 14px/1.35 var(--mono); margin-top: 2px; overflow-wrap: anywhere; }
.coa-t { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; table-layout: fixed; }
.coa-t th:nth-child(1) { width: 34%; } .coa-t th:nth-child(2) { width: 36%; } .coa-t th:nth-child(4) { width: 26px; }
.coa-t td { overflow-wrap: anywhere; }
.coa-t th { text-align: left; font: 600 9.5px var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 6px; border-bottom: 1px solid var(--ink); }
.coa-t td { padding: 8px 6px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.coa-t td:nth-child(2) { font: 400 12.5px var(--mono); color: var(--ink-2); }
.coa-t td:nth-child(3) { font: 500 13px var(--mono); }
@media (max-width: 560px) { .coa { padding: 16px 14px; } .coa-t { font-size: 13px; } .coa-t td, .coa-t th { padding-left: 3px; padding-right: 3px; } .coa-t td:nth-child(2) { font-size: 11.5px; } .coa-t td:nth-child(3) { font-size: 12px; } }
.coa-t td:last-child { width: 26px; text-align: center; }
.coa-t .ok { color: var(--ok); }
.coa-t .pend { color: var(--ts); }
.coa-t tr.pending td:nth-child(3) { color: var(--ink-3); font-style: italic; }
.coa-sig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.coa-sig div { border-top: 1px solid var(--ink); padding-top: 6px; font: 400 11px/1.4 var(--mono); color: var(--ink-3); min-width: 0; }
.coa-sig b { display: block; font: 400 15px/1.2 var(--text); color: var(--ink); font-style: italic; min-height: 18px; }
.stamp { position: absolute; right: 30px; top: 14px; width: 172px; transform: rotate(-6deg); pointer-events: none; }
.stamp .glabel { box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .4); }
.stamp.in { animation: stamp .55s var(--ease) both; }
.coa-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; font: 400 11.5px var(--mono); color: var(--ink-3); }
@media (min-width: 1000px) { .coa-wrap { grid-template-columns: 300px minmax(0, 1fr); gap: 16px; } .coa { padding: 26px 30px; } .coa-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } .coa-meta div:nth-child(odd) { padding-right: 0; } .coa-meta div { padding-right: 10px; } }
@media (max-width: 560px) {
  .coa-hd { padding-right: 128px; min-height: 108px; }
  .stamp { width: 122px; right: 10px; top: 10px; }
  .stamp .glabel { font-size: 9px; padding: 7px 7px 6px; }
  .stamp .glabel h4 { font-size: 12.5px; padding-bottom: 5px; margin-bottom: 4px; }
}

/* ---------- §04 dossier ---------- */
.ds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tree { background: var(--sheet); border: 1px solid var(--rule); }
.tree-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ink); }
.node { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--rule-2); }
.node.l1 { background: #fafaf8; }
.node.l2 { padding-left: 42px; }
.node .code { font: 500 12.5px var(--mono); color: var(--ink-2); margin-right: 8px; }
.node .ttl { font-size: 14.5px; min-width: 0; }
.node.l1 .ttl { font-weight: 500; }
.node .pg { font: 400 11.5px var(--mono); color: var(--ink-3); margin-left: 8px; white-space: nowrap; }
.node .r { display: flex; align-items: center; gap: 8px; }
.ds-sum { background: var(--graphite); color: var(--trace); padding: 20px; border-radius: 2px; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.ds-sum .lbl { color: rgba(238, 241, 240, .45); }
.ds-big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, .14); }
.ds-big div { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.ds-big div:nth-child(even) { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .14); }
.ds-big b { display: block; font: 200 48px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ds-big small { font: 400 11.5px var(--mono); color: rgba(238, 241, 240, .55); }
.ds-sum p { font-size: 14px; color: rgba(238, 241, 240, .75); }
.ds-sum p b { color: var(--qt-bg); font-weight: 500; }
.ds-sum .seg { background: transparent; border-color: rgba(255, 255, 255, .3); }
.ds-sum .seg button { color: rgba(238, 241, 240, .7); border-right-color: rgba(255, 255, 255, .15); }
.ds-sum .seg button.on { background: var(--trace); color: var(--graphite); }
.ds-sum .btn { background: var(--signal); border-color: var(--signal); }
.ds-sum .btn:hover { background: var(--trace); border-color: var(--trace); color: var(--graphite); }
@media (min-width: 1000px) { .ds { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; } .ds-sum { position: sticky; top: 80px; } }

/* ---------- §05 enquiry record ---------- */
.rec { background: var(--sheet); border: 1px solid var(--ink); }
.rec-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--ink); }
.rec-hd > div { padding: 12px 14px; min-width: 0; }
.rec-hd h3 { font: 700 15px/1.2 var(--display); font-stretch: 125%; letter-spacing: .1em; text-transform: uppercase; }
.rec-hd p { font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 3px; }
.rec-hd .stat { border-left: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; min-width: 120px; }
.rec-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.rec-row:last-of-type { border-bottom: 0; }
.rec-n { display: flex; justify-content: center; padding-top: 16px; font: 500 13px var(--mono); color: var(--signal-t); border-right: 1px solid var(--rule); }
.rec-c { padding: 14px 16px 16px; min-width: 0; }
.rec-c > .lbl { display: block; margin-bottom: 10px; color: var(--ink-2); }
.rec-picks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.rec-qty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.cyl { position: relative; width: 74px; height: 250px; touch-action: none; cursor: ns-resize; outline-offset: 4px; }
.cyl-tube { position: absolute; left: 0; top: 0; bottom: 14px; width: 40px; border: 1.5px solid var(--ink); border-top: 0; border-radius: 0 0 8px 8px; overflow: hidden; background: rgba(242, 243, 240, .6); }
.cyl-tube::before { content: ''; position: absolute; left: -6px; right: -6px; top: 0; height: 1.5px; background: var(--ink); }
.cyl-liq { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(90deg, rgba(255, 77, 0, .85), rgba(255, 120, 60, .7)); transition: height .35s var(--ease); }
.cyl-liq::before { content: ''; position: absolute; left: 0; right: 0; top: -4px; height: 8px; border-radius: 50%; background: rgba(255, 77, 0, .95); }
.cyl.drag .cyl-liq { transition: none; }
.cyl-foot { position: absolute; left: -8px; bottom: 0; width: 56px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--sheet); }
.cyl-ticks { position: absolute; left: 44px; top: 8px; bottom: 22px; width: 30px; }
.cyl-ticks span { position: absolute; left: 0; display: flex; align-items: center; gap: 4px; font: 400 9.5px/1 var(--mono); color: var(--ink-3); transform: translateY(50%); white-space: nowrap; }
.cyl-ticks span::before { content: ''; width: 7px; height: 1px; background: var(--ink); }
.cyl-ticks span.on { color: var(--signal-t); font-weight: 600; }
.qty-ro b { display: block; font: 200 clamp(60px, 9vw, 104px)/.9 var(--display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.qty-ro span { font: 400 12.5px/1.5 var(--mono); color: var(--ink-2); display: block; margin-top: 8px; }
.qty-ro .btns { display: flex; gap: 6px; margin-top: 14px; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sigpad { position: relative; height: 150px; border: 1px dashed var(--ink-3); border-radius: 2px; background: repeating-linear-gradient(0deg, transparent 0 29px, var(--rule-2) 29px 30px), var(--sheet); touch-action: none; }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sigpad .hint { position: absolute; left: 12px; bottom: 10px; font: 400 11.5px var(--mono); color: var(--ink-3); pointer-events: none; }
.sigpad .x { position: absolute; left: 12px; top: 54%; font: 400 22px var(--text); color: var(--ink-3); pointer-events: none; }
.sigpad.has .hint { display: none; }
.rec-sub { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--ink); background: var(--paper); }
.rec-sub p { font: 400 12px/1.5 var(--mono); color: var(--ink-2); }
.trail { margin-top: 12px; border: 1px solid var(--rule); background: var(--sheet); }
.trail li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--rule-2); font: 400 12.5px/1.45 var(--mono); animation: fadein .4s var(--out) both; }
.trail li:last-child { border-bottom: 0; }
.trail li span:first-child { color: var(--ink-3); }
.rec.locked .rec-c { pointer-events: none; }
.rec.locked .cyl { cursor: default; }
@media (min-width: 900px) { .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } .rec-row { grid-template-columns: 56px minmax(0, 1fr); } }

/* ---------- §06 stability, §07 logger: shared chart frame ---------- */
.chart { position: relative; background: var(--sheet); border: 1px solid var(--rule); }
.chart-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.chart-plot { position: relative; height: 340px; touch-action: pan-y; cursor: crosshair; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-plot .ax { font: 400 10.5px var(--mono); fill: var(--ink-3); }
.chart-plot .axl { font: 600 9px var(--display); font-stretch: 125%; letter-spacing: .14em; fill: var(--ink-3); }
.tip { position: absolute; top: 12px; left: 0; transform: translateX(-50%); pointer-events: none; background: var(--ink); color: var(--sheet); padding: 7px 10px; border-radius: 2px; font: 400 11px/1.5 var(--mono); white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 2; }
.tip b { font: 500 12.5px var(--text); display: block; }
.tip.on { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 12px var(--mono); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 18px; height: 0; border-top: 2px solid var(--c); }
.legend i.dash { border-top-style: dashed; }
.legend i.band { height: 10px; border: 0; background: var(--c); }
.legend button { display: inline-flex; align-items: center; gap: 7px; font: inherit; color: inherit; }
.legend button.off { opacity: .35; }
.chart-ft { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.chart-ft > div { padding: 12px 14px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); min-width: 0; }
.chart-ft b { display: block; font: 300 30px/1.05 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.chart-ft b em { font: 400 12px var(--mono); font-style: normal; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.chart-ft .tag { margin-top: 8px; }
@media (min-width: 900px) { .chart-ft { grid-template-columns: repeat(4, minmax(0, 1fr)); } .chart-ft > div { border-bottom: 0; } }
.route { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
@media (min-width: 760px) { .route { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.route div { position: relative; padding: 12px 10px 12px; border-right: 1px solid var(--rule-2); min-width: 0; transition: background .2s; }
.route div:last-child { border-right: 0; }
.route div.on { background: var(--signal-bg); }
.route b { display: block; font: 500 13px/1.25 var(--text); overflow-wrap: anywhere; }
.route small { display: block; font: 400 10.5px/1.4 var(--mono); color: var(--ink-3); }
.route i { position: absolute; left: 0; top: 0; height: 2px; background: var(--signal); width: 0; transition: width .2s; }

/* ---------- §08 reaction windows + reactor drawings ---------- */
.rx-g { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rxc { background: var(--sheet); border: 1px solid var(--rule); }
.rxc-axis, .rxr { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; }
.rxc-axis { border-bottom: 1px solid var(--ink); height: 36px; }
.rxc-axis .sc { position: relative; height: 100%; }
.rxc-axis .sc span { position: absolute; bottom: 8px; transform: translateX(-50%); font: 400 10.5px var(--mono); color: var(--ink-3); }
.rxr { width: 100%; text-align: left; border-bottom: 1px solid var(--rule-2); height: 44px; transition: background .12s; }
.rxr:last-child { border-bottom: 0; }
.rxr:hover { background: #fafaf8; }
.rxr.on { background: var(--signal-bg); }
.rxr .nm { padding: 0 12px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rxr .lane { position: relative; height: 100%; margin-right: 14px; }
.rxc-axis .sc { margin-right: 14px; }
.rxr .zero, .rxc-axis .zero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); }
.rxr .bar { position: absolute; top: 14px; height: 16px; background: var(--ink); border-radius: 1px; transition: background .15s; }
.rxr .bar::before, .rxr .bar::after { content: ''; position: absolute; top: -4px; width: 1px; height: 24px; background: var(--ink); }
.rxr .bar::before { left: 0; } .rxr .bar::after { right: 0; }
.rxr.on .bar { background: var(--signal); }
.rxr .bar.p::after { box-shadow: 0 0 0 0; }
.rxd { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.rxd h3 { font: 600 30px/1 var(--display); font-stretch: 106%; letter-spacing: -.03em; }
.rxd .win { font: 200 54px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.rxd p { color: var(--ink-2); font-size: 15px; }
.rxd .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.rxd .meta span { font: 400 12px var(--mono); padding: 4px 8px; border: 1px solid var(--rule); border-radius: 1px; }
.fleet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.vsl { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 12px 6px 10px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); min-width: 0; transition: opacity .25s; }
.vsl svg { width: 100%; height: 110px; display: block; }
.vsl b { font: 500 13px var(--mono); }
.vsl small { font: 400 10.5px var(--mono); color: var(--ink-3); }
.vsl.dim { opacity: .3; }
.vsl.on b { color: var(--signal-t); }
@media (min-width: 640px) { .fleet { grid-template-columns: repeat(6, minmax(0, 1fr)); } .vsl { border-bottom: 0; } }
@media (min-width: 1000px) { .rx-g { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; } .rxc-axis, .rxr { grid-template-columns: 190px minmax(0, 1fr); } }
@media (max-width: 520px) { .rxc-axis, .rxr { grid-template-columns: 112px minmax(0, 1fr); } .rxr .nm { font-size: 12.5px; padding: 0 8px; } }

/* ---------- §09 market ledger ---------- */
.ml-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ml-top p { font: 400 13px var(--mono); color: var(--ink-2); }
.ml-top p b { font: 300 26px var(--display); color: var(--ink); letter-spacing: -.02em; }
.ml-wrap { position: relative; overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); }
.ml { width: 100%; min-width: 780px; border-collapse: collapse; }
.ml th { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--ink); font: 600 9.5px/1.3 var(--display); font-stretch: 125%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.ml th small { display: block; font: 400 10px var(--mono); letter-spacing: 0; text-transform: none; margin-top: 2px; }
.ml td { padding: 9px 10px; border-bottom: 1px solid var(--rule-2); }
.ml td:first-child, .ml th:first-child { position: sticky; left: 0; background: var(--sheet); z-index: 1; }
.ml td:first-child { font-weight: 500; font-size: 14.5px; white-space: nowrap; }
.ml .hl { background: #fff7f2; }
.ml th.hl { color: var(--signal-t); }
.ml tbody tr { transition: transform .45s var(--ease); }

/* ---------- §10 audits + certificates ---------- */
.au { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tl { position: relative; background: var(--sheet); border: 1px solid var(--rule); padding: 6px 0; }
.tl li { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 14px; padding: 12px 16px 12px 16px; }
.tl li::before { content: ''; position: absolute; left: 100px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.tl li::after { content: ''; position: absolute; left: 96px; top: 18px; width: 9px; height: 9px; background: var(--sheet); border: 1.5px solid var(--ink); }
.tl li.ok::after { background: var(--ok); border-color: var(--ok); }
.tl time { font: 500 12.5px var(--mono); color: var(--ink-2); padding-top: 1px; }
.tl .ev { padding-left: 14px; min-width: 0; }
.tl .ev b { display: block; font-weight: 500; font-size: 15px; }
.tl .ev small { display: block; color: var(--ink-3); font-size: 13px; margin: 1px 0 6px; }
.tl .tag { white-space: normal; height: auto; min-height: 22px; padding: 4px 7px; line-height: 1.3; max-width: 100%; }
.certs { background: var(--sheet); border: 1px solid var(--rule); }
.cert { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); width: 100%; text-align: left; transition: background .12s; }
.cert:last-child { border-bottom: 0; }
.cert:hover { background: #fafaf8; }
.cert b { font-weight: 500; font-size: 15px; }
.cert small { display: block; color: var(--ink-3); font-size: 12.5px; }
.cert .vb { grid-column: 1 / -1; position: relative; height: 12px; background-image: repeating-linear-gradient(90deg, var(--ink-3) 0 1px, transparent 1px 10%); background-size: 100% 6px; background-repeat: no-repeat; background-position: 0 100%; border-bottom: 1px solid var(--ink); }
.cert .vb i { position: absolute; left: 0; top: 0; height: 6px; background: var(--ok); }
.cert .vb i.soon { background: var(--qt); }
.cert .vt { font: 400 11.5px var(--mono); color: var(--ink-2); text-align: right; white-space: nowrap; }
@media (min-width: 1000px) { .au { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; } }

/* ---------- footer ---------- */
.ft { margin-top: clamp(110px, 13vw, 180px); background: var(--graphite); color: var(--trace); padding: 40px var(--side) calc(28px + var(--sab)); overflow: hidden; }
.ft-word { font: 700 clamp(84px, 19vw, 280px)/.8 var(--display); font-stretch: 125%; letter-spacing: -.02em; margin-left: -.03em; }
.ft-word .o { color: var(--signal); }
.ft-g { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .16); }
.ft-g h4 { font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: rgba(238, 241, 240, .45); margin-bottom: 10px; }
.ft-g p { color: rgba(238, 241, 240, .72); max-width: 38em; font-size: 15px; }
.ft-g li { padding: 3px 0; font-size: 15px; }
.ft-g a:hover { color: var(--signal); }
.ft-c { font: 400 11.5px/1.5 var(--mono); color: rgba(238, 241, 240, .4); margin-top: 28px; }
@media (min-width: 900px) { .ft-g { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- drawer + toast ---------- */
.drw-wrap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drw-bg { position: absolute; inset: 0; background: rgba(15, 18, 20, .4); animation: fadein .2s both; }
.drw { position: relative; width: min(440px, 100%); height: 100%; background: var(--sheet); border-left: 1px solid var(--ink); display: flex; flex-direction: column; animation: slidein .35s var(--ease) both; }
.drw-hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ink); }
.drw-hd h2 { font: 600 24px/1 var(--display); font-stretch: 108%; letter-spacing: -.03em; }
.drw-bd { flex: 1; overflow-y: auto; padding: 4px 0; }
.drw-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--rule-2); }
.drw-row svg.mol { width: 56px; height: 42px; }
.drw-row b { display: block; font-weight: 500; }
.drw-row small { font: 400 12px var(--mono); color: var(--ink-3); }
.drw-ft { padding: 14px 18px calc(14px + var(--sab)); border-top: 1px solid var(--ink); display: grid; gap: 8px; }
.drw-ft .btn { width: 100%; }
.xbtn { width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 2px; display: grid; place-items: center; }
.xbtn:hover { background: var(--ink); color: var(--sheet); }
#toast-root { position: fixed; left: 20px; bottom: calc(20px + var(--sab)); z-index: 90; display: grid; gap: 6px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--graphite); color: var(--trace); padding: 12px 16px 12px 12px; border-radius: 2px; font: 400 14px/1.35 var(--text); animation: rise .3s var(--out) both; border-left: 4px solid var(--signal); }
.toast .mono { font-size: 11.5px; color: rgba(238, 241, 240, .5); }

/* ---------- keyframes ---------- */
@keyframes led { 50% { opacity: .25; } }
@keyframes tick { 30% { transform: translateY(-3px); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-6deg) scale(1.35); } 60% { opacity: 1; transform: rotate(-6deg) scale(.97); } 100% { transform: rotate(-6deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
