/* ==========================================================================
   DVA Gebäudetechnik GmbH: „Sicherungskasten“
   Switch-cabinet grey and anthracite, the three phase colours (brown, black,
   grey) for everything electrical, pipe red and blue for heat and water, and
   one signal yellow. The header is a DIN rail of circuit breakers, the hero a
   riser diagram, the footer a heating manifold.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin + latin-ext) ---------- */
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Encode Sans Expanded';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/encode-sans-expanded-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Encode Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/encode-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Encode Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/encode-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  /* Cabinet and paper. Contrast of --ink-soft on --paper 7.2:1, on --cabinet 6.3:1. */
  --paper: #f2f3f0;
  --sheet: #fbfbf8;
  --cabinet: #e2e5e1;
  --module: #eef0ec;
  --board: #262a2e;
  --board-deep: #1c1f22;
  --ink: #15181b;
  --ink-soft: #4a5157;
  --line: #c3c8c4;
  --field: #6b7378;
  --on-board: #f2f3f0;
  --on-board-soft: #b9bfc3;

  /* Phase colours (L1 brown, L2 black, L3 grey) and pipe colours. */
  --l1: #7b4a24;
  --l2: #1c1e20;
  --l3: #868c90;
  --heat: #b2302a;
  --heat-soft: #e0857c;
  --water: #1d5aa6;
  --waste: #6f747a;
  --gas: #e0b000;
  --gas-ink: #7a5c00;
  --note-bg: #fff4cc;
  --signal: #ffc61a;
  --signal-deep: #f0b400;
  --ok: #1c6b38;
  --ok-bg: #e4efe6;
  --error-bg: #f8e6e4;
  --lcd: #c9d4a8;
  --lcd-ink: #2a3320;

  --font-head: 'Encode Sans Expanded', 'Arial', system-ui, sans-serif;
  --font-body: 'Encode Sans', 'Segoe UI', system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1240px;
  --head-h: 76px;
  --space-section: clamp(64px, 9vw, 120px);
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-module: inset 0 -3px 0 rgb(0 0 0 / 0.14), 0 2px 4px rgb(0 0 0 / 0.4);
  --shadow-sheet: 0 1px 1px rgb(21 24 27 / 0.08), 0 18px 36px -20px rgb(21 24 27 / 0.55);
  --phase-stripes: linear-gradient(var(--l1) 0 33.3%, var(--l2) 33.3% 66.6%, var(--l3) 66.6%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: var(--water); text-underline-offset: 0.18em; }
a:hover { color: var(--heat); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { padding: 0; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; }
.board :focus-visible, .order :focus-visible, .site-footer :focus-visible { outline-color: var(--signal); }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.nobr { white-space: nowrap; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* ==========================================================================
   Components
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.btn:active { transform: translateY(2px); }
.btn-signal { background: var(--signal); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn-signal:hover { background: var(--signal-deep); color: var(--ink); }
.btn-signal:active { box-shadow: 0 1px 0 var(--ink); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--board); color: var(--signal); }

/* ---------- Label plate (engraved marking strip) ---------- */
.plate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--on-board);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plate-id {
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--on-board);
  color: var(--ink);
  letter-spacing: 0.04em;
}
.plate.is-signal .plate-id { background: var(--signal); }

/* ---------- Breaker lever (shared by the header, the form and the 404) ---------- */
.breaker-lever {
  position: relative;
  flex: none;
  width: 14px;
  height: 32px;
  border-radius: 3px;
  background: #2a2f33;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.7);
}
.breaker-lever::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(#fbfbf9, #c9cdca);
  transition: transform 0.22s cubic-bezier(0.5, 1.6, 0.5, 1);
}

/* ==========================================================================
   Header: circuit breakers on a DIN rail
   ========================================================================== */
.board {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--board);
  color: var(--on-board);
  border-bottom: 3px solid var(--ink);
  transition: box-shadow 0.2s;
}
.board.is-scrolled { box-shadow: 0 8px 22px rgb(0 0 0 / 0.28); }
.board-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: var(--head-h);
  margin-inline: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: inherit;
  text-decoration: none;
}
.brand:hover { color: inherit; }
.brand-mark { flex: none; width: 38px; height: 38px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-head); font-size: 1.3125rem; font-weight: 800; letter-spacing: 0.06em; }
.brand-sub { margin-top: 4px; color: var(--on-board-soft); font-family: var(--font-head); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; }

.rail-list { position: relative; display: flex; gap: 4px; padding: 0 8px; list-style: none; }
/* The rail itself: a slotted steel profile running behind the modules. */
.rail-list::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 20px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgb(0 0 0 / 0.45) 18px 30px) center / 100% 6px no-repeat,
    linear-gradient(#c9cdd0, #8e9498 45%, #b5babd 55%, #7c8286);
  transform: translateY(-50%);
}
.breaker {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px 0 10px;
  border-radius: 3px;
  background: linear-gradient(#f6f7f4, #dde0dc);
  box-shadow: var(--shadow-module);
  color: var(--ink);
  text-decoration: none;
}
.breaker:hover { color: var(--ink); }
/* Status window: green while off, red once the breaker is switched on. */
.breaker::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #3d8c4f;
}
.rail-contact { display: none; }
.breaker-text { display: flex; flex-direction: column; line-height: 1.15; }
.breaker-id { color: var(--ink-soft); font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; }
.breaker-name { font-family: var(--font-head); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.breaker:hover .breaker-lever::after,
.mainswitch:hover .breaker-lever::after { transform: translateY(-4px); }
.breaker[aria-current] .breaker-lever::after,
.mainswitch[aria-current] .breaker-lever::after { transform: translateY(-14px); }
.breaker[aria-current]::after { background: var(--heat); }

.mainswitch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px 0 10px;
  border-radius: 3px;
  background: linear-gradient(#ffd54d, var(--signal-deep));
  box-shadow: var(--shadow-module);
  color: var(--ink);
  text-decoration: none;
}
.mainswitch:hover { color: var(--ink); background: linear-gradient(#ffdc66, #f5bd0f); }
.mainswitch .breaker-lever::after { background: linear-gradient(#e2554b, var(--heat)); }
.mainswitch-text { display: flex; flex-direction: column; line-height: 1.15; }
.mainswitch .breaker-id { color: var(--ink); }
.mainswitch-label { font-family: var(--font-head); font-size: 0.875rem; font-weight: 800; white-space: nowrap; }

/* Menu toggle: a small cabinet door with a handle. */
.door-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid rgb(242 243 240 / 0.5);
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-board);
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 700;
}
.door-toggle:hover { border-color: var(--on-board); }
.door-icon {
  position: relative;
  width: 16px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform-origin: left center;
  transition: transform 0.3s;
}
.door-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 2px;
  width: 2px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
}
.door-toggle[aria-expanded="true"] .door-icon { transform: perspective(60px) rotateY(-55deg); }

@media (max-width: 1039.98px) {
  :root { --head-h: 66px; }
  .door-toggle { display: inline-flex; }
  .mainswitch { height: 48px; padding: 0 14px 0 9px; }
  .mainswitch .breaker-lever { width: 12px; height: 28px; }
  .mainswitch .breaker-lever::after { height: 12px; }
  .mainswitch[aria-current] .breaker-lever::after { transform: translateY(-12px); }
  .rail {
    position: fixed;
    top: var(--head-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 49;
    padding: 28px var(--gutter) 40px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--board-deep);
    perspective: 1600px;
    visibility: hidden;
  }
  .rail.is-open { visibility: visible; }
  /* The board door: it swings open on its left hinge when the menu opens. */
  .rail::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
      linear-gradient(90deg, transparent calc(100% - 46px), rgb(0 0 0 / 0.5) calc(100% - 46px) calc(100% - 40px), transparent calc(100% - 40px)) center / 100% 70px no-repeat,
      repeating-linear-gradient(transparent 0 14px, rgb(0 0 0 / 0.08) 14px 16px),
      linear-gradient(90deg, #c7cbc8, #e3e6e2 60%, #cfd3d0);
    transform-origin: left center;
    pointer-events: none;
    opacity: 0;
  }
  .rail.is-open::before { animation: door-open 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .rail-list { flex-direction: column; gap: 12px; width: min(100%, 520px); margin-inline: auto; padding: 8px 0; }
  .rail-list::before {
    top: 0;
    bottom: 0;
    left: 32px;
    right: auto;
    width: 22px;
    height: auto;
    background:
      repeating-linear-gradient(transparent 0 18px, rgb(0 0 0 / 0.45) 18px 30px) center / 6px 100% no-repeat,
      linear-gradient(90deg, #c9cdd0, #8e9498 45%, #b5babd 55%, #7c8286);
    transform: none;
  }
  .breaker { height: 64px; padding: 0 20px 0 16px; gap: 16px; }
  .breaker .breaker-lever { width: 16px; height: 36px; }
  .breaker .breaker-lever::after { height: 16px; }
  .breaker[aria-current] .breaker-lever::after { transform: translateY(-16px); }
  .breaker-name { font-size: 1.0625rem; }
  .rail-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(100%, 520px);
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgb(242 243 240 / 0.16);
    color: var(--on-board-soft);
    font-size: 0.9375rem;
  }
  .rail-contact a { color: var(--on-board); font-family: var(--font-head); font-size: 1.375rem; font-weight: 800; text-decoration: none; }
  .rail-contact a:hover { color: var(--signal); }
  .breaker-id { font-size: 0.75rem; }
}
@keyframes door-open {
  0% { opacity: 1; transform: rotateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotateY(-100deg); }
}
@media (max-width: 559.98px) {
  .mainswitch-more { display: none; }
  .door-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .door-toggle { padding: 0; justify-content: center; }
  .board-inner { gap: 10px; }
}
@media (max-width: 379.98px) {
  .brand-sub { font-size: 0.625rem; }
  .brand-mark { width: 34px; height: 34px; }
  .mainswitch .breaker-id { display: none; }
}
@media (max-width: 339.98px) {
  .mainswitch .breaker-lever { display: none; }
  .mainswitch { padding: 0 12px; }
}

/* ==========================================================================
   Hero: riser diagram + smart meter
   ========================================================================== */
.hero {
  padding: clamp(32px, 5vw, 64px) 0 clamp(56px, 7vw, 96px);
  border-bottom: 2px solid var(--ink);
  background:
    linear-gradient(rgb(21 24 27 / 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgb(21 24 27 / 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  grid-template-areas:
    "title title"
    "riser side";
  gap: clamp(28px, 4vw, 40px) clamp(32px, 5vw, 72px);
  align-items: start;
}
.hero-title {
  grid-area: title;
  max-width: 15ch;
  font-size: clamp(2.375rem, 5.6vw, 4.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
/* Three phase conductors underline the headline. */
.hero-title::after {
  content: '';
  display: block;
  width: 132px;
  height: 12px;
  margin-top: clamp(16px, 2.4vw, 26px);
  background: var(--phase-stripes);
}
.riser {
  grid-area: riser;
  padding: clamp(10px, 1.6vw, 18px);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-sheet);
}
.riser-svg { width: 100%; height: auto; }
.riser-room { fill: #fbfbf9; }
.riser-cellar { fill: #e9ebe7; }
.riser-cut { fill: #2a2f33; }
.riser-glass { fill: #d9e4ec; }
.riser-label text { fill: var(--ink-soft); font-family: var(--font-head); font-size: 13px; font-weight: 700; text-anchor: middle; }
.riser-level path { fill: var(--ink); }
.riser-level text { fill: var(--ink-soft); font-family: var(--font-head); font-size: 11px; font-weight: 500; }
.pipe-waste { fill: none; stroke: var(--waste); stroke-width: 9; stroke-linejoin: round; }
.pipe-branch { fill: none; stroke: var(--waste); stroke-width: 4; stroke-linejoin: round; }
.pipe-water { fill: none; stroke: var(--water); stroke-width: 5; stroke-linejoin: round; }
.water-taps { fill: none; stroke: var(--water); stroke-width: 3; }
.fixture { fill: #fff; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.pipe-flow { fill: none; stroke: var(--heat); stroke-width: 5; }
.pipe-return { fill: none; stroke: var(--heat-soft); stroke-width: 5; }
.pipe-bridge { fill: none; stroke: #fbfbf9; stroke-width: 9; }
.pipe-flow-branch { fill: none; stroke: var(--heat); stroke-width: 3; }
.pipe-return-branch { fill: none; stroke: var(--heat-soft); stroke-width: 3; }
.radiator rect { fill: #fff; stroke: var(--ink); stroke-width: 1.8; }
.radiator path { fill: none; stroke: var(--ink); stroke-width: 1; }
.boiler { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.pipe-gas { fill: none; stroke: var(--gas); stroke-width: 4; stroke-linejoin: round; }
.cable path { fill: none; stroke-width: 2.4; }
.phase-l1 { stroke: var(--l1); }
.phase-l2 { stroke: var(--l2); }
.phase-l3 { stroke: var(--l3); }
.circuit-wire { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.lamp { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.socket { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
.subboard rect { fill: var(--module); stroke: var(--ink); stroke-width: 1.6; }
.subboard path { fill: var(--ink); }
.callout circle { fill: var(--ink); stroke: var(--sheet); stroke-width: 3; }
.callout text { fill: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 800; text-anchor: middle; }
/* Moving dashes over the pipes; switched off with reduced motion. */
.flow { fill: none; stroke: rgb(255 255 255 / 0.75); stroke-width: 1.6; stroke-dasharray: 5 13; stroke-linecap: round; animation: flow 1.4s linear infinite; }
.flow-gas { stroke: rgb(21 24 27 / 0.55); }
@keyframes flow { to { stroke-dashoffset: -36; } }

.hero-side { grid-area: side; display: flex; flex-direction: column; gap: 28px; padding-top: 6px; }
.hero-lead { max-width: 44ch; color: var(--ink-soft); font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.legend { display: grid; gap: 12px; padding: 20px 0 0; border-top: 2px solid var(--ink); list-style: none; }
.legend li { display: grid; grid-template-columns: 26px 40px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 0.9375rem; line-height: 1.4; }
.legend strong { display: block; font-family: var(--font-head); font-size: 0.875rem; }
.legend-no {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 800;
}
.legend-swatch { height: 10px; border-radius: 1px; }
.legend-swatch.is-power { background: var(--phase-stripes); }
.legend-swatch.is-heat { background: linear-gradient(var(--heat) 0 45%, transparent 45% 60%, var(--heat-soft) 60%); }
.legend-swatch.is-water { height: 6px; background: var(--water); }
.legend-swatch.is-waste { background: var(--waste); }
.legend-swatch.is-gas { height: 6px; background: var(--gas); }

/* Smart meter */
.meter { display: flex; align-items: center; gap: 18px; }
.meter-body {
  flex: 1 1 auto;
  max-width: 400px;
  padding: 10px 14px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(#f6f7f4, #d6dad6);
  box-shadow: var(--shadow-sheet);
}
.meter-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.meter-brand { color: var(--ink-soft); font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.meter-led { width: 9px; height: 9px; border-radius: 50%; background: var(--heat); box-shadow: 0 0 0 2px rgb(178 48 42 / 0.2); animation: impulse 2.4s steps(1) infinite; }
@keyframes impulse { 50% { background: #5a1a16; box-shadow: none; } }
.meter-lcd {
  min-height: 92px;
  padding: 10px 14px;
  border-radius: 5px;
  background: var(--lcd);
  color: var(--lcd-ink);
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.28);
}
.meter-unit { font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.meter-list { list-style: none; }
.meter-entry { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.meter-code { flex: none; font-family: var(--font-head); font-size: 0.75rem; font-weight: 700; opacity: 0.85; }
.meter-value { font-family: var(--font-head); font-size: clamp(1rem, 1.5vw, 1.1875rem); font-weight: 700; line-height: 1.25; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.meter.is-live .meter-entry:not(.is-shown) { display: none; }
.meter-key {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  padding: 4px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
}
.meter-key-cap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #545c62, var(--ink) 70%);
  box-shadow: 0 4px 0 #000, 0 6px 10px rgb(0 0 0 / 0.3);
  transition: transform 0.12s, box-shadow 0.12s;
}
.meter-key:hover { color: var(--ink); }
.meter-key:active .meter-key-cap { transform: translateY(3px); box-shadow: 0 1px 0 #000; }

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: var(--space-section) 0; }
.section-head { max-width: 780px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { margin-top: 18px; font-size: clamp(1.875rem, 4vw, 3.125rem); font-weight: 800; letter-spacing: -0.01em; }
.section-intro { max-width: 62ch; margin-top: 16px; color: var(--ink-soft); font-size: clamp(1rem, 1.2vw, 1.125rem); }
.section-cta { margin-top: 32px; }

/* ---------- F1 Leistungen: circuits ---------- */
.rocker {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 36px;
  padding: 5px;
  border-radius: 10px;
  background: var(--ink);
  box-shadow: 0 4px 0 #000, 0 12px 24px -12px rgb(0 0 0 / 0.6);
}
.rocker-side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px 0 18px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--on-board-soft);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.rocker-side::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #3a4045; transition: background-color 0.2s, box-shadow 0.2s; }
.rocker-side:hover { color: var(--on-board); }
.rocker-side[aria-selected="true"] {
  background: linear-gradient(#f6f7f4, #d6dad6);
  color: var(--ink);
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.16);
}
#tab-elektro[aria-selected="true"]::before { background: var(--signal); box-shadow: 0 0 0 3px rgb(255 198 26 / 0.35); }
#tab-wasser[aria-selected="true"]::before { background: var(--water); box-shadow: 0 0 0 3px rgb(29 90 166 / 0.3); }
.rocker-side:focus-visible { outline-color: var(--signal); }

.circuit { position: relative; padding-left: 84px; }
.circuit + .circuit { margin-top: 56px; }
.is-switched .circuit + .circuit { margin-top: 0; }
/* The feed: three conductors for power, flow and return for water & heat. */
.circuit::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 34px;
  left: 18px;
  width: 15px;
}
.circuit.is-power::before { background: linear-gradient(90deg, var(--l1) 0 4px, transparent 4px 5.5px, var(--l2) 5.5px 9.5px, transparent 9.5px 11px, var(--l3) 11px); }
.circuit.is-water::before { width: 16px; border-radius: 2px; background: linear-gradient(90deg, var(--heat) 0 6px, transparent 6px 10px, var(--water) 10px); }
.circuit-title { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 1.375rem; font-weight: 800; }
.loads { list-style: none; counter-reset: load; }
.load {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  gap: 8px clamp(24px, 4vw, 56px);
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: load;
}
/* Branch from the feed to each load, ending in a fuse symbol. */
.load::before {
  content: '';
  position: absolute;
  top: 34px;
  left: -51px;
  width: 24px;
  height: 3px;
  background: var(--ink);
}
.circuit.is-water .load::before { height: 4px; background: linear-gradient(var(--heat) 0 50%, var(--water) 50%); }
.load::after {
  content: counter(load);
  position: absolute;
  top: 25px;
  left: -29px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 800;
}
.load h4 { padding-top: 4px; font-size: 1.0625rem; font-weight: 700; }
.load p { color: var(--ink-soft); }

.relay {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 48px;
  padding: 26px 28px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-lg);
}
.relay-symbol { flex: none; width: 64px; height: 48px; color: var(--ink); }
.relay h3 { font-size: 1.125rem; font-weight: 800; }
.relay p { max-width: 74ch; margin-top: 8px; color: var(--ink-soft); }

/* ---------- F2 Wartung: calendar ---------- */
.maintenance { background: var(--cabinet); }
.calendar {
  --name-w: 22rem;
  --cal-gap: 32px;
  padding: clamp(18px, 3vw, 34px);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-sheet);
}
.calendar-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-left: calc(var(--name-w) + var(--cal-gap));
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 700;
}
.calendar-scale span { padding-left: 8px; border-left: 2px solid var(--ink); }
.calendar-rows { list-style: none; }
.cal-row {
  display: grid;
  grid-template-columns: var(--name-w) minmax(0, 1fr);
  align-items: center;
  gap: 8px var(--cal-gap);
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cal-row.is-heat { --dot: var(--heat); }
.cal-row.is-water { --dot: var(--water); }
.cal-row.is-waste { --dot: var(--waste); }
.cal-row.is-power { --dot: var(--l1); }
.cal-row.is-gas { --dot: #a37f00; }
.cal-name h3 { font-size: 1rem; font-weight: 700; }
.cal-name p { margin-top: 2px; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.45; }
/* Quarter ticks, year lines and one dot per due date, all drawn from --every (in quarters). */
.cal-strip {
  display: block;
  height: 34px;
  background:
    radial-gradient(circle at calc(100% / (2 * var(--every))) 50%, var(--dot) 0 7px, var(--sheet) 7.5px 10px, transparent 10.5px) 0 0 / calc(100% / 16 * var(--every)) 100% repeat-x,
    linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 25%),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 6.25%);
}
.calendar-note { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--ink-soft); font-size: 0.875rem; }
.cal-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }

/* ---------- F3 Ablauf: commissioning record ---------- */
.protocol { border: 2px solid var(--ink); border-radius: var(--radius-lg); background: var(--sheet); box-shadow: var(--shadow-sheet); overflow: hidden; }
.protocol-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--ink); color: var(--on-board); }
.protocol-head p { padding: 14px 20px; font-family: var(--font-head); font-size: 0.9375rem; font-weight: 700; }
.protocol-head p + p { border-left: 1px solid rgb(255 255 255 / 0.18); }
.protocol-head span { display: block; color: var(--on-board-soft); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; }
.protocol-rows { list-style: none; }
.protocol-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 11rem) minmax(0, 1fr) minmax(0, 15rem);
  align-items: start;
  gap: 8px 28px;
  padding: 22px 24px 22px 20px;
}
.protocol-row + .protocol-row { border-top: 1px solid var(--line); }
.protocol-no { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--l3); line-height: 1.2; }
.protocol-row h3 { padding-top: 4px; font-size: 1.125rem; font-weight: 800; }
.protocol-row p { color: var(--ink-soft); }
.protocol-row .protocol-result { display: flex; align-items: flex-start; gap: 12px; color: var(--ink); font-family: var(--font-head); font-size: 0.875rem; font-weight: 700; line-height: 1.4; }
.check { position: relative; flex: none; width: 24px; height: 24px; margin-top: -2px; border: 2px solid var(--ink); border-radius: 3px; background: #fff; }
.check::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 7px;
  height: 13px;
  border-right: 3px solid var(--ok);
  border-bottom: 3px solid var(--ok);
  transform: rotate(45deg);
  transition: transform 0.35s cubic-bezier(0.5, 1.6, 0.5, 1) 0.15s;
}
.has-reveal .protocol-row:not(.is-visible) .check::after { transform: rotate(45deg) scale(0); }

/* ---------- F4 Fragen: inspection report ---------- */
.audit { background: var(--cabinet); }
.audit-sheet { border: 2px solid var(--ink); border-radius: var(--radius-lg); background: var(--sheet); box-shadow: var(--shadow-sheet); overflow: hidden; }
.audit-head,
.audit-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 17rem) minmax(0, 1fr) 7.5rem;
  gap: 8px 28px;
  padding-inline: 20px 24px;
}
.audit-head { padding-block: 12px; background: var(--ink); color: var(--on-board); font-family: var(--font-head); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.audit-rows { list-style: none; }
.audit-row { align-items: start; padding-block: 22px; }
.audit-row + .audit-row { border-top: 1px solid var(--line); }
.audit-no { color: var(--l3); font-family: var(--font-head); font-size: 1.125rem; font-weight: 800; line-height: 1.4; }
.audit-q { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; }
.audit-a { color: var(--ink-soft); }
.audit-mark {
  justify-self: start;
  padding: 3px 10px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
  transform: rotate(-4deg);
}
.audit-mark.is-ok { color: var(--ok); background: var(--ok-bg); }
.audit-mark.is-note { color: var(--gas-ink); background: var(--note-bg); }

/* ---------- Q1 Auftrag: work order ---------- */
.order { background: var(--board); color: var(--on-board); }
.order .plate { background: #000; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28); }
.order .section-intro { color: var(--on-board-soft); }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); gap: clamp(24px, 3vw, 40px); align-items: start; }
.ticket {
  position: relative;
  padding: clamp(22px, 3.6vw, 44px);
  border-radius: 3px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.7);
}
/* Perforated tear-off edge. */
.ticket::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 0;
  right: 0;
  height: 14px;
  background: radial-gradient(circle at 9px 7px, var(--board) 0 5px, transparent 5.5px) 0 0 / 18px 14px repeat-x;
}
.ticket a { color: var(--water); }
.ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 4px double var(--ink);
}
.ticket-title { font-family: var(--font-head); font-size: clamp(1.25rem, 2.4vw, 1.625rem); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ticket-copy { color: var(--ink-soft); font-size: 0.8125rem; }
.field-group { min-width: 0; margin: 0 0 26px; padding: 0; border: 0; }
.field-group legend { margin-bottom: 10px; padding: 0; font-family: var(--font-head); font-size: 0.9375rem; font-weight: 700; }
.field-group .field-hint { margin: -6px 0 10px; }
.req { color: var(--heat); }
.choice-row, .toggle-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice, .toggle, .urgency { position: relative; cursor: pointer; }
.choice input, .toggle input, .urgency input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.choice:hover span { background: var(--cabinet); }
.choice input:checked + span { background: var(--ink); color: var(--paper); }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px 0 10px;
  border: 2px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 600;
  transition: border-color 0.15s, background-color 0.15s;
}
.toggle:hover { border-color: var(--ink); }
.toggle-lever {
  position: relative;
  width: 12px;
  height: 26px;
  border-radius: 3px;
  background: #2a2f33;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.6);
}
.toggle-lever::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(#fbfbf9, #c9cdca);
  transition: transform 0.2s cubic-bezier(0.5, 1.6, 0.5, 1);
}
.toggle:has(input:checked) { border-color: var(--ink); background: #fff8dc; }
.toggle input:checked + .toggle-lever::after { transform: translateY(-11px); background: linear-gradient(#ffd54d, var(--signal-deep)); }
.urgency-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.urgency > span {
  position: relative;
  display: block;
  height: 100%;
  padding: 12px 14px 12px 22px;
  border: 2px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.urgency > span::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 7px; width: 6px; border-radius: 2px; background: var(--l3); }
.urgency.is-mid > span::before { background: var(--signal-deep); }
.urgency.is-high > span::before { background: var(--heat); }
.urgency strong { display: block; color: var(--ink); font-family: var(--font-head); font-size: 0.9375rem; }
.urgency:hover > span { border-color: var(--ink); }
.urgency input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.choice input:focus-visible + span,
.toggle:has(input:focus-visible),
.urgency input:focus-visible + span { outline: 3px solid var(--water); outline-offset: 3px; }
fieldset[aria-invalid="true"] .choice span,
fieldset[aria-invalid="true"] .toggle,
fieldset[aria-invalid="true"] .urgency > span { border-color: var(--heat); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.field { min-width: 0; }
.field.is-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; font-family: var(--font-head); font-size: 0.875rem; font-weight: 700; }
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 2px solid var(--field);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}
.field select {
  appearance: none;
  padding-right: 42px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
  background-position: right 22px center, right 15px center;
  background-size: 7px 7px;
  background-repeat: no-repeat;
}
.field textarea { min-height: 136px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--heat); }
.field-hint { margin-top: 6px; color: var(--ink-soft); font-size: 0.875rem; }
.field-error { margin-top: 6px; color: var(--heat); font-size: 0.875rem; font-weight: 600; }
.field-error:empty { display: none; }
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ticket-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px dashed var(--line);
}
.ticket-note { max-width: 50ch; color: var(--ink-soft); font-size: 0.875rem; }
.form-status { margin-top: 20px; padding: 14px 18px; border-left: 5px solid var(--ok); border-radius: 2px; background: var(--ok-bg); }
.form-status:empty { display: none; }
.form-status.is-error { border-color: var(--heat); background: var(--error-bg); }

.order-aside { display: grid; gap: 18px; }
.contact-card { padding: 24px; border: 1px solid rgb(242 243 240 / 0.22); border-radius: var(--radius-lg); background: var(--board-deep); }
.contact-card h3, .gas-card h3 { font-size: 1.125rem; font-weight: 800; }
.contact-list { margin-top: 14px; }
.contact-list dt { color: var(--on-board-soft); font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.contact-list dd { margin: 2px 0 14px; font-size: 1rem; }
.contact-list dd:last-child { margin-bottom: 0; }
.contact-list a { color: var(--on-board); text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.contact-list a:hover { color: var(--signal); }
.gas-card { padding: 22px 24px; border-radius: var(--radius-lg); background: var(--signal); color: var(--ink); }
.gas-card p { margin-top: 8px; font-size: 0.9375rem; }

/* ==========================================================================
   Footer: heating manifold with the links on its outlets
   ========================================================================== */
.site-footer { padding: 64px 0 28px; background: var(--board-deep); color: var(--on-board); }
.site-footer a { color: var(--on-board); }
.site-footer a:hover { color: var(--signal); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 40px 56px; align-items: start; }
.footer-firm p + p { margin-top: 12px; }
.footer-firm p { color: var(--on-board-soft); }
.footer-firm .footer-name { color: var(--on-board); font-family: var(--font-head); font-size: 1.0625rem; font-weight: 800; }
.manifold { padding-top: 18px; }
.outlets { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 66px; list-style: none; }
/* Flow bar (red) and return bar (blue) across the top. */
.outlets::before,
.outlets::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 14px;
  border-radius: 7px;
}
.outlets::before { top: 0; background: linear-gradient(#ec9a91, var(--heat) 55%, #7e1f19); }
.outlets::after { top: 26px; background: linear-gradient(#7ea6d8, var(--water) 55%, #123e75); }
.outlets li { position: relative; display: flex; }
/* Each outlet: flow and return pipes dropping from the bars to the link. */
.outlets li::before {
  content: '';
  position: absolute;
  top: -59px;
  left: 50%;
  width: 16px;
  height: 59px;
  background: linear-gradient(90deg, var(--heat) 0 6px, transparent 6px 10px, var(--water) 10px);
  transform: translateX(-50%);
}
/* Flow meter on top of the flow bar. */
.outlets li::after {
  content: '';
  position: absolute;
  top: -84px;
  left: calc(50% - 8px);
  z-index: 2;
  width: 10px;
  height: 22px;
  border: 1.5px solid rgb(242 243 240 / 0.6);
  border-radius: 5px;
  background: linear-gradient(transparent 0 45%, var(--heat-soft) 45% 62%, transparent 62%), rgb(242 243 240 / 0.12);
}
.outlets a,
.outlets .link-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 2px solid rgb(242 243 240 / 0.28);
  border-radius: var(--radius);
  background: var(--board);
  color: var(--on-board);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.outlets a:hover,
.outlets .link-button:hover { border-color: var(--signal); color: var(--signal); }
.outlets a[aria-current="page"] { border-color: var(--on-board); }
.footer-legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgb(242 243 240 / 0.14); color: var(--on-board-soft); font-size: 0.875rem; }

/* ==========================================================================
   Pages: legal documents and 404
   ========================================================================== */
.doc { padding: clamp(40px, 6vw, 80px) 0 var(--space-section); }
.doc-head { margin-bottom: clamp(28px, 4vw, 48px); }
.doc-head h1 { margin-top: 18px; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.01em; }
.doc-body {
  position: relative;
  max-width: 820px;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 48px) clamp(24px, 4vw, 48px) clamp(32px, 5vw, 60px);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-sheet);
}
/* The three phase conductors run down the left edge of every document. */
.doc-body::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: clamp(10px, 2vw, 22px);
  width: 9px;
  background: linear-gradient(90deg, var(--l1) 0 3px, var(--l2) 3px 6px, var(--l3) 6px);
}
.prose > * + * { margin-top: 0.9em; }
.prose h2 { margin-top: 2em; font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 800; }
.prose h3 { margin-top: 1.5em; font-size: 1.0625rem; font-weight: 700; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose .lead { font-size: 1.125rem; color: var(--ink-soft); }
.prose dl { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 6px 20px; }
.prose dt { font-weight: 700; }
.prose code { padding: 1px 5px; border-radius: 3px; background: var(--cabinet); font-size: 0.9em; white-space: nowrap; }
.toc { padding: 20px 24px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.toc h2 { margin: 0; font-size: 1rem; }
.toc ol { margin-top: 10px; columns: 2 16rem; column-gap: 32px; }
.toc li { break-inside: avoid; }
.highlight { padding: 18px 22px; border-left: 6px solid var(--signal-deep); border-radius: 2px; background: var(--note-bg); }
.highlight h3 { margin-top: 0; }
.highlight > * + * { margin-top: 0.7em; }
.form-sheet { padding: 20px 24px; border: 2px dashed var(--ink); border-radius: var(--radius); }
.form-sheet > * + * { margin-top: 0.7em; }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9375rem; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { background: var(--ink); color: var(--on-board); font-family: var(--font-head); font-size: 0.8125rem; }
.table-wrap tr:last-child td { border-bottom: 0; }
/* Narrow screens: each cookie-table row becomes a stacked block of "label / value" pairs. */
@media (max-width: 719.98px) {
  .table-wrap { overflow-x: visible; }
  .table-wrap table { min-width: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap tr { border-bottom: 1px solid var(--line); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 4px 14px; border-bottom: 0; overflow-wrap: break-word; }
  .table-wrap td:first-child { padding-top: 14px; }
  .table-wrap td:last-child { padding-bottom: 14px; }
  .prose code { white-space: normal; overflow-wrap: anywhere; }
  .table-wrap td::before { content: attr(data-label); display: block; color: var(--ink-soft); font-family: var(--font-head); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
}

.tripped { padding: clamp(48px, 8vw, 112px) 0 var(--space-section); }
.tripped-grid { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.rcd { width: 100%; max-width: 240px; height: auto; margin-inline: auto; }
.tripped-code { font-family: var(--font-head); font-size: 0.875rem; font-weight: 700; color: var(--heat); letter-spacing: 0.08em; text-transform: uppercase; }
.tripped h1 { margin-top: 12px; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
.tripped p:not(.tripped-code) { max-width: 52ch; margin-top: 16px; color: var(--ink-soft); font-size: 1.0625rem; }
.tripped .hero-actions { margin-top: 28px; }

/* ==========================================================================
   Cookie consent (banner + dialog) as a fuse-board panel
   ========================================================================== */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 800px;
  max-height: calc(100vh - 32px);
  margin-inline: auto;
  padding: 30px clamp(18px, 3vw, 30px) clamp(18px, 3vw, 26px);
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.65);
}
.consent::before,
.consent-dialog-inner::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(var(--l1) 0 3px, var(--l2) 3px 6px, var(--l3) 6px);
}
.consent-title { font-size: 1.1875rem; font-weight: 800; }
.consent-text { margin-top: 8px; color: var(--ink-soft); font-size: 0.9375rem; }
.consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.consent-btn {
  flex: 1 1 170px;
  min-height: 50px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 700;
  transition: background-color 0.18s, color 0.18s;
}
.consent-btn:hover { background: var(--board); color: var(--signal); }
.consent-link {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--water);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.consent-link:hover { color: var(--heat); }
.consent-dialog {
  width: min(700px, 100% - 32px);
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  color: var(--ink);
}
.consent-dialog::backdrop { background: rgb(21 24 27 / 0.65); }
.consent-dialog-inner { position: relative; padding: 32px clamp(20px, 4vw, 32px) clamp(20px, 4vw, 28px); }
.consent-categories { margin-top: 18px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.consent-category { padding-block: 14px; border-bottom: 1px solid var(--line); }
.consent-category-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consent-category h3 { font-size: 1.0625rem; font-weight: 800; }
.consent-category p { margin-top: 6px; color: var(--ink-soft); font-size: 0.9063rem; }
.consent-always { color: var(--ok); font-family: var(--font-head); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.consent-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.consent-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* A breaker lever lying on its side: left = 0, right = I. */
.consent-switch-track {
  position: relative;
  width: 56px;
  height: 30px;
  border-radius: 4px;
  background: #2a2f33;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.7);
  transition: background-color 0.18s;
}
.consent-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: linear-gradient(#fbfbf9, #c9cdca);
  transition: transform 0.2s cubic-bezier(0.5, 1.6, 0.5, 1), background-color 0.18s;
}
.consent-switch input:checked + .consent-switch-track { background: var(--ok); }
.consent-switch input:checked + .consent-switch-track::after { transform: translateX(26px); }
.consent-switch input:focus-visible + .consent-switch-track { outline: 3px solid var(--water); outline-offset: 3px; }
.consent-btn-save { background: var(--signal); color: var(--ink); }
.consent-btn-save:hover { background: var(--signal-deep); color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .protocol-row { grid-template-columns: 56px minmax(0, 10rem) minmax(0, 1fr); }
  .protocol-row .protocol-result { grid-column: 3; }
  .audit-head, .audit-row { grid-template-columns: 48px minmax(0, 14rem) minmax(0, 1fr) 7rem; gap: 8px 22px; }
}
@media (max-width: 1023.98px) {
  /* One column: the side column dissolves so the drawing sits between the
     buttons and its legend. */
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: none; gap: 28px 40px; }
  .hero-side { display: contents; }
  .hero-title, .hero-lead, .hero-actions, .riser { grid-area: auto; grid-column: 1 / -1; }
  .hero-title { max-width: 14ch; }
  .hero-lead { order: 1; max-width: 60ch; }
  .hero-actions { order: 2; }
  .riser { order: 3; }
  .legend { order: 4; }
  .meter { order: 5; align-self: start; flex-direction: column; align-items: stretch; }
  .meter-body { min-width: 0; max-width: none; }
  .meter-key { flex-direction: row; justify-content: center; }
  .calendar { --name-w: 15rem; --cal-gap: 24px; }
  .order-grid { grid-template-columns: minmax(0, 1fr); }
  .order-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-head { display: none; }
  .audit-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px 16px; }
  .audit-q { grid-column: 2; }
  .audit-mark { grid-column: 3; grid-row: 1; }
  .audit-a { grid-column: 2 / -1; }
}
@media (max-width: 759.98px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .legend, .meter { grid-column: 1 / -1; }
  .load { grid-template-columns: minmax(0, 1fr); padding: 18px 0; }
  .circuit { padding-left: 66px; }
  .circuit::before { left: 6px; }
  .load::before { left: -45px; width: 22px; top: 30px; }
  .load::after { top: 21px; left: -27px; }
  .load h4 { padding-top: 2px; }
  .relay { flex-direction: column; gap: 14px; padding: 22px 20px; }
  .calendar-scale { margin-left: 0; }
  .cal-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .protocol-head { grid-template-columns: minmax(0, 1fr); }
  .protocol-head p { padding: 10px 18px; }
  .protocol-head p + p { border-left: 0; border-top: 1px solid rgb(255 255 255 / 0.18); }
  .protocol-row { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 14px; padding: 20px 18px 20px 14px; }
  .protocol-row p, .protocol-row .protocol-result { grid-column: 2; }
  .protocol-no { font-size: 1.25rem; }
  .urgency-row { grid-template-columns: minmax(0, 1fr); }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .order-aside { grid-template-columns: minmax(0, 1fr); }
  .ticket-foot .btn { width: 100%; }
  /* The manifold turns vertical: bars down the left, outlets to the right. */
  .outlets { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 0 0 76px; }
  .outlets::before, .outlets::after { top: 0; bottom: 0; width: 14px; height: auto; }
  .outlets::before { left: 0; right: auto; background: linear-gradient(90deg, #ec9a91, var(--heat) 55%, #7e1f19); }
  .outlets::after { left: 26px; right: auto; background: linear-gradient(90deg, #7ea6d8, var(--water) 55%, #123e75); }
  .outlets li::before { top: 50%; left: -69px; width: 69px; height: 16px; background: linear-gradient(var(--heat) 0 6px, transparent 6px 10px, var(--water) 10px); transform: translateY(-50%); }
  .outlets li::after { display: none; }
  .outlets a, .outlets .link-button { justify-content: flex-start; padding-inline: 16px; }
  .tripped-grid { grid-template-columns: minmax(0, 1fr); }
  .rcd { max-width: 180px; margin-inline: 0; }
  .prose dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prose dd + dt { margin-top: 10px; }
}
@media (max-width: 479.98px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .meter { flex-direction: column; align-items: stretch; }
  .meter-body { max-width: none; }
  .meter-key { flex-direction: row; justify-content: center; }
  .rocker { display: flex; }
  .rocker-side { flex: 1 1 50%; justify-content: center; padding: 0 12px; font-size: 0.875rem; }
  .audit-row { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 16px; }
  .audit-no { display: none; }
  .audit-q { grid-column: 1; }
  .audit-mark { grid-column: 2; }
  .audit-a { grid-column: 1 / -1; }
  .choice-row .choice { flex: 1 1 100%; }
  .choice span { width: 100%; }
  .toggle-row .toggle { flex: 1 1 calc(50% - 5px); }
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .flow { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .board, .consent, .consent-dialog, .skip-link, .meter-key, .rocker, .site-footer .manifold { display: none; }
  body { background: #fff; }
  .circuit[hidden] { display: block; }
  .doc-body, .ticket, .protocol, .audit-sheet, .calendar { box-shadow: none; }
}
