:root {
  --bg: #f4f5f2;
  --karte: #ffffff;
  --text: #1d2321;
  --leise: #66706c;
  --linie: #e2e5e0;
  --akzent: #2f6f5e;
  --gruen: #1f7a4d;
  --gruen-bg: #e3f3ea;
  --gelb: #8a5a00;
  --gelb-bg: #fdf1d8;
  --rot: #b3261e;
  --rot-bg: #fbe4e2;
  --blau: #1d5fa0;
  --blau-bg: #e3eefa;
  --grau-bg: #eceeeb;
  --balken: #2f6f5e;
  --balken-leer: #e6e9e4;
  --schatten: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --karte: #1b1f1e;
    --text: #e6eae8;
    --leise: #9aa4a0;
    --linie: #2b3130;
    --akzent: #5fb89c;
    --gruen: #6fd39c;
    --gruen-bg: #173326;
    --gelb: #f0c36a;
    --gelb-bg: #3a2e14;
    --rot: #ff8a80;
    --rot-bg: #3e1d1b;
    --blau: #8fbef0;
    --blau-bg: #1a2c40;
    --grau-bg: #262b2a;
    --balken: #5fb89c;
    --balken-leer: #2a302e;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2 { margin: 0; font-weight: 650; }
h1 { font-size: 1.15rem; }
h2 { font-size: 1rem; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.klein { font-size: .82rem; }
.zahl { font-size: .8rem; font-weight: 600; color: var(--leise); background: var(--grau-bg); border-radius: 99px; padding: 0 .5rem; }
.zahl:empty { display: none; }

.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 2; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: .75rem; }
.kopf-innen h1 { margin-right: auto; }
#aktualisiert { text-align: right; }
@media (max-width: 520px) {
  .kopf-innen { flex-wrap: wrap; row-gap: .2rem; }
  #aktualisiert { order: 3; width: 100%; text-align: left; }
}

.seite { max-width: 1200px; margin: 0 auto; padding: 16px; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.breit { grid-column: 1 / -1; }
@media (max-width: 760px) { .raster { grid-template-columns: minmax(0, 1fr); } }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 16px; box-shadow: var(--schatten); min-width: 0; }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.karte-kopf h2 { margin: 0; }

.ampel { border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; border: 1px solid transparent; }
.ampel.gruen { background: var(--gruen-bg); color: var(--gruen); }
.ampel.rot { background: var(--rot-bg); color: var(--rot); }
.ampel.gelb { background: var(--gelb-bg); color: var(--gelb); }
.ampel ul { margin: .3rem 0 0; padding-left: 1.2rem; font-weight: 500; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: 0; padding-top: 0; }
.liste .inhalt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.liste .titel { font-weight: 600; }
.leer { color: var(--leise); padding: .25rem 0; }

.haken { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--linie); background: transparent; cursor: pointer; margin-top: 1px; color: var(--gruen); font-size: 15px; line-height: 1; padding: 0; }
.haken:hover, .haken:focus-visible { border-color: var(--gruen); }
.haken::after { content: "✓"; opacity: 0; }
.haken:hover::after, .haken:focus-visible::after { opacity: .6; }
.punkt { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; margin-left: 8px; margin-right: 8px; background: var(--gelb); }

.chip { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 99px; padding: .1rem .55rem; white-space: nowrap; }
.chip.arbeitet { background: var(--blau-bg); color: var(--blau); }
.chip.wartet { background: var(--gelb-bg); color: var(--gelb); }
.chip.fertig { background: var(--gruen-bg); color: var(--gruen); }
.chip.fehler { background: var(--rot-bg); color: var(--rot); }
.chip.gestoppt, .chip.unbekannt { background: var(--grau-bg); color: var(--leise); }

input[type=search], input[type=password], input:not([type]), input[type=text] {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: .5rem .7rem; width: 100%;
}
.werkzeuge { display: flex; gap: .5rem; align-items: center; flex: 1; justify-content: flex-end; }
#suche { max-width: 260px; }
@media (max-width: 760px) { .werkzeuge { flex-basis: 100%; flex-wrap: wrap-reverse; } #suche { max-width: none; } }
input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }

.ordner { margin-top: .5rem; }
.ordner + .ordner { margin-top: 1rem; }
.ordner > h3 { font-size: .95rem; margin: 0 0 .25rem; }
.unterordner > h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin: .6rem 0 .1rem; font-weight: 600; }
.thread { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .75rem; padding: .45rem 0; border-top: 1px solid var(--linie); }
.thread .links { min-width: 0; }
.thread .titel { font-weight: 550; overflow-wrap: break-word; }
.thread .rechts { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.thread .w { color: var(--leise); font-size: .85rem; margin-top: .1rem; }

.gross { font-size: 1.8rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.zahlen { font-variant-numeric: tabular-nums; }
.woche { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 110px; margin: 1rem 0 .25rem; }
.woche .saeule { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.woche .wert { background: var(--balken); border-radius: 5px 5px 2px 2px; min-height: 2px; opacity: .55; }
.woche .heute .wert { opacity: 1; }
.woche-tage { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: .75rem; color: var(--leise); }
.tabelle { width: 100%; border-collapse: collapse; margin-top: .75rem; font-size: .88rem; }
.tabelle td { padding: .35rem 0; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle td.r { text-align: right; white-space: nowrap; padding-left: .75rem; font-variant-numeric: tabular-nums; }
.tabelle .klein { display: block; }

.werte { display: grid; grid-template-columns: auto 1fr auto; gap: .55rem .75rem; align-items: center; }
.werte .name { color: var(--leise); }
.werte .ueber2 { grid-column: span 2; }
.werte .zahl-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini { height: 8px; background: var(--balken-leer); border-radius: 99px; overflow: hidden; }
.mini > span { display: block; height: 100%; background: var(--balken); border-radius: 99px; }
.mini.warn > span { background: var(--gelb); }
.mini.rot > span { background: var(--rot); }
.dienste { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.dienst { font-size: .82rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; }
.dienst.an { background: var(--gruen-bg); color: var(--gruen); }
.dienst.aus { background: var(--rot-bg); color: var(--rot); }

.motiv { padding: .55rem 0; border-top: 1px solid var(--linie); }
.motiv:first-child { border-top: 0; padding-top: 0; }
.motiv .zeile { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .3rem; }
.motiv .name { font-weight: 600; overflow-wrap: break-word; min-width: 0; }
.motiv .prozent { font-weight: 600; white-space: nowrap; }
.motiv .status { font-size: .85rem; margin-top: .3rem; }
.motiv .mini { height: 10px; }
.motiv .notiz { font-size: .85rem; color: var(--leise); margin-top: .1rem; }

button { font: inherit; }
.knopf-leise { background: transparent; border: 1px solid var(--linie); color: var(--text); border-radius: 10px; padding: .35rem .75rem; cursor: pointer; }
.knopf-leise:hover { border-color: var(--leise); }

/* Anmelden / Einrichten */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-karte { width: 100%; max-width: 380px; }
.login-karte h1 { font-size: 1.35rem; margin-bottom: .25rem; }
.login-karte form { display: grid; gap: .9rem; margin-top: 1rem; }
.login-karte label { display: grid; gap: .3rem; font-weight: 550; font-size: .92rem; }
.login-karte button[type=submit] { background: var(--akzent); color: #fff; border: 0; border-radius: 10px; padding: .7rem; font-weight: 650; cursor: pointer; }
@media (prefers-color-scheme: dark) { .login-karte button[type=submit] { color: #0f1a16; } }
.login-karte button:disabled { opacity: .6; }
.meldung { margin: 0; color: var(--rot); background: var(--rot-bg); padding: .5rem .7rem; border-radius: 10px; font-size: .9rem; }
