/* ------------------------------------------------------------------- base */
:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #17203a;
  --muted: #66708a;
  --primary: #3554d1;
  --green: #2f9e44;
  --green-dark: #26833a;
  --red: #e03131;
  --red-dark: #c02c2c;
  --border: #d8deea;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.muted { color: var(--muted); }
.small-text { font-size: .88rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 1rem; cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .9rem; }
.btn.tiny { padding: 3px 8px; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ----------------------------------------------------------------- layout */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #17203a; color: #fff; padding: 12px 20px;
}
.topbar-title { font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }

main { max-width: 980px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.card h2, .card h3, .card h4 { margin-top: 0; }

.panel { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fbfcff; }
.panel h4 { margin: 0 0 8px; font-size: .95rem; }

.session .session-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.session h3 { margin: 0; font-size: 1.15rem; }
.session-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.session-body { margin-top: 14px; display: grid; gap: 14px; }

.badge.live {
  background: #fff3bf; color: #664d03; border-radius: 999px;
  padding: 2px 10px; font-size: .72rem; margin-left: 8px; vertical-align: middle;
}

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field input, .field textarea, .inline-form input, .inline-form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
.inline-form { display: grid; gap: 8px; margin-top: 10px; }
.error { color: var(--red); margin-top: 8px; min-height: 1em; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ------------------------------------------------------------------ login */
.login-page { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 430px; }
.login-card h1 { margin: 0 0 2px; }
.login-card h2 { margin: 0 0 16px; font-size: 1.02rem; color: var(--muted); font-weight: 500; }
.wide { width: 100%; }

/* ------------------------------------------------------------- join panel */
.join-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.join-link {
  background: #eef2ff; border: 1px dashed #b6c3f0; border-radius: 8px;
  padding: 7px 10px; font-size: .88rem; overflow-wrap: anywhere;
}
.join-link.disabled { text-decoration: line-through; color: #98a0b3; background: #f1f2f5; border-color: #d5d8df; }
.switch { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; user-select: none; }
.warn {
  background: #fff4e6; border: 1px solid #ffd8a8; color: #8a4b08;
  padding: 8px 10px; border-radius: 8px; margin-top: 8px; font-size: .9rem;
}

/* ------------------------------------------------------------------- vote */
.vote-progress { margin: 8px 0; font-weight: 600; }
.open-vote { display: grid; gap: 4px; }
.namelist { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip {
  background: #eef2ff; border: 1px solid #c7d2fe; color: #1e2a63;
  padding: 2px 10px; border-radius: 999px; font-size: .85rem;
}

.question-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  height: 44vh; min-height: 200px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.question-inner { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.q-title { font-size: 1.6em; font-weight: 800; line-height: 1.25; }
.q-text { font-size: 1em; white-space: pre-wrap; line-height: 1.5; margin-top: .6em; }

.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.vote-btn {
  border: none; border-radius: 16px; cursor: pointer;
  min-height: 132px; padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 1.25rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(20, 30, 60, .14);
  transition: transform .07s ease;
}
.vote-btn:active { transform: scale(.97); }
.vote-btn .symbol { font-size: 3rem; line-height: 1; font-weight: 400; }
.vote-btn.ja { background: var(--green); color: #fff; }        /* Ja   = green = +     */
.vote-btn.ja:hover { background: var(--green-dark); }
.vote-btn.nein { background: var(--red); color: #fff; }        /* Nein = red   = −     */
.vote-btn.nein:hover { background: var(--red-dark); }
.vote-btn.enth { background: #fff; color: var(--text); border: 2px solid #c9cfdd; } /* Enthaltung = white = ◯ */
.vote-btn.enth:hover { background: #f3f4f8; }
.vote-btn:disabled { opacity: .55; cursor: default; }
.vote-btn.selected { outline: 4px solid #74c0fc; }
.vote-meta { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.thanks {
  background: #ebfbee; border: 1px solid #b2f2bb; color: #1b5e20;
  padding: 12px 14px; border-radius: 10px; font-weight: 600; margin-top: 12px;
}
@media (max-width: 600px) {
  .vote-grid { grid-template-columns: 1fr; }
  .vote-btn { min-height: 84px; flex-direction: row; gap: 14px; }
  .vote-btn .symbol { font-size: 2rem; }
}

/* ---------------------------------------------------------------- results */
.result { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.result-title { font-weight: 700; margin-bottom: 4px; }
.result-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); margin-bottom: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; margin: 6px 0; }
.bar-label { font-size: .92rem; }
.bar-sym { color: var(--muted); }
.bar { background: #edf0f5; height: 22px; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: #adb5bd; }
.bar-row.ja .bar-fill { background: var(--green); }
.bar-row.nein .bar-fill { background: var(--red); }
.bar-row.enth .bar-fill { background: #adb5bd; }
.bar-num { text-align: right; font-weight: 700; }
.result-meta { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.results-list { display: grid; gap: 12px; }
.section-label {
  font-size: .9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px;
}

/* ------------------------------------------------------------------ queue */
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 12px;
}
.queue-text { flex: 1; min-width: 0; }
.queue-actions { display: flex; gap: 6px; flex-shrink: 0; }
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.info-box { background: #e7f0ff; border: 1px solid #a9c6f5; padding: 14px 16px; border-radius: 10px; }
.info-box.warn { background: #fff4e6; border-color: #ffd8a8; color: #8a4b08; }
