/* Seite: Layout, Kopf, Wohnungsmodell, Fassungen, Bühne, Ansicht nur Fernbedienung, Rastkurve */

/* Layout: Das Gerät ist die Bühne (Handy: oben, breit: links und klebend). Daneben bzw. darunter
   das simulierte Haus, die Meldungen an Home Assistant und die Belegung als Vorschlag. */
:root {
  --ground: #E6E7E3;
  --surface: #F1F2EE;
  --raised: #FAFAF8;
  --ink: #16181A;
  --ink-2: #464B50;
  --muted: #6B7076;
  --line: #C9CCC7;
  --line-soft: #DADCD7;
  --steel: #2F4D69;
  --steel-soft: rgba(47, 77, 105, 0.10);
  --vor: #C98A00;
  --shadow: rgba(24, 26, 28, 0.40);
  --lamp-off: #D2D4CF;

  /* Gerät: feste Produktfarben, in beiden Themen gleich */
  --hell-1: #E6E4DD; --hell-2: #D1CEC6; --hell-3: #B8B5AC;
  --dunkel-1: #3C3F42; --dunkel-2: #2B2D30; --dunkel-3: #1B1C1E;
  --hell-knurl-a: #8D9297; --hell-knurl-b: #D6D9DB;
  --dunkel-knurl-a: #2E3134; --dunkel-knurl-b: #6B7075;
  --hell-metal-1: #F4F4F1; --hell-metal-2: #CBCED0; --hell-metal-3: #A0A5A9;
  --dunkel-metal-1: #9A9FA4; --dunkel-metal-2: #62676B; --dunkel-metal-3: #3E4246;
  --hell-key: #2B2D30; --hell-glyph: #E7E4DD;
  --dunkel-key: #141516; --dunkel-glyph: #C9C7C1;
  --scr-bg: #000000;
  --scr-fg: #F2EFE8;
  --scr-dim: #8C887F;
  --scr-line: #262624;
  --scr-edge: #3A3936;
  --scr-toast: #2A2926;
  --vol: #A9C3EC;
  --led-mic: #FF5A1F;
  --tv-bg: #0C0D0E;
  --tv-tile: #2A2D31;
  --tv-ink: #D3D7DA;
  --tv-focus: #F2EFE8;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Barlow", "DIN Alternate", "Arial Narrow", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E0F11;
    --surface: #15171A;
    --raised: #1B1E21;
    --ink: #E6E8E5;
    --ink-2: #B3B8BB;
    --muted: #899096;
    --line: #2D3135;
    --line-soft: #23272A;
    --steel: #A9C0D6;
    --steel-soft: rgba(169, 192, 214, 0.13);
    --vor: #E0A21A;
    --shadow: rgba(0, 0, 0, 0.72);
    --lamp-off: #2E3236;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E0F11;
  --surface: #15171A;
  --raised: #1B1E21;
  --ink: #E6E8E5;
  --ink-2: #B3B8BB;
  --muted: #899096;
  --line: #2D3135;
  --line-soft: #23272A;
  --steel: #A9C0D6;
  --steel-soft: rgba(169, 192, 214, 0.13);
  --vor: #E0A21A;
  --shadow: rgba(0, 0, 0, 0.72);
  --lamp-off: #2E3236;
  color-scheme: dark;
}

[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
.page { max-width: 70rem; margin: 0 auto; padding-inline: 16px; padding-block: 18px 56px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: var(--steel); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf -------------------------------------------------------------------- */
.mast { display: grid; gap: 4px; }
.eyebrow, .panel h2, .meta-k, table.map thead th, .feel-k {
  font-family: var(--font-display);
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.eyebrow { margin: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); }
h1 { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1; letter-spacing: -0.01em; }
.lede { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); max-width: 60ch; }

/* Raster ------------------------------------------------------------------
   Handy: Wohnungsmodell klebt oben, das Gerät läuft darunter, so sind Drehen und Licht
   gleichzeitig zu sehen. Breit: Gerät links und klebend, rechts Modell und Details. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; margin-top: 14px; }
.demo { display: grid; gap: 14px; min-width: 0; }
.side { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 919.98px) {
  .house {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 6;
    margin-inline: -16px;
    padding: 8px 16px 10px;
    background: var(--ground);
    box-shadow: 0 1px 0 var(--line), 0 10px 18px -16px var(--shadow);
  }
}
@media (min-width: 920px) {
  .layout { grid-template-columns: 330px minmax(0, 1fr); grid-template-areas: "stage house" "stage side"; align-items: start; gap: 22px 36px; }
  .demo { display: contents; }
  .stage { grid-area: stage; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px); }
  .house { grid-area: house; }
  .side { grid-area: side; }
}

/* Wohnungsmodell -------------------------------------------------------------
   Feste Bildwelt wie ein Modellfoto, unabhängig vom Seitenthema: Abend dunkelblau, Tag hellgrau. */
:root {
  /* Abendhintergrund etwas heller, damit sich das dunkle Haus abhebt; die Nachtstimmung bleibt (Nutzer, 2026-10-08) */
  --vp-eve-1: #3A4A66; --vp-eve-2: #1C2435; --vp-eve-ink: #EEF0F2; --vp-eve-mute: #A3AEBB;
  --vp-eve-pill: rgba(12, 16, 24, 0.74); --vp-eve-edge: rgba(255, 255, 255, 0.16); --vp-eve-acc: #8DB8FF; --vp-eve-acc-ink: #0B1220;
  --vp-day-1: #F1F2F0; --vp-day-2: #C8CFD3; --vp-day-ink: #1B1F23; --vp-day-mute: #59636C;
  --vp-day-pill: rgba(250, 250, 248, 0.88); --vp-day-edge: rgba(20, 24, 28, 0.14); --vp-day-acc: #2F63C0; --vp-day-acc-ink: #FFFFFF;
}
.house { display: grid; gap: 8px; min-width: 0; }
.vp {
  --vp-ink: var(--vp-eve-ink); --vp-mute: var(--vp-eve-mute); --vp-pill: var(--vp-eve-pill);
  --vp-edge: var(--vp-eve-edge); --vp-acc: var(--vp-eve-acc); --vp-acc-ink: var(--vp-eve-acc-ink);
  position: relative;
  height: clamp(180px, 30svh, 300px);
  border-radius: 12px;
  overflow: hidden;
  background: var(--vp-eve-2);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.house[data-tod="tag"] .vp {
  --vp-ink: var(--vp-day-ink); --vp-mute: var(--vp-day-mute); --vp-pill: var(--vp-day-pill);
  --vp-edge: var(--vp-day-edge); --vp-acc: var(--vp-day-acc); --vp-acc-ink: var(--vp-day-acc-ink);
}
.vp::before, .vp::after { content: ""; position: absolute; inset: 0; transition: opacity 0.8s ease; }
.vp::before { background: radial-gradient(120% 95% at 50% 18%, var(--vp-eve-1), var(--vp-eve-2)); }
.vp::after { background: radial-gradient(120% 95% at 50% 18%, var(--vp-day-1), var(--vp-day-2)); opacity: 0; }
.house[data-tod="tag"] .vp::after { opacity: 1; }
@media (min-width: 920px) { .vp { height: auto; aspect-ratio: 16 / 10; max-height: 72svh; } }
.vp-canvas { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; }
.vp-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.vp-head { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 3; pointer-events: none; }
.vp-hide {
  position: absolute; top: 8px; right: 8px; z-index: 4; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--vp-edge); border-radius: 50%; background: var(--vp-pill); color: var(--vp-ink); cursor: pointer;
}
.vp-hide svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Cleane Fassung (Standard): nur Haus und Fernbedienung, Ton und Vibration als Symbole in der Ecke */
/* Ecken: links Grundriss ein/aus, rechts Ton und Vibration. Über dem Haus dunkel, sonst wie die Seite */
.corner { display: none; }
.page[data-fassung="clean"] .corner {
  --c-pill: var(--raised); --c-edge: var(--line); --c-ink: var(--ink); --c-mute: var(--muted);
  position: fixed; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 8px); left: calc(env(safe-area-inset-left, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px);
  display: flex; justify-content: space-between; pointer-events: none;
}
.page.buehne[data-fassung="clean"] .corner, .page.buehne-quer[data-fassung="clean"] .corner, .page[data-fassung="clean"][data-view="fern"] .corner { --c-pill: var(--vp-eve-pill); --c-edge: var(--vp-eve-edge); --c-ink: var(--vp-eve-ink); --c-mute: var(--vp-eve-mute); }
/* Bühne quer (Rechner und Tablet quer, cleane Fassung; Nutzer, 2026-10-08): das Haus füllt das ganze
   Fenster, die Fernbedienung liegt links darauf, ganz sichtbar; die Kamera rahmt das Haus rechts daneben ein */
.page.buehne-quer[data-fassung] { max-width: none; padding: 0; }
.page.buehne-quer[data-fassung] .layout { display: block; margin: 0; min-height: 0; }
.page.buehne-quer[data-fassung] .demo { display: block; position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.page.buehne-quer[data-fassung] .house { position: absolute; inset: 0; display: block; }
.page.buehne-quer[data-fassung] .vp { position: absolute; inset: 0; width: auto; height: auto; max-height: none; aspect-ratio: auto; border-radius: 0; }
.page.buehne-quer[data-fassung] .stage { position: absolute; z-index: 3; left: clamp(24px, 4vw, 72px); top: 50%; transform: translateY(-50%); display: block; }
.page.buehne-quer[data-fassung] .device { --w: clamp(180px, calc((100svh - 72px) / 2.62), 360px); }
.fx { display: flex; gap: 6px; }
.fx-b {
  pointer-events: auto; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--c-edge); border-radius: 50%; background: var(--c-pill); color: var(--c-ink); cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.fx-b[hidden] { display: none; }
.fx-b svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fx-b[aria-pressed="false"] { color: var(--c-mute); }
.fx-b[aria-pressed="true"] .off, .fx-b[aria-pressed="false"] .on { display: none; }
.page[data-fassung="clean"] .mast, .page[data-fassung="clean"] .vp-ctl, .page[data-fassung="clean"] .vp-hide,
.page[data-fassung="clean"] .curve-slot, .page[data-fassung="clean"] .feel, .page[data-fassung="clean"] .ctls,
.page[data-fassung="clean"] .note, .page[data-fassung="clean"] .side, .page[data-fassung="clean"] .footer { display: none; }
.page[data-fassung="clean"] { padding-block: 16px; }
.page[data-fassung="clean"] .device { clip-path: inset(-40px -40px -40px -40px); transition: clip-path 0.45s cubic-bezier(0.22, 0.8, 0.24, 1); }
.page[data-fassung="clean"][data-view="fern"] .layout { margin-top: 0; min-height: calc(100svh - 32px); align-content: center; }
.page[data-fassung="clean"][data-view="fern"] .device { --w: clamp(176px, min(70vw, calc((100svh - 64px) / 2.62)), 300px); }
/* Ohne Grundriss derselbe Abendhimmel wie hinter dem Haus, unabhängig vom Systemdesign (Nutzer, 2026-10-08):
   beim Ein- und Ausblenden des Grundrisses bleibt der Hintergrund gleich */
.page[data-fassung="clean"][data-view="fern"]::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 95% at 50% 18%, var(--vp-eve-1), var(--vp-eve-2)); }
html:has(.page[data-fassung="clean"][data-view="fern"]), html:has(.page[data-fassung="clean"][data-view="fern"]) body { background: var(--vp-eve-2); }
@media (min-width: 920px) {
  .page[data-fassung="clean"] .layout { grid-template-areas: "stage house"; align-items: center; margin-top: 0; min-height: calc(100svh - 32px); }
  .page[data-fassung="clean"] .vp { aspect-ratio: auto; height: min(calc(100svh - 32px), 640px); max-height: none; }
}

/* Probier das: eigenes Panel, auf dem Handy unter der Fernbedienung */
.tour .panel-head { justify-content: space-between; }
.tour h2.hit { animation: tourhit 1.2s ease-out; }
@keyframes tourhit { 0%, 35% { color: var(--steel); } 100% { color: var(--ink); } }
.tour-n { font: 500 12px var(--font-mono); color: var(--steel); font-variant-numeric: tabular-nums; }
.tour-items { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.tour-items li { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); gap: 4px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.tour-items li:first-child { border-top: 0; padding-top: 0; }
.tour-items li::before { content: attr(data-n); font: 500 11.5px/1.75 var(--font-mono); color: var(--muted); }
.tour-items li.ok { color: var(--muted); }
.tour-items li.ok::before { content: "✓"; color: var(--steel); font-weight: 700; }
.tour-items li.next { color: var(--ink); font-weight: 600; }
.tour-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.tour-reset { padding: 0; border: 0; background: none; color: var(--steel); font: 600 12.5px var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Bühne (Handy, mit Wohnung): Modell bildschirmfüllend, Fernbedienung davor, unter dem Display
   angeschnitten. Kopf entfällt, die Einleitung wandert zu den Panels, alles Weitere liegt darunter. */
.page.buehne { padding-top: 0; }
.page.buehne .mast { display: none; }
.page.buehne .layout { margin-top: 0; }
.page.buehne .demo { margin-inline: -16px; justify-items: center; gap: 12px; }
.page.buehne .house, .page.buehne .stage { display: contents; }
.page.buehne .vp { grid-row: 1; grid-column: 1; justify-self: stretch; height: 100vh; height: 100svh; border-radius: 0; }
.page.buehne .rig { grid-row: 1; grid-column: 1; align-self: end; z-index: 3; padding: 0; }
.page.buehne .device {
  --w: clamp(176px, min(60vw, 30svh), 250px);
  margin-bottom: calc(var(--w) * -0.36);
  clip-path: inset(-14px -18px calc(var(--w) * 0.36) -18px);
}
.page.buehne .curve-slot { order: 1; margin-top: 2px; }
.page.buehne .feel { order: 2; }
.page.buehne .vp-ctl { order: 3; justify-self: stretch; padding-inline: 16px; }
.page.buehne .ctls { order: 4; padding-inline: 16px; }
.page.buehne .note { order: 5; padding-inline: 16px; }
.page.buehne .side .lede { margin: 0; }
.page.buehne[data-fassung="clean"] { padding-block: 0; }
.page.buehne[data-fassung="clean"] .demo { height: 100vh; height: 100svh; overflow: hidden; }

/* Ansicht nur Fernbedienung: Modell, Details und Einleitung weg, das Gerät wird größer */
.mast-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.view-seg button { font-size: 12.5px; }
.page[data-view="fern"] .house, .page[data-view="fern"] .side, .page[data-view="fern"] .lede, .page[data-view="fern"] .eyebrow { display: none; }
.page[data-view="fern"] .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage"; }
.page[data-view="fern"] .stage { position: static; }
.page[data-view="fern"] .device { --w: clamp(200px, min(66vw, calc((100svh - 190px) / 2.62)), 280px); }
.vp-head h2 { font: 700 10.5px/1.3 var(--font-display); font-stretch: 125%; letter-spacing: 0.14em; text-transform: uppercase; color: var(--vp-ink); }
.vp-sub { margin: 1px 0 0; font-size: 11.5px; color: var(--vp-mute); }
.vp-hint { position: absolute; right: 10px; bottom: 9px; z-index: 3; margin: 0; padding: 2px 8px; border-radius: 99px; background: var(--vp-pill); font-size: 11px; color: var(--vp-mute); transition: opacity 0.4s; pointer-events: none; }
.vp-hint.gone { opacity: 0; }
@media (max-width: 919.98px) { .vp-hint, .vp-sub { display: none; } .lb { font-size: 10.5px; padding: 1px 7px; gap: 5px; } .lb.rm span { font-size: 8.5px; } }
.vp-fail { position: absolute; inset: auto 12px 12px; z-index: 3; margin: 0; font-size: 13px; color: var(--vp-ink); }
.lb {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--vp-edge);
  border-radius: 99px;
  background: var(--vp-pill);
  color: var(--vp-ink);
  font: 500 11.5px/1.35 var(--font-ui);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  will-change: transform;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.2s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lb b { font-weight: 600; }
.lb i { font-style: normal; font: 600 9px/1.4 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 0 5px; border: 1px solid currentColor; border-radius: 99px; opacity: 0.85; }
.lb.rm span { font: 700 9.5px/1.5 var(--font-display); font-stretch: 112%; letter-spacing: 0.12em; text-transform: uppercase; }
.lb.far { background: transparent; border-color: transparent; color: var(--vp-mute); -webkit-backdrop-filter: none; backdrop-filter: none; }
.lb.here { border-color: var(--vp-acc); }
.lb.off b { color: var(--vp-mute); }
.lb.sel { background: var(--vp-acc); border-color: var(--vp-acc); color: var(--vp-acc-ink); }
.lb.sel b { color: inherit; }
.lb.kiesel { padding: 1px 6px; font-size: 10px; color: var(--vp-mute); }
.vp-ctl { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.vp-ctl::-webkit-scrollbar { display: none; }
.vp-ctl .tog, .vp-ctl .seg { flex: 0 0 auto; }
.vp-ctl .tog { padding: 6px 11px; font-size: 12.5px; }
.vp-ctl .seg button { padding: 4px 10px; font-size: 12.5px; }
.flat { display: grid; gap: 4px; }

/* Rastkurve: Täler sind Rasten, die Steigung ist das Drehmoment. Sie liegt immer unter der Fernbedienung. */
.curve-slot { width: min(100%, 300px); }
.curve {
  --cv-line: var(--steel); --cv-fill: var(--steel-soft); --cv-dot: var(--ink); --cv-mute: var(--muted); --cv-axis: var(--line);
  margin: 0; display: grid; gap: 3px; pointer-events: none;
}
.curve-cap { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 11.5px; line-height: 1.3; color: var(--cv-mute); white-space: nowrap; }
.curve-cap b { flex: 0 0 auto; color: var(--cv-dot); font-weight: 600; }
.curve-cap span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.curve canvas { display: block; width: 100%; height: 52px; }
.house.no3d { position: static; box-shadow: none; }
.house.no3d .vp { height: auto; aspect-ratio: auto; min-height: 0; padding: 62px 12px 12px; cursor: default; }
.house.no3d .vp-fail { position: relative; inset: auto; z-index: 3; }
