/* PaperLens record-rendering grammar — rv-* result grid, ev-* evidence,
 * confidence badges, editable cells, PDF highlight overlay. Tokens only. */

.rv-root { font-size: 13px; }
/* fields flow horizontally as key→value pairs, wrapping into as many columns as fit
   (min 260px each); collapses to a single column in narrow/nested containers. */
.rv-obj { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0 24px; width: 100%; align-items: start; }
.rv-row { display: flex; gap: 14px; justify-content: space-between; align-items: baseline;
  min-width: 0; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rv-key { font-weight: 600; color: var(--text-muted); flex: 0 0 auto; }
/* a field with help: a dotted underline and a small ⓘ, both carrying the definition on hover */
.rv-key.rv-key-help { text-decoration: underline dotted var(--border); text-underline-offset: 3px; cursor: help; }
.rv-help { font-size: 10px; font-weight: 400; margin-left: 4px; color: var(--text-muted); vertical-align: 1px; cursor: help; }
.rv-help:focus { outline: none; color: var(--accent); }
.rv-opt-help { font-size: 11px; margin-left: 2px; }
/* the one tooltip: at once, plain text with its line breaks, within the viewport */
.tip { position: fixed; z-index: 1000; max-width: 340px; padding: 6px 9px; border-radius: 6px; font-size: 12.5px; line-height: 1.4;
  white-space: pre-line; color: var(--surface); background: var(--text); box-shadow: var(--shadow-sm); pointer-events: none; }
.tip[hidden] { display: none; }
.rv-val { color: var(--text); line-height: 1.5; word-break: break-word; flex: 0 1 auto;
  min-width: 0; text-align: left; }
/* nested objects/tables take the full row width and stack the value under the key */
.rv-row.rv-row-block { grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 3px; }
.rv-row.rv-row-block > .rv-val { text-align: left; }
.rv-val.rv-nested { width: 100%; padding: 2px 0; }
/* a child row's title cell in a stage table: the row's identity when its id and label are not cells of the stage */
.rv-table td.rv-rowtitle { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
/* a stage's inline group: its fields' rows side by side on one line (a period's year and month) */
.rv-inline { grid-column: 1 / -1; display: flex; gap: 24px; }
.rv-inline > .rv-row { flex: 1 1 0; min-width: 0; }
.rv-num { color: var(--accent-2); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.rv-null { color: var(--text-muted); font-style: italic; }
.rv-editable.rv-empty { min-width: 1.6em; display: inline-block; }
.rv-editable.rv-empty:empty::before { content: "—"; color: var(--text-muted); font-style: italic; }
.rv-editable.rv-empty:focus:empty::before { content: ""; }

/* wide/nested tables scroll horizontally inside the panel rather than crushing columns */
.rv-tablewrap { overflow-x: auto; max-width: 100%; }
.rv-table { border-collapse: collapse; font-size: 12.5px; margin: 2px 0; }
/* word-break:normal overrides the inherited break-word so words don't split letter-by-letter
   in a narrow column; min/max-width keep cells readable, and long labels wrap at spaces. */
.rv-table th, .rv-table td { border: 1px solid var(--border); padding: 3px 8px; text-align: left;
  vertical-align: top; word-break: normal; overflow-wrap: break-word; min-width: 64px; max-width: 280px; }
.rv-table th { background: var(--bg); font-weight: 600; color: var(--text-muted); white-space: nowrap; }
/* a cell holding a nested table/object must not be width-capped — its own wrapper scrolls */
.rv-table td:has(.rv-tablewrap), .rv-table td:has(.rv-obj) { max-width: none; }

/* render_hints "cards": one card per array element — header line, sub-table, details below */
.rv-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
  margin: 8px 0; background: var(--surface); }
.rc-head { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; font-size: 12.5px; }
.rc-hk { color: var(--text-muted); font-weight: 600; margin-right: 3px; }
.rc-below { margin-top: 8px; }

/* edit-in-place — corrections route through the verification layer */
.rv-editable { cursor: text; border-bottom: 1px dashed transparent; border-radius: 3px; padding: 0 2px;
  transition: background .15s, border-color .15s; }
.rv-editable:hover { background: var(--accent-wash); border-bottom-color: var(--accent); }
.rv-editable:focus { outline: none; background: var(--accent-wash); box-shadow: 0 0 0 2px var(--accent-wash); }
/* blank fields (e.g. a manually added finding) still need a clickable target */
.rv-editable:empty { display: inline-block; min-width: 3.5em; min-height: 1.1em;
  border-bottom-color: var(--accent); }
.rv-edited { background: var(--override-bg); border-bottom: 2px solid var(--override-line); border-radius: 2px 2px 0 0; }

/* typed edit controls declared by a preset's field_types (dropdown / multi-select) */
.rv-selwrap { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.rv-select, .rv-other { font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; max-width: 100%; }
.rv-select:focus, .rv-other:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.rv-multi { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rv-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.rv-chk input { width: auto; margin: 0; }
/* a multi value outside the declared options (the paper's own term): a chip the coder can untick */
.rv-chk.rv-free { border: 1px dashed var(--border); border-radius: 999px; padding: 0 7px; }
.rv-multi .rv-multi-other { font-size: 12px; padding: 1px 6px; min-width: 110px; flex: 0 1 140px; }

/* confidence badges */
.confidence-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.confidence-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; }
.confidence-high { background: var(--conf-high-bg); border-color: var(--conf-high-bd); color: var(--conf-high); }
.confidence-medium { background: var(--conf-med-bg); border-color: var(--conf-med-bd); color: var(--conf-med); }
.confidence-low { background: var(--conf-low-bg); border-color: var(--conf-low-bd); color: var(--conf-low); }

/* evidence blocks (detail panel) */
.ev-block { border-left: 3px solid var(--accent); padding-left: 12px; margin: 8px 0; }
.ev-snippet { font-size: 12.5px; font-style: italic; color: var(--text); line-height: 1.6; margin: 0 0 6px; }
.ev-snippet::before { content: "\201C"; } .ev-snippet::after { content: "\201D"; }
.ev-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--bg); color: var(--text-muted); font-family: var(--font-mono); }
.ev-tag.ev-page { background: var(--accent-wash); color: var(--accent); }
.ev-tag.ev-source { background: var(--success-bg); color: var(--success); }

/* PDF page + highlight overlay (the signature evidence trace) */
.page { position: relative; width: calc(var(--pdf-zoom, 1) * 100%); min-width: calc(var(--pdf-zoom, 1) * 460px);
  max-width: calc(var(--pdf-zoom, 1) * 900px); margin: 0 auto 18px; background: var(--surface);
  box-shadow: var(--shadow-sm); }
.pageimg { display: block; width: 100%; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pagelabel { position: absolute; top: 4px; left: 4px; background: var(--accent); color: var(--on-accent);
  font-size: 11px; padding: 1px 6px; border-radius: 3px; z-index: 2; }
/* Only ONE evidence is shown at a time: every rect is transparent by default (no wall of
   highlights that makes the page unreadable), and clicking a value/field paints just that
   one (.sel), replacing the previous. .hot is the transient hover preview. */
rect.hl { fill: transparent; stroke: none; }
rect.hl.sel { fill: var(--highlight-focus); stroke: none; }
rect.hl.hot { fill: var(--highlight-focus); stroke: none; }
.val-check { font-size: 11px; color: var(--conf-med); margin-left: 8px; cursor: help; white-space: nowrap; }
rect.hl.flash { fill: var(--highlight-focus); stroke: none;
  animation: hl-pulse .5s ease 0s 3; }
@keyframes hl-pulse { 50% { fill: var(--green-focus); stroke: var(--green-stroke); } }
/* the coder's own marks: violet, apart from the model's evidence and the current item */
rect.cm { fill: rgba(126, 87, 194, .26); stroke: none; pointer-events: auto; cursor: pointer; }
rect.cm.hot, rect.cm.sel { fill: rgba(126, 87, 194, .5); }
body.stg-marking #pages img.pageimg { cursor: text; }
/* the rubber band of a drag in marking mode: the words from its start to its end become the mark */
rect.cm-drag { fill: rgba(126, 87, 194, .14); stroke: rgba(126, 87, 194, .75); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
body.stg-marking #pages { box-shadow: inset 0 0 0 2px rgba(126, 87, 194, .55); }
#pagespane .stg-pane-nav .stg-mark { margin-left: 4px; border-left: 1px solid var(--border); border-radius: 0; }
#pagespane .stg-pane-nav .stg-mark.on { color: #7e57c2; background: rgba(126, 87, 194, .12); }
/* "Your marks": the coder's sentences in the stage panel, page tag and text, ✕ on hover */
.stg-marks { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 6px; }
.stg-marks .stg-mark { position: relative; cursor: pointer; padding-right: 26px; }
.stg-marks .stg-mark-del { position: absolute; right: 2px; top: 4px; border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 12px; opacity: 0; }
.stg-marks .stg-mark:hover .stg-mark-del { opacity: .8; }
.stg-marks .stg-mark-del:hover { color: #b3261e; opacity: 1; }
.stg-nomarks { font-size: 12.5px; margin: 0; }

/* an extracted value that has linked evidence — hover previews, click jumps */
.rv-linked { cursor: pointer; border-bottom: 1px dotted var(--accent-3); }
.rv-linked:hover { background: var(--highlight); }
/* the field-name key is also click-to-evidence, but stays a plain label (no underline) */
.rv-key.rv-linked { border-bottom: none; }
/* read-only value with no cited evidence — still locatable in the PDF on click */
.rv-probe { cursor: pointer; }
.rv-probe:hover { background: var(--highlight); }

/* per-record card (panel) */
.record { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
  background: var(--surface); }
/* study-level info shown once above the per-condition entries */
.study-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  padding: 8px 12px; margin-bottom: 14px; }
.study-block > summary { cursor: pointer; font-weight: 600; }
.study-block .study-body { margin-top: 8px; }
.study-block .study-shared { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.study-block .study-sub { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.record.focus { animation: rec-focus 2.3s ease; }
@keyframes rec-focus { 0%, 100% { box-shadow: none; } 12%, 62% { box-shadow: 0 0 0 3px var(--accent-wash); border-color: var(--accent); } }
.rectitle { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.recdel { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 12px; opacity: .4; }
.recdel:hover { opacity: 1; }

/* sub-view tabs (metadata / correlations / effect sizes …) inside a record card */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; border-bottom: 1px solid var(--border); }
/* every tab is a visible chip (not only the active one) so a reviewer sees there are more */
.subtab { font-size: 13px; font-weight: 600; border: 1px solid var(--border); border-bottom: none; background: var(--bg); cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--text-muted); margin-bottom: -1px; }
.subtab:hover { color: var(--text); background: var(--surface); }
.subtab.active { color: var(--accent); background: var(--surface); border-color: var(--border); }
.subpanel.hidden { display: none; }
.verify { display: flex; gap: 6px; margin-bottom: 10px; }
.verify-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); align-items: center; }
.verify-lead { font-size: 12px; margin-right: 4px; }
.verify-foot .vbtn { padding: 4px 12px; font-size: 12px; }
.verify-foot .vbtn.on[data-status="verified"] { background: var(--success-bg); border-color: var(--success); color: var(--success); font-weight: 600; }
.verify-foot .vbtn.on[data-status="flagged"] { background: var(--flag-bg); border-color: var(--flag); color: var(--flag); font-weight: 600; }
.vbtn { font-size: 11px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 3px 9px; cursor: pointer; }
.vbtn.ok:hover { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.vbtn.flag:hover { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.vbtn:disabled { opacity: .5; cursor: default; }
.chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ── declarative presets: typed fields, citation state, confidence ─────────── */
.rv-missing { color: var(--text-muted); font-style: italic; border-bottom: 1px dotted var(--conf-med-bd); cursor: help; }
.rv-row-missing .rv-key { color: var(--conf-med); }
.rv-text { white-space: pre-wrap; display: inline-block; max-width: 100%; }
.rv-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--border); font-size: 12px; margin: 1px 0; }
.rv-table.rv-typed td, .rv-table.rv-typed th { vertical-align: middle; }
.rv-kv td:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
/* a value's citation state — where its evidence is, at a glance */
.rv-cited { border-bottom: 1px dotted var(--accent-3); cursor: pointer; }
.rv-cited:hover { background: var(--highlight); }
.rv-cited-nofix { border-bottom: 1px dotted var(--conf-med-bd); cursor: pointer; }
.rv-covered { cursor: pointer; }
.rv-covered:hover { background: var(--highlight); }
.rv-uncited { box-shadow: inset 0 -2px 0 var(--conf-low-bg); }
.rv-uncited::after { content: "no evidence"; font-size: 10px; color: var(--conf-low); margin-left: 6px; font-style: italic; }
/* one citation chip per sub-entry row / table row / table */
.rv-rowcite { width: 20px; text-align: center; padding: 3px 4px !important; }
.ev-cite { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 1px 6px;
  border-radius: 999px; background: var(--accent-wash); color: var(--accent); border: 1px solid var(--accent-3);
  cursor: pointer; white-space: nowrap; font-family: var(--font-mono); }
.ev-cite:hover { background: var(--highlight); }
.ev-cite.ev-none { background: var(--bg); color: var(--text-muted); border-color: var(--border); cursor: default; }
.uncited-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
/* confidence: a badge per group next to its fields, a dot for rollups, low = look here first */
.group-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 10px 0 4px; }
.conf-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font: inherit; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted); cursor: default; }
button.conf-badge { cursor: pointer; }
.conf-high { background: var(--conf-high-bg); border-color: var(--conf-high-bd); color: var(--conf-high); }
.conf-medium { background: var(--conf-med-bg); border-color: var(--conf-med-bd); color: var(--conf-med); }
.conf-low { background: var(--conf-low-bg); border-color: var(--conf-low-bd); color: var(--conf-low); }
.conf-caret { opacity: .7; font-size: 10px; }
.conf-notes { flex-basis: 100%; font-size: 12.5px; color: var(--text); background: var(--surface);
  border-left: 3px solid var(--border); padding: 4px 10px; margin: 2px 0 6px; }
.conf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 5px; vertical-align: middle;
  border: 1px solid transparent; }
.conf-dot.conf-high { background: var(--conf-high-bd); }
.conf-dot.conf-medium { background: var(--conf-med-bd); }
.conf-dot.conf-low { background: var(--conf-low-bd); }
.conf-dot.conf-unknown { background: var(--border); }
.rv-row.rv-low { border-left: 3px solid var(--conf-low-bd); padding-left: 8px; margin-left: -11px; }
.rv-row.rv-low > .rv-key { color: var(--conf-low); }
.rv-row.rv-medium { border-left: 3px solid var(--conf-med-bd); padding-left: 8px; margin-left: -11px; }
td.rv-low { box-shadow: inset 3px 0 0 var(--conf-low-bd); }
.subtab .conf-dot { margin-left: 4px; }
.rc-conf { margin-left: auto; }
.rc-evsum { font-size: 12px; color: var(--conf-med); margin: -2px 0 8px; }
/* faint context: this entry's sources on the page; the clicked one stays strong */
rect.hl.ctx { fill: var(--highlight); stroke: none; }
/* entry nav: status + confidence at a glance, needs-attention count */
.rnav-tab .st-dot, .docsub-item .st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; background: var(--border); vertical-align: middle; flex: none; }
.rnav-tab .st-dot.verified, .docsub-item .st-dot.verified { background: var(--success); }
.rnav-tab .st-dot.flagged, .docsub-item .st-dot.flagged { background: var(--flag); }
.rnav-tab .needs { font-size: 10px; font-weight: 700; color: var(--conf-low); margin-left: 4px; }
/* display.sheet: a table's pill carries its verified-over-total column count */
.rnav-tab .dt-n { font-size: 10.5px; font-weight: 600; color: var(--text-muted); background: var(--bg); border-radius: 8px; padding: 0 5px; margin-left: 6px; }
.rnav-tab.active .dt-n { background: var(--surface); }
/* progress + triage in the panel head */
.progress { font-weight: 600; color: var(--text-muted); }
.progress.done { color: var(--success); }
.triage { font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); padding: 3px 6px; }
.kbd-help { position: fixed; right: 16px; bottom: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 10px 14px; font-size: 12px; z-index: 50; }
.kbd-help kbd { font-family: var(--font-mono); background: var(--bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 5px; }
.paper-fields { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.issue-note { font-size: 12px; color: var(--conf-med); margin: 4px 0 8px; }

/* ── the chain review layout (display.review.layout = "chain") ───────────────── */
.cs-plus { color: var(--conf-high); stroke: var(--conf-high); fill: var(--conf-high); border-color: var(--conf-high); }
.cs-minus { color: var(--conf-low); stroke: var(--conf-low); fill: var(--conf-low); border-color: var(--conf-low); }
.cs-zero { color: var(--text-muted); stroke: var(--text-muted); fill: var(--text-muted); border-color: var(--text-muted); }
.cs-mixed { color: var(--conf-med); stroke: var(--conf-med); fill: var(--conf-med); border-color: var(--conf-med); }
.chain-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.chain-head .chain-title { font: 600 15px/1.3 var(--font-serif); margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-head .chain-prog { font-size: 12px; white-space: nowrap; }
.chain-nav { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); width: 28px; height: 28px; font-size: 15px; cursor: pointer; color: var(--text); }
.chain-nav:hover { border-color: var(--accent-3); } .chain-nav:disabled { opacity: .4; cursor: default; }
.chain-dag { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 12px 8px; margin-bottom: 12px; }
.chain-dagscroll { overflow: auto; }
.chain-svg text { font: 11.5px system-ui, sans-serif; fill: var(--text); }
.chain-svg .chain-n rect { fill: var(--bg); stroke: var(--border); stroke-width: 1.2; } .chain-svg .chain-n.unplaced rect { stroke-dasharray: 4 3; }
.chain-svg .chain-line { fill: none; stroke-width: 1.8; opacity: .85; } .chain-svg .chain-hit { fill: none; stroke: transparent; stroke-width: 14; }
.chain-svg .chain-dot { fill: var(--surface); stroke-width: 1.6; } .chain-svg .chain-sign { font: 700 11px ui-monospace, Menlo, monospace; stroke: none; }
.chain-svg .chain-e { cursor: pointer; } .chain-svg .chain-e:hover .chain-line, .chain-svg .chain-e.on .chain-line { stroke-width: 3.2; opacity: 1; }
.chain-svg .chain-e.dim { opacity: .18; }
.chain-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.chain-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 5px; }
.chain-card { transition: opacity .15s; } .chain-card.dim { opacity: .3; } .chain-card.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chain-card.dim:hover { opacity: .8; }
.chain-id { font-size: 12px; color: var(--text-muted); }
.chain-edge { display: flex; align-items: center; flex-wrap: wrap; cursor: pointer; margin: 2px 0 0; }
.chain-node { border: 1.2px solid var(--border); background: var(--bg); border-radius: 7px; padding: 4px 10px; font-weight: 600; font-size: 13.5px; max-width: 44%; }
.chain-node small { display: block; font: 400 10px ui-monospace, Menlo, monospace; color: var(--text-muted); margin-top: 1px; }
.chain-arrow { flex: 0 0 auto; display: flex; align-items: center; margin: 0 2px; }
.chain-arrow .ln { width: 26px; height: 0; border-top: 2px solid; }
.chain-arrow .sg { width: 20px; height: 20px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; justify-content: center; font: 700 12px/1 ui-monospace, Menlo, monospace; background: var(--surface); }
.chain-arrow .hd { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid; }
.chain-stmt { font-weight: 600; font-size: 13.5px; margin: 2px 0 0; }
.chain-scope { font-size: 12px; margin: 6px 0 0; }
.chain-dl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; margin: 12px 0 0; }
.chain-dl dt { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; padding-top: 4px; }
.chain-dl dd { margin: 0; min-width: 0; }
.chain-q { font: italic 13.5px/1.5 var(--font-serif); } .chain-q .ev-cite { font-style: normal; margin-left: 4px; vertical-align: middle; }
.chain-pg { font-size: 11px; margin-left: 6px; }
.chain-none { font-size: 12.5px; }
.chain-res { margin-bottom: 8px; } .chain-line { font-size: 13px; line-height: 1.7; } .chain-line b { font-weight: 600; }
.chain-num { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; background: var(--bg); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.chain-chk { font-size: 11px; margin-left: 6px; white-space: nowrap; } .chain-chk.agrees { color: var(--conf-high); } .chain-chk.mismatch { color: var(--conf-low); font-weight: 700; } .chain-chk.unchecked { color: var(--text-muted); }
.chain-rowlab { font-size: 12px; margin: 0 0 4px; }
/* the two sides of one paper linked: a result row opens the regression column it cites in the
   tables document; a regression column lists the claims citing it in the claims document */
.chain-open, .cited-link { font-size: 11px; margin-left: 6px; white-space: nowrap; text-decoration: none; color: var(--accent); }
.chain-open:hover, .cited-link:hover { text-decoration: underline; }
.cited-by { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 12px; margin: -4px 0 8px; }
.cited-by .k { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.cited-link { margin-left: 0; border: 1px solid var(--border); border-radius: 9px; padding: 0 7px; line-height: 1.6; }
.cited-link.cc-exact { border-color: var(--conf-high); } .cited-link.cc-mismatch { border-color: var(--conf-low); color: var(--conf-low); font-weight: 600; }
.chain-op { font-size: 12.5px; margin-top: 2px; display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; }
.chain-op .k { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
.chain-why summary { font-size: 11.5px; cursor: pointer; } .chain-why div { font-size: 12px; margin-top: 2px; }
.chain-lineq { font-size: 12.5px; }
.tag { display: inline-block; font-size: 10.5px; border: 1px solid var(--border); border-radius: 9px; padding: 0 7px; color: var(--text-muted); margin: 1px 4px 0 0; white-space: nowrap; }
.tag.warn { border-color: var(--conf-med); color: var(--conf-med); }
.chain-foot { display: flex; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.chain-foot .vbtn { padding: 4px 12px; font-size: 12px; } .chain-sup { margin-left: auto; cursor: help; } .chain-note { font-size: 11.5px; cursor: help; }
.chain-card .status { margin-left: 2px; }
.chain-review { display: inline-flex; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.chain-review[hidden] { display: none; }        /* an explicit display beats the UA's [hidden] rule */
.chain-review select, .chain-review input { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.chain-review input { flex: 1; min-width: 90px; }
.chain-foot .vbtn.on[data-status="verified"] { background: var(--success-bg); border-color: var(--success); color: var(--success); font-weight: 600; }
.chain-foot .vbtn.on[data-status="flagged"] { background: var(--error-bg); border-color: var(--error); color: var(--error); font-weight: 600; }
.hist-note { font-size: 12px; color: var(--text); margin: 2px 0 0 2px; }
.chain-construct { font-style: italic; } .tag.chain-stratum { border-color: var(--accent-3); color: var(--accent); }
.chain-modelnote { font-size: 12.5px; color: var(--text-muted); }

/* chain review, editable: the estimate and its se are cells like any other; a row can be
   taken off a claim, and a result added */
.chain-num .rv-editable { font: inherit; min-width: 2.2em; text-align: right; }
.chain-resdel { margin-left: 6px; border: none; background: none; color: var(--text-muted);
  cursor: pointer; font-size: 12px; border-radius: 3px; padding: 0 4px; visibility: hidden; }
.chain-res:hover .chain-resdel { visibility: visible; }
.chain-resdel:hover { color: var(--error); background: var(--error-bg); }
.chain-addres { margin-top: 6px; border: 1px dashed var(--border); background: none;
  color: var(--text-muted); border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer;
  font-size: 12px; }
.chain-addres:hover { color: var(--accent); border-color: var(--accent-3); background: var(--accent-wash); }

/* the standalone note: who wrote it and when, beside the input */
.chain-noteby { font-size: 11.5px; white-space: nowrap; align-self: center; }
.vbtn.notebtn { opacity: .85; }

/* ＋ row / ✕ on a typed table — structural edits, logged as corrections */
.rv-tableadd { margin: 3px 0 0; }
.rv-addrow { border: 1px dashed var(--border); background: none; border-radius: var(--radius-sm);
             color: var(--text-muted); font-size: 11.5px; padding: 1px 8px; cursor: pointer; }
.rv-addrow:hover { color: var(--accent-dark); border-color: var(--accent); }
.rv-rowdel-h, .rv-rowdel-c { width: 18px; }
.rv-rowdel { border: none; background: none; color: var(--text-muted); cursor: pointer;
             font-size: 11px; padding: 0 2px; opacity: 0; transition: opacity .12s; }
tr:hover .rv-rowdel { opacity: .75; }
.rv-rowdel:hover { color: #b3261e; opacity: 1; }
/* the same two buttons on a sub-entry (an arm, a result): a card's ✕ sits at the end of its head line */
.rv-childcards .rv-tableadd, .rv-child + .rv-tableadd { margin: 2px 0 6px; }
.rc-head .rv-rowdel { opacity: .5; margin-left: auto; }
.rv-card:hover .rv-rowdel { opacity: .85; }

/* display.inline_evidence: a field's note and quotes under it */
.rv-inline { margin: -2px 0 10px; padding: 4px 0 2px 10px; border-left: 2px solid var(--border); }
.rv-inote { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.rv-inote b { color: var(--text); font-weight: 600; }
.rv-iquotes { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; line-height: 1.45; }
.rv-iquotes li { margin: 3px 0; }
.rv-iq { margin-right: 4px; }
.rv-stance { display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.rv-stance[data-src="supporting"] { background: var(--success-bg); color: var(--success); border-color: transparent; }
/* display.review.layout "criteria": one row per criterion — label, the call, the model's probability as
   a chip shaded from green (certain) to red (a coin toss) — then the reasoning and the quotes for/against */
.cr-list { display: flex; flex-direction: column; gap: 8px; }
.cr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; }
.cr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-label { font-weight: 600; flex: 1 1 160px; min-width: 0; }
.cr-call .rv-obj, .cr-ot .rv-obj { margin: 0; }
.cr-call .rv-row, .cr-ot .rv-row { display: block; padding: 0; border: 0; margin: 0; }
.cr-call .rv-key, .cr-ot .rv-key { display: none; }
.cr-call .rv-val, .cr-ot .rv-val { padding: 0; }
.cr-p { font: 600 12px/1 var(--font-mono); padding: 4px 7px; border-radius: 10px; min-width: 36px; text-align: center;
        background: color-mix(in srgb, var(--conf-high-bg) calc(var(--cert) * 100%), var(--conf-low-bg));
        color: color-mix(in srgb, var(--conf-high) calc(var(--cert) * 100%), var(--conf-low));
        border: 1px solid color-mix(in srgb, var(--conf-high-bd) calc(var(--cert) * 100%), var(--conf-low-bd)); }
.cr-ot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cr-p.cr-veiled { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
.cr-veiled-note { font-style: italic; }
.rv-qt { font-family: var(--font-serif); font-style: italic; font-size: 13.5px; }
.cr-reason { font-size: 12.5px; color: var(--text-muted); margin: 5px 0 0; line-height: 1.45; }
.cr-ev { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 14px; margin-top: 6px; font-size: 12.5px; }
.cr-side b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.cr-for b { color: var(--success); }
.cr-against b { color: var(--error); }
.cr-side .rv-iquotes { margin-top: 2px; }
.cr-side.cr-mixed > b { display: none; }
.cr-side.cr-mixed.cr-empty > b { display: inline; color: var(--text-muted); }
.cr-side.cr-empty b { margin-right: 6px; }
.cr-side.cr-empty .muted { font-size: 12px; }
.cr-after { margin-top: 10px; }
.cr-more { margin-top: 8px; font-size: 12.5px; }
.cr-more summary { cursor: pointer; color: var(--text-muted); }
.rv-stance[data-src="questioning"] { background: var(--conf-med-bg); color: var(--conf-med); border-color: transparent; }
/* the evidence layout: the reader's items first, the cells each bears on beneath */
.evi-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 12px; margin-bottom: 10px; }
.evi-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.evi-id { font: 700 11px ui-monospace, Menlo, monospace; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.evi-note { font-size: 12px; flex-basis: 100%; }
.evi-body { font: italic 13.5px/1.5 var(--font-serif); margin: 2px 0 8px; }
.evi-body.evi-tbl { font: inherit; font-size: 13px; }
.evi-cap { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.evi-tablewrap { overflow: auto; max-height: 340px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.evi-table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.evi-table th, .evi-table td { padding: 2px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.evi-table th { position: sticky; top: 0; background: var(--bg); font-weight: 600; }
.evi-cells { border-top: 1px dashed var(--border); padding-top: 4px; }
.evi-cells.evi-nothing { font-size: 12px; }
.evi-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin: 8px 0 2px; }
.evi-lower { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evi-go { border: 1px dashed var(--border); background: none; color: var(--text-muted); border-radius: var(--radius-sm); padding: 1px 8px; cursor: pointer; font-size: 11.5px; }
.evi-go:hover { color: var(--accent); border-color: var(--accent-3); background: var(--accent-wash); }
.evi-rec { padding: 8px 12px; } .evi-rec .rectitle { margin-bottom: 4px; } .evi-rec .verify { margin-bottom: 4px; }
.evi-rest { border-style: dashed; }
.evi-pgroups { margin: 0 0 8px; }
/* the staged layout: a stage bar, the stage's instruction, its items, the rest folded, its cells */
.stg-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.stg-tab { border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 999px; padding: 2px 10px 2px 6px; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.stg-tab:hover { color: var(--accent); border-color: var(--accent-3); }
.stg-tab.active { color: var(--text); border-color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.stg-k { font: 700 10.5px ui-monospace, Menlo, monospace; text-transform: uppercase; background: var(--bg); border-radius: 999px; padding: 0 5px; color: var(--text-muted); }
.stg-tab.active .stg-k { background: var(--accent); color: #fff; }
.stg-prog { font-size: 12px; margin-left: auto; }
.stg-help { font-size: 13px; line-height: 1.5; padding: 8px 12px; margin: 0 0 10px; border-left: 3px solid var(--accent); background: var(--accent-wash); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.stg-help p { margin: 0 0 6px; } .stg-help p:last-child { margin: 0; }
.stg-items .evi-item:last-child { margin-bottom: 10px; }
.stg-noitems { font-size: 12.5px; margin: 0 0 10px; }
.stg-other { margin: 0 0 12px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 4px 12px; }
.stg-other > summary { cursor: pointer; color: var(--text-muted); font-size: 12.5px; padding: 4px 0; }
.stg-other .evi-item { margin: 6px 0; }
.stg-cells { border-top: 2px solid var(--border); padding-top: 10px; }
.stg-entry { margin-bottom: 10px; }
.stg-fields { margin-top: 4px; }
.stg-empty { font-size: 12.5px; margin: 0 0 8px; }
.stg-addtask { display: block; margin: 4px 0 10px; }
.stg-copy { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0 2px; font-size: 12px; }
.stg-copyfrom { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; }
.stg-same { border: 1px dashed var(--border); background: none; color: var(--text-muted); border-radius: var(--radius-sm); padding: 1px 8px; cursor: pointer; font-size: 11.5px; }
.stg-same:hover { color: var(--accent); border-color: var(--accent-3); background: var(--accent-wash); }
/* the item control at the top of the PDF column while a stage is open */
#pagespane .stg-pane-nav { position: absolute; top: 8px; left: 18px; z-index: 6; display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 4px; font-size: 12px; color: var(--text-muted); box-shadow: var(--shadow-sm); }
#pagespane .stg-pane-nav button { border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; padding: 2px 7px; border-radius: 4px; color: var(--text); }
#pagespane .stg-pane-nav button:hover { background: var(--bg); }
#pagespane .stg-pane-nav button:disabled { opacity: .35; cursor: default; }
#pagespane .stg-pane-nav .stg-pane-k { min-width: 84px; text-align: center; }
.stg-head { margin: 0 0 6px; }
.stg-cells .rv-obj { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
/* the stage's evidence: one plain list — number and page on a line, then the quote or the table —
   items parted by a thin rule, the current one marked by a left accent */
.stg-evidence { margin: 8px 0 14px; }
.stg-evidence > .evi-item { border: 0; border-radius: 0; box-shadow: none; background: none; padding: 6px 8px 7px 10px; margin: 0;
  border-left: 3px solid transparent; border-bottom: 1px solid var(--border); cursor: pointer; }
.stg-evidence > .evi-item:last-of-type { border-bottom: 0; }
.stg-evidence > .evi-item .evi-head { margin-bottom: 3px; gap: 6px; }
.stg-evidence > .evi-item .evi-body { margin: 0; font-size: 12.5px; line-height: 1.45; }
.stg-evidence > .evi-item .evi-note { flex-basis: auto; }
.stg-evidence > .evi-item:hover { border-left-color: var(--accent-3); }
.stg-evidence > .evi-item.cur { border-left-color: var(--accent); background: var(--accent-wash); }
.stg-evidence .stg-other { margin: 6px 0 0; }
.evi-item.evi-bare .evi-head { margin-bottom: 2px; }
/* a bare passage: the page tag hangs at the left of the quote, which wraps beside it; a table
   keeps its tag above */
.stg-evidence .evi-item.evi-bare.evi-passage { display: flex; align-items: flex-start; gap: 10px; }
.stg-evidence .evi-item.evi-bare.evi-passage .evi-head { flex: 0 0 auto; margin: 3px 0 0; }
.stg-evidence .evi-item.evi-bare.evi-passage .evi-body { flex: 1 1 auto; min-width: 0; }
/* the PDF column collapsed to a strip at the right edge: the icon opens it; "item k of n" stacked */
/* the right column of a stages preset: the stage's EVIDENCE in the upper pane, the PDF in the
   lower one, a draggable bar between them */
.stg-evpane, .hsplitter { display: none; }
body.stg-split .stg-evpane { display: block; flex: 0 0 var(--evpane-h, 50%); min-height: 60px; overflow: auto; padding: 8px 16px 10px; background: var(--surface); }
body.stg-split .hsplitter { display: block; flex: 0 0 6px; cursor: row-resize; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hsplitter:hover, .hsplitter.drag { background: var(--accent-3); }
/* the PDF collapsed: a strip along the foot of the column, the evidence taking the rest */
body.stg-pdf-closed .hsplitter { display: none; }
body.stg-pdf-closed .stg-evpane { flex: 1 1 auto; }
body.stg-pdf-closed #pdfpane { flex: 0 0 34px; border-top: 1px solid var(--border); background: var(--surface); }
body.stg-pdf-closed #pdfpane > :not(.stg-pdf-strip) { display: none; }
.stg-pdf-strip { display: none; }
body.stg-pdf-closed .stg-pdf-strip { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 100%; }
.stg-pdf-open { border: 0; background: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; line-height: 0; }
.stg-pdf-open:hover { color: var(--accent); background: var(--accent-wash); }
.stg-pdf-k { font-size: 11px; color: var(--text-muted); white-space: nowrap; letter-spacing: .02em; }
#pagespane .stg-pane-nav .stg-pdf-close { margin-left: 4px; border-left: 1px solid var(--border); border-radius: 0 4px 4px 0; }
/* the foot of a stage: previous item, and next item / next stage / done */
/* tables in a stage's fields block are tight: the model's lists are long */
.stg-cells .rv-table { font-size: 11.5px; }
.stg-cells .rv-table th, .stg-cells .rv-table td { padding: 1px 5px; line-height: 1.25; }
.stg-cells .rv-table.rv-typed td, .stg-cells .rv-table.rv-typed th { vertical-align: top; }
.stg-cells .rv-typed .rv-editable { padding: 0 2px; }
.stg-cells .rv-typed .rv-editable:empty { min-width: 2em; min-height: 1em; }
.stg-cells .rv-typed select { font-size: 11.5px; padding: 0 2px; }
.stg-cells .rv-typed .rv-opt-help { display: inline; margin-left: 2px; }
.rv-nocite .rv-rowcite { display: none; }
.stg-cells .stg-entry .ev-none, .stg-cells .stg-entry .rc-evsum { display: none; }
body.stg-split .stg-entry .rv-uncited { box-shadow: none; }                /* the coder's own cells cite nothing: no marker */
body.stg-split .stg-entry .rv-uncited::after { content: none; }
.stg-cells tr.stg-cited { cursor: pointer; }
.stg-cells tr.stg-cited:hover td { background: var(--accent-wash); }
.stg-cells .rv-typed .rv-selwrap { white-space: nowrap; }
.stg-units, .stg-misses { margin: 0 0 8px; font-size: 12px; }
.stg-units ul, .stg-misses ul { margin: 2px 0 4px 18px; padding: 0; }
.stg-units li, .stg-misses li { margin: 1px 0; }
.stg-match select { max-width: 220px; }
tr.stg-group td { background: var(--bg); font-size: 11.5px; padding: 3px 6px; border-top: 2px solid var(--border); }
tr.stg-group.dropped td { color: var(--text-muted); text-decoration: line-through; }
.stg-accept { border: 1px solid var(--border); background: var(--surface); color: var(--accent); border-radius: 4px; cursor: pointer; font: inherit; font-size: 11px; padding: 1px 6px; white-space: nowrap; }
.stg-accept:hover { background: var(--accent-wash); border-color: var(--accent); }
.stg-accept.done { color: var(--success); border-color: var(--success); cursor: default; }
.stg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 6px 0 18px; }
.stg-foot .stg-next { font-weight: 600; }

/* display.sheet: a table field as the printed table — rows as printed, one column per entry of the
   same table; this entry's column is the editable one (tinted), its siblings stand beside it */
.sheet { margin: 2px 0 4px; }
.sh-cap { font-weight: 600; font-size: 12.5px; margin: 0 0 4px; }
.sh-cap .muted { font-weight: 400; }
.sh-t { border-collapse: collapse; font-size: 12.5px; min-width: 100%; border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.sh-t th, .sh-t td { padding: 2px 8px; vertical-align: baseline; white-space: nowrap; border: 0; }
.sh-t thead th { font-weight: 600; text-align: right; color: var(--text); }
.sh-t thead tr:last-child th { border-bottom: 1px solid var(--text); }
.sh-t thead tr.sh-hdr th { font-weight: 400; font-size: 11.5px; color: var(--text-muted); white-space: normal; max-width: 120px; vertical-align: top; }
.sh-t th.sh-col[data-rid] { cursor: pointer; color: var(--text-muted); }
.sh-t th.sh-col[data-rid]:hover { color: var(--accent); }
.sh-t .st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 5px; background: var(--border); vertical-align: middle; }
.sh-t .st-dot.verified { background: var(--success); }
.sh-t .st-dot.flagged { background: var(--flag); }
.sh-t td.sh-lab, .sh-t th.sh-lab { text-align: left; white-space: normal; min-width: 90px; max-width: 220px; }
.sh-t td.sh-cell { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.sh-t .sh-me { background: var(--accent-wash); }
.sh-t thead th.sh-me { color: var(--accent); }
.sh-t td.sh-sib { color: var(--text-muted); cursor: pointer; }
.sh-t td.sh-sib:hover { color: var(--text); }
.sh-t tr.sh-sub td { padding-top: 0; font-size: 11.5px; }
.sh-t tr.sh-sub td.sh-lab { color: var(--text-muted); }
.sh-type { font-size: 10px; color: var(--text-muted); margin-left: 4px; font-style: italic; font-family: var(--font-sans, inherit); }
.sh-t tr.sh-rule td { border-top: 1px solid var(--text); padding-top: 4px; }
.sh-t tr.sh-panel td { font-weight: 600; font-style: italic; padding-top: 6px; }
.sh-val { display: inline-block; min-width: 2.5em; text-align: right; }
.sh-foot { margin: 4px 0 0; }
.sh-toggle { font-size: 11.5px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 1px 8px;
  cursor: pointer; color: var(--text-muted); }
.sh-toggle:hover { color: var(--text); background: var(--surface); }
/* a table on one card: every cell editable, the open column tinted, its own fields under the table */
.tcard .sh-t th.sh-col[data-key] { cursor: pointer; }
.tcard .sh-t th.sh-col[data-key]:hover { color: var(--accent); }
.tcard .sh-t td.sh-cell .sh-val:focus { outline: 1px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.tc-col { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.tc-ident { margin: 2px 0 8px; padding: 6px 10px; border: 1px dashed var(--border); border-radius: 8px; }
.tc-colhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.tc-colhead .muted { font-size: 12px; }
.rv-extra { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--border); }
/* a joint workflow: the paper's claims under the table they cite */
.jc-box { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.jc-none { font-size: 12px; }
.jc-cap { font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.jc-cap .muted { font-weight: 400; }
.jc-claim { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin: 0 0 6px; background: var(--bg); }
.jc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.jc-edge { color: var(--text); }
.jc-arrow { color: var(--text-muted); }
.jc-sign { font-size: 11.5px; color: var(--text-muted); font-style: italic; }
.jc-acts { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.jc-acts .vbtn { padding: 1px 8px; }
.jc-open { font-size: 12px; margin-left: 4px; }
.jc-stmt { font-size: 12.5px; margin: 3px 0 2px; }
.jc-q { font-size: 12px; color: var(--text-muted); margin: 2px 0; }
.jc-ql { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.jc-res { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }
.jc-cc { font-size: 11.5px; }
.jc-cc.cc-exact { color: var(--success); }
.jc-cc.cc-mismatch { color: var(--conf-low); }
.rnav-tab .jc-n { font-size: 10.5px; color: var(--text-muted); margin-left: 5px; }
.sh-t thead th .sh-colname { display: inline-block; min-width: 1.5em; }
.sh-t thead tr.sh-printed th { font-weight: 600; font-size: 11.5px; color: var(--text); white-space: normal; max-width: 120px; }
.sh-t thead th .sh-hdrtxt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 140px; }
/* a row's tools sit in the flow with their space kept, shown on hover: nothing moves under the pointer */
.sh-rowtools { visibility: hidden; display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; vertical-align: baseline; }
.sh-row:hover .sh-rowtools, .sh-rowtools:focus-within { visibility: visible; }
.sh-typebtn, .sh-rowdel { font-size: 10px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; color: var(--text-muted); cursor: pointer; padding: 0 5px; line-height: 15px; font-family: var(--font-sans, inherit); font-style: normal; }
.sh-typebtn:hover { color: var(--text); }
.sh-typesel { font-size: 10px; max-width: 110px; margin-left: 6px; }
.sh-rowdel:hover { color: var(--conf-low); }
.sh-addrow { font-size: 11.5px; border: 1px dashed var(--border); background: var(--bg); border-radius: 999px; padding: 1px 8px; cursor: pointer; color: var(--text-muted); }
.sh-addrow:hover { color: var(--text); background: var(--surface); }
.tc-del { margin-left: auto; }
.tc-foot .tc-note { flex: 1 1 220px; min-width: 160px; font-size: 12px; margin-left: 8px; }
.sh-t .sh-val.sh-target { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* what a joint workflow asks of each column besides the cells: one line per column */
.tc-ask { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.tc-askcap { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.tc-askcap .muted { font-weight: 400; }
.tc-asktab { border-collapse: collapse; font-size: 12.5px; }
.tc-asktab th, .tc-asktab td { padding: 2px 10px 2px 0; text-align: left; vertical-align: middle; }
.tc-asktab thead th { font-weight: 600; color: var(--text-muted); font-size: 11.5px; border-bottom: 1px solid var(--border); }
.tc-asktab tbody th { font-weight: 400; white-space: nowrap; }
.tc-asktab tr.tc-me th { color: var(--accent); }
.tc-coldel { font-size: 10px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; color: var(--text-muted); cursor: pointer; padding: 0 5px; line-height: 15px; }
.tc-coldel:hover { color: var(--conf-low); }
.tc-asktab .rv-row { border: 0; padding: 0; margin: 0; display: block; }
.tc-asktab .rv-key { display: none; }
.tc-asktab td .rv-editable, .tc-asktab td .rv-listed { display: block; max-width: 300px; max-height: 4.6em; overflow: auto; white-space: pre-wrap; }   /* a long note scrolls; the line stays a line */
.jc-fields { margin-top: 4px; }
.jc-fields .rv-row { margin: 0; }
.jc-restab { margin-top: 6px; }
.jc-restab .rv-table { font-size: 12px; }
.jc-restab tr.jc-here td { background: var(--accent-wash); }
.jc-restab .rv-rowcite .jc-cc { font-weight: 600; font-size: 12px; }
.jc-slot > .chain-card { margin: 0 0 8px; }
.chain-res.jc-here { background: var(--accent-wash); border-radius: 6px; padding-left: 6px; margin-left: -6px; }
.jc-col { font-size: 11.5px; margin-left: 6px; }
.jc-type { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.jc-main { color: var(--accent); font-weight: 600; font-size: 11.5px; }

/* what the workflow's checks found: a note on the card, a mark on the cell a finding names */
.check-note { font-size: 12px; margin: 2px 0 6px; padding: 3px 8px; border-radius: 6px; background: var(--conf-low-bg); color: var(--conf-low); cursor: help; }
.check-note.cf-warn { background: var(--conf-med-bg); color: var(--conf-med); }
.cell-finding { box-shadow: inset 0 -2px 0 var(--conf-low); }
.cell-finding.cf-warn { box-shadow: inset 0 -2px 0 var(--conf-med-bd); }
.cell-finding.cf-info { box-shadow: none; text-decoration: underline dotted var(--border); }

/* the review queue bar above the panel: a gate's worklist and its progress */
.queuebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 10px; margin: 0 0 8px; font-size: 12.5px;
  border: 1px solid var(--accent-3); border-radius: var(--radius-sm); background: var(--accent-wash); }
.queuebar[hidden] { display: none; }
.qb-label { font-weight: 600; }
.qb-progress { width: 120px; height: 8px; }
.qb-all { margin-left: auto; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.qb-exit { font-size: 12px; }

/* ---- call chains: candidate chips, the card's run summary, the trace, read-only runs ---- */
.rv-cands { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; justify-content: flex-end; }
.rv-cand { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; font: inherit;
           font-size: 11.5px; padding: 0 7px; cursor: pointer; color: var(--text); line-height: 1.6; }
.rv-cand:hover:not([disabled]) { border-color: var(--accent); color: var(--accent-dark); }
.rv-cand[disabled] { cursor: default; }
.rv-cand-cur { border-color: var(--accent); background: var(--accent-bg, #eef4f6); font-weight: 600; }
.rv-cand-n { margin-left: 5px; font-size: 10px; color: var(--text-muted); font-weight: 400; }
.chain-sum { font-size: 11.5px; color: var(--text-muted); font-weight: 400; white-space: nowrap; }
.chain-flag { font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: var(--conf-med-bg); color: var(--conf-med);
              border: 1px solid var(--conf-med-bd); font-weight: 500; }
.tracebody { font-size: 12px; margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }
.trace-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 2px 0; }
.trace-row code { font-size: 11px; }
.trace-hop { font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--accent-dark); text-decoration: none; }
.trace-hop:hover { border-color: var(--accent); }
.runsbody table { width: 100%; border-collapse: collapse; font-size: 12px; }
.runsbody th, .runsbody td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.runsbody .differs { background: var(--conf-med-bg); }
.ro-banner { padding: 6px 10px; margin-bottom: 8px; font-size: 12.5px; color: #7a5325; background: #fdf3e3;
             border: 1px solid #ecdfc8; border-radius: var(--radius-sm); }
body.ro .verify, body.ro .recdel, body.ro .rv-addrow, body.ro .rv-rowdel, body.ro .rv-rowsel, body.ro .rv-rowdel-sel,
body.ro #addfinding, body.ro #deldoc, body.ro .rv-cand:not([disabled]) { display: none !important; }

/* support colours (how many runs stand behind an entry), the definition hover card, issue list */
.chain-sum.s-all { color: var(--conf-high, #2c6e2c); }
.chain-sum.s-majority { color: var(--conf-med); }
.chain-sum.s-minority { color: var(--conf-low, #b3261e); font-weight: 600; }
.rv-val.rv-support { border-radius: var(--radius-sm); padding: 0 6px; }
.rv-val.rv-support.s-all { background: var(--conf-high-bg, #e7f2e7); color: var(--conf-high, #2c6e2c); }
.rv-val.rv-support.s-majority { background: var(--conf-med-bg); color: var(--conf-med); }
.rv-val.rv-support.s-minority { background: var(--conf-low-bg, #fbe5e3); color: var(--conf-low, #b3261e); }
.deftip { position: fixed; z-index: 60; max-width: 340px; font-size: 12px; line-height: 1.45; padding: 6px 9px;
          background: var(--text, #222); color: #fff; border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(0,0,0,.18);
          pointer-events: none; white-space: pre-wrap; }
[data-def] { cursor: help; }
.issue-note { cursor: pointer; }
.issue-list { margin: 4px 0 0 16px; padding: 0; font-size: 11.5px; color: var(--text-muted); }
.issue-list li { margin: 1px 0; }
