/* Atlas — slide job runner. Cool neutral layers, near-black type, crisp
   hairlines, one indigo accent, compact tactile controls. Matches the
   labelling tool's skin. */

:root {
  color-scheme: light;
  /* Cool grey canvas, white data surfaces, neutral hairlines, one indigo
     brand accent. Panels are flat; controls carry a small physical edge. */
  --paper: #f6f6f8;          /* working canvas */
  --canvas: #ffffff;         /* navigation plane (masthead) */
  --surface: #ffffff;        /* data surfaces */
  --surface-soft: #eeeef4;
  --surface-card: #ffffff;
  --surface-accent: rgba(79, 70, 229, 0.10);
  --ink: #1a1a2e;
  --text: #1a1a2e;
  --muted: #5c5c72;          /* 7.0:1 on --paper — body-weight muted text */
  --faint: #6b6b80;          /* 5.6:1 on --paper — labels only, never body */
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-on: #e8e6fb;      /* selected-chip fill */
  --rule: #e3e3ea;           /* hairline */
  --rule-dk: #d3d3de;        /* frame/input border */
  --line: #e3e3ea;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --stability-text: #33334a;
  --stability-pill-text: #2a2a3d;
  --stability-success: #14532d;
  --stability-danger: #5c1414;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --ok: #15803d;
  --bad: #b91c1c;
  --warn: #92400e;
  --queue: #5c5c72;
  /* rubric categories: outcome in the brand family, quality cool teal */
  --cat-outcome: #4f46e5;
  --cat-outcome-bg: #e6e4fb;
  --cat-quality: #0f766e;
  --cat-quality-bg: #cdf0eb;
  /* one family everywhere — the serif alias stays for old rules but renders sans */
  --sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* controls get a hard 1px edge; panels get NO shadow (hairline instead) */
  --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.08);
  --shadow-md: 0 10px 30px rgba(26, 26, 46, 0.14);
  --edge-primary: 0 3px 0 -1px #a5a0f0;
  --edge-neutral: 0 3px 0 -1px #dededf;
  --focus: 0 0 0 3px rgba(79, 70, 229, 0.35);
  --radius: 10px;
  /* legacy aliases */
  --bg: #f6f6f8;
  --panel: #ffffff;
  --panel-2: #eeeef4;
  --border: #d3d3de;
  --accent-dark: #4338ca;
}

* { box-sizing: border-box; }
/* display rules on classes must never beat the hidden attribute */
[hidden] { display: none !important; }
html { background: var(--paper); }
html, body { margin: 0; padding: 0; }
body {
  /* the page owns the full viewport: no dead band under short views, and the
     footer sits on the bottom edge instead of floating mid-page */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5715 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
b, strong { font-weight: 600; }
::selection { color: var(--ink); background: rgba(79, 70, 229, 0.25); }
a { color: var(--accent-strong); }
kbd {
  font: 11px/1 var(--mono); padding: 2px 5px; vertical-align: baseline;
  border: 1px solid var(--rule-dk); border-bottom-width: 2px; border-radius: 4px;
  background: #fafafc; color: var(--muted);
}

/* ---------- masthead ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 4px 16px;
  background: var(--canvas);
  border-bottom: 1px solid var(--rule-dk);
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-text { display: flex; align-items: baseline; gap: 14px; }
.brand-mark { font-weight: 700; font-size: 16px; letter-spacing: -0.025em; color: var(--ink); }
.brand-sub {
  color: var(--accent-strong); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-left: 1px solid var(--rule-dk); padding-left: 14px;
}
/* segmented tabs in a sunken track: the current section reads as a raised
   pill, so "where am I" is answered by shape, not just colour */
.topnav {
  display: flex; gap: 4px; margin-left: 22px;
  padding: 3px; border-radius: 8px; background: var(--surface-soft);
}
.topnav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 5px 13px; border-radius: 6px;
}
.topnav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.topnav a.active {
  color: var(--ink); background: var(--surface); font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.1);
}

.whoami { margin-left: auto; color: var(--faint); font-size: 12px; }

.view { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 18px 40px; }
/* work views use the FULL available width — nothing boxed in */
#view-run.view, #view-task.view, #view-flowtask.view { max-width: none; }

/* ---------- cards: crisp white surfaces ---------- */

.card {
  background: var(--surface-card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--rule);
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 10px; font-weight: 600;
  letter-spacing: -0.025em; font-size: 18px;
  display: flex; align-items: baseline; gap: 8px;
}
.card h3 { font-weight: 600; letter-spacing: -0.025em; font-size: 15px; }

/* ---------- form fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span {
  font-size: 10.5px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.field .hint { font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--faint); }
.field-row { display: flex; gap: 18px; }
.field-row .grow { flex: 1; }

input[type="text"], input[type="search"], input[type="email"], textarea, select {
  background: var(--surface);
  border: 1px solid var(--rule-dk);
  border-radius: 6px;
  color: var(--ink);
  padding: 6px 12px;
  font: inherit;
  box-shadow: var(--shadow-sm);
}
input[type="text"]::placeholder, input[type="search"]::placeholder, input[type="email"]::placeholder, textarea::placeholder { color: var(--faint); }
input[type="text"]:focus, input[type="search"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.20);
}
textarea { resize: vertical; }
select { cursor: pointer; }

.task-row select { width: 100%; }
.new-task-box {
  display: flex; gap: 12px; flex-direction: column; align-items: flex-start;
  background: var(--surface-soft);
  border: 1px dashed var(--rule-dk);
  border-radius: 6px;
  padding: 14px 16px;
  margin: -6px 0 16px;
}
.new-task-box[hidden] { display: none; }
.new-task-box input { width: 100%; }
.field-inline { display: flex; flex-direction: column; gap: 8px; }
.cat-label {
  font-size: 10.5px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.cat-label .hint { font-weight: 400; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--faint); }
.cat-select { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-select input { display: none; }
.cat-select i {
  display: block; padding: 5px 13px; font-style: normal; cursor: pointer;
  background: rgba(255, 255, 255, 0.62); color: var(--muted); font-size: 13px; font-weight: 600;
  border: 1px solid var(--rule-dk); border-radius: 6px;
}
.cat-select i:hover { color: var(--ink); border-color: rgba(26, 26, 46, 0.24); background: #fff; }
.cat-select input:checked + i {
  background: var(--surface); border-color: var(--accent); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- buttons: compact, tactile ---------- */

/* the one filled control on a screen: the action you came here to take */
button.primary {
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 6px;
  height: 34px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: var(--edge-primary);
  transition: transform .15s, background-color .15s, box-shadow .15s;
}
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.primary:active { transform: translateY(2px); box-shadow: none; }
button.primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }

button.secondary {
  background: var(--surface); color: var(--ink);
  border: 1px solid #ccc; border-radius: 6px;
  height: 32px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; box-shadow: var(--edge-neutral);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
button.secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
button.secondary:active { transform: translateY(2px); box-shadow: none; }
button.secondary:disabled { opacity: 0.5; cursor: default; }

/* Rare or reversible actions: no chrome until you go near them. */
button.quiet {
  background: none; color: var(--muted); border: 1px solid transparent;
  border-radius: 6px; height: 30px; padding: 0 10px; font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer;
}
button.quiet:hover { background: #e4e4ee; color: var(--ink); }
button.quiet:disabled { opacity: 0.5; cursor: default; }

button.linkish {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--accent-strong); font-weight: 600; cursor: pointer;
}
button.linkish:hover { text-decoration: underline; }

/* one ring for the whole app: the halo reads on any surface, and the outline
   underneath still shows when an ancestor clips the shadow */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--focus); }

/* ---------- dropzone ---------- */

.dropzone {
  position: relative;
  border: 1.5px dashed var(--rule-dk);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 30px 24px 22px;
  min-height: 120px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 8px;
}
.dropzone.drag { border-color: var(--accent); background: var(--surface-accent); }
.dz-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 17px; }
.dz-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.file-list { list-style: none; margin: 14px auto 0; padding: 0; max-width: 560px; text-align: left; }
.file-list:empty { margin: 0; }
.file-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 6px 12px; border-radius: 6px; background: var(--surface);
  border: 1px solid var(--rule);
  margin-bottom: 6px; font-size: 13px;
}
.file-list .rm { color: var(--red); cursor: pointer; background: none; border: none; font-size: 13px; font-weight: 600; }

/* ---------- model grid ---------- */

.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 13px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.model-card .mc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 4px 10px; flex-wrap: wrap; margin-bottom: 9px;
}
.model-card h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 15.5px; white-space: nowrap; }
.repeats { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.repeats select { padding: 3px 7px; border-radius: 6px; font-size: 12px; }
.efforts { display: flex; flex-wrap: wrap; gap: 6px; }
.efforts label {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rule-dk); border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  padding: 3px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted);
}
.efforts label:hover { color: var(--ink); border-color: rgba(26, 26, 46, 0.24); background: #fff; }
.efforts input { display: none; }
.efforts label.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: none;
}

/* Skills strip: spans the grid directly under the "Skill" cards it
   configures, so the association is visible. */
.skill-picks-row {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px;
  background: var(--surface-accent);
  border: 1px solid var(--rule-dk);
  border-radius: 6px;
  padding: 9px 14px;
  margin-top: -4px;
}
.skill-picks-row .sp-label { font-size: 12px; color: var(--muted); }
.skill-picks { display: flex; flex-wrap: wrap; gap: 18px; }
.skill-picks label {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink);
}
.skill-picks input { accent-color: var(--accent); }

.submit-row { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.job-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.form-error { color: var(--red); margin: 12px 0 0; }

/* ---------- runs list ---------- */

.cat-chip {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); background: rgba(26, 26, 46, 0.06);
  border: none; border-radius: 6px; padding: 2px 9px; white-space: nowrap;
}

/* status chips: verdict colour on its soft background */
.chip {
  display: inline-block; border-radius: 6px; padding: 2px 9px;
  font-size: 11px; font-weight: 700; border: 1px solid var(--rule-dk);
  color: var(--muted); background: rgba(255, 255, 255, 0.62); white-space: nowrap;
}
.chip.completed { color: var(--green); border-color: rgba(120, 200, 155, 0.4); background: var(--green-bg); }
.chip.failed { color: var(--red); border-color: rgba(185, 28, 28, 0.4); background: var(--red-bg); }
.chip.running { color: var(--amber); border-color: rgba(146, 64, 14, 0.4); background: var(--amber-bg); }
.chip.queued { color: var(--muted); background: rgba(26, 26, 46, 0.05); }

/* ---------- run detail ---------- */

.back { color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
.back:hover { color: var(--ink); }
.run-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.run-head > button { margin-left: auto; }
.run-head h2 { margin: 0; }
.run-meta { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.prompt-details { margin-bottom: 14px; }
.prompt-details summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.prompt-details pre {
  white-space: pre-wrap; background: var(--surface-soft); padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 6px; font-size: 12.5px;
  font-family: var(--mono); margin: 8px 0 0;
}
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sources a {
  color: var(--accent-strong); text-decoration: none; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--rule-dk); background: var(--surface-accent);
  padding: 3px 11px; border-radius: 6px;
}
.sources a:hover { border-color: var(--accent); }

.jobs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.jobs-table th {
  text-align: left; color: var(--faint); font-weight: 700; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  padding: 7px 10px; border-bottom: 1px solid var(--rule-dk); background: none;
}
.jobs-table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; font-variant-numeric: tabular-nums; }
.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table tbody tr:hover { background: rgba(26, 26, 46, 0.035); }
.jobs-table .err { color: var(--red); font-size: 12.5px; max-width: 340px; }
.dl {
  display: inline-block; color: var(--accent-strong); background: var(--surface-accent);
  border: 1px solid var(--rule-dk); border-radius: 6px; padding: 3px 11px;
  text-decoration: none; font-size: 12px; font-weight: 600; margin: 0 6px 6px 0;
}
.dl:hover { border-color: var(--accent); }
.up-btn {
  display: inline-block; background: rgba(255, 255, 255, 0.62); color: var(--muted);
  border: 1px solid var(--rule-dk); border-radius: 6px; padding: 3px 11px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; margin: 0 6px 6px 0;
}
.up-btn:hover { color: var(--ink); border-color: rgba(26, 26, 46, 0.24); background: #fff; }
.up-btn:disabled { opacity: 0.5; cursor: default; }
.up-btn.drag { border-color: var(--accent); background: var(--surface-accent); color: var(--accent-strong); }

/* ---------- synchronized viewer ---------- */

.viewer-head { display: flex; justify-content: space-between; align-items: center; }
.viewer-head h2 { margin: 0; }
.viewer-controls { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  background: var(--surface); border: 1px solid var(--rule-dk); color: var(--ink);
  border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 12px;
  font-weight: 600; line-height: 1.5;
}
.nav-btn:hover { border-color: var(--rule-dk); }
#v-counter, #wb-counter, #lb-counter { color: var(--muted); font-size: 12.5px;
  min-width: 88px; text-align: center; font-variant-numeric: tabular-nums; }

/* column count is set inline by the viewer based on available width */
.viewer-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 16px; }
.deck-panel {
  background: var(--surface-soft); border: 1px solid var(--rule);
  border-radius: 6px; padding: 12px;
}
.deck-panel .label {
  font-size: 11px; color: var(--accent-strong); margin-bottom: 8px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.deck-panel .stage {
  background: #fff; border-radius: 6px; overflow: hidden; position: relative;
  border: 1px solid rgba(26, 26, 46, 0.16);
}
.deck-panel .stage.loading::after {
  content: "Rendering with LibreOffice — a deck's first view can take a minute…";
  position: absolute; inset: 0; display: flex; padding: 0 20px; text-align: center;
  align-items: center; justify-content: center; color: var(--muted); background: var(--surface-card);
  font-size: 12.5px;
}
.deck-panel .slide-img { display: block; width: 100%; height: auto;
  max-height: 76vh; object-fit: contain; background: #fff; }
/* multiple decks forced into one column: cap slide heights so the whole
   stacked comparison fits in one viewport */
.viewer-grid.stacked-multi .slide-img { max-height: 37vh; }
.viewer-grid.stacked-multi { gap: 12px; }

/* thumbnail mode: every slide, three across */
#viewer-card.thumbs .viewer-controls { display: none; }
.deck-panel .stage.thumbs-stage {
  border: none; background: none; overflow: visible;
}
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thumb {
  position: relative; margin: 0; cursor: zoom-in;
}
.thumb img {
  display: block; width: 100%; background: #fff;
  border: 1px solid rgba(26, 26, 46, 0.16); border-radius: 6px;
}
.thumb:hover img { border-color: var(--rule-dk); }
.thumb .n {
  position: absolute; right: 6px; bottom: 6px; font-style: normal;
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: rgba(255, 255, 255, 0.88); border: 1px solid var(--rule);
  border-radius: 6px; padding: 0 6px; font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) { .thumb-grid { grid-template-columns: repeat(2, 1fr); } }

.lb-img { display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 90px); }
.deck-panel .out-of-range {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(26, 26, 46, 0.82); color: #f3f3f7; font-size: 13px;
}
.deck-panel.past-end .out-of-range { display: flex; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; margin-top: 4px; }

.foot {
  text-align: center; color: var(--faint); font-size: 12px;
  padding: 14px 0 18px; border-top: 1px solid var(--rule);
}
.foot .linkish { font-size: 12px; font-weight: 500; color: var(--muted); }
.foot .linkish kbd { margin-left: 3px; }

.shortcuts {
  border: 1px solid var(--rule-dk); border-radius: var(--radius);
  padding: 20px 22px; width: min(460px, 94vw);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-md);
}
.shortcuts::backdrop { background: rgba(26, 26, 46, 0.45); }
.shortcuts h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.shortcuts dl {
  display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; margin: 0 0 14px;
}
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; font-size: 13px; color: var(--muted); }
.shortcuts form { margin-top: 14px; text-align: right; }
.foot span { font-size: 12px; }

@media (max-width: 760px) {
  .model-grid { grid-template-columns: 1fr; }
  .viewer-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ---------- evaluation + rubric builder ---------- */

.rubric-link {
  font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none;
  border: 1px solid var(--rule-dk); border-radius: 6px; padding: 2px 10px;
  background: rgba(255, 255, 255, 0.62); white-space: nowrap;
}
.rubric-link:hover { color: var(--ink); border-color: var(--rule-dk); background: #fff; }

#b-status.ok { color: var(--green); } #b-status.err { color: var(--red); }
.b-h { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 17px; }
.b-h .hint { font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--faint); }
.b-x { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 14px; }

.slide-badge { margin-left: 8px; font-size: 11px; font-weight: 700;
  color: var(--red); background: var(--red-bg); border-radius: 999px; padding: 1px 9px; }
.v-triggered { border: 1px solid var(--rule); background: var(--surface-soft);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.v-triggered .trig { color: var(--muted); padding: 2px 0; }

button.quiet.b-danger { color: var(--red); }
button.quiet.b-danger:hover { background: var(--red-bg); color: var(--red); }

/* run-level judging summary: one row per judging kind, aggregated over all
   judged decks of the selected run */
.wb-summary { width: 100%; border-collapse: collapse; font-size: 12.5px;
  margin-bottom: 10px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.wb-summary th { text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--faint); font-weight: 700;
  padding: 6px 10px; background: #f1f1f6; }
.wb-summary td { padding: 6px 10px; border-top: 1px solid var(--rule); }
.wb-summary td b { font-size: 13.5px; }
.wb-summary td i { font-style: normal; font-size: 11px; color: var(--muted);
  margin-left: 3px; }
.wb-summary .sum-outcome b { color: var(--cat-outcome); }
.wb-summary .sum-quality b { color: var(--cat-quality); }
.wb-summary tr.sub td:first-child { padding-left: 24px; color: var(--muted); }
.wb-summary tr.avg td { background: #fafafc; font-weight: 600;
  border-top: 1px solid var(--rule-dk); }

.tasks-list { display: flex; flex-direction: column; gap: 6px; }
.task-row-link { display: flex; gap: 12px; align-items: center;
  padding: 10px 14px; border: 1px solid var(--rule);
  border-radius: 6px; text-decoration: none; color: inherit;
  background: var(--surface); cursor: pointer; }
.task-row-link:hover { border-color: var(--rule-dk); box-shadow: var(--shadow-sm); }
.task-row-link { min-width: 0; }
.task-row-link .cat-chip { flex: 0 0 auto; white-space: nowrap; }
.task-row-link .muted { flex: 0 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.task-row-link .rubric-link { margin-left: auto; flex: 0 0 auto;
  white-space: nowrap; }
/* Narrow screens: the byline is the first thing worth dropping. */
@media (max-width: 760px) { .task-row-link .byline { display: none; } }
.rubric-badge { flex: 0 0 auto; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px;
  border-radius: 999px; color: var(--warn); background: var(--amber-bg); }
.rubric-badge.has { color: var(--green); background: var(--green-bg); }

.tasks-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}
.tasks-toolbar h2 {
  margin: 0;
}
.tasks-search {
  flex: 1 1 240px;
  width: 100%;
  min-width: 180px;
  max-width: 480px;
}
.tasks-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}
.tasks-tracker {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-bg);
}
.tasks-tracker strong {
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tasks-tracker span {
  font-size: 12px;
  font-weight: 600;
}
.tasks-tracker small {
  display: block;
  font-size: 11px;
  font-weight: 400;
}
.tasks-board-hint {
  margin: 0 0 14px;
}
.tasks-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  padding: 3px 3px 12px;
}
.task-column {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  /* tall enough to read as a column and to be an easy drop target, without
     leaving a screenful of empty track when a stage holds one card */
  min-height: 340px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.task-column.is-drop-target {
  border-color: var(--accent-strong);
  background: var(--surface-accent);
  box-shadow: inset 0 0 0 1px var(--accent-strong);
}
.task-column-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}
.task-column-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.task-column-heading::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.task-column[data-section="task-review"] .task-column-heading::before {
  background: var(--cat-outcome);
}
.task-column[data-section="rubric-building"] .task-column-heading::before {
  background: var(--cat-quality);
}
.task-column[data-section="rubric-review"] .task-column-heading::before {
  background: var(--amber);
}
.task-column[data-section="finalized"] .task-column-heading::before {
  background: var(--green);
}
.task-column[data-section="archived"] .task-column-heading::before {
  background: var(--muted);
}
.task-column-header .task-create-row {
  padding: 4px 8px;
  font-size: 12px;
  border-style: solid;
}
.task-column > .task-create-row,
.task-column > .task-group-h {
  grid-column: 1 / -1;
}
.task-column[data-section="finalized"] .task-column-heading {
  color: var(--green);
}
.task-column-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* An empty stage reads as somewhere a card can land, not as a rendering gap. */
.task-empty {
  grid-column: 1 / -1;
  margin: 6px 0;
  padding: 18px 10px;
  text-align: center;
  border: 1px dashed var(--rule-dk);
  border-radius: 8px;
  color: var(--faint);
}
.task-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 11px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.task-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.task-card[draggable="true"] {
  cursor: grab;
}
.task-card.is-dragging {
  opacity: 0.45;
}
.task-card[aria-busy="true"] {
  opacity: 0.65;
}
.task-card.is-archived {
  border-style: dashed;
  background: var(--surface-soft);
}
.task-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.task-card-name {
  padding-right: 26px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.task-card-link:hover .task-card-name {
  color: var(--accent-strong);
}
.tasks-board:focus-visible,
.task-card-link:focus-visible,
.task-menu-trigger:focus-visible,
.task-state-menu button:focus-visible,
.tasks-board .task-create-row:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}
.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.task-card-tags .cat-chip,
.task-card-tags .rubric-badge {
  padding: 2px 7px;
  font-size: 9px;
}
.task-archived-badge {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.task-ai-badge {
  padding: 1px 7px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}
.task-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0 0;
}
.task-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 5px;
}
.task-metric dt {
  font-size: 11px;
  color: var(--muted);
}
.task-metric dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.task-metric-outcome dd {
  color: var(--cat-outcome);
}
.task-metric-quality dd {
  color: var(--cat-quality);
}
.task-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.task-menu-trigger {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}
.task-menu-trigger[aria-expanded="true"] {
  background: var(--surface-soft);
  color: var(--ink);
}
.task-state-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 180px;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--rule-dk);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.task-state-menu:popover-open {
  display: flex;
  flex-direction: column;
}
.task-state-menu-label {
  padding: 4px 8px 6px;
}
.task-state-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  justify-content: space-between;
  text-align: left;
}
.task-state-menu button.is-current {
  opacity: 1;
  color: var(--green);
  background: var(--green-bg);
}
.task-card-byline {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .tasks-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-column {
    padding: 10px;
    /* stacked, six columns of empty track would be six screenfuls of scroll */
    min-height: 0;
  }
  .tasks-search {
    flex-basis: 100%;
    min-width: 0;
    max-width: none;
  }
  .tasks-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* rubric criteria table + wide builder view */
#view-task.view { max-width: none; padding-left: 14px; padding-right: 14px; }
#view-task .card { padding: 10px 12px; margin-bottom: 10px; }


/* ---- home is the New run form; tasks & runs live behind the top nav ---- */
#view-home.view, #view-taskruns.view { max-width: 1060px; }
#view-tasks.view { max-width: 1800px; }

/* ---- full-screen slide inspector: bright, like the report's lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex;
  flex-direction: column; background: rgba(246, 246, 248, 0.97); }
.lightbox[hidden] { display: none; }
.lb-bar { display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  color: var(--ink); }
.lb-label { font-weight: 600; font-size: 13.5px; margin-right: auto; }
.lb-bar .viewer-controls, .lb-bar #lb-counter { color: var(--muted); }
.lb-bar .nav-btn { background: var(--surface); color: var(--ink);
  border-color: var(--rule-dk); }
.lb-bar .nav-btn:hover { border-color: var(--rule-dk); }
.lb-stage { flex: 1; overflow: auto; display: flex; align-items: flex-start;
  justify-content: center; padding: 0 16px 20px; }
.lb-stage .stage { background: #fff; border-radius: 6px; overflow: hidden;
  position: relative; border: 1px solid var(--rule-dk); box-shadow: var(--shadow-md); }
.deck-panel .stage.zoomable { cursor: zoom-in; }


/* ================= Rubric Flow ================= */
.rf-create .field { margin-bottom: 12px; }
.rf-file-list { list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px; }
.rf-file-list li { display: flex; gap: 12px; align-items: center;
  font-size: 12.5px; padding: 5px 10px; background: var(--surface-soft);
  border: 1px solid var(--rule); border-radius: 6px; }
.rf-ref-toggle { display: flex; gap: 5px; align-items: center;
  font-size: 11.5px; color: var(--muted); margin-left: auto; cursor: pointer; }

.rf-stage { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 2px 9px; border-radius: 999px;
  color: var(--warn); background: var(--amber-bg); }
.rf-stage-ready { color: var(--green); background: var(--green-bg); }
.rf-stage-failed, .rf-stage-stalled { color: var(--red); background: var(--red-bg); }

.rf-split { display: grid;
  grid-template-columns: minmax(520px, 5fr) 10px var(--rf-right-width, minmax(360px, 2fr));
  gap: 0; align-items: start; }
.rf-resizer { position: relative; min-width: 10px; height: 100%; cursor: col-resize;
  touch-action: none; outline: none; }
.rf-resizer::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px;
  background: var(--rule); transform: translateX(-50%); transition: background 0.12s, width 0.12s; }
.rf-resizer:hover::before, .rf-resizer:focus-visible::before {
  width: 3px; background: var(--accent); }
body.rf-resizing, body.rf-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 1100px) {
  .rf-split { grid-template-columns: 1fr; gap: 18px; }
  .rf-resizer { display: none; }
}
/* the title card stacks with the grid so it only spans the preview width;
   the WHOLE left column is sticky so the previews stay put while the rubric
   pane scrolls */
.rf-left-col { min-width: 0; position: sticky; top: 12px;
  max-height: calc(100vh - 24px); overflow-y: auto; }
.rf-left { padding: 6px 6px 4px; }
.rf-left .viewer-head { margin: 2px 6px 0; flex-wrap: wrap; gap: 8px; }
.rf-left .viewer-controls { flex-wrap: wrap; }
#rf-grid-size { flex-shrink: 0; }
#rf-grid-size button { min-height: 30px; }
#rf-grid-size button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  --rf-slide-aspect: 16 / 9; gap: 5px; margin-top: 6px; }
.rf-grid[data-grid-size="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); --rf-grid-rows: 2; }
.rf-grid[data-grid-size="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); --rf-grid-rows: 3; }
.rf-grid[data-grid-size="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); --rf-grid-rows: 2; }
.rf-cell { margin: 0; position: relative; background: var(--surface-soft);
  border: 1px solid var(--rule); border-radius: 6px; padding: 2px;
  overflow: hidden; }
.rf-cell figcaption { font-size: 9.5px; font-weight: 700; color: var(--accent-strong);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-cell img { display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid var(--rule); border-radius: 6px; box-sizing: border-box;
  border: 1px solid rgba(26, 26, 46, 0.14); border-radius: 4px;
  cursor: zoom-in; }
.rf-missing { display: flex; align-items: center; justify-content: center;
  min-height: 70px; font-size: 11px; color: var(--faint); }
.rf-missing-match { flex-direction: column; align-content: center; gap: 10px; padding: 16px 10px;
  color: var(--text); font-size: 12px; line-height: 1.5; text-align: center;
  overflow-wrap: anywhere; }
.rf-missing-match button { max-width: 100%; white-space: normal; }
.rf-badge { position: absolute; top: 3px; right: 5px; font-style: normal;
  font-weight: 800; font-size: 13px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; padding: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 1px 4px #0004; }
.rf-badge.pass { color: #fff; background: var(--green); }
.rf-badge.fail { color: #fff; background: var(--red); }
.rf-badge:hover { transform: scale(1.08); }
.rf-badge:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* The criteria list can run to dozens of rows; its controls ride along at the
   top of the scroll instead of disappearing after the first screenful. */
.rf-crit-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 -14px 8px; padding: 6px 14px 8px;
  background: var(--surface-card); border-bottom: 1px solid var(--rule);
}
.rf-crit-bar .b-h { margin: 0; margin-right: auto; }

.rf-criteria { display: flex; flex-direction: column; gap: 6px; }
.rf-crit { display: block; padding: 9px 10px 10px; border: 1px solid var(--rule);
  border-radius: 6px; background: var(--surface);
  font-size: 12.5px; }
.rf-crit-check { display: block; width: 100%; border: 0; padding: 0;
  background: none; color: inherit; font: inherit; text-align: left; }
.rf-crit.on { border-color: var(--accent); background: var(--surface-accent, #eeecfc); }
.rf-summary { margin-top: 10px; max-width: 560px; }

/* Rubric Flow landing: create+list left, how-it-works right */
.rf-flow-split { display: grid; grid-template-columns: minmax(420px, 3fr) minmax(300px, 2fr);
  gap: 18px; align-items: start; }
@media (max-width: 1000px) { .rf-flow-split { grid-template-columns: 1fr; } }
.rf-explain { font-size: 13px; position: sticky; top: 12px; }
.rf-explain h3 { margin-top: 0; }
.rf-explain ol { margin: 0; padding-left: 20px; display: flex;
  flex-direction: column; gap: 10px; }
.rf-explain li { color: var(--muted); }
.rf-explain li b { color: var(--ink); }

/* ---------- checkboxes: bigger, on-theme ---------- */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; flex: 0 0 auto;
  border: 1.5px solid var(--rule-dk); border-radius: 6px;
  background: var(--surface); cursor: pointer; position: relative;
  vertical-align: -4.5px; margin: 0 2px 0 0;
  transition: background 0.12s, border-color 0.12s;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent-strong);
}
input[type="checkbox"]:checked::after {
  content: "✓"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; line-height: 1;
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.rf-stage-live { animation: rf-pulse 1.6s ease-in-out infinite; }
@keyframes rf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* full-screen slide zoom (Rubric Flow previews) */
.rf-zoom { position: fixed; inset: 0; z-index: 60; cursor: zoom-out;
  background: rgba(26, 26, 46, 0.88); display: flex;
  align-items: center; justify-content: center; padding: 24px; }
.rf-zoom figure { margin: 0; max-width: 96vw; max-height: 94vh;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rf-zoom img { max-width: 96vw; max-height: 88vh; width: auto; height: auto;
  background: #fff; border-radius: 6px; box-shadow: var(--shadow-md); }
.rf-zoom figcaption { color: rgba(255, 255, 255, 0.75); font-size: 12px; }

/* template/reference cell in the flow grid */
.rf-cell.rf-template { border: 2px solid var(--accent);
  background: var(--surface-accent); }
.rf-cell.rf-template figcaption { display: flex; justify-content: space-between;
  align-items: center; gap: 6px; overflow: visible; }
.rf-template-tag { color: #fff; background: var(--accent-strong);
  border-radius: 999px; padding: 1px 8px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; }
.rf-template-nav { display: flex; gap: 4px; align-items: center;
  font-size: 10px; color: var(--accent-strong); font-weight: 700; }
.rf-template-nav button { border: 1px solid var(--rule-dk);
  background: var(--surface); border-radius: 6px; cursor: pointer;
  font-size: 9px; padding: 1px 5px; color: var(--accent-strong); }
.rf-template-nav button:hover { background: var(--accent-on); }

.rf-deckwide { margin-top: 10px; }
.rf-deckwide summary { cursor: pointer; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint);
  font-weight: 700; padding: 4px 0 8px; }
.rf-deckwide summary:hover { color: var(--ink); }
.rf-deckwide .rf-crit { margin-bottom: 6px; }
.rf-no-reviewed { margin: 4px 0; }
.rf-crit.editing { cursor: default; display: block; }
.rf-criterion-form { padding: 0; overflow: hidden; border-color: var(--rule-dk);
  border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.rf-criterion-form-head { padding: 16px 16px 14px;
  background: linear-gradient(145deg, var(--surface-accent), var(--surface) 72%); }
.rf-criterion-form-head h4 { margin: 4px 0 3px; color: var(--ink);
  font-size: 15px; font-weight: 650; letter-spacing: -0.012em; }
.rf-criterion-form-head p { margin: 0; color: var(--muted); font-size: 11.5px;
  line-height: 1.45; }
.rf-field { display: flex; flex-direction: column; min-width: 0; }
.rf-field-label { display: block; color: var(--ink); font-size: 12.5px;
  font-weight: 700; line-height: 1.35; }
.rf-field-description { margin: 3px 0 8px; color: var(--muted);
  font-size: 11.5px; line-height: 1.4; }
.rf-criterion-main-field { padding: 16px; border-top: 1px solid var(--rule); }
.rf-crit-edit { width: 100%; min-height: 104px; margin: 0; padding: 10px 12px;
  font-size: 13px; line-height: 1.5; box-shadow: none; }
.rf-criterion-example { margin: 9px 0 0; padding: 7px 9px;
  border-left: 2px solid var(--accent); border-radius: 0 5px 5px 0;
  background: var(--surface-soft); color: var(--muted); font-size: 11.5px;
  line-height: 1.4; }
.rf-criterion-example span { color: var(--ink); font-weight: 700; }
.rf-criterion-tips { display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 0; color: var(--muted); font-size: 10.5px; }
.rf-criterion-tips span { padding: 3px 7px; border: 1px solid var(--rule);
  border-radius: 999px; background: var(--surface); }
.rf-field-error { margin: 6px 0 0; color: var(--red); font-size: 11.5px;
  font-weight: 650; }
.rf-field-row { display: grid; grid-template-columns: 1fr;
  gap: 14px; padding: 15px 16px 16px; border-top: 1px solid var(--rule);
  background: #fafafc; }
.rf-field-row select { width: 100%; min-height: 38px; box-shadow: none; }
.rf-field-row .rf-field-description:last-child { margin: 6px 2px 0; }
/* Same scale as the commentary pills; a flex item that neither stretches to the
   button height nor shrinks and wraps. */
.rf-tag { flex: none; align-self: center; padding: 1px 7px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); background: var(--surface);
  font: 650 10.5px/1.4 var(--sans); white-space: nowrap; }
.rf-tag-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.rf-tag-options legend { padding: 0; }
.rf-tag-option { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0;
  color: var(--ink); font-size: 12px; cursor: pointer; }
.rf-tag-option input { flex: none; width: 18px; height: 18px; min-height: 18px; margin: 0; }
.rf-tag-hint { font-style: normal; color: var(--muted); }
.rf-criterion-footer { display: grid; grid-template-columns: 1fr;
  gap: 7px; padding: 13px 16px 15px; border-top: 1px solid var(--rule);
  background: var(--surface); }
.rf-criterion-actions { display: flex; align-items: center; justify-content: flex-end;
  gap: 7px; margin-top: 3px; }
.rf-criterion-actions button { white-space: nowrap; }
.rf-criterion-save-note { margin: 0; color: var(--muted); font-size: 11px; }
.rf-crit-edit[aria-invalid="true"] { border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14); }
.rf-sync-btn { border: 1px solid var(--rule-dk); background: var(--surface);
  border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 11.5px;
  font-weight: 600; color: var(--muted); cursor: pointer; margin-left: 8px; }
.rf-sync-btn:hover { border-color: var(--rule-dk); color: var(--ink); }
.rf-sync-btn.on { background: var(--accent-on); border-color: var(--accent);
  color: var(--ink); }
.rf-judge-btn { color: var(--green) !important; font-weight: 800; }
.rf-judge-btn:hover { background: var(--green-bg) !important; }
.rf-scores-btn { margin-top: 0; padding: 4px 10px; }
.rf-scores-btn b { font-size: 15px; color: var(--accent-strong); }
.rf-scores-btn i { font-style: normal; font-size: 11px; color: var(--muted);
  margin-left: 3px; }
.rf-scores-modal { cursor: default; }
.rf-modal-card { background: var(--surface-card); border-radius: 6px;
  padding: 20px 22px; max-width: 640px; width: 92vw; max-height: 88vh;
  overflow-y: auto; box-shadow: var(--shadow-md); }
.rf-modal-card .wb-summary { margin: 0 0 10px; }

/* Quiet outcome/quality markers: retain fast category scanning without a
   filled pill competing with the criterion text. */
.rf-cat { display: inline-flex; align-items: center; font-style: normal;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0; margin-left: 6px; vertical-align: 1px;
  background: transparent; }
.rf-cat::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto;
  margin-right: 5px; border-radius: 50%; background: currentColor; }
.rf-cat-outcome { color: var(--accent-strong); }
.rf-cat-quality { color: var(--cat-quality); }
.rf-tier { display: inline-flex; align-items: center; font-style: normal;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; border: 1px solid currentColor; }
.rf-tier-possible_dealbreaker { color: var(--amber); }
.rf-tier-certain_dealbreaker { color: var(--red); }
.rf-btn-cat { font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 2px 8px; margin-left: 6px; }
.rf-summary .sum-outcome b { color: var(--cat-outcome); }
.rf-summary .sum-quality b { color: var(--cat-quality); }
.rf-summary td.over b, .rf-btn-cat.over { color: var(--red); }
.rf-btn-cat.over { background: var(--red-bg); }
.rf-scores-btn.is-off-target { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.rf-btn-target { margin-left: 4px; color: var(--red); font-size: 11px; font-weight: 800; }
.rf-btn-target.ok { color: var(--ok); }
.rf-targets-head { margin: 0 0 6px; font-size: 14px; }
.rf-targets { margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; }
.rf-targets li { padding: 2px 0; }
.rf-targets li.ok { color: var(--ok); }
.rf-targets li.miss { color: var(--red); font-weight: 700; }
.rf-cell figcaption { display: flex; justify-content: space-between;
  align-items: center; gap: 4px; }
.rf-cap-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-dl { flex: 0 0 auto; font-size: 11px; text-decoration: none;
  color: var(--faint); padding: 0 3px; border-radius: 5px; }
.rf-dl:hover { color: var(--accent-strong); background: var(--surface-accent); }
.rf-raw { font-style: normal; font-size: 8.5px; font-weight: 800;
  color: var(--warn); background: var(--amber-bg); border-radius: 999px;
  padding: 0 5px; letter-spacing: 0.05em; }

/* ---------- Rubric Flow workbench: masthead header + viewport-height ---------- */

.rf-topbar { display: flex; align-items: center; gap: 10px; flex: 1;
  min-width: 0; margin-left: 18px; }
.rf-topbar h2 { margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 16px; letter-spacing: -0.02em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.rf-progress { flex: none; margin: 0 0 10px; line-height: 1.6;
  overflow-wrap: anywhere; }
/* grading row, always present. Resting: the Grade button (a play glyph plus
   label), a summary, and the All/Stale chips. Running: the glyph is a ring
   with the deck number, then squares per deck, the activity and the timer.
   Settled: a check or X badge and a pill. The chevron drops down the full
   message and a timestamped history. Same 6px radius as the page's cards. */
/* Commentary then grading: the commentary card at its natural width, the
   grading card taking the rest up to its 760px; the grading card wraps under
   when the row cannot hold both. */
.rf-bars { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 0 10px; }
.rf-judge-live { flex: 0 1 auto; min-width: 0; max-width: 760px; align-self: start; }
.rf-judge-row {
  position: relative; border-radius: 6px; background: var(--surface-card);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.rf-judge-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; min-height: 44px; padding: 0 6px 0 4px; color: var(--muted); }
/* At rest the glyph and label sit inside an accent pill - a button. When a
   run starts the pill dissolves, the glyph turns into the ring and the new
   label slides out from it. */
.rf-judge-main {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 4px;
  border: 0; border-radius: 999px; background: none; font: inherit; color: var(--ink); cursor: pointer;
  transition: background-color 0.3s cubic-bezier(0.23, 1, 0.32, 1), color 0.3s, padding 0.3s, box-shadow 0.3s;
}
.rf-judge-main:disabled { cursor: default; }
.rf-judge-row[data-status="idle"] .rf-judge-main {
  padding: 0 14px 0 6px; background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.12);
}
.rf-judge-row[data-status="idle"] .rf-judge-main:hover:not(:disabled) { background: var(--accent-strong); }
.rf-judge-row[data-status="idle"] .rf-judge-main:disabled { background: var(--rule-dk); color: var(--panel); box-shadow: none; }
.rf-judge-row[data-status="idle"] .rf-judge-label { color: inherit; }
.rf-judge-label.rf-judge-swap { animation: rf-judge-swap 0.35s cubic-bezier(0.23, 1, 0.32, 1) both; }
.rf-judge-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-judge-glyph {
  position: relative; flex: none; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rf-judge-ring { position: absolute; inset: 0; fill: none; stroke-width: 2; }
.rf-judge-track { stroke: var(--rule-dk); }
.rf-judge-arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 19.4 49.7; }
.rf-judge-row[data-status="running"] .rf-judge-ring { animation: rf-judge-spin 1.1s linear infinite; }
.rf-judge-step { position: relative; font-size: 10.5px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.rf-judge-play, .rf-judge-check, .rf-judge-x { display: none; }
.rf-judge-play { fill: #fff; margin-left: 1px; }
.rf-judge-check, .rf-judge-x { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rf-judge-row:not([data-status="running"]) .rf-judge-glyph {
  width: 22px; height: 22px; margin: 0 1px; border-radius: 50%;
}
.rf-judge-row:not([data-status="running"]) .rf-judge-ring,
.rf-judge-row:not([data-status="running"]) .rf-judge-step { display: none; }
.rf-judge-row[data-status="idle"] .rf-judge-glyph { background: rgba(255, 255, 255, 0.22); }
.rf-judge-row[data-status="idle"] .rf-judge-play { display: block; }
.rf-judge-row[data-status="done"] .rf-judge-glyph, .rf-judge-row[data-status="failed"] .rf-judge-glyph {
  animation: rf-judge-pop 0.3s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.rf-judge-row[data-status="done"] .rf-judge-glyph { background: var(--ok); }
.rf-judge-row[data-status="done"] .rf-judge-check { display: block; }
.rf-judge-row[data-status="failed"] .rf-judge-glyph { background: var(--accent-strong); }
.rf-judge-row[data-status="failed"] .rf-judge-x { display: block; }
.rf-judge-label { flex: none; font-size: 13px; font-weight: 500; color: var(--ink); }
.rf-judge-squares { flex: none; display: inline-flex; gap: 3px; }
.rf-judge-squares:empty { display: none; }
.rf-judge-squares i { width: 9px; height: 9px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--rule-dk); }
.rf-judge-squares i[data-status="running"], .rf-judge-squares i[data-status="rendering"],
.rf-judge-squares i[data-status="posting"] { box-shadow: none; background: var(--accent);
  animation: rf-judge-blink 1.2s ease-in-out infinite; }
.rf-judge-squares i[data-status="done"] { box-shadow: none; background: var(--ok); }
.rf-judge-squares i[data-status="failed"], .rf-judge-squares i[data-status="cancelled"] {
  box-shadow: none; background: var(--accent-strong); }
.rf-judge-detail { flex: 1; min-width: 0; white-space: pre-line;
  font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rf-judge-pill { display: none; flex: none; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; animation: rf-judge-fade 0.2s ease-out both; }
.rf-judge-row[data-status="done"] .rf-judge-pill { display: inline-flex; background: rgba(21, 128, 61, 0.12); color: var(--ok); }
.rf-judge-row[data-status="failed"] .rf-judge-pill { display: inline-flex; background: var(--surface-accent); color: var(--accent-strong); }
/* A failure says so in its label; an empty pill would be a blank blob. */
.rf-judge-row .rf-judge-pill:empty { display: none; }
.rf-judge-time { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.rf-judge-time:empty { display: none; }
/* scope chips, the filter-chip grammar: capsule, active one lifted, count in a small box */
.rf-judge-scope { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(26, 26, 46, 0.045); }
.rf-judge-row[data-status="running"] .rf-judge-scope { display: none; }
.rf-judge-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.rf-judge-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.rf-judge-chip:hover { background: rgba(26, 26, 46, 0.05); }
.rf-judge-chip:has(input:checked) { background: var(--surface-card); color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule-dk), 0 1px 2px rgba(26, 26, 46, 0.06); }
.rf-judge-chip[data-empty] { opacity: 0.55; }
.rf-judge-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.rf-judge-chip b { font-weight: 500; font-size: 10.5px; padding: 0 4px; border-radius: 4px;
  font-variant-numeric: tabular-nums; color: var(--muted); }
.rf-judge-chip:has(input:checked) b { background: var(--panel-2); }
.rf-judge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rf-judge-chevron { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rf-judge-chevron:hover { background: var(--panel-2); color: var(--ink); }
.rf-judge-chevron:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-judge-chevron svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round;
  stroke-linejoin: round; transition: transform 0.3s; }
.rf-judge-row.open .rf-judge-chevron svg { transform: rotate(180deg); }
.rf-judge-drop { display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 0.3s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s; }
.rf-judge-row.open .rf-judge-drop { grid-template-rows: 1fr; opacity: 1; }
/* The history floats over the page rather than pushing the workbench down;
   a failure's message stays in flow so it never covers the slides. */
.rf-judge-row:not([data-status="failed"]) .rf-judge-drop {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin-top: 4px;
  border-radius: 6px; background: var(--surface-card);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow-md); }
.rf-judge-row:not(.open) .rf-judge-drop { visibility: hidden; }
.rf-judge-row .rf-judge-details { padding-top: 8px; }
.rf-judge-head .rf-judge-stop { flex: none; align-self: center; }
.rf-judge-drop-inner { overflow: hidden; display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 0 10px 0 9px; }
.rf-judge-vline { width: 1px; margin: 0 auto; background: var(--rule); }
.rf-judge-details { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; }
.rf-judge-stop { align-self: flex-start; font-size: 12px; padding: 3px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); color: var(--ink); cursor: pointer; }
.rf-judge-stop:hover { background: var(--panel-2); }
.rf-judge-error { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.rf-judge-error:empty { display: none; }
.rf-judge-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rf-judge-log:empty::before { content: "Nothing has run yet."; font-size: 12px; color: var(--muted); }
.rf-judge-log li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  animation: rf-judge-up 0.3s cubic-bezier(0.23, 1, 0.32, 1) both; }
.rf-judge-log span { font-size: 12px; color: var(--muted); min-width: 0; white-space: normal; }
.rf-judge-log time { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--muted); opacity: 0.75;
  font-variant-numeric: tabular-nums; }
/* While a run is on or has settled, the grading row's head is fixed slots:
   label | squares | detail | done count + elapsed + ETA | Stop or scope |
   chevron. The label and squares slots never grow, so no label can run into
   the squares; while a run is on, the count column is sized for its longest
   value, so a tick never moves a neighbour. */
.rf-judge-live:has(.rf-judge-row:not([data-status="idle"])) { flex: 1 1 560px; container-type: inline-size; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-head {
  display: grid; grid-template-columns: 136px 69px minmax(0, 1fr) auto auto 28px; gap: 0 8px; }
.rf-judge-live .rf-judge-row[data-status="running"] .rf-judge-head {
  grid-template-columns: 136px 69px minmax(0, 1fr) 250px 96px 28px; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-head > * { grid-row: 1; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-main { grid-column: 1; min-width: 0; overflow: hidden; }
/* six squares a row; more decks wrap to further rows inside the slot */
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-squares { grid-column: 2;
  display: flex; flex-wrap: wrap; width: 69px; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-detail { grid-column: 3;
  white-space: nowrap; overflow: hidden; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-time { grid-column: 4;
  text-align: right; white-space: nowrap; overflow: hidden; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-pill { grid-column: 4; justify-self: end; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-scope,
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-stop { grid-column: 5; justify-self: end; }
.rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-chevron { grid-column: 6; }
/* The grading ring fills as decks finish instead of spinning. */
.rf-judge-live .rf-judge-row[data-status="running"] .rf-judge-ring { animation: none; transform: rotate(-90deg); }
.rf-judge-live .rf-judge-arc { transition: stroke-dasharray 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
/* A narrow row keeps every slot whole: the count and timer (and the scope
   control) take a second line instead of squeezing into the first. */
@container (max-width: 640px) {
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-head,
  .rf-judge-live .rf-judge-row[data-status="running"] .rf-judge-head {
    grid-template-columns: 136px 69px minmax(0, 1fr) auto 28px; padding-bottom: 8px; }
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-stop,
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-pill { grid-column: 4; }
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-chevron { grid-column: 5; }
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-head > .rf-judge-scope { grid-row: 2; grid-column: 1 / 4; justify-self: start; }
  .rf-judge-live .rf-judge-row:not([data-status="idle"]) .rf-judge-head > .rf-judge-time { grid-row: 2; grid-column: 3 / 6; }
  .rf-judge-live .rf-judge-row[data-status="running"] .rf-judge-head > .rf-judge-time { grid-column: 1 / 6; }
}
.rf-judge-squares i[data-status="capacity"] { box-shadow: none; background: var(--amber); }
/* One card per deck in the panel: deck | phase | elapsed + ETA, a thin
   progress bar, then its tool calls. */
.rf-judge-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rf-judge-cards:empty { display: none; }
.rf-judge-cards li { display: grid; grid-template-columns: 56px minmax(0, 1fr) 160px; align-items: baseline;
  grid-template-areas: "deck phase time" "bar bar bar" ". tools pct";
  padding: 8px 10px; border-radius: 6px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rf-judge-cards b { grid-area: deck; font-weight: 500; color: var(--ink); }
.rf-judge-card-phase { grid-area: phase; min-width: 0; }
.rf-judge-card-time { grid-area: time; text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.rf-judge-card-bar { grid-area: bar; height: 3px; margin: 6px 0; border-radius: 2px; background: var(--rule); overflow: hidden; }
.rf-judge-card-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent);
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
.rf-judge-card-tools { grid-area: tools; }
.rf-judge-card-pct { grid-area: pct; text-align: right; font-family: var(--mono); font-size: 11.5px; }
.rf-judge-cards li[data-status="capacity"] .rf-judge-card-bar { background: var(--amber-bg); }
.rf-judge-cards li[data-status="done"] .rf-judge-card-bar i { background: var(--ok); }
.rf-judge-cards li[data-status="capacity"] .rf-judge-card-phase { color: var(--amber); }
.rf-judge-cards li[data-status="failed"] .rf-judge-card-phase { color: var(--accent-strong); }
.rf-judge-history > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none;
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); }
.rf-judge-history > summary::-webkit-details-marker { display: none; }
.rf-judge-history > summary::before { content: "▸"; font-size: 10px; transition: transform 0.2s; }
.rf-judge-history[open] > summary::before { transform: rotate(90deg); }
.rf-judge-history > summary:hover { color: var(--ink); }
.rf-judge-history > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.rf-judge-history .rf-judge-log { margin-top: 6px; }
@keyframes rf-judge-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes rf-judge-swap { from { opacity: 0; transform: translateX(-10px); } }
@keyframes rf-judge-pop { from { opacity: 0; transform: scale(0.5); } }
@keyframes rf-judge-fade { from { opacity: 0; } }
@keyframes rf-judge-spin { to { transform: rotate(360deg); } }
@keyframes rf-judge-blink { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .rf-judge-row, .rf-judge-row *, .rf-judge-log li, .rf-commentary * { animation: none !important; transition: none !important; }
}
.rf-more-menu { position: relative; flex: none; }
.rf-more-menu > summary { list-style: none; cursor: pointer; padding: 7px 10px;
  border: 1px solid var(--rule-dk); border-radius: 6px; background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rf-more-menu > summary::-webkit-details-marker { display: none; }
.rf-more-menu > summary::after { content: " ▾"; }
.rf-more-menu[open] > summary { color: var(--ink); background: var(--surface-soft); }
.rf-more-actions { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0;
  display: flex; flex-direction: column; min-width: 190px; padding: 6px;
  border: 1px solid var(--rule-dk); border-radius: 6px; background: var(--surface);
  box-shadow: var(--shadow-md); }
.rf-more-actions button { width: 100%; justify-content: flex-start;
  text-align: left; white-space: nowrap; }
body.rf-full .topbar { padding: 7px 18px; flex-wrap: nowrap; align-items: center; }
body.rf-full .whoami { margin-left: 14px; white-space: nowrap; }

@media (min-width: 1101px) {
  body.rf-full { height: 100vh; display: flex; flex-direction: column;
    overflow: hidden; }
  body.rf-full #view-flowtask { flex: 1; min-height: 0; display: flex;
    flex-direction: column; padding: 8px 10px; }
  body.rf-full .rf-split { flex: 1; min-height: 0; align-items: stretch;
    gap: 0; }
  body.rf-full .rf-left-col { position: static; max-height: none;
    min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  body.rf-full .rf-left { flex: 1; min-height: 0; display: flex;
    flex-direction: column; margin-bottom: 0; }
  /* Every cell is exactly one slide tall: the preview box keeps the slide's
     aspect ratio (--rf-slide-aspect) whatever the column count, so no blank
     space sits under a slide and the grid scrolls when rows overflow */
  body.rf-full .rf-grid { flex: 1; min-height: 0; overflow-y: auto;
    grid-auto-rows: max-content; align-content: start; }
  body.rf-full .rf-cell { min-height: 0; display: flex; flex-direction: column;
    background: none; border: 0; padding: 0 2px; }
  body.rf-full .rf-cell figcaption { flex: none; }
  body.rf-full .rf-cell img { flex: none; width: 100%; height: auto;
    aspect-ratio: var(--rf-slide-aspect); object-fit: contain; object-position: top left; }
  body.rf-full .rf-cell .rf-missing { flex: none; display: grid; place-items: center;
    aspect-ratio: var(--rf-slide-aspect); min-height: 0;
    background: var(--surface-soft); border: 1px solid var(--rule); border-radius: 6px; }
  body.rf-full .rf-right { min-height: 0; overflow-y: auto; margin-bottom: 0; }
  /* Stick at the scroll edge, not below the card's 14px padding, so no
     scrolled criterion text shows above the bar. */
  body.rf-full .rf-right .rf-crit-bar { top: -14px; }
}
.rf-topbar #rf-judge-all, .rf-scores-btn { white-space: nowrap; }
body.rf-full footer { display: none; }
body.rf-full .brand, body.rf-full .topnav, body.rf-full .whoami { flex: none; }
body.rf-full .brand-sub { display: none; }
.rf-task-heading {
  flex: 1 1 auto;
  min-width: 100px;
}
.rf-task-heading #rf-task-creator {
  display: block;
  overflow-wrap: anywhere;
}
.rf-task-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.rf-task-actions button {
  white-space: nowrap;
}
.rf-topbar #rf-status {
  max-width: 200px;
  overflow-wrap: anywhere;
}
.rf-topbar #rf-scores, .rf-topbar .rf-stage { flex: none; }


.hub-btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: 6px; border: 1px solid #ccc; background: var(--surface);
  box-shadow: var(--edge-neutral); color: var(--ink);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.hub-btn:hover { border-color: #aaa; }
.hub-btn:active { transform: translateY(2px); box-shadow: none; }
.hub-btn.quiet { border-color: transparent; box-shadow: none; color: var(--muted); }
.hub-btn.quiet:hover { background: #e4e4ee; color: var(--ink); }
.hub-btn:disabled { border-color: var(--rule-dk); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.hub-btn:disabled:hover { border-color: var(--rule-dk); }


.rf-split .rf-right[hidden] { display: none; }
.rf-dialog { border: 0; border-radius: 6px; padding: 16px; max-width: 640px;
  width: 90vw; box-shadow: 0 16px 48px rgba(26, 26, 46, 0.18); }
.rf-regen-dialog { max-width: 1040px; }
.rf-dialog::backdrop { background: rgba(26, 26, 46, 0.35); }
.rf-dialog h3 { margin: 0 0 6px; }
.rf-dialog textarea { width: 100%; margin: 8px 0; }
.rf-skip-label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.rf-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* tasks list groups: yours first */
.task-group-h { margin: 4px 0 6px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.025em; color: var(--muted); }
.task-group-h + .task-row-link { margin-top: 0; }
.task-group-h:nth-of-type(2) { margin-top: 14px; }


/* new-task page: the flow, as a chart rather than an essay */
.rf-chart { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.rf-chart-node { background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; font-weight: 500; }
.rf-chart-node .muted { font-weight: 400; font-size: 12px; }
.rf-chart-arrow { text-align: center; color: var(--faint); font-size: 12px; line-height: 1.1; }

/* generate dialog: input files with reference flags */
.rf-regen-inputs { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.rf-regen-file { display: flex; gap: 8px; align-items: center; font-size: 13px;
  padding: 4px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--rule); }
.rf-regen-file.new { background: #f5f4ff; }
.rf-regen-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-add-files { color: var(--accent-strong); font-weight: 600; cursor: pointer; }

.rf-cell.rf-thumb img { cursor: zoom-in; }
.rf-cap-btn { cursor: pointer; text-decoration: underline dotted; }
.rf-cap-btn:hover { color: var(--accent-strong); }

/* criteria: guidance, filters and clear row actions */
.rf-review-intro { margin: 0 0 14px; padding: 12px 14px; border-radius: 6px;
  background: var(--surface-accent); box-shadow: inset 0 0 0 1px var(--accent-on); }
.rf-review-intro h3 { margin: 0 0 4px; font-size: 15px; }
.rf-review-intro p { margin: 0; color: var(--muted); font-size: 12.5px;
  line-height: 1.45; }
.rf-verdict-guide { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: 8px 6px 10px; padding: 8px 10px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 11.5px; }
.rf-guide-result { font-weight: 750; }
.rf-guide-result.pass { color: var(--green); }
.rf-guide-result.fail { color: var(--red); }
.rf-verdict-dialog { width: min(560px, calc(100vw - 32px)); }
.rf-verdict-dialog-head { display: flex; justify-content: space-between;
  gap: 16px; align-items: flex-start; }
.rf-verdict-dialog-head h3 { margin: 1px 0 0; }
.rf-verdict-result { display: inline-flex; margin: 16px 0 12px; padding: 6px 10px;
  border-radius: 999px; font-weight: 800; }
.rf-verdict-result.pass { color: var(--green); background: var(--green-bg); }
.rf-verdict-result.fail { color: var(--red); background: var(--red-bg); }
.rf-verdict-copy { padding: 12px 14px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule); }
.rf-verdict-copy b { font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.045em; color: var(--faint); }
.rf-verdict-copy p { margin: 3px 0 13px; line-height: 1.5; }
.rf-verdict-copy p:last-child { margin-bottom: 0; }
.rf-crit-toggle { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule);
  vertical-align: middle; margin: 0 6px; }
.rf-crit-toggle button { border: 0; background: none; font: 500 12px var(--sans);
  padding: 3px 10px; border-radius: 5px; cursor: pointer; color: var(--muted); }
.rf-crit-toggle button.on { background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink); }
.rf-crit-group { margin: 10px 0 4px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.025em; color: var(--muted); }
.rf-crit { position: relative; container-type: inline-size; }
.rf-crit .rf-crit-actions { display: flex; gap: 6px; justify-content: flex-end;
  margin-top: 8px; }
.rf-crit-actions > .rf-cat { display: inline-flex; align-items: center;
  justify-content: center; height: 26px; padding: 0; margin-left: 0;
  margin-right: 0; line-height: 1; }
.rf-crit-actions .hub-btn { height: 26px; padding: 0 10px; font-size: 12px;
  background: var(--surface); }
.rf-crit-actions .rf-del { color: var(--muted); border-color: transparent; box-shadow: none; background: none; }
.rf-crit-actions .rf-del:is(:hover, :focus-visible):not(:disabled) { color: var(--red); background: var(--red-bg); }
.rf-code-check { margin-right: auto; align-self: center; }
.rf-consistency-slot { margin-right: auto; display: inline-flex; align-items: center;
  width: 176px; height: 26px; }
/* The commentary under the criterion: its pills, then (unless fine) the
   points, never truncated; the pills open the full commentary in a popover. */
.rf-audit-btn { flex: none; }
.rf-audit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 0;
  font-size: 12px; line-height: 1.5; color: var(--ink); }
.rf-audit-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rf-audit-sr { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }
.rf-audit-pill, .rf-audit-stale { display: inline-block;
  padding: 2px 7px; border-radius: 999px; font: 650 10.5px/1.4 var(--sans);
  vertical-align: 1px; white-space: nowrap; }
.rf-audit-pill { background: var(--surface-soft); color: var(--stability-pill-text); }
.rf-audit[data-verdict="issue"] .rf-audit-pill { background: var(--amber-bg); color: var(--amber); }
.rf-audit-stale { background: var(--surface-accent); color: var(--accent-strong); }
.rf-audit[data-earlier] .rf-audit-pills .rf-audit-pill { background: none; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--rule-dk); }
.rf-audit-trigger { min-height: 24px; margin-inline-start: -4px; padding: 0 4px; border: 0;
  border-radius: 999px; background: none; font: inherit; color: inherit; cursor: pointer; }
.rf-audit-trigger:hover .rf-audit-pill { box-shadow: inset 0 0 0 1px var(--rule-dk); }
.rf-audit[data-verdict="issue"] .rf-audit-trigger:hover .rf-audit-pill { box-shadow: inset 0 0 0 1px var(--amber); }
.rf-audit-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The comment popover: native light-dismiss, under its trigger. */
.rf-audit-pop { box-sizing: border-box; width: max-content; max-width: min(36rem, calc(100vw - 32px));
  margin: 0; inset: auto; padding: 12px; border: 1px solid var(--rule-dk); border-radius: 8px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md);
  font-size: 12.5px; line-height: 1.5; }
@supports (position-area: block-end) {
  .rf-audit-pop { position-area: block-end span-inline-end; margin-block-start: 4px;
    position-try-fallbacks: flip-block, flip-inline; }
}
.rf-audit[data-verdict="issue"] .rf-audit-pop .rf-audit-pill { background: var(--amber-bg); color: var(--amber); }
.rf-audit-pop-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rf-audit-pop-head time { margin-inline-start: auto; padding-inline-start: 8px; color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; }
.rf-audit-pop > p { margin: 8px 0 0; }
.rf-audit-body { flex-basis: 100%; min-width: 0; }
.rf-audit-body > :first-child { margin-block-start: 2px; }
.rf-audit-note { margin: 8px 0 0; color: var(--muted); }
.rf-audit-comment { white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
/* One row per point: its label pill, then the full text. */
.rf-audit-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rf-audit-points li { display: flex; align-items: baseline; gap: 8px; }
.rf-audit-points li .rf-audit-pill { flex: none; }
.rf-audit-points p { margin: 0; }
.rf-audit-suggestion { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--rule-dk); border-radius: 6px; }
.rf-audit-suggestion h5 { margin: 0; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.rf-audit-suggestion p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rf-criterion-form > .rf-audit { margin: 0; padding: 10px 16px; border-block-start: 1px solid var(--rule); }
/* The commentary card: same height, radius and edge as the grading card. */
.rf-commentary { flex: 0 1 auto; min-width: 0; max-width: 100%; border-radius: 6px;
  background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--rule); }
/* 7px + the 30px button + 7px = the grading card's 44px row, so both heads
   share a centre line; a wrapped tally drops below with the pills' own gap. */
.rf-commentary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  min-height: 44px; padding: 7px 14px; box-sizing: border-box; }
.rf-commentary-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.rf-audit-status { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* The count of criteria per comment pill, above the notes. */
.rf-judge-head { cursor: pointer; }
/* Once a run is on, or commentary is in, the card takes the room left of the
   grading card and grows downward. */
.rf-commentary:not([data-state="idle"]) { flex: 1 1 420px; }
/* While a run is on or has failed, the live row stands in for the header. */
.rf-commentary:is([data-state="running"], [data-state="failed"]) .rf-commentary-head { display: none; }
.rf-audit-live { background: none; box-shadow: none; }
.rf-audit-live .rf-judge-head { height: auto; min-height: 44px; flex-wrap: wrap; row-gap: 0; }
.rf-audit-live .rf-judge-main { cursor: default; }
/* The commentary card grows to show its history, so it never covers the
   notes below it; only the grading card's history floats. */
.rf-audit-live.rf-judge-row .rf-judge-drop { position: static; margin: 0; background: none; box-shadow: none; }
.rf-audit-live .rf-judge-detail { white-space: normal; overflow: visible; }
.rf-audit-live .rf-judge-log span { white-space: normal; overflow: visible; }
.rf-audit-retry { color: var(--accent-strong); font-weight: 500; }
.rf-audit-tally { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; }
.rf-audit-tally .rf-audit-pill[data-tone="issue"] { background: var(--amber-bg); color: var(--amber); }
.rf-audit-tally b { font-weight: 650; font-variant-numeric: tabular-nums; opacity: 0.75; }
/* Set-level notes, option B (spike/notes-column): a plain list in the right
   column above the criteria bar, folded with a native <details>. */
/* Same 14px gap below as the review intro above it; rows split by a rule
   with the criterion card's 10px inset, 6px (the criteria list gap) inside. */
.rf-notes { margin: 0 0 14px; padding: 8px 14px 12px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule); }
.rf-notes > summary { cursor: pointer; font-family: var(--serif); font-weight: 400; font-size: 17px; }
.rf-notes[open] > summary { margin-bottom: 4px; }
.rf-notes-list { list-style: none; margin: 0; padding: 0; }
.rf-notes-item { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--rule); }
.rf-notes-item:last-child { padding-bottom: 0; }
.rf-notes-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rf-notes-item p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
.rf-audit-card-label { padding: 2px 8px; border-radius: 999px; font: 650 10.5px/1.4 var(--sans);
  background: var(--accent-on); color: var(--accent-strong); }
.rf-audit-card-label[data-tone="warn"] { background: var(--amber-bg); color: var(--amber); }
.rf-audit-card-label[data-tone="neutral"] { background: var(--surface-card); color: var(--stability-pill-text); }
.rf-audit-card-metric { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.rf-audit-card-crits { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.rf-audit-crit { position: relative; display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border: 1px solid var(--rule-dk); border-radius: 999px; background: var(--surface);
  font: 500 11px/1 var(--mono); color: var(--accent-strong); cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s; }
.rf-audit-crit::before { content: ""; position: absolute; inset: -3px -1px; }
button.rf-audit-crit:hover { border-color: var(--accent); background: var(--surface-accent); }
button.rf-audit-crit:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
span.rf-audit-crit { border-style: dashed; color: var(--muted); cursor: default; }
/* A chip's criterion row, once it is scrolled to. */
.rf-crit.rf-flash { animation: rf-audit-flash 1.6s cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes rf-audit-flash {
  from { background-color: var(--accent-on); box-shadow: 0 0 0 2px var(--accent); }
}
.rf-consistency-pill { border: 1px solid var(--rule-dk);
  border-radius: 999px; padding: 0 8px; background: #eeeef4;
  color: var(--stability-pill-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; height: 26px; box-sizing: border-box;
  font: 750 10.5px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.rf-consistency-pill:hover { border-color: var(--rule-dk); background: #eeeef4; }
.rf-consistency-pill.mixed { border-color: var(--red); background: var(--red-bg);
  color: var(--stability-danger); }
.rf-consistency-pill.mixed:hover { border-color: var(--stability-danger); background: var(--red-bg); }
.rf-consistency-pill:focus-visible { outline: 2px solid var(--accent);
  outline-offset: 2px; }
.rf-consistency-unchecked, .rf-consistency-inline, .rf-consistency-checking {
  color: var(--stability-text); font: inherit; font-size: 10.5px; }
.rf-consistency-unchecked, .rf-consistency-inline {
  border: 0; padding: 0; background: transparent; }
/* Not graded is a badge, not a control: only the reviewable pill is clickable. */
.rf-consistency-inline { cursor: pointer; }
.rf-consistency-inline:hover {
  text-decoration: underline; text-underline-offset: 2px; }
.rf-consistency-inline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px; }
.rf-consistency-checking { display: inline-flex; align-items: center; gap: 5px;
  cursor: wait; white-space: nowrap; }
.rf-consistency-checking.queued { cursor: default; }
@container (max-width: 420px) {
  .rf-crit-actions { flex-wrap: wrap; }
  .rf-crit-actions > .rf-cat { margin-right: auto; }
  .rf-consistency-slot { order: 1; flex: 1 0 100%; width: auto; }
}
.rf-consistency-spinner { width: 9px; height: 9px; flex: 0 0 9px;
  border: 1.5px solid var(--rule-dk); border-top-color: var(--stability-text); border-radius: 50%;
  animation: rf-consistency-spin 0.7s linear infinite; }
@keyframes rf-consistency-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .rf-consistency-spinner { animation: none; }
}
.rf-consistency-panel { margin: 8px -4px -4px; padding: 8px;
  border-radius: 5px; background: #f3f3f7; }
.rf-consistency-heading { color: var(--ink); font-size: 11px; font-weight: 650; }
.rf-consistency-guidance { margin: 2px 0 7px; color: var(--stability-text);
  font-size: 10.5px; line-height: 1.4; }
.rf-consistency-deck { margin-top: 4px; }
.rf-consistency-deck > summary { display: flex; align-items: center; gap: 8px;
  cursor: pointer; color: var(--ink); font-size: 10.5px; font-weight: 650; }
.rf-consistency-deck > summary::before { content: "▸"; color: var(--faint); }
.rf-consistency-deck[open] > summary::before { content: "▾"; }
.rf-deck-consistency { margin-left: auto; color: var(--stability-text);
  font-size: 9.5px; font-weight: 700; }
.rf-deck-consistency.mixed { color: var(--stability-danger); }
.rf-judge-outputs { padding: 2px 0 1px 14px; }
.rf-judge-output { padding: 5px 0 2px; }
.rf-judge-output-head { display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px; }
.rf-judge-name { color: var(--stability-text); font-size: 8.5px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; }
.rf-judge-verdict { margin-left: auto; padding: 1px 5px; border-radius: 4px;
  font-size: 9px; font-weight: 750; }
.rf-judge-verdict.pass { color: var(--stability-success); background: var(--green-bg); }
.rf-judge-verdict.fail { color: var(--stability-danger); background: var(--red-bg); }
.rf-judge-output p { margin: 0; color: var(--stability-text); font-size: 10.5px;
  line-height: 1.4; }
.rf-crit-check { cursor: pointer; line-height: 1.42; }
.rf-crit-check:hover { color: var(--accent-strong); }
.rf-crit-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* full-width judging view + runs grid */
#view-flowtask.view { padding-left: 4px; padding-right: 4px; }
#all-runs-list { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }

/* create-task as the first row of the list */
.task-create-row { justify-content: center; color: var(--accent-strong);
  font-weight: 600; box-shadow: none; border: 1px dashed var(--rule-dk);
  background: none; text-decoration: none; }
.task-create-row:hover { background: var(--surface); border-style: solid; }

/* runs page: grouped, one line per run */
#all-runs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px 16px; align-items: start; }
.run-group { background: var(--surface); border-radius: 6px; box-shadow: inset 0 0 0 1px var(--rule); padding: 8px 10px; }
.run-group .task-group-h { margin: 0 0 4px; }
.run-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 5px 6px; border-radius: 5px; text-decoration: none; color: var(--ink); }
.run-line:hover { background: var(--surface-soft); }
.run-line .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-line .small { white-space: nowrap; }
.run-load-all { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }
.rf-prompt-text { white-space: pre-wrap; font: 13px/1.5 var(--sans); margin: 8px 0;
  max-height: 60vh; overflow-y: auto; padding: 10px 12px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule); }
.rf-ai-check { margin: 0 0 10px; }
.rf-ai-check.is-flagged { padding: 10px 12px; border: 2px solid var(--red); border-radius: 6px;
  background: var(--red-bg); color: var(--ink); }
.rf-ai-check-title { margin-bottom: 8px; color: var(--red); font-size: 14px; font-weight: 800; }
.rf-ai-check-file { margin: 0 0 8px; padding: 7px 9px; border-radius: 6px; background: var(--surface); }
.rf-ai-check-name { font-weight: 700; overflow-wrap: anywhere; }
.rf-ai-check-verdict { color: var(--red); font-size: 11px; font-weight: 700; }
.rf-ai-check-reason { margin-top: 3px; font-size: 12px; }
.rf-ai-check-file ul { margin: 6px 0 0; padding-left: 18px; font-size: 11px; overflow-wrap: anywhere; }
.rf-prompt-panel { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px;
  background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--rule); }
.rf-prompt-panel > summary { cursor: pointer; font-weight: 700; }
.rf-prompt-panel .rf-prompt-text { margin: 6px 0 0; max-height: 32vh; background: var(--surface); }
.rf-prompt-files { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.rf-prompt-files-label { margin-bottom: 6px; color: var(--faint); font-size: 10px;
  font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.rf-prompt-file-list { display: flex; flex-direction: column; gap: 5px; }
.rf-prompt-file { display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 7px 9px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); color: var(--ink); text-decoration: none; }
.rf-prompt-file:hover { border-color: var(--accent); background: var(--surface-accent, #eeecfc); }
.rf-prompt-file-mark { flex: 0 0 auto; color: var(--accent-strong); font-weight: 800; }
.rf-prompt-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px; font-weight: 650; }
.rf-prompt-file-kind { flex: 0 0 auto; color: var(--muted); font-size: 10.5px; }
.rf-prompt-files-empty { margin: 0; }
.rf-topbar button.on { background: #e4e4ee; }

/* These responsive workbench overrides must follow the desktop full-height
   rules above so the task header wraps and the expert guidance comes first. */
@media (max-width: 1100px) {
  /* Slides first and pinned, so a selected criterion's badges stay in view. */
  .rf-left-col { position: sticky; top: 0; z-index: 5; height: 42vh; max-height: none;
    overflow-y: auto; background: var(--bg); }
  .rf-crit-bar { top: 42vh; }
  .rf-left-col > .rf-left { min-height: 100%; box-sizing: border-box; margin-bottom: 0; }
  body.rf-full .topbar { flex-wrap: wrap; }
  body.rf-full .rf-topbar { order: 2; flex-basis: 100%; margin-left: 0; flex-wrap: wrap; }
  body.rf-full .rf-topbar h2 { min-width: 0; }
  body.rf-full .rf-task-heading {
    flex-basis: calc(100% - 100px);
  }
  body.rf-full .whoami { margin-left: auto; }
}
@media (max-width: 900px) {
  body.rf-full .rf-topbar #rf-scores { order: 1; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .rf-left .viewer-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .rf-left .viewer-controls { flex-wrap: wrap; gap: 6px; }
}

/* Platform invitations */
.admin-card {
  max-width: 900px;
  margin: 0 auto;
}
.admin-add-person {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 24px 0 12px;
}
.admin-add-person .field {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.admin-add-person button {
  flex: none;
}
.admin-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}
.admin-person {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.admin-person-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-person button,
.admin-role {
  flex: none;
}
.admin-role {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .admin-add-person {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-person {
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin-person-details {
    flex-basis: 100%;
  }
}

/* Expert review block, above the criteria list in the rubric panel. */
.rf-expert { border: 1px solid var(--line, #e3e3ea); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; display: grid; gap: 10px; }
.rf-expert .field { display: grid; gap: 4px; }
.rf-expert .field > span { font-size: 13px; font-weight: 600; }
.rf-expert .hint { font-weight: 400; font-style: normal; color: var(--muted, #6b6b80); }
.rf-step { margin: 16px 0 6px; font-size: 15px; font-weight: 700; color: var(--accent); }
.rf-step-link { margin: 0 0 12px; font-size: 13px; }
.rf-expert-slider { display: flex; align-items: center; gap: 8px; max-width: 420px; }
.rf-expert-slider input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.rf-expert-slider input[data-unset] { opacity: 0.45; }
.rf-expert-slider input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.rf-step1 > summary { cursor: pointer; }
.rf-step1[open] > summary { margin-bottom: 10px; }
.rf-expert-end { font-size: 12px; color: var(--muted, #6b6b80); }
.rf-expert-slider output { min-width: 56px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rf-expert textarea { width: 100%; resize: vertical; }
.rf-expert [aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }
.rf-expert #rf-expert-saved { margin: 0; min-height: 16px; }
.rf-expert #rf-expert-saved.err { color: var(--red); }

/* Keep sign-in and session recovery centered above the current view. */
.auth-notice {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 8px 32px #0002;
}
.auth-notice a {
  display: inline-block;
  margin-right: 1rem;
}
.auth-notice button {
  margin-top: 0.5rem;
}
