/* fox-Cockpit: Handy zuerst (390 px), ab 1024 px zwei Spalten. Hell/dunkel über das System. Nur Klassen, keine style-Attribute. */
:root {
  --grund: #f4f5f7; --flaeche: #ffffff; --flaeche-2: #f0f1f4; --text: #15171c; --leise: #596070; --rand: #dfe2e8;
  --marke: #c2410c; --marke-auf: #ffffff; --fokus: #2563eb;
  --rot: #b42318; --rot-flaeche: #fdeceb; --gelb: #8a5300; --gelb-flaeche: #fff3d6; --gruen: #1d7a3a; --gruen-flaeche: #e5f4ea;
  --blau: #1f4fb8; --blau-flaeche: #e8effc;
  --radius: 14px; --schatten: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 4%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #121419; --flaeche: #1b1e25; --flaeche-2: #232731; --text: #eceef3; --leise: #a5abb8; --rand: #2e333e;
    --marke: #fb923c; --marke-auf: #1b1e25; --fokus: #7aa7ff;
    --rot: #ff8f86; --rot-flaeche: #3a1f1f; --gelb: #f5c35b; --gelb-flaeche: #352a12; --gruen: #6fd08f; --gruen-flaeche: #17301f;
    --blau: #9dbbff; --blau-flaeche: #1b2640;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1.05rem; margin: .25rem 0; }
p { margin: .4rem 0; }
a { color: var(--blau); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Kopfleiste */
.kopfleiste { position: sticky; top: 0; z-index: 2; background: var(--flaeche); border-bottom: 1px solid var(--rand); padding-top: env(safe-area-inset-top); }
.kopfleiste-innen { max-width: 1200px; margin: 0 auto; padding: .5rem 16px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.logo-zeichen { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: var(--marke); color: var(--marke-auf); font-weight: 800; }
.navi { display: flex; align-items: center; gap: .25rem; }
.navi a, .navi-abmelden { padding: .55rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; min-height: 44px; }
.navi a[aria-current="page"] { background: var(--flaeche-2); font-weight: 700; }
.navi-abmelden { color: var(--leise); }

/* Inhalt */
.inhalt { max-width: 1200px; margin: 0 auto; padding: 1rem 16px calc(2rem + env(safe-area-inset-bottom)); outline: none; }
.seitenkopf { margin: .5rem 0 1rem; }
.lead { font-size: 1.05rem; color: var(--text); }
.leise, .leer { color: var(--leise); }
.leer { padding: 1rem; background: var(--flaeche-2); border-radius: var(--radius); }
.klein { font-size: .88rem; color: var(--leise); }
.spalten, .stapel { display: grid; gap: 1rem; align-items: start; }
.block { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem; box-shadow: var(--schatten); min-width: 0; }
.block-breit { margin-top: 1rem; }
@media (min-width: 1024px) {
  .spalten { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .inhalt { padding-top: 1.5rem; }
  h1 { font-size: 2rem; }
}

/* Zahl neben Überschrift */
.zahl { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .45rem; border-radius: 999px; background: var(--flaeche-2); color: var(--leise); font-size: .95rem; }
.zahl-aktiv { background: var(--marke); color: var(--marke-auf); }

/* Karten */
.karten { display: grid; gap: .75rem; }
.karte { border: 1px solid var(--rand); border-left-width: 6px; border-radius: 12px; padding: .9rem; background: var(--flaeche); }
.karte-rot { border-left-color: var(--rot); }
.karte-gelb { border-left-color: var(--gelb); }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.stufe, .mstufe, .marke { font-size: .8rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.stufe-rot, .mstufe-ausfall, .marke-schlecht { background: var(--rot-flaeche); color: var(--rot); }
.stufe-gelb, .mstufe-wichtig { background: var(--gelb-flaeche); color: var(--gelb); }
.mstufe-info { background: var(--blau-flaeche); color: var(--blau); }
.marke-gut { background: var(--gruen-flaeche); color: var(--gruen); }
.kennung { font: .85rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--leise); }
.risiko, .frist { font-size: .95rem; }
.genau { background: var(--flaeche-2); border-radius: 10px; padding: .6rem .75rem; margin: .5rem 0; }
.genau-titel { font-weight: 700; font-size: .9rem; margin: 0 0 .25rem; }
.genau-text, .meldung-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.technik summary, details summary { cursor: pointer; color: var(--leise); font-size: .9rem; padding: .3rem 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--flaeche-2); padding: .6rem; border-radius: 8px; margin: .25rem 0; }

/* Knöpfe */
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; align-items: center; }
.knopf { min-height: 48px; padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf-haupt { background: var(--marke); border-color: var(--marke); color: var(--marke-auf); }
.knopf-gefahr { background: var(--rot); border-color: var(--rot); color: var(--flaeche); }
.knopf-leise { background: none; border-color: transparent; color: var(--blau); min-height: 44px; padding: .5rem .6rem; font-weight: 500; }
.knopf-breit { width: 100%; }
.knoepfe .knopf-haupt, .knoepfe > .knopf:not(.knopf-leise) { flex: 1 1 9rem; }
.grund { width: 100%; display: grid; gap: .4rem; }
.grund label { font-weight: 600; font-size: .95rem; }
.grund input { font: inherit; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); width: 100%; }

/* Rückmeldungen */
.hinweis { padding: .6rem .8rem; border-radius: 10px; background: var(--blau-flaeche); color: var(--blau); margin: .5rem 0; }
.hinweis-gut { background: var(--gruen-flaeche); color: var(--gruen); }
.hinweis-fehler { background: var(--rot-flaeche); color: var(--rot); }

/* Meldungen */
.meldungen, .ablaeufe, .verlauf, .punkte { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.meldung { border: 1px solid var(--rand); border-radius: 12px; padding: .75rem .85rem; }
.meldung-ausfall { border-color: var(--rot); }
.meldung-gelesen { opacity: .7; }

/* System */
.punkt { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; flex: none; margin-right: .45rem; vertical-align: middle; }
.punkt-gruen { background: var(--gruen); }
.punkt-rot { background: var(--rot); }
.punkt-grau { background: var(--leise); }
.gesamt { font-weight: 700; padding: .6rem .8rem; border-radius: 10px; display: flex; align-items: center; }
.gesamt-gut { background: var(--gruen-flaeche); color: var(--gruen); }
.gesamt-schlecht { background: var(--rot-flaeche); color: var(--rot); }
.ablauf { border-top: 1px solid var(--rand); padding-top: .6rem; }
.zeile { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.punkte li { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: baseline; font-size: .95rem; }
.weise { font-size: .78rem; padding: .1rem .45rem; border-radius: 999px; background: var(--flaeche-2); color: var(--leise); }
.block-zeile { flex-basis: 100%; }
.werte { display: grid; grid-template-columns: 1fr; gap: .15rem; margin: 0; }
.werte dt { font-weight: 700; margin-top: .5rem; display: flex; align-items: center; }
.werte dd { margin: 0; color: var(--text); }
.verlauf li { border-top: 1px solid var(--rand); padding-top: .5rem; }
.verlauf-fehler strong, .verlauf-abgelehnt strong { color: var(--rot); }

/* Anmelden */
.anmelden { max-width: 28rem; margin: 2rem auto; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.5rem 1.25rem; box-shadow: var(--schatten); }
.anmelden .knopf-breit { margin: 1rem 0 .5rem; }

.logo-bild { width: 2rem; height: 2rem; border-radius: 9px; display: block; }
.logo-neu { font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; background: var(--marke); color: var(--marke-auf); }

/* Ab 0.2.0: Aufgaben, Aufträge, Vorschläge, Anlegen, Zugänge */
.eintraege, .schritte, .zugaenge, .liste, .regeln { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.liste, .regeln { list-style: disc; padding-left: 1.2rem; gap: .25rem; }
.eintrag, .auftrag, .zugang { border-top: 1px solid var(--rand); padding-top: .6rem; }
.eintraege > :first-child, .zugaenge > :first-child { border-top: 0; padding-top: 0; }
.eintrag strong, .auftrag strong { overflow-wrap: anywhere; }
.vorschlag-art + .vorschlag-art { margin-top: .9rem; }
.vorschlag-art h3, .klappe-inhalt h3 { font-size: .95rem; color: var(--leise); margin: .6rem 0 .4rem; }
.schritte { gap: .35rem; margin: .4rem 0; }
.schritt { display: flex; flex-wrap: wrap; gap: .2rem .5rem; align-items: baseline; font-size: .95rem; }
.sstatus { font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--flaeche-2); color: var(--leise); min-width: 4.2rem; text-align: center; }
.sstatus-erledigt { background: var(--gruen-flaeche); color: var(--gruen); }
.sstatus-laeuft { background: var(--blau-flaeche); color: var(--blau); }
.sstatus-fehler { background: var(--rot-flaeche); color: var(--rot); }
.auftrag-abgebrochen strong { color: var(--rot); }
.stapel.block-breit { margin-top: 1rem; }
.klappe { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.klappe > summary { list-style: none; cursor: pointer; padding: .9rem 1rem; min-height: 48px; display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.05rem; color: var(--text); }
.klappe > summary::-webkit-details-marker { display: none; }
.klappe > summary::before { content: "▸"; color: var(--leise); transition: transform .15s; }
.klappe[open] > summary::before { transform: rotate(90deg); }
.klappe-inhalt { padding: 0 1rem 1rem; }
.formular { display: grid; gap: .6rem; }
.feld { display: grid; gap: .3rem; }
.feld label { font-weight: 600; font-size: .95rem; }
.feld input, .feld select, .feld textarea { font: inherit; padding: .65rem .75rem; border-radius: 10px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); width: 100%; min-height: 48px; }
.feld textarea { resize: vertical; }
.ablauf-gelb { color: var(--gelb); font-weight: 600; }
.ablauf-rot { color: var(--rot); font-weight: 700; }
.kosten { display: grid; gap: .25rem; margin-top: .35rem; font-size: .92rem; }
.kosten p { margin: 0; }
.kosten meter { width: 100%; height: .8rem; }
.zurueck { margin: .25rem 0 0; padding-left: 0; }
@media (min-width: 1024px) {
  .zugaenge { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .zugaenge > :nth-child(2) { border-top: 0; padding-top: 0; }
}
.eintrag .knoepfe > .knopf:not(.knopf-leise) { flex: 0 1 12rem; }

/* Ab 0.2.0 (O4): Fristen, Überfälliges, Prüfungen auf Karten */
.block-rot { border-color: var(--rot); border-width: 2px; background: var(--rot-flaeche); margin-bottom: 1rem; }
.block-rot h2 { color: var(--rot); }
.zahl-rot { background: var(--rot); color: var(--flaeche); }
.frist-zeile { font-weight: 600; }
.frist-um { color: var(--rot); }
.pruefungen { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .3rem; }
.pruefung { font-size: .92rem; padding: .35rem .55rem; border-radius: 8px; background: var(--flaeche-2); border-left: 4px solid var(--leise); }
.pruefung-gruen { border-left-color: var(--gruen); }
.pruefung-gelb { border-left-color: var(--gelb); }
.pruefung-rot { border-left-color: var(--rot); }
p.pruefung { margin: .25rem 0; }

/* O9: Bilder der Stellen (rund; Fotos zugeschnitten) */
.bild { border-radius: 50%; display: block; flex: none; background: var(--flaeche-2); }
.bild-foto { object-fit: cover; }
.bild-22 { width: 22px; height: 22px; }
.bild-36 { width: 36px; height: 36px; }
.bild-44 { width: 44px; height: 44px; }
.bild-96 { width: 96px; height: 96px; }
.bild-rahmen { display: inline-grid; justify-items: center; gap: .1rem; }
.ki-hinweis { font-size: .62rem; letter-spacing: .03em; color: var(--leise); text-transform: uppercase; }

/* Paket 0: Geräte einrichten, Einmal-Code, Umzug */
.code-kasten { border: 2px solid var(--marke); border-radius: var(--radius); padding: .9rem 1rem; margin: .8rem 0; background: var(--flaeche); }
.code { font: 700 1.45rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; overflow-wrap: anywhere; margin: .3rem 0; user-select: all; }
.code-eingabe { font: 600 1.15rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; }
.schrittliste { padding-left: 1.3rem; margin: .6rem 0; display: grid; gap: .45rem; }
.knopf-link { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: .6rem; }
.umzug { max-width: 34rem; }
.navi a[hidden] { display: none; }
.code-klein { font: 600 .95rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; user-select: all; }
.hinweis-warnung, .marke-warnung { background: var(--gelb-flaeche); color: var(--gelb); }
