/* AIM Live: gemeinsames Stylesheet für Teilnehmerseite, Notsteuerung, Prüfseite, Datenschutz.
   Gestaltung nach Variante D (docs/DESIGN.md): gleiche Tokens wie das Cockpit, Flächen mit 1-px-Linie, ruhig, Tippflächen mindestens 48 px.
   Keine externen Ressourcen. Schriften lokal (SIL OFL, web/fonts/LIZENZ.txt): Inter für Text, Space Grotesk für Überschriften. */

@font-face { font-family: "Inter"; src: url("/fonts/Inter-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --navy: #1D4E89;
  --navy-dark: #143A68;
  --navy-ink: #0E2A4D;
  --orange: #F7931E;
  --orange-soft: #FFF3E3;
  --grey: #B4B4B4;
  --grey-border: #6E6E6E;   /* Formularränder: mind. 3:1 gegen Weiß */
  --text: #1C2430;
  --muted: #4A5361;         /* 7.4:1 auf Weiß */
  --bg: #FAFBFC;
  --card: #FFFFFF;
  --line: #D9DEE6;
  --hover-flaeche: #F1F4F9;
  --info-soft: #E6ECF4;
  --neutral-soft: #EEF1F5;
  --radius-klein: 8px;
  --radius-gross: 10px;
  --ok: #1B6E2E;
  --ok-soft: #E7F4EA;
  --warn: #7A4B00;
  --warn-soft: #FFF3D6;
  --err: #A4231B;
  --err-soft: #FCEBEA;
  --radius: 12px;
  --focus: #0B2E59;
  --font-text: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-kopf: "Space Grotesk", Inter, system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.125rem; /* 18 px */
  scrollbar-color: #9AA5B5 transparent;
  scrollbar-width: thin;
  caret-color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

::selection { background: #C9DCF2; color: var(--navy-ink); }
::placeholder { color: #5F6775; opacity: 1; } /* 5.9:1 auf Weiß */
input, textarea, button { accent-color: var(--navy); }

/* Zeichnung statt Textzeichen: Linien-Icons, Farbe folgt dem Text */
.ico { width: 1.25em; height: 1.25em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-dark); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Kopf und Rahmen ---------- */

.topbar {
  background: var(--card);
  color: var(--navy-ink);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font: 700 1.05rem/1 var(--font-kopf); color: var(--navy-ink); flex: none; }
.topbar .brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--navy); position: relative; flex: none; }
.topbar .brand i::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 2px; background: var(--orange); }
.topbar .session-title {
  font-size: 1rem;
  color: var(--muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

main {
  flex: 1;
  width: 100%;
  max-width: 592px; /* 560 px Karte plus Rand */
  margin: 0 auto;
  padding: 16px 16px 32px;
}
main.wide { max-width: 760px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

h1, h2, h3 { color: var(--navy-ink); line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
h1, h2, legend { font-family: var(--font-kopf); letter-spacing: -.01em; }
h1 { font-weight: 700; } h2 { font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 12px; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 1rem; } /* nur für Nebeninfos, nie unter 16 px */

footer.site {
  text-align: center;
  padding: 16px;
  font-size: 1rem;
  color: var(--muted);
}
footer.site a { margin: 0 8px; display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; }

/* ---------- Knöpfe ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: var(--radius-klein);
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  width: 100%;
  touch-action: manipulation;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn:active:not(:disabled):not([aria-disabled="true"]) { background: var(--navy-ink); border-color: var(--navy-ink); }
.btn.secondary:active:not(:disabled) { background: var(--info-soft); }
.btn.danger:active:not(:disabled) { background: #F6D5D3; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--neutral-soft); border-color: #C9CED6; color: #5A6270; cursor: not-allowed;
}
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--hover-flaeche); color: var(--navy-dark); }
.btn.secondary:disabled { background: #F4F5F7; color: #5A6270; }
.btn.danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: var(--err-soft); color: var(--err); }
.btn.small-btn { min-height: 48px; padding: 8px 14px; font-size: 1rem; width: auto; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-row .btn { flex: 1 1 140px; width: auto; }

/* ---------- Formulare ---------- */

label.field-label, .field-label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="text"], textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--grey-border);
  border-radius: var(--radius-klein);
  padding: 12px 14px;
  min-height: 52px;
}
textarea { min-height: 120px; resize: vertical; }
input[type="text"]:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--navy-ink); }
input[type="text"]:focus, textarea:focus { border-color: var(--navy); }
input:disabled, textarea:disabled { background: #F4F5F7; color: #4A5361; }

.code-input {
  font-size: 2rem !important;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace !important; /* Code zum Abtippen, Zeichen klar unterscheidbar */
  padding-left: .3em !important; /* Ausgleich letter-spacing */
}
.code-input::placeholder { letter-spacing: .3em; }

.hint { color: var(--muted); font-size: 1rem; margin-top: 6px; }
.counter { color: var(--muted); font-size: 1rem; text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.counter.full { color: var(--warn); font-weight: 600; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; font-size: 1.25rem; color: var(--navy-ink); margin-bottom: 14px; line-height: 1.3; }

/* ---------- Fragekarten ---------- */

.q-card { position: relative; }
.q-meta { font-size: 1rem; color: var(--muted); margin: -6px 0 12px; }
.q-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius-gross);
  background: var(--neutral-soft);
  margin-bottom: 14px;
}

.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-gross);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.option:hover { border-color: var(--navy-ink); background: var(--hover-flaeche); }
.option input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.option .mark {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 2px solid var(--grey-border);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.option .mark.radio { border-radius: 50%; }
.option .mark.check { border-radius: 6px; }
.option .label-text { flex: 1; }
.option .opt-img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-klein); flex: 0 0 auto; }
.option input:checked ~ .mark { background: var(--navy); border-color: var(--navy); }
.option .mark.check::after, .option .mark.radio::after { content: ""; display: none; }
.option input:checked ~ .mark::after { display: block; }
.option input:checked ~ .mark.check::after { width: 8px; height: 14px; margin-top: -3px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.option input:checked ~ .mark.radio::after { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.option:active { background: var(--info-soft); }
.option:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--info-soft); }
.option.is-checked { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--info-soft); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.option.disabled { cursor: default; }
.option.disabled:hover { border-color: var(--grey-border); background: #fff; }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct:hover { border-color: var(--ok); background: var(--ok-soft); }
.option.correct { box-shadow: inset 0 0 0 1px var(--ok); }
.option .tag {
  font-size: .95rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.option .tag.ok { background: var(--ok); color: #fff; }
.option .tag.mine { background: var(--navy); color: #fff; }

.word-fields { display: grid; gap: 12px; }
.word-field label { font-weight: 600; display: block; margin-bottom: 4px; }

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.scale .option {
  flex-direction: column;
  justify-content: center;
  padding: 10px 4px;
  min-height: 64px;
  font-size: 1.375rem;
  font-weight: 700;
  gap: 0;
}
.scale .option .mark { display: none; }
.scale-labels {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 1rem; color: var(--muted); margin-top: 8px;
}
.scale-labels span:last-child { text-align: right; }

/* ---------- Status und Meldungen ---------- */

.status-line {
  margin-top: 14px;
  min-height: 1.5em;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.status-line.center-row { justify-content: center; margin-top: 0; }
.status-line.ok { color: var(--ok); }
.status-line.pending { color: var(--muted); font-weight: 500; }
.status-line.error { color: var(--err); }
.status-line.closed { color: var(--muted); font-weight: 500; }

.notice {
  border-radius: var(--radius-gross);
  padding: 12px 14px;
  background: var(--hover-flaeche);
  border: 1px solid #C9D6E8;
  margin: 0 0 14px;
}
.notice.warn { background: var(--warn-soft); border-color: #EBCB8B; color: #3D2A00; }
.notice.error { background: var(--err-soft); border-color: #EBB5B1; }
.notice.ok { background: var(--ok-soft); border-color: #A9D3B1; }

.conn-banner {
  position: sticky; top: 0; z-index: 10;
  background: var(--warn-soft);
  color: #3D2A00;
  border-bottom: 1px solid #EBCB8B;
  padding: 8px 16px;
  font-size: 1rem;
  text-align: center;
}

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid #C9D3E0; border-top-color: var(--navy);
  animation: spin 1s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.waiting { text-align: center; padding: 36px 20px; }
.waiting .dots { display: inline-flex; gap: 8px; margin: 8px 0 18px; }
.waiting .dots span {
  width: 12px; height: 12px; border-radius: 50%; background: var(--orange);
  animation: pulse 1.6s ease-in-out infinite;
}
.waiting .dots span:nth-child(2) { animation-delay: .25s; }
.waiting .dots span:nth-child(3) { animation-delay: .5s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.big-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.big-icon .ico { width: 32px; height: 32px; stroke-width: 2.5; }
.big-icon.info { background: #E3ECF7; color: var(--navy); }
.big-icon.warn { background: var(--warn-soft); color: var(--warn); }
.big-icon.err { background: var(--err-soft); color: var(--err); }
.big-icon.ok { background: var(--ok-soft); color: var(--ok); }
.center { text-align: center; }

details.ask {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 8px;
}
details.ask summary {
  cursor: pointer;
  padding: 16px 20px;
  min-height: 56px;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
  display: flex; align-items: center; gap: 10px;
}
details.ask summary::-webkit-details-marker { display: none; }
details.ask summary::before {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin: 0 6px 3px 4px;
  border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg); transition: transform .15s ease-out;
}
details.ask[open] summary::before { transform: rotate(45deg); margin-bottom: 6px; }
details.ask summary:active { background: var(--hover-flaeche); border-radius: var(--radius); }
details.ask .ask-body { padding: 0 20px 20px; }

/* ---------- Notsteuerung ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-gross); margin: 0 0 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .num { font: 700 1.375rem/1.2 var(--font-kopf); color: var(--navy-ink); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: .9375rem; color: var(--muted); }

.qrow { border: 1px solid var(--line); border-radius: var(--radius-gross); padding: 14px; margin-bottom: 12px; background: #fff; }
.qrow.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--info-soft); }
.qrow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qrow-key { font-weight: 700; color: var(--navy-ink); overflow-wrap: anywhere; min-width: 0; }
.pill {
  display: inline-block; font-size: .95rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; background: #E4E7EC; color: #2A323D;
}
.pill.open { background: var(--ok); color: #fff; }
.pill.closed { background: #4A5361; color: #fff; }
.pill.revealed { background: var(--navy); color: #fff; }
.pill.flag { background: var(--err); color: #fff; }
.pill.hidden-p { background: #E4E7EC; color: #2A323D; }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.pending-p { background: var(--warn-soft); color: var(--warn); }

.items { list-style: none; padding: 0; margin: 12px 0 0; }
.items li { border-top: 1px solid var(--line); padding: 10px 0; }
.items .item-text { display: block; margin-bottom: 6px; word-break: break-word; }
.items .item-text.is-hidden { text-decoration: line-through; color: var(--muted); }
.items .item-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Prüfseite ---------- */

.traffic {
  display: flex; gap: 16px; align-items: flex-start;
}
.traffic .lamp {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.lamp.green { background: var(--ok); }
.lamp.yellow { background: var(--orange); color: #1C2430; }
.lamp.red { background: var(--err); }
.lamp .ico { width: 30px; height: 30px; stroke-width: 2.5; }
.lamp.grey { background: #66707F; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .sym { width: 1.4em; flex: 0 0 auto; display: inline-flex; justify-content: center; padding-top: .2em; }
.checklist .sym .ico { width: 1.15em; height: 1.15em; }
.checklist .sym.ok { color: var(--ok); }
.checklist .sym.warn { color: var(--warn); }
.checklist .sym.err { color: var(--err); }

details.tech { margin-top: 12px; }
details.tech summary { cursor: pointer; font-weight: 600; color: var(--navy); min-height: 48px; display: flex; align-items: center; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; font-size: 1rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ---------- Textseiten ---------- */

.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 1.3em; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.prose address { font-style: normal; margin-bottom: 12px; }

@media (min-width: 700px) {
  main { padding-top: 32px; }
  .card { padding: 28px; }
}

@media (max-width: 360px) {
  .card { padding: 16px; }
  .scale { gap: 6px; }
  .code-input { font-size: 1.6rem !important; letter-spacing: .2em; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .waiting .dots span { animation: none; }
  details.ask summary::before { transition: none; }
}

/* Nachträge */
.q-card fieldset .notice { margin-top: 14px; margin-bottom: 0; }
.btn.danger:disabled { background: #F4F5F7; border-color: #C9CED6; color: #5A6270; }
.btn-row .btn.small-btn { flex: 1 1 90px; }
@media (max-width: 480px) {
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}

/* ---------- v1.3: Hinweis „Antwort ändern“ ---------- */
.change-hint { margin: 10px 0 0; }

/* ---------- v1.3: Rangfolge (ranking) ---------- */
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rank-row { display: flex; gap: 8px; align-items: stretch; }
.rank-opt {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-gross);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.rank-opt:hover { border-color: var(--navy-ink); background: var(--hover-flaeche); }
.rank-opt .label-text { flex: 1; min-width: 0; overflow-wrap: break-word; }
.rank-opt .opt-img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-klein); flex: 0 0 auto; }
.rank-badge {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px dashed var(--grey-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.15rem; line-height: 1;
}
.rank-row.is-ranked .rank-opt { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--info-soft); }
.rank-row.is-ranked .rank-badge { border: 2px solid var(--navy); background: var(--navy); color: #fff; font-variant-numeric: tabular-nums; }
.rank-opt:disabled { cursor: default; color: var(--text); }
.rank-opt:disabled:hover { border-color: var(--grey-border); background: #fff; }
.rank-row.is-ranked .rank-opt:disabled:hover { border-color: var(--navy); background: var(--info-soft); }
.rank-moves { display: flex; gap: 6px; flex: 0 0 auto; }
.rank-move {
  appearance: none;
  width: 48px; min-height: 60px;
  border: 1px solid var(--navy);
  border-radius: var(--radius-gross);
  background: #fff; color: var(--navy);
  font: inherit; font-size: 1.1rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  cursor: pointer; touch-action: manipulation;
}
.rank-move:hover { background: var(--hover-flaeche); }
.rank-move:active:not(:disabled), .rank-opt:active:not(:disabled), .vote-btn:active, .sig-btn:active:not(:disabled) { background: var(--info-soft); }
.rank-move .ico { width: 24px; height: 24px; stroke-width: 2.5; }
.rank-move:disabled { border-color: #C9CED6; color: #5A6270; background: var(--neutral-soft); cursor: not-allowed; }
.rank-summary { margin: 12px 0 0; color: var(--navy-ink); font-weight: 600; }
.rank-tools { margin-top: 10px; }
.rank-tools .btn.small-btn { min-height: 56px; flex: 0 1 auto; }
@media (max-width: 420px) {
  /* schmal: Pfeile übereinander, damit die Option genug Breite für ihren Text behält */
  .rank-moves { flex-direction: column; gap: 6px; }
  .rank-move { width: 52px; min-height: 56px; }
  .rank-opt { padding: 10px 12px; gap: 10px; }
}

/* ---------- v1.3: Fragen aus der Gruppe (+1) ---------- */
.asks-list { margin-top: 16px; }
.asks-list h2 { font-size: 1.2rem; }
.ask-items { list-style: none; padding: 0; margin: 8px 0 0; }
.ask-item { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 10px 0; }
.ask-item:first-child { border-top: 0; }
.ask-item-body { flex: 1; min-width: 0; }
.ask-item-text { display: block; overflow-wrap: anywhere; }
.ask-item-votes { display: block; color: var(--muted); font-size: 1rem; }
.ask-item .tag {
  flex: 0 0 auto; font-size: .95rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.ask-item .tag.mine { background: var(--navy); color: #fff; }
.vote-btn {
  appearance: none; flex: 0 0 auto;
  min-width: 64px; min-height: 56px; padding: 8px 12px;
  border: 1px solid var(--navy); border-radius: var(--radius-klein);
  background: #fff; color: var(--navy);
  font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; font-variant-numeric: tabular-nums;
}
.vote-btn:hover { background: var(--hover-flaeche); }
.vote-btn.is-on { background: var(--navy); color: #fff; }
.vote-btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------- v1.3: Signal-Leiste „Wie geht's?“ ---------- */
/* Die Leiste klebt am unteren Bildschirmrand; der Inhalt bekommt genau ihre Höhe als Abstand, damit nichts verdeckt wird und keine Leerfläche entsteht. */
body.is-live { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.signal-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
}
.signal-head, .signal-btns { max-width: 560px; margin: 0 auto; }
.signal-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  font-size: 1rem; min-height: 1.5em; margin-bottom: 6px;
}
.signal-h { font-weight: 700; color: var(--navy-ink); }
.signal-status { font-weight: 600; }
.signal-status.ok { color: var(--ok); }
.signal-status.warn { color: var(--warn); }
.signal-status.error { color: var(--err); }
.signal-wait { color: var(--muted); font-variant-numeric: tabular-nums; }
/* Drei gleich breite Knöpfe in einer Reihe, unabhängig von der Länge des Textes. */
.signal-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sig-btn {
  appearance: none;
  min-height: 56px; padding: 6px 8px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--navy); border-radius: var(--radius-klein);
  background: #fff; color: var(--navy);
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  cursor: pointer; touch-action: manipulation;
}
.sig-btn:hover { background: var(--hover-flaeche); }
.sig-btn:disabled { color: #5A6270; background: var(--neutral-soft); border-color: #C9CED6; cursor: not-allowed; }
.sig-btn.is-sent:disabled { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
@media (max-width: 360px) {
  .signal-bar { padding-left: 10px; padding-right: 10px; }
  .signal-btns { gap: 6px; }
  .sig-btn { padding: 4px 2px; font-size: .9375rem; }
}


/* Teilnehmeransicht: bestätigte Antworten brauchen keine zweite Eingabekarte. */
body:has(#view-live) .q-receipt-title {
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}
body:has(#view-live) .q-receipt-status {
  color: var(--ok);
  font-weight: 700;
  margin: 0 0 6px;
}
body:has(#view-live) .q-receipt-wait { color: var(--muted); margin: 0; }

/* Nur die Teilnehmerseite: mehr Platz für Fragen, ohne kleinere Tippziele.
   Rückmeldungen stehen im Dokumentfluss. So verdecken sie auch bei geöffneter
   Bildschirmtastatur oder vergrößertem Text weder Antworten noch Fußlinks. */
@media (max-width: 600px) {
  body:has(#view-live) { font-size: 1rem; min-height: 100svh; }
  body.is-live:has(#view-live) { padding-bottom: 0; }
  body:has(#view-live) .topbar { min-height: 48px; padding: 8px 12px; gap: 8px; }
  body:has(#view-live) .topbar .session-title {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }
  body:has(#view-live) main { padding: 12px 12px 16px; }
  body:has(#view-live) .card { padding: 16px; margin-bottom: 12px; }
  body:has(#view-live) h1 { font-size: 1.375rem; }
  body:has(#view-live) legend { margin-bottom: 12px; overflow-wrap: anywhere; }
  body:has(#view-live) .q-meta { margin-bottom: 10px; }
  body:has(#view-live) .options { gap: 8px; }
  body:has(#view-live) .option { min-height: 48px; padding: 10px 12px; gap: 10px; }
  body:has(#view-live) .option .label-text { min-width: 0; overflow-wrap: anywhere; }
  body:has(#view-live) .option .opt-img { width: 48px; height: 48px; }
  body:has(#view-live) .scale .option { min-height: 52px; padding: 8px 4px; }
  body:has(#view-live) .btn-row { margin-top: 12px; }
  body:has(#view-live) .btn { min-height: 48px; padding: 10px 16px; }
  body:has(#view-live) .status-line { margin-top: 10px; }
  body:has(#view-live) .status-line:empty { display: none; }
  body:has(#view-live) input[type="text"],
  body:has(#view-live) textarea { min-height: 48px; padding: 10px 12px; }
  body:has(#view-live) textarea { min-height: 104px; }
  body:has(#view-live) .word-fields { gap: 8px; }
  body:has(#view-live) .q-image { max-height: 200px; margin-bottom: 12px; }
  body:has(#view-live) .waiting { padding: 24px 16px; }
  body:has(#view-live) .waiting .dots { margin: 0 0 12px; }
  body:has(#view-live) .waiting p:last-child { margin-bottom: 0; }
  body:has(#view-live) details.ask summary { min-height: 48px; padding: 12px 14px; }
  body:has(#view-live) details.ask .ask-body { padding: 0 14px 14px; }
  body:has(#view-live) .signal-bar {
    position: static;
    padding: 12px 0 0;
    margin-top: 16px;
    background: transparent;
  }
  body:has(#view-live) .signal-btns {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
    gap: 6px;
  }
  body:has(#view-live) .sig-btn { min-height: 48px; padding: 8px 4px; font-size: 1rem; overflow-wrap: anywhere; }
  body:has(#view-live) .signal-status { overflow-wrap: anywhere; }
  body:has(#view-live) .rank-list { gap: 8px; }
  body:has(#view-live) .rank-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  body:has(#view-live) .rank-moves { flex-direction: row; justify-content: flex-end; }
  body:has(#view-live) .rank-opt { min-height: 48px; }
  body:has(#view-live) .rank-move { min-height: 48px; width: 48px; }
  body:has(#view-live) footer.site { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
}
