/* MeterMath. Layout: inputs on the left; the result is a yellow appliance-style energy label on the right,
   with heavy black rules, one big number, and a range bar placing the estimate among all 50 states. */
:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #585654;
  --rule: #111111;
  --hair: #d9d6cf;
  --field: #ffffff;
  --label: #ffd60a;      /* the sticker; same in both themes */
  --label-ink: #111111;
  --label-hair: rgba(17, 17, 17, 0.28);
  --loss: #c3161c;
  --focus: #0050d8;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --s-1: 0.875rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.75rem;
  --s3: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151514; --ink: #f1efe9; --muted: #aaa69d; --rule: #f1efe9; --hair: #3a3936; --field: #1d1d1b;
    --loss: #ff6b5f; --focus: #73b3ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151514; --ink: #f1efe9; --muted: #aaa69d; --rule: #f1efe9; --hair: #3a3936; --field: #1d1d1b;
  --loss: #ff6b5f; --focus: #73b3ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: var(--s0); line-height: 1.55; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num, .amt, td.n { font-variant-numeric: tabular-nums; }

/* Header */
.site-head { border-bottom: 3px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-block: 14px; }
.brand { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 1.6rem; letter-spacing: -0.01em; line-height: 1; text-decoration: none; color: var(--ink); display: inline-flex; align-items: baseline; }
.brand b { font-weight: 800; background: var(--label); color: var(--label-ink); padding: 2px 5px 1px; margin-left: 2px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-weight: 700; font-size: var(--s-1); }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--hair); }
.nav a[aria-current="page"] { border-bottom-color: var(--label); }

/* Type */
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: var(--s3); font-weight: 800; font-stretch: 78%; line-height: 0.98; letter-spacing: -0.015em; max-width: 18ch; }
h2 { font-size: var(--s2); font-weight: 800; font-stretch: 82%; line-height: 1.05; }
h3 { font-size: var(--s1); font-weight: 700; font-stretch: 90%; line-height: 1.2; }
.intro { padding-block: 36px 4px; display: grid; gap: 14px; }
.deck { max-width: 60ch; margin: 0; font-size: 1.15rem; line-height: 1.5; }
.dateline { margin: 0; font-size: var(--s-1); color: var(--muted); }
.dateline b { color: var(--ink); }

/* Calculator layout */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-block: 28px 48px; }
@media (max-width: 860px) { .calc { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

.inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 700; font-size: var(--s-1); }
.hint, .source-note { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.source-note button { font: inherit; color: var(--ink); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 440px) { .row2 { grid-template-columns: minmax(0, 1fr); } }

.control { display: flex; align-items: stretch; height: 48px; border: 2px solid var(--rule); background: var(--field); }
.control:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.control .unit { display: flex; align-items: center; padding: 0 12px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.control .unit:first-child { padding-right: 0; color: var(--ink); font-weight: 700; }
.control input, .control select {
  flex: 1 1 0; width: 0; min-width: 0; height: 100%; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-family: var(--display); font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 0 12px; outline: none;
}
.control select { font-family: var(--body); font-size: 1rem; font-weight: 700; cursor: pointer; }
.control input::-webkit-outer-spin-button, .control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.control input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.segmented { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--rule); }
@media (max-width: 480px) { .segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { text-align: center; padding: 11px 6px; font-weight: 700; font-size: 0.9rem; cursor: pointer; background: var(--field); box-shadow: inset -1px -1px 0 var(--hair); }
.segmented input:checked + label { background: var(--ink); color: var(--paper); box-shadow: none; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }

details.more { border-top: 2px solid var(--rule); padding-top: 14px; }
details.more summary { cursor: pointer; font-weight: 700; font-size: var(--s-1); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 120ms; }
details.more[open] summary::before { transform: rotate(45deg); }
details.more .inputs { margin-top: 16px; }

/* The label */
.label-card {
  background: var(--label); color: var(--label-ink); border: 3px solid var(--label-ink);
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px);
  --ink: var(--label-ink);
}
@media (max-width: 860px) { .label-card { position: static; } }
.lb-head { display: flex; justify-content: space-between; align-items: end; gap: 6px 14px; flex-wrap: wrap; padding: 12px 16px 10px; border-bottom: 8px solid var(--label-ink); }
.lb-title { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 1.55rem; line-height: 1; margin: 0; }
.lb-where { font-weight: 700; font-size: 0.85rem; }
.verdict { padding: 14px 16px 4px; }
.verdict .kicker { margin: 0; font-weight: 700; font-size: 1rem; }
.verdict .big { margin: 2px 0 0; font-family: var(--display); font-weight: 900; font-stretch: 85%; font-size: clamp(3.2rem, 2.2rem + 4vw, 4.6rem); line-height: 0.95; letter-spacing: -0.02em; }
.verdict .big.neg { color: var(--loss); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .verdict .big.neg { color: #b3121a; } }
:root[data-theme="dark"] .verdict .big.neg { color: #b3121a; }
.verdict .sub { margin: 8px 0 0; font-size: 0.9rem; }

.range { padding: 10px 16px 14px; }
.range .cap { font-size: 0.78rem; margin: 0 0 22px; }
.range .bar { position: relative; height: 10px; border: 2px solid var(--label-ink); background: linear-gradient(90deg, rgba(17,17,17,0.08), rgba(17,17,17,0.32)); }
.range .ptr { position: absolute; top: -21px; transform: translateX(-50%); font-size: 0.7rem; font-weight: 700; white-space: nowrap; display: grid; justify-items: center; }
.range .ptr::after { content: ""; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--label-ink); margin-top: 1px; }
.range .ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 0.78rem; }
.range .ends span:last-child { text-align: right; }
.range .ends b { font-family: var(--display); font-size: 1rem; font-weight: 800; display: block; }

.lines { list-style: none; margin: 0; padding: 0 16px; border-top: 3px solid var(--label-ink); }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--label-hair); }
.lines li:last-child { border-bottom: 0; }
.lines .what { min-width: 0; font-weight: 600; }
.lines .what small { display: block; font-weight: 400; font-size: 0.78rem; }
.lines .amt { font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.lines li.total { border-bottom: 3px solid var(--label-ink); }
.lines li.total .what { font-weight: 800; }
.lines li.total .amt { font-weight: 900; font-size: 1.2rem; }
.lines li.gap { display: none; }
.amt.neg { color: #b3121a; }
.callout { margin: 0; padding: 12px 16px; border-bottom: 3px solid var(--label-ink); font-size: 0.92rem; }
.lb-foot { margin: 0; padding: 10px 16px 12px; font-size: 0.75rem; }

.chart { padding: 10px 16px 4px; border-bottom: 3px solid var(--label-ink); }
.chart .cap { font-size: 0.78rem; font-weight: 700; margin: 0 0 4px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--label-ink); stroke-width: 1; opacity: 0.18; }
.chart .zero { stroke: var(--label-ink); stroke-width: 1.5; }
.chart .line { fill: none; stroke: var(--label-ink); stroke-width: 3; stroke-linejoin: round; }
.chart .area { fill: var(--label-ink); opacity: 0.1; }
.chart .dot { fill: var(--label); stroke: var(--label-ink); stroke-width: 3; }
.chart text { fill: var(--label-ink); font-family: var(--body); font-size: 11px; }
.chart text.callout-label { font-weight: 700; font-size: 12px; }

.cta { margin: 0; padding: 14px 16px; border-bottom: 3px solid var(--label-ink); display: grid; gap: 8px; }
.cta a.btn { justify-self: start; background: var(--label-ink); color: var(--label); text-decoration: none; font-weight: 800; padding: 11px 16px; }
.disclosure { font-size: 0.72rem; }
.ad-slot { margin-block: 28px; min-height: 100px; }

/* Phone result bar */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 0; border-top: 3px solid var(--label-ink); background: var(--label); color: var(--label-ink); font: inherit; text-align: left; cursor: pointer;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.mini .txt { min-width: 0; font-weight: 700; line-height: 1.2; }
.mini .txt b { font-family: var(--display); font-weight: 900; font-size: 1.4rem; display: block; }
.mini .txt b.neg { color: #b3121a; }
.mini .go { font-weight: 800; font-size: 0.85rem; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 861px) { .mini { display: none; } }

/* Article */
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 0 24px; }
.article::before { content: ""; height: 3px; background: var(--rule); }
.article > * { min-width: 0; }
.article section { max-width: 66ch; display: grid; gap: 12px; }
.article p, .article ul { margin: 0; }
.article ul { padding-left: 1.2em; display: grid; gap: 6px; }
.formula { font-family: var(--code); font-size: 0.85rem; line-height: 1.6; border-left: 6px solid var(--label); background: var(--field); padding: 12px 14px; overflow-x: auto; white-space: pre; }
.faq { gap: 22px !important; }
.faq > div { display: grid; gap: 4px; }

/* Table */
.table-wrap { overflow: auto; max-height: 520px; border-top: 3px solid var(--rule); border-bottom: 3px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--hair); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--paper); font-weight: 800; font-size: 0.8rem; border-bottom: 2px solid var(--rule); }
td.n, th.n { text-align: right; }
td.n { font-family: var(--display); font-weight: 600; }
tr.here td { background: var(--label); color: var(--label-ink); font-weight: 800; }

/* Home */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.picker .control { flex: 0 1 300px; min-width: 0; }
.picker .rate-read { font-size: 0.95rem; }
.picker .rate-read b { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.tools { display: grid; border-top: 3px solid var(--rule); margin-block: 28px 10px; }
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, auto); grid-template-areas: "txt quick" "go quick"; gap: 14px 32px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.tool h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.tool p { margin: 6px 0 0; color: var(--muted); max-width: 56ch; }
.tool { position: relative; transition: background-color 120ms ease; }
.tool .txt { grid-area: txt; min-width: 0; }
.tool .quick { grid-area: quick; }
.tool .go { grid-area: go; justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 0.9rem; }
.tool .go span { transition: transform 120ms ease; }
.tool:hover, .tool:focus-visible { --wash: color-mix(in srgb, var(--label) 22%, var(--paper)); background: var(--wash); box-shadow: -12px 0 0 var(--wash), 12px 0 0 var(--wash); }
.tool:hover .go, .tool:focus-visible .go { background: var(--label); color: var(--label-ink); }
.tool:hover .go span, .tool:focus-visible .go span { transform: translateX(4px); }
.tool:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .tool, .tool .go span { transition: none; } }
.tool .quick { text-align: right; font-size: 0.85rem; font-weight: 700; }
.tool .quick b { display: block; font-family: var(--display); font-weight: 900; font-stretch: 85%; font-size: 2.4rem; line-height: 1; }
.tool .quick b.neg { color: var(--loss); }
@media (max-width: 600px) { .tool { grid-template-columns: minmax(0, 1fr); grid-template-areas: "txt" "quick" "go"; } .tool .quick { text-align: left; } }

/* Footer and prose */
.site-foot { border-top: 3px solid var(--rule); margin-top: 32px; padding-block: 22px 40px; font-size: 0.85rem; color: var(--muted); }
.site-foot .wrap { display: grid; gap: 8px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 700; }
.site-foot nav a { color: var(--ink); text-decoration: none; }
.prose { padding-block: 36px 24px; max-width: 66ch; display: grid; gap: 14px; }
.prose p, .prose ul { margin: 0; }
.prose h2 { margin-top: 14px; }
@media (max-width: 860px) { .site-foot { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { details.more summary::before { transition: none; } }

/* State pages */
.crumbs { margin: 0; font-size: var(--s-1); font-weight: 700; }
.crumbs a { text-decoration: none; border-bottom: 3px solid var(--label); }
.crumbs span { color: var(--muted); margin: 0 4px; }
.answer { margin: 0; max-width: 60ch; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding-block: 12px; border-top: 3px solid var(--rule); border-bottom: 3px solid var(--rule); font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
.answer .figure { font-family: var(--display); font-weight: 900; font-stretch: 85%; font-size: clamp(2.6rem, 2rem + 2.6vw, 3.6rem); line-height: 0.95; letter-spacing: -0.02em; white-space: nowrap; }
.answer .figure.neg { color: var(--loss); }
.answer span { flex: 1 1 24ch; min-width: 0; }
.see { list-style: none; padding: 0 !important; gap: 0 !important; border-top: 3px solid var(--rule); }
.see li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.see a { font-weight: 800; }
.article .source-note { padding-left: 1.2em; }
.state-links { list-style: none; padding: 0 !important; display: block !important; columns: 3 160px; column-gap: 24px; }
.state-links li { padding: 3px 0; break-inside: avoid; }
td .go { display: flex; gap: 12px; margin-top: 2px; font-size: 0.78rem; font-weight: 700; }
