:root {
  --ink: #101010;
  --muted: #5f5f5f;
  --faint: #979088;
  --line: #e6e2dc;
  --paper: #ffffff;
  --card: #ffffff;
  --wash: #f7f5f2;
  --accent: #f04e23;          /* policy-tool orange */
  --accent-dark: #b93413;
  --accent-soft: #fdeae3;
  --warn-bg: #fff8ec;
  --warn-ink: #8a6100;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--accent-dark); }

/* ---- top bar ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  height: 58px;
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 20;
}

.brand {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-accent { color: var(--accent); }

.tabs { display: flex; gap: 4px; height: 100%; }

.tab-btn {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  height: 100%;
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); }

.draft-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 1px solid #f0e4c4;
  padding: 8px 24px;
  font-size: 12.5px;
  text-align: center;
}

.tab-panel { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.tab-panel.hidden { display: none; }

.page-head { padding: 34px 0 6px; }

.page-head h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.page-head p { max-width: 780px; color: var(--muted); margin: 0; }

/* ---- explorer ---- */

.stat-strip {
  display: flex;
  gap: 40px;
  padding: 18px 0 4px;
}

.stat .stat-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
}

.stat .stat-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.explorer-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  padding: 10px 0 40px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.filter-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#cat-filter { width: auto; max-width: 320px; font-weight: 600; }

.check-inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

.chip {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}

.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

#usmap svg { display: block; width: 100%; height: auto; }

.state {
  stroke: #ffffff;
  stroke-width: 0.75;
  cursor: pointer;
  transition: opacity 0.1s;
}

.state:hover { opacity: 0.75; }
.state.selected { stroke: var(--ink); stroke-width: 1.75; }

.state-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink);
  pointer-events: none;
  text-anchor: middle;
}

.state-label.on-dark { fill: #fff; }

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend .swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -2px;
  border: 1px solid rgba(0,0,0,0.08);
}

.map-note { font-size: 12px; color: var(--faint); margin-top: 10px; max-width: 640px; }

/* ---- state panel ---- */

.state-panel {
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  background: var(--card);
  padding: 18px 20px;
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.state-panel h3 {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.state-panel .panel-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

.panel-breakdown { margin: 0 0 14px; }

.panel-breakdown div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--wash);
}

.panel-breakdown div span:last-child { font-family: var(--mono); }

.bill-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.bill-card .bill-id { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.bill-card .bill-title { font-size: 13.5px; font-weight: 600; margin: 1px 0 4px; }
.bill-card .bill-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.controls details.advanced { margin-bottom: 14px; }
.controls details.advanced > summary {
  list-style: none;
  width: 100%;
  padding: 7px;
  box-sizing: border-box;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 14px;
}
.controls details.advanced > summary::-webkit-details-marker { display: none; }
.controls details.advanced > summary::after { content: " \25BE"; font-size: 11px; }
.controls details.advanced[open] > summary { border-color: var(--accent); color: var(--accent-dark); }
.controls details.advanced[open] > summary::after { content: " \25B4"; }
.controls details.advanced > summary:hover { border-color: var(--ink); color: var(--ink); }
.duty-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.duty-item:last-child { border-bottom: none; }
.duty-item .duty-label { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.duty-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.duty-cell { display: flex; flex-direction: column; }
.duty-cell input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 5px 2px; border: 1px solid var(--line); border-radius: 3px; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.duty-cell input::-webkit-outer-spin-button,
.duty-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.duty-cell input:focus { border-color: var(--accent); outline: none; }
.duty-cap { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 3px; }

#glossary .gloss-h {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--muted); margin: 26px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
}
#glossary .gloss-h:first-of-type { border-top: none; padding-top: 0; }
#glossary .gloss-h4 { font-size: 13.5px; font-weight: 700; margin: 18px 0 6px; }
#glossary .gloss-h4 .fam-key { font-weight: 400; color: var(--faint); font-size: 11.5px; margin-left: 6px; }
#glossary .gloss-steps { padding-left: 20px; }
#glossary .gloss-steps li { font-size: 13.5px; margin-bottom: 8px; line-height: 1.55; }
#glossary code {
  font-family: var(--mono); font-size: 11.5px; background: var(--wash);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; white-space: nowrap;
}
.gloss-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gloss-table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 6px 10px 6px 0; border-bottom: 2px solid var(--line);
}
.gloss-table td {
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line);
  vertical-align: top; line-height: 1.5;
}
.gloss-table tr:last-child td { border-bottom: none; }
.gloss-table td.num { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.params-table { table-layout: fixed; }
.params-table th:nth-child(1) { width: 21%; }
.params-table th:nth-child(2) { width: 34%; }
.params-table td { overflow-wrap: break-word; }

/* ---- profile builder ---- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-top: 4px; }
.profile-field { min-width: 0; }
.pf-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.pf-label .hint { font-weight: 400; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); user-select: none; transition: all .12s;
}
.chip input { margin: 0; accent-color: var(--accent); }
.chip:hover { border-color: var(--faint); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.profile-field select {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
}
.avail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.avail-row .radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.avail-row .radio input { margin: 0; accent-color: var(--accent); }
.avail-row select { width: auto; flex: 1; min-width: 130px; }
.avail-row select:disabled { opacity: .45; }

/* ---- cost falloff chart ---- */
.cost-chart { margin: 24px 0 8px; }
.cc-rows { display: flex; flex-direction: column; }
.cc-row {
  display: grid; grid-template-columns: 148px 1fr 88px; align-items: center; gap: 22px;
  padding: 14px 18px; border-radius: 16px; transition: background .2s;
}
.cc-row + .cc-row { margin-top: 2px; }
.cc-row.sel { background: linear-gradient(90deg, #fff3ee 30%, #fffaf7); }
.cc-label { display: flex; flex-direction: column; gap: 1px; }
.cc-tier { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cc-row.sel .cc-tier { color: var(--accent-dark); }
.cc-you { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.cc-rev { font-size: 11.5px; color: var(--faint); }
.cc-track { height: 15px; background: rgba(150,105,80,.1); border-radius: 3px; overflow: hidden; }
.cc-fill { height: 100%; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, #ffc196, #f5722f);
  transition: width .7s cubic-bezier(.2,.75,.2,1); }
.cc-row.sel .cc-fill { background: linear-gradient(90deg, #ff8846, #e5410e); }
.cc-pct { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.cc-row.sel .cc-pct { color: var(--accent-dark); }
.cc-pre {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 18px;
  border-radius: 16px; background: var(--wash); font-size: 13.5px; color: var(--muted);
}
.cc-pre.sel { background: linear-gradient(90deg, #fff3ee 30%, #fffaf7); color: var(--ink); }
.cc-pre strong { color: var(--ink); font-weight: 700; }
.cc-pre-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--faint); flex: none; }
.cc-pre.sel .cc-pre-dot { background: var(--accent); }
@media (max-width: 620px) {
  .cc-row { grid-template-columns: 110px 1fr 64px; gap: 12px; }
}

/* browse-laws disclosure — hidden unless asked for */
.laws-toggle > summary {
  cursor: pointer; list-style: none; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.laws-toggle > summary::-webkit-details-marker { display: none; }
.laws-toggle > summary::before {
  content: "\203A"; font-weight: 700; color: var(--accent); font-size: 18px;
  transition: transform .18s; display: inline-block;
}
.laws-toggle[open] > summary::before { transform: rotate(90deg); }
.laws-toggle > summary .hint { font-weight: 400; }
.laws-toggle #bills-table { margin-top: 16px; }

/* ---- stay updated / lead capture ---- */
/* understated, editorial "stay posted" — not a conversion box */
.stay { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.stay-lead { font-size: 15px; color: var(--ink); margin: 0 0 12px; }
.lead-inline { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; }
.lead-inline input {
  font: inherit; font-size: 15px; padding: 4px 2px; min-width: 220px;
  border: none; border-bottom: 1.5px solid var(--line); background: transparent; color: var(--ink);
  transition: border-color .16s;
}
.lead-inline input::placeholder { color: var(--faint); }
.lead-inline input:focus { border-bottom-color: var(--accent); outline: none; }
.lead-inline button {
  font: inherit; font-size: 15px; font-weight: 600; padding: 4px 6px; cursor: pointer;
  border: none; background: none; color: var(--accent-dark); white-space: nowrap;
  transition: opacity .16s;
}
.lead-inline button:hover { opacity: .7; }
.lead-consent { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); margin-top: 12px; }
.lead-consent input { accent-color: var(--accent); }
#lead-status:not(:empty) { display: block; margin-top: 10px; color: var(--accent-dark); }

.bill-card .bill-params { font-size: 12px; color: var(--muted); }
.bill-card .bill-links { font-size: 12px; margin-top: 3px; }
.bill-card .bill-links a { color: var(--accent, #2563eb); text-decoration: none; }
.bill-card .bill-links a:hover { text-decoration: underline; }

.panel-empty { color: var(--muted); font-size: 13.5px; }

/* ---- badges ---- */

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 3px;
  white-space: nowrap;
  background: var(--wash);
  color: var(--muted);
}

.badge.company { background: var(--accent-soft); color: var(--accent-dark); }
.badge.family { background: var(--wash); color: var(--ink); text-transform: none; letter-spacing: 0; }
.badge.pending { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #eddfb8; }

/* ---- tooltip ---- */

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 4px;
  z-index: 50;
  max-width: 240px;
}

.tooltip.hidden { display: none; }
#cost-detail.hidden { display: none; }

/* ---- cost wizard (premium) ---- */
#tab-model .page-head { text-align: center; padding: 48px 0 10px; }
#tab-model .page-head h1 { font-size: 42px; letter-spacing: -0.03em; }
#tab-model .page-head p { margin: 0 auto; max-width: 600px; font-size: 16.5px; }
#tab-model { padding-bottom: 60px; }
.wizard-wrap { max-width: 900px; margin: 26px auto 0; }
.wizard {
  padding: 0; overflow: hidden; border: none; border-radius: 24px;
  background: #fff; box-shadow: 0 1px 2px rgba(16,16,16,.04), 0 24px 60px -28px rgba(16,16,16,.22);
}
.wiz-bar { height: 3px; background: #f0ece6; }
.wiz-bar span { display: block; height: 100%; width: 25%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #f9803f, var(--accent)); transition: width .4s cubic-bezier(.4,0,.1,1); }
.wiz-step { padding: 52px 56px 40px; }
@keyframes wizInR { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes wizInL { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.wiz-step.slide-r { animation: wizInR .34s cubic-bezier(.2,.7,.2,1); }
.wiz-step.slide-l { animation: wizInL .34s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .wiz-step.slide-r, .wiz-step.slide-l { animation: none; } .wiz-bar span, .opt:hover { transition: none; } }
.wiz-q { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 8px; }
.wiz-help { color: var(--muted); font-size: 15.5px; margin: 0 0 30px; max-width: 60ch; }

/* selectable option tiles */
.chip-group.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.chip-group.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); gap: 12px; }
.chip-group.big .chip {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 2px; text-align: left;
  padding: 15px 52px 15px 20px; border: 1.5px solid var(--line);
  border-radius: 14px; background: #fff; cursor: pointer; user-select: none;
  font-size: 15px; font-weight: 600; line-height: 1.3;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.chip-group.big .chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip-group.big .chip:hover { border-color: #cbc3b9; box-shadow: 0 6px 16px -12px rgba(16,16,16,.25); }
.chip-group.big .chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
/* checkmark only when selected — no empty circle stealing space from the text */
.chip-group.big .chip:has(input:checked)::after {
  content: ""; position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}
.chip-eg { display: block; font-size: 12.5px; color: var(--faint); font-weight: 400; }
.chip:has(input:checked) .chip-eg { color: var(--accent-dark); opacity: .8; }

/* per-release badge in the duty editor */
.duty-flag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-dark); background: var(--accent-soft); border-radius: 4px;
  padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}

/* family % split on the result page */
.family-split { margin-top: 26px; }
.fs-title { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.fs-row { display: grid; grid-template-columns: 210px 1fr 52px; align-items: center; gap: 14px; padding: 5px 0; }
.fs-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-row.other .fs-label { color: var(--muted); font-weight: 500; }
.fs-track { height: 8px; background: rgba(150,105,80,.1); border-radius: 3px; overflow: hidden; }
.fs-fill { display: block; height: 100%; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, #ffc196, #f5722f); }
.fs-row.other .fs-fill { background: #d8d0c6; }
.fs-pct { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .fs-row { grid-template-columns: 130px 1fr 46px; gap: 10px; } }

/* "you can change the assumptions" — a proper interactive row */
.assumptions-cta {
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left; cursor: pointer; margin-top: 24px;
  padding: 16px 20px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; font: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.assumptions-cta:hover { border-color: var(--accent); box-shadow: 0 8px 22px -16px rgba(240,78,35,.45); }
.assumptions-cta .ac-icon {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.assumptions-cta .ac-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.assumptions-cta .ac-main { font-size: 15px; font-weight: 700; color: var(--ink); }
.assumptions-cta .ac-sub { font-size: 12.5px; color: var(--muted); }
.assumptions-cta .ac-open {
  margin-left: auto; flex: none; display: flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 700; color: var(--accent-dark);
}
.assumptions-cta .cc { display: none; }
.assumptions-cta.open .cc { display: inline; }
.assumptions-cta.open .oc { display: none; }
.assumptions-cta .ac-caret { font-weight: 700; transition: transform .2s; display: inline-block; }
.assumptions-cta.open .ac-caret { transform: rotate(180deg); }

.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.wiz-btn {
  font: inherit; font-size: 15px; font-weight: 600; padding: 12px 24px; cursor: pointer;
  border: 1.5px solid transparent; background: none; color: var(--muted); border-radius: 10px;
  transition: all .16s;
}
.wiz-btn.back:hover { color: var(--ink); }
.wiz-btn.next, .wiz-btn.primary {
  background: var(--ink); color: #fff; box-shadow: 0 8px 20px -10px rgba(16,16,16,.5);
}
.wiz-btn.next:hover, .wiz-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(16,16,16,.55); }
.wiz-btn.primary { background: var(--accent); box-shadow: 0 8px 22px -8px rgba(240,78,35,.6); }
.wiz-btn.primary:hover { background: var(--accent-dark); }

.wiz-geo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin-bottom: 22px; }
.geo-field { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 9px; }
.geo-field select { font: inherit; font-size: 14px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; cursor: pointer; }
.geo-field select:focus { border-color: var(--accent); outline: none; }
.avail-row { gap: 12px 16px; }
.avail-row .radio { font-size: 14px; }
.wiz-map { margin: 8px 0 6px; }
.wiz-map svg { width: 100%; height: auto; display: block; }
.wm-state { stroke: #d8d2c9; stroke-width: 1; cursor: pointer; transition: fill .12s; }
/* CSS fill beats the presentation attribute, so hover always reads clearly */
.wm-state:hover { fill: #ffb488 !important; }
.wm-state.picked { stroke: var(--ink); stroke-width: 2; }
.wm-state.picked:hover { fill: #f04e23 !important; }
/* overlay draws the full hovered outline on top — never clipped by neighbours */
.wm-hover { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }

.wiz-step.result { padding-top: 44px; }
#result-headline { font-size: 27px; font-weight: 800; line-height: 1.22; letter-spacing: -0.02em; margin: 0 0 6px; }
#result-headline strong { color: var(--accent-dark); }
@media (max-width: 620px) { .wiz-step { padding: 36px 24px 30px; } .wiz-q { font-size: 25px; } .wiz-geo { grid-template-columns: 1fr; } }
.tooltip .tt-count { color: #f8b39c; font-family: var(--mono); }

/* ---- cost model layout ---- */

.layout {
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
}

.controls {
  position: sticky;
  top: 74px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  padding: 18px 18px 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.controls section { margin-bottom: 20px; }

.controls h2, .card h2 {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.control { margin-bottom: 10px; }

.control label { display: block; font-size: 13px; margin-bottom: 3px; }

.control.check label { display: flex; gap: 7px; align-items: baseline; }

.hint { color: var(--faint); font-weight: normal; text-transform: none; letter-spacing: 0; font-size: 12px; }

.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.rate-row { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }

input[type="number"], select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.rate-row input[type="number"] { width: 90px; }
#n-firms { width: 120px; }

input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="range"]:disabled { opacity: 0.4; }
input[type="checkbox"] { accent-color: var(--accent); }

output {
  float: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-dark);
}

#reset {
  width: 100%;
  padding: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
}
#reset:hover { border-color: var(--ink); color: var(--ink); }

/* ---- cards ---- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.headline { border-top: 3px solid var(--accent); }

.headline-figures { display: flex; gap: 36px; margin: 14px 0 6px; }

.fig-label { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

.fig-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  margin-top: 2px;
}

.fig.lead .fig-value { color: var(--accent-dark); }
.fig.lead .fig-label { color: var(--accent-dark); font-weight: 600; }

.aggregate-line { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.aggregate-line strong { font-family: var(--mono); color: var(--ink); font-weight: 600; }

/* ---- charts ---- */

#histogram svg, #families svg { display: block; width: 100%; height: auto; }

.bar { fill: #f5c9b4; }
.pct-line { stroke: var(--accent-dark); stroke-width: 1.5; }
.pct-label { font-family: var(--mono); font-size: 11px; fill: var(--accent-dark); }
.axis-label { font-family: var(--mono); font-size: 11px; fill: var(--faint); }

.fam-bar { fill: var(--accent); opacity: 0.85; }
.fam-name { font-size: 13px; fill: var(--ink); font-weight: 600; }
.fam-sub { font-size: 11px; fill: var(--faint); }
.fam-value { font-family: var(--mono); font-size: 12px; fill: var(--muted); }

/* ---- bills table ---- */

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px 6px 0;
  font-weight: 600;
}

td { border-bottom: 1px solid var(--wash); padding: 7px 10px 7px 0; vertical-align: top; }

tr.excluded td { color: var(--faint); }
tr.excluded .badge { background: var(--wash); color: var(--faint); }

.bill-id { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.bill-name { color: var(--muted); font-size: 12px; }
.params { font-size: 12px; color: var(--muted); }

.methodology ul { padding-left: 18px; margin: 0; }
.methodology li { margin-bottom: 8px; font-size: 14px; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 14px 28px 40px;
  color: var(--faint);
  font-size: 12px;
}

footer a { color: var(--faint); }

@media (max-width: 960px) {
  .layout, .explorer-layout { grid-template-columns: 1fr; }
  .controls, .state-panel { position: static; max-height: none; }
  .headline-figures { flex-wrap: wrap; gap: 20px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
}
