/* ClaimShield AI — one-page console.
   Deliberately restrained: no gradients, no blur, no ornament. Hierarchy comes
   from type scale, weight and spacing; colour is reserved for coverage meaning. */

:root {
  --bg:        #f4f5f6;
  --surface:   #ffffff;
  --ink:       #14181c;
  --ink-2:     #46525c;
  --ink-3:     #6b7680;
  --line:      #dde2e6;
  --line-2:    #eef1f3;
  --accent:    #0f5f5a;
  --accent-dk: #0b4743;
  --accent-bg: #e8f1f0;
  --ok:        #1a6d43;
  --bad:       #a4241c;
  --warn:      #8a5a00;
  --radius:    4px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(20, 24, 28, .05);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  text-wrap: pretty;
}

code { font: 500 12.5px/1 var(--mono); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dk); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ── top bar ──────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--accent); color: #fff;
  font: 600 11px/1 var(--mono); letter-spacing: .04em;
}
.brand-name { font-weight: 600; letter-spacing: -.01em; }
.badge {
  padding: 2px 7px; border: 1px solid var(--line); color: var(--ink-2);
  font: 500 10.5px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .07em;
}
.topnav { display: flex; gap: 20px; font-size: 13.5px; }
.topnav a { text-decoration: none; color: var(--ink-2); }
.topnav a:hover { color: var(--accent); }

/* ── shell ────────────────────────────────────────────────────────────── */
.shell {
  max-width: 1240px; margin: 0 auto; padding: 36px 24px 56px;
}

/* ── left rail ────────────────────────────────────────────────────────── */
.rail { border-right: 1px solid var(--line); padding-right: 32px; }
.lede { margin: 0 0 28px; color: var(--ink-2); }
.rail-h {
  margin: 0 0 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.pipeline { margin: 0 0 30px; padding: 0; list-style: none; counter-reset: step; }
.pipeline li {
  counter-increment: step; position: relative; padding: 0 0 14px 26px;
  color: var(--ink-2); font-size: 13.5px;
}
.pipeline li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  font: 500 10.5px/1.6 var(--mono); color: var(--ink-3);
}
.pipeline li span { color: var(--ink); font-weight: 500; }
.facts { margin: 0 0 26px; }
.facts dt {
  font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 3px;
}
.facts dd { margin: 0 0 14px; font-size: 13.5px; color: var(--ink); }
.dim { color: var(--ink-3); }
.rail-note {
  margin: 0; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}

/* ── architecture sections ────────────────────────────────────────────── */
.sec { margin: 0 0 52px; }
.lede { margin: 0 0 20px; color: var(--ink-2); max-width: 72ch; }
.sec-h {
  margin: 0 0 6px; font: 600 20px/1.25 var(--sans); letter-spacing: -.01em; color: var(--ink);
}
.sec-sub { margin: 0 0 22px; font-size: 13.5px; color: var(--ink-3); max-width: 74ch; }
.sec-sub code { font-size: 12px; }

/* pipeline flow — hairline-bordered vertical steps */
.flow { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.flow-step {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.flow-head { font: 500 12.5px/1.4 var(--mono); color: var(--ink); }
.flow-id {
  display: block; font: 500 10.5px/1 var(--mono); color: var(--ink-3);
  letter-spacing: .07em; margin-bottom: 4px;
}
.flow-name { color: var(--accent); text-transform: lowercase; }
.flow-route {
  margin: 0 0 8px; font: 400 12.5px/1.7 var(--mono); color: var(--ink-2); overflow-wrap: anywhere;
}
.flow-note { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); max-width: 76ch; }
.flow-note code, .flow-route code { font-size: 12px; }

/* request path — numbered walkthrough */
.req { list-style: none; margin: 0; padding: 0; counter-reset: req; border-top: 1px solid var(--line); }
.req li {
  counter-increment: req; position: relative; padding: 14px 0 14px 40px;
  border-bottom: 1px solid var(--line-2); font-size: 14px; line-height: 1.6; color: var(--ink-2);
}
.req li::before {
  content: counter(req, decimal-leading-zero); position: absolute; left: 0; top: 16px;
  font: 500 11px/1.5 var(--mono); color: var(--accent);
}
.req code { font-size: 12px; }
.req-b { display: block; font-weight: 500; color: var(--ink); }

/* trust — grounding contract */
.contract { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0 0 18px; }
.contract-box {
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.contract-h {
  margin: 0 0 10px; font: 500 10.5px/1 var(--mono); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.contract-list { margin: 0; padding: 0; list-style: none; }
.contract-list li {
  position: relative; padding: 0 0 8px 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
}
.contract-list li:last-child { padding-bottom: 0; }
.contract-list li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); }
.contract-list code { font-size: 12px; }
.trust-p { margin: 0 0 14px; font-size: 14px; line-height: 1.62; color: var(--ink-2); max-width: 78ch; }
.trust-p strong { color: var(--ink); font-weight: 500; }
.trust-p code { font-size: 12px; }

/* stack line */
.stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 32px; margin: 0; }
.stack dt {
  font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 5px;
}
.stack dd { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.stack code { font-size: 12px; }

/* console — kept visually distinct from the prose above */
.work { margin-top: 8px; padding-top: 30px; border-top: 1px solid var(--line); }

/* The console is the tool; the explanation below it needs a clearer break. */
.work + .sec { margin-top: 56px; }

/* ── tabs ─────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 0 0 11px; cursor: pointer;
  font: 500 14px/1 var(--sans); color: var(--ink-3);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── free allowance + founder unlock ──────────────────────────────────── */

/* Sits under the tabs so it covers both panels. */
.quota {
  margin: 0 0 22px;
  font: 400 11.5px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Shown in place of the result once a visitor spends their allowance. Uses the
   same card furniture as a result, so it doesn't read as an error. */
.unlock-h { margin: 0 0 6px; font: 600 15px/1.3 var(--sans); color: var(--ink); }
.unlock-p { margin: 0 0 16px; max-width: 52ch; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.unlock-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }

.unlock-input {
  flex: 1 1 240px; min-width: 0; padding: 10px 12px;
  font: 400 14px/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.unlock-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.unlock-msg { margin: 10px 0 0; min-height: 18px; font-size: 13px; color: var(--ink-2); }
.unlock-msg.is-error { color: var(--bad); }

/* ── ask bar ──────────────────────────────────────────────────────────── */
.askbar { display: flex; gap: 10px; }
.askbar input {
  flex: 1; min-width: 0; height: 44px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 400 15px/1 var(--sans);
}
.askbar input::placeholder { color: #9aa4ac; }
.askbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.btn {
  height: 44px; padding: 0 22px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer;
  font: 500 14px/1 var(--sans);
}
.btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn[disabled] { opacity: .5; cursor: default; }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.examples-h { font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.chip {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); cursor: pointer; font: 400 13px/1 var(--sans);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── states ───────────────────────────────────────────────────────────── */
.out { margin-top: 30px; }
.state { color: var(--ink-3); font-size: 14px; padding: 22px 0; }
.state.is-error { color: var(--bad); }
.notice {
  padding: 12px 14px; border: 1px solid #e6d9bd; background: #fdf8ee;
  border-radius: var(--radius); color: var(--warn); font-size: 13.5px;
}
.bar { height: 2px; background: var(--line); overflow: hidden; margin: 22px 0; }
.bar i { display: block; height: 100%; width: 34%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ── result ───────────────────────────────────────────────────────────── */
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.result-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  padding: 14px 20px; border-bottom: 1px solid var(--line-2);
}
.result-q { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.result-q b { color: var(--ink); font-weight: 500; }
.result-body { padding: 20px; }

.answer { margin: 0; font-size: 16.5px; line-height: 1.62; }
.answer sup.cite {
  display: inline-block; min-width: 15px; height: 15px; margin-left: 2px; padding: 0 3px;
  border-radius: 2px; background: var(--accent-bg); color: var(--accent-dk);
  font: 500 10px/15px var(--mono); text-align: center; text-decoration: none;
  vertical-align: super;
}
.answer sup.cite:hover { background: var(--accent); color: #fff; }

.meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.metric { min-width: 130px; }
.metric dt { font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.metric dd { margin: 0; font: 500 15px/1 var(--mono); }
.conf { position: relative; width: 130px; height: 4px; background: var(--line); margin-top: 8px; border-radius: 2px; }
.conf i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 2px; }
.conf u {
  position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3);
}
.conf-h { display: block; margin-top: 5px; font: 400 11px/1 var(--mono); color: var(--ink-3); }

/* ── evidence ─────────────────────────────────────────────────────────── */
.ev-h {
  margin: 30px 0 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.ev { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.ev-item { border-bottom: 1px solid var(--line-2); padding: 14px 0; }
.ev-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.ev-n { font: 500 11px/1.5 var(--mono); color: var(--accent); }
.ev-src { font: 400 12px/1.5 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.ev-score { margin-left: auto; font: 500 12px/1.5 var(--mono); color: var(--ink-2); white-space: nowrap; }
.ev-text { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
details.ev-text summary {
  cursor: pointer; color: var(--accent); font-size: 12.5px; list-style: none;
}
details.ev-text summary::-webkit-details-marker { display: none; }
details.ev-text[open] summary { margin-bottom: 6px; }

/* ── compare table ────────────────────────────────────────────────────── */
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.cmp thead th {
  font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
}
.cmp tbody th { font-weight: 500; color: var(--ink-2); width: 116px; }
.cmp td { color: var(--ink); }
.cmp td.pol { font: 400 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.pol-name { display: block; font: 500 13px/1.5 var(--sans); color: var(--ink); }
.pol-file { display: block; font: 400 11px/1.5 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.verdict { display: flex; gap: 14px; margin-top: 24px; padding: 16px 18px; background: var(--accent-bg); border-radius: var(--radius); }
.verdict-h { font: 500 10.5px/1.6 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--accent-dk); white-space: nowrap; }
.verdict p { margin: 0; font-size: 14px; }
.verdict p + p { margin-top: 8px; color: var(--ink-2); }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 2px;
  font: 500 11.5px/1.5 var(--mono); white-space: nowrap;
}
.pill.ok { background: #e7f2ec; color: var(--ok); }
.pill.bad { background: #fbeae9; color: var(--bad); }
.pill.warn { background: #fbf3e2; color: var(--warn); }
.pill.none { background: var(--line-2); color: var(--ink-2); }

/* ── footer ───────────────────────────────────────────────────────────── */
.foot {
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
  align-items: baseline; max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px;
}
.foot-author { color: var(--ink-2); }
.foot-author a { font-weight: 500; text-decoration: none; }
.foot-author a:hover { text-decoration: underline; }

/* ── responsive ───────────────────────────────────────────────────────── */

/* Tablet / phone: one column. The console is the reason someone opened this
   page, so on a narrow screen it comes first and the explanatory rail moves
   underneath — otherwise the demo sits below a screenful of preamble. */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 22px 16px 40px;
  }
  .work { order: 1; }
  .rail {
    order: 2;
    margin-top: 32px;
    padding: 26px 0 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .topbar { height: 52px; padding: 0 16px; }
  .badge { display: none; }
  .topnav { gap: 14px; font-size: 13px; }
  .brand-name { font-size: 15px; }

  .askbar { flex-direction: column; }
  .btn { width: 100%; }

  /* Four metrics become a readable 2x2 instead of four cramped columns. */
  .meta { gap: 18px 20px; }
  .metric { flex: 1 1 40%; min-width: 0; }

  .result-head { flex-direction: column; gap: 5px; padding: 12px 16px; }
  .result-body { padding: 16px; }
  .answer { font-size: 16px; }
  .verdict { flex-direction: column; gap: 8px; padding: 14px 16px; }

  /* Touch targets: 44px minimum, per the usual platform guidance. */
  .chip { padding: 10px 14px; font-size: 13.5px; }
  .tab { padding-bottom: 13px; }
  .foot { padding: 20px 16px 36px; flex-direction: column; gap: 6px; }
}

/* Phone: a four-column comparison table cannot work here, so each policy
   becomes its own labelled card. The captions come from data-label on the
   cells (set in app.js) because the table head is hidden. */
@media (max-width: 700px) {
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp, .cmp tbody, .cmp tr, .cmp td { display: block; width: 100%; }
  .cmp tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 14px;
  }
  .cmp td { border: 0; padding: 7px 0; }
  .cmp td::before {
    content: attr(data-label);
    display: block; margin-bottom: 4px;
    font: 500 10.5px/1 var(--mono); letter-spacing: .07em;
    text-transform: uppercase; color: var(--ink-3);
  }
  .cmp td.pol { padding: 0 0 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
  .cmp td.pol::before { display: none; }
}

/* Small phone: tighten the top bar so brand + links never collide. */
@media (max-width: 430px) {
  .topbar { padding: 0 12px; }
  .topnav { gap: 12px; font-size: 12.5px; }
  .mark { width: 24px; height: 24px; }
  .shell { padding: 18px 13px 34px; }
  .answer { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar i { animation: none; }
}

/* ── architecture responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .flow-step { grid-template-columns: 1fr; gap: 8px; }
  .flow-id { display: inline; margin: 0 10px 0 0; }
  .flow-name { display: inline; }
  .stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .contract { grid-template-columns: 1fr; gap: 12px 0; }
  .stack { grid-template-columns: 1fr; }
  .sec-h { font-size: 18px; }
}
