/* Redline Referee. Plain CSS, no build step. */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e4e7ec;
  --line-strong: #d2d6dd;
  --ink: #15171c;
  --ink-2: #3a414d;
  --muted: #667080;
  --faint: #8e96a4;

  --accent: #3353c8;
  --accent-ink: #2843a8;
  --accent-bg: #eef2fd;
  --accent-line: #c8d4f7;

  --red: #c2311d;
  --red-bg: #fdf2f0;
  --red-line: #f1c8c1;
  --amber: #a65a05;
  --amber-bg: #fdf6e7;
  --amber-line: #edd3a0;
  --green: #19774a;
  --green-bg: #eef8f2;
  --green-line: #bde0cd;
  --grey: #5c6472;
  --grey-bg: #f1f2f5;
  --grey-line: #d9dde3;

  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --serif: Georgia, "Times New Roman", Times, serif;
  --status: var(--grey);
  --status-bg: var(--grey-bg);
  --status-line: var(--grey-line);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 13px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.muted { color: var(--muted); }

[data-status="ready"] { --status: var(--green); --status-bg: var(--green-bg); --status-line: var(--green-line); }
[data-status="changes"] { --status: var(--amber); --status-bg: var(--amber-bg); --status-line: var(--amber-line); }
[data-status="blocked"] { --status: var(--red); --status-bg: var(--red-bg); --status-line: var(--red-line); }
[data-status="incomplete"], [data-status="loading"], [data-status="error"] { --status: var(--grey); --status-bg: var(--grey-bg); --status-line: var(--grey-line); }

/* Tones shared by tags, chips, dots, marks */
.t-red { --t: var(--red); --t-bg: var(--red-bg); --t-line: var(--red-line); }
.t-amber { --t: var(--amber); --t-bg: var(--amber-bg); --t-line: var(--amber-line); }
.t-green { --t: var(--green); --t-bg: var(--green-bg); --t-line: var(--green-line); }
.t-grey { --t: var(--grey); --t-bg: var(--grey-bg); --t-line: var(--grey-line); }
.t-accent { --t: var(--accent-ink); --t-bg: var(--accent-bg); --t-line: var(--accent-line); }
.t-ink { --t: var(--ink); --t-bg: #eceef2; --t-line: #c9cdd6; }

/* ------------------------------------------------------------ app shell */
.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app > * { flex: none; }

.ico { display: inline-flex; flex: none; width: 14px; height: 14px; }
.ico svg { width: 100%; height: 100%; display: block; }

/* --------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 16px 0 18px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.brand-mark {
  flex: none; width: 22px; height: 22px; border-radius: 5px; background: var(--ink);
  display: grid; align-content: center; gap: 3px; padding: 0 5px;
}
.brand-mark i { display: block; height: 2px; border-radius: 1px; background: #fff; }
.brand-mark i:nth-child(2) { background: #e9523a; margin: 0 -2px; }
.brand-mark i:nth-child(3) { width: 60%; }
.brand-name { font-weight: 650; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-tag {
  color: var(--muted); padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toplinks { display: flex; align-items: center; gap: 2px; margin-right: auto; flex: none; }
.toplinks a, .toplinks button {
  display: inline-flex; align-items: center; height: 28px; padding: 0 8px; border: 0; border-radius: 5px; background: none;
  color: var(--ink-2); font-weight: 550; white-space: nowrap; text-decoration: none;
}
.toplinks a:hover, .toplinks button:hover { background: var(--grey-bg); color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }
.clocked-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; flex: none;
  border: 1px solid var(--accent-line); border-radius: 12px; background: var(--accent-bg); color: var(--accent-ink);
  font-size: 12px; white-space: nowrap;
}
.clocked-pill b { font-weight: 700; }
.clocked-pill .sep { margin: 0 6px 0 2px; opacity: 0.6; font-style: normal; }
.clocked-pill:hover { border-color: var(--accent); }
.cta { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.cta .btn { text-decoration: none; }
.cta .btn .ico { width: 12px; height: 12px; }
.cta-link { font-size: 12.5px; font-weight: 550; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font-weight: 550; white-space: nowrap;
}
.btn:hover { background: #f7f8fa; border-color: #c3c8d1; }
.btn--sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #2a2e37; border-color: #2a2e37; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--grey-bg); border-color: var(--line); color: var(--faint); cursor: not-allowed;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--grey-bg); }
.icon-btn:disabled { color: var(--line-strong); cursor: default; background: transparent; }

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot[data-status="ready"] { background: var(--green); }
.dot[data-status="changes"] { background: #d38a17; }
.dot[data-status="blocked"] { background: var(--red); }
.dot[data-status="incomplete"] { background: var(--faint); }

.switcher { position: relative; min-width: 0; }
.switcher-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px;
  min-width: 170px; max-width: 300px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel);
  font-weight: 550;
}
.switcher-btn:hover { background: #f7f8fa; }
.switcher-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-btn .ico { color: var(--muted); }
.switcher-menu {
  position: absolute; z-index: 40; top: 34px; right: 0; width: 380px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(21, 23, 28, 0.12), 0 2px 6px rgba(21, 23, 28, 0.06);
  max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
}
.switcher-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: 0.02em; }
.switcher-item {
  display: grid; grid-template-columns: 8px 1fr; column-gap: 10px; align-items: baseline;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; text-align: left;
}
.switcher-item:hover, .switcher-item:focus-visible { background: var(--grey-bg); }
.switcher-item[aria-selected="true"] { background: var(--accent-bg); }
.switcher-item .dot { transform: translateY(-1px); }
.switcher-item b { font-weight: 600; display: block; }
.switcher-item small { grid-column: 2; display: block; font-size: 12px; line-height: 1.35; color: var(--muted); margin-top: 1px; }
.switcher-item.no-dot { grid-template-columns: minmax(0, 1fr); }
.switcher-item.no-dot small { grid-column: 1; }

.mode-badge .short { display: none; }
.mode-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; flex: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--grey-bg);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
.mode-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.mode-badge[data-mode="live"] { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.mode-badge[data-mode="live"]::before { background: var(--green); }
.mode-badge[data-mode="replay"]::before { background: var(--accent); }
.mode-badge[data-mode="rules-only"] { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.mode-badge[data-mode="rules-only"]::before { background: #d38a17; }

.upload-wrap { position: relative; display: inline-flex; flex: none; }

/* --------------------------------------------------------------- start here */
.intro {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 10px 7px 22px;
  background: var(--accent-bg); border-bottom: 1px solid var(--accent-line);
}
.intro-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-ink); white-space: nowrap; }
.intro-text { margin-right: auto; color: var(--ink); font-weight: 550; }
.intro-links { display: flex; flex-wrap: wrap; gap: 6px; }
.intro-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 11px;
  border: 1px solid var(--accent-line); border-radius: 13px; background: var(--panel); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.intro-btn .ico { width: 12px; height: 12px; }
.intro-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.intro-close { color: var(--accent-ink); }

/* ------------------------------------------------------------ verdict band */
.verdict {
  display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) auto;
  column-gap: 36px; align-items: center;
  padding: 14px 20px 14px 22px; min-height: 88px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--status);
}
.verdict-main { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; align-items: center; min-width: 0; }
.verdict-glyph {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--status); color: #fff;
}
.verdict-glyph .ico { width: 16px; height: 16px; }
.verdict-headline { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; color: var(--status); }
.verdict-case { grid-column: 2; margin-top: 3px; font-size: 12.5px; color: var(--muted); max-width: 420px; }
.verdict-case b { color: var(--ink-2); font-weight: 600; }

.verdict-mid { display: grid; row-gap: 7px; min-width: 0; align-content: center; }
.reasons { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; row-gap: 2px; min-width: 0; }
.reason {
  display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: baseline;
  padding: 2px 6px 2px 0; border: 0; border-radius: 5px; background: none; color: var(--ink-2); text-align: left; min-width: 0;
}
@supports not (grid-template-columns: subgrid) { .reason { grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; } }
.reason.is-link { cursor: pointer; }
.reason.is-link:hover { background: var(--grey-bg); color: var(--ink); }
.reason .tag { justify-self: start; }
.reason-text { min-width: 0; }
.nowrap { white-space: nowrap; }
.reason-text .ico { width: 12px; height: 12px; margin-left: 5px; vertical-align: -2px; color: var(--faint); }
.reason.is-link:hover .reason-text .ico { color: var(--accent); }
.reasons-legend { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  border: 1px solid var(--t-line, var(--line)); border-radius: 4px; background: var(--t-bg, var(--grey-bg));
  color: var(--t, var(--ink-2)); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.reasons .tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--t); }

.signoff { display: grid; justify-items: end; row-gap: 7px; width: 264px; }
.progress { display: grid; row-gap: 5px; width: 100%; justify-items: end; }
.progress-text { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.progress-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--grey-bg); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; transition: width 0.2s; }
.signoff-actions { display: flex; gap: 8px; }
.signoff .btn { height: 32px; padding: 0 14px; }
.signoff-why { font-size: 11.5px; line-height: 1.4; color: var(--muted); text-align: right; }
.signoff-done { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.signoff-done .ico { color: var(--green); }
.signoff-done b { font-weight: 650; color: var(--ink); margin-right: -2px; }
.signoff-done .link-btn { margin-left: 6px; }

/* ---------------------------------------------------------------- errors */
.errors {
  display: grid; grid-template-columns: 16px 1fr; column-gap: 10px; align-items: start;
  padding: 10px 20px 10px 22px; background: #eceef2; border-bottom: 1px solid var(--line-strong);
  box-shadow: inset 4px 0 0 var(--grey); color: var(--ink);
}
.errors .ico { width: 16px; height: 16px; margin-top: 1px; color: var(--grey); }
.errors h3 { font-size: 13px; font-weight: 650; }
.errors ul { margin-top: 4px; display: grid; row-gap: 2px; max-height: 84px; overflow: auto; }
.errors li { color: var(--ink-2); }
.errors li b { font-weight: 600; color: var(--ink); }
.errors li code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* -------------------------------------------------------------- warnings */
.warns {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 9px; align-items: start;
  padding: 5px 10px 5px 22px; background: var(--amber-bg); border-bottom: 1px solid var(--amber-line);
  box-shadow: inset 4px 0 0 #d38a17; color: var(--ink-2); font-size: 12.5px;
}
.warns > .ico { margin-top: 3px; color: var(--amber); }
.warns ul { display: grid; row-gap: 1px; align-self: center; }
.warns li b { font-weight: 650; color: var(--amber); }
.warns .icon-btn { width: 22px; height: 22px; color: var(--amber); }

/* ------------------------------------------------------------------ main */
.main {
  display: grid; flex: 1 1 0; min-height: 240px;
  grid-template-columns: clamp(288px, 23vw, 340px) minmax(0, 1fr) clamp(324px, 26vw, 380px);
}
.left, .right { background: var(--panel); min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.center { min-height: 0; min-width: 0; display: flex; flex-direction: column; }

.tabs { display: flex; gap: 2px; padding: 0 8px; height: 40px; flex: none; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 8px;
  border: 0; background: transparent; color: var(--muted); font-weight: 550; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--ink); }
.count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--grey-bg); color: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count.t-red, .count.t-amber { background: var(--t-bg); color: var(--t); }
.left-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* --------------------------------------------------------- changes list */
.group + .group { border-top: 1px solid var(--line); }
.group-head {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 14px 0 12px;
  border: 0; background: transparent; text-align: left;
  font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.01em;
}
.group-head .ico { width: 12px; height: 12px; color: var(--faint); transition: transform 0.12s; }
.group[data-open="false"] .group-head .ico { transform: rotate(-90deg); }
.group-head .n { margin-left: auto; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.group-head:hover { background: #fafbfc; }
.group[data-open="false"] .group-rows { display: none; }
.group-rows { padding: 0 6px 6px; display: grid; row-gap: 2px; }

.row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 9px;
  width: 100%; padding: 8px 8px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left;
}
.row:hover { background: #f6f7f9; }
.row[aria-current="true"] { background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); }
.pin-n {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
  background: var(--m, var(--grey)); color: #fff; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.row-main { display: block; min-width: 0; }
.row-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.row-clause { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 550; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-top .chip { margin-left: auto; flex: none; align-self: center; }
.row-summary { display: block; margin-top: 1px; color: var(--ink-2); overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.row-meta .state { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); }
.state.is-done { color: var(--t); font-weight: 600; }
.state.is-done::before { border-color: var(--t); background: var(--t); }

.badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 550; white-space: nowrap;
}
.badge.is-compare { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent-ink); font-weight: 650; }
.badge.is-both { color: var(--ink-2); }
.badge.is-clocked { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent-ink); font-weight: 650; }
.badge.is-clash { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); font-weight: 650; cursor: help; }
.readers { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.reader {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 550; white-space: nowrap;
}
.reader.is-clocked { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent-ink); font-weight: 650; }
.badge.is-promoted { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); font-weight: 650; cursor: help; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px;
  border: 1px solid var(--t-line, var(--line)); background: var(--t-bg, var(--grey-bg)); color: var(--t, var(--ink-2));
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.chip .ico { width: 11px; height: 11px; }

.empty { padding: 28px 20px; color: var(--muted); text-align: center; }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

.unplaced { margin: 0 6px 6px; border: 1px solid var(--line); border-radius: 6px; }
.unplaced summary { padding: 7px 9px; cursor: pointer; font-weight: 550; }
.unplaced > div { padding: 0 9px 9px; display: grid; row-gap: 6px; }

/* ----------------------------------------------------------- cover note */
.pane { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
.pane > div, .claims { grid-template-columns: minmax(0, 1fr); }
.pane-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pane-line { font-size: 12px; color: var(--muted); }
.pane-line b { color: var(--ink-2); font-weight: 600; }
.letter {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fbfbfc;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ink-2);
}
.claim-span {
  background: var(--t-bg); color: var(--ink); border-radius: 2px; padding: 1px 0;
  box-shadow: inset 0 -2px 0 var(--t); cursor: pointer;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.claim-span.is-active { background: var(--t); color: #fff; }
.claim.is-ai { background: var(--red-bg); border-color: var(--red-line); }
button.callout--link { width: 100%; text-align: left; cursor: pointer; font: inherit; }
button.callout--link:hover { border-color: var(--t); }
.claim-span.v-not_stated, .claim-span.v-not_checked { box-shadow: inset 0 -1px 0 var(--faint); }
.section-title { font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.01em; }
.claims { display: grid; row-gap: 8px; }
.claim {
  display: grid; row-gap: 6px; width: 100%; padding: 10px 11px; text-align: left;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
  box-shadow: inset 3px 0 0 var(--t);
}
.claim:hover { border-color: var(--line-strong); }
.claim.is-active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--t), 0 0 0 1px var(--accent); }
.claim-head { display: flex; align-items: center; gap: 8px; }
.claim-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--grey-bg); color: var(--muted); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.claim-head .p { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.claim-head .link { margin-left: auto; font-size: 11.5px; color: var(--accent-ink); font-weight: 550; white-space: nowrap; }
.claim-text { font-weight: 550; overflow-wrap: anywhere; }
.evidence { font-size: 12px; color: var(--muted); }
.evidence q { quotes: none; display: block; margin-top: 3px; padding-left: 8px; border-left: 2px solid var(--line-strong); color: var(--ink-2); overflow-wrap: anywhere; }
.warn-line { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--amber); }
.warn-line .ico { margin-top: 1px; }

/* ------------------------------------------------------------ key terms */
.terms { width: 100%; border-collapse: collapse; table-layout: fixed; }
.terms th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; padding: 9px 8px 7px;
  font-size: 11.5px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line);
}
.terms th:first-child, .terms td:first-child { padding-left: 14px; width: 37%; }
.terms td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.terms tr.is-changed td { background: var(--amber-bg); }
.terms tr.is-changed td:first-child { box-shadow: inset 3px 0 0 #d38a17; }
.terms tr.is-changed .term-val { font-weight: 650; color: var(--ink); }
.terms tbody tr.can-locate { cursor: pointer; }
.terms tbody tr.can-locate:hover td { background: #f6f7f9; }
.terms tbody tr.is-changed.can-locate:hover td { background: #fbefd3; }
.term-label { font-weight: 550; }
.term-val { color: var(--ink-2); }
.term-none { color: var(--faint); }
.term-sub { display: block; margin-top: 1px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.term-sub.is-low { color: var(--amber); font-weight: 600; }
.term-flag { display: block; margin-top: 2px; font-size: 11px; font-weight: 650; color: var(--amber); }

/* ------------------------------------------------------------ documents */
.doc-toolbar {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  min-height: 40px; padding: 5px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
}
/* The layer name gives way first, so the zoom controls are never covered. */
.doc-toolbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; }
.layer-switch { display: flex; flex: 0 1 auto; min-width: 0; }
.layer-switch .switcher-btn { flex: 0 1 auto; height: 28px; min-width: 0; max-width: 260px; width: auto; gap: 6px; padding: 0 6px 0 9px; font-size: 12px; }
.layer-switch .switcher-label { flex: 0 1 auto; min-width: 0; }
.layer-prefix { flex: none; }
.layer-switch .switcher-menu { left: 0; right: auto; top: 32px; width: 320px; }
.layer-prefix { color: var(--muted); font-weight: 500; }
.seg { display: inline-flex; flex: none; padding: 2px; border-radius: 6px; background: var(--grey-bg); }
.seg button { height: 24px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(21, 23, 28, 0.06); }
.zoom { display: inline-flex; flex: none; align-items: center; gap: 2px; }
.zoom-val { min-width: 44px; text-align: center; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.zoom .btn { margin-left: 6px; }

/* The wrong file came back: one plain statement above the two first pages. */
.gate-card {
  flex: none; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; align-items: start;
  margin: 12px 12px 0; padding: 14px 16px; border: 1px solid var(--red-line); border-radius: 8px; background: var(--red-bg);
}
.gate-card > .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--red); }
.gate-card h3 { font-size: 15px; font-weight: 650; color: var(--red); }
.gate-card p { margin-top: 3px; color: var(--ink); max-width: 76ch; }
.gate-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.gate-facts li { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--red-line); border-radius: 12px; background: var(--panel); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.gate-facts b { font-weight: 650; color: var(--ink); }
.stop-note { display: grid; row-gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfbfc; color: var(--ink-2); }
.stop-note b { color: var(--ink); font-weight: 650; }
.stop-steps ol { margin-top: 8px; display: grid; row-gap: 8px; counter-reset: step; }
.stop-steps li { position: relative; padding-left: 28px; color: var(--ink-2); counter-increment: step; }
.stop-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--grey-bg); color: var(--ink-2); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.stop-steps li b { color: var(--ink); font-weight: 600; }
.docs { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-auto-flow: column; }
.docs[data-view="v1"], .docs[data-view="v2"] { grid-template-columns: minmax(0, 1fr); }
.docs[data-view="v1"] .doc[data-side="v2"], .docs[data-view="v2"] .doc[data-side="v1"] { display: none; }
.doc { display: contents; }
/* A firm line between the two documents, so at high zoom the pages do not run into each other. */
.docs[data-view="both"]::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background: var(--line-strong); z-index: 8; pointer-events: none; }
.doc-head {
  display: grid; row-gap: 5px; padding: 9px 12px 9px; align-content: start; min-width: 0;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.doc-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-weight: 650; }
.doc-name small { font-weight: 500; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.doc-meta a { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.doc-meta .ico { width: 12px; height: 12px; }
.doc-caption { color: var(--ink-2); min-width: 0; }
.doc-scroll { min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; background: #e9ebef; }
.doc-scroll:focus, .detail-scroll:focus, .drawer-body:focus { outline: none; }
.doc-scroll:focus-visible, .detail-scroll:focus-visible, .drawer-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.doc-pages { width: calc(var(--zoom, 1) * 100%); padding: 8px 8px 14px; display: grid; row-gap: 10px; }
.page-wrap { display: grid; row-gap: 4px; }
.page-label { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 1px; }
.page {
  position: relative; width: 100%; background: #fff; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(21, 23, 28, 0.1), 0 1px 3px rgba(21, 23, 28, 0.08);
}
.page img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.page-layer { position: absolute; inset: 0; }
/* Until the page image has arrived the box stays reserved and empty: no overlays floating on a blank sheet. */
.page:not(.is-loaded) .page-layer { visibility: hidden; }
.page:not(.is-loaded)::after, .page.is-missing::after {
  content: "Loading page"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; pointer-events: none;
}
.page.is-missing::after { content: "Page image not available"; }
.doc-empty { margin: 24px; padding: 24px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 6px; }

.c-substantive { --m: #d9480f; --fill: 28%; }
.c-reworded { --m: var(--accent); --fill: 17%; }
.c-administrative { --m: #5c6472; --fill: 17%; }
.c-spelling, .c-formatting, .c-other { --m: #99a1ae; --fill: 20%; }
.c-guard { --m: var(--red); --fill: 24%; }

/* Every change part gets a soft tinted fill, like a highlighter, plus a hairline in the class colour.
   The box is exactly as tall as the line of text: nothing is drawn over the lines above or below. */
.mark {
  position: absolute; margin: 0 -2px; padding: 0; box-sizing: content-box; border: solid transparent; border-width: 0 2px; min-height: 3px;
  border-radius: 2px; cursor: pointer; z-index: 1; mix-blend-mode: multiply;
  background: color-mix(in srgb, var(--m) var(--fill, 18%), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--m) 55%, transparent);
}
.mark:hover { background: color-mix(in srgb, var(--m) calc(var(--fill, 18%) + 10%), transparent); }
.mark.c-substantive, .mark.c-guard { z-index: 2; }
.mark.c-spelling, .mark.c-formatting, .mark.c-other { z-index: 0; }
.mark.is-selected { box-shadow: inset 0 0 0 1.5px var(--m); background: color-mix(in srgb, var(--m) calc(var(--fill, 18%) + 14%), transparent); z-index: 3; }
.mark.m-sentence { margin: 0 -3px; border: 0; z-index: 0; pointer-events: none; box-shadow: none; background: color-mix(in srgb, var(--m) 7%, transparent); }
.mark.m-spot { --m: var(--accent); z-index: 4; pointer-events: none; background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 2px var(--m); }
@keyframes mark-pulse {
  0% { outline: 2px solid var(--m); outline-offset: 0; }
  100% { outline: 2px solid transparent; outline-offset: 12px; }
}
.mark.is-pulse { animation: mark-pulse 0.75s ease-out 2; }
@media (prefers-reduced-motion: reduce) { .mark.is-pulse { animation: none; } }
/* Layer views show Clocked's own marked copy: our overlays stay in place for scrolling but are not drawn. */
.docs:not([data-layer="changes"]) .mark, .docs:not([data-layer="changes"]) .pin, .docs:not([data-layer="changes"]) .page-flag { visibility: hidden; pointer-events: none; }

.pin {
  position: absolute; z-index: 5; width: 14px; height: 14px; padding: 0; border: 1.5px solid #fff; border-radius: 50%;
  transform: translate(-70%, -70%);
  display: grid; place-items: center; background: var(--m); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; box-sizing: content-box; cursor: pointer;
}
.pin.is-selected { z-index: 6; box-shadow: 0 0 0 2px var(--m); }
.page-flag {
  position: absolute; z-index: 5; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border: 0; border-radius: 4px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 650;
}
.page-flag .ico { width: 12px; height: 12px; }

.legend {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 30px; padding: 5px 12px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted);
}
.legend:empty { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend span.legend-note { display: inline; white-space: normal; line-height: 1.45; color: var(--ink-2); }
.legend i { width: 16px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--m) calc(var(--fill, 18%) + 6%), transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m) 70%, transparent); }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-ink); font-size: 11.5px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
kbd {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 3px; background: var(--panel); font: 600 10.5px/1 var(--font); color: var(--muted);
}

/* --------------------------------------------------------------- detail */
.detail-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.readings { display: flex; flex-wrap: wrap; gap: 5px; }
/* Three readings of one change, side by side: the rule layer, Verify, Compare. */
.readings3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.reading { display: grid; row-gap: 1px; align-content: start; padding: 7px 9px 8px; border: 0; background: var(--panel); text-align: left; min-width: 0; }
.reading + .reading { border-left: 1px solid var(--line); }
.reading.is-link { cursor: pointer; }
.reading.is-link:hover { background: #fafbfc; }
.reading-who { font-size: 11px; font-weight: 650; color: var(--muted); letter-spacing: 0.01em; }
.reading-who.is-clocked { color: var(--accent-ink); }
.reading b { font-weight: 650; color: var(--t, var(--ink)); line-height: 1.3; overflow-wrap: anywhere; }
.reading.t-grey b { color: var(--ink-2); font-weight: 550; }
.reading small { font-size: 11px; color: var(--muted); }
.readers-clash { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--amber-line); border-radius: 6px; background: var(--amber-bg); color: var(--amber); font-weight: 650; }
.readers-clash .ico { flex: none; }
.quote-absent { color: var(--muted); font-style: italic; padding-top: 1px; }
.pair-side.is-absent { background: #fafbfc; }
.renum { display: grid; row-gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.renum b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.part-note { font-size: 12px; color: var(--muted); }
.part-title .link-btn { font-size: inherit; }
.rchip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  border: 1px solid var(--t-line, var(--line)); background: var(--t-bg, var(--grey-bg)); color: var(--ink-2); font-size: 11.5px; white-space: nowrap;
}
.rchip b { font-weight: 650; color: var(--t, var(--ink)); }
.rchip:hover { border-color: var(--t, var(--line-strong)); }
.crops { display: grid; row-gap: 8px; }
.crop { display: grid; row-gap: 3px; min-width: 0; }
.crop figcaption { font-size: 11.5px; color: var(--muted); }
.crop figcaption b { font-weight: 600; color: var(--ink-2); }
.crop-view { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; scrollbar-width: thin; }
.crop-view:hover { border-color: var(--accent); }
.crop-img { position: relative; min-width: 100%; background-color: #fff; background-repeat: no-repeat; }
.crop-mark { position: absolute; border-radius: 3px; mix-blend-mode: multiply; background: color-mix(in srgb, var(--m) var(--fill, 18%), transparent); box-shadow: 0 0 0 1.5px var(--m); }
.note-neutral { padding: 8px 10px; border-radius: 6px; background: var(--grey-bg); color: var(--ink-2); font-size: 12.5px; }
.note-neutral .link-btn, .kv .link-btn { font-size: inherit; }
.detail-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.detail-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 550; }
.detail-kicker .nav { margin-left: auto; display: inline-flex; gap: 4px; }
.detail-kicker .nav .icon-btn { width: auto; padding: 0 5px 0 3px; gap: 3px; display: inline-flex; align-items: center; border-color: var(--line); }
.detail-kicker .nav .icon-btn:disabled kbd { opacity: 0.45; }
.detail-title { margin-top: 6px; font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.detail-summary { margin-top: 3px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.detail-badges { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }

.block { padding: 13px 16px 14px; border-bottom: 1px solid var(--line); display: grid; row-gap: 9px; }
.block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.block-head h3 { font-size: 12.5px; font-weight: 650; }
.block-head .via { font-size: 11px; font-weight: 600; color: var(--faint); padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; }
.block-head .chip, .block-head .right-note { margin-left: auto; }
.right-note { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.not-run { color: var(--muted); font-size: 12.5px; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 6px; background: #fbfbfc; }

.pair { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pair + .pair { margin-top: -1px; }
.pair-side { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; padding: 8px 10px; }
.pair-side + .pair-side { border-top: 1px solid var(--line); }
.pair-side[data-side="v2"] { background: #fcfaf5; }
.pair-label { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.pair-label button { display: block; margin-top: 1px; padding: 0; border: 0; background: none; color: var(--accent-ink); font-size: 11px; font-weight: 550; }
.pair-label button:hover { text-decoration: underline; }
.pair-label small { display: block; font-size: 11px; font-weight: 500; color: var(--faint); }
.quote { font-family: var(--serif); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.quote mark, mark.chg { background: #ffe9b8; color: var(--ink); font-weight: 700; border-radius: 2px; padding: 0 1px; box-shadow: inset 0 -1.5px 0 #d38a17; }
.pair-side[data-side="v1"] .quote mark { background: #eceef2; box-shadow: inset 0 -1.5px 0 var(--faint); }
.quote--clamp { max-height: 168px; overflow: auto; overscroll-behavior: contain; }
.vrows { display: grid; row-gap: 9px; }
.vrow { display: grid; row-gap: 4px; }
.vrow-label { font-size: 12px; color: var(--muted); }
.vrow-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.vrow-p { font-size: 11.5px; color: var(--muted); }
.part-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 4px 0 -3px; }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; row-gap: 5px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { color: var(--ink); font-weight: 550; }
.kv dd small { font-weight: 500; color: var(--muted); font-size: 12px; }
.plain { color: var(--ink-2); }
.passage { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; display: grid; row-gap: 4px; }
.passage-head { display: flex; align-items: baseline; gap: 8px; }
.passage-head b { font-weight: 600; }
.passage-head span { margin-left: auto; flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.passage p { color: var(--ink-2); }
.passage.is-skipped { background: #fbfbfc; }
.passage.is-skipped p, .passage.is-skipped b { color: var(--muted); }
details.fold summary { cursor: pointer; font-size: 12px; font-weight: 550; color: var(--ink-2); padding: 2px 0; }
details.fold[open] summary { margin-bottom: 7px; }
details.fold > div { display: grid; row-gap: 7px; }
.callout { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--t-line); background: var(--t-bg); color: var(--t); font-weight: 550; display: flex; gap: 7px; align-items: flex-start; }
.callout .ico { margin-top: 2px; }
.callout span { color: var(--ink); font-weight: 500; }
.callout b { color: var(--t); font-weight: 650; }
.final-route { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 9px 10px; border-radius: 6px; background: var(--grey-bg); }
.final-route dt { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-top: 2px; }
.final-route p { margin-top: 4px; color: var(--ink-2); font-size: 12.5px; }
.linked { display: grid; row-gap: 6px; }
.linked button { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 8px; align-items: baseline; width: 100%; padding: 7px 9px; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.linked button:hover { border-color: var(--line-strong); background: #fafbfc; }

.detail-actions { flex: none; padding: 11px 16px 12px; border-top: 1px solid var(--line-strong); background: var(--panel); display: grid; row-gap: 8px; }
.actions-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--muted); }
.actions-head b { color: var(--ink); font-weight: 650; font-size: 12.5px; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); font-weight: 600;
}
.action:hover { background: #f7f8fa; }
.action kbd { margin-left: 2px; }
.action.is-suggested { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent-ink); }
.action.is-suggested::after {
  content: "Suggested"; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 0 5px; height: 14px; line-height: 14px;
  background: var(--panel); color: var(--accent-ink); font-size: 10px; font-weight: 650; letter-spacing: 0.02em; border-radius: 3px;
}
.action.is-applied { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.action.is-applied kbd { display: none; }
.action.is-applied.is-suggested::after { color: var(--ink); }
.actions-note { font-size: 11.5px; color: var(--muted); min-height: 16px; }
.actions-plain { display: grid; row-gap: 2px; }
.actions-plain b { font-weight: 650; font-size: 12.5px; }
.actions-plain span { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------- drawer */
/* A bar at the bottom. Open, it is a panel over the workspace rather than a strip that squeezes it. */
.drawer { position: relative; z-index: 30; flex: none; height: 37px; min-width: 0; }
.drawer-panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line-strong); }
.drawer[data-open="true"] .drawer-panel { height: min(64vh, 660px); box-shadow: 0 -14px 36px rgba(21, 23, 28, 0.16); }
.drawer-close { margin-left: 4px; }
.drawer-bar { flex: none; display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 16px 0 10px; }
.drawer-toggle { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; font-weight: 650; }
.drawer-toggle:hover { background: var(--grey-bg); }
.drawer-toggle .ico { color: var(--muted); transition: transform 0.12s; transform: rotate(180deg); }
.drawer[data-open="true"] .drawer-toggle .ico { transform: none; }
.drawer-tabs { display: none; gap: 2px; }
.drawer[data-open="true"] .drawer-tabs { display: inline-flex; }
.drawer-sum { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.drawer-sum b { color: var(--ink); font-weight: 650; }
.drawer-sum .ep { display: inline-flex; gap: 5px; }
.drawer-sum .ep.is-off { color: var(--faint); }
.drawer-note { padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.drawer-note b { font-weight: 650; color: var(--ink); margin-right: 10px; }
.drawer-method { padding: 10px 18px 14px; color: var(--ink-2); font-size: 12.5px; }
.drawer-method b { font-weight: 650; color: var(--ink); }
.drawer-method ul { margin-top: 4px; display: grid; row-gap: 2px; }
.drawer-method li { position: relative; padding-left: 12px; }
.drawer-method li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.ep-detail { display: block; margin-top: 2px; color: var(--ink-2); }
.ep-more { margin-top: 4px; }
.ep-more summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.ep-more summary:hover { color: var(--ink-2); }
.ep-more .ep-effect { margin-top: 3px; }
.ep-detail .link-btn { font-size: inherit; }
.share { font-size: 11px; color: var(--faint); font-weight: 500; }
.drawer-body { display: none; flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid var(--line); overscroll-behavior: contain; }
.drawer[data-open="true"] .drawer-body { display: block; }

.grid { width: 100%; border-collapse: collapse; }
.grid th {
  position: sticky; top: 0; z-index: 1; background: #fafbfc; text-align: left; padding: 8px 12px; white-space: nowrap;
  font-size: 11.5px; font-weight: 650; color: var(--muted); box-shadow: inset 0 -1px 0 var(--line);
}
.grid td { padding: 8px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.grid th:first-child, .grid td:first-child { padding-left: 18px; }
.grid .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid tfoot td { font-weight: 650; border-bottom: 0; background: #fafbfc; position: sticky; bottom: 0; box-shadow: inset 0 1px 0 var(--line); }
.grid tr.is-off td { color: var(--faint); }
.ep-name { font-weight: 650; display: block; }
.ep-path { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ep-result { font-weight: 600; color: var(--ink); display: block; }
.ep-effect { color: var(--muted); display: block; margin-top: 2px; }
.ep-without { color: var(--ink-2); }
.ep-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ep-links button { height: 20px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); font-size: 11.5px; font-weight: 550; color: var(--accent-ink); }
.ep-links button:hover { background: var(--accent-bg); border-color: var(--accent-line); }
.grid--audit td { padding-top: 6px; padding-bottom: 6px; white-space: nowrap; }
.grid--audit .idem { color: var(--faint); }
.src { display: inline-flex; align-items: center; gap: 5px; }
.src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.src.is-live::before { background: var(--green); }

/* ---------------------------------------------------------------- modal */
.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel); color: var(--ink); box-shadow: 0 24px 64px rgba(21, 23, 28, 0.22);
}
.modal[open] { display: flex; flex-direction: column; }
.modal > form { display: flex; flex-direction: column; min-height: 0; }
.modal--wide { width: min(680px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(21, 23, 28, 0.36); }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; font-weight: 650; }
.modal-body { padding: 16px 18px; display: grid; row-gap: 14px; overflow: auto; min-height: 0; }
.modal-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 10px 10px; }
.modal-foot .busy { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.field { display: grid; row-gap: 5px; }
.field-label { font-weight: 600; }
.field-label em { font-style: normal; font-weight: 500; color: var(--faint); margin-left: 6px; font-size: 12px; }
.field input[type="file"] { padding: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fbfbfc; width: 100%; }
.field textarea { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; resize: vertical; min-height: 96px; line-height: 1.5; width: 100%; }
.field textarea:focus-visible, .field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.modal-note { font-size: 12px; color: var(--muted); }
.form-error { padding: 9px 11px; border: 1px solid var(--red-line); border-radius: 6px; background: var(--red-bg); color: var(--red); font-weight: 550; overflow-wrap: anywhere; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.reply-banner { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 6px; border: 1px solid var(--t-line); background: var(--t-bg); color: var(--t); font-size: 14px; font-weight: 650; }
.reply-banner .ico { width: 16px; height: 16px; }
.reply-banner > span { display: grid; row-gap: 1px; }
.reply-banner small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.sum-part { border: 1px solid var(--line-strong); border-radius: 8px; }
.sum-part.is-internal { border-style: dashed; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.sum-head h3 { font-size: 13.5px; font-weight: 650; }
.sum-head p { font-size: 12px; color: var(--muted); }
.sum-part.is-internal .sum-head { background: var(--amber-bg); }
.sum-body { display: grid; row-gap: 10px; padding: 12px; }
.sum-body .reply-sub { margin-bottom: 3px; }
.btn.is-done { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.reply-lines { display: grid; row-gap: 8px; color: var(--ink); }
.reply-lines b { font-weight: 650; }
.vmark { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border: 1px solid var(--t-line); border-radius: 9px; background: var(--t-bg); color: var(--t); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.reply-foot { font-size: 12px; color: var(--muted); }
.reply-wait { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.reply-suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-bg); color: var(--ink-2); font-size: 12.5px; }
.reply-list { display: grid; row-gap: 10px; }
.reply-item { display: grid; row-gap: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.reply-item-head { display: flex; align-items: baseline; gap: 8px; }
.reply-item-head b { font-weight: 650; }
.reply-item-sum { color: var(--ink-2); overflow-wrap: anywhere; }
.reply-item-head .chip { margin-left: auto; flex: none; align-self: center; }
.reply-item blockquote { padding-left: 9px; border-left: 2px solid var(--line-strong); color: var(--ink-2); }
.reply-item blockquote b { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.reply-sub { font-size: 12px; color: var(--muted); }
.reply-plain { display: grid; row-gap: 3px; color: var(--ink-2); }
.reply-plain li { padding-left: 12px; position: relative; }
.reply-plain li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

/* ------------------------------------------------------------- loading */
.splash { grid-column: 1 / -1; display: grid; place-content: center; justify-items: center; row-gap: 6px; padding: 40px; color: var(--muted); text-align: center; }
.splash b { color: var(--ink); font-size: 15px; font-weight: 650; }
.splash code { font-family: var(--mono); font-size: 12px; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1699px) {
  .mode-badge .long { display: none; }
  .mode-badge .short { display: inline; }
}
@media (max-width: 1599px) {
  .intro { gap: 6px 10px; padding-left: 18px; }
  .intro-kicker { display: none; }
  .intro-text { font-size: 12.5px; }
  .intro-btn { padding: 0 7px 0 9px; font-size: 12px; }
}
@media (max-width: 1440px) {
  .brand-tag { display: none; }
}
@media (max-width: 1340px) {
  #zoom-fit { display: none; }
  .layer-switch .switcher-btn { max-width: 220px; }
  .left .tabs { padding: 0 6px; gap: 0; }
  .left .tab { padding: 0 6px; }
  .verdict { grid-template-columns: minmax(200px, 0.55fr) minmax(0, 1.45fr) auto; column-gap: 24px; padding-top: 12px; padding-bottom: 12px; }
  .signoff { width: 236px; }
  .topbar { gap: 8px; }
  .topbar-right { gap: 8px; }
}
@media (max-width: 1279px) {
  .cta-link { display: none; }
}
@media (max-width: 1140px) {
  .main { grid-template-columns: 280px minmax(0, 1fr) 308px; }
  .mode-badge { display: none; }
  .left .tab { padding: 0 5px; font-size: 12.5px; }
  .left .tabs { padding: 0 6px; gap: 0; }
  .seg button { padding: 0 7px; }
  .verdict-headline { font-size: 20px; }
  .pair-side, .kv, .final-route { grid-template-columns: 82px minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .main { grid-template-columns: 256px minmax(0, 1fr) 292px; }
  .clocked-pill .pill-more { display: none; }
}

/* Phone and small tablet: one column that scrolls as a page. Verdict, the list, the selected change
   with its page crops, then one document at a time. */
@media (max-width: 899px) {
  html, body { height: auto; }
  .app { display: block; height: auto; min-height: 100dvh; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .toplinks { margin-left: auto; margin-right: -6px; }
  .topbar-right { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
  .switcher { flex: 1 1 100%; }
  .switcher-btn { max-width: none; min-width: 0; height: 36px; }
  .switcher-menu { left: 0; right: 0; width: auto; top: 40px; }
  .mode-badge { display: none; }
  .clocked-pill .pill-more { display: inline; }
  .cta { flex: 1 1 auto; justify-content: space-between; }
  .cta-link { display: inline; }
  .intro { padding: 10px 8px 10px 14px; }
  .intro-kicker { display: inline; }
  .intro-text { flex: 1 1 60%; margin-right: 0; font-size: 13px; }
  .intro-btn { font-size: 12.5px; padding: 0 8px 0 11px; }
  .intro-close { order: -1; margin-left: auto; }
  .intro-kicker { order: -2; }
  .intro-links { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px 0 -14px; padding: 2px 8px 4px 14px; scrollbar-width: none; }
  .intro-links::-webkit-scrollbar { display: none; }
  .warns { padding-left: 18px; }
  .gate-card { margin: 10px 10px 0; }
  .intro-btn { flex: none; height: 32px; }
  .verdict { grid-template-columns: minmax(0, 1fr); row-gap: 12px; padding: 14px 14px 14px 18px; }
  .verdict-case { max-width: none; }
  .signoff { width: 100%; justify-items: start; }
  .progress { justify-items: start; }
  .signoff-why { text-align: left; }
  .signoff .btn { height: 38px; }
  .errors { padding: 10px 14px 10px 18px; }
  .main { display: flex; flex-direction: column; min-height: 0; }
  .left { order: 1; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .right { order: 2; border-left: 0; border-bottom: 1px solid var(--line-strong); scroll-margin-top: 8px; }
  .center { order: 3; }
  .left-body, .detail-scroll { flex: none; overflow: visible; }
  .left .tabs { position: sticky; top: 0; z-index: 9; background: var(--panel); height: 44px; }
  .left .tab { padding: 0 8px; font-size: 13px; }
  .row { padding: 11px 8px; }
  .action { height: 42px; }
  .action kbd, .detail-kicker kbd { display: none; }
  .detail-kicker .nav .icon-btn { width: 34px; height: 30px; justify-content: center; padding: 0; }
  .detail-actions { position: sticky; bottom: 0; z-index: 9; box-shadow: 0 -6px 16px rgba(21, 23, 28, 0.08); }
  .doc-toolbar { position: sticky; top: 0; z-index: 9; }
  #view-seg [data-view="both"], .zoom { display: none; }
  .seg button { height: 30px; padding: 0 11px; }
  .docs { display: block; }
  .docs[data-view="both"]::after { display: none; }
  .doc { display: block; }
  .doc-scroll { overflow: visible; }
  .doc-pages { width: 100%; padding: 8px 10px 14px; }
  .pin { width: 16px; height: 16px; font-size: 10px; }
  .legend { padding: 8px 12px; }
  .drawer { height: auto; z-index: auto; }
  .drawer-panel { position: static; }
  .drawer[data-open="true"] .drawer-panel { height: auto; box-shadow: none; }
  .drawer-bar { height: auto; min-height: 44px; flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; }
  .drawer-sum { flex: 1 1 100%; margin-left: 8px; flex-wrap: wrap; white-space: normal; gap: 2px 12px; }
  .drawer-close { display: none; }
  .drawer-body { overflow-x: auto; }
  /* The endpoint table becomes one card per endpoint. */
  .grid--eps, .grid--eps tbody, .grid--eps tfoot { display: block; }
  .grid--eps thead { display: none; }
  .grid--eps tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .grid--eps td { display: block; padding: 0; border: 0; }
  .grid--eps td:first-child { flex: 1 1 100%; padding-left: 0; }
  .grid--eps td:first-child .ep-name { display: inline; margin-right: 8px; }
  .grid--eps td.r { text-align: left; font-size: 12px; color: var(--ink-2); }
  .grid--eps td.r:empty { display: none; }
  .grid--eps td[data-label]::before { content: attr(data-label) " "; color: var(--muted); }
  .grid--eps td.wide { flex: 1 1 100%; }
  .grid--eps td.wide[data-label]::before { display: block; margin-bottom: 1px; font-size: 11px; font-weight: 650; letter-spacing: 0.02em; }
  .grid--eps tfoot td { position: static; background: none; box-shadow: none; }
  .grid--audit { min-width: 900px; }
  .terms th { top: 44px; }
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .modal-body { padding: 12px; }
  .sum-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner { animation-duration: 2s; }
}

/* The signature is an actual note/evidence pair from the open review. */
.intro { position: relative; display: block; padding: 13px 52px 11px 22px; background: #fbf6ef; border-bottom-color: #ded1c1; }
.intro-kicker { display: block; margin-bottom: 9px; color: #82533c; font-size: 10px; letter-spacing: .12em; }
.intro-evidence { display: grid; grid-template-columns: minmax(0,1.3fr) 24px minmax(0,1fr) auto; gap: 18px; align-items: center; }
.intro-label { display: block; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.intro-said q { display: block; font-family: Georgia,serif; font-size: 18px; line-height: 1.25; }
.intro-found { padding-left: 14px; border-left: 3px solid var(--red); }
.intro-found strong { display: block; font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
.intro-vs { color: #9c8878; font-size: 22px; }
.intro-action { white-space: nowrap; }
.intro-close { position: absolute; right: 12px; top: 8px; }
.intro-explore { margin-top: 9px; font-size: 11px; color: #725f50; }
.intro-explore summary { cursor: pointer; width: fit-content; }
.intro-explore .intro-links { margin-top: 9px; }
.intro-orientation { display: flex; gap: 18px; align-items: baseline; }
.intro-orientation b { font-size: 18px; letter-spacing: -.35px; }
.intro-orientation span { color: var(--muted); font-size: 12px; }
@media(max-width:1000px){.intro-evidence{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:10px}.intro-action{grid-column:1 / -1;justify-self:start;height:30px;font-size:12px}.intro-said q{font-size:16px}.intro-found strong{font-size:18px}.intro-orientation{display:block}.intro-orientation span{display:block}}
@media(max-width:600px){.intro{padding:11px 36px 10px 14px}.intro-kicker{display:block;margin-bottom:7px;font-size:9px}.intro-evidence{gap:8px;grid-template-columns:minmax(0,1.1fr) 12px minmax(0,1fr)}.intro-said q{font-size:14px}.intro-found{padding-left:8px}.intro-found strong{font-size:17px}.intro-label{font-size:8px}.intro-explore .intro-links{margin:8px -20px 0 0;padding:0;flex-wrap:wrap;overflow:visible}.intro-close{right:3px;top:3px}.intro-orientation b{font-size:16px}}
@media(max-width:600px){
  .topbar-right .cta, .topbar-right .clocked-pill { display:none; }
  .verdict-case { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .reasons-legend { display:none; }
  .verdict { row-gap:9px; }
}

/* fine print that both versions carry: listed, not a finding */
.fineprint { padding: 8px 14px 10px; display: grid; gap: 4px; }
.fineprint .quote { font-size: 12px; }
.fineprint small { color: var(--muted, #6b7280); font-size: 11.5px; line-height: 1.4; }

/* first screen: who decides next, beside what was claimed and what changed */
.intro-next { display: grid; gap: 3px; align-content: center; min-width: 0; padding-left: 16px; border-left: 1px solid rgba(0,0,0,.12); }
.intro-next-who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.intro-next small { color: #6b6257; font-size: 11.5px; }
@media (max-width: 900px) { .intro-next { padding-left: 0; border-left: 0; grid-column: 1 / -1; } }
@media (min-width: 1001px) { .intro-evidence { grid-template-columns: minmax(0,1.3fr) 24px minmax(0,1fr) minmax(0,.95fr) auto; } }
