
:root {
  --fenster: #F2F9F8;
  --papier: #FFFFFF;
  --liste: #F8FCFB;
  --label: #10201E;
  --label-2: #47625E;
  --label-3: rgba(16, 32, 30, 0.35);
  --trenner: rgba(16, 32, 30, 0.12);
  --f1: rgba(10, 117, 111, 0.06);
  --f2: rgba(10, 117, 111, 0.10);
  --f3: rgba(10, 117, 111, 0.16);
  --akzent: #0A756F;
  --akzent-h: #086660;
  --akzent-p: #075A55;
  --rot: #B3261E;
  --gelb-s: #A87B00;
  --schrift: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r-papier: 12px;
  --r-zeile: 10px;
  --r-knopf: 20px;
  --r-iphone-knopf: 25px;
  --sh-papier: 0 1px 2px rgba(16, 32, 30, 0.06), 0 1px 3px rgba(16, 32, 30, 0.04);
  --sh-haupt: 0 1px 2px rgba(10, 117, 111, 0.24);
  --dauer-kurz: 120ms;
  --dauer-puls: 1400ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  background: var(--fenster);
  color: var(--label);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Knöpfe: genau ein grüner Stil, sonst weiß mit feinem Rahmen */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-knopf);
  font-size: 15px; font-weight: 600; line-height: 22px; white-space: nowrap;
  cursor: pointer; border: 1px solid var(--trenner); background: var(--papier); color: var(--label);
  transition: background var(--dauer-kurz) ease;
}
.knopf:hover:not(:disabled) { background: var(--f1); }
.knopf:disabled { cursor: not-allowed; color: var(--label-3); background: var(--liste); }
.knopf-gruen { background: var(--akzent); border-color: var(--akzent); color: var(--papier); box-shadow: var(--sh-haupt); }
.knopf-gruen:hover:not(:disabled) { background: var(--akzent-h); }
.knopf-gruen:active:not(:disabled) { background: var(--akzent-p); }
.knopf-gruen:disabled { background: var(--f3); border-color: transparent; color: var(--papier); box-shadow: none; }
.knopf-leise { border-color: transparent; background: transparent; }

/* Anmeldung */
.login-flaeche { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-karte {
  width: 100%; max-width: 380px; background: var(--papier); border-radius: var(--r-papier);
  box-shadow: var(--sh-papier); padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.login-karte h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; }
.login-karte label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 600; }
.feld {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-zeile);
  border: 1px solid var(--trenner); background: var(--papier); font-size: 15px;
}
.feld::placeholder { color: var(--label-3); }
.feld:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--f2); }
.login-karte .knopf { width: 100%; }
.meldung-rot { margin: 0; color: var(--rot); font-weight: 600; }
.meldung-gelb { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.meldung-gelb::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gelb-s); transform: translateY(-1px); }

/* Rahmen der Haupt-Oberfläche: feste Höhe, nur die Listen scrollen */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.kopf {
  background: var(--papier); border-bottom: 1px solid var(--trenner);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 0 24px; min-height: 56px;
}
.kopf-links { display: flex; align-items: center; gap: 24px; min-width: 0; flex-wrap: wrap; }
.kopf-titel { margin: 0; font-size: 17px; line-height: 22px; font-weight: 700; white-space: nowrap; }
.tabs { display: flex; gap: 8px; }
.tab {
  height: 56px; padding: 0 12px; border: 0; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent;
}
.tab:hover { background: var(--f1); }
.tab[aria-selected="true"] { border-bottom-color: var(--akzent); color: var(--akzent); font-weight: 600; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; }
.kopf-link { font-weight: 600; white-space: nowrap; }

.leiste {
  background: var(--papier); border-bottom: 1px solid var(--trenner);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 12px 24px;
}
.ziel-bereich { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.schild {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px;
  border-radius: var(--r-zeile); background: var(--f1); font-weight: 600; flex-wrap: wrap;
}
.schild .punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); flex: none; }
.schild .zusatz { font-weight: 500; }
.umschalter { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-knopf); background: var(--liste); border: 1px solid var(--trenner); flex-wrap: wrap; }
.umschalter button {
  height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: transparent;
  cursor: pointer; font-weight: 500; white-space: nowrap;
}
.umschalter button[aria-pressed="true"] { background: var(--papier); color: var(--akzent); font-weight: 600; box-shadow: var(--sh-papier); }
.live-rahmen { border: 1px solid var(--akzent); border-radius: var(--r-zeile); padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.live-rahmen .zeile { font-weight: 500; }
.schnell { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hauptbereich */
.haupt { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: 16px; padding: 16px 24px; }
.spalte { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.spalten-umschalter { display: none; }
.suche { position: relative; }
.suche .feld { padding-left: 12px; }
.katalog-liste { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 16px; padding-bottom: 16px; }
.gruppe { display: flex; flex-direction: column; gap: 8px; }
.gruppe h2 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fall {
  display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; min-width: 0;
  padding: 12px; border-radius: var(--r-zeile); border: 1px solid var(--trenner);
  background: var(--papier); cursor: pointer; transition: background var(--dauer-kurz) ease;
}
.fall:hover:not(:disabled) { background: var(--f1); }
.fall:active:not(:disabled) { background: var(--f2); }
.fall:disabled { cursor: not-allowed; background: var(--liste); }
.fall:disabled .fall-titel { color: var(--label-3); }
.fall.notfall { border-left: 4px solid var(--rot); }
.fall-oben { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.fall-titel { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.fall-unten { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 18px; }
.fall-knopf { font-weight: 500; overflow-wrap: anywhere; }
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 12px;
  font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; background: var(--f1); color: var(--label);
}
.chip-rot { background: transparent; color: var(--rot); border: 1px solid var(--rot); }
.chip-haken { background: var(--f2); color: var(--akzent); }
.chip-aus { background: var(--liste); color: var(--label-2); }
.leer { margin: 0; padding: 24px 12px; text-align: center; }

/* Live-Aktivität */
.aktiv { background: var(--liste); border-radius: var(--r-papier); border: 1px solid var(--trenner); min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.aktiv-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--trenner); background: var(--papier); }
.aktiv-kopf h2 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.aktiv-meta { display: flex; gap: 12px; align-items: center; font-size: 13px; line-height: 18px; color: var(--label-2); }
.verbindung { display: inline-flex; align-items: center; gap: 8px; }
.verbindung::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--label-3); }
.verbindung[data-zustand="ok"]::before { background: var(--akzent); }
.verbindung[data-zustand="fehler"]::before { background: var(--rot); }
.lauf-liste { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.lauf { background: var(--papier); border-radius: var(--r-zeile); box-shadow: var(--sh-papier); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lauf.fehler { border-left: 4px solid var(--rot); }
.lauf.konfig { border-left: 4px solid var(--gelb-s); }
.lauf-kopf { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; min-width: 0; }
.lauf-titel { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.lauf-zeit { flex: none; font-size: 13px; line-height: 18px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.lauf-ziel { font-size: 13px; line-height: 18px; color: var(--label-2); }
.lauf-schritt { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.lauf-schritt.ok { color: var(--akzent); }
.lauf-schritt.rot { color: var(--rot); }
.lauf-text { overflow-wrap: anywhere; }
.lauf-link { font-weight: 600; }
.puls { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); flex: none; animation: puls var(--dauer-puls) ease-in-out infinite; }
@keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .puls { animation: none; }
  * { transition: none !important; }
}

/* Laptop schmaler, iPad */
@media (max-width: 1100px) {
  .raster { grid-template-columns: minmax(0, 1fr); }
}

/* iPhone: einspaltig, Umschalter Fälle · Live-Aktivität, Knöpfe 50 px */
@media (max-width: 760px) {
  .kopf { padding: 8px 16px; gap: 8px; }
  .kopf-links { gap: 8px; width: 100%; justify-content: space-between; }
  .tabs { width: 100%; gap: 0; }
  .tab { flex: 1; height: 44px; padding: 0 8px; }
  .kopf-rechts { width: 100%; justify-content: space-between; }
  .leiste { padding: 12px 16px; }
  .ziel-bereich, .schnell { width: 100%; }
  .schnell .knopf { flex: 1; }
  .knopf { height: 50px; border-radius: var(--r-iphone-knopf); }
  .kopf .knopf { height: 40px; border-radius: var(--r-knopf); }
  .haupt { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; gap: 12px; grid-template-rows: auto minmax(0, 1fr); }
  .spalten-umschalter { display: flex; }
  .aktiv-kopf h2 { display: none; }
  .spalten-umschalter button { flex: 1; }
  .haupt[data-ansicht="faelle"] .spalte-aktiv { display: none; }
  .haupt[data-ansicht="aktiv"] .spalte-katalog { display: none; }
  .fall { padding: 12px; }
  .feld { height: 50px; }
}
