/* Shell: an app shell. A rail on the left for where to go, a slim bar on top
   for where you are, and a stage with one primary panel and quieter ones
   around it. Loaded after the base sheet, which still draws the pieces this
   file does not (chart text, badges, forms); everything visible is re-set here.

   Type: Geist (OFL), tabular figures throughout. Colour: warm sage canvas,
   white panels, deep-ink actions. Fuels keep their three hues and nothing else
   in the interface is allowed to compete with them. */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page:           #eef0ea;
  --rail:           #fafbf8;
  --surface-1:      #ffffff;
  --surface-2:      #f3f5f0;
  --text-primary:   #15201b;
  --text-secondary: #3c4741;
  --text-muted:     #5a655f;
  --gridline:       #e6e9e2;
  --axis:           #bcc4ba;
  --border:         rgba(21, 32, 27, 0.11);
  --border-strong:  rgba(21, 32, 27, 0.30);
  --shadow:         0 1px 2px rgba(21, 32, 27, 0.05), 0 6px 18px -10px rgba(21, 32, 27, 0.12);
  --dot:            transparent;
  --ink:            #17261f;
  --on-ink:         #ffffff;

  --series-1:       #b25e05;
  --series-2:       #2a55c6;
  --series-3:       #0a7c77;
  --on-series:      #ffffff;
  --link:           #17604a;
  --seq-100:        #f1e2c4;
  --seq-250:        #e2b56f;

  --good:           #2a8a45;
  --good-text:      #1d6a32;
  --warning:        #d99a14;
  --critical:       #c0321f;

  --radius:         12px;
  --radius-sm:      8px;
  --rail-w:         236px;
  --ease:           cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0f1512; --rail: #121a16; --surface-1: #172019; --surface-2: #1d2821;
    --text-primary: #eef2ec; --text-secondary: #c6cec5; --text-muted: #94a094;
    --gridline: #25302a; --axis: #3d4a42;
    --border: rgba(238, 242, 236, 0.11); --border-strong: rgba(238, 242, 236, 0.34);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -12px rgba(0,0,0,.6);
    --ink: #e8efe6; --on-ink: #101813;
    --series-1: #f0a62e; --series-2: #7aa5f5; --series-3: #3dc2b4; --on-series: #11150f;
    --link: #7fd1ae; --seq-100: #4a3510; --seq-250: #8a5f17;
    --good: #4cc267; --good-text: #5fd079; --critical: #ff6b55;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1512; --rail: #121a16; --surface-1: #172019; --surface-2: #1d2821;
  --text-primary: #eef2ec; --text-secondary: #c6cec5; --text-muted: #94a094;
  --gridline: #25302a; --axis: #3d4a42;
  --border: rgba(238, 242, 236, 0.11); --border-strong: rgba(238, 242, 236, 0.34);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -12px rgba(0,0,0,.6);
  --ink: #e8efe6; --on-ink: #101813;
  --series-1: #f0a62e; --series-2: #7aa5f5; --series-3: #3dc2b4; --on-series: #11150f;
  --link: #7fd1ae; --seq-100: #4a3510; --seq-250: #8a5f17;
  --good: #4cc267; --good-text: #5fd079; --critical: #ff6b55;
}

/* ------------------------------------------------------------- base reset */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0; padding: 0;
  background: var(--page); background-image: none;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
section { margin-bottom: 0; }
code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ------------------------------------------------------------------- rail */

.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px 14px;
  background: var(--rail); border-right: 1px solid var(--border);
  z-index: 30; overflow-y: auto;
}
.rail-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 16px; color: var(--text-primary); text-decoration: none;
  font-weight: 650; font-size: 15px; letter-spacing: -0.015em;
}
.rail-brand .mark { width: 26px; height: 26px; border-radius: 7px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-group { padding: 16px 10px 5px; }
.rail-group span { font-size: 11px; font-weight: 550; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }

.rail-nav a, .rail-foot button {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none;
  font: inherit; font-size: 14px; font-weight: 500;
  background: transparent; border: 0; box-shadow: none; cursor: pointer; width: 100%; text-align: left;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.rail-nav a:hover, .rail-foot button:hover { background: var(--surface-2); color: var(--text-primary); border: 0; }
.rail-nav a:active, .rail-foot button:active { transform: none; box-shadow: none; }
.rail-nav a .ico, .rail-foot .ico { flex: none; opacity: .75; transition: opacity 140ms, color 140ms; }
.rail-nav a:hover .ico { opacity: 1; }
.rail-nav a.on { background: var(--ink); color: var(--on-ink); }
.rail-nav a.on .ico { opacity: 1; }
.rail-nav a.empty:not(.on) { color: var(--text-muted); }
.rail-nav a.fuel-electric .ico { color: var(--series-1); }
.rail-nav a.fuel-gas .ico { color: var(--series-2); }
.rail-nav a.fuel-water .ico { color: var(--series-3); }
.rail-nav a.on.fuel-electric .ico, .rail-nav a.on.fuel-gas .ico, .rail-nav a.on.fuel-water .ico { color: var(--on-ink); }
.rail-nav a.add { margin-top: 2px; border: 1px dashed var(--border-strong); }
.rail-nav a.add:hover { border-style: solid; }

.rail-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }

/* -------------------------------------------------------------- bar/stage */

.main { margin-left: var(--rail-w); min-height: 100vh; }
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px; padding: 0 28px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumb { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }
.crumb h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.crumb h1 small { font-weight: 450; color: var(--text-muted); font-size: 13px; letter-spacing: 0; }
.chip-home { font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 99px; background: var(--surface-1); border: 1px solid var(--border); }
.period { color: var(--text-muted); font-size: 13px; }
.bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bar-right form.inline { margin: 0; }

.stage { padding: 22px 28px 64px; max-width: 1320px; }

/* ---------------------------------------------------------------- controls */

button, .btn, select, input[type="number"] {
  font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 12px; box-shadow: none; cursor: pointer; text-decoration: none;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 90ms var(--ease), color 140ms;
}
button:hover, .btn:hover, select:hover { background: var(--surface-2); border-color: var(--border-strong); }
button:active:not(.table-toggle):not(.link), .btn:active { transform: scale(.97); box-shadow: none; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--series-2); outline-offset: 2px;
}
button.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
button.primary:hover { background: var(--ink); filter: brightness(1.25); }
button.link { background: none; border: 0; color: var(--link); padding: 2px 4px; text-decoration: underline; }
button.danger { color: var(--critical); }
select { padding-right: 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="number"] {
  font: inherit; font-size: 13.5px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; cursor: text;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="date"]:focus { outline: 2px solid var(--series-2); outline-offset: 0; border-color: transparent; }

.field label, .field .label { font-size: 12px; font-weight: 550; color: var(--text-secondary); text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.field .hint { font-weight: 400; color: var(--text-muted); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* ---------------------------------------------------------------- panels */

.panel, .card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px 20px; min-width: 0; position: relative;
}
.card::before { display: none; }
.panel-h, .card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel h2, .card h2 {
  margin: 0; font-family: var(--font-body); font-size: 14px; font-weight: 620;
  text-transform: none; letter-spacing: -0.005em; color: var(--text-primary);
}
.panel .note, .card .note, .note { margin: 2px 0 0; color: var(--text-muted); font-size: 12.5px; }
.card .note { margin: 2px 0 12px; }
.panel-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { font-size: 12px; font-weight: 550; color: var(--text-muted); letter-spacing: .01em; }

.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.chart-head .note { margin-bottom: 4px; }
.table-toggle {
  font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid transparent; color: var(--text-secondary); white-space: nowrap; flex: none;
}
.table-toggle:hover { border-color: var(--border-strong); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); align-items: center; }
.legend .swatch { border-radius: 3px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.chart-head + .legend, .card .legend { margin-bottom: 8px; }
.panel-tools .legend { margin: 0; }

.table-view { margin-top: 10px; }
table { font-size: 13px; }
thead th { font-family: var(--font-body); font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.up { color: var(--critical); } .down { color: var(--good-text); }

.part { margin: 26px 0 10px; }
.part h2 { margin: 0; font-family: var(--font-body); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; text-transform: none; }
.part p { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }

.grid { display: grid; gap: 16px; }
.flash { border-radius: var(--radius-sm); margin-bottom: 14px; }
.foot, footer.foot { color: var(--text-muted); font-size: 12.5px; margin: 8px 0 0; padding: 0; border: 0; }

/* the numbers that lead a panel */
.big { font-size: 46px; font-weight: 620; letter-spacing: -0.04em; line-height: 1.05; margin: 2px 0 4px; }
.big-sub { color: var(--text-secondary); font-size: 13.5px; }
.big-sub .up, .hero-meta .up { color: var(--critical); font-weight: 600; }
.big-sub .down, .hero-meta .down { color: var(--good-text); font-weight: 600; }
.why { margin: 8px 0 0; max-width: 60ch; font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.why strong { color: var(--text); font-weight: 600; }
.why .up { color: var(--critical); font-weight: 600; }
.why .down { color: var(--good-text); font-weight: 600; }

.delta-pill { border-radius: 99px; background: var(--surface-2); border: 0; padding: 2px 10px 2px 8px; font-size: 12.5px; font-weight: 550; }
.delta-pill .dot { border-radius: 50%; transform: none; width: 7px; height: 7px; }

/* a quiet strip of facts: not tiles, a ruled line */
.statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--gridline); gap: 0; }
.statline > div { padding: 0 16px; border-left: 1px solid var(--gridline); min-width: 0; }
.statline > div:first-child { padding-left: 0; border-left: 0; }
.statline dt { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.statline dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.statline .sf { font-size: 12px; color: var(--text-muted); }

/* ---------------------------------------------------------------- overview */

.ov { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ov .lead { display: grid; gap: 16px; min-width: 0; }
.ov .side { display: grid; gap: 16px; min-width: 0; }
#alerts { max-height: 380px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.ov > .foot { grid-column: 1 / -1; }
.ov .primary .panel-h { margin-bottom: 4px; }

.frows { display: grid; margin: 0 -8px; }
.frow {
  display: block; padding: 14px 12px; margin: 0; border-radius: 10px; text-decoration: none; color: inherit;
  transition: background 150ms var(--ease);
}
.frow + .frow { border-top: 1px solid var(--gridline); border-radius: 0; }
.frow:hover { background: var(--surface-2); border-radius: 10px; }
.frow:hover + .frow { border-top-color: transparent; }
.frow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fuel-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.dot-lg { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.frow .figure { font-size: 26px; font-weight: 620; letter-spacing: -0.035em; line-height: 1; }
.frow-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sub-line { color: var(--text-muted); font-size: 12.5px; }
.split-line { margin-top: 8px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.split-line .up { color: var(--critical); font-weight: 600; } .split-line .down { color: var(--good-text); font-weight: 600; }
.frow .facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gridline); }
.fact .k { font-size: 11.5px; color: var(--text-muted); font-weight: 500; font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
.fact .v { font-size: 13px; font-weight: 600; }
.frow .go { margin-top: 10px; font-size: 12px; color: var(--link); font-weight: 550; }
.frow:hover .go span { display: inline-block; transform: translateX(3px); }
.frow .go span { transition: transform 150ms var(--ease); }

.alert-row { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--gridline); align-items: flex-start; }
.alert-row:last-child { border-bottom: 0; padding-bottom: 0; }
.alert-row .tag { border-radius: 99px; border: 0; background: var(--surface-2); font-family: var(--font-body); font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 2px 9px; color: var(--text-secondary); }
.alert-row .t { font-size: 13px; font-weight: 600; }
.alert-row .d { font-size: 12.5px; color: var(--text-secondary); }
.alert-row a { font-weight: 550; }

.carbon-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.tiles-col { display: grid; gap: 0; }

/* tiles, wherever the JS still makes them: ruled rows, not boxes */
.tile { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 10px 0; border-bottom: 1px solid var(--gridline); }
.tile:last-child { border-bottom: 0; }
.tile .label { font-family: var(--font-body); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.tile .value { font-family: var(--font-body); font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin: 2px 0 0; }
.tile .foot { font-size: 12px; color: var(--text-muted); }
.tile .key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 1100px) {
  .ov { grid-template-columns: minmax(0, 1fr); }
  .carbon-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .rail {
    inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; align-items: stretch; gap: 0;
    padding: 0 6px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--border);
    overflow: visible;
  }
  .rail-brand, .rail-group, .rail-nav a.add { display: none; }
  .rail-nav { flex-direction: row; flex: 1; gap: 0; justify-content: space-around; align-items: stretch; }
  .rail-nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; font-size: 10.5px; width: auto; text-align: center; min-width: 0; }
  .rail-nav a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
  .rail-nav a.on { background: none; color: var(--text-primary); box-shadow: inset 0 2px 0 var(--ink); border-radius: 0; }
  .rail-nav a.on .ico, .rail-nav a.on.fuel-electric .ico, .rail-nav a.on.fuel-gas .ico, .rail-nav a.on.fuel-water .ico { color: var(--text-primary); }
  .rail-foot { position: fixed; top: 9px; right: 12px; flex-direction: row; border: 0; padding: 0; gap: 6px; z-index: 40; }
  .rail-foot button { width: 36px; height: 34px; padding: 0; justify-content: center; background: var(--surface-1); border: 1px solid var(--border); }
  .rail-foot button span { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .bar { flex-wrap: wrap; padding: 8px 150px 8px 16px; }
  .bar-right { flex: 1 1 100%; justify-content: flex-start; }
  .stage { padding: 16px 16px 40px; }
  .big { font-size: 38px; }
  .statline { grid-template-columns: 1fr; gap: 10px; }
  .statline > div { padding: 0; border: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .statline dd { font-size: 17px; }
  .period { display: none; }
  .month-grid, .statline.cols-4 { grid-template-columns: 1fr; }
  .month-hero .hero-figure { font-size: 44px; }
}

/* ---------------------------------------------------------------- fuel page */

.fuel-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.fuel-top .side { display: grid; gap: 16px; min-width: 0; }
.hero-panel { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 8px 28px; padding-bottom: 6px; }
.hero-l { padding-top: 2px; }
.hero-label { color: var(--text-muted); font-size: 12.5px; font-weight: 550; margin: 0; }
.hero-figure { font-family: var(--font-body); font-size: 62px; font-weight: 620; letter-spacing: -0.05em; line-height: 1.02; margin: 4px 0 10px; }
.hero-meta { color: var(--text-secondary); font-size: 13px; }
.hero-forecast { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.hero-forecast .note { margin: 2px 0 0; }
.hero-r { border-left: 1px solid var(--gridline); padding-left: 24px; min-width: 0; }
.hero-r .chart-head { margin-bottom: 0; }

/* the stat tiles become one ruled strip along the bottom of the primary panel */
.strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; border-top: 1px solid var(--gridline); }
.strip .tile { border: 0; border-left: 1px solid var(--gridline); padding: 14px 16px; }
.strip .tile:first-child { border-left: 0; padding-left: 0; }
.strip .tile .value { font-size: 20px; }
.strip:empty { display: none; }

.streak { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); border: 0; }
.streak .count { font-family: var(--font-body); font-size: 44px; font-weight: 620; letter-spacing: -0.04em; line-height: 1; }
.streak .copy { font-size: 13px; color: var(--text-secondary); }
.pip { border-radius: 3px; height: 6px; width: 16px; }

.tabs { display: flex; gap: 4px; margin: 22px 0 16px; border-bottom: 1px solid var(--border); position: sticky; top: 58px; z-index: 10; background: var(--page); overflow-x: auto; scrollbar-width: none; }
.tab {
  font: inherit; font-size: 13.5px; font-weight: 550; color: var(--text-muted);
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 10px 14px; margin-bottom: -1px; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color 140ms, border-color 140ms var(--ease);
}
.tab:hover { background: none; color: var(--text-primary); border-color: var(--border-strong); border-top: 0; border-left: 0; border-right: 0; }
.tab.on { color: var(--text-primary); border-bottom-color: var(--ink); border-top: 0; border-left: 0; border-right: 0; }
.tab:active { transform: none; }

.pane:not([hidden]), #insights:not([hidden]) { display: grid; gap: 16px; animation: rise 260ms var(--ease); }
.pane > *, #insights > * { min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pane .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pane .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pane .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pane .part { margin: 10px 0 -4px; }
#add { scroll-margin-top: 120px; }
#empty-state:not([hidden]) ~ :not(.foot):not(script) { display: none; }
.empty-ways { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.empty-ways > div { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.empty-ways h3 { margin: 0 0 4px; font-size: 14px; }
.empty-ways p { margin: 0; font-size: 13px; color: var(--text-secondary); }

.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); padding: 26px; text-align: center; color: var(--text-secondary); transition: background 140ms, border-color 140ms; }
.dropzone:hover, .dropzone.over { background: var(--surface-1); border-color: var(--ink); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.badge { border-radius: 10px; }
.level-title { font-family: var(--font-body); font-size: 18px; font-weight: 620; letter-spacing: -0.02em; text-transform: none; }
.meter { border-radius: 99px; }
.meter > span { border-radius: 99px; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tip h3 { font-family: var(--font-body); }
.compare-controls .choice { border-radius: 99px; }
.calc label .k { font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
.calc-fig b { font-family: var(--font-body); }

@media (max-width: 1100px) {
  .fuel-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr); }
  .hero-r { border-left: 0; padding-left: 0; border-top: 1px solid var(--gridline); padding-top: 14px; }
  .hero-figure { font-size: 52px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .tile:nth-child(odd) { border-left: 0; padding-left: 0; }
  .tabs { top: 52px; }
  .pane .grid.cols-2, .pane .grid.cols-3, .pane .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .empty-ways { grid-template-columns: 1fr; }
}
#anomaly-list { overflow-x: auto; }
.strip .tile .value { font-size: 18px; }
.table-toggle { text-decoration: none; }
.part { border: 0; padding: 0; }
.rows .tile:first-child { padding-top: 0; }
.rows .tile .value { font-size: 20px; }
.rows .tile .label { font-weight: 550; }
.rows:empty { display: none; }

/* fuel page: hero across the top, two quieter panels beneath it */
.fuel-top { grid-template-columns: minmax(0, 1fr); }
.fuel-top .side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.rows .tile:nth-child(2) { padding-top: 0; }
.rows .tile:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 820px) {
  .fuel-top .side { grid-template-columns: minmax(0, 1fr); }
  .rows { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ year, raw, rates, homes */

.page-year .stage > section { margin-bottom: 16px; }
.year-nav { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 99px; }
.year-nav a { padding: 4px 14px; border-radius: 99px; text-decoration: none; color: var(--text-secondary); font-weight: 550; font-size: 13px; transition: background 140ms, color 140ms; }
.year-nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.year-nav a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.year-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 28px; align-items: center; }
.year-hero .hero-figure { font-size: 72px; }
.year-hero .hero-label { font-size: 13px; }
.year-share { border-left: 1px solid var(--gridline); padding-left: 24px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .address { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 8px; }
.pill { border-radius: 99px; font-size: 12px; font-weight: 550; padding: 3px 10px; background: var(--surface-2); border: 0; display: inline-block; margin: 2px 4px 2px 0; }
.grid.cols-1, .grid.cols-2, .grid.cols-3 { display: grid; gap: 16px; }
.year-fuel .fuel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.year-fuel .fuel-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.year-fuel .go { color: var(--text-muted); font-size: 12px; }
.year-fuel .figure { font-size: 38px; font-weight: 620; letter-spacing: -0.04em; margin: 8px 0 2px; line-height: 1.05; }
.year-fuel .sub-line { color: var(--text-muted); font-size: 12.5px; }
.year-fuel .facts { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gridline); }
.year-fuel .fact { display: flex; justify-content: space-between; gap: 12px; }
.year-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 6px; }
.year-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; text-align: center; font-size: 12px; color: var(--text-muted); }
.year-bar .stack { flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 1px; }
.year-bar .stack i { display: block; border-radius: 3px; transition: opacity 140ms; }
.year-bar:hover .stack i { opacity: .8; }
.year-bar span { margin-top: 6px; }
.year-bar { text-decoration: none; color: var(--text-muted); border-radius: 6px; }
.year-bar .stack { width: 100%; max-width: none; margin: 0; }
.year-bar .stack i { min-height: 2px; }
.year-bar:hover > span:last-child { color: var(--text-primary); font-weight: 600; }

.rate-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.offers { display: grid; }
.offer-row { border-radius: 8px; }
.home-card { display: block; text-decoration: none; color: inherit; transition: transform 150ms var(--ease), box-shadow 150ms; }
.home-card:hover { transform: translateY(-2px); }
.page-raw .table-view, .page-raw .stage .card { max-width: 100%; }
.page-rates .stage > *, .page-homes .stage > *, .page-raw .stage > * { margin-bottom: 16px; }
.page-rates #page > *, .page-homes .stage > .grid { margin-bottom: 16px; }
.page-homes .grid.cols-4, .page-rates .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-homes .grid.cols-4 .tile, .page-rates .grid.cols-4 .tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }

@media (max-width: 820px) {
  .year-hero { grid-template-columns: 1fr; }
  .year-share { border-left: 0; padding-left: 0; border-top: 1px solid var(--gridline); padding-top: 14px; }
  .hero-figure { font-size: 54px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .page-homes .grid.cols-4, .page-rates .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .table-view.scroll, #grid { overflow-x: auto; }
}

.add-narrow { display: none; }
@media (max-width: 820px) { .add-narrow { display: inline-block; } }
.year-nav a { font-family: var(--font-body); }

/* ---------------------------------------------------------------- month */

.page-month .stage { display: grid; gap: 16px; }
.month-nav { display: flex; gap: 6px; }
.month-hero .hero-figure { font-size: 56px; margin-bottom: 6px; }
.month-fuel .panel-h { align-items: center; margin-bottom: 4px; }
.month-fuel .fuel-name .sub-line { font-weight: 450; margin-left: 4px; }
.month-amt { font-size: 26px; font-weight: 620; letter-spacing: -0.035em; }
.statline.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 0; }
.statline dd .sf { font-size: 13px; font-weight: 500; }
.statline > div > .sf { margin-top: 2px; }
.month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gridline); }
.month-part h3 { margin: 0 0 4px; font-size: 12.5px; font-weight: 550; color: var(--text-muted); }
.month-part p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.month-part p + p { margin-top: 6px; }
.month-part .flag { color: var(--critical); }
.month-weather { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gridline); }
.month-weather h3 { margin: 0; font-size: 14px; font-weight: 620; }
.month-go { margin: 14px 0 0; font-size: 13px; color: var(--text-muted); }

/* ---------------------------------------------------------------- sign-in */

.page-login .narrow { max-width: 440px; margin: 24px auto 0; }
.page-login .card.auth h2 { font-size: 18px; }

/* ---------------------------------------------------------------- docs */

.page-docs .docs-nav { top: 74px; }
.page-docs .docs-body a { color: var(--link); }

/* ---------------------------------------------------------------- year by year */

.page-years .stage { display: grid; gap: 16px; }
.long-figures { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 8px; font-size: 52px; font-weight: 620; letter-spacing: -0.045em; line-height: 1; }
.long-figures small { display: block; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); margin-top: 6px; }
.long-figures .arrow { font-size: 28px; color: var(--text-muted); align-self: center; }
.long-hero .hero-meta { max-width: 720px; }
.years-table td, .years-table th { white-space: nowrap; }
.years-table tr.base td { background: var(--surface-2); }
.years-table .sf { font-size: 12px; color: var(--text-muted); }
@media (max-width: 820px) { .long-figures { font-size: 38px; } }
