:root {
  --paper: #fafaf6;
  --ink: #253c31;
  --muted: #68786e;
  --line: #dce2d7;
  --lime: #dafa65;
  --white: #fffffc;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #527d3f;
  outline-offset: 5px;
}
button {
  touch-action: manipulation;
}
button svg {
  flex-shrink: 0;
}
button[hidden],
[hidden] {
  display: none !important;
}
.app {
  max-width: 1720px;
  margin: auto;
  padding: clamp(20px, 3vw, 52px) clamp(20px, 4vw, 72px) 26px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.17em;
  font-weight: 750;
  margin: 0 0 16px;
}
.kicker svg {
  color: #698236;
}
h1 {
  font-size: clamp(32px, 3.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.055em;
  font-weight: 750;
  margin: 0;
}
.period {
  color: #88a34f;
}
.intro {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 0;
}
.mode-area {
  padding-top: 5px;
  min-height: 87px;
}
.controls {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: #f1f2eb;
  border: 1px solid var(--line);
  border-radius: 30px;
}
.controls button {
  border: 0;
  background: none;
  border-radius: 25px;
  padding: 12px 19px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  min-height: 42px;
}
.controls button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #afc29e;
}
.controls [aria-pressed="true"] .status-dot {
  background: var(--lime);
}
.mode-note {
  font-size: 10px;
  text-align: center;
  color: var(--muted);
  margin: 10px 0 0;
}
.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}
.stage {
  position: relative;
  aspect-ratio: 1400/650;
  width: 100%;
  max-height: 690px;
}
.scene,
#particles {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
}
.scene {
  overflow: visible;
}
#particles {
  pointer-events: none;
}
.source {
  cursor: pointer;
  outline: none;
}
.source-card {
  fill: var(--white);
  stroke: #e0e5db;
  stroke-width: 1.3;
  transition:
    fill 0.2s,
    stroke 0.2s;
}
.source:hover .source-card,
.source.chosen .source-card {
  fill: #f6faec;
  stroke: #a5bb8b;
}
.source:focus-visible .source-card,
.destination:focus-visible .focus-box {
  stroke: #527d3f;
  stroke-width: 3;
}
.source-label {
  font-size: 15px;
  font-weight: 700;
  fill: var(--ink);
  letter-spacing: -0.025em;
}
.source-value {
  font-size: 13.5px;
  font-weight: 600;
  fill: #4c6454;
  font-variant-numeric: tabular-nums;
}
.battery-state {
  font-size: 9.5px;
  font-weight: 500;
}
.destination-value {
  font-size: 14.5px;
  font-weight: 650;
  fill: #4c6454;
  font-variant-numeric: tabular-nums;
}
.estimate-marker {
  font-size: 11.5px;
  font-weight: 500;
}
.port {
  fill: #d9eeaa;
  stroke: var(--ink);
  stroke-width: 2;
}
.conduit {
  fill: none;
  stroke: #344d3e;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.conduit-core {
  fill: none;
  stroke: #e5ecd9;
  stroke-width: 3.6;
  stroke-linecap: round;
}
.hub-halo {
  fill: #f0f4e2;
}
.hub-outer {
  fill: #eff4d7;
  stroke: var(--ink);
  stroke-width: 3;
}
.hub-inner {
  fill: #dafa7b;
  stroke: var(--ink);
  stroke-width: 2;
}
.hub-label {
  font-size: 10px;
  fill: #677760;
  letter-spacing: 0.2em;
  font-weight: 700;
}
.scene-kicker {
  font-size: 10px;
  font-weight: 650;
  fill: #71816f;
  letter-spacing: 0.18em;
}
.destination {
  cursor: pointer;
  outline: none;
}
.destination-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  fill: var(--ink);
}
.focus-box {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  rx: 14;
}
.destination:hover .focus-box,
.destination.chosen .focus-box {
  fill: #eef2e64a;
  stroke: #b1c39d;
}
.hill {
  fill: #caddb2;
}
.rotor {
  animation: spin 9s linear infinite;
  transform-origin: 0 0;
}
.flow-water {
  stroke-dasharray: 5 7;
  animation: water 2s linear infinite;
}
.window {
  animation: glow 5s ease-in-out infinite;
}
.window.alt {
  animation-delay: -2.5s;
}
.smoke {
  animation: steam 5s ease-in-out infinite;
}
.smoke.alt {
  animation-delay: -2.5s;
}
.battery-bars {
  transition: opacity 1s;
}
.battery-idle .battery-bars {
  opacity: 0.45;
}
.battery-charging .battery-bars {
  animation: glow 3s ease-in-out infinite;
}
body.tab-hidden * {
  animation-play-state: paused !important;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes water {
  to {
    stroke-dashoffset: -48;
  }
}
@keyframes glow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
@keyframes steam {
  0% {
    opacity: 0;
    transform: translateY(3px);
  }
  35% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding-top: 21px;
  margin-top: 8px;
}
.demand-caption {
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.demand-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 1px;
}
.demand-number strong {
  font-size: 48px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.unit-explainer {
  font-size: 10px;
  color: var(--muted);
  margin: 3px 0 0;
  line-height: 1.35;
}
.demand-number > span {
  font-size: 17px;
  font-weight: 500;
  color: #718164;
}
.measurement {
  margin-right: auto;
  font-size: 12px;
  line-height: 1.5;
}
.measurement p {
  margin: 0 0 3px;
}
.measurement > span {
  font-size: 10px;
  color: var(--muted);
}
.reading-state {
  font-weight: 650;
}
.reading-state[data-status="live"] {
  color: #467039;
}
.reading-state[data-status="delayed"],
.reading-state[data-status="unavailable"] {
  color: #8a571e;
}
.separator {
  padding: 0 8px;
  color: #a2aca0;
}
.about-button {
  background: none;
  border: 0;
  font-size: 12px;
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 14px 0 14px 12px;
}
.about-button span {
  font-size: 20px;
}
.replay-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 248px;
  padding-top: 10px;
}
.replay-tools button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 12px;
}
.replay-tools input {
  width: 125px;
  accent-color: var(--ink);
  height: 22px;
  min-width: 0;
}
.replay-tools time {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tooltip {
  position: fixed;
  z-index: 10;
  width: 310px;
  max-width: calc(100vw - 28px);
  border: 1px solid #bdcbb0;
  background: #fffffc;
  border-radius: 16px;
  padding: 20px;
  max-height: calc(100svh - 28px);
  overflow: auto;
  box-shadow: 0 8px 28px #243d3112;
}
.tooltip h2 {
  font-size: 18px;
  letter-spacing: -0.03em;
  margin: 0 25px 5px 0;
}
.tooltip > strong {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.04em;
  display: block;
}
.tooltip > p {
  font-size: 12px;
  line-height: 1.5;
  color: #5c6e60;
  margin: 8px 0 0;
}
.tooltip .tooltip-eyebrow {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 7px;
}
.tooltip-close,
.dialog-close {
  position: absolute;
  right: 11px;
  top: 9px;
  border: 0;
  background: none;
  font-size: 23px;
  width: 32px;
  height: 32px;
  line-height: 1;
}
.tooltip dl {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  font-size: 12px;
}
.tooltip dd {
  font-size: 13px;
  font-weight: 600;
}
.tooltip-sites:empty { display: none; }
.tooltip-sites {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 12px;
}
.tooltip-sites h3 { margin: 0 0 4px; font-size: 12px; }
.tooltip-sites p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.tooltip-sites ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 11px;
}
.tooltip-sites li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
}
.tooltip-sites a {
  font-size: 11px;
  color: var(--ink);
  line-height: 1.4;
  text-underline-offset: 2px;
}
.tooltip-sites strong {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tooltip-sites small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
}
.tooltip dl:empty {
  display: none;
}
.tooltip dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.tooltip dt {
  color: #65756a;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px;
  max-width: 570px;
  width: calc(100vw - 28px);
  max-height: 85svh;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #20382c45;
  backdrop-filter: blur(4px);
}
dialog .dialog-close {
  position: sticky;
  float: right;
  top: -25px;
  margin-right: -20px;
}
dialog h2 {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.055em;
  margin: 12px 0 24px;
}
dialog h3 {
  font-size: 16px;
  margin: 25px 0 8px;
  letter-spacing: -0.025em;
}
dialog p {
  font-size: 13px;
  line-height: 1.7;
  color: #596d5e;
}
dialog a {
  color: var(--ink);
  text-underline-offset: 3px;
}
.fine-print,
.data-provenance {
  font-size: 11px !important;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  z-index: 30;
  left: 15px;
  top: -100px;
  background: var(--ink);
  color: white;
  padding: 12px;
}
.skip:focus {
  top: 15px;
}
.noscript {
  padding: 30px;
}
@media (min-width: 1100px) and (max-height: 760px) {
  .app {
    padding-top: 24px;
  }
  h1 {
    font-size: 40px;
  }
  .kicker {
    margin-bottom: 9px;
  }
  .intro {
    margin-top: 9px;
  }
  .stage {
    max-height: calc(100svh - 245px);
  }
  .footer {
    padding-top: 14px;
  }
  .demand-number strong {
    font-size: 37px;
  }
}
@media (max-width: 900px) {
  .app {
    padding: 26px 24px 20px;
  }
  .header {
    gap: 15px;
  }
  h1 {
    font-size: 36px;
  }
  .intro {
    font-size: 11px;
    max-width: 270px;
  }
  .controls button {
    padding: 10px 13px;
  }
  .stage {
    aspect-ratio: 600/770;
    max-height: calc(100svh - 275px);
    min-height: 570px;
    width: min(100%, 600px);
  }
  .footer {
    gap: 18px;
  }
  .measurement {
    font-size: 10px;
  }
  .measurement > span {
    font-size: 9px;
    max-width: 240px;
    display: block;
  }
  .about-button {
    font-size: 11px;
    gap: 12px;
  }
  .demand-number strong {
    font-size: 38px;
  }
}
@media (max-width: 600px) {
  .app {
    padding: max(19px, env(safe-area-inset-top)) 16px
      max(15px, env(safe-area-inset-bottom));
    min-height: 100svh;
  }
  .header {
    display: block;
  }
  .brand .kicker {
    font-size: 9px;
    margin-bottom: 10px;
    gap: 6px;
  }
  .kicker svg {
    width: 11px;
    height: 14px;
  }
  h1 {
    font-size: clamp(27px, 7.2vw, 37px);
    line-height: 1.06;
    max-width: 370px;
    letter-spacing: -0.055em;
  }
  .desktop-break {
    display: none;
  }
  .intro {
    display: none;
  }
  .mode-area {
    padding-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    gap: 8px;
  }
  .controls {
    width: max-content;
    padding: 3px;
  }
  .controls button {
    font-size: 10px;
    padding: 7px 12px;
    min-height: 33px;
    gap: 6px;
  }
  .controls button svg {
    width: 12px;
    height: 12px;
  }
  .mode-note {
    font-size: 9px;
    max-width: none;
    white-space: nowrap;
    text-align: right;
    margin: 0 0 0 auto;
  }
  .stage-wrap {
    padding: 4px 0 0;
  }
  .stage {
    width: 100%;
    aspect-ratio: 390/465;
    max-height: none;
    min-height: 0;
  }
  .footer {
    padding-top: 12px;
    margin-top: 3px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .demand-caption {
    font-size: 8px;
  }
  .demand-number strong {
    font-size: 38px;
  }
  .unit-explainer {
    font-size: 8px;
  }
  .demand-number > span {
    font-size: 13px;
  }
  .measurement {
    font-size: 10px;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
    max-width: 225px;
  }
  .measurement > span {
    font-size: 8px;
  }
  .about-button {
    font-size: 10px;
    gap: 10px;
    margin-left: auto;
    padding: 4px 0;
  }
  .measurement p {
    margin: 0 0 2px;
  }
  .separator {
    padding: 0 4px;
  }
  .tooltip {
    padding: 17px;
    max-height: calc(100svh - 30px);
    overflow: auto;
  }
  .replay-tools {
    padding: 0;
    max-width: 135px;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .replay-tools input {
    width: 75px;
  }
  .replay-tools button {
    width: 27px;
    height: 27px;
  }
  .replay-tools time {
    font-size: 9px;
  }
  .mode-area:has(.replay-tools:not([hidden])) .mode-note {
    display: none;
  }
  .replay-tools time {
    width: 100%;
    text-align: right;
  }
  dialog {
    padding: 29px 25px;
  }
  dialog h2 {
    font-size: 35px;
  }
  .dialog-close {
    margin-right: -10px !important;
  }
}
@media (max-width: 600px) and (min-height: 760px) {
  .app {
    padding-top: 26px;
    padding-bottom: 23px;
  }
  .mode-area {
    padding-top: 20px;
  }
  .stage {
    aspect-ratio: 390/510;
  }
  .footer {
    padding-top: 17px;
    margin-top: 8px;
  }
  .demand-number strong {
    font-size: 44px;
  }
  .about-button {
    margin-top: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Keep the entire story in view; SVG meet preserves the drawing's proportions. */
@media (min-width: 901px) {
  .stage {
    max-height: calc(100svh - 330px);
  }
}
@media (min-width: 901px) and (max-height: 760px) {
  .stage {
    max-height: calc(100svh - 245px);
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .stage {
    min-height: 0;
    max-height: calc(100svh - 305px);
  }
}
@media (max-width: 600px) {
  .footer {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 1px;
  }
  .demand {
    grid-row: 1/3;
  }
  .measurement {
    grid-column: 2;
    align-self: end;
  }
  .about-button {
    grid-column: 2;
    justify-self: end;
    align-self: start;
    margin-top: 1px;
    min-height: 24px;
  }
  .stage {
    max-height: calc(100svh - 238px);
  }
}
@media (min-width: 901px) {
  .stage {
    max-height: calc(100svh - 345px);
  }
}
@media (min-width: 901px) and (max-height: 760px) {
  .stage {
    max-height: calc(100svh - 260px);
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .stage {
    aspect-ratio: 600/800;
  }
}
@media (max-width: 600px) {
  .stage {
    aspect-ratio: 390/490;
    max-height: calc(100svh - 255px);
  }
}
@media (max-width: 600px) and (min-height: 760px) {
  .stage {
    aspect-ratio: 390/535;
  }
}
:root {
  --muted: #5d6e62;
}
.demand-number > span {
  color: #5e7152;
}
.tooltip > strong.battery-value {
  font-size: 22px;
  white-space: nowrap;
}
body[data-reading-status="delayed"] .controls .status-dot {
  background: #e5bc72;
}
body[data-reading-status="unavailable"] .controls .status-dot {
  background: #b9c1b9;
}
@media (min-width: 601px) and (max-width: 900px) {
  .stage { aspect-ratio: 600/840; }
}
@media (max-width: 600px) {
  .stage { aspect-ratio: 390/522; }
  .source-value, .battery-state { font-size: 15px; }
}
@media (max-width: 600px) and (min-height: 760px) {
  .stage { aspect-ratio: 390/555; }
}
