:root {
  --blau: #00325b;
  --himmel: #009ee3;
  --limette: #d3d800;
  --sand: #cbcdb9;
  --sandhell: #f4f4ee;
  --himmelhell: #e5f5fc;
  --text: #3c3c3b;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--blau); color: #fff; overflow-x: hidden; }
button { font-family: inherit; cursor: pointer; border: none; }
input, textarea { font-family: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--limette); outline-offset: 2px;
}

/* ---------- Gemeinsam ---------- */
.wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.label {
  display: inline-block; background: var(--himmel); color: #fff; font-weight: 700;
  font-size: 12px; letter-spacing: 1.2px; padding: 6px 14px;
}
.titel {
  display: inline-block; background: var(--limette); color: var(--blau); font-weight: 700;
  padding: 8px 20px; font-size: clamp(22px, 3.4vw, 40px); line-height: 1.15;
}
.wortmarke { font-weight: 700; font-style: italic; color: #fff; opacity: .85; }

/* ---------- Fehlerbanner ---------- */
.fehlerbanner {
  display: none; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--sand); color: var(--blau); font-size: 13px; line-height: 1.4;
  padding: 10px 16px; position: relative; z-index: 60;
}
.fehlerbanner.zeigen { display: flex; }
.fehlerbanner button {
  background: var(--blau); color: #fff; font-weight: 700; font-size: 12px;
  padding: 8px 14px; border-radius: 2px; flex-shrink: 0;
}

/* ---------- Beamer ---------- */
#beamer { display: none; padding: 3.2vh 3.4vw 2.4vh; }
#beamer.on { display: flex; }
.kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.kopfL { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.schritte { display: flex; gap: 8px; align-items: center; }
.punkt { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.28); }
.punkt.akt { background: var(--limette); }
.buehne { flex: 1; display: flex; align-items: center; min-height: 0; padding: 2.4vh 0; }

.scan { display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; width: 100%; }
.qrkasten { background: #fff; padding: 20px; border-radius: 4px; line-height: 0; }
.qrfallback { font: 14px/1.5 Arial; color: var(--blau); max-width: 320px; word-break: break-all; padding: 12px; }
.scanfrage { font-size: clamp(30px, 4.6vw, 60px); font-weight: 700; line-height: 1.1; max-width: 16ch; }
.scanhilfe { margin-top: 26px; color: #bfd3e2; font-size: clamp(14px, 1.5vw, 19px); line-height: 1.55; max-width: 34ch; }
.kopiere { margin-top: 22px; background: var(--limette); color: var(--blau); font-weight: 700; padding: 12px 22px; font-size: 15px; }

.live { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; }
.summe { font-size: clamp(90px, 19vw, 270px); font-weight: 700; color: var(--limette); line-height: .85; letter-spacing: -.04em; transition: transform .35s ease; }
.summe.puls { transform: scale(1.06); }
.summeSub { font-size: clamp(16px, 2vw, 26px); color: #fff; margin-top: 14px; }
.nebenzahlen { display: flex; gap: 30px; margin-top: 30px; flex-wrap: wrap; }
.nz b { display: block; font-size: clamp(26px, 3.4vw, 44px); color: var(--himmel); font-weight: 700; line-height: 1; }
.nz span { font-size: 13px; color: #bfd3e2; display: block; margin-top: 6px; }

.tafel { background: rgba(255,255,255,.06); padding: 22px; max-height: 62vh; overflow: auto; }
.tafel h3, .tafelh3 { font-size: 13px; letter-spacing: 1.2px; color: var(--himmel); margin-bottom: 14px; font-weight: 700; }
.leer { color: #8fa9bd; font-size: 16px; line-height: 1.6; }

/* Rangliste "Wer wie viele Termine" */
.reihe { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: clamp(18px, 1.5vw, 19px); }
.reihe .ort { display: block; font-size: 13px; color: #8fa9bd; margin-top: 2px; font-style: normal; }
.reihe:last-child { border-bottom: none; }
.reihe b { color: var(--limette); font-weight: 700; white-space: nowrap; }

/* Skalenverteilung 1–10 */
.vert { display: flex; flex-direction: column; gap: 10px; }
.vz { display: grid; grid-template-columns: 2.5em 1fr auto; gap: 14px; align-items: center; }
.vz .note { font-size: clamp(16px, 1.7vw, 22px); font-weight: 700; color: #fff; }
.vz b { color: var(--limette); font-weight: 700; font-size: clamp(15px, 1.5vw, 20px); white-space: nowrap; }
.vzbalken { height: 14px; background: rgba(255,255,255,.14); }
.vzbalken i { display: block; height: 100%; background: var(--himmel); width: 0; transition: width .5s ease; }

/* Freitext-Stimmen */
.ende { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: start; }
.stimmen { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.stimme {
  background: rgba(255,255,255,.07); padding: 14px 18px;
  font-size: clamp(15px, 1.6vw, 21px); line-height: 1.35; white-space: pre-wrap;
}
.stimme i { display: block; font-style: normal; font-size: 13px; color: var(--himmel); margin-top: 6px; }
.csvlink { display: inline-block; margin-top: 18px; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 13px; padding: 10px 16px; text-decoration: none; }

.fuss { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; font-size: 11px; color: #7f9bb3; padding: 14px 90px 0 0; border-top: 1px solid rgba(255,255,255,.12); }
.fussbtn { background: none; color: #7f9bb3; font-size: 11px; text-decoration: underline; padding: 4px; }
.pfeile { display: flex; gap: 10px; }
.pfeil { background: rgba(255,255,255,.14); color: #fff; width: 38px; height: 38px; font-size: 17px; line-height: 1; }

[data-admin] { display: none; }
body.ist-admin [data-admin] { display: initial; }
/* inline-block, sonst greift der obere Abstand des Links nicht */
body.ist-admin a.csvlink[data-admin] { display: inline-block; }

/* ---------- Handy ---------- */
#handy { display: none; background: #fff; color: var(--text); }
#handy.on { display: flex; }
.hkopf { background: var(--blau); padding: 26px 22px 30px; }
.hsub { color: #bfd3e2; font-size: 13px; margin-top: 12px; line-height: 1.5; }
.hbody { padding: 26px 22px 40px; flex: 1; display: flex; flex-direction: column; }
.hfrage { font-size: 19px; font-weight: 700; color: var(--blau); margin-bottom: 18px; line-height: 1.3; }
.frage { margin-bottom: 34px; }

.feld {
  width: 100%; border: 2px solid var(--sand); padding: 14px 16px; font-size: 17px;
  color: var(--text); background: #fff; border-radius: 2px;
}
.feld:focus { border-color: var(--himmel); }
.feldgross { line-height: 1.45; resize: vertical; }

/* Skala */
.niveauwert { text-align: center; color: var(--himmel); font-weight: 700; line-height: 1; margin-bottom: 6px; }
.niveauwert #niveauZahl { font-size: 62px; }
.niveauvon { font-size: 24px; opacity: .7; }
.schieber { width: 100%; accent-color: var(--himmel); height: 44px; }
.schieberskala { display: flex; justify-content: space-between; font-size: 12px; color: #6d6d6c; margin-top: 2px; }

/* Zähler */
.zaehler { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.zbtn { background: var(--blau); color: #fff; width: 60px; height: 60px; font-size: 30px; font-weight: 700; border-radius: 50%; line-height: 1; flex-shrink: 0; }
.zbtn:disabled { opacity: .3; }
.zwert { flex: 1; text-align: center; font-size: 52px; font-weight: 700; color: var(--himmel); line-height: 1; }
.schnell { display: flex; gap: 8px; flex-wrap: wrap; }
.sbtn { background: var(--sandhell); color: var(--blau); font-weight: 700; padding: 11px 0; font-size: 16px; flex: 1; min-width: 42px; border-radius: 2px; }
.sbtn.akt { background: var(--limette); }

.senden { background: var(--limette); color: var(--blau); font-weight: 700; font-size: 19px; padding: 18px; width: 100%; margin-top: 10px; border-radius: 2px; }
.senden:disabled { opacity: .45; }
.hinweis { font-size: 12px; color: #6d6d6c; line-height: 1.5; margin-top: 16px; }
.hfehler { background: var(--sand); color: var(--blau); font-size: 13px; padding: 10px 14px; line-height: 1.45; margin-bottom: 16px; border-radius: 2px; }

/* Bestätigung */
.danke { text-align: center; padding: 20px 0; }
.dankezahl { font-size: 74px; font-weight: 700; color: var(--himmel); line-height: 1; }
.dankesub { font-size: 15px; color: var(--text); margin-top: 8px; }
.dankename { margin-top: 14px; font-size: 19px; color: var(--blau); font-weight: 700; }
.dankebox { background: var(--himmelhell); color: var(--blau); padding: 18px; margin-top: 24px; font-size: 15px; line-height: 1.5; }
.dankeliste { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; line-height: 1.4; }
.dankeliste dt { color: #6d6d6c; }
.dankeliste dd { color: var(--blau); font-weight: 700; margin: 0; }
.aendern { background: none; color: var(--blau); text-decoration: underline; font-size: 14px; margin-top: 20px; padding: 6px 0; }

.modus { position: fixed; right: 10px; bottom: 10px; background: rgba(0,50,91,.75); color: #fff; font-size: 11px; padding: 7px 11px; border-radius: 3px; z-index: 50; }
/* Im Handy-Modus nicht über dem Formular schweben — sonst verdeckt der
   Umschalter den Absenden-Knopf. */
body.handy-modus .modus { position: static; display: block; margin: 18px auto; }

@media (max-width: 900px) {
  .scan, .live, .ende { grid-template-columns: 1fr; gap: 24px; }
  .tafel { max-height: 38vh; }
  .stimmen { max-height: 34vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
