/* VPS-SYNC Board: ruhig, aufgeräumt, nach dem Vorbild der Apple-Einstellungen.
   Gruppierte Listen statt Kacheln, eine Schrift (Systemschrift), Statusfarben nur mit Text. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --sep: rgba(60, 60, 67, 0.16);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-hover: rgba(118, 118, 128, 0.18);
  --accent: #0066cc;
  --accent-ink: #ffffff;
  --gut: #34c759;
  --gut-text: #1f7a35;
  --warn: #ff9500;
  --warn-text: #a35200;
  --schlecht: #ff3b30;
  --schlecht-text: #c4000f;
  --grau: #aeaeb2;
  --balken: #b8b8be;
  --neu-bg: rgba(52, 199, 89, 0.12);
  --weg-bg: rgba(255, 59, 48, 0.1);
  --fokus: rgba(0, 102, 204, 0.45);
  --radius: 12px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #98989d;
    --ink-3: #7c7c80;
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-hover: rgba(118, 118, 128, 0.32);
    --accent: #2997ff;
    --accent-ink: #000000;
    --gut: #30d158;
    --gut-text: #4cd964;
    --warn: #ff9f0a;
    --warn-text: #ffb340;
    --schlecht: #ff453a;
    --schlecht-text: #ff6961;
    --grau: #636366;
    --balken: #5a5a5f;
    --neu-bg: rgba(48, 209, 88, 0.16);
    --weg-bg: rgba(255, 69, 58, 0.16);
    --fokus: rgba(41, 151, 255, 0.55);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 6px; }

/* ---------- Kopf und Navigation ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.kopf.gescrollt { border-bottom-color: var(--sep); }

.kopf-innen {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.marke {
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  margin-right: auto;
}
.marke:hover { text-decoration: none; }

.abmelden {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  padding: 6px 2px;
  cursor: pointer;
}

.segmente {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--fill);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  order: 3;
  width: 100%;
}
.segmente::-webkit-scrollbar { display: none; }

.segmente a,
.segmente button {
  flex: 1 0 auto;
  text-align: center;
  padding: 6px 14px;
  border-radius: 7px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.segmente a:hover { text-decoration: none; background: var(--fill-hover); }
.segmente [aria-current="page"],
.segmente [aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 480px) {
  .kopf .segmente { gap: 0; }
  .kopf .segmente a { flex: 1 1 auto; padding: 6px 4px; font-size: 13px; letter-spacing: -0.01em; }
}

@media (min-width: 720px) {
  .kopf-innen { flex-wrap: nowrap; padding-top: 14px; }
  .kopf .segmente { order: 0; width: auto; }
}

/* ---------- Seite ---------- */

.seite {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 64px;
}

.lage { padding: 28px 0 8px; }

.gross {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0;
}
@media (min-width: 720px) {
  .gross { font-size: 44px; letter-spacing: -0.028em; }
}

.unter {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 60ch;
}

.liste-offen {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.liste-offen li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 3px 0;
}

/* ---------- Gruppierte Listen ---------- */

.abschnitt { margin-top: 36px; }

.abschnitt-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}
.abschnitt-kopf h2 {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0;
}
.abschnitt-kopf .neben { min-width: 0; font-size: 15px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abschnitt-kopf .neben a { color: var(--ink-2); }

.gruppe-titel {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 24px 4px 8px;
}

.gruppe {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.zeile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
  min-height: 52px;
  padding: 11px 16px;
  color: var(--ink);
}
a.zeile:hover { text-decoration: none; background: var(--fill); }
/* Trennlinie zwischen Zeilen, eingerückt bis zum Text (wie in den iOS-Einstellungen) */
.gruppe > .zeile:not(:first-child)::before,
.gruppe > .aufklapp:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 38px;
  right: 0;
  border-top: 1px solid var(--sep);
}
.gruppe > .ohne-punkt:not(:first-child)::before { left: 16px; }
.zeile.ohne-punkt { grid-template-columns: 1fr auto; }
.aufklapp { position: relative; }
.unterliste { border-top: 1px solid var(--sep); margin-left: 38px; }
.unterliste > .aufklapp:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 38px;
  right: 0;
  border-top: 1px solid var(--sep);
}
.unterliste .zeile { padding-left: 0; }
.unterliste .aufklapp-inhalt { padding-left: 22px; }

.zeile-text { min-width: 0; }
.zeile-titel { font-size: 16px; }
.zeile-sub { font-size: 14px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }
.zeile-wert { font-size: 15px; color: var(--ink-2); text-align: right; }
.zeile .pfeil { color: var(--ink-3); width: 8px; height: 13px; flex: none; }
.zeile-rechts { display: flex; align-items: center; gap: 10px; }

.punkt {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grau);
  flex: none;
}
.punkt.gruen { background: var(--gut); }
.punkt.gelb { background: var(--warn); }
.punkt.rot { background: var(--schlecht); }

.text-rot { color: var(--schlecht-text); }
.text-gelb { color: var(--warn-text); }
.text-gruen { color: var(--gut-text); }

.leer {
  padding: 18px 16px;
  color: var(--ink-2);
  font-size: 15px;
}

/* Aufklappbare Zeilen (details) */
.aufklapp > summary {
  list-style: none;
  cursor: pointer;
}
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary:hover { background: var(--fill); }
.aufklapp > summary .pfeil { transition: transform 0.2s ease; }
.aufklapp[open] > summary .pfeil { transform: rotate(90deg); }

.aufklapp-inhalt {
  padding: 4px 16px 18px 38px;
  font-size: 15px;
}

/* ---------- Verlauf der Erreichbarkeit ---------- */

.puls {
  padding: 0 16px 14px 38px;
}
.puls svg { display: block; width: 100%; height: 36px; overflow: visible; }
.puls .balken { fill: var(--balken); }
.puls .balken.aus { fill: var(--schlecht); }
.puls .balken:hover { fill: var(--ink-2); }
.puls .balken.aus:hover { fill: var(--schlecht-text); }
.puls-achse {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ---------- Kennzahlen ---------- */

.zahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--sep);
}
.zahl {
  background: var(--surface);
  padding: 14px 16px;
}
.zahl-wert { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.zahl-name { font-size: 14px; color: var(--ink-2); }

/* ---------- Vergleich der Rechtstexte ---------- */

.diff {
  margin: 10px 0 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sep);
  font-size: 14px;
  line-height: 1.5;
}
.diff div { padding: 4px 10px 4px 28px; position: relative; overflow-wrap: anywhere; }
.diff div::before { position: absolute; left: 10px; color: var(--ink-3); }
.diff .neu { background: var(--neu-bg); }
.diff .neu::before { content: "+"; }
.diff .weg { background: var(--weg-bg); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.diff .weg::before { content: "−"; }
.diff .gleich { color: var(--ink-2); }
.diff .luecke { color: var(--ink-3); padding-left: 28px; }
.diff .luecke::before { content: "…"; }

.befunde { margin: 0; padding: 0; list-style: none; }
.befunde li { padding: 2px 0; }

.verlauf { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.verlauf li { padding: 2px 0; }

.volltext {
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--ink-2);
  border: 1px solid var(--sep);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ---------- Knöpfe und Formulare ---------- */

.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

.knopf {
  appearance: none;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 9px 18px;
  min-height: 40px;
  cursor: pointer;
}
.knopf:hover { filter: brightness(1.08); }
.knopf:disabled { opacity: 0.45; cursor: default; filter: none; }
.knopf.leise { background: var(--fill); color: var(--accent); }
.knopf.leise:hover { background: var(--fill-hover); filter: none; }
.knopf.warnend { background: var(--fill); color: var(--schlecht-text); }

.meldung { font-size: 14px; color: var(--ink-2); }
.meldung.fehler { color: var(--schlecht-text); }

.feld { display: grid; gap: 6px; margin-top: 14px; }
.feld label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.feld input {
  font: inherit;
  font-size: 17px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--sep);
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  width: 100%;
}
.feld input:focus-visible { outline: 3px solid var(--fokus); outline-offset: 0; border-color: var(--accent); }
.feld .hilfe { font-size: 13px; color: var(--ink-3); }

.hinweis-text { font-size: 14px; color: var(--ink-2); margin: 10px 4px 0; max-width: 64ch; }

.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { text-align: left; padding: 9px 16px; border-top: 1px solid var(--sep); vertical-align: top; }
.tabelle thead th { border-top: 0; font-weight: 500; color: var(--ink-2); }
.tabelle .zahlspalte { text-align: right; }
.tabelle-huelle { overflow-x: auto; }

/* ---------- Anmeldung ---------- */

.anmeldung {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.anmeldung-box { width: 100%; max-width: 380px; }
.anmeldung-box .gross { text-align: center; }
.anmeldung-box .unter { text-align: center; margin: 8px auto 24px; }
.anmeldung-box .gruppe { padding: 4px 16px 18px; }
.anmeldung-box .knopf { width: 100%; margin-top: 20px; min-height: 46px; font-size: 17px; }
.anmeldung-fehler { color: var(--schlecht-text); font-size: 15px; text-align: center; min-height: 22px; margin: 0 0 12px; }

.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
