:root {
  color-scheme: light dark;
  /* ChatGPT-style light palette */
  --bg: #ffffff;            /* main content */
  --panel: #f9f9f9;         /* sidebars / panels */
  --panel-2: #ececec;       /* secondary surface, user bubble */
  --line: #e3e3e3;          /* hairline borders */
  --text: #0d0d0d;          /* primary text */
  --muted: #6b6b7b;         /* secondary text */
  --accent: #10a37f;        /* signature green — links, focus, active */
  --pri-bg: #0d0d0d;        /* primary button bg */
  --pri-fg: #ffffff;        /* primary button text */
  --code-bg: #f1f1f1;
  --shadow: 0 2px 10px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --crit: #e02e2e; --major: #c9750a; --minor: #8a8a99; --accept: #10a37f;
  --cp-label: #8a6d1a;      /* workbench gold — finding-panel row labels */
  --radius: 12px; font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121; --panel: #171717; --panel-2: #2f2f2f; --line: #3a3a3a;
    --text: #ececec; --muted: #a3a3b2; --accent: #19c37d;
    --pri-bg: #ffffff; --pri-fg: #0d0d0d; --code-bg: #2b2b2b;
    --shadow: 0 2px 14px rgba(0,0,0,.4);
    --crit: #ff6b6b; --major: #f0a850; --minor: #8a8a99; --accept: #19c37d;
    --cp-label: #d4b45a;    /* lighter gold — keeps contrast on near-black */
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "Helvetica Neue", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { font-weight: 700; letter-spacing: .3px; font-size: 18px; }
.docs-ready { color: var(--muted); font-size: 13px; }
.export-bar { margin-left: auto; display: flex; gap: 10px; }

/* ── tabs (Assistant | Cross-doc checks) ──────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-left: 10px; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active { background: var(--panel-2); border-color: transparent; color: var(--text); }

/* ── assistant tab (grounded chat) ────────────────────────────────────────── */
/* id-scoped: ".assistant" alone would also match ".chat-msg.assistant" bubbles */
#assistant-tab { height: calc(100vh - 57px); display: flex;
                 justify-content: center; overflow: hidden; }

/* history sidebar (ChatGPT-style) */
.chat-side { flex: 0 0 240px; border-right: 1px solid var(--line);
             background: var(--panel); padding: 14px 12px; overflow-y: auto;
             display: flex; flex-direction: column; gap: 10px; }
.chat-list { display: flex; flex-direction: column; gap: 4px; }
.chat-item { display: flex; align-items: center; gap: 6px; border-radius: 8px;
             padding: 8px 10px; cursor: pointer; border: 1px solid transparent; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--panel-2); border-color: var(--line); }
.ci-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; cursor: pointer; }
.ci-del { background: none; border: none; color: var(--muted); font-size: 15px;
          cursor: pointer; padding: 0 2px; border-radius: 4px; visibility: hidden; }
.chat-item:hover .ci-del { visibility: visible; }
.ci-del:hover { color: var(--crit); }
.chat-wrap { width: min(820px, 100%); display: flex; flex-direction: column;
             padding: 22px 20px; }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex;
               flex-direction: column; gap: 12px; padding-bottom: 8px; }
.chat-hello { margin: auto; max-width: 560px; text-align: center; }
.chat-hello-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.chat-hello p { font-size: 14px; line-height: 1.5; }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
                 margin-top: 16px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px;
            font-size: 14px; line-height: 1.5; }
.chat-msg p { margin: 0; }
.chat-msg p + p { margin-top: 8px; }
.chat-msg.user { align-self: flex-end; background: var(--panel-2); color: var(--text);
                 border-radius: 20px; padding: 10px 16px; }
.chat-msg.assistant { align-self: stretch; max-width: 100%; background: transparent;
                      border: none; padding: 2px 2px 6px; }
.chat-msg.typing { color: var(--muted); letter-spacing: 3px; }
.chat-msg code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px;
                 background: var(--code-bg); border: 1px solid var(--line);
                 border-radius: 5px; padding: 1px 5px; }
.chat-msg ul { margin: 6px 0 0; padding-left: 20px; }
.chat-msg li { margin: 3px 0; }
.chat-msg li + li { margin-top: 4px; }
.chat-table { border-collapse: collapse; margin: 8px 0 2px; font-size: 13px; }
.chat-table th { text-align: left; color: var(--muted); font-weight: 600;
                 padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); }
.chat-table td { padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); }
.chat-citations { align-self: flex-start; display: flex; flex-direction: column;
                  gap: 6px; max-width: 85%; }
.chat-cite {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-left-width: 4px;
  color: var(--text); border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.chat-cite:hover { border-color: var(--accent); }
.chat-cite.sev-CRITICAL { border-left-color: var(--crit); }
.chat-cite.sev-MAJOR { border-left-color: var(--major); }
.chat-cite.sev-MINOR { border-left-color: var(--minor); }
.cc-param { font-weight: 600; flex: 1; }
.cc-open { color: var(--accent); font-size: 12px; white-space: nowrap; }
.chat-form { display: flex; gap: 10px; margin-top: 12px; }
.chat-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); padding: 13px 18px; border-radius: 26px; font-size: 15px;
  box-shadow: var(--shadow);
}
.chat-form input:focus { outline: none; border-color: var(--muted); }

/* ── documents tab (Document Map) ─────────────────────────────────────────── */
#documents-tab { height: calc(100vh - 57px); overflow: hidden; }
.docmap-wrap { max-width: 1240px; margin: 0 auto; height: 100%;
               padding: 20px; display: flex; flex-direction: column; }
.docmap-head { display: flex; align-items: center; justify-content: space-between; }
.docmap-note { font-size: 13px; line-height: 1.45; margin: 6px 0 12px; }
.docmap-empty { padding: 16px; border: 1px dashed var(--line); border-radius: 8px;
                background: var(--panel); color: var(--muted); font-size: 14px; }
.docmap-flags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.docmap-flag { border: 1px solid var(--major); border-left-width: 4px;
               background: var(--panel-2); border-radius: 8px; padding: 8px 12px;
               font-size: 13px; }
.flag-kind { font-weight: 700; color: var(--major); margin-right: 8px;
             font-size: 11px; letter-spacing: .4px; }
.flag-cite { color: var(--muted); font-size: 12px; margin-top: 4px;
             font-family: ui-monospace, Menlo, monospace; }
.docmap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
               flex: 1; min-height: 0; }
.docmap-col { min-height: 0; overflow-y: auto; background: var(--panel);
              border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.docmap-subhead { font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
                  color: var(--muted); margin-bottom: 10px; }
.docmap-legend { text-transform: none; letter-spacing: 0; }
/* relationship map (governance graph) */
.docmap-graph-wrap { margin: 4px 0 16px; }
.docmap-graph { overflow-x: auto; background: var(--panel);
                border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.relmap-svg { display: block; }
.relmap-node rect { fill: var(--panel-2); stroke: var(--line); }
.relmap-node text { fill: var(--text); font-size: 11px; font-family: inherit; }
.relmap-edge { stroke-width: 1.6; }
.relmap-edge.cited { stroke: var(--accent); }
.relmap-edge.inferred { stroke: var(--muted); stroke-dasharray: 5 4; }
.relmap-arrowhead.cited { fill: var(--accent); }
.relmap-arrowhead.inferred { fill: var(--muted); }
.docmap-typehead { font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
                   color: var(--muted); margin: 12px 0 6px; }
.docmap-ld { border: 1px solid var(--line); background: var(--panel-2);
             border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.ld-title { font-weight: 600; font-size: 14px; }
.ld-count { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.ld-ambiguous { color: var(--major); font-size: 11px; }
.ld-revs { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.ld-rev { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.ld-rev code { color: var(--text); }
.ld-rev.current code { color: var(--accept); }
.ld-sig { color: var(--muted); flex: 1; }
.ld-current { font-size: 10px; font-weight: 700; color: #fff; background: var(--accept);
              border-radius: 999px; padding: 1px 7px; letter-spacing: .4px; }
.ld-ctrl { display: flex; gap: 6px; margin-top: 8px; }
.ld-ctrl select { background: var(--panel); border: 1px solid var(--line); color: var(--text);
                  border-radius: 6px; padding: 5px 8px; font-size: 12px; flex: 1; min-width: 0; }
.docmap-edge { border: 1px solid var(--line); background: var(--panel-2);
               border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.docmap-edge.basis-cited { border-left: 3px solid var(--accent); }
.docmap-edge.basis-inferred { border-left: 3px dashed var(--muted); }
.edge-rel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.edge-node { font-weight: 600; }
.edge-verb { color: var(--muted); }
.edge-basis { font-size: 11px; color: var(--muted); border: 1px solid var(--line);
              border-radius: 999px; padding: 0 7px; }
.edge-state { font-size: 12px; color: var(--accept); }
.edge-cite { font-size: 12px; color: var(--text); margin-top: 6px;
             font-family: ui-monospace, Menlo, monospace; line-height: 1.4; }
.edge-actions { display: flex; gap: 6px; margin-top: 8px; }

.layout { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 57px); }
.rail { border-right: 1px solid var(--line); background: var(--panel);
        padding: 18px; overflow-y: auto; display: flex; flex-direction: column; }

.findings-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.findings-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.count { background: var(--panel-2); border: 1px solid var(--line);
         padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--muted); }

.filter { margin-bottom: 14px; }
#ask-input, #note-input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 9px 11px; border-radius: 8px; font-size: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
#show-all { margin-top: 8px; }
.out-of-scope {
  margin-top: 10px; padding: 12px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.4;
}

.findings-rail { display: flex; flex-direction: column; gap: 8px; }
.finding-card {
  border: 1px solid var(--line); border-left-width: 4px; background: var(--panel-2);
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
}
.finding-card:hover { border-color: var(--accent); }
.finding-card.sev-CRITICAL { border-left-color: var(--crit); }
.finding-card.sev-MAJOR { border-left-color: var(--major); }
.finding-card.sev-MINOR { border-left-color: var(--minor); }
.finding-card.active { outline: 1px solid var(--accent); }
.fc-top { display: flex; align-items: center; gap: 8px; }
.sev-pill { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; padding: 1px 7px;
            border-radius: 999px; color: #fff; }
.sev-CRITICAL .sev-pill, .pill-CRITICAL { background: var(--crit); }
.sev-MAJOR .sev-pill, .pill-MAJOR { background: var(--major); }
.sev-MINOR .sev-pill, .pill-MINOR { background: var(--minor); }
.fc-param { font-weight: 600; font-size: 14px; }
.fc-desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.35; }
.fc-link { color: var(--accent); font-size: 12px; margin-top: 7px; }
.fc-decision { font-size: 11px; margin-top: 5px; }
.fc-decision.accepted { color: var(--accept); }
.fc-decision.dismissed { color: var(--muted); }

.walk { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.walk-caption { flex: 1; font-size: 12px; color: var(--muted); }

.stage { padding: 18px; overflow: hidden; display: flex; flex-direction: column; }
.empty-stage { height: 100%; display: flex; flex-direction: column; align-items: center;
               justify-content: center; text-align: center; color: var(--muted); gap: 4px; }
.empty-glyph { font-size: 54px; opacity: .25; margin-bottom: 6px; }

.viewer { display: flex; flex-direction: column; height: 100%; }
.viewer-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.finding-banner { font-size: 16px; font-weight: 600; line-height: 1.4; flex: 1; }
.finding-banner .pill { font-size: 11px; font-weight: 700; color: #fff; padding: 2px 8px;
                        border-radius: 999px; margin-right: 8px; }
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-level { font-size: 12px; color: var(--muted); min-width: 44px; text-align: center; }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 12px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-head { font-size: 12.5px; color: var(--muted); margin-bottom: 8px;
             display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pane-pdf { color: var(--accent); text-decoration: none; font-size: 12px; white-space: nowrap; }
.pane-pdf:hover { text-decoration: underline; }
.viewport { flex: 1; min-height: 0; min-width: 0; overflow: auto; background: #c9ced6;
            border-radius: 6px; position: relative; }
.canvas { position: relative; }
.page-img { display: block; background: #fff; }
.hilite { position: absolute; border: 2px solid var(--accent);
          background: rgba(63,140,255,.18); border-radius: 2px;
          box-shadow: 0 0 0 9999px rgba(15,20,25,.22); pointer-events: none; }
.pane-snippet { margin-top: 8px; font-family: ui-monospace, Menlo, monospace;
                font-size: 12.5px; color: var(--text); }

.judgment { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.judgment #note-input { flex: 1; }
.decision-state { font-size: 13px; color: var(--accept); min-width: 84px; }

.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text);
       padding: 8px 15px; border-radius: 9px; font-size: 13px; cursor: pointer;
       text-decoration: none; display: inline-block; font-weight: 500;
       transition: background .12s ease, opacity .12s ease, border-color .12s ease; }
.btn:hover { background: var(--panel-2); border-color: var(--line); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.accept { background: var(--pri-bg); border-color: var(--pri-bg); color: var(--pri-fg); }
.btn.accept:hover { background: var(--pri-bg); opacity: .85; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); }

/* ── structured rationale panel + single-pane (real-data ingest) ───────────── */
.finding-detail {
  margin: 8px 14px 0; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); font-size: 13px; line-height: 1.45;
}
.finding-detail.hidden { display: none; }
.fd-row { display: flex; gap: 10px; padding: 3px 0; }
.fd-row + .fd-row { border-top: 1px dashed var(--line); }
.fd-label { flex: 0 0 110px; color: var(--muted); font-weight: 600; text-transform: uppercase;
            font-size: 11px; letter-spacing: .03em; padding-top: 1px; }
.fd-val { flex: 1 1 auto; color: var(--text); }
.panes.single .pane[data-side="A"] { flex: 1 1 100%; max-width: 100%; }
.pane.hidden { display: none; }

/* ── run bar (history picker) + new-run panel ─────────────────────────────── */
.run-bar { display: flex; align-items: center; gap: 8px; margin-left: 18px; }
.run-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
             color: var(--muted); }
.run-select { background: var(--panel-2); border: 1px solid var(--line);
              color: var(--text); padding: 6px 10px; border-radius: 8px;
              font-size: 13px; max-width: 360px; }
.export-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.new-run-panel { padding: 14px 20px; border-bottom: 1px solid var(--line);
                 background: var(--panel); }
.new-run-panel.hidden { display: none; }
.nrp-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.nrp-file { display: flex; flex-direction: column; gap: 5px; font-size: 12px;
            color: var(--muted); }
.nrp-file input[type="file"], .nrp-file input[type="text"] {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 9px; border-radius: 8px; font-size: 13px; min-width: 230px; }
.nrp-types { display: flex; flex-direction: column; gap: 4px; font-size: 13px;
             color: var(--text); }
.nrp-types-label { font-size: 12px; color: var(--muted); }
.nrp-types label { display: flex; align-items: center; gap: 6px; }
.run-status { margin-top: 10px; font-size: 13px; color: var(--accent); min-height: 18px; }

/* ── login ────────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
              background: var(--panel); }
.login-card { width: 360px; padding: 34px 30px; background: var(--bg);
              border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.login-brand { font-size: 24px; font-weight: 700; letter-spacing: -.2px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form.hidden { display: none; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px;
                    color: var(--muted); }
.login-form input { background: var(--bg); border: 1px solid var(--line);
                    color: var(--text); padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.login-form input:focus { outline: none; border-color: var(--accent);
                          box-shadow: 0 0 0 3px rgba(16,163,127,.12); }
.btn.full { width: 100%; text-align: center; }
.login-otp-note { font-size: 13px; color: var(--text); margin: 0; }
.login-msg { margin-top: 14px; font-size: 13px; color: var(--accent); min-height: 18px; }
.login-msg.err { color: var(--crit, #ff6b6b); }

/* register switch on the login card */
.login-switch { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.login-switch a { color: var(--accent); text-decoration: none; }

/* account + admin modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55);
                 display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
              box-shadow: var(--shadow);
              padding: 22px 24px; width: 400px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal-card.wide { width: 560px; }
.modal-head { display: flex; justify-content: space-between; align-items: center;
              font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-subhead { font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
                 color: var(--muted); margin: 10px 0 4px; }

/* admin user list */
.admin-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.admin-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
             padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.admin-user { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-user b { font-size: 14px; }
.admin-email { font-size: 12px; color: var(--muted); }
.admin-org { font-size: 12px; color: var(--accent); }
.admin-status { font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
                padding: 2px 8px; border-radius: 10px; }
.admin-status.s-pending { background: rgba(201,117,10,.14); color: #b45309; }
.admin-status.s-approved { background: rgba(16,163,127,.14); color: #0e8a6b; }
.admin-status.s-denied { background: rgba(224,46,46,.12); color: #c62828; }
.admin-actions { display: flex; gap: 6px; }

/* admin: assign-to-company control */
.admin-actions { flex-wrap: wrap; align-items: center; }
.admin-assign { background: var(--panel); color: var(--text); border: 1px solid var(--line);
                border-radius: 6px; padding: 4px 6px; font-size: 12px; max-width: 150px; }
.admin-newco { background: var(--panel); color: var(--text); border: 1px solid var(--line);
               border-radius: 6px; padding: 5px 8px; font-size: 12px; width: 150px; }
.btn.danger { color: var(--crit); border-color: transparent; }
.btn.danger:hover { border-color: var(--crit); }

/* account: profile view */
.profile-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
                font-size: 13px; margin: 6px 0 2px; }
.profile-k { color: var(--muted); }
.profile-v { color: var(--text); word-break: break-all; }

/* ══════════════════════════════════════════════════════════════════════════
   UIV2 rework — two-surface shell (Chat | Workspace) + global feedback widget
   ══════════════════════════════════════════════════════════════════════════ */

/* topbar surface switch */
.surfaces { display: flex; gap: 4px; margin-left: 10px; }
.surface-tab { background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 7px 16px; border-radius: 9px; font-size: 14px; cursor: pointer;
  font-weight: 600; white-space: nowrap; }
.surface-tab:hover { color: var(--text); background: var(--panel-2); }
.surface-tab.active { background: var(--panel-2); color: var(--text); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Surface 1: Chat with in-chat source side panel ── */
#chat-surface { height: calc(100vh - 57px); display: flex; overflow: hidden; }
/* override the standalone-chat fixed width so the wrap centers and a side
   panel can share the row */
.chat-wrap { width: auto; flex: 1; max-width: 820px; margin: 0 auto; min-width: 0; }
.chat-sidepanel { flex: 0 0 46%; max-width: 780px; min-width: 380px;
  border-left: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; overflow: hidden; }
.sidepanel-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.viewer-host { flex: 1; min-height: 0; display: flex; overflow: hidden; padding: 14px; }
#viewer-bundle { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.viewer-host .empty-stage { margin: auto; }

/* ── Surface 2: Workspace (SaaS shell) ── */
#workspace-surface { height: calc(100vh - 57px); display: flex; overflow: hidden; }
.ws-nav { flex: 0 0 210px; border-right: 1px solid var(--line); background: var(--panel);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.ws-navitem { text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--muted); padding: 9px 12px; border-radius: 9px; font-size: 14px;
  cursor: pointer; font-weight: 500; }
.ws-navitem:hover { color: var(--text); background: var(--panel-2); }
.ws-navitem.active { background: var(--panel-2); color: var(--text); }
.ws-content { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.ws-page { flex: 1; min-height: 0; overflow: auto; }
.ws-page-head { padding: 18px 22px 6px; }

/* checks page reuses .rail / .stage / .viewer */
#ws-checks { overflow: hidden; }
.checks-layout { display: grid; grid-template-columns: 360px 1fr; height: 100%; }
.checks-export { margin-top: auto; display: flex; gap: 8px; padding-top: 12px; }
.stage .viewer-host { padding: 0; }

/* account page */
.account-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  padding: 16px 22px; max-width: 860px; }
.account-card { border: 1px solid var(--line); background: var(--panel);
  border-radius: 12px; padding: 18px; }
@media (max-width: 720px) { .account-cols { grid-template-columns: 1fr; } }

/* ── Global feedback / feature-request widget ── */
.fb-launch { position: fixed; right: 20px; bottom: 88px; z-index: 50;
  display: flex; align-items: center; gap: 6px; background: var(--accent);
  color: #fff; border: none; border-radius: 999px; padding: 11px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.fb-launch:hover { filter: brightness(1.05); }
.fb-launch-ico { font-size: 15px; }
.fb-modal { position: fixed; right: 20px; bottom: 148px; z-index: 51;
  width: 384px; max-width: 92vw; max-height: 72vh; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; }
.fb-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fb-title { font-weight: 700; font-size: 15px; }
.fb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fb-thread { flex: 1; min-height: 120px; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; }
.fb-msg { font-size: 13.5px; line-height: 1.45; padding: 9px 12px;
  border-radius: 10px; max-width: 92%; white-space: pre-wrap; }
.fb-msg.user { align-self: flex-end; background: var(--panel-2); color: var(--text); }
.fb-msg.assistant { align-self: flex-start; background: var(--code-bg);
  border: 1px solid var(--line); }
.fb-status { font-size: 12.5px; color: var(--muted); padding: 0 16px; min-height: 15px; }
.fb-status.err { color: var(--crit); }
.fb-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.fb-form input { flex: 1; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); border-radius: 20px; padding: 10px 14px; font-size: 14px; }
.fb-form input:focus { outline: none; border-color: var(--muted); }
.fb-actions { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 12px 12px; }
.fb-shot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

/* ── chat file-drop redirect (UPLOAD_INGESTION_DESIGN §5) ──────────────── */
.chat-drop-hover { outline: 2px dashed var(--accent, #4a7dff); outline-offset: -6px; }
.chat-dropcard {
  margin: 10px 0; padding: 12px 14px; border: 1px solid var(--border, #2c2c34);
  border-radius: 10px; background: var(--panel, rgba(120,130,160,.08));
  max-width: 560px;
}
.chat-dropcard .dropcard-title { font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.chat-dropcard p { margin: 4px 0 8px; }
.chat-dropcard .btn { margin-top: 2px; }
.nrp-visibility {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--panel, rgba(120,130,160,.10)); font-size: .92em;
}

/* ── library upload (Document Map) ─────────────────────────────────────── */
.lib-dropzone {
  margin: 0 0 14px; padding: 14px 16px; border: 2px dashed var(--border, #2c2c34);
  border-radius: 10px; cursor: pointer; background: var(--panel, rgba(120,130,160,.06));
}
.lib-dropzone:focus { outline: 2px solid var(--accent, #4a7dff); }
.lib-drop-hover { border-color: var(--accent, #4a7dff); background: rgba(74,125,255,.08); }
.lib-drop-attn { animation: libattn 1.4s ease; }
@keyframes libattn { 0%,100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(74,125,255,.35); } }
.lib-browse { text-decoration: underline; cursor: pointer; }
.lib-upload-status { margin-top: 6px; }
.lib-upload-line { font-size: .9em; opacity: .85; }
.lib-upload-line.ok { color: #3fa76a; }
.lib-upload-line.err { color: #d05555; }

/* ── check declaration + results ───────────────────────────────────────── */
.check-declare {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border, #2c2c34);
  border-radius: 10px; background: var(--panel, rgba(120,130,160,.06));
}
.check-declare-title { font-weight: 600; }
.check-declare label { display: flex; align-items: center; gap: 6px; font-size: .92em; }
.check-declare select { max-width: 260px; }
.check-results { margin: 0 0 12px; max-height: 46vh; overflow-y: auto; }
.ckf-head { margin: 6px 0 8px; font-size: .95em; }
.ckf-card {
  border: 1px solid var(--border, #2c2c34); border-left-width: 4px;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
}
.ckf-violation { border-left-color: #d05555; }
.ckf-conflict { border-left-color: #d98b3a; }
.ckf-gap { border-left-color: #c9b83a; }
.ckf-needs_review { border-left-color: #4a7dff; }
.ckf-compliant { border-left-color: #3fa76a; }
.ckf-title { margin-bottom: 2px; }
.ckf-tier { font-size: .8em; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.ckf-quote { font-size: .88em; opacity: .9; margin: 3px 0; overflow-wrap: anywhere; }
.ckf-anchor { font-weight: 600; opacity: .8; margin-right: 4px; }
.chat-check-pickers { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.chat-check-pickers label { display: flex; gap: 6px; align-items: center; font-size: .9em; }
.chat-check-pickers select { max-width: 220px; }
.fb-launch, .fb-head { touch-action: none; }   /* pointer-drag friendly */
.fb-head { cursor: grab; }

/* ── runs relocated into Cross-doc checks (topbar decluttered) ─────────── */
.checks-runbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 8px 12px; border: 1px solid var(--border, #2c2c34);
  border-radius: 10px; background: var(--panel, rgba(120,130,160,.06));
}
#ws-checks .new-run-panel { margin-bottom: 10px; }

/* accessibility-only labels (check sentence bar) */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* fresh tenants: no legacy runs -> the run-keyed rail/stage/exports hide */
#ws-checks.no-runs .checks-layout { display: none; }
.ckf-warning {
  border: 1px solid #d98b3a; border-radius: 8px; padding: 6px 10px;
  margin: 6px 0; font-size: .9em;
}
#ws-checks.no-runs .checks-runbar { display: none; }
.check-history { margin-top: 14px; }
.check-history-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.check-history-item { display: flex; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 7px 10px; margin-bottom: 4px;
  border: 1px solid var(--border, #d8d8d8); border-radius: 8px;
  background: transparent; cursor: pointer; font: inherit; }
.check-history-item:hover { background: rgba(0,0,0,0.04); }
.check-history-item:disabled { opacity: .5; cursor: default; }
.chi-sentence { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chi-meta { white-space: nowrap; color: var(--muted, #777); font-size: 12px; }
/* chat check-artifact cards + side-by-side check panel */
.chat-checkart { display: flex; flex-direction: column; gap: 2px; width: 100%;
  text-align: left; padding: 10px 12px; border: 1px solid var(--border, #d8d8d8);
  border-radius: 10px; background: transparent; cursor: pointer; font: inherit; }
.chat-checkart:hover { background: rgba(0,0,0,0.04); }
.chat-checkart:disabled { opacity: .6; cursor: default; }
.cca-title { font-weight: 600; }
.cca-meta { color: var(--muted, #777); font-size: 12px; }
.check-panel { display: flex; flex-direction: column; gap: 10px; padding: 10px;
  overflow-y: auto; height: 100%;
  /* room to scroll the last row clear of the fixed feedback launcher
     (bottom: 88px) — the review record's Record button used to land
     underneath it and become unclickable */
  padding-bottom: 130px; }
.cp-head { font-weight: 600; font-size: 13px; }
.cp-findings { display: flex; flex-direction: column; gap: 4px;
  max-height: 30%; overflow-y: auto; }
.cp-frow { text-align: left; padding: 6px 8px; border: 1px solid var(--border, #ddd);
  border-radius: 7px; background: transparent; cursor: pointer; font: inherit;
  font-size: 12.5px; }
.cp-frow.active { border-color: #4a7dff; background: rgba(74,125,255,0.08); }
/* The panel is a SCROLLING flex column, so no row may be flex-shrunk below
   its content. `.cp-panes` carried `min-height: 0`, which let the flex
   algorithm crush the panes row to height 0 whenever the panel's content was
   taller than the panel (the chat side panel, or any short window). The
   figures inside kept their real height and simply painted OUTSIDE that
   zero-height box — so the Review Record, which comes next in the column, was
   laid out over the page images and, being a later sibling, also intercepted
   every pointer event aimed at the citation pager. Dropping `min-height: 0`
   restores the default `min-height: auto`, which is what keeps this row (and
   every other panel row) at its own height. */
.cp-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* both panes stretch to the taller of the two (grid default) so the two cited
   pages line up; the image itself is confined to `.cp-viewport` below */
.cp-pane { margin: 0; min-width: 0; display: flex; flex-direction: column;
  min-height: 0; }
.cp-pane > .cp-viewport { flex: 1 1 auto; min-height: 0; }
/* …but a viewport with no image to show must NOT take that height: an empty
   page-sized bordered box next to the real page reads as a failed image load.
   `renderPane`'s blank() marks it (a class, not `:has()`, because the image
   is MOVED out of its viewport while the full-screen overlay is open — the
   pane must not collapse and re-expand around that). */
.cp-pane > .cp-viewport.is-empty { flex: 0 0 auto; border: 0; }
.cp-pane figcaption { font-size: 11.5px; color: var(--muted, #777);
  margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.cp-pane img { width: 100%; height: auto; border: 1px solid var(--border, #ddd);
  border-radius: 4px; }
.cp-note { font-size: 11.5px; }
.check-stage-host { margin-top: 14px; }
.check-stage-host .check-panel { border: 1px solid var(--border, #ddd);
  border-radius: 10px; max-height: 75vh; }
.ckf-card.clickable { cursor: pointer; }
.ckf-card.clickable:hover { background: rgba(0,0,0,0.03); }
.ckf-hint { font-size: 12px; margin: 4px 0 8px; }
/* legacy runs layout retired — the hidden attribute must always win over
   the layout's own display rules */
.checks-layout[hidden] { display: none !important; }
/* the relocatable split viewer belongs to the retired legacy runs surface;
   without mountViewer() it would render at body level — never show it */
#viewer-bundle { display: none !important; }
.cp-head { display: flex; justify-content: space-between; align-items: center; }
.cp-close { flex: 0 0 auto; }
/* one-finding detail panel — workbench ledger style: a header line
   (id — title), then tight label-left rows on a shared grid */
.cpd-title { font-size: 14px; margin-bottom: 6px; line-height: 1.35; }
.cpd-grid { display: grid; grid-template-columns: 86px minmax(0, 1fr);
  gap: 4px 12px; align-items: start; }
.cpd-label { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; color: var(--cp-label);
  padding-top: 2px; }
.cpd-val { font-size: 13.5px; line-height: 1.4; min-width: 0;
  overflow-wrap: break-word; }
.cpd-sev { font-size: 11px; border: 1px solid currentColor; border-radius: 6px;
  padding: 0 5px; }
.cpd-quote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid #4a7dff;
  background: rgba(74,125,255,.06); font-size: 12.5px; }
.cpd-cite { display: block; margin-top: 3px; font-size: 11.5px;
  color: var(--muted, #777); }
.cpd-nav { max-width: 45%; }
.cp-zoombar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cp-zoom-level { font-size: 12px; min-width: 44px; text-align: center; }
/* per-pane citation pager — only rendered when a pane really has more than
   one cited page, so the ordinary two-citation finding looks unchanged.
   ONE row, scrolled sideways if long: a wrapping pager made the two panes
   different heights and pushed the paged image below its neighbour, so the
   two pages no longer lined up — the whole point of a side-by-side. When
   EITHER pane has a pager the other reserves the same row (`has-pager`), so
   the images stay level. */
.cp-pager { display: flex; gap: 4px; margin-bottom: 4px; overflow-x: auto;
  scrollbar-width: thin; }
.cp-pager:empty { display: none; }
.cp-panes.has-pager .cp-pager { display: flex; min-height: 19px; }
.cp-pager .cp-page { font: inherit; font-size: 11px; line-height: 1.4;
  flex: 0 0 auto; white-space: nowrap;
  padding: 1px 7px; border: 1px solid var(--border, #ddd); border-radius: 6px;
  background: transparent; color: inherit; cursor: pointer; }
.cp-pager .cp-page.on { border-color: #4a7dff; background: rgba(74,125,255,.12);
  font-weight: 600; }
.cpd-extra { font-size: 11.5px; color: var(--muted, #777); }
/* the whole-finding plain-language evidence sentence — deliberately SEPARATE
   from the pane-tracking Evidence line it used to overwrite */
.cpd-sub { margin-top: 4px; font-size: 12px; color: var(--muted, #777); }
/* per-pane state note: "same page, different callout", or a citation that has
   no page to render (quote only) */
.cp-pane-note { font-size: 11.5px; color: var(--muted, #777);
  margin-bottom: 4px; }
.cp-viewport { overflow: auto; max-height: 46vh; border: 1px solid
  var(--border, #ddd); border-radius: 4px; }
.cp-viewport img { display: block; width: 100%; height: auto; border: 0; }
.cp-img-clickable { cursor: zoom-in; }
/* full-screen side-by-side overlay: click = open, Esc/backdrop = close,
   per-pane ↗ button opens that page's file in a new tab */
.cp-fs { position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 15, 20, 0.88); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px; }
.cp-fs-bar { display: flex; justify-content: flex-end; align-items: center;
  gap: 12px; }
.cp-fs-hint { color: #bbb; font-size: 12px; }
.cp-fs-close { color: #fff; font-size: 20px; }
/* minmax(0,1fr) + min-height:0 keep the panes inside the viewport: with the
   default auto row / auto min-height a zoomed-in image made the figure grow
   to the full image height, so the pane never scrolled VERTICALLY (the
   overlay overflowed the screen instead) and the zoom anchor's scrollTop
   math had nothing to act on */
.cp-fs-panes { flex: 1; display: grid; grid-template-rows: minmax(0, 1fr);
  gap: 14px; min-height: 0; }
.cp-fs-pane { margin: 0; display: flex; flex-direction: column;
  min-width: 0; min-height: 0; }
.cp-fs-pane figcaption { color: #eee; font-size: 12.5px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-fs-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-fs-open { flex: 0 0 auto; color: #fff; border-color: #888; }
.cp-fs-zoom { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.cp-fs-zoom .btn { color: #fff; border-color: #888; }
.cp-fs-zlvl { color: #ddd; font-size: 11.5px; min-width: 40px;
  text-align: center; font-variant-numeric: tabular-nums; }
.cp-fs-viewport { flex: 1; overflow: auto; background: #fff;
  border-radius: 6px; overscroll-behavior: contain; }
/* max-width freed only while the img lives in the overlay, so a >100%
   zoom can exceed the pane; the panel's own rules re-apply on restore */
.cp-fs-viewport img { display: block; width: 100%; max-width: none;
  height: auto; }
/* ── adjudication: the multi-party review record (2026-07-22) ───────────── */
.cp-judgment { margin-top: 10px; border-top: 1px solid var(--line);
  padding-top: 10px; }
.adj-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adj-top .cpd-label { display: inline; }
.adj-progress { font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.adj-export { margin-left: auto; font-size: 12px; }
.ckf-progress { font-size: 12px; color: var(--muted); margin: 2px 0 6px;
  font-variant-numeric: tabular-nums; }
.adj-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px;
  flex-wrap: wrap; font-size: 12.5px; }
.adj-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.adj-tag { display: inline-flex; align-items: center; gap: 2px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 1px 4px 1px 7px; font-size: 11.5px; }
.adj-tag-x, .adj-del { background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px; line-height: 1; padding: 0 3px; }
.adj-tag-in { width: 90px; font-size: 12px; }
.adj-form { display: flex; align-items: center; gap: 6px; margin-top: 8px;
  flex-wrap: wrap; }
.adj-form input[data-testid=adj-note] { flex: 1; min-width: 170px; }
.adj-state { font-size: 12px; color: var(--muted); }
.adj-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px;
  font-size: 11.5px; color: var(--muted); }
.adj-timeline { list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px; }
.adj-entry { border-left: 2px solid var(--line); padding: 1px 0 1px 8px;
  font-size: 12.5px; }
.adj-entry.adj-comment { border-left-color: var(--accent); }
.adj-entry.adj-deleted { opacity: .5; text-decoration: line-through; }
.adj-entry-top { display: flex; align-items: baseline; gap: 6px; }
.adj-role, .adj-ts { color: var(--muted); font-size: 11.5px; }
.adj-ts { margin-left: auto; }
.adj-action { color: var(--muted); font-style: italic; }
.adj-verdict { text-transform: uppercase; font-size: 11px; letter-spacing: .3px; }
.adj-v-real { color: #d64545; }
.adj-v-immaterial { color: var(--muted); }
.adj-v-error { color: #b47a12; }
.adj-empty { font-size: 12.5px; }
/* ontology proposal cards */
.ontology-proposals { margin: 10px 0; padding: 10px 12px;
  border: 1px solid #e8b93c66; border-radius: 10px;
  background: rgba(232,185,60,.07); }
.ontology-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.ontology-card { margin-bottom: 8px; }
.ontology-q { font-size: 13px; margin-bottom: 4px; }
.ontology-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ontology-row input { min-width: 180px; }

/* ── workbench two-column checks layout (2026-07-21) ───────────────────────
   Left rail: concise findings list. Right: the side-by-side detail panel.
   Scoped under .check-columns so chat's inline compare-card results keep
   their existing full-card look. */
.check-columns {
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.check-columns .check-results {
  margin: 0; max-height: 76vh; overflow-y: auto; padding-right: 2px;
}
.check-columns .check-stage-host {
  margin-top: 0; position: sticky; top: 8px;
}
@media (max-width: 1100px) {
  .check-columns { grid-template-columns: 1fr; }
  .check-columns .check-results { max-height: 38vh; }
  .check-columns .check-stage-host { position: static; }
}
.ckf-card.ckf-mini { padding: 7px 10px; margin-bottom: 6px; }
.ckf-mini-top {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: .88em;
}
.ckf-mini-id { font-weight: 600; }
.ckf-chip {
  border: 1px solid currentColor; border-radius: 999px; padding: 0 7px;
  font-size: .85em; line-height: 1.5; opacity: .9;
}
.ckf-chip-violation { color: #d05555; }
.ckf-chip-conflict { color: #d98b3a; }
.ckf-chip-gap { color: #a89722; }
.ckf-chip-needs_review { color: #4a7dff; }
.ckf-chip-compliant { color: #3fa76a; }
.ckf-mini-sev { font-size: .85em; opacity: .75; text-transform: lowercase; }
.ckf-mini-title {
  font-size: .92em; margin-top: 2px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.ckf-card.selected {
  outline: 2px solid #4a7dff; outline-offset: -1px;
  background: rgba(74, 125, 255, 0.07);
}
.ckf-card.selected:hover { background: rgba(74, 125, 255, 0.1); }

/* finding-id links inside chat answers */
.chat-fid-link {
  color: #4a7dff; text-decoration: underline dotted;
  text-underline-offset: 2px; cursor: pointer; font-weight: 600;
}
.chat-fid-link:hover { text-decoration-style: solid; }

/* ── History runs tab (2026-07-22) ─────────────────────────────────────────
   List of every saved cross-doc check for the scope, then ONE run's rail +
   the shared side-by-side panel (which reuses .check-columns). */
#ws-history { overflow: auto; }
.hist-wrap { padding: 0 22px 22px; }
.hist-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hist-row {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  width: 100%; cursor: pointer; color: var(--text);
  background: transparent; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
.hist-row:hover { background: var(--panel-2); }
.hist-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-when { font-weight: 600; font-size: .92em; }
.hist-chip {
  font-size: .78em; border: 1px solid var(--line); border-radius: 5px;
  padding: 0 5px; color: var(--muted);
}
.hist-chip.hist-decided { color: var(--accent); border-color: currentColor; }
.hist-pair { font-size: .95em; }
.hist-counts { font-size: .85em; color: var(--muted); }
.hist-runhead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 12px;
}
.hist-run-title { font-weight: 600; font-size: .95em; }
