/* ApoSanitas CI: Blau #00aeef, Grau #4a5a63, Helvetica */
:root {
  --blau: #00aeef; --blau-dunkel: #0090c8; --grau: #4a5a63; --grau-hell: #8a969c;
  --linie: #d9dee1; --hintergrund: #f4f6f7; --weiss: #fff; --warn: #c0392b; --ok: #2e8b57;
  --schrift: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--schrift); color: var(--grau); background: var(--hintergrund); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-weight: 700; margin: 0 0 .5em; line-height: 1.2; }
a { color: var(--blau-dunkel); }
small, .dezent { color: var(--grau-hell); }
.mt { margin-top: 1rem; }
.logo-klein { height: 40px; width: auto; }
.inline { display: inline; }

.btn { display: inline-block; font: inherit; font-weight: 700; padding: .6rem 1rem; border: 2px solid var(--grau); border-radius: 8px;
  background: var(--weiss); color: var(--grau); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover:not(:disabled) { background: #eef1f3; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primaer { background: var(--blau); border-color: var(--blau); color: var(--weiss); }
.btn.primaer:hover:not(:disabled) { background: var(--blau-dunkel); border-color: var(--blau-dunkel); }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.klein { padding: .35rem .6rem; font-size: .85rem; border-width: 1.5px; }
.btn.gross { padding: 1rem 1.4rem; font-size: 1.15rem; width: 100%; margin-top: .6rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .15rem .5rem; border-radius: 999px;
  background: var(--linie); color: var(--grau); vertical-align: middle; }
.badge.live { background: var(--blau); color: var(--weiss); }
.badge.geschlossen { background: var(--grau); color: var(--weiss); }
.meldung { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.meldung.fehler { background: #fdecea; color: var(--warn); }
.meldung.ok { background: #e6f5ec; color: var(--ok); }

/* Balkendiagramm */
.balken { margin-top: 1rem; }
.balken-zeile { margin-bottom: .9rem; }
.balken-kopf { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; }
.balken-zahl { white-space: nowrap; font-variant-numeric: tabular-nums; }
.balken-spur { background: var(--linie); border-radius: 6px; height: 1.1em; overflow: hidden; }
.balken-fuellung { height: 100%; background: var(--blau); border-radius: 6px; width: 0 !important; transition: width .8s ease-out; }
.balken-fuellung.an { width: var(--w) !important; }
.balken-zeile.hoechste .balken-kopf { font-weight: 700; }
.balken-zeile.hoechste .balken-fuellung { background: var(--blau-dunkel); }
.balken-fuss { color: var(--grau-hell); font-size: .85em; margin: .5rem 0 0; }

/* ---------- Teilnehmer ---------- */
body.teilnehmer { background: var(--weiss); }
.tn-kopf { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--linie); }
.tn-kopf .logo-klein { height: 34px; }
.verbindung { font-size: .9rem; color: var(--grau-hell); }
.verbindung.verbunden { color: var(--ok); }
.verbindung.getrennt { color: #e0a800; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.tn-main { padding: 1.2rem 1rem 2rem; max-width: 560px; margin: 0 auto; }
.frage-nr { color: var(--blau); font-weight: 700; margin: 0 0 .3rem; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
h1.frage { font-size: 1.4rem; margin-bottom: 1rem; }
.hinweis { color: var(--grau-hell); margin: 0 0 .8rem; }
.optionen { display: flex; flex-direction: column; gap: .7rem; }
.option { font: inherit; font-size: 1.1rem; text-align: left; padding: 1rem 1.1rem; border: 2px solid var(--linie); border-radius: 12px;
  background: var(--weiss); color: var(--grau); cursor: pointer; min-height: 3.6rem; }
.option:active { background: #eef8fd; }
.option.gewaehlt { border-color: var(--blau); background: #e6f6fd; font-weight: 700; }
.option:disabled { opacity: .6; }
.warten, .danke { text-align: center; padding: 2rem 0 1rem; }
.warten h1 { font-size: 1.5rem; }
.haken { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--blau); color: var(--weiss);
  font-size: 2.2rem; line-height: 64px; font-weight: 700; }
.status { font-weight: 700; }

/* ---------- Beamer ---------- */
body.beamer { background: var(--weiss); overflow: hidden; height: 100vh; }
body.beamer.getrennt::after { content: "Verbindung wird neu aufgebaut …"; position: fixed; bottom: 1vh; right: 1vw; font-size: 1.6vh; color: #e0a800; }
.bm-main { height: 100vh; padding: 3vh 4vw; display: flex; flex-direction: column; }
.bm-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2vh; }
.logo-beamer { height: 9vh; width: auto; }
.bm-nr { color: var(--blau); font-weight: 700; font-size: 3vh; text-transform: uppercase; letter-spacing: .06em; }
.bm-frage { font-size: 5.2vh; line-height: 1.2; margin: 0 0 3vh; }
.bm-warten { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bm-warten .qr-block { flex-direction: column; }
.bm-warten .qr { height: 46vh; width: 46vh; }
.bm-begruessung { font-size: 3.5vh; margin-top: 3vh; }
.qr-block { display: flex; align-items: center; gap: 3vw; }
.qr { height: 32vh; width: 32vh; }
.qr-text .gross { font-size: 4vh; font-weight: 700; margin: 0 0 1vh; }
.qr-text .url { font-size: 3vh; color: var(--blau); font-weight: 700; margin: 0; word-break: break-all; }
.bm-live { flex: 1; display: grid; grid-template-columns: 1fr 1.2fr; gap: 4vw; align-items: center; }
.bm-live-links .dezent { font-size: 2.6vh; margin-top: 2vh; }
.bm-optionen { font-size: 3.6vh; line-height: 1.5; margin: 0; padding-left: 1.2em; }
.zaehler { margin-top: 4vh; display: flex; align-items: baseline; gap: 1.5vw; }
.zaehler-zahl { font-size: 12vh; font-weight: 700; color: var(--blau); line-height: 1; font-variant-numeric: tabular-nums; }
.zaehler-zahl.puls { animation: puls .4s ease-out; }
@keyframes puls { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }
.zaehler-text { font-size: 4vh; }
.bm-ergebnis { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.bm-ergebnis .balken, .bm-live-rechts .balken { font-size: 3.4vh; }
.bm-live-rechts .balken { font-size: 2.8vh; }
.bm-ergebnis .balken-spur, .bm-live-rechts .balken-spur { height: 1.2em; border-radius: .4em; }
.bm-ergebnis .balken-fuellung, .bm-live-rechts .balken-fuellung { border-radius: .4em; }
.bm-ergebnis .balken-zeile { margin-bottom: 2.2vh; }

/* ---------- Admin ---------- */
body.admin { padding-bottom: 3rem; }
.admin-nav { display: flex; gap: .2rem; align-items: center; background: var(--grau); padding: .4rem .8rem; position: sticky; top: 0; z-index: 2; }
.admin-nav a { color: var(--weiss); text-decoration: none; padding: .5rem .8rem; border-radius: 6px; font-weight: 700; }
.admin-nav a.aktiv, .admin-nav a:hover { background: rgba(255,255,255,.15); }
.admin-nav .rechts { margin-left: auto; }
.admin-main { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; padding: 1.2rem; margin-bottom: 1.2rem; }
.karte h2 { font-size: 1.15rem; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr.gewaehlt td { background: #eef8fd; }
.aktionen { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.formular { display: flex; flex-direction: column; gap: .8rem; margin-top: .8rem; }
.formular label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .9rem; }
.formular label.zeile { flex-direction: row; align-items: center; gap: .5rem; }
.formular input[type=text], .formular input:not([type]), .formular input[type=password], .formular input[type=number],
.formular select, .formular textarea { font: inherit; padding: .55rem .7rem; border: 1.5px solid var(--linie); border-radius: 8px; font-weight: 400; }
.formular fieldset { border: 1px solid var(--linie); border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.formular legend { font-weight: 700; padding: 0 .3rem; }
details summary { cursor: pointer; font-weight: 700; color: var(--blau-dunkel); }
.gefahr { display: flex; gap: .5rem; flex-wrap: wrap; }
.fragenliste { list-style: none; padding: 0; margin: 0 0 1rem; }
.fragenliste li { border-bottom: 1px solid var(--linie); padding: .7rem 0; }
.fragenliste li.aktuell { background: #eef8fd; margin: 0 -.6rem; padding: .7rem .6rem; border-radius: 8px; }
.frage-zeile { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.frage-text { flex: 1; }
.login-box { max-width: 380px; margin: 10vh auto; background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; padding: 2rem; text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; text-align: left; }
.login-box label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
.login-box input { font: inherit; padding: .6rem .7rem; border: 1.5px solid var(--linie); border-radius: 8px; }
.regie-aktuell { border: 2px solid var(--blau); }
.regie-frage { font-size: 1.2rem; }
.regie-zaehler { font-size: 1.1rem; }
.regie-zaehler strong { font-size: 2rem; color: var(--blau); }
.knopfzeile { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.knopfzeile .btn.gross { margin-top: 0; }
body.admin.getrennt .admin-nav::after { content: "Verbindung wird neu aufgebaut …"; color: #ffd76a; font-size: .85rem; margin-left: .5rem; }

@media (max-width: 640px) {
  .bm-live { grid-template-columns: 1fr; }
  .frage-zeile { flex-direction: column; }
  .formular fieldset { grid-template-columns: 1fr; }
  .knopfzeile { grid-template-columns: 1fr; }
  .admin-nav a { padding: .5rem .5rem; font-size: .9rem; }
}
