/* ===========================================================================
   Golden State Solar Guide — shared design system
   One stylesheet for every generated page so the toolkit reads as one product.
   Theme: bright, friendly, USA-flag palette. WHITE dominates; deep navy blue is
   the primary accent; red is the secondary pop. Category colours are consistent
   EVERYWHERE:
     utility-scale = navy blue   ·   distributed/rooftop = red
     candidate (unmapped) = red  ·   known/flagged = bright blue
   =========================================================================== */

:root {
  color-scheme: light;   /* native controls (inputs, scrollbars) render light */
  --field: #ffffff;      /* one shared surface for EVERY text input, sitewide */
  /* --- USA flag palette ------------------------------------------------- */
  --blue:        #0a3161;   /* Old Glory Blue — primary: CTAs, headings, utility data */
  --blue-2:      #1d4ed8;   /* brighter blue — links, hovers, map markers */
  --blue-soft:   #eaf1fb;   /* blue tint for chips / fills */
  --red:         #b31942;   /* Old Glory Red — accent: secondary data, badges, highlights */
  --red-2:       #d81e3f;   /* brighter red for small pops */
  --red-soft:    #fdebef;   /* red tint */

  /* semantic category aliases (used by .dot/.tile/.kpi etc.) */
  --utility:        var(--blue);
  --utility-soft:   var(--blue-soft);
  --distributed:    var(--red);
  --distributed-soft:var(--red-soft);
  --candidate:      var(--red-2);
  --known:          var(--blue-2);
  --accent:         var(--red);

  --ink:    #10203a;        /* near-navy body text */
  --ink-2:  #3a4a63;
  --muted:  #6b7a90;
  --line:   #e4e9f1;
  --bg:     #ffffff;        /* page background is WHITE */
  --bg-2:   #f5f8fd;        /* faint blue-tinted alt band */
  --card:   #ffffff;
  --header: #ffffff;        /* topbar is white now */

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(10,49,97,.04), 0 8px 30px rgba(10,49,97,.07);
  --shadow-sm: 0 1px 3px rgba(10,49,97,.08);
  --shadow-lg: 0 18px 50px rgba(10,49,97,.16);
  --topbar-h: 64px;

  --font:    'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Accessibility: honour reduced-motion (neutralises CSS animations + transitions). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
/* Skip-to-content link — visible only when focused by keyboard. */
.skip { position: absolute; left: -9999px; top: 0; z-index: 3000; background: var(--blue);
  color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 700; font-size: 14px; }
.skip:focus { left: 0; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

/* ---- Top navigation bar -------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 1200;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  font-family: var(--display); font-weight: 800; font-size: 15.5px; letter-spacing: -.02em; color: var(--ink);
  /* reset the generic .brand card styling (equipment cards share the class) */
  background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none;
}
.topbar .brand:hover { text-decoration: none; }
.topbar .brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--blue);
  box-shadow: 0 3px 10px rgba(10,49,97,.30);
}
.topbar .brand .logo .brandmark { width: 26px; height: 26px; display: block; }
.topbar nav { display: flex; gap: 2px; margin-left: 10px; }
.topbar nav a {
  color: var(--ink-2); font-weight: 600; font-size: 14px;
  padding: 8px 13px; border-radius: 9px; line-height: 1;
}
.topbar nav a:hover { color: var(--blue); background: var(--blue-soft); text-decoration: none; }
.topbar nav a.active { color: var(--blue); background: var(--blue-soft); }
.topbar .spacer { flex: 1; }
.topbar .ctx { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.topbar .ctx b { color: var(--blue); font-weight: 700; }
.topbar .cta {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 10px 16px; border-radius: 999px; line-height: 1;
  box-shadow: 0 4px 14px rgba(10,49,97,.28); transition: .15s;
}
.topbar .cta:hover { background: #0c3c78; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ---- Legal / long-form content pages (Privacy, Terms, 404) --------------- */
.legal { max-width: 760px; margin: 0 auto; padding: 40px 26px 20px; }
.legal h1 { font-size: 32px; font-weight: 800; }
.legal-meta { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.legal-intro { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 18px 0 8px; }
.legal h2 { font-size: 18px; font-weight: 700; margin: 30px 0 6px; color: var(--ink); }
.legal p { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; margin: 8px 0; }
.legal ul { margin: 8px 0; padding-left: 22px; }
.legal li { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; margin: 4px 0; }
.legal b { color: var(--ink); }
.legal.notfound { text-align: center; padding-top: 64px; padding-bottom: 48px; }
.legal.notfound .cta-row { margin-top: 22px; }

/* ---- Page title band (used on dashboard-style pages) --------------------- */
.pagehead { padding: 30px 26px 8px; max-width: 1280px; margin: 0 auto; }
.pagehead h1 { font-size: 30px; font-weight: 800; }
.pagehead p { margin: 8px 0 0; color: var(--muted); font-size: 15px; max-width: 74ch; }

/* ---- Layouts ------------------------------------------------------------- */
/* map-centric pages: full-bleed map + right sidebar */
.map-app { height: calc(100vh - var(--topbar-h)); display: flex; }
.map-app .map { flex: 1; min-width: 0; }
.map-app .side {
  width: 372px; flex: none; overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--line);
  padding: 18px;
}
.side .side-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.side .side-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }

/* dashboard pages: centered grid of cards */
.dash { max-width: 1280px; margin: 0 auto; padding: 14px 26px 40px;
        display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash .col-span { grid-column: 1 / -1; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.side .card { box-shadow: var(--shadow-sm); padding: 16px; }
.card-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; font-family: var(--font); margin: 0 0 14px;
}

/* ---- KPIs ---------------------------------------------------------------- */
.kpi-grid { display: flex; flex-wrap: wrap; gap: 28px; }
.kpi .num { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -.03em;
            font-variant-numeric: tabular-nums; line-height: 1.05; color: var(--ink); }
.kpi .lbl { color: var(--muted); font-size: 12px; margin-top: 3px; }
.kpi .num.util { color: var(--blue); }
.kpi .num.dist { color: var(--red); }

/* ---- Stat rows ----------------------------------------------------------- */
.stat { display: flex; align-items: center; justify-content: space-between;
        font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat:last-child { border-bottom: 0; }
.stat .lab { color: var(--ink-2); display: flex; align-items: center; }
.stat b { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- Dots / swatches / badges -------------------------------------------- */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block;
       margin-right: 7px; flex: none; }
.dot.util { background: var(--blue); }
.dot.dist { background: var(--red); }
.dot.cand { background: var(--candidate); }
.dot.known { background: var(--known); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px;
         font-size: 11px; font-weight: 700; background: var(--blue-soft);
         color: var(--blue); }

/* ---- Controls ------------------------------------------------------------ */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); cursor: pointer; transition: .14s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: #c7d2e3; background: #f6f9fe; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff;
               box-shadow: 0 4px 14px rgba(10,49,97,.22); }
.btn.primary:hover { background: #0c3c78; border-color: #0c3c78; }
.btn.accent { background: var(--red); border-color: var(--red); color: #fff;
              box-shadow: 0 4px 14px rgba(179,25,66,.22); }
.btn.accent:hover { background: #9c1239; border-color: #9c1239; }
.btn.lg { font-size: 15px; padding: 13px 22px; border-radius: 999px; }

label.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px;
              padding: 4px 0; cursor: pointer; color: var(--ink-2); }
label.check input { accent-color: var(--blue); width: 15px; height: 15px; }

.control-row { display: flex; align-items: center; gap: 10px; }
.control-row .val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; }
input[type=range] { flex: 1; accent-color: var(--blue); }

input[type=text], input[type=number], input[type=email], input[type=tel], input[type=password],
input[type=search], input[type=url], select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--field); color: var(--ink); width: 100%;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  outline: 3px solid rgba(29,78,216,.18); border-color: var(--blue-2);
}
/* Neutralise Chrome autofill so it can't repaint fields a mismatched colour. */
input:-webkit-autofill, select:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--field) inset;
  caret-color: var(--ink); border-color: var(--line);
}
.field-row select { width: 130px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
             margin: 7px 0; font-size: 13px; color: var(--ink-2); }
.field-row input { width: 88px; text-align: right; padding: 6px 9px; }

/* design metrics readout */
.metric { display: flex; align-items: baseline; justify-content: space-between;
          padding: 8px 0; border-bottom: 1px dashed var(--line); }
.metric:last-child { border-bottom: 0; }
.metric .k { color: var(--ink-2); font-size: 13px; }
.metric .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.metric.hero { padding: 4px 0 10px; }
.metric.hero .v { font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--blue); letter-spacing: -.03em; }
.metric.hero .k { font-size: 13px; }

/* equipment option cards */
.opt { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
       margin-bottom: 9px; cursor: pointer; transition: .14s; background: var(--card); }
.opt:hover { border-color: #c7d2e3; background: #f6f9fe; }
.opt.sel { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(10,49,97,.16); }
.opt .oh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opt .oh b { font-size: 13.5px; }
.opt .os { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.opt .om { margin-top: 6px; font-size: 12.5px; color: var(--ink-2);
           font-variant-numeric: tabular-nums; display: flex; gap: 10px; flex-wrap: wrap; }
.opt .om b { color: var(--ink); }
.why { font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
       background: var(--blue-soft); border-radius: 10px; padding: 11px 13px; margin-top: 4px; }

/* news page */
.news-grid { max-width: 1280px; margin: 0 auto; padding: 16px 26px 34px;
            display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
             box-shadow: var(--shadow); padding: 16px 17px; display: flex; flex-direction: column; transition: .15s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d2dcec; }
.news-card .src { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; margin-bottom: 9px; }
.news-card .src .b { font-weight: 700; color: var(--blue); }
.news-card .src .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.news-card h3 { font-size: 15.5px; line-height: 1.34; margin: 0 0 8px; letter-spacing: -.01em; }
.news-card h3 a { color: var(--ink); }
.news-card p { font-size: 12.7px; color: var(--ink-2); line-height: 1.55; margin: 0 0 12px; flex: 1; }
.news-card .more { font-size: 12.5px; font-weight: 700; color: var(--blue-2); }
.news-card .thumb { height: 158px; margin: -16px -17px 12px; background-size: cover; background-position: center;
                    border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.news-card .thumb.ph { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
                       letter-spacing: .02em; background: linear-gradient(135deg, var(--blue), var(--red)); }

/* featured hero story */
.news-hero { max-width: 1280px; margin: 0 auto; padding: 10px 26px 4px; }
.feat { display: grid; grid-template-columns: 1.35fr 1fr; background: var(--card); border: 1px solid var(--line);
        border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); color: var(--ink); transition: .15s; }
.feat:hover { text-decoration: none; box-shadow: var(--shadow-lg); border-color: #d2dcec; }
.feat .ph { min-height: 280px; background-size: cover; background-position: center; }
.feat .ph.placeholder { background: linear-gradient(135deg, var(--blue), var(--red)); }
.feat .ft { padding: 28px 30px; display: flex; flex-direction: column; justify-content: center; }
.feat .ft .src { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.feat .ft .src .d { color: var(--muted); font-weight: 500; }
.feat .ft h2 { font-size: 27px; line-height: 1.18; margin: 0 0 10px; }
.feat .ft p { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 0 0 14px; }
.feat .ft .more { font-weight: 700; color: var(--red); font-size: 13px; }

/* video reel — compact horizontal strip (HomeBase-style "clips" row) */
.reel-wrap { max-width: 1280px; margin: 0 auto; padding: 8px 26px 6px; }
.reel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.reel-head .t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.reel-head .t span { color: var(--ink-2); font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 8px; }
.reel-nav { display: flex; gap: 6px; }
.reel-nav button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--card);
                   color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.reel-nav button:hover { background: var(--blue-soft); color: var(--blue); }
.reel { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-behavior: smooth; scroll-snap-type: x proximity; }
.reel::-webkit-scrollbar { height: 8px; }
.reel::-webkit-scrollbar-thumb { background: #cdd8e8; border-radius: 99px; }
.reel::-webkit-scrollbar-track { background: transparent; }
.clip { flex: 0 0 262px; scroll-snap-align: start; cursor: pointer; border-radius: 13px; overflow: hidden;
        background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: .14s; }
.clip:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d2dcec; }
.clip .thumb { position: relative; aspect-ratio: 16/9; background: #0b1f3a center/cover no-repeat; }
.clip .pill { position: absolute; top: 7px; left: 7px; max-width: 78%; font-size: 10px; font-weight: 700; color: #fff;
              background: rgba(10,31,58,.72); padding: 2px 7px; border-radius: 6px; overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; }
.clip .play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%;
              background: var(--red); display: grid; place-items: center; opacity: .92; transition: .14s;
              box-shadow: 0 4px 14px rgba(179,25,66,.4); }
.clip:hover .play { opacity: 1; transform: scale(1.08); }
.clip .play::after { content: ""; border-left: 14px solid #fff; border-top: 8px solid transparent;
                     border-bottom: 8px solid transparent; margin-left: 3px; }
.clip .cmeta { padding: 10px 12px; }
.clip .cmeta .ct { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.32;
                   display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip .cmeta .cd { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.reel-empty { max-width: 1280px; margin: 0 auto; padding: 0 26px 10px; }
/* clip modal */
.vmodal { position: fixed; inset: 0; z-index: 3000; background: rgba(8,18,34,.9); display: none;
          align-items: center; justify-content: center; padding: 20px; }
.vmodal.show { display: flex; }
.vmodal .box { width: min(900px, 95vw); background: #0b1f3a; border: 1px solid #1c3458; border-radius: 16px;
               overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.vmodal .vhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; color: #e2e8f0; font-size: 13px; }
.vmodal .vhead button { background: none; border: 0; color: #94a3b8; font-size: 22px; cursor: pointer; line-height: 1; }
.vmodal .vbody { aspect-ratio: 16/9; background: #000; }
.vmodal .vbody iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 760px){ .feat { grid-template-columns: 1fr; } .feat .ph { min-height: 180px; } }

/* education / resources page */
.learn-section { max-width: 1280px; margin: 0 auto; padding: 24px 26px 0; }
.learn-section h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.learn-section p.lead { color: var(--muted); font-size: 14px; margin: 0 0 6px; max-width: 80ch; }
.brand-grid { max-width: 1280px; margin: 0 auto; padding: 14px 26px 0;
              display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.brand { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
         box-shadow: var(--shadow); padding: 16px 17px; }
.brand .bh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.brand .bh b { font-size: 15px; font-family: var(--display); font-weight: 700; }
.brand .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
              padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.brand .tag.panel { background: var(--blue-soft); color: var(--blue); }
.brand .tag.inv { background: var(--red-soft); color: var(--red); }
.brand .tag.batt { background: var(--blue-soft); color: var(--blue-2); }
.brand p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 10px; }
.brand .links { font-size: 12px; color: var(--muted); }
.brand .links a { font-weight: 700; }
.flag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-soft);
        border: 1px solid #f4c4d0; border-radius: 7px; padding: 2px 8px; margin: 0 0 8px; }
.concept-grid { max-width: 1280px; margin: 0 auto; padding: 14px 26px 0;
                display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.concept { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 16px 17px; }
.concept h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.concept p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.concept .for { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.linkrow { max-width: 1280px; margin: 0 auto; padding: 14px 26px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.linkrow a { font-size: 13px; font-weight: 600; padding: 9px 14px; border: 1px solid var(--line);
             border-radius: 999px; background: var(--card); color: var(--ink); }
.linkrow a:hover { text-decoration: none; border-color: var(--blue-2); background: var(--blue-soft); color: var(--blue); }

/* address autocomplete */
.ac-wrap { position: relative; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1500;
      background: var(--card); border: 1px solid var(--line); border-radius: 12px;
      box-shadow: var(--shadow); overflow: hidden; display: none; }
.ac.show { display: block; }
.ac-item { padding: 10px 13px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.active { background: var(--blue-soft); }
.ac-item .s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---- Legend -------------------------------------------------------------- */
.legend { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }
.legend .row { display: flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block;
            opacity: .92; flex: none; }

/* ---- Tables -------------------------------------------------------------- */
.table-wrap { overflow: auto; max-height: 540px; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: right; padding: 9px 11px;
                               border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  position: sticky; top: 0; background: var(--card); color: var(--ink-2);
  font-weight: 700; cursor: pointer; user-select: none; z-index: 1;
  border-bottom: 2px solid var(--line);
}
table.data thead th:hover { color: var(--blue); }
table.data tbody tr:hover { background: #f6f9fe; }
table.data td.muted { color: #b9c4d4; }
table.data td.has { color: var(--blue-2); font-weight: 700; }

/* ---- Notes / footer ------------------------------------------------------ */
.note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.note code { background: var(--blue-soft); color: var(--blue); padding: 1px 5px; border-radius: 5px; font-size: 11px; }
.site-footer {
  max-width: 1280px; margin: 28px auto 0; padding: 22px 26px 34px;
  color: var(--muted); font-size: 11.5px; line-height: 1.6;
  border-top: 1px solid var(--line);
}
.site-footer b { color: var(--ink-2); }

/* ===========================================================================
   Landing page (index) — friendly marketing hero like the reference
   =========================================================================== */
.hero-bg {
  background-color: #f3f8ff;
  background-image:
    radial-gradient(rgba(10,49,97,.05) 2.2px, transparent 2.2px),
    radial-gradient(rgba(179,25,66,.045) 2.2px, transparent 2.2px);
  background-size: 46px 46px, 70px 70px;
  background-position: 0 0, 23px 33px;
  border-bottom: 1px solid var(--line);
}
.hero-wrap {
  max-width: 1280px; margin: 0 auto; padding: 56px 26px 60px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center;
}
.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue); background: var(--card); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.hero-copy .eyebrow .star { color: var(--red); font-size: 13px; line-height: 1; }
.hero-copy h1 {
  font-family: var(--display); font-weight: 800; font-size: 56px; line-height: 1.03;
  letter-spacing: -.035em; color: var(--ink); margin: 0;
}
.hero-copy h1 .accent { color: var(--blue); }
.hero-copy h1 .accent-r { color: var(--red); }
.hero-copy .sub { font-size: 17px; color: var(--ink-2); line-height: 1.6; margin: 20px 0 0; max-width: 52ch; }
.checklist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; }
.checklist li { display: flex; align-items: center; gap: 11px; font-size: 15.5px; font-weight: 500; color: var(--ink); }
.checklist li .ck {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue);
}
.checklist li:nth-child(2) .ck { background: var(--red-soft); color: var(--red); }
.cta-row { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: 100%; height: auto; max-width: 540px; filter: drop-shadow(0 22px 40px rgba(10,49,97,.16)); }

/* alt-band section label + tiles */
.tiles-section { background: var(--bg); }
.hero { max-width: 1280px; margin: 0 auto; padding: 38px 26px 6px; }   /* legacy fallback */
.hero h1 { font-size: 34px; }
.hero p { color: var(--muted); font-size: 15px; max-width: 64ch; margin: 8px 0 0; }
.tiles { max-width: 1280px; margin: 0 auto; padding: 22px 26px 48px;
         display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 18px; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
  color: var(--ink); transition: .15s; position: relative; overflow: hidden;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); opacity: 0; transition: .15s; }
.tile:hover { text-decoration: none; transform: translateY(-3px);
              box-shadow: var(--shadow-lg); border-color: #d2dcec; }
.tile:hover::before { opacity: 1; }
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid;
            place-items: center; margin-bottom: 15px; }
.tile .ic.util { background: var(--blue-soft); color: var(--blue); }
.tile .ic.dist { background: var(--red-soft); color: var(--red); }
.tile .ic.nat  { background: var(--blue-soft); color: var(--blue-2); }
.tile .ic.det  { background: var(--red-soft); color: var(--red-2); }
.tile h3 { font-size: 16.5px; font-weight: 700; }
.tile p { color: var(--muted); font-size: 12.8px; margin: 6px 0 0; }
.tile .meta { margin-top: 14px; font-size: 12px; color: var(--ink-2); font-weight: 600;
              font-variant-numeric: tabular-nums; }
.section-label { max-width: 1280px; margin: 14px auto -4px; padding: 0 26px;
                 font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
                 color: var(--muted); font-weight: 700; }

/* ---- Leaflet polish ------------------------------------------------------ */
.leaflet-container { font-family: var(--font); background: var(--bg-2); }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; margin: 12px 14px; }
.leaflet-popup-content b { color: var(--ink); }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow); }
.leaflet-bar a { color: var(--ink-2); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.82); }

/* ===========================================================================
   Floating chat widget (assets/chat.js) — lead-gate + verify + chat
   =========================================================================== */
.mc-chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 2600;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(10,49,97,.4); transition: transform .15s, background .15s;
}
.mc-chat-fab:hover { transform: translateY(-2px) scale(1.04); background: #0c3c78; }
.mc-chat-fab.active { background: #0c3c78; }
.mc-chat-dot { position: absolute; top: 12px; right: 13px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--red); border: 2px solid #fff;
  animation: mcPulse 2s ease-in-out infinite; }
@keyframes mcPulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(179,25,66,.5);} 50%{ box-shadow: 0 0 0 6px rgba(179,25,66,0);} }

.mc-chat-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 2600;
  width: min(380px, calc(100vw - 32px)); height: min(564px, calc(100vh - 130px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none; transform-origin: bottom right;
  transition: opacity .16s ease, transform .16s ease;
}
.mc-chat-panel.show { opacity: 1; transform: none; pointer-events: auto; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; background: var(--blue); color: #fff; }
.mc-head-id { display: flex; align-items: center; gap: 10px; }
.mc-head-id b { font-family: var(--display); font-weight: 700; font-size: 14.5px; display: block; }
.mc-av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16);
  display: grid; place-items: center; color: #fff; flex: none; }
.mc-av svg { width: 19px; height: 19px; }
.mc-status { font-size: 11px; color: #bcd3f5; }
.mc-x { background: none; border: 0; color: #cfe0f7; cursor: pointer; padding: 4px; line-height: 0;
  border-radius: 7px; }
.mc-x:hover { background: rgba(255,255,255,.14); color: #fff; }
.mc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px; overflow-y: auto; }

.mc-intro { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-bottom: 14px; }
.mc-intro b { color: var(--ink); }
.mc-gate { display: flex; flex-direction: column; gap: 11px; }
.mc-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-field { display: flex; flex-direction: column; gap: 4px; }
.mc-field span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.mc-field input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit;
  font-size: 13.5px; color: var(--ink); background: var(--field); width: 100%; }
.mc-field input:focus { outline: 3px solid rgba(29,78,216,.16); border-color: var(--blue-2); }
.mc-btn { margin-top: 2px; background: var(--blue); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 14px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(10,49,97,.24); transition: background .14s; }
.mc-btn:hover { background: #0c3c78; }
.mc-btn:disabled { opacity: .65; cursor: default; }
.mc-err { font-size: 12px; color: var(--red); font-weight: 600; }
.mc-fine { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.mc-fine a { color: var(--blue-2); text-decoration: underline; }
.mc-links { display: flex; gap: 16px; justify-content: center; margin-top: 2px; }
.mc-links a { font-size: 12px; font-weight: 600; color: var(--blue-2); cursor: pointer; }
.mc-links a:hover { text-decoration: underline; }
.mc-note { font-size: 11px; color: var(--ink-2); line-height: 1.5; background: var(--red-soft);
  border: 1px solid #f4c4d0; border-radius: 9px; padding: 9px 11px; }
.mc-note code { background: var(--card); color: var(--red); padding: 1px 5px; border-radius: 5px; }
.mc-code { text-align: center; letter-spacing: .5em; font-size: 22px; font-weight: 700; color: var(--ink);
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field);
  font-variant-numeric: tabular-nums; width: 100%; }
.mc-code:focus { outline: 3px solid rgba(29,78,216,.16); border-color: var(--blue-2); }

.mc-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px;
  padding-right: 2px; margin: -4px 0 12px; }
.mc-msg { max-width: 84%; font-size: 13px; line-height: 1.5; padding: 9px 12px; border-radius: 13px; }
.mc-msg.bot { align-self: flex-start; background: var(--blue-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.mc-msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.mc-msg.typing { color: var(--muted); letter-spacing: 2px; animation: mcType 1s steps(3) infinite; }
@keyframes mcType { 0%{opacity:.4} 50%{opacity:1} 100%{opacity:.4} }
.mc-inrow { display: flex; gap: 8px; align-items: center; }
.mc-input { flex: 1; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; font: inherit;
  font-size: 13.5px; color: var(--ink); background: var(--field); }
.mc-input:focus { outline: 3px solid rgba(29,78,216,.16); border-color: var(--blue-2); }
.mc-send { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--blue);
  color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(10,49,97,.26); }
.mc-send:hover { background: #0c3c78; }
@media (max-width: 480px) { .mc-chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; } }
.mc-2col + .mc-sub, .mc-sub { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 4px 0 -4px; }
.mc-3col { display: grid; grid-template-columns: 1fr 58px 90px; gap: 8px; }
.mc-consent { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; background: var(--blue-soft);
  border-radius: 9px; padding: 9px 11px; }
.mc-consent b { color: var(--blue); }

/* ===========================================================================
   Cookie / data-use consent banner (assets/chat.js) — plain-spoken, honest
   =========================================================================== */
.mc-cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 2700;
  max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 15px 18px;
  display: flex; gap: 14px 18px; align-items: center; flex-wrap: wrap;
  transform: translateY(160%); transition: transform .32s cubic-bezier(.2,.7,.2,1); }
.mc-cookie.show { transform: none; }
.mc-cookie p { margin: 0; font-size: 12.8px; color: var(--ink-2); line-height: 1.55; flex: 1 1 340px; }
.mc-cookie p b { color: var(--ink); }
.mc-cookie p a { color: var(--blue-2); font-weight: 700; text-decoration: underline; }
.mc-cookie .acts { display: flex; gap: 8px; flex: 0 0 auto; }
.mc-cookie button { font: inherit; font-size: 13px; font-weight: 700; border-radius: 999px;
  padding: 9px 17px; cursor: pointer; border: 1px solid var(--line); transition: .14s; }
.mc-cookie .accept { background: var(--blue); color: #fff; border-color: var(--blue); }
.mc-cookie .accept:hover { background: #0c3c78; }
.mc-cookie .decline { background: var(--card); color: var(--ink-2); }
.mc-cookie .decline:hover { background: var(--bg-2); border-color: var(--muted); }

/* ===========================================================================
   "Free solar consultation" lead form (homepage) — a second, honest capture path
   =========================================================================== */
.consult { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.consult-wrap { max-width: 1280px; margin: 0 auto; padding: 48px 26px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.consult-copy h2 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin: 0 0 10px; }
.consult-copy p { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 0 0 12px; max-width: 48ch; }
.consult-copy .promise { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.consult-copy .promise li { font-size: 13.5px; color: var(--ink); display: flex; gap: 9px; align-items: center; }
.consult-copy .promise li b { color: var(--blue); }
.consult-form { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 22px 20px; }
.consult-form .fh { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0 0 12px; }
.consult-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consult-form .row3 { display: grid; grid-template-columns: 1fr 64px 96px; gap: 10px; }
.consult-form label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin: 11px 0 4px; }
.consult-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; color: var(--ink); background: var(--field); }
.consult-form input:focus { outline: 3px solid rgba(29,78,216,.16); border-color: var(--blue-2); }
.consult-form .consent { display: flex; gap: 9px; align-items: flex-start; margin: 15px 0 2px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.consult-form .consent input { width: auto; margin-top: 2px; flex: none; }
.consult-form button { margin-top: 14px; width: 100%; background: var(--blue); color: #fff; border: 0;
  border-radius: 10px; padding: 12px; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; box-shadow: 0 4px 14px rgba(10,49,97,.22); }
.consult-form button:hover { background: #0c3c78; }
.consult-form .fine { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.45; text-align: center; }
.consult-form .ok { text-align: center; padding: 26px 10px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.consult-form .ok b { color: var(--blue); }
.consult-form .zipnote { font-size: 11.5px; color: var(--red); font-weight: 600; margin-top: 6px; display: none; }
.consult-form .zipnote.show { display: block; }
@media (max-width: 860px) { .consult-wrap { grid-template-columns: 1fr; gap: 26px; } }

/* ===========================================================================
   Northern California regional page (norcal.py)
   =========================================================================== */
.region-why { max-width: 1280px; margin: 0 auto; padding: 10px 26px 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 16px; }
.why-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 19px; }
.why-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 13px; background: var(--blue-soft); color: var(--blue); }
.region-why .why-card:nth-child(2) .ic, .region-why .why-card:nth-child(4) .ic { background: var(--red-soft); color: var(--red); }
.why-card h3 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0 0 6px; line-height: 1.25; }
.why-card p { font-size: 13px; color: var(--ink-2); line-height: 1.58; margin: 0; }
.region-note { max-width: 1280px; margin: 0 auto; padding: 16px 26px 0; }
.region-note .card { background: var(--bg-2); }
.region-note .rn { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; margin: 0; }
.region-note .rn b { color: var(--blue); }
/* Chunked regulatory "rules" — replaces the old wall-of-text region-note. */
.rules { max-width: 1280px; margin: 0 auto; padding: 10px 26px 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 15px 16px; }
.rule .t { display: block; font-family: var(--display); font-weight: 700; font-size: 13.5px;
  color: var(--blue); margin-bottom: 6px; line-height: 1.3; }
.rule p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.58; }
.rule p b { color: var(--ink); font-weight: 700; }
.rules-note { max-width: 1280px; margin: 12px auto 0; padding: 0 26px;
  font-size: 12px; color: var(--muted); line-height: 1.55; }
@media (max-width: 820px) { .rules { grid-template-columns: 1fr; } }
.region-cols { max-width: 1280px; margin: 0 auto; padding: 10px 26px 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.region-col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 14px 15px; }
.region-col b { display: block; font-family: var(--display); font-weight: 700; color: var(--blue); font-size: 14px; margin-bottom: 6px; }
.region-col span { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.pge-wrap { max-width: 1280px; margin: 0 auto; padding: 10px 26px 0;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.pge-map-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; }
.pge-copy { align-self: stretch; }
@media (max-width: 900px) { .pge-wrap { grid-template-columns: 1fr; } }

/* ---- FAQ accordion (norcal) ---------------------------------------------- */
.faq { max-width: 1280px; margin: 0 auto; padding: 8px 26px 0; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  margin-bottom: 10px; padding: 0 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink); padding: 15px 24px 15px 0;
  list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 12px; color: var(--blue);
  font-weight: 700; font-size: 22px; line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 0 0 15px; font-size: 13.5px; color: var(--ink-2); line-height: 1.62; }

/* ---- About page ---------------------------------------------------------- */
.about { max-width: 800px; margin: 0 auto; padding: 8px 26px 0; }
.about .card { margin-bottom: 16px; }
.about h2 { font-family: var(--display); font-weight: 700; font-size: 19px; margin: 0 0 8px; color: var(--ink); }
.about p { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin: 0 0 8px; }
.about p:last-child { margin-bottom: 0; }
.about p b { color: var(--ink); }
.about .cta-row { margin-top: 4px; }

/* ---- Footer nav links ---------------------------------------------------- */
.site-footer .foot-links { margin-bottom: 10px; }
.site-footer .foot-links a { color: var(--blue-2); font-weight: 600; }
.site-footer .foot-links a:not(:last-child)::after { content: " · "; color: var(--muted); font-weight: 400; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-wrap { grid-template-columns: 1fr; gap: 24px; padding: 40px 26px 44px; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 400px; }
  .hero-copy h1 { font-size: 42px; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .map-app { flex-direction: column; height: auto; }
  .map-app .map { height: 60vh; }
  .map-app .side { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .topbar .ctx { display: none; }
  .topbar nav { display: none; }
}

/* ===========================================================================
   Dark mode  ([data-theme="dark"] on <html>)
   Chrome + content go dark; charts, maps and Learn diagram stages keep a light
   surface (via CSS-variable re-scoping) so their baked-in navy/red data colours
   and diagram strokes stay legible.
   =========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;   /* native controls (inputs, scrollbars) render dark */
  --field:#1c2942;      /* shared input surface — sits above both --card and --bg-2 */
  --ink:#e9eefb; --ink-2:#bcc7de; --muted:#8b9ab5;
  --line:#28324c; --bg:#0b1220; --bg-2:#0f1830; --card:#151f37; --header:#0f1830;
  --blue:#5b8def; --blue-2:#83b0ff; --blue-soft:#17233f;
  --red:#e0567a; --red-2:#ff6f8f; --red-soft:#2b1622;
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.45);
  --shadow-sm:0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:0 20px 50px rgba(0,0,0,.6);
  color-scheme:dark;
}
[data-theme="dark"] .topbar { background:rgba(13,22,44,.9); }
[data-theme="dark"] .btn:hover { background:var(--bg-2); border-color:var(--line); }
[data-theme="dark"] .opt:hover { background:var(--bg-2); border-color:var(--line); }
[data-theme="dark"] table.data tbody tr:hover { background:var(--bg-2); }
[data-theme="dark"] .btn.primary:hover { background:var(--blue-2); border-color:var(--blue-2); }
[data-theme="dark"] .btn.accent:hover { background:var(--red-2); border-color:var(--red-2); }
[data-theme="dark"] .topbar .cta:hover { background:var(--blue-2); }
[data-theme="dark"] .linkrow a:hover { background:var(--blue-soft); }
[data-theme="dark"] .hero-bg { background-color:#0d1731;
  background-image:radial-gradient(rgba(131,176,255,.06) 2.2px,transparent 2.2px),
                   radial-gradient(rgba(224,86,122,.05) 2.2px,transparent 2.2px); }
/* keep data-viz + diagram surfaces light (re-scope the tokens they read) */
[data-theme="dark"] .card:has(canvas),
[data-theme="dark"] .card:has([id$="map"]),
[data-theme="dark"] .pge-map-card {
  --card:#ffffff; --ink:#10203a; --ink-2:#3a4a63; --muted:#6b7a90; --line:#e4e9f1;
  --blue:#0a3161; --blue-2:#1d4ed8; background:#ffffff;
}

/* theme toggle button (topbar) */
.theme-toggle { display:inline-grid; place-items:center; width:38px; height:38px; border-radius:10px;
  border:1px solid var(--line); background:transparent; color:var(--ink-2); cursor:pointer; flex:none; }
.theme-toggle:hover { background:var(--blue-soft); color:var(--blue); }
.theme-toggle .sun { display:none; } .theme-toggle .moon { display:inline; }
[data-theme="dark"] .theme-toggle .moon { display:none; } [data-theme="dark"] .theme-toggle .sun { display:inline; }
