:root {
  --bg: #f6f3ee;                /* warm off-white page */
  --surface: #ffffff;
  --surface-2: #faf8f4;         /* tinted panels inside cards */
  --input-bg: #ffffff;
  --text: #0f1b2d;
  --muted: #5d6b7e;
  --rule: #e4dfd6;
  --rule-strong: #cfc8bc;
  --accent: #1f5fd1;
  --accent-hover: #174cab;
  --accent-text: #ffffff;
  --accent-soft: #eaf1fd;
  --brand: #f26a1b;             /* logo orange */
  --brand-soft: #fff0e4;
  --good: #11804a;
  --warn-bg: #fff4d6;
  --warn-text: #6a4a00;
  --est-bg: #eef0f4;
  --est-text: #3d4651;
  --tag-bg: #f3edfc;
  --tag-text: #5531a0;
  --error: #b42318;
  --new: #6a2fb0;               /* "Added on" plan notes */
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05), 0 8px 24px -12px rgba(15, 27, 45, 0.18);
  --shadow-lg: 0 2px 4px rgba(15, 27, 45, 0.06), 0 24px 48px -20px rgba(15, 27, 45, 0.35);
  --radius: 16px;
  --hero-from: #0c2142;         /* navy hero behind the logo */
  --hero-to: #173a6b;
  --hero-glow: rgba(242, 106, 27, 0.35);
  --header-text: #ffffff;
  --header-muted: #c9d6ea;
  --thead-bg: #f4f0e9;           /* plan table's column headings, usage strip */
  --tip-bg: #0f1b2d;
  --tip-text: #ffffff;
  --arrow-top: #f26a1b;            /* usage modal's Easiest / Most Accurate arrow */
  --arrow-bottom: #1f5fd1;
  --arrow-text: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220;
    --surface: #121c2e;
    --surface-2: #17233a;
    --input-bg: #0e1727;
    --text: #e8eef7;
    --muted: #9aabc3;
    --rule: #24324a;
    --rule-strong: #344563;
    --accent: #7fb0ff;
    --accent-hover: #a5c8ff;
    --accent-text: #0a1220;
    --accent-soft: #172b4d;
    --brand: #ff8a3d;
    --brand-soft: #3a2310;
    --good: #6ddba0;
    --warn-bg: #4a3608;
    --warn-text: #ffdf8a;
    --est-bg: #22304a;
    --est-text: #d3ddeb;
    --tag-bg: #33244f;
    --tag-text: #dccbff;
    --error: #ff9a8f;
    --new: #d3b2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
    --hero-from: #071021;
    --hero-to: #0f2547;
    --hero-glow: rgba(255, 138, 61, 0.25);
    --header-text: #ffffff;
    --header-muted: #a9bad3;
    --thead-bg: #1a2740;
    --tip-bg: #e8eef7;
    --tip-text: #0a1220;
    --arrow-top: #c9561a;
    --arrow-bottom: #2f6fd6;
    --arrow-text: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #121c2e; --surface-2: #17233a; --input-bg: #0e1727; --text: #e8eef7; --muted: #9aabc3; --rule: #24324a; --rule-strong: #344563;
  --accent: #7fb0ff; --accent-hover: #a5c8ff; --accent-text: #0a1220; --accent-soft: #172b4d; --brand: #ff8a3d; --brand-soft: #3a2310; --good: #6ddba0;
  --warn-bg: #4a3608; --warn-text: #ffdf8a; --est-bg: #22304a; --est-text: #d3ddeb; --tag-bg: #33244f; --tag-text: #dccbff; --error: #ff9a8f; --new: #d3b2ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  --hero-from: #071021; --hero-to: #0f2547; --hero-glow: rgba(255, 138, 61, 0.25); --header-text: #ffffff; --header-muted: #a9bad3; --thead-bg: #1a2740;
  --tip-bg: #e8eef7; --tip-text: #0a1220; --arrow-top: #c9561a; --arrow-bottom: #2f6fd6; --arrow-text: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { position: relative; overflow: hidden; color: var(--header-text);
  background: radial-gradient(60rem 22rem at 12% 0%, var(--hero-glow), transparent 70%), linear-gradient(135deg, var(--hero-from), var(--hero-to)); }
/* Faint grid, like a utility map, behind the hero. */
.top::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%); }
.top .wrap { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 20px; padding-bottom: 22px; }
/* Home page: room for the lookup card to overlap the hero. */
body:has(main > .lookup:first-child) .top .wrap { padding-bottom: 76px; }
/* The logo carries the site name (alt text for screen readers). */
.top h1 { margin: 0; line-height: 0; }
.top h1 img, .top .logo img { display: block; width: auto; height: 112px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); }
.hero-text { flex: 1 1 22rem; min-width: 0; }
.tagline { margin: 0; font-size: clamp(1.35rem, 1rem + 1.4vw, 2.1rem); line-height: 1.2; font-weight: 750; letter-spacing: -0.02em; color: var(--header-text);
  text-wrap: balance; }
.tagline em { font-style: normal; color: #ffb27a; }
.promises { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.promises li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  color: var(--header-muted); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); }
.promises li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: #ffb27a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230c2142' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
@media (max-width: 420px) { .profile-opts button { padding: 5px 8px; font-size: 0.78rem; } }
@media (max-width: 600px) {
  .top .wrap { gap: 10px 16px; padding-top: 14px; padding-bottom: 16px; flex-wrap: nowrap; }
  body:has(main > .lookup:first-child) .top .wrap { padding-bottom: 58px; }
  .top h1 img, .top .logo img { height: 72px; }
  .promises { display: none; }
}
/* Shown only to a signed-in admin (app.js asks /_auth/me). */
.admin-link { position: absolute; top: 14px; right: 16px; font-weight: 600; font-size: 0.85rem; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px; color: var(--header-text); text-decoration: none; white-space: nowrap; background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(6px); }
.admin-link:hover { color: var(--header-text); background: rgba(255, 255, 255, 0.18); }

/* Lookup form */
.lookup { position: relative; display: grid; grid-template-columns: 11rem 1fr; gap: 18px 32px; align-items: start;
  margin: 22px 0 20px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
main > .lookup:first-child { margin-top: -54px; }
@media (max-width: 600px) { main > .lookup:first-child { margin-top: -40px; } }
.field label { display: block; font-weight: 650; margin-bottom: 6px; }
.field output { font-variant-numeric: tabular-nums; }
#zip { width: 100%; font-family: inherit; font-size: 1.35rem; font-weight: 650; line-height: 1.2; padding: 11px 14px; border: 1.5px solid var(--rule-strong); border-radius: 12px;
  background: var(--input-bg); color: var(--text); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; transition: border-color 0.15s, box-shadow 0.15s; }
#zip::placeholder { color: var(--muted); opacity: 0.55; }
#zip:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* Usage (assets/usage.js): the main-page block and the modal. */
/* "Just looking around?" zips under the no-plans message. */
.sample-zips-box { margin-top: 10px; color: var(--text); font-weight: 400; }
.sample-zips-box p { margin: 0 0 4px; }
.sample-zips { margin: 0; padding-left: 20px; columns: 2 16em; font-size: 0.9rem; }
.sample-zips li { margin: 2px 0; }
.sample-zips .reset { font-size: inherit; font-weight: 600; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 6px; }
.usage-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.usage-method { font-weight: 600; }
.usage-avg { font-weight: 400; color: var(--muted); }
.usage-avg strong { color: var(--text); }
.field .usage-label { font-weight: 400; margin-bottom: 4px; }
.avg-slider input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
.kwh-box { width: 6.2em; font: inherit; font-variant-numeric: tabular-nums; padding: 5px 7px; border: 1px solid var(--rule-strong); border-radius: 8px;
  background: var(--input-bg); color: var(--text); }
.field .usage-hl label, .field .month-box { font-weight: 400; margin: 0; }
.usage-hl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0; }
.usage-months, .um-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month-box { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--muted); }
.month-box .kwh-box { width: 100%; padding: 5px 4px; }
@media (max-width: 1000px) { .usage-months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 480px) { .usage-months { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Usage profile: three buttons that work like radio buttons. */
.profile { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; font-size: 0.85rem; }
.profile-label { color: var(--muted); }
/* Segmented control */
.profile-opts { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 10px; background: var(--thead-bg); }
.profile-opts button { font: inherit; font-size: 0.82rem; padding: 5px 12px; white-space: nowrap; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.profile-opts button:hover { color: var(--text); }
.profile-opts button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: 0 1px 3px rgba(15, 27, 45, 0.15); }
.profile-opts button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.usage-modal { width: min(940px, calc(100vw - 16px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--rule); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45); }
.usage-modal[open] { display: flex; flex-direction: column; animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .usage-modal[open] { animation: none; } }
.usage-modal::backdrop { background: rgba(8, 15, 28, 0.55); backdrop-filter: blur(3px); }
.um-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--rule); }
.um-head h2 { flex: 1; margin: 0; font-size: 1.2rem; }
.um-x { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: var(--thead-bg); border: 0; border-radius: 50%; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0; }
.um-x:hover { color: var(--text); background: var(--rule); }
.um-body { position: relative; flex: 1; display: flex; gap: 10px; padding: 12px 0 12px 10px; overflow: hidden; min-height: 0; }
/* While more options are below: a fade over the bottom of the list and a "More below" button. */
.um-more { position: absolute; left: 84px; right: 18px; bottom: 0; height: 64px; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px; background: linear-gradient(to bottom, transparent, var(--surface) 70%); pointer-events: none; }
.um-more[hidden] { display: none; }
.um-more button { pointer-events: auto; font: inherit; font-size: 0.85rem; font-weight: 600; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; box-shadow: var(--shadow); }
.um-more button:hover { background: var(--accent-soft); }
/* Arrows down the left: 90% of the height, labels inside near the heads. */
.um-arrows { flex: 0 0 64px; display: flex; align-items: center; }

/* One two-headed arrow, nearly the full height: Easiest at the top, Most Accurate at the bottom. */
.um-arrow { height: 98%; width: 100%; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 44px 0; background: linear-gradient(to bottom, var(--arrow-top), var(--arrow-bottom)); color: var(--arrow-text);
  font-weight: 800; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase;
  clip-path: polygon(50% 0, 100% 38px, 76% 38px, 76% calc(100% - 38px), 100% calc(100% - 38px), 50% 100%, 0 calc(100% - 38px),
    24% calc(100% - 38px), 24% 38px, 0 38px); }
.um-arrow span { writing-mode: vertical-rl; white-space: nowrap; }
.um-arrow .um-arrow-top { transform: rotate(180deg); }
/* Only the options scroll; the arrows stay the height of the visible area. */
.um-options { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 2px 18px 2px 2px; }
.um-opt { display: flex; gap: 14px; padding: 12px 14px; border: 2px solid transparent; border-radius: 14px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.um-opt:hover { background: var(--accent-soft); }
.um-opt.selected { border-color: var(--accent); background: var(--accent-soft); cursor: default; }
.um-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.um-opt.um-soon { cursor: default; }
.um-opt.um-soon:hover { background: none; }
.um-num { flex: 0 0 auto; width: 1.4em; font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--accent); text-align: center; }
.um-content { flex: 1; min-width: 0; }
.um-content h3 { margin: 2px 0 2px; font-size: 1.02rem; }
.um-desc { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); }
.um-value { margin: 6px 0; font-size: 0.9rem; }
.um-inline { display: block; margin-top: 4px; font-size: 0.85rem; }
.um-hl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0; font-size: 0.9rem; }
.um-hl select { font: inherit; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--input-bg); color: var(--text); }
.um-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 560px) { .um-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.um-chart-wrap { touch-action: none; }
.um-chart { width: 100%; height: auto; display: block; user-select: none; }
.um-chart .grid { stroke: var(--rule); }
.um-chart .axis { fill: var(--muted); font-size: 11px; }
.um-chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.um-chart .dot { fill: var(--accent); }
.um-chart .handle { cursor: grab; outline: none; }
.um-chart .handle circle { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.um-chart .handle:focus circle, .um-chart .handle:hover circle { fill: var(--accent-soft); stroke-width: 4; }
.um-chart .handle-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.um-tag { font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--est-bg); color: var(--est-text); vertical-align: middle; }
.um-steps { margin: 4px 0 6px; padding-left: 20px; font-size: 0.88rem; }
.um-steps li { margin: 3px 0; }
.um-register { font-size: 0.85rem; }
.um-register summary { color: var(--accent); cursor: pointer; width: fit-content; }
.um-register ul, .um-register ol { padding-left: 20px; }
.um-status p { margin: 6px 0; font-size: 0.88rem; }
.um-note { color: var(--muted); }
.um-error { color: var(--error); font-weight: 600; }
.usage-meter { margin: 2px 0 0; font-size: 0.9rem; }
/* Meter data more than 30 days old: suggest loading a fresh copy. */
.usage-stale, .um-stale { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.85rem; }
.um-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 18px; background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }
.um-confirm[hidden] { display: none; }
.um-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--rule); background: var(--surface-2);
  border-radius: 0 0 20px 20px; }
@media (max-width: 560px) {
  .um-options { padding-right: 10px; }
  .um-arrows { flex-basis: 44px; }
  .um-more { left: 58px; right: 10px; }
  .um-arrow { font-size: 0.78rem; letter-spacing: 0.03em; padding: 34px 0;
    clip-path: polygon(50% 0, 100% 28px, 76% 28px, 76% calc(100% - 28px), 100% calc(100% - 28px), 50% 100%, 0 calc(100% - 28px),
      24% calc(100% - 28px), 24% 28px, 0 28px); }
  .um-opt { gap: 8px; padding: 10px 8px; }
  .um-num { font-size: 1.9rem; }
}
.kwh-ticks { font-size: 0.75rem; margin-top: -2px; }
@media (max-width: 420px) { .kwh-ticks { font-size: 0.65rem; } .kwh-ticks button { padding: 2px 1px; } }
.hint { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
/* Estimated usage: every month on wide screens, winter/summer on narrow ones. */
.zip-col .btn { width: 100%; margin-top: 12px; }
/* Estimated usage sits in its own box, colored like the plan list's header. */
.est-usage { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 9px 14px; border-radius: 12px; background: var(--thead-bg); border: 1px solid var(--rule); }
.est-label { line-height: 1.2; padding-top: 1px; }
.est-cells { flex: 1; display: flex; justify-content: space-between; gap: 4px; }
.est-cell { display: flex; flex-direction: column; align-items: center; line-height: 1.2; font-variant-numeric: tabular-nums; }
.est-cell b { font-weight: 600; color: var(--text); font-size: 0.8rem; }
.est-cell small { font-size: 0.72rem; }
.by-season { display: none; }
@media (max-width: 1000px) { .by-month { display: none; } .by-season { display: flex; } .est-usage { flex-wrap: wrap; gap: 2px 10px; } .est-label { flex-basis: 100%; } }
.plans thead th .unit { text-transform: none; }
.btn { display: inline-block; font-family: inherit; font-size: 0.95rem; font-weight: 650; line-height: 1; padding: 12px 20px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15); transition: background 0.15s, transform 0.1s, box-shadow 0.15s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--accent); border-color: var(--rule-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 8px 14px; font-size: 0.88rem; border-radius: 10px; }
/* The main call to action in logo orange (deep enough for white text in both themes). */
#lookup .zip-col .btn { padding: 14px 20px; font-size: 1rem; background: #d9560c; border-color: #d9560c; color: #fff; }
#lookup .zip-col .btn:hover { filter: brightness(1.06); }
.linkish { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }

.status { min-height: 1.5em; margin: 6px 0 10px; color: var(--muted); }
.status:empty { min-height: 0; margin: 0; }   /* no message: no gap above the results */
.status.error { color: var(--error); font-weight: 600; }
.notice { background: var(--accent-soft); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 16px; }
.notice p { margin: 0 0 10px; }
.tdu-options { display: flex; flex-wrap: wrap; gap: 8px; }

/* Results: filters on the left, plans on the right */
.results { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 48px; }
.filters { position: sticky; top: 12px; z-index: 10; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 12px 14px; box-shadow: var(--shadow); }
/* Same look as the plan table's column headings. */
.filters-head { display: flex; align-items: center; gap: 12px; margin: -12px -12px 0; padding: 12px 14px;
  background: var(--thead-bg); border-bottom: 1px solid var(--rule); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.filters-head .filters-close { margin-left: auto; }
.reset { font: inherit; font-size: 0.85rem; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.filters h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0; color: var(--muted); }
/* Each section gets a line all the way around so the groups stand apart. */
.filters fieldset { border: 1px solid var(--rule); border-radius: 12px; margin: 12px 0 0; padding: 8px 10px 10px; background: var(--surface-2); }
.filters legend { font-weight: 650; font-size: 0.88rem; padding: 0 6px; margin: 0 0 0 -6px; }
/* Options start right under their heading; the space goes above the next heading. */
.filters fieldset > legend + *, .filters fieldset > legend + * > :first-child { margin-top: 0; }
.filters label { display: block; font-size: 0.9rem; margin: 5px 0; }
.filters input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; margin: 0 6px 0 0; }
.filters input[type=range] { width: 100%; accent-color: var(--accent); }
.range-label { margin: 0 0 2px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Two-handle slider: two range inputs stacked on one drawn track */
.dual { position: relative; height: 26px; }
.dual-track { position: absolute; left: 9px; right: 9px; top: 11px; height: 4px; border-radius: 2px; background: var(--rule); }
.dual-fill { position: absolute; top: 11px; height: 4px; border-radius: 2px; background: var(--accent); }
.dual input[type=range] { position: absolute; inset: 0; width: 100%; height: 26px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none; }
.dual input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; height: 26px; }
.dual input[type=range]::-moz-range-track { background: none; border: 0; }
.dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
  width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; cursor: pointer;
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.dual input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.ticks { position: relative; height: 1.5em; font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks button { position: absolute; transform: translateX(-50%); font: inherit; color: inherit; background: none; border: 0;
  padding: 2px 3px; border-radius: 4px; cursor: pointer; }
.ticks button:hover, .ticks button:focus-visible { color: var(--accent); background: var(--accent-soft); outline: none; }
.filters select { width: 100%; padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--input-bg); color: var(--text); font: inherit; }
.filters-open, .filters-close { display: none; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.02em; }
/* The utility on the count line: its name opens the utility modal; the arrow box after it
   (an invisible select over a drawn chevron) switches utility where several serve the zip. */
.tdu-link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tdu-menu { position: relative; display: inline-block; width: 1.4em; height: 1.2em; margin-left: 4px; vertical-align: -0.15em;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--input-bg); }
.tdu-menu::after { content: ''; position: absolute; left: 50%; top: 42%; width: 0.36em; height: 0.36em; pointer-events: none;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translate(-50%, -50%) rotate(45deg); }
.tdu-menu select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 1rem; }
.tdu-menu:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Utility modal's charge history */
.tdu-hist-wrap { overflow-x: auto; }
.tdu-hist { border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tdu-hist th, .tdu-hist td { padding: 3px 14px 3px 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.tdu-hist th { font-weight: 600; color: var(--muted); }
.tdu-hist .num { text-align: right; }
.tdu-hist .up { color: var(--error); }
.tdu-hist .down { color: var(--good); }
.sort { font-size: 0.9rem; color: var(--muted); }
.sort select { margin-left: 6px; padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.explain { font-size: 0.85rem; color: var(--muted); margin: 6px 0 12px; max-width: 70ch; }

table.plans { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
/* Column headings stay on screen while scrolling the list. */
.plans thead th { position: sticky; top: 0; z-index: 3; background: var(--thead-bg); color: var(--muted);
  text-align: center; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 12px; border-bottom: 1px solid var(--rule); }
.plans thead th.num { text-align: center; }
/* Sortable headings: look like the others, underline on hover, arrow on the current sort. */
.sort-head { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.sort-head:hover, .sort-head:focus-visible { text-decoration: underline; }
.plans thead th[aria-sort] .sort-head { color: var(--accent); }
.plans thead th[aria-sort="ascending"] .sort-head::after { content: " ▲"; }
.plans thead th[aria-sort="descending"] .sort-head::after { content: " ▼"; }
.plans thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.plans thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.plans tbody:last-child td.extra { border-bottom-left-radius: calc(var(--radius) - 1px); }
.plans tbody:last-child td.go { border-bottom-right-radius: calc(var(--radius) - 1px); }
.plans td { padding: 14px; border-bottom: 1px solid var(--rule); vertical-align: top; transition: background 0.12s; }
@media (min-width: 761px) { .plans tbody:hover td { background: var(--surface-2); } }
/* Each plan is two rows: the figures, then its catches and details across the columns. */
.plans tr.main td:not(.go) { border-bottom: 0; padding-bottom: 4px; }
.plans td.extra { padding-top: 0; }
.plans tbody:last-child td { border-bottom: 0; }
/* "Monthly estimates" on the left, what changed lately on the right of the same line. */
.detail-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px 16px; flex-wrap: wrap; }
.short-avg { cursor: help; color: var(--muted); margin-left: 1px; }
.dated { margin-top: 6px; font-size: 0.8rem; color: var(--muted); cursor: help; }
.dated-new { color: var(--new); }
.dated-down { color: var(--good); }
.dated-up { color: var(--error); }
.plans .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plans td.mid { text-align: center; }    /* Avg bill, Contract, Cancel fee, Renewable (phones: left, below) */
.plans td small { display: block; color: var(--muted); font-size: 0.8rem; }
.plans .cost strong { font-size: 1.5rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.85rem; color: var(--muted); }
.provider { font-weight: 650; color: var(--text); }
.stars { color: #c98a00; letter-spacing: 1px; }
.name { font-weight: 700; font-size: 1.06rem; margin: 2px 0 8px; letter-spacing: -0.01em; }
.term { font-size: 0.9rem; white-space: nowrap; }
.etf { font-size: 0.9rem; min-width: 6em; }
.go { text-align: right; white-space: nowrap; }
.go .efl { display: block; font-size: 0.8rem; margin-top: 6px; }

/* Plan name: opens the plan modal (app.js openPlan). */
.name-link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.name-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.plan-modal { width: min(760px, calc(100vw - 16px)); }
.pm-titles { flex: 1; min-width: 0; }
.pm-titles .provider { margin: 0; font-size: 0.85rem; }
.plan-modal h2 { margin: 0; font-size: 1.3rem; }
.pm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; }
.pm-body h3 { margin: 18px 0 6px; font-size: 1rem; }
.pm-facts { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 5px 14px; margin: 0; font-size: 0.9rem; }
.pm-facts dt { color: var(--muted); }
.pm-facts dd { margin: 0; }
.pm-note { margin: 6px 0; color: var(--muted); font-size: 0.85rem; }
.pm-months { border-collapse: collapse; margin-top: 4px; }
.pm-months th, .pm-months td { padding: 1px 10px 1px 0; font-weight: 400; text-align: left; }
.pm-months td.num { text-align: right; }
.pm-changes { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.pm-changes > li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.pm-changes > li:last-child { border-bottom: 0; }
.pm-changes ul { margin: 2px 0 0; padding-left: 20px; color: var(--text); }
.plan-modal .um-foot .btn { text-decoration: none; }
@media (max-width: 560px) { .pm-facts { grid-template-columns: 1fr; gap: 0; } .pm-facts dd { margin-bottom: 6px; } }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 0.74rem; font-weight: 550; line-height: 1.4; padding: 2px 9px; border-radius: 999px; cursor: help; }
.badge.tag { background: var(--tag-bg); color: var(--tag-text); }
.badge.est { background: var(--est-bg); color: var(--est-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.breakdown { margin-top: 6px; font-size: 0.85rem; }
.breakdown summary { color: var(--accent); cursor: pointer; width: fit-content; }
.breakdown table { border-collapse: collapse; margin-top: 4px; }
.breakdown th, .breakdown td { padding: 1px 10px 1px 0; font-weight: 400; text-align: left; }
.breakdown td.num { text-align: right; }
.more { text-align: center; margin: 16px 0; }

/* About and FAQ below the tool: plain text for people and search engines (also the 404 page's body). */
.about { margin: 56px 0 48px; max-width: 80ch; }
.about h1, .about h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); line-height: 1.2; margin: 0 0 10px; }
.about > p { margin: 0 0 20px; color: var(--muted); font-size: 1.05rem; }
main.wrap.about { max-width: 1200px; margin: 48px auto; }    /* 404 page: lined up with the logo */
main.wrap.about > * { max-width: 80ch; }
.faq details { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--thead-bg); color: var(--muted); font-size: 1.1rem; font-weight: 600; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary h3 { display: inline; font-size: 1rem; font-weight: 650; margin: 0; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
/* City pages (lib/Electric/Cities.pm): a text heading over the form, and a summary below the tool. */
.page-title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.15; margin: 28px 0 6px; }
.page-intro { margin: 0 0 16px; color: var(--muted); max-width: 90ch; }
.about.city { max-width: 960px; }
.about h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.about .asof, .about .note { color: var(--muted); font-size: 0.9rem; }
.about .facts { margin: 0 0 16px; padding-left: 1.2em; }
.about .facts li { margin-bottom: 4px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.city-plans { width: 100%; border-collapse: collapse; }
.city-plans th { background: var(--thead-bg); text-align: left; padding: 10px 14px; font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); }
.city-plans td { padding: 10px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
.city-plans .num { text-align: right; white-space: nowrap; }
.city-plans .provider { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.city-plans .catches { font-size: 0.85rem; color: var(--tag-text); }
.city-list { columns: 3 12rem; margin: 0 0 8px; padding-left: 1.2em; }
/* "Electricity rates by city" links on the home page, as chips. */
p.cities { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0; }
p.cities a { font-size: 0.9rem; font-weight: 550; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface);
  text-decoration: none; transition: border-color 0.15s, background 0.15s; }
p.cities a:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 600px) { .city-plans th, .city-plans td { padding: 8px 6px; } .city-plans th { font-size: 0.8rem; } .city-plans td:last-child { white-space: nowrap; } }
.top .logo { margin: 0; line-height: 0; }

.bottom { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: var(--header-muted); font-size: 0.85rem; }
.bottom a { color: #ffffff; }
.bottom .wrap { padding-top: 28px; padding-bottom: 36px; }
.bottom p { margin: 0; max-width: 90ch; }

/* Tablets: narrower filter column */
@media (max-width: 1000px) {
  .results { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .plans th:nth-child(6), .plans td:nth-child(6) { display: none; }
}

/* Phones: cards, and filters in a slide-out panel */
@media (max-width: 760px) {
  .lookup { grid-template-columns: 1fr; padding: 18px 16px; }
  .lookup .btn { width: 100%; }
  .results { grid-template-columns: 1fr; }
  .filters-open { display: inline-block; justify-self: start; }
  .filters { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); z-index: 20; overflow-y: auto; border-radius: 0;
    transform: translateX(-105%); transition: transform 0.2s ease; }
  .filters-shown .filters { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); }
  .filters-close { display: block; }
  .filters-head { border-radius: 0; }
  table.plans, .plans thead, .plans td { display: block; width: 100%; }
  table.plans { background: none; border: 0; box-shadow: none; }
  .plans thead { display: none; }
  .plans tbody { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 14px; padding: 6px 0; display: grid;
    grid-template-columns: 1fr 1fr; box-shadow: var(--shadow); }
  .plans tr { display: contents; }
  .plans td, .plans tr.main td:not(.go), .plans td.extra { border: 0; padding: 6px 14px; border-radius: 0; }
  .plans td.plan, .plans td.go, .plans td.extra { grid-column: 1 / -1; }
  /* Card order: plan, its catches and details, the figures, then Sign up. */
  .plans td.plan { order: 0; } .plans td.extra { order: 1; } .plans td { order: 2; } .plans td.go { order: 3; }
  .plans td.num, .plans td.term, .plans td.etf { text-align: left; }
  .plans td.cost::before { text-transform: none !important; }
  .plans td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .plans th:nth-child(6), .plans td:nth-child(6) { display: block; }
  .go { text-align: left; display: flex; align-items: center; gap: 14px; }
  .go .efl { display: inline; margin: 0; }
}

/* Explanations: shown on hover, tap or keyboard focus */
.tip { position: relative; cursor: help; }
.filters .tip { border-bottom: 1px dotted var(--muted); }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: min(280px, 80vw); padding: 9px 12px; border-radius: 10px;
  background: var(--tip-bg); color: var(--tip-text); font: 400 0.8rem/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: none; letter-spacing: normal; white-space: normal; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); pointer-events: none; }
.tip:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tip-right:hover::after, .tip-right:focus::after { left: auto; right: 0; }    /* at the right edge: open leftward */
