:root {
  --bg: #0f172a; --flaeche: #1e293b; --rand: #334155;
  --text: #f1f5f9; --text2: #cbd5e1; --text3: #94a3b8;
  --akzent: #22c55e; --akzent2: #16a34a; --warn: #f59e0b; --rot: #ef4444;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f8fafc; --flaeche: #ffffff; --rand: #cbd5e1; --text: #0f172a; --text2: #334155; --text3: #64748b; color-scheme: light; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
.kopf { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.kopf h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.link { background: none; border: 0; color: var(--text3); padding: 6px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.anmeldung { padding: 24px 16px; max-width: 420px; width: 100%; margin: 0 auto; }
.anmeldung form { display: grid; gap: 10px; }
.anmeldung input { padding: 14px; border-radius: 12px; border: 1px solid var(--rand); background: var(--flaeche); font-size: 18px; }
.haupt { padding: 14px; border-radius: 12px; border: 0; background: var(--akzent2); color: #fff; font-weight: 600; font-size: 17px; cursor: pointer; }
.fehler { color: var(--rot); min-height: 1.4em; margin: 0; }
.hinweis { color: var(--text3); font-size: 12.5px; text-align: center; margin: 6px 0 0; }

.app { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: 720px; width: 100%; margin: 0 auto; }
.wahl { padding: 0 16px; display: grid; gap: 8px; }
.paar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.paar select, .zeile select { width: 100%; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--rand); background: var(--flaeche); font-size: 16px; }
.rund { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rand); background: var(--flaeche); font-size: 20px; cursor: pointer; }
.modus { display: grid; grid-template-columns: 1fr 1fr; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 3px; }
.seg { border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--text2); }
.seg.aktiv { background: var(--rand); color: var(--text); font-weight: 600; }
.klein { color: var(--text3); font-size: 13px; margin: 0; }
.optionen { font-size: 14px; color: var(--text2); }
.optionen summary { cursor: pointer; padding: 4px 0; color: var(--text3); }
.schalter, .zeile { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.zeile select { flex: 1; padding: 8px; }
.schalter input { width: 20px; height: 20px; accent-color: var(--akzent2); }

.protokoll { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; overscroll-behavior: contain; }
.leer { color: var(--text3); text-align: center; margin: auto 0; }
.eintrag { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; padding: 10px 12px; }
.eintrag .meta { display: flex; justify-content: space-between; color: var(--text3); font-size: 12px; margin-bottom: 4px; }
.eintrag .quelle { color: var(--text2); font-size: 15px; }
.eintrag .quelle .vorlaeufig { color: var(--text3); }
.eintrag .ziel { font-size: 20px; font-weight: 550; margin-top: 4px; }
.eintrag .ziel:empty::before { content: "…"; color: var(--text3); }
.eintrag.abgebrochen .ziel::after { content: " (abgebrochen)"; color: var(--warn); font-size: 13px; font-weight: 400; }
.eintrag button.nochmal { background: none; border: 0; color: var(--text3); cursor: pointer; padding: 0 2px; font-size: 13px; }
.meldung { color: var(--warn); font-size: 13px; text-align: center; }

.steuerung { padding: 6px 16px 12px; display: flex; flex-direction: column; align-items: center; border-top: 1px solid var(--rand); }
.werkzeuge { width: 100%; display: flex; justify-content: space-between; }
.knopf {
  position: relative; width: 112px; height: 112px; border-radius: 50%; border: 0; margin: 4px 0;
  background: var(--akzent2); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); touch-action: manipulation;
}
.knopf svg { width: 48px; height: 48px; fill: currentColor; position: relative; }
.knopf .ring { position: absolute; inset: -8px; border-radius: 50%; border: 4px solid var(--akzent); opacity: 0; transform: scale(1); transition: transform .08s linear, opacity .2s; }
.knopf.laeuft { background: var(--rot); }
.knopf.laeuft .ring { opacity: .7; }
.knopf.verbinde { background: var(--warn); }
.knopf.spricht { background: #2563eb; }
.status { margin: 4px 0 0; color: var(--text2); font-size: 15px; min-height: 1.4em; text-align: center; }
