/* Central entry points app.<domain> / meinhaus.<domain> (A4). Only tokens of the design system
   (frontends/design/daemmerung.css), no colour values of their own: Danwood red leads (the
   stage, the rail), window light marks what is done. */

html, body { margin: 0; min-height: 100%; }
body.dw2 { min-height: 100vh; }
#app { min-height: 100vh; }

/* ── Sign-in: red stage with the house, form below ─────────────────────────── */
.buehne {
  background: var(--dw-daemmerung);
  color: var(--dw-daemmerung-text);
  padding: calc(28px + env(safe-area-inset-top)) var(--dw-rand) 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
}
.buehne h1 { color: var(--dw-daemmerung-text); max-width: 16ch; }
.buehne p { color: var(--dw-daemmerung-leise); margin-top: 10px; max-width: 46ch; }
.marke { font: 700 1.05rem/1 var(--dw-schrift-titel); color: var(--dw-daemmerung-text); margin-bottom: 36px; grid-column: 1 / -1; }

.haus { width: 112px; height: auto; }
.haus .dach { fill: none; stroke: var(--dw-dach); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.haus .wand { fill: var(--dw-wand); stroke: var(--dw-dach); stroke-width: 1.4; }
.haus .fenster { fill: var(--dw-fenster-aus); transition: fill .6s ease; }
.haus .fenster.an { fill: var(--dw-fensterlicht); }
@media (prefers-reduced-motion: reduce) { .haus .fenster { transition: none; } }

.inhalt { padding: 28px var(--dw-rand) 48px; display: grid; gap: 22px; }
.inhalt > * { max-width: 560px; }
.inhalt.breit > * { max-width: none; }

.feld { display: grid; gap: 6px; }
.feld label { font-weight: 600; }
.feld input {
  font: inherit; padding: 13px 14px; border-radius: var(--dw-radius-knopf);
  border: 1.5px solid var(--dw-fuge-stark); background: var(--dw-flaeche); color: var(--dw-graphit);
  width: 100%;
}
.feld input:focus-visible { outline: 3px solid var(--dw-fokus); outline-offset: 1px; }

.knopf {
  font: 600 1rem/1.2 var(--dw-schrift-text); border: 0; cursor: pointer;
  border-radius: var(--dw-radius-knopf); padding: 14px 20px; min-height: 48px;
  background: var(--dw-daemmerung); color: var(--dw-daemmerung-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.knopf:hover { background: var(--dw-daemmerung-tief); }
.knopf[disabled] { opacity: .55; cursor: progress; }
.knopf.leise { background: var(--dw-flaeche); color: var(--dw-graphit); border: 1.5px solid var(--dw-fuge-stark); }
.knopf.leise:hover { background: var(--dw-putz); }
.knopf.voll { width: 100%; }
.zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.hinweis { padding: 14px 16px; border-radius: var(--dw-radius-knopf); background: var(--dw-flaeche); border-left: 4px solid var(--dw-fensterlicht-text); }
.fehler { padding: 14px 16px; border-radius: var(--dw-radius-knopf); background: var(--dw-fehler-weich); color: var(--dw-fehler); border-left: 4px solid var(--dw-fehler); }

/* Choice of the office: whole row is the button. */
.wahl { display: grid; gap: 10px; }
.wahl button {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  background: var(--dw-flaeche); color: var(--dw-graphit); border: 1.5px solid var(--dw-fuge);
  border-radius: var(--dw-radius-karte); padding: 16px 18px; min-height: 64px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
}
.wahl button:hover { border-color: var(--dw-daemmerung); }
.wahl .titel { font: 700 1.1rem/1.25 var(--dw-schrift-titel); overflow-wrap: anywhere; }
.wahl .unter { color: var(--dw-grau); font-size: .92rem; overflow-wrap: anywhere; }
.wahl .zeichen { width: 40px; height: 40px; border-radius: 12px; background: var(--dw-daemmerung); display: grid; place-items: center; color: var(--dw-daemmerung-text); }
.wahl .pfeil { color: var(--dw-grau); }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; }
.codes li { background: var(--dw-flaeche); border: 1px solid var(--dw-fuge); border-radius: 10px; padding: 10px 12px; font-variant-numeric: tabular-nums; letter-spacing: .04em; text-align: center; }

/* ── Operator frame: red rail on desktop, bottom bar on phones ─────────────── */
.rahmen { display: grid; grid-template-columns: var(--dw-rahmen-leiste) minmax(0, 1fr); min-height: 100vh; }
.leiste {
  background: var(--dw-daemmerung); color: var(--dw-daemmerung-text);
  padding: 24px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.leiste .marke { margin: 4px 10px 26px; }
.leiste nav { display: grid; gap: 4px; }
.leiste a, .leiste button.nav {
  font: 600 1rem/1.2 var(--dw-schrift-text); color: var(--dw-daemmerung-leise); text-decoration: none;
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: none; border: 0; cursor: pointer; text-align: left;
}
.leiste a[aria-current="page"] { background: var(--dw-daemmerung-tief); color: var(--dw-daemmerung-text); }
.leiste a:hover, .leiste button.nav:hover { color: var(--dw-daemmerung-text); }
.leiste .unten { margin-top: auto; display: grid; gap: 4px; }
.leiste .wer { padding: 0 12px 8px; color: var(--dw-daemmerung-leise); font-size: .9rem; overflow-wrap: anywhere; }

.seite { padding: 32px var(--dw-rand) 48px; display: grid; gap: 22px; align-content: start; min-width: 0; }
.seite header { display: grid; gap: 6px; }

.liste { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.karte { background: var(--dw-flaeche); border-radius: var(--dw-radius-karte); padding: 18px 20px; display: grid; gap: 10px; min-width: 0; border: 1px solid var(--dw-fuge); }
.karte h3 { overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--dw-putz); border: 1px solid var(--dw-fuge); white-space: nowrap; }
.chip.licht { background: var(--dw-fensterlicht); border-color: var(--dw-fensterlicht); color: var(--dw-graphit); }
.chip.warn { background: var(--dw-fehler-weich); border-color: var(--dw-fehler-weich); color: var(--dw-fehler); }

.werte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.werte div { min-width: 0; }
.werte dt { color: var(--dw-grau); font-size: .88rem; }
.werte dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }

.summen { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.summe { background: var(--dw-flaeche); border-radius: var(--dw-radius-karte); padding: 16px 18px; border: 1px solid var(--dw-fuge); }
.summe dt { color: var(--dw-grau); }
.summe dd { margin: 4px 0 0; font: 700 1.6rem/1.15 var(--dw-schrift-text); font-variant-numeric: tabular-nums; }
.summe.vorn { background: var(--dw-daemmerung); border-color: var(--dw-daemmerung); color: var(--dw-daemmerung-text); }
.summe.vorn dt { color: var(--dw-daemmerung-leise); }

.leer { color: var(--dw-grau); }

.freigabe-stand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.punkt { width: 14px; height: 14px; border-radius: 4px; background: var(--dw-fuge); display: inline-block; }
.punkt.an { background: var(--dw-fensterlicht); outline: 1px solid var(--dw-fensterlicht-text); }

@media (max-width: 820px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--dw-rahmen-unten) + env(safe-area-inset-bottom)); }
  .leiste {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 5;
    flex-direction: row; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .leiste .marke, .leiste .wer { display: none; }
  .leiste nav { grid-auto-flow: column; grid-auto-columns: 1fr; flex: 1; gap: 2px; }
  .leiste .unten { margin: 0; grid-auto-flow: column; }
  .leiste a, .leiste button.nav { flex-direction: column; gap: 4px; font-size: .78rem; padding: 8px 4px; justify-content: center; text-align: center; }
  .seite { padding-top: 22px; }
  .buehne { padding-bottom: 28px; }
  .haus { width: 84px; }
}
.inhalt.eng { padding: 14px 0 0; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
/* Headings get the focus after a view change (screen readers); no ring for that. */
[tabindex="-1"]:focus { outline: none; }
@media (max-width: 820px) {
  .summen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summe { padding: 14px; }
  .summe dd { font-size: 1.2rem; }
}
/* Long German words (Wiederherstellungscodes) break instead of leaving the screen. */
.buehne h1 { hyphens: auto; overflow-wrap: break-word; }
.codes li { white-space: nowrap; letter-spacing: 0; font-size: .95rem; padding: 10px 6px; }
