/* pii/style.css — linked after tokens.css.
   The one demo that re-skins the shared tokens: a sober bank look, navy and
   slate, system fonts only. Same light-dark() mechanism as tokens.css, so the
   shared theme toggle drives it. Colour carries meaning only: green filtered,
   brick raw, amber demo extras. */

:root {
  --ink:          light-dark(#16202e, #e3e8ef);
  --ink-2:        light-dark(#3b4757, #b8c2cf);
  --ink-3:        light-dark(#556274, #8e9aac);
  --paper:        light-dark(#f6f7f9, #0b1220);
  --surface:      light-dark(#ffffff, #121b2c);
  --surface-2:    light-dark(#f0f2f5, #172236);
  --row-alt:      light-dark(#f8f9fb, #141e30);
  --line:         light-dark(#d5dae1, #26324a);
  --line-strong:  light-dark(#7f8b9c, #66748e);

  --navy:         light-dark(#0b2545, #13315c);
  /* solid controls: navy in light; a lifted bank blue in dark, where navy sinks into the page */
  --action:       light-dark(#0b2545, #2b5a98);
  --action-hover: light-dark(#13315c, #336aaf);
  --navy-ink:     light-dark(#f4f6f9, #eef2f7);
  --navy-muted:   light-dark(#b4c2d6, #a9b8cc);
  --accent:       light-dark(#1f5fae, #8db4e8);
  --accent-soft:  light-dark(#e9f0f9, #18273f);

  --ok:           light-dark(#2d6a45, #7fc29a);
  --ok-soft:      light-dark(#ebf3ee, #14271d);
  --over:         light-dark(#a33a2a, #ee9786);
  --over-soft:    light-dark(#f9ece9, #2c1916);
  --warn:         light-dark(#855600, #ddb061);

  --radius: 4px;
  --shadow: none;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: var(--serif);
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

body { font-size: 15px; line-height: 1.5; }
h1, h2, h3 { line-height: 1.25; }
.box, .hl, .fig, .count, .sample, .panel-tag, textarea, input { font-variant-numeric: tabular-nums; }

button, .chip, .sample, .seg button, a { transition: color 120ms, background-color 120ms, border-color 120ms, opacity 120ms; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip:focus { left: 8px; top: 8px; position: fixed; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* micro-labels: field and panel headings */
.eyebrow, .panel h3, .field-name, .compare thead th, .who, .lv-form label {
  font-family: var(--body); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3);
}

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar { background: var(--navy); color: var(--navy-ink); border-bottom: 1px solid light-dark(var(--navy), var(--line)); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.wordmark { font-family: var(--serif); font-variant: small-caps; font-size: 19px; letter-spacing: 0.04em; }
.topbar-label { font-size: 12.5px; color: var(--navy-muted); padding-left: 16px; border-left: 1px solid color-mix(in srgb, var(--navy-muted) 40%, transparent); }
.topbar .theme-toggle {
  margin-left: auto; color: var(--navy-ink); background: transparent;
  border: 1px solid color-mix(in srgb, var(--navy-muted) 55%, transparent); border-radius: 2px;
}
.topbar .theme-toggle:hover { color: var(--navy-ink); border-color: var(--navy-ink); }
.topbar .theme-toggle:focus-visible { outline-color: var(--navy-ink); }
@media (max-width: 520px) { .topbar-label { display: none; } }

/* ── Title ────────────────────────────────────────────────────── */
.hero { padding: 32px 20px 4px; }
.eyebrow { margin: 0; }
.eyebrow a { color: var(--accent); text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.hero h1 { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 34px); font-weight: 500; letter-spacing: 0; margin: 6px 0 10px; color: var(--ink); }
.hero .lede { max-width: 66ch; color: var(--ink-2); font-size: 16px; margin: 0; }
.ba { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; max-width: 900px; }
.ba > div { margin: 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 2px; }
.ba > .ba-before { border-left-color: var(--over); }
.ba dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ok); }
.ba .ba-before dt { color: var(--over); }
.ba dd { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 720px) { .ba { grid-template-columns: 1fr; } }
.pr-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 8px; }
.pr-cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--accent); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
}
.pr-cta::after { content: "\2197"; margin-left: 6px; }
.pr-cta:hover { color: var(--navy-ink); background: var(--action); border-color: var(--action); }
.muted { color: var(--ink-3); }

/* features that exist only in the draft pull request: dashed edge, warn tag */
.in-pr { border-style: dashed; border-color: var(--line-strong); }
.in-pr .panel-tag { color: var(--warn); border-color: currentColor; }
.in-pr-list { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); max-width: 72ch; }
.in-pr-list strong { color: var(--ink); }
.in-pr code { font-family: var(--mono); font-size: 13px; padding: 0 4px; background: var(--surface-2); border-radius: 2px; }
.in-pr .meta { margin: 0; }
.in-pr .wire {
  margin: 6px 0 2px; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); background: var(--surface-2); border-radius: 2px;
}
.meta { font-size: 12.5px; color: var(--ink-3); }

/* ── Panels ───────────────────────────────────────────────────── */
main { display: grid; gap: 20px; padding-top: 20px; padding-bottom: 32px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: 18px 20px; }
.panel h2 {
  font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink);
  margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.panel h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 2px; padding: 1px 6px;
}

/* statement panels: navy top rule, a header strip, then ledger rows */
.side, .compare { padding: 0; border-top: 2px solid var(--navy); }
.side h2, .compare h2 {
  margin: 0; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  justify-content: space-between;
}
.side .panel-tag { color: var(--over); border-color: currentColor; }
.side.filtered .panel-tag { color: var(--ok); }

/* ── Compose ──────────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 10px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] { color: var(--navy-ink); background: var(--action); border-color: var(--action); }
.field { display: block; }
.field-name { display: block; margin-bottom: 6px; }
.field textarea {
  width: 100%; min-height: 40px; font-family: var(--mono); font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: 9px 12px; resize: vertical;
}
.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--action); border-radius: 2px; }
.seg button {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; height: 38px;
  color: var(--ink); background: var(--surface); border: 0; border-radius: 0; padding: 0 18px;
}
.seg button + button { border-left: 1px solid var(--action); }
.seg button:hover { background: var(--accent-soft); }
.seg button[aria-checked="true"] { color: var(--navy-ink); background: var(--action); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--action); }
button.primary {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; height: 40px; padding: 0 22px;
  color: var(--navy-ink); background: var(--action); border: 1px solid var(--action); border-radius: var(--radius);
}
button.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.controls .meta { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.live-note { margin: 12px 0 0; max-width: 68ch; }
.check[hidden], .live-note[hidden] { display: none; }

/* ── The two sides: ledger rows ───────────────────────────────── */
.sides { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 860px) { .sides { grid-template-columns: 1fr; } }
.ledger .row {
  display: grid; grid-template-columns: 8.5em 1fr; gap: 6px 14px; align-items: baseline;
  padding: 12px 16px;
}
.ledger .row + .row { border-top: 1px solid var(--line); }
.ledger .row:nth-child(even) { background: var(--row-alt); }
.ledger h3 { align-self: start; padding-top: 2px; }
@media (max-width: 560px) { .ledger .row { grid-template-columns: 1fr; } .field textarea { min-height: 7.6em; } }
.box { font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.box.reply { font-family: var(--body); font-size: 14.5px; line-height: 1.55; max-width: 68ch; }
.box.refused { padding-left: 10px; border-left: 3px solid var(--ok); }
.box.refused .muted { color: var(--ok); font-family: var(--body); font-weight: 600; }
.log-row { display: grid; grid-template-columns: 5.5em 1fr; gap: 2px 8px; align-items: baseline; }
.log-row + .log-row { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.log-row .note { grid-column: 2; justify-self: start; }
.who { font-size: 10.5px; }
.note, .badge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 2px; padding: 0 5px; line-height: 1.6;
}
.note { color: var(--ok); }
.badge { color: var(--ink-3); }
.badge.live { color: var(--accent); }

/* ── Highlights: colour plus a type tag, never colour alone ───── */
.hl { color: var(--ink); background: none; padding: 0; }
.hl.raw, .hl.mask { font-family: var(--mono); border-radius: 2px; padding: 1px 3px; white-space: nowrap; }
.hl.raw { color: var(--over); background: var(--over-soft); text-decoration: underline 1px; text-underline-offset: 3px; }
.hl.mask { color: var(--ok); background: var(--ok-soft); }
.hl .t {
  font-family: var(--body); font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  vertical-align: 1px; margin-left: 5px; text-decoration: none; display: inline-block;
}

/* ── Summary of exposure ──────────────────────────────────────── */
.compare table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.compare th, .compare td { text-align: left; padding: 10px 16px; vertical-align: baseline; overflow-wrap: anywhere; }
.compare thead th { padding-top: 12px; padding-bottom: 6px; }
.compare tbody th { font-weight: 500; color: var(--ink-2); width: 34%; }
.compare tbody tr > * { border-top: 1px solid var(--line); }
.compare tbody tr:nth-child(even) { background: var(--row-alt); }
.compare td { color: var(--ink-2); }
.compare td.l { border-left: 3px solid var(--over); }
.compare td.r { border-left: 3px solid var(--ok); }
.compare .fig { font-family: var(--mono); font-size: 22px; font-weight: 500; margin-right: 1px; color: var(--ink); }
.compare .fig.leak { color: var(--over); }
.compare .fig.safe { color: var(--ok); }
@media (max-width: 560px) {
  .compare thead { display: none; }
  .compare table, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare tbody tr > * { border-top: 0; }
  .compare tbody tr { border-top: 1px solid var(--line); padding: 8px 0; }
  .compare tbody th { padding: 4px 16px; }
  .compare td { padding: 4px 12px; margin: 4px 16px; }
  .compare td::before { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
  .compare td.l::before { content: "Without filter"; }
  .compare td.r::before { content: "With filter"; }
}

/* ── What it finds: a definition table ────────────────────────── */
.legend ul { list-style: none; margin: 0 -20px -18px; padding: 0; border-top: 1px solid var(--line); }
.legend li {
  display: grid; grid-template-columns: 11em 1fr 15em 2.5em; gap: 4px 14px; align-items: baseline;
  font-size: 13.5px; color: var(--ink-2); padding: 8px 20px; border-bottom: 1px solid var(--line);
}
.legend li:nth-child(even) { background: var(--row-alt); }
.legend li.hit { color: var(--ink); }
.legend li.hit .hl { font-weight: 700; }
.legend li.off { opacity: 0.5; }
.legend li > .hl { font-family: var(--mono); font-size: 12.5px; justify-self: start; }
.legend .kind { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.legend li.extra .kind { color: var(--warn); }
.legend .count { font-family: var(--mono); font-weight: 600; color: var(--ink); text-align: right; }
.legend .samples { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.legend .sample {
  font: inherit; font-family: var(--mono); font-size: 11.5px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 2px 8px;
}
.legend .sample:hover, .legend .sample:focus-visible { border-color: var(--accent); color: var(--accent); }
.legend li.none { display: block; color: var(--ink-2); font-weight: 600; border-bottom: 0; }
@media (max-width: 700px) {
  .legend li { grid-template-columns: 1fr auto; }
  .legend li .what, .legend li .kind { grid-column: 1 / -1; }
  .legend li .count { grid-row: 1; grid-column: 2; }
}

/* ── Your own agent ───────────────────────────────────────────── */
.live summary { font-family: var(--serif); font-size: 18px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.live .honesty { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; font-size: 14px; color: var(--ink-2); }
.lv-form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 16px; }
.lv-form label { display: grid; gap: 6px; }
.lv-form input, .lv-form select {
  font: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; height: 40px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: 0 10px;
}
.lv-form input { font-family: var(--mono); }
.lv-row { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lv-row button {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0;
  color: var(--accent); background: none; border: 0; text-decoration: underline 1px; text-underline-offset: 3px;
}
.lv-row button:hover { color: var(--ink); }

/* ── Disclosure ───────────────────────────────────────────────── */
.disclosure { padding-bottom: 40px; }
.disclosure::before { content: ""; display: block; border-top: 1px solid var(--line); margin-bottom: 16px; }
.disclosure .honesty { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-3); max-width: 70ch; }
.disclosure .honesty strong { font-weight: 700; color: var(--ink-2); }
.footnote { font-size: 12.5px; color: var(--ink-3); margin: 0; max-width: 70ch; }

/* every control keeps a visible focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.field textarea:focus-visible, .lv-form input:focus-visible, .lv-form select:focus-visible { border-color: var(--accent); }

/* Tooltips: opt-in depth on hover or keyboard focus. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 6;
  width: min(280px, 72vw);
  background: var(--navy); color: var(--navy-ink); border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left; letter-spacing: 0; text-transform: none;
  padding: 8px 10px; border-radius: 2px; white-space: normal;
}
