/* Research setups: the same panels, fields and buttons as Send for review. (The step bar of the old setup pages is gone with them.) */


.ctl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 10px 0; }
.ctl-check { display: flex; align-items: flex-start; gap: 8px; min-height: 28px; }
.ctl-check input { margin-top: 3px; flex: none; }
.ctl-filters { margin: 8px 0 12px; }
.ctl-filters > summary, details.panel > summary { cursor: pointer; font-weight: 600; }
.ctl-rows { list-style: none; margin: 0; padding: 0; }
.ctl-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(17, 17, 17, 0.06); }
.ctl-row.off { opacity: 0.6; }
.ctl-row > input[type=checkbox] { margin-top: 4px; flex: none; }
.ctl-row-main { min-width: 0; flex: 1; display: grid; gap: 4px; }
.ctl-row .chip.warn, .chip.warn { background: #fff4e5; color: #8a4b00; }
/* A structured answer: each name beside what was answered, what is nested set in on a thin line. */
.ctl-answer { margin: 0; padding: 0; font-size: 13.5px; line-height: 1.5; }
dl.ctl-answer { display: grid; grid-template-columns: fit-content(180px) minmax(0, 1fr); gap: 6px 16px; }
.ctl-answer dt { font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding-top: 1px; text-transform: capitalize; overflow-wrap: anywhere; }
.ctl-answer dd { margin: 0; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ctl-answer dd > .ctl-answer { padding-left: 12px; border-left: 1px solid var(--line); white-space: normal; }
ol.ctl-answer { padding-left: 20px; display: grid; gap: 6px; }
.ctl-facts { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13.5px; }
.ctl-facts dt { color: var(--ink-2); }
.ctl-facts dd { margin: 0; overflow-wrap: anywhere; }
.ctl-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; background: #fbfbfa; padding: 12px; border-radius: 8px; max-height: 480px; overflow: auto; }
/* What the server refused (the other setup pages): the error colour on its head, no frame on the left (Jay, 2026-11-13). */
.ctl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ctl-card { display: grid; gap: 6px; margin: 0; color: inherit; text-decoration: none; }
.ctl-card:hover, .ctl-card:focus-visible { box-shadow: 0 0 0 1.5px rgba(59, 130, 246, 0.55), var(--shadow); }
@media (max-width: 640px) {
  .ctl-facts { grid-template-columns: 1fr; gap: 2px; }
  .ctl-facts dt { margin-top: 8px; font-size: 12.5px; }
  dl.ctl-answer { grid-template-columns: 1fr; gap: 2px; }
  .ctl-answer dt { margin-top: 6px; }
  .ctl-grid { grid-template-columns: 1fr; }
}

/* ---- Generate a human-assisted rubric (.rb-page; Jay, 2026-11-13) -------------------------------------------------------
   One pattern through its three steps. A card is one part: its head says what it is and, at the right, how many or in what
   state. Settings sit on one label column. A list scrolls in its own box (the reviews, to the window's bottom). The step's one
   framed button is its primary action, at the lower right; everything else is a quiet text button. What explains a thing is
   behind its "?". */
.rb-page .rb-card { padding: 18px 20px 20px; }
.rb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 0 0 14px; }
.rb-head h2 { margin: 0; }
.rb-head-lead { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rb-head-lead .rb-quiet { padding: 3px 8px; }
.rb-count { margin-left: 8px; color: var(--ink-3); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.rb-state { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.rb-state strong { color: var(--ink); font-weight: 600; }
.rb-warn { color: var(--warn); }
.rb-quiet { display: inline-flex; align-items: center; font: 500 13px/1.3 var(--sans); color: var(--ink-2); background: none; border: 0; padding: 6px 9px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; 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 { opacity: 0.45; cursor: default; background: none; }
.rb-sub { color: var(--ink-3); font-size: 12.5px; }
.rb-empty { margin: 0; padding: 18px 20px; border-radius: var(--radius-lg); background: rgba(17, 17, 17, 0.03); color: var(--ink-2); font-size: 13.5px; }
.rb-plain { list-style: none; margin: 0; padding: 0; }

/* The head: the page's name, the prompt under it (the way to its rubric), and the steps on the same line. */
.rb-top { align-items: flex-start; margin-bottom: 20px; }
.rb-prompt { margin: 4px 0 0; font-size: 14px; }
.rb-prompt a { color: var(--ink-2); text-decoration: none; }
.rb-prompt a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Inputs: the reviews beside the two cards that say what is read and what is told. In one column (a phone, a narrow window)
   the order is: what is read, the reviews, what is told, Next. */
.rb-inputs { display: flex; flex-direction: column; gap: 18px; }
.rb-inputs .panel { margin: 0; }
.rb-main, .rb-rail { display: contents; }
.rb-main > * { order: 2; }
.rb-rail > * { order: 3; }
.rb-rail > :first-child { order: 1; }
.rb-next .btn { width: 100%; min-height: 40px; }
.rb-kept { display: grid; gap: 8px; }
.rb-kept p { margin: 0 2px; }
@media (min-width: 1080px) {
  .rb-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); align-items: start; }
  .rb-main, .rb-rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .rb-inputs.fill-down > .rb-main { align-self: stretch; min-height: 0; }
  .rb-inputs.fill-down .rb-reviews { flex: 1 1 0; min-height: 380px; }
  .rb-inputs.fill-down .rb-reviews:has(.rb-more:not([hidden])) { min-height: 640px; }
  .rb-inputs.fill-down .rb-reviews .rb-rows.scroll-box { max-height: none; }
  .rb-inputs.fill-down .rb-pieces { flex: none; }
}
/* Between a phone and two columns the page scrolls as it is (lab.js sets a height on .fill-down for wide windows). */
@media (max-width: 1079px) { .rb-inputs.fill-down { height: auto !important; } }

/* A column of ticks: each a row that answers the pointer. */
.rb-checks { display: grid; gap: 1px; }
.rb-checks .ctl-check { align-items: center; gap: 10px; min-height: 32px; margin: 0 -8px; padding: 2px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.rb-checks .ctl-check input { margin-top: 0; }
.rb-checks .ctl-check:has(input:disabled) { color: var(--ink-3); cursor: default; }
@media (hover: hover) { .rb-checks .ctl-check:not(:has(input:disabled)):hover { background: var(--hover); } }
.rb-sep { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
/* A name and its small field on one line. */
.rb-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 36px; font-size: 13.5px; }
.rb-line + .rb-line { margin-top: 8px; }
.rb-line > span { display: flex; align-items: center; }
.rb-line input[type=number] { justify-self: end; width: 76px; }
.rb-line select, .rb-line input { height: 36px; padding-top: 0; padding-bottom: 0; }
.rb-line select { width: 150px; }

/* The reviews: head, filters, the line that selects all, and the rows in their own box. */
.rb-page .rb-reviews { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.rb-reviews > .rb-head { margin: 0; padding: 18px 20px 14px; }
.rb-tools { display: flex; align-items: center; gap: 8px; padding: 0 20px 14px; }
.rb-tools > input, .rb-tools > select { height: 36px; padding-top: 0; padding-bottom: 0; }
.rb-tools > .rb-search { flex: 1 1 140px; width: auto; min-width: 132px; }
.rb-tools > select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 200px; }
.rb-tools > .disclose { flex: none; margin: 0 0 0 4px; padding: 7px 9px; }
.rb-more { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; padding: 2px 20px 16px; }
.rb-more > .field { grid-column: span 2; }
.rb-more > .rb-range { grid-column: span 3; }
.rb-more > .rb-more-check { grid-column: 4 / span 3; margin-top: -6px; }
.rb-more input:not([type=checkbox]), .rb-more select { height: 36px; padding-top: 0; padding-bottom: 0; }
.rb-range > span { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.rb-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.rb-dash { color: var(--ink-3); }
.rb-more-check .ctl-check { align-items: center; min-height: 36px; font-size: 13.5px; }
.rb-more-check .ctl-check input { margin-top: 0; }
/* A day: the browser's date field as one of the page's fields. Empty and at rest it says From or To; the whole field opens the calendar. */
.rb-day { position: relative; display: block; min-width: 0; }
.rb-page input[type=date] { display: block; width: 100%; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: 10px; background: var(--field);
  color: var(--ink); font: 14px/1.4 var(--sans); font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.rb-page input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.rb-page input[type=date]::-webkit-datetime-edit { padding: 0; }
.rb-day.unset input:not(:focus), .rb-day.unset input:not(:focus)::-webkit-datetime-edit { color: transparent; }
.rb-day-ph { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; pointer-events: none; display: none; }
.rb-day.unset:not(:focus-within) .rb-day-ph { display: block; }

.rb-listhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 3px 20px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); font-size: 13px; }
.rb-all { display: inline-flex; align-items: center; gap: 12px; min-height: 32px; cursor: pointer; }
.rb-listhead-actions { display: inline-flex; align-items: center; gap: 2px; margin-right: -9px; }
.rb-rows { list-style: none; margin: 0; padding: 0; }
.rb-reviews .rb-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.rb-row { display: flex; align-items: flex-start; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); transition: background 0.1s; }
.rb-row:last-of-type { border-bottom: 0; }
.rb-row > input[type=checkbox] { margin-top: 12px; }
.rb-row > details, .rb-row > .rb-entry { flex: 1 1 auto; min-width: 0; }
.rb-row > .rb-entry { padding: 10px 0; }
.rb-row > details > summary { display: block; padding: 10px 0; color: var(--ink); font-weight: 400; }
.rb-row > details > summary::after { display: none; }
.rb-row > details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
@media (hover: hover) { .rb-reviews .rb-row:not(.off):hover { background: var(--hover); } }
.rb-row.off { color: var(--ink-3); }
.rb-none { padding: 22px 20px; color: var(--ink-2); font-size: 13.5px; }
.rb-bounded { margin: 0; padding: 10px 20px; border-top: 1px solid var(--line-soft); }

/* A source in two lines, on one grid so every row's parts line up: its kind over its batch, the reviewer over the piece, the day
   over the review time, the length; the mark that it opens. */
.rb-entry { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.25fr) 86px 68px 14px; column-gap: 14px; row-gap: 1px; align-items: baseline; font-size: 13.5px; line-height: 1.45; }
.rb-row > .rb-entry { grid-template-columns: minmax(150px, 1fr) minmax(0, 1.25fr) 86px 68px; }
.rb-l1, .rb-l2 { display: contents; }
.rb-entry > * > span, .rb-refused > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-kind { grid-column: 1; grid-row: 1; font-weight: 500; }
.rb-who { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px; }
.rb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-who .chip { flex: none; padding: 1px 8px; font-size: 11.5px; }
.rb-date { grid-column: 3; grid-row: 1; text-align: right; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.rb-len { grid-column: 4; grid-row: 1; text-align: right; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.rb-batch, .rb-piece, .rb-time { grid-row: 2; color: var(--ink-3); font-size: 12.5px; }
.rb-batch { grid-column: 1; }
.rb-piece { grid-column: 2; }
.rb-time { grid-column: 3; text-align: right; font-variant-numeric: tabular-nums; }
.rb-chev { grid-column: 5; grid-row: 1 / span 2; align-self: center; justify-self: end; position: relative; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; overflow: visible !important; }
details[open] > summary .rb-chev { transform: translateY(2px) rotate(-135deg); }
.rb-refused .rb-why { grid-column: 2 / -1; white-space: normal; font-size: 12.5px; }
.rb-answer { margin: 0 0 14px; padding: 12px 14px 14px; border-radius: 10px; background: var(--field); cursor: auto; }
.rb-answer-facts { margin: 0 0 10px; color: var(--ink-3); font-size: 12.5px; }
.rb-answer-facts p { margin: 0; }
.rb-readonly.scroll-box { max-height: 360px; }
.rb-readonly .rb-row { padding: 0; }
.rb-readonly .rb-row > .rb-entry { grid-template-columns: 230px minmax(0, 1fr) 86px 68px; }
.rb-pieces .scroll-box { max-height: 196px; }
.rb-pieces .rb-sub { margin-left: 8px; }
.rb-unused { max-height: 360px; display: grid; gap: 12px; padding-bottom: 14px; }
.rb-unused h3 { margin: 0 0 4px; }
.rb-unused li { padding: 3px 0; color: var(--ink-2); font-size: 13px; }
.rb-prompts .rb-plain { margin: 0 -8px; }
.rb-prompt-row { display: grid; gap: 1px; padding: 9px 8px; border-radius: 8px; text-decoration: none; }
.rb-prompt-row .rb-name { font-weight: 500; }
@media (hover: hover) { .rb-prompt-row:hover { background: var(--hover); } }

/* Method: each setting's name on the left column, its control beside it. */
.rb-method .panel { margin-bottom: 18px; }
/* Labels in a column just wide enough for "Writing request" (Jay, 2026-11-15: it feels a bit empty). */
.rb-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 20px; align-items: start; }
.rb-field + .rb-field { margin-top: 14px; }
.rb-label { display: grid; justify-items: start; gap: 4px; padding-top: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.rb-label > span { display: flex; align-items: center; }
.rb-label .rb-quiet { margin-left: -9px; font-weight: 500; color: var(--accent-ink); }
.rb-control { min-width: 0; }
.rb-control > select, .rb-control > input, .rb-inline { max-width: 460px; }
/* A menu as wide as its choices, and its box visible on a grey card as on a white one, so its edge lines up with the ticks under it (Jay, 2026-11-15: not aligned). */
.rb-control > select { width: auto; min-width: 200px; max-width: min(100%, 360px); box-shadow: inset 0 0 0 1px var(--line); }
.rb-control > textarea { display: block; }
.rb-page textarea.code { min-height: 0; }
.rb-inline { display: flex; align-items: center; gap: 6px; }
.rb-inline input { flex: 1 1 auto; min-width: 0; }
.rb-hosts { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-top: 2px; }
.rb-plainvalue { margin: 0; padding-top: 8px; }
.rb-page details.rb-advanced > summary { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.rb-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; max-width: 760px; align-items: end; }
.rb-nums-note { margin: 0; align-self: center; }
.rb-types { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px 16px; max-width: 760px; }
.rb-types .ctl-check span::first-letter { text-transform: uppercase; }
.rb-notoffered { margin: 14px 0 0; }
.rb-tipword { border-bottom: 1px dotted var(--ink-3); cursor: help; }

/* Preview: the counts first, then what was resolved; the long parts fold under each card. */
.rb-wait { display: flex; align-items: center; margin: 24px 2px; }
.rb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 2px 0 18px; }
.rb-stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rb-stat span { color: var(--ink-2); font-size: 12.5px; }
.rb-stat.zero b { color: var(--ink-3); font-weight: 500; }
.rb-preview .rb-card { margin-bottom: 18px; }
.rb-preview .ctl-facts { max-width: 860px; }
.rb-fold { margin: 0 -20px; padding: 0 20px; border-top: 1px solid var(--line-soft); }
.rb-card > :not(.rb-fold) + .rb-fold { margin-top: 18px; }
.rb-fold > summary { padding: 12px 0; font-size: 13.5px; }
.rb-fold[open] { padding-bottom: 14px; }
.rb-fold h3:first-of-type { margin-top: 2px; }
.rb-page .rb-card:has(> .rb-fold:last-child) { padding-bottom: 0; }

/* A step's foot: back at the left; what the action makes, then the action, at the right. */
.rb-foot { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; }
.rb-foot > .rb-quiet:first-child { margin-left: -9px; }
.rb-foot .rb-status { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--ink-2); font-size: 13px; }
.rb-foot .btn { min-height: 40px; padding-left: 18px; padding-right: 18px; }

@media (max-width: 860px) {
  .rb-top { margin-bottom: 16px; }
  .rb-inputs { gap: 14px; }
  .rb-quiet { min-height: 40px; }
  .rb-next .btn, .rb-foot .btn { min-height: 46px; }
  .rb-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-more > .field, .rb-more > .rb-range { grid-column: auto; }
  .rb-more > .rb-more-check { grid-column: 1 / -1; margin-top: 0; }
  .rb-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
  .rb-page input[type=date], .rb-tools > input, .rb-tools > select, .rb-more input:not([type=checkbox]), .rb-more select, .rb-line select, .rb-line input { height: 44px; }
  .rb-day-ph { font-size: 16px; }
  .rb-foot { flex-wrap: wrap; }
  .rb-foot .rb-status { flex: 1 1 100%; order: -1; text-align: left; }
  .rb-foot .btn { flex: 1 1 auto; }
  .rb-row > input[type=checkbox] { margin-top: 13px; }
}
@media (max-width: 640px) {
  .rb-page .rb-card { padding: 16px; }
  .rb-page .rb-reviews { padding: 0; }
  .rb-reviews > .rb-head { padding: 16px 16px 12px; }
  .rb-tools { flex-wrap: wrap; padding: 0 16px 12px; }
  .rb-tools > .rb-search { flex-basis: 100%; }
  .rb-tools > select { flex: 1 1 0; max-width: none; min-width: 0; }
  .rb-tools > .disclose { margin-left: -6px; }
  .rb-more { grid-template-columns: minmax(0, 1fr); padding: 0 16px 14px; }
  .rb-listhead, .rb-row, .rb-none, .rb-bounded { padding-left: 16px; padding-right: 16px; }
  .rb-readonly .rb-row { padding: 0; }
  .rb-pieces .ctl-check > span { display: grid; }
  .rb-pieces .rb-sub { margin-left: 0; }
  .rb-fold { margin: 0 -16px; padding: 0 16px; }
  /* A phone's two lines: what it is and who; then its day, its length and the piece. Its batch and review time are in the answer's facts. */
  .rb-entry, .rb-row > .rb-entry { display: block; position: relative; padding-right: 22px; }
  .rb-row > .rb-entry { padding-right: 0; }
  .ctl-page .rb-row > details > summary { min-height: 0; padding: 11px 0; line-height: 1.45; white-space: normal; }
  .rb-l1, .rb-l2 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .rb-l2 { margin-top: 2px; gap: 6px; }
  .rb-kind, .rb-date, .rb-len { flex: none; }
  .rb-who { flex: 1 1 auto; min-width: 0; }
  .rb-piece { flex: 1 1 auto; min-width: 0; }
  .rb-date, .rb-len, .rb-piece { color: var(--ink-3); font-size: 12.5px; text-align: left; }
  .rb-len::before, .rb-piece::before { content: "·"; margin-right: 6px; }
  .rb-batch, .rb-time { display: none; }
  .rb-chev { position: absolute; right: 2px; top: 50%; margin-top: -5px; }
  .rb-row > .rb-refused { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rb-refused .rb-why { grid-column: auto; }
  .rb-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .rb-label { padding-top: 0; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: stretch; }
  .rb-control > select, .rb-control > input, .rb-inline { max-width: none; }
  .rb-inline { flex-wrap: wrap; }
  .rb-hosts, .rb-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 12px; }
}

/* ======================================================================================================================================
   Setup panels (public/setup_panel.js; Write with AI, Judge pieces, Prepare guidance) and Setup and results (public/setup_status.js).
   The panels reuse the Generate rubric panel's `rg-*` classes (rubrics.css) as they are; what is here is what the others add. (Jay, 2026-11-13)
   ====================================================================================================================================== */
/* Beside Samples' list, in the aside the prompt's page uses: it scrolls as one panel with its foot kept in reach. */
.sp-layout.with-detail > .sp-detail.rw-panel { padding: 0; overflow-y: auto; overscroll-behavior: contain; }
/* Beside the list, after it, at every width (the rule that puts Generate rubrics above its list is not this panel's). */
.sp-layout > .sp-detail.rw-panel { order: 0; }
@media (max-width: 860px) {
  .sp-layout.with-detail > .sp-detail.rw-panel { z-index: 60; }
  /* The sheet has its own foot: the bar of what to do with the ticked pieces would stand over it. */
  body:has(.sp-detail.rw-panel.as-sheet) .selectionbar { display: none; }
  /* Generate pieces: Write with AI is the page's own, under the list (the prompts are ticked there), its foot at the window's foot (rubrics.css). */
  .sp-layout.with-detail > .sp-detail.rw-panel.in-page { position: static; inset: auto; z-index: auto; animation: none; margin-top: 16px; border-radius: 16px; overflow: visible; }
  /* Its list shows as many prompts as fit above that foot. */
  .sp-layout:has(> .sp-detail.in-page) > .sp-list .scroll-box.tall { max-height: calc(100vh - 290px); min-height: 280px; }
  /* Brought into view by Write with AI's steps: just under the page's sticky tabs. */
  .sp-layout:has(> .sp-detail.in-page) > .sp-list { scroll-margin-top: 76px; }
}
/* A piece, a review: its ✕ at the end of its first line, quiet. */
.rg-x { margin-left: auto; flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0 0 2px; border: 0; border-radius: 6px; background: transparent; box-shadow: none;
  color: var(--ink-3); font: 400 18px/1 var(--sans); cursor: pointer; transition: background 0.12s, color 0.12s; }
.rg-x:hover { background: var(--hover); color: var(--ink); }
.rg-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rg-row-title { min-height: 24px; }
span.rg-name { flex: 1 1 auto; }
.rg-row-sub .hint { margin-left: 4px; }
/* "Change in the list" is for the phone's sheet: the list is beside the panel everywhere else. */
.rg-change { display: none; }
@media (max-width: 860px) { .rg-change { display: block; margin: -2px 0 0 -8px; } }
.rg-row-sub .rg-line { flex: 0 1 auto; }
/* On the phone a piece's name has room for two lines, so its writer (what tells one piece of a prompt from the next) is not cut off. */
@media (max-width: 860px) {
  .rw-panel:is(.is-write, .is-judge) .rg-row-title { align-items: flex-start; }
  .rw-panel:is(.is-write, .is-judge) span.rg-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; padding: 1px 0; }
}
/* A review's role is a choice, so it keeps the select's chevron: only the ground changes (the `background` shorthand would take the arrow away). */
.rg-role { flex: none; margin-left: auto; height: 26px; padding: 0 22px 0 8px; border: 0; border-radius: 8px; background-color: var(--surface); background-position: right 7px center; font: 500 12.5px/1 var(--sans); color: var(--ink-2); }
/* On the phone every field's text is 16px (style.css), so the role is a field tall enough for it. */
@media (max-width: 860px) { .rg-role { height: 36px; padding-right: 28px; background-position: right 10px center; } }
.rg-fixed { font-size: 13.5px; color: var(--ink); }
/* Method: a choice of rows; the baseline under them; with guidance one locked row. */
.rg-baseline { padding: 2px 4px 0; }
/* What it writes from, as steps (Jay, 2026-11-14: "cascaded selection"): 1 Rubrics, 2 Traces as thinking, 3 Model and the rest. A step is a soft block; folded it is one
   line, its number, name and what was chosen; open, what it holds under that line. Write with AI and Generate pieces draw them alike. */
.rg-steps { display: grid; gap: 6px; }
.rg-step { border-radius: 12px; background: var(--field); overflow: hidden; }
.rg-step-head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 14px; cursor: pointer; transition: background 0.12s; }
.rg-step-head:hover { background: #efefec; }
.rg-step-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.rg-step-head.as-line { cursor: default; }
.rg-step-head.as-line:hover { background: transparent; }
.rg-step-n { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); color: var(--ink-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rg-step.open .rg-step-n { background: var(--ink); color: var(--surface); }
/* Step 1, the prompts: always in view (they are ticked in the list beside), so its number is lit. */
.rg-step-title-row { display: inline-flex; align-items: center; gap: 8px; }
.rg-step-title-row .rg-step-n { background: var(--ink); color: var(--surface); }
.rg-step-title { flex: none; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.rg-step-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 13px; color: var(--ink-2); }
.rg-step.open .rg-step-sum { visibility: hidden; }
.rg-step-head .ph-chev { margin-left: 0; margin-right: 2px; }
.rg-step.open > .rg-step-head .ph-chev { transform: translateY(2px) rotate(-135deg); }
.rg-step-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 2px 14px 14px; }
.rg-step-body[hidden] { display: none; }
.rg-step-body > select { width: 100%; min-width: 0; background-color: var(--surface); }
/* Step 1: each ticked prompt and the version its pieces are written from; a prompt left out greyed, with why. */
.rg-rubric-lines { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rg-rubric-lines[hidden] { display: none; }
.rg-rubric-lines li { display: flex; align-items: baseline; gap: 12px; min-height: 26px; font-size: 13px; }
.rg-rubric-prompt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rg-rubric-version { flex: none; color: var(--ink-2); }
.rg-rubric-lines li.off .rg-rubric-prompt, .rg-rubric-lines li.off .rg-rubric-version { color: var(--ink-3); }
.rg-trace-note { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.rg-trace-note[hidden], .rg-reset[hidden] { display: none; }
.rg-step .rg-card { background: var(--surface); }
.rg-step .rg-card-head:hover { background: rgba(17, 17, 17, 0.03); }
.rg-reset { display: flex; justify-content: flex-end; }
.rg-reset .rb-quiet { margin-right: -8px; }
@media (max-width: 860px) { .rg-step-head { min-height: 52px; } .rg-rubric-lines li { min-height: 32px; } }
/* An exact version of the method, under it, with the way back to the newest. */
.rg-version { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0; color: var(--ink-2); font-size: 13px; }
.rg-version[hidden] { display: none; }
.rg-version b { font-weight: 500; color: var(--ink); }
.rg-version .rb-quiet { margin-left: -4px; }
/* The trace a method writes from, under the methods (Jay, 2026-11-14): its name on the left, the choice beside it. */
.rg-trace-src { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; margin: 10px 4px 0; }
.rg-trace-src[hidden] { display: none; }
.rg-trace-src-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
/* A step's options as rows (never a menu): a group's name over its options. */
.rg-pick { margin-bottom: 8px; }
.rg-pick-group { padding: 10px 14px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.rg-pick .rw-opt.off { opacity: .55; }
.rg-baseline .ctl-check { min-height: 32px; align-items: center; font-size: 13.5px; }
.rg-baseline .hint { margin-left: 2px; }
.rw-opt.locked { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--field); cursor: default; }
.rw-opt.locked[hidden] { display: none; }
.rw-opt.locked.is-problem .rw-opt-text > span { color: var(--danger); }
.rw-opts[hidden] { display: none; }
/* Traces: a version for each piece that has more than one, each earlier stage's own settings, new traces for all. */
.rg-traces { display: grid; gap: 12px; }
.rg-traces:empty { display: none; }
/* A piece's version: its name above the choice (a name is too long for the label column). */
.rb-field.rg-ver { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.rg-stages { display: grid; gap: 6px; }
.rg-stage { margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.rg-stage > summary { padding: 10px 0; }
.rg-stage .rb-field { margin: 8px 0; }
.rg-regen { display: flex; }
.rg-regen .rb-quiet { margin-left: -9px; }
.rg-fields { border-radius: 12px; background: var(--field); }
.rg-fixed { display: inline-flex; align-items: center; min-height: 32px; }
.rg-for a { color: var(--accent-ink); }

/* ---- Setup and results: where a launch lands ---- */
.ss-page { display: grid; gap: 12px; max-width: 980px; min-width: 0; }
.ss-back { justify-self: start; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.ss-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ss-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ss-head h1 { margin: 0; font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.ss-actions { flex: none; display: flex; gap: 4px; }
.ss-sub { margin: -4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.ss-counts { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; min-height: 30px; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-counts.bad, .ss-bad, .ss-note.bad { color: var(--danger); }
.ss-bad { display: inline-flex; align-items: center; font-weight: 500; }
.ss-counts .rb-quiet, .ss-row .rb-quiet { height: 26px; padding: 0 8px; color: var(--accent-ink); }
.ss-counts .rb-quiet:hover, .ss-row .rb-quiet:hover { background: var(--accent-soft); }
.ss-notes { display: grid; gap: 2px; }
.ss-note { display: flex; align-items: center; margin: 0; font-size: 13px; }
.ss-unavailable { margin: 0; font-size: 13px; color: var(--ink-2); }
.ss-rows { margin: 4px 0 0; padding: 0; list-style: none; background: var(--surface); border-radius: 14px; box-shadow: var(--ring); overflow: hidden; }
/* A state may be a whole sentence (a failure's reason): it wraps in its own column and never takes the piece's name down to a sliver. */
.ss-row { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(52%); align-items: center; gap: 4px 18px; padding: 10px 18px; min-height: 52px; }
.ss-row + .ss-row { border-top: 1px solid var(--line-soft); }
.ss-title { min-width: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ss-states { display: grid; gap: 2px; justify-items: end; min-width: 0; }
.ss-state { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; min-height: 26px; font-size: 13.5px; color: var(--ink-2); }
.ss-state[data-kind="done"], .ss-state[data-kind="ready"] { color: var(--ink); }
.ss-state[data-kind="running"] .ss-state-text { color: var(--accent-ink); }
.ss-state-text.bad { color: var(--danger); display: inline-flex; align-items: center; }
.ss-state-text .spin { margin-right: 6px; }
.ss-label { margin-right: 6px; font-size: 12.5px; color: var(--ink-3); }
.ss-time { font-variant-numeric: tabular-nums; }
.ss-done { display: flex; padding-top: 4px; }
.ss-done[hidden] { display: none; }
.ss-exact { margin-top: 8px; }
.ss-exact-body { display: grid; gap: 12px; padding: 4px 0 12px; }
.ss-run { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; font-size: 13.5px; }
@media (max-width: 860px) {
  .ss-row { grid-template-columns: minmax(0, 1fr); }
  .ss-states { justify-items: start; }
  .ss-state { justify-content: flex-start; }
  .ss-head h1 { font-size: 21px; }
}
.ss-guidance-body { background: var(--surface); border-radius: 14px; box-shadow: var(--ring); padding: 16px 18px; }
.ss-text { margin: 0; max-height: none; }
.ss-wait { display: grid; gap: 4px; font-size: 14px; }
.ss-wait .spin { margin-right: 6px; }
.ss-wait.bad p { margin: 0; }
.ss-editor { width: 100%; min-height: 240px; }
.ss-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ss-guidance-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ss-guidance-actions .btn.disabled { pointer-events: none; opacity: 1; background: var(--field); color: var(--ink-2); box-shadow: none; }
.ss-guidance-actions .ss-note { flex-basis: 100%; }
.ss-versions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.ss-ver.on { padding: 0 8px; font-size: 13px; font-weight: 600; }


/* Texts per prompt (no trace): a short number beside its name, under the Prompts step's head. */
.rg-per-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 6px 0 2px; font-size: 13px; }
.rg-per-prompt label { display: inline-flex; align-items: center; gap: 8px; }
.rg-per-prompt[hidden] { display: none; }
.rg-per-prompt input { width: 64px; }
.rg-per-prompt input[aria-label="Length in words"] { width: 108px; }

/* Step 4: the model's fields at once (no card head, no frame). */
.rg-card.rg-card-flat { background: none; border: 0; box-shadow: none; padding: 0; }
.rg-card.rg-card-flat > .rg-card-head { display: none; }
.rg-card.rg-card-flat > .rg-card-body { padding: 4px 0 0; border: 0; }
.rg-trace-extras .rg-card { margin-top: 8px; }
.rg-trace-list { max-height: 300px; overflow: auto; }
.rg-rest { margin-top: 6px; }
.rg-rest > summary { font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 6px 0; }

/* Write with AI, step 4: a member's own writing scripts, each a way out to a run of it. */
.rg-own-scripts { margin: 10px 2px 2px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
