/* autoinsurance101.com — theme_03 Swiss Grid Technical Ledger */
:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --ink: #111111;
  --accent: #d9381e;
  --accent-dim: #b02c16;
  --muted: #4b5563;
  --line: #d8d8d0;
  --line-strong: #111111;
  --warn: #b45309;
  --fail: #d9381e;
  --info: #1d4ed8;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #f4f4f0; padding: 8px 14px; z-index: 100;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Swiss hairline header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px;
  border-bottom: 2px solid var(--line-strong);
  background: var(--surface);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-mark {
  font-weight: 900; color: var(--accent);
  border: 2px solid var(--ink); padding: 1px 6px;
  font-size: 13px; letter-spacing: 0.04em;
}
.brand-name { font-weight: 700; letter-spacing: 0.08em; font-size: 14px; }
.brand-sub { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.topnav { display: flex; gap: 0; flex-wrap: wrap; border-left: 1px solid var(--line); }
.topnav a {
  color: var(--ink); text-decoration: none;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-right: 1px solid var(--line);
}
.topnav a:hover { color: var(--accent); background: var(--surface-2); }

.disclosure-strip {
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  padding: 8px 22px;
}
.disclosure-strip a { color: #ffffff; text-decoration: underline; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 22px 64px; }

/* Hero — numbered module header */
.hero { margin-bottom: 28px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.hero h1 {
  font-size: clamp(26px, 4.4vw, 40px);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-weight: 800;
  line-height: 1.05;
}
.hero h1 .accent { color: var(--accent); }
.hero p { max-width: 74ch; color: var(--muted); margin: 0 0 8px; }
.hero .meta {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  display: flex; gap: 0; flex-wrap: wrap; margin-top: 12px;
}
.hero .meta span { padding-right: 18px; margin-right: 18px; border-right: 1px solid var(--line); }
.hero .meta span:last-child { border-right: 0; }

section { margin: 34px 0; }
h2 {
  font-size: 18px; margin: 0 0 6px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800;
  border-left: 6px solid var(--accent); padding-left: 12px;
}
h2 .idx { color: var(--accent); margin-right: 10px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 80ch; }

/* Two-pane ledger layout — hairline dividers act as the grid */
.console {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 0;
  align-items: start;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
@media (max-width: 900px) { .console { grid-template-columns: 1fr; } }

.panel {
  padding: 16px;
  background: var(--surface);
}
#input-deck { border-right: 1px solid var(--line-strong); }
@media (max-width: 900px) { #input-deck { border-right: 0; border-bottom: 1px solid var(--line-strong); } }
.panel + .panel, .panel .panel { border-top: 1px solid var(--line); }
.console > div > .panel + .panel { border-top: 1px solid var(--line-strong); }
.panel h3 {
  font-size: 12px; margin: 0 0 12px;
  color: var(--ink); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800;
  border-bottom: 2px solid var(--line-strong); padding-bottom: 8px;
}

.field { margin-bottom: 12px; }
.field label {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.field label output { color: var(--accent); }
.field input[type="range"], .field select {
  width: 100%; accent-color: var(--accent);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 0; padding: 6px;
  font-family: var(--sans); font-size: 13px;
}
.field input[type="range"] { padding: 4px 0; border: 0; border-bottom: 1px solid var(--line-strong); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }
.field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--line);
}
.field-row > .field { padding: 10px 12px 10px 0; }
.field-row > .field + .field { border-left: 1px solid var(--line); padding-left: 12px; }

.preset-row { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 14px; border: 1px solid var(--line-strong); }
.btn {
  background: var(--surface); color: var(--ink);
  border: 0; border-right: 1px solid var(--line);
  padding: 8px 12px; font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  cursor: pointer;
}
.btn:last-child { border-right: 0; }
.preset-row .btn:last-child { border-right: 0; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); color: #ffffff; }
.export-row { display: flex; gap: 0; flex-wrap: wrap; margin-top: 14px; border: 1px solid var(--line-strong); }
.export-row .btn { border-right: 1px solid var(--line-strong); }
.export-row .btn:last-child { border-right: 0; }

/* Telemetry readouts — ledger cells */
.telemetry {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0; margin-bottom: 14px;
  border: 1px solid var(--line-strong);
}
.readout {
  background: var(--surface-2); border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); padding: 10px 12px;
}
.readout .k {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.readout .v { font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.readout .v.warn { color: var(--warn); }
.readout .v.fail { color: var(--fail); }
.readout .u { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }

.gauge-wrap { margin: 6px 0 14px; border: 1px solid var(--line); padding: 10px; }
.gauge-wrap svg { width: 100%; height: auto; display: block; }
.gauge-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-top: 4px;
}

.chart-wrap { border-top: 1px solid var(--line); padding-top: 10px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap svg + svg { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.chart-legend {
  display: flex; gap: 0; flex-wrap: wrap;
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px;
}
.chart-legend span { padding-right: 18px; }
.chart-legend span::before { content: "■ "; }
.chart-legend .l1::before { color: var(--accent); }
.chart-legend .l2::before { color: var(--ink); }
.chart-legend .l3::before { color: var(--accent); }

/* Audit sheet — ledger table */
.audit { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit th, .audit td {
  text-align: left; padding: 7px 8px; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.audit th {
  color: var(--muted); font-weight: 700; text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.08em;
  border-bottom: 2px solid var(--line-strong);
}
.badge {
  display: inline-block; padding: 1px 7px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge.pass { color: #166534; border-color: #166534; background: #f0fdf4; }
.badge.fail { color: var(--fail); border-color: var(--fail); background: #fef2f2; }
.badge.warn { color: var(--warn); border-color: var(--warn); background: #fffbeb; }
.badge.info { color: var(--info); border-color: var(--info); background: #eff6ff; }

.receipt {
  margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line-strong);
  padding: 12px; font-size: 11px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  white-space: pre-wrap; word-break: break-all; color: var(--muted);
  max-height: 260px; overflow: auto;
}
.receipt .sha { color: var(--accent); font-weight: 700; }

/* Reference sections — Swiss grid cards */
.ref-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0; border: 1px solid var(--line-strong); background: var(--surface);
}
.ref-card { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ref-card h3 {
  font-size: 11px; font-weight: 800; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 8px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.ref-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ref-card td, .ref-card th {
  padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left;
}
.ref-card th {
  color: var(--muted); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ref-card p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.prose { max-width: 78ch; color: var(--muted); }
.prose h3 { color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.prose code {
  font-size: 12px; background: var(--surface-2); padding: 1px 5px;
  border: 1px solid var(--line); color: var(--accent);
}

footer.site-footer {
  border-top: 2px solid var(--line-strong); background: var(--surface);
  padding: 26px 22px 40px; margin-top: 40px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-inner .col { font-size: 12px; color: var(--muted); }
.footer-inner .col strong { color: var(--ink); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.footer-inner .col a {
  color: var(--muted); text-decoration: none; margin-right: 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-inner .col a:hover { color: var(--accent); }
.footer-inner .legal { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
