/* 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;
}
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);
}
.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;
}
.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 {
  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); }
.f-evidence {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--page); border: 1px solid var(--grid);
  font-size: 12.5px; color: var(--ink-2);
}
.f-evidence b { color: var(--ink); }
.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; }

/* 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); }

.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); }
.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); }

/* 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;
}
.nosave-check { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.prompt-new .btn-small { align-self: flex-start; }
.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; }
.mp-lane .l-fill {
  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.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: #f06d0f; border: 0;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.mp-tag.beta { background: #d61f76; }

.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;
  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; }
.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; }
.usertable .methods .chip { margin-right: 4px; }
.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;
}

/* ---- MultiPass guide (/guide/multipass) ---------------------------------
   Office-casual explainer: the orange/magenta MultiPass palette over the
   app's standard panels. The routing diagram is pure CSS — colored dots on
   the doc list recur inside each pass card, so the fan-out reads without
   connector lines. */
.mpg-link { color: #f06d0f; font-weight: 700; }
.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; }

.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; }
