:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --ink: #14171f;
  --ink-2: #5a6473;
  --line: #e2e6ec;
  --accent: #2f5fe0;
  --accent-ink: #ffffff;
  --ok: #1c7c48;
  --ok-bg: #e6f5ec;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --bad: #a32020;
  --bad-bg: #fbe9e9;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --panel: #171b23; --panel-2: #1d222c; --ink: #e7eaf0; --ink-2: #98a2b3;
    --line: #2a3140; --accent: #6b93ff; --accent-ink: #0b0e14;
    --ok: #6ee7a8; --ok-bg: #12301f; --warn: #f0c274; --warn-bg: #33270e; --bad: #ff9d9d; --bad-bg: #3a1717;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}
h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: .92em; }

/* ------------------------------------------------------------------ header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  /* Above the scrim (40): navigation must stay reachable while the drawer is open,
     and clicking a tab closes it. Still below the drawer itself (50). */
  position: sticky; top: 0; z-index: 46;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; }
.topbar h1 { font-size: 16px; }
.sub { margin: 0; color: var(--ink-2); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
#apikey { width: 210px; }

input, select, textarea {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--ink); font: inherit; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-icon { padding: 4px 9px; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 4px; padding: 0 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: relative; z-index: 45;
  flex-wrap: wrap;              /* eight tabs must survive a narrow window */
}
.tab-link:first-of-type { margin-left: auto; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; }
  #apikey { flex: 1; }
}
.tab {
  padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--ink-2); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 560; }
.tab-link { text-decoration: none; margin-left: auto; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ----------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
#q { flex: 1 1 340px; }
.hint { color: var(--ink-2); font-size: 12.5px; margin: 0 0 14px; }

/* ----------------------------------------------------------------- results */
.results { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer;
}
.row:hover { border-color: var(--accent); }
.thumb {
  width: 56px; height: 74px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.thumb-empty { display: grid; place-items: center; color: var(--ink-2); font-size: 20px; }
.row-main { min-width: 0; }
.row-title { font-weight: 570; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.row-meta { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.row-meta span + span::before { content: "·"; margin: 0 7px; opacity: .5; }
.snippet {
  margin-top: 5px; font-size: 12.5px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.snippet b, .snippet mark { color: var(--ink); background: var(--warn-bg); border-radius: 3px; padding: 0 2px; }
.row-side { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

.pill { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-muted { background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; color: var(--ink-2); }
.empty { padding: 40px; text-align: center; color: var(--ink-2); }

/* ------------------------------------------------------------------- cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.upload-card { max-width: 520px; display: flex; flex-direction: column; gap: 12px; }
.upload-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.upload-card label.check { flex-direction: row; align-items: center; gap: 8px; }
.result-box {
  padding: 10px 12px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; white-space: pre-wrap;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.stat h3 { font-size: 12.5px; color: var(--ink-2); font-weight: 560; margin-bottom: 8px; }
.stat .big { font-size: 30px; font-weight: 640; letter-spacing: -.02em; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ drawer */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(760px, 96vw);
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .18s ease; z-index: 50;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(6, 9, 14, .38); z-index: 40; }

.field-grid { display: grid; grid-template-columns: 168px 1fr; gap: 6px 14px; margin: 6px 0 18px; }
.field-grid dt { color: var(--ink-2); font-size: 12.5px; }
.field-grid dd { margin: 0; word-break: break-word; }
.src { font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.src-conflict { color: var(--bad); border-color: var(--bad); }

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2);
  margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.pages { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pages img { height: 210px; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; }
.page-wrap { text-align: center; font-size: 11px; color: var(--ink-2); }
.match-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--panel-2);
}
.match-row.accepted { border-color: var(--ok); }
.ocr {
  max-height: 320px; overflow: auto; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.actions input { flex: 1 1 160px; }
.warnbox {
  background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px;
  font-size: 12.5px; margin-bottom: 14px;
}

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  z-index: 90; box-shadow: var(--shadow); font-size: 13px;
}

/* ------------------------------------------------------------- empty state */
.welcome {
  max-width: 620px; margin: 48px auto; padding: 26px 30px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.welcome h2 { font-size: 17px; margin-bottom: 12px; }
.welcome p { margin: 0 0 11px; color: var(--ink-2); font-size: 13.5px; }
.welcome b { color: var(--ink); font-weight: 600; }
.welcome code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; color: var(--ink);
}
.welcome-links { display: flex; gap: 18px; margin-top: 16px; }
.welcome-links a { color: var(--accent); text-decoration: none; font-weight: 550; }
.welcome-links a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- layout aids */
.spacer { flex: 1 1 auto; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; margin: 14px 0; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid label, .card > label.check {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2);
}
.card > label.check, .form-grid label.check { flex-direction: row; align-items: center; gap: 8px; margin: 4px 0; }
.card h2 { font-size: 15px; margin-bottom: 6px; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg { padding: 7px 13px; border: 0; background: var(--panel-2); color: var(--ink-2); font: inherit; cursor: pointer; }
.seg.active { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
}
.tile:hover { border-color: var(--accent); }
.tile.static { cursor: default; }
.tile.static:hover { border-color: var(--line); }
.tile h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; }
.tile .big { font-size: 30px; font-weight: 660; letter-spacing: -.02em; margin-top: 4px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A formatted money total is far longer than a count and must not wrap the tile. */
.tile .big.money { font-size: clamp(15px, 1.5vw, 21px); }
.tile .note { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.tile .big.ok { color: var(--ok); }
.tile .big.warn { color: var(--warn); }
.tile .big.bad { color: var(--bad); }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); font-weight: 600; margin-bottom: 12px;
}
.bar-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 12.5px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-row .name.clickable { color: var(--ink); cursor: pointer; }
.bar-row .name.clickable:hover { color: var(--accent); text-decoration: underline; }
/* Both must be block-level: height is ignored on an inline element, which once
   made every bar render as an empty track. */
.bar-track {
  display: block; background: var(--panel-2); border-radius: 999px;
  height: 9px; overflow: hidden; border: 1px solid var(--line);
}
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 999px; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.spark { width: 100%; height: 96px; display: block; }
.spark rect { fill: var(--accent); }
.spark .axis { stroke: var(--line); stroke-width: 1; }
/* Axis labels live in HTML, not in the SVG: a non-uniform preserveAspectRatio
   stretches glyphs horizontally and turns dates into unreadable smears. */
.spark-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 4px; }

/* -------------------------------------------------------------- table mode */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.records { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.records th, table.records td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.records th { background: var(--panel-2); color: var(--ink-2); font-weight: 600; position: sticky; top: 0; z-index: 2; }
table.records tbody tr { cursor: pointer; }
table.records tbody tr:hover { background: var(--panel-2); }
table.records td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.records tr.deleted { opacity: .55; }
table.records tr.deleted td:first-child::before { content: "🗑 "; }

/* ------------------------------------------------------------ edit mode */
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; margin: 8px 0 14px; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.edit-grid input, .edit-grid select { font-size: 13px; }
.edit-grid input.dirty, .edit-grid select.dirty { border-color: var(--accent); background: var(--panel); }
.danger { border-color: var(--bad); color: var(--bad); }
.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.deleted-banner { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }

/* ------------------------------------------------------- inline confirmation */
.confirm-panel {
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--panel-2); padding: 12px 14px; margin: 12px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.confirm-panel.danger-panel { border-color: var(--bad); }
.confirm-panel b { font-size: 13.5px; }
.confirm-panel p { margin: 0; }
.confirm-panel input[type="text"], .confirm-panel input:not([type]) { width: 100%; }

/* ------------------------------------------------------------- scan viewer */
.viewer { margin: 8px 0 4px; }
.viewer-stage {
  position: relative; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center;
}
.viewer-stage img { display: block; width: 100%; height: auto; }
.viewer-overlay { position: absolute; inset: 0; pointer-events: none; }
.mark-box {
  position: absolute; border: 2px solid var(--bad); border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset; pointer-events: auto; cursor: pointer;
}
.mark-box.signature { border-color: var(--ok); }
.mark-box.rejected { border-style: dashed; opacity: .45; }
.mark-box .tag {
  position: absolute; top: -19px; left: -2px; font-size: 10.5px; font-weight: 700;
  background: var(--bad); color: #fff; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.mark-box.signature .tag { background: var(--ok); }
.viewer-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12.5px; color: var(--ink-2);
}
.page-strip { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; }
.page-strip img {
  height: 62px; border: 2px solid var(--line); border-radius: 5px; cursor: pointer; opacity: .65;
}
.page-strip img.active { border-color: var(--accent); opacity: 1; }

/* -------------------------------------------------------- compliance panel */
.compliance {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0; background: var(--panel-2);
}
.compliance.ok { border-left-color: var(--ok); }
.compliance.poa_required { border-left-color: var(--bad); }
.compliance.review { border-left-color: var(--warn); }
.compliance.exempt, .compliance.unchecked { border-left-color: var(--ink-2); }
.compliance h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.compliance p { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.compliance .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mark-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.mark-item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 12.5px;
  background: var(--panel);
}
.mark-item.is-rejected { opacity: .5; }
.mark-item .who { color: var(--ink-2); font-size: 11.5px; }


/* ------------------------------------------------------------ batch intake */
.src-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 8px; background: var(--panel-2);
}
.src-row .name { font-weight: 600; }
.src-row .meta { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.src-row .meta span + span::before { content: "·"; margin: 0 7px; opacity: .5; }
.src-progress {
  grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); overflow: hidden; display: block; margin-top: 4px;
}
.src-progress > span { display: block; height: 100%; background: var(--ok); }
.batch-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.batch-controls input[type="number"] { width: 90px; }
.busy-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }


/* ---------------------------------------------------------------- registry */
.tpl {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tpl img.canon { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tpl .canon-empty { width: 96px; height: 96px; display: grid; place-items: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: 8px; }
.tpl .name { font-weight: 600; }
.tpl .slug { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.tpl.proposed { border-left: 4px solid var(--warn); }
.tpl.retired { opacity: .55; }
.impressions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.impressions .imp { position: relative; width: 84px; height: 84px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.impressions .imp img { position: absolute; max-width: none; }
.ident-line { font-size: 12.5px; margin-top: 4px; }
.ident-line .pill { margin-right: 4px; }


/* ---------------------------------------------------------------- requests */
.req-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.req-row:hover { border-color: var(--accent); }
.req-row .t { font-weight: 600; }
.stepper { display: flex; gap: 6px; margin: 16px 0 12px; flex-wrap: wrap; }
.step { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--ink-2); font-size: 13px; cursor: pointer; }
.step.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.done { border-color: var(--ok); color: var(--ok); }
.work-grid { display: grid; grid-template-columns: minmax(280px, 42%) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; } }
.work-scan img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.item.missing { border-left: 4px solid var(--bad); }
.item.found, .item.replaced, .item.uploaded { border-left: 4px solid var(--ok); }
.item.pending { border-left: 4px solid var(--warn); }
.item h4 { margin: 0 0 4px; font-size: 13.5px; }
.cand { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 8px; margin-top: 6px; }
.cand.accepted { border-style: solid; border-color: var(--ok); }
.cand img { width: 44px; height: 58px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.letter { width: 100%; min-height: 380px; font: 13px/1.5 var(--mono); padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink); }
.deadline { font-family: var(--mono); font-size: 12px; }


/* --------------------------------------------------------------- contracts */
.ct-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.ct-row:hover { border-color: var(--accent); }
.route { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.route.legal { background: var(--bad-bg); color: var(--bad); }
.route.director { background: var(--warn-bg); color: var(--warn); }
.route.accounting { background: var(--accent-soft); color: var(--accent); }
.route.ok { background: var(--ok-bg); color: var(--ok); }
.finding { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.finding.critical { border-left-color: var(--bad); }
.finding.major { border-left-color: var(--warn); }
.finding.minor { border-left-color: var(--accent); }
.finding.info { border-left-color: var(--line); }
.finding .law { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.finding .redline { margin-top: 4px; color: var(--ink); background: var(--panel-2); padding: 6px 8px; border-radius: 6px; }
table.protocol td { white-space: normal; vertical-align: top; }

.app-footer { padding: 18px 24px 28px; color: var(--ink-2); font-size: 12px; text-align: center; }
