/* Rubrics. One grammar on every page here (Jay, 2026-11-13: too scattered):
   - a section is a title with its state beside it and its one action at the right edge;
   - a part is a flat card (white, a hairline ring, 14px corners) whose rows are two lines and light up under the pointer;
   - everything inside a card stands on one 18px inset, so titles, rows, fields and buttons share their left and right edges;
   - one filled button a section; the other actions are plain words (.rb-quiet) that show a ground on hover;
   - only the panel beside the list floats (a shadow); nothing else does, and no card stands inside another. */

/* ---- shared by the pages here ---- */
.segs .seg .count { margin-left: 6px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.segs .seg[aria-pressed="true"] .count { color: inherit; opacity: 0.7; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.scroll-x { overflow-x: auto; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check-inline input[type=checkbox] { margin: 0; }
/* Other pages' side notes (a reading page's column of notes). */
.side-notes .section-head { margin-bottom: 8px; }
.side-notes .section-head h2 { font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.side-notes .row { margin-top: 10px; gap: 12px; }

/* An action in plain words: no frame, a ground under the pointer. */
.rb-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font: 500 13px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.12s, color 0.12s; }
.rb-quiet:hover { background: var(--hover); color: var(--ink); }
.rb-quiet:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rb-quiet:disabled, .rb-quiet.working { opacity: 0.5; cursor: default; }
.rb-quiet.danger:hover { background: var(--danger-soft); color: var(--danger); }
/* A state beside a title: lighter than the title, never bold. */
.rb-state, .rw-state, .rw-n { font-size: 13px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ================= The list page (#/rubrics) ================= */
.rubrics-page .head { align-items: center; margin-bottom: 18px; }
.rc-mine { margin: 0 0 14px; padding: 11px 18px; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); }
.rw-general-fold { margin: 0 0 28px; }
/* A fold points down, and up once open (style.css .disclose); › is for a link that leaves the page. */
.rw-general-fold > summary .ph-chev { transform: translateY(-2px) rotate(45deg); }
.rw-general-fold[open] > summary .ph-chev { transform: translateY(2px) rotate(-135deg); }
.rw-general-fold > summary:hover { background: var(--hover); }
/* Prompt rubrics: the title on the cards' own left edge, its state, and how it works at the right edge. No rule above it. */
.rw-section-head.rw-prompts-head { align-items: center; gap: 10px; min-height: 30px; margin: 0 0 12px; padding: 0; border-top: 0; }
.rw-prompts-head h2 { font-size: 16px; }
.rw-prompts-head .rw-how { margin: 0 0 0 auto; }
.rubric-how { margin: 0 0 14px; }
.rubric-how[hidden] { display: none; }
.rubric-how .rubric-steps { margin: 0; border-radius: 14px; box-shadow: var(--ring); }
.rw { gap: 18px; scroll-margin-top: 76px; }

/* Runs (public/rubric_runs.js): one card, open from the start, in ONE fixed size (Jay, 2026-11-13: the window size of the runs block should be fixed; DESIGN-4 §3). The head is 48 px (one line) alone and 84 px (two: the title and fold,
   then the segments) beside a panel and on a phone; the box under it is 261 px alone (four rows and a half) and 203 px beside a panel and on a phone (three and a half): the half row says there is more, no fade.
   A row is 58 px, two lines of one line each. An empty segment, rows that are loading and a lab that cannot be reached are all drawn inside the box, so nothing under the card ever moves. */
.rw-runs { flex: none; margin: 0 0 16px; }
.rr-card { --rr-head: 48px; --rr-body: 261px; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); overflow: hidden; }
.rr-card.beside { --rr-head: 84px; --rr-body: 203px; }
.rr-card.flat { background: transparent; border-radius: 0; box-shadow: none; }
.rr-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 48px; align-items: center; column-gap: 8px; box-sizing: border-box; height: var(--rr-head); padding: 0 10px 0 18px; box-shadow: inset 0 -1px 0 var(--line-soft); }
.rr-card.folded .rr-head { box-shadow: none; }
.rr-card.flat .rr-head { padding-left: 0; }
.rr-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rr-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.rr-head .hint { margin-left: 0; }
.rr-segs { display: flex; flex-wrap: nowrap; gap: 2px; min-width: 0; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
.rr-segs::-webkit-scrollbar { display: none; }
/* The segments are the card's tabs (Jay, 2026-11-14: opened, the card looked laid out at random): words on the tab line, the chosen one underlined, never a chip beside
   the title. The title is the heading, and pressing it folds or opens the card. */
button.rr-seg { display: inline-flex; flex: none; align-items: center; gap: 5px; height: 100%; min-height: 34px; margin: 0 9px; padding: 0 1px; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); font: 500 13px/1 var(--sans); white-space: nowrap; cursor: pointer; transition: color 0.12s, box-shadow 0.12s; }
button.rr-seg:hover { background: transparent; color: var(--ink); box-shadow: inset 0 -2px 0 var(--line); }
button.rr-seg[aria-pressed="true"] { background: transparent; color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
button.rr-seg.bad[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--danger); }
.rr-title-text { cursor: pointer; border-radius: 6px; }
.rr-title-text:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.rr-seg .count { margin-left: 6px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
button.rr-seg.bad, button.rr-seg.bad .count { color: var(--danger); }
/* On a phone every tab fits on the card's line (Jay, 2026-11-15: "History" was cut at the edge): tighter spacing, not a scroll. */
@media (max-width: 440px) {
  .rr-segs { margin-left: 0; }
  button.rr-seg { margin: 0 5px; font-size: 12.5px; }
  .rr-seg .count { margin-left: 3px; }
}
button.rr-fold { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; transition: background 0.12s; }
button.rr-fold:hover { background: var(--hover); }
button.rr-fold .ph-chev { margin: 0; transform: translateY(2px) rotate(-135deg); }
button.rr-fold[aria-expanded="false"] .ph-chev { transform: translateY(-2px) rotate(45deg); }
.rr-body { position: relative; height: var(--rr-body); overflow: hidden; }
.rr-body[hidden] { display: none; }
.rr-rows { display: block; height: 100%; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.rr-rows[hidden] { display: none; }
.rr-rows.dim { opacity: 0.5; }
li.rr-more { height: 1px; list-style: none; }
.rr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; box-sizing: border-box; height: 58px; padding: 0 12px 0 18px; transition: background 0.12s; }
.rr-card.flat .rr-row { padding-left: 4px; }
/* A run with one line (no second line under its name) is shorter, so the prompts under it sit close to its name (Jay, 2026-11-17: this gap is a bit wide). */
.rr-row:has(.rr-l2:empty) { height: 46px; }
/* No hairline between rows (Jay, 2026-11-14: he does not like too many borders): the hover says which row is which, room separates them. */
.rr-row { border-radius: 10px; }
.rr-rows { padding: 4px 6px 8px; box-sizing: border-box; }
.rr-card .rr-row { padding-left: 12px; padding-right: 6px; }
.rr-card.flat .rr-rows { padding: 0; }
/* Under a run's row: its prompts that are generating, waiting or failed, a line each (dot, title, how long or why), each opening the run at that prompt. */
/* A run is one group (Jay, 2026-11-14: should it not be split into batches?): its row, then its prompts in this segment in one soft box under it, no rules, so they read as that
   run's; room before the next run's row starts the next group. */
.rr-jobs { display: block; margin: -6px 0 0; padding: 0 6px 12px 12px; }
.rr-card.flat .rr-jobs { padding-left: 0; }
.rr-tree { display: grid; padding: 4px 4px; border-radius: 10px; background: var(--field, #f6f6f4); }
.rr-tree .rr-job { margin: 0; padding: 0 10px; }
.rr-tree .rr-job:hover { background: rgba(17, 17, 17, 0.045); }
.rr-job { display: grid; grid-template-columns: 8px minmax(0, 44%) minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 26px; padding: 0 8px; margin: 0 -8px; border-radius: 7px; color: inherit; text-decoration: none; font-size: 13px; }
.rr-job:hover { background: var(--hover); }
.rr-job .st-dot { width: 7px; height: 7px; }
.rr-job-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rr-job-s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rr-job-s.rr-bad { color: var(--danger); }
.rr-job-more { grid-template-columns: minmax(0, 1fr); color: var(--accent-ink); padding-left: 26px; }
.rr-row:hover { background: var(--hover); }
.rr-row.rr-earlier { grid-template-columns: minmax(0, 1fr) auto; padding-right: 12px; }
.rr-row.rr-earlier .rr-l1 { font-weight: 500; color: var(--ink-2); }
.rr-open { display: grid; gap: 2px; min-width: 0; color: inherit; text-decoration: none; }
/* The first line is the row's link; it takes a click anywhere on the row, under the counts that open their own segment. */
.rr-open-a { display: block; min-width: 0; color: inherit; text-decoration: none; }
a.rr-open-a::after { content: ""; position: absolute; inset: 0; }
a.rr-open-a:focus-visible { outline: none; }
a.rr-open-a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
/* A run's row: whose run it is in the ink, when and how many prompts quieter. */
.rr-row.rr-run .rr-m { font-weight: 500; color: var(--ink-2); }
/* Its tally: a thin bar of its prompts by state, then each state's count with its dot; this segment's in bold, another's opens that segment. */
.rr-l2.rr-tally { display: flex; align-items: center; gap: 0; text-overflow: clip; }
.rr-ti { display: inline-flex; flex: none; align-items: center; gap: 5px; white-space: nowrap; }
.rr-ti .st-dot { width: 7px; height: 7px; }
.rr-ti .st-dot.approved { background: var(--ink-3); box-shadow: none; }
.rr-ti.on { font-weight: 600; color: var(--ink); }
.rr-ti.on.rr-bad, .rr-ti.rr-bad { color: var(--danger); }
button.rr-ti-go { position: relative; z-index: 1; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
button.rr-ti-go:hover { color: var(--ink); text-decoration-color: currentColor; }
button.rr-ti-go.rr-bad:hover { color: var(--danger); }
button.rr-ti-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.rr-sep { flex: none; white-space: pre; }
/* Line one is one line: a long title is cut with "…", what follows it (when, who) never is. Line two is one line of words, a failure in the error colour. */
.rr-l1 { display: flex; min-width: 0; height: 20px; font-size: 14px; font-weight: 600; line-height: 20px; color: var(--ink); white-space: nowrap; }
.rr-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rr-m { flex: none; white-space: pre; }
.rr-l2 { display: block; min-width: 0; height: 18px; font-size: 13px; line-height: 18px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A row that would only repeat the lines under it has no second line (Jay, 2026-11-15). */
.rr-l2:empty { display: none; }
span.rr-bad { color: var(--danger); font-weight: 500; }
.rr-end { position: relative; z-index: 1; display: inline-flex; align-items: center; }
.rr-end:empty { display: none; }
.rr-act { height: 30px; white-space: nowrap; }
.btn.small.rr-act { padding: 0 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; font-size: 13px; }
.btn.small.rr-act:hover { background: #dfeafd; }
.btn.small.rr-act.confirm { background: var(--ink); color: #fff; }
.btn.small.rr-act.working::after { border-color: rgba(37, 99, 235, 0.25); border-top-color: var(--accent-ink); }
.btn.small.rr-act.working { color: var(--accent-ink) !important; padding-left: 31px; }
.btn.small.rr-act.working::after { left: 12px; margin-left: 0; }
.btn.rn-approve.working::after { left: 14px; margin-left: 0; }
.rb-quiet.rr-act { color: var(--accent-ink); }
.rb-quiet.rr-act:hover { background: var(--accent-soft); }
.rr-go { color: var(--ink-3); font-size: 19px; line-height: 1; }
/* The sentence of an empty or unread segment is at the box's top; the rows that are on their way are three grey rows of the same size; a lab that cannot be reached is one 28 px line pinned in the box's foot. */
.rr-empty { position: absolute; top: 0; left: 0; right: 0; margin: 0; padding: 14px 18px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.rr-empty[hidden] { display: none; }
.rr-empty .rb-quiet { margin-left: 6px; color: var(--accent-ink); }
.rr-empty .rb-quiet:hover { background: var(--accent-soft); }
.rr-skeleton { position: absolute; inset: 0; overflow: hidden; }
.rr-skeleton[hidden] { display: none; }
.rr-sk-row { display: grid; align-content: center; gap: 9px; box-sizing: border-box; height: 58px; padding: 0 18px; }
.rr-sk-row { margin: 0 6px; }
.rr-sk-row .sk { display: block; height: 9px; animation: sk-breathe 1.6s ease-in-out infinite; }
.rr-offline { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 4px; box-sizing: border-box; height: 28px; padding: 0 10px 0 18px; background: var(--surface); box-shadow: inset 0 1px 0 var(--line-soft); font-size: 13px; font-weight: 500; color: var(--danger); }
.rr-offline[hidden] { display: none; }
.rr-offline .rr-retry { height: 24px; padding: 0 8px; color: var(--accent-ink); }
.rr-offline .rr-retry:hover { background: var(--accent-soft); }
button.rr-jump { all: unset; box-sizing: border-box; cursor: pointer; color: var(--accent-ink); font-weight: 500; }
button.rr-jump:hover { text-decoration: underline; text-underline-offset: 3px; }
button.rr-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
/* Beside a panel and on a phone the card is narrow: its head takes a second line for the segments (which scroll sideways when they do not fit), and its box shows three rows and a half. */
.rr-card.beside .rr-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 46px 38px; }
/* Beside a panel: the heading and its arrow on the first line; the tabs on the second, their words on the heading's edge, the active one's line on the card's. */
.rr-card.beside .rr-segs { grid-column: 1 / -1; grid-row: 2; align-self: stretch; margin: 0 0 0 -10px; }
/* Beside Generate rubrics, folded (Jay, 2026-11-14): the card is one line, its title, its segments and the arrow, so the prompts below have the room. */
.rr-card.compact.folded { --rr-head: 46px; }
.rr-card.compact.folded .rr-head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 46px; }
.rr-card.compact.folded .rr-segs { grid-column: auto; grid-row: auto; align-self: stretch; margin: 0 0 0 2px; }
.rr-card.compact.folded .rr-title .hint { display: none; }
/* One line (the card alone, or folded beside Generate rubrics): the heading, then room, then the tabs: the heading is not one of them (Jay, 2026-11-14: fewer
   rules; room and weight say which is which, no line between them). */
.rr-card:not(.beside) .rr-title, .rr-card.compact.folded .rr-title { padding-right: 18px; }
.rr-card:not(.beside) .rr-title-text, .rr-card.compact.folded .rr-title-text { font-size: 15px; }
.rr-card.flat:not(.beside) .rr-title { padding-right: 0; }
.rr-card.compact.folded .rr-seg { margin: 0 7px; }
/* History is a look back, not what a person picking prompts weighs: there once the card is opened. */
.rr-card.compact.folded .rr-seg[data-seg="history"] { display: none; }
@media (max-width: 860px) {
  .rr-card { --rr-head: 84px; --rr-body: 203px; }
  .rr-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 48px 36px; padding-left: 16px; }
  .rr-segs { grid-column: 1 / -1; grid-row: 2; align-self: center; margin: 0 0 0 -4px; }
  .rr-row { padding-left: 16px; column-gap: 8px; }
}

/* The list's filters: words with their counts, the chosen one on a ground; the search ends on the list's right edge. */
.rw .rw-list .rw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.rw-toolbar .segs { flex-wrap: wrap !important; gap: 2px; height: auto; min-height: 0; max-width: 100%; padding: 0; overflow: visible; background: transparent; border-radius: 0; box-shadow: none; }
.rw-toolbar .segs .seg { display: inline-flex; align-items: center; height: 32px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); box-shadow: none; }
.rw-toolbar .segs .seg:hover { background: var(--hover); color: var(--ink); }
.rw-toolbar .segs .seg[aria-pressed="true"] { background: rgba(17, 17, 17, 0.075); color: var(--ink); font-weight: 600; box-shadow: none; }
.rw-toolbar .segs .seg[aria-pressed="true"] .count { opacity: 1; color: var(--ink-2); font-weight: 500; }
.rw-toolbar .search { flex: 1 1 200px; max-width: 300px; height: 34px; margin-left: auto; }
/* Beside an open panel: the filters' names on one line (their counts are on the wide list), the search as wide as the list. */
.rw.split .rw-toolbar .segs .seg { padding: 0 9px; }
.rw.split .rw-toolbar .segs .seg .count { display: none; }
/* A short window, beside a panel (.tight, public/rubrics.js): the filters are one menu on the search's line; a taller window keeps the row of segments. */
.rw-seg-menu { display: none; }
.rw.split.tight .rw-toolbar { flex-wrap: nowrap; gap: 8px; }
.rw.split.tight .rw-toolbar .segs { display: none; }
.rw.split.tight .rw-seg-menu { display: block; flex: 0 1 auto; min-width: 0; max-width: 46%; height: 34px; }
.rw.split.tight .rw-toolbar .search { flex: 1 1 120px; min-width: 100px; max-width: none; margin-left: 0; }
/* Picking on a short window: the Tick line is the list's head; a title has the row's width, two lines at most (the whole of it on hover and in the panel). */
.rw.tight .rubric-list.picking thead { display: none; }
.rw.tight .rubric-list.narrow td.primary .title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* What chooses the prompts, then a line, then the prompts (Jay, 2026-11-14: what can be chosen should have a line under it separating it from the prompts): the filters and the Tick line are one band
   over the list, closed by a rule; the list starts under it. */
.rw .rw-list .rw-toolbar { margin-bottom: 14px; }
.rw.split .rw-list .rw-toolbar { margin-bottom: 8px; }
/* Only beside a panel, where the choosing is two lines over a narrow list (Jay, 2026-11-14: fewer rules): alone, the list's own card edge is the separation. */
.rw.split .rw-list .rw-toolbar:has(+ .rw-picks[hidden]), .rw.split .rw-list .rw-picks:not([hidden]) { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.rw.split .rw-toolbar .search { flex-basis: 100%; max-width: none; }
/* The chips that tick the list sit with it, above its table, while Generate is open for many (Jay, 2026-11-13: it should be on the left): actions, never states. */
.rw-picks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.rw-picks[hidden] { display: none; }
.rw-picks-label { margin-right: 2px; font-size: 12.5px; color: var(--ink-3); }
.rw-picks-end { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rw-picks-end .rw-pick[hidden] { display: none; }

/* The prompts: two lines a row. */
.rubric-list td.rubric-state > .line { display: flex; align-items: center; gap: 8px; }
.rw-approve { margin-left: auto; color: var(--accent); font-weight: 500; white-space: nowrap; }
.rw-approve-ask { margin-left: auto; display: inline-flex; gap: 6px; }
.rw-versions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rw-list > .rw-table, .rw-list > .rw-table.scroll-box { margin: 0; padding: 0; border-radius: 14px; box-shadow: var(--ring); }
.rubric-list th { padding-top: 11px; padding-bottom: 9px; }
.rubric-list td { padding-top: 11px; padding-bottom: 11px; }
.rw-table > .rubric-list th:first-child, .rw-table > .rubric-list td:first-child { padding-left: 18px; }
.rw-table > .rubric-list th:last-child, .rw-table > .rubric-list td:last-child { padding-right: 18px; }
.rubric-list tbody tr:last-child td { border-bottom: 0; }
.rubric-list .title { font-weight: 500; overflow-wrap: anywhere; }
.rubric-list .sub { margin-top: 2px; color: var(--ink-3); }
.rubric-list .rw-short, .rubric-list.narrow .rw-long { display: none; }
.rubric-list.narrow .rw-short { display: inline; }
.rubric-list td.rubric-state .line { gap: 8px; }
.rubric-list td.rubric-state .line .sub { margin: 0; }
.rubric-list .rw-none { font-size: 13px; color: var(--ink-3); }
.rubric-list .prov-line { flex-wrap: nowrap; margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); }
.rubric-list .prov-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rubric-list .prov-toggle { flex: none; }
.rw .rubric-list tr.on > td { background: var(--accent-soft); }
@media (min-width: 861px) {
  .rubric-list { table-layout: fixed; }
  .rubric-list th.check, .rubric-list td.check { width: 46px; }
  .rubric-list th.rubric-state, .rubric-list td.rubric-state { width: 38%; }
  .rubric-list th.date, .rubric-list td.date { width: 86px; }
  .rubric-list td.primary { min-width: 0; }
  /* Beside an open panel: the version alone, at the row's right edge. */
  .rubric-list.narrow th.rubric-state, .rubric-list.narrow td.rubric-state { width: 100px; text-align: right; }
  /* How a version was made is on the row; the recorded facts behind it are asked for on the row under the pointer. */
  @media (hover: hover) {
    .rubric-list .prov-toggle { opacity: 0; transition: opacity 0.12s; }
    .rubric-list tr:hover .prov-toggle, .rubric-list .prov-toggle:focus-visible, .rubric-list .prov-toggle[aria-expanded="true"] { opacity: 1; }
  }
  .rw.fill-down > .rw-list > .rw-table { min-height: 200px; }
}
@media (max-width: 860px) {
  /* A phone: the prompt, its date at the right; under them its version. How it was made is in the prompt, opened. */
  .rubric-list td.rubric-state { margin-top: 2px; }
  .rubric-list .rubric-provenance, .rubric-list .rw-long { display: none; }
  .rubric-list .rw-short { display: inline; }
  .rw-prompts-head h2 { white-space: nowrap; }
  .rw { scroll-margin-top: 84px; }
  .rw-toolbar .search { max-width: none; }
}

/* ---- the panel beside the list: a head that stays, a body, and (Generate) a foot that stays ---- */
.rw-panel { display: flex; flex-direction: column; border-radius: 16px; }
.rw-head { flex: none; align-items: center; gap: 10px; min-height: 56px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line-soft); }
.rw-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.rw-head h2 > span { font-size: inherit; color: inherit; } /* the list-and-panel layout (.split span) would shrink a title written as a span */
.rw-head-actions, .rw-panel .rw-head-actions { flex: none; align-self: flex-start; gap: 2px; min-height: 36px; }
.rw-close { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0 0 2px; border: 0; border-radius: 8px; background: transparent; box-shadow: none;
  color: var(--ink-2); font: 400 21px/1 var(--sans); cursor: pointer; transition: background 0.12s, color 0.12s; }
.rw-close:hover { background: var(--hover); color: var(--ink); }
.rw-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rw-body { flex: 1 0 auto; padding: 16px 18px 24px; }

/* ---- Generate rubric (public/rubric_generate.js): ONE panel for one prompt or many ----
   Prompts (each row's second line is its state), Reads, Your rules, More control (three folded cards), then a foot that stays: what the panel is doing,
   what it may cost, the budget, and the one button, which says why when it cannot be pressed. A problem is the error colour at a readable size with a
   small mark, then its one-click fix as plain words; there is no alert panel and no left border (Jay, 2026-11-13). */
.rg { display: contents; }
.rg-body { display: grid; gap: 22px; align-content: start; }
.rg-for { margin: -4px 0 -10px; font-size: 13px; color: var(--ink-2); }
.rg-for a { color: var(--accent-ink); }
.rg-sec { display: grid; gap: 8px; min-width: 0; }
.rg-sec-head { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 24px; }
.rg-sec-head h3, span.rg-h { display: inline-flex; align-items: center; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
span.rg-state { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.rg-state.err, .rg-bad, span.rg-bad { color: var(--danger); }
.rg-state span.rg-bad { font-weight: 500; }
span.rg-warn { display: inline-grid; place-items: center; flex: none; width: 14px; height: 14px; margin: 0 6px 0 0; border: 1.5px solid currentColor; border-radius: 50%; font-size: 9px; font-weight: 800; line-height: 1; vertical-align: -2px; }
span.rg-warn::before { content: "!"; }
.rg-sec .spin { margin-right: 6px; }
.rw-ticks { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-pick { height: 28px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--field); color: var(--ink-2); font: 500 12.5px/1 var(--sans); white-space: nowrap; cursor: pointer; transition: background 0.12s, color 0.12s; }
.rw-pick:hover { background: #ececea; color: var(--ink); }
.rw-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rw-pick:focus:not(:focus-visible) { outline: none; }
.rw-pick.clear { background: transparent; }
.rw-pick.clear:hover { background: var(--hover); }
/* A fix several rows share, offered once. */
.rg-groupfix { display: grid; gap: 2px; }
.rg-groupfix-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; font-size: 13px; color: var(--ink-2); }
.rg-groupfix-line .rb-quiet { height: 26px; padding: 0 8px; margin-left: -2px; color: var(--accent-ink); }
/* The prompts: two lines a row, in their own box (four rows tall). */
.rg-box, .rg-box.scroll-box { display: block; max-height: 254px; margin: 0; padding: 0; border-radius: 12px; background: var(--field); list-style: none; overflow-y: auto; }
.rg-row { display: grid; gap: 0; padding: 9px 14px 8px; transition: background 0.12s; }
.rg-row + .rg-row { border-top: 1px solid var(--line-soft); }
.rg-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.rg-row-title .chip { flex: none; }
span.rg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-row-sub { display: flex; align-items: center; gap: 4px 10px; min-width: 0; min-height: 22px; font-size: 13px; color: var(--ink-2); }
span.rg-line { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity 0.15s; }
.rg-row.is-stale .rg-line { opacity: 0.55; }
/* On a phone a prompt's line wraps rather than cutting its cost off (2026-11-16: "usually $0.74, up to $41.98" ended in "usuall…"). */
@media (max-width: 640px) { span.rg-line { white-space: normal; overflow: visible; } }
.rg-row.is-problem .rg-row-sub { flex-wrap: wrap; }
.rg-row.is-problem .rg-line { flex-basis: auto; overflow: visible; white-space: normal; color: var(--danger); }
.rg-fix.rb-quiet { flex: none; height: 24px; padding: 0 8px; margin: 0 -8px 0 0; color: var(--accent-ink); font-size: 13px; }
.rg-row.is-problem .rg-fix.rb-quiet { margin-left: -4px; }
.rg-fix.rb-quiet:hover { background: var(--accent-soft); }
/* Reads: a field-coloured group of three ticks; each says in a few words what it reads. */
.rw-opts { display: grid; border-radius: 12px; background: var(--field); overflow: hidden; }
.rw-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px; border-radius: 0; background: transparent; cursor: pointer; }
.rw-opt + .rw-opt { border-top: 1px solid var(--line-soft); }
.rw-opt:hover { background: #efefec; }
.rw-opt.off { cursor: default; }
.rw-opt.off:hover { background: transparent; }
.rw-opt.off b { color: var(--ink-3); }
.rw-opt input { margin: 0; }
.rw-opt-text { display: grid; gap: 1px; min-width: 0; }
.rw-opt-text b { font-size: 13.5px; font-weight: 600; }
.rw-opt-text > span { font-size: 12.5px; color: var(--ink-2); }
.rw-opt-text > span .rb-quiet { height: 22px; padding: 0 6px; font-size: 12.5px; color: var(--accent-ink); }
.rw-opt-text > span a { color: var(--accent-ink); }
.rw-rules { min-height: 92px; width: 100%; resize: vertical; }
/* More control: opens in place; three folded cards, each a head with its title and its state. */
.rg-more-sec { gap: 10px; }
.rg-more-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.rg-more-toggle.disclose { margin: 0 -8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rg-more-head > span.rg-state { margin-left: auto; }
.rg-more-head > .rb-quiet { margin-right: -10px; height: 26px; }
.rg-more { display: grid; gap: 8px; }
.rg-card { border-radius: 12px; background: var(--field); overflow: hidden; }
.rg-card[hidden] { display: none; }
.rg-card-head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; cursor: pointer; transition: background 0.12s; }
.rg-card-head:hover { background: #efefec; }
.rg-card-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
span.rg-card-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rg-card-head span.rg-state { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-card-head .ph-chev { margin-left: 0; margin-right: 2px; }
.rg-card.open > .rg-card-head .ph-chev { transform: translateY(2px) rotate(-135deg); }
.rg-card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 6px 14px 16px; border-top: 1px solid var(--line-soft); }
.rg-card-body .rb-field + .rb-field { margin-top: 0; }
.rg-card-body .rb-sep { margin-top: 0; }
.rg-card-body .rb-checks .ctl-check { margin: 0 -8px; }
.rg-sub { display: flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.rg-sub > span { display: inline-flex; align-items: center; }
.rg-card-body textarea.code { min-height: 0; font-size: 12.5px; line-height: 1.5; }
.rg-card-body .rb-nums { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rg-card-body .rb-types { max-width: none; }
.rg-card[data-card="reviews"] > .rg-card-body { padding: 0; gap: 0; }
.rg-card .rb-tools { padding: 12px 14px; }
.rg-card .rb-more { padding: 0 14px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rg-card .rb-more > .field, .rg-card .rb-more > .rb-range { grid-column: auto; }
.rg-card .rb-more > .rb-more-check { grid-column: 1 / -1; margin-top: 0; }
.rg-card .rb-listhead { padding: 3px 14px; }
.rg-card .rb-row { padding: 0 14px; }
.rg-card .rb-none { padding: 18px 14px; }
.rg-reviews-list.scroll-box { max-height: 320px; }
.rg-card .rb-entry { grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.4fr) 82px 66px 14px; column-gap: 10px; }
.rg-card .rb-row > .rb-entry { grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.4fr) 82px 66px; }
.rg-unused .rb-fold { margin: 0; padding: 0 14px; border-top: 1px solid var(--line-soft); }
.rg-exact { margin: 0 -14px -16px; padding: 0 14px; }
.rg-exact-body { display: grid; gap: 8px; padding-bottom: 12px; }
.rg-exact-body h3 { margin: 6px 0 4px; }
.rg-card .ctl-pre { max-height: 280px; }
.rg-problem { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; margin: 0; font-size: 13px; line-height: 1.5; color: var(--danger); }
.rg-problem[hidden] { display: none; }
.rg-problem .rb-quiet, .rg-note .rb-quiet { height: 24px; padding: 0 8px; color: var(--accent-ink); }
.rg-problem span.rg-warn { align-self: center; }
.rg-note { margin: 0; }
@keyframes rg-flash { 0%, 45% { background-color: var(--danger-soft); box-shadow: 0 0 0 6px var(--danger-soft); } 100% { background-color: transparent; box-shadow: 0 0 0 6px transparent; } }
.rg-flash { border-radius: 8px; animation: rg-flash 1.8s ease-out; }
@media (prefers-reduced-motion: reduce) { .rg-flash { animation: none; background-color: var(--danger-soft); } }
/* The foot stays in the panel's reach: what the panel is doing, always said; then the cost and the budget at the left and the one button at the right. */
.rg-foot { position: sticky; bottom: 0; z-index: 2; flex: none; display: grid; gap: 6px; padding: 10px 18px 12px; background: var(--surface); border-top: 1px solid var(--line-soft); border-radius: 0 0 16px 16px; }
.rg-status { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; min-height: 24px; font-size: 13px; color: var(--ink-2); }
.rg-status .rb-quiet { height: 24px; padding: 0 8px; margin: 0 0 0 -4px; font-size: 13px; color: var(--accent-ink); }
.rg-status .rb-quiet:hover { background: var(--accent-soft); }
.rg-status span.rg-bad { display: inline-flex; align-items: center; font-weight: 500; }
span.rg-dot { color: var(--ink-3); }
.rg-foot-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rg-cost { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.rg-cost-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; min-height: 34px; }
span.rg-amount { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rg-cost-row .hint { margin-left: -6px; }
.rg-cost-row > .rb-quiet { height: 28px; padding: 0 8px; margin-left: -6px; font-size: 13px; }
.rg-typed { display: inline-flex; align-items: center; gap: 4px; }
.rg-typed input { width: 96px; height: 32px; padding: 0 8px; font-variant-numeric: tabular-nums; }
span.rg-dollar { color: var(--ink-2); font-size: 13.5px; }
.rg-typed .rb-quiet { height: 28px; padding: 0 8px; }
.rg-budget-problem { margin: 0; }
.rg-actions { flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rg-actions .hint { margin-left: 0; }
.rg-go { height: 36px; padding: 0 16px; white-space: nowrap; }
.rg-go:disabled:not(.working) { background: var(--field); color: var(--ink-2); box-shadow: none; opacity: 1; }
.rg-go.confirm { background: var(--ink); box-shadow: none; }
.rg-secondary.rb-quiet { height: 36px; }
@media (max-width: 860px) {
  .rw-panel.as-sheet { border-radius: 0; }
  /* Generate for many on a phone: the prompts are ticked in the list under the panel, so its foot stays at the window's foot. */
  .rw-panel:not(.as-sheet) .rg-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px -14px rgba(17, 17, 17, 0.22); }
  .rw-panel:not(.as-sheet) .rg-body { padding-bottom: 150px; }
  .rg-foot-row { flex-wrap: wrap; row-gap: 8px; }
  .rg-actions { flex: 1 1 100%; }
  .rg-actions .btn { flex: 1 1 auto; min-width: 0; height: 44px; }
  .rg-card .rb-more { grid-template-columns: minmax(0, 1fr); }
  .rg-card-body .rb-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rg-reviews-list.scroll-box { max-height: 260px; }
}

/* ================= A run's page (#/rubrics/runs/ID; public/rubric_runs.js) ================= */
/* The status page's family: a title that says where the run stands, who started it, the counts, then a row a prompt: `dot · title · state · actions` (the state and the actions under the title on a phone).
   The dot has a column of its own (20 px) and nothing else leads a line, so the title's words, the state's and the actions' stand on one edge; colour and the word carry the state. */
.rn-page { display: grid; gap: 14px; min-width: 0; max-width: 1000px; }
.rn-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.rn-main { flex: 1 1 320px; min-width: 0; }
.rn-main h1 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rn-sub { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.rn-sub a { color: var(--accent-ink); }
.rn-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.btn.rn-approve { height: 36px; padding: 0 16px; white-space: nowrap; }
.btn.rn-approve[hidden] { display: none; }
.btn.rn-approve.confirm { background: var(--ink); box-shadow: none; }
.btn.rn-approve.working { color: #fff !important; padding-left: 36px; }
.rn-status { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; min-height: 30px; font-size: 13.5px; color: var(--ink-2); }
.rn-status-text { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.rn-status-actions { display: inline-flex; align-items: center; gap: 2px; margin-right: -10px; }
.rn-status .rb-quiet { color: var(--accent-ink); }
.rn-status .rb-quiet:hover { background: var(--accent-soft); }
span.rn-bad { display: inline-flex; align-items: center; color: var(--danger); font-weight: 500; }
span.rn-bad[hidden], .rn-status .rb-quiet[hidden] { display: none; }
.rn-rows { margin: 0; padding: 0; list-style: none; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); overflow: hidden; }
/* The rows share one set of columns (Jay, 2026-11-15: the lower part of each row is a lot of empty space … redo the layout): the actions column is as wide as the widest row's actions, which stay on
   one line, and every row's title and state line up. Without subgrid each row sizes its own. */
/* The dot's column is auto: a subgrid row's padding counts as room around its first and last items, so a fixed 20 px column put the dot 2 px from the title. */
.rn-rows { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) max-content; column-gap: 12px; }
.rn-row { grid-column: 1 / -1; display: grid; grid-template-columns: 20px minmax(0, 1.4fr) minmax(0, 1fr) max-content; grid-template-columns: subgrid; align-items: start; column-gap: 12px; padding: 11px 18px 11px 16px; }
.rn-row + .rn-row { box-shadow: inset 0 1px 0 var(--line-soft); }
.rn-row[hidden] { display: none; }
.rn-dot { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.rn-name { min-width: 0; font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.rn-state { min-width: 0; font-size: 13.5px; line-height: 20px; color: var(--ink-2); overflow-wrap: anywhere; }
.rn-row.live .rn-state { color: var(--accent-ink); }
.rn-row.bad .rn-state { color: var(--danger); }
.rn-row[data-state="approved"] .rn-state { color: var(--ink); }
.rn-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; gap: 2px; min-height: 20px; margin: -5px -9px -5px 0; }
.rn-row-actions:empty { display: none; }
.rn-row-actions .rb-quiet { color: var(--accent-ink); }
.rn-row-actions .rb-quiet:hover { background: var(--accent-soft); }
.rn-row-actions .rn-approve-one { color: var(--ink-2); }
.rn-row-actions .rn-approve-one:hover { background: var(--hover); color: var(--ink); }
/* Read ⌄: the version's items under its row, read only, in a box of their own (at most 60% of the window; opening another closes this one). */
.rn-read { grid-column: 2 / -1; min-width: 0; max-height: 60vh; margin: 8px 0 2px; padding: 12px 14px; overflow-y: auto; overscroll-behavior: contain; border-radius: 10px; background: var(--field); }
.rn-read[hidden] { display: none; }
.rn-read-lead { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.rn-read-links { display: inline-flex; align-items: center; gap: 2px; margin-right: -9px; }
.rn-read-lead .rb-quiet { color: var(--accent-ink); }
.rn-read-lead .rb-quiet:hover { background: var(--accent-soft); }
.rn-read-lead .rb-quiet.confirm { color: var(--danger); }
/* Edit, where the version is read (Jay, 2026-11-14): the items as Rubrics edits them, on the box's soft ground; Save stays in sight at the box's foot while the items scroll. */
.rn-read.editing { padding-bottom: 0; }
.rn-read.editing .criterion + .criterion { border-top-color: var(--line); }
.rn-read.editing textarea.criterion-name:hover:not([readonly]):not(:focus) { background: var(--surface); box-shadow: 0 0 0 6px var(--surface); }
.rn-read .rb-foot { margin: 6px -14px 0; padding: 10px 14px; background: var(--field); border-top: 0; box-shadow: 0 -1px 0 var(--line-soft); }
.rn-read .rb-foot input { background: var(--surface); }
/* Setup, under its row (Jay, 2026-11-14: Setup should be able to open in place): a few lines on two columns, the names quiet; no rule between them. */
.rn-facts { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; line-height: 1.5; }
.rn-facts dt { color: var(--ink-3); }
.rn-facts dd { min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.rn-facts .rn-refs { color: var(--ink-3); }
.rn-facts .rn-refs a { color: var(--accent-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.rn-facts .rn-refs a:hover { text-decoration: underline; }
.rn-rules { white-space: pre-wrap; }
.rn-none { color: var(--ink-3); }
.rn-bad-text { color: var(--danger); }
.rn-facts .rn-instructions-button { height: 22px; margin: -2px 0 -2px -4px; padding: 0 6px; font-size: 13px; color: var(--accent-ink); vertical-align: baseline; }
.rn-facts .rn-instructions-button:hover { background: var(--accent-soft); }
.rn-instructions { display: grid; gap: 10px; margin-top: 12px; }
.rn-instruction-label { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.rn-instruction-text { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface); font: 12.5px/1.5 var(--mono, ui-monospace, monospace); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.rn-read-wait, .rn-read-bad { margin: 0; font-size: 13px; color: var(--ink-2); }
.rn-read-bad { color: var(--danger); }
.rn-read-bad .rb-quiet { color: var(--accent-ink); }
.rn-items { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
/* A version read under its groups and kinds (public/rubric_kinds.js): the group a heading with its "?", each kind a small heading with its own. */
.rn-groups { display: grid; gap: 22px; }
.rn-group { display: grid; gap: 12px; }
.rn-group + .rn-group { padding-top: 16px; border-top: 1px solid var(--line); }
.rn-group-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rn-kind { display: grid; gap: 8px; }
.rn-kind-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.rn-kind .rn-item-kind { display: none; }
/* Under its kind an item is its number, then its question, with the levels under the question. */
.rn-kind .rn-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 6px; }
.rn-kind .rn-item-head { grid-column: 1; margin: 0; padding-top: 1px; font-size: 13px; }
.rn-kind .rn-item > :not(.rn-item-head) { grid-column: 2; }
/* Under Criteria: the two groups of kinds, each with its "?" and its kinds' names. */
.rb-kind-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -2px 0 10px; font-size: 12.5px; color: var(--ink-3); }
.rb-kind-group { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.rb-kind-group-title { font-weight: 600; color: var(--ink-2); }
.rb-kind-group-kinds { min-width: 0; }
.rn-item { min-width: 0; }
.rn-item-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-size: 12px; color: var(--ink-3); }
.rn-item-n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.rn-item-kind { letter-spacing: 0.02em; }
.rn-item-q { margin: 0 0 4px; font-size: 14px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.rn-levels { display: grid; gap: 3px; margin: 0; }
.rn-level { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 10px; font-size: 13px; line-height: 1.45; }
.rn-level dt { color: var(--ink-3); }
.rn-level dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .rn-main h1 { font-size: 20px; }
  .rn-actions { flex: 1 1 100%; }
  .btn.rn-approve { flex: 1 1 auto; height: 44px; }
  /* The dot stays in its column at the first line; the state and the actions go under the title, on its text edge. */
  .rn-rows { display: block; }
  .rn-row { grid-template-columns: 20px minmax(0, 1fr); row-gap: 2px; padding: 11px 16px; }
  .rn-row-actions { flex-wrap: wrap; white-space: normal; }
  .rn-name, .rn-state, .rn-row-actions, .rn-read { grid-column: 2; }
  .rn-dot { grid-row: 1; }
  .rn-row-actions { justify-content: flex-start; margin: -2px 0 -9px -9px; }
  .rn-status-actions { margin: 0 0 0 -10px; }
  .rn-level { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .rn-facts { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .rn-read-links { margin: 0 0 0 -9px; }
  .rn-facts dd + dt { margin-top: 6px; }
}

/* ================= One prompt (the panel, and #/rubrics/<id>) ================= */
.rb-page { display: grid; gap: 22px; min-width: 0; }
.rb-page > .head { margin-bottom: -2px; }
/* The prompt: one card. Its text folds under its name; what there is of it beside; the test set at the right edge. */
.rb-prompt { min-width: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); }
.rb-prompt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 48px; padding: 9px 18px; }
.rb-brief-toggle.disclose { margin: 0 -8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.rb-facts { flex: 1 1 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-width: 0; font-size: 13px; }
.rb-facts > a, .rb-facts > .muted { font-size: 13px; color: var(--ink-2); }
.rb-facts > a:hover { color: var(--ink); }
.rb-facts-end { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-left: auto; }
.rb-facts .rubric-pieces { gap: 8px; }
.rb-facts .rubric-pieces .hint { margin-left: -2px; }
.rb-brief { margin: 0; padding: 2px 18px 18px; max-width: 76ch; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; color: var(--ink); }

/* Versions: the title, its state, and making a new one at the right edge. */
.rb-versions { display: grid; gap: 10px; min-width: 0; }
.rb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 32px; }
.rb-head h2 { margin: 0; font-size: 15px; }
.rb-head-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.rb-other.disclose { margin: 0; }
.rb-head .btn.small { height: 30px; padding: 0 13px; font-size: 13px; white-space: nowrap; }
/* The other ways to make one: a card of two-line rows. */
.rubric-make { margin: 0; }
.rubric-make[hidden] { display: none; }
.rubric-ways { display: grid; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); overflow: hidden; }
.rubric-ways .rubric-way { display: grid; gap: 1px; justify-items: start; width: 100%; height: auto; margin: 0; padding: 10px 18px; border: 0; border-radius: 0; box-shadow: none;
  background: transparent; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background 0.12s; }
.rubric-ways .rubric-way + .rubric-way { border-top: 1px solid var(--line-soft); }
.rubric-ways .rubric-way:hover { background: var(--hover); }
.rubric-ways .rubric-way:disabled { cursor: default; opacity: 0.6; }
.rubric-ways .rubric-way b { font-size: 14px; font-weight: 600; }
.rubric-ways .rubric-way span { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.draft-failed { margin: 8px 2px 0; }

/* A version: one line, folded. Its number, state and date keep their columns down the list. */
.rubric-versions { display: grid; gap: 8px; min-width: 0; }
.rubric-versions:empty { display: none; }
.rv-item { min-width: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); overflow: clip; }
.rv-fold { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px 12px; width: 100%; min-height: 48px; padding: 8px 18px; border-radius: 14px; cursor: pointer; transition: background 0.12s; }
.rv-fold.still { cursor: default; }
.rv-fold:not(.still):hover { background: var(--hover); }
.rv-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rv-fold .version-n { flex: none; min-width: 26px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.rv-fold .version-status { flex: none; min-width: 66px; font-size: 13px; color: var(--ink-2); }
.rv-fold .version-status.ok { color: var(--accent-ink); font-weight: 500; }
.rv-fold .rv-meta { min-width: 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rv-fold .rv-reader { flex: none; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.rv-fold .rv-reader.warn { color: var(--warn); font-weight: 500; }
.rv-fold .rv-reader.ok { color: var(--accent-ink); font-weight: 500; }
.rv-fold .ph-chev { flex: none; margin-left: auto; margin-right: 2px; transform: translateY(-2px) rotate(45deg); }
.rv-fold:hover .ph-chev { border-color: var(--ink); }
.rv-item.open > .rv-fold { border-radius: 14px 14px 0 0; }
.rv-item.open > .rv-fold .ph-chev { transform: translateY(2px) rotate(-135deg); }

/* The draft being written: the first row of the versions, with its state said and kept current (Queued, Generating 0:42, Not generated, Still waiting). */
.rb-generate { display: inline-flex; align-items: center; }
.rb-state.err, .rb-state .err { color: var(--danger); }
.rv-job { display: grid; gap: 1px; min-width: 0; padding: 8px 18px 11px; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); }
.rv-job-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; min-height: 32px; }
.rv-job .version-n { flex: none; min-width: 26px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
span.rv-job-state { display: inline-flex; flex-wrap: wrap; align-items: center; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.rv-job-state .spin { color: var(--accent-ink); }
span.rv-job-time { margin-left: 6px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rv-job-main > .rb-quiet { margin: 0 -10px 0 auto; color: var(--accent-ink); }
.rv-job-main > .rb-quiet:hover { background: var(--accent-soft); }
.rv-job-sub { margin-left: 38px; font-size: 13px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.rv-job.bad span.rv-job-state { color: var(--danger); }
.rv-job.bad .rv-job-sub { color: var(--ink); }
/* In the list: a prompt's Rubric cell while its draft is generating, and when it failed. */
span.rw-gen, span.rw-failed { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
span.rw-gen, span.rw-failed { white-space: nowrap; max-width: 100%; }
span.rw-gen.compact { justify-content: center; min-width: 26px; min-height: 22px; }
span.rw-gen { color: var(--accent-ink); }
.rw-pulse { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ag-pulse 1.4s ease-in-out infinite; }
span.rw-failed { color: var(--danger); }
span.rw-failed span.rg-warn { margin-right: 0; }
.rubric-list .sub.rw-why { margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

/* A version unfolded: about it, its criteria, its pieces. Lines part them. */
.rb-body { border-top: 1px solid var(--line-soft); }
.rb-part { min-width: 0; padding: 14px 18px 16px; }
.rb-part + .rb-part { border-top: 1px solid var(--line-soft); }
.rb-part[hidden] + .rb-part { border-top: 0; }
.rb-part-head { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 0 4px; }
.rb-part-head h3 { display: inline-flex; align-items: center; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rb-part-head > .rb-quiet { margin: 0 -10px 0 auto; }
.rb-part-head > .btn { margin-left: auto; height: 30px; padding: 0 13px; font-size: 13px; white-space: nowrap; }
.rb-add::before { content: "+"; font-size: 15px; font-weight: 400; line-height: 1; margin-top: -1px; }
.rb-about { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.rb-about:not(:has(.rb-made > *, .rb-checks > *, .rb-actions > *, .rb-note:not([hidden]))) { display: none; }
.rb-about:not(:has(.rb-made > *, .rb-checks > *, .rb-actions > *, .rb-note:not([hidden]))) + .rb-part { border-top: 0; }
.rb-about-main { flex: 1 1 240px; display: grid; gap: 6px; align-content: center; min-width: 0; min-height: 30px; }
.rb-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.rb-made:empty, .rb-checks:empty { display: none; }
.rb-made .prov-line { margin: 0; font-size: 13px; }
.rb-checks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
.rb-checks .linkish { font-size: 13px; }
/* Reader check: its label, where it stands in small text, one quiet button. No pill, no underline, nothing wider than its words. */
.rc-line { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; min-width: 0; min-height: 30px; }
.rc-label { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.rc-label .hint { margin-left: 6px; }
.rc-state { display: inline-flex; align-items: center; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.rc-state.warn { color: var(--warn); font-weight: 500; }
.rc-state.ok { color: var(--accent-ink); font-weight: 500; }
.rc-state.bad { color: var(--danger); font-weight: 500; }
.rc-state span.rg-warn { margin-right: 6px; }
.rc-state .spin { margin-right: 6px; }
.rc-act { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.rc-act .rb-quiet { height: 28px; padding: 0 8px; color: var(--accent-ink); }
.rc-act .rb-quiet:hover { background: var(--accent-soft); }
.rc-act select { width: auto; max-width: 100%; height: 30px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
/* Under the words on a phone, a button's own words line up with them (its padding is the 8px it is pulled left by). */
@media (max-width: 640px) { .rc-act { margin-left: -8px; } .rc-act select:first-child { margin-left: 8px; } }
.rb-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-left: auto; max-width: 100%; }
/* A version's next steps (Write with AI ›, Send for review ›) are links in the accent, among its plain-words actions. */
.rb-actions .rv-next { color: var(--accent-ink); }
.rb-actions .rv-next:hover { background: var(--accent-soft); }
.rb-actions:empty { display: none; }
.rb-actions .btn.small { height: 30px; margin-left: 6px; padding: 0 16px; font-size: 13px; }
/* A button that cannot be pressed yet says so quietly, not as a pale copy of the filled one. */
.rb-page .btn:disabled:not(.working) { background: var(--field); color: var(--ink-3); box-shadow: none; opacity: 1; }

/* The criteria: two lines an item. Its words; then its kind, what it lacks, what is behind it, and Remove at the right edge. */
.criteria { display: flex; flex-direction: column; }
/* Room between an item's words and the line under them, so the field's 7.5 px halo and focus ring never touch it (Jay, 2026-11-15: the edit view looks a bit crowded). */
.criterion { display: grid; gap: 10px; min-width: 0; padding: 16px 0; }
.criterion + .criterion { border-top: 1px solid var(--line-soft); }
textarea.criterion-name { display: block; width: 100%; min-height: 28px; margin: 0; padding: 3px 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none;
  color: var(--ink); font: 600 14.5px/1.5 var(--sans); letter-spacing: -0.005em; resize: none; overflow-wrap: anywhere; field-sizing: content; }
/* No box has a height of its own (Jay, 2026-11-13: all of it should be visible): the browser sizes it to its words; the old measuring (public/rubrics.js) only stands in where it cannot. */
@supports (field-sizing: content) { textarea.criterion-name, .criterion-body textarea { overflow: visible; } }
@supports not (field-sizing: content) { textarea.criterion-name { overflow: hidden; } }
p.criterion-name.read { margin: 0; padding: 3px 0; min-height: 28px; color: var(--ink); font: 600 14.5px/1.5 var(--sans); letter-spacing: -0.005em; overflow-wrap: anywhere; }
textarea.criterion-name::placeholder { font-weight: 500; }
/* The halo around the words is a shadow, not room: nothing in the criteria reaches past its column (no sideways overflow). */
textarea.criterion-name:hover:not([readonly]):not(:focus) { background: var(--field); box-shadow: 0 0 0 6px var(--field); }
textarea.criterion-name:focus { background: var(--surface); box-shadow: 0 0 0 6px var(--surface), 0 0 0 7.5px rgba(59, 130, 246, 0.55); }
/* Its tags wrap in their own column; Remove (and the count) stay at the right of the first line. */
.criterion-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; min-height: 28px; }
.criterion-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; min-width: 0; min-height: 28px; }
.criterion-end { display: flex; align-items: center; gap: 10px; min-height: 28px; }
span.criterion-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
span.criterion-count[hidden] { display: none; }
/* The kind reads as words with a caret, not a boxed field: it is the item's second line. */
select.criterion-kind { flex: none; width: auto; max-width: 100%; height: 26px; margin-left: -6px; padding: 0 22px 0 6px; border: 0; border-radius: 6px; background-color: transparent; background-position: right 6px center;
  color: var(--ink-2); font-size: 13px; font-weight: 500; line-height: 26px; field-sizing: content; }
select.criterion-kind:hover:not(:disabled) { background-color: var(--hover); color: var(--ink); }
select.criterion-kind:disabled { opacity: 1; cursor: default; background-image: none; padding-right: 6px; }
.criterion-meta .chip[hidden] { display: none; }
.criterion-meta .more-toggle { margin: 0 -8px; }
.criterion-remove.rb-quiet { height: 26px; margin: 0; padding: 0 0 0 8px; font-size: 12.5px; color: var(--ink-3); }
.criterion-remove.rb-quiet:hover { box-shadow: 8px 0 0 var(--danger-soft); }
.weight { display: flex; align-items: center; gap: 8px; flex: none; }
.weight .segs { padding: 2px; }
.weight .segs .seg { padding: 2px 9px; font-variant-numeric: tabular-nums; }
.weight .segs .seg:disabled { cursor: default; }
/* Behind an item: one grid, a name on the left and its field on the right, so every field shares both edges. */
.criterion-body { display: grid; gap: 8px; min-width: 0; margin: 8px 0 6px; }
.criterion-body[hidden] { display: none; }
.criterion-levels { display: grid; gap: 8px; }
.criterion-levels:empty { display: none; }
.criterion-sub { display: flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.criterion-body .field { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; }
.criterion-body .field > span { margin: 0; padding-top: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.criterion-body textarea { min-height: 36px; padding: 7px 11px; font-size: 13.5px; line-height: 1.5; field-sizing: content; overflow-wrap: anywhere; resize: none; }
/* Without the right to edit, a field is its words (an empty one is not there), never a box. */
.criterion-body p.note-text { min-width: 0; margin: 0; padding: 7px 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.criterion-rests { margin-left: 96px; font-size: 12.5px; color: var(--ink-2); }
.criterion-rests p { margin: 0; }
.rests-exceptions { margin: 4px 0 0; }
/* Saving, once there is something to save: it stays in sight under a long list of items. */
.rb-foot { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 10px -18px -16px; padding: 12px 18px; background: var(--surface);
  border-top: 1px solid var(--line-soft); }
.rb-foot input { flex: 1 1 auto; min-width: 0; height: 34px; }
.rb-foot .btn { flex: none; height: 34px; padding: 0 14px; white-space: nowrap; }
.rb-foot .rb-quiet { flex: none; height: 34px; }

/* The pieces judged with it: rows from edge to edge of the card, their words on its inset; a long list scrolls in its own box. */
.judged { padding-bottom: 6px; }
.judged > .rb-part-head { margin-bottom: 2px; }
.judged > .scroll-box { max-height: 330px; margin: 0 -18px; }
table.judged-table { min-width: 100%; }
table.judged-table th { padding-top: 7px; padding-bottom: 7px; }
table.judged-table td { padding-top: 9px; padding-bottom: 9px; }
table.judged-table th:first-child, table.judged-table td:first-child { padding-left: 18px; }
table.judged-table th:last-child, table.judged-table td:last-child { padding-right: 18px; }
table.judged-table tbody tr:last-child td { border-bottom: 0; }
table.judged-table tr.click { cursor: pointer; }
table.judged-table tr.click:hover td { background: var(--hover); }
table.judged-table td.primary { min-width: 150px; }
table.judged-table td.primary .line { display: flex; align-items: baseline; gap: 10px; }
table.judged-table td.primary .title { font-family: var(--mono, ui-monospace, monospace); font-size: 13px; font-weight: 500; white-space: nowrap; }
table.judged-table a.title { text-decoration: none; }
table.judged-table a.title:hover { text-decoration: underline; text-decoration-color: var(--line-2); }
table.judged-table td.primary .sub { margin: 0; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
table.judged-table th.crit { min-width: 104px; max-width: 168px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; vertical-align: bottom; }
table.judged-table td.strong { font-weight: 600; }
table.judged-table td.num, table.judged-table th.num { font-variant-numeric: tabular-nums; }
/* A judged piece opens: a thin chevron like every other toggle here, never a triangle (Jay 11-02). */
table.judged-table .chev { display: inline-block; flex: none; align-self: center; width: 6px; height: 6px; margin: 0 2px 2px 2px; border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform 0.15s; }
table.judged-table .chev.open { transform: rotate(45deg); }
table.judged-table .chev.none { visibility: hidden; }
table.judged-table tr.open td { background: var(--hover); }
table.judged-table td.disputed { color: var(--warn); font-weight: 500; white-space: nowrap; }
table.judged-table tr.calib-row > td { padding: 0; background: #fbfbfa; }

/* People checking the judge: a judged piece opens to each criterion's score and reason; your own first, then the judge's. */
.calib { display: flex; flex-direction: column; padding: 4px 18px 12px 38px; position: sticky; left: 0; width: var(--calib-w, auto); box-sizing: border-box; }
.calib-line { display: grid; grid-template-columns: minmax(130px, 200px) 28px minmax(0, 1fr) auto; column-gap: 16px; row-gap: 6px; align-items: baseline; padding: 12px 0; }
.calib-line + .calib-line { border-top: 1px solid var(--line-soft); }
.calib-crit { font-weight: 500; grid-row: span 2; }
.calib-score { font: 600 15px var(--sans); font-variant-numeric: tabular-nums; text-align: center; }
.calib-reason { color: var(--ink-2); font-size: 13px; line-height: 1.5; min-width: 0; }
.calib-reason blockquote { margin: 6px 0 0; color: var(--ink-2); font-style: italic; }
.calib-reason blockquote::before { content: "\201C"; }
.calib-reason blockquote::after { content: "\201D"; }
.calib-actions { justify-self: end; }
.calib-actions .segs .seg { padding: 4px 11px; font-size: 12.5px; }
.calib-mine { grid-column: 3 / -1; display: flex; align-items: center; gap: 10px; }
.calib-mine[hidden] { display: none; }
/* Your own score first: the form spans the line until the judge's is shown. */
.calib-mine.own-first { grid-column: 2 / -1; flex-wrap: wrap; }
.calib-mine .segs .seg { padding: 4px 10px; font-variant-numeric: tabular-nums; }
.calib-mine input[type=text] { flex: 1; min-width: 0; max-width: 360px; }
.calib-mine select { max-width: 280px; }
.calib-others { grid-column: 3 / -1; }
/* Beside the list the panel is narrow: one column. */
.rw-panel .calib-line { grid-template-columns: minmax(0, 1fr) 28px; }
.rw-panel .calib-crit { grid-row: auto; }
.rw-panel .calib-reason, .rw-panel .calib-mine, .rw-panel .calib-mine.own-first, .rw-panel .calib-others { grid-column: 1 / -1; }
.rw-panel .calib-mine { flex-wrap: wrap; }

@media (max-width: 860px) {
  .calib { padding: 4px 16px 12px; }
  .calib-line { grid-template-columns: minmax(0, 1fr) 28px; }
  .calib-crit { grid-row: auto; }
  .calib-reason, .calib-actions, .calib-mine, .calib-mine.own-first, .calib-others { grid-column: 1 / -1; }
  .calib-actions { justify-self: start; }
  .calib-mine { flex-wrap: wrap; }
  .calib-mine input[type=text] { flex-basis: 100%; max-width: none; }
}
@media (max-width: 640px) {
  /* A phone: every card on a 16px inset; a version's line is two (v3 and its state, then its date); a field's name stands over it. */
  .rb-page { gap: 18px; }
  .rw-body { padding: 14px 16px 24px; }
  .rw-head { padding-left: 16px; }
  .rb-prompt-head { padding: 9px 16px; }
  .rb-brief { padding: 2px 16px 16px; }
  .rb-facts-end { margin-left: 0; }
  .rubric-ways .rubric-way { padding: 10px 16px; }
  .rv-fold { flex-wrap: wrap; padding: 9px 16px; }
  .rv-fold .version-status { min-width: 0; }
  .rv-fold .rv-meta { order: 5; flex-basis: 100%; }
  .rb-part { padding: 12px 16px 14px; }
  .rv-job { padding-left: 16px; padding-right: 16px; }
  .rv-job-sub { margin-left: 38px; }
  .rb-foot { flex-wrap: wrap; margin: 10px -16px -14px; padding: 12px 16px; }
  .rb-foot input { flex: 1 1 100%; }
  .rb-foot .btn { margin-left: auto; }
  .judged > .scroll-box { margin: 0 -16px; }
  table.judged-table th:first-child, table.judged-table td:first-child { padding-left: 16px; }
  table.judged-table th:last-child, table.judged-table td:last-child { padding-right: 16px; }
  .criterion-body .field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .criterion-body .field > span { padding-top: 0; }
  .criterion-rests { margin-left: 0; }
  .rg-foot { padding-left: 16px; padding-right: 16px; }
}

/* ================= How a version was made, the ledger, reader checks ================= */
/* How a rubric version was made (public/rubric_provenance.js): one line, the facts behind Details. Shared by Prompt sets, Rubrics
   and Send's version choices; `hidden` hides the facts (style.css). */
.rubric-provenance { min-width: 0; }
.prov-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 2px 0 0; color: var(--ink-2); }
.prov-summary { overflow-wrap: anywhere; }
.prov-toggle { padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.prov-toggle:hover, .prov-toggle[aria-expanded="true"] { color: var(--ink); text-decoration-color: currentColor; }
.prov-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.made-from { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--ink-2); display: grid; gap: 3px; max-width: 64ch; overflow-wrap: anywhere; }
.made-from p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.made-from .prov-k { color: var(--ink-3); }
.made-from .err { color: var(--danger); }
@media (max-width: 860px) { .prov-toggle { min-height: 32px; } }
.made-questions { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 2px; }
/* Details opens in place: the fold toggle's look (public/style.css .disclose), not a link's underline. */
.prov-toggle.disclose { padding: 2px 7px; margin: -2px -7px; font-size: 12.5px; text-decoration: none; }
.prov-toggle.disclose:hover { text-decoration: none; }

/* The ledger (Greg's method, 2026-11-12) */
.ledger-page .ledger-group { margin-top: 14px; }
.ledger-page .ledger-group.empty { background: transparent; box-shadow: none; border: 1px dashed var(--line); padding: 18px 30px; }
.ledger-page .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ledger-page .section-head h2 { font-size: 15px; margin: 0; }
.ledger-obs { padding: 10px 0; border-top: 1px solid var(--line); }
.ledger-obs:first-child { border-top: 0; }
.ledger-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ledger-quote { margin: 6px 0 4px; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--ink-2); background: var(--field); border-radius: 0 8px 8px 0; }
.ledger-obs p { margin: 4px 0 0; }

/* Reader checks (public/reader_checks.js) */
.reader-check .rc-bar { justify-content: space-between; align-items: center; margin: 12px 0; flex-wrap: wrap; gap: 10px; }
.reader-check .rc-item { margin-top: 10px; }
.reader-check .rc-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.reader-check .rc-item-head b, .reader-check .rc-table td.primary { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.reader-check .rc-levels { display: grid; gap: 6px; }
.reader-check .rc-level { display: grid; grid-template-columns: auto 92px 1fr; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.reader-check .rc-level:hover { background: var(--field); }
.reader-check .rc-level.on { background: var(--field); box-shadow: var(--ring); }
.reader-check .rc-item input[type=text] { margin-top: 8px; width: 100%; }
.reader-check .rc-foot { justify-content: flex-end; gap: 12px; align-items: center; margin-top: 14px; }
.reader-check .rc-table td.rc-differ { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
/* A phone's list rows clear the last cell's padding (style.css); the marked cell keeps its own, so the mark never covers the text. */
.reader-check .panel.flush > table.cards.list.rc-table td.rc-differ { padding-left: 12px; }
.reader-check .rc-agree { margin: 0 0 10px; }
.reader-check .rc-table .rc-story { display: none; }
@media (max-width: 700px) { .reader-check .rc-table .rc-story { display: inline; } }
.reader-check .rc-decide { gap: 10px; margin-top: 14px; }
.reader-check .rc-decide input { flex: 1; min-width: 200px; }
@media (max-width: 640px) { .reader-check .rc-level { grid-template-columns: auto 1fr; } .reader-check .rc-level span { grid-column: 2; } }

/* Rubrics' list on a phone (Jay, 2026-11-15: why is every row so tall): a prompt's state (its version, Failed, None) on the right of its
   title instead of a line of its own, and a little less room around it. */
@media (max-width: 860px) {
  table.cards.list.rubric-list tr { padding: 10px 16px; row-gap: 2px; }
  .panel.flush > .scroll-box > table.cards.list.rubric-list tr > td.check, .panel.flush > table.cards.list.rubric-list tr > td.check, table.cards.list.rubric-list tr > td.check { margin: -10px 0 -10px -16px; }
  /* (as specific as style.css's rule that gives every other cell a line of its own, which it outranks) */
  table.cards.list.rubric-list tr:has(td.check) td.rubric-state:not(.check):not(.primary):not(.date), table.cards.list.rubric-list tr td.rubric-state:not(.check):not(.primary):not(.date) { grid-column: -2; grid-row: 1; justify-self: end; max-width: 42vw; }
  table.cards.list.rubric-list td.rubric-state .line { justify-content: flex-end; flex-wrap: wrap; }
}

/* A version's items while it is being edited (Jay, 2026-11-15: rubrics should be editable): each field shows as a field; outside editing they read as text. */
/* Only the item's own words get the halo; the fields under Details keep their own boxes, with space between them. */
.rb-editing textarea.criterion-name { background: var(--field); box-shadow: 0 0 0 6px var(--field); }
.rb-editing textarea.criterion-name:focus { background: var(--surface); box-shadow: 0 0 0 6px var(--surface), 0 0 0 7.5px rgba(59, 130, 246, 0.55); }

/* An item's exceptions in the editor: each its words and Remove on one line; Add an exception under them. */
.criterion-exceptions { display: grid; gap: 6px; margin-top: 8px; }
.criterion-exceptions .rests-exceptions { display: grid; gap: 6px; margin: 0; padding: 0; }
.criterion-exceptions li.exception { display: flex; align-items: flex-start; gap: 8px; }
.criterion-exceptions li.exception textarea { flex: 1 1 auto; min-width: 0; }
.criterion-exceptions .exception-add { justify-self: start; }

/* An item's words on a run's page: a click edits them, and they say so on hover. */
.rn-item-q.rn-editable { cursor: text; border-radius: 6px; }
.rn-item-q.rn-editable:hover { background: var(--field); box-shadow: 0 0 0 6px var(--field); }

/* Evidence under an item (public/rubric_evidence.js; Jay, 2026-11-15): the reviews it was drawn from, each with what the reviewer pointed out and their words, then its exceptions. */
.ev { display: grid; gap: 6px; margin-top: 4px; }
.ev-button { justify-self: start; max-width: 100%; font-size: 12.5px; color: var(--ink-2); text-align: left; white-space: normal; }
/* Under a question in Read: the line says why before anything opens. */
.rn-item .ev, .send-rubric-criteria .ev { margin: 2px 0 6px; }
.ev-prompt { font-size: 12.5px; color: var(--ink-3); }
/* The item's own why, a sentence, then what the reviews said under it. */
.ev-reason { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ev-reason-k { font-weight: 600; color: var(--ink); }
.criterion-tags .ev-button { margin: 0; }
.ev-box { display: grid; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--field); font-size: 13px; line-height: 1.45; }
.ev-box[hidden] { display: none; }
.criterion > .ev-box { margin-top: 6px; }
.ev-lead { margin: 0; color: var(--ink-2); }
.ev-review, .ev-exceptions { display: grid; gap: 4px; min-width: 0; }
.ev-review-head, .ev-sub { margin: 0; font-weight: 600; }
.ev-review-head .muted { font-weight: 400; }
.ev-points { display: grid; gap: 6px; margin: 0; padding-left: 12px; border-left: 2px solid var(--line); }
.ev-point { min-width: 0; overflow-wrap: anywhere; }
.ev-said { margin: 0; }
.ev-quote { margin: 3px 0 0; padding: 0; color: var(--ink-2); font-style: italic; }
.ev-quote::before { content: "“"; } .ev-quote::after { content: "”"; }
.ev-why { margin: 2px 0 0; }
.ev-rest { display: grid; gap: 10px; }
.ev-rest[hidden] { display: none; }
.ev-more { justify-self: start; }

/* The full-page editor (public/rubric_sheet.js; Jay, 2026-11-16: this page must look like editing, not fixed like it was): over the page, every item's fields open, each
   field a box with its edge showing, Save at the foot. */
body.rb-sheet-open { overflow: hidden; }
.rb-sheet { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; padding: 24px; background: rgba(17, 17, 17, 0.36); }
.rb-sheet-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1040px, 100%); height: 100%; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.rb-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); }
.rb-sheet-title { min-width: 0; }
.rb-sheet-kicker { margin: 0 0 2px; font-size: 12.5px; font-weight: 500; color: var(--accent-ink); }
.rb-sheet-head h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.rb-sheet-actions { display: flex; flex: none; align-items: center; gap: 16px; padding-top: 2px; }
.rb-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 28px; }
.rb-sheet-foot { padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.rb-sheet-foot .rb-foot { margin: 0; }
.rb-sheet .criterion { padding: 22px 0; }
.rb-sheet .more-toggle { display: none; }
.rb-sheet textarea.criterion-name { padding: 10px 12px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.rb-sheet textarea.criterion-name:hover:not(:focus) { background: var(--field); box-shadow: inset 0 0 0 1px var(--ink-3); }
.rb-sheet textarea.criterion-name:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px rgba(59, 130, 246, 0.25); }
.rb-sheet .criterion-body textarea, .rb-sheet .rb-foot input[type=text] { border-radius: 8px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.rb-sheet .criterion-body textarea:focus, .rb-sheet .rb-foot input[type=text]:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px rgba(59, 130, 246, 0.25); }
.rb-sheet select.criterion-kind { height: 30px; margin-left: 0; padding: 0 26px 0 10px; border-radius: 8px; background-color: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 640px) {
  .rb-sheet { padding: 0; }
  .rb-sheet-panel { border-radius: 0; }
  .rb-sheet-head, .rb-sheet-body, .rb-sheet-foot { padding-left: 16px; padding-right: 16px; }
}
/* Read says a click on an item edits the rubric. */
.rn-read-hint { font-size: 12.5px; color: var(--ink-3); }
.rn-read-from .rn-setup { margin: -6px 0 -6px 6px; vertical-align: baseline; }
.rn-read .rn-setup-box { margin: 0 0 12px; max-height: none; overflow: visible; background: var(--surface); box-shadow: var(--ring); }
.send-rubric-q.rn-editable { cursor: text; border-radius: 6px; }
.send-rubric-q.rn-editable:hover { background: var(--field); box-shadow: 0 0 0 4px var(--field); }

/* Under a rubric: what of the reviews no item uses, and the ledger (2026-11-16). */
.ev-unused { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.ev-unused .hint { margin-left: 4px; vertical-align: 1px; }
.ev-unused .ev-ledger { font-size: 12.5px; margin-left: 8px; padding: 0; min-height: 0; line-height: inherit; white-space: nowrap; }

/* The list's Test set mark is the way to where the test set is set (the prompt's page), and that box is marked for a moment on arrival. */
a.rw-held-link { text-decoration: none; cursor: pointer; }
a.chip.rw-held-link:hover, a.chip.chip-link:hover { background: var(--ink); color: var(--surface); }
a.chip.chip-link { text-decoration: none; cursor: pointer; }
a.rw-held-link:not(.chip) { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The test set's own page (public/testset.js): one line of what it holds, its prompts as a tight table, and the ways to add under it. */
.ts-page .head { margin-bottom: 6px; }
.ts-line { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.ts-page .panel.flush { margin-bottom: 12px; }
.ts-table td, .ts-table th { padding-top: 9px; padding-bottom: 9px; }
.ts-table td.num, .ts-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts-table .ts-title { color: var(--ink); text-decoration: none; font-weight: 500; }
.ts-table .ts-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.ts-table td.ts-act { text-align: right; white-space: nowrap; }
.ts-table tr.ts-asked > td { background: var(--field); box-shadow: inset 0 0 0 9999px rgba(47, 109, 240, .07); transition: box-shadow .6s; }
.ts-add { padding: 4px 18px 8px; }
.ts-add > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; }
.ts-add-random { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 13.5px; }
.ts-add-random input { width: 84px; }
.ts-add .search { width: 100%; margin-bottom: 6px; }
.ts-found { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.ts-found li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; padding: 7px 2px; border-top: 1px solid var(--line-soft); }
.ts-found-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .ts-table td.num, .ts-table td.ts-act { text-align: left; }
  .ts-page .panel.flush table.cards.list.ts-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; padding: 8px 16px; }
  .ts-page .panel.flush table.cards.list.ts-table td { display: block; padding: 0; font-size: 13px; }
  .ts-page .panel.flush table.cards.list.ts-table td.primary { flex: 1 1 100%; font-size: 14.5px; }
  .ts-add { padding: 4px 14px 8px; }
}
