/* Layout concept: an operator's ledger. Left-aligned text column, mono labels in a narrow margin,
   and one recurring motif: the four-stage customer track (qualification, handoff, onboarding, ongoing CS). */
:root {
  --bg: #F5F7F6;
  --surface: #FFFFFF;
  --ink: #1F2424;
  --muted: #55605E;
  --line: #D6DEDC;
  --teal: #1B6C77;
  --teal-bright: #21808D;
  --teal-soft: #E1EEEE;
  --coral: #E68161;
  --coral-soft: #FBE7DF;
  --on-coral: #1F2424;
  --band: #1F2424;
  --band-ink: #EEF2F1;
  --band-muted: #A9B4B2;
  --tone-1: #E9A47F;
  --tone-2: #5FA2AA;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.4rem, 5.2vw, 3.9rem);

  --wrap: 72rem;
  --measure: 40rem;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141817; --surface: #1B201F; --ink: #E9EEED; --muted: #A2ADAB; --line: #2C3533;
    --teal: #5CB8C3; --teal-bright: #5CB8C3; --teal-soft: #17302F; --coral: #EE9476; --coral-soft: #3A2620;
    --on-coral: #1A1D1D; --band: #0E1211; --band-ink: #E9EEED; --band-muted: #93A09D;
    --tone-1: #C98A6C; --tone-2: #4E9AA2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141817; --surface: #1B201F; --ink: #E9EEED; --muted: #A2ADAB; --line: #2C3533;
  --teal: #5CB8C3; --teal-bright: #5CB8C3; --teal-soft: #17302F; --coral: #EE9476; --coral-soft: #3A2620;
  --on-coral: #1A1D1D; --band: #0E1211; --band-ink: #E9EEED; --band-muted: #93A09D;
  --tone-1: #C98A6C; --tone-2: #4E9AA2;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 87%;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); font-weight: 750; }
h3 { font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
}

.label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink); max-width: var(--measure); }
.prose { display: grid; gap: 1rem; max-width: var(--measure); }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 0.8rem;
}
.brand { display: inline-flex; color: var(--ink); line-height: 0; }
.brand svg { height: 30px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding-block: 0.25rem; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--coral); }
.nav .btn { padding: 0.5rem 0.9rem; border-bottom: 0; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .brand svg { height: 26px; }
  .nav { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font: 600 0.9rem var(--font-body); color: var(--ink);
    background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.45rem 0.75rem; cursor: pointer;
  }
  .site-header.open .nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 0.6rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px));
  }
  .site-header.open .nav a { padding-block: 0.55rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 0.98rem/1.2 var(--font-body);
  text-decoration: none; border-radius: var(--radius);
  padding: 0.8rem 1.15rem; border: 1px solid transparent; cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}
.btn-primary { background: var(--coral); color: var(--on-coral); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.25rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 0.8rem; margin-bottom: 1.75rem; max-width: 46rem; }

/* Margin-label layout: mono label left, content right */
.ledger { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .ledger { grid-template-columns: 12rem minmax(0, 1fr); gap: 2.5rem; }
}
.ledger > * { min-width: 0; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.25rem, 6vw, 4rem) clamp(2rem, 5vw, 3rem); }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.1rem; }
.hero .actions { margin-top: 1.5rem; }

/* The four-stage track */
.track {
  list-style: none; margin: 2.25rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.track li { padding: 1rem 1.1rem 0 0; position: relative; display: grid; gap: 0.35rem; align-content: start; }
.track li::before {
  content: ""; position: absolute; top: -7px; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink);
}
.track .num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.track .stage { font-family: var(--font-display); font-stretch: 87%; font-weight: 700; font-size: 1.15rem; }
.track .signal { font-size: 0.92rem; color: var(--muted); line-height: 1.45; }
.track li.hit::before { background: var(--coral); border-color: var(--coral); box-shadow: 0 0 0 5px var(--coral-soft); }
.track li.hit .stage { color: var(--ink); }
.track .flag {
  justify-self: start; margin-top: 0.4rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  background: var(--coral-soft); color: var(--ink); padding: 0.2rem 0.45rem; border-radius: 3px;
}
@media (max-width: 720px) {
  .track { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 2px solid var(--ink); margin-left: 6px; }
  .track li { padding: 0 0 1.4rem 1.4rem; }
  .track li::before { top: 0.35rem; left: -8px; }
}

/* ---------- Proof ---------- */
.proof { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .proof { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 3rem; } }
.figures { display: flex; align-items: baseline; gap: 0.75rem 1.25rem; flex-wrap: wrap; }
.figure { display: grid; gap: 0.2rem; }
.figure .val {
  font-family: var(--font-display); font-stretch: 87%; font-weight: 800;
  font-size: clamp(3rem, 7vw, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.figure.after .val { color: var(--teal-bright); }
.figures .arrow { font-family: var(--font-mono); font-size: 1.6rem; color: var(--muted); }
.fineprint { font-size: var(--step--1); color: var(--muted); }

/* ---------- Offers ---------- */
.offers { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .offers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.offer { padding: 1.5rem 0; display: grid; gap: 0.9rem; align-content: start; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  .offer { padding: 1.5rem 2rem 1.5rem 0; border-bottom: 0; }
  .offer + .offer { padding-left: 2rem; border-left: 1px solid var(--line); }
}
.offer ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.offer .meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.25rem 1rem; }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  grid-row: span 2; font-family: var(--font-mono); font-size: 0.9rem; color: var(--teal); padding-top: 0.15rem;
}
.steps h3 { font-size: 1.12rem; }
.steps p { color: var(--muted); }

.modules { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.module { background: var(--surface); padding: 1.4rem 1.5rem; display: grid; gap: 0.5rem; align-content: start; }
.module p { color: var(--muted); font-size: 0.98rem; }

.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }
.topics li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); display: grid; gap: 0.2rem; }
.topics strong { font-weight: 600; }
.topics span { color: var(--muted); font-size: 0.96rem; }

.facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.facts dd { margin: 0; }

/* ---------- Dark band (coaching, CTA) ---------- */
.band { background: var(--band); color: var(--band-ink); }
.band h2, .band h3 { color: var(--band-ink); }
.band .label, .band .muted { color: var(--band-muted); }
.band a:not(.btn) { color: var(--band-ink); }
.band .btn-ghost { color: var(--band-ink); border-color: color-mix(in srgb, var(--band-ink) 30%, transparent); }
.band .btn-ghost:hover { border-color: var(--band-ink); }
.section.band + .section, .section + .section.band { border-top: 0; }

/* ---------- Tool teaser ---------- */
.teaser { display: grid; gap: 2rem; }
@media (min-width: 900px) { .teaser { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; } }
.mini-ledger {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums;
  display: grid; gap: 0.5rem;
}
.mini-ledger .row { display: flex; justify-content: space-between; gap: 1rem; }
.mini-ledger .row.total { border-top: 1px solid var(--line); padding-top: 0.6rem; font-weight: 600; }
.mini-ledger .row.total span:last-child { color: var(--teal-bright); }

/* ---------- About ---------- */
.person { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .person { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 2.75rem; } }
.person img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; max-width: 100%; background: var(--teal-soft); }
.person-teaser { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 720px) { .person-teaser { grid-template-columns: 9rem minmax(0, 1fr); gap: 2rem; } }
.person-teaser img { width: 9rem; aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; border-radius: 50%; }

/* ---------- Tools index ---------- */
.tool-list { display: grid; gap: 1.25rem; }
@media (min-width: 860px) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool {
  display: grid; gap: 0.8rem; align-content: start; padding: 1.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.tool:hover { border-color: var(--teal); }
.tool p { color: var(--muted); }
.tool .go { font-weight: 600; color: var(--teal); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; max-width: 34rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.8rem; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
textarea { min-height: 8rem; resize: vertical; }
.form-note { font-size: var(--step--1); color: var(--muted); }
.form-status { font-weight: 600; color: var(--teal); }
.copyline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.copyline code { font-family: var(--font-mono); font-size: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem 0.7rem; user-select: all; }
.btn-small { padding: 0.45rem 0.75rem; font-size: 0.88rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem; font-size: 0.92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer a { color: var(--muted); }
.foot-brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.foot-brand img { width: 22px; height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.prose.wide { max-width: 46rem; }
.prose.wider { max-width: 52rem; }

/* ---------- Retention Math ---------- */
.hero-tight { padding-bottom: 1rem; }
.calc-section { padding-top: 1.5rem; }
.calc-status { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem; border-radius: 3px; background: var(--coral-soft); color: var(--ink);
}
.chip.yours { background: var(--teal-soft); }
.linkish { font: inherit; font-size: 0.95rem; background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.calc { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .calc { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 3rem; } }
.calc > * { min-width: 0; }
.calc-inputs { display: grid; gap: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
@media (min-width: 960px) { .calc-inputs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5rem); } }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 0.8rem; min-width: 0; }
fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 1.1rem; }
legend { padding: 0; margin-bottom: 0.6rem; }
fieldset.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
fieldset.pair legend { grid-column: 1 / -1; }
.calc-inputs input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.calc-inputs .field label { font-size: 0.9rem; }
.calc-error { color: var(--ink); background: var(--coral-soft); border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.92rem; }
.calc-results { display: grid; gap: 1.75rem; }
.results-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 560px) { .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.result { background: var(--surface); padding: 1.1rem 1.2rem; display: grid; gap: 0.3rem; align-content: start; }
.result .big { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.05; color: var(--teal-bright); font-variant-numeric: tabular-nums; }
.result .big.neg { color: var(--coral); }
.result .sub { font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-wrap { margin: 0; display: grid; gap: 0.6rem; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; }
.legend { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--muted); }
.key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.key-target { background: var(--teal-bright); }
.key-today { background: var(--muted); margin-left: 0.6rem; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.chart .gap-area { fill: var(--coral-soft); }
.chart .line-today { fill: none; stroke: var(--muted); stroke-width: 2.25; }
.chart .line-target { fill: none; stroke: var(--teal-bright); stroke-width: 2.75; }
.chart .dot-today { fill: var(--bg); stroke: var(--muted); stroke-width: 2; }
.chart .dot-target { fill: var(--teal-bright); }
.chart .end-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.chart .end-target { fill: var(--teal-bright); }
.chart .end-today { fill: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.calc-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.calc-table th, .calc-table td { padding: 0.55rem 0.9rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }
.calc-table thead th { font-weight: 600; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }
.calc-table tbody tr:last-child td { border-bottom: 0; font-weight: 600; }
.calc-table td.gap { color: var(--teal-bright); }
/* the memo table has six columns, so its headings wrap and the running total stays in view */
.memo-table thead th { white-space: normal; vertical-align: bottom; }
.memo-table th, .memo-table td { padding-left: 0.6rem; padding-right: 0.6rem; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.summary-text { font-family: var(--font-mono); font-size: 0.85rem; min-height: 9rem; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 20; background: var(--surface); color: var(--ink); padding: 0.5rem 0.8rem; border-radius: var(--radius); }
@media (max-width: 480px) {
  .calc-table { font-size: 0.8rem; }
  .calc-table th, .calc-table td { padding: 0.5rem 0.55rem; }
  .calc-table thead th { font-size: 0.68rem; letter-spacing: 0.03em; }
}

/* ---------- The bar (home) ---------- */
.bar-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .bar-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 3rem; } }
.bar-figs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 2.25rem; }
.bar-fig { display: grid; gap: 0.2rem; }
.bar-fig .val {
  font-family: var(--font-display); font-stretch: 87%; font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 5rem); line-height: 0.95; color: var(--coral); font-variant-numeric: tabular-nums;
}
.mini-calc {
  background: var(--surface); color: var(--ink); border-radius: 12px; padding: 1.25rem;
  display: grid; gap: 1rem; box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.6);
}
.band .mini-calc h3 { color: var(--ink); }
.band .mini-calc .label, .band .mini-calc .muted { color: var(--muted); }
.mini-calc .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mini-calc input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mini-rows { display: grid; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.mini-rows .row { display: flex; justify-content: space-between; gap: 1rem; }
.mini-rows .row.total { border-top: 1px solid var(--line); padding-top: 0.6rem; align-items: baseline; font-weight: 600; }
.mini-rows .gapval { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: 2rem; line-height: 1; color: var(--teal-bright); }
.mini-calc .btn { justify-content: center; }
.mini-calc .fineprint { margin-top: -0.25rem; }

/* ---------- Tool cards (home and tools page) ---------- */
.tool-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .tool-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tcard {
  display: grid; gap: 0.65rem; align-content: start; grid-template-rows: auto auto auto 1fr auto;
  padding: 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.tcard:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 16px 32px -24px rgba(20, 60, 60, 0.5); }
.tcard h3 { font-size: 1.22rem; }
.tcard p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.tcard .go { font-weight: 600; color: var(--teal); }
.tviz { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.tviz .ln { stroke: var(--line); stroke-width: 2; fill: none; }
.tviz .ink { stroke: var(--muted); stroke-width: 2; fill: none; }
.tviz .tl { stroke: var(--teal-bright); stroke-width: 2.5; fill: none; }
.tviz .area { fill: var(--coral-soft); }
.tviz .dot { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.tviz .hit { fill: var(--coral); }
.tviz .bar-a { fill: var(--line); }
.tviz .bar-b { fill: var(--teal-bright); }
.tviz .bar-c { fill: var(--coral); }
.feature {
  display: grid; gap: 1.5rem; padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 44px -32px rgba(20, 50, 50, 0.45);
}
@media (min-width: 860px) { .feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2.5rem; align-items: center; } }
.feature .mini-ledger { background: var(--bg); }
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--coral-soft); color: var(--ink); padding: 0.2rem 0.5rem; border-radius: 3px; margin-left: 0.4rem; vertical-align: 0.1em;
}
.subhead { margin: 2.25rem 0 1rem; }

/* ---------- Assessments ---------- */
.tool-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); max-width: 26ch; }
.tool-hero .lede { max-width: 46rem; }
.has-report .tool-hero { display: none; }
.has-report .tool-section { padding-top: clamp(2rem, 5vw, 3rem); }
@media (max-width: 600px) {
  .tool-hero .lede { font-size: var(--step-0); }
  .tool-howto { font-size: 0.95rem; }
}
.tool-note { margin-top: 0.9rem; font-size: var(--step--1); color: var(--muted); }
.tool-howto { margin-top: 1rem; max-width: 46rem; padding: 0.8rem 1rem; border-left: 3px solid var(--teal); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin-top: 1.25rem; }
.stat { display: grid; gap: 0.2rem; }
.stat-val { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: 2.3rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-good .stat-val { color: var(--teal-bright); }
.tool-section { padding-top: 0.25rem; }
.tool-card {
  max-width: 52rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(1.1rem, 3.5vw, 2rem); scroll-margin-top: 5rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 22px 48px -32px rgba(20, 50, 50, 0.4);
}
.tool-head, .tool-nav { display: none; }
.js .tool-head { display: grid; gap: 0.5rem; margin-bottom: 1.4rem; }
.tool-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 1rem; }
.tool-part { color: var(--teal); }
.tool-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 5px; }
.tool-dots li { flex: 1 1 0; min-width: 0; }
.tool-dots button { display: block; width: 100%; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.tool-dots button::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); transition: background-color 160ms ease; }
.tool-dots button.is-done::before { background: var(--teal-bright); }
.tool-dots button.is-current::before { background: var(--coral); }
.tool-dots button:disabled { cursor: default; }
fieldset.q { display: grid; gap: 1.1rem; }
fieldset.q + fieldset.q { margin-top: 2.25rem; padding-top: 2.25rem; }
.js fieldset.q + fieldset.q { margin-top: 0; padding-top: 0; border-top: 0; }
.js fieldset.q:not([hidden]) { animation: q-in 220ms ease both; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
fieldset.q:focus { outline: none; }
.q-legend { display: grid; gap: 0.45rem; padding: 0; margin: 0 0 1.1rem; }
.q-rating .q-legend { margin-bottom: 0.4rem; }
.q-num { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.js .q-num { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.q-text {
  font-family: var(--font-display); font-stretch: 87%; font-weight: 750; letter-spacing: -0.01em;
  font-size: clamp(1.45rem, 3.4vw, 1.95rem); line-height: 1.15; color: var(--ink); text-wrap: balance;
}
.sr { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opts { display: grid; gap: 0.6rem; }
.opt {
  position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.85rem; align-items: start;
  padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.opt:hover { border-color: var(--teal); }
.opt-key {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--muted);
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.opt-body { display: grid; gap: 0.15rem; padding-top: 0.2rem; }
.opt-title { font-weight: 600; line-height: 1.35; }
.opt-detail { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.opt:has(input:checked), .opt.is-checked { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.opt:has(input:checked) .opt-key, .opt.is-checked .opt-key { background: var(--teal); border-color: var(--teal); color: var(--surface); }
.opt:has(input:focus-visible), .scale-opt:has(input:focus-visible) { outline: 2px solid var(--coral); outline-offset: 2px; }
.why { border-top: 1px dashed var(--line); padding-top: 0.8rem; }
.why summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--teal);
}
.why summary::-webkit-details-marker { display: none; }
.why summary::before {
  content: "+"; display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem;
  border: 1px solid currentColor; border-radius: 50%; font-size: 0.85rem; line-height: 1;
}
.why[open] summary::before { content: "\2212"; }
.why p { margin-top: 0.65rem; color: var(--muted); max-width: 44rem; }
.tool-hint { margin-top: 1rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); background: var(--coral-soft); color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.tool-hint:empty { display: none; }
.js .tool-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.tool-nav .btn:disabled { opacity: 0.35; cursor: default; transform: none; }
#tool-next.is-waiting { opacity: 0.55; }

/* rating questions */
.q-def { color: var(--muted); max-width: 44rem; }
.levels { display: grid; gap: 0.7rem; }
@media (min-width: 760px) { .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.level { border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 10px; padding: 0.85rem 0.95rem; background: var(--bg); }
.level-emerging { border-top-color: var(--tone-1); }
.level-proficient { border-top-color: var(--tone-2); }
.level-mastery { border-top-color: var(--teal-bright); }
.level-name {
  display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink); font-weight: 600;
}
.level-name span { color: var(--muted); font-weight: 400; }
.level ul { margin: 0; padding-left: 1rem; display: grid; gap: 0.35rem; font-size: 0.92rem; line-height: 1.45; }
.scale-prompt { font-weight: 600; margin-top: 0.2rem; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; margin-top: -0.5rem; }
.scale-opt {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 0.35rem; text-align: center;
  padding: 0.8rem 0.4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.scale-opt:hover { border-color: var(--teal); }
.scale-n { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: 1.7rem; line-height: 1; }
.scale-t { font-size: 0.8rem; color: var(--muted); line-height: 1.25; }
.scale-opt:has(input:checked), .scale-opt.is-checked { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.scale-opt:has(input:checked) .scale-n, .scale-opt.is-checked .scale-n { color: var(--teal); }
@media (max-width: 560px) {
  .scale { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .scale-opt { grid-template-columns: 2.25rem minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; padding: 0.6rem 0.85rem; }
  .scale-n { font-size: 1.4rem; }
  .scale-t { font-size: 0.92rem; }
}

/* ---------- Reports ---------- */
.report { max-width: 52rem; scroll-margin-top: 5rem; }
.report-head { display: grid; gap: 0.35rem; }
.report-head h2:focus { outline: none; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; margin-top: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.report-sec { display: grid; gap: 1rem; padding-block: 1.75rem; border-bottom: 1px solid var(--line); }
.report-big { font-size: clamp(1.6rem, 3.8vw, 2.25rem); font-weight: 800; }
.report-h { font-size: 1.35rem; }
.report-lede { font-size: var(--step-1); line-height: 1.5; max-width: 44rem; }
.sub-label { margin-top: 0.4rem; }
.also-note { justify-self: start; background: var(--teal-soft); border-radius: var(--radius); padding: 0.45rem 0.75rem; font-size: 0.95rem; }
.track-report { margin-top: 0.75rem; }
.track li.also::before { border-color: var(--coral); }
.track .flag-also { background: var(--teal-soft); }
.score { display: grid; gap: 0.75rem 1.75rem; align-items: center; }
@media (min-width: 640px) { .score { grid-template-columns: auto minmax(0, 1fr); } }
.score-num { display: flex; align-items: baseline; gap: 0.55rem; }
.score-val { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: clamp(4rem, 12vw, 6rem); line-height: 0.85; font-variant-numeric: tabular-nums; }
.score-max { font-family: var(--font-mono); color: var(--muted); }
.score-text { display: grid; gap: 0.35rem; max-width: 40rem; }
.score-band { font-size: 1.65rem; }
.meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.meter-seg { display: grid; gap: 0.35rem; align-content: start; }
.meter-bar { height: 10px; border-radius: 5px; background: var(--tone); opacity: 0.3; }
.meter-seg.is-on .meter-bar { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 28%, transparent); }
.meter-name { font-size: 0.84rem; font-weight: 600; line-height: 1.2; color: var(--muted); }
.meter-seg.is-on .meter-name { color: var(--ink); }
.meter-range { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.tone-0 { --tone: var(--coral); }
.tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); }
.tone-3 { --tone: var(--teal-bright); }
.fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.fix { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.25rem 0.9rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fix-num { font-family: var(--font-mono); font-weight: 600; color: var(--teal); padding-top: 0.25rem; }
.fix-body { display: grid; gap: 0.5rem; }
.fix h4, .focus-card h4 { font-family: var(--font-display); font-stretch: 87%; font-weight: 750; font-size: 1.22rem; line-height: 1.2; margin: 0; }
.fix-why { color: var(--muted); font-size: 0.95rem; }
.fix-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.fix-steps li { padding-left: 0.2rem; }
.fix-steps li::marker { font-family: var(--font-mono); font-size: 0.85em; color: var(--teal); }
.fix-rest ul { margin: 0.45rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.line-name { display: grid; gap: 0.1rem; font-weight: 600; }
.line-ans { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.pill { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-A { background: var(--teal-soft); color: var(--teal); }
.pill-B { background: var(--line); color: var(--ink); }
.pill-C { background: var(--coral-soft); color: var(--ink); }
.mcalc { display: grid; gap: 1rem; }
@media (min-width: 760px) { .mcalc { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.25rem; } }
.mcalc-in { display: grid; gap: 0.8rem; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.mcalc-in input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mcalc-in .field label { font-size: 0.9rem; }
.mcalc-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; align-self: start; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mcalc-cell { background: var(--surface); padding: 1rem 1.1rem; display: grid; gap: 0.3rem; align-content: start; }
.mcalc-val { font-family: var(--font-display); font-stretch: 87%; font-weight: 800; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.mcalc-cell.is-key .mcalc-val { color: var(--teal-bright); }
.bars { display: grid; gap: 0.6rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 3rem; gap: 0.4rem 0.9rem; align-items: center; }
.bar-name { font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.bar-track {
  position: relative; height: 14px; border-radius: 7px; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), var(--surface) calc(20% - 1px) 20%),
    linear-gradient(90deg, var(--coral-soft) 0 40%, var(--line) 40% 80%, var(--teal-soft) 80% 100%);
}
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--teal-bright); border-radius: 7px; }
.bar-val { font-family: var(--font-mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bar-val .muted { font-weight: 400; }
.bar-zones { display: grid; grid-template-columns: 40% 40% 20%; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) 2.6rem; }
  .bar-name { grid-column: 1 / -1; }
  .bar-legend > span:first-child { display: none; }
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips li { display: grid; gap: 0.15rem; padding: 0.75rem 1rem; border-radius: 10px; background: var(--teal-soft); }
.chip-name { font-weight: 600; }
.chip-val { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.focus-grid { display: grid; gap: 0.9rem; }
@media (min-width: 760px) { .focus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.focus-card { display: grid; gap: 0.5rem; align-content: start; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-top: 3px solid var(--coral); border-radius: 12px; background: var(--surface); }
.focus-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.report-cta { margin-top: 1.75rem; padding: 1.5rem; border: 0; border-radius: 14px; background: var(--band); color: var(--band-ink); }
.report-cta h3 { color: var(--band-ink); }
.report-cta .btn-ghost { color: var(--band-ink); border-color: color-mix(in srgb, var(--band-ink) 30%, transparent); }
.report-send { display: grid; gap: 0.75rem; padding-top: 2rem; scroll-margin-top: 5rem; }
.report-send > p { color: var(--muted); max-width: 40rem; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tool-about .prose { max-width: 44rem; }
.print-head, .print-foot { display: none; }
.calc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.from-home { margin-top: 0.6rem; }

/* ---------- Print: the report or the calculator, nothing else ---------- */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme] {
    --bg: #FFFFFF; --surface: #FFFFFF; --ink: #111515; --muted: #4A5452; --line: #CFD8D6;
    --teal: #1B6C77; --teal-bright: #1B6C77; --teal-soft: #E1EEEE; --coral: #D9714F; --coral-soft: #FBE7DF;
    --tone-1: #E9A47F; --tone-2: #5FA2AA; --band: #FFFFFF; --band-ink: #111515; --band-muted: #4A5452;
    color-scheme: light;
  }
  @page { margin: 14mm; }
  html, body { background: #FFFFFF; }
  body { font-size: 10.5pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; animation: none !important; }
  body::before, .site-header, .site-footer, .skip, .no-print, .tool-card, .tool-about, .tool-hero, .band, noscript { display: none !important; }
  .section { padding-block: 0 !important; border: 0 !important; }
  .wrap { max-width: none; padding: 0 !important; }
  .print-head { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 8.5pt; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 1rem; }
  .print-head img { width: 18px; height: auto; }
  .print-foot { display: block; margin-top: 1.25rem; font-family: var(--font-mono); font-size: 8.5pt; color: var(--muted); }
  .report { max-width: none; }
  .report-sec { padding-block: 1rem; }
  .report-sec, .fix, .focus-card, .mcalc, .score, .meter, .bars, .lines li, .track, .results-grid, .chart-wrap, .table-wrap { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .hero { padding-block: 0 0.75rem; }
  .calc { display: block !important; }
  .calc-inputs { position: static !important; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; padding: 0.75rem; margin-bottom: 1rem; }
  .calc-inputs fieldset + fieldset { border-top: 0; padding-top: 0; }
  .calc-inputs input { padding: 0.3rem 0.45rem; }
  .calc-inputs .field label { font-size: 8.5pt; }
  .calc-results { gap: 1rem; }
  .results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .result .big { font-size: 1.5rem; }
}
.tool-grid.with-feature .feature { grid-column: 1 / -1; }
@media (min-width: 960px) { .tool-grid.with-feature { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 959px) { .tool-grid.with-feature > .tcard:last-child { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.notfound .tool-grid { margin-top: 2rem; }
.notfound .tcard { grid-template-rows: auto auto 1fr auto; }
.notfound-home { margin-top: 1.5rem; }
.field-note { grid-column: 1 / -1; font-size: 0.84rem; line-height: 1.4; color: var(--muted); margin-top: -0.2rem; }

/* ---------- Chart colors. Validated with the dataviz palette checks (all six pass):
   light #DB6D4B / #008A9C on #FFFFFF, dark #D9764F / #1A9FB0 on #1B201F ---------- */
:root { --chart-churn: #DB6D4B; --chart-keep: #008A9C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-churn: #D9764F; --chart-keep: #1A9FB0; } }
:root[data-theme="dark"] { --chart-churn: #D9764F; --chart-keep: #1A9FB0; }
@media print { :root, :root:not([data-theme="light"]), :root[data-theme] { --chart-churn: #DB6D4B; --chart-keep: #008A9C; } }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Tool grids ---------- */
@media (min-width: 1080px) { .tool-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .tool-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 959px) { .tool-grid.three > .tcard:last-child { grid-column: 1 / -1; } }
.tool-group + .tool-group { margin-top: 0.5rem; }
.tviz .mk { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.tviz .you { fill: var(--chart-keep); stroke: var(--bg); stroke-width: 2; }
.tviz .zone { fill: var(--line); opacity: 0.6; }
.tviz .bc { fill: var(--chart-churn); }
.tviz .bk { fill: var(--chart-keep); }
.tviz .cut { stroke: var(--ink); stroke-width: 1.5; }

/* ---------- Legends with several items ---------- */
.legend-items { flex-wrap: wrap; gap: 0.35rem 1rem; }
.lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.key-you { width: 11px; height: 11px; border-radius: 50%; background: var(--chart-keep); }
.key-bar { width: 3px; height: 14px; border-radius: 1px; background: var(--ink); }
.key-median { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; }
.key-churn { width: 12px; height: 12px; border-radius: 3px; background: var(--chart-churn); }
.key-keep { width: 12px; height: 12px; border-radius: 3px; background: var(--chart-keep); }

/* ---------- Tables shared by the new tools ---------- */
.calc-table caption { caption-side: top; text-align: left; padding: 0.85rem 0.9rem 0.35rem; }
.calc-table tbody th { text-align: left; font-family: var(--font-body); font-weight: 600; }
.sc-bridge tbody tr:last-child td, .sc-targets tbody tr:last-child td, .sc-segtable tbody tr:last-child td,
.sc-medians tbody tr:last-child td, .hs-table tbody tr:last-child td { font-weight: 400; }
.sc-bridge tr.is-total th, .sc-bridge tr.is-total td { font-weight: 700; border-top: 1px solid var(--ink); }
.calc-table tbody tr:last-child th { border-bottom: 0; }

/* ---------- Retention Scorecard ---------- */
.sc-inputs { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.sc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.sc-mode { display: none; }
.js .sc-mode { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.sc-mode label { position: relative; display: block; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.sc-mode input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sc-mode label:has(input:checked) { background: var(--ink); color: var(--bg); }
.sc-mode label:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.sc-head { display: none; }
#sc-rows { display: grid; gap: 1rem; }
.sc-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.sc-row + .sc-row { border-top: 1px solid var(--line); padding-top: 1rem; }
.sc-row .sc-name { grid-column: 1 / -1; padding-right: 2.75rem; }
.sc-inputs:not(.is-seg) .sc-name { display: none; }
.sc-row input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sc-row .sc-name input { font-family: var(--font-body); }
.sc-row .field label { font-size: 0.85rem; }
.sc-remove { position: absolute; top: 1.55rem; right: 0; width: 2.25rem; height: 2.25rem; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.sc-row + .sc-row .sc-remove { top: 2.55rem; }
.sc-remove:hover { color: var(--ink); border-color: var(--ink); }
.sc-add-row:has(> button[hidden]) { display: none; }
@media (min-width: 960px) {
  .sc-head, .sc-row { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
  .is-seg .sc-head, .is-seg .sc-row { grid-template-columns: minmax(0, 1.4fr) repeat(6, minmax(0, 1fr)) 2.25rem; }
  .sc-head { display: grid; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
  .sc-head .hint { text-transform: none; letter-spacing: 0; }
  .sc-inputs:not(.is-seg) .sc-h-name, .sc-inputs:not(.is-seg) .sc-h-x { display: none; }
  .sc-row .sc-name { grid-column: auto; padding-right: 0; }
  .sc-row .field label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .sc-row + .sc-row { border-top: 0; padding-top: 0; }
  #sc-rows { gap: 0.6rem; }
  .sc-remove, .sc-row + .sc-row .sc-remove { position: static; align-self: center; }
}
.sc-results { display: grid; gap: 1.75rem; margin-top: 2rem; }
.sc-results .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 960px) { .sc-results .results-grid, .hs-results .results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sc-bench { max-width: 46rem; }
.sc-two { display: grid; gap: 1.25rem; }
@media (min-width: 860px) { .sc-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.sc-targets td.is-bar { color: var(--muted); }
.sc-medians { max-width: 30rem; }
.sc-seg { display: grid; gap: 0.75rem; }
.sc-seg-note { max-width: 46rem; color: var(--muted); }
.sc-readout { display: grid; gap: 0.6rem; }
.sc-reads { display: grid; gap: 0.6rem; max-width: 46rem; }
.sc-reads p { padding-left: 0.9rem; border-left: 3px solid var(--teal); }
.pos .track, .pos .tick { stroke: var(--line); stroke-width: 1; }
.pos .barline { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.pos .med { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.pos .you { fill: var(--chart-keep); stroke: var(--surface); stroke-width: 2; }
.pos text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.pos .row-name { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--ink); }
.pos .t-you { fill: var(--ink); font-weight: 600; }
.pos .t-bar { fill: var(--ink); }

/* ---------- Health Score Test ---------- */
.hs-inputs { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.hs-boxes { display: grid; gap: 1rem; }
@media (min-width: 720px) { .hs-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hs-boxes textarea { min-height: 11rem; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.hs-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); min-height: 1.2em; }
.hs-opts { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem 1.25rem; }
.hs-scale { min-width: 11rem; }
.hs-results { display: grid; gap: 1.75rem; margin-top: 2rem; }
.hs-verdict { display: grid; gap: 0.5rem; }
.mark { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.12rem 0.45rem; border-radius: 999px; white-space: nowrap; color: var(--ink); }
.mark.is-pass { background: var(--teal-soft); }
.mark.is-miss { background: var(--coral-soft); }
.hs-notes { display: grid; gap: 0.4rem; color: var(--muted); max-width: 46rem; }
.hs-table summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.hs-table .table-wrap { margin-top: 0.75rem; max-width: 26rem; }
.hs-fixes { display: grid; gap: 0.75rem; }
.hist .zone { fill: var(--line); opacity: 0.45; }
.hist .cut { stroke: var(--ink); stroke-width: 1; }
.hist .gridline { stroke: var(--line); stroke-width: 1; }
.hist .baseline { stroke: var(--muted); stroke-width: 1; }
.hist .b-churn { fill: var(--chart-churn); }
.hist .b-keep { fill: var(--chart-keep); }
.hist .bar:hover { opacity: 0.78; }
.hist text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.hist .row-name { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--ink); }
.hist .t-cut { fill: var(--ink); font-weight: 600; }

@media print {
  .sc-results, .hs-results { margin-top: 0; gap: 1rem; }
  .sc-two, .hs-verdict, .sc-seg, .sc-readout, .hs-fixes, .hs-notes { break-inside: avoid; }
  .sc-results .results-grid, .hs-results .results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .sc-reads p { border-left-width: 2px; }
  .sc-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Seven tools added November 2026: shared pieces ---------- */
.is-stale { opacity: 0.45; transition: opacity 0.15s; }
.reads { display: grid; gap: 0.6rem; max-width: 46rem; }
.reads:empty { display: none; }
.reads p { padding-left: 0.9rem; border-left: 3px solid var(--teal); }
.vchart text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.vchart .gridline { stroke: var(--line); stroke-width: 1; }
.vchart .baseline { stroke: var(--muted); stroke-width: 1; }
.vchart .b-keep { fill: var(--chart-keep); }
.vchart .b-keep-soft { fill: var(--chart-keep); opacity: 0.45; }
.vchart .b-churn { fill: var(--chart-churn); }
.vchart .b-muted { fill: var(--muted); opacity: 0.5; }
.vchart .bar:hover { opacity: 0.8; }
.vchart .t-val, .vchart .t-strong { fill: var(--ink); font-weight: 600; }
.vchart .t-note { fill: var(--muted); font-size: 10.5px; }
.vchart .t-label { font-family: var(--font-body); font-size: 13px; font-weight: 600; fill: var(--ink); }
.vchart .ref, .vchart .renew { stroke: var(--ink); stroke-width: 1.25; stroke-dasharray: 4 3; }
.vchart .zone { fill: var(--line); opacity: 0.55; }
.vchart .tick-need { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.vchart .line-keep { fill: none; stroke: var(--chart-keep); stroke-width: 2.5; stroke-linejoin: round; }
.vchart .line-churn { fill: none; stroke: var(--chart-churn); stroke-width: 2.5; stroke-linejoin: round; }
.key-zone { width: 12px; height: 12px; border-radius: 3px; background: var(--line); }
.key-dash { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed var(--ink); }
.calc-table tr.is-plan th, .calc-table tr.is-plan td { font-weight: 700; }
.ed-starts tbody tr:last-child td, .ec-steps tbody tr:last-child td, .ec-break tbody tr:last-child td,
.qa-table tbody tr:last-child td, .ct-table tbody tr:last-child td, .cp-table tbody tr:last-child td { font-weight: 400; }
.ec-break tr.is-total th, .ec-break tr.is-total td { font-weight: 700; border-top: 1px solid var(--ink); }
.ec-break tbody tr.is-total:last-child td { font-weight: 700; }
.calc-table td.is-quiet { font-weight: 700; color: var(--ink); }
.qa-table td:last-child, .qa-table th:last-child { text-align: left; }
.calc-inputs fieldset.pair, .cp-row, .cp-team { align-items: end; }
.calc-inputs textarea.bc-ask { min-height: 0; resize: vertical; }
.calc-results > .table-wrap + .table-wrap { margin-top: -0.75rem; }
.ct-hist .bar:hover { opacity: 0.8; }
.result .big.cp-thin { font-size: clamp(1.45rem, 3.2vw, 1.95rem); overflow-wrap: anywhere; }
.qa-ask { margin-top: 1rem; max-width: 46rem; }

/* ---------- CS Business Case Builder: the memo ---------- */
.memo { display: grid; gap: 1rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-width: 48rem; }
.memo-kicker { margin: 0; }
.memo-head { display: grid; margin: 0; border-top: 1px solid var(--line); }
.memo-head > div { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.memo-head dt { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.memo-head dd { margin: 0; font-weight: 600; }
.memo-sec { display: grid; gap: 0.3rem; }
.memo-sec h3 { font-size: 1.05rem; margin: 0; }
.memo-sec p { margin: 0; }
.memo-sec ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.bc-wide { grid-column: 1 / -1; }

/* ---------- CSM Coverage Planner: segment rows ---------- */
.cp-team { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.cp-team > .label, .cp-team .field-note { grid-column: 1 / -1; }
.cp-team input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cp-seglabel { padding-top: 1rem; border-top: 1px solid var(--line); }
.cp-head { display: none; }
#cp-rows { display: grid; gap: 1rem; }
.cp-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.cp-row + .cp-row { border-top: 1px solid var(--line); padding-top: 1rem; }
.cp-row .cp-name { grid-column: 1 / -1; padding-right: 2.75rem; }
.cp-row .cp-model { grid-column: 1 / -1; }
.cp-row input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cp-row .cp-name input { font-family: var(--font-body); }
.cp-row .field label { font-size: 0.85rem; }
.cp-row .cp-remove { position: absolute; top: 1.55rem; right: 0; }
.cp-row + .cp-row .cp-remove { top: 2.55rem; }
@media (min-width: 960px) {
  .cp-team { grid-template-columns: minmax(0, 9rem) minmax(0, 11rem) minmax(0, 1fr); }
  .cp-team .field-note { grid-column: auto; align-self: center; margin: 0; }
  .cp-head, .cp-row { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr) 2.25rem; align-items: end; gap: 0.75rem; }
  .cp-head { display: grid; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
  .cp-row .cp-name, .cp-row .cp-model { grid-column: auto; padding-right: 0; }
  .cp-row .field label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .cp-row + .cp-row { border-top: 0; padding-top: 0; }
  #cp-rows { gap: 0.6rem; }
  .cp-row .cp-remove, .cp-row + .cp-row .cp-remove { position: static; align-self: center; }
}

@media print {
  .memo { border: 0; padding: 0; max-width: none; gap: 0.55rem; font-size: 10pt; line-height: 1.4; }
  .memo .print-foot { margin-top: 0.35rem; }
  .memo-head > div { padding: 0.25rem 0; }
  .memo-sec { gap: 0.15rem; }
  .memo-sec h3 { font-size: 11pt; }
  .memo-sec ul { gap: 0.1rem; }
  .memo .calc-table th, .memo .calc-table td { padding: 0.2rem 0.5rem; }
  .memo-sec, .memo-head, .memo .table-wrap { break-inside: avoid; }
  .reads { break-inside: avoid; }
  .reads p { border-left-width: 2px; }
  .cp-inputs, .calc-inputs.no-print { display: none !important; }
  .calc-inputs .field-note { display: none; }
  .calc-results .chart-wrap .chart { max-width: 5in; }
  .calc-inputs.print-rows { grid-template-columns: minmax(0, 1fr) !important; gap: 0.45rem; }
  .calc-inputs.print-rows fieldset { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 0.4rem 0.6rem; }
  .calc-inputs.print-rows fieldset legend { grid-column: 1 / -1; margin-bottom: 0.1rem; }
  .hero h1 { font-size: 22pt; line-height: 1.1; }
  .calc-table th, .calc-table td { padding: 0.3rem 0.6rem; }
  .facts > div { padding: 0.45rem 0; }
  .hero-tight > .wrap > .label { display: none; }
  .calc-results { gap: 0.7rem; }
  .is-stale { opacity: 1; }
}

.tools-more { margin-top: 1.25rem; font-weight: 600; }
.math-next { margin-top: -0.5rem; }
