/* shadcn/ui and ReUI-style tokens, softened so neither mode is harsh on the eyes:
   no pure white or black, gentle contrast, muted status and chart colours. */
:root, [data-theme="light"] {
  --background: #f6f6f7; --foreground: #2b2b30; --card: #fcfcfd; --muted: #efeff1; --muted-foreground: #6a6a73;
  --accent: #e9e9ed; --border: #e3e3e7; --input: #d9d9df; --ring: #9d9da8;
  --primary: #34343a; --primary-foreground: #f6f6f7; --seg-active: #fcfcfd;
  --success-bg: #e8f3ec; --success: #2e6e4f; --success-border: #cfe6d8;
  --warning-bg: #fbf2e2; --warning: #82581a; --warning-border: #f0dfbd;
  --danger-bg: #f9ecec; --danger: #a84848; --danger-border: #eed2d2;
  --c-base: #8c86d4; --c-eei: #58a98c; --c-afa: #d68a69; --c-retail: #a0a0a8; --c-tax: #6f9fd3;
  --shadow-xs: 0 1px 2px rgb(20 20 30 / 0.05);
  --shadow-sm: 0 1px 3px rgb(20 20 30 / 0.08), 0 1px 2px rgb(20 20 30 / 0.04);
  color-scheme: light;
}
[data-theme="dark"] {
  --background: #1b1b1f; --foreground: #dedee3; --card: #222227; --muted: #2a2a30; --muted-foreground: #9e9ea8;
  --accent: #303037; --border: #33333a; --input: #3d3d45; --ring: #707079;
  --primary: #dedee3; --primary-foreground: #1b1b1f; --seg-active: #3a3a42;
  --success-bg: #1f2f27; --success: #8ccaa9; --success-border: #2c4437;
  --warning-bg: #33291a; --warning: #dcb26f; --warning-border: #4a3b24;
  --danger-bg: #332223; --danger: #e19a9a; --danger-border: #4a3032;
  --c-base: #9d97dc; --c-eei: #6fb89c; --c-afa: #dc9a7c; --c-retail: #9a9aa3; --c-tax: #82acd9;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.25);
  --shadow-sm: 0 2px 6px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

:root { --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; --col: 780px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--col); margin: 0 auto; padding: 0 16px 48px; }
h1 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
ul { margin: 0; padding-left: 1.2rem; }
li + li { margin-top: 4px; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--foreground); }
[hidden] { display: none !important; }

.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--muted-foreground); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.lead { font-size: 16px; line-height: 1.75; }
.big { font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.stat { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.9; color: var(--muted-foreground); }
.up, .t-up { color: var(--danger); }
.down, .t-down { color: var(--success); }
.icon { width: 15px; height: 15px; flex: none; }
[data-icon] { display: inline-flex; }

/* ---------- controls ---------- */
button, select, input { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; background: var(--card); color: var(--foreground);
  border: 1px solid var(--input); border-radius: 8px; box-shadow: var(--shadow-xs);
  font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover { background: var(--accent); }
button[aria-pressed="true"]:not(.seg button) { background: var(--accent); border-color: var(--ring); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); margin-top: 12px; }
.btn-primary:hover { background: var(--primary); opacity: .9; }
.btn-icon { width: 34px; padding: 0; }
.chip { height: 30px; padding: 0 10px; font-size: 13px; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent); border-color: var(--ring); }
input, select {
  height: 36px; width: 100%; min-width: 0; padding: 0 10px; font-size: 15px;
  background: var(--card); border: 1px solid var(--input); border-radius: 8px; box-shadow: var(--shadow-xs);
}

/* segmented control, same look as shadcn TabsList */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 10px; }
.seg button { height: 28px; padding: 0 10px; border: 1px solid transparent; background: transparent; box-shadow: none; color: var(--muted-foreground); border-radius: 7px; }
.seg button:hover { color: var(--foreground); background: transparent; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--seg-active); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-xs); }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; margin: 20px 0 16px; }
.tabs button { height: 34px; font-size: 14px; }
.subtabs { margin-bottom: 14px; flex-wrap: wrap; }
.sm { display: none; }

/* ---------- layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.topbar-inner { max-width: var(--col); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); display: inline-flex; align-items: center; justify-content: center; }
.logo .icon { width: 17px; height: 17px; }
.actions { display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hero h2 { font-size: 22px; line-height: 1.3; margin: 0; max-width: 520px; letter-spacing: -0.02em; }
.type-seg button { height: 32px; padding: 0 12px; }
.section-head { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.section-head .subtabs { margin: 0; }
.section-head .type-seg { margin-left: auto; flex: none; }
.type-seg button[aria-pressed="false"] .type-lbl { display: none; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-xs); }
.soft { background: var(--muted); border-radius: 10px; padding: 14px 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.stack > * + * { margin-top: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }

/* badges and alerts, ReUI "light" style */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.pill .icon { width: 12px; height: 12px; }
.pill.warn { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.pill.ok { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.pill.bad { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.warnbox { display: flex; gap: 8px; align-items: flex-start; background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0; }
.warnbox .icon { margin-top: 2px; }
/* Why box: one colour family, stronger tone on top (cause), lighter tone below (summary). */
.cause-box { --tone: var(--foreground); --tone-bg: var(--muted); --tone-border: var(--border); border: 1px solid var(--tone-border); border-radius: 10px; overflow: hidden; margin: 10px 0; }
.cause-up { --tone: var(--warning); --tone-bg: var(--warning-bg); --tone-border: var(--warning-border); }
.cause-down { --tone: var(--success); --tone-bg: var(--success-bg); --tone-border: var(--success-border); }
.cause { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 14px; font-weight: 600; color: var(--tone); background: var(--tone-bg); }
.cause .icon { margin-top: 3px; flex: none; }
.cause-sum { padding: 12px 14px; background: color-mix(in srgb, var(--tone-bg) 40%, var(--card)); border-top: 1px solid var(--tone-border); }
/* Who decides */
h3 { font-size: 14px; font-weight: 600; margin: 14px 0 4px; }
.split-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 10px 0 4px; }
.who-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.who-step:last-of-type { border-bottom: 0; }
.who-step .formula { line-height: 1.6; margin: 4px 0; white-space: normal; }
.who-step ul { margin: 4px 0 0; padding-left: 18px; }
.step-no { width: 26px; height: 26px; border-radius: 50%; background: var(--muted); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
ol.flow { list-style: none; counter-reset: f; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
ol.flow li { counter-increment: f; background: var(--muted); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
ol.flow li::before { content: counter(f) ". "; font-weight: 600; }
/* Map: three layers of boxes with lines drawn between them */
.map { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 48px; margin: 14px 0 12px; padding: 0 26px; }
.map-layer { display: flex; flex-direction: column; gap: 8px; }
.map-layer-title { font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.map-nodes { display: flex; flex-direction: column; gap: 10px; justify-content: space-around; flex: 1; }
.map-node { justify-content: flex-start; gap: 8px; height: auto; min-height: 40px; padding: 8px 10px; white-space: normal; text-align: left; line-height: 1.25; font-size: 13px; background: var(--card); transition: color .15s, border-color .15s; }
.map-bill .map-node { background: var(--muted); border-color: var(--border); }
.map-node .icon { flex: none; }
#whoDetail .line-title { display: flex; gap: 6px; align-items: center; }
.map-node[aria-pressed="true"] { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground); }
.map.focus .map-node:not([aria-pressed="true"]):not(.near) { color: color-mix(in srgb, var(--muted-foreground) 70%, var(--card)); border-color: var(--border); box-shadow: none; }
.map.focus .map-node.near { border-color: var(--ring); }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.map-lines path { fill: none; stroke: var(--input); stroke-width: 1.5; }
.map-lines path.halo { stroke: var(--card); stroke-width: 5; }
.map.focus .map-lines path:not(.on) { opacity: 0.35; }
.map.focus .map-lines path.on { stroke: var(--foreground); stroke-width: 2; }
.map.focus .map-lines path.halo.on { stroke: var(--card); stroke-width: 6; }
/* 45.40 vs home and shop rate */
.avg-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.avg-label { display: flex; flex-direction: column; font-weight: 500; }
.avg-bar { height: 10px; background: var(--muted); border-radius: 5px; overflow: hidden; }
.avg-bar span { display: block; height: 100%; background: var(--c-retail); border-radius: 5px; }
.avg-mid .avg-bar span { background: var(--foreground); }
.avg-you .avg-bar span { background: var(--c-base); }
/* ICPT vs AFA: two columns, headers once */
.vs { display: grid; gap: 8px; }
.vs-head, .vs-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vs-head > div { display: flex; flex-direction: column; gap: 2px; background: var(--muted); border-radius: 10px; padding: 10px 12px; }
.vs-head b { font-size: 16px; }
.vs-label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 6px; }
.vs-cells > div { background: var(--muted); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.vs .vs-now { background: color-mix(in srgb, var(--c-afa) 16%, var(--card)); }
.strip { display: flex; align-items: flex-end; gap: 2px; height: 38px; margin: 8px 0 4px; }
.strip span { flex: 1; border-radius: 2px 2px 0 0; background: var(--c-retail); }
.strip .pos { background: var(--c-afa); }
.strip .neg { background: var(--c-eei); }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 3px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.linkbtn .icon { width: 14px; height: 14px; }

/* ---------- formula ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex: none; }
.dot-base { background: var(--c-base); } .dot-eei { background: var(--c-eei); } .dot-afa { background: var(--c-afa); }
.dot-retail { background: var(--c-retail); } .dot-tax { background: var(--c-tax); }
.u-base, .u-eei, .u-afa, .u-retail, .u-tax { border-bottom: 2px solid; padding-bottom: 1px; }
.u-base { border-color: var(--c-base); } .u-eei { border-color: var(--c-eei); } .u-afa { border-color: var(--c-afa); }
.u-retail { border-color: var(--c-retail); } .u-tax { border-color: var(--c-tax); }
.formula { font-family: var(--mono); font-size: 13px; line-height: 2.3; }
.formula span { white-space: nowrap; }
.formula-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; padding: 2px 0 8px; margin-bottom: 8px; }
.formula-chips .chip { height: 28px; padding: 0 8px; font-size: 12.5px; }
.formula-chips .dot { width: 7px; height: 7px; margin-right: 5px; }
.formula-chips .result { font-size: 14px; font-weight: 600; white-space: nowrap; }
.formula-chips .op { color: var(--muted-foreground); font-weight: 500; }

.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line:last-child { border-bottom: 0; }
.line .amt { text-align: right; align-self: center; font-size: 15px; font-weight: 500; white-space: nowrap; }
.line-title { font-weight: 500; display: flex; align-items: center; }
.lever, .tip { display: flex; gap: 12px; align-items: flex-start; }
.badge-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--muted); display: grid; place-items: center; flex: none; }

/* ---------- bill entry ---------- */
.note { display: flex; gap: 8px; align-items: flex-start; }
.note .icon { margin-top: 3px; color: var(--success); }
.endday { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.endday input { width: 64px; }
.billrows { display: flex; flex-direction: column; gap: 8px; }
.billrow { display: grid; grid-template-columns: minmax(0, 1fr) 140px 36px; gap: 8px; align-items: end; }
.billrow label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.billrow .lbl { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.billrow + .billrow .lbl { display: none; }
.billrow .f-remove { height: 36px; width: 36px; color: var(--muted-foreground); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 10px; }

/* ---------- results ---------- */
.bill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.picker select { width: auto; }
.table-wrap { overflow-x: auto; margin-top: 4px; border: 1px solid var(--border); border-radius: 10px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.cmp th, table.cmp td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
table.cmp td:first-child { white-space: normal; }
table.cmp th { font-size: 12px; font-weight: 600; color: var(--muted-foreground); background: var(--muted); }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--card); }
table.cmp th:first-child { background: var(--muted); }
table.cmp td:first-child { font-weight: 500; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp .sub td { color: var(--muted-foreground); font-size: 12.5px; }
table.cmp .total td, table.cmp .total td:first-child { font-weight: 600; background: var(--muted); }
table.cmp .diff { background: color-mix(in srgb, var(--muted) 55%, transparent); }
table.cmp .sel { background: color-mix(in srgb, var(--c-base) 12%, transparent); }
table.cmp th.sel { background: color-mix(in srgb, var(--c-base) 20%, var(--muted)); }
.th-btn { height: 26px; padding: 0 8px; font-size: 12px; font-weight: 600; background: var(--card); border-color: var(--border); box-shadow: none; color: var(--foreground); }
.th-btn[aria-pressed="true"] { border-color: var(--c-base); }
.bar-g { cursor: pointer; outline: none; }
.bar-g:hover .s-bar { fill-opacity: 0.6; }
.bar-g.on:hover .s-bar { fill-opacity: 0.85; }
.bar-g:focus-visible .s-bar { stroke: var(--ring); stroke-width: 3; }
#multi { margin-bottom: 18px; }
#detail { border-top: 1px solid var(--border); padding-top: 16px; scroll-margin-top: 70px; }
#multi[hidden] + #detail { border-top: 0; padding-top: 0; }
.detail-head { font-size: 17px; margin-bottom: 2px; }

svg text { font-family: inherit; }
.s-text { fill: var(--foreground); } .s-muted { fill: var(--muted-foreground); }
.s-up { fill: var(--danger); } .s-down { fill: var(--success); }
.s-axis { stroke: var(--input); } .s-grid { stroke: var(--border); }
.s-bar { fill: var(--primary); }

details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--card); }
details summary { cursor: pointer; font-size: 13px; font-weight: 500; }
table.src { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.src td { padding: 6px; border-top: 1px solid var(--border); vertical-align: top; }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); }

/* back-to-top, centred at the bottom of the screen */
.to-top {
  position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); box-shadow: var(--shadow-sm);
}
.to-top:hover { background: var(--primary); opacity: .9; }
.to-top .icon { width: 18px; height: 18px; }
.bottom-nav { display: none; }

/* tap-to-explain short forms */
.term {
  display: inline; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: inherit; color: inherit; white-space: normal; cursor: help;
  text-decoration: underline dotted; text-decoration-color: var(--muted-foreground); text-underline-offset: 3px;
}
.term:hover { background: none; text-decoration-color: var(--foreground); }
.term-pop {
  position: absolute; z-index: 40; width: min(320px, calc(100vw - 16px)); padding: 12px 14px;
  background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); font-size: 13.5px;
}
.term-pop p { margin: 4px 0 0; color: var(--muted-foreground); }
dl.terms { margin: 0; }
dl.terms dt { font-weight: 600; margin-top: 14px; }
dl.terms dt:first-child { margin-top: 0; }
dl.terms dd { margin: 2px 0 0; color: var(--muted-foreground); }

.many table.cmp { font-size: 12.5px; }
.many table.cmp th, .many table.cmp td { padding: 7px 6px; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .lg { display: none; }
  .sm { display: inline; }
  .tabs { display: none; }
  .hero { margin: 14px 0 16px; flex-direction: column; align-items: stretch; }
  .hero h2 { font-size: 19px; }
  .section-head { align-items: stretch; margin-bottom: 12px; }
  .section-head .subtabs { flex: 1; min-width: 0; }
  .type-seg button { flex-direction: column; gap: 2px; height: auto; min-height: 52px; padding: 6px 8px; font-size: 11.5px; }
  .subtabs { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); width: 100%; }
  .subtabs button { flex-direction: column; height: auto; min-height: 52px; padding: 6px 2px; white-space: normal; line-height: 1.2; font-size: 11.5px; text-align: center; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--card); border-top: 1px solid var(--border); padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgb(0 0 0 / 0.04);
  }
  .bottom-nav button { flex-direction: column; gap: 2px; height: 58px; padding: 0 2px; border: 0; background: transparent; box-shadow: none; border-radius: 10px; color: var(--muted-foreground); font-size: 11.5px; }
  .bottom-nav button .icon { width: 22px; height: 22px; }
  .bottom-nav button[aria-selected="true"] { color: var(--foreground); background: var(--muted); }
  .to-top { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; border-radius: 12px; }
  .big { font-size: 26px; }
  input, select { font-size: 16px; }
  .billrow { grid-template-columns: 1fr 40px; grid-template-areas: "month remove" "kwh kwh"; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); }
  .billrow + .billrow .lbl { display: block; }
  .billrow .f-month { grid-area: month; } .billrow .f-kwh { grid-area: kwh; }
  .billrow .f-remove { grid-area: remove; height: 42px; width: 40px; }
  .billrow input, .billrow select { height: 42px; }
  .picker select { flex: 1; min-width: 120px; }
  .formula { font-size: 12.5px; }
  #addRow, .btn-primary { width: 100%; height: 42px; }
  .map { gap: 8px 16px; padding: 0 12px; }
  .map-layer-title { font-size: 10px; letter-spacing: 0.02em; }
  .map-node { font-size: 11.5px; padding: 6px; min-height: 34px; hyphens: auto; }
  .map-node .icon, .map-node .dot { display: none; }
  .avg-row { grid-template-columns: 1fr auto; }
  .avg-bar { grid-column: 1 / -1; grid-row: 2; }
  table.cmp { font-size: 12.5px; }
  table.cmp th, table.cmp td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
