:root {
  --paper: #f6f5f0;
  --sheet: #fbfaf6;
  --card: #ffffff;
  --ink: #1d211f;
  --ink-2: #3b403d;
  --muted: #6d726e;
  --faint: #9a9e99;
  --hair: #e4e2da;
  --hair-2: #eeece5;
  --green: #2f5e45;
  --green-ink: #24503a;
  --green-tint: #dfe9df;
  --green-wash: #eef4ee;
  --amber: #8a5b00;
  --amber-tint: #f6ecd3;
  --red: #9a2d22;
  --red-tint: #f5e1dc;
  --blue: #2c4f7c;
  --strip: #151715;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.005em; margin: 0; }

/* ── top strip + bar ─────────────────────────────── */
.strip {
  background: var(--strip); color: #f2f2ee; height: 30px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.06em;
}
.strip b { font-weight: 700; text-transform: uppercase; }
.strip span { opacity: 0.85; letter-spacing: 0.01em; }

.bar {
  position: sticky; top: 0; z-index: 30; background: rgba(246, 245, 240, 0.94);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--hair);
}
.bar-in { max-width: 1240px; margin: 0 auto; padding: 0 28px; height: 58px; display: flex; align-items: center; gap: 28px; }
.mark { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.mark small { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-left: 8px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 6px; color: var(--ink-2); font-size: 14px; }
.nav a:hover { background: var(--hair-2); }
.nav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.ask-pill {
  margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 340px;
  background: var(--card); border: 1px solid var(--hair); border-radius: 999px; padding: 7px 8px 7px 16px;
  color: var(--muted); font-size: 14px; text-align: left; box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.ask-pill:hover { border-color: #cfcdc4; }
.ask-pill .spark { color: var(--green); font-size: 13px; }
.ask-pill kbd { margin-left: auto; font: 11px var(--mono); color: var(--faint); border: 1px solid var(--hair); border-radius: 5px; padding: 1px 6px; background: var(--sheet); }
.who { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: right; line-height: 1.25; }
.who b { display: block; color: var(--ink); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 34px 28px 120px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 0 28px 40px; font-size: 12px; color: var(--faint); }

/* ── type helpers ─────────────────────────────── */
.eyebrow { font-size: 11.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 17px; color: var(--ink-2); margin: 10px 0 0; max-width: 760px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--serif); }
.num { font-variant-numeric: tabular-nums; }

/* ── evidence-able values ─────────────────────────── */
.ev { border-bottom: 1px dotted #9db3a5; cursor: pointer; }
.ev:hover { background: var(--green-wash); border-bottom-color: var(--green); }
.hot { color: var(--red); font-weight: 600; }
.hot.ev { border-bottom-color: #d39a92; }

/* ── buttons & chips ─────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); background: var(--card); border-radius: 7px; padding: 7px 13px; font-size: 13.5px; white-space: nowrap; }
.btn:hover { border-color: #cbc9bf; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--green-ink); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { background: var(--green-wash); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 5px; background: var(--hair-2); color: var(--ink-2); white-space: nowrap; }
.chip.green { background: var(--green-tint); color: var(--green-ink); }
.chip.amber { background: var(--amber-tint); color: var(--amber); }
.chip.red { background: var(--red-tint); color: var(--red); }
.chip.outline { background: transparent; border: 1px solid var(--hair); color: var(--muted); }

/* ── Today ─────────────────────────────── */
.hello h1 { font-size: 40px; margin-top: 8px; }
.hello .quietline { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.hello .quietline a { color: var(--green-ink); border-bottom: 1px solid #b9cdbf; }
.block { margin-top: 38px; }
.block-h { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.block-h h2 { font-size: 22px; }
.block-h .count { font-size: 13px; color: var(--muted); }
.block-h .right { margin-left: auto; font-size: 13px; }

.att { display: grid; grid-template-columns: 6px 1fr auto; gap: 0 22px; padding: 20px 0 20px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.att:hover { background: linear-gradient(90deg, rgba(255,255,255,0.0), rgba(255,255,255,0.75) 8%, rgba(255,255,255,0.75)); }
.att .rule { border-radius: 3px; background: var(--amber); }
.att.critical .rule { background: var(--red); }
.att .lvl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--amber); }
.att.critical .lvl { color: var(--red); }
.att .who-line { display: flex; align-items: baseline; gap: 10px; margin-top: 3px; }
.att .name { font-family: var(--serif); font-size: 21px; }
.att .ent { font-size: 12.5px; color: var(--faint); }
.att .line { font-size: 15.5px; margin-top: 4px; }
.att .why { font-size: 14px; color: var(--muted); margin-top: 3px; max-width: 760px; }
.att .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 190px; }
.att .due { font-size: 13px; color: var(--ink-2); }
.att .acts { display: flex; gap: 6px; }

.up { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.up:hover .nm { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.up .dt { font-size: 13px; color: var(--muted); }
.up .nm { font-family: var(--serif); font-size: 18px; }
.up .what { font-size: 13.5px; color: var(--muted); margin-left: 8px; }
.more-line { padding: 12px 0; font-size: 13.5px; color: var(--muted); }
.more-line a { color: var(--green-ink); border-bottom: 1px solid #b9cdbf; }

/* ── File ─────────────────────────────── */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.file-head { display: flex; align-items: flex-start; gap: 24px; }
.file-head h1 { font-size: 38px; margin-top: 6px; }
.file-head .sub { color: var(--ink-2); margin-top: 4px; }
.file-head .keys { display: flex; gap: 22px; margin-top: 14px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.file-head .keys b { color: var(--ink); font-weight: 600; font-size: 15px; }
.file-head .right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.banner { margin-top: 22px; display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--hair); border-left: 4px solid var(--red); border-radius: 8px; padding: 12px 16px; cursor: pointer; }
.banner.amber { border-left-color: var(--amber); }
.banner .lvl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--red); white-space: nowrap; }
.banner.amber .lvl { color: var(--amber); }
.banner .t { font-size: 14.5px; }
.banner .go { margin-left: auto; color: var(--green-ink); font-size: 13.5px; white-space: nowrap; }

.tabs { display: flex; gap: 28px; margin-top: 26px; border-bottom: 1px solid var(--hair); }
.tabs a { padding: 10px 2px; font-size: 15px; color: var(--ink-2); }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tabs a .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: 2px; }

.ws { display: grid; grid-template-columns: 250px 1fr; gap: 0; margin-top: 0; min-height: 560px; }
.side-nav { border-right: 1px solid var(--hair); padding: 24px 22px 24px 0; }
.side-nav .eyebrow { margin: 0 0 12px 2px; }
.side-nav a { display: block; padding: 8px 12px; margin: 2px 0; border-radius: 7px; font-size: 14px; color: var(--ink-2); }
.side-nav a:hover { background: var(--hair-2); }
.side-nav a.on { background: var(--green-tint); color: var(--green-ink); }
.side-nav a .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-left: 7px; vertical-align: 2px; }
.side-nav select { width: 100%; padding: 8px 10px; border: 1px solid var(--hair); border-radius: 7px; background: var(--card); font: 13px var(--sans); margin-bottom: 20px; }
.side-nav .req { display: block; padding: 10px 12px; border-radius: 7px; margin: 2px 0 14px; }
.side-nav .req .d { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.side-nav .req .t { font-size: 14px; }
.side-nav .req.on { background: var(--green-tint); }
.side-nav .req:hover:not(.on) { background: var(--hair-2); }

.sec { padding: 24px 0 24px 36px; }
.sec .kicker { display: flex; align-items: center; justify-content: space-between; }
.sec h2 { font-size: 30px; margin-top: 6px; }
.meta3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.meta3 .k { font-size: 12px; color: var(--muted); }
.meta3 .v { font-size: 14.5px; margin-top: 1px; }
.headline { font-weight: 600; font-size: 17px; margin: 22px 0 8px; max-width: 820px; }
.sec p { margin: 8px 0; max-width: 780px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; background: var(--sheet); border: 1px solid var(--hair-2); border-radius: 8px; padding: 16px 18px; margin-top: 18px; }
.facts .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts .v { margin-top: 4px; font-size: 14.5px; }
.sec ul.plain { margin: 10px 0 0; padding-left: 18px; max-width: 780px; color: var(--ink-2); }
.sec ul.plain li { margin: 5px 0; }
.srcline { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--hair); }
.srcline .k { font-size: 12px; color: var(--muted); }
.srcline .v { font-size: 14px; }

table.t { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--hair); }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--hair-2); font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 600; border-bottom: none; border-top: 1px solid var(--hair); }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--sheet); }

.checks { margin-top: 14px; }
.check { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--hair-2); align-items: baseline; }
.check .ic { font-size: 13px; text-align: center; }
.check.breach .ic { color: var(--red); } .check.exception .ic { color: var(--amber); } .check.ok .ic { color: var(--green); } .check.open .ic { color: var(--faint); }
.agentline { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.agentline::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.watch { margin-top: 16px; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; background: var(--card); }
.watch .w { display: grid; grid-template-columns: 1.3fr 2fr 0.7fr 0.7fr 0.7fr 0.9fr; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--hair-2); align-items: start; font-size: 14px; }
.watch .w:last-child { border-bottom: none; }
.watch .w.h { background: var(--sheet); font-size: 12px; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.watch .w .lbl { font-weight: 600; }
.watch .w .obs { color: var(--muted); font-size: 13px; }

.live-box { margin-top: 18px; border: 1px dashed #c9b98a; border-radius: 10px; padding: 14px 16px; background: #fffdf5; }
.live-box .eyebrow { color: var(--amber); }
.live-box .lv { display: grid; grid-template-columns: 1.6fr 0.8fr 0.8fr 0.8fr 0.9fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-2); font-size: 14px; align-items: baseline; }
.live-box .lv:last-child { border-bottom: none; }
.live-box .lv.h { font-size: 12px; color: var(--muted); }
.pr.cleared { color: var(--faint) !important; font-weight: 400; }
details.fold > summary { cursor: pointer; list-style: none; padding: 14px 0; border-bottom: 1px solid var(--hair); font-size: 14px; color: var(--ink-2); }
details.fold > summary::before { content: "▸ "; color: var(--muted); }
details.fold[open] > summary::before { content: "▾ "; }
.role { font-size: 12px; color: var(--faint); }
.preserved { margin-top: 22px; background: var(--sheet); border: 1px solid var(--hair-2); border-radius: 8px; padding: 14px 18px; }
.preserved b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.preserved div { font-size: 13.5px; color: var(--muted); margin-top: 3px; }

.reqhead { padding: 22px 0 18px 36px; border-bottom: 1px solid var(--hair); display: flex; align-items: flex-start; }
.reqhead .d { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.reqhead .t { font-family: var(--serif); font-size: 22px; margin-top: 4px; }
.reqhead .a { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.reqhead .chip { margin-left: auto; }

/* ── Book ─────────────────────────────── */
.bookbar { display: flex; gap: 12px; align-items: center; margin-top: 26px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg a { padding: 7px 14px; font-size: 13.5px; color: var(--ink-2); }
.seg a.on { background: var(--ink); color: #fff; }
.search { flex: 1; min-width: 240px; max-width: 420px; border: 1px solid var(--hair); background: var(--card); border-radius: 8px; padding: 8px 12px; font: 14px var(--sans); }
.prio-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.prio-row a { font-size: 13px; padding: 5px 11px; border: 1px solid var(--hair); border-radius: 999px; background: var(--card); color: var(--ink-2); }
.prio-row a.on { border-color: var(--ink); color: var(--ink); background: var(--sheet); }
.prio-row a b { font-weight: 600; margin-left: 4px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pr { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.pr.Critical { color: var(--red); } .pr.High { color: var(--amber); } .pr.Medium { color: var(--blue); } .pr.Low { color: var(--muted); } .pr.None { color: var(--faint); font-weight: 400; }

/* ── drawer (evidence) ─────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(20, 22, 20, 0.18); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100vw; background: var(--paper); border-left: 1px solid var(--hair); z-index: 61; transform: translateX(100%); transition: transform 0.2s ease, right 0.2s ease; overflow-y: auto; }
.drawer.open { transform: none; box-shadow: -12px 0 40px rgba(0,0,0,0.06); }
.drawer { visibility: hidden; transition: transform 0.2s ease, right 0.2s ease, visibility 0s linear 0.2s; }
.drawer.open { visibility: visible; transition: transform 0.2s ease, right 0.2s ease, visibility 0s; }
.drawer:not(.open) { pointer-events: none; }
body.chat-open .drawer.open { right: 460px; width: 480px; }
body.chat-open .scrim { right: 460px; }
.drawer .in { padding: 26px 28px 40px; }
.drawer .x { position: absolute; top: 18px; right: 18px; border: none; background: none; font-size: 20px; color: var(--muted); }
.drawer h3 { font-size: 26px; margin-top: 6px; }
.drawer .big { font-family: var(--serif); font-size: 34px; margin-top: 12px; }
.doc { margin-top: 20px; background: var(--card); border: 1px solid var(--hair); border-radius: 8px; padding: 18px 20px; }
.doc .dt { font-weight: 600; }
.doc .dm { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doc blockquote { margin: 14px 0 0; padding: 12px 14px; background: #fbf6e3; border-left: 3px solid #d9b85a; font-family: var(--serif); font-size: 15.5px; line-height: 1.5; }
.formula { margin-top: 18px; font-family: var(--mono); font-size: 13px; background: var(--card); border: 1px solid var(--hair); border-radius: 8px; padding: 12px 14px; }
.inputs { margin-top: 10px; }
.inputs .i { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--hair-2); font-size: 14px; }
.rule-note { margin-top: 16px; font-size: 13.5px; padding: 10px 12px; border-radius: 7px; background: var(--green-wash); color: var(--green-ink); }
.hist { margin-top: 8px; }
.hist .h { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; border-bottom: 1px dashed var(--hair); }
.drawer .sub-h { margin-top: 26px; }

/* ── chat ─────────────────────────────── */
.chat { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; z-index: 50; background: var(--card); border-left: 1px solid var(--hair); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.2s ease; }
.chat.open { transform: none; box-shadow: -14px 0 44px rgba(0,0,0,0.07); }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.chat-h .t { font-family: var(--serif); font-size: 19px; }
.chat-h .ctx { font-size: 12px; color: var(--muted); background: var(--hair-2); border-radius: 5px; padding: 2px 8px; }
.chat-h .x { margin-left: auto; border: none; background: none; font-size: 20px; color: var(--muted); }
.chat-h .clr { border: none; background: none; font-size: 12.5px; color: var(--muted); }
.thread { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 14px 14px 4px 14px; max-width: 85%; font-size: 14.5px; }
.msg.ai { font-size: 14.5px; color: var(--ink); max-width: 100%; }
.msg.ai p { margin: 0 0 8px; }
.msg.ai ul { margin: 6px 0 8px; padding-left: 18px; }
.msg.ai li { margin: 4px 0; }
.msg.ai table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
.msg.ai th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--hair); padding: 5px 6px; }
.msg.ai td { border-bottom: 1px solid var(--hair-2); padding: 6px; font-variant-numeric: tabular-nums; }
.msg.ai .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg.ai .links a { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid #c9d8cd; color: var(--green-ink); background: var(--green-wash); }
.msg.ai .links a:hover { border-color: var(--green); }
.msg.ai a[data-evk] { color: var(--green-ink); border-bottom: 1px dotted var(--green); }
.msg.ai a[data-evk]:hover { background: var(--green-wash); }
.msg.ai .src { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.msg.ai .nav-note { font-size: 12.5px; color: var(--green-ink); margin-bottom: 6px; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-right: 4px; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; } .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 10px; }
.sugs button { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--hair); background: var(--sheet); color: var(--ink-2); }
.sugs button:hover { border-color: #c4c2b8; }
.chat-in { border-top: 1px solid var(--hair); padding: 12px 14px 14px; display: flex; gap: 8px; }
.chat-in input { flex: 1; border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; font: 14.5px var(--sans); background: var(--paper); }
.chat-in input:focus { outline: 2px solid var(--green-tint); border-color: #b9cdbf; }
.chat-foot { font-size: 11px; color: var(--faint); padding: 0 16px 12px; }
body.chat-open main, body.chat-open .bar-in, body.chat-open .foot { margin-right: 460px; margin-left: max(0px, calc((100vw - 460px - 1240px) / 2)); }

.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { background: #fff4cf; } 100% { background: transparent; } }

/* mini chart */
.spark-chart { margin-top: 18px; background: var(--card); border: 1px solid var(--hair-2); border-radius: 8px; padding: 14px 16px 6px; }
.spark-chart .lbl { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .strip { padding: 0 16px; } .strip span { display: none; }
  .bar-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 6px 18px; }
  .ask-pill { order: 3; min-width: 0; width: 100%; flex: 1 1 100%; margin: 0 0 4px; }
  .who, .mark small { display: none; }
  main { padding: 24px 16px 90px; } .foot { padding: 0 16px 30px; }
  .hello h1 { font-size: 32px; } .file-head { flex-direction: column; gap: 12px; } .file-head .right { margin-left: 0; align-items: flex-start; } .file-head h1 { font-size: 30px; }
  table.t { display: block; overflow-x: auto; white-space: nowrap; }
  .up { grid-template-columns: 1fr; gap: 2px; } .banner { flex-wrap: wrap; } .banner .go { margin-left: 0; }
  body.chat-open main, body.chat-open .bar-in, body.chat-open .foot { margin: 0; }
  .chat { width: 100vw; } body.chat-open .drawer { right: 0; width: 100vw; z-index: 70; }
  .tabs { gap: 18px; overflow-x: auto; } .reqhead { flex-wrap: wrap; gap: 8px; }
  .ws { grid-template-columns: 1fr; } .side-nav { border-right: none; border-bottom: 1px solid var(--hair); }
  .sec, .reqhead { padding-left: 0; }
  .att { grid-template-columns: 6px 1fr; } .att .side { grid-column: 2; align-items: flex-start; margin-top: 10px; }
  .meta3, .facts { grid-template-columns: 1fr; }
  .watch .w { grid-template-columns: 1fr 1fr; }
}
.ws > * { min-width: 0; }

/* ── theme switch helpers ─────────────────────────── */
.t-bank { display: none; }
[data-theme="bank"] .t-bank { display: inline; }
[data-theme="bank"] .t-living { display: none; }

/* ── Banking system theme: enterprise navy, sans, dense, panelled ─────────────── */
[data-theme="bank"] {
  --paper: #eef1f5; --sheet: #f6f8fa; --card: #ffffff;
  --ink: #18212d; --ink-2: #2f3a48; --muted: #5d6878; --faint: #8a94a3;
  --hair: #d5dbe3; --hair-2: #e7ebf0;
  --green: #1d5aa6; --green-ink: #174a8a; --green-tint: #e1ebf7; --green-wash: #eef4fb;
  --amber: #9a5b00; --amber-tint: #fdf0d8; --red: #b42318; --red-tint: #fde7e5; --blue: #1d5aa6;
  --strip: #06132a;
  --serif: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
[data-theme="bank"] body { font-size: 14.5px; }
[data-theme="bank"] h1, [data-theme="bank"] h2, [data-theme="bank"] h3 { font-weight: 600; letter-spacing: 0; }
[data-theme="bank"] .strip { height: 24px; font-size: 10.5px; }
[data-theme="bank"] .bar { background: #0f2a52; border-bottom: 0; backdrop-filter: none; }
[data-theme="bank"] .bar-in { height: 52px; }
[data-theme="bank"] .mark { color: #fff; font-size: 16px; font-weight: 600; display: flex; align-items: center; }
[data-theme="bank"] .mark small { color: #a9bad3; letter-spacing: 0.04em; }
[data-theme="bank"] .logo { font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: 0.08em; background: #fff; color: #0f2a52; padding: 3px 6px; border-radius: 2px; margin-right: 10px; }
[data-theme="bank"] .nav a { color: #d3dded; border-radius: 0; padding: 16px 12px; }
[data-theme="bank"] .nav a:hover { background: rgba(255,255,255,0.08); }
[data-theme="bank"] .nav a.on { color: #fff; box-shadow: inset 0 -3px 0 #6ea6ff; }
[data-theme="bank"] .ask-pill { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #c7d3e5; border-radius: 4px; }
[data-theme="bank"] .ask-pill .spark { color: #9cc3ff; }
[data-theme="bank"] .ask-pill kbd { background: transparent; color: #a9bad3; border-color: rgba(255,255,255,0.25); }
[data-theme="bank"] .who { color: #a9bad3; } [data-theme="bank"] .who b { color: #fff; }
[data-theme="bank"] main { padding-top: 22px; }
[data-theme="bank"] .eyebrow { letter-spacing: 0.06em; font-size: 11px; font-weight: 600; }
[data-theme="bank"] .hello h1 { font-size: 26px; margin-top: 4px; }
[data-theme="bank"] .lede { font-size: 15px; }
[data-theme="bank"] .block { background: var(--card); border: 1px solid var(--hair); border-radius: 4px; padding: 2px 18px 6px; margin-top: 18px; }
[data-theme="bank"] .block-h { padding: 12px 0 10px; }
[data-theme="bank"] .block-h h2 { font-size: 16px; }
[data-theme="bank"] .att { padding: 14px 0; }
[data-theme="bank"] .att:last-child, [data-theme="bank"] .up:last-of-type { border-bottom: 0; }
[data-theme="bank"] .att:hover { background: #fafcfe; }
[data-theme="bank"] .att .rule { border-radius: 0; }
[data-theme="bank"] .att .name, [data-theme="bank"] .up .nm { font-size: 16px; font-weight: 600; }
[data-theme="bank"] .att .line { font-size: 14.5px; }
[data-theme="bank"] .crumbs { margin-bottom: 8px; }
[data-theme="bank"] .file-head { background: var(--card); border: 1px solid var(--hair); border-radius: 4px 4px 0 0; padding: 16px 20px; }
[data-theme="bank"] .file-head h1 { font-size: 24px; margin-top: 2px; }
[data-theme="bank"] .banner { border-radius: 3px; margin-top: 12px; }
[data-theme="bank"] .tabs { margin-top: 12px; background: var(--card); border: 1px solid var(--hair); border-bottom: 0; padding: 0 20px; gap: 22px; }
[data-theme="bank"] .tabs a { padding: 11px 2px; font-size: 14px; font-weight: 600; color: var(--muted); }
[data-theme="bank"] .tabs a.on { color: var(--green-ink); box-shadow: inset 0 -3px 0 var(--green); }
[data-theme="bank"] .ws { background: var(--card); border: 1px solid var(--hair); border-radius: 0 0 4px 4px; }
[data-theme="bank"] .side-nav { background: var(--sheet); padding: 16px 0; }
[data-theme="bank"] .side-nav .eyebrow { padding: 0 16px; }
[data-theme="bank"] .side-nav a { border-radius: 0; margin: 0; padding: 8px 16px; font-size: 13.5px; }
[data-theme="bank"] .side-nav a.on { background: var(--card); color: var(--green-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--green); }
[data-theme="bank"] .side-nav .req { border-radius: 0; margin: 0 0 8px; padding: 8px 16px; }
[data-theme="bank"] .side-nav .req.on { background: var(--card); box-shadow: inset 3px 0 0 var(--green); }
[data-theme="bank"] .side-nav select { margin: 0 16px 16px; width: calc(100% - 32px); }
[data-theme="bank"] .sec { padding: 20px 24px 24px; }
[data-theme="bank"] .reqhead { padding: 18px 24px 14px; }
[data-theme="bank"] .reqhead .t { font-size: 18px; font-weight: 600; }
[data-theme="bank"] .sec h2 { font-size: 20px; }
[data-theme="bank"] .headline { font-size: 15px; margin-top: 16px; }
[data-theme="bank"] .meta3 { background: var(--sheet); border: 1px solid var(--hair-2); border-radius: 3px; padding: 10px 14px; }
[data-theme="bank"] table.t { border: 1px solid var(--hair); }
[data-theme="bank"] table.t th { background: var(--sheet); text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; font-weight: 600; padding: 9px 10px; }
[data-theme="bank"] table.t td { padding: 9px 10px; }
[data-theme="bank"] table.t tbody tr:nth-child(even) td { background: #fafbfd; }
[data-theme="bank"] .btn { border-radius: 3px; font-weight: 600; }
[data-theme="bank"] .chip { border-radius: 2px; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
[data-theme="bank"] .facts, [data-theme="bank"] .preserved, [data-theme="bank"] .live-box, [data-theme="bank"] .watch, [data-theme="bank"] .spark-chart, [data-theme="bank"] .doc, [data-theme="bank"] .formula { border-radius: 3px; }
[data-theme="bank"] .preserved b { font-size: 15px; }
[data-theme="bank"] .drawer h3 { font-size: 20px; }
[data-theme="bank"] .drawer .big { font-size: 26px; font-weight: 600; }
[data-theme="bank"] .doc blockquote { font-size: 14px; background: #fffbea; }
[data-theme="bank"] .chat-h { background: #0f2a52; border-bottom: 0; }
[data-theme="bank"] .chat-h .t { color: #fff; font-size: 16px; font-weight: 600; }
[data-theme="bank"] .chat-h .ctx { background: rgba(255,255,255,0.14); color: #d3dded; }
[data-theme="bank"] .chat-h .x, [data-theme="bank"] .chat-h .clr { color: #c7d3e5; }
[data-theme="bank"] .msg.me { background: var(--green); border-radius: 6px; }
[data-theme="bank"] .seg a.on { background: var(--green); }
[data-theme="bank"] .prio-row a { border-radius: 3px; }
[data-theme="bank"] .search, [data-theme="bank"] .chat-in input { border-radius: 3px; }

/* ── Demo controls: presenter-only, deliberately outside both themes ─────────────── */
.demo { position: fixed; left: 14px; bottom: 14px; z-index: 90; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.demo-pill { background: #d6157b; color: #fff; border: 2px dashed #fff; outline: 2px solid #d6157b; border-radius: 6px; padding: 5px 10px; font: 700 11px ui-monospace, Menlo, monospace; letter-spacing: 0.14em; box-shadow: 0 4px 14px rgba(214,21,123,0.35); }
.demo-panel { display: none; width: 290px; margin-bottom: 10px; background: #17121a; color: #f3e9f0; border: 2px dashed #d6157b; border-radius: 8px; padding: 14px 14px 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.demo.open .demo-panel { display: block; }
.demo-h { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #ff6fb5; }
.demo-sub { color: #bba9b5; font-size: 11px; margin-top: 3px; }
.demo-k { margin: 12px 0 6px; color: #ff6fb5; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.demo-themes { display: grid; gap: 6px; }
.demo-themes button { text-align: left; background: #241c27; color: #f3e9f0; border: 1px solid #4a3a4f; border-radius: 5px; padding: 7px 9px; font: inherit; }
.demo-themes button span { display: block; color: #bba9b5; font-size: 10.5px; }
.demo-themes button.on { border-color: #ff6fb5; box-shadow: inset 3px 0 0 #ff6fb5; }
.demo-stops { display: grid; gap: 2px; }
.demo-stops a { color: #f3e9f0; padding: 3px 6px; border-radius: 4px; }
.demo-stops a:hover { background: #2e2232; }
.demo-reset { margin-top: 12px; width: 100%; background: #d6157b; color: #fff; border: 0; border-radius: 5px; padding: 8px; font: 700 12px ui-monospace, Menlo, monospace; letter-spacing: 0.06em; }
.demo-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95; background: #17121a; color: #fff; border: 2px dashed #d6157b; border-radius: 8px; padding: 8px 14px; font: 12px ui-monospace, Menlo, monospace; }
@media print { .demo, .demo-toast { display: none; } }
[data-theme="bank"] .ask-pill .srch { color: #9cc3ff; flex: none; }
[data-theme="bank"] .chip.green { background: #e2f2e7; color: #1d6b3a; }
[data-theme="bank"] .check.ok .ic { color: #1d6b3a; }
[data-theme="bank"] .agentline::before { background: #1d6b3a; }

/* chat mode line + live answers */
.chat-mode { font-size: 12px; color: var(--muted); padding: 7px 20px; border-bottom: 1px solid var(--hair-2); background: var(--sheet); }
.chat-mode a { color: var(--green-ink); text-decoration: underline; text-underline-offset: 2px; }
.chat-mode .mode-live { color: var(--green-ink); font-weight: 600; }
.msg.ai.live .status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.msg.ai.live .status .typing span { width: 5px; height: 5px; }
.msg.ai code { font: 12.5px var(--mono); background: var(--hair-2); padding: 1px 5px; border-radius: 4px; }
.msg.ai a[data-href] { color: var(--green-ink); border-bottom: 1px solid #b9cdbf; }
.msg.ai ol { margin: 6px 0 8px; padding-left: 20px; }
