/* MS CPA Engagement Review POC — shared styles.
   Color roles follow the dataviz reference palette (light mode). */

:root {
  color-scheme: light;
  --page:          #f9f9f7;
  --surface:       #fcfcfb;
  --ink:           #0b0b0b;
  --ink-2:         #52514e;
  --muted:         #898781;
  --grid:          #e1e0d9;
  --baseline:      #c3c2b7;
  --border:        rgba(11, 11, 11, 0.10);

  --series-1:      #2a78d6;   /* blue  — current year / primary accent */
  --series-1-lt:   #86b6ef;   /* blue 250 — prior year (ordinal pair) */
  --violet:        #4a3aa7;

  --st-good:       #0ca30c;
  --st-good-text:  #006300;
  --st-warn:       #fab219;
  --st-warn-text:  #8a5b00;
  --st-serious:    #ec835a;
  --st-serious-text:#a34310;
  --st-crit:       #d03b3b;
  --st-crit-text:  #a02020;

  --wash-good:     rgba(12, 163, 12, 0.10);
  --wash-warn:     rgba(250, 178, 25, 0.14);
  --wash-serious:  rgba(236, 131, 90, 0.14);
  --wash-crit:     rgba(208, 59, 59, 0.10);
  --wash-blue:     rgba(42, 120, 214, 0.10);

  --radius: 10px;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 4px 14px rgba(11,11,11,.06);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  transition: background-color .5s ease;
}
/* MultiPass mode washes the whole page purple — the doc set outgrew a single
   pass. Overriding the page/surface vars carries the tint through every card. */
body.mode-multi {
  --page:    #e4ddf5;
  --surface: #f3effb;
}
h1, h2, h3 { margin: 0; font-weight: 650; }
a { color: var(--series-1); }
button { font-family: inherit; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--grid);
  transition: background-color .5s ease, border-color .5s ease;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand .poc {
  margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--wash-blue); color: var(--series-1);
  font-size: 11px; font-weight: 650; letter-spacing: .4px;
}

/* the What's-New pill: a details popover riding the .poc pill style */
.brand .whatsnew { display: inline-block; position: relative; }
.brand .whatsnew > summary { list-style: none; cursor: pointer; display: inline-block; }
.brand .whatsnew > summary::-webkit-details-marker { display: none; }
.brand .whatsnew[open] > summary { background: var(--series-1); color: #fff; }
.wn-pop {
  position: absolute; z-index: 80; top: 26px; left: 0;
  width: 420px; max-width: 86vw; padding: 12px 16px;
  font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 1.5;
  color: var(--ink); text-align: left; white-space: normal;
  background: var(--surface); border: 1px solid var(--grid); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(11, 11, 11, 0.16);
}
.wn-pop b { color: var(--ink); }
.wn-pop ol { margin: 8px 0 2px; padding-left: 18px; }
.wn-pop li { margin-bottom: 8px; }
/* the popover carries the newest date only; earlier ones are one click away */
.wn-all { display: inline-block; margin-top: 6px; font-size: 12.5px;
          font-weight: 600; color: var(--series-1); text-decoration: none; }
.wn-all:hover { text-decoration: underline; }
.topbar .spacer { flex: 1; }
.engagement-tag { color: var(--ink-2); font-size: 13px; }
.logout { color: var(--muted); font-size: 13px; text-decoration: none; }
.logout:hover { color: var(--ink-2); }
/* "you are here": current page shows in the nav but isn't clickable */
.nav-here {
  color: var(--ink); font-weight: 700; cursor: default;
  border-bottom: 2px solid var(--series-1); padding-bottom: 2px;
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(42,120,214,.08), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(27,175,122,.07), transparent 60%),
    var(--page);
}
.login-card { width: 400px; padding: 36px 34px 30px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 22px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.login-card input[type="password"] {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--baseline); border-radius: 8px; background: #fff;
}
.login-card input[type="password"]:focus { outline: 2px solid var(--series-1); border-color: transparent; }
.btn-primary {
  width: 100%; margin-top: 16px; padding: 11px 16px;
  background: var(--series-1); color: #fff; border: 0; border-radius: 8px;
  font-size: 14.5px; font-weight: 650; cursor: pointer;
}
.btn-primary:hover { background: #256abf; }
.btn-primary:disabled { background: var(--baseline); cursor: not-allowed; }
.login-error {
  margin-top: 14px; padding: 9px 12px; border-radius: 8px;
  background: var(--wash-crit); color: var(--st-crit-text); font-size: 13px;
}
.login-foot { margin-top: 20px; color: var(--muted); font-size: 11.5px; }

/* ---------- workbench ---------- */
.wb-main { max-width: 1100px; margin: 26px auto 60px; padding: 0 22px; display: grid; gap: 18px; }

/* ---------- 4-step pipeline ----------
   Each configurable step carries a theme color (--th) with a pastel fill.
   Its bubble, and the matching change-panel below, share the color so the
   mapping is obvious. */
.theme-docs   { --th: #2a78d6; --th-text: #1d5eae; --th-wash: rgba(42,120,214,.10); --th-pastel: #e9f2fd; --th-border: #bcd7f5; }
.theme-prompt { --th: #e09f00; --th-text: #8a5b00; --th-wash: rgba(250,178,25,.16); --th-pastel: #fdf4dd; --th-border: #efd79e; }
.theme-model  { --th: #0ca30c; --th-text: #006300; --th-wash: rgba(12,163,12,.10);  --th-pastel: #e8f7e8; --th-border: #b6e3b6; }
.theme-run    { --th: #4a3aa7; --th-text: #4a3aa7; --th-wash: rgba(74,58,167,.10);  --th-pastel: #edeafb; --th-border: #cec6f1; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 980px) { .steps-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps-row { grid-template-columns: 1fr; } }

/* double-height segments: badge | label + value + preview | chevron,
   with a big watermark count in the corner where applicable */
.step-bubble {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  min-height: 152px; position: relative;  /* no overflow:hidden — the open-tab notch hangs below */
  padding: 13px 14px; border-radius: 12px;
  background: var(--th-pastel); border: 1px solid var(--th-border);
  font-family: inherit; font-size: inherit; color: var(--ink);
  transition: box-shadow .15s ease, background .2s ease, border-color .2s ease;
}
button.step-bubble { cursor: pointer; }
button.step-bubble:hover { box-shadow: 0 2px 10px var(--th-wash), var(--shadow); }
.step-bubble:not(.ready) {
  background: color-mix(in srgb, var(--th-pastel) 40%, #f5f5f2);
  border-color: var(--grid);
}

/* open = active tab: solid theme fill + notch pointing into its panel */
.step-bubble.open { position: relative; background: var(--th); border-color: var(--th); }
.step-bubble.open::after {
  content: ""; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--th);
}
.step-bubble.open .step-name,
.step-bubble.open:not(.ready) .step-name { color: rgba(255,255,255,.8); }
.step-bubble.open .step-value,
.step-bubble.open:not(.ready) .step-value,
.step-bubble.open .step-value .sub { color: #fff; }
.step-bubble.open > .chev { color: #fff; }
.step-bubble.open .step-badge,
.step-bubble.ready.open .step-badge { background: #fff; border-color: #fff; color: var(--th-text); }
.step-bubble.open .gauge i { background: rgba(255,255,255,.35); }
.step-bubble.open .gauge i.on { background: #fff; }

.step-badge {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--muted);
  border: 1.5px solid var(--baseline);
  transition: background .2s ease, color .2s ease;
}
.step-badge svg { width: 15px; height: 15px; display: block; }
.step-bubble.ready .step-badge { background: var(--th); border-color: var(--th); color: #fff; }
/* small corner check once the step is configured */
.step-bubble.ready .step-badge::after {
  content: ""; position: absolute; right: -4px; bottom: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid #fff;
  background: var(--th-text) center / 7px 7px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='white' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.step-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; position: relative; z-index: 1; }
.theme-run .step-body { justify-content: center; align-self: stretch; }

/* docs card: first few filenames */
.step-files { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; min-width: 0; }
.step-files .f {
  font-size: 10.5px; color: var(--ink-2); max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 13px; position: relative;
}
.step-files .f::before { content: "▸"; position: absolute; left: 2px; font-size: 8px; top: 2px; color: var(--th-text); opacity: .6; }
.step-files .f.empty { color: var(--muted); font-style: italic; padding-left: 0; }
.step-files .f.empty::before { content: none; }
.step-files .more { font-size: 13px; font-weight: 700; color: var(--th-text); line-height: .7; padding-left: 13px; }

/* prompt/engine cards: a few lines of preview text */
.step-excerpt {
  font-size: 11px; color: var(--ink-2); line-height: 1.5; margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* big watermark count (docs card): large numeral + small "file(s)" unit */
.step-count {
  position: absolute; right: 12px; bottom: 6px; z-index: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end;
  color: rgba(11, 11, 11, .10);
}
.step-count i {
  font-family: Impact, "Arial Black", "Helvetica Neue", sans-serif; font-weight: 900;
  font-style: normal; font-size: 56px; line-height: .9; letter-spacing: -2px;
}
.step-count em {
  font-style: normal; font-size: 11px; font-weight: 800;
  letter-spacing: 2.5px; text-transform: uppercase;
}

/* open (solid fill) recolors for the preview content */
.step-bubble.open .step-files .f,
.step-bubble.open .step-excerpt { color: rgba(255,255,255,.88); }
.step-bubble.open .step-files .f::before,
.step-bubble.open .step-files .more { color: rgba(255,255,255,.75); }
.step-bubble.open .step-count { color: rgba(255,255,255,.22); }
.step-name { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--th-text); }
.step-bubble:not(.ready) .step-name { color: var(--muted); }
.step-value {
  font-size: 13px; font-weight: 650; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.step-value .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-value .sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.step-bubble:not(.ready) .step-value { color: var(--muted); font-weight: 500; }

.step-bubble > .chev {
  margin-left: auto; flex: none; font-size: 13px; color: var(--th-text);
  transition: transform .2s ease;
}
.step-bubble.open > .chev { transform: rotate(180deg); }

/* engine-strength gauge: 4 segments, deeper green = stronger engine */
.gauge { display: flex; gap: 3px; width: 100%; max-width: 140px; }
.gauge i { flex: 1; height: 6px; border-radius: 3px; background: rgba(11,11,11,.10); }
.step-body .gauge { max-width: 84px; margin-top: 3px; }
.gauge i.on:nth-child(1) { background: #9ed69e; }
.gauge i.on:nth-child(2) { background: #5cbb5c; }
.gauge i.on:nth-child(3) { background: #22a022; }
.gauge i.on:nth-child(4) { background: #0b7d0b; }
.m-gauge { max-width: 84px; flex: none; width: 84px; }

/* change-panels: one visible at a time, framed in the step's theme color */
.step-panel {
  border: 1.5px solid var(--th); border-top-width: 3px;
  background: linear-gradient(var(--th-wash), transparent 120px), var(--surface);
  box-shadow: var(--shadow); animation: fadeIn .2s ease;
}
.step-panel h2 { color: var(--th-text); }
.panel-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.step-panel .bundle.selected,
.step-panel .prompt-item.selected,
.step-panel .model-item.selected { border-color: var(--th); box-shadow: 0 0 0 2px var(--th-wash); }
.step-panel .btn-small { background: var(--th); }
.step-panel .btn-small:hover { filter: brightness(.94); }

.panel { padding: 20px 22px; }
.panel h2 { font-size: 14px; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }

.dropzone {
  border: 2px dashed var(--baseline); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; color: var(--ink-2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone.dragover { border-color: var(--series-1); background: var(--wash-blue); }
.dropzone .dz-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.dz-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }
.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--baseline); background: var(--surface);
  border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--series-1); color: var(--series-1); }

/* documents render as squarish cards in a 2-column grid, indented inside
   the set card so the hierarchy (set -> documents) reads at a glance.
   The dropzone is just the last card in the grid (display:contents lets
   the JS-refreshed doclist share the grid with it). */
.docgrid { margin: 14px 0 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 760px) { .docgrid { grid-template-columns: 1fr; margin-left: 14px; } }
.doclist { display: contents; }
.doc {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--grid); border-radius: 8px;
  background: #fff; opacity: 0; transform: translateY(4px);
  animation: docIn .3s ease forwards;
}
@keyframes docIn { to { opacity: 1; transform: none; } }
.doc .ico { font-size: 17px; text-align: center; }
.doc .meta { min-width: 0; }
.doc .meta .name {
  font-size: 13px; font-weight: 600; color: var(--series-1);
  cursor: pointer; overflow-wrap: anywhere;
}
.doc .meta .name:hover { text-decoration: underline; }
.doc .meta .sub { font-size: 11px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.doc .meta .sub .doctype { color: var(--series-1); font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.queued   { background: #f0efec; color: var(--muted); }
.pill.transfer { background: var(--wash-blue); color: var(--series-1); }
.pill.encrypt  { background: rgba(74,58,167,.10); color: var(--violet); }
.pill.classify { background: var(--wash-warn); color: var(--st-warn-text); }
.pill.done     { background: var(--wash-good); color: var(--st-good-text); }
.pill .spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.docbar { height: 3px; border-radius: 2px; background: var(--grid); margin-top: 6px; overflow: hidden; }
.docbar > i { display: block; height: 100%; width: 0%; background: var(--series-1); border-radius: 2px; transition: width .25s ease; }

/* run panel */
.runchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-block; max-width: 100%;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--grid); background: #fff;
  padding: 4px 10px; border-radius: 999px;
}
.chip b { color: var(--ink); font-weight: 650; }
.btn-engage {
  width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 700;
  border: 0; border-radius: 10px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #2a78d6, #4a3aa7);
  box-shadow: 0 6px 18px rgba(42,120,214,.30);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-engage:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.btn-engage:disabled { background: var(--baseline); box-shadow: none; cursor: not-allowed; }
.run-hint { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* preflight sizing line under the Run button — advisory color only, the
   button itself never locks on it */
.preflight {
  display: block; margin-top: 5px; font-size: 10.5px; line-height: 1.35;
  font-weight: 650; border-radius: 6px; padding: 3px 7px;
}
.preflight.ok    { color: var(--st-good-text);    background: var(--wash-good); }
.preflight.tight { color: var(--st-warn-text);    background: var(--wash-warn); }
.preflight.over  { color: var(--st-serious-text); background: var(--wash-serious); }
.preflight.mp    { color: #d15a00; background: rgba(240, 109, 15, .08); }
/* payload just changed: the previous verdict is stale, show measuring */
.preflight.sizing { color: var(--muted); background: var(--page); font-weight: 500; }
/* rolling-cap projection line (tank % now → after this job) */
.preflight.capline { margin-top: 3px; }
.preflight.sizing::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px;
  border: 2px solid var(--baseline); border-top-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: pf-spin 0.9s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }
.step-bubble .btn-engage { padding: 9px 10px; font-size: 13.5px; border-radius: 9px; }
.step-bubble .run-hint { margin-top: 4px; font-size: 10.5px; text-align: left; line-height: 1.3; }

/* progress stage */
.progress-panel { padding: 22px; display: none; }
.progress-panel.active { display: block; }
.meter { height: 14px; border-radius: 999px; background: #e9f1fb; overflow: hidden; margin: 14px 0 6px; }
.meter > i {
  display: block; height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a78d6, #4a3aa7, #2a78d6);
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
  transition: width .4s ease;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.meter-row .pct { font-weight: 700; color: var(--ink); font-size: 14px; }
.stages { margin-top: 14px; display: grid; gap: 6px; }
.stage { display: flex; gap: 9px; align-items: baseline; font-size: 13px; color: var(--muted); }
.stage .s-ico { width: 16px; text-align: center; }
.stage.active { color: var(--ink); font-weight: 600; }
.stage.done { color: var(--st-good-text); }
.tokenticker { margin-top: 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticker-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.abort-btn {
  font-size: 12px; color: var(--st-crit-text); background: none;
  border: 1px solid rgba(192, 57, 43, .4); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.abort-btn:hover { background: rgba(192, 57, 43, .08); }
.abort-btn:disabled { opacity: .6; cursor: default; }
/* payload is committed while a run is in flight */
.step-bubble.run-locked { opacity: .55; cursor: not-allowed; }
.skip-link { font-size: 12px; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }

.done-banner {
  display: none; margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: var(--wash-good); border: 1px solid rgba(12,163,12,.25);
}
.done-banner.active { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.done-banner .msg { font-size: 13.5px; color: var(--st-good-text); font-weight: 600; }
.done-banner .rerun-link {
  margin-left: 2px; font-size: 12.5px; font-weight: 600; color: var(--st-good-text);
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; opacity: .85;
}
.done-banner .rerun-link:hover { opacity: 1; }
.btn-report {
  padding: 10px 18px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--st-good); color: #fff; font-weight: 700; font-size: 14px;
}

/* ---------- report ---------- */
/* sits below the sticky topbar (top offset = topbar height) */
.rp-head { padding: 16px 22px 0; background: var(--surface); border-bottom: 1px solid var(--grid); position: sticky; top: 43px; z-index: 30; }
.rp-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 1160px; margin: 0 auto; }
.rp-title-row h1 { font-size: 17px; }
.rp-sub { color: var(--ink-2); font-size: 12.5px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge.crit { background: var(--wash-crit); color: var(--st-crit-text); border: 1px solid rgba(208,59,59,.30); }

.tabs { display: flex; gap: 2px; max-width: 1160px; margin: 12px auto 0; overflow-x: auto; }
.tab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--series-1); border-bottom-color: var(--series-1); }
.tab .n {
  margin-left: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #f0efec; color: var(--ink-2);
}
.tab .n.crit { background: var(--wash-crit); color: var(--st-crit-text); }
.tab .n.warn { background: var(--wash-warn); color: var(--st-warn-text); }
.tab .n.serious { background: var(--wash-serious); color: var(--st-serious-text); }

.rp-main { max-width: 1160px; margin: 22px auto 80px; padding: 0 22px; }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { padding: 16px 18px; border-top: 3px solid var(--grid); }
.tile.crit    { border-top-color: var(--st-crit); }
.tile.warn    { border-top-color: var(--st-warn); }
.tile.serious { border-top-color: var(--st-serious); }
.tile.good    { border-top-color: var(--st-good); }
.tile .t-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tile .t-value { font-size: 34px; font-weight: 650; margin: 2px 0; }
.tile .t-sub { font-size: 11.5px; color: var(--muted); }

/* severity chips */
.sev {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  letter-spacing: .2px; white-space: nowrap;
}
.sev.crit    { background: var(--wash-crit);    color: var(--st-crit-text); }
.sev.warn    { background: var(--wash-warn);    color: var(--st-warn-text); }
.sev.serious { background: var(--wash-serious); color: var(--st-serious-text); }
.sev.good    { background: var(--wash-good);    color: var(--st-good-text); }
.sev.info    { background: var(--wash-blue);    color: var(--series-1); }

/* finding cards */
.findings { display: grid; gap: 12px; }
.finding { padding: 16px 18px; border-left: 4px solid var(--grid); }
.finding.crit    { border-left-color: var(--st-crit); }
.finding.warn    { border-left-color: var(--st-warn); }
.finding.serious { border-left-color: var(--st-serious); }
.f-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.f-id { font-size: 12px; font-weight: 700; color: var(--muted); }
.f-area { font-size: 11px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--grid); padding: 2px 8px; border-radius: 999px; }
.f-title { font-size: 14.5px; font-weight: 650; margin-bottom: 6px; }
.f-body { font-size: 13.5px; color: var(--ink-2); }
/* The citation is the one line that ties a finding to a page, and in review
   mode it competes with a colour-coded severity header, figure chips, an
   action block and the disposition panel. A sticky-note yellow makes it the
   landmark the eye returns to. Hardcoded rather than var(--page) on purpose:
   it must stay the same note when MultiPass washes the page purple. */
.f-evidence {
  margin-top: 10px; padding: 10px 12px; border-radius: 3px 3px 8px 3px;
  background: linear-gradient(180deg, #fffce9, #fff5c9);
  border: 1px solid #e3d18a;
  font-size: 12.5px; color: #4a4534;
  box-shadow: 0 1px 2px rgba(90, 74, 0, .10);
}
.f-evidence b { color: #7a5d00; letter-spacing: .2px; }
.f-action { margin-top: 10px; font-size: 13px; }
.f-action b { color: var(--series-1); }
.f-impact { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* charts */
.chartgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 980px) { .chartgrid { grid-template-columns: 1fr; } }
.chartcard { padding: 18px 20px; }
.chartcard h3 { font-size: 13.5px; margin-bottom: 2px; }
.chartcard .c-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.legend .l-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend .l-swatch { width: 10px; height: 10px; border-radius: 3px; }
svg text { font-family: var(--font); }

#tooltip {
  position: fixed; z-index: 90; pointer-events: none; display: none;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4;
  padding: 8px 10px; border-radius: 7px; max-width: 260px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
#tooltip .tt-title { font-weight: 700; }
#tooltip .tt-sub { color: #c3c2b7; }

/* coverage checklist */
.coverage { display: grid; gap: 0; }
.cov-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 6px; border-bottom: 1px solid var(--grid); font-size: 13.5px;
}
.cov-row:last-child { border-bottom: 0; }
.cov-row .c-ico { text-align: center; font-size: 14px; }
.cov-row .c-note { color: var(--muted); font-size: 12px; text-align: right; }

/* sign-off grid (report overview, top): one Pass/Open cell per program area */
.sg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.sg-cell {
  display: grid; grid-template-columns: 20px 1fr; grid-template-rows: auto auto;
  gap: 2px 6px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--grid); border-radius: 8px; font-size: 12px;
}
.sg-cell .sg-num { grid-row: 1 / 3; font-weight: 700; color: var(--muted); text-align: center; }
.sg-cell .sg-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}
.sg-cell .sg-state { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; }
.sg-cell.pass { background: var(--wash-good); }
.sg-cell.pass .sg-state { color: var(--st-good-text); }
.sg-cell.open { background: var(--wash-warn); }
.sg-cell.open .sg-state { color: var(--st-warn-text); }
.sg-cell.open.hot { background: var(--wash-crit); }
.sg-cell.open.hot .sg-state { color: var(--st-crit-text); }

/* tables */
table.rec { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rec th {
  text-align: left; font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--baseline);
}
table.rec td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.rec tr:last-child td { border-bottom: 0; }
table.rec td.num, table.rec th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rec .delta-up { color: var(--st-good-text); font-weight: 600; }
table.rec .delta-down { color: var(--st-crit-text); font-weight: 600; }
tr.rec-flag td { background: rgba(250,178,25,.06); }
/* tiecheck: the row contradicts itself — machine-measured, not model opinion */
.tie-note { margin-top: 4px; font-size: 12px; color: var(--st-crit-text); }
.tie-sum.tie-bad { color: var(--st-crit-text); font-weight: 600; }
/* the fix-list bar: floating remediation status during draft iterations */
.remed-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px;
  z-index: 70; max-width: min(880px, 92vw);
  background: var(--surface); border: 1.5px solid var(--st-warn-text, #8a5b00);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px;
}
.remed-bar.done { border-color: var(--st-good-text, #006300); }
.remed-bar summary { padding: 9px 16px; cursor: pointer; font-weight: 600; }
.remed-line {
  padding: 8px 16px 7px; font-weight: 600; border-bottom: 1px solid var(--grid);
}
.remed-bar > .remed-line:only-child, .remed-bar > .remed-line:last-child { border-bottom: 0; }
/* the manual checklist tick: shiny white until active, green once ticked */
.d-btn.d-resolve {
  background: linear-gradient(180deg, #ffffff, #f1f1ec);
  border: 1px solid var(--baseline); color: var(--st-good-text);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(11,11,11,.14), inset 0 1px 0 #fff;
}
.d-btn.d-resolve:hover { border-color: var(--st-good); }
.d-btn.d-resolve.active {
  background: var(--st-good); border-color: var(--st-good); color: #fff;
  box-shadow: none;
}
.remed-bar .remed-list {
  max-height: 40vh; overflow: auto; padding: 4px 16px 12px;
  border-top: 1px solid var(--grid);
}
.remed-item { margin: 9px 0; }
.remed-chip {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  margin-right: 6px; text-transform: uppercase;
}
.remed-chip.good { background: var(--wash-good, #e4f3e3); color: var(--st-good-text, #006300); }
.remed-chip.warn { background: #fbf1db; color: #8a5b00; }
.remed-chip.crit { background: #f7e8e7; color: #a02020; }
.remed-detail { font-size: 12px; color: var(--ink-2); margin: 2px 0 0 4px; }
.remed-go {
  font-size: 11px; padding: 1px 8px; margin-left: 6px; cursor: pointer;
  border: 1px solid var(--grid); border-radius: 999px; background: var(--surface);
  color: var(--series-1);
}
.remed-go:hover { border-color: var(--series-1); }
.remed-foot {
  padding: 8px 16px 10px; font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--grid); font-style: italic;
}
.remed-warn { color: #a02020; font-weight: 600; }
.remed-ok { color: var(--st-good-text, #006300); }

/* draft swap: the report-header feedback line */
.swap-note { display: block; margin-top: 4px; font-size: 12.5px; color: var(--st-warn-text, #8a5b00); }
.swap-note.good { color: var(--st-good-text, #006300); }

/* casual chat: the home-page pill, the session-file chip, drag-drop states */
.chat-busy-note {
  margin: 10px 14px 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.4;
  color: var(--st-warn-text); background: var(--wash-warn);
  border: 1px solid var(--st-warn); border-radius: 8px;
}

.chat-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px;
  border-radius: 999px; border: 1px solid var(--grid); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none;
  white-space: nowrap;
}
.chat-pill:hover { border-color: var(--th); color: var(--th); }
.dlg-file {
  display: inline-flex; align-items: center; gap: 4px; max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: #9fd49f; font-family: inherit;
}
.dlg-file .dlg-file-x { padding: 0 6px; }
a.dlg-close { text-decoration: none; }
.dlg-dropping { outline: 2px dashed #9fd49f; outline-offset: -6px; }
.chat-standalone { inset: 64px 16px 16px 16px; }
.rv-dlg-attach { font-size: 11px; }
.rv-dlg-head .dlg-btn { padding: 1px 7px; }

/* the tie-out tables as a native evidence viewport */
.tie-scroll { overflow: auto; height: 100%; }
.tie-wrap { padding: 12px 14px 24px; }
.tie-wrap .tie-block h3 {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .02em;
}
.tie-wrap table.rec { font-size: 12px; }
.tie-wrap table.rec td { padding: 6px 8px; }
tr.tie-hot td {
  background: rgba(250,178,25,.18);
  border-top: 2px solid var(--st-warn-text, #8a5b00);
  border-bottom: 2px solid var(--st-warn-text, #8a5b00);
}
/* narrate.py findings: arithmetic raised them, the model only worded them */
.f-prov {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--wash-blue, rgba(42,120,214,.1)); color: var(--ink-2);
  white-space: nowrap;
}

.section-note {
  margin: 18px 0; padding: 12px 16px; border-radius: 10px; font-size: 13px;
  background: var(--wash-blue); color: var(--ink-2); border: 1px solid rgba(42,120,214,.18);
}

/* conclusion */
.verdict { padding: 22px 24px; margin-bottom: 16px; }
.verdict .v-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.verdict h2 { font-size: 17px; }
.verdict p { color: var(--ink-2); font-size: 14px; }
.next-steps { display: grid; gap: 8px; margin-top: 8px; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--grid); border-radius: 8px; background: #fff; }
.step .s-n { width: 22px; height: 22px; border-radius: 50%; background: var(--wash-blue); color: var(--series-1); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.rp-footer { max-width: 1160px; margin: 30px auto 0; padding: 14px 22px 0; border-top: 1px solid var(--grid); color: var(--muted); font-size: 11.5px; }

h2.pane-title { font-size: 16px; margin-bottom: 4px; }
p.pane-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 16px; }

/* ---------- phase-1 additions: bundles, prompts, generic output ---------- */
/* set cards tint to the docs theme so they stand out from the panel */
.bundle {
  border: 1px solid var(--th-border, var(--grid)); border-radius: 10px;
  background: var(--th-pastel, #fff); margin-bottom: 12px;
}
.bundle.selected { border-color: var(--series-1); box-shadow: 0 0 0 2px var(--wash-blue); }
.bundle-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.bundle-head .b-name { font-weight: 650; font-size: 14px; }
.bundle-head .b-count { font-size: 12px; color: var(--muted); }

/* Rename: the pencil sits quietly next to the name and comes forward on
   hover. Visible at rest (not hover-only) so the affordance is findable, and
   because a hover-only control does not exist on a touch screen. */
.b-rename {
  border: 0; background: none; cursor: pointer; padding: 2px 4px; line-height: 1;
  font-size: 12.5px; color: var(--muted); border-radius: 5px; opacity: .55;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.bundle-head:hover .b-rename { opacity: 1; }
.b-rename:hover { background: var(--wash-blue); color: var(--series-1); }
.b-rename:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; opacity: 1; }
/* :not([hidden]) is load-bearing, not style: a bare `display: flex` here
   OUTRANKS the hidden attribute (which only works via display:none in the UA
   stylesheet), so the editor rendered open on every card at page load. */
.b-rn-form:not([hidden]) { display: flex; align-items: center; gap: 4px; }
.b-rn-form input {
  font: inherit; font-weight: 650; font-size: 14px; padding: 2px 7px;
  border: 1px solid var(--series-1); border-radius: 6px; min-width: 220px;
  background: var(--surface, #fff); color: var(--ink);
}
.b-rn-form button {
  border: 0; background: none; cursor: pointer; padding: 2px 5px; line-height: 1;
  font-size: 12.5px; border-radius: 5px;
}
.b-rn-ok { color: var(--st-good-text); }
.b-rn-ok:hover { background: var(--wash-good, var(--wash-blue)); }
.b-rn-cancel { color: var(--muted); }
.b-rn-cancel:hover { background: var(--grid); color: var(--ink-2); }
.bundle-body { padding: 0 14px 12px; }

/* Collapsed-first cards: the list reads as file groups; the chevron opens
   the detail level (doc rows, weight/map chips, dropzone). */
.b-chevron {
  flex: none; width: 20px; text-align: center; font-size: 17px;
  color: var(--ink-2); display: inline-block; transition: transform 0.15s ease;
  line-height: 1;
}
.bundle:not(.collapsed) .b-chevron { transform: rotate(90deg); }
.bundle.collapsed .bundle-body { display: none; }
.bundle:not(.collapsed) .bundle-files { display: none; }
.bundle-files {
  padding: 0 14px 10px 53px; font-size: 11.5px; color: var(--muted);
  line-height: 1.65; cursor: pointer;
}
.bundle-files .bf-name { white-space: nowrap; }
.bundle-files .bf-name:not(:first-child)::before { content: " · "; white-space: normal; }
.bundle-files .bf-empty { font-style: italic; }
/* dropzone = one more card in the doc grid */
.bundle .dropzone {
  margin: 0; padding: 14px 12px; font-size: 12.5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 92px; background: rgba(255,255,255,.6);
}
.bundle .dropzone b { color: var(--th-text, var(--ink-2)); }
.bundle .dropzone span { font-size: 11px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-form input[type="text"] {
  flex: 1; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid var(--baseline); border-radius: 8px; background: #fff;
}
.inline-form input[type="text"]:focus { outline: 2px solid var(--series-1); border-color: transparent; }
.btn-small {
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--series-1); color: #fff; font-size: 13px; font-weight: 650;
}
.btn-small:hover { background: #256abf; }
.btn-danger-link { background: none; border: none; color: var(--muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.btn-danger-link:hover { color: var(--st-crit-text); }
/* same quiet link shape, non-destructive verb: hover goes blue, not red */
.btn-quiet-link { background: none; border: none; color: var(--muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.btn-quiet-link:hover { color: var(--series-1); }
.btn-quiet-link:disabled { opacity: .5; cursor: default; text-decoration: none; }
/* while the sweep runs the button IS the meter: a chip whose background
   fill tracks done/total (set inline by the docs poll) */
.btn-quiet-link.rc-active {
  text-decoration: none; opacity: 1; color: var(--series-1);
  border: 1px solid var(--grid); border-radius: 6px; padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

/* prompt library: 2-column tallish cards with a body preview */
.promptgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .promptgrid { grid-template-columns: 1fr; } }
.prompt-item {
  display: flex; flex-direction: column; gap: 8px; min-height: 168px;
  padding: 12px 14px; border: 1px solid var(--th-border, var(--grid));
  border-radius: 10px; background: var(--th-pastel, #fff); cursor: pointer;
}
.prompt-item.selected { border-color: var(--series-1); box-shadow: 0 0 0 2px var(--wash-blue); }
.prompt-item .p-head { display: flex; gap: 10px; align-items: flex-start; }
.prompt-item .p-title { font-size: 13.5px; font-weight: 650; }
.prompt-item .p-sub { font-size: 11.5px; color: var(--muted); }
.prompt-item .p-preview {
  font-size: 11.5px; color: var(--ink-2); line-height: 1.55; flex: 1;
  padding: 8px 10px; background: rgba(255,255,255,.65); border-radius: 8px;
}
/* clamp on an inner span: clamping the padded box lets the cut line peek
   through the bottom padding */
.prompt-item .p-preview .txt {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-item .p-foot { display: flex; align-items: center; gap: 10px; }
.p-view {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 650; color: var(--th-text, var(--series-1));
}
.p-view:hover { text-decoration: underline; }
.sample-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--grid); border-radius: 999px; padding: 2px 8px;
}

/* full-prompt modal (amber-themed) */
.pm-box { inset: 8vh 14vw; }
@media (max-width: 900px) { .pm-box { inset: 5vh 5vw; } }
.pm-head { background: var(--th-pastel); border-bottom: 2px solid var(--th); }
.pm-head .dm-title { color: var(--th-text); }
.pm-body {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word;
  background: linear-gradient(var(--th-wash), transparent 140px), var(--surface);
}
/* add-prompt card: one more cell in the prompt grid (matches the doc-grid
   dropzone pattern); narrow on purpose — long prompts arrive by paste */
.prompt-new {
  border: 1.5px dashed var(--baseline); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.prompt-new .p-title { font-size: 13.5px; font-weight: 650; color: var(--th-text, var(--ink-2)); }
.prompt-new form { display: flex; flex-direction: column; gap: 8px; }
.prompt-new input[type="text"] {
  width: 100%; padding: 8px 10px; font-size: 13px; border: 1px solid var(--baseline);
  border-radius: 8px; background: #fff; font-family: inherit;
}
.prompt-new textarea {
  width: 100%; min-height: 96px; padding: 8px 10px; font-size: 12.5px; resize: vertical;
  border: 1px solid var(--baseline); border-radius: 8px; background: #fff; font-family: inherit;
}
.prompt-new input[type="text"]:focus, .prompt-new textarea:focus {
  outline: 2px solid var(--th, var(--series-1)); border-color: transparent;
}
.prompt-new .btn-small { align-self: flex-start; }
/* MultiPass mode: the new-prompt form is swapped for a note — those prompts
   are pre-seeded, not free-typed. */
.prompt-new .pn-multi { display: none; }
body.mode-multi .prompt-new .pn-single { display: none; }
body.mode-multi .prompt-new .pn-multi { display: block; }
body.mode-multi .prompt-new { border-color: rgba(74, 58, 167, .42); background: rgba(74, 58, 167, .05); }
body.mode-multi .prompt-new .p-title { color: #4a3aa7; }
.prompt-new .pn-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
/* Single no-save free-text slot: violet-tinted to echo the "this session only"
   tag, same signal as the no-save document set. Edited in place, never saved. */
.prompt-item.scratch { border-color: rgba(74, 58, 167, .45); background: rgba(74, 58, 167, .05); }
.prompt-item.scratch .nosave-tag { margin-left: 6px; vertical-align: middle; }
.scratch-body {
  width: 100%; flex: 1; min-height: 96px; padding: 8px 10px;
  font-size: 12.5px; line-height: 1.5; resize: vertical; font-family: inherit;
  border: 1px solid var(--baseline); border-radius: 8px; background: #fff;
}
.scratch-body:focus { outline: 2px solid var(--violet); border-color: transparent; }
.nosave-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--violet); background: rgba(74, 58, 167, .10);
  border: 1px solid rgba(74, 58, 167, .35);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
/* MultiPass live progress: the cumulative meter recolors to the MultiPass
   scheme and per-pass lanes appear beneath it, indented as children */
.progress-panel.mp .meter > i {
  background: linear-gradient(90deg, #f06d0f, #d61f76, #f06d0f);
  background-size: 200% 100%;
}
.mp-lanes { margin-top: 12px; display: grid; gap: 7px; }
.mp-lane {
  display: grid; grid-template-columns: minmax(150px, 240px) 1fr 84px;
  gap: 10px; align-items: center; font-size: 12px;
  padding-left: 20px; position: relative; color: var(--ink-2);
}
.mp-lane::before { content: "\2514"; position: absolute; left: 6px; top: -2px; color: var(--muted); }
.mp-lane .l-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-lane .l-track { height: 8px; border-radius: 999px; background: #faeee0; overflow: hidden; }
/* :not([hidden]): a bare display rule overrides the UA's [hidden] and makes
   the attribute a no-op in real browsers (tests/lint_hidden.py) */
.mp-lane .l-fill:not([hidden]) {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #f06d0f, #f2a03d);
  transition: width .4s ease;
}
.mp-lane.running { color: var(--ink); font-weight: 600; }
.mp-lane.running .l-fill {
  background: linear-gradient(90deg, #f06d0f, #d61f76, #f06d0f);
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
.mp-lane.pending { opacity: .5; }
.mp-lane.waiting { color: var(--ink); font-weight: 600; }
.mp-lane.waiting .l-tok { color: var(--muted, #7a7a7a); font-weight: 500; font-style: italic; }
.mp-lane.failed .l-track { background: rgba(192, 57, 43, .12); }
.mp-lane.failed .l-fill { background: #c0392b; }
.mp-lane .l-tok { text-align: right; font-variant-numeric: tabular-nums; }
.mp-lane.done .l-tok { color: var(--ink); font-weight: 700; }
/* a finished lane drops its pale remainder: bar length now reads as relative
   size (a bar chart), not unfinished progress — only running/failed lanes
   keep the track */
.mp-lane.done .l-track { background: transparent; }

/* MultiPass experiment badges — deliberately loud so the A/B pick is unmistakable */
.mp-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: #fff; background: #4a3aa7; border: 0;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}

/* the pipeline-version ⓘ pill: a no-JS details popover next to the mp-tag */
.mp-info { display: inline-block; position: relative; margin-left: 4px; vertical-align: middle; }
.mp-info > summary {
  list-style: none; cursor: pointer; display: inline-block;
  width: 15px; height: 15px; line-height: 15px; text-align: center;
  font-size: 10px; font-weight: 800; font-style: italic; font-family: Georgia, serif;
  color: #4a3aa7; background: var(--surface); border: 1px solid #4a3aa7;
  border-radius: 50%;
}
.mp-info > summary::-webkit-details-marker { display: none; }
.mp-info[open] > summary { color: #fff; background: #4a3aa7; }
.mp-info-pop {
  position: absolute; z-index: 60; top: 20px; left: -8px;
  width: 340px; max-width: 78vw; padding: 10px 12px;
  font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none;
  line-height: 1.45; color: var(--ink); text-align: left; white-space: normal;
  background: var(--surface); border: 1px solid var(--grid); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(11, 11, 11, 0.13);
}

.model-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--grid); border-radius: 8px; background: #fff; margin-bottom: 8px; cursor: pointer; }
.model-item.selected { border-color: var(--series-1); box-shadow: 0 0 0 2px var(--wash-blue); }
.model-item .m-label { font-size: 13.5px; font-weight: 650; }
.model-item .m-detail { font-size: 11.5px; color: var(--muted); }
/* live average from the usage log; absent entirely until a run of that
   type has been recorded */
.price-tag {
  font-size: 11px; font-weight: 700; white-space: nowrap; flex: none;
  color: var(--st-good-text); background: var(--wash-good);
  border: 1px solid rgba(12, 163, 12, .35);
  border-radius: 999px; padding: 2px 9px;
}
.mpg-step-title .price-tag { margin-left: 6px; vertical-align: 1px; }
.model-item.locked { opacity: .45; cursor: not-allowed; }
.mp-model-note {
  margin: 2px 0 10px; padding: 9px 12px; border-radius: 8px; font-size: 12px;
  color: var(--ink-2); background: rgba(240, 109, 15, .07);
  border: 1px solid rgba(240, 109, 15, .35);
}

.runrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--grid); font-size: 13px; }
.runrow:last-child { border-bottom: 0; }
.runrow .r-sub { font-size: 11.5px; color: var(--muted); }

.gen-main { max-width: 860px; margin: 26px auto 80px; padding: 0 22px; display: grid; gap: 16px; }
.gen-output { padding: 20px 24px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }

/* rendered-markdown view (mdlite): deterministic hierarchy + light color,
   styled with the app's own palette — no LLM formatting pass involved */
.gen-output.md { white-space: normal; padding: 26px 30px; }
.gen-output.md > :first-child { margin-top: 0; }
.gen-output.md h1 {
  font-size: 20px; font-weight: 700; margin: 26px 0 10px;
  padding-bottom: 10px; border-bottom: 2px solid var(--grid);
}
.gen-output.md h2 {
  font-size: 16px; font-weight: 700; color: var(--series-1); margin: 24px 0 8px;
}
.gen-output.md h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-2); margin: 18px 0 6px;
}
.gen-output.md h4 { font-size: 13.5px; font-weight: 700; margin: 14px 0 4px; }
.gen-output.md p { margin: 8px 0; color: var(--ink); }
.gen-output.md strong { font-weight: 700; color: var(--ink); background: var(--wash-blue); padding: 0 3px; border-radius: 4px; }
.gen-output.md ul, .gen-output.md ol { margin: 8px 0 12px; padding-left: 24px; }
.gen-output.md li { margin: 4px 0; }
.gen-output.md ul li::marker { color: var(--series-1); }
.gen-output.md ol li::marker { color: var(--series-1); font-weight: 700; }
.gen-output.md hr { border: 0; border-top: 1px solid var(--grid); margin: 20px 0; }
.gen-output.md blockquote {
  margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--series-1);
  background: var(--wash-blue); border-radius: 0 8px 8px 0; color: var(--ink-2);
}
.gen-output.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: var(--page); border: 1px solid var(--grid); border-radius: 5px; padding: 1px 5px;
}
.gen-output.md pre {
  background: var(--page); border: 1px solid var(--grid); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; margin: 10px 0;
}
.gen-output.md pre code { border: 0; padding: 0; background: none; font-size: 12.5px; }
.gen-output.md table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.gen-output.md th {
  text-align: left; font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--baseline);
}
.gen-output.md td { padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.gen-output.md tr:last-child td { border-bottom: 0; }
.conf-pill { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.conf-pill.high { background: var(--wash-good); color: var(--st-good-text); }
.conf-pill.medium { background: var(--wash-warn); color: var(--st-warn-text); }
.conf-pill.low { background: var(--wash-crit); color: var(--st-crit-text); }

/* document weight tag: how much of the context window this file eats
   (estimated tokens, not KB — a dense little PDF outweighs a big photo) */
.wt-pill {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  margin-left: 6px; text-transform: capitalize;
}
.wt-pill.light  { background: var(--wash-good);    color: var(--st-good-text); }
.wt-pill.medium { background: var(--wash-warn);    color: var(--st-warn-text); }
.wt-pill.heavy  { background: var(--wash-serious); color: var(--st-serious-text); }

/* ---------- action feedback toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; z-index: 120;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- in-app document viewer modal ---------- */
.doc-modal { position: fixed; inset: 0; z-index: 100; }
.dm-backdrop { position: absolute; inset: 0; background: rgba(11,11,11,.55); }
.dm-box {
  position: absolute; inset: 4vh 5vw; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.dm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--grid); background: var(--surface);
}
.dm-title { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-close {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--grid);
  background: var(--surface); color: var(--ink-2); font-size: 18px; line-height: 1;
  cursor: pointer;
}
.dm-close:hover { background: var(--wash-crit); color: var(--st-crit-text); border-color: transparent; }
.dm-frame { flex: 1; width: 100%; border: 0; background: #525659; }

/* ---- Auth phase: login tabs, account settings, admin bar, user management ---- */

.adminbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--wash-blue); border-bottom: 1px solid var(--grid);
  padding: 7px 22px; font-size: 12.5px;
}
.adminbar-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: #fff; background: var(--series-1); padding: 2px 8px; border-radius: 999px;
}
.adminlink { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.adminlink:hover { color: var(--series-1); }
.adminbar .nav-here { color: var(--ink); font-weight: 700; }
/* second-tier admin links: present, just not shouting */
.adminlink-dim { color: var(--muted); font-weight: 500; }
.adminlink-dim:hover { color: var(--series-1); }
/* Dev Area — default-collapsed shelf for the diagnostic surfaces. A plain
   <details> so no JS owns nav state; it renders open when the current page
   lives inside it (the template sets `open`). */
/* display:contents lifts summary + .devrow to direct flex children of the
   adminbar, so the open shelf can wrap to its own full-width line while the
   chevron stays put in the first row */
.devarea { display: contents; }
.devrow {
  flex-basis: 100%; display: flex; align-items: center; gap: 32px;
  padding: 6px 0 1px 2px; border-top: 1px dashed var(--grid);
}
.devarea > summary {
  cursor: pointer; list-style: none; color: var(--muted);
  font-weight: 600; user-select: none;
}
.devarea > summary::-webkit-details-marker { display: none; }
.devarea > summary::before { content: "▸ "; font-size: 10px; }
.devarea[open] > summary::before { content: "▾ "; }
.devarea[open] > summary { color: var(--ink-2); }
.nav-account { font-weight: 700; }

.login-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; margin-bottom: 18px; background: var(--page);
  border: 1px solid var(--grid); border-radius: 8px; padding: 3px;
}
.login-tab {
  border: 0; background: none; padding: 7px 4px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); border-radius: 6px; cursor: pointer;
}
.login-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.login-card input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--baseline);
  border-radius: 8px; margin-bottom: 16px; background: #fff; font-family: inherit;
}
.login-card input[type="text"]:focus { outline: 2px solid var(--series-1); border-color: transparent; }

.flashbar { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.flashbar.good { background: var(--wash-good); color: var(--st-good-text); }
.flashbar.bad { background: var(--wash-crit); color: var(--st-crit-text); }

.acct-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px;
  font-size: 13.5px; align-items: center;
}
.acct-k { color: var(--muted); font-size: 12.5px; }
.acct-form { max-width: 380px; }
.acct-form label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  margin: 12px 0 6px;
}
.acct-form input {
  width: 100%; padding: 9px 12px; font-size: 14px; border: 1px solid var(--baseline);
  border-radius: 8px; background: #fff; font-family: inherit;
}
.acct-form input:focus { outline: 2px solid var(--series-1); border-color: transparent; }
.acct-form .btn-primary, .acct-form .btn-secondary { margin-top: 14px; }
.acct-note { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; max-width: 560px; }

.btn-secondary {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1px solid var(--baseline); border-radius: 8px; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--series-1); color: var(--series-1); }
.btn-danger {
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--st-crit-text);
  background: #fff; border: 1px solid var(--grid); border-radius: 8px; cursor: pointer;
}
.btn-danger:hover { background: var(--wash-crit); border-color: transparent; }

.totp-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.totp-qr { width: 168px; height: 168px; border: 1px solid var(--grid); border-radius: 8px; background: #fff; }
.totp-secret {
  display: inline-block; font-size: 13px; background: var(--page);
  border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px;
  margin-bottom: 4px; word-break: break-all; user-select: all;
}

.linkbox { border: 1px solid var(--series-1); }
.linkrow { display: flex; gap: 10px; align-items: center; }
.linkrow code {
  flex: 1; font-size: 12.5px; background: var(--page); border: 1px solid var(--grid);
  border-radius: 6px; padding: 9px 12px; word-break: break-all; user-select: all;
}

.userform { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.userform label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.userform input, .userform select {
  padding: 9px 12px; font-size: 13.5px; border: 1px solid var(--baseline);
  border-radius: 8px; background: #fff; font-family: inherit; min-width: 170px;
}
.userform input:focus, .userform select:focus { outline: 2px solid var(--series-1); border-color: transparent; }

.usertable { width: 100%; border-collapse: collapse; font-size: 13px; }
.usertable th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--muted); padding: 6px 10px;
  border-bottom: 1px solid var(--grid);
}
.usertable td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.usertable tr:last-child td { border-bottom: 0; }
/* Chips in the two narrow columns carry sentence-length labels ("invite
   pending", "no window — cannot sign in") that outgrow their column. They stay
   one pill: the box wraps as a unit, the text wraps inside it on balanced
   lines, and the radius eases off so a two-line pill reads as a tag rather
   than a stretched lozenge. */
.usertable .methods .chip,
.usertable .status .chip {
  margin: 2px 4px 2px 0;
  border-radius: 10px; line-height: 1.35; text-align: center;
  text-wrap: balance; overflow-wrap: break-word;
}
/* Enough room for the common single-line labels before wrapping kicks in. */
.usertable .methods { min-width: 112px; }
.usertable .status { min-width: 118px; line-height: 1.5; }
.chip-admin { background: var(--wash-blue); border-color: var(--series-1); color: var(--series-1); }
.chip-pending { background: var(--wash-warn); border-color: var(--st-warn); color: var(--st-warn-text); }
.row-disabled td { opacity: .45; }
.usertable .actions { white-space: nowrap; }
.usertable .actions form { display: inline-block; margin-left: 4px; }
.btn-mini {
  padding: 4px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1px solid var(--baseline); border-radius: 999px; cursor: pointer;
}
.btn-mini:hover { border-color: var(--series-1); color: var(--series-1); }
.btn-mini-danger:hover { border-color: var(--st-crit); color: var(--st-crit-text); }
.acct-grid .chip { justify-self: start; }

/* per-user run reports */
.report-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.report-filter label { font-weight: 600; }
.report-filter select {
  padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--baseline);
  border-radius: 8px; background: #fff; font-family: inherit;
}
.report-filter select:focus { outline: 2px solid var(--series-1); border-color: transparent; }
.runrow.with-user { grid-template-columns: 1fr auto auto; }
.run-user {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  background: var(--page); border: 1px solid var(--grid); border-radius: 999px; padding: 3px 10px;
}

/* ---- User guide (/guide) -------------------------------------------------
   Reuses the mpg-* explainer styles; adds a numbered four-step overview and
   collapsed <details> accordions (default compact) for the deeper topics. */
.mpg-link { color: #f06d0f; font-weight: 700; }

.guide-steps { display: grid; gap: 14px; margin-top: 4px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.guide-step b { color: var(--ink); }
.gs-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  background: var(--th, var(--series-1)); box-shadow: 0 1px 3px rgba(11,11,11,.18);
}
.guide-more-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); margin: 8px 2px 0; }
.guide-acc {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.guide-acc > summary {
  list-style: none; cursor: pointer; padding: 15px 18px;
  display: flex; align-items: baseline; gap: 12px;
  font-size: 15.5px; font-weight: 700; color: var(--ink);
}
.guide-acc > summary::-webkit-details-marker { display: none; }
.guide-acc > summary::after {
  content: "\25B8"; margin-left: auto; align-self: center;
  color: var(--muted); font-size: 13px; transition: transform .2s ease;
}
.guide-acc[open] > summary::after { transform: rotate(90deg); }
.guide-acc > summary:hover { background: rgba(11,11,11,.02); }
.guide-acc .ga-sub { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.guide-acc .ga-body { padding: 2px 18px 18px; border-top: 1px solid var(--border); }
.guide-acc .ga-body > .mpg-lead:first-child { margin-top: 14px; }
.mpg-main { max-width: 980px; margin: 26px auto 80px; padding: 0 22px; display: grid; gap: 18px; }
.mpg-hero { text-align: center; padding: 26px 12px 6px; }
.mpg-hero h1 { font-size: 30px; margin: 10px 0 6px; letter-spacing: -.3px; }
.mpg-hero p { color: var(--ink-2); font-size: 15px; max-width: 560px; margin: 0 auto; }
.mpg-hero-tags .mp-tag { font-size: 12px; padding: 3px 12px; }
.mpg-card { border-top: 3px solid #f06d0f; }
.mpg-h {
  font-size: 17px !important; text-transform: uppercase; letter-spacing: 1.2px;
  color: #f06d0f !important; font-weight: 800;
}
.mpg-lead { font-size: 14.5px; line-height: 1.55; margin: 0 0 14px; }
.mpg-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 14px 0 0; }

.mpg-diagram {
  display: grid; grid-template-columns: auto 24px 1fr 24px auto;
  gap: 10px; align-items: center; margin-top: 6px;
}
.mpg-col { display: grid; gap: 7px; align-content: start; }
.mpg-col-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.mpg-arrow { font-size: 22px; color: #f06d0f; text-align: center; font-weight: 700; }
.mpg-doc {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  background: #fff; border: 1px solid var(--grid); border-radius: 999px;
  padding: 5px 12px; white-space: nowrap;
}
.mpg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.d-draft { background: #f06d0f; }
.d-prior { background: var(--violet); }
.d-w2    { background: var(--series-1); }
.d-1099  { background: #0e8f8f; }
.d-pay   { background: var(--st-good); }
.d-ded   { background: var(--st-warn); }
.mpg-pass {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(240, 109, 15, .06); border: 1px solid rgba(240, 109, 15, .35);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px;
}
.mpg-pass-title { font-weight: 700; }
.mpg-areas { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.mpg-mini { display: inline-flex; gap: 4px; margin-left: auto; }
.mpg-mini .mpg-dot { width: 11px; height: 11px; }
.mpg-synth { background: rgba(214, 31, 118, .07); border-color: rgba(214, 31, 118, .4); }
.mpg-synth-note { flex-basis: 100%; font-size: 11.5px; color: var(--ink-2); }
.mpg-memo {
  text-align: center; font-weight: 700; font-size: 13px;
  border: 1px dashed var(--baseline); border-radius: 8px; padding: 10px 12px; background: #fff;
}

.mpg-limits { display: grid; gap: 12px; margin-top: 4px; }
.mpg-limit-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; }
.mpg-limit-label { font-size: 12px; font-weight: 700; text-align: right; color: var(--ink-2); }
.mpg-limit-track { position: relative; background: var(--page); border: 1px solid var(--grid); border-radius: 8px; padding: 6px; }
.mpg-limit-line {
  position: absolute; top: -6px; bottom: -6px; left: 78%; width: 0;
  border-left: 2px dashed var(--st-crit);
}
.mpg-limit-line::after {
  content: "context limit"; position: absolute; top: -4px; left: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--st-crit-text); white-space: nowrap;
}
.mpg-limit-stack { display: grid; gap: 4px; }
.mpg-limit-bar {
  height: 18px; border-radius: 5px; font-size: 10.5px; font-weight: 700; color: #fff;
  display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: visible;
}
.mpg-limit-bar.over { background: linear-gradient(90deg, #f06d0f, var(--st-crit)); }
.mpg-limit-bar.ok { background: #f06d0f; }

.partial-banner {
  background: var(--wash-serious); border: 1px solid rgba(236, 131, 90, .5);
  border-radius: 8px; padding: 12px 15px; font-size: 13.5px;
  color: var(--st-serious-text); margin: 14px 0;
}
.resume-form { display: inline; margin-left: 8px; }
.resume-btn {
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: var(--st-serious-text); background: none; border: 1px solid currentColor;
  border-radius: 6px; padding: 4px 10px;
}
.resume-btn:hover { background: rgba(236, 131, 90, .12); }
.mpg-banner {
  background: var(--wash-good); border: 1px solid rgba(12, 163, 12, .35);
  border-radius: 8px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 14px;
}
.mpg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mpg-half-title { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.mpg-half-title.good { color: var(--st-good-text); }
.mpg-half-title.warn { color: var(--st-serious-text); }
.mpg-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.mpg-list li { margin: 6px 0; }
.mpg-list li::marker { color: #f06d0f; }

.mpg-steps { display: grid; gap: 14px; }
.mpg-step {
  display: flex; gap: 14px; align-items: center; font-size: 13.5px; line-height: 1.55;
  background: #fff; border: 1px solid var(--grid); border-radius: 10px; padding: 12px 16px;
}
.mpg-step-title { font-weight: 800; margin-bottom: 2px; }
.mpg-fineprint { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.55; }

@media (max-width: 760px) {
  .mpg-diagram { grid-template-columns: 1fr; }
  .mpg-arrow { transform: rotate(90deg); }
  .mpg-two { grid-template-columns: 1fr; }
  .mpg-limit-row { grid-template-columns: 1fr; }
  .mpg-limit-label { text-align: left; }
}

/* ---- history cards ------------------------------------------------------
   Rows ran out of horizontal room once documents / prompt / result each got
   a column — rectangle cards give every value breathing space instead. */
.hist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px; margin-top: 6px;
}
.hist-card {
  display: block; background: #fff; border: 1px solid var(--grid);
  border-radius: 10px; padding: 12px 14px 11px;
  color: inherit; text-decoration: none;
  transition: border-color .12s, box-shadow .12s;
}
.hist-card:hover { border-color: var(--series-1); box-shadow: var(--shadow); }
.hc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hc-time { font-size: 12px; color: var(--ink-2); flex: 1; white-space: nowrap; }
.hc-time b { color: var(--ink); }
.hc-user {
  font-size: 10.5px; font-weight: 700; color: var(--violet);
  background: rgba(74, 58, 167, .08); border-radius: 999px; padding: 1px 8px;
}
.hc-field { font-size: 12.5px; margin-top: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.hc-label {
  display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1px;
}
.hc-dim { color: var(--muted); font-size: 11.5px; }
.hc-result {
  margin-top: 9px; padding-top: 7px; border-top: 1px dashed var(--grid);
  font-size: 12px; font-style: italic; color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- history theming: labels & filters wear the workbench step colors
   (docs blue / prompt amber / engine green / user violet — the same
   --th values as .theme-docs, .theme-prompt, .theme-model, .theme-run) */
.hc-label::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: 1px; background: var(--baseline);
}
.hc-label.th-docs   { color: #1d5eae; } .hc-label.th-docs::before   { background: #2a78d6; }
.hc-label.th-prompt { color: #8a5b00; } .hc-label.th-prompt::before { background: #e09f00; }
.hc-label.th-model  { color: #006300; } .hc-label.th-model::before  { background: #0ca30c; }

.report-filter label.f-docs   { color: #1d5eae; }
.report-filter label.f-prompt { color: #8a5b00; }
.report-filter label.f-user   { color: var(--violet); }
.report-filter select.f-docs   { background: #e9f2fd; border-color: #bcd7f5; color: #1d5eae; }
.report-filter select.f-prompt { background: #fdf4dd; border-color: #efd79e; color: #8a5b00; }
.report-filter select.f-user   { background: #edeafb; border-color: #cec6f1; color: var(--violet); }

/* ---------- page-map chip + review panel ---------- */
/* Deliberately bigger than the info pills (conf/weight) around it — this
   one is a BUTTON that opens the map panel, and it dresses like one:
   taller, accent border, shadow, disclosure caret. */
.map-chip {
  font-size: 12px; font-weight: 650; padding: 4px 11px; border-radius: 999px;
  margin-left: 6px; border: 1px solid var(--series-1); background: var(--surface);
  color: var(--series-1); cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  box-shadow: 0 1px 2px rgba(20, 40, 80, 0.10);
}
.map-chip::after { content: "▾"; font-size: 9px; opacity: 0.75; }
.map-chip.has-flags { background: var(--wash-warn); color: var(--st-warn-text); border-color: var(--st-warn-text); }
.map-chip.suggest { background: transparent; border-style: dashed; color: var(--muted); border-color: var(--border); }
.map-chip.suggest::after { content: none; }
.map-chip:hover { filter: brightness(0.96); box-shadow: 0 1px 4px rgba(20, 40, 80, 0.16); }
.map-panel {
  /* full-width sub-row of the doc grid, indented under its owning card —
     never a stray cell whose position depends on the owner's column */
  grid-column: 1 / -1;
  margin: 2px 0 10px 40px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); font-size: 12.5px;
}
.map-head { font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.map-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--st-warn-text); margin: 6px 0 2px; }
.map-row { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.map-row.flag .map-title { color: var(--st-warn-text); font-weight: 600; }
.map-pages { flex: 0 0 84px; font-variant-numeric: tabular-nums; color: var(--muted); }
.map-route { flex: 0 0 120px; font-size: 11px; color: var(--muted); }
.map-title { flex: 1; }
.map-hint { font-size: 11px; color: var(--muted); font-style: italic; }
.map-edit { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 13px; }
.map-edit:hover { color: var(--ink); }

/* The two verdict tones of the map panel: brown = wants a human decision
   (the pulsing pencil IS the call to action); green = confirmed/earned
   automatically. */
.map-instr {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  font-size: 11px; color: var(--muted); font-style: italic; margin-left: 10px;
}
.map-toggle.good {
  display: block; padding: 0; margin: 10px 0 2px; text-align: left;
  font-family: inherit; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--st-good-text);
}
.map-row.ok .map-mark, .map-row.ok .map-hint { color: var(--st-good-text); }
.map-row.flag .map-edit {
  color: var(--st-warn-text); border-radius: 50%;
  animation: pencil-pulse 1.7s ease-in-out infinite;
}
@keyframes pencil-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(148, 84, 8, 0.35); }
  50%      { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(148, 84, 8, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .map-row.flag .map-edit { animation: none; }
}
.map-toggle { border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 12px; padding: 4px 0; font-family: inherit; }
.map-rest { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 4px; }
.map-empty { color: var(--muted); font-style: italic; padding: 4px 0; }
.map-input { flex: 1; font: inherit; font-size: 12.5px; padding: 2px 6px;
  border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Excel export link ---------- */
/* The most-exercised control on a finished report — dressed as a real
   button, not a metadata chip. */
.xlsx-link {
  color: #fff; font-weight: 700; text-decoration: none;
  border: 1px solid var(--st-good-text); border-radius: 999px; padding: 7px 18px;
  background: var(--st-good); font-size: 14px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 1px 3px rgba(0, 80, 0, 0.25);
}
.xlsx-link:hover { filter: brightness(1.06); box-shadow: 0 2px 6px rgba(0, 80, 0, 0.3); }

.m-pool { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Engine fuel tank — the TPD bucket refills continuously (no daily reset),
   so it reads as a tank: green fluid with a slow ripple drifting across. */
.fuel { display: inline-flex; align-items: center; gap: 7px; }
.fuel-tank {
  width: 108px; height: 9px; border-radius: 5px; position: relative;
  background: var(--page); border: 1px solid var(--border);
  overflow: hidden; flex: none;
}
.fuel-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, #86d9a6 0%, #41ab6c 55%, #2f8f57 100%);
  border-radius: 4px 0 0 4px; overflow: hidden;
}
.fuel-fill::after {
  content: ""; position: absolute; top: -5px; left: 0; height: 11px; width: 300%;
  background: radial-gradient(ellipse 9px 5px at 9px 5px,
              rgba(255, 255, 255, 0.32) 42%, transparent 43%) repeat-x;
  background-size: 18px 11px;
  animation: fuel-ripple 7s linear infinite;
}
@keyframes fuel-ripple {
  from { transform: translateX(0); }
  to   { transform: translateX(-18px); }
}
.fuel-label { white-space: nowrap; }
.fuel-cap { font-size: 9.5px; letter-spacing: .2px; }

/* Taller fuel tank (2x the base height); its WIDTH is set inline, proportional
   to the engine's cap, so a larger pool reads as a physically longer tank
   (Sonnet 10.8M wide, Opus ~a quarter at 2.59M). */
.fuel-tank { height: 18px; border-radius: 7px; min-width: 44px; }
.fuel-fill { border-radius: 6px 0 0 6px; }
.fuel-fill::after { top: -3px; height: 20px; }
.fuel-label { font-size: 11.5px; }
.fuel-title {
  display: inline-block; margin-bottom: 3px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  text-transform: uppercase; color: var(--ink-2);
}

/* ---------- auto mode banner + flip badge ---------- */
.mode-banner { display: flex; align-items: center; gap: 13px; margin: 2px 0 16px; }
.mode-badge { perspective: 700px; width: 172px; height: 34px; flex: none; }
.mb-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.62, .04, .28, .92);
}
body.mode-multi .mb-inner { transform: rotateY(180deg); }
.mb-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid; font-size: 12.5px; letter-spacing: .2px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mb-face b { font-weight: 800; margin-right: 4px; }
.mb-single { background: #e8f7e8; border-color: #b6e3b6; color: #006300; }
.mb-multi  { background: #ece7fb; border-color: #c4b8f1; color: #4a3aa7; transform: rotateY(180deg); }
.mode-why { font-size: 12px; color: var(--muted); transition: color .4s ease; }
body.mode-multi .mode-why { color: #6a5cc0; }

/* Step 2 shows only the current mode's prompts (the badge/theme explain why) */
body.mode-single .prompt-item[data-multipass] { display: none; }
body.mode-multi  .prompt-item:not([data-multipass]) { display: none; }

/* Step 2 review-mode switch: auto only forces Single->Multi; back is manual */
.mode-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.mode-seg { display: inline-flex; border: 1px solid var(--grid); border-radius: 999px; overflow: hidden; }
.mode-seg .seg-btn {
  border: 0; background: none; font: inherit; font-size: 12.5px;
  padding: 5px 14px; cursor: pointer; color: var(--muted);
}
.mode-seg .seg-btn.on { background: var(--th, #4a3aa7); color: #fff; font-weight: 650; }
.mode-seg .seg-btn:disabled { cursor: not-allowed; opacity: .45; }
.mode-seg .seg-btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.mode-seg .seg-btn small { font-size: 10px; opacity: .75; margin-left: 3px; }

/* ---------- Auto-Select engine switch (Step 3 header) ---------- */
.panel-h2-row { display: flex; align-items: center; }
.auto-switch {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; cursor: pointer;
  font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2);
}
.auto-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.as-track {
  width: 34px; height: 19px; border-radius: 999px; background: #d0cfca;
  position: relative; flex: none; transition: background .2s;
}
.as-thumb {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s;
}
.auto-switch input:checked + .as-track { background: var(--th, #0ca30c); }
.auto-switch input:checked + .as-track .as-thumb { transform: translateX(15px); }
.auto-switch input:focus-visible + .as-track { outline: 2px solid var(--series-1); outline-offset: 2px; }
.as-label { white-space: nowrap; }

/* "AUTO" chip on the engine step while Auto-Select is on */
#step-model.auto-on .step-value::after {
  content: "AUTO"; margin-left: 7px; font-size: 9px; font-weight: 800; letter-spacing: .5px;
  color: #006300; background: #e8f7e8; border: 1px solid #b6e3b6; border-radius: 4px;
  padding: 1px 4px; vertical-align: middle; white-space: nowrap;
}

/* ---------- moved sizing + rolling-cap lines (now in the Step 3 bubble) ---------- */
.wb-sizing, .wb-cap {
  display: block; font-size: 10px; line-height: 1.35; margin-top: 3px;
  padding: 3px 6px; border-radius: 5px; font-weight: 600; max-width: 100%;
}
.wb-sizing.ok,    .wb-cap.ok    { color: var(--st-good-text);    background: var(--wash-good); }
.wb-sizing.tight, .wb-cap.tight { color: var(--st-warn-text);    background: var(--wash-warn); }
.wb-sizing.over,  .wb-cap.over  { color: var(--st-serious-text); background: var(--wash-serious); }
.wb-sizing.mp { color: #4a3aa7; background: rgba(74, 58, 167, .10); }
.wb-sizing.sizing { color: var(--muted); background: rgba(0, 0, 0, .04); font-weight: 500; }

/* Strong header shift for MultiPass mode — the whole top bar inverts to light
   text on a deep purple ground, so the mode reads from the masthead down. */
body.mode-multi .topbar { background: #4a3aa7; border-bottom-color: #362a80; }
body.mode-multi .brand { color: #fff; }
body.mode-multi .brand .poc { background: rgba(255, 255, 255, .20); color: #fff; }
body.mode-multi .engagement-tag { color: rgba(255, 255, 255, .82); }
body.mode-multi .topbar .logout { color: rgba(255, 255, 255, .74); }
body.mode-multi .topbar .logout:hover { color: #fff; }
body.mode-multi .topbar .nav-here { color: #fff; border-bottom-color: #cbbcff; }

/* ---------- UI-blocking sizing overlay ---------- */
/* Sizing now decides mode, prompt filtering, and engine, so the job config is
   locked behind this pill until /autosize resolves. */
.sizing-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 11, 11, .30);
}
/* the display:flex above outranks the [hidden] attribute's UA display:none —
   restore it so hidden=true actually hides (same for the label chips below) */
.sizing-modal[hidden] { display: none; }
.wb-sizing[hidden], .wb-cap[hidden] { display: none; }
.sz-pill {
  display: inline-flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 15px 24px; box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 650; color: var(--ink-2);
}
.sz-spin {
  width: 17px; height: 17px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--grid); border-top-color: var(--series-1);
  animation: sz-spin .7s linear infinite;
}
body.mode-multi .sz-spin { border-top-color: #4a3aa7; }
@keyframes sz-spin { to { transform: rotate(360deg); } }

/* ---------- selection radios (documents / prompt / engine) ----------
   Larger custom radios with an unmistakable filled state: a solid,
   theme-colored disc with a white center and a halo ring, vs. an empty white
   ring. Each inherits its step's --th color (blue / amber / green). */
input[name^="pick-"] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 0 4px 0 0; flex: none;
  border: 2px solid var(--baseline); border-radius: 50%;
  background: #fff; cursor: pointer; position: relative; vertical-align: middle;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
input[name^="pick-"]:hover { border-color: var(--th, var(--series-1)); }
input[name^="pick-"]:checked {
  border-color: var(--th, var(--series-1));
  background: var(--th, var(--series-1));
  box-shadow: 0 0 0 3px var(--th-wash, rgba(42, 120, 214, .15));
}
input[name^="pick-"]:checked::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  transform: translate(-50%, -50%);
}
input[name^="pick-"]:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
input[name^="pick-"]:disabled { opacity: .4; cursor: not-allowed; }

/* ---- finding dispositions (clearing-comments loop on the report page) ---- */
.f-dispo { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--baseline); }
.f-dispo .d-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.f-dispo .d-row:first-child { margin-top: 0; }
.d-status { font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 3px 10px;
  border-radius: 999px; margin-right: 4px; white-space: nowrap; }
.d-status.open { background: var(--wash-warn); color: var(--st-warn-text);
  border: 1px solid rgba(250,178,25,.35); }
.d-status.cleared { background: var(--wash-good); color: var(--st-good-text);
  border: 1px solid rgba(12,163,12,.3); }
.d-btn { font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer;
  padding: 4px 11px; border-radius: 999px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--baseline); }
.d-btn:hover { border-color: var(--series-1); color: var(--series-1); }
.d-btn.active { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.d-note { flex: 1 1 260px; font: inherit; font-size: 12.5px; padding: 5px 9px;
  border: 1px solid var(--baseline); border-radius: 7px;
  background: var(--surface); color: var(--ink); min-width: 160px; }
.d-err { font-size: 11.5px; font-weight: 650; color: var(--st-crit-text); }
.pane-cleared { font-size: 12px; font-weight: 650; color: var(--muted);
  margin-left: 10px; letter-spacing: .2px; }

/* ---- evidence viewer drawer (report page; widescreen 1-2 source panes) ---- */
.ev-btn { font: inherit; font-size: 11px; font-weight: 650; cursor: pointer;
  margin-left: 8px; padding: 2px 9px; border-radius: 999px; color: var(--series-1);
  background: var(--wash-blue); border: 1px solid rgba(42,120,214,.25); }
.ev-btn:hover { background: var(--series-1); color: #fff; }
.ev-btn:disabled { opacity: .5; cursor: default; }
.ev-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(44vw, 860px);
  background: var(--surface); border-left: 1px solid var(--baseline);
  display: none; flex-direction: column; z-index: 60;
  box-shadow: -8px 0 22px rgba(0,0,0,.10); }
body.ev-open .ev-drawer { display: flex; }
@media (min-width: 1200px) {
  body.ev-open .rp-head, body.ev-open .rp-main, body.ev-open .rp-footer {
    margin-right: min(44vw, 860px); }
}
@media (max-width: 900px) { .ev-drawer { width: 100vw; } }
.ev-head { display: flex; gap: 8px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--grid); }
.ev-title { flex: 1; font-weight: 700; font-size: 13px; letter-spacing: .3px; }
.ev-panes { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ev-pane { flex: 1; display: flex; flex-direction: column; min-height: 0;
  border-bottom: 1px solid var(--grid); }
/* Two stacked viewers over white pages inside a white drawer read as one
   scrolling surface — the seam between them disappears exactly where the
   reader needs it. Each bar gets its own tinted band and a matching rail down
   the pane's full height, so "which viewer am I in" is answerable without
   reading the filename. Cool for the upper, warm for the lower: two hues far
   enough apart to tell instantly, muted enough not to compete with the figure
   highlights, which are the only saturated colour in the pane. */
.ev-bar { display: flex; gap: 6px; align-items: center; padding: 7px 10px;
  border-bottom: 1px solid var(--baseline);
  background: var(--page); box-shadow: inset 0 -1px 0 rgba(0,0,0,.04); }
.ev-panes > .ev-pane:nth-child(1) > .ev-bar {
  background: linear-gradient(180deg, #e8eff8, #dee8f4);
  border-bottom-color: #b9cde4; }
.ev-panes > .ev-pane:nth-child(2) > .ev-bar {
  background: linear-gradient(180deg, #f6eee2, #f0e4d2);
  border-bottom-color: #ddc9a9; }
/* the rail carries the identity past the bar, down the whole viewer */
.ev-panes > .ev-pane:nth-child(1) { border-left: 4px solid #7ea7d8; }
.ev-panes > .ev-pane:nth-child(2) { border-left: 4px solid #d9ab6a; }
/* one pane alone needs no identity — nothing to be confused with */
.ev-panes > .ev-pane:only-child { border-left: 0; }
.ev-panes > .ev-pane:only-child > .ev-bar { background: var(--page); }
.ev-doc { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 4px 6px;
  border: 1px solid var(--baseline); border-radius: 6px;
  background: var(--surface); color: var(--ink); }
.ev-page { width: 64px; font: inherit; font-size: 12px; padding: 4px 6px;
  border: 1px solid var(--baseline); border-radius: 6px;
  background: var(--surface); color: var(--ink); }
.ev-pg { font-size: 12px; color: var(--muted); }
.ev-x { border: 0; background: none; cursor: pointer; font-size: 17px;
  color: var(--muted); padding: 0 4px; }
.ev-x:hover { color: var(--st-crit-text); }
.ev-body { flex: 1; min-height: 0; }
.ev-frame { width: 100%; height: 100%; border: 0; display: block; }
.ev-note { padding: 18px; font-size: 13px; color: var(--ink-2); }
.ev-note a { color: var(--series-1); }

/* ---- evidence pane: rendered page image + anchor highlight ---- */
.ev-scroll { height: 100%; overflow: auto; background: #6b6b66; }
.ev-imgwrap { position: relative; margin: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.ev-img { width: 100%; display: block; background: #fff; }
/* The overlay's width/height are the text's own measured rectangle, so the
   padding that makes it a comfortable highlight has to grow OUTWARD. The
   global `* { box-sizing: border-box }` was pulling it inward instead: the
   box lost 2x the padding in width while the negative margin shifted it
   left, which is why the last character of a figure sat outside its own
   highlight. content-box restores the intent, and the padding is generous on
   purpose — a slightly oversized box reads as a highlighter stroke, an
   undersized one reads as a mistake. */
.ev-hl { position: absolute; pointer-events: none; border-radius: 4px;
  box-sizing: content-box;
  background: rgba(250, 210, 40, .35); border: 2px solid rgba(230, 160, 0, .9);
  box-shadow: 0 0 0 5px rgba(250, 210, 40, .18);
  margin: -7px -9px; padding: 7px 9px; }
/* per-figure boxes: fill and edge come from the chip's hue (inline), so the
   shared shadow stays neutral or the hues would all read the same */
.ev-hl.fig { border-width: 2px; box-shadow: none; transition: box-shadow .12s; }
.ev-hl.fig.fig-on { box-shadow: 0 0 0 4px rgba(0, 0, 0, .16); z-index: 2; }
.ev-nav { border: 1px solid var(--baseline); background: var(--surface); cursor: pointer;
  color: var(--ink-2); font-size: 15px; line-height: 1; padding: 3px 8px; border-radius: 6px; }
.ev-nav:hover { border-color: var(--series-1); color: var(--series-1); }
.ev-status { font-size: 11px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ev-status.good { color: var(--st-good-text); font-weight: 650; }
.ev-loading { position: absolute; top: 14px; left: 0; right: 0; text-align: center;
  font-size: 12px; color: #ddd; letter-spacing: .3px; pointer-events: none; }

/* ---- review mode: single finding (1/3) + evidence (2/3), chrome hidden ---- */
body.ev-review .topbar, body.ev-review .rp-head, body.ev-review .rp-main,
body.ev-review .rp-footer { display: none; }
.rv-panel { display: none; }
@media (min-width: 900px) {
  body.ev-review .rv-panel { display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; width: 33.4vw;
    background: var(--surface); border-right: 1px solid var(--baseline); z-index: 59; }
  body.ev-review.ev-open .ev-drawer { width: 66.6vw; }
}
.rv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--grid); }
.rv-count { font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  min-width: 64px; text-align: center; }
.rv-hint { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.rv-card { flex: 1; overflow: auto; padding: 14px; }
.rv-card .finding { margin: 0; }
/* The card's own "evidence viewer" button is redundant here: the viewer is
   already open on this exact finding, so it could only reopen what is on
   screen. It stays live in the tab panes, where the drawer may be showing a
   DIFFERENT finding and the button is how you switch. */
.rv-panel .ev-btn { display: none; }
.rv-panel .f-evidence { padding-bottom: 9px; }

/* targeted inquiry: a mini terminal pinned under the finding card — same
   dark identity as the run dialog so "this is the AI talking" reads at a
   glance, sized so the card above keeps most of the panel */
.rv-dlg { flex-shrink: 0; display: flex; flex-direction: column; max-height: 42%;
  background: #101418; color: #d6e2ea; border-top: 1px solid #2a3540;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.rv-dlg-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  font-weight: 700; color: #eaf2f7; border-bottom: 1px solid #2a3540; }
.rv-dlg-note { font-weight: 400; font-size: 11px; color: #7f93a3; font-style: italic; }
.rv-dlg-log { overflow-y: auto; padding: 8px 12px; min-height: 30px; }
.rv-dlg-turn { margin-bottom: 10px; }
.rv-dlg-q { color: #8fd18f; margin-bottom: 3px; }
.rv-dlg-q .dlg-chevron, .rv-dlg-form .dlg-chevron { color: #4a90d9; font-weight: 700; }
.rv-dlg-a { color: #d6e2ea; white-space: pre-wrap; padding-left: 12px;
  border-left: 2px solid #2a3540; }
/* :not([hidden]): same display-vs-hidden guard as .l-fill above */
.rv-dlg-form:not([hidden]) { display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-top: 1px solid #2a3540; }
.rv-dlg-input { flex: 1; background: transparent; border: 0; outline: none;
  color: #eaf2f7; font: inherit; caret-color: #8fd18f; }

/* ---- numcheck: deterministic $-figure verification chips ---- */
.f-numcheck { margin-top: 8px; font-size: 12px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.f-numcheck b { color: var(--ink); cursor: help; }
.nc-chip { display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid transparent; cursor: help; }
.nc-ok   { background: var(--wash-good); color: var(--st-good-text);
  border-color: rgba(12, 163, 12, .25); }
.nc-mid  { background: var(--page); color: var(--ink-2); border-color: var(--grid); }
.nc-warn { background: var(--wash-warn); color: var(--st-warn-text);
  border-color: rgba(250, 178, 25, .35); }
.nc-note .nc-chip { cursor: default; }

/* ---- figure chips: identity swatch + on-screen state ----
   Background = status (green/gray/amber), swatch = identity (matches the
   overlay hue in the source pane). Dim means "not on a page you can see". */
/* Sized and filled to survive its surroundings: the chip already carries a
   status tint, so a small pastel square on top of it disappeared. Solid hue,
   12px, and a ring in the surface colour that separates the token from any
   chip background it lands on. */
.nc-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px;
  margin-right: 6px; vertical-align: -2px;
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px rgba(0, 0, 0, .12); }
.nc-go { cursor: pointer; }
.nc-go:hover { filter: brightness(0.97); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.nc-away { opacity: .5; }
.nc-here { box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .22); }
.nc-gone { opacity: .45; text-decoration: line-through; cursor: default; }

/* ---- review mode: the disposition panel is the point of the screen ----
   Everywhere else this bar is a footnote on a card. Inside the evidence
   viewer it is the one thing we are asking the reader to DO, so it becomes a
   titled panel in the accent colour. The pulse runs a few cycles on arrival
   rather than forever — a permanent throb next to a document someone is
   reading closely turns from a cue into an irritation — and stops entirely
   once the finding is cleared. */
body.ev-review .f-dispo {
  margin-top: 14px; padding: 12px 13px 11px; border-radius: 10px;
  border: 2px solid var(--series-1); border-top-style: solid;
  background: var(--wash-blue);
}
body.ev-review .f-dispo::before {
  content: "Your call on this finding";
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: var(--series-1); margin-bottom: 9px;
}
body.ev-review .f-dispo.d-cleared { border-color: rgba(12, 163, 12, .45);
  background: var(--wash-good); }
body.ev-review .f-dispo.d-cleared::before { content: "Your call — recorded";
  color: var(--st-good-text); }
body.ev-review .f-dispo .d-btn { padding: 6px 12px; font-weight: 650; }
body.ev-review .f-dispo .d-note { padding: 7px 9px; }

@keyframes dispoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42, 120, 214, 0); }
  50%      { box-shadow: 0 0 0 7px rgba(42, 120, 214, .20); }
}
body.ev-review .f-dispo.d-open { animation: dispoPulse 1.7s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) {
  body.ev-review .f-dispo.d-open { animation: none; }
}

/* the header's evidence-viewer entry point: same pill shape as the export
   link but the primary accent, so two green pills don't read as one control */
.ev-link { background: var(--series-1); border-color: #1b5fae;
  box-shadow: 0 1px 3px rgba(0, 40, 90, .28); }
.ev-link:hover { box-shadow: 0 2px 6px rgba(0, 40, 90, .34); }

/* ---- pinned pane: which viewer holds still while the other follows ---- */
.ev-pin { font-size: 12px; padding: 3px 6px; line-height: 1; }
.ev-pin.on { border-color: var(--series-1); background: var(--wash-blue); }
.ev-pane:has(.ev-pin.on) > .ev-bar {
  box-shadow: inset 0 2px 0 var(--series-1), inset 0 -1px 0 rgba(0,0,0,.06); }

/* ---- data inventory: muted cells + the delete affordance ---- */
table.rec td.muted, .gen-main .muted { color: var(--muted); }
table.rec .btn-danger-link { padding: 2px 8px; font-size: 12px; }

/* ---- Document mapper (/docs/{id}/map) ----------------------------------
   Its own page rather than a panel inside the workbench: classifying a
   section needs the section list, the rendered page and the picker on
   screen at once, and that does not fit beside the upload step. */
.dm-main { max-width: 1500px; margin: 0 auto; padding: 14px 18px 28px; }
.dm-bar { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--grid); margin-bottom: 12px; }
.dm-back { font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.dm-back:hover { color: var(--series-1); }
.dm-name { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.dm-meta { font-size: 12px; color: var(--muted); }
.dm-queue { margin-left: auto; display: flex; gap: 7px; }
.dm-q { font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.dm-q.flag { background: var(--wash-crit, #fdeceb); color: var(--st-crit-text); }
.dm-q.unrouted { background: var(--surface, #f1f1ef); color: var(--ink-2); }
.dm-q.done { background: var(--wash-good, #eaf7f1); color: var(--st-good-text); }

.dm-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.6fr) minmax(280px, 1fr);
  gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dm-grid { grid-template-columns: 1fr; } }
.dm-col { border: 1px solid var(--grid); border-radius: 10px; background: var(--surface, #fff); }
.dm-list { max-height: 76vh; overflow-y: auto; padding: 6px; }
.dm-empty, .dm-hint, .dm-loading { font-size: 12.5px; color: var(--muted); padding: 14px; }

/* One section. The left border carries state, so a queue reads as a column
   of colour rather than as text you have to parse row by row. */
.dm-seg { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px;
  width: 100%; text-align: left; background: none; cursor: pointer;
  border: 1px solid transparent; border-left: 4px solid var(--grid);
  border-radius: 7px; padding: 8px 10px; margin-bottom: 3px; font: inherit; }
.dm-seg:hover { background: var(--page); }
.dm-seg.sel { border-color: var(--series-1); background: var(--page); }
.dm-seg.flag { border-left-color: #d6453a; }
.dm-seg.unrouted { border-left-color: #c9a227; }
.dm-seg.done { border-left-color: #1baf7a; }
.dm-seg-pp { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.dm-seg-title { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
/* align-self matters here: as a grid item the pill would otherwise stretch to
   the row's height, and a tall box under border-radius:999px renders as a big
   circle with the label stranded at its top edge. Centring shrinks it back to
   its text and sits it beside a title of any depth. */
.dm-seg-pill { font-size: 10px; text-transform: uppercase; letter-spacing: .3px;
  font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  align-self: center; }
.dm-seg-pill.flag { background: var(--wash-crit, #fdeceb); color: var(--st-crit-text); }
.dm-seg-pill.unrouted { background: var(--wash-warn); color: var(--st-warn-text); }
.dm-seg-pill.done { background: var(--wash-good, #eaf7f1); color: var(--st-good-text); }
/* Quiet green (2026-08-03): a clean map used to be a wall of grey that read
   as worry. The pill text still says "unchallenged" — words keep the caveat,
   color carries the mood. Softer than earned .done green on purpose. */
.dm-seg-pill.plain { background: var(--wash-good, #eaf7f1); color: var(--st-good-text);
  opacity: .75; }
.dm-seg.plain { border-left-color: rgba(27, 175, 122, .45); }
.dm-sort {
  margin-left: auto; border: 0; background: none; cursor: pointer;
  font-size: 11px; color: var(--muted); text-decoration: underline dotted;
}
.dm-sort:hover { color: var(--series-1); }
.dm-seg-note { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink-2); }

.dm-viewbar { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid var(--grid); }
.dm-nav { border: 1px solid var(--baseline); background: var(--surface); cursor: pointer;
  color: var(--ink-2); font-size: 15px; line-height: 1; padding: 2px 9px; border-radius: 6px; }
.dm-nav:disabled { opacity: .4; cursor: default; }
.dm-pageno { font-size: 12.5px; font-weight: 650; min-width: 44px; text-align: center; }
.dm-viewhint { font-size: 11.5px; color: var(--muted); }
.dm-canvas { padding: 10px; min-height: 320px; max-height: 72vh; overflow-y: auto;
  background: var(--page); border-radius: 0 0 10px 10px; }
.dm-img { display: block; width: 100%; height: auto; border: 1px solid var(--grid);
  border-radius: 6px; background: #fff; }

.dm-pick { padding: 12px 13px; }
.dm-pick-head { font-size: 12.5px; font-weight: 650; display: flex; justify-content: space-between;
  align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dm-pick-pp { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.dm-lab, .dm-seclab { display: block; font-size: 12px; font-weight: 650; margin: 12px 0 4px; }
.dm-lab .dm-sub, .dm-seclab .dm-sub { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
/* The section label, readable but not editable: it follows the kind pick.
   Free-text renaming was the magic-word game the picker exists to end. */
.dm-title-ro { font-size: 12.5px; padding: 7px 8px; border: 1px dashed var(--grid);
  border-radius: 7px; background: var(--page); color: var(--ink-2); }
.dm-select, .dm-input { width: 100%; font: inherit; font-size: 12.5px; padding: 7px 8px;
  border: 1px solid var(--baseline); border-radius: 7px; background: var(--surface); color: var(--ink); }
/* The consequence of the choice, never hidden behind a save */
.dm-dest { margin-top: 7px; font-size: 12px; color: var(--ink-2); padding: 6px 9px;
  border-radius: 7px; background: var(--page); border: 1px dashed var(--grid); }
.dm-dest.chosen { border-style: solid; border-color: rgba(27,175,122,.4);
  background: var(--wash-good, #eaf7f1); color: var(--st-good-text); }
.dm-inferred { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.dm-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dm-why { margin-top: 12px; font-size: 11.5px; color: var(--ink-2);
  border-top: 1px dashed var(--grid); padding-top: 8px; }
.dm-why b { color: var(--ink); }

/* The document-kind picker in step 1. Styled to sit in the metadata line
   like the text it replaced — it is a correction, not a form field, and
   should not shout. It shows a chosen state because "the classifier guessed"
   and "a human decided" are different facts about a document. */
.doctype-pick { font: inherit; font-size: 11.5px; color: var(--ink-2);
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 1px 4px; max-width: 260px; cursor: pointer; }
.doctype-pick:hover { border-color: var(--baseline); background: var(--surface); }
.doctype-pick.chosen { color: var(--st-good-text); font-weight: 650;
  background: var(--wash-good, #eaf7f1); border-color: rgba(27,175,122,.35); }

/* Account: sign-in guidance, and the pills that rank the two routes. Both are
   two-factor; the page still has to say which one to reach for. */
.acct-guide { border-left: 3px solid var(--series-1); }
.acct-pill { font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
  margin-left: 7px; background: var(--surface, #f1f1ef); color: var(--muted); }
.acct-pill.good { background: var(--wash-good, #eaf7f1); color: var(--st-good-text); }

/* Step 1: find / sort bar. Hidden below three sets — a control that manages a
   list nobody needs help reading is just noise above the list. */
.bset-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--grid); }
.bset-search { flex: 1 1 240px; min-width: 180px; font: inherit; font-size: 12.5px;
  padding: 6px 10px; border: 1px solid var(--baseline); border-radius: 8px;
  background: var(--surface); color: var(--ink); }
.bset-search:focus { outline: none; border-color: var(--series-1); }
.bset-sortlab { font-size: 11.5px; color: var(--muted); }
.bset-sort { font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--baseline); background: var(--surface); color: var(--ink-2); }
.bset-count { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* Feedback: the one colored link in the header (it exists to be found), the
   filing popup, and the ticket pages. Violet is feedback's identity color —
   unused by any status scale, so it never reads as good/bad. */
.fb-link { color: var(--violet); font-weight: 700; }
.fb-link:hover { color: var(--violet); text-decoration: underline; }
body.mode-multi .topbar .fb-link { color: #cbbcff; }
.fb-word { color: var(--violet); }
.fb-dialog { border: 1px solid var(--baseline); border-radius: 12px; padding: 18px 20px;
  width: min(480px, 92vw); box-shadow: 0 18px 50px rgba(11, 11, 11, .22); }
.fb-dialog::backdrop { background: rgba(11, 11, 11, .35); }
.fb-dialog h3 { margin: 0 0 6px; color: var(--violet); }
.fb-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.fb-fields { display: flex; flex-direction: column; gap: 8px; }
.fb-fields select, .fb-fields input, .fb-fields textarea { font: inherit; font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--baseline); border-radius: 8px;
  background: var(--surface); color: var(--ink); }
.fb-fields textarea { resize: vertical; }
.fb-fields :focus { outline: 2px solid var(--violet); border-color: transparent; }
.fb-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.fb-actions .spacer { flex: 1; }
.fb-all { font-size: 12.5px; color: var(--muted); }
.fb-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.fb-num { color: var(--violet); font-weight: 700; text-decoration: none; }
.fb-title { color: var(--ink); text-decoration: none; }
.fb-title:hover, .fb-num:hover { text-decoration: underline; }
.chip.fb-st-open { background: rgba(74, 58, 167, .10); border-color: var(--violet); color: var(--violet); }
.chip.fb-st-in_progress { background: var(--wash-warn); border-color: var(--st-warn); color: var(--st-warn-text); }
.fb-body { white-space: pre-wrap; font-size: 13.5px; margin: 10px 0; }
.fb-statusrow { display: flex; align-items: center; gap: 6px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--grid); }
.fb-statusrow .fb-st-here { border-color: var(--violet); color: var(--violet); opacity: 1; }
.fb-comment { padding: 8px 0; border-bottom: 1px solid var(--grid); }
.fb-comment p { margin: 4px 0 0; white-space: pre-wrap; font-size: 13px; }
.fb-comment:last-of-type { border-bottom: 0; }
.fb-commentform { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 12px; }
.fb-commentform textarea { width: 100%; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--baseline); border-radius: 8px; background: var(--surface); color: var(--ink); }
.fb-new { display: inline-block; padding: 8px 16px; background: var(--violet);
  color: #fff; border-radius: 8px; font-size: 13px; font-weight: 650;
  text-decoration: none; white-space: nowrap; }
.fb-new:hover { background: #3b2e86; }
.rolecell { display: flex; gap: 4px; align-items: center; }
.rolecell select { font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 7px;
  border: 1px solid var(--baseline); background: var(--surface); color: var(--ink-2); }
.fb-legend { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px;
  font-size: 12.5px; color: var(--ink-2); }
.fb-legend .chip { margin-right: 6px; }
.chip.fb-lg-system { background: var(--wash-blue); border-color: var(--series-1); color: var(--series-1); }
.chip.fb-lg-full { background: var(--wash-warn); border-color: var(--st-warn); color: var(--st-warn-text); }

/* ---- prompt-cache switch & live-cache chips (step 3 / bundle cards / report) ---- */
.cache-row { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 2px 0 12px; flex-wrap: wrap; padding: 7px 10px;
  border: 1px solid var(--baseline); border-radius: 9px; background: var(--page); }
.cache-row .as-label { font-weight: 650; }
.qpill { border: 1px solid var(--baseline); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; width: 20px; height: 20px; font-size: 12px; font-weight: 700;
  line-height: 1; cursor: pointer; }
.qpill:hover { color: var(--series-1); border-color: var(--series-1); }
.cache-note { flex-basis: 100%; font-size: 12px; color: var(--ink-2); background: var(--page);
  border: 1px dashed var(--grid); border-radius: 7px; padding: 8px 10px; }
.cache-chip { font-size: 11px; font-weight: 650; padding: 1px 8px; border-radius: 999px;
  background: var(--wash-good, #eaf7f1); color: var(--st-good-text);
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- follow-up dialog: terminal-style thread over the report ---- */
/* Deliberately dark in both themes — it reads as a terminal, and the
   contrast makes "this is a different mode" obvious over the memo. */
.dlg-panel { position: fixed; inset: 48px 16px 16px 16px; z-index: 60;
  display: flex; flex-direction: column; border-radius: 10px;
  background: #101418; color: #d6e2ea; border: 1px solid #2a3540;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
/* same trap as .sizing-modal above: display:flex outranks [hidden]'s UA
   display:none, so the closed panel showed anyway */
.dlg-panel[hidden], .dlg-tab[hidden] { display: none; }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid #2a3540; }
.dlg-title { font-weight: 700; color: #eaf2f7; }
.dlg-model { font-size: 11px; color: #7f93a3; }
select.dlg-model {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 4px; cursor: pointer;
}
.dlg-btn { border: 1px solid #2a3540; background: #182028; color: #d6e2ea;
  border-radius: 6px; padding: 3px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.dlg-btn:hover { border-color: #4a90d9; }
.dlg-btn:disabled { opacity: .4; cursor: default; }
.dlg-log { flex: 1; overflow-y: auto; padding: 14px 16px; }
.dlg-turn { margin-bottom: 14px; }
.dlg-q { color: #8fd18f; margin-bottom: 4px; }
.dlg-q .dlg-chevron { color: #4a90d9; font-weight: 700; }
.dlg-stamp { color: #5a6b78; font-size: 11px; margin-left: 8px; }
.dlg-a { color: #d6e2ea; white-space: pre-wrap; padding-left: 14px;
  border-left: 2px solid #2a3540; }
.dlg-note { color: #7f93a3; font-style: italic; margin-bottom: 12px; }
.dlg-inputrow { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-top: 1px solid #2a3540; }
.dlg-inputrow .dlg-chevron { color: #4a90d9; font-weight: 700; }
.dlg-input { flex: 1; background: transparent; border: 0; outline: none;
  color: #eaf2f7; font: inherit; caret-color: #8fd18f; }
.dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 14px; border-top: 1px solid #2a3540; font-size: 11.5px; color: #7f93a3;
  font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.dlg-footnote { font-style: italic; }
.dlg-tab { position: fixed; right: 16px; bottom: 16px; z-index: 59;
  border: 1px solid #2a3540; background: #101418; color: #d6e2ea;
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.dlg-tab:hover { border-color: #4a90d9; }
.dlg-docs { display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: #a8bccb; cursor: pointer; white-space: nowrap; }
.dlg-docs input { accent-color: #4a90d9; }

/* ---- Reviews: underway cards + mode tags (2026-09-06) ---- */
.live-panel { border-color: var(--accent, #2b6cb0); }
.live-landed { display: block; font-size: 12px; font-weight: 400; color: var(--muted, #666); margin-top: 4px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.live-card { position: relative; }
.live-status { }
.live-meter { position: relative; height: 8px; border-radius: 4px; background: rgba(43, 108, 176, .12); overflow: hidden; margin: 10px 0 4px; }
.live-fill { display: block; height: 100%; width: 12%; border-radius: 4px;
  background: linear-gradient(90deg, #2b6cb0, #63b3ed, #2b6cb0); background-size: 200% 100%;
  animation: live-shimmer 1.6s linear infinite; transition: width .6s ease; }
.live-meter.indeterminate .live-fill { width: 34%; animation: live-slide 1.8s ease-in-out infinite, live-shimmer 1.6s linear infinite; }
@keyframes live-shimmer { from { background-position: 0 0; } to { background-position: -200% 0; } }
@keyframes live-slide { 0% { margin-left: -34%; } 100% { margin-left: 100%; } }
.live-stage { font-size: 12px; color: var(--muted, #666); min-height: 16px; }
.mode-tag { font-size: 10px; letter-spacing: .04em; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; margin-left: 6px; }
.mode-tag.batch { color: #6b46c1; }
.mode-tag.ondemand { color: #2b6cb0; }

/* ---- Reviews: one card per document set (2026-09-07) ---- */
.set-list { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.set-card { border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--card, #fff); padding: 10px 14px 8px; }
.set-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line, #eee); margin-bottom: 4px; }
.set-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.set-newest { font-size: 12px; color: var(--muted, #666); white-space: nowrap; }
.rev-row { display: flex; gap: 14px; padding: 9px 4px; border-radius: 6px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line, #f0f0f0); }
.rev-row:last-of-type { border-bottom: none; }
.rev-row:hover { background: rgba(43, 108, 176, .05); }
.rev-date { display: flex; flex-direction: column; min-width: 108px; line-height: 1.15; }
.rev-date b { font-size: 14px; color: var(--ink); }
.rev-date small { font-size: 11.5px; color: var(--muted, #666); }
.rev-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rev-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.rev-engine { font-weight: 600; }
.rev-result { font-size: 12.5px; color: var(--ink-2, #333); line-height: 1.35; overflow-wrap: anywhere; }
.rev-toggle { background: none; border: none; color: var(--accent, #2b6cb0); font-size: 12px; cursor: pointer; padding: 6px 4px 2px; }
.rev-toggle:hover { text-decoration: underline; }
