:root {
  color-scheme: dark;
  --grund: #000; --flaeche: #141416; --flaeche2: #1d1d20; --rand: #2a2a2e; --linie: #232326;
  --text: #eee; --leise: #808086; --ok: #4cd964; --warn: #ff9f0a; --fehler: #ff453a; --akzent: #ff9f0a;
}
* { box-sizing: border-box; }
/* Sonst gewinnt `.zeile { display: flex }` gegen `hidden`. */
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--grund); color: var(--text); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 13px; margin: 24px 0 10px; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
h3 { font-size: 15px; margin: 0 0 6px; }
a { color: var(--akzent); }
code { background: var(--flaeche2); padding: 2px 7px; border-radius: 6px; font-size: 13px; }
.waehlbar { user-select: all; }
.umbruch { word-break: break-all; }

input, select, button, textarea { font: inherit; border-radius: 9px; border: 1px solid #333; background: var(--flaeche2); color: var(--text); padding: 8px 12px; }
button { background: var(--text); color: #000; border: none; font-weight: 600; cursor: pointer; }
button:hover { background: #fff; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--text); border: 1px solid #444; font-weight: 400; }
button.ghost:hover { border-color: #777; }
button.danger { border: 1px solid var(--fehler); color: var(--fehler); background: transparent; }
button.danger:hover { background: var(--fehler); color: #fff; }
button.klein, .klein { font-size: 12px; }
button.klein { padding: 4px 9px; }
textarea { font: 12px/1.5 ui-monospace, Menlo, monospace; width: 100%; min-height: 320px; background: #0c0c0e; color: #d6d6d6; }

.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spalte { display: flex; flex-direction: column; gap: 10px; }
.abstand { flex: 1; }
.ok { color: var(--ok); } .warn, .used { color: var(--warn); } .fehler { color: var(--fehler); } .muted { color: var(--leise); }
.fehlerliste { color: var(--fehler); margin: 6px 0 0 18px; padding: 0; }
label.haken { display: flex; align-items: center; gap: 7px; font-size: 13px; }

/* Eingang (Anmeldung, Faktor) */
.eingang { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.karte.schmal { width: min(440px, 100%); }
.karte.schmal h1 { margin-bottom: 8px; }

/* Rahmen mit Seitenleiste */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.seitenleiste { background: #0b0b0d; border-right: 1px solid var(--linie); padding: 18px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.seitenleiste .marke { font-weight: 700; padding: 0 10px 14px; }
.seitenleiste .gruppe { color: var(--leise); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 4px; }
.seitenleiste a { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.seitenleiste a:hover { background: var(--flaeche); }
.seitenleiste a.aktiv { background: var(--flaeche2); color: #fff; font-weight: 600; }
.seitenleiste .zahl { margin-left: auto; background: var(--warn); color: #000; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.hauptteil { padding: 20px 28px 60px; min-width: 0; max-width: 1200px; }
.kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.erklaerung { background: #101014; border: 1px solid var(--linie); border-left: 3px solid var(--akzent); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; color: #c8c8cc; font-size: 13px; }
.erklaerung:empty { display: none; }
.erklaerung p { margin: 4px 0; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--linie); }
  .hauptteil { padding: 16px; }
}

/* Tabellen */
.tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--leise); font-weight: 600; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
.unterzeile td { background: #101012; padding: 10px; }
.liste { display: flex; flex-direction: column; gap: 6px; }
.eintrag { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 1px solid var(--linie); border-radius: 8px; flex-wrap: wrap; }

/* Kacheln der Übersicht */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px; }
.kachel .wert { font-size: 26px; font-weight: 700; }
.kachel .name { color: var(--leise); font-size: 12px; }
.aufgaben { list-style: none; padding: 0; margin: 0; }
.aufgaben li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--linie); }

/* Release-Schritte */
.schritt { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.schritt .nummer { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--flaeche2); border: 1px solid #444; }
.schritt.erledigt .nummer { background: var(--ok); color: #000; border-color: var(--ok); }
.schritt.offen .nummer { border-color: var(--warn); color: var(--warn); }
.status { font-size: 12px; margin-left: 8px; }

/* Karten-Editor */
.treffer { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; cursor: pointer; border-bottom: 1px solid #1c1c20; }
.treffer:hover { background: #17171a; }
.treffer code { flex: 0 0 auto; }
.treffer span { color: #999; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.befehl { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.befehl code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; padding: 6px 10px; }

/* Hilfe */
.hilfe dt { font-weight: 700; margin-top: 12px; }
.hilfe dd { margin: 2px 0 0; color: #c8c8cc; }

#msg { position: fixed; right: 16px; bottom: 16px; max-width: min(520px, calc(100vw - 32px)); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
#msg:empty { display: none; }
#msg.fehler { border-color: var(--fehler); }
#msg.ok { border-color: var(--ok); }
