:root {
  --dark: #2B3A42; --card: #EDF0F1; --pink: #F6E7E4; --red: #A63A2E; --text: #1F2A30; --muted: #6B7C85; --line: #C6D4DA;
  --yes: #2C7A3F; --no: #B3392C; --abst: #7A8790; --bg: #F7F8F9; --white: #fff;
  --r: 16px; --gap: 16px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; -webkit-user-select: none; user-select: none; border: 0; }
input, select, textarea { font-size: 17px; /* >=16px verhindert Auto-Zoom in iOS-Safari */ }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0; }

/* ---------- Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; background: var(--dark); color: #fff;
  padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal)); display: flex; align-items: center; gap: 12px; }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who span { font-size: 13px; color: #C6D4DA; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,.6); }
.net { width: 10px; height: 10px; border-radius: 50%; background: #5FBF77; flex: none; }
.net.off { background: #E0A43A; }
.btn-ghost { background: transparent; color: #C6D4DA; padding: 10px 12px; min-height: 44px; border-radius: 10px; font-size: 15px; }
.btn-ghost:active { background: rgba(255,255,255,.12); }

.wrap { max-width: 980px; margin: 0 auto; padding: var(--gap) calc(16px + var(--sar)) calc(32px + var(--sab)) calc(16px + var(--sal)); }
.card { background: #fff; border-radius: var(--r); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: var(--gap); }
.card.soft { background: var(--card); box-shadow: none; }
.card.pink { background: var(--pink); box-shadow: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--card); color: var(--text); }
.pill.red { background: var(--pink); color: var(--red); }
.pill.dark { background: var(--dark); color: #fff; }

/* ---------- Knöpfe */
.btn { min-height: 52px; padding: 12px 20px; border-radius: 12px; background: var(--dark); color: #fff; font-weight: 600; font-size: 17px; }
.btn:active { transform: scale(.98); filter: brightness(1.1); }
.btn.sec { background: var(--card); color: var(--text); }
.btn.red { background: var(--red); }
.btn.sm { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }

/* ---------- Abstimmen (große Touch-Flächen) */
.vote-title { font-size: 26px; line-height: 1.2; margin: 6px 0 4px; }
.timer { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 8px; }
.timer .num { font: 700 56px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.timer.urgent .num { color: var(--red); }
.bar { height: 10px; background: var(--card); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--dark); border-radius: 99px; transition: width .25s linear; }
.timer.urgent + .bar > i { background: var(--red); }
.choices { display: grid; gap: 12px; margin-top: 20px; }
.choices.yn { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .choices.yn { grid-template-columns: 1fr; } }
.choice { min-height: 96px; border-radius: 18px; font-size: 26px; font-weight: 700; background: var(--card); color: var(--text); border: 4px solid transparent; padding: 12px; }
.choice.ja { background: #E3F1E6; color: var(--yes); }
.choice.nein { background: #F8E2DF; color: var(--no); }
.choice.enth { background: var(--card); color: #4A5860; }
.choice.sel { border-color: currentColor; box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.choice.cand { font-size: 22px; min-height: 76px; text-align: left; padding-left: 22px; }
@media (min-width: 700px) { .choice { min-height: 160px; font-size: 34px; } .choice.cand { min-height: 90px; font-size: 26px; } }
.confirm { margin-top: 18px; }
.done { text-align: center; padding: 28px 10px; }
.done .check { width: 84px; height: 84px; border-radius: 50%; background: var(--yes); color: #fff; font-size: 48px; line-height: 84px; margin: 0 auto 12px; }

/* ---------- Ergebnisse */
.res { display: grid; gap: 8px; margin-top: 10px; }
.res .r { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 15px; }
.res .r .b { height: 14px; background: var(--card); border-radius: 99px; overflow: hidden; }
.res .r .b i { display: block; height: 100%; }
.res .r .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { font-weight: 800; font-size: 20px; }
.verdict.y { color: var(--yes); } .verdict.n { color: var(--no); }

/* ---------- Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px; background: var(--card); border-radius: 14px; margin-bottom: var(--gap); }
.tabs button { flex: 1 1 auto; min-height: 46px; padding: 8px 14px; border-radius: 10px; background: transparent; font-weight: 600; white-space: nowrap; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- Formulare */
label.f { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 15px; }
input[type=text], input[type=password], select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; -webkit-appearance: none; appearance: none; }
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--dark); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 46px; padding: 8px 16px; border-radius: 12px; background: var(--card); font-weight: 600; }
.seg button.on { background: var(--dark); color: #fff; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.switch input { width: 52px; height: 32px; -webkit-appearance: none; appearance: none; background: var(--line); border-radius: 99px; position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--dark); }
.switch input:checked::after { transform: translateX(20px); }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.presets button { text-align: left; padding: 14px; border-radius: 14px; background: var(--card); min-height: 64px; }
.presets button b { display: block; }
.presets button span { font-size: 13px; color: var(--muted); }

/* ---------- Listen */
.list .it { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--card); }
.list .it:last-child { border-bottom: 0; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mem { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); min-height: 60px; text-align: left; width: 100%; }
.mem.sick { background: #fff; border: 2px dashed var(--line); color: var(--muted); }
.mem .nm { flex: 1; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl td, .tbl th { padding: 10px 6px; border-bottom: 1px solid var(--card); text-align: left; vertical-align: middle; }
.tbl th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tbl select { min-height: 44px; padding: 6px 10px; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }

/* ---------- Login */
.login { max-width: 440px; margin: 0 auto; padding: calc(48px + var(--sat)) 20px 40px; }
.login h1 { font-size: 34px; margin-bottom: 4px; }
.err { background: var(--pink); color: var(--red); padding: 12px 14px; border-radius: 12px; margin-top: 12px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); background: var(--dark); color: #fff; padding: 14px 20px; border-radius: 14px; z-index: 100; font-weight: 600; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* ---------- Beamer */
body.beamer { background: #1B262C; color: #fff; overflow: hidden; }
.bm { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: 3vh 4vw; gap: 2vh; }
.bm .hd { display: flex; justify-content: space-between; align-items: baseline; }
.bm .hd .nm { font: 700 3.2vh Georgia, serif; }
.bm .hd .st { font-size: 2.4vh; color: #9FB3BD; }
.bm .main { display: grid; grid-template-columns: 1.15fr 1fr; gap: 4vw; align-items: center; min-height: 0; }
.bm .title { font: 700 5.2vh/1.15 Georgia, serif; margin: 1vh 0 2vh; }
.bm .kick { font-size: 2.2vh; letter-spacing: .12em; text-transform: uppercase; color: #9FB3BD; font-weight: 700; }
.bm .count { font: 800 16vh/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
.bm .count.urgent { color: #FF7A6B; }
.bm .part { font-size: 3vh; color: #C6D4DA; margin-top: 1vh; }
.bm .bar { height: 1.4vh; background: rgba(255,255,255,.12); margin-top: 1.5vh; }
.bm .bar > i { background: #fff; }
.bm .verdict { font: 800 9vh/1 -apple-system, sans-serif; letter-spacing: .02em; }
.bm .verdict.y { color: #6FD38A; } .bm .verdict.n { color: #FF7A6B; }
.bm .res .r { grid-template-columns: 22vh 1fr 8vh; font-size: 3vh; gap: 1.5vh; }
.bm .res .r .b { height: 3vh; background: rgba(255,255,255,.1); }
.bm .need { font-size: 2.4vh; color: #9FB3BD; margin-top: 1.5vh; }
.bm svg { width: 100%; height: auto; max-height: 62vh; }
.bm .legend { display: flex; flex-wrap: wrap; gap: 1vh 2.2vw; font-size: 2.1vh; color: #C6D4DA; }
.bm .legend i { display: inline-block; width: 1.8vh; height: 1.8vh; border-radius: 50%; margin-right: .7vh; vertical-align: -.2vh; }

@media print { .top, .tabs, .btn { display: none !important; } }

/* ---------- Ordnungsrufe */
.calls { display: inline-flex; gap: 4px; }
.calls i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--red); display: inline-block; }
.calls i.on { background: var(--red); }
.covert { position: fixed; inset: 0; z-index: 60; background: rgba(14, 20, 24, .97); display: grid; place-items: center; padding: 20px; }
.cv-box { width: min(720px, 100%); text-align: center; color: #fff; }
.cv-box p { color: #C6D4DA; font-size: 18px; }
.bm-call { position: fixed; top: 0; left: 0; right: 0; z-index: 70; display: flex; gap: 3vw; align-items: baseline; justify-content: center; padding: 2.4vh 4vw;
  background: #A63A2E; color: #fff; font-size: 3vh; animation: callIn .4s ease-out; }
.bm-call b { font: 700 5vh Georgia, serif; } .bm-call em { font-style: normal; opacity: .85; } .bm-call span:first-child { font-weight: 800; letter-spacing: .14em; }
@keyframes callIn { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------- Fraktion: Rollen */
.roles { display: grid; gap: 10px; }
.role { background: var(--card); border-radius: 14px; padding: 12px 14px; }
.role.done { display: flex; align-items: center; gap: 12px; background: #E3F1E6; }
.role .rn { font-weight: 700; } .role.done .rn { flex: 1; } .role .rh { font-weight: 700; color: var(--yes); }
.cands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cand { min-height: 46px; padding: 8px 14px; border-radius: 12px; background: #fff; font-weight: 600; border: 2px solid transparent; display: inline-flex; align-items: center; gap: 8px; }
.cand.on { border-color: var(--dark); }
.cand .cnt { background: var(--dark); color: #fff; border-radius: 99px; min-width: 24px; height: 24px; padding: 0 7px; font-size: 13px; display: inline-grid; place-items: center; }
/* ---------- Änderungsanträge */
.fchip { display: inline-block; border-left: 5px solid; padding: 0 6px; margin-right: 2px; background: #fff; border-radius: 4px; color: var(--text); letter-spacing: 0; }
.pill.ok { background: #E3F1E6; color: var(--yes); }
.desc { background: var(--card); border-radius: 12px; padding: 12px 14px; margin: 8px 0 4px; white-space: pre-wrap; font-size: 16px; }
.bm .bdesc { font-size: 2.6vh; color: #C6D4DA; margin: -1vh 0 2vh; max-height: 16vh; overflow: hidden; }

/* ---------- Gesetzentwurf */
.bill .para { padding: 12px 0; border-top: 1px solid var(--card); }
.bill .para .ph { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 18px; }
.bill .para .pt { margin-top: 4px; white-space: pre-wrap; }
.bill .para .po { margin-top: 4px; color: var(--muted); font-size: 14px; text-decoration: line-through; }
.bill .para.del .pt { text-decoration: line-through; color: var(--muted); }
.bill .para.new { background: #F1F8F2; border-radius: 12px; padding: 12px; border-top: 0; margin: 6px 0; }
.para-edit { background: var(--card); border-radius: 14px; padding: 12px; margin-top: 10px; }

/* ---------- Tagesordnung + Rednerliste */
.strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px calc(16px + var(--sar)) 8px calc(16px + var(--sal)); background: #3B4C55; color: #fff; font-size: 15px; }
.strip.spk { background: #1B262C; }
.strip .timer { margin: 0 0 0 auto; } .strip .timer .num { font-size: 22px; color: #fff; } .strip .timer.urgent .num { color: #FF9C90; }
.spk-t { font-weight: 800; font-variant-numeric: tabular-nums; margin-left: auto; font-size: 20px; }
.spk-t.big { font-size: 40px; } .spk-t.urgent { color: #E0A43A; } .spk-t.over { color: var(--red); }
.strip .spk-t.over, .bm .spk-t.over { color: #FF7A6B; }
.spk-box { background: var(--card); border-radius: 14px; padding: 14px; margin-top: 10px; }
.it.qi { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--card); }
.it.cur { background: var(--pink); border-radius: 12px; padding: 12px; }
.agn { width: 30px; height: 30px; border-radius: 50%; background: var(--card); display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.cstep { border-left: 4px solid var(--line); padding: 8px 12px; margin-top: 10px; }
.cstep.ok { border-color: var(--yes); }
.bm .count.spk-t { margin-left: 0; font-size: 16vh; }
.bm-call.bm-zf { background: #1E4E79; }
.bm-snd { position: fixed; right: 1.5vw; bottom: 1.5vh; z-index: 80; background: rgba(255,255,255,.08); color: #C6D4DA; border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: .6vh 1.2vw; font: 600 1.6vh system-ui, sans-serif; cursor: pointer; opacity: .7; }
.bm-snd:hover { opacity: 1; }

/* Rollenkarten */
.rk-wrap { align-items: center; overflow: hidden; }
.rk { width: min(760px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; background: #FBF8F1; color: #1F2A30;
  border-radius: 16px; border-top: 12px solid #607D8B; padding: 22px 26px 26px; text-align: left; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.rk .rk-kick { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #6B7C85; }
.rk h2 { font: 700 30px Georgia, serif; margin: 4px 0 2px; }
.rk .rk-name { color: #6B7C85; margin-bottom: 8px; }
.rk h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .06em; color: #2B3A42; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid #E3DED2; }
.rk p, .rk li { font-size: 17px; line-height: 1.5; margin: 6px 0; }
.rk ul { padding-left: 22px; margin: 6px 0; }
.rk .def { background: #F0EBDD; border-radius: 10px; padding: 10px 14px; }
.rk .small { font-size: 14px; color: #55656E; }
.rk .btn[disabled] { opacity: .55; }
