/* Handy zuerst. Große Tippflächen, ruhige Farben, Warnungen dort, wo sie zählen. */

:root {
  --grund: #f8fafc;
  --flaeche: #ffffff;
  --rand: #e2e8f0;
  --text: #0f172a;
  --leise: #64748b;
  --akzent: #0284c7;
  --akzent-text: #ffffff;
  --warnung-grund: #fef3c7;
  --warnung-rand: #f59e0b;
  --warnung-text: #78350f;
  --fehler: #dc2626;
  --gut: #16a34a;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f172a;
    --flaeche: #1e293b;
    --rand: #334155;
    --text: #f1f5f9;
    --leise: #94a3b8;
    --akzent: #38bdf8;
    --akzent-text: #0f172a;
    --warnung-grund: #422006;
    --warnung-rand: #d97706;
    --warnung-text: #fde68a;
    --fehler: #f87171;
    --gut: #4ade80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--grund);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: #1e293b; color: #f1f5f9;
}
.marke { color: inherit; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.zustand { width: 10px; height: 10px; border-radius: 50%; background: var(--leise); }
.zustand.ok { background: var(--gut); }
.zustand.gestoert { background: var(--fehler); }

.inhalt {
  max-width: 640px; margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 96px);
}

h1 { font-size: 1.25rem; margin: 0 0 4px; line-height: 1.3; }
h2 { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
     color: var(--leise); margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.leise { color: var(--leise); font-size: .9rem; }

/* --- Knöpfe ------------------------------------------------------------------ */

.knopf {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 12px 18px;
  border: 1px solid var(--rand); border-radius: var(--radius);
  background: var(--flaeche); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.gross { min-height: 72px; font-size: 1.1rem; }
.knopf.gefahr { color: var(--fehler); }
.knopf.klein { min-height: 40px; width: auto; padding: 8px 14px; font-size: .9rem; }
.knopfreihe { display: grid; gap: 10px; margin-top: 12px; }
.knopfreihe.zwei { grid-template-columns: 1fr 1fr; }

.datei-eingang { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* --- Karten im Verlauf ------------------------------------------------------- */

.liste { display: grid; gap: 10px; }

.karte {
  display: block; padding: 14px 16px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
a.karte:active { transform: scale(.99); }
.karte .titel { font-weight: 600; line-height: 1.35; }
.karte .zeile { display: flex; gap: 8px; align-items: center; margin-top: 4px;
                color: var(--leise); font-size: .88rem; flex-wrap: wrap; }
.karte.fehler { border-color: var(--fehler); }
.karte.zweifel { border-left: 4px solid var(--warnung-rand); }

.marke-klein {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--grund); border: 1px solid var(--rand); font-size: .78rem;
}
.marke-klein.warn { background: var(--warnung-grund); border-color: var(--warnung-rand);
                    color: var(--warnung-text); }

.laeuft::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px;
  border: 2px solid var(--leise); border-top-color: var(--akzent); border-radius: 50%;
  animation: drehen .8s linear infinite; vertical-align: -1px;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.leer { text-align: center; color: var(--leise); padding: 32px 0; }

/* --- Prüfansicht ------------------------------------------------------------- */

.zurueck { display: inline-block; margin-bottom: 12px; color: var(--akzent);
           text-decoration: none; font-weight: 600; }

.hinweis {
  padding: 12px 14px; margin: 12px 0; border-radius: var(--radius);
  background: var(--warnung-grund); border: 1px solid var(--warnung-rand); color: var(--warnung-text);
}
.hinweis strong { display: block; margin-bottom: 4px; }
.hinweis ul { margin: 0; padding-left: 18px; }

.vorschau { margin: 12px 0; }
.vorschau img { width: 100%; border-radius: var(--radius); border: 1px solid var(--rand);
                background: var(--flaeche); }

.feld { display: grid; gap: 4px; margin-bottom: 14px; }
.feld > span { font-size: .85rem; color: var(--leise); }
.feld input, .feld select, .feld textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--rand); border-radius: 10px;
  background: var(--flaeche); color: var(--text); font: inherit;
}
.feld textarea { min-height: 110px; resize: vertical; }
.feld .zusatz { font-size: .8rem; color: var(--warnung-text); background: var(--warnung-grund);
                padding: 2px 8px; border-radius: 6px; justify-self: start; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.schalter {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
}
.schalter input { width: 22px; height: 22px; flex: none; accent-color: var(--akzent); }
.schalter.wichtig { border-color: var(--warnung-rand); }

.aufgabe {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
}
.aufgabe input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--akzent); }
.aufgabe.aus { opacity: .5; }
.aufgabe.aus .text { text-decoration: line-through; }

.fuss { margin-top: 20px; font-size: .8rem; color: var(--leise); }

/* --- Meldung ----------------------------------------------------------------- */

.meldung {
  position: fixed; left: 16px; right: 16px; z-index: 10;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  max-width: 608px; margin: 0 auto; padding: 14px 16px;
  border-radius: var(--radius); background: #0f172a; color: #f1f5f9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transform: translateY(150%); transition: transform .25s ease;
}
.meldung.sichtbar { transform: none; }
.meldung.fehler { background: var(--fehler); color: #fff; }
