/* ============================================================================
   Hydrira: Stylesheet. "Civic Utility"
   Light, plain-language, accessible. Body text is 18px. Sky bands carry a
   wavy water-surface edge; white-on-white sections meet at a ripple line.
   All values come from tokens.css.
   ========================================================================== */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: light; }
[id] { scroll-margin-top: calc(var(--nav-h) + var(--space-6)); }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--fs-h1); line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 700; }
h4 { font-size: var(--fs-h4); line-height: 1.35; font-weight: 700; letter-spacing: -0.005em; }
p  { margin: 0 0 var(--space-4); max-width: 60ch; }
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-6); }
li { margin-bottom: var(--space-2); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
strong { color: var(--text-primary); font-weight: 700; }

code, pre, .mono { font-family: var(--font-mono); }
.metric, .ts, .num, td.num, .price__amount { font-variant-numeric: tabular-nums; }

/* Small kicker text above a heading. Sentence case, no tracking. */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--clean-ink);
  margin-bottom: var(--space-3);
}
.lead { font-size: var(--fs-lead); color: var(--text-secondary); max-width: 60ch; line-height: 1.55; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -80px; z-index: 200;
  background: var(--accent); color: var(--text-on-accent);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  font-weight: 700; text-decoration: none;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); color: var(--text-on-accent); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--container-xl);
  margin-inline: auto; padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-xl); }
.container--md { max-width: var(--container-md); }

.section { padding-block: var(--section-y); position: relative; }
.section--lg { padding-block: var(--section-y-lg); }

/* Sky band: a pale blue section whose top and bottom edges are a gentle
   water surface. */
.section--alt, .section--canvas { background: var(--sky); }
.section--deep { background: var(--bg-900); color: var(--text-on-deep); }
.section--deep h2, .section--deep h3, .section--deep h4 { color: #ffffff; }
.section--alt::before, .section--alt::after,
.section--canvas::before, .section--canvas::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 14 V8 C20 0 40 0 60 8 S100 16 120 8 V14 Z' fill='%23eef6fc'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 14px;
  pointer-events: none;
}
.section--alt::before, .section--canvas::before { top: -13px; }
.section--alt::after, .section--canvas::after { bottom: -13px; transform: scaleY(-1); }

/* Two white sections in a row meet at a short ripple line. */
.section:not(.section--alt):not(.section--canvas):not(.section--deep):not(.hero) + .section:not(.section--alt):not(.section--canvas):not(.section--deep)::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(240px, 50%); height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath d='M0 6 C8 1 16 1 24 6 S40 11 48 6' fill='none' stroke='%239fcbe9' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x;
  background-size: 48px 12px;
}
.section--strip { padding-block: clamp(36px, 4vw, 56px); }

.section__head { max-width: 62ch; margin-bottom: var(--space-12); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .lead, .section__head--center p { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(var(--grid-cols), 1fr); }
.cols-2 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols--stretch { align-items: stretch; }
.cols--stretch > .stretch { display: flex; }
.cols--stretch > .stretch > .console { flex: 1; display: flex; flex-direction: column; }
.cols--stretch > .stretch .log { max-height: none; flex: 1; }
.split  { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.split--reverse > :first-child { order: 2; }
.split--top { align-items: start; }
.workspace { display: grid; gap: var(--panel-gap); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.stack > * + * { margin-top: var(--stack); }
.flow > * + * { margin-top: var(--space-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--panel-pad);
}
.section--alt .panel, .section--canvas .panel { border-color: var(--border-default); }
.panel--raised { background: var(--surface-2); }
.panel--flush { padding: 0; overflow: hidden; }
.panel--hover { transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.panel--hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.panel__title { margin: 0 0 var(--space-2); font-size: var(--fs-h4); }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.panel__head h3 { margin: 0; font-size: var(--fs-small); }
.panel__body { padding: var(--panel-pad); }

/* Console: on this site a plain record sheet with a pale title strip. */
.console {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-width: 0;
}
.console > * { position: relative; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-body);
  line-height: 1.1; min-height: 52px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface-1); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-sm { min-height: 44px; padding: var(--space-2) var(--space-4); font-size: var(--fs-small); }

/* ---------- Status chip (glyph + label, never colour alone) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.02em; line-height: 1;
  padding: 5px var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  color: var(--text-secondary); background: var(--surface-2);
  white-space: nowrap;
}
.chip .dot { display: none; }
.chip .glyph { font-size: 0.8125rem; line-height: 1; }
.chip--queued  { color: var(--st-queued);  background: var(--st-queued-soft); }
.chip--running { color: var(--st-running); background: var(--st-running-soft); }
.chip--waiting { color: var(--st-waiting); background: var(--st-waiting-soft); }
.chip--approve { color: var(--st-approve); background: var(--st-approve-soft); }
.chip--success { color: var(--st-success); background: var(--st-success-soft); }
.chip--failed  { color: var(--st-failed);  background: var(--st-failed-soft); }
.chip--blocked { color: var(--st-blocked); background: var(--st-blocked-soft); }

.tag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary);
  background: var(--sky); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 3px var(--space-2);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-base);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--border-subtle); box-shadow: var(--shadow-1); }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  color: var(--text-primary); text-decoration: none; font-weight: 800; flex: none;
}
.brand__mark { width: 28px; height: 28px; flex: none; display: block; }
.brand > span { line-height: 1; }
.brand__logo { display: block; height: 30px; width: auto; max-width: none; }
.nav__list { display: flex; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav__list li { margin: 0; }
.nav__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text-primary); text-decoration: none;
  font-size: var(--fs-small); font-weight: 600;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: none; border: 0; cursor: pointer; font-family: inherit; min-height: 44px;
}
.nav__link:hover { color: var(--link); background: var(--sky); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--link); text-decoration: underline; text-decoration-color: var(--brand-clean); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.nav__caret { width: 10px; height: 10px; transition: transform var(--dur-fast) var(--ease-out); }
.nav__link[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: var(--space-2); }

.has-menu { position: relative; }
.megamenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 110;
  min-width: 560px; padding: var(--space-6);
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6);
}
.megamenu.is-open { display: grid; }
.megamenu h4 { font-size: var(--fs-small); color: var(--clean-ink); margin-bottom: var(--space-2); font-weight: 700; }
.megamenu ul { list-style: none; margin: 0; padding: 0; }
.megamenu li { margin: 0; }
.megamenu a {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none; font-size: var(--fs-small); font-weight: 600;
}
.megamenu a:hover { background: var(--sky); color: var(--link); }
.megamenu a span { display: block; color: var(--text-muted); font-size: 0.875rem; font-weight: 400; margin-top: 2px; }

.kbd {
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--surface-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 2px 6px; color: var(--text-secondary);
}
.nav__hamburger { display: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 120; background: var(--bg-base);
  padding: var(--space-5) 0 var(--space-16);
  overflow-y: auto; display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li { margin: 0; border-bottom: 1px solid var(--border-subtle); }
.mobile-menu a {
  display: block; padding: var(--space-3) var(--space-1); color: var(--text-primary);
  text-decoration: none; font-size: var(--fs-body-lg); font-weight: 600;
}
.mobile-menu a:hover { color: var(--link); }
.mobile-menu a.btn { display: inline-flex; font-size: var(--fs-body); margin-top: var(--space-4); }
.mobile-menu a.btn-primary, .mobile-menu a.btn-primary:hover { color: var(--text-on-accent); }
.mobile-menu__group { margin-bottom: var(--space-8); }
.mobile-menu__group > h4 { font-size: var(--fs-small); color: var(--clean-ink); margin-bottom: var(--space-2); }

/* ---------- Breadcrumbs ---------- */
.breadcrumb { padding-top: var(--space-6); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0;
  font-size: var(--fs-small); color: var(--text-muted); }
.breadcrumb li { margin: 0; display: flex; gap: var(--space-2); align-items: center; }
.breadcrumb li + li::before { content: "›"; color: var(--text-faint); }
.breadcrumb a { color: var(--link); }

/* ---------- Hero (sub-pages) ---------- */
.hero { padding-block: clamp(40px, 6vw, 88px) clamp(56px, 6vw, 96px); position: relative; isolation: isolate; }
.hero__grid > * { min-width: 0; }
.hero__grid { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.hero h1 { font-size: var(--fs-h1); }
.hero .lead { font-size: var(--fs-lead); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-8); align-items: center;
  font-size: var(--fs-small); color: var(--text-muted); }
.hero__meta > span { display: inline-flex; align-items: center; gap: var(--space-2); }
.hero__meta > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-clean); flex: none; }
.hero__meta > span:has(> .chip)::before { content: none; }
@media (max-width: 1024px) { .hero__grid { grid-template-columns: 1fr; } }

/* ---------- Agent graph (inline SVG on sub-pages) ---------- */
.graph { width: 100%; height: auto; display: block; }
.graph__wrap { padding: var(--space-5); overflow-x: auto; min-width: 0; background: var(--canvas); }
.graph .edge { stroke: var(--edge); stroke-width: 1.75; fill: none; }
.graph .edge--dashed { stroke-dasharray: 6 6; }
.graph .edge--active { stroke: var(--edge-active); stroke-width: 2; }
.graph .edge--wrap { stroke: var(--edge-wrap); stroke-width: 1.75; stroke-dasharray: 5 5; }
.graph .node { cursor: pointer; }
.graph .node-box { fill: var(--node-bg); stroke: var(--node-border); stroke-width: 1.25; }
.graph .node.is-active .node-box { stroke: var(--node-active); stroke-width: 2.5; fill: var(--st-running-soft); }
.graph .node.is-done .node-box { fill: #ffffff; }
.graph .node .node-box { transition: stroke var(--dur-base) var(--ease-out), fill var(--dur-base) var(--ease-out); }
.graph .node:hover .node-box { stroke: var(--brand-bar); fill: var(--sky); }
.graph .node[aria-pressed="true"] .node-box { stroke: var(--accent); stroke-width: 2.5; fill: var(--accent-soft); }
.graph .node:focus { outline: none; }
.graph .node:focus-visible .node-box { stroke: var(--ring); stroke-width: 3; }
.graph .node-label { font-family: var(--font-sans); font-size: 11px; fill: var(--text-primary); font-weight: 600; letter-spacing: -0.01em; }
.graph .node-sub { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-muted); }
.graph .node-status { font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.graph .lane-label { font-family: var(--font-sans); font-size: 11px; fill: var(--text-muted); font-weight: 600; }
.graph .grid-line { stroke: var(--grid-line); stroke-width: 1; }
.st-queued  { fill: var(--st-queued); }
.st-running { fill: var(--st-running); }
.st-waiting { fill: var(--st-waiting); }
.st-approve { fill: var(--st-approve); }
.st-success { fill: var(--st-success); }
.st-failed  { fill: var(--st-failed); }

/* ---------- Run timeline (<ol>) ---------- */
.run { list-style: none; margin: 0; padding: var(--space-5) var(--space-5) var(--space-2); position: relative; }
.run > li { position: relative; margin: 0; padding: 0 0 var(--step-gap) var(--space-12); }
.run > li::before {
  content: ""; position: absolute; left: 15px; top: 28px; bottom: 4px;
  width: 2px; border-radius: 2px; background: var(--border-default);
}
.run > li:last-child::before { display: none; }
.run > li.is-done::before { background: var(--run-done); }
.run__dot {
  position: absolute; left: 6px; top: 4px; width: 20px; height: 20px;
  border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface-1);
}
.run > li.is-done .run__dot { border-color: var(--st-success); background: var(--st-success-soft); box-shadow: inset 0 0 0 4px #fff; background-color: var(--st-success); }
.run > li.is-active .run__dot { border-color: var(--st-running); background: var(--st-running); }
.run > li.is-approve .run__dot { border-color: var(--st-approve); background: var(--st-approve); border-radius: 4px; transform: rotate(45deg) scale(0.85); }
.run__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.run__idx { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted); }
.run__name { font-size: var(--fs-body); color: var(--text-primary); font-weight: 700; }
.run__dur { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-left: auto; }
.run__detail { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--text-secondary); max-width: 62ch; }
.run__agent { font-family: var(--font-mono); font-size: 0.875rem; color: var(--clean-ink); font-weight: 700; }

/* ---------- Tool-call log ---------- */
.log {
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.55;
  padding: var(--space-4) var(--space-5); margin: 0; max-height: 380px; min-height: 340px; overflow-y: auto;
  scrollbar-width: thin; background: var(--canvas);
  color: var(--text-secondary); list-style: none;
}
.log li { margin: 0; padding: var(--log-line-y) 0; display: flex; gap: var(--space-3); align-items: flex-start; border-bottom: 1px dashed var(--border-subtle); }
.log li:last-child { border-bottom: 0; }
.log .ts { color: var(--text-muted); font-size: 0.8125rem; flex: none; padding-top: 2px; min-width: 70px; }
.log .arrow { color: var(--text-muted); flex: none; }
.log .call { color: var(--text-primary); }
.log .fn { color: var(--link); font-weight: 700; }
.log .ret { color: var(--text-secondary); }
.log .ok { color: var(--st-success); font-weight: 700; }
.log .warnline { color: var(--st-approve); font-weight: 700; }
.log__body { min-width: 0; word-break: break-word; }
.console__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-5); background: var(--sky);
  border-bottom: 1px solid var(--border-default);
  font-size: 0.9375rem; font-weight: 600; color: var(--text-primary);
}
.console__bar .dots { display: none; }
.console__bar .spacer { flex: 1; }
.console__bar > span:last-child:not(.spacer) { color: var(--text-muted); font-weight: 500; }

/* ---------- Reasoning trace ---------- */
.trace { font-size: var(--fs-small); }
.trace details { border-bottom: 1px solid var(--border-subtle); }
.trace details:last-child { border-bottom: 0; }
.trace summary {
  cursor: pointer; padding: var(--space-3) var(--space-4); min-height: 48px;
  display: flex; align-items: center; gap: var(--space-3); color: var(--text-primary);
  list-style: none;
}
.trace summary:hover { background: var(--sky); }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::before { content: "+"; font-family: var(--font-mono); color: var(--link); font-weight: 700; width: 1ch; }
.trace details[open] summary::before { content: "−"; }
.trace__kind { color: var(--clean-ink); font-weight: 700; min-width: 92px; }
.trace__body { padding: 0 var(--space-4) var(--space-4) calc(var(--space-8) + 92px); color: var(--text-secondary); line-height: 1.6; }

/* ---------- Inspector ---------- */
@media (min-width: 1025px) {
  .inspector { position: sticky; top: calc(var(--nav-h) + var(--space-6)); align-self: start; }
}
.inspector dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0 0; font-size: var(--fs-small); }
.inspector dt { color: var(--text-muted); }
.inspector dd { margin: 0; color: var(--text-primary); font-family: var(--font-mono); overflow-wrap: anywhere; }

.panel > dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-3) var(--space-5); margin: var(--space-4) 0 0; align-items: baseline; }
.panel > dl > dt { color: var(--text-muted); font-size: var(--fs-small); }
.panel > dl > dd { margin: 0; color: var(--text-primary); font-size: var(--fs-small); overflow-wrap: anywhere; }
.panel > dl + p { margin-top: var(--space-5); }
@media (max-width: 480px) { .panel > dl { grid-template-columns: 1fr; gap: 2px var(--space-4); }
  .panel > dl > dd { margin-bottom: var(--space-3); } }

/* ---------- Command palette ---------- */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); color: var(--text-secondary);
  padding: var(--space-2) var(--space-3); min-height: 44px; cursor: pointer;
  font-family: var(--font-sans); font-size: var(--fs-small);
}
.cmdk-trigger:hover { color: var(--accent); border-color: var(--accent); }
.cmdk {
  position: fixed; inset: 0; z-index: 150; display: none;
  align-items: flex-start; justify-content: center;
  padding: clamp(48px, 12vh, 140px) var(--space-4) var(--space-4);
  background: var(--scrim);
}
.cmdk.is-open { display: flex; }
.cmdk__panel {
  width: 100%; max-width: 640px; background: var(--surface-1);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-3);
}
.cmdk__input {
  width: 100%; border: 0; background: var(--surface-1); color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--fs-body-lg); padding: var(--space-5);
  border-bottom: 2px solid var(--border-default); outline: none; border-radius: 0;
}
.cmdk__input:focus { border-bottom-color: var(--ring); }
.cmdk__list { list-style: none; margin: 0; padding: var(--space-2); max-height: 44vh; overflow-y: auto; }
.cmdk__group { font-size: 0.875rem; font-weight: 700; color: var(--clean-ink); padding: var(--space-3) var(--space-3) var(--space-1); margin: 0; }
.cmdk__opt {
  display: flex; align-items: center; gap: var(--space-3); min-height: 48px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-primary); cursor: pointer; font-size: var(--fs-small); margin: 0;
}
.cmdk__opt .mono { color: var(--text-muted); font-size: 0.8125rem; margin-left: auto; }
.cmdk__opt.is-active, .cmdk__opt:hover { background: var(--accent-soft); color: var(--accent); }
.cmdk__foot { display: flex; gap: var(--space-4); padding: var(--space-3) var(--space-5); margin: 0; max-width: none;
  background: var(--sky); font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Metrics ---------- */
.metric { display: block; font-family: var(--font-sans); font-size: var(--fs-metric);
  font-weight: 800; color: var(--accent); line-height: 1.05; letter-spacing: -0.03em; }
.metric__label { display: block; margin-top: var(--space-3); font-size: var(--fs-small); color: var(--text-secondary); }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4);
  min-height: 168px; padding: var(--space-6); }
.stat .metric__label { margin-top: 0; text-wrap: balance; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--surface-1); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
caption { text-align: left; padding: var(--space-4) var(--space-5); color: var(--text-muted); font-size: var(--fs-small); }
th, td { text-align: left; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
thead th { background: var(--sky); color: var(--text-primary); font-size: 0.9375rem; font-weight: 700; border-bottom: 2px solid var(--border-default); }
tbody th { color: var(--text-primary); font-weight: 700; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody td { color: var(--text-secondary); }
td .mono, th .mono { font-family: var(--font-mono); }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; }
.card__icon { width: 36px; height: 36px; margin-bottom: var(--space-4); color: var(--brand-bar); }
.card__meta { font-family: var(--font-mono); font-size: 0.875rem; color: var(--clean-ink); font-weight: 500; margin-bottom: var(--space-2); }
.card p:last-child { margin-bottom: 0; }
.card > .row { margin-top: auto; padding-top: var(--space-4); }
.card > .row + p { margin-top: var(--space-4) !important; }
.card--lead { grid-column: 1 / -1; background: var(--sky); border-color: var(--border-default); }
@media (min-width: 861px) {
  .card--lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-10); align-items: start; }
  .card--lead > .card__meta, .card--lead > h3, .card--lead > .small.muted { grid-column: 1; }
  .card--lead > p:not(.card__meta):not(.small) { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .card--lead > .row { grid-column: 2; margin-top: var(--space-4); padding-top: 0; }
  .card--lead > .row + p { grid-column: 2; }
}
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: var(--space-8); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.32em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--st-success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.4' fill='none' stroke='%230b6f66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
  border: 1px solid var(--st-success);
}
.numlist { list-style: none; padding: 0; counter-reset: n; }
.numlist li { counter-increment: n; position: relative; padding-left: var(--space-12); margin-bottom: var(--space-5); }
.numlist li::before {
  content: counter(n); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9375rem; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--border-default);
}

/* ---------- Bento ---------- */
.bento { display: grid; gap: var(--panel-gap); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bento > * { grid-column: span 2; }
.bento .b-wide { grid-column: span 4; }
.bento .b-full { grid-column: span 6; }
.bento > .panel { display: flex; flex-direction: column; }
.bento .b-metric { justify-content: center; gap: var(--space-3); min-height: 156px; }
.bento .b-metric .metric__label { margin-top: 0; }
.bento .b-wide > .row, .bento .b-full > .row { margin-top: auto; padding-top: var(--space-5); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > *, .bento .b-wide, .bento .b-full { grid-column: span 2; } }

/* ---------- Logos strip ---------- */
.logos { display: flex; flex-wrap: wrap; gap: var(--space-3) clamp(20px, 3vw, 40px); align-items: center; justify-content: center; }
.logos span { font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }

/* ---------- Quotes ---------- */
blockquote { margin: 0; }
blockquote p { color: var(--text-primary); font-size: var(--fs-body-lg); line-height: 1.55; }
cite { display: block; font-style: normal; font-size: var(--fs-small); font-weight: 600;
  color: var(--text-muted); margin-top: var(--space-4); }

/* ---------- Pricing ---------- */
.price__amount { font-size: var(--fs-price); font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.03em; line-height: 1; display: block; }
.price__unit { font-size: var(--fs-small); color: var(--text-muted); display: block; margin-top: var(--space-2); }
.tier { position: relative; display: flex; flex-direction: column; }
.tier--featured { border: 2px solid var(--accent); }
.tier__badge {
  position: absolute; top: -14px; left: var(--panel-pad);
  padding: 4px var(--space-3); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--text-on-accent);
  font-size: 0.875rem; font-weight: 700; white-space: nowrap;
}
.tier .btn { width: 100%; margin-top: auto; }

/* ---------- FAQ ---------- */
.faq { max-width: var(--container-md); }
.faq__item { border-bottom: 1px solid var(--border-default); }
.faq__item:first-child { border-top: 1px solid var(--border-default); }
.faq__q {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 64px; cursor: pointer;
  background: transparent; border: 0; color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--fs-body-lg); font-weight: 700;
  padding: var(--space-4) var(--space-2);
}
.faq__q:hover { color: var(--link); }
.faq__q .sign {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--border-strong); color: var(--accent); font-size: 1.125rem; line-height: 1;
}
.faq__q[aria-expanded="true"] .sign { background: var(--accent); border-color: var(--accent); color: #fff; }
.faq__a { padding: 0 var(--space-2) var(--space-5); }
.faq__a p { color: var(--text-secondary); }
.faq__a[hidden] { display: none; }

/* ---------- Code ---------- */
pre {
  margin: 0; padding: var(--space-5); overflow-x: auto;
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.6;
  color: var(--text-primary); background: var(--canvas);
}
pre code { font-family: inherit; }
.tok-key { color: var(--link); }
.tok-str { color: var(--st-success); }
.tok-com { color: var(--text-muted); font-style: italic; }
.tok-fn  { color: var(--st-approve); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: var(--space-5); }
.field > span { display: block; font-size: var(--fs-small); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; min-height: 52px; padding: var(--space-3) var(--space-4);
  background: var(--surface-1); color: var(--text-primary);
  border: 2px solid var(--border-strong); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--fs-body);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ring); }
textarea { min-height: 140px; resize: vertical; }

/* ---------- Footer: the reservoir ---------- */
.site-footer {
  position: relative; background: var(--bg-900); color: var(--text-on-deep-muted);
  padding-block: calc(var(--section-y) + 8px) var(--space-10); margin-top: 14px;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 14 V8 C20 0 40 0 60 8 S100 16 120 8 V14 Z' fill='%230b2e4f'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 14px;
}
.site-footer .muted, .site-footer .small { color: var(--text-on-deep-muted); }
.site-footer .chip--queued { color: #d5e4f0; background: transparent; border-color: #6f8ea9; }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); }
.footer__grid h4 { font-size: var(--fs-small); color: #ffffff; margin-bottom: var(--space-3); }
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: var(--space-2); }
.footer__grid a { color: var(--text-on-deep); text-decoration: none; font-size: var(--fs-small); }
.footer__grid a:hover { color: #ffffff; text-decoration: underline; }
.footer__grid :focus-visible, .footer__bottom :focus-visible { outline-color: #9fd8f5; }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center;
  justify-content: space-between; margin-top: var(--space-12); padding-top: var(--space-6);
  border-top: 1px solid #24496d; font-size: 0.875rem; color: var(--text-on-deep-muted);
}
.footer__bottom a { color: var(--text-on-deep); }
.footer__status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Motion helpers ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js [data-reveal].in { opacity: 1; transform: none; }

@keyframes logIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.log.is-playing > li { animation: logIn 240ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 150ms); }
.log.is-paused > li { animation-play-state: paused; }
.offscreen-opt { content-visibility: auto; contain-intrinsic-size: 640px; }

/* ---------- Products ---------- */
.product__logo { width: 56px; height: 56px; border-radius: var(--radius-md); margin-bottom: var(--space-4);
  background: var(--surface-1); border: 1px solid var(--border-subtle); padding: 6px; }
.product__logo--inline { width: 40px; height: 40px; margin: 0; padding: 4px; }

form.panel .btn { margin-top: var(--space-2); }
.cols-2 > *, .cols-3 > *, .cols-4 > *, .split > *, .workspace > * { min-width: 0; }
.panel > table { display: block; overflow-x: auto; }

/* ==========================================================================
   HOMEPAGE: "Civic Utility" components
   ========================================================================== */

/* ---------- Hero: statement + hourly notice ---------- */
.civic-hero { padding-block: clamp(40px, 6vw, 96px) clamp(64px, 7vw, 112px); position: relative; overflow: hidden; }
.civic-hero__rings { position: absolute; right: -180px; top: -120px; width: 820px; height: 820px; z-index: -1; pointer-events: none; }
.civic-hero__rings circle { fill: none; stroke: var(--ripple-soft); stroke-width: 1.5; }
.civic-hero__grid { display: grid; gap: clamp(36px, 5vw, 72px); grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: center; }
.civic-hero__grid > * { min-width: 0; }
.civic-hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: var(--space-6); max-width: 13ch; }
.civic-hero .lead { max-width: 52ch; }
.civic-hero__note { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-8);
  padding: var(--space-4) var(--space-5); background: var(--sky); border-radius: var(--radius-md);
  font-size: var(--fs-small); color: var(--text-secondary); max-width: 54ch; }
.civic-hero__note svg { flex: none; width: 22px; height: 22px; color: var(--link); margin-top: 2px; }
.civic-hero__note p { margin: 0; }

.notice {
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden;
}
.notice__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2) var(--space-4);
  padding: var(--space-5) var(--space-6) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.notice__head h2 { font-size: var(--fs-h4); margin: 0; }
.notice__head p { margin: 0; font-size: 0.9375rem; color: var(--text-muted); }
.notice__body { padding: var(--space-5) var(--space-6) var(--space-4); }
.notice__chart { width: 100%; height: auto; display: block; }
.notice__chart .bar { fill: var(--brand-bar); }
.notice__chart .bar--rain { fill: var(--prod-turbix); }
.notice__chart .limit { stroke: var(--st-failed); stroke-width: 1.5; stroke-dasharray: 5 4; }
.notice__chart .base { stroke: var(--border-default); stroke-width: 1; }
.notice__chart .lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--text-muted); }
.notice__chart .lbl--limit { fill: var(--st-failed); font-weight: 700; }
.notice__rows { list-style: none; margin: 0; padding: 0 var(--space-6) var(--space-5); }
.notice__rows li { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; margin: 0;
  padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-small); }
.notice__rows li span:first-child { color: var(--text-secondary); }
.notice__rows li span:last-child { color: var(--st-success); font-weight: 700; text-align: right; }
.notice__foot { margin: 0; max-width: none; padding: var(--space-3) var(--space-6); background: var(--sky); font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Treatment train: the signature vertical flow ---------- */
.train { list-style: none; margin: 0; padding: 0; position: relative; }
.train::before {
  content: ""; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 10px; border-radius: 10px;
  background: linear-gradient(to bottom, var(--raw-water) 0%, #8fa39a 22%, #6fb0c9 48%, var(--brand-bar) 72%, var(--brand-clean) 100%);
}
.stage { position: relative; margin: 0; padding: 0 0 clamp(36px, 4vw, 56px) 96px; display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-4) clamp(24px, 4vw, 56px); }
.stage:last-child { padding-bottom: 0; }
.stage__num {
  position: absolute; left: 0; top: 0; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-1);
  border: 3px solid var(--stage-c, var(--brand-bar)); color: var(--text-primary);
  font-weight: 800; font-size: 1.375rem;
}
.stage__intro h3 { font-size: var(--fs-h3); margin-bottom: var(--space-2); padding-top: 14px; }
.stage__intro p { margin-bottom: 0; }
.stage__detail { display: grid; gap: var(--space-3); padding-top: 14px; }
.stage__detail dl { margin: 0; display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: var(--space-2) var(--space-4); }
.stage__detail dt { font-weight: 700; color: var(--text-primary); font-size: var(--fs-small); }
.stage__detail dd { margin: 0; font-size: var(--fs-small); color: var(--text-secondary); }
.stage__who { font-size: 0.9375rem; color: var(--text-muted); }
.stage__who a { font-weight: 700; }
.train__aside { margin-top: var(--space-12); padding: var(--space-6); border-radius: var(--radius-lg);
  background: var(--surface-1); border: 1px dashed var(--border-strong); max-width: 78ch; }
.train__aside h3 { font-size: var(--fs-h4); }
.train__aside p:last-child { margin-bottom: 0; }

/* ---------- Permit compliance ---------- */
.permit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.permit > * { min-width: 0; }
.rule-list { list-style: none; padding: 0; margin: var(--space-6) 0 0; }
.rule-list li { padding: var(--space-4) 0 var(--space-4) var(--space-10); position: relative; margin: 0; border-top: 1px solid var(--border-subtle); }
.rule-list li:last-child { border-bottom: 1px solid var(--border-subtle); }
.rule-list li::before {
  content: ""; position: absolute; left: 0; top: 18px; width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='11' width='10' height='8' rx='1.5' fill='none' stroke='%230b3a66' stroke-width='1.8'/%3E%3Cpath d='M9 11V8.5a3 3 0 0 1 6 0V11' fill='none' stroke='%230b3a66' stroke-width='1.8'/%3E%3C/svg%3E") center/24px no-repeat;
}
.rule-list strong { display: block; }
.gate { background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.gate__title { margin: 0; padding: var(--space-5) var(--space-6); font-size: var(--fs-h4); border-bottom: 1px solid var(--border-subtle); }
.gate ol { list-style: none; margin: 0; padding: var(--space-2) var(--space-6) var(--space-4); counter-reset: g; }
.gate li { counter-increment: g; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--space-3); align-items: start;
  padding: var(--space-3) 0; margin: 0; border-bottom: 1px dashed var(--border-subtle); font-size: var(--fs-small); }
.gate li:last-child { border-bottom: 0; }
.gate li::before { content: counter(g); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sky); color: var(--accent); font-weight: 800; font-size: 0.9375rem; }
.gate li strong { display: block; }
.gate__result { margin: 0; max-width: none; padding: var(--space-4) var(--space-6); background: var(--st-success-soft); color: var(--st-success); font-weight: 700; font-size: var(--fs-small); }
.assurance { margin-top: var(--space-12); }

/* ---------- Storm story: a timeline by the clock ---------- */
.storm__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-6); align-items: end; margin-bottom: var(--space-10); }
.storm__head > * { min-width: 0; }
.storm__flag { display: inline-flex; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  background: var(--surface-1); border: 1px solid var(--border-default); font-size: 0.9375rem; color: var(--text-secondary); white-space: nowrap; }
.storm__flag svg { width: 18px; height: 18px; color: var(--link); }
.clock { list-style: none; margin: 0; padding: 0; position: relative; }
.clock::before { content: ""; position: absolute; left: calc(6.5rem + 11px); top: 8px; bottom: 8px; width: 2px; background: var(--ripple); }
.clock li { display: grid; grid-template-columns: 6.5rem 24px minmax(0, 1fr); gap: var(--space-5); margin: 0; padding-bottom: var(--space-8); position: relative; }
.clock li:last-child { padding-bottom: 0; }
.clock time { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; color: var(--text-primary); text-align: right; line-height: 1.3; font-variant-numeric: tabular-nums; }
.clock__pin { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-1); border: 3px solid var(--brand-bar); margin-top: 3px; position: relative; z-index: 1; }
.clock li.is-person .clock__pin { border-color: var(--st-approve); background: var(--st-approve-soft); border-radius: 6px; transform: rotate(45deg) scale(0.86); }
.clock li.is-rain .clock__pin { background: var(--brand-bar); }
.clock h3 { font-size: var(--fs-h4); margin-bottom: var(--space-1); }
.clock p { margin: 0; font-size: var(--fs-small); }
.clock__who { display: block; margin-top: var(--space-2); font-size: 0.9375rem; color: var(--text-muted); }
.storm__foot { margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--border-default); font-size: var(--fs-small); color: var(--text-muted); max-width: 78ch; }

/* ---------- Aeration energy ---------- */
.energy { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.energy > * { min-width: 0; }
.energy__figure { margin: 0; background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-6); }
.energy__figure svg { width: 100%; height: auto; display: block; }
.energy__figure figcaption { font-size: 0.9375rem; color: var(--text-muted); margin-top: var(--space-4); }
.energy__figure .ax { stroke: var(--border-default); stroke-width: 1; }
.energy__figure .grid { stroke: var(--grid-line); stroke-width: 1; }
.energy__figure .fixed { stroke: var(--text-muted); stroke-width: 2.5; stroke-dasharray: 8 6; fill: none; }
.energy__figure .follow { stroke: var(--brand-bar); stroke-width: 3; fill: none; }
.energy__figure .load { fill: var(--sky-2); }
.energy__figure .gap { fill: var(--brand-clean); opacity: 0.22; }
.energy__figure text { font-family: var(--font-sans); font-size: 12px; fill: var(--text-muted); }
.energy__figure .t-strong { fill: var(--text-primary); font-weight: 700; }
.energy__figure .t-blue { fill: #135f99; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; padding: 0; margin: var(--space-4) 0 0; font-size: 0.9375rem; }
.legend li { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; }
.legend i { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--brand-bar); }
.legend i.dash { border-top: 3px dashed var(--text-muted); }
.legend i.area { height: 12px; border: 0; background: var(--sky-2); }
.measures { margin: var(--space-6) 0 0; display: grid; gap: 0; }
.measures div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.measures dt { font-weight: 700; color: var(--text-primary); font-size: var(--fs-small); }
.measures dd { margin: 0; font-size: var(--fs-small); }

/* ---------- Products: a service directory ---------- */
.directory { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text-primary); }
.directory li { display: grid; grid-template-columns: 64px minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 0.9fr); gap: var(--space-3) var(--space-6);
  align-items: start; padding: var(--space-6) 0; margin: 0; border-bottom: 1px solid var(--border-default); }
.directory img { width: 56px; height: 56px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); padding: 6px; background: #fff; }
.directory h3 { font-size: var(--fs-h3); margin: 0 0 var(--space-1); }
.directory h3 a { color: var(--text-primary); text-decoration: none; }
.directory h3 a:hover { color: var(--link); text-decoration: underline; }
.directory__role { margin: 0; font-size: 0.9375rem; color: var(--clean-ink); font-weight: 600; }
.directory__what { margin: 0; }
.directory__start { margin: 0; font-size: var(--fs-small); color: var(--text-muted); }
.directory__start strong { display: block; color: var(--text-primary); }

/* ---------- Utility voices: the people who sign off ---------- */
.voices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--panel-gap); }
.voice { margin: 0; display: flex; flex-direction: column; padding: var(--panel-pad); background: var(--surface-1);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px; border: 1px solid var(--border-default); position: relative; }
.voice__q { font-size: var(--fs-body-lg); line-height: 1.45; color: var(--text-primary); font-weight: 600; margin-bottom: var(--space-5); }
.voice__a { font-size: var(--fs-small); color: var(--text-secondary); margin-bottom: var(--space-5); }
.voice footer { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); font-size: 0.9375rem; }
.voice footer strong { display: block; }
.voice footer span { color: var(--text-muted); }
.voices__note { margin-top: var(--space-6); font-size: var(--fs-small); color: var(--text-muted); }

/* ---------- Procurement-friendly pricing ---------- */
.procure { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
.schedule th[scope="row"] { min-width: 9rem; }
.schedule .price { font-weight: 800; color: var(--text-primary); font-size: var(--fs-body-lg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule .unit { display: block; font-size: 0.9375rem; color: var(--text-muted); font-weight: 400; white-space: normal; }
.schedule td ul { margin: 0; padding-left: var(--space-5); }
.schedule td li { margin-bottom: var(--space-1); }
.schedule tbody tr.is-wedge { background: #f6fbff; }
.schedule tbody tr.is-wedge th::after { content: "Usual starting point"; display: block; margin-top: var(--space-2); font-size: 0.875rem; font-weight: 600; color: var(--clean-ink); }
.procure__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--panel-gap); }
.procure__box { padding: var(--panel-pad); border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--border-default); }
.procure__box h3 { font-size: var(--fs-h4); }
.procure__box dl { margin: 0; }
.procure__box dl div { padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.procure__box dt { font-weight: 700; color: var(--text-primary); font-size: var(--fs-small); }
.procure__box dd { margin: var(--space-1) 0 0; font-size: var(--fs-small); }
.procure__box .checklist { margin: 0; }
.procure__box .checklist li { font-size: var(--fs-small); }

/* ---------- Closing call ---------- */
.cta-band { background: var(--accent); color: var(--text-on-deep); border-radius: var(--radius-xl); padding: clamp(32px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; position: relative; overflow: hidden; }
.cta-band > * { min-width: 0; position: relative; }
.cta-band h2 { color: #ffffff; margin-bottom: var(--space-3); }
.cta-band p { color: #d6e6f3; margin-bottom: 0; }
.cta-band__ripple { position: absolute; inset: auto -40px -60px auto; width: 420px; height: 220px; pointer-events: none; }
.cta-band__ripple path { fill: none; stroke: #2c6597; stroke-width: 2; }
.cta-band__actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: stretch; }
.cta-band .btn-primary { background: #ffffff; color: var(--accent); border-color: #ffffff; }
.cta-band .btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.cta-band .btn-secondary { background: transparent; color: #ffffff; border-color: #8fb7d9; }
.cta-band .btn-secondary:hover { background: #134c82; color: #fff; }
.cta-band :focus-visible { outline-color: #ffffff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__list, .nav__actions .btn-primary, .cmdk-trigger { display: none; }
  .nav__hamburger { display: inline-flex; }
}
@media (max-width: 1024px) {
  .workspace { grid-template-columns: 1fr; }
  .span-8, .span-4, .span-5, .span-7, .span-6 { grid-column: span 12; }
  .civic-hero__grid { grid-template-columns: 1fr; }
  .civic-hero h1 { max-width: 16ch; }
  .directory li { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.3fr); }
  .directory__start { grid-column: 2 / -1; }
}
@media (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { grid-template-columns: 1fr; }
  .stage__detail { padding-top: 0; }
  .permit, .energy { grid-template-columns: 1fr; }
  .voices { grid-template-columns: 1fr; }
  .procure__cols { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .split, .cols-2 { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
  .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .megamenu { min-width: 0; }
  .graph { width: 720px; max-width: none; }
  .graph__wrap { padding-inline: var(--space-4); }
  .log { font-size: 0.8125rem; min-height: 280px; }
  .stat { min-height: 132px; }
  .trace__body { padding-left: var(--space-4); }
  .train::before { left: 19px; }
  .stage { padding-left: 64px; }
  .stage__num { width: 48px; height: 48px; font-size: 1.125rem; }
  .stage__intro h3 { padding-top: 8px; }
  .stage__detail dl { grid-template-columns: 1fr; gap: 2px; }
  .stage__detail dd { margin-bottom: var(--space-2); }
  .storm__head { grid-template-columns: 1fr; }
  .clock::before { left: 11px; }
  .clock li { grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-2) var(--space-4); }
  .clock time { grid-column: 2; grid-row: 1; text-align: left; font-size: 1.0625rem; }
  .clock__pin { grid-column: 1; grid-row: 1; }
  .clock li > div { grid-column: 2; }
  .directory li { grid-template-columns: 52px minmax(0, 1fr); }
  .directory img { width: 48px; height: 48px; }
  .directory__what, .directory__start { grid-column: 1 / -1; }
  .measures div { grid-template-columns: 1fr; gap: 2px; }
  .schedule thead { display: none; }
  .schedule, .schedule tbody, .schedule tr, .schedule th, .schedule td { display: block; width: 100%; }
  .schedule tr { border-bottom: 1px solid var(--border-default); padding: var(--space-3) 0; }
  .schedule tbody tr:last-child { border-bottom: 0; }
  .schedule th, .schedule td { border: 0; padding: var(--space-2) var(--space-4); }
  .schedule td[data-label]::before { content: attr(data-label); display: block; font-size: 0.875rem; font-weight: 700; color: var(--clean-ink); margin-bottom: 2px; }
}
@media (max-width: 520px) {
  .hero__cta .btn, .civic-hero .hero__cta .btn { width: 100%; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .notice__head, .notice__body { padding-inline: var(--space-4); }
  .notice__rows { padding-inline: var(--space-4); }
  .notice__foot { padding-inline: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .log.is-playing > li { animation: none; }
}

@media print {
  .site-header, .cmdk, .mobile-menu { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Measure caps: keep reading lines under ~75 characters ---------- */
.clock p, .rule-list li, .voices__note, .civic-hero__note p { max-width: 64ch; }
.storm__foot, .train__aside { max-width: 66ch; }
.schedule th[scope="row"] { width: 18%; }
.schedule td[data-label="List price"] { width: 30%; }
.schedule td[data-label="What it covers"] { width: 52%; }
@media (max-width: 760px) { .schedule th[scope="row"], .schedule td[data-label] { width: 100%; } }
/* A table inside a panel is part of that panel, not a second card. */
.panel .table-wrap { border: 0; border-radius: 0; background: transparent; }
/* Graph nodes only call out the exception (an approval); routine success is
   stated once, in the run timeline beneath the graph. */
.graph .node-status.st-success { display: none; }
