/* digitreal.de — Werkbank-Sprache, eine Stufe größer. Tokens: cowork-shared/digitreal-landing/design.md §1 */

@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-Light.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --surface: #ffffff;
  --sunken: #f4f4f4;
  --line: #e0e0e0;
  --line-strong: #c6c6c6;
  --fg: #161616;
  --fg-2: #525252;
  --fg-3: #6f6f6f;
  --accent: #1D4ED8;
  --primary: #1D4ED8;
  --on-primary: #ffffff;
  --primary-hover: #1a44bf;
  --ref: #8d8d8d;
  --ok: #198038;
  --pending: #8e6a00;
  --missing: #da1e28;
  --logo: #1D4ED8;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: 32px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #161616;
    --sunken: #262626;
    --line: #393939;
    --line-strong: #525252;
    --fg: #f4f4f4;
    --fg-2: #c6c6c6;
    --fg-3: #a8a8a8;
    --accent: #60A5FA;
    --primary-hover: #2a5ce6;
    --ref: #6f6f6f;
    --ok: #42be65;
    --pending: #f1c21b;
    --missing: #fa4d56;
    --logo: #ffffff;
  }
}
@media (max-width: 479px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--fg-2);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
strong, b { font-weight: 500; color: var(--fg); }
a { color: var(--accent); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); color: var(--fg); padding: 8px 16px; z-index: 10; }
.skip:focus { left: 0; }

/* Typografie */
.display {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 300;
  color: var(--fg);
}
.display .l, .display .b { display: block; }
.display .b { font-weight: 500; }
.lead {
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  line-height: 1.55;
  font-weight: 300;
}

/* Knopf */
.btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: var(--primary);
  color: var(--on-primary);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border-radius: 0;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: inset 0 0 0 3px var(--surface); }
.btn-sm { height: 38px; font-size: 14px; }

/* Kopfzeile */
html { scroll-padding-top: 73px; }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.logo {
  display: block;
  height: 34px;
  aspect-ratio: 874 / 257;
  background: var(--logo);
  -webkit-mask: url("../assets/logo-quer.svg") no-repeat left center / contain;
  mask: url("../assets/logo-quer.svg") no-repeat left center / contain;
}

/* Abschnitte */
main > section { border-bottom: 1px solid var(--line); }

/* 1 — Hero */
.hero { display: flex; align-items: center; min-height: min(calc(100svh - 73px - 166px), 960px); padding: 48px 0; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-text > * + * { margin-top: 24px; }
.hero-text .lead { max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.mail { font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
@media (min-width: 720px) {
  .hero { padding: 64px 0; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 48px; }
}

.scene { width: 100%; height: auto; }
.scene .doc rect, .scene .card rect { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.scene .doc.half { opacity: 0.35; }
.scene .ln { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; opacity: 0.6; }
.scene .glyph { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.scene .house, .scene .px { fill: var(--accent); }
.scene .order { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 0.1 5; }
.scene text { font-family: var(--sans); }
.scene .t1 { font-size: 12.5px; font-weight: 500; fill: var(--fg); }
.scene .t2 { font-size: 10.5px; font-weight: 400; fill: var(--fg-3); }

/* Abschnitte allgemein */
.sec { padding: 48px 0; }
@media (min-width: 720px) { .sec { padding: 72px 0; } }
.h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 300;
  color: var(--fg);
}
.h2 b { font-weight: 500; }
.h3 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.3; font-weight: 600; color: var(--fg); }
.num { font-family: var(--mono); font-weight: 400; }
.sub { color: var(--fg-3); }
.r { text-align: right; }

/* 2 — Schieberegler */
.tabbar { display: flex; border: 1px solid var(--line); background: var(--sunken); }
.tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 1 0 5.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 12px;
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: transparent;
  color: var(--fg-3);
  font: 400 13px/1.2 var(--sans);
  cursor: pointer;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--fg); font-weight: 500; }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.tab:focus-visible { outline-offset: -2px; }
.prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); opacity: 0.7; transform: scaleX(0); transform-origin: left; }
.slider.is-playing .tab[aria-selected="true"] .prog { animation: prog 5.2s linear forwards; }
.slider.is-paused .tab[aria-selected="true"] .prog { animation-play-state: paused; }
@keyframes prog { to { transform: scaleX(1); } }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: square; }
.playpause { flex: 0 0 48px; border: 0; border-radius: 0; background: transparent; color: var(--fg-2); cursor: pointer; display: grid; place-items: center; }
.playpause:hover { color: var(--fg); }
.playpause:focus-visible { outline-offset: -2px; }
.playpause .i-play, .playpause[aria-pressed="true"] .i-pause { display: none; }
.playpause[aria-pressed="true"] .i-play { display: block; }
.i-play path { fill: currentColor; }

.stage { position: relative; display: grid; margin-top: 24px; }
.panel { grid-area: 1 / 1; display: grid; gap: 24px; align-content: start; min-width: 0; visibility: hidden; opacity: 0; }
.panel.is-active { visibility: visible; opacity: 1; animation: rise 350ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.panel:focus-visible { outline-offset: 4px; }
/* Das Modul wächst aus seiner Spalte (design.md §5): das Skript bewegt den Rahmen .zoom von der Spalte zum Mockup
   (oder zurück) und setzt am Ziel-Panel .zoom-in, nach 300 ms .zoom-done; .zoomed bleibt bis zum nächsten Wechsel. */
.zoom { position: absolute; z-index: 2; display: none; left: 0; top: 0; padding: 10px; border: 1px solid var(--accent); background: var(--surface); font-style: normal; pointer-events: none; }
.zoom.is-on { display: block; }
.zoom.is-on .tt { animation: zoomtt 250ms ease forwards; }
@keyframes zoomtt { to { opacity: 0; } }
.panel.is-active.zoomed { animation: none; }
.panel.zoom-in .mock { border-color: transparent; }
.panel.zoom-in .mock > * { opacity: 0; }
.panel.zoom-in .card-text { animation: rise 350ms ease-out 200ms both; }
.panel.zoom-done .mock { border-color: var(--line-strong); transition: border-color 190ms ease 150ms; }
.panel.zoom-done .mock > * { opacity: 1; transition: opacity 300ms ease; }
@media (min-width: 760px) {
  .panel { grid-template-columns: 1.55fr 1fr; gap: 40px; align-items: start; }
}
.card-text { max-width: 65ch; padding-top: 8px; }
.card-text .h3 { margin-bottom: 12px; }
@media (min-width: 760px) {
  /* Leiste so breit wie die linke Spalte der Bühne (1,55 : 1, 40 px Abstand); Textkarte in H2- und Lead-Größe */
  .slider .tabbar { width: calc((100% - 40px) * 1.55 / 2.55); }
  .card-text .h3 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 16px; }
  .card-text p { font-size: clamp(1.05rem, 1.9vw, 1.25rem); line-height: 1.55; font-weight: 300; }
}

/* Mockups */
.mock { border: 1px solid var(--line-strong); padding: 16px; min-height: 280px; min-width: 0; overflow-x: auto; font-size: 12px; font-weight: 400; color: var(--fg-2); }
.mock-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mt { font-size: 13px; font-weight: 600; color: var(--fg); }
.ms { font-size: 11px; color: var(--fg-3); display: inline-flex; align-items: center; gap: 6px; }
.tt { display: block; font-size: 11px; font-weight: 600; color: var(--fg); }
.src { display: block; font-size: 11px; color: var(--fg-3); margin-top: 4px; }
.src a { color: var(--accent); text-decoration: none; }
.src a:hover { text-decoration: underline; }
.miss { color: var(--missing); }
.chip { display: inline-block; padding: 2px 6px; border: 1px solid currentColor; font-size: 11px; line-height: 1.3; white-space: nowrap; }
.c-pending { color: var(--pending); }
.c-missing { color: var(--missing); }

.ring { width: 56px; height: 56px; }
.ring circle { fill: none; stroke-width: 4; }
.ring .rt { stroke: var(--line); }
.ring .rf { stroke: var(--accent); }

.docflow { display: grid; grid-template-columns: 150px 24px 1fr; gap: 16px; align-items: center; min-width: 560px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.files li { font: 400 11px/1 var(--mono); color: var(--fg-2); border: 1px solid var(--line-strong); padding: 6px 8px; width: max-content; background: var(--surface); }
.files .k1 { transform: rotate(-4deg); }
.files .k2 { transform: rotate(3deg) translateX(10px); }
.files .k3 { transform: rotate(-2deg) translateX(4px); }
.files .k4 { transform: rotate(5deg) translateX(16px); }
.flow-arrow { width: 24px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.6; transform: rotate(-90deg); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.col { border: 1px solid var(--line-strong); padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; }
.col .dp { margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--fg-3); }
.slot { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; hyphens: auto; }
.slot i { font-style: normal; flex: 0 0 10px; }
.s-ok i { color: var(--ok); }
.s-sug i { color: var(--accent); }
.s-none { color: var(--fg-3); }

.fields { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 16px 20px; }
.fl { display: block; font-size: 11px; color: var(--fg-2); margin-bottom: 4px; }
.fv { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: var(--sunken); border-bottom: 1px solid var(--ref); padding: 6px 8px; font-size: 13px; color: var(--fg); }
.calc .fv { border-bottom-style: dashed; }
.fu { font-size: 11px; color: var(--fg-3); }

.finance { display: grid; grid-template-columns: minmax(300px, 1.6fr) minmax(170px, 1fr); gap: 16px; min-width: 500px; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font: 400 9px var(--mono); fill: var(--fg-3); }
.chart .b-brut { fill: var(--ref); }
.chart .b-net { fill: var(--accent); }
.chart .soll { opacity: 0.4; }
.chart .today { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 3 3; }
.lg { display: inline-block; width: 8px; height: 8px; }
.lg-ref { background: var(--ref); }
.lg-acc { background: var(--accent); margin-left: 6px; }
.units { display: grid; gap: 6px; align-content: start; font-size: 11px; }
.unit { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.tt-gap { margin-top: 10px; }

.calc-tbl { width: 100%; min-width: 360px; border-collapse: collapse; font-size: 12px; }
.calc-tbl td { padding: 6px 0; border-top: 1px solid var(--line); }
.calc-tbl tr:first-child td { border-top: 0; }
.calc-tbl .pct { color: var(--fg-3); font-size: 11px; padding: 6px 12px; }
.calc-tbl .num { color: var(--fg); font-size: 13px; }
.calc-tbl .sum td { border-top: 1px solid var(--fg); font-weight: 600; color: var(--fg); padding-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { border: 1px solid var(--line-strong); padding: 12px; }
.kv { display: block; font-size: 18px; color: var(--fg); }

@media (max-width: 759px) {
  .tabbar { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .panel.is-active { animation: none; }
  .prog { display: none; }
}

/* Bewegung — Bausteine für die Abschnitte 3 und 4 (design.md §6.1); Auslöser ist die Scrollposition.
   html.js: das Skript läuft. html.anim: das Skript läuft und Bewegung ist erlaubt.
   Verborgene Startzustände gelten nur unter .anim; ohne sie steht der Endzustand.
   Reihenfolge und Verzögerung kommen aus data-i / data-d (das Skript setzt --i / --d; die CSP erlaubt kein style-Attribut). */

/* Der Rahmen zeichnet sich: vier Linien, oben → rechts → unten → links, zusammen 0,96 s. */
.draw { position: relative; }
.fr { position: absolute; background: var(--line-strong); pointer-events: none; }
.fr-t { left: 0; top: 0; width: 100%; height: 1px; transform-origin: left; }
.fr-r { right: 0; top: 0; width: 1px; height: 100%; transform-origin: top; }
.fr-b { left: 0; bottom: 0; width: 100%; height: 1px; transform-origin: right; }
.fr-l { left: 0; top: 0; width: 1px; height: 100%; transform-origin: bottom; }
.anim .draw:not(.is-in) > .fr-t, .anim .draw:not(.is-in) > .fr-b { transform: scaleX(0); }
.anim .draw:not(.is-in) > .fr-r, .anim .draw:not(.is-in) > .fr-l { transform: scaleY(0); }
.anim .draw.is-in > .fr { transition: transform 0.28s linear; }
.anim .draw.is-in > .fr-r { transition-duration: 0.2s; transition-delay: 0.28s; }
.anim .draw.is-in > .fr-b { transition-delay: 0.48s; }
.anim .draw.is-in > .fr-l { transition-duration: 0.2s; transition-delay: 0.76s; }

/* Bausteine erscheinen versetzt: .stg ist die Bühne, .is-on startet, --i zählt die Reihenfolge, --base setzt den Beginn. */
.anim .stg .st { opacity: 0; transform: translateY(8px); }
.anim .stg.is-on .st { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); transition-delay: calc(var(--base, 0s) + var(--i, 0) * 60ms + var(--d, 0s)); }
.anim .stg .fade { opacity: 0; }
.anim .stg.is-on .fade { opacity: 1; transition: opacity 0.4s ease calc(var(--base, 0s) + var(--d, 0s)); }

/* Ringe und Balken füllen sich. Ring: stroke-dasharray="<Wert> 200" bei pathLength="100" im SVG, hier nur der Weg dorthin. */
.anim .stg .pf { stroke-dashoffset: 100; }
.anim .stg.is-on .pf { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s cubic-bezier(0.3, 0, 0.2, 1); transition-delay: calc(var(--base, 0s) + var(--i, 0) * 60ms + 0.2s); }
.gx, .gy { transform-box: fill-box; }
.anim .stg .gx { transform: scaleX(0); transform-origin: left center; }
.anim .stg .gy { transform: scaleY(0); transform-origin: center bottom; }
.anim .stg.is-on .gx, .anim .stg.is-on .gy { transform: none; transition: transform 0.7s cubic-bezier(0.3, 0, 0.2, 1); transition-delay: calc(var(--base, 0s) + var(--i, 0) * 60ms + var(--d, 0s)); }

/* Das Aktive leuchtet: 3 px accent links. */
.lit { position: relative; }
.lit::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); pointer-events: none; }

/* Klebende Strecke (design.md §6.1): das Skript setzt .is-pin an den Abschnitt, wenn Bewegung erlaubt ist und
   Breite und Höhe reichen. .track ist der Scrollweg, .pin klebt unter der Kopfzeile. Ist der Abschnitt zu Ende,
   kommt .is-done hinzu: der Pin wird statisch, die Strecke so hoch wie ihr Inhalt. */
.sec.is-pin { padding-top: 40px; }
.sec.is-pin .track { overflow-anchor: none; }
.sec.is-pin .pin { position: sticky; top: 73px; min-height: calc(100svh - 73px); padding: 32px 0; }
.sec.is-pin.is-done .track { height: auto; }
.sec.is-pin.is-done .pin { position: static; min-height: 0; }

/* Szenen der Abschnitte 3 und 4: Vokabular zusätzlich zu den Mockups aus Abschnitt 2 */
.modules .num, .steps .num { font-variant-numeric: tabular-nums; }
.ov .mock-h, .gs .mock-h, .pcard .mock-h { flex-wrap: wrap; gap: 4px 16px; margin-bottom: 0; white-space: normal; }
.cap { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.lk { color: var(--accent); }
.cf { color: var(--ok); white-space: nowrap; }
.c-plain { color: var(--fg); border-color: var(--line-strong); }
.arw { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: var(--fg-3); stroke-width: 1.5; stroke-linecap: square; }

/* 3 — die Funktionen der drei Module: Text zum Aufklappen, Szene je Modul, Übersicht zuletzt (design.md §6.2)
   Mit .is-pin (Skript) scrollgeführt in vier Stufen; sonst mit Bewegung untereinander, jede Szene baut sich beim Hereinscrollen auf.
   Ohne .anim (kein Skript oder reduzierte Bewegung): keine Übersicht, alle Texte offen, jede Szene fertig neben bzw. unter ihrem Text. */
.modules .h2 { margin-bottom: 32px; text-wrap: balance; }
.mods { display: grid; }
.mod { display: grid; min-width: 0; }

/* Übersicht: Rahmen mit drei Vorschaufenstern */
.ov { display: none; container: ov / inline-size; gap: 14px; align-content: start; padding: 16px; margin-top: 8px; font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--fg-2); }
.anim .ov { display: grid; }
.anim .mods:not(.is-pin) .ov:not(.is-in) { visibility: hidden; }
.ov .mock-h { align-items: center; }
.ov-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ov-tile { position: relative; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ov-tile:hover, .ov-tile:focus-visible { border-color: var(--accent); }
.ov-tile:focus-visible { outline-offset: -2px; }
.ov-tile:hover .arw, .ov-tile:focus-visible .arw { stroke: var(--accent); }
.ov-in { display: grid; gap: 2px; padding: 12px; }
.anim .ov-in { transition: opacity 0.25s ease; }
.mini { width: 100%; height: auto; margin-bottom: 8px; }
.mini.ring { width: 100%; height: auto; }
.ov-n { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--fg); }
.ov-s { font-size: 11px; color: var(--fg-3); }
.ov-hint { font-size: 11px; color: var(--fg-3); }
.mods[data-hi] .ov-in { opacity: 0.45; }
.mods[data-hi="0"] .ov-tile[data-mod="0"] .ov-in, .mods[data-hi="1"] .ov-tile[data-mod="1"] .ov-in, .mods[data-hi="2"] .ov-tile[data-mod="2"] .ov-in { opacity: 1; }
.mods[data-hi="0"] .ov-tile[data-mod="0"], .mods[data-hi="1"] .ov-tile[data-mod="1"], .mods[data-hi="2"] .ov-tile[data-mod="2"] { border-color: var(--accent); }
@container ov (max-width: 430px) {
  .ov-tiles { grid-template-columns: minmax(0, 1fr); }
  .ov-in { grid-template-columns: 112px minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .mini { grid-row: 1 / 3; margin: 0; }
  .ov-n { align-self: end; }
  .ov-s { align-self: start; }
}
.m-track { fill: var(--line); }
.m-acc { fill: var(--accent); }
.m-ref { fill: var(--ref); }
.m-pend { fill: var(--pending); }
.m-vac { fill: none; stroke: var(--missing); stroke-width: 1; stroke-dasharray: 3 3; }
.m-line { fill: none; stroke: var(--line); stroke-width: 1; }
.m-dot { fill: var(--line-strong); }
.mini .soll { opacity: 0.4; }
.mini .m-num { font: 400 12px var(--mono); fill: var(--fg); text-anchor: middle; }
.mini .m-cap { font: 400 9.5px var(--sans); fill: var(--fg-3); }
.mini .m-big { font: 400 13px var(--mono); fill: var(--fg); }

/* Liste: Titel und Untertitel sind der Knopf, der Text klappt darunter auf */
.mod-h { margin: 0; font: inherit; }
.mod-b { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 14px; gap: 6px 16px; align-items: start; width: 100%; padding: 20px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--fg-2); font: 300 15px/1.55 var(--sans); text-align: left; }
.js .mod-b { cursor: pointer; }
.mod-b:focus-visible { outline-offset: -2px; }
.mod-t { font-size: clamp(1.1rem, 1.9vw, 1.35rem); line-height: 1.3; font-weight: 600; color: var(--fg); text-wrap: balance; }
.mod-t .l2 { display: block; }
.mod-s { grid-column: 1; font-size: 16px; }
.mod-b .arw { display: none; grid-column: 2; grid-row: 1; margin-top: 7px; }
.js .mod-b .arw { display: block; }
.mod-b:hover .arw, .js .mod.is-open .mod-b .arw { stroke: var(--accent); }
.js .mod.is-open .mod-b .arw { transform: rotate(90deg); }
.anim .mod-b .arw { transition: transform 0.3s ease; }
.mod-body { position: relative; display: grid; grid-template-rows: 1fr; }
.mod-body > div { overflow: hidden; min-height: 0; }
.mod-body p { max-width: 62ch; padding: 0 16px 12px; }
.mod-body p:last-child { padding-bottom: 24px; }
.anim .mod.is-open .mod-b::before, .anim .mod.is-open .mod-body::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.js .mod:not(.is-open) .mod-body { grid-template-rows: 0fr; }
.anim .mod-body { transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.mods > .mod:nth-last-child(2) .mod-body { border-bottom: 1px solid var(--line); }

/* Szene eines Moduls: Rahmen, der sich zeichnet; vor dem Aufbau ist nichts zu sehen */
.gs { container: gs / inline-size; --base: 0.7s; min-width: 0; margin: 8px 0 24px; padding: 16px; display: grid; gap: 14px; align-content: start; font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--fg-2); }
.anim .gs:not(.is-on) > :not(.fr) { opacity: 0; }
.anim .gs.is-on > :not(.fr):not(.st):not(.fade) { transition: opacity 0.35s ease var(--base); }
.js:not(.anim) .mod:not(.is-open) .gs { display: none; }
.anim .mods:not(.is-pin) .gs { margin: 0 0 24px; }

/* Datenpass */
.pass { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 20px; align-items: center; }
.pass-ring { display: grid; justify-items: center; gap: 6px; text-align: center; }
.pass-ring .ring { width: 96px; height: 96px; grid-area: 1 / 1; }
.pass-ring .ring circle { stroke-width: 5; }
.pass-pct { grid-area: 1 / 1; align-self: center; font-size: 20px; color: var(--fg); }
.pass-ring .sub { font-size: 10.5px; line-height: 1.35; }
.pass-rows { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.pass-rows li { display: grid; grid-template-columns: minmax(0, 138px) minmax(40px, 1fr) 34px; gap: 8px; align-items: center; font-size: 11px; color: var(--fg); }
.pass-rows span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-bar { width: 100%; height: 4px; }
.pr-c { font-size: 10.5px; color: var(--fg-3); text-align: right; }
.uses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.uses .fl { margin: 0 4px 0 0; }
@container gs (max-width: 400px) {
  .pass { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
  .pass-ring .ring { width: 72px; height: 72px; }
  .pass-pct { font-size: 15px; }
  .pass-rows li { grid-template-columns: minmax(0, 1fr) minmax(32px, 0.6fr) 34px; gap: 6px; }
}
@container gs (max-width: 280px) { .pass { grid-template-columns: minmax(0, 1fr); } }

/* Kalkulation */
.gik { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.gik .fl { margin: 0; font-size: 12px; font-weight: 600; color: var(--fg); }
.gik-v { font-size: 20px; line-height: 1.2; color: var(--fg); }
.stack { width: 100%; height: 12px; }
.stack-lg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11px; color: var(--fg-3); }
.stack-lg > span { display: inline-flex; align-items: center; gap: 6px; }
.stack-lg .lg-acc { margin-left: 0; }
.rows { width: 100%; border-collapse: collapse; font-size: 12px; }
.rows td { padding: 5px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.rows tr:first-child td { border-top: 0; }
.rows .num { color: var(--fg); font-size: 12.5px; white-space: nowrap; padding-left: 10px; }
.rows .pct { color: var(--fg-3); font-size: 11px; padding: 0 10px; white-space: nowrap; }
.kp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.kp-row .fl { margin-bottom: 0; overflow-wrap: anywhere; }
.kp-row .kv { font-size: 15px; line-height: 1.3; }
@container gs (max-width: 280px) { .kp-row { grid-template-columns: minmax(0, 1fr); } }

/* Verträge: Zeitleiste über 18 Monate; unter 470 px Blockbreite die schmale Fassung */
.tl-scroll { overflow-x: auto; min-width: 0; }
.tl { width: 100%; min-width: 440px; height: auto; }
.tl.tl-c { min-width: 0; }
.tl .ax { font: 400 9px var(--mono); fill: var(--fg-3); }
.tl .ax.now { fill: var(--fg); font-weight: 500; }
.tl .lb { font: 400 10.5px var(--sans); fill: var(--fg); }
.tl .lb.miss { fill: var(--missing); }
.tl .gc { font: 600 9px var(--sans); letter-spacing: 0.06em; fill: var(--fg-3); }
.tl .grid { stroke: var(--line); stroke-width: 1; }
.tl .b-rent, .tl .b-brut { fill: var(--ref); }
.tl .b-cost { fill: var(--surface); stroke: var(--ref); stroke-width: 1; }
.tl .b-vac { fill: none; stroke: var(--missing); stroke-width: 1; stroke-dasharray: 3 3; }
.tl .b-net { fill: var(--accent); }
.tl .soll { opacity: 0.4; }
.tl .today { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tl .end { fill: var(--pending); }
.tl .cause { stroke: var(--pending); stroke-width: 1; stroke-dasharray: 1 3; stroke-linecap: round; }
.tl .note { font: 400 9.5px var(--mono); fill: var(--pending); }
.alarms { display: flex; flex-wrap: wrap; gap: 6px; }
@container gs (max-width: 470px) { .tl:not(.tl-c) { display: none; } }
@container gs (min-width: 470.02px) { .tl.tl-c { display: none; } }

/* Ab 900 px ohne Bewegung: jede Szene steht neben ihrem Text. */
@media (min-width: 900px) {
  html:not(.anim) .mod { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-rows: auto 1fr; column-gap: 64px; }
  html:not(.anim) .mod-h, html:not(.anim) .mod-body { grid-column: 1; }
  html:not(.anim) .mod .gs { grid-column: 2; grid-row: 1 / 3; align-self: start; margin: 20px 0 24px; }
}

/* Scrollgeführt (.is-pin, ab 900 px Breite und 680 px kleiner Fensterhöhe — 100svh, gemessen an .svh-probe): links die Liste, rechts liegen die drei Szenen und die Übersicht
   in derselben Zelle, die die Höhe der höchsten freihält. Das Skript setzt je Eintrag .is-shown (erschienen), .is-dim
   (zurückgetreten) und .is-cur (seine Szene steht rechts), an .mods .show-ov (rechts steht die Übersicht). */
.modules.is-pin .track { height: calc(100svh - 73px + 4 * 70svh); }
.mods.is-pin { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-rows: repeat(6, auto) 1fr; column-gap: 64px; }
.mods.is-pin .mod { display: contents; }
.mods.is-pin .mod-h, .mods.is-pin .mod-body { grid-column: 1; }
.mods.is-pin .mod-h { transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s; }
.mods.is-pin .mod-body { transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s; }
.mods.is-pin .mod:not(.is-shown) .mod-h, .mods.is-pin .mod:not(.is-shown) .mod-body { visibility: hidden; opacity: 0; transform: translateY(16px); }
.mods.is-pin .mod.is-dim:not(.is-open) .mod-h { opacity: 0.35; }
.mods.is-pin .mod.is-cur .mod-b::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.mods.is-pin .ov, .mods.is-pin .gs { grid-column: 2; grid-row: 1 / -1; align-self: start; margin: 0; visibility: hidden; opacity: 0; transition: opacity 0.35s ease, visibility 0.35s; }
.mods.is-pin .mod.is-cur .gs, .mods.is-pin.show-ov .ov { visibility: visible; opacity: 1; }

/* 4 — transparent und nachvollziehbar: eine Szene in fünf Schritten (design.md §6.3)
   Mit Bewegung wählt das Skript nach Breite und Höhe des Fensters einen von drei Modi; Höhe ist die kleine Fensterhöhe
   (100svh, Browserleiste eingeblendet), gemessen an .svh-probe:
   - Pin (.is-pin, ab 980 px Breite und 680 px Höhe): die Scrollposition führt über die klebende Strecke durch die Schritte,
     links die Szene, rechts die Schritte.
   - A (.is-pin.is-bar, unter 980 px Breite, ab 650 px Höhe): dieselbe Strecke; Schrittleiste aus fünf Nummern, darunter der
     Text des offenen Schritts, darunter die Szene in einem Ausschnitt.
   - C (.is-shots, jedes niedrigere Fenster): kein Pin, alle Schritte offen, unter jedem Text ein Ausschnitt mit einer Kopie der Szene.
   In Pin und A trägt .chain nach Schritt 5 .is-done, dann wählt ein Klick den Schritt.
   Ohne .anim (kein Skript oder reduzierte Bewegung): alle Schritte offen, die Szene im Endzustand. */
.steps .h2 { margin-bottom: 32px; text-wrap: balance; }
/* Messelement (Skript, am body, für Abschnitt 3 und 4): so hoch wie 100svh, nicht zu sehen, nimmt keinen Platz ein */
.svh-probe { position: fixed; left: 0; top: 0; width: 0; height: 100svh; visibility: hidden; pointer-events: none; }
.steps.is-pin .track { height: calc(100svh - 73px + 5 * 60svh); }
.chain { display: grid; gap: 32px; align-content: start; }
.chain-side { order: -1; }
@media (min-width: 980px) {
  .chain { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 48px; align-items: start; }
  .chain-side { order: 0; }
}

/* Die Szene: links die Profilkarte, rechts (ab 520 px Blockbreite) Unterlagen herein und Verwendungen hinaus */
.chain-scene { container: scene / inline-size; min-width: 0; font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--fg-2); }
.scene-in { display: grid; gap: 24px; align-items: start; min-height: inherit; }
.pcard { padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; background: var(--surface); }
.pcard .fv { min-height: 32px; line-height: 1.5; }
.pcard .src { line-height: 1.4; }
.pcap { display: grid; grid-template-columns: 38% 1fr; gap: 12px; }
.prow { position: relative; display: grid; grid-template-columns: 38% 1fr; column-gap: 12px; align-items: start; padding-left: 11px; margin-left: -11px; }
.prow .fl { margin: 0; padding-top: 7px; }
.hk { grid-column: 2; display: grid; grid-template-rows: 1fr; }
.hk > div { overflow: hidden; min-height: 0; }
.props-wrap { grid-column: 1 / -1; display: grid; grid-template-rows: 1fr; }
.props-wrap > div { overflow: hidden; min-height: 0; }
.props { container: props / inline-size; display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; margin-top: 10px; }
.prop { min-width: 0; overflow: hidden; }
.prop-in { width: calc(50cqw - 5px); height: 100%; background: var(--sunken); padding: 10px; display: grid; gap: 6px; align-content: start; }
.prop .fv { background: var(--surface); }
.prop .src { margin: 0; }
.pick { justify-self: start; display: inline-block; border: 1px solid var(--ref); padding: 3px 10px; font-size: 11px; line-height: 1.3; color: var(--fg); }
.props-wrap .open { margin-top: 10px; }

.side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.side-g { position: relative; display: grid; gap: 10px; align-content: start; min-width: 0; }
.udoc { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 9px 11px; border: 1.6px solid var(--accent); background: var(--surface); }
.udoc svg { grid-row: 1 / 3; width: 20px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: square; }
.udoc .t1, .udoc .t2 { min-width: 0; overflow-wrap: anywhere; }
.udoc .t1 { font-size: 12.5px; font-weight: 500; line-height: 1.3; color: var(--fg); }
.udoc .t2 { font-size: 10.5px; line-height: 1.3; color: var(--fg-3); }
/* Gepunktete Linien mit Pfeil: .arm waagerecht (breit), .garm senkrecht (schmal) */
.arm, .garm { position: absolute; pointer-events: none; }
.arm::after, .garm::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid var(--accent); border-width: 1.6px 0 0 1.6px; }
.arm { display: none; right: calc(100% + 1.6px); top: 50%; width: 40px; height: 0; border-top: 1.6px dotted var(--accent); margin-top: -0.8px; }
.garm { left: 20px; bottom: 100%; width: 0; height: 24px; border-left: 1.6px dotted var(--accent); }
.in .garm { transform-origin: bottom; }
.in .garm::after { left: -4.3px; top: 1.5px; transform: rotate(45deg); }
.out .garm { transform-origin: top; }
.out .garm::after { left: -4.3px; bottom: 1.5px; transform: rotate(225deg); }
.in .arm { transform-origin: right; }
.in .arm::after { left: 1.5px; top: -4.3px; transform: rotate(-45deg); }
.out .arm { transform-origin: left; }
.out .arm::after { right: 1.5px; top: -4.3px; transform: rotate(135deg); }
@container scene (min-width: 520px) {
  .scene-in { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); column-gap: 40px; align-items: stretch; }
  .pcard { align-self: start; }
  .side { grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: end; }
  .garm { display: none; }
  .arm { display: block; }
}
/* Die schmale Szene (unter 520 px Blockbreite, design.md §6.3 „Die schmale Szene“): eine Spalte — „Neue Unterlagen“ über
   der Karte, „Weiterverwendung“ darunter, je Gruppe zwei Karten nebeneinander ohne Unterzeile; die Linien laufen nach unten.
   Die Regeln ohne Abfrage oben bleiben als Rückfall für Browser ohne Container-Abfragen stehen. */
@container scene (max-width: 519px) {
  .scene-in { display: flex; flex-direction: column; gap: 18px; }
  .side { display: contents; }
  .side-g { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .side-g .cap { grid-column: 1 / -1; }
  .side-g.in { order: -1; }
  .side-g.out { order: 1; }
  .udoc { padding: 7px 9px; grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px; }
  .udoc svg { width: 16px; height: 20px; }
  .udoc .t2 { display: none; }
  .garm { height: 18px; }
  .in .garm { bottom: auto; top: 100%; transform-origin: top; }
  .in .garm::after { top: auto; bottom: 1.5px; transform: rotate(225deg); }
  /* Flex statt Raster: eingeklappte Teile heben ihren Abstand mit margin-top: -8px auf */
  .pcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .prow .hk { grid-column: 1 / -1; }
  /* Ein Vorschlag als Fluss: Überschrift, Wert und „Übernehmen“ nebeneinander, Herkunft darunter */
  .prop-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 5px 8px; padding: 8px; }
  .prop-in .cap { flex: 0 0 100%; }
  .prop-in .fv { flex: 1 1 120px; }
  .prop-in .pick { order: 2; }
  .prop-in .src { order: 3; flex: 0 0 100%; }
}

/* Die Schritte (Pin): der offene trägt 3 px accent links, an seiner Unterkante zeigt .prog den Scrollweg im Schritt (das Skript setzt scaleX) */
.steps-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { position: relative; }
.step + .step { border-top: 1px solid var(--line); }
.step-b { position: relative; display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 0; background: transparent; color: var(--fg-2); font: 400 15px/1.4 var(--sans); text-align: left; }
.js .step-b { cursor: pointer; }
.step-b:hover { color: var(--fg); }
.step-b:focus-visible { outline-offset: -2px; }
.step-b .n { font: 400 12px/1 var(--mono); color: var(--fg-3); min-width: 1.2em; }
.anim .step.is-open .step-b { color: var(--fg); font-weight: 500; }
.anim .step.is-open .n { color: var(--accent); }
.anim .step.is-done .n { color: var(--fg); }
.anim .step.is-open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.step-body { display: grid; grid-template-rows: 1fr; }
.step-body > div { overflow: hidden; min-height: 0; }
.step-body p { padding: 0 16px 16px 44px; max-width: 52ch; }
/* Der Schritttitel steht zusätzlich im Textkörper; zu sehen ist er nur unter der schmalen Schrittleiste */
.st-t { display: none; }
.js .step:not(.is-open) .step-body { grid-template-rows: 0fr; }
.anim .step-body { transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.step .prog { pointer-events: none; }
.chain.is-done .prog { display: none; }

/* Messkopie der Szene (Skript): außerhalb von .chain steht ihr Endzustand; in einem Element .chain.measure mit .s1 … .sK
   steht der Zustand des Schritts K, ohne Übergänge — daran misst das Skript die Bereiche für den Ausschnitt */
.measure { position: absolute; left: -9999px; top: 0; visibility: hidden; }
.chain.measure { display: block; }
.measure, .measure * { transition: none !important; }

/* Modus A (design.md §6.3 „Schmal“; Skript setzt .is-bar zusätzlich zu .is-pin: unter 980 px Breite, ab 650 px Höhe):
   der Abschnitt klebt direkt unter der Kopfzeile (--pin-top, 73 px), die Überschrift klebt mit — 12 px unter der Kopfzeile,
   in ihrer H2-Größe, 12 px darunter die Schrittleiste —, die Schritte sind eine Leiste aus
   fünf Nummern, darunter Titel und Text des offenen Schritts (--body-h = längster Text, gemessen), darunter die Szene in
   einem Ausschnitt, in dem sie per translateY zum Bereich des Schritts fährt. .prog hängt in diesem Modus im Knopf. */
.steps.is-bar .pin { top: var(--pin-top, 73px); height: calc(100svh - var(--pin-top, 73px)); min-height: 0; padding: 12px 0 8px; display: flex; flex-direction: column; }
.steps.is-bar .pin > .wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.steps.is-bar .h2 { margin-bottom: 12px; }
.steps.is-bar .chain { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
.steps.is-bar .chain-scene { min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }
.steps.is-bar .scene-in { padding-top: 6px; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.steps.is-bar .steps-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto var(--body-h, auto); border: 1px solid var(--line); background: var(--sunken); }
.steps.is-bar .step { display: contents; }
.steps.is-bar .step.is-open::before { display: none; }
.steps.is-bar .step-b { grid-row: 1; justify-content: center; align-items: center; padding: 9px 0 8px; border-right: 1px solid var(--line); }
.steps.is-bar .step:last-child .step-b { border-right: 0; }
/* Der Titel im Knopf ist nur optisch verborgen: für Vorlesegeräte heißt der Knopf weiter „1 Ein Profil je Immobilie“ usw. */
.steps.is-bar .step-b > span:not(.n) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.steps.is-bar .step-b .n { font-size: 13px; min-width: 0; }
.steps.is-bar .step.is-open .step-b { background: var(--surface); }
.steps.is-bar .step.is-open .step-b::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.steps.is-bar .steps-list .step .step-body { grid-row: 2; grid-column: 1 / -1; grid-template-rows: 1fr; background: var(--surface); border-top: 1px solid var(--line); transition: none; }
.steps.is-bar .steps-list .step:not(.is-open) .step-body { display: none; }
.steps.is-bar .steps-list.is-measuring .step .step-body { display: grid; }
.steps.is-bar .step.is-open .step-body > div { animation: step-in 0.35s ease; }
.steps.is-bar .step-body p { padding: 0 14px 10px; max-width: none; font-size: 14px; line-height: 1.5; }
.steps.is-bar .st-t { display: block; padding: 8px 14px 2px; font-size: 14.5px; font-weight: 500; line-height: 1.4; color: var(--fg); }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } }

/* Modus C (design.md §6.3 „Schmal“; Skript setzt .is-shots: Fenster zu niedrig für Pin oder Modus A): kein Pin, eine Spalte,
   alle Schritte offen. Die Szene in .chain ist ausgeblendet; unter jedem Text hängt das Skript einen Ausschnitt .shot mit
   einer Kopie der Szene in einem eigenen .chain ein, der sich beim Hereinscrollen einmal zu seinem Schritt aufbaut. */
.steps.is-shots .chain { grid-template-columns: minmax(0, 1fr); gap: 0; }
.steps.is-shots .wrap > .chain > .chain-scene { display: none; }
.steps.is-shots .steps-list { border-bottom: 0; }
.steps.is-shots .step.is-open::before, .steps.is-shots .prog { display: none; }
.steps.is-shots .step-b { color: var(--fg); font-weight: 500; cursor: default; padding-top: 20px; }
.steps.is-shots .step-b .n { color: var(--accent); }
.shot { position: relative; overflow: hidden; margin: 0 0 28px; }
.shot.cut-t { border-top: 1px dashed var(--line); }
.shot.cut-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
.shot > .chain { display: block; }

/* Zustände je Schritt: .s1 … .s5 an .chain kommen hinzu, nichts verschwindet vor dem Neubeginn */
.anim .chain .q, .anim .chain .a, .anim .chain .pcard .mock-h, .anim .chain .pcap { opacity: 0; }
.anim .chain.s1 .pcard .mock-h, .anim .chain.s1 .pcap { opacity: 1; transition: opacity 0.4s ease 0.5s; }
.anim .chain.s1 .q { opacity: 1; transition: opacity 0.4s ease calc(0.7s + var(--i) * 90ms); }
.anim .chain.s1 .a { opacity: 1; transition: opacity 0.4s ease calc(1.25s + var(--i) * 110ms); }
.anim .chain .hk, .anim .chain .props-wrap { grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; }
.anim .chain.s2 .hk { grid-template-rows: 1fr; opacity: 1; transition-delay: calc(var(--i) * 120ms); }
.anim .chain.s3 .props-wrap { grid-template-rows: 1fr; opacity: 1; transition-delay: 0.45s; }
.anim .chain .props { grid-template-columns: 1fr 0fr; column-gap: 0px; transition: grid-template-columns 0.6s cubic-bezier(0.4, 0, 0.2, 1), column-gap 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.anim .chain.s4 .props { grid-template-columns: 1fr 1fr; column-gap: 10px; }
.anim .chain .pa .prop-in { width: 100cqw; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.anim .chain.s4 .pa .prop-in { width: calc(50cqw - 5px); }
.anim .chain .open { opacity: 0; transition: opacity 0.3s ease; }
.anim .chain.s4 .open { opacity: 1; transition-delay: 0.6s; }
.anim .chain .prow.focus::after { opacity: 0; transition: opacity 0.4s ease; }
.anim .chain.s3 .prow.focus::after { opacity: 1; }
.anim .chain .prow .q, .anim .chain .prow .a { will-change: opacity; }
.anim .chain.s3 .prow:not(.focus) > .fl, .anim .chain.s3 .prow:not(.focus) > .fv, .anim .chain.s3 .prow:not(.focus) > .hk { opacity: 0.5; transition: opacity 0.4s ease; }
.anim .chain.s5 .prow:not(.focus) > .fl, .anim .chain.s5 .prow:not(.focus) > .fv, .anim .chain.s5 .prow:not(.focus) > .hk { opacity: 1; }
.anim .chain .udoc, .anim .chain .side .cap { opacity: 0; transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.anim .chain .in .udoc { transform: translateY(10px); }
.anim .chain .out .udoc { transform: translateY(-10px); }
.anim .chain .arm, .anim .chain .garm { transition: transform 0.45s ease; }
.anim .chain .arm { transform: scaleX(0); }
.anim .chain .garm { transform: scaleY(0); }
.anim .chain.s3 .in .cap, .anim .chain.s3 .d1, .anim .chain.s4 .d2, .anim .chain.s5 .out .cap, .anim .chain.s5 .out .udoc { opacity: 1; transform: none; }
.anim .chain.s5 .e2 { transition-delay: 0.15s; }
.anim .chain.s3 .d1 .arm, .anim .chain.s4 .d2 .arm, .anim .chain.s5 .out .arm, .anim .chain.s3 .in .garm, .anim .chain.s5 .out .garm { transform: none; transition-delay: 0.35s; }
@container scene (min-width: 520px) {
  .anim .chain .pcard { transform: translateX(calc(33.333% + 20px)); transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain.s3 .pcard { transform: none; }
  .anim .chain .in .udoc { transform: translateX(14px); }
  .anim .chain .out .udoc { transform: translateX(-14px); }
  .anim .chain.s3 .d1, .anim .chain.s4 .d2, .anim .chain.s5 .out .udoc { transform: none; }
}
/* Schmale Szene: Zurücktreten heißt Einklappen. Schritt 3 und 4 zeigen nur Endenergieverbrauch mit Beleg und Vorschlägen,
   Schritt 5 das ganze Profil ohne Unterlagen, Belege und Vorschläge (der Chip „offen“ bleibt). Regeln mit :not(.sK) hängen
   an der eigenen Szene (> .chain-scene): die Ausschnitte niedriger Fenster tragen Kopien in eigenen .chain innerhalb von #chain. */
@container scene (max-width: 519px) {
  .anim .chain.s1 .pcard .mock-h { max-height: 60px; transition: opacity 0.4s ease 0.5s, max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain.s3:not(.s5) > .chain-scene .pcard .mock-h { max-height: 0; opacity: 0; margin-top: -8px; padding-bottom: 0; border-bottom-width: 0; overflow: hidden; }
  .anim .chain.s1 .pcap { max-height: 40px; transition: opacity 0.4s ease 0.5s, max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain.s3:not(.s5) > .chain-scene .pcap { max-height: 0; opacity: 0; margin-top: -8px; overflow: hidden; }
  .anim .chain .prow:not(.focus) { max-height: 160px; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain.s3:not(.s5) > .chain-scene .prow:not(.focus) { max-height: 0; opacity: 0; margin-top: -8px; overflow: hidden; }
  .anim .chain .pb { max-height: 320px; transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain:not(.s4) > .chain-scene .pb { max-height: 0; }
  .anim .chain:not(.s4) > .chain-scene .props-wrap .open { display: none; }
  .anim .chain .side-g.in { max-height: 200px; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
  .anim .chain.s5 > .chain-scene .side-g.in { max-height: 0; opacity: 0; margin-bottom: -18px; overflow: hidden; }
  .anim .chain.s5 > .chain-scene .prow > .hk { grid-template-rows: 0fr; opacity: 0; }
  .anim .chain .props { max-height: 420px; transition: grid-template-columns 0.6s cubic-bezier(0.4, 0, 0.2, 1), column-gap 0.6s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease; }
  .anim .chain.s5 > .chain-scene .props { max-height: 0; margin-top: 0; opacity: 0; overflow: hidden; }
}

/* 6 — Aufruf */
.cta-inner { display: grid; justify-items: center; text-align: center; gap: 20px; }
.cta-inner p { max-width: 60ch; }
.cta-inner .btn { margin-top: 8px; }

/* 7 — Fußzeile */
.site-footer { padding: 32px 0; font-size: 13px; font-weight: 400; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.mark {
  width: 24px; height: 24px; flex: 0 0 24px;
  background: var(--fg-3);
  -webkit-mask: url("../assets/bildmarke.svg") no-repeat center / contain;
  mask: url("../assets/bildmarke.svg") no-repeat center / contain;
}
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--fg-3); }
.footer-nav a { color: var(--fg-2); text-decoration: none; }
.footer-nav a:hover { color: var(--fg); text-decoration: underline; }
.footer-note { margin-left: auto; color: var(--fg-3); font-size: 12px; }
@media (max-width: 599px) { .footer-note { margin-left: 0; flex-basis: 100%; } }

/* Pflichtseiten */
.legal { padding: 48px 0 72px; border-bottom: 1px solid var(--line); }
.legal .wrap > * { max-width: 65ch; }
.legal h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; color: var(--fg); margin-bottom: 24px; }
.legal h2 { font-size: 1.1rem; font-weight: 600; color: var(--fg); margin: 32px 0 8px; }
.legal h3 { font-size: 1rem; font-weight: 600; color: var(--fg); margin: 20px 0 6px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 1.2em; }
.legal address { font-style: normal; margin-bottom: 12px; }
.draft-note { border: 1px solid var(--pending); color: var(--pending); padding: 12px 16px; margin-bottom: 32px; font-weight: 400; }
.ph { background: transparent; color: var(--missing); font-weight: 500; }

/* /demo — Seite „Demo buchen“ und Zustimmungsblock (design.md §9; Knopf zweite Stufe §3)
   Drei Abschnitte: Einstieg mit Video, Termin (#termin) mit der Termin-Fläche („Mulde“), Zustimmung.
   Ab 1080 px zweispaltig (Überschriften links; Video, Mulde und Zustimmungsblock rechts), darunter eine Spalte bis 880 px.
   Was nur mit Skript Sinn hat, trägt im HTML hidden; video.js und consent.js nehmen es weg. */
button.btn { border: 0; cursor: pointer; }
.btn-2 {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: 500 14px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.btn-2:hover { background: var(--sunken); border-color: var(--fg-3); }
.btn-2:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.btn[hidden], .btn-2[hidden], .vstart[hidden], .vbar[hidden] { display: none; }

/* Aufbau (§9.1) */
.demo-sec { padding: 64px 0; }
.demo-consent { padding: 32px 0 48px; }
.demo-grid { display: grid; grid-template-columns: minmax(0, 880px); justify-content: center; gap: 24px; }
.demo-intro > * + * { margin-top: 24px; }
.demo-intro .lead { max-width: 52ch; }
.demo-entry .demo-video { margin-top: 16px; }
.demo-video { min-width: 0; }

/* Video (§9.2): Fläche in beiden Modi weiß, das Standbild steht als poster davor */
.vframe { position: relative; }
.demo-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line-strong); background: #ffffff; }
.vstart { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; border: 0; border-radius: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; }
.vstart:hover { background: var(--primary-hover); }
.vstart:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: inset 0 0 0 3px var(--surface); }
.vstart svg { width: 22px; height: 22px; fill: currentColor; }
.vbar { display: flex; align-items: center; height: 44px; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.vtrack { position: relative; flex: 1; min-width: 0; height: 2px; margin: 0 16px; background: var(--line); }
.vprog { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: var(--accent); opacity: 0.7; transform: scaleX(0); transform-origin: left; transition: transform 250ms linear; }
.vtime { margin-right: 14px; font: 400 12px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--fg-3); white-space: nowrap; }
.vbtn { flex: 0 0 44px; align-self: stretch; display: grid; place-items: center; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--fg); cursor: pointer; }
.vbtn:hover { background: var(--sunken); }
.vbtn:focus-visible { outline-offset: -2px; }
.vbtn svg { display: none; width: 16px; height: 16px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }
.vbtn .v-play path { fill: currentColor; stroke: none; }
.vbtn[data-state="playing"] .v-pause, .vbtn[data-state="paused"] .v-play, .vbtn[data-state="ended"] .v-again { display: block; }

/* Termin-Fläche, die Mulde (§9.3): dieselbe Fläche vor und nach der Zustimmung */
.mulde { position: relative; min-width: 0; min-height: 747px; padding: 16px; background: var(--sunken); overflow: hidden; }
.cal-ph-text { position: relative; z-index: 1; display: grid; gap: 16px; justify-items: start; max-width: 560px; padding: 16px; }
.cal-ph-text p { max-width: 60ch; }
.cal-ico { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: square; }
.cal-ph-text .cal-alt { max-width: none; font-size: 13px; font-weight: 400; color: var(--fg-3); }
.cal-alt .sep { margin: 0 3px; }
.cal-alt .mail { font-size: 12.5px; color: var(--fg-2); }
/* Skizze: ein Monat und fünf Zeitfelder, nur Linien, nach unten ausgeblendet */
.sketch { position: absolute; left: 32px; right: 32px; bottom: 0; height: 330px; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 200px); gap: 32px; align-items: start; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent); mask-image: linear-gradient(to bottom, #000 35%, transparent); }
.sk-month { padding: 16px; border: 1px solid var(--line-strong); }
.sk-bar { display: block; width: 40%; height: 8px; background: var(--line-strong); }
.sk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.sk-days i { aspect-ratio: 1; border: 1px solid var(--line); }
.sk-days i:nth-child(-n+3), .sk-days i:nth-child(7n), .sk-days i:nth-child(7n-1) { border-style: dashed; }
.sk-days .sk-on { border-color: var(--accent); }
.sk-times { display: grid; gap: 10px; padding-top: 16px; }
.sk-times i { height: 36px; border: 1px solid var(--line-strong); }
/* Nach der Zustimmung (consent.js): Ladefläche und Kalender liegen in derselben Zelle der Mulde, 715 px hoch — nichts springt.
   Der Kalender rechnet hell (color-scheme: light): sein Grund bleibt im Dunkelmodus durchsichtig. */
.cal-slot { display: grid; }
.cal-slot > * { grid-area: 1 / 1; min-width: 0; }
.cal-loading { height: 715px; overflow: hidden; pointer-events: none; }
.cal-loading i { display: block; width: 30%; height: 2px; background: var(--accent); animation: cal-run 1.1s linear infinite; }
.cal-loading p { padding: 20px 24px 0; font-size: 13px; font-weight: 400; color: var(--fg-3); }
@keyframes cal-run { from { transform: translateX(-100%); } to { transform: translateX(333.34%); } }
.cal-frame { display: block; width: 100%; border: 0; color-scheme: light; }

/* Zustimmungsblock (§9.4): unten auf /demo und in der Datenschutzerklärung, Ziffer 6 (dort ohne Hinweis) */
.consent { min-width: 0; padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); }
.consent .consent-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 38px; max-width: none; margin: 0; font-size: 15px; color: var(--fg-2); }
.consent .consent-row:focus-visible { outline-offset: 4px; }
.consent .consent-note { max-width: 72ch; margin: 10px 0 0; font-size: 13px; font-weight: 400; color: var(--fg-3); }
.legal .consent { margin: 20px 0 12px; }

@media (min-width: 1080px) {
  .demo-grid { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); justify-content: normal; align-items: start; gap: 0 64px; }
  .demo-entry .demo-video { margin-top: 0; }
  .demo-consent .consent { grid-column: 2; }
}
@media (max-width: 479px) {
  .demo-sec { padding: 40px 0; }
  .demo-consent { padding: 24px 0 40px; }
  .demo-entry { gap: 16px; }
  .demo-intro > * + * { margin-top: 16px; }
  .demo-entry .demo-video { margin-top: 8px; }
  .mulde { min-height: 731px; padding: 8px; }
  .cal-ph-text { padding: 12px; }
  .sketch { left: 20px; right: 20px; height: 250px; grid-template-columns: minmax(0, 1fr); }
  .sk-times { display: none; }
  .consent { padding: 16px; }
  .consent .btn-2 { flex: 1 0 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .vprog { transition: none; }
  .cal-loading i { animation: none; }
}
