/* Spectpoint flagship — functional, fast, readable. No framework CSS. */

:root {
  --ink: #17202a;
  --muted: #5b6b7c;
  --line: #dfe6ee;
  --bg: #ffffff;
  --bg-soft: #f4f7fa;
  --accent: #0b5fff;
  --accent-ink: #ffffff;
  --ok: #0e7c3e;
  --ok-bg: #e7f6ec;
  --caution: #925e00;
  --caution-bg: #fff6e0;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --radius: 12px;
  --wrap: 72rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.0625rem;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-header nav a:hover { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0; color: var(--muted); font-size: 0.9375rem; }
.site-footer .fine { font-size: 0.8125rem; }

/* ---------- Hero ---------- */
.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.hero .lede { color: var(--muted); font-size: 1.125rem; max-width: 44rem; margin: 0 0 1.5rem; }
.covers { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.covers li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.875rem; color: var(--muted); }

/* ---------- Vehicle context bar ---------- */
.vehicle-bar {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.vehicle-bar h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.vehicle-bar .row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.vehicle-bar label { display: grid; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.vehicle-bar input {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.625rem;
  font-size: 1rem; min-width: 7rem; background: #fff; color: var(--ink);
}
.vehicle-bar button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 0.5rem 1rem; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.vehicle-bar button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vehicle-chip {
  display: none; align-items: center; gap: 0.5rem; font-weight: 600;
  background: #e8efff; border: 1px solid #c4d6ff; border-radius: 999px; padding: 0.375rem 0.875rem;
}
.vehicle-chip.on { display: inline-flex; }
.vehicle-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 0; }

/* ---------- Tree stepper ---------- */
.tree { margin: 0 0 3rem; }
.step-label { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.75rem 0 0.75rem; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; }
.branch-card {
  display: block; text-align: left; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 1rem 1.125rem; cursor: pointer; width: 100%;
  font-size: 1rem; color: var(--ink); text-decoration: none;
}
.branch-card:hover { border-color: var(--accent); }
.branch-card[aria-pressed="true"] { border-color: var(--accent); background: #f2f7ff; }
.branch-card .icon { font-size: 1.5rem; display: block; margin-bottom: 0.375rem; }
.branch-card strong { display: block; margin-bottom: 0.25rem; }
.branch-card small { color: var(--muted); }

.clarifier { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: #fff; margin-top: 1rem; }
.clarifier h3 { margin: 0 0 0.75rem; font-size: 1.125rem; }
.answer-list { display: grid; gap: 0.5rem; }
.answer-btn {
  text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 0.875rem 1rem; cursor: pointer; font-size: 1rem; color: var(--ink); width: 100%;
}
.answer-btn:hover { border-color: var(--accent); background: #f8fbff; }
.answer-btn small { display: block; color: var(--muted); margin-top: 0.125rem; }

.back-link { display: inline-block; margin-top: 1rem; color: var(--muted); font-size: 0.9375rem; background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- Diagnosis card ---------- */
.diagnosis { border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; background: #fff; }
.diagnosis h2 { margin: 0 0 0.25rem; font-size: 1.5rem; letter-spacing: -0.01em; }
.confidence { color: var(--muted); font-size: 0.9375rem; margin-bottom: 1rem; }
.cause-block { border-top: 1px solid var(--line); padding: 1.25rem 0; }
.cause-block:first-of-type { border-top: 0; padding-top: 0; }
.likelihood { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; padding: 0.125rem 0.625rem; margin-bottom: 0.5rem; }
.likelihood.most-likely { background: #e8efff; color: #0b3fa0; }
.likelihood.possible { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.likelihood.less-likely { background: var(--bg-soft); color: var(--muted); border: 1px dashed var(--line); }
.cause-block h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.mechanism { margin: 0 0 1rem; }
.evidence { display: grid; gap: 1rem; margin: 0 0 1rem; }
@media (min-width: 46rem) { .evidence { grid-template-columns: 1fr 1fr; } }
.evidence h4 { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.evidence ul { margin: 0; padding-left: 1.25rem; font-size: 0.9375rem; }
.evidence .for h4 { color: var(--ok); }
.evidence .against h4 { color: var(--caution); }
.evidence .claim { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

/* Verdict */
.verdict { border-radius: 10px; padding: 1rem 1.25rem; margin: 1rem 0; border: 1px solid; }
.verdict.ok { background: var(--ok-bg); border-color: #bfe6cc; }
.verdict.caution { background: var(--caution-bg); border-color: #f0d48a; }
.verdict.warn { background: var(--caution-bg); border-color: #f0d48a; }
.verdict.danger { background: var(--danger-bg); border-color: #f5b8b1; }
.verdict .state { font-weight: 800; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 0.375rem; }
.verdict.ok .state { color: var(--ok); }
.verdict.caution .state, .verdict.warn .state { color: var(--caution); }
.verdict.danger .state { color: var(--danger); }
.verdict p { margin: 0.375rem 0; }
.verdict ul { margin: 0.5rem 0 0; padding-left: 1.25rem; font-size: 0.9375rem; }

.severity-note { font-size: 0.9375rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 0.875rem; margin: 1rem 0; }

/* Safe checks */
.checks { margin: 1.5rem 0; }
.check { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.75rem; background: #fff; }
.check summary { cursor: pointer; padding: 0.875rem 1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.check summary::-webkit-details-marker { display: none; }
.check summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.check[open] summary::after { content: "–"; }
.check .body { padding: 0 1rem 1rem; }
.check ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.check .stop { background: var(--danger-bg); border-radius: 8px; padding: 0.625rem 0.875rem; margin-top: 0.75rem; font-size: 0.9375rem; }
.check .stop strong { color: var(--danger); }
.time-est { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }

/* Pro triggers */
.pro-triggers { background: var(--bg-soft); border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.pro-triggers h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.pro-triggers ul { margin: 0; padding-left: 1.25rem; }
.pro-triggers li { margin-bottom: 0.5rem; }

/* Cost */
.costs { margin: 1.5rem 0; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.cost-table th, .cost-table td { text-align: left; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cost-table th { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.cost-range { font-weight: 700; white-space: nowrap; }
.uncertainty { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.125rem 0.5rem; white-space: nowrap; }
.uncertainty.low { background: var(--ok-bg); color: var(--ok); }
.uncertainty.medium { background: var(--caution-bg); color: var(--caution); }
.uncertainty.high { background: var(--danger-bg); color: var(--danger); }
.methodology { font-size: 0.8125rem; color: var(--muted); margin-top: 0.75rem; }
.methodology summary { cursor: pointer; font-weight: 600; }

/* Next decision */
.next-decision { background: #f2f7ff; border: 1px solid #c4d6ff; border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.next-decision h3 { margin: 0 0 0.5rem; }
.next-decision ol { margin: 0; padding-left: 1.25rem; }
.next-decision li { margin-bottom: 0.375rem; font-weight: 600; }

/* Actions */
.actions { display: grid; gap: 0.75rem; margin: 1.5rem 0; }
@media (min-width: 46rem) { .actions { grid-template-columns: 1fr 1fr; } }
.action-card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.125rem; background: #fff; }
.action-card h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.action-card p { margin: 0 0 0.75rem; font-size: 0.9375rem; color: var(--muted); }
.action-card a, .action-card button {
  display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  border: 0; border-radius: 8px; padding: 0.5rem 1rem; font-weight: 700; font-size: 0.9375rem; cursor: pointer;
}
.action-card .tag { font-size: 0.75rem; color: var(--muted); display: block; margin-top: 0.5rem; }

/* Sources */
.sources { font-size: 0.875rem; color: var(--muted); margin: 2rem 0; }
.sources h2 { font-size: 1.125rem; color: var(--ink); }
.sources ol { padding-left: 1.25rem; }

/* Editorial (below the fold) */
.editorial { margin: 3rem 0; max-width: 44rem; }
.editorial h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
.editorial h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
.faq dt { font-weight: 700; margin-top: 1rem; }
.faq dd { margin: 0.25rem 0 0; color: var(--muted); }

[hidden] { display: none !important; }

/* No-JS: everything visible, anchor-navigable. JS enhances into a stepper. */
.no-js-note { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.9375rem; color: var(--muted); margin-bottom: 1.5rem; }
script + .no-js-note, .js .no-js-note { display: none; }

/* ---------- Decision summary (DECIDE layer — first on every screen) ---------- */
.decision-summary {
  border-radius: var(--radius);
  border: 2px solid;
  padding: 1.25rem;
  margin: 1rem 0 1.25rem;
}
.decision-summary.ok { background: var(--ok-bg); border-color: var(--ok); }
.decision-summary.caution, .decision-summary.warn { background: var(--caution-bg); border-color: var(--caution); }
.decision-summary.danger { background: var(--danger-bg); border-color: var(--danger); }
.ds-verdict { margin-bottom: 1rem; }
.ds-state {
  display: inline-block; font-weight: 800; font-size: 0.8125rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 999px; padding: 0.25rem 0.75rem; margin-bottom: 0.5rem;
  background: #fff; border: 1px solid currentColor;
}
.decision-summary.ok .ds-state { color: var(--ok); }
.decision-summary.caution .ds-state, .decision-summary.warn .ds-state { color: var(--caution); }
.decision-summary.danger .ds-state { color: var(--danger); }
.ds-headline { margin: 0; font-size: 1.125rem; }
.ds-grid { display: grid; gap: 1rem; margin: 0; }
.ds-q dt {
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.25rem;
}
.ds-q dd { margin: 0; font-size: 1rem; }
.ds-q ol, .ds-conditions { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.ds-q ol li + li, .ds-conditions li + li { margin-top: 0.25rem; }
.ds-escalates { margin: 0.5rem 0 0; font-size: 0.9375rem; }
.ds-note { display: block; margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.ds-hint { font-weight: 400; font-size: 0.8125rem; color: var(--muted); }

/* ---------- Progressive disclosure ---------- */
.disclosure {
  border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 0.75rem; background: #fff;
}
.disclosure > summary {
  cursor: pointer; padding: 0.875rem 1rem; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: 1.0625rem;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.25rem; flex-shrink: 0; }
.disclosure[open] > summary::after { content: "–"; }
.disclosure > .body { padding: 0 1rem 1.25rem; }
.disclosure .cause-block:first-of-type { border-top: 0; padding-top: 0.25rem; }
.pro-list, .repair-list { margin: 0.5rem 0; padding-left: 1.25rem; }
.pro-list li + li, .repair-list li + li { margin-top: 0.5rem; }

/* ---------- Vehicle honesty note ---------- */
.vehicle-note { font-size: 0.875rem; color: var(--muted); margin: 0 0 0.75rem; max-width: 44rem; }

/* ---------- Focus visibility (keyboard navigation) ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.branch-card:focus-visible, .answer-btn:focus-visible { outline-offset: 3px; }

/* ---------- Desktop: decision summary becomes two columns ---------- */
@media (min-width: 60rem) {
  .ds-grid { grid-template-columns: 1fr 1fr; }
  .ds-q:first-child { grid-column: 1 / -1; }
  .decision-summary { padding: 1.5rem 1.75rem; }
  .disclosure > .body { padding: 0 1.5rem 1.5rem; }
}
