/* Copyright (c) 2026 ByteVerity, Inc.  SPDX-License-Identifier: MIT
   The Defensible AI cockpit — design system for the Clinical Intake Assistant demo.
   Two worlds: the dark "cockpit" (live operation) and the light "evidence pack"
   (the archival artifact you hand a regulator). Semantics carry the only saturated
   color — green=proof, red=deny, amber=caution. Chrome is cool slate/teal. */

:root {
  /* cockpit (dark) */
  --ink:        #0a0e12;
  --ink-2:      #0e141a;
  --panel:      #121a22;
  --panel-2:    #17212b;
  --line:       #223140;
  --line-soft:  #1a2732;
  --text:       #dbe4ea;
  --text-dim:   #8397a6;
  --text-faint: #566675;

  /* semantics — the load-bearing color */
  --green:      #2fe38b;
  --green-ink:  #0a3222;
  --green-dim:  #1f6b4a;
  --red:        #ff5c6c;
  --red-ink:    #3a0d12;
  --amber:      #f5b740;
  --amber-ink:  #3a2c08;

  /* chrome accent (interactive only — never a verdict) */
  --teal:       #58c6d6;
  --teal-dim:   #2b6d78;

  --seal-gold:  #d8c48a;

  --r-sm: 6px;  --r-md: 10px;  --r-lg: 16px;
  --pad: clamp(16px, 3vw, 34px);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 18px 50px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(88,198,214,.07), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(47,227,139,.05), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* app manages its own scroll regions */
}

/* ── typographic devices ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
.eyebrow--teal { color: var(--teal); }
h1, h2, h3 { font-weight: 620; letter-spacing: -.02em; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(30px, 4.6vw, 56px); }
h2 { font-size: clamp(22px, 3vw, 34px); }
.lede { color: var(--text-dim); font-size: clamp(15px, 1.5vw, 18px); max-width: 62ch; }
.mono { font-family: var(--mono); }
.hash { font-family: var(--mono); font-size: 12px; color: var(--text-dim); word-break: break-all; }
b, strong { color: #eef4f8; font-weight: 620; }

/* ── app frame ───────────────────────────────────────────────────── */
#app { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh; }

/* top bar: brand + verb rail */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 12px var(--pad); border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(20,28,36,.9), rgba(10,14,18,.6));
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand .mark { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; color: var(--text); }
.brand .mark .b { color: var(--teal); }
.brand .sub { font-size: 11px; color: var(--text-faint); letter-spacing: .06em; }

.verbrail { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.verb {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); padding: 5px 9px; border-radius: 20px; border: 1px solid transparent;
  display: flex; align-items: center; gap: 6px;
}
.verb .n { color: var(--teal-dim); font-size: 9px; }
.verb.is-active { color: var(--text); border-color: var(--line); background: var(--panel); }
.verb.is-done { color: var(--green-dim); }

/* stage */
.stage { position: relative; overflow: hidden; }
.scene {
  position: absolute; inset: 0; overflow-y: auto; padding: clamp(20px,3.5vw,46px) var(--pad);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .38s ease, transform .38s ease;
}
.scene.is-active { opacity: 1; transform: none; pointer-events: auto; }
.wrap { max-width: 1180px; margin: 0 auto; }

/* bottom transport */
.transport {
  display: flex; align-items: center; gap: 16px;
  padding: 10px var(--pad); border-top: 1px solid var(--line-soft);
  background: linear-gradient(0deg, rgba(20,28,36,.9), rgba(10,14,18,.5));
}
.progress { display: flex; gap: 6px; align-items: center; margin: 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); cursor: pointer; transition: all .25s; }
.dot.is-active { background: var(--teal); box-shadow: 0 0 0 4px rgba(88,198,214,.14); }
.dot.is-done { background: var(--green-dim); }
.scene-label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--text-dim); text-transform: uppercase; }

/* ── buttons ─────────────────────────────────────────────────────── */
button { font-family: inherit; cursor: pointer; }
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 560;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); transition: all .18s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
.btn:hover { border-color: var(--teal-dim); background: #1b2732; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary { background: var(--teal); color: #04222a; border-color: var(--teal); font-weight: 640; }
.btn--primary:hover { background: #6ad3e2; }
.btn--ghost { background: transparent; }
.btn--danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn--danger:hover { background: var(--red-ink); }
.btn--green { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 640; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.kbd { font-family: var(--mono); font-size: 11px; color: var(--text-faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

/* ── cards / panels ─────────────────────────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 18px; }
.grid { display: grid; gap: 16px; }
.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-dim);
}
.tag--green { color: var(--green); border-color: var(--green-dim); }
.tag--red { color: var(--red); border-color: #5c2530; }
.tag--amber { color: var(--amber); border-color: var(--amber-ink); }
.tag--teal { color: var(--teal); border-color: var(--teal-dim); }

/* ── COVER ──────────────────────────────────────────────────────── */
.cover { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; min-height: 78vh; }
.cover-copy h1 { margin: 14px 0 18px; }
.cover-copy h1 em { font-style: normal; color: var(--teal); }
.cover-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.cover-art { display: grid; place-items: center; }

/* ── how-it-works: the boundary diagram ─────────────────────────── */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-top: 26px; }
.verbcard { padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--panel); position: relative; overflow: hidden; }
.verbcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal-dim); }
.verbcard .vn { font-family: var(--mono); font-size: 11px; color: var(--teal); letter-spacing: .2em; }
.verbcard h3 { margin: 8px 0 6px; font-size: 18px; }
.verbcard p { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.verbcard .slideref { margin-top: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.boundary-strip {
  margin-top: 30px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: center;
  padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(18,26,34,.4), rgba(23,33,43,.7), rgba(18,26,34,.4));
}
.bs-node { text-align: center; }
.bs-node .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--text-dim); text-transform: uppercase; }
.bs-node .big { font-size: 15px; font-weight: 600; margin-top: 4px; }
.bs-gate { text-align: center; padding: 14px 18px; border-radius: var(--r-md); border: 1px dashed var(--teal-dim); background: rgba(88,198,214,.05); }
.bs-gate .g { font-family: var(--mono); color: var(--teal); font-size: 13px; letter-spacing: .08em; }
.bs-arrow { color: var(--text-faint); font-size: 20px; text-align: center; }

/* ── CONFIGURE: policy studio ───────────────────────────────────── */
.cfg { display: grid; grid-template-columns: 360px 1fr; gap: 22px; margin-top: 22px; align-items: start; }
.control-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.control-row:last-child { border-bottom: 0; }
.control-row .k { font-size: 13px; font-weight: 600; }
.control-row .d { font-size: 12px; color: var(--text-dim); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { background: transparent; color: var(--text-dim); border: 0; padding: 7px 12px; font-size: 12.5px; font-family: var(--mono); letter-spacing: .04em; }
.seg button.on { background: var(--panel-2); color: var(--text); }
.seg button.on[data-tone="enforce"], .seg button.on[data-tone="deny"] { color: var(--green); }
.seg button.on[data-tone="observe"] { color: var(--amber); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch .track { width: 42px; height: 24px; border-radius: 20px; background: var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-dim); transition: transform .2s, background .2s; }
.switch.on .track { background: var(--green-dim); }
.switch.on .track::after { transform: translateX(18px); background: var(--green); }
.chiplist { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-family: var(--mono); font-size: 11.5px; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.chip.allow { border-color: var(--green-dim); color: var(--green); }
.chip.block { border-color: #5c2530; color: var(--red); }

.yaml {
  background: #0b1116; border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; padding: 18px 20px;
  overflow: auto; white-space: pre; color: #b9c8d3; min-height: 340px;
}
.yaml .yk { color: var(--teal); }
.yaml .yv { color: #dbe4ea; }
.yaml .yc { color: var(--text-faint); }
.yaml .yg { color: var(--green); }
.yaml .yr { color: var(--red); }
.yaml .ya { color: var(--amber); }
.yaml-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.yaml-head .fn { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.mock-note { margin-top: 14px; font-size: 12px; color: var(--text-faint); display: flex; gap: 8px; align-items: flex-start; }

/* editable rules-file studio */
.studio { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #0b1116; }
.studio-tab { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #10171e; border-bottom: 1px solid var(--line-soft); }
.studio-tab .wd { width: 10px; height: 10px; border-radius: 50%; }
.studio-tab .wd.r { background: #ff5f56; } .studio-tab .wd.y { background: #ffbd2e; } .studio-tab .wd.g { background: #27c93f; }
.studio-tab .fn { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: 6px; }
.pill { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--green-dim); color: var(--green); }
.pill.dirty { color: var(--amber); border-color: var(--amber-ink); }
.studio-body { display: grid; grid-template-columns: 44px 1fr; max-height: 360px; }
.gutter { overflow: hidden; padding: 14px 0; text-align: right; background: #0a0f14; border-right: 1px solid var(--line-soft); user-select: none; }
.gutter span { display: block; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--text-faint); padding-right: 10px; }
.yaml-edit {
  border: 0; outline: 0; resize: none; width: 100%; height: 360px; padding: 14px 16px;
  background: transparent; color: #c7d4de; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; white-space: pre;
  caret-color: var(--teal); tab-size: 2;
}
.yaml-edit:focus { box-shadow: inset 0 0 0 1px var(--teal-dim); }
.studio-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-soft); background: #10171e; }

/* ── RUN cockpit ────────────────────────────────────────────────── */
.run-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.run-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.runcase {
  text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--panel); min-width: 210px; transition: all .18s;
}
.runcase:hover { border-color: var(--teal-dim); }
.runcase.sel { border-color: var(--teal); background: var(--panel-2); }
.runcase .rc-t { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.runcase .rc-d { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.run-body { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.stepper { display: flex; flex-direction: column; gap: 0; }
.step {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  opacity: .35; transform: translateY(4px); transition: opacity .3s, transform .3s;
}
.step.shown { opacity: 1; transform: none; }
.step .marker { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--text-dim); background: var(--panel); }
.step.pass .marker { border-color: var(--green-dim); color: var(--green); }
.step.deny .marker { border-color: var(--red); color: var(--red); background: var(--red-ink); }
.step.warn .marker { border-color: var(--amber-ink); color: var(--amber); }
.step.active .marker { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 4px rgba(88,198,214,.12); }
.step .s-t { font-weight: 600; font-size: 14px; }
.step .s-d { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.step .s-receipt { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 6px; display: none; }
.step.shown .s-receipt { display: block; }
.step .s-verdict { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.step.pass .s-verdict { color: var(--green); }
.step.deny .s-verdict { color: var(--red); }
.step.warn .s-verdict { color: var(--amber); }

/* boundary scan animation on a gated step */
.step .s-t .scan { display: inline-block; }
@keyframes scanpulse { 0%,100% { opacity:.4 } 50% { opacity:1 } }
.step.active .s-d .scanning { color: var(--teal); animation: scanpulse 1s infinite; }

/* run sidebar: intake + live receipts */
.run-side .card + .card { margin-top: 16px; }
.intake { font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; color: #c4d2dc; }
.pii { background: var(--red-ink); color: #ffd0d5; border-radius: 3px; padding: 0 3px; border-bottom: 1px solid var(--red); }
.pii.tok { background: var(--green-ink); color: #9ff0c8; border-color: var(--green-dim); }

.receipt-feed { display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow: auto; }
.receipt { font-family: var(--mono); font-size: 11px; padding: 7px 9px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); background: #0d141a; display: flex; gap: 8px; align-items: baseline; }
.receipt .rk { color: var(--text-faint); }
.receipt.ok { border-left: 2px solid var(--green-dim); }
.receipt.deny { border-left: 2px solid var(--red); }
.receipt.warn { border-left: 2px solid var(--amber); }

/* ── the verdict seal (signature) ───────────────────────────────── */
.seal-wrap { display: grid; place-items: center; padding: 20px 0; }
.seal {
  --sc: var(--green); position: relative; width: 168px; height: 168px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  border: 2px solid var(--sc);
  background: radial-gradient(circle at 50% 40%, rgba(47,227,139,.10), transparent 70%);
  box-shadow: 0 0 0 6px rgba(47,227,139,.06), inset 0 0 30px rgba(47,227,139,.06);
  animation: sealin .5s cubic-bezier(.2,.9,.3,1.2);
}
.seal.red { --sc: var(--red); background: radial-gradient(circle at 50% 40%, rgba(255,92,108,.12), transparent 70%); box-shadow: 0 0 0 6px rgba(255,92,108,.06), inset 0 0 30px rgba(255,92,108,.06); }
@keyframes sealin { from { transform: scale(.7) rotate(-8deg); opacity: 0 } to { transform: none; opacity: 1 } }
.seal .s-icon { font-size: 30px; color: var(--sc); line-height: 1; }
.seal .s-word { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--sc); margin-top: 6px; font-weight: 600; }
.seal .s-sub { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--text-dim); margin-top: 3px; }
.seal-rim { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); text-align: center; margin-top: 10px; word-break: break-all; max-width: 240px; }

/* ── email alert modal ──────────────────────────────────────────── */
.modal-scrim { position: fixed; inset: 0; background: rgba(4,7,10,.72); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 40; padding: 24px; }
.modal-scrim.open { display: grid; }
.modal { width: min(640px, 96vw); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; animation: sealin .3s ease; }
.email-app .eh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2); }
.email-app .eh .dotr { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.email-meta { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.email-meta .row { display: flex; gap: 10px; padding: 2px 0; }
.email-meta .row .lbl { color: var(--text-faint); width: 62px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.email-subject { font-weight: 640; font-size: 15px; }
.email-body { padding: 18px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.email-body .attach { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); display: flex; align-items: center; gap: 10px; }

/* ── kill-switch banner ─────────────────────────────────────────── */
.killbanner { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--red); background: var(--red-ink); display: flex; gap: 14px; align-items: center; }
.killbanner .ki { font-size: 24px; }
.killbanner .kt { font-weight: 640; color: #ffd7db; }
.killbanner .kd { font-size: 12.5px; color: #f0b8bf; margin-top: 2px; }
.locked-note { font-family: var(--mono); font-size: 11.5px; color: var(--red); display: inline-flex; align-items: center; gap: 6px; }

/* ── EVIDENCE PACK (light archival world) ───────────────────────── */
.pack {
  background: #f4f1ea; color: #23201a; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid #d8d2c4;
}
.pack-head { padding: 22px 26px; border-bottom: 1px solid #ddd6c7; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pack-head .doc-title { font-family: Georgia, "Times New Roman", serif; }
.pack-head .doc-title .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: #8a7f66; }
.pack-head .doc-title h2 { color: #1c1a15; font-family: Georgia, serif; margin-top: 6px; font-weight: 600; }
.pack-seal { text-align: center; }
.pack-seal .ring { width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--green-dim); display: grid; place-items: center; color: var(--green-dim); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.pack-body { padding: 22px 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pack-sec h3 { font-family: Georgia, serif; font-size: 16px; color: #2a261d; margin-bottom: 10px; }
.pack-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #e5dfd0; font-size: 13px; }
.pack-row .pk { color: #6b6250; }
.pack-row .pv { font-family: var(--mono); font-size: 12px; color: #2a261d; text-align: right; }
.clause { padding: 8px 0; border-bottom: 1px solid #e5dfd0; }
.clause .cc { font-family: var(--mono); font-size: 11px; color: #8a7f66; }
.clause .ct { font-size: 12.5px; color: #2a261d; }
.clause .met { color: var(--green-dim); font-weight: 600; font-family: var(--mono); font-size: 11px; }
.pack-foot { padding: 16px 26px; border-top: 1px solid #ddd6c7; font-family: var(--mono); font-size: 11px; color: #6b6250; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── VERIFY panel (back to the cockpit voice) ───────────────────── */
.verify-grid { display: grid; grid-template-columns: 1fr 380px; gap: 22px; margin-top: 22px; align-items: start; }
.verify-console {
  background: #0a1015; border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; padding: 18px 20px; min-height: 300px; color: #b9c8d3;
}
.verify-console .ln { display: block; }
.verify-console .ok { color: var(--green); }
.verify-console .bad { color: var(--red); }
.verify-console .dim { color: var(--text-faint); }
.verify-console .cur { color: var(--teal); }
.chain { display: flex; flex-direction: column; gap: 0; }
.chain-node { display: grid; grid-template-columns: 20px 1fr; gap: 12px; }
.chain-node .rail { display: flex; flex-direction: column; align-items: center; }
.chain-node .rail .d { width: 11px; height: 11px; border-radius: 50%; background: var(--teal); margin-top: 5px; }
.chain-node .rail .l { flex: 1; width: 2px; background: var(--line); min-height: 22px; }
.chain-node:last-child .rail .l { display: none; }
.chain-node .body { padding-bottom: 16px; }
.chain-node .plane { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.chain-node .sm { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.chain-node.root .rail .d { background: var(--amber); }
.chain-node.root .plane { color: var(--amber); }

.pill-real { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--green); border: 1px solid var(--green-dim); border-radius: 20px; padding: 4px 11px; }
.blink { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: scanpulse 1.4s infinite; }

/* ── REWIND scene ───────────────────────────────────────────────── */
.rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; align-items: start; }
.rw-fine { font-size: 11.5px; color: var(--text-faint); margin: 12px 0 0; line-height: 1.5; }
.rw-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.ribbon { display: flex; gap: 3px; margin: 14px 0 10px; flex-wrap: wrap; }
.rtick { width: 10px; height: 22px; border-radius: 2px; background: var(--green-dim); opacity: .85; }
.rtick.ok { background: var(--green-dim); }
.rtick.warn { background: var(--amber); opacity: .7; }
.rtick.bad { background: var(--red); }
.rw-drift-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.bisect { margin-top: 8px; }
.bisect-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); padding: 6px 0; }
.bisect-head .mono { color: var(--teal); font-size: 14px; }
.bisect-track { position: relative; height: 30px; border-radius: 6px; background: #0b1116; border: 1px solid var(--line); overflow: hidden; }
.bwin { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: rgba(88,198,214,.16); border-left: 1px solid var(--teal-dim); border-right: 1px solid var(--teal-dim);
  transition: left .28s ease, width .28s ease; }
.bmark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--amber); transform: translateX(-1px); }
.bmark.hit { background: var(--red); box-shadow: 0 0 0 3px rgba(255,92,108,.25); width: 3px; }

.rw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.culprit-card { border-color: #5c2530; }
.culprit-doc { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #140d10; }
.culprit-doc .cd-ic { font-size: 24px; }
.cd-t { font-weight: 640; font-size: 14.5px; }
.cd-d { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.cd-h { font-size: 11px; color: var(--text-faint); margin-top: 8px; }
.blame { margin-top: 16px; padding-top: 4px; }
.blame-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.blame-row .bk { color: var(--text-faint); }
.blame-row .bv { color: var(--text); font-family: var(--mono); font-size: 12px; }

.replay { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 6px; }
.rp { padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); text-align: center; }
.rp.bad { border-color: #5c2530; background: var(--red-ink); }
.rp.good { border-color: var(--green-dim); background: var(--green-ink); }
.rp-k { font-size: 11px; color: var(--text-dim); }
.rp-v { font-size: 13.5px; margin-top: 4px; }
.rp.bad .rp-v b { color: var(--red); }
.rp.good .rp-v b { color: var(--green); }
.rp-arrow { font-family: var(--mono); font-size: 10px; color: var(--text-faint); white-space: nowrap; }

/* ── misc ───────────────────────────────────────────────────────── */
.callout { border-left: 3px solid var(--teal-dim); padding: 4px 0 4px 16px; color: var(--text-dim); font-size: 13.5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.spacer { height: 22px; }
.center { text-align: center; }
.hidden { display: none !important; }
.fade-in { animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

/* responsive */
@media (max-width: 940px) {
  .cover, .cfg, .run-body, .verify-grid, .pack-body, .two, .rw-grid, .rw-two { grid-template-columns: 1fr; }
  .replay { grid-template-columns: 1fr; } .rp-arrow { transform: rotate(90deg); }
  .verbrail { display: none; }
  .boundary-strip { grid-template-columns: 1fr; }
  .bs-arrow { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .05ms !important; }
}

/* ── REGULATORY EVIDENCE PACK (scrollable, mirrors bv.regpack.v1) ─────────── */
.regpack-scroll {
  max-height: min(74vh, 780px); overflow-y: auto;
  border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid #d8d2c4; background: #efece3;
  scrollbar-width: thin; scrollbar-color: #cfc7b4 transparent;
}
.regpack-scroll::-webkit-scrollbar { width: 12px; }
.regpack-scroll::-webkit-scrollbar-thumb { background: #cfc7b4; border-radius: 8px; border: 3px solid #efece3; }
.regpack { background: #f4f1ea; color: #23201a; font-family: var(--sans); }
.regpack .mono { font-family: var(--mono); }

.rp-head { padding: 24px 26px 20px; border-bottom: 1px solid #ddd6c7; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.rp-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: #4a5da8; font-weight: 600; }
.rp-title { font-family: Georgia, "Times New Roman", serif; font-size: 26px; color: #1c1a15; margin: 8px 0 10px; font-weight: 600; }
.rp-desc { font-size: 13px; line-height: 1.55; color: #4b463a; max-width: 58ch; }
.rp-seal { flex: none; text-align: center; border: 2px dashed var(--seal-gold); color: #9a7b2e; border-radius: 10px; padding: 10px 16px; transform: rotate(3deg); font-family: var(--mono); }
.rp-seal .v { font-size: 8.5px; letter-spacing: .22em; text-transform: uppercase; color: #b09551; }
.rp-seal .b { font-size: 12px; font-weight: 700; letter-spacing: .05em; margin-top: 3px; line-height: 1.25; }

.rp-meta { display: flex; flex-wrap: wrap; gap: 18px 34px; padding: 18px 26px; border-bottom: 1px solid #e5dfd0; }
.rp-meta .fl { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: #8a7f66; }
.rp-meta .fv { font-family: var(--mono); font-size: 12.5px; color: #2a261d; margin-top: 4px; font-weight: 600; }

.rp-metrics { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 26px; border-bottom: 1px solid #e5dfd0; }
.rp-metric { padding: 0 18px; border-left: 1px solid #e5dfd0; }
.rp-metric:first-child { border-left: 0; padding-left: 0; }
.rp-metric .ml { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #8a7f66; line-height: 1.35; }
.rp-metric .mv { font-size: 30px; font-weight: 700; margin: 8px 0 4px; }
.rp-metric .mv.ok { color: #2f8f63; } .rp-metric .mv.bad { color: #c0392b; } .rp-metric .mv.warn { color: #b9791f; }
.rp-metric .ms { font-size: 11.5px; color: #6b6250; line-height: 1.35; }

.rp-steps { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 16px 26px; border-bottom: 1px solid #e5dfd0; }
.rp-step { font-size: 12px; color: #4b463a; display: inline-flex; align-items: center; gap: 7px; }
.rp-step i { width: 8px; height: 8px; border-radius: 50%; background: #2f8f63; display: inline-block; }
.rp-step.warn i { background: #b9791f; }

.rp-sec { padding: 20px 26px; border-bottom: 1px solid #e5dfd0; }
.rp-sec-h { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #6b6250; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.rp-sec-h .n { color: #8a7f66; letter-spacing: .02em; text-transform: none; font-size: 11px; }

.rp-ledger { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-ledger th { text-align: left; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #8a7f66; padding: 0 10px 8px 0; font-weight: 600; }
.rp-ledger td { padding: 9px 10px; border-top: 1px solid #eae4d6; color: #2a261d; vertical-align: middle; }
.rp-ledger td:first-child { padding-left: 0; }
.rp-ledger tr.denied td { background: #f7e7e4; }
.rp-vd { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: 5px; }
.rp-vd.ok { background: #d9ecdf; color: #2f7f57; } .rp-vd.denied { background: #f2d3ce; color: #b53a2b; }

.rp-scores { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 26px; border-bottom: 1px solid #e5dfd0; }
.rp-score { border: 1px solid #ddd6c7; border-radius: 8px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; background: #fbf9f4; }
.rp-score-n { font-size: 11px; color: #6b6250; line-height: 1.15; }
.rp-score-v { font-family: var(--mono); font-weight: 700; font-size: 16px; color: #23201a; }

.rp-cross { padding: 22px 26px; }
.rp-legend { display: flex; gap: 20px; align-items: center; font-size: 11px; color: #6b6250; margin-bottom: 16px; flex-wrap: wrap; }
.rp-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.rp-legend .sat i { background: #2f8f63; } .rp-legend .part i { background: #b9791f; } .rp-legend .ne i { background: #cfc7b4; }
.rp-fwgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-fw { border: 1px solid #e0d9c9; border-radius: 12px; padding: 16px 16px 14px; background: #fbf9f4; }
.rp-fw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rp-fw-name { font-family: Georgia, serif; font-size: 17px; font-weight: 700; color: #1c1a15; }
.rp-fw-std { font-family: var(--mono); font-size: 10px; color: #8a7f66; margin-top: 3px; line-height: 1.35; }
.rp-fw-met { font-family: var(--mono); font-size: 11px; color: #8a7f66; text-align: right; white-space: nowrap; }
.rp-fw-met b { font-size: 20px; color: #23201a; }
.rp-fw-met span { display: block; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.rp-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: #e7e0d0; margin: 12px 0 14px; }
.rp-bar .s { background: #2f8f63; } .rp-bar .p { background: #b9791f; }
.rp-ctrl { display: grid; grid-template-columns: 74px 66px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid #eee7d8; }
.rp-ctrl:first-child { border-top: 0; }
.rp-badge { font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: .04em; padding: 3px 5px; border-radius: 5px; text-align: center; }
.rp-badge.sat { background: #d9ecdf; color: #2f7f57; } .rp-badge.partial { background: #f3e4c8; color: #9a6b1a; } .rp-badge.denied { background: #f2d3ce; color: #b53a2b; }
.rp-ref { font-family: var(--mono); font-size: 12px; font-weight: 700; color: #3a5db0; }
.rp-ctext { font-size: 12px; color: #2a261d; line-height: 1.35; }
.rp-ev { display: block; font-family: var(--mono); font-size: 10px; color: #9a8f76; margin-top: 3px; word-break: break-word; }

.rp-crypto { padding: 24px 26px; background: #eaf3f2; border-top: 1px solid #d7e2e0; }
.rp-crypto-h { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #3d6a68; }
.rp-crypto-lede { font-size: 13px; color: #2f3b3a; margin: 10px 0 16px; line-height: 1.5; }
.rp-crypto-grid { display: grid; grid-template-columns: 190px 1fr; gap: 20px; }
.rp-hash { margin-bottom: 14px; }
.rp-hash span { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #5f7d7a; }
.rp-hash code { display: block; font-family: var(--mono); font-size: 10.5px; color: #24302f; word-break: break-all; margin-top: 4px; line-height: 1.5; }
.rp-curl { background: #0c1a22; border-radius: 8px; padding: 14px 16px; font-family: var(--mono); font-size: 10.5px; line-height: 1.7; overflow-x: auto; }
.rp-curl .c { color: #5fe0b0; } .rp-curl .o { color: #8fb7c4; word-break: break-all; }
.rp-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 16px; }
.rp-check { font-size: 12px; color: #2f3b3a; } .rp-check::before { content: "\2713  "; color: #2f8f63; font-weight: 700; }

.rp-honest { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px 26px; border-top: 1px solid #e5dfd0; font-size: 11.5px; color: #5b5344; line-height: 1.55; }
.rp-honest .partial { color: #b9791f; font-weight: 600; }
.rp-foot { padding: 14px 26px 20px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: #8a7f66; }

@media (max-width: 1180px) {
  .rp-fwgrid, .rp-crypto-grid, .rp-honest { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .rp-metrics { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .rp-checks { grid-template-columns: 1fr; }
}

.regpack b, .regpack strong { color: inherit; }
