@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/*
 * Safety Net Dispatch Visual Brand Kit v1.2 tokens.
 * Practical, construction-grade: warm ground, white sheets, 1px rules,
 * orange for the one primary action, green for results. No gradients,
 * shadows or blur.
 */
:root {
    --accent: #F97316;
    --accent-hover: #EA6A08;
    --accent-press: #C2410C;
    --accent-text: #9A3412;
    --accent-tint: #FFF4EC;
    --ok: #16A34A;
    --ok-text: #15803D;
    --ok-tint: #EEF8F1;
    --ink: #1A1A1A;
    --ink-muted: #6B7280;
    --ink-faint: #9CA3AF;
    --rule: #E8E3DC;
    --ground: #FAF7F2;
    --sheet: #FFFFFF;
    --caution: #B45309;
    --caution-tint: #FEF6E7;
    --caution-text: #92400E;
    --stop: #B42318;
    --stop-tint: #FEEDEC;
    --stop-text: #912018;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--ground);
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Mono label: eyebrows, field units, metric labels. */
.snd-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

/* Keep responsive control rows usable if the generated Tailwind utility sheet is stale. */
.flex-wrap { flex-wrap: wrap; }

.results-hidden { display: none; }
.section-anchor { scroll-margin-top: 1.5rem; }
.fade-in { animation: none; }

/* ---------- Top bar ---------- */
.snd-topbar {
    background: var(--sheet);
    border-bottom: 1px solid var(--rule);
}

.snd-topbar-inner,
nav.bg-white > div {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
}

.snd-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    text-decoration: none;
    min-height: 44px;
}

.snd-mark { width: 30px; height: 26px; flex: none; }

.snd-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-size: 0.8125rem;
    text-transform: uppercase;
}

.snd-wordmark b { font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.snd-wordmark span { font-weight: 400; letter-spacing: 0.22em; margin-top: 2px; }

nav.bg-white {
    background: var(--sheet) !important;
    border-color: var(--rule) !important;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    color: var(--ink-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.nav-link:hover { color: var(--ink); }

@media (max-width: 400px) {
    .snd-topbar-inner { gap: 0.5rem; }
    .snd-topbar-inner > .flex { gap: 0 !important; }
    .nav-link { padding: 0 0.5rem; }
}

.nav-link.active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

/* ---------- Page header ---------- */
.snd-hero {
    background: var(--sheet);
    border-bottom: 1px solid var(--rule);
}

.snd-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 1.25rem;
}

.snd-hero h1 {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    margin-top: 0.5rem;
    max-width: 22ch;
}

.snd-hero-sub {
    margin-top: 0.375rem;
    color: var(--ink);
    font-size: 0.9375rem;
    max-width: 60ch;
}

.snd-hero-meta {
    margin-top: 0.75rem;
    color: var(--ink-muted);
    font-size: 0.8125rem;
    max-width: 70ch;
}

.snd-hero-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 768px) {
    .snd-hero-inner { padding: 2.5rem 2rem 2rem; }
    .snd-hero h1 { font-size: 2rem; max-width: none; }
}

/* Legacy gradient headers on the secondary pages: flatten onto the light system. */
header.gradient-bg {
    background: var(--sheet) !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--rule);
}

header.gradient-bg .text-white,
header.gradient-bg h1,
header.gradient-bg h2 { color: var(--ink) !important; }

header.gradient-bg .text-orange-100,
header.gradient-bg .text-orange-200,
header.gradient-bg [class*="text-white/"] { color: var(--ink-muted) !important; }

header.gradient-bg img { display: none; }

header.gradient-bg .justify-between { flex-wrap: wrap; gap: 1rem; }
header.gradient-bg .mb-6, header.gradient-bg .mb-4 { margin-bottom: 0 !important; }

header.gradient-bg div[class*="bg-white/"] {
    background: var(--ground) !important;
    border-left: 4px solid var(--accent);
    border-radius: 0 !important;
    backdrop-filter: none !important;
}

header.gradient-bg a[class*="bg-white/"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    background: var(--sheet) !important;
    border: 1px solid var(--ink);
    border-radius: 0 !important;
    color: var(--ink) !important;
}

header.gradient-bg a[class*="bg-white/"]:hover { border-color: var(--accent); }

header.gradient-bg [class*="bg-white/"] .text-white,
header.gradient-bg [class*="bg-white/"] p { color: var(--ink) !important; }

/* Legacy orange CTA bands: white sheet, orange rule, dark text. */
section.gradient-bg,
div.gradient-bg,
.bg-gradient-to-r.from-orange-500 {
    background: var(--sheet) !important;
    color: var(--ink) !important;
    border: 1px solid var(--rule);
    border-left: 4px solid var(--accent);
}

section.gradient-bg :is(h1, h2, h3, .text-white),
div.gradient-bg :is(h1, h2, h3, .text-white),
.bg-gradient-to-r.from-orange-500 :is(h1, h2, h3, .text-white) { color: var(--ink) !important; }

section.gradient-bg :is(.text-orange-100, .text-orange-200, [class*="text-white/"]),
div.gradient-bg :is(.text-orange-100, .text-orange-200, [class*="text-white/"]),
.bg-gradient-to-r.from-orange-500 :is(.text-orange-100, .text-orange-200) { color: var(--ink-muted) !important; }

section.gradient-bg .bg-white,
.bg-gradient-to-r.from-orange-500 button.bg-white {
    background: var(--accent) !important;
    color: #fff !important;
}

.bg-gradient-to-r.from-orange-50 {
    background: var(--sheet) !important;
    border-color: var(--rule) !important;
}

/* ---------- Surfaces ---------- */
.card-shadow { box-shadow: none !important; }

section.bg-white,
div.bg-white,
main .bg-white,
.bg-white {
    background-color: var(--sheet) !important;
}

main section.bg-white,
main div.bg-white.card-shadow,
main details.bg-white {
    border: 1px solid var(--rule);
}

.rounded-lg, .rounded-xl, .rounded-2xl { border-radius: 4px !important; }

.hover\:shadow-lg:hover, .hover\:shadow-md:hover { box-shadow: none !important; }

button, .button, a[class*="px-"][class*="py-"] {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.5rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: 0;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1rem;
    background: var(--sheet);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent-text); }

.btn-text {
    min-height: 44px;
    padding: 0 0.25rem;
    background: none;
    border: 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.btn-text:hover { color: var(--ink); }

/* ---------- Calculator paths (segmented) ---------- */
.calculator-mode-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--rule);
    background: var(--sheet);
    margin-bottom: 1.5rem;
}

.calculator-mode-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-height: 48px;
    padding: 0.5rem 0.75rem;
    color: var(--ink-muted);
    text-decoration: none;
    border-left: 1px solid var(--rule);
    border-bottom: 3px solid transparent;
}

.calculator-mode-link:first-child { border-left: 0; }

.calculator-mode-link strong {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
}

.calculator-mode-link span {
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.calculator-mode-link:hover { color: var(--ink); background: var(--ground); }

.calculator-mode-link.is-current {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.calculator-mode-link.is-current strong { font-weight: 700; }

@media (max-width: 639px) {
    .calculator-mode-link { align-items: center; text-align: center; padding: 0.5rem 0.25rem; }
    .calculator-mode-link > span { display: none; }
    .calculator-mode-link strong { font-size: 0.8125rem; }
}

/* ---------- Calculator layout ---------- */
.calc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .calc-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; }
    .calc-layout > .live-summary { grid-column: 2; grid-row: 1; }
    .calc-layout > .calc-card { grid-column: 1; grid-row: 1; }
}

.calc-card {
    background: var(--sheet);
    border: 1px solid var(--rule);
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .calc-card { padding: 0.5rem 2rem; }
}

.preset-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.25rem;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.preset-lead { margin-right: 0.25rem; }

.preset-button {
    min-height: 44px;
    padding: 0 0.375rem;
    background: none;
    border: 0;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    cursor: pointer;
}

.preset-button:hover { color: var(--accent-text); }

.preset-bar .preset-note { flex-basis: 100%; }

.preset-note {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.preset-note summary {
    cursor: pointer;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.preset-note p { margin-top: 0.25rem; max-width: 70ch; }

fieldset.calc-step {
    margin: 0;
    min-width: 0;
    border: 0;
    border-top: 1px solid var(--rule);
    padding: 1.25rem 0 1rem;
}

.calc-step-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0;
    float: left;
    width: 100%;
}

.calc-step-head + * { clear: both; }

.calc-step-num {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calc-step-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calc-step-help {
    padding-top: 0.375rem;
    color: var(--ink-muted);
    font-size: 0.875rem;
    max-width: 70ch;
}

/* Settings-style rows: label left, compact input right. */
.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem;
    align-items: center;
    column-gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
}

.field-row:last-of-type { border-bottom: 0; }

.field-row label {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.field-hint {
    display: block;
    font-weight: 400;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--ink-muted);
    margin-top: 0.125rem;
}

.field-row .field-warn { grid-column: 1 / -1; }

@media (min-width: 768px) {
    .field-row { grid-template-columns: minmax(0, 1fr) 13rem; }
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--sheet);
    border: 1px solid #D6D0C7;
}

.input-wrap:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.input-wrap input {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 0 0.625rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    outline: none;
    box-shadow: none !important;
    -moz-appearance: textfield;
}

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.input-affix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-muted);
    white-space: nowrap;
}

.input-affix.is-prefix { padding-right: 0; font-size: 0.9375rem; color: var(--ink-muted); }
.input-affix.is-suffix { padding-left: 0; min-width: 2.5rem; }

.field-warn {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--caution-text);
}

.callout {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ground);
    border-left: 4px solid var(--accent);
    font-size: 0.8125rem;
    color: var(--ink);
}

.callout.is-caution {
    background: var(--caution-tint);
    border-left-color: var(--caution);
    color: var(--caution-text);
}

.callout strong { font-weight: 600; }

/* ---------- Live verdict card (top on phones, sticky sidebar on desktop) ---------- */
.live-summary {
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-top: 4px solid var(--ok);
    padding: 1rem;
}

.live-summary.is-negative { border-top-color: var(--caution); }

.verdict-call {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink);
}

.verdict {
    margin-top: 0.25rem;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ok-text);
}

.live-summary.is-negative .verdict { color: var(--caution); }

.live-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}

.live-summary dl > div { display: flex; flex-direction: column-reverse; }

.live-summary dt {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    white-space: nowrap;
}

.live-summary dd {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.split-bar {
    display: flex;
    gap: 2px;
    height: 8px;
    margin-top: 0.875rem;
    background: var(--rule);
}

.split-bar.is-large { height: 14px; margin-top: 0.75rem; }
.split-bar > span { flex: 1 1 0; min-width: 0; }

.seg-time { background: var(--ok); }
.seg-permit { background: var(--accent); }
.seg-risk { background: var(--ink-muted); }
.seg-sub { background: var(--accent); }
.seg-impl { background: var(--accent-press); }
.seg-train { background: #FDBA74; }
.seg-support { background: var(--accent-text); }

.split-key {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.split-key li, .ledger dt { display: inline-flex; align-items: center; gap: 0.375rem; }
.split-key i, .ledger .key { display: inline-block; width: 8px; height: 8px; flex: none; }

.live-summary-link { display: none; }

@media (min-width: 1024px) {
    .live-summary { position: sticky; top: 1.5rem; padding: 1.25rem; }
    .verdict { font-size: 2rem; }
    .live-summary dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .live-summary dl > div {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--rule);
    }
    .live-summary dt { font-family: var(--font-sans); font-size: 0.875rem; letter-spacing: 0; text-transform: none; }
    .live-summary-link { display: flex; margin-top: 1rem; width: 100%; }
}

/* Phone-only compact bar once the verdict card has scrolled away. */
.live-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
    background: var(--sheet);
    border-top: 3px solid var(--ok);
    transform: translateY(110%);
    transition: transform 0.2s ease;
}

.live-bar.is-negative { border-top-color: var(--caution); }
.live-bar.is-visible { transform: none; }

.live-bar dl { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 0.5rem; margin: 0; }
.live-bar dl > div { display: flex; flex-direction: column-reverse; }
.live-bar dt { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.live-bar dd { margin: 0; font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-bar .btn-primary { min-height: 44px; padding: 0 0.875rem; font-size: 0.875rem; }

@media (min-width: 1024px) { .live-bar { display: none; } }

/* ---------- Results ---------- */
.results-hero {
    background: var(--ok);
    color: #fff;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.results-hero.is-negative { background: var(--caution); }

.results-hero .snd-label { color: rgba(255, 255, 255, 0.85); }

.results-verdict {
    margin-top: 0.375rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.results-call {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 60ch;
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}

.btn-on-dark {
    min-height: 44px;
    padding: 0 1rem;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-on-dark:hover { background: rgba(255, 255, 255, 0.12); }

.results-share-status { font-size: 0.875rem; color: #fff; }
.results-share-status:empty { display: none; }

.results-metrics {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.results-metrics .metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.results-metrics .metric-label {
    margin-top: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.results-hero-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #fff;
}

.results-hero-note + .results-hero-note { margin-top: 0.375rem; }

@media (min-width: 768px) {
    .results-hero { padding: 2rem; margin-bottom: 1.5rem; }
    .results-verdict { font-size: 2.5rem; }
    .results-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
    .results-metrics .metric-value { font-size: 2rem; }
    .results-metrics .metric-label { font-size: 0.75rem; }
}

.result-card {
    background: var(--sheet);
    border: 1px solid var(--rule);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .result-card { padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
}

.result-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0.25rem;
}

.result-card-sub {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
    max-width: 70ch;
}

.result-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
}

.breakdown-title { font-size: 0.9375rem; font-weight: 700; }

.chart-box { position: relative; }
.chart-box-wide { margin-top: 1rem; height: 200px; }

/* The PDF report snapshots these composition charts; they never show on the page. */
.pdf-charts {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 360px;
    pointer-events: none;
}

.pdf-charts > div { width: 360px; height: 360px; }

.ledger { margin-top: 0.75rem; }

.ledger > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9375rem;
}

.ledger dt { color: var(--ink-muted); }
.ledger dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger .ledger-total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 0.25rem; }
.ledger .ledger-total dt { color: var(--ink); font-weight: 700; }
.ledger .ledger-total dd { font-size: 1.125rem; font-weight: 700; }
.ledger .is-ok { color: var(--ok-text); }

/* Scenario comparison: one row per planning range. */
.scenario-table { margin-top: 0.75rem; }

.scenario-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name use" "nums nums";
    column-gap: 0.75rem;
    padding: 0.875rem 0;
    border-top: 1px solid var(--rule);
}

.scenario-row:last-child { padding-bottom: 0; }

.scenario-name { grid-area: name; }
.scenario-name h4 { font-size: 1rem; font-weight: 700; }
.scenario-name p { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 0.125rem; }
.scenario-row.is-expected .scenario-name h4::after {
    content: "Default";
    margin-left: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    border: 1px solid var(--rule);
    padding: 1px 4px;
    vertical-align: 2px;
}

.scenario-row dl {
    grid-area: nums;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
}

.scenario-row dl > div { display: flex; flex-direction: column-reverse; }

.scenario-row dt {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.scenario-row dd { margin: 0; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scenario-row.is-negative .scenario-roi { color: var(--caution); }
.scenario-use { grid-area: use; align-self: start; min-height: 40px; }

@media (min-width: 768px) {
    .scenario-row {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
        grid-template-areas: "name nums use";
        align-items: center;
    }
    .scenario-row dl { margin: 0; }
    .scenario-use { align-self: center; }
}

.decision-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.decision-call {
    margin-top: 0.75rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 60ch;
}

.driver-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .driver-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1rem; }
}

.driver { padding-left: 0.75rem; border-left: 3px solid var(--accent); }
.driver-label { font-weight: 600; font-size: 0.9375rem; }
.driver-detail { font-size: 0.875rem; color: var(--ink-muted); margin-top: 0.125rem; }
.driver-detail strong, .driver-impact { color: var(--ink); font-weight: 600; }

.insight {
    padding: 0.5rem 0 0.5rem 0.75rem;
    border-left: 3px solid var(--rule);
    font-size: 0.9375rem;
    color: var(--ink);
}

.insight + .insight { margin-top: 0.5rem; }
.insight strong { font-weight: 600; }

.result-details { margin-top: 1rem; border-top: 1px solid var(--rule); }

.result-details summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-details { margin-top: 0; border-top: 1px solid var(--rule); }
.about-details summary { font-size: 1rem; text-decoration: none; }

/* ---------- Next steps ---------- */
.next-card {
    background: var(--sheet);
    border: 1px solid var(--rule);
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}

.next-card.is-primary { border-left: 4px solid var(--accent); }

.next-card h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-top: 0.25rem; }

.next-card p:not(.snd-label) { margin-top: 0.375rem; color: var(--ink-muted); font-size: 0.9375rem; max-width: 60ch; }

.report-card .btn-primary { margin-top: 1rem; width: 100%; }

.framework-card .inline-form { margin-top: 1rem; }

@media (min-width: 768px) {
    .next-card { padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
    .report-card, .framework-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2rem;
        align-items: center;
    }
    .framework-card { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
    .report-card .btn-primary { margin-top: 0; width: auto; }
    .framework-card .inline-form { margin-top: 0; }
}

.inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inline-form input[type="email"] {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 0.75rem;
    border: 1px solid #D6D0C7;
    border-radius: 0;
    font-size: 1rem;
    background: var(--sheet);
    color: var(--ink);
}

.inline-form input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.inline-form .btn-secondary { min-height: 48px; }

@media (min-width: 640px) {
    .inline-form { flex-direction: row; }
}

.more-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--rule);
    background: var(--sheet);
    margin-bottom: 1rem;
}

.more-links a {
    display: block;
    padding: 1rem;
    color: var(--ink);
    text-decoration: none;
    border-top: 1px solid var(--rule);
}

.more-links a:first-child { border-top: 0; }
.more-links strong { display: block; font-weight: 600; }
.more-links strong::after { content: " →"; color: var(--accent); }
.more-links span { display: block; margin-top: 0.125rem; font-size: 0.875rem; color: var(--ink-muted); }
.more-links a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 768px) {
    .more-links { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1.5rem; }
    .more-links a { padding: 1.25rem 2rem; border-top: 0; }
    .more-links a + a { border-left: 1px solid var(--rule); }
}

/* ---------- Footer ---------- */
.snd-footer {
    border-top: 1px solid var(--rule);
    background: var(--sheet);
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.snd-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

.snd-footer strong { color: var(--ink); }
.snd-footer a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.snd-footer p + p { margin-top: 0.375rem; }

/* ---------- Inputs (legacy markup on secondary pages) ---------- */
input, select, textarea { background-color: #fff; border-radius: 0 !important; }

.input-focus:focus {
    border-color: var(--accent) !important;
    outline: none;
    box-shadow: inset 0 0 0 1px var(--accent);
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); font-style: normal; }

/* Tailwind utility overrides to keep legacy markup on the SND palette. */
.bg-gray-50 { background-color: var(--ground) !important; }
.bg-orange-50 { background-color: var(--accent-tint) !important; }
.bg-orange-100 { background-color: var(--accent-tint) !important; }
.bg-orange-500,
.bg-orange-600 { background-color: var(--accent) !important; }
.hover\:bg-orange-700:hover,
.hover\:bg-orange-600:hover { background-color: var(--accent-hover) !important; }
.bg-blue-50 { background-color: var(--ground) !important; }
.bg-blue-100 { background-color: var(--ground) !important; }
.bg-blue-600 { background-color: var(--ink) !important; }
.border-blue-200, .border-blue-500 { border-color: var(--rule) !important; }
.border-l-4.border-blue-500 { border-left-color: var(--accent) !important; }
.bg-green-50 { background-color: var(--ok-tint) !important; }
.bg-amber-50, .bg-yellow-50 { background-color: var(--caution-tint) !important; }
.border-amber-200, .border-yellow-200 { border-color: #F3D9A4 !important; }
.text-amber-700, .text-amber-800, .text-amber-900 { color: var(--caution-text) !important; }
.text-gray-400, .text-gray-500,
.text-gray-600,
.text-gray-700 { color: var(--ink-muted) !important; }
.text-gray-800,
.text-gray-900 { color: var(--ink) !important; }
.text-orange-500,
.text-orange-600,
.text-orange-700 { color: var(--accent-text) !important; }
.text-green-600, .text-green-700 { color: var(--ok-text) !important; }
.text-red-600 { color: var(--stop) !important; }
.text-blue-600, .text-blue-800, .text-blue-900 { color: var(--ink) !important; }
.border-gray-200, .border-gray-300 { border-color: var(--rule) !important; }
.border-orange-100, .border-orange-200, .border-orange-300 { border-color: var(--rule) !important; }
.border-orange-500 { border-color: var(--accent) !important; }
.hover\:text-orange-600:hover,
.hover\:text-orange-700:hover { color: var(--accent-press) !important; }
.hover\:bg-orange-100:hover,
.hover\:bg-orange-50:hover { background-color: var(--accent-tint) !important; }
.hover\:bg-gray-300:hover { background-color: var(--rule) !important; }
.bg-gray-900 { background-color: var(--ink) !important; }
.italic { font-style: normal !important; }
em { font-style: normal; font-weight: 600; }

canvas { max-width: 100%; }

/* ---------- Planning paths (admin.html, compliance.html) ---------- */
.planner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.planner-card {
    min-width: 0;
    padding: 1.5rem 2rem;
    background: var(--sheet);
    border: 1px solid var(--rule);
}

.planner-card h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.planner-card p {
    color: var(--ink-muted);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.planner-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.planner-fields label {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
}

.planner-fields input {
    width: 100%;
    min-height: 48px;
    padding: 0 0.75rem;
    border: 1px solid #D6D0C7;
    border-radius: 0;
    background: var(--sheet);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.planner-fields input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.planner-results {
    border-top: 4px solid var(--ok);
    position: sticky;
    top: 1.5rem;
}

.planner-results dl { margin: 1rem 0; }

.planner-results dl > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
}

.planner-results dt { color: var(--ink-muted); font-size: 0.9375rem; }

.planner-results dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.planner-results .planner-total {
    border-top: 2px solid var(--ink);
    border-bottom: 0;
}

.planner-results .planner-total dt { color: var(--ink); font-weight: 700; }
.planner-results .planner-total dd { font-size: 1.5rem; color: var(--ok-text); }

.planner-results p { font-size: 0.8125rem; }

.planner-warning {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--caution);
    background: var(--caution-tint);
    color: var(--caution-text) !important;
}

.planner-warning[hidden] { display: none; }

.planner-footer {
    padding: 2rem 1rem;
    color: var(--ink-muted);
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.875rem;
}

.planner-footer a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 1023px) {
    .planner-layout { grid-template-columns: 1fr; }
    .planner-results { position: static; }
}

@media (max-width: 600px) {
    .planner-fields { grid-template-columns: 1fr; }
    .planner-card { padding: 1.25rem 1rem; }
}

/* ---------- Pass 5: hero actions, evidence block, footer links ---------- */
.results-range {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: #fff;
    opacity: 0.92;
}

.btn-on-dark.is-solid {
    background: #fff;
    color: var(--ink);
    border-color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    min-height: 48px;
    padding: 0 1.25rem;
}

.btn-on-dark.is-solid:hover { background: var(--ground); }

.btn-link-on-dark {
    min-height: 44px;
    padding: 0 0.25rem;
    background: none;
    border: 0;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

@media (max-width: 639px) {
    .results-actions .is-solid { width: 100%; }
}

.evidence { padding-top: 0; padding-bottom: 0; }

.evidence-part { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.evidence-part:first-child { border-top: 0; }

.evidence-more > summary {
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.evidence-more > summary::-webkit-details-marker { display: none; }
.evidence-more > summary h3 { margin: 0; font-size: 1.0625rem; }
.evidence-more > summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--accent-text); line-height: 1; }
.evidence-more[open] > summary::after { content: "–"; }

@media (min-width: 768px) {
    .evidence-part { padding: 1.5rem 0; }
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-bottom: 0.75rem;
}

.footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.footer-about { margin-bottom: 1rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.footer-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ink); }

@media (max-width: 1023px) {
    .live-eyebrow, .verdict-call { display: none; }
    .live-summary { padding: 0.875rem 1rem; }
    .verdict { margin-top: 0; font-size: 1.5rem; }
    .live-summary dl { margin-top: 0.5rem; }
}

@media (max-width: 639px) {
    .mode-short-hide { display: none; }
    .mode-cap { text-transform: capitalize; }
}

.calculator-mode-link.is-current strong { color: var(--ink); }

/* Planning paths: same settings-style rows as the ROI inputs on phones. */
.planner-fields input { text-align: right; font-weight: 600; }

@media (max-width: 600px) {
    .planner-fields { gap: 0; margin-top: 1rem; }
    .planner-fields label {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 7.5rem;
        align-items: center;
        gap: 1rem;
        padding: 0.625rem 0;
        border-bottom: 1px solid var(--rule);
        font-size: 0.9375rem;
    }
    .planner-fields label:last-child { border-bottom: 0; }
    .planner-fields input { min-height: 44px; }
}

/* ---------- Pass 6: four inputs up front, refine panel, one examples control, range band ---------- */
.calc-head { padding: 1.25rem 0 0.5rem; }
.calc-head h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.calc-head p { margin-top: 0.25rem; font-size: 0.875rem; color: var(--ink-muted); max-width: 60ch; }

.calc-card > .field-row:last-of-type { border-bottom: 1px solid var(--rule); }
.calc-note { padding: 0.625rem 0 0.75rem; font-size: 0.8125rem; color: var(--ink-muted); }

.refine { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.refine > summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    align-items: center;
    min-height: 56px;
    padding: 0.625rem 0;
}

.refine > summary::-webkit-details-marker { display: none; }
.refine > summary::after { content: "+"; grid-column: 2; grid-row: 1 / span 2; font-size: 1.5rem; color: var(--accent-text); line-height: 1; }
.refine[open] > summary::after { content: "–"; }
.refine-title { font-weight: 700; font-size: 1rem; }
.refine-sum { grid-column: 1; font-size: 0.8125rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.refine-group { padding: 0.5rem 0 0.25rem; border-top: 1px solid var(--rule); }
.refine-group h3 { padding-top: 0.5rem; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.refine-help { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 0.125rem; }
.refine-group .field-row:last-child { border-bottom: 0; }

.examples { padding: 0.75rem 0 1rem; }
.examples-title { font-weight: 700; font-size: 0.9375rem; }

.examples-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.25rem;
    margin-top: 0.25rem;
}

.examples-kind {
    width: 6.5rem;
    flex: none;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.example-chip { display: contents; }
.example-notes { margin-top: 0.375rem; padding-left: 1rem; list-style: disc; }
.example-notes li + li { margin-top: 0.25rem; }

@media (max-width: 400px) {
    .examples-kind { width: 100%; margin-top: 0.25rem; }
}

/* Range band inside the green result */
.band {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: #fff;
    color: var(--ink);
    border-radius: 4px;
}

.band-title { font-weight: 700; font-size: 0.9375rem; }

.band-rows { margin-top: 0.5rem; }

.band-row {
    display: grid;
    grid-template-columns: 6.25rem minmax(0, 1fr) 3.5rem 5.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.band-label { color: var(--ink-muted); }
.band-mid .band-label { color: var(--ink); font-weight: 700; }
.band-track { height: 8px; background: var(--rule); }
.band-track > span { display: block; height: 100%; background: var(--ok); }
.band-row.is-negative .band-track > span { background: var(--caution); }
.band-roi { text-align: right; font-weight: 600; }
.band-row.is-negative .band-roi { color: var(--caution); }
.band-payback { text-align: right; font-weight: 600; white-space: nowrap; }
.band-mid .band-roi, .band-mid .band-payback { font-weight: 700; }
.band-note { margin-top: 0.5rem; font-size: 0.75rem; color: var(--ink-muted); }

@media (max-width: 400px) {
    .band-row { grid-template-columns: 5.5rem minmax(0, 1fr) 3rem 4.75rem; font-size: 0.8125rem; gap: 0.375rem; }
}

/* ---------- Round 6 fixes ---------- */
.example-chip.is-hidden { display: none; }
.examples-row { gap: 0 0.5rem; }

/* Band column headers so a negative Year 1 ROI next to a payback reads correctly. */
.band-head { padding: 0 0 0.125rem; font-size: 0.6875rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.band-head .band-roi, .band-head .band-payback { font-weight: 500; color: var(--ink-muted); }

/* Sensitivities as a compact driver → $ table */
.driver-list { gap: 0; }
.driver {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
    padding: 0.625rem 0;
    border-left: 0;
    border-bottom: 1px solid var(--rule);
}
.driver:last-child { border-bottom: 0; }
.driver-label { font-weight: 600; font-size: 0.9375rem; }
.driver-unit { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--ink-muted); }
.driver-amount { font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
    .driver-list { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 0.5rem; max-width: 36rem; }
}

/* Share actions read as a pair */
.results-actions .btn-on-dark:not(.is-solid) { min-height: 48px; }
@media (max-width: 639px) {
    .results-actions .btn-on-dark { width: 100%; }
}

/* Phones: the top card is a one-line verdict; the numbers live in the bar and the result. */
@media (max-width: 1023px) {
    .live-summary .verdict-metrics { display: none; }
    .live-summary { padding: 0.75rem 1rem; }
    .verdict { font-size: 1.375rem; }
    /* keep the fixed bar from covering the last controls */
    .calc-layout { padding-bottom: 3.5rem; margin-bottom: 0; }
}

.footer-about summary::after { content: "+"; margin-left: auto; color: var(--accent-text); font-size: 1.25rem; }
.footer-about[open] summary::after { content: "–"; }
.footer-about summary { list-style: none; }
.footer-about summary::-webkit-details-marker { display: none; }

.driver-amount span { font-size: 0.8125rem; font-weight: 500; color: var(--ink-muted); }
.band-head > span { white-space: nowrap; }

/* ---------- Option 1: tab subtitles + quiet result sheet ---------- */
@media (max-width: 639px) {
    .calculator-mode-link { padding: 0.5rem 0.375rem; gap: 0.125rem; }
    .calculator-mode-link > span { display: block; font-size: 0.75rem; line-height: 1.3; color: var(--ink-muted); }
}

.results-hero {
    background: var(--sheet);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-top: 6px solid var(--ok);
    border-radius: 0;
}

.results-hero.is-negative { background: var(--sheet); border-top-color: var(--caution); }
.results-hero .snd-label { color: var(--ink-muted); }
.results-verdict { color: var(--ok-text); }
.results-hero.is-negative .results-verdict { color: var(--caution); }
.results-call { color: var(--ink); }
.results-metrics { border-top-color: var(--rule); }
.results-metrics .metric-label { color: var(--ink-muted); }
.results-hero-note { color: var(--ink-muted); }
.results-share-status { color: var(--ok-text); }
.band { background: var(--ground); padding: 0.75rem; }
.results-actions .btn-primary, .results-actions .btn-secondary { min-height: 48px; }
@media (max-width: 639px) {
    .results-actions .btn-primary, .results-actions .btn-secondary { width: 100%; }
}
@media (min-width: 768px) { .band { max-width: 40rem; } }
