/* Pareto Desk (from the shared fleet stylesheet) - one stylesheet, both themes, no external fonts. */

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --ink: #e6edf3;
  --ink-dim: #9aa7b4;
  --line: #2a3441;
  --accent: #b48cff;
  --accent-ink: #08131f;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --crit: #ff7b72;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
}

:root[data-theme="light"] {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --panel2: #f0f3f6;
  --ink: #1f2328;
  --ink-dim: #5b6570;
  --line: #d8dee4;
  --accent: #6a3fc8;
  --accent-ink: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  --crit: #a40e26;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

code, pre, .mono { font-family: var(--mono); }
.mono { font-size: 0.92em; }
.small { font-size: 0.85em; }
.muted { color: var(--ink-dim); }
.hidden { display: none !important; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* --- top bar ------------------------------------------------------------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand .sep { color: var(--ink-dim); }
.backlink { text-decoration: none; }
.topactions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.credits { font-family: var(--mono); font-size: 0.85em; color: var(--ink-dim); }
.topup {
  font-size: 0.85em;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}

/* --- buttons -------------------------------------------------------------- */

button { font-family: inherit; font-size: 1em; cursor: pointer; }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
}
.ghost:hover { background: var(--panel2); }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-weight: 600;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

.big {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
}
.big:hover { border-color: var(--accent); }

.mini {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85em;
}
.mini:hover { border-color: var(--accent); }

.linkish {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

/* --- layout ---------------------------------------------------------------- */

main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

.hero h1 { font-size: 1.9rem; line-height: 1.25; margin: 18px 0 10px; }
.lede { font-size: 1.05rem; color: var(--ink); max-width: 74ch; }
.herobtns { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 18px 0;
}
.card h2 { font-size: 1.15rem; margin: 0 0 10px; }
.card h3 { font-size: 1.05rem; margin: 0 0 10px; }
.count {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
  margin-left: 6px;
}

.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.labelrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.labelrow label { font-weight: 600; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1 1 240px; }

textarea, select, input[type="file"] {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.5;
}
select { font-family: var(--sans); font-size: 0.95rem; }
textarea { resize: vertical; }
textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.dropzone { border: 1px dashed transparent; border-radius: 10px; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragging { border-color: var(--accent); background: rgba(76, 154, 255, 0.06); }
.droprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.droprow input[type="file"] { width: auto; flex: 0 1 auto; font-size: 0.8rem; padding: 4px; }

.runrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

.rungate {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: rgba(210, 153, 34, 0.08);
  font-size: 0.92em;
}
.gateaction { font-weight: 600; cursor: pointer; }

/* --- prescan ---------------------------------------------------------------- */
.prescan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel2);
  margin-bottom: 14px;
}
.prescan h2 { font-size: 1rem; }
.flaglist { list-style: none; padding: 0; margin: 8px 0 0; }
.flaglist li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.92em; }
.progresshead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; }
.step { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--ink-dim); }
.step-ic {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line); flex: 0 0 auto;
}
.step.done { color: var(--ink); }
.step.done .step-ic { background: var(--ok); border-color: var(--ok); }
.step.live { color: var(--ink); }
.step.live .step-ic { border-color: var(--accent); background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- result ---------------------------------------------------------------------- */

.resulthead h2 { font-size: 1.35rem; }
.verdict {
  font-size: 1.03rem;
  border-left: 3px solid var(--line);
  padding-left: 12px;
  margin: 10px 0;
}
.sdkstrip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
}
.sdkbox { display: flex; flex-direction: column; min-width: 78px; }
.sdkbox strong { font-size: 1.25rem; }
.sdkarrow { color: var(--ink-dim); font-size: 1.3rem; }
.warnline {
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(210, 153, 34, 0.09);
}
.warnline ul { margin: 6px 0 0; padding-left: 18px; }
.warnline li { margin: 2px 0; word-break: break-word; }
pre.snippet, pre.bigpre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre;
  margin: 0;
}
pre.bigpre { max-height: 480px; overflow-y: auto; }
.tablewrap { overflow-x: auto; }
table.inv { width: 100%; border-collapse: collapse; font-size: 0.9em; min-width: 560px; }
table.inv th, table.inv td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.inv th { color: var(--ink-dim); font-weight: 600; font-size: 0.85em; }
.exportrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* --- history ------------------------------------------------------------------------- */

.history { list-style: none; padding: 0; margin: 0 0 10px; }
.history li { border-top: 1px solid var(--line); }
.history li:first-child { border-top: none; }
.histbtn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--ink);
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.histbtn:hover { background: var(--panel2); }
.histtitle { font-weight: 600; }
.histmeta { color: var(--ink-dim); }
.histload { margin: 0 0 10px 4px; }

.explain p { max-width: 78ch; }
/* --- footer + toasts -------------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.9em;
}
.foot p { margin: 6px 0; max-width: 80ch; margin-left: auto; margin-right: auto; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  font-size: 0.92em;
  transition: opacity 0.5s;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--bad); }
.toast.gone { opacity: 0; }
.toast a { margin-left: 8px; font-weight: 600; }

/* --- docs pages ---------------------------------------------------------------------- */

.doc { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.doc h1 { font-size: 1.7rem; }
.doc h2 { font-size: 1.2rem; margin-top: 30px; }
.doc h3 { font-size: 1rem; margin-top: 22px; }
.doc p, .doc li { max-width: 80ch; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.9em; margin: 12px 0; }
.doc th, .doc td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink-dim); }
.doc code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.88em; }
.doc pre code { background: none; border: none; padding: 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 0; }
.tab {
  background: var(--panel2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 5px 12px;
  font-size: 0.85em;
}
.tab.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.codegroup pre { border-radius: 0 8px 8px 8px; margin-top: 0; }
.codegroup pre[hidden] { display: none; }

.tokenrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.tokenbox {
  flex: 1 1 320px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  min-height: 44px;
}
.statebox { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel2); margin: 12px 0; }
.badge {
  font-family: var(--mono);
  font-size: 0.74em;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: color-mix(in srgb, var(--ok) 75%, var(--ink)); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: color-mix(in srgb, var(--warn) 75%, var(--ink)); }
.status-ok { color: var(--ok); } .status-warn { color: var(--warn); } .status-bad { color: var(--bad); }
.reconrow { display: grid; grid-template-columns: minmax(0, 12ch) 1fr; gap: 6px 12px; padding: 6px 0; border-bottom: 1px solid var(--line, #3a3f4b); }
.reconrow .mono { word-break: break-word; }
.labelrow select { max-width: 12rem; }
@media (max-width: 480px) { .herobtns .big { width: 100%; } .exportrow .mini { flex: 1 1 45%; } }
.tablewrap:focus-visible, pre.bigpre:focus-visible, .gateaction:focus-visible { outline: 3px solid var(--accent, #7aa2ff); outline-offset: 2px; }

/* --- shared desk components ------------------------------------------------------ */
input[type="text"] {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset.group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 14px; }
fieldset.group legend { font-weight: 700; padding: 0 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid3 .field > label { font-size: 0.88em; font-weight: 600; }
.checkfield { display: flex; align-items: flex-end; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.88em; }
.dropzone.droprow { padding: 8px; }
.verdictline { font-weight: 600; font-size: 1.02rem; margin: 4px 0 10px; }
.twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }
table.inv.kv { min-width: 0; }
table.inv.kv td:last-child { text-align: right; white-space: nowrap; }
table.inv.num td + td, table.inv.num th + th, table.inv.grid td, table.inv.grid thead th + th { text-align: right; white-space: nowrap; }
table.inv tr.strong td { font-weight: 700; }
table.inv.grid th.base, table.inv.grid td.base { outline: 2px solid var(--accent); outline-offset: -2px; }
.flags { list-style: none; padding: 0; margin: 6px 0 12px; }
.flagrow { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.flagrow:first-child { border-top: none; }
.verdict { border-left: 4px solid var(--line); padding: 6px 12px; font-weight: 700; }
.verdict.verdict-supportable { border-left-color: var(--ok); }
.verdict.verdict-stretched { border-left-color: var(--warn); }
.verdict.verdict-not_supportable { border-left-color: var(--bad); }
.driver, .option { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.driverhead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.driver p, .option p { margin: 6px 0 0; }
.recon { margin: 6px 0; padding-left: 20px; }
.recon.bad li { color: var(--bad); }
.histrow { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 2px; }
.histrow .linkish { text-align: left; font-weight: 600; }
@media (max-width: 760px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .twocol { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .grid3 { grid-template-columns: 1fr; } }
@media print {
  .topbar, .toasts, .exportrow, form, #progressPanel, #historyZone, .herobtns, .foot, .hero { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; break-inside: avoid; }
}

/* Shared desk additions */
table.inv tr.excluded td { opacity: 0.55; }
table.inv tr.statrow td { background: var(--panel2); }
table.inv tr.statrow.first td { border-top: 2px solid var(--line); }
table.inv td.nm { color: var(--ink-dim); }
table.inv td.outlier { outline: 2px dashed var(--warn, #d9a441); outline-offset: -3px; }
.reading { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.reading p { margin: 6px 0 0; }
label.incl { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
textarea.mono { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 0.85em; }
.twocol > div { min-width: 0; }

/* --- Lanes, tables, findings -------------------------------------- */
.verdict.verdict-client_ready { border-left-color: var(--ok); }
.verdict.verdict-fix_before_sending { border-left-color: var(--warn); }
.verdict.verdict-not_ready { border-left-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid2 .field > label { font-size: 0.88em; font-weight: 600; }
.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 1100px; margin: 14px auto 0; padding: 0 16px; box-sizing: border-box; }
.lane { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); cursor: pointer; min-width: 0; }
.lane strong { font-size: 1rem; }
.lane:hover { border-color: var(--accent); }
.lane.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--panel2); }
.laneline { margin: 6px 0 0; color: var(--ink-dim); }
.lanepane { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.flags li.flag { padding: 6px 0; border-bottom: 1px solid var(--line); }
.flags li.flag > div { margin-top: 3px; overflow-wrap: anywhere; }
.badge.id { background: var(--panel2); color: var(--ink); font-family: var(--mono); }
details.numbers { margin: 8px 0 12px; }
details.numbers summary { cursor: pointer; font-weight: 600; }
.sevblock { margin-bottom: 14px; }
.sevblock h3 { margin: 4px 0 6px; }
.sev-critical > h3 { color: var(--bad); }
.sev-important > h3 { color: var(--warn); }
.sevblock h4 { margin: 10px 0 4px; font-size: 0.95rem; }
ol.findings { padding-left: 22px; margin: 4px 0; }
li.finding { padding: 6px 0 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
li.finding p { margin: 4px 0; }
li.finding .action { color: var(--ink-dim); }
blockquote.quote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--line); font-family: var(--mono); font-size: 0.88em; color: var(--ink-dim); overflow-wrap: anywhere; }
blockquote.quote.missing { border-left-color: var(--bad); text-decoration: line-through; }
.checklist { list-style: none; padding: 0; margin: 4px 0; font-family: var(--mono); }
.checklist li { padding: 3px 0; }
.changes { padding-left: 18px; }
.changes li { padding: 4px 0; overflow-wrap: anywhere; }
.applied { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; background: var(--panel2); min-width: 0; }
.cleared { margin-top: 10px; }
.strong { font-weight: 600; }
.recon.warn li { color: var(--warn); }
.recon.ok li { color: var(--ink-dim); }
table.inv td { overflow-wrap: anywhere; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .lanes { grid-template-columns: 1fr; } }

/* inherited from the desk scaffold */
.verdict.verdict-further_diligence { border-left-color: var(--ok); }
.verdict.verdict-pass { border-left-color: var(--warn); }
.verdict.verdict-hard_pass { border-left-color: var(--bad); }
.crit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.crit-grid .field { margin: 0; }
.crit-grid input[type="text"] { width: 100%; }
.qlist { padding-left: 1.4em; margin: 6px 0 12px; }
.qlist li { padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.qlist li .why { display: block; color: var(--ink-dim); font-size: 0.88em; margin-top: 2px; }
.qtopic { margin: 14px 0 2px; font-size: 0.95rem; }
.star { color: var(--warn); font-weight: 700; }
.pointlist { padding-left: 1.2em; margin: 6px 0; }
.pointlist li { padding: 4px 0; overflow-wrap: anywhere; }
.quote { display: block; color: var(--ink-dim); font-size: 0.88em; font-style: italic; margin-top: 2px; }
.quote.bad { color: var(--bad); font-style: normal; }
dl.facts { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 6px 14px; margin: 6px 0; }
dl.facts dt { color: var(--ink-dim); font-size: 0.9em; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: 6px; } }

/* --- shared components */
.verdict.skew-upside { color: var(--ok); border-color: var(--ok); }
.verdict.skew-balanced { color: var(--warn); border-color: var(--warn); }
.verdict.skew-downside { color: var(--bad); border-color: var(--bad); }
.yoy-pos { color: var(--ok); font-weight: 600; }
.yoy-neg { color: var(--bad); font-weight: 600; }
.yoy-neutral { color: var(--ink-dim); }
.qlist li .bar { display: block; font-family: var(--mono); font-size: 0.85em; margin-top: 2px; }
.qlist li .bar.bad { color: var(--bad); }
.scen-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.scen-case { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel2); }
.scen-case h4 { margin: 0 0 6px; }
.scen-case p { margin: 4px 0; }
table.inv tr.case-bull td:first-child { color: var(--ok); }
table.inv tr.case-bear td:first-child { color: var(--bad); }
table.inv tr.subject td { font-weight: 600; }
.ai-disclaimer { background: #fff3b0; color: #3d3200; border: 1px solid #e0c200; border-radius: 6px; text-align: center; padding: 6px 10px; font-weight: 600; font-size: 0.9em; margin: 0 0 10px; }
blockquote.mgmt { margin: 8px 0 8px 12px; padding: 4px 0 4px 12px; border-left: 3px solid var(--accent); font-style: italic; }
blockquote.mgmt cite { display: block; font-style: normal; font-size: 0.82em; color: var(--ink-dim); margin-top: 2px; }
p.paraphrase { margin: 6px 0 6px 12px; font-size: 0.9em; color: var(--warn); }
ul.thesis > li { margin-bottom: 10px; }
.pointlist li .why { display: block; font-size: 0.82em; color: var(--ink-dim); font-family: var(--mono); }
ol.appendix { padding-left: 20px; }
ol.appendix li { margin: 5px 0; font-size: 0.9em; }
#estBody td:nth-child(n+3), #noteEstBody td:nth-child(n+2) { white-space: nowrap; }
@media print {
  .ai-disclaimer { border: 1px solid #999; }
}

/* --- shared components */

/* api.html code samples must scroll inside their box, never widen the page at phone width. */
.doc pre { overflow-x: auto; max-width: 100%; box-sizing: border-box; }
.doc pre, .codegroup pre { white-space: pre; }
.doc table { display: block; overflow-x: auto; max-width: 100%; }

.badge.st-green { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.badge.st-amber { background: color-mix(in srgb, var(--warn) 16%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.badge.st-red { background: color-mix(in srgb, var(--bad) 16%, transparent); color: color-mix(in srgb, var(--bad) 80%, var(--ink)); }
.badge.st-grey { background: var(--panel2); color: var(--ink-dim); }

.spark { width: 100px; height: 28px; display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark-target { stroke: var(--ink-dim); stroke-width: 1; stroke-dasharray: 3 3; }
.spark-dot { fill: var(--ink-dim); }
.spark-dot.st-green { fill: var(--ok); }
.spark-dot.st-amber { fill: var(--warn); }
.spark-dot.st-red { fill: var(--bad); }

td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.good { color: var(--ok); }
td.bad { color: var(--bad); }
td.zhot { color: var(--bad); font-weight: 700; }
td.drv { color: var(--bad); font-weight: 600; }
td.off { color: var(--ok); }
tr.topseg td { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.flag.sev-critical { border-left: 3px solid var(--crit); }
.flag.sev-high { border-left: 3px solid var(--bad); }
.flag.sev-medium { border-left: 3px solid var(--warn); }
.flag.sev-low { border-left: 3px solid var(--line); }

.verdict.overall-on_track { color: var(--ok); border-color: var(--ok); }
.verdict.overall-mixed { color: var(--warn); border-color: var(--warn); }
.verdict.overall-off_track { color: var(--bad); border-color: var(--bad); }
.verdict.verdict-rate, .verdict.verdict-mix, .verdict.verdict-mixed, .verdict.verdict-volume { color: var(--accent); border-color: var(--accent); }
.verdict.verdict-inconclusive { color: var(--warn); border-color: var(--warn); }

.recon li.ok { color: var(--ink-dim); }
.recon li.bad { color: var(--bad); }

.prose { font-size: 1.02rem; }
.result .card + .card { margin-top: 14px; }
.progress .steps { margin: 8px 0 0; }
.card.grid2 > div { min-width: 0; }

@media (max-width: 640px) {
  .spark { width: 70px; }
  .herobtns .big { width: 100%; }
}
.flags li.flag[class*="sev-"] { padding-left: 10px; }

/* --- shared components */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.grid4 .field > label { font-size: 0.88em; font-weight: 600; }
@media (max-width: 760px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
input[type="date"] { width: 100%; box-sizing: border-box; }
.verdict.verdict-ready { border-left-color: var(--ok); }
.verdict.verdict-proceed_with_assumptions { border-left-color: var(--warn); }
.verdict.verdict-close_first { border-left-color: var(--bad); }
p.verdict-ready { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
p.verdict-proceed_with_assumptions { color: color-mix(in srgb, var(--warn) 85%, var(--ink)); }
p.verdict-close_first { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
p.gate { border-left: 3px solid var(--warn); padding: 8px 12px; background: var(--panel2); border-radius: 6px; margin: 10px 0; }
p.gate:empty { display: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.st-file { color: color-mix(in srgb, var(--bad) 80%, var(--ink)); font-weight: 600; }
td.st-near { color: color-mix(in srgb, var(--warn) 85%, var(--ink)); }
td.st-exempt, td.st-below, td.st-no_payee { color: var(--ink-dim); }
tr.row-exempt td, tr.row-below td { opacity: 0.8; }
td.w9-missing { color: color-mix(in srgb, var(--bad) 80%, var(--ink)); font-weight: 600; }
td.w9-on_file { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
td.w9-unknown { color: var(--ink-dim); }
table.inv td, table.inv th { overflow-wrap: anywhere; }
.flags li span, .pointlist li span, .qlist li span { overflow-wrap: anywhere; }

/* shared additions */
.verdict.verdict-ready_to_send { color: var(--ok); }
.verdict.verdict-confirm_then_send { color: var(--warn); }
.verdict.verdict-resolve_first { color: var(--bad); }
td.chk-pass { color: var(--ok); font-weight: 600; }
td.chk-confirm { color: var(--warn); font-weight: 600; }
td.chk-issue { color: var(--bad); font-weight: 600; }
td.sev-high { color: var(--bad); font-weight: 600; }
td.sev-medium { color: var(--warn); font-weight: 600; }
td.sev-low { color: var(--ink-dim); }
.recon li.warn { color: var(--warn); }
#sinceLine { border-left: 3px solid var(--accent); padding-left: 10px; }
#envMessage { white-space: pre-wrap; word-break: break-word; }
.status-bad { color: var(--bad); }
.status-ok { color: var(--ok); }


/* earlier per-app additions (shared stylesheet) */
.verdict { border-left: 4px solid var(--line); padding-left: 10px; }
.verdict.verdict-safe { border-left-color: var(--ok); }
.verdict.verdict-at_risk { border-left-color: var(--warn); }
.verdict.verdict-broken { border-left-color: var(--bad); }
.sevcard { border-left-width: 4px; }
.sevcard.sev-critical, .sevcard.sev-high { border-left-color: var(--bad); }
.sevcard.sev-medium { border-left-color: var(--warn); }
.sevcard.sev-low { border-left-color: var(--line); }
.hcard pre.snippet { margin: 6px 0; }
.flag.otherlane { opacity: 0.6; }
textarea.mono { font-family: var(--mono); font-size: 0.88em; tab-size: 2; }
#tools pre.snippet { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 3.2em; }
pre.snippet, pre.bigpre { max-width: 100%; box-sizing: border-box; overflow-x: auto; }
.hero h1 sup { font-size: 0.6em; }
.lanes { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.lanes button { flex: 1 1 200px; text-align: left; }
.lanes button[aria-selected="true"] { outline: 2px solid var(--accent); }
.lanes button small { display: block; color: var(--ink-dim); font-weight: 400; }
.hcard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--panel2); }
.hcard h4 { margin: 0 0 4px; font-size: 0.95rem; }
.hcard p, .hcard ul { margin: 4px 0; }
.hcard .meta { color: var(--ink-dim); font-size: 0.85em; }
.none { color: var(--ink-dim); font-style: italic; }
.wrapurl { overflow-wrap: anywhere; word-break: break-word; }
td.mono, td.small { overflow-wrap: anywhere; }
.doc pre { overflow-x: auto; max-width: 100%; box-sizing: border-box; }

/* Pareto Desk */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
details.settings { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--panel2); }
details.settings summary { cursor: pointer; font-weight: 600; }
details.settings input, details.settings select { width: 100%; box-sizing: border-box; }
.filelabel { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.filelabel input[type=file] { max-width: 180px; }
.status-warn { color: var(--warn); font-weight: 600; }
p.verdict-probable { color: color-mix(in srgb, var(--ok) 85%, var(--ink)); }
p.verdict-tentative { color: color-mix(in srgb, var(--warn) 85%, var(--ink)); }
p.verdict-unassigned { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
tr.selrow td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mirrorbox { width: 100%; max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
svg.mirror { display: block; width: 100%; height: auto; }
svg.mirror .axis { stroke: var(--ink-dim); stroke-width: 1; }
svg.mirror .tick, svg.mirror .lbl { fill: var(--ink-dim); font-size: 11px; font-family: var(--mono); }
svg.mirror .pk { stroke-width: 2; }
svg.mirror .pk-q, svg.mirror .pk-r { stroke: var(--ink-dim); opacity: 0.6; }
svg.mirror .pk-match { stroke: var(--accent); }
svg.mirror .pk-shift { stroke: var(--warn); }
textarea.mono { white-space: pre; overflow-x: auto; }
.placeholder-note { font-size: 0.9em; }
pre.bigpre, pre.snippet { white-space: pre-wrap; word-break: break-word; max-width: 100%; box-sizing: border-box; }
.doc pre { overflow-x: auto; max-width: 100%; box-sizing: border-box; }
p.verdict-recommend { color: color-mix(in srgb, var(--ok) 85%, var(--ink)); }
p.verdict-close_call { color: color-mix(in srgb, var(--warn) 85%, var(--ink)); }
p.verdict-rerun { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.plotbox { width: 100%; max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
svg.scatter { display: block; width: 100%; height: auto; }
svg.scatter .axis { stroke: var(--ink-dim); stroke-width: 1; }
svg.scatter .grid { stroke: var(--line); stroke-width: 1; }
svg.scatter .tick, svg.scatter .lbl { fill: var(--ink-dim); font-size: 11px; font-family: var(--mono); }
svg.scatter .pt-dom { fill: var(--ink-dim); opacity: 0.45; }
svg.scatter .pt-inf { fill: none; stroke: var(--bad); stroke-width: 1.2; opacity: 0.7; }
svg.scatter .pt-front { fill: var(--accent); }
svg.scatter .frontline { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.7; }
svg.scatter .pt-pick { fill: none; stroke: var(--warn); stroke-width: 2.5; }
svg.scatter .ptlbl { fill: var(--ink); font-size: 10px; font-family: var(--mono); }
.axispick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.axispick select { max-width: 45%; }
.rolechips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.rolechip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 0.82em; background: var(--panel2); }
.rolechip.obj { border-color: var(--accent); }
.rolechip.con { border-color: var(--warn); }
