:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #1c2420;
  --muted: #5d6a63;
  --line: #d9ded9;
  --accent: #157a4b;
  --accent-ink: #0f5c38;
  --warn-bg: #fff3d6;
  --warn-ink: #7a4d00;
  --bad-bg: #fde4e1;
  --bad-ink: #8a1c10;
  --good-bg: #dff3e6;
  --good-ink: #0f5c38;
  --info-bg: #e3ecf8;
  --info-ink: #1f4d8a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1b211e;
    --surface-2: #232b27;
    --text: #e6ebe7;
    --muted: #9aa7a0;
    --line: #2f3833;
    --accent: #4fc487;
    --accent-ink: #7fd8a6;
    --warn-bg: #3d2f0d;
    --warn-ink: #ffd27a;
    --bad-bg: #3f1a15;
    --bad-ink: #ff9d8f;
    --good-bg: #16362a;
    --good-ink: #8fe0b3;
    --info-bg: #1a2a40;
    --info-ink: #9cc2f5;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--accent-ink); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.site-header { padding: 28px 0 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-size: 1.6rem; font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.tagline { margin: 6px 0 2px; font-size: 1.05rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.9rem; }

.intro { margin: 22px 0 12px; }
.intro p { margin: 0; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin: 18px 0 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.control label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.control select, .control input[type="number"] {
  width: 100%;
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { flex: 1; }
.control.checks { display: flex; flex-direction: column; gap: 6px; justify-content: end; }
.control.checks label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.9rem; margin: 0; cursor: pointer; }

.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
table.programs { width: 100%; border-collapse: collapse; min-width: 900px; }
.programs th, .programs td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.programs th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.programs th[data-sort] { cursor: pointer; user-select: none; }
.programs th[data-sort]:hover { color: var(--text); }
.programs th.sorted::after { content: " ▾"; }
.programs th.sorted.asc::after { content: " ▴"; }
.programs th.num, .programs td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.programs tbody tr.row { cursor: pointer; }
.programs tbody tr.row:hover { background: var(--surface-2); }
.programs tbody tr.row.open { background: var(--surface-2); }
.programs tbody tr.details td { background: var(--surface-2); padding: 12px 16px 18px; border-bottom: 2px solid var(--line); }
.programs tbody tr:last-child td { border-bottom: 0; }
.name { font-weight: 600; }
/* "Show details" control: a pill at the row end on desktop, a drawer-style footer strip on mobile cards */
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--accent-ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; white-space: nowrap; }
.more .handle { display: inline-block; width: 0.45em; height: 0.45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.15em) rotate(45deg); transition: transform 0.15s; }
.programs tbody tr.row:hover .more, .more:hover, .more:focus-visible { border-color: var(--accent); }
.programs tbody tr.row.open .more .handle { transform: translateY(0.1em) rotate(-135deg); }
.operator { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.rate { font-weight: 600; font-size: 1.05rem; }
.rate .arrow { color: var(--muted); font-weight: 400; }
.sub { display: block; color: var(--muted); font-size: 0.8rem; white-space: normal; }
.money { font-weight: 600; }
td.small { font-size: 0.88rem; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge.established { background: var(--good-bg); color: var(--good-ink); }
.badge.newer { background: var(--info-bg); color: var(--info-ink); }
.badge.unverified { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.fit { background: var(--good-bg); color: var(--good-ink); }
.badge.free { background: var(--info-bg); color: var(--info-ink); }
.badge.buy { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.promo { background: var(--warn-bg); color: var(--warn-ink); }

.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; }
.details-grid h4 { margin: 0 0 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.details-grid p, .details-grid ul { margin: 0 0 6px; font-size: 0.92rem; }
.details-grid ul { padding-left: 18px; }
.quote { font-style: italic; border-left: 3px solid var(--accent); padding-left: 10px; color: var(--muted); }
.links a { margin-right: 14px; }
.province-table { border-collapse: collapse; font-size: 0.85rem; margin-top: 4px; }
.province-table td, .province-table th { padding: 2px 8px; border: 1px solid var(--line); text-align: right; }
.province-table th:first-child, .province-table td:first-child { text-align: left; }

.empty { text-align: center; color: var(--muted); padding: 24px; }
.notes { margin: 28px 0; }
.notes h2 { font-size: 1.1rem; margin: 0 0 8px; }
.notes ul { padding-left: 20px; margin: 0; }
.notes li { margin-bottom: 6px; }
.site-footer { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--muted); font-size: 0.85rem; background: var(--surface); }
.site-footer p { margin: 0; }

@media (max-width: 720px) {
  .site-header { padding: 18px 0 12px; }
  .brand { font-size: 1.35rem; }
  .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  table.programs, .programs tbody, .programs tr, .programs td { display: block; min-width: 0; }
  .programs thead { display: none; }
  .programs tbody tr.row { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 8px 4px; box-shadow: var(--shadow); }
  .programs tbody tr.row.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
  .programs tbody tr.details { margin-bottom: 10px; }
  .programs tbody tr.details td { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
  .programs td { border: 0; padding: 4px 10px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
  .programs td > .sub { flex-basis: 100%; text-align: right; }
  .programs td > .more { flex: 0 0 calc(100% + 28px); flex-direction: column; justify-content: center; gap: 5px; margin: 8px -14px -12px; padding: 7px 0 9px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--surface-2); color: var(--muted); }
  .programs td > .more .handle { width: 36px; height: 4px; border: 0; border-radius: 2px; background: var(--muted); transform: none; }
  .programs tbody tr.row.open td > .more { border-radius: 0; color: var(--accent-ink); }
  .programs tbody tr.row.open td > .more .handle { background: var(--accent); transform: none; }
  .programs td.num { text-align: right; }
  .programs td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; flex: 0 0 auto; padding-top: 3px; }
  .programs td.first { display: block; padding-bottom: 6px; }
  .programs td.first::before { display: none; }
  .programs td > span, .programs td > div { text-align: right; }
  .programs tr.details td { display: block; }
  .programs tr.details td > div, .programs tr.details td > div * { text-align: left; }
  .programs td.first > * { text-align: left; }
}

/* ---------- multi-page additions ---------- */
.brand-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.site-nav a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--accent-ink); background: var(--good-bg); }
.intro h1 { font-size: 1.45rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.section-title { font-size: 1.15rem; margin: 26px 0 10px; }
.controls.slim { grid-template-columns: repeat(auto-fit, minmax(200px, 280px)); }

.cards { display: grid; gap: 14px; margin: 14px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); }
.card.hl, .programs tbody tr.row.hl { box-shadow: inset 3px 0 0 var(--accent); }
.card.muted-card { background: var(--surface-2); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.card h2 { font-size: 1.12rem; margin: 0; }
.card .lead { margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 8px; font-size: 0.92rem; }
.kv dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.kv dd { margin: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot.yes { background: var(--accent); }
.dot.no { background: var(--line); }
.caveats { margin: 6px 0; padding-left: 18px; font-size: 0.9rem; color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 3px 0; }
.plain li.hl { font-weight: 600; }
.links.small { font-size: 0.85rem; margin: 8px 0 0; }
.sub.inline { display: inline; margin-left: 10px; }
.muted { color: var(--muted); }
.rate.good { color: var(--accent-ink); }
.quote-inline { font-style: italic; }
.net { color: var(--accent-ink); font-weight: 600; }
.net .q { text-decoration: none; margin-left: 3px; border: 1px solid var(--line); border-radius: 50%; padding: 0 5px; font-size: 0.7rem; color: var(--muted); }

.fed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 8px 0 12px; }
.stat { display: flex; flex-direction: column; }
.stat-n { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.stat-l { font-size: 0.8rem; color: var(--muted); }
table.mini { border-collapse: collapse; font-size: 0.85rem; margin: 4px 0 10px; }
table.mini th, table.mini td { padding: 3px 9px; border: 1px solid var(--line); text-align: right; }
table.mini th:first-child, table.mini td:first-child { text-align: left; }
.rates .rate-n { display: inline-block; min-width: 4.5em; font-weight: 600; font-variant-numeric: tabular-nums; }
table.rebates { min-width: 820px; }
table.electricity { min-width: 860px; }

@media (max-width: 720px) {
  .brand-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .site-nav a { padding: 3px 8px; font-size: 0.86rem; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
  .programs td.first .badge { margin-left: 0; }
}

.programs tbody tr.row.static { cursor: default; }
.programs tbody tr.row.static:hover { background: inherit; }
table.fees { min-width: 860px; }

/* ---------- contact form ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px 28px; align-items: start; margin: 4px 0 20px; }
form.contact { padding: 22px 24px 24px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field-hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.field input, .field textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); transition: border-color 0.12s, box-shadow 0.12s; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.7; }
.field textarea { resize: vertical; min-height: 170px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field.turnstile { margin-bottom: 18px; }
.cf-turnstile { min-height: 65px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 18px; }
.segmented legend { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; padding: 0; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.9rem; font-weight: 500; transition: all 0.12s; }
.segmented input:checked + span { background: var(--good-bg); border-color: var(--accent); color: var(--good-ink); font-weight: 600; }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.segmented label:hover span { border-color: var(--accent); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.btn { font: inherit; font-weight: 600; font-size: 0.98rem; padding: 11px 22px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.btn:hover { filter: brightness(0.94); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.form-status { margin: 0; font-size: 0.92rem; }
.form-status.good { color: var(--good-ink); }
.form-status.bad { color: var(--bad-ink); }

.contact-done { text-align: center; padding: 40px 24px; }
.done-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: var(--good-bg); color: var(--good-ink); font-size: 1.6rem; font-weight: 700; line-height: 52px; }
.contact-done h2 { margin: 0 0 6px; }
.contact-done p { margin: 0 0 8px; color: var(--muted); }

.contact-aside { font-size: 0.92rem; }
.aside-block { padding: 14px 0; border-top: 1px solid var(--line); }
.aside-block:first-child { border-top: 0; padding-top: 4px; }
.aside-block h3 { margin: 0 0 6px; font-size: 0.95rem; }
.aside-block p, .aside-block ul { margin: 0; color: var(--muted); }
.aside-block ul { padding-left: 18px; }
.aside-block li { margin-bottom: 4px; }
.aside-fine { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-aside { border-top: 1px solid var(--line); padding-top: 6px; }
  .aside-block:first-child { border-top: 0; }
}
@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
  form.contact { padding: 18px 16px 20px; }
  .btn { width: 100%; }
}
