/* Genni — design system from the "Genni Web Front End" canvas.
   Warm stone ground, deep-teal accent, Newsreader display over IBM Plex Sans, Plex Mono labels, dark rail. */
:root {
  --bg: #F5F3EE;
  --panel: #FFFFFF;
  --panel-2: #FBFAF7;
  --ink: #17191E;
  --ink-2: #2A2D33;
  --ink-3: #4A4F59;
  --muted: #62666F;
  --faint: #A3A6AD;
  --line: #E3DFD5;
  --line-2: #EEEBE3;
  --line-3: #C9C4B8;
  --teal: #0E5E59;
  --teal-d: #0A4441;
  --teal-bg: #E3EFED;
  --teal-2: #5FB3AC;
  --amber: #9A4A06;
  --amber-bg: #FBEEDC;
  --amber-line: #F0D3A8;
  --amber-dot: #D08A2E;
  --red: #A8261B;
  --red-bg: #F9E4E1;
  --indigo: #34408F;
  --indigo-bg: #E6E9F7;
  --rail: #15181D;
  --rail-2: #1B1E24;
  --rail-line: #2C3038;
  --rail-on: #262A31;
  --rail-text: #C9CCD2;
  --rail-muted: #8B909A;
  /* names older screens use */
  --navy: var(--teal); --navy-2: var(--teal-d); --gold: #F2C98A;
  --green: var(--teal); --green-bg: var(--teal-bg); --blue: var(--indigo); --blue-bg: var(--indigo-bg);
  --soft: var(--line-2); --gray-bg: var(--line-2);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 25, 30, .04);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--sans);
  color: var(--ink);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-d); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.serif { font-family: var(--serif); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.grid.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* ------------------------------------------------------------------ shell: dark rail + main column */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px;
  background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; gap: 24px; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; }
.sb-brand span { font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.sb-org { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--rail-line);
  border-radius: 10px; background: var(--rail-2); color: #E6E8EC; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.sb-org:hover { border-color: #3A3F48; }
.sb-org .mark { width: 22px; height: 22px; border-radius: 6px; background: #3A3F48; color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0; }
.sb-org .name { flex-grow: 1; line-height: 1.2; }
.sb-org .name small { display: block; font-size: 11px; color: var(--rail-muted); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--rail-text);
  font-size: 14px; font-weight: 500; }
.sb-nav a:hover { background: #1F2228; color: #fff; }
.sb-nav a.on { background: var(--rail-on); color: #fff; }
.sb-nav a > span.grow { flex-grow: 1; }
.sb-nav .kbd { font-family: var(--mono); font-size: 11px; color: var(--rail-muted); }
.sb-nav .count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #F2C98A; color: #3D2303; font-size: 11px;
  font-weight: 600; display: grid; place-items: center; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 6px; }
.sb-head .eyebrow { color: var(--rail-muted); }
.sb-icon-btn { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--rail-text); cursor: pointer;
  display: grid; place-items: center; }
.sb-icon-btn:hover { background: #1F2228; color: #fff; }
.sb-brain { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: #E6E8EC; font-size: 14px; }
.sb-brain:hover { background: #1F2228; color: #fff; }
.sb-brain.on { background: var(--rail-on); color: #fff; }
.sb-brain .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sb-brain .nm { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-brain .cat { font-size: 12px; color: var(--rail-muted); }
.sb-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--rail-line); }
.sb-user .av { width: 32px; height: 32px; border-radius: 16px; background: var(--teal-bg); color: var(--teal); font-size: 12px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0; }
.sb-user .who { flex-grow: 1; min-width: 0; line-height: 1.25; }
.sb-user .who b { display: block; color: #fff; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .who span { font-size: 12px; color: var(--rail-muted); }
.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 40px; border-bottom: 1px solid var(--line); background: var(--bg);
  display: flex; align-items: center; gap: 14px; }
.topbar .crumbs { flex-grow: 1; margin: 0; font-size: 14px; color: var(--ink-3); display: flex; gap: 10px; align-items: center; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar .crumbs a { color: var(--ink-3); }
.topbar .crumbs .sep { color: var(--faint); }
.topbar .crumbs .here { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.search { width: 360px; max-width: 34vw; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  display: flex; align-items: center; gap: 8px; color: var(--muted); }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.search input { flex-grow: 1; border: 0 !important; outline: none; background: transparent; padding: 0 !important; font-size: 14px; }
.kbd-hint { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0; }
.icon-btn:hover { border-color: var(--line-3); color: var(--ink); }
.app { padding: 36px 40px 56px; width: 100%; max-width: 1480px; }
.app.flush { padding: 0; max-width: none; }
.app.auth { max-width: 1040px; margin: 0 auto; }

/* ------------------------------------------------------------------ surfaces */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel h2 + p { margin-top: 4px; }
.card-head { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { flex-grow: 1; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 12px; gap: 12px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 14px; }
.display { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.1; letter-spacing: -.015em; }
.display .quiet { color: var(--muted); }

/* ------------------------------------------------------------------ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: var(--line-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #000; }
.btn.gold { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.btn.green { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.red { background: #fff; border-color: #EBC3BD; color: var(--red); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn.quiet:hover { background: var(--line-2); }
.btn.ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.link { border: none; background: none; color: var(--teal); padding: 0; min-height: 0; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 14px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); }
label.field > * { margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #EAE6DC; gap: 2px; }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(23, 25, 30, .08); }
.pill-btn { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink);
  font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill-btn[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-bg); color: var(--teal); font-weight: 500; }
select.pill-select { width: auto; min-height: 32px; padding: 0 30px 0 12px; border-radius: 16px; background-color: var(--bg); font-size: 13px; }

/* ------------------------------------------------------------------ badges & pills */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
  background: var(--line-2); color: var(--ink-3); white-space: nowrap; }
.badge.green { background: var(--teal-bg); color: var(--teal); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--indigo-bg); color: var(--indigo); }
.badge.navy { background: var(--teal-bg); color: var(--teal); }
.badge.strike { text-decoration: line-through; }
.status { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-3); }
.status.approved, .status.verified, .status.done { background: var(--teal-bg); color: var(--teal); }
.status.proposed, .status.pending, .status.queued { background: var(--amber-bg); color: var(--amber); }
.status.corrected { background: var(--indigo-bg); color: var(--indigo); }
.status.rejected, .status.reversed { background: var(--red-bg); color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3); margin: 2px 4px 2px 0; }
.chip .sw { width: 8px; height: 8px; border-radius: 2px; }
.chip.ok { background: var(--teal-bg); border-color: transparent; color: var(--teal); }
.chip.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.cite-n { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--teal-bg); color: var(--teal);
  vertical-align: 3px; margin: 0 1px; }
.cite-n.warn { background: var(--amber-bg); color: var(--amber); }

/* ------------------------------------------------------------------ KPI tiles */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 13px; color: var(--ink-3); }
.kpi .value { font-family: var(--serif); font-size: 36px; line-height: 1; }
.kpi .value.teal { color: var(--teal); } .kpi .value.amber { color: var(--amber); } .kpi .value.red { color: var(--red); }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi .bar { height: 6px; border-radius: 3px; background: var(--teal-bg); margin-top: 4px; overflow: hidden; }
.kpi .bar > div { height: 100%; background: var(--teal); }

/* ------------------------------------------------------------------ home */
.ask-hero { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 14px 22px; display: flex; flex-direction: column;
  gap: 14px; box-shadow: var(--shadow); }
.ask-hero .line { display: flex; align-items: center; gap: 14px; }
.ask-hero input[type=text] { border: 0; box-shadow: none; padding: 0; font-size: 18px; min-height: 44px; }
.ask-hero .opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-hero .vsep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ask-hero .sugg { font-size: 13px; color: var(--ink-3); padding: 6px 4px; }
.ask-hero .sugg:hover { color: var(--teal); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--panel-2); color: var(--ink); }
.list-row .grow { flex-grow: 1; min-width: 0; font-size: 14px; }
.list-row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.list-row .date { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 64px; text-align: right; white-space: nowrap; }
.risk-row { padding: 14px 20px; display: flex; gap: 12px; border-bottom: 1px solid var(--line-2); }
.risk-row:last-child { border-bottom: 0; }
.risk-row .dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--amber-dot); flex-shrink: 0; }
.risk-row .dot.high { background: var(--red); }
.risk-row .dot.low { background: var(--teal-2); }
.risk-row .txt { font-size: 14px; line-height: 1.4; }
.risk-row .why { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------------ brain header & tabs */
.brain-head { padding: 28px 40px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.brain-head .top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.brain-head .title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brain-head .meta { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.tabs { display: flex; gap: 4px; margin: 18px 0 0; overflow-x: auto; }
.tabs a { min-height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tabs .count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
  background: var(--amber-bg); color: var(--amber); }
.tabs .count.red { background: var(--red-bg); color: var(--red); }
.brain-body { padding: 28px 40px 56px; }
.eng-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

/* engagement cards */
.eng-card { display: block; color: inherit; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: border-color .12s; }
.eng-card:hover { border-color: var(--line-3); color: inherit; }
.eng-card h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.eng-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.eng-card .stats { display: flex; gap: 20px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.eng-card .stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ink); }
.eng-card.deleting { opacity: .55; pointer-events: none; }
.icon-del { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: 6px; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-del:hover, .icon-del:focus-visible { color: var(--red); background: var(--red-bg); border-color: #EBC3BD; outline: none; }
.window { min-width: 260px; }
.window .bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.window .bar > div { height: 100%; background: var(--teal); }
.window.extended .bar > div { background: var(--teal-2); }
.window.closed .bar > div { background: var(--faint); }

/* ------------------------------------------------------------------ data page: collapsible versions */
.ver-list { display: flex; flex-direction: column; gap: 10px; }
.ver { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ver-head { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 20px; border: 0; background: transparent;
  cursor: pointer; text-align: left; flex-wrap: wrap; }
.ver-head:hover { background: var(--panel-2); }
.ver-head .chev { display: grid; place-items: center; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
.ver.open .ver-head .chev { transform: none; }
.ver-head .tag { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.ver-head .lbl { font-family: var(--serif); font-size: 19px; }
.ver-head .grow { flex-grow: 1; }
.ver-head .meta { font-size: 13px; color: var(--muted); }
.ver.open .ver-head { border-bottom: 1px solid var(--line-2); }
.ver-body[hidden] { display: none; }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 14px; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel-2); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ verification (queue + cards) */
.vq { display: flex; gap: 20px; align-items: flex-start; }
.vq-list { width: 440px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 230px); overflow-y: auto; padding: 3px; }
.vq-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 14px 16px; border-radius: 12px; text-align: left;
  background: #fff; border: 1px solid var(--line); cursor: pointer; }
.vq-card:hover { border-color: var(--line-3); }
.vq-card.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.vq-card.done { opacity: .6; }
.vq-card .top { display: flex; align-items: center; gap: 8px; width: 100%; }
.vq-card .rank { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.vq-card .kind { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); flex-grow: 1; }
.vq-card .text { font-size: 15px; line-height: 1.4; }
.vq-card .sub { font-size: 12px; color: var(--muted); }
.mini { height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; background: var(--amber-bg); color: var(--amber); }
.mini.verified { background: var(--teal-bg); color: var(--teal); }
.mini.corrected { background: var(--indigo-bg); color: var(--indigo); }
.mini.rejected { background: var(--red-bg); color: var(--red); }
.vq-detail { flex-grow: 1; min-width: 0; position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 22px; }
.vq-detail h2.big { font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fact { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-size: 14px; overflow-wrap: anywhere; }
.fact .v.mono { font-size: 15px; }
.excerpt { margin: 0; padding: 18px 20px; border-radius: 12px; background: var(--bg); font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px 20px; }
.vcard.conflict { border-color: #EBC3BD; }
.vcard .statement { font-family: var(--serif); font-size: 20px; margin: 10px 0 6px; }
.vcard .value { font-family: var(--mono); font-size: 18px; }
.quote { background: var(--bg); padding: 12px 14px; border-radius: 10px; font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; }
.quote .src { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 6px; }
.meter { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; vertical-align: middle; }
.meter > div { height: 100%; background: var(--amber-dot); }
.meter.hi > div { background: var(--teal); }
.meter.lo > div { background: var(--red); }
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.correct-box { display: flex; gap: 8px; margin-top: 10px; }
.correct-box input { max-width: 220px; }

/* ------------------------------------------------------------------ ask */
.ask-page { display: flex; min-height: calc(100vh - 64px); }
.ask-main { flex-grow: 1; min-width: 0; padding: 36px 48px; display: flex; flex-direction: column; gap: 24px; }
.ask-main h1 { font-size: 34px; line-height: 1.2; }
.answer-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.answer-card .prose { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.answer-card .foot { display: flex; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.statements { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.statements li { font-size: 15px; line-height: 1.5; display: flex; gap: 10px; align-items: baseline; }
.followup { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 18px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 16px rgba(23, 25, 30, .06); margin-top: auto; }
.followup input { border: 0 !important; box-shadow: none !important; padding: 0 !important; font-size: 16px; min-height: 44px; }
.aside { width: 340px; flex-shrink: 0; border-left: 1px solid var(--line); background: var(--panel-2); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.claim-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.claim-card.warn { border-color: var(--amber-line); }
.claim-card .top { display: flex; align-items: center; gap: 8px; }
.claim-card .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.claim-card .kind { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); flex-grow: 1; }
.claim-card .st { font-size: 12px; font-weight: 500; color: var(--teal); }
.claim-card.warn .st { color: var(--amber); }
.claim-card .t { font-size: 14px; line-height: 1.45; }
.claim-card .s { font-size: 12px; color: var(--muted); }
.ask-box { display: flex; gap: 8px; }
.answer { white-space: pre-wrap; font-size: 15px; }
.cite { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.cite:last-child { border-bottom: none; }

/* ------------------------------------------------------------------ decisions */
.dec-page { display: flex; min-height: calc(100vh - 64px); }
.dec-list { width: 380px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.dec-list .filters { padding: 14px 20px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dec-list .filters button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
.dec-list .filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dec-item { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.dec-item:hover { background: var(--panel-2); color: var(--ink); }
.dec-item.on { background: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.dec-item .st { font-size: 12px; font-weight: 500; }
.dec-item .st.approved { color: var(--teal); } .dec-item .st.proposed { color: var(--amber); } .dec-item .st.rejected, .dec-item .st.reversed { color: var(--red); }
.dec-item .id { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dec-item .t { font-size: 15px; line-height: 1.4; }
.dec-item.on .t { font-weight: 500; }
.dec-detail { flex-grow: 1; min-width: 0; padding: 28px 40px; display: flex; flex-direction: column; gap: 22px; }
.dec-detail h2.big { font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.25; }
.trace { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.trace-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.trace-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.45; display: flex; gap: 8px; }
.tbox.soft { background: var(--panel-2); font-size: 14px; }
.tbox.unv { border-style: dashed; border-color: #D9A45C; background: #FDF6EC; }
.tbox.dec { border-color: var(--teal); background: var(--teal-bg); color: var(--teal-d); font-size: 14px; }
.tbox.none { border-style: dashed; border-color: var(--line-3); color: var(--ink-3); flex-direction: column; }
.tbox svg { flex-shrink: 0; margin-top: 2px; }

/* ------------------------------------------------------------------ misc components kept from earlier screens */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.versus .vs { display: grid; place-items: center; font-family: var(--serif); font-size: 20px; color: var(--red); }
.side { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel-2); }
.side .big { font-family: var(--serif); font-size: 28px; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); }
.tl-item.ok::before { border-color: var(--teal); }
.tl-item.bad::before { border-color: var(--red); }
.tl-item.gold::before { border-color: var(--amber-dot); }
.tl-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-card { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.flag { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px 18px 16px 34px; position: relative; }
.flag::before { content: ""; position: absolute; left: 16px; top: 22px; width: 8px; height: 8px; border-radius: 4px; background: var(--amber-dot); }
.flag.high::before { background: var(--red); }
.flag.low::before { background: var(--teal-2); }
.flag h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 6px 0; }
.callout { display: block; background: var(--teal-bg); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
a.callout { color: var(--ink); }
a.callout:hover { filter: brightness(.97); color: var(--ink); }
.callout.danger { background: var(--red-bg); }
.callout.warn { background: var(--amber-bg); }
.callout.ok { background: var(--teal-bg); }
.drop { display: block; border: 1.5px dashed var(--line-3); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--panel-2); cursor: pointer; }
.drop.over { border-color: var(--teal); background: var(--teal-bg); }
.pbar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.pbar > div { height: 100%; }
.pvalue { font-family: var(--serif); font-size: 24px; }
mark { background: #FBE3BF; color: var(--ink); padding: 1px 2px; border-radius: 3px; }
mark.hit { background: #FBE3BF; box-shadow: 0 0 0 3px #FBE3BF; }
.transcript { white-space: pre-wrap; font-family: var(--serif); font-size: 17px; line-height: 1.65; max-height: 70vh; overflow-y: auto; }
.cat-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-pick legend { margin-bottom: 6px; }
.cat-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.cat-card:hover { border-color: var(--line-3); }
.cat-card:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.cat-card input { margin-top: 3px; accent-color: var(--teal); }
.cat-card > span { display: flex; flex-direction: column; gap: 2px; }
.proc-status { margin: 16px 0 0; }
.proc-status.busy { border-color: var(--amber-line); background: #FDF6EC; }

/* drawer / modal / toasts */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(23, 25, 30, .32); display: flex; justify-content: flex-end; }
.drawer .sheet { width: min(620px, 100%); height: 100%; background: #fff; overflow-y: auto; padding: 24px 28px; box-shadow: -6px 0 24px rgba(0, 0, 0, .12); }
.modal { position: fixed; inset: 0; z-index: 45; background: rgba(23, 25, 30, .4); display: grid; place-items: center; padding: 16px; }
.modal .box { width: min(640px, 100%); max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 16px; padding: 24px 28px; }
.modal .box h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; }
.modal .box.wide { width: min(860px, 100%); }
.picker { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; background: var(--panel-2); }
.picker legend { padding: 0 6px; }
.pk-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-filters select { width: auto; flex: 0 1 auto; }
.pk-bar { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.pk-bar .grow { flex-grow: 1; }
.pk-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pk-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pk-row:last-child { border-bottom: 0; }
.pk-row:hover { background: var(--panel-2); }
.pk-row.on { background: var(--teal-bg); }
.pk-row input { margin-top: 3px; accent-color: var(--teal); width: 16px; height: 16px; flex-shrink: 0; }
.pk-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.close-x { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; width: 40px; height: 40px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); max-width: 560px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--teal); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 22px; margin-bottom: 6px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--teal); animation: spin .8s linear infinite;
  display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.2s ease-in-out 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(208, 138, 46, .35); } }

/* presenter guide */
.guide { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; z-index: 30; background: #fff; border-left: 1px solid var(--line);
  box-shadow: -6px 0 20px rgba(0, 0, 0, .08); overflow-y: auto; padding: 18px 18px 40px; }
body.guide-open .main { margin-right: 380px; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.step.current { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.step.done { opacity: .6; }
.step .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; margin-right: 6px; }
.step.done .num { background: var(--teal); }
.step .say { font-size: 13.5px; color: var(--ink); margin: 8px 0; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.step .say::before { content: "Say: "; font-weight: 600; color: var(--teal); }
.step .spread { flex-wrap: nowrap; }

/* sign-in */
.login { max-width: 1000px; margin: 48px auto; padding: 0 24px; }
.login-hero { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.login-hero .logo svg { width: 44px; height: 44px; }
.login-hero h1 { font-size: 52px; letter-spacing: -.02em; }
.login-hero p { color: var(--ink-3); max-width: 640px; margin: 0; font-size: 16px; }
.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.persona-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; }
.persona-card:hover { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.persona-card b { display: block; font-weight: 600; }
.persona-card .org { font-size: 12px; color: var(--muted); }
.persona-card p { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--teal-bg); color: var(--teal);
  font-size: 13px; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

@media (max-width: 1100px) {
  .grid.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-grid, .facts { grid-template-columns: 1fr 1fr; }
  .aside { display: none; }
  .search { display: none; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .app, .brain-body { padding: 24px 16px 40px; }
  .topbar, .brain-head { padding-left: 16px; padding-right: 16px; }
  .vq { flex-direction: column; } .vq-list { width: 100%; max-height: none; } .vq-detail { position: static; }
  .dec-page { flex-direction: column; } .dec-list { width: 100%; border-right: 0; }
  .versus, .form-grid, .grid.kpis-4 { grid-template-columns: 1fr; }
  body.guide-open .main { margin-right: 0; } .guide { width: 100%; }
  .display { font-size: 34px; }
}
/* synthetic data studio: ground truth highlighted in generated documents */
mark.gt { background: var(--teal-bg); color: var(--ink); }
mark.neg { background: transparent; color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--amber); }
