/* 交大设计院智能微电网协同平台 — navy platform identity. */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-500.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;

  --navy-deep: #0d2536;
  --navy: #18465d;
  --navy-soft: #24536b;
  --ink: #10182d;
  --body: #4c566d;
  --muted: #5f6a7f;
  --line: #dce5ed;
  --mist: #f2f6f9;
  --white: #ffffff;
  --on-navy: #e6eef3;
  --on-navy-muted: #a9bfcc;
  --copper: #ce784b;

  /* Energy roles on white. */
  --pv: #e8a317;
  --storage: #2a86d6;
  --diesel: #c4602f;
  /* Energy roles on navy. */
  --pv-dark: #d69a12;
  --storage-dark: #3a8fd6;
  --diesel-dark: #c9502f;

  --font: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: min(100% - 64px, 1240px);

  --z-header: 10;
  --z-tooltip: 50;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ol {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: var(--z-tooltip);
  padding: 10px 16px;
  background: var(--white);
  color: var(--ink);
}
.skip-link:focus {
  top: 12px;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover {
  background: #e8eff3;
}
.btn-ghost-light {
  min-height: 42px;
  padding: 0 16px;
  border-color: rgb(255 255 255 / 0.32);
  color: var(--white);
}
.btn-ghost-light:hover {
  border-color: var(--white);
  background: rgb(255 255 255 / 0.08);
}

.text-link-light {
  color: var(--on-navy);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.4);
  text-underline-offset: 6px;
  transition: text-decoration-color 180ms var(--ease);
}
.text-link-light:hover {
  text-decoration-color: var(--white);
}

/* ---------- Header & hero (navy) ---------- */

.retired-share-notice {
  padding-block: 20px;
}

.site-header {
  position: relative;
  z-index: var(--z-header);
  background: var(--navy-deep);
  color: var(--white);
}
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 40px;
  min-height: 76px;
  padding-block: 16px;
}
.wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  max-width: 100%;
  line-height: 1.2;
}
.wordmark-cn {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
}
.wordmark-sub {
  color: var(--on-navy-muted);
  font-size: 12px;
  letter-spacing: 1px;
}
.nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  color: var(--on-navy);
  font-size: 15px;
}
.nav a {
  padding: 10px 0;
  white-space: nowrap;
  transition: color 180ms var(--ease);
}
.nav a:hover {
  color: var(--white);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 90% at 82% 40%, rgb(58 143 214 / 0.16), transparent 70%),
    var(--navy-deep);
  color: var(--white);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 48px;
  padding: 56px 0 88px;
}
.hero h1 .line {
  display: block;
}
.hero h1 {
  margin-top: 0;
  font-size: clamp(36px, 4.6vw, 62px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
body[data-variant='mix'] .when-diesel,
body[data-variant='diesel'] .when-mix {
  display: none;
}
.nowrap {
  white-space: nowrap;
}
.hl {
  color: #f2b134;
  font-variant-numeric: tabular-nums;
}
.hero-lead {
  max-width: 34em;
  margin-top: 24px;
  color: var(--on-navy);
  font-size: 18px;
  line-height: 1.8;
}
.hero-lead strong {
  color: var(--white);
  font-weight: 600;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}
.hero-config {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}
.hero-config dt {
  color: var(--on-navy-muted);
  font-size: 13px;
}
.hero-config dd {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.clock-figure {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.clock {
  position: relative;
  width: min(100%, 500px, calc(64vh / var(--zoom, 1)));
  min-width: min(100%, 280px);
  aspect-ratio: 1;
}
.clock svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.clock .daylight {
  fill: rgb(214 154 18 / 0.55);
}
.clock .nightlight {
  fill: rgb(169 191 204 / 0.25);
}
.clock .dial {
  fill: none;
  stroke: rgb(255 255 255 / 0.12);
}
.clock .load-marker {
  fill: rgb(255 255 255 / 0.85);
}
.clock.is-morphing .seg {
  transition: d 700ms var(--ease);
}
.clock .wedge {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: opacity 260ms var(--ease), transform 300ms var(--ease), filter 260ms var(--ease);
}
/* Hovered hour lifts out and brightens; the rest of the dial recedes. */
.clock.is-focus .wedge {
  opacity: 0.26;
}
.clock.is-focus .wedge.is-active {
  opacity: 1;
  transform: translate(var(--dx), var(--dy)) scale(1.045);
  filter: brightness(1.2) drop-shadow(0 0 14px rgb(255 255 255 / 0.35));
}
.clock svg:focus-visible {
  outline: none;
}
.clock svg:focus-visible .dial {
  stroke: var(--copper);
  stroke-width: 2;
}
.legend-dark b {
  margin-left: 4px;
  color: var(--white);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legend-dark b:empty {
  display: none;
}
.clock-hint {
  color: var(--on-navy-muted);
  font-size: 12px;
}
.clock .sweep {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 50% 50%;
  pointer-events: none;
}
.clock .trail {
  fill: #ffffff;
}
.clock .hand {
  stroke: rgb(255 255 255 / 0.9);
  stroke-width: 2;
  stroke-linecap: round;
}
.clock .hand-tip {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgb(255 255 255 / 0.9));
}
.clock .hour-label {
  fill: var(--on-navy-muted);
  font-size: 13px;
}
.clock .center-big {
  fill: var(--white);
  font-size: 46px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.clock .center-small {
  fill: var(--on-navy-muted);
  font-size: 14px;
}
.clock .hit {
  fill: transparent;
  cursor: default;
}
.clock-figure figcaption {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.season-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
}
.season-switch button {
  min-width: 76px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-navy);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.season-switch button:hover {
  color: var(--white);
}
.season-switch button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
}

/* ---------- Legends ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--body);
  font-size: 13px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend-dark {
  color: var(--on-navy);
}
.legend-center {
  justify-content: center;
  margin-top: 18px;
}
.key {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.key-pv {
  background: var(--pv);
}
.key-storage {
  background: var(--storage);
}
.key-diesel {
  background: var(--diesel);
}
.legend-dark .key-pv {
  background: var(--pv-dark);
}
.legend-dark .key-storage {
  background: var(--storage-dark);
}
.legend-dark .key-diesel {
  background: var(--diesel-dark);
}
.key-line {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 9vw, 120px) 0;
}
.section-mist {
  background: var(--mist);
}
.section-head {
  max-width: 760px;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.section-head p {
  margin-top: 14px;
  color: var(--body);
  font-size: 17px;
}

/* ---------- Configure ---------- */

.configure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.controls {
  display: grid;
  gap: 34px;
}
.presets {
  margin: 0;
  padding: 0;
  border: 0;
}
.presets legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px;
}
.chip {
  display: grid;
  gap: 1px;
  min-height: 52px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.chip span {
  font-size: 14px;
  font-weight: 600;
}
.chip small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chip:hover {
  border-color: var(--navy-soft);
}
.chip[aria-pressed='true'] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}
.chip[aria-pressed='true'] small {
  color: var(--on-navy-muted);
}

.result {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 24px 60px -32px rgb(16 24 45 / 0.28);
}
.result-label {
  color: var(--body);
  font-size: 16px;
}
.result-figure {
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(56px, 7vw, 88px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.result-figure .unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.42em;
  letter-spacing: 0;
}
.mix-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  margin-top: 26px;
}
.mix-bar span {
  min-width: 2px;
  height: 100%;
}
.mix-bar.is-morphing span {
  transition: flex-grow 700ms var(--ease);
}
.mix-bar span.is-empty {
  flex-grow: 0 !important;
  min-width: 0;
}
.mix-bar span:first-child {
  border-radius: 4px 0 0 4px;
}
.mix-bar span:last-child {
  border-radius: 0 4px 4px 0;
}
.mix-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.mix-keys li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--body);
}
.mix-keys b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.result-status {
  min-height: 20px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}
.result-status.is-error {
  color: #b23b2a;
}
.result.is-busy .result-figure,
.result.is-busy .kpi-value b {
  opacity: 0.55;
  transition: opacity 160ms var(--ease);
}

/* ---------- Charts ---------- */

.chart-card {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 18px;
}
.chart-title {
  font-size: 17px;
  font-weight: 600;
}
.chart-sub {
  color: var(--body);
  font-size: 14px;
}
.chart {
  position: relative;
  width: 100%;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .axis text {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart .band {
  fill: #e6eef5;
}
.chart .band-label {
  fill: var(--navy-soft);
  font-size: 12px;
  font-weight: 500;
}
.chart.is-morphing .seg {
  transition: y 760ms var(--ease), height 760ms var(--ease);
  transition-delay: calc(var(--i, 0) * 28ms);
}
.chart .hit {
  fill: transparent;
}
.chart .hit:hover {
  fill: rgb(16 24 45 / 0.04);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 24px;
}

/* ---------- Method ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid #c9d6e0;
}
.steps li {
  position: relative;
  padding: 30px 32px 6px 0;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.steps h3 {
  font-size: 20px;
  font-weight: 600;
}
.steps p {
  margin-top: 8px;
  max-width: 24em;
  color: var(--body);
}
.method-note {
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: var(--on-navy-muted);
  font-size: 13px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 24px 0;
}

/* ---------- Tooltip ---------- */

.tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 12px 30px rgb(16 24 45 / 0.3);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}
.tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.tooltip table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tooltip td:last-child {
  padding-left: 14px;
  text-align: right;
}
.tooltip .key {
  display: inline-block;
  margin-right: 6px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .intro .hero h1 .line,
  .intro .reveal-hero {
    animation: rise 900ms var(--ease) both;
  }
  .hero h1 .line:nth-child(1) {
    animation-delay: 180ms;
  }
  .hero h1 .line:nth-child(2) {
    animation-delay: 300ms;
  }
  .hero-lead {
    animation-delay: 460ms;
  }
  .hero-actions {
    animation-delay: 580ms;
  }
  .hero-config {
    animation-delay: 700ms;
  }
  .clock-figure .reveal-hero {
    animation-delay: 1500ms;
  }
  .clock.is-entering .daylight,
  .clock.is-entering .nightlight,
  .clock.is-entering .hour-label {
    animation: fade-in 1200ms var(--ease) 200ms both;
  }
  /* The hand covers one hour every 60 ms; each sector lights up as it passes, then its glow fades. */
  .clock.is-entering .wedge {
    animation: wedge-in 1000ms var(--ease) both;
    animation-delay: calc(300ms + var(--i) * 60ms);
  }
  .clock.is-entering .sweep {
    animation: sweep 1440ms linear 300ms both;
  }
  .clock.is-entering .center-big,
  .clock.is-entering .center-small {
    animation: fade-in 900ms var(--ease) 700ms both;
  }

  .motion .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  }
  .motion .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
  .motion .configure-grid.reveal .result {
    transition: transform 800ms var(--ease) 120ms;
  }

  .chip,
  .chart-card,
  .result {
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color 180ms var(--ease),
      background-color 180ms var(--ease), color 180ms var(--ease);
  }
  .chart-card:hover {
    box-shadow: 0 18px 40px -28px rgb(16 24 45 / 0.35);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes wedge-in {
  0% {
    opacity: 0;
    transform: scale(0.6);
    filter: brightness(1);
  }
  30% {
    opacity: 1;
    transform: scale(1.035);
    filter: brightness(1.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}
@keyframes sweep {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  84% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(360deg);
  }
}

/* ---------- Responsive ---------- */

/* ---------- Controls ---------- */

.controls {
  gap: 30px;
}
.control + .control {
  margin-top: 30px;
}
.control-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.control-head label {
  font-size: 17px;
  font-weight: 600;
}
.numbox {
  display: inline-flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.numbox:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(24 70 93 / 0.15);
}
.numbox input {
  width: 64px;
  height: 100%;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}
.numbox input[aria-invalid='true'] {
  color: #b23b2a;
}
.numbox-unit {
  min-width: 40px;
  color: var(--muted);
  font-size: 13px;
}
.step {
  display: grid;
  place-items: center;
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background-color 140ms var(--ease);
}
.step:first-child {
  border-right: 1px solid var(--line);
  border-radius: 5px 0 0 5px;
}
.step:last-child {
  border-left: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
}
.step:hover:not(:disabled) {
  background: var(--mist);
}
.step:active:not(:disabled) {
  background: #e3ebf1;
}
.step:disabled {
  color: #b5c2cd;
  cursor: not-allowed;
}
.step svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.range {
  position: relative;
  margin-top: 24px;
  padding-bottom: 26px;
}
.range input[type='range'] {
  --fill: 50%;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.range input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--navy-soft), var(--navy) var(--fill), #e1e9ef var(--fill));
}
.range input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #e1e9ef;
}
.range input[type='range']::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--navy);
}
.range input[type='range']::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 1px rgb(24 70 93 / 0.35), 0 3px 10px rgb(16 24 45 / 0.25);
  appearance: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.range input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 1px rgb(24 70 93 / 0.35), 0 3px 10px rgb(16 24 45 / 0.25);
}
.range input[type='range']:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgb(24 70 93 / 0.12), 0 3px 10px rgb(16 24 45 / 0.25);
}
.range input[type='range']:active::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 0 0 9px rgb(24 70 93 / 0.14), 0 3px 10px rgb(16 24 45 / 0.25);
}
.range input[type='range']:focus-visible {
  outline: none;
}
.range input[type='range']:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--copper);
}
.range-ticks {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 22px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.range-ticks span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
}
.range-ticks span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 5px;
  background: #c3d0da;
}
.range-ref {
  position: absolute;
  top: -16px;
  transform: translateX(-50%);
  color: var(--copper);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.range-ref i {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--copper);
}
.duration {
  min-height: 22px;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--mist);
  color: var(--body);
  font-size: 14px;
}

/* ---------- Result panel ---------- */

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}
.result-badge {
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e8f0f5;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.kpis > div {
  padding: 18px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}
.kpis > div:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.kpis dt {
  color: var(--body);
  font-size: 14px;
}
.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.kpi-value b {
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-value span {
  color: var(--muted);
  font-size: 14px;
}
.kpi-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Energy flow ---------- */

.section-navy {
  background: var(--navy-deep);
  color: var(--white);
}
.section-navy .section-head p {
  color: var(--on-navy);
}
.flow-card {
  padding: 28px 0 8px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}
.flow svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  overflow: visible;
}
.flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 12px;
}
.segmented-dark {
  background: rgb(255 255 255 / 0.08);
}
.segmented-dark button {
  color: var(--on-navy);
}
.segmented-dark button:hover {
  color: var(--white);
}
.segmented-dark button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
}
.flow-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.flow-day[hidden] {
  display: none;
}
.play {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.play:hover {
  border-color: var(--white);
  background: rgb(255 255 255 / 0.08);
}
.play svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.play .icon-play {
  fill: currentColor;
}
.play[aria-pressed='true'] .icon-play,
.play[aria-pressed='false'] .icon-pause {
  display: none;
}
#flow-hour {
  --fill: 50%;
  width: min(240px, 46vw);
  height: 24px;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
#flow-hour::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffffff var(--fill), rgb(255 255 255 / 0.2) var(--fill));
}
#flow-hour::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.2);
}
#flow-hour::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--white);
  appearance: none;
}
#flow-hour::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
}
#flow-time {
  min-width: 64px;
  color: var(--white);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.flow-track {
  fill: none;
  stroke: var(--c);
  stroke-opacity: 0.24;
  stroke-linecap: round;
}
.flow-dots {
  fill: none;
  stroke: color-mix(in srgb, var(--c) 45%, #ffffff);
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--c)) drop-shadow(0 0 2px var(--c));
}
.flow-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 28px;
  pointer-events: stroke;
}
.flow-link:hover .flow-track {
  stroke-opacity: 0.38;
}
.flow-pill {
  pointer-events: none;
}
.flow-pill rect {
  fill: #0d2536;
  stroke: var(--c);
  stroke-opacity: 0.7;
}
.flow-pill text {
  fill: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.flow-node {
  transition: opacity 400ms var(--ease);
}
.flow-node.is-idle {
  opacity: 0.4;
}
.node-halo {
  fill: var(--c);
  opacity: 0.12;
  transform-box: fill-box;
  transform-origin: center;
  animation: halo 2.8s ease-in-out infinite;
}
.flow-node.is-idle .node-halo {
  animation: none;
  opacity: 0;
}
@keyframes halo {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(1);
  }
  50% {
    opacity: 0.22;
    transform: scale(1.08);
  }
}
.node-disc {
  fill: #0d2536;
  stroke: var(--c);
  stroke-width: 2.5;
}
.node-icon {
  color: var(--c);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.node-load .node-disc {
  fill: var(--white);
}
.node-load .node-icon {
  color: var(--navy-deep);
}
.node-label,
.node-value {
  paint-order: stroke;
  stroke: #0d2536;
  stroke-width: 6px;
  stroke-linejoin: round;
}
.node-label {
  fill: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.node-value {
  fill: var(--on-navy);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.is-tall .node-label {
  font-size: 17px;
}
.is-tall .node-value,
.is-tall .flow-pill text {
  font-size: 14px;
}
.flow.is-offscreen .flow-dots,
.flow.is-offscreen .node-halo {
  animation-play-state: paused;
}

.flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 8px 48px;
  margin-top: 28px;
}
.flow-group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(255 255 255 / 0.22);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.flow-group-title b {
  font-variant-numeric: tabular-nums;
}
.flow-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.flow-group li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 84px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: var(--on-navy);
  font-size: 14px;
}
.flow-group li span {
  color: var(--on-navy-muted);
  font-variant-numeric: tabular-nums;
}
.flow-group li b {
  color: var(--white);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.flow-group .key-curtail {
  background: repeating-linear-gradient(45deg, #6f8797 0 2px, #3f5566 2px 5px);
}
.flow-note {
  margin-top: 10px;
  color: var(--on-navy-muted);
  font-size: 13px;
  text-align: right;
}

/* ---------- Segmented, heatmap, sizing ---------- */

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 6px;
  background: var(--mist);
}
.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.segmented button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(16 24 45 / 0.12);
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.heat-legend i {
  width: 140px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef3f7, #c6d7e4, #8eb0c9, #4d7fa2, #18465d);
}
.heat-cell {
  cursor: default;
}
.heat-cell:hover {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.chart.is-morphing .heat-cell {
  transition: fill 700ms var(--ease);
  transition-delay: calc(var(--i, 0) * 12ms);
}
#day .day-grid {
  margin-top: 24px;
}

.size-cell {
  cursor: pointer;
  outline: none;
}
.size-cell rect {
  transition: transform 180ms var(--ease), filter 180ms var(--ease);
  transform-box: fill-box;
  transform-origin: center;
}
.size-cell:hover rect,
.size-cell:focus-visible rect {
  transform: scale(0.94);
  filter: brightness(1.06);
}
.size-cell:focus-visible rect {
  stroke: var(--copper);
  stroke-width: 3;
}
.size-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.size-marker {
  fill: none;
  stroke: var(--copper);
  stroke-width: 3;
  pointer-events: none;
}
.chart.is-morphing .size-marker {
  transition: x 700ms var(--ease), y 700ms var(--ease);
}
.chart .axis-title {
  fill: var(--body);
  font-size: 13px;
}
.marker-key {
  display: inline-block;
  width: 16px;
  height: 12px;
  margin-right: 6px;
  border: 2.5px solid var(--copper);
  border-radius: 3px;
  vertical-align: -1px;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-bottom: 64px;
  }
  .clock {
    width: min(100%, 440px);
  }
  .hero-grid > .clock-figure {
    order: 0;
  }
  .configure-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li {
    padding: 26px 0 22px 56px;
    border-bottom: 1px solid #c9d6e0;
  }
  .steps li::before {
    position: absolute;
    left: 0;
    top: 24px;
  }
}

@media (max-width: 760px) {
  :root {
    --wrap: min(100% - 32px, 1240px);
  }
  .nav {
    display: none;
  }
  .header-row {
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
  }
  .hero-grid {
    padding-top: 36px;
  }
  .hero-lead {
    font-size: 16px;
  }
  .hero-config {
    gap: 14px 28px;
    margin-top: 36px;
  }
  .kpis > div {
    padding-right: 10px;
  }
  .kpis > div:nth-child(even) {
    padding-left: 12px;
  }
  .kpi-value b {
    font-size: 22px;
  }
  .numbox input {
    width: 54px;
    font-size: 18px;
  }
  .section-head {
    margin-bottom: 32px;
  }
  .section-head p {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .wordmark-cn {
    font-size: 20px;
  }
  .wordmark-sub {
    display: none;
  }
  .btn-ghost-light {
    padding: 0 12px;
  }
}

@media (max-width: 1080px) {
  .nav {
    display: none;
  }
}

/* Short landscape screens (laptops, phones turned sideways). */
@media (max-height: 820px) and (min-width: 981px) {
  .hero-grid {
    padding: 40px 0 56px;
  }
  .hero h1 {
    font-size: clamp(34px, 4vw, 54px);
  }
  .hero-config {
    margin-top: 32px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    padding: 28px 0 40px;
  }
  .clock {
    width: min(100%, 78vh);
  }
  .hero-config {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

.flow-list[hidden] {
  display: none;
}


/* Approved platform layout; existing charts and live controls are retained. */
@font-face {
  font-family: 'Bomi Display';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/noto-sans-sc-display-800.ttf?v=5') format('truetype');
}
:root {
  --navy-deep: #132936;
  --navy: #1a3548;
  --on-navy-muted: #aebfc9;
  --pv-dark: #dcaa2b;
  --storage-dark: #5b9cd6;
  --diesel-dark: #bf5b3b;
  --gold: #f2bd42;
  --wrap: min(100% - 64px, 1012px);
  --header-height: 64px;
}
/* Root zoom is set by fit.js from the viewport; sections land flush under the header. */
html { scroll-padding-top: var(--header-height); }
body { min-width: 320px; }
.wrap { width: var(--wrap); }
section[id] { scroll-margin-top: 0; }
section:focus { outline: none; }
a:focus-visible, button:focus-visible { outline: 3px solid #e9b646; outline-offset: 5px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy-deep);
  transition: box-shadow 180ms ease;
}
/* The header is exactly --header-height tall (no border), so a section scrolled
   under it fills the rest of the screen without a strip of its neighbour. */
.site-header.is-scrolled { box-shadow: 0 1px 0 rgb(174 191 201 / 20%), 0 5px 18px rgb(0 0 0 / 10%); }
.header-row { height: var(--header-height); min-height: 0; padding-block: 0; gap: 20px; flex-wrap: nowrap; }
/* Desktop languages share one width; phones retain the Chinese-only wordmark. */
.wordmark { display: grid; align-content: center; justify-items: start; gap: 3px; width: max-content; min-height: 44px; }
.wordmark-cn { width: 100%; font-family: 'Bomi Display', var(--font); font-size: 18px; font-weight: 800; letter-spacing: 1.3px; text-align-last: justify; white-space: nowrap; }
.wordmark-sub { display: block; width: 100%; font-size: 10px; letter-spacing: .2px; text-align-last: justify; color: #e0e9ee; white-space: nowrap; }
.nav { display: flex; gap: 25px; font-size: 13px; }
.nav a { display: flex; align-items: center; min-height: 44px; position: relative; }
.nav a::after {
  content: '';
  position: absolute;
  height: 2px;
  left: 0;
  right: 0;
  bottom: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.nav a[aria-current] { color: var(--gold); }
.nav a[aria-current]::after { transform: scaleX(1); }
.menu-toggle { display: none; }
.hero {
  background: radial-gradient(ellipse at 84% 50%, rgb(47 90 127 / 16%), transparent 65%), var(--navy-deep);
  min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
}
.hero-grid { grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr); align-items: start; gap: 28px; padding: 40px 0 28px; }
.hero-copy { padding-top: 10px; text-align: left; }
.hero h1 { font-family: 'Bomi Display', var(--font); font-size: clamp(39px, 4.66vw, 58px); font-weight: 800; line-height: 1.12; letter-spacing: 2.3px; }
.hero h1 .line { white-space: nowrap; }
.hero .hero-location { font-size: .93em; line-height: 1.2; letter-spacing: 4px; }
.hero-focus { color: var(--gold); }
.hero-lead { max-width: 36em; margin-top: 14px; font-size: 14px; line-height: 1.65; letter-spacing: .6px; color: var(--on-navy-muted); }
.hero-lead .lead-line { display: block; }
.hero-actions { margin-top: 50px; }
.hero-actions .btn { min-height: 40px; padding: 0 20px; font-size: 13px; border-radius: 2px; }
.hero-config { display: grid; grid-template-columns: repeat(4, max-content); justify-content: space-between; gap: 16px 20px; padding-top: 16px; margin-top: 38px; border-color: rgb(255 255 255 / 12%); }
.hero-config dt { font-size: 12px; }
.hero-config dd { font-size: 14px; white-space: nowrap; margin-top: 4px; }
.clock-figure { gap: 6px; margin-top: -6px; width: calc(100% - 12px); }
.clock { width: 420px; max-width: 100%; min-width: 0; }
.clock .center-big { font-size: 46px; }
.clock-figure figcaption { gap: 11px; }
.season-switch { padding: 2px; border-color: rgb(255 255 255 / 14%); }
.season-switch button { min-width: 62px; min-height: 32px; font-size: 13px; }
.legend-dark { gap: 15px; font-size: 12px; }
.clock-hint { font-size: 12px; }
.key-pv { background: var(--pv-dark); }
.key-storage { background: var(--storage-dark); }
.key-diesel { background: var(--diesel-dark); }
.footer-row { flex-wrap: wrap; gap: 16px; font-size: 12px; }
.footer-row a { text-decoration: underline; text-underline-offset: 4px; }
.site-footer { border-top: 1px solid var(--line); }
@media (min-width: 1500px) {
  :root { --wrap: min(100% - 120px, 1280px); --header-height: 80px; }
  .wordmark-cn { font-size: 23px; }
  .wordmark-sub { font-size: 12px; }
  .nav { font-size: 15px; gap: 34px; }
  .hero-grid { padding-top: 70px; gap: 60px; }
  .hero h1 { font-size: 65px; }
  .hero-lead { font-size: 17px; }
  .hero-config dt { font-size: 13px; }
  .hero-config dd { font-size: 15px; }
  .clock { width: 530px; }
  .hero-actions .btn { min-height: 48px; font-size: 15px; }
}
@media (min-width: 1081px) and (max-height: 700px) {
  .hero-grid { padding-top: 40px; padding-bottom: 24px; }
}
@media (max-width: 1080px) {
  :root { --wrap: min(100% - 48px, 920px); --header-height: 68px; }
  .hero { min-height: 0; }
  .header-row { justify-content: space-between; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; padding: 0 12px; min-height: 44px; border: 1px solid #4d6574; border-radius: 3px; background: transparent; color: var(--white); font: inherit; font-size: 13px; cursor: pointer; }
  .menu-toggle span { font-size: 19px; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy-deep); border-top: 1px solid #344d5c; padding: 12px 24px 20px; box-shadow: 0 12px 20px rgb(0 0 0 / 15%); font-size: 15px; gap: 6px; }
  .menu-open .nav { display: grid; }
  .menu-open .menu-toggle span { transform: rotate(45deg); }
  .nav a { padding-inline: 8px; }
  .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); padding: 45px 0 50px; gap: 24px; }
  .hero h1 { font-size: clamp(30px, 4.2vw, 45px); letter-spacing: 1px; }
  .hero .hero-location { letter-spacing: 1px; }
  .hero-lead { font-size: 13px; }
  .hero-actions { margin-top: 28px; }
  .hero-config { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; row-gap: 20px; }
  .hero-config dd { font-size: 14px; }
  .clock-figure { margin-top: 0; width: 100%; }
  .clock { width: min(100%, 430px); }
}
@media (max-width: 700px) {
  :root { --wrap: calc(100% - 40px); --header-height: 68px; }
  .header-row { gap: 10px; }
  .wordmark { flex-shrink: 1; }
  .wordmark-cn { font-size: clamp(12px, 3.6vw, 18px); letter-spacing: .4px; }
  .wordmark-sub { display: none; }
  .menu-toggle { min-width: 66px; padding-inline: 8px; font-size: 12px; }
  .hero-grid { grid-template-columns: 1fr; padding-top: 26px; padding-bottom: 36px; gap: 36px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: clamp(29px, 7.7vw, 49px); line-height: 1.3; letter-spacing: 1px; }
  .hero-lead { font-size: 14px; line-height: 1.8; margin-top: 20px; letter-spacing: 0; }
  .hero-actions { margin-top: 26px; }
  .hero-actions .btn { min-height: 44px; padding-inline: 22px; }
  .hero-config { margin-top: 28px; padding-top: 20px; column-gap: 22px; }
  .hero-config dt { font-size: 12px; }
  .hero-config dd { font-size: 14px; }
  .clock { width: min(100%, 410px); }
  .clock-figure { gap: 6px; }
  .season-switch button { min-width: 76px; min-height: 44px; font-size: 13px; }
  .clock-hint { font-size: 11px; }
  .legend-dark { font-size: 12px; }
  .section { padding: 60px 0; }
  .section-head h2 { font-size: 28px; }
  .section-head p { font-size: 14px; }
  .chart-card { padding: 18px 12px; }
  .chart { overflow-x: auto; }
  .chart svg { max-width: none; }
  .result { padding: 24px 20px; }
  .chip { min-height: 66px; }
  .numbox { flex-shrink: 0; }
}
@media (max-width: 350px) {
  :root { --wrap: calc(100% - 28px); }
  .wordmark-cn { font-size: 11px; letter-spacing: .2px; }
  .hero h1 { font-size: 26px; }
  .hero-config dd { font-size: 13px; }
}
/* Desktop and projector: every chapter fills the screen below the fixed header,
   content centred, so jumping from the navigation never shows a strip of the
   neighbouring chapter (1024 x 768 projectors included). Phones and portrait
   tablets keep natural scrolling. */
@media (min-width: 1000px) {
  main > .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
  }
  main > .section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
    padding-block: 56px;
  }
  main > .section > .wrap { flex-shrink: 0; }
  main > .section .section-head { margin-bottom: 32px; }
  /* The flow diagram always fits the first screen of its chapter; the tables follow below. */
  main > #flow .flow svg { max-height: min(560px, max(400px, calc(100svh / var(--zoom, 1) - var(--header-height) - 320px))); }
}
/* Short screens (720p / 768p projectors, laptops): compact chapter headings so charts keep their size. */
@media (min-width: 1000px) and (max-height: 820px) {
  main > .section { padding-block: 32px; }
  main > .section .section-head { margin-bottom: 20px; }
  main > .section .section-head h2 { font-size: 32px; }
  main > .section .section-head p { margin-top: 8px; font-size: 15px; }
  main > #flow .flow-card { padding-top: 16px; }
  main > #flow .flow svg { max-height: min(560px, max(400px, calc(100svh / var(--zoom, 1) - var(--header-height) - 240px))); }
}
/* The dial and size grid are keyboard-focusable; mouse clicks must not draw a focus box. */
.clock svg:focus,
.size-cell:focus { outline: none; }
.footer-row { justify-content: flex-start; color: var(--on-navy-muted); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
