/* MillRate USA. Layout: navy masthead and hero over a pale ledger-paper body;
   content in one 1120px column, tables as the main object on every page.
   Single light look by design (matches MillRate.ca), so every colour is explicit. */
:root {
  color-scheme: light;
  --navy: #0B1829;      /* masthead, hero, ink */
  --navy-2: #13243B;    /* raised surfaces on navy */
  --ink: #1A2535;       /* body text */
  --muted: #5A6577;     /* secondary text, slightly blue-biased grey */
  --paper: #FFFFFF;
  --paper-2: #F3F5F9;   /* alternate bands */
  --rule: #DCE1E9;
  --red: #B22234;       /* accent on light */
  --red-bright: #E8414F;/* accent on navy */
  --blue: #3C3B6E;      /* links on light */
  --blue-soft: #7FA6DC; /* accents on navy */
  --up: #B22234; --down: #2F6B4F;
  --f-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--f-body); }
a { color: var(--blue); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; color: var(--navy); line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.min0 { min-width: 0; }

/* Sample-data banner */
.sample-banner { background: #FFF4D6; color: #5C4300; border-bottom: 1px solid #E9D49A; font-size: .875rem; font-weight: 500; }
.sample-banner .wrap { padding-block: 8px; }

/* Masthead */







/* Hero */
.hero { background: radial-gradient(ellipse at 80% 0%, #1B3150 0%, var(--navy) 60%); color: #FFFFFF; }
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-inner { padding-block: 64px 56px; text-align: center; position: relative; z-index: 1; }
/* Map sits behind the hero copy. Live states keep a "live" class so they can be
   highlighted later; for now they look the same as the rest. */
.hero-map { position: absolute; z-index: 0; left: 50%; top: 50%; width: min(1180px, 140%); max-width: none; height: auto; transform: translate(-50%, -46%); pointer-events: none; }
.hero-map .st { fill: rgba(127, 166, 220, .07); }
.hero-map .st-border { fill: none; stroke: rgba(127, 166, 220, .16); stroke-width: 1; stroke-linejoin: round; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(11,24,41,.55), rgba(11,24,41,0) 70%); pointer-events: none; }
.hero h1 { color: #FFFFFF; max-width: 22ch; margin-inline: auto; }
.hero-accent { display: block; font-style: italic; color: var(--red-bright); }
.hero-lede { color: rgba(255,255,255,.78); max-width: 62ch; margin: 0 auto 28px; }
.search { display: flex; max-width: 560px; margin: 0 auto; background: #FFFFFF; border-radius: var(--radius); overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; padding: 14px 16px; font: inherit; color: var(--ink); background: #FFFFFF; }
.search button { border: 0; background: var(--red); color: #FFFFFF; font: 500 1rem var(--f-body); padding: 0 22px; cursor: pointer; }
.search button:hover { background: #941B2B; }
.search-msg { color: #FFD9DD; margin-top: 10px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; margin: 40px 0 0; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { color: rgba(255,255,255,.6); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.hero-stats dd { margin: 0; font-family: var(--f-display); font-size: 2.2rem; color: #FFFFFF; font-variant-numeric: tabular-nums; }

/* Bands */
.band { padding-block: 56px; background: var(--paper); }
.band-alt { background: var(--paper-2); }
.section-head { display: grid; gap: 4px; margin-bottom: 24px; }
.section-head p { color: var(--muted); max-width: 70ch; }

/* State grid */
.state-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.state-card > a, .state-card > div { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; padding: 14px; box-sizing: border-box; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--paper); height: 100%; }
.state-card .abbr { grid-row: span 2; font-family: var(--f-display); font-size: 1.6rem; color: var(--navy); line-height: 1; align-self: center; }
.state-card .nm { font-weight: 500; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.state-card .status { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.state-live > a { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--red); }
.state-live .status { color: var(--red); font-weight: 700; }
.state-live > a:hover { background: var(--paper-2); }
.state-planned > div { opacity: .6; }

/* Explainer + stack illustration */
.explainer { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.explainer-text { min-width: 0; max-width: 62ch; }
.text-link { font-weight: 500; }
.stack-fig { margin: 0; }
.stack { display: grid; gap: 4px; }
.layer { color: #FFFFFF; padding: 14px 16px; border-radius: 6px; font-weight: 500; font-size: .95rem; }
.l1 { background: var(--navy); min-height: 76px; }
.l2 { background: var(--blue); min-height: 48px; }
.l3 { background: var(--red); min-height: 56px; }
.l4 { background: #FFFFFF; color: var(--muted); border: 1px dashed var(--muted); }
.stack-fig figcaption { color: var(--muted); font-size: .8rem; margin-top: 8px; }

/* Tool cards */
.tool-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tool-card { border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; background: var(--paper); }
.btn { display: inline-block; background: var(--navy); color: #FFFFFF; text-decoration: none; padding: 10px 18px; border-radius: 8px; font-weight: 500; border: 1px solid var(--navy); cursor: pointer; font: 500 1rem var(--f-body); }
.btn:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--paper-2); }

/* Page heads */
.page-head { background: var(--navy); color: #FFFFFF; padding-block: 28px 36px; }
.page-head h1 { color: #FFFFFF; }
.page-head .lede, .page-head .subhead { color: rgba(255,255,255,.78); max-width: 70ch; }
.subhead { font-size: 1.05rem; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; margin-bottom: 14px; color: rgba(255,255,255,.6); }
.crumbs a { color: var(--blue-soft); }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 24px 0 0; }
.keyfacts div { background: var(--navy-2); border: 1px solid #22385A; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.keyfacts dt { order: 1; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.keyfacts dd { order: 2; margin: 2px 0 0; font-family: var(--f-display); font-size: 1.9rem; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.keyfacts small { display: block; font-family: var(--f-body); font-size: .85rem; color: rgba(255,255,255,.7); }
.keyfacts small a { color: var(--blue-soft); }

/* Callout */
.callout { border-left: 4px solid var(--red); background: var(--paper-2); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 40px; max-width: 80ch; }
.callout h2 { font-size: 1.3rem; }
.callout p:last-child { margin-bottom: 0; }

/* Tables */
.table-tools { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.table-tools h2 { margin-right: auto; margin-bottom: 0; }
.table-tools select, .picker select { font: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data th, .data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data thead th { background: var(--paper-2); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.data thead th button { all: unset; cursor: pointer; }
.data thead th button::after { content: " ↕"; opacity: .4; }
.data thead th button[aria-sort="ascending"]::after { content: " ↑"; opacity: 1; }
.data thead th button[aria-sort="descending"]::after { content: " ↓"; opacity: 1; }
.data tbody th { font-weight: 500; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data tbody tr:hover { background: #F8FAFC; }
.data .num { text-align: right; }
.data.compact th, .data.compact td { padding: 8px 12px; }
.data .up { color: var(--up); }
.data .down { color: var(--down); }
.is-current { background: #FFF1F2; }
.is-current th { color: var(--red); }
.table-note, .source { font-size: .875rem; color: var(--muted); margin-top: 10px; }

/* County grid */
.county-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.county-grid a { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); }
.county-grid a:hover { border-color: var(--navy); }
.county-grid .nm { font-weight: 500; color: var(--navy); }
.county-grid .meta { font-size: .85rem; color: var(--muted); }

/* Municipality rate layout */
.rate-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.rate-card { border: 1px solid var(--navy); border-radius: var(--radius); padding: 24px; background: var(--paper); box-shadow: inset 0 4px 0 var(--red); min-width: 0; }
.eyebrow { font-family: var(--f-body); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 6px; }
.big-rate { font-family: var(--f-display); font-size: clamp(3rem, 8vw, 4.4rem); color: var(--navy); line-height: 1; margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.big-rate span { display: block; font-family: var(--f-body); font-size: 1rem; color: var(--muted); margin-top: 8px; }
.rate-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.rate-facts dt { font-size: .8rem; color: var(--muted); }
.rate-facts dd { margin: 0; font-size: 1.15rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.rate-facts .up { color: var(--up); } .rate-facts .down { color: var(--down); }
.rank-note { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.covers { min-width: 0; }
.covers-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.covers-list li { padding-left: 30px; position: relative; }
.covers-list li::before { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.covers-list .yes::before { content: "✓"; background: #E3F0E9; color: var(--down); }
.covers-list .maybe::before { content: "?"; background: #FFF4D6; color: #7A5B00; }

/* Calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.calc label, .picker label { display: block; font-weight: 500; margin-bottom: 6px; }
.input-money { display: flex; align-items: center; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); max-width: 320px; }
.input-money span { padding-left: 14px; color: var(--muted); }
.input-money input { border: 0; padding: 12px; font: 500 1.2rem var(--f-body); width: 100%; min-width: 0; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-result { background: var(--navy); color: #FFFFFF; border-radius: var(--radius); padding: 24px; }
.calc-result .eyebrow { color: rgba(255,255,255,.65); }
.calc-out { font-family: var(--f-display); font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-work { color: var(--blue-soft); font-size: .9rem; }
.calc-result .muted { color: rgba(255,255,255,.65); }

/* Two-column history */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.chart-fig { margin: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 12px var(--f-body); }
.chart .val { fill: var(--ink); font: 500 12px var(--f-body); }
.chart .bar { fill: #9DB1CF; }
.chart .bar.latest { fill: var(--navy); }
.chart-fig figcaption { font-size: .85rem; color: var(--muted); }

/* Prose */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; } .prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.2em; font-size: 1.15rem; }
.rules { padding-left: 1.1em; display: grid; gap: 10px; }

/* Picker */
.picker { display: grid; gap: 10px; max-width: 480px; margin-bottom: 40px; }

/* Signup */
.signup { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; margin-block: 56px; background: var(--paper-2); }
.signup h2 { font-size: 1.4rem; }
.signup p { color: var(--muted); margin: 0; }
.signup-form { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-form input { flex: 1 1 200px; min-width: 0; padding: 11px 12px; font: inherit; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); color: var(--ink); }
.signup-form button { background: var(--red); color: #FFFFFF; border: 0; border-radius: 8px; padding: 0 20px; min-height: 44px; font: 500 1rem var(--f-body); cursor: pointer; }
.form-note { flex-basis: 100%; font-size: .85rem; }

/* Ad slots */
.ad-slot { max-width: 1120px; margin: 24px auto; min-height: 120px; }
.ad-slot-preview { display: grid; place-items: center; border: 1px dashed var(--muted); color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin-inline: max(16px, env(safe-area-inset-left, 0px)); }
@media (min-width: 1152px) { .ad-slot-preview { margin-inline: auto; } }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding-block: 40px 24px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid a { display: block; color: #FFFFFF; text-decoration: none; opacity: .8; padding: 2px 0; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }
.footer-grid img { height: 38px; width: auto; }
.footer-h { font-family: var(--f-body); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.site-footer .muted { color: rgba(255,255,255,.6); max-width: 40ch; }
.fine { font-size: .8rem; color: rgba(255,255,255,.45); text-align: center; margin-top: 28px; padding-top: 16px; padding-bottom: 4px; border-top: 1px solid var(--navy-2); }

/* Tool cards (hub + home) */
.tool-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-grid a { display: flex; flex-direction: column; height: 100%; padding: 20px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); }
.tool-grid a:hover { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--red); }
.tool-grid h2, .tool-grid h3 { font-size: 1.25rem; margin: 8px 0 6px; }
.tool-grid p { color: var(--muted); margin: 0; font-size: .95rem; }
.tool-k { align-self: flex-start; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--red); }
.link-card { text-decoration: none; color: var(--ink); display: block; }
.link-card:hover { border-color: var(--navy); }
.link-card p { color: var(--muted); margin: 0; }

/* Forms on tool pages */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 500; }
.field select, .plain-input { font: inherit; padding: 11px 12px; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); color: var(--ink); width: 100%; min-width: 0; }
.field .input-money { max-width: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-suffix { display: flex; align-items: center; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); }
.input-suffix input { border: 0; padding: 12px; font: 500 1.1rem var(--f-body); width: 100%; min-width: 0; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.input-suffix span { padding-right: 14px; color: var(--muted); }
.note-block { margin-top: 40px; }

/* Compare */
.compare-out { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.cmp-card, .cmp-diff { border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; background: var(--paper); min-width: 0; }
.cmp-diff { background: var(--navy); color: #FFFFFF; border-color: var(--navy); text-align: center; min-width: 200px; }
.cmp-diff .eyebrow { color: rgba(255,255,255,.65); }
.cmp-tax { font-family: var(--f-display); font-size: 2.2rem; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.cmp-card .cmp-tax { color: var(--navy); }
.cmp-sub { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.cmp-diff .cmp-sub { color: var(--blue-soft); }
.cmp-bars { display: grid; gap: 6px; margin-top: 16px; }
.cmp-bar { height: 10px; border-radius: 5px; transition: width .3s ease; }
.cmp-bar.a { background: var(--blue); } .cmp-bar.b { background: var(--red); }

/* Monthly cost */
.cost { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.cost-inputs { display: grid; gap: 16px; min-width: 0; }
.cost-result { background: var(--navy); color: #FFFFFF; border-radius: var(--radius); padding: 24px; min-width: 0; }
.cost-result .eyebrow { color: rgba(255,255,255,.65); }
.cost-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 16px 0; background: var(--navy-2); }
.seg { display: block; height: 100%; transition: width .3s ease; }
.seg.pi, .sw.pi { background: var(--blue-soft); } .seg.tax, .sw.tax { background: var(--red-bright); } .seg.ins, .sw.ins { background: #FFFFFF; }
.cost-lines { margin: 0; display: grid; gap: 8px; }
.cost-lines div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #22385A; padding-bottom: 8px; }
.cost-lines dt { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.85); }
.cost-lines dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Town page extras */
.calc-prior { font-size: .9rem; color: #FFFFFF; background: var(--navy-2); border-radius: 8px; padding: 10px 12px; }
.summary-line { color: var(--muted); max-width: 62ch; }
.calc-work.light { color: var(--muted); }

/* Rankings */
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 32px; }
.rank-block { min-width: 0; }
.rank-block h2 { font-size: 1.35rem; }
.mini-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 12px; }
.mini-lists ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.mini-lists li span { float: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Guides */
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 760px; }
.guide-list a { display: block; padding: 20px 22px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--paper); }
.guide-list a:hover { border-color: var(--navy); }
.guide-list h2 { font-size: 1.3rem; margin-bottom: 4px; }
.guide-list p { color: var(--muted); margin: 0; }
.prose .table-wrap { margin-block: 12px 18px; }

@media (max-width: 820px) {
  .explainer, .rate-layout, .calc, .two-col, .signup, .footer-grid, .cost, .compare-out { grid-template-columns: 1fr; }
  .cmp-diff { min-width: 0; }
  .hero-inner { padding-block: 44px 40px; }
  .hero-stats { gap: 28px; }
  .band { padding-block: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* State page town directory (names only, links to town and county pages) */
.town-directory { columns: 3 260px; column-gap: 32px; }
.dir-county { break-inside: avoid; margin-bottom: 22px; }
.dir-county h3 { font-size: 1.1rem; margin-bottom: 6px; }
.dir-county h3 span { font-family: var(--f-body); font-size: .8rem; color: var(--muted); }
.dir-county ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .95rem; }
.grid-more { margin-top: 16px; }

/* Layered (stack) states */
.big-rate.range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.big-rate.range i { font-family: var(--f-body); font-style: normal; font-size: 1rem; color: var(--muted); }
.big-rate.range span { flex-basis: 100%; }
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.stack-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; min-width: 0; }
.stack-card h3 { font-size: 1.2rem; }
.stack-card .data { margin-top: 14px; }
.stack-card .data th small, .data th small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.stack-card tfoot th, .stack-card tfoot td { font-weight: 700; border-top: 2px solid var(--navy); border-bottom: 0; }
.stack-card tfoot .second-rate th, .stack-card tfoot .second-rate td { font-weight: 500; border-top: 1px solid var(--rule); color: var(--muted); }
.stack-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; gap: 2px; }
.stack-bar span { display: block; min-width: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: baseline; }
.seg-county { background: var(--navy); }
.seg-municipal { background: var(--blue); }
.seg-school { background: var(--red); }
.seg-intermediate-school { background: #D9727D; }
.seg-college { background: #7FA6DC; }
.seg-hospital { background: #5A6577; }
.seg-utility { background: #C9A227; }
.seg-water { background: #3E8E9A; }
.seg-state { background: #8E7CC3; }
.seg-library { background: #9DB1CF; }
.seg-special, .seg-fire { background: #B0B8C4; }
.field-select { display: block; width: 100%; max-width: 360px; font: inherit; padding: 10px 12px; border: 1px solid var(--muted); border-radius: 8px; background: var(--paper); color: var(--ink); margin-bottom: 14px; }
.calc label + .field-select, .calc label + .input-money { margin-top: 0; }
.rises tbody th small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.full-calc { align-items: start; }
.fc-monthly { color: rgba(255,255,255,.8); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.fc-link { display: inline-block; margin-top: 8px; color: var(--blue-soft); font-weight: 500; }

/* Towns listed without counties (Connecticut, Rhode Island) */
.flat-directory { list-style: none; padding: 0; margin: 16px 0 24px; columns: 4 200px; column-gap: 32px; }
.flat-directory li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; font-size: 15px; }
.flat-directory span { color: var(--muted); font-variant-numeric: tabular-nums; }

.rises td small { display: block; font-size: .75rem; color: var(--muted); }

.newer-rate { margin: 12px 0 0; padding: 10px 12px; background: var(--paper-2); border-left: 3px solid var(--red); font-size: .9rem; }

/* State guides */
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.guide-toc { position: sticky; top: 24px; font-size: .9rem; }
.guide-toc ol { margin: 8px 0 16px; padding-left: 18px; display: grid; gap: 6px; }
.guide-toc-cta { border-top: 1px solid var(--rule); padding-top: 12px; }
.guide-body h2 { margin-top: 2.2em; scroll-margin-top: 16px; }
.guide-body h2:first-child { margin-top: 0; }
.source-list { font-size: .92rem; display: grid; gap: 6px; }
.keyfacts dd.small-dd { font-size: 1.05rem; font-family: var(--f-body); line-height: 1.35; }
.fact-table td, .fact-table th { vertical-align: top; }
@media (max-width: 860px) {
  .guide-layout { grid-template-columns: 1fr; gap: 16px; }
  .guide-toc { position: static; background: var(--paper-2); border-radius: var(--radius); padding: 14px 16px; }
}

.guide-link { font-size: 1.02rem; margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--radius); max-width: 80ch; }
.guide-link a { font-weight: 700; }

.guide-layout > * { min-width: 0; }
.stack-grid > * { min-width: 0; }
.stack-card { overflow-x: auto; }

.fact-table { width: 100%; }
.fact-table th, .fact-table td { white-space: normal; }
.fact-table th { width: 38%; }

/* Units states (Texas): county pages with an add-up tool */
.units-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.units-layout > * { min-width: 0; }
.units-h { margin-top: 1.6em; font-size: 1.35rem; }
.units-h:first-child { margin-top: 0; }
.units-h span { font-family: var(--f-body); font-size: .85rem; color: var(--muted); margin-left: 6px; }
.units-table .tick { width: 36px; text-align: center; }
.units-table th small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; white-space: normal; }
.addup-box { position: sticky; top: 16px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; }
.addup-box h2 { color: #fff; font-size: 1.3rem; }
.addup-box .muted { color: rgba(255,255,255,.7); }
.addup-box label { color: rgba(255,255,255,.85); }
.addup-rate { font-family: var(--f-display); font-size: 1.6rem; margin: 14px 0 0; }
.addup-rate small { font-family: var(--f-body); font-size: .8rem; color: rgba(255,255,255,.7); }
.addup-box .calc-out { color: #fff; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (max-width: 860px) {
  .units-layout { grid-template-columns: 1fr; }
  .addup-box { position: sticky; bottom: 0; top: auto; order: 2; }
}

/* Bill builder (Texas) */
.addup { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; margin-top: 16px; }
.addup-pick { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 18px 16px; max-height: 640px; overflow-y: auto; }
.addup-h { font-size: 1.05rem; margin: 16px 0 6px; }
.addup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.addup-list label { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; cursor: pointer; font-size: .93rem; }
.addup-list .nm { flex: 1; }
.addup-list .nm small { display: block; color: var(--muted); font-size: .75rem; }
.addup-list .rt { font-variant-numeric: tabular-nums; color: var(--muted); }
.addup-more { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 8px; }
.addup-more summary { cursor: pointer; font-weight: 600; }
.addup-more summary span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.addup-break { width: 100%; margin: 6px 0 10px; font-size: .85rem; border-collapse: collapse; }
.addup-break th { text-align: left; font-weight: 400; color: rgba(255,255,255,.85); padding: 3px 0; }
.addup-break td { text-align: right; padding: 3px 0; }
@media (max-width: 860px) {
  .addup { grid-template-columns: 1fr; }
  .addup-pick { max-height: 420px; }
  .addup-box { position: static; }
}

.county-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; max-width: 640px; }
.county-pick label { flex-basis: 100%; }
.county-pick select { flex: 1; min-width: 220px; }

.addup-box .calc-out { font-size: 2.1rem; line-height: 1.15; }

/* Header: same layout as millrate.ca. Full width, logo hard left, links hard right, 64px tall. */
.site-header { background: var(--navy); border-bottom: 1px solid var(--navy-2); display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 2rem; position: sticky; top: 0; z-index: 100; }
.logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo img { display: block; height: 44px; width: auto; }
.main-nav { display: flex; gap: 1.5rem; align-items: center; }
.main-nav a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .9rem; transition: color .2s; }
.main-nav a:hover { color: #FFFFFF; }
/* Tools dropdown: opens on hover with a mouse, on tap or Enter otherwise (matches millrate.ca) */
.nav-drop { position: relative; }
.nav-dt { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: .9rem; color: rgba(255,255,255,.7); display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.nav-dt:hover, .nav-drop.open .nav-dt { color: #FFFFFF; }
.nav-dt .car { font-size: .7rem; transition: transform .18s; }
.nav-drop.open .car { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 14px); right: -12px; min-width: 290px; background: #FFFFFF; border: 1px solid #E2E8EF; border-radius: 10px;
  box-shadow: 0 14px 38px rgba(11,24,41,.22); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 120; }
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }   /* hover bridge across the gap */
.nav-drop.open .nav-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 901px) { .nav-drop:hover .nav-menu { opacity: 1; visibility: visible; transform: none; } .nav-drop:hover .car { transform: rotate(180deg); } .nav-drop:hover .nav-dt { color: #FFFFFF; } }
.main-nav .nav-menu a { display: block; padding: 9px 11px; border-radius: 7px; color: var(--navy); font-size: .9rem; font-weight: 500; line-height: 1.3; }
.main-nav .nav-menu a span { display: block; font-size: .76rem; font-weight: 400; color: #6B7A8D; margin-top: 2px; }
.main-nav .nav-menu a:hover { background: var(--paper-2); color: var(--navy); }
.main-nav .nav-menu a.nav-all { color: var(--blue); font-size: .82rem; border-top: 1px solid #E2E8EF; border-radius: 0 0 7px 7px; margin-top: 4px; }
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; flex-direction: column; gap: 5px; width: 40px; }
.nav-burger span { display: block; height: 2px; background: rgba(255,255,255,.85); border-radius: 2px; transition: transform .18s, opacity .18s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 900px) {
  .site-header { padding: 0 1.1rem; }
  .nav-burger { display: flex; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem 1.1rem 1.1rem; border-top: 1px solid rgba(255,255,255,.09); }
  .main-nav.on { display: flex; }
  .main-nav a { padding: .75rem .2rem; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.07); }
  .nav-dt { width: 100%; justify-content: space-between; padding: .75rem .2rem; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.07); }
  .nav-menu { position: static; display: none; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0 0 0 .9rem; opacity: 1; visibility: visible; transform: none; transition: none; }
  .nav-menu::before { display: none; }
  .nav-drop.open .nav-menu { display: block; }
  .main-nav .nav-menu a { color: rgba(255,255,255,.75); border-radius: 0; padding: .65rem .2rem; border-bottom: 1px solid rgba(255,255,255,.07); }
  .main-nav .nav-menu a span { color: rgba(255,255,255,.45); }
  .main-nav .nav-menu a:hover { background: none; color: #FFFFFF; }
  .main-nav .nav-menu a.nav-all { color: var(--blue-soft); border-top: 0; margin-top: 0; }
}

/* State page finder and county table */
.finder { max-width: 640px; margin: 8px 0 20px; }
.finder-label { display: block; font-weight: 600; margin-bottom: 6px; }
.finder-box { position: relative; }
.finder-box input { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px 12px 40px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A6577' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.finder-box input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.finder-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; list-style: none; margin: 0; padding: 6px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 14px 38px rgba(11,24,41,.18); }
.finder-results a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.finder-results a span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.finder-results li.on a, .finder-results a:hover { background: var(--paper-2); }
.finder-results li.none { padding: 9px 10px; color: var(--muted); }
.scroll-box { max-height: 480px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.scroll-box .data { border: 0; margin: 0; }
.scroll-box thead th { position: sticky; top: 0; z-index: 1; background: var(--paper-2); }
.filter-empty { padding: 14px 16px; margin: 0; }
.az-list { margin: 20px 0; }
.az-list summary { cursor: pointer; font-weight: 600; padding: 8px 0; }

.finder + .table-note, .scroll-box { margin-bottom: 24px; }
.scroll-box + .az-list, .scroll-box + .guide-link, .az-list + .guide-link { margin-top: 24px; }

.hero-sources { margin: 22px auto 0; max-width: 70ch; font-size: .85rem; color: rgba(255,255,255,.55); }

.hero-stats .of { font-family: var(--f-body); font-size: 1rem; color: rgba(255,255,255,.6); margin-left: 4px; }

/* Contact page */
.contact-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; }
.contact-card { background: var(--paper-2); border-radius: var(--radius); padding: 22px; }
.contact-cards { display: grid; gap: 16px; }
.contact-card h2 { font-size: 1rem; margin: 0 0 2px; }
.contact-email { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; margin: 4px 0 8px; }
.fine a { color: rgba(255,255,255,.6); }
.fine-2 { display: block; margin-top: 6px; }
.footer-sister { margin-top: 14px; color: rgba(255,255,255,.6); }
.footer-grid .footer-sister a { display: inline; opacity: 1; text-decoration: underline; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; gap: 24px; } }

.finder-results li.nolink > span { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; color: var(--muted); }
.finder-results li.nolink span span { font-size: .85rem; }
.state-card[hidden] { display: none; }
