/* The pane's whole palette. Both stylesheets (this one and review.css) read
   it from here — retuning a colour is a one-line change, not a hunt through
   two files and a template literal. */
:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;   /* input and value-box borders */
  --wash: #f8fafc;          /* subtle panel fill */
  --hover: #eef2f7;
  --sunken: #f1f5f9;
  --indigo: #4338ca;
  --indigo-bg: #eef2ff;
  --indigo-line: #c7d2fe;
  --indigo-deep: #3730a3;
  /* muted traffic lights: clearly green/amber/red, deliberately not neon —
     the pane is read for hours, intensity fatigues */
  --green: #2e9e60;
  --green-bg: #f0fdf4;
  --green-deep: #278a53;
  --amber: #d18a2f;
  --amber-bg: #fffbeb;
  --red: #d64f4f;
  --red-bg: #fef2f2;
  --red-line: #fca5a5;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --highlight: #fde68a;     /* <mark> on matched evidence values */
  --amber-deep: #92400e;    /* text on amber tint */
  --blue-deep: #1e40af;     /* text on blue tint */
  --blue-line: #bfdbfe;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--ink);
  background: #fff;
  padding-bottom: 40px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 6px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 22px; width: auto; display: block; }
.icon-btn {
  border: none; background: none; font-size: 15px; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); }

.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }

/* ⋮ menu (Claude-style kebab): room for future entries next to Sign out */
.menu-btn { font-size: 17px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.menu-btn:hover { background: var(--hover); }
.menu-pop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 80; min-width: 168px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}
.menu-user {
  padding: 6px 9px 7px; font-size: 10.5px; color: var(--muted);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 9px; font-size: 12px; color: var(--ink); border-radius: 7px; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.btn.connected { background: var(--green); border-color: var(--green); color: #fff; }
.btn.connected:hover { background: var(--green-deep); border-color: var(--green-deep); }

.login {
  min-height: 100vh; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 24px; gap: 4px;
}
.login-logo { height: 30px; width: auto; margin-bottom: 18px; }
.login-title { font-size: 16px; font-weight: 700; line-height: 1.35; margin: 0 0 8px; }
.login-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 22px; max-width: 30ch; }
.login-btn { width: 100%; max-width: 260px; }
.login-request { display: block; margin-top: 12px; font-size: 11.5px; color: var(--indigo);
                 font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.login-request:hover { color: var(--indigo-deep); }
.login-status { margin-top: 14px; font-size: 11.5px; line-height: 1.45; color: var(--muted); min-height: 1.4em; }
.login-status.error { color: var(--red); }

.dealbar {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 8px; font-size: 11px; font-weight: 600; color: var(--muted);
  position: relative; /* anchors the ⋮ menu-pop */
}
/* searchable deal picker: input filters, list floats below */
.combo { position: relative; flex: 1; min-width: 0; }
.combo input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 4px 7px; font-size: 11.5px; color: var(--ink); font-weight: 400;
}
.combo input:disabled { background: #f8fafc; color: var(--muted); }
.combo-list {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  max-height: 210px; overflow-y: auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.combo-item {
  padding: 6px 9px; font-size: 11.5px; font-weight: 400; color: var(--ink);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-item:hover, .combo-item.active { background: #eef2f7; }
.combo-item.sel { font-weight: 600; }
.combo-none { padding: 8px 9px; font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* new-project form: compact stacked fields under the deal bar */
.newproj { margin: 0 12px 10px; padding: 9px 11px; background: var(--wash);
           border: 1px solid var(--line); border-radius: 9px; }
.np-title { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.newproj input, .newproj select, .newproj textarea {
  display: block; width: 100%; box-sizing: border-box; margin-bottom: 5px;
  border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
  padding: 5px 8px; font-size: 11.5px; font-family: inherit; color: var(--ink);
}
.newproj textarea { resize: none; }
.np-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 2px; }
.np-actions .primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.np-actions .primary:disabled { opacity: 0.6; }

.banner {
  margin: 0 12px 10px; padding: 7px 10px; border-radius: 7px;
  background: var(--blue-bg); color: var(--blue); font-size: 11.5px; line-height: 1.4;
}
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.hidden { display: none !important; }

.summary {
  margin: 0 12px 10px; padding: 9px 11px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 9px;
}
.summary-title { font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }

/* summary table: verification state × approval state */
/* count tiles: summary + filter in one control (tap to filter, tap to
   clear) — number on top, label below, equal widths so it's always one row */
.sum-chips { display: flex; gap: 5px; }
.chip {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: 0; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 2px 3px; cursor: pointer; color: var(--ink);
}
.chip .n { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.chip .l { font-size: 9px; font-weight: 600; opacity: 0.75; line-height: 1.2;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chip.chip-r { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.chip.chip-a { background: #fffbeb; color: var(--amber-deep); border-color: var(--highlight); }
.chip.chip-g { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.chip.chip-acc { background: #fffbeb; color: var(--amber-deep); border-color: var(--highlight); }
.chip.on { box-shadow: 0 0 0 2px var(--indigo-line); }
.chip.zero { opacity: 0.45; }

.verify-btn {
  margin: 0 12px 8px; width: calc(100% - 24px);
  background: var(--indigo); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.verify-btn:hover { background: var(--indigo-deep); }
.verify-btn:disabled { background: #a5b4fc; cursor: wait; }
/* slide changed since verification — a quiet amber edge says "run me again" */
.verify-btn.attn { box-shadow: 0 0 0 2px var(--amber-bg), 0 0 0 3.5px var(--amber); }
.status-line { margin: 0 12px 8px; color: var(--muted); font-size: 11.5px; min-height: 14px; }

.section-head {
  display: flex; align-items: center; gap: 6px;
  margin: 14px 12px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.section-head .count { color: var(--muted); font-weight: 600; }
.review-btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
/* one action row: Verify Slide + Review side by side — two full-width
   stacked buttons cost a row of vertical space for no information */
/* Review Workspace: the always-there door to the popup (review + deal chat) */
.review-ws { display: block; width: calc(100% - 24px); margin: 0 12px 10px; padding: 9px 12px;
             background: var(--indigo-bg); border: 1px solid var(--indigo-line);
             color: var(--indigo); border-radius: 10px; font-weight: 700; font-size: 12px;
             cursor: pointer; }
.review-ws:hover { background: var(--indigo-line); }
.app-version { color: var(--faint); font-size: 10px; margin-left: 8px; }
.verify-cap { text-align: center; font-size: 11px; color: var(--muted); margin: 0 12px 6px; }
.empty-ico { width: 72px; height: 72px; display: block; margin: 24px auto 10px; }

.action-row { display: flex; gap: 6px; margin: 0 12px 8px; }
.action-row .verify-btn { flex: 1.15; width: auto; margin: 0; }
/* deep navy from the logo's dark end — clearly distinct from the indigo
   Verify Slide button, same brand family. Doubled selector outranks
   .btn.primary. */
.btn.primary.review-cta {
  display: block; flex: 1; margin: 0;
  padding: 10px; font-size: 13px; font-weight: 600; border-radius: 8px;
  background: #1e1b4b; border-color: #1e1b4b; color: #fff; white-space: nowrap;
}
.btn.primary.review-cta:hover { background: #312e81; border-color: #312e81; }
.sec-verified { color: var(--green); } .sec-verified .dot { background: var(--green); }
/* decided, slide edit still pending — blue = transitional, not done */
.sec-pendrev { color: var(--blue); } .sec-pendrev .dot { background: var(--blue); }
.card.verified.pendrev, .card.pendrev { border-left-color: var(--blue); }
.sec-calculated { color: var(--blue); } .sec-calculated .dot { background: var(--blue); }
.sec-no_source { color: var(--amber); } .sec-no_source .dot { background: var(--amber); }
.sec-conflict { color: var(--red); } .sec-conflict .dot { background: var(--red); }

.card {
  margin: 0 12px 8px; padding: 9px 11px;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 9px;
  background: #fff;
}
/* quiet cards, loud verdicts: white face, the colored left edge carries the
   state — tinted card backgrounds competed with the content */
.card.verified { border-left-color: var(--green); }
.card.calculated { border-left-color: var(--blue); }
.card.no_source { border-left-color: var(--amber); }
.card.conflict { border-left-color: var(--red); }

.card .quote { font-weight: 700; font-size: 12.5px; margin-bottom: 3px; cursor: pointer; }
.card .quote:hover { color: var(--indigo); }
.card .meta { color: var(--muted); font-size: 11px; line-height: 1.45; }
.card .meta .doc { color: var(--ink); }
.card .rationale { color: var(--muted); font-size: 11px; margin-top: 4px; font-style: italic; }
.card .record { color: var(--red); font-weight: 600; font-size: 11.5px; margin-top: 3px; }

/* compact action row: smaller chrome, but unmistakably buttons (border,
   white face, hover) — all four fit one line at the pane's default width */
.card { margin-bottom: 12px; }
.section-head { margin-top: 14px; margin-bottom: 8px; }
.card .actions { margin-top: 7px; display: flex; gap: 3px; flex-wrap: wrap; }
.card .actions .btn { padding: 3px 6px; font-size: 10.5px; }
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 4px 9px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.primary:hover { background: var(--indigo-deep); }
.btn.done { background: var(--green); border-color: var(--green); color: #fff; }
.btn.done:hover { background: var(--green-deep); border-color: var(--green-deep); }
.tag {
  display: inline-block; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: 10px; color: var(--muted); background: #fff; margin-left: 5px;
}

.card .hint { color: var(--muted); font-size: 10.5px; margin-top: 5px; font-style: italic; }

/* slide ≠ record mini comparison on conflict cards */
.cmp { display: flex; align-items: center; gap: 6px; margin: 3px 0 4px; font-size: 11.5px; }
.cmp-box { border: 1px solid var(--line); background: #f8fafc; border-radius: 6px;
           padding: 1px 7px; font-weight: 600; }
.cmp-box.bad { background: #fef2f2; border-color: #fecaca; color: #bc4444; }
.cmp-neq { color: #d64f4f; font-weight: 700; }
.cmp-delta { color: var(--muted); font-size: 10.5px; }

/* ✦ conclusion line: the gap-explanation's finding — the one thing to read
   (the full reasoning stays folded behind "Details") */
.gapline { margin-top: 4px; font-size: 11px; color: var(--ink); line-height: 1.5; }

/* Accept button states: not yet accepted = white face, green text;
   accepted (clicked or auto) = solid green, white text */
.card .actions .btn.acc { background: #fff; border-color: var(--green); color: var(--green); }
.card .actions .btn.acc:hover { background: #f0fdf4; }
.card .actions .btn.acc.done { background: var(--green); border-color: var(--green); color: #fff; }

.card .actions .btn.chatb { border-color: var(--indigo-line); color: #4338ca; }
.card .actions .btn.chatb:hover { background: #eef2ff; }

/* calculation build-up (Derived · N inputs · View trace) */
.calc { margin-top: 6px; }
.calc summary { cursor: pointer; font-size: 11.5px; color: var(--indigo); font-weight: 600; }
.calc-ok { color: var(--green); }
.calc-bad { color: var(--red); }
.calc-na { color: var(--muted); }
.calc-formula {
  font-family: Consolas, "Courier New", monospace; font-size: 11.5px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 7px; margin: 6px 0;
}
.calc-input { display: flex; gap: 6px; font-size: 11px; padding: 2px 0; align-items: baseline; }
.calc-input .ci-label { flex: 1; color: var(--ink); }
.calc-input .ci-val { font-weight: 600; white-space: nowrap; }
.calc-input .ci-src { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* per-fact re-verify feedback */
.spin { display: inline-block; animation: ddspin 0.9s linear infinite; }
@keyframes ddspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
/* full-area loader shown in #results while a verify runs */
.empty.loading { color: #475569; }
.empty.loading .spin { font-size: 22px; margin-bottom: 8px; }
.card.busy { opacity: 0.55; }
.card.busy .actions button:not(:disabled) { pointer-events: none; }

.empty { margin: 30px 12px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }

/* per-slide verification status */
.slide-status {
  margin: 0 12px 8px; padding: 6px 10px; border-radius: 7px;
  font-size: 11.5px; font-weight: 600;
}
.slide-status.fresh { background: var(--green-bg); color: var(--green); }
.slide-status.stale { background: #fff7ed; color: var(--amber); border: 1px solid #fed7aa; }
.slide-status.unverified { background: #f8fafc; color: var(--muted); }

/* flag with comment */
.flag-box { margin-top: 7px; display: flex; gap: 6px; align-items: flex-start; }
.flag-note {
  margin-top: 6px; font-size: 11px; color: var(--amber-deep);
  background: var(--amber-bg); border-radius: 6px; padding: 4px 8px;
  white-space: pre-wrap;
}
/* live slide-change hints: amber so they register, stronger when the
   card's own number is affected */
.changed-note {
  margin-top: 6px; font-size: 11px; color: var(--amber-deep);
  background: #fffbeb; border: 1px solid var(--highlight); border-radius: 6px;
  padding: 3px 8px;
}
.changed-note.hard { color: #9a3412; background: #fff7ed; border-color: #fdba74; font-weight: 600; }
.flag-box textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 7px; font-family: inherit; font-size: 11.5px; resize: vertical;
}

/* evidence click-through (opens the Review Mode cockpit) */
.ev-link { color: var(--indigo); text-decoration: none; font-weight: 600; }
.ev-link:hover { text-decoration: underline; }

/* corroboration: which sources confirm/contradict the fact — collapsed
   list of ADDITIONAL sources under the primary citation */
.src-details { margin-top: 4px; }
.src-details summary { cursor: pointer; list-style-position: inside; }
.src-count { font-size: 10px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.src-count.warn { color: var(--amber); }
.src-line { font-size: 11px; line-height: 1.65; margin-left: 14px; }
.stance { font-weight: 700; color: var(--green); margin-right: 3px; }
.src-line.bad .stance, .stance.bad { color: var(--red); }
.src-line.rel .stance, .stance.rel { color: var(--amber); }
.stance.ok { color: var(--green); }
/* the value a source shows, after its page reference */
.val { color: #475569; font-weight: 600; margin-left: 4px; font-size: 11px; }
.val.bad { color: var(--red); }
.val.rel { color: var(--amber); }
/* red flag in front of a positive card's rationale when a source disagrees */
.warn-flag { color: var(--red); font-weight: 700; font-style: normal; margin-right: 2px; }

/* human acceptance of a standing record conflict */
.tag-accept { background: var(--amber-bg); color: var(--amber); border: 1px solid #fcd34d; }
/* one lean acceptance line for auto AND human: light grey text, only the
   tick is green — no pill, no box */
.accept-note { margin: 4px 0 1px; font-size: 10.5px; color: var(--muted); }
.accept-note .ok-tick { color: var(--green); font-weight: 700; }
.accept-persist { margin-bottom: 3px; font-size: 10.5px; color: var(--red); }
.accept-box { margin-top: 6px; padding: 6px 8px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.accept-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.btn.accept-go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.accept-go:hover { background: var(--green-deep); border-color: var(--green-deep); }
.accept-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.accept-other { display: flex; gap: 6px; margin-top: 6px; }
.accept-other textarea { flex: 1; border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px; font-size: 11px; font-family: inherit; }
.sum-acc { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.recheck-link { color: var(--indigo); text-decoration: underline; font-size: 11px; margin-left: 4px; }

/* analyst conflict resolutions */
.resolve-note { margin-top: 6px; font-size: 11px; color: var(--muted); }
.resolve-note.ok { color: var(--green); font-weight: 600; }
.resolve-note.bad { color: var(--red); font-weight: 600; }

/* Needs Review layout: bold problem line + flat source list with per-source
   resolution buttons */
/* complex conflicts (no clean X ≠ Y boxes): a QUIET two-line summary — the
   card title carries the weight, Review Mode carries the full story */
.err-head {
  margin: 4px 0 2px; font-size: 11.5px; font-weight: 400; color: var(--ink-soft);
  line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.src-flat { margin: 2px 0 3px; }
.src-flat .src-line { margin-left: 4px; }
.src-flat .val { white-space: normal; }
/* Needs Review source block: header line never wraps; value wraps below */
.src-block { padding: 3px 0 4px; border-top: 1px solid rgba(15, 23, 42, 0.06); }
.src-block:first-child { border-top: none; }
.src-head { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.src-head .ev-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-loc { white-space: nowrap; color: var(--muted); font-size: 10.5px; }
.btn.mini.icon { padding: 1px 7px; font-weight: 700; }
.src-val {
  margin: 1px 0 0 16px; font-size: 11px; font-weight: 600; color: #475569;
  line-height: 1.45; white-space: normal; word-break: break-word;
}
.src-val.bad { color: var(--red); }
.src-val.rel { color: var(--amber); }
.src-ctl { white-space: nowrap; display: flex; gap: 3px; }
.btn.mini { padding: 1px 6px; font-size: 10px; }
.src-res { font-size: 10px; font-weight: 700; border: none; background: none; padding: 0; }
.src-res.ok { color: var(--green); cursor: pointer; }
.src-res.ok:hover { color: var(--red); }
.src-res.dis { color: var(--muted); }
.src-dismissed { margin: 3px 0 0 4px; font-size: 10px; color: var(--muted); }
.src-restore { color: var(--indigo); text-decoration: underline; }
.btn.hot { border-color: var(--red); color: var(--red); font-weight: 700; }
.note-del {
  margin-left: 6px; border: none; background: none; cursor: pointer;
  color: #b45309; font-size: 11px; font-weight: 700;
}
.note-meta { display: block; margin-top: 2px; font-size: 9.5px; font-weight: 600; color: #b45309; opacity: 0.75; }
.note-del:hover { color: var(--red); }
.flag-note { display: flex; align-items: flex-start; justify-content: space-between; }

/* progressive verify: cards awaiting their verdict + reviewer badge */
.sec-pending { color: var(--muted); }
.card.pending { border-left-color: #94a3b8; background: #f8fafc; }
.card.pending .meta { color: var(--muted); }
.review-note { margin-top: 5px; font-size: 10.5px; color: var(--muted); font-style: italic; }

/* ── deal record chat dock ─────────────────────────────────────────── */
.chat-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; flex-direction: column;
  /* fixed size on open — the dock must not grow/shrink with its content */
  height: min(62vh, 480px);
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12);
}
/* the bubble wears the brand mark — white face so the blue dots pop */
.chat-fab {
  position: fixed; right: 12px; bottom: 14px; z-index: 80;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
}
.chat-fab img { width: 24px; height: 24px; display: block; }
.chat-fab:hover { border-color: var(--indigo); box-shadow: 0 4px 14px rgba(67, 56, 202, 0.35); }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.chat-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; }
.chat-tab {
  display: flex; align-items: center; gap: 4px; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.chat-tab.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.tab-x { border: none; background: none; cursor: pointer; font-size: 9px; color: inherit; opacity: 0.65; padding: 0; }
.tab-x:hover { opacity: 1; }
.chat-head-btns { white-space: nowrap; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 0; min-height: 70px; }
.chat-msg {
  margin: 4px 10px; padding: 6px 9px; border-radius: 9px;
  font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user { background: #eef2ff; margin-left: 42px; }
.chat-msg.assistant { background: #f8fafc; margin-right: 42px; border: 1px solid var(--line); }
.chat-msg.pending { color: var(--muted); font-style: italic; }
.chat-msg.sys { background: none; color: var(--muted); font-style: italic; padding: 2px 9px; }
.chat-row { display: flex; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line); }
.chat-row textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; font-size: 11.5px; font-family: inherit;
}

/* markdown-lite rendering for platform evidence chunks */
.ev-md { white-space: normal; }
.ev-md-h { font-weight: 700; font-size: 11.5px; margin: 6px 0 3px; }
.ev-md-h:first-child { margin-top: 0; }
.ev-md-p { margin: 5px 0; }
.ev-md-p:first-child { margin-top: 0; }
.ev-md-list { margin: 2px 0 4px 16px; padding: 0; }
.ev-md-list li { margin: 1px 0; }
.ev-md-table { border-collapse: collapse; margin: 4px 0; width: 100%; }
.ev-md-table td {
  border: 1px solid var(--line); padding: 2px 6px;
  font-size: 11px; vertical-align: top;
}
.ev-md-table tr:first-child td { background: #f8fafc; font-weight: 600; }

/* view tabs: current slide | deck overview */
.viewnav { display: flex; gap: 6px; margin: 0 12px 10px; }
.viewtab {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 8px; padding: 6px 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.viewtab.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }


/* deck overview */
.ov-toolbar { display: flex; gap: 8px; margin: 0 12px 6px; align-items: center; }
.ov-verify { margin: 0; width: auto; flex: 1; }
.ov-hint { margin: 0 12px 8px; color: var(--muted); font-size: 10.5px; }
.ov-head, .ov-row {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 11.5px;
}
.ov-head { color: var(--muted); font-weight: 700; font-size: 10px; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); }
.ov-row { border-bottom: 1px solid #f1f5f9; }
.ov-row-un { color: var(--muted); }
.ov-c { width: 24px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ov-check { width: 22px; }
.ov-title { flex: 1; width: auto; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-title:hover { color: var(--indigo); }
.ov-state {
  width: 66px; font-size: 9px; font-weight: 700; letter-spacing: 0.03em;
  border-radius: 99px; padding: 2px 0;
}
.ov-state.st-ok { background: var(--green-bg); color: var(--green); }
.ov-state.st-re { background: #fff7ed; color: var(--amber); }
.ov-state.st-un { background: #f1f5f9; color: #94a3b8; }
.ov-state.st-run { background: var(--indigo-bg); color: var(--indigo); }
.ov-state.st-q { background: var(--wash); color: var(--muted); }
.leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot-g { background: var(--green); }
.dot-a { background: var(--amber); }
.dot-r { background: var(--red); }
.ov-g { color: var(--green); font-weight: 600; }
.ov-a { color: var(--amber); font-weight: 600; }
.ov-r { color: var(--red); font-weight: 600; }

/* ── Files tab ── */
.up-box { display: flex; gap: 6px; margin: 0 12px 6px; align-items: stretch; }
.up-tag { flex: none; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
          font-size: 11.5px; color: var(--ink); padding: 4px 6px; max-width: 92px; }
.up-drop { flex: 1; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--wash);
           color: var(--muted); font-size: 11.5px; padding: 12px 10px; text-align: center; cursor: pointer;
           user-select: none; }
.up-drop:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-bg); }
.up-drop.over { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-bg); }
.up-drop.busy { opacity: 0.6; pointer-events: none; }
.up-icon { font-size: 14px; margin-right: 4px; }
.status-line.error { color: var(--red); }
.status-line.warn { color: var(--amber); }

/* password prompt for protected uploads (bytes are up, finalisation waits) */
.up-pwrow { margin-top: 2px; padding: 7px 9px; background: var(--wash);
            border: 1px solid var(--line); border-radius: 8px; }
.up-pwmsg { font-size: 11px; color: var(--ink); margin-bottom: 5px; }
.up-pwline { display: flex; gap: 5px; }
.up-pwinput { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 7px;
              padding: 4px 8px; font-size: 11.5px; font-family: inherit; }
.up-pwline .up-pwgo { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.up-pwhint { font-size: 10.5px; color: var(--muted); margin-top: 4px; min-height: 1.2em; }
.files-head { display: flex; align-items: center; gap: 8px; margin: 8px 12px 4px;
              font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
              color: var(--muted); }
.files-head .icon-btn { margin-left: auto; }
.file-row { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 6px 2px;
            border-bottom: 1px solid var(--line); font-size: 12px; }
.fl-name { flex: 1; min-width: 0; white-space: nowrap; }
.fl-src { flex: none; width: 52px; text-align: right; }
.fl-tag { font-size: 10.5px; font-weight: 600; color: var(--ink-soft); }
.files-empty { margin: 18px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.files-group { margin: 10px 12px 2px; font-size: 10px; font-weight: 700; text-transform: uppercase;
               letter-spacing: 0.5px; color: var(--muted); }

/* Access block: who's on the deal + share picker */
.acc-head { display: flex; align-items: center; gap: 8px; margin: 2px 12px 4px;
            font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
            color: var(--muted); }
.acc-head .icon-btn { margin-left: auto; }
.acc-members { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 12px 8px; }
.acc-member { font-size: 10.5px; color: var(--ink-soft); background: var(--wash);
              border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.acc-member .lvl { color: var(--faint); }
.share-row { display: flex; gap: 6px; margin: 0 12px 4px; align-items: stretch; }
.share-btn { flex: none; }
.share-btn:not(:disabled) { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.share-item { display: flex; align-items: center; gap: 7px; }
.share-item .tick { width: 14px; flex: none; color: var(--green); font-weight: 700; }
.share-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-item .em { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis;
                  white-space: nowrap; color: var(--faint); font-size: 10.5px; }

.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; border-top: 1px solid var(--line);
  background: #fff; font-size: 10.5px; color: var(--muted);
}
.footer a { color: var(--indigo); text-decoration: none; font-weight: 600; }

/* record-drift note: link inherits the amber tone, reads as one sentence */
#docwatch-note a { color: inherit; font-weight: 600; }
