:root {
  --paper: #F4F6F3;
  --panel: #FFFFFF;
  --ink: #18231F;
  --muted: #5E6B66;
  --faint: #8A9590;
  --rule: #D8DED9;
  --rule-strong: #B9C3BD;
  --palm: #0E5E50;
  --palm-deep: #0A4439;
  --palm-soft: #E2EEEA;
  --tag: #F2C230;
  --tag-deep: #C99A10;
  --tag-ink: #3A2E00;
  --ok: #2F7D4E;
  --ok-soft: #E3F1E8;
  --warn: #B5600C;
  --warn-soft: #FBEBDB;
  --bad: #B3261E;
  --bad-soft: #F8E1DF;
  --wait: #6E7781;
  --wait-soft: #ECEFF1;
  --radius-s: 4px;
  --radius-m: 8px;
  --shadow: 0 1px 0 rgba(24, 35, 31, 0.06), 0 2px 8px rgba(24, 35, 31, 0.06);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--palm); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--palm); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
small, .muted { color: var(--muted); }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail {
  background: var(--palm-deep);
  color: #DCEAE5;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; padding: 4px 6px; }
.brand svg { color: var(--tag); }
.stages { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: relative; }
.stages::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: rgba(255,255,255,0.12); }
.stages a {
  position: relative; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: var(--radius-m); color: inherit; text-decoration: none;
}
.stages a:hover { background: rgba(255,255,255,0.06); }
.stages a.active { background: rgba(255,255,255,0.10); color: #FFFFFF; }
.stages .num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--palm-deep); border: 2px solid rgba(255,255,255,0.28); font-weight: 700; font-size: 13px; z-index: 1;
}
.stages a.active .num { background: var(--tag); border-color: var(--tag); color: var(--tag-ink); }
.stages b { display: block; font-weight: 700; font-size: 14px; }
.stages small { display: block; color: #9FBDB3; font-size: 12px; }
.count { font-style: normal; font-weight: 700; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--tag); color: var(--tag-ink); }
.count:empty { display: none; }
.rail-link { color: #DCEAE5; text-decoration: none; padding: 8px 10px; border-radius: var(--radius-m); border: 1px solid rgba(255,255,255,0.14); }
.rail-link:hover, .rail-link.active { background: rgba(255,255,255,0.08); color: #FFFFFF; }
.rail-note { margin-top: auto; font-size: 12px; color: #9FBDB3; padding: 0 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 12px 28px;
  background: var(--panel); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
.dataset { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-right: auto; }
.dataset-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); }
.dataset-dot.client { background: var(--ok); }
.field-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
select, input[type="text"], input[type="number"], input[type="date"], textarea {
  border: 1px solid var(--rule-strong); border-radius: var(--radius-s); background: var(--panel); padding: 6px 8px; min-height: 32px;
}
textarea { width: 100%; min-height: 64px; resize: vertical; }
#view { padding: 24px 28px 48px; outline: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--palm); background: var(--palm); color: #FFFFFF;
  padding: 7px 14px; border-radius: var(--radius-s); font-weight: 600; cursor: pointer; text-decoration: none; min-height: 34px;
}
.btn:hover { background: var(--palm-deep); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-quiet { background: var(--panel); color: var(--palm); }
.btn-quiet:hover { background: var(--palm-soft); }
.btn-warn { background: var(--panel); color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn-soft); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Page header */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head .lede { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

/* Summary strip: a ledger line, not a card grid */
/* The summary cards always share one row: equal columns, however many there are. A long label wraps inside its
   card and the figures stay on one line along the bottom, a little smaller on a narrow screen. */
.ledger-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 22px; background: var(--panel); }
.ledger-strip div { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 10px clamp(9px, 1vw, 18px) 12px; border-right: 1px solid var(--rule); min-width: 0; }
.ledger-strip div:last-child { border-right: 0; }
.ledger-strip span { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.ledger-strip b { font-size: clamp(14px, 1.4vw, 20px); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }

/* Calendar */
.cal { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow-x: auto; box-shadow: var(--shadow); }
.cal table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.cal th, .cal td { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); vertical-align: top; }
.cal thead th { background: #FAFBF9; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px; text-align: left; position: sticky; top: 0; }
.cal thead th.event-month { color: var(--ink); }
.cal thead th small { display: block; font-weight: 500; color: var(--tag-deep); }
.cal th.cat { width: 150px; text-align: left; padding: 10px; font-size: 13px; background: #FAFBF9; position: sticky; left: 0; z-index: 1; }
.cal td { padding: 6px; }
.chip {
  display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center;
  width: 100%; text-align: left; margin-bottom: 5px; padding: 5px 6px 5px 5px; border: 1px solid var(--rule); border-left: 3px solid var(--wait);
  border-radius: var(--radius-s); background: var(--panel); cursor: pointer; font-size: 12px; line-height: 1.25;
}
.chip:hover { border-color: var(--rule-strong); background: #FBFCFA; }
.chip .nm { flex: 1 0 100%; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip.s-draft { border-left-color: var(--wait); }
.chip.s-inapproval { border-left-color: var(--palm); }
.chip.s-sentback { border-left-color: var(--warn); }
.chip.s-approved { border-left-color: var(--ok); }
.chip.s-exported, .chip.s-reviewed { border-left-color: var(--ok); background: #FAFCFA; }
.chip .st { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* The discount tag: the one place yellow appears */
.pct-tag {
  display: inline-block; font-weight: 800; font-size: 11px; padding: 1px 5px 1px 9px; color: var(--tag-ink); background: var(--tag);
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%); border-radius: 0 2px 2px 0; white-space: nowrap;
}
.pct-tag.none { background: var(--wait-soft); color: var(--muted); }

/* Status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 12px; background: var(--wait-soft); color: var(--wait); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-inapproval { background: var(--palm-soft); color: var(--palm); }
.pill.s-sentback { background: var(--warn-soft); color: var(--warn); }
.pill.s-approved, .pill.s-exported, .pill.s-reviewed { background: var(--ok-soft); color: var(--ok); }
.pill.e-validated { background: var(--ok-soft); color: var(--ok); }
.pill.e-exploratory { background: var(--warn-soft); color: var(--warn); }
.pill.e-history { background: var(--wait-soft); color: var(--wait); }

/* Panels and grids */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.panel-head .right { margin-left: auto; }
.panel-body { padding: 16px; overflow-x: auto; }
.split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* Grid and flex children may shrink below their content, so a wide table scrolls inside its own box instead of
   pushing the whole page sideways at laptop widths. */
.split > *, .two > *, .stack > *, .main { min-width: 0; }

/* Form */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.form label > select, .form label > input { width: 100%; color: var(--ink); font-weight: 400; font-size: 14px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row { display: grid; grid-template-columns: 1fr 64px; gap: 10px; align-items: center; }
input[type="range"] { accent-color: var(--tag-deep); width: 100%; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form[aria-disabled="true"] select, .form[aria-disabled="true"] input { background: #F7F8F6; }

/* Shelf tag card */
.shelf-tag {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: end;
  padding: 18px 20px 16px 26px; background: var(--tag); color: var(--tag-ink); border-radius: var(--radius-m);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
}
.shelf-tag::before { content: ""; position: absolute; left: 14px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--paper); }
.shelf-tag .sku { grid-column: 1 / -1; font-weight: 700; font-size: 14px; }
.shelf-tag .was { font-size: 15px; text-decoration: line-through; opacity: 0.7; }
.shelf-tag .now { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.shelf-tag .now small { font-size: 15px; font-weight: 700; color: var(--tag-ink); margin-right: 4px; }
.shelf-tag .off { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; text-align: right; }
.shelf-tag .mech { grid-column: 1 / -1; font-size: 12px; font-weight: 600; opacity: 0.8; }

/* Economics ledger: the activity sheet, made readable */
.ledger { width: 100%; border-collapse: collapse; }
.ledger td { padding: 5px 0; border-bottom: 1px solid #EEF1EE; }
.ledger td:last-child { text-align: right; font-weight: 600; }
.ledger tr.sum td { border-top: 1.5px solid var(--ink); border-bottom: 0; font-weight: 700; padding-top: 7px; }
.ledger tr.key td { font-weight: 700; }
.ledger tr.est td:last-child { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(14, 94, 80, 0.08) 4px 8px); }
.ledger .why { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.unavail { color: var(--faint); font-weight: 500; }

/* Stepper */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.stepper li { position: relative; padding-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--rule); }
.stepper li:first-child::before { left: 50%; }
.stepper li:last-child::before { right: 50%; }
.stepper li::after { content: ""; position: absolute; top: 1px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--panel); border: 2px solid var(--rule-strong); }
.stepper li.done::after { background: var(--ok); border-color: var(--ok); }
.stepper li.done::before { background: var(--ok); }
.stepper li.now::after { background: var(--tag); border-color: var(--tag-deep); }
.stepper li.now { color: var(--ink); font-weight: 700; }
.stepper li.back::after { background: var(--warn); border-color: var(--warn); }

/* Tables */
.grid { width: 100%; border-collapse: collapse; background: var(--panel); }
.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.grid td { padding: 8px 10px; border-bottom: 1px solid #EEF1EE; }
.grid td.num, .grid th.num { text-align: right; }
.grid tr.clickable { cursor: pointer; }
.grid tr.clickable:hover td { background: #F8FAF7; }
.grid tr.sel td { background: var(--palm-soft); }
.var-pos { color: var(--ok); font-weight: 600; }
.var-neg { color: var(--bad); font-weight: 600; }
.neg { color: var(--bad); }
.grid td { white-space: nowrap; }

/* Audit trail */
.results { list-style: none; margin: 6px 0 0; padding: 0; }
.results li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid #EEF1EE; font-size: 13px; }
.results li b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.audit { list-style: none; margin: 0; padding: 0; }
.audit li { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EEF1EE; font-size: 13px; }
.audit time { color: var(--muted); font-size: 12px; }

/* Notices */
.notice { padding: 10px 12px; border-radius: var(--radius-s); background: var(--palm-soft); color: var(--palm-deep); font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: #7A3F06; }
.notice.bad { background: var(--bad-soft); color: #7E1A14; }

/* Charts */
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .bar { fill: #9CB7AE; }
.chart .bar.promo { fill: var(--palm); }
.chart .est { fill: url(#hatch); stroke: var(--palm); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .whisker { stroke: var(--palm); stroke-width: 1.5; }
.chart .base { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }

.empty { padding: 36px; text-align: center; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #FFFFFF; padding: 10px 16px; border-radius: var(--radius-m); font-weight: 600; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  /* !important: some pages set their column widths inline, and the narrow layout must still win. */
  .split, .two { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .stages { flex-direction: row; overflow-x: auto; }
  .stages::before, .stages small, .rail-note { display: none; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  #view { padding: 16px; }
  /* On a phone the cards go two to a row rather than shrink below reading size. */
  .ledger-strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-strip div { border-bottom: 1px solid var(--rule); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Insight deck */
.btn-deck { background: var(--tag); color: var(--tag-ink); border-color: var(--tag-deep); font-weight: 700; }
.btn-deck:hover { background: var(--tag-deep); color: #FFFFFF; }
.btn-deck[disabled]:hover { background: var(--tag); color: var(--tag-ink); }
body.deck-open { overflow: hidden; }
.deck {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--palm-deep); color: #DCEAE5;
}
.d-bar, .d-nav { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.d-bar { justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); }
.d-bar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.d-bar-title b { color: #FFFFFF; font-size: 15px; }
.d-bar-title span { color: #A9C3BB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-bar-actions { display: flex; gap: 8px; }
.d-nav { justify-content: center; border-top: 1px solid rgba(255,255,255,0.1); }
.d-btn {
  background: transparent; color: #FFFFFF; border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-s); padding: 7px 14px; cursor: pointer; font-weight: 600;
}
.d-btn:hover:not([disabled]) { background: rgba(255,255,255,0.1); }
.d-btn[disabled] { opacity: 0.35; cursor: default; }
.d-primary { background: var(--tag); color: var(--tag-ink); border-color: var(--tag); }
.d-primary:hover:not([disabled]) { background: #FFD45A; }
.deck :focus-visible { outline: 2px solid var(--tag); outline-offset: 2px; }
.d-dots { display: flex; gap: 6px; }
.d-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,0.28); cursor: pointer; }
.d-dots button[aria-current="true"] { background: var(--tag); }
.d-count { min-width: 64px; text-align: center; color: #A9C3BB; }
.d-stage { display: grid; place-items: center; padding: 18px; min-height: 0; overflow: hidden; }
.d-holder { position: relative; }
.d-frame { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.d-frame[hidden] { display: none; }

.d-slide {
  position: relative; width: 1280px; height: 720px; overflow: hidden;
  background: var(--panel); color: var(--ink);
  padding: 56px 72px 64px; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.d-head h2 { font-size: 18px; font-weight: 700; color: var(--palm); letter-spacing: 0; }
.d-stamp { font-size: 12px; font-weight: 700; color: var(--warn); border: 1.5px solid var(--warn); border-radius: var(--radius-s); padding: 3px 8px; }
.d-headline { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 14px 0 28px; max-width: 26ch; }
.d-headline .d-neg, .d-claims .d-neg, .d-table .d-neg { color: var(--bad); }
.d-body { flex: 1; min-height: 0; }
.d-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; height: 100%; }
.d-split.d-wide { grid-template-columns: 0.8fr 1.5fr; }
.d-claims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.d-claims li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; font-size: 18px; line-height: 1.4; align-items: baseline; }
.d-lvl { font-size: 11.5px; font-weight: 700; border-radius: 3px; padding: 3px 7px; text-align: center; background: var(--wait-soft); color: var(--muted); }
.d-lvl.l-ComputedMetric { background: var(--palm-soft); color: var(--palm-deep); }
.d-lvl.l-ObservedTransaction { background: #E6ECF4; color: #2B4A6F; }
.d-lvl.l-AnalyticalAttribution { background: var(--warn-soft); color: var(--warn); }
.d-lvl.l-ModelledScenario { background: repeating-linear-gradient(45deg, #FFF6D8 0 5px, #FBE9A8 5px 10px); color: var(--tag-ink); }
.d-limits { list-style: none; margin: 22px 0 0 110px; padding: 0; color: var(--muted); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.d-visual { min-width: 0; }
.d-chart { width: 100%; height: auto; max-height: 470px; font-family: var(--font); }
.d-axis { stroke: var(--rule-strong); stroke-width: 1.5; }
.d-link { stroke: var(--faint); stroke-dasharray: 3 3; }
.d-bar-pos { fill: var(--palm); }
.d-bar-neg { fill: var(--bad); }
.d-bar-total { fill: var(--ink); }
.d-hatch { stroke: var(--tag-deep); stroke-width: 1.5; }
.d-hatch-bg { fill: #FFF3C4; }
.d-hatch-line { stroke: var(--tag-deep); stroke-width: 3; }
.d-lab { font-size: 14px; fill: var(--ink); font-weight: 600; }
.d-val { font-size: 14px; fill: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.d-val.neg { fill: var(--bad); }
.d-note { font-size: 11.5px; fill: var(--muted); }
.d-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.d-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--ink); padding: 6px 10px 6px 0; }
.d-table td { border-bottom: 1px solid var(--rule); padding: 7px 10px 7px 0; vertical-align: top; }
.d-table tr.d-gap td { border-bottom: 1.5px solid var(--ink); padding: 2px; }
.d-list { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 12px; font-size: 18px; line-height: 1.4; max-width: 64ch; }
.d-list.d-small { font-size: 14.5px; gap: 6px; }
.d-list.d-cols { display: block; columns: 2; column-gap: 56px; max-width: none; font-size: 15px; }
.d-list.d-cols li { break-inside: avoid; margin-bottom: 10px; }
.d-split h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.d-engine { margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.d-foot { position: absolute; left: 72px; right: 72px; bottom: 22px; display: flex; justify-content: space-between; gap: 24px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 10px; }
.d-pg { white-space: nowrap; font-variant-numeric: tabular-nums; }

.d-title { background: var(--palm-deep); color: #FFFFFF; justify-content: center; padding-left: 96px; }
.d-title .d-mark { color: var(--tag); margin-bottom: 28px; }
.d-title h1 { font-size: 64px; font-weight: 800; letter-spacing: -0.03em; max-width: 16ch; }
.d-title .d-sub { font-size: 20px; color: #CFE1DA; margin-top: 18px; }
.d-title-notes { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: #DCEAE5; max-width: 70ch; }
.d-title-notes li { border-left: 3px solid var(--tag); padding-left: 12px; }
.d-gen { margin-top: 28px; font-size: 13px; color: #A9C3BB; }
.d-title .d-foot { left: 96px; color: #A9C3BB; border-top-color: rgba(255,255,255,0.15); }

@media (max-width: 760px) {
  .d-bar-title span, .d-dots { display: none; }
  .d-bar, .d-nav { padding: 10px 16px; }
  .d-stage { padding: 8px; }
}

@media print {
  @page { size: 13.333in 7.5in; margin: 0; }
  body.deck-open .shell, body.deck-open .toast { display: none !important; }
  body.deck-open { background: #FFFFFF; overflow: visible; }
  .deck { position: static; display: block; background: none; }
  .d-bar, .d-nav { display: none; }
  .d-stage { display: block; padding: 0; overflow: visible; }
  .d-holder { width: auto !important; height: auto !important; }
  .d-frame, .d-frame[hidden] { display: block; position: static; transform: none !important; break-after: page; page-break-after: always; }
  .d-slide { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Repeat, fix or stop */
.pill.v-repeat { background: var(--ok-soft); color: var(--ok); }
.pill.v-fix { background: #FCEFD3; color: #8A5A00; }
.pill.v-stop { background: var(--bad-soft); color: var(--bad); }
.pill.v-none { background: var(--wait-soft); color: var(--wait); }
.notice.verdict { background: var(--panel); border: 1px solid var(--rule); }

/* Confidence rating */
.conf { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.conf::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: currentColor; }
.conf.c-high { color: #2E6B4F; }
.conf.c-med { color: #34477A; }
.conf.c-low { color: #B06A00; }
.conf.c-none { color: var(--wait); }
.notice.verdict .conf { display: inline-block; margin: 0 0 0 6px; }
.conf-why { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Values inside the ledger strip keep the strip's size; only their colour signals direction. */
.ledger-strip b span { display: inline; font-size: inherit; }
.ledger-strip b .neg, .ledger-strip b .var-neg { color: #B3261E; }
.ledger-strip b .var-pos { color: #2F7D4E; }

/* Sign-in and users */
.who { font-size: 13px; color: var(--muted); }
.who b { color: var(--ink); font-weight: 600; }
.signin { max-width: 380px; margin: 8vh auto; }
.signin .panel-body { display: grid; gap: 12px; }
.signin .err { color: var(--bad); font-size: 13px; min-height: 1.2em; }
.users-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.roles-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.roles-pick label { display: inline-flex; gap: 6px; align-items: center; }
.topbar [hidden], .rail [hidden] { display: none; }

/* KPI scorecard */
.section-title { font-size: 15px; margin: 26px 0 10px; }
.two + .section-title { margin-top: 26px; }
.panel-foot { padding: 10px 16px 12px; }
ul.plain { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
ul.plain li { margin: 3px 0; }
.kp-card { display: flex; flex-direction: column; }
.kp-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.kp-row { display: flex; gap: 14px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid #EEF1EE; cursor: pointer; }
.kp-row:hover { background: #FAFBF9; }
.kp-main { flex: 1; min-width: 0; }
.kp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.kp-title .muted { font-size: 12px; }
.kp-why { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.kp-fig { text-align: right; white-space: nowrap; }
.kp-fig b { display: block; font-size: 15px; }
.kp-fig span { font-size: 12px; color: var(--muted); }
.kp-fig span span { font-size: inherit; }
.kp-more { padding: 10px 16px; text-align: right; font-size: 13px; font-weight: 600; }
.kp-more a::after { content: " \2192"; }
/* Performance tables: every column fits the panel; headings wrap rather than push the table wider. */
.grid.perf { width: 100%; }
.grid.perf th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.grid.perf th, .grid.perf td { padding: 8px 8px; }
.grid.perf th:first-child, .grid.perf td:first-child { padding-left: 16px; }
.grid.perf th:last-child, .grid.perf td:last-child { padding-right: 16px; }
.grid.perf + .grid.perf { margin-top: 6px; }
.effbar { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.grid.perf td.lbl { white-space: normal; }
.effbar .track { position: relative; flex: 1; height: 12px; background: #EEF1EE; border-radius: 3px; }
.effbar .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.effbar .track i.ok { background: #2F7D4E; }
.effbar .track i.bad { background: #C4534A; }
.effbar .track em { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--ink); }
.effbar b { font-size: 13px; min-width: 32px; text-align: right; }
.kp-table { width: 100%; }
.kp-table td { white-space: nowrap; vertical-align: top; }
.kp-table td.why { white-space: normal; min-width: 260px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.kp-table th:first-child, .kp-table td:first-child { padding-left: 16px; }
.kp-table td:first-child { white-space: normal; min-width: 170px; }
@media (max-width: 1400px) { .grid.perf .opt, .kp-table .opt { display: none; } }
@media (max-width: 1340px) { .kp-two { grid-template-columns: 1fr !important; } }
@media (max-width: 1150px) { .kp-table .opt2 { display: none; } .kp-table td.why { min-width: 180px; } }

/* What a promotion is for */
.purpose { display: grid; gap: 8px; }
.purpose-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.purpose-facts span { display: block; font-size: 12px; color: var(--muted); }
.purpose-facts b { font-size: 15px; }
.purpose p { margin: 0; line-height: 1.45; max-width: 90ch; }
.purpose.none { color: var(--muted); font-size: 13px; }

/* Approvals: where the selected promotion stands, at the top right of the heading */
/* The sign-off progress card. Wherever it appears it is this card: top right of the page heading, one width, one height. */
.head-card { margin-left: auto; flex: 0 0 520px; width: 520px; height: 108px; box-sizing: border-box; padding: 10px 14px 12px; align-self: flex-start; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; overflow: hidden; }
.head-card-title { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; min-width: 0; }
.head-card-title b { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.head-card-title .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.head-card .stepper li { line-height: 1.25; }
.appr-split { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr); }
.grid.appr th, .grid.appr td { padding-left: 7px; padding-right: 7px; }
/* Tables that run to the panel's edges keep their first and last columns off the border. */
.grid.edge { width: 100%; }
.grid.edge th:first-child, .grid.edge td:first-child { padding-left: 16px; }
.grid.edge th:last-child, .grid.edge td:last-child { padding-right: 16px; }
.grid td.wrap { white-space: normal; }
@media (max-width: 1340px) { .appr-split { grid-template-columns: 1fr !important; } }
@media (max-width: 1100px) { .page-head { flex-wrap: wrap; } .head-card { flex-basis: 100%; width: 100%; margin-left: 0; } }

/* Page filters */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 14px; }
.filters label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filters select { min-width: 150px; }
.filters-step { display: inline-flex; gap: 8px; }
.filters-note { margin-left: auto; font-size: 13px; align-self: center; }
/* Calendar: every month in view fits the screen. Twelve months use compact chips (name and depth; chain and status
   are in the tooltip and the list below). */
.cal.m12 th.cat { width: 112px; padding: 8px; font-size: 12px; }
.cal.m12 thead th { padding: 6px 5px; font-size: 11px; }
.cal.m12 thead th small { font-size: 10px; line-height: 1.2; }
.cal.m12 td { padding: 3px; }
.cal.m12 .chip { padding: 3px 3px 3px 4px; margin-bottom: 3px; font-size: 10.5px; line-height: 1.2; gap: 2px 4px; }
.cal.m12 .chip .st { display: none; }
.cal.m12 .chip .pct-tag { font-size: 10px; padding: 0 4px 0 6px; }
.cal .chip { overflow: hidden; }
.cal .chip .nm { overflow-wrap: anywhere; }

/* Post-promotion review: the list on the left, the selected promotion's result on the right */
.rev-split { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); }
.rev-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
.grid.rev th, .grid.rev td { padding-left: 7px; padding-right: 7px; }
.grid.rev td .muted { font-size: 12px; }
.grid tr.sel td { background: var(--palm-soft); }
.insight-lead { margin: 0; font-size: 14px; line-height: 1.45; }
.unitbars { display: grid; gap: 6px; margin-top: 12px; }
.unitbars > div:not(.legend) { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.unitbars > div > span { color: var(--muted); }
.unitbars > div > b { text-align: right; }
.ub { display: flex; height: 14px; background: #EEF1EE; border-radius: 3px; overflow: hidden; }
.ub i { display: block; height: 100%; }
.ub .base { background: #B9C3BD; } .ub .net { background: #2F7D4E; } .ub .sis { background: #D9A21B; } .ub .nxt { background: #B5600C; }
.page-head .actions { align-items: center; }
@media (max-width: 1340px) { .rev-split { grid-template-columns: 1fr !important; } .rev-side { position: static; max-height: none; } }

/* Tables whose text may wrap so they never need to scroll sideways */
.grid.fit th, .grid.fit td { white-space: normal; }
.grid.fit td.num, .grid.fit th.num { white-space: nowrap; }

/* Price response: one hue, a line with its range, the plan marked */
.chart.resp .cap { font-weight: 700; fill: var(--ink); }
.chart.resp .grid { stroke: #EEF1EE; stroke-width: 1; }
.chart.resp .zero { stroke: var(--ink); stroke-width: 1; }
.chart.resp .rband { fill: var(--palm); fill-opacity: 0.14; }
.chart.resp .rline { fill: none; stroke: var(--palm); stroke-width: 2; stroke-linejoin: round; }
.chart.resp .plan { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.chart.resp .planlbl { fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.chart.resp .dot { fill: var(--palm); stroke: var(--panel); stroke-width: 2; }
.chart.resp .hit { fill: transparent; }
.chart.resp .hit:hover { fill: rgba(14, 94, 80, 0.07); }
.reading p { margin: 8px 0 0; line-height: 1.45; }
details.figs { margin-top: 10px; }
details.figs summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--palm); }
ul.plain.trust li { margin: 5px 0; line-height: 1.4; }
.grid.fit td.rng { white-space: normal; min-width: 92px; }
details.figs .grid th, details.figs .grid td { padding-left: 6px; padding-right: 6px; }

/* Data readiness */
.pill.r-pass { background: var(--ok-soft); color: var(--ok); }
.pill.r-partial { background: #FCEFD3; color: #8A5A00; }
.pill.r-fail { background: var(--bad-soft); color: var(--bad); }
.pill.r-na { background: var(--wait-soft); color: var(--wait); }
.pill.big { font-size: 15px; padding: 4px 14px; }
.rating .muted { font-size: 12px; font-weight: 600; }
.rating-verdict { margin: 6px 0 8px; }
.rating p { margin: 0; line-height: 1.45; }
.r-table th:nth-child(2) { width: 19%; } .r-table th:nth-child(3) { width: 22%; } .r-table th:nth-child(4) { width: 17%; } .r-table th:nth-child(6) { width: 112px; }
.r-table td { vertical-align: top; }
.r-table details summary { cursor: pointer; }
ul.r-rows { list-style: none; margin: 8px 0 2px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
ul.r-rows .pill { font-size: 11px; padding: 1px 7px; margin-right: 4px; }
/* A page printed from the tool: the content only, on ordinary paper. The slide deck keeps its own page size. */
@media print {
  body:not(.deck-open) .rail, body:not(.deck-open) .topbar, body:not(.deck-open) .toast, body:not(.deck-open) .actions { display: none !important; }
  body:not(.deck-open) .shell { display: block; }
  body:not(.deck-open) #view { padding: 0.4in; }
  body:not(.deck-open) .panel { box-shadow: none; break-inside: avoid; }
}

/* Tabs of the promotion page */
.tabs { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 18px 10px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-m) var(--radius-m) 0 0; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--palm-soft); }
.tabs a.active { color: var(--ink); background: var(--panel); border-color: var(--rule-strong); box-shadow: inset 0 3px 0 var(--tag); }
.tabs .tabs-right { margin-left: auto; padding: 0 0 6px 12px; flex: 0 0 auto; }

/* Price response tab */
.resp-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.resp-grid > * { min-width: 0; }
.reading.tight p:first-child { margin-top: 0; }
.chart.resp .need { fill: none; stroke: var(--warn); stroke-width: 2; stroke-dasharray: 6 4; }
.chart.resp .pt { fill: #9CB7AE; fill-opacity: 0.75; stroke: var(--panel); stroke-width: 1; }
.chart.resp .pt.late { fill: var(--tag-deep); fill-opacity: 0.95; }
.chart.resp .planmark { fill: var(--ink); stroke: var(--panel); stroke-width: 1.5; }
.chart.resp .legend text { fill: var(--ink); }
.figs-table td, .figs-table th { padding-left: 8px; padding-right: 8px; }
.figs-table .sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.figs-table th { white-space: normal; vertical-align: bottom; }
.figs-table tr.sel td b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--palm-deep); margin-left: 4px; }
@media (max-width: 1200px) { .resp-grid { grid-template-columns: 1fr; } }

/* Calculation tab */
.calc .lede { color: var(--muted); max-width: 90ch; margin: 0 0 4px; }
.calc-steps { list-style: none; margin: 0; padding: 0; counter-reset: calc; }
.calc-steps > li { counter-increment: calc; position: relative; padding: 18px 0 18px 46px; border-top: 1px solid var(--rule); max-width: 110ch; }
.calc-steps > li:first-child { border-top: 0; }
.calc-steps > li::before { content: counter(calc); position: absolute; left: 0; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--palm); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.calc-steps h3 { font-size: 16px; margin-bottom: 8px; }
.calc-steps p { margin: 8px 0 0; line-height: 1.5; }
.calc-steps ul.plain { color: var(--ink); font-size: 14px; }
.calc-steps ul.plain li { margin: 5px 0; line-height: 1.45; }
.formula { margin: 0; padding: 10px 14px; background: var(--paper); border-left: 3px solid var(--palm); border-radius: 0 var(--radius-s) var(--radius-s) 0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; color: var(--ink); overflow-x: auto; }
.worked { margin-top: 10px; padding: 10px 14px; background: var(--palm-soft); border-radius: var(--radius-s); color: var(--palm-deep); line-height: 1.5; font-size: 14px; }
@media print { .tabs { display: none; } }
