/* Layout: Skizzenbuch wie im Video. Papiergrund, Tusche-Konturen, Kapitelkästen mit Handschrift.
   Links bleibt das live gebaute 3D-Haus mit Ergebnis stehen, rechts drei Schritte (Haus, Räume, Ergebnis).
   Hell (Papier) ist Standard; dunkel folgt dem Schalter der Webseite (html[data-theme="dark"], siehe Ende der Datei). */
:root {
  --paper: #f4ecdc; --card: #fbf7ee; --field: #fffdf8; --ink: #2b2a26; --mute: #6b5d4a; --line: rgba(43, 42, 38, .16); --line-2: rgba(43, 42, 38, .32);
  --brand: #2f5d46; --brand-soft: #dfe8df; --brand-fill: #2f5d46; --brand-ink: #fbf5ea; --spark: #f2a03a; --hand-ink: #3b2414;
  --heat: #e0662a; --heat-text: #a84318; --link: #2a6f91; --heat-ink: #1f1408; --heat-soft: #f8e1cf; --vor: #c8452c; --cold: #3f8fb5; --cold-soft: #dcebf2;
  --ok: #2f6b45; --ok-soft: #dcebd9; --tight: #7f570a; --tight-soft: #f6e3bd; --short: #a8321c; --short-soft: #f5d3c9; --idle: #a89c88; --idle-soft: #ece4d4;
  --ground: #e6dcc6; --roof: #d8cdb6; --shadow: 4px 5px 0 rgba(60, 45, 25, .14);
  --f-display: "Avenir Next", "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-body: "Avenir Next", "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-cond: "Avenir Next Condensed", "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-hand: "Bradley Hand", "Patrick Hand", "Segoe Print", cursive;
  --f-data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 8px; --r-s: 6px;
  color-scheme: light;
}

* { box-sizing: border-box }
body { margin: 0; color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  /* feines Papierkorn wie im Video */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0 }
button, input, select { font: inherit; color: inherit }
a { color: var(--link) }
:focus-visible { outline: 2.5px solid var(--cold); outline-offset: 2px }

/* Kopfzeile */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--card); border-bottom: 1.4px solid var(--ink) }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--card) }
.top-in, .wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0 }
.brand b { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em }
.brand span { font-family: var(--f-cond); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; border-left: 1.4px solid var(--line-2) }
.logo { flex: none; display: block }
.langs { display: flex; gap: 2px; border: 1.4px solid var(--ink); border-radius: 6px; padding: 2px; background: var(--field) }
.langs button { border: 0; background: none; border-radius: 4px; padding: 3px 10px; font-family: var(--f-cond); font-size: 15px; font-weight: 700; letter-spacing: .04em; cursor: pointer; color: var(--mute) }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--card) }

/* Einstieg mit Milli */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-top: 34px; border-bottom: 1.4px solid var(--ink); margin-bottom: 28px }
.hero-text { padding-bottom: 30px; max-width: 720px }
.eyebrow { margin: 0 0 12px; font-family: var(--f-cond); font-size: 16px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--heat-text) }
.hero h1 { font-size: clamp(34px, 5.2vw, 58px); line-height: 1.04; letter-spacing: -.02em; font-weight: 700 }
.lead { font-size: 18px; color: var(--mute); margin: 16px 0 0; max-width: 60ch }
.privacy { display: inline-flex; align-items: center; gap: 9px; margin: 18px 0 0; font-family: var(--f-hand); font-size: 19px; color: var(--brand) }
.lock { width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 3px; position: relative; top: 2px; flex: none }
.lock::before { content: ""; position: absolute; left: 1px; top: -7px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0 }
.hero-milli { align-self: end; line-height: 0 }
.hero-milli img { display: block; height: 260px; width: auto; max-width: 100% }

/* Zweispaltig: Haus links (klebt), Schritte rechts */
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; padding-bottom: 48px }
.side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px) }
.side-in { display: flex; flex-direction: column; gap: 16px }
.main { display: flex; flex-direction: column; gap: 26px; min-width: 0 }

/* 3D-Bühne */
.stage { position: relative; height: 380px; border-radius: var(--r); overflow: hidden; border: 1.4px solid var(--ink); background: var(--card); box-shadow: var(--shadow) }
.stage-gl, .stage-labels { position: absolute; inset: 0 }
.stage-gl canvas { display: block; touch-action: pan-y; cursor: grab }
.stage-gl canvas:active { cursor: grabbing }
.stage-labels { pointer-events: none; overflow: hidden }
.scene-label { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-cond); font-size: 14px; font-weight: 700; background: var(--card); color: var(--ink); border: 1.5px solid var(--idle) }
.scene-label.ok { border-color: var(--ok) } .scene-label.tight { border-color: var(--tight) } .scene-label.short { border-color: var(--short) }
.scene-label.bn { background: var(--short); color: var(--card); border-color: var(--short) }
.stage-empty, .stage-hint { position: absolute; left: 16px; right: 16px; margin: 0; text-align: center; color: var(--mute); pointer-events: none }
.stage-empty { bottom: 50px; font-family: var(--f-hand); font-size: 22px; color: var(--ink) }
.stage-hint { top: 10px; font-family: var(--f-cond); font-size: 14px; letter-spacing: .04em; text-transform: uppercase }
.stage.no-gl .stage-gl { display: none }
.legend { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-family: var(--f-cond); font-size: 15px; font-weight: 600; color: var(--mute); justify-content: center }
.legend li { display: flex; align-items: center; gap: 6px }
.legend i, .pill i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none }
.ok > i, i.ok { background: var(--ok) } .tight > i, i.tight { background: var(--tight) } .short > i, i.short { background: var(--short) }
.idle > i, i.idle, .incomplete > i, i.incomplete, .none > i, i.none { background: var(--idle) }

/* Zusammenfassung neben dem Haus */
.summary { background: var(--card); border: 1.4px solid var(--ink); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow) }
.sum-title { margin: 0 0 10px; font-family: var(--f-hand); font-size: 21px; line-height: 1.2 }
.todo { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px }
.todo .link { background: var(--field); border: 1.4px dashed var(--line-2); border-radius: 6px; padding: 3px 11px; text-decoration: none; color: var(--ink); font-family: var(--f-cond); font-size: 16px; font-weight: 600 }
.todo .link:hover { border-color: var(--heat-text); color: var(--heat-text) }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.kpis div { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.kpis span { font-family: var(--f-cond); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); line-height: 1.2 }
.kpis b { font-family: var(--f-display); font-size: 42px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.kpis b small { font-size: 18px; font-weight: 600; color: var(--mute) }
.kpis div:last-child b { color: var(--vor) }
.kpis em { font-style: normal; font-size: 14px; color: var(--mute); overflow-wrap: anywhere }
.verdict { margin: 14px 0 0; padding: 9px 14px; border-radius: var(--r-s); font-family: var(--f-cond); font-size: 19px; font-weight: 700; line-height: 1.3 }
.verdict.ok { background: var(--ok-soft); color: var(--ok) } .verdict.short { background: var(--short-soft); color: var(--short) } .verdict.idle { background: var(--idle-soft); color: var(--mute) }
.limit { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 15px; color: var(--ink) }
.thermo { flex: none; width: 10px; height: 22px; margin-top: 1px; border-radius: 5px; background: linear-gradient(to top, var(--heat) 0 45%, var(--cold) 55% 100%) }

/* Schritte als Blätter mit Kapitelkasten */
.panel { background: var(--card); border: 1.4px solid var(--ink); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0 }
.chapter { margin-bottom: 20px }
.chap-box { display: inline-flex; flex-direction: column; max-width: 100%; border: 1.4px solid var(--ink); background: var(--field) }
.chap-top { font-family: var(--f-cond); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 3px 10px; border-bottom: 1.4px solid var(--ink) }
.chap-box h2 { font-family: var(--f-hand); font-weight: 400; font-size: 30px; line-height: 1.15; padding: 4px 12px 5px; color: var(--hand-ink) }
.chapter p { margin: 10px 0 0; color: var(--mute); font-size: 15px; max-width: 62ch }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 18px }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.field.wide { grid-column: 1 / -1 }
.field.span2 { grid-column: span 2 }
@media (max-width: 460px) { .field.span2 { grid-column: 1 / -1 } }
.field > label, .lbl, .flow-head label, .quick label { font-family: var(--f-cond); font-size: 16px; font-weight: 700; letter-spacing: .02em }
.control { display: flex; align-items: center; background: var(--field); border: 1.4px solid var(--line-2); border-radius: var(--r-s); transition: border-color .15s, box-shadow .15s }
.control:focus-within { border-color: var(--ink); box-shadow: 3px 3px 0 var(--cold-soft) }
.field.wide .control { max-width: 220px }
.control.small { width: 150px; flex: none }
.inp { width: 100%; min-width: 0; border: 0; background: none; padding: 9px 12px; font-family: var(--f-data); font-size: 15px; font-variant-numeric: tabular-nums; outline: none }
select.inp { font-family: var(--f-body); cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat }
select.inp option { background: var(--field); color: var(--ink) }
.inp::placeholder { color: var(--mute); opacity: .5 }
.unit { padding-right: 12px; font-family: var(--f-data); font-size: 13px; color: var(--mute); white-space: nowrap }
.hint { margin: 0; font-size: 14px; line-height: 1.45; color: var(--mute) }
.hint .ext { display: inline-block; margin-top: 5px; font-weight: 700; color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 3px }
.hint .note { display: block; font-size: 13px; opacity: .85 }
.seg { display: flex; border: 1.4px solid var(--line-2); border-radius: var(--r-s); padding: 3px; gap: 3px; background: var(--field) }
.seg button { flex: 1; border: 0; background: none; border-radius: 4px; padding: 7px 8px; font-size: 15px; cursor: pointer; color: var(--mute); line-height: 1.25 }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); font-weight: 600 }

/* Wunschvorlauf: das Thema des Videos, darum farbig wie der Vorlauf-Regler */
.flow { margin-top: 22px; padding: 16px; border-radius: var(--r-s); background: var(--heat-soft); border: 1.4px dashed color-mix(in srgb, var(--heat) 55%, transparent); display: flex; flex-direction: column; gap: 12px }
.flow-head { display: flex; flex-direction: column; gap: 4px }
.flow-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { border: 1.4px solid var(--ink); background: var(--field); border-radius: 6px; padding: 5px 12px; font-family: var(--f-cond); font-size: 17px; font-weight: 700; cursor: pointer }
.chip[aria-pressed="true"] { background: var(--heat); border-color: var(--heat); color: var(--heat-ink) }
.retro { margin-top: 18px; border-top: 1.4px dashed var(--line-2); padding-top: 14px }
.retro summary { cursor: pointer; font-family: var(--f-cond); font-size: 17px; font-weight: 700; list-style-position: inside }
.retro .hint { margin: 6px 0 12px }

/* Räume */
.empty { border: 1.4px dashed var(--line-2); border-radius: var(--r); padding: 18px; color: var(--mute); background: var(--field); display: flex; align-items: center; gap: 18px }
.empty img { flex: none; width: 120px; height: auto }
.empty h3 { font-family: var(--f-hand); font-weight: 400; font-size: 26px; color: var(--ink); margin-bottom: 4px }
.empty p { margin: 0; max-width: 46ch }
.roomlist { display: flex; flex-direction: column; gap: 18px }
.room { border: 1.4px solid var(--ink); border-radius: var(--r); padding: 18px 18px 18px 22px; background: var(--field); position: relative; overflow: hidden }
.room::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--idle) }
.room.ok::before { background: var(--ok) } .room.tight::before { background: var(--tight) } .room.short::before { background: var(--short) }
.room-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap }
.roomno { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-cond); font-size: 15px; font-weight: 700; border: 1.5px solid var(--idle); color: var(--ink) }
.room.ok .roomno { border-color: var(--ok) } .room.tight .roomno { border-color: var(--tight) } .room.short .roomno { border-color: var(--short) }
.rname { flex: 1 1 160px; min-width: 0; border: 0; border-bottom: 1.4px dashed var(--line-2); background: none; padding: 0 0 2px; font-family: var(--f-hand); font-size: 28px; line-height: 1.2; color: var(--hand-ink); outline: none }
.rname:focus { border-bottom: 1.4px solid var(--ink) }
.bn-tag { font-family: var(--f-cond); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--short); border: 1.4px dashed var(--short); padding: 0 6px; border-radius: 4px }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-cond); font-size: 16px; font-weight: 700; padding: 1px 10px 1px 8px; border-radius: 6px; white-space: nowrap }
.pill.ok { background: var(--ok-soft); color: var(--ok) } .pill.tight { background: var(--tight-soft); color: var(--tight) } .pill.short { background: var(--short-soft); color: var(--short) }
.pill.incomplete, .pill.none { background: var(--idle-soft); color: var(--mute) }
.icon { border: 0; background: none; width: 34px; height: 34px; border-radius: 6px; font-size: 22px; line-height: 1; color: var(--mute); cursor: pointer; flex: none }
.icon:hover { background: var(--short-soft); color: var(--short) }
.lw { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute) }
.lw .inp { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; font-size: 13px; width: 0; flex: 1 }
.checks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; cursor: pointer }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none }
.rads { margin-top: 18px; padding: 14px; background: var(--card); border: 1.4px dashed var(--line-2); border-radius: var(--r-s); outline: none }
.rads h3 { font-family: var(--f-cond); font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 10px }
.rad { display: grid; grid-template-columns: minmax(110px, 1.2fr) 1fr 1fr 34px; gap: 10px; align-items: end; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line) }
.rad-out { grid-column: 1 / -1; margin: 0; font-family: var(--f-data); font-size: 13px; color: var(--mute) }
.rad-out b { color: var(--ink) }
.rad-foot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start }
.room-result { margin-top: 16px }
.miss { margin: 0; font-size: 15px; color: var(--mute) }
.link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit }
.meter { position: relative; height: 10px; border-radius: 3px; background: var(--idle-soft); margin-bottom: 12px }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px }
.meter b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink) }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.stats div { min-width: 0 }
.stats dt { font-family: var(--f-cond); font-size: 14px; font-weight: 600; color: var(--mute); line-height: 1.2 }
.stats dd { margin: 2px 0 0; font-family: var(--f-display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums }
.adders { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 20px; align-items: start; margin-top: 20px; padding-top: 20px; border-top: 1.4px dashed var(--line-2) }
.quick { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.quick-row { display: flex; gap: 8px }
.quick-row .inp { background: var(--field); border: 1.4px solid var(--line-2); border-radius: var(--r-s); font-family: var(--f-body) }
.quick-row .inp:focus { border-color: var(--ink) }

/* Knöpfe */
button.primary, .quick-row button, button.ghost, button.danger { border-radius: 6px; padding: 8px 16px; font-family: var(--f-cond); font-weight: 700; font-size: 18px; letter-spacing: .02em; cursor: pointer; white-space: nowrap; border: 1.4px solid var(--ink) }
button.primary { background: var(--heat); color: var(--heat-ink); box-shadow: 3px 3px 0 var(--ink) }
button.primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink) }
button.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink) }
button.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none }
.quick-row button { background: var(--ink); color: var(--card) }
button.ghost { background: var(--field); color: var(--ink) }
button.ghost:hover { background: var(--card) }
button.danger { background: var(--short); color: var(--card) }

/* Ergebnis */
.tablewrap { overflow-x: auto; margin: 0 -4px }
table { width: 100%; border-collapse: collapse; font-size: 15px }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle }
thead th { font-family: var(--f-cond); font-size: 14px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; white-space: normal; border-bottom: 1.4px solid var(--ink) }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums }
td.num { font-family: var(--f-data); font-size: 14px }
tr.bn td { font-weight: 700 } tr.bn td:first-child { color: var(--short) }
tr.ex td { color: var(--mute) }
.cov { font-family: var(--f-data); font-size: 13px; color: var(--mute); margin-left: 4px }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px }
.ask { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600 }
.result .hint[role="status"] { margin-top: 10px }
.method { color: var(--mute); font-size: 14px; padding: 4px 4px 0; max-width: 72ch }
.method h3 { font-family: var(--f-hand); font-weight: 400; font-size: 24px; color: var(--ink); margin-bottom: 6px }
.method p { margin: 0 0 10px }
.method .disc { color: var(--ink); font-weight: 600 }
.method .from { font-family: var(--f-cond); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em }

/* Kurve: Raumtemperatur bei Kälte */
.cold { margin-top: 26px; padding-top: 20px; border-top: 1.4px dashed var(--line-2); display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.cold h3 { font-family: var(--f-hand); font-weight: 400; font-size: 27px; color: var(--hand-ink) }
.chart { position: relative; width: 100%; min-width: 0; touch-action: pan-y; background: var(--field); border: 1.4px solid var(--line-2); border-radius: var(--r-s) }
.chart svg { display: block; overflow: visible }
.chart .grid { stroke: var(--line); stroke-width: 1 }
.chart .tick { font-family: var(--f-cond); font-size: 13px; font-weight: 600; fill: var(--mute) }
.chart .axis { font-family: var(--f-cond); font-size: 14px; font-weight: 600; fill: var(--mute) }
.chart .ref { font-family: var(--f-cond); font-size: 14px; font-weight: 600; fill: var(--mute) } .chart .ref.strong { fill: var(--ink); font-weight: 700 }
.chart .setpoint { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4 }
.chart .design { stroke: var(--cold); stroke-width: 1.5; stroke-dasharray: 3 4 }
.chart .deficit { fill: var(--short-soft); opacity: .85 }
.chart .curve { fill: none; stroke: var(--heat); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round }
.chart .limdot, .chart .hovdot { fill: var(--heat); stroke: var(--field); stroke-width: 2 }
.chart .cross { stroke: var(--line-2); stroke-width: 1 }
.tip { position: absolute; width: 150px; pointer-events: none; background: var(--ink); color: var(--card); font-family: var(--f-cond); font-size: 15px; font-weight: 600; text-align: center; padding: 5px 8px; border-radius: 6px }
.coldtab caption { text-align: left; font-family: var(--f-cond); font-size: 15px; font-weight: 600; color: var(--mute); padding-bottom: 6px }
.coldtab tr.sel td { background: var(--card) } .coldtab tr.sel td:first-child { font-weight: 700 }
.coldtab td.below { color: var(--short); font-weight: 600 }

/* Schmal: Haus oben, nicht klebend */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px }
  .side { position: static }
  .stage { height: 300px }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; padding-top: 22px }
  .hero-text { padding-bottom: 20px }
  .hero-milli img { height: 150px }
  .lead { font-size: 16px }
  .panel { padding: 16px }
  .room { padding: 14px 14px 14px 18px }
  .rad { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px }
  .rad > .field:first-child { grid-column: 1 / -1 }
  .rad .icon { grid-column: 3; grid-row: 2 }
  .adders { grid-template-columns: minmax(0, 1fr) }
  .kpis b { font-size: 34px }
  .brand span { display: none }
  .empty { flex-direction: column; text-align: center }
  .chap-box h2 { font-size: 26px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important } }

/* ---------- Gesperrte Zahlen und Auswertung per E-Mail ---------- */
.lockico { display: inline-block; width: 11px; height: 9px; border: 1.6px solid currentColor; border-radius: 2px; position: relative; margin-top: 5px; vertical-align: middle; opacity: .75; flex: none }
.lockico::before { content: ""; position: absolute; left: 1px; top: -7px; width: 6px; height: 6px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0 }
/* Gesperrte Spalten: Schraffur wie eine noch offene Fläche im Plan */
td.locked { color: var(--mute); text-align: center; background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6.4px) }
.locked-note { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--mute); margin: 12px 0 12px }
.mail-jump { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px; border: 1.4px solid var(--ink); background: var(--brand-fill); color: var(--brand-ink); font-family: var(--f-cond); font-weight: 700; font-size: 18px; letter-spacing: .02em; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s, box-shadow .15s }
.mail-jump:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink) }

/* Das Blatt für die Auswertung: grüner Kopf (Marke), links was drinsteht, rechts das Formular, unten der Weg in drei Schritten */
.mailbox { margin: 26px 0 8px; border: 1.6px solid var(--ink); border-radius: 14px; background: var(--card); box-shadow: 6px 7px 0 rgba(60, 45, 25, .16); scroll-margin-top: 84px; overflow: hidden; container-type: inline-size }
.mail-head { position: relative; padding: 22px 24px 22px; background: var(--brand-fill); color: var(--brand-ink); isolation: isolate; border-bottom: 1.6px solid var(--ink) }
.mail-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 120% at 100% 0, rgba(242, 169, 59, .34), transparent 70%), radial-gradient(40% 90% at 0 100%, rgba(63, 143, 181, .3), transparent 70%) }
.mail-tag { display: inline-block; font-family: var(--f-cond); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 5px; background: var(--spark); color: #1f1408 }
.mailbox .mail-title { margin: 12px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 5.2cqi, 34px); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance }
.mailbox .mail-sub { margin: 10px 0 0; font-size: 16px; line-height: 1.45; opacity: .9; max-width: 56ch }
.mail-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 }
.mail-gets { list-style: none; margin: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; background: var(--field); border-right: 1.4px dashed var(--line-2) }
.mail-gets li { display: flex; gap: 12px; align-items: flex-start }
.mail-gets svg { flex: none; width: 26px; height: 26px; margin-top: 1px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.mail-gets p { margin: 0; display: flex; flex-direction: column; min-width: 0 }
.mail-gets b { font-family: var(--f-cond); font-size: 18px; font-weight: 700; letter-spacing: .01em; line-height: 1.2 }
.mail-gets span { font-size: 14px; line-height: 1.4; color: var(--mute) }
.mail-form { padding: 22px 24px 20px; display: flex; flex-direction: column; min-width: 0 }
.mail-lbl { font-family: var(--f-cond); font-size: 17px; font-weight: 700; letter-spacing: .02em; margin-bottom: 7px }
.mail-row { display: flex; flex-direction: column; gap: 10px }
.mail-row .inp { width: 100%; min-width: 0; padding: 14px 14px; font-family: var(--f-body); font-size: 17px; background: var(--field); border: 1.6px solid var(--ink); border-radius: 8px; transition: box-shadow .15s }
.mail-row .inp[aria-invalid="true"] { border-color: var(--short); box-shadow: 4px 4px 0 var(--short-soft) }
.mail-row .inp:focus { box-shadow: 4px 4px 0 var(--cold-soft); outline: 2.5px solid var(--cold); outline-offset: 1px }
.mail-row button.primary { width: 100%; padding: 13px 18px; font-size: 21px; border-radius: 8px; border-width: 1.6px; box-shadow: 4px 4px 0 var(--ink) }
.mail-row button.primary:hover:not(:disabled) { box-shadow: 5px 5px 0 var(--ink) }
.mail-row button.primary:disabled { opacity: 1; background: var(--idle-soft); color: var(--mute); border-color: var(--line-2); box-shadow: none }
.mail-row .arr { display: inline-block; margin-left: 10px; transition: transform .2s } .mail-row button.primary:hover:not(:disabled) .arr { transform: translateX(4px) }
.mail-priv { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--mute); margin: 14px 0 0 }
.mail-news { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 11px 12px; font-size: 14px; line-height: 1.45; cursor: pointer; border: 1.4px dashed var(--line-2); border-radius: 8px }
.mail-news:hover { border-color: var(--ink) }
.mail-news input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--brand) }
.mail-news em { font-style: normal; font-family: var(--f-cond); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute) }
.mail-form .hint { margin-top: 10px }
.mail-way { list-style: none; margin: 0; padding: 14px 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: w; border-top: 1.4px solid var(--ink); background: var(--paper) }
.mail-way li { counter-increment: w; display: flex; align-items: center; gap: 9px; font-family: var(--f-cond); font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--mute) }
.mail-way li::before { content: counter(w); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; border: 1.4px solid var(--line-2); background: var(--card) }
.mail-way li.now { color: var(--ink) } .mail-way li.now::before { background: var(--heat); border-color: var(--ink); color: var(--heat-ink) }
.mail-way li.done { color: var(--ok) } .mail-way li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: var(--card) }
.mail-sentbody { padding: 22px 24px; font-size: 17px } .mail-sentbody p { margin: 0 0 12px; max-width: 60ch; overflow-wrap: anywhere }
@container (max-width: 620px) {
  .mail-body { grid-template-columns: minmax(0, 1fr) }
  .mail-form { order: -1 }
  .mail-gets { border-right: 0; border-top: 1.4px dashed var(--line-2); padding-top: 18px; padding-bottom: 18px }
  .mail-way { grid-template-columns: minmax(0, 1fr); gap: 8px }
}
@media (max-width: 640px) { .mail-head, .mail-form, .mail-gets, .mail-sentbody { padding-left: 16px; padding-right: 16px } .mail-way { padding-left: 16px; padding-right: 16px } }
.hint.err { color: var(--short, #c8452c); font-weight: 600 }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0 }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.unlock { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 11px 14px; border-radius: 8px; font-weight: 600; background: var(--field); border: 1.4px solid var(--line-2); max-width: 60ch }
.unlock.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok) } .unlock.ok::before { content: "✓"; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--card); font-size: 14px }
.unlock.fail { border-color: var(--short); background: var(--short-soft); color: var(--short) }

/* Kopfzeile: Schalter hell/dunkel neben den Sprachen */
.top-tools { display: flex; align-items: center; gap: 10px; flex: none }
.theme { flex: none; border: 1.4px solid var(--ink); background: var(--field); color: var(--ink); border-radius: 999px; width: 54px; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; cursor: pointer; font-size: 14px; position: relative }
.theme::after { content: ""; position: absolute; top: 2px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: currentColor; opacity: .18; transition: transform .35s }
html[data-theme="dark"] .theme::after { transform: translateX(23px) }

/* ---------- Dunkel: Nachtblau mit cremefarbener Tusche (Schalter wie auf der übrigen Seite) ---------- */
html[data-theme="dark"] {
  --paper: #090d12; --card: #111922; --field: #16202b; --ink: #f3ecdd; --mute: #a3acb3; --line: rgba(243, 236, 221, .14); --line-2: rgba(243, 236, 221, .32);
  --brand: #7fc49d; --brand-soft: rgba(127, 196, 157, .14); --hand-ink: #f3ecdd; --brand-fill: #234a37; --brand-ink: #f3ecdd;
  --heat: #ff7a3d; --heat-text: #ff9a5c; --link: #7cc4f2; --heat-soft: rgba(255, 122, 61, .12); --vor: #ff8b74; --cold: #5fb4e6; --cold-soft: rgba(95, 180, 230, .2);
  --ok: #7fd19a; --ok-soft: rgba(111, 207, 138, .16); --tight: #f0c15a; --tight-soft: rgba(240, 193, 90, .16); --short: #ff8b74; --short-soft: rgba(255, 125, 102, .16); --idle: #6b7680; --idle-soft: rgba(243, 236, 221, .08);
  --ground: #16202b; --roof: #2a3642; --shadow: 4px 5px 0 rgba(0, 0, 0, .55);
  color-scheme: dark;
}
html[data-theme="dark"] body { background-image: none }
html[data-theme="dark"] .mailbox { box-shadow: 6px 7px 0 rgba(0, 0, 0, .55) }
html[data-theme="dark"] .scene-label.bn, html[data-theme="dark"] button.danger { color: #1f1408 }

/* ---------- Handy: Ergebnis als Karten je Raum statt einer Tabelle mit sechs Spalten ---------- */
@media (max-width: 640px) {
  .rtab, .rtab tbody, .rtab tr, .rtab td { display: block } .rtab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
  .result .tablewrap { margin: 0; overflow: visible }
  .rtab tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line) }
  .rtab td { border: 0; padding: 0; white-space: normal }
  .rtab td:first-child { font-family: var(--f-cond); font-size: 20px; font-weight: 700; letter-spacing: .01em }
  .rtab td:nth-child(4) { grid-row: 1; grid-column: 2; text-align: right }
  .rtab td[data-l] { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: right; font-size: 15px }
  .rtab td[data-l]::before { content: attr(data-l); font-family: var(--f-cond); font-size: 15px; font-weight: 600; color: var(--mute); text-align: left }
  /* gesperrt: eine schraffierte Zeile je Raum statt vier Felder */
  .rtab td.locked { display: none }
  .rtab td.locked:nth-child(2) { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 14px }
  .rtab td.locked:nth-child(2)::after { content: attr(title) } .rtab td.locked .lockico { margin-top: 3px }
  .hero h1 { font-size: clamp(30px, 8.6vw, 40px) }
  .top-in { gap: 8px } .langs button { padding: 3px 8px }
}
@media (max-width: 380px) { .brand b { font-size: 18px } .theme { width: 48px } html[data-theme="dark"] .theme::after { transform: translateX(18px) } }
