/* Layout: one reading column for the proposal; the sketch breaks out to a wide working panel (page strip | scan | rubric). */
:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --sunk: #e8ecf1;
  --ink: #18212c;
  --muted: #5a6573;
  --line: #d5dce5;
  --accent: #1d4c9c;      /* ink blue: UI */
  --accent-soft: #e2eaf7;
  --mark: #c22a22;        /* red pen: marks */
  --ok: #2c7a4c;
  --ok-soft: #e1f1e7;
  --warn: #9a5c00;
  --warn-soft: #fbefd9;
  --shade: rgba(24, 33, 44, 0.38);
  --page-filter: none;
  --f-display: Georgia, "Times New Roman", serif;
  --f-body: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151c; --surface: #18202a; --sunk: #121922; --ink: #e5eaf1; --muted: #9ba7b6;
    --line: #2b3543; --accent: #8db0ee; --accent-soft: #213149; --mark: #ff7b70;
    --ok: #6fcf97; --ok-soft: #173326; --warn: #e3a94d; --warn-soft: #3a2a12;
    --shade: rgba(0, 0, 0, 0.5); --page-filter: brightness(0.9); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10151c; --surface: #18202a; --sunk: #121922; --ink: #e5eaf1; --muted: #9ba7b6;
  --line: #2b3543; --accent: #8db0ee; --accent-soft: #213149; --mark: #ff7b70;
  --ok: #6fcf97; --ok-soft: #173326; --warn: #e3a94d; --warn-soft: #3a2a12;
  --shade: rgba(0, 0, 0, 0.5); --page-filter: brightness(0.9); color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body);
  font-size: 15px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 32px 64px;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; text-wrap: balance; line-height: 1.2; margin: 0; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.5rem; margin-bottom: 12px; }
h3 { font-size: 1.08rem; margin-bottom: 6px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--f-mono); font-size: 0.9em; }
a { color: var(--accent); }
.col { max-width: 760px; margin: 0 auto; }
.wide { max-width: 1280px; margin: 0 auto; }
section { margin-top: 48px; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lede { font-size: 1.08rem; color: var(--ink); margin-top: 14px; }
.note { color: var(--muted); font-size: 0.9rem; }
ul.plain { margin: 0; padding-left: 20px; }
ul.plain li { margin-bottom: 6px; }


/* App frame */
.app { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.appbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunk); }
.brand { font-family: var(--f-display); font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { font: inherit; font-size: 0.88rem; border: 1px solid transparent; background: none; color: var(--muted); padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.tab:hover { color: var(--ink); border-color: var(--line); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
.who { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.view { padding: 16px; }
button.btn { font: inherit; font-size: 0.9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 5px; cursor: pointer; }
button.btn:hover { border-color: var(--accent); }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 500; }
button.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .thumb:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="text"], input[type="email"], input[type="number"], textarea, select { font: inherit; font-size: 0.92rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; }
textarea { width: 100%; resize: vertical; }
.pill { display: inline-block; font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.todo { }
.pill.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.flagged { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.review { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Grade screen */
.taskbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.taskbar .t { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; }
.taskbar .sub { color: var(--muted); font-size: 0.88rem; }
.taskbar .nav { margin-left: auto; display: flex; gap: 6px; }
.grade { display: grid; grid-template-columns: 112px minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.strip { display: flex; flex-direction: column; gap: 6px; max-height: 78vh; overflow-y: auto; padding-right: 4px; }
.strip h4 { font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; font-weight: 600; }
.strip h4:first-child { margin-top: 0; }
.thumb { position: relative; border: 2px solid var(--line); border-radius: 4px; padding: 0; background: var(--surface); cursor: pointer; display: block; width: 100%; text-align: left; font: inherit; color: inherit; }
.thumb img { display: block; width: 100%; aspect-ratio: 1240 / 1754; object-fit: cover; filter: var(--page-filter); border-radius: 2px 2px 0 0; }
.thumb .lab { display: flex; justify-content: space-between; gap: 4px; font-size: 0.72rem; padding: 2px 4px; font-family: var(--f-mono); }
.thumb.cur { border-color: var(--accent); }
.thumb.ans { box-shadow: 0 0 0 2px var(--mark) inset; }
.thumb .home { position: absolute; top: 3px; left: 3px; background: var(--accent); color: var(--surface); font-size: 0.62rem; padding: 0 4px; border-radius: 3px; font-family: var(--f-mono); }
.thumb .pin { position: absolute; top: 3px; right: 3px; background: var(--mark); color: #fff; font-size: 0.62rem; padding: 0 4px; border-radius: 3px; font-family: var(--f-mono); }
.thumb .others { color: var(--muted); }
.viewer { min-width: 0; }
.vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.vtools .where { font-size: 0.88rem; color: var(--muted); margin-right: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.8rem; color: var(--muted); }
.chip { font: inherit; font-size: 0.75rem; font-family: var(--f-mono); border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 1px 6px; border-radius: 4px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--mark); border-color: var(--mark); color: #fff; }
.scan { position: relative; height: 78vh; overflow: auto; background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; }
.scan .sheet { position: relative; margin: 0 auto; }
.scan img { display: block; width: 100%; filter: var(--page-filter); }
.band { position: absolute; left: 0; right: 0; background: var(--shade); pointer-events: none; }
.rubric { border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: var(--surface); max-height: 78vh; overflow-y: auto; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.total { font-family: var(--f-display); font-size: 1.9rem; color: var(--mark); font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.total small { font-size: 0.95rem; color: var(--muted); }
.items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item { border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; }
.item.on { border-color: var(--mark); }
.item label.chk { display: grid; grid-template-columns: 20px 1fr; gap: 8px; cursor: pointer; align-items: start; }
.item input[type="checkbox"] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--mark); }
.item .nm { font-weight: 600; }
.item .tx { font-size: 0.86rem; color: var(--muted); }
.seg { display: flex; gap: 4px; margin: 6px 0 4px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 0.82rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 3px 10px; border-radius: 4px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--mark); color: #fff; border-color: var(--mark); }
.cmp { font-size: 0.8rem; font-family: var(--f-mono); margin-top: 4px; }
.cmp.diff { color: var(--warn); font-weight: 500; }
details.ref { border-top: 1px solid var(--line); padding: 8px 0; font-size: 0.86rem; }
details.ref summary { cursor: pointer; font-weight: 500; }
details.ref ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
details.ref li { margin-bottom: 4px; }
.expect { font-family: var(--f-mono); font-size: 0.8rem; background: var(--sunk); padding: 6px 8px; border-radius: 4px; white-space: pre; overflow-x: auto; margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.flagline { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; margin-top: 8px; }
.msg { font-size: 0.86rem; margin-top: 8px; min-height: 1.3em; }
.msg.err { color: var(--mark); }
.msg.ok { color: var(--ok); }
.banner { font-size: 0.85rem; background: var(--accent-soft); color: var(--ink); border-radius: 5px; padding: 8px 10px; margin-bottom: 10px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sunk); }
td.cell { text-align: center; font-family: var(--f-mono); cursor: pointer; }
td.cell.todo { color: var(--muted); }
td.cell.done { color: var(--ink); }
td.cell.agree { color: var(--ok); }
td.cell.disputed { background: var(--warn-soft); color: var(--warn); font-weight: 500; }
td.cell.flagged { box-shadow: inset 0 0 0 2px var(--mark); color: var(--mark); }
td.cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .l-agree::before { background: var(--ok-soft); border-color: var(--ok); }
.legend .l-disp::before { background: var(--warn-soft); border-color: var(--warn); }
.legend .l-flag::before { border: 2px solid var(--mark); }
.chief { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; min-width: 0; }
.bar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin: 3px 0 8px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* Forms */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 0.88rem; }
.field > span { font-weight: 500; }
.signin { max-width: 380px; margin: 24px auto; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.signin h3 { margin-bottom: 4px; }
.codebox { letter-spacing: 0.4em; font-family: var(--f-mono); font-size: 1.1rem; width: 100%; }
pre.csv { font-family: var(--f-mono); font-size: 0.8rem; background: var(--sunk); padding: 10px; border-radius: 5px; max-height: 300px; overflow: auto; margin: 0; }


@media (max-width: 1080px) {
  .grade { grid-template-columns: 96px minmax(0, 1fr); }
  .rubric { grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 760px) {
  h1 { font-size: 1.8rem; }
  .grade { grid-template-columns: minmax(0, 1fr); }
  .strip { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .strip h4 { display: none; }
  .thumb { width: 72px; flex: 0 0 auto; }
  .scan { height: 64vh; }
  .chief, .two { grid-template-columns: minmax(0, 1fr); }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dd { margin-bottom: 6px; }
  .taskbar .nav { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .scan { scroll-behavior: smooth; }
}

/* App additions (not in the sketch) */
body { padding-block: 0 48px; }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
header.top .brand { font-size: 1.1rem; color: var(--ink); text-decoration: none; }
header.top nav { display: flex; flex-wrap: wrap; gap: 4px; }
header.top nav a { color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 5px; font-size: 0.9rem; border: 1px solid transparent; }
header.top nav a:hover { color: var(--ink); border-color: var(--line); }
header.top nav a.on { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
header.top .who { display: flex; align-items: center; gap: 8px; }
header.top form { margin: 0; }
.linkbtn { font: inherit; font-size: 0.85rem; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; }
.wrap { max-width: 1400px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stack > * + * { margin-top: 16px; }
a.btn { display: inline-block; text-decoration: none; font-size: 0.9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 5px; }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 500; }
a.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.pill.started { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.final { background: var(--sunk); color: var(--ink); }
.pill.wait { color: var(--muted); border-style: dashed; }
td.cell.final { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); }
td.cell.started { color: var(--accent); }
td.cell.none { color: var(--line); }
td.cell a { color: inherit; text-decoration: none; display: block; }
.legend .l-final::before { background: var(--surface); border-color: var(--accent); }
.err { color: var(--mark); }
.ok { color: var(--ok); }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 5px; padding: 8px 10px; font-size: 0.88rem; }
.errbox { background: var(--warn-soft); border-left: 3px solid var(--mark); border-radius: 4px; padding: 8px 12px; font-size: 0.88rem; }
.errbox ul { margin: 4px 0 0; padding-left: 18px; }
.namecrop { max-width: 520px; width: 100%; border: 1px solid var(--line); border-radius: 4px; display: block; }
.tasklist td a { color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.chk-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88rem; }
.chk-list label { display: inline-flex; gap: 5px; align-items: center; }
.locked { font-size: 0.85rem; background: var(--sunk); border-radius: 5px; padding: 8px 10px; margin-bottom: 10px; }
.tcol { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 10px; font-size: 0.85rem; align-items: baseline; }
.tcol .v { font-family: var(--f-mono); text-align: center; min-width: 2.2em; }
.tcol .v.diff { color: var(--warn); font-weight: 600; }
.tcol .h { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.hist { font-size: 0.8rem; color: var(--muted); max-height: 220px; overflow-y: auto; }
.hist div { padding: 2px 0; border-bottom: 1px dotted var(--line); }
kbd { font-family: var(--f-mono); font-size: 0.75rem; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }

/* Grading screen v2: page bar over scan | splitter | transcript | rubric */
.wrap.full { max-width: none; }
.wrap.full main { max-width: none; }
.wrap.full .taskbar { margin-bottom: 8px; }
.pagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
.pagebar .grp { font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 2px 0 8px; }
.pagebar .grp:first-child { margin-left: 0; }
.pg { font: inherit; font-family: var(--f-mono); font-size: 0.8rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 2px 7px; border-radius: 4px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.pg:hover { border-color: var(--accent); }
.pg.cur { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pg.home { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pg.ans { box-shadow: inset 0 0 0 1px var(--mark); }
.pg.blank { color: var(--muted); border-style: dashed; }
.pg .pin { background: var(--mark); color: #fff; font-size: 0.65rem; padding: 0 3px; border-radius: 3px; }
.pg .oth { color: var(--muted); font-size: 0.65rem; }
.pg.more { color: var(--muted); font-family: var(--f-body); }
.grade2 { --scan-frac: 0.36; display: grid; gap: 0 10px; align-items: start;
  grid-template-columns: calc(var(--scan-frac) * (100% - 360px)) 6px minmax(0, 1fr) 330px; }
.grade2.notr { grid-template-columns: minmax(0, 1fr) 360px; }
.grade2.notr .splitter, .grade2.notr .trpane { display: none; }
.scanpane, .trpane { margin-top: 0; }
.scanpane { min-width: 0; display: flex; flex-direction: column; height: var(--pane-h, 78vh); }
.scanpane .vtools { margin: 0 0 6px; }
.scanpane .vtools:last-child { margin: 6px 0 0; }
.grade2 .scan { flex: 1; height: auto; min-height: 0; }
.scan .sheet { width: 100%; }
.scan img { cursor: zoom-in; }
.lens { position: absolute; width: 320px; height: 180px; border: 2px solid var(--accent); border-radius: 6px; background-color: #fff;
  background-repeat: no-repeat; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); pointer-events: none; z-index: 3; filter: var(--page-filter); }
.splitter { height: var(--pane-h, 78vh); cursor: col-resize; border-radius: 3px; background: var(--line); opacity: 0.5; touch-action: none; }
.splitter:hover, body.dragging .splitter { background: var(--accent); opacity: 1; }
body.dragging { user-select: none; cursor: col-resize; }
.trpane { min-width: 0; height: var(--pane-h, 78vh); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.trhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 10px 6px; border-bottom: 1px solid var(--line); }
.trhead .meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.trwarn { font-size: 0.78rem; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; }
.trbody { flex: 1; overflow-y: auto; padding: 8px 10px 40vh; }
.blk { border-left: 3px solid transparent; padding: 2px 0 4px 8px; margin-bottom: 8px; }
.blk.cur { border-left-color: var(--accent); }
.blkhead { font: inherit; font-size: 0.8rem; color: var(--muted); background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; }
.blkhead b { font-family: var(--f-mono); color: var(--ink); }
.blkhead .dim { color: var(--warn); }
.sec { margin: 4px 0 8px; }
.sec .lbl { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em; color: var(--accent); margin-bottom: 2px; }
.sec.other { opacity: 0.55; }
.sec.other .lbl { color: var(--muted); }
.sec .md { font-size: 0.95rem; line-height: 1.5; overflow-wrap: anywhere; }
.sec .md p { margin: 0 0 6px; }
.sec .md pre { font-family: var(--f-mono); font-size: 0.84rem; line-height: 1.4; background: var(--sunk); padding: 6px 8px; border-radius: 4px; overflow-x: auto; margin: 4px 0 8px; white-space: pre; }
.sec .md code { font-family: var(--f-mono); font-size: 0.86em; background: var(--sunk); padding: 0 3px; border-radius: 3px; }
.sec .md pre code { background: none; padding: 0; font-size: inherit; }
.unread { color: var(--mark); font-weight: 700; }
.aside { color: var(--muted); font-style: italic; }
.grade2 .rubric { height: var(--pane-h, 78vh); max-height: none; }
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(10, 14, 20, 0.88); overflow: auto; cursor: zoom-out; padding: 12px 0; }
.overlay img { display: block; margin: 0 auto; width: min(96vw, 1400px); background: #fff; filter: var(--page-filter); }
.keys { margin-top: 6px; font-size: 0.8rem; }
@media (max-width: 1100px) {
  .grade2 { grid-template-columns: calc(var(--scan-frac) * 100%) 6px minmax(0, 1fr); }
  .grade2.notr { grid-template-columns: minmax(0, 1fr); }
  .grade2 .rubric { grid-column: 1 / -1; height: auto; margin-top: 12px; }
}
@media (max-width: 760px) {
  .grade2, .grade2.notr { grid-template-columns: minmax(0, 1fr); }
  .splitter { display: none; }
  .scanpane, .trpane { height: 70vh; }
  .trpane { margin-top: 10px; }
}

/* Sign-off: proposed marks with reasons, issues, chief settling */
.grade2.so { grid-template-columns: calc(var(--scan-frac) * (100% - 420px)) 6px minmax(0, 1fr) 400px; }
.grade2.so.notr { grid-template-columns: minmax(0, 1fr) 420px; }
td.cell.agreed, td.cell.signed { color: var(--ok); background: var(--ok-soft); }
td.cell.proposed { color: var(--muted); }
td.cell.issue { background: var(--warn-soft); color: var(--warn); font-weight: 600; box-shadow: inset 0 0 0 2px var(--warn); }
td.cell.chk a { text-decoration: underline dotted var(--mark); text-underline-offset: 3px; }
.legend .l-prop::before { background: var(--surface); }
.legend .l-chk::before { border: 0; border-bottom: 2px dotted var(--mark); border-radius: 0; }
.item.so { display: flex; flex-direction: column; gap: 4px; }
.item.so.lost { border-left: 3px solid var(--mark); }
.item.so.hasissue { border-color: var(--warn); background: var(--warn-soft); }
.sohead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sohead .seg { margin: 0; }
.pv { font-size: 0.8rem; font-weight: 600; padding: 1px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid var(--line); }
.pv.full { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pv.half { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pv.zero { color: var(--mark); background: var(--surface); border-color: var(--mark); }
.why, .ev { font-size: 0.86rem; }
.why .k, .ev .k { color: var(--muted); font-size: 0.78rem; }
.ev { color: var(--muted); }
.changed { font-size: 0.78rem; color: var(--warn); font-weight: 600; }
.chkbadge { font-size: 0.78rem; color: var(--mark); font-weight: 600; }
.cmt { font-size: 0.84rem; border-left: 3px solid var(--warn); padding: 3px 8px; background: var(--surface); border-radius: 0 4px 4px 0; }
.cmt.resolved { border-left-color: var(--ok); color: var(--muted); }
.cmt .sug { font-family: var(--f-mono); font-size: 0.78rem; color: var(--warn); }
.cmt .reply { color: var(--ok); margin-top: 2px; }
.linkbtn.raise { align-self: flex-start; font-size: 0.8rem; }
.issueform select { font-size: 0.82rem; }
.chkctl { font-size: 0.84rem; display: inline-flex; gap: 4px; align-items: center; }
.rubric .actions.sticky { position: sticky; bottom: -14px; background: var(--surface); padding: 8px 0 10px; border-top: 1px solid var(--line); z-index: 2; }

/* attention: green / orange / red (app/review.py) */
.fl { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; vertical-align: baseline; }
.fl.green { background: var(--ok); }
.fl.orange { background: var(--warn); }
.fl.red { background: var(--mark); }
td.cell.f-orange { box-shadow: inset 0 -3px 0 var(--warn); }
td.cell.f-red { box-shadow: inset 0 -3px 0 var(--mark); }
.item.so.f-green { border-left: 4px solid var(--ok); }
.item.so.f-orange { border-left: 4px solid var(--warn); }
.item.so.f-red { border-left: 4px solid var(--mark); }
.attn { border-radius: 5px; padding: 8px 10px; margin-bottom: 10px; font-size: 0.85rem; }
.attn.green { background: var(--ok-soft); color: var(--ok); }
.attn.orange { background: var(--warn-soft); color: var(--warn); }
.attn.red { background: var(--warn-soft); color: var(--mark); border: 1px solid var(--mark); }
.flagwhy { font-size: 0.82rem; margin: 4px 0; padding-left: 16px; }
.flagwhy li { margin: 1px 0; }
.second, .grp { font-size: 0.82rem; margin: 4px 0; padding: 4px 8px; background: var(--sunk); border-radius: 4px; }
.second .k, .grp .k { color: var(--muted); }
.grp .ids { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); }
table.groups { table-layout: fixed; width: 100%; }
table.groups td { vertical-align: top; font-size: 0.85rem; overflow-wrap: anywhere; white-space: normal; }
table.groups th { white-space: normal; }
table.groups tr.ok td { color: var(--muted); }
table.groups .ids a { font-family: var(--f-mono); font-size: 0.78rem; margin-right: 4px; display: inline-block; }
table.groups .off { color: var(--mark); font-weight: 500; }
