/* =========================================================
   Generisches Auswertungs-Modul — gemeinsames Stylesheet
   (gleiche Designsprache wie die Graz-Auswertung)
   ========================================================= */
:root {
    --ink:#14181d; --ink-2:#3a4250; --ink-3:#6b7585;
    --line:#e6e9ee; --line-2:#d6dbe2; --bg:#fff; --bg-tint:#f6f7f9; --bg-deep:#0e1116;
    --pos:#1f9d63; --neg:#c0392b; --radius:16px;
    --shadow:0 1px 2px rgba(20,24,29,.04), 0 12px 32px -16px rgba(20,24,29,.22);
    --maxw:1040px; --serif:"Fraunces",Georgia,serif;
    --sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; font-family:var(--sans); color:var(--ink); background:var(--bg);
    -webkit-font-smoothing:antialiased; line-height:1.55; }
.wrap { max-width:var(--maxw); margin:0 auto; padding:0 24px; }
a { color:inherit; }

/* Masthead */
.masthead { position:sticky; top:0; z-index:50; background:rgba(255,255,255,.82);
    backdrop-filter:saturate(180%) blur(12px); border-bottom:1px solid var(--line); }
.masthead__row { display:flex; align-items:center; justify-content:space-between; height:58px; }
.brand { display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); }
.brand__mark { font-weight:700; font-size:12px; letter-spacing:.12em; background:var(--ink);
    color:#fff; padding:5px 8px; border-radius:6px; }
.brand__txt { font-weight:600; font-size:14px; color:var(--ink-2); }
.back { text-decoration:none; color:var(--ink-3); font-size:14px; font-weight:500; }
.back:hover { color:var(--ink); }
.mast-nav { display:flex; gap:18px; align-items:center; }
.mast-nav a { text-decoration:none; color:var(--ink-3); font-size:14px; font-weight:600; white-space:nowrap; }
.mast-nav a:hover { color:var(--ink); }
.mast-nav a.is-here { color:var(--ink); border-bottom:2px solid var(--ink); padding-bottom:2px; }

/* Hero */
.hero { padding:64px 0 52px; border-bottom:1px solid var(--line);
    background:radial-gradient(1200px 500px at 80% -10%, rgba(20,24,29,.04), transparent 60%), var(--bg); }
.hero__kicker { display:inline-flex; align-items:center; gap:9px; font-size:13px; font-weight:600;
    color:var(--ink-3); }
.hero__kicker .dot { width:8px; height:8px; border-radius:50%; }
.hero__title { font-family:var(--serif); font-weight:600; font-size:clamp(32px,5.5vw,58px);
    line-height:1.04; letter-spacing:-.02em; margin:18px 0 18px; max-width:18ch; }
.hero__lead { font-size:clamp(16px,2vw,20px); color:var(--ink-2); max-width:62ch; margin:0 0 32px; }
.hero__lead strong { color:var(--ink); font-weight:600; }
.hero__stats { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line);
    border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.stat { background:var(--bg); padding:18px 20px; }
.stat__val { font-family:var(--serif); font-weight:600; font-size:28px; line-height:1;
    display:flex; align-items:baseline; gap:7px; }
.stat__delta { font-family:var(--sans); font-size:12.5px; font-weight:600; }
.stat__delta.up { color:var(--pos); } .stat__delta.down { color:var(--neg); }
.stat__lbl { margin-top:8px; font-size:12.5px; color:var(--ink-3); font-weight:500; }
.hero__stand { margin-top:20px; font-size:13px; color:var(--ink-3); }

/* Blocks */
.block { padding:60px 0; border-bottom:1px solid var(--line); }
.block--tint { background:var(--bg-tint); }
.block__head { max-width:64ch; margin-bottom:30px; }
.eyebrow { font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase;
    margin:0 0 12px; }
.block__head h2 { font-family:var(--serif); font-weight:600; font-size:clamp(26px,4vw,36px);
    letter-spacing:-.015em; line-height:1.1; margin:0 0 12px; }
.block__sub { font-size:15.5px; color:var(--ink-2); margin:0; }

.chart-card { background:var(--bg); border:1px solid var(--line); border-radius:var(--radius);
    box-shadow:var(--shadow); padding:28px 26px; }
.block--tint .chart-card { box-shadow:0 1px 2px rgba(20,24,29,.04); }

/* Result bars — feste Spalten, damit alle Lanes gleich breit & Balken proportional sind */
.barrow { display:grid; grid-template-columns:190px 1fr 158px; align-items:center;
    gap:16px; padding:12px 0; }
.barrow + .barrow { border-top:1px solid var(--line); }
.barrow__name { font-weight:600; font-size:13.5px; line-height:1.25; }
.barrow__name .k { font-weight:700; font-size:14px; }
.barrow__lane { width:100%; min-width:0; }
.barrow__bar { height:28px; border-radius:7px; width:0; transition:width 1s cubic-bezier(.22,1,.36,1); min-width:3px; }
.barrow__meta { display:flex; flex-direction:column; align-items:flex-end; gap:1px; white-space:nowrap; }
.barrow__metb { display:flex; align-items:baseline; gap:8px; }
.barrow__pct { font-family:var(--serif); font-weight:600; font-size:18px; }
.barrow__chg { font-size:12px; font-weight:600; }
.barrow__chg.up { color:var(--pos); } .barrow__chg.down { color:var(--neg); } .barrow__chg.flat { color:var(--ink-3); }
.barrow__chg.new { color:var(--ink-3); font-style:italic; }
.barrow.win .barrow__pct { color:var(--ink); }

/* Mandate badge */
.mand { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600;
    color:var(--ink-3); }
.mand b { color:var(--ink); }

/* Swing */
.swing { display:flex; flex-direction:column; gap:2px; }
.swingrow { display:grid; grid-template-columns:150px 1fr 64px; align-items:center; gap:14px; padding:8px 0; }
.swingrow__name { font-weight:600; font-size:13px; }
.swingrow__lane { position:relative; height:30px; border-radius:8px;
    background:linear-gradient(90deg, rgba(192,57,43,.05), rgba(31,157,99,.05)); }
.swingrow__zero { position:absolute; left:50%; top:-6px; bottom:-6px; width:1.5px; background:var(--line-2); }
.swingrow__fill { position:absolute; top:6px; bottom:6px; width:0; border-radius:5px; transition:width 1s cubic-bezier(.22,1,.36,1); }
.swingrow__val { font-family:var(--serif); font-weight:600; font-size:16px; text-align:right; }
.swingrow__val.up { color:var(--pos); } .swingrow__val.down { color:var(--neg); }

/* Hemicycle */
.seats-card { text-align:center; }
.seats-card svg { max-width:580px; width:100%; height:auto; }
.seat { opacity:0; transform:translateY(6px); transition:opacity .5s ease, transform .5s ease; }
.seat.in { opacity:1; transform:none; }
.seatcore { fill:var(--ink); font-family:var(--serif); font-weight:600; }
.legend { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 18px; margin-top:24px; }
.legend__item { display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-2); }
.legend__sw { width:12px; height:12px; border-radius:4px; }
.legend__item b { color:var(--ink); font-weight:700; }

/* Head-to-head (Stichwahl) */
.h2h { display:grid; grid-template-columns:1fr 1fr; gap:0; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); }
.h2h__side { padding:30px 28px; color:#fff; position:relative; min-height:200px; display:flex; flex-direction:column; justify-content:flex-end; }
.h2h__pct { font-family:var(--serif); font-weight:600; font-size:52px; line-height:1; }
.h2h__name { font-weight:700; font-size:18px; margin-top:8px; }
.h2h__sub { font-size:13px; opacity:.85; margin-top:3px; }
.h2h__win { position:absolute; top:18px; left:28px; font-size:11px; font-weight:700; letter-spacing:.1em;
    text-transform:uppercase; background:rgba(255,255,255,.22); padding:4px 10px; border-radius:999px; }
.h2hbar { display:flex; height:14px; border-radius:7px; overflow:hidden; margin-top:18px; }

/* Table */
.table-wrap { border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.rtable { width:100%; border-collapse:collapse; font-size:14px; }
.rtable thead th { background:var(--bg-tint); text-align:right; font-weight:600; color:var(--ink-3);
    font-size:12px; letter-spacing:.03em; text-transform:uppercase; padding:13px 16px; border-bottom:1px solid var(--line); }
.rtable thead th:first-child { text-align:left; }
.rtable tbody td { padding:12px 16px; text-align:right; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums; }
.rtable tbody td:first-child { text-align:left; }
.rtable tbody tr:last-child td { border-bottom:none; }
.rtable tbody tr:hover { background:var(--bg-tint); }
.rt-party { display:inline-flex; align-items:center; gap:10px; font-weight:600; }
.rt-dot { width:11px; height:11px; border-radius:3px; flex:none; }
.rt-chg.up { color:var(--pos); font-weight:600; } .rt-chg.down { color:var(--neg); font-weight:600; } .rt-chg.flat { color:var(--ink-3); }
.rtable tbody tr.is-winner td { background:rgba(20,24,29,.03); }

/* Footer */
.foot { background:var(--bg-deep); color:#aeb6c2; padding:48px 0; }
.foot__grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; }
.foot__brand { font-family:var(--serif); font-weight:600; font-size:19px; color:#fff; margin:0 0 8px; }
.foot__note { font-size:13px; margin:0; color:#8b94a3; }
.foot__label { font-size:12px; letter-spacing:.12em; text-transform:uppercase; color:#7c8696; margin:0 0 8px; font-weight:700; }
.foot__src p { margin:0 0 6px; font-size:13px; }

/* Hochburgen */
.hochburg td { vertical-align:middle; }
.hb-cell { display:flex; flex-direction:column; gap:1px; align-items:flex-end; }
.hb-name { font-size:13px; font-weight:600; color:var(--ink); }
.hb-val { font-size:12px; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.hochburg td:first-child { text-align:left; }

/* Streudiagramm */
.scatter { max-width:660px; margin:6px auto 0; }
.scatter svg { width:100%; height:auto; display:block; }

/* Insight-Karten */
.insight-row { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.insight { background:var(--bg); border:1px solid var(--line); border-radius:14px; padding:18px 20px; box-shadow:0 1px 2px rgba(20,24,29,.04); border-top:3px solid var(--ink); }
.insight__val { font-family:var(--serif); font-weight:600; font-size:25px; line-height:1.05; letter-spacing:-.01em; margin-bottom:6px; }
.insight__lbl { font-size:13px; color:var(--ink-3); line-height:1.4; }
.insight__lbl b { color:var(--ink-2); font-weight:600; }

/* Mehrheiten */
.coalitions { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.coal { background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; box-shadow:0 1px 2px rgba(20,24,29,.04); }
.coal__top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.coal__label { font-weight:700; font-size:15px; }
.coal__badge { font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap; }
.coal__badge.ok { background:rgba(31,157,99,.12); color:var(--pos); }
.coal__badge.no { background:rgba(192,57,43,.10); color:var(--neg); }
.coal__seatbar { display:flex; height:16px; border-radius:6px; overflow:hidden; background:var(--line); margin-bottom:12px; position:relative; }
.coal__seg { height:100%; }
.coal__majline { position:absolute; top:-4px; bottom:-4px; width:2px; background:var(--ink); opacity:.55; }
.coal__foot { display:flex; align-items:baseline; gap:8px; font-size:13px; color:var(--ink-3); }
.coal__seats { font-family:var(--serif); font-weight:600; font-size:21px; color:var(--ink); }

/* Stadtsenat / Proporz */
.card-sub { font-size:13.5px; color:var(--ink-3); margin:0 0 16px; }
.senat-grid { display:grid; grid-template-columns:1.15fr 1fr; gap:16px; margin-bottom:16px; }
.senat-seats { display:flex; flex-wrap:wrap; gap:9px; justify-content:center; align-items:center; padding:22px 0 8px; }
.senat-seat { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; box-shadow:inset 0 0 0 2px rgba(255,255,255,.35); }
.bm-card { background:var(--bg-deep); color:#fff; border-radius:var(--radius); padding:26px 28px; display:flex; flex-direction:column; justify-content:center; }
.bm-kicker { font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:#9aa3ab; font-weight:700; margin:0 0 12px; }
.bm-modus { font-size:14px; color:#b9c0cb; margin:0; line-height:1.5; }
.dhondt thead th, .dhondt tbody td { text-align:center; }
.dhondt thead th:first-child, .dhondt tbody td:first-child { text-align:left; }
.dh-q { font-variant-numeric:tabular-nums; color:var(--ink-3); font-size:13px; }
.dh-q.seat { color:var(--ink); font-weight:700; background:rgba(31,157,99,.10); border-radius:6px; padding:3px 8px; }
.dh-rank { display:inline-block; font-size:10px; color:var(--pos); font-weight:700; vertical-align:super; margin-left:3px; }

/* Verwandte Wahlen */
.related { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.rel-card { display:block; text-decoration:none; color:inherit; background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:16px 18px; border-left:4px solid var(--c,#888); transition:transform .15s, box-shadow .15s; }
.rel-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.rel-card .rt { font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-3); }
.rel-card .rs { font-weight:700; font-size:15px; margin:4px 0 2px; }
.rel-card .rd { font-size:12.5px; color:var(--ink-3); }

/* Bezirks-Karte + Heatmap */
.map-card { padding:24px 24px 20px; margin-bottom:16px; }
.map-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.card-title { font-weight:700; font-size:15px; margin:0; }
.seg { display:inline-flex; background:var(--bg-tint); border:1px solid var(--line); border-radius:10px; padding:3px; }
.seg__btn { border:none; background:transparent; font:inherit; font-size:13px; font-weight:600; color:var(--ink-3); padding:7px 13px; border-radius:7px; cursor:pointer; transition:all .15s; }
.seg__btn.is-active { background:var(--bg); color:var(--ink); box-shadow:0 1px 2px rgba(20,24,29,.12); }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.chip { display:inline-flex; align-items:center; gap:7px; font:inherit; font-size:13px; font-weight:600; color:var(--ink-2); background:var(--bg); border:1.5px solid var(--line-2); border-radius:999px; padding:6px 13px 6px 10px; cursor:pointer; transition:all .14s; }
.chip:hover { border-color:var(--c,var(--ink-3)); }
.chip__dot { width:10px; height:10px; border-radius:50%; }
.chip.is-active .chip__dot { display:none; }
.map-wrap { position:relative; margin-top:12px; }
.emap { width:100%; max-width:780px; margin:0 auto; }
.emap svg { width:100%; height:auto; display:block; overflow:visible; }
.bez { stroke:#fff; stroke-width:1.2; stroke-linejoin:round; cursor:pointer; transition:opacity .15s; }
.bez:hover { opacity:.88; } .bez.dim { opacity:.28; } .bez.active { stroke:var(--ink); stroke-width:2.2; }
.bez-label { font-family:var(--sans); font-size:11px; font-weight:700; fill:#fff; text-anchor:middle; pointer-events:none; paint-order:stroke; stroke:rgba(20,24,29,.35); stroke-width:2.4px; }
.bez-sub { font-family:var(--sans); font-size:9.5px; font-weight:600; fill:rgba(255,255,255,.92); text-anchor:middle; pointer-events:none; paint-order:stroke; stroke:rgba(20,24,29,.3); stroke-width:2.2px; }
.map-tip { position:absolute; z-index:5; background:var(--bg-deep); color:#fff; border-radius:12px; padding:13px 15px; min-width:185px; box-shadow:0 12px 32px -8px rgba(0,0,0,.5); pointer-events:none; transform:translate(-50%,calc(-100% - 14px)); font-size:13px; }
.map-tip h4 { margin:0 0 3px; font-family:var(--serif); font-size:16px; font-weight:600; }
.map-tip .tip-turn { color:#9aa3ab; font-size:12px; margin:0 0 9px; }
.map-tip .tip-row { display:grid; grid-template-columns:13px 1fr auto auto; align-items:center; gap:8px; padding:2px 0; font-variant-numeric:tabular-nums; }
.map-tip .tip-row .sw { width:10px; height:10px; border-radius:3px; }
.map-tip .tip-row .nm { color:#cfd5dd; } .map-tip .tip-row .pc { font-weight:700; }
.map-tip .tip-row .dl { font-size:11px; width:44px; text-align:right; }
.map-tip .tip-row .dl.up { color:#51d68c; } .map-tip .tip-row .dl.down { color:#ff7a6b; }
.map-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 16px; margin-top:14px; }
.map-legend .li { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-2); }
.map-legend .li .sw { width:12px; height:12px; border-radius:4px; }
.map-legend .scale-grad { width:120px; height:12px; border-radius:4px; }
.map-legend .scale-lbl { font-size:12px; color:var(--ink-3); }
.heat-card { padding:24px 24px 18px; }
.heat-scroll { overflow-x:auto; margin-top:10px; }
.heat { width:100%; border-collapse:separate; border-spacing:4px; font-size:13px; min-width:620px; }
.heat th { font-size:11.5px; font-weight:700; color:var(--ink-3); text-transform:uppercase; letter-spacing:.03em; padding:7px 5px; text-align:center; cursor:pointer; user-select:none; white-space:nowrap; }
.heat th:first-child { text-align:left; cursor:default; }
.heat th.sorted { color:var(--ink); } .heat th .arrow { font-size:9px; opacity:.7; }
.heat td { text-align:center; padding:0; } .heat td:first-child { text-align:left; }
.bz-name { display:flex; flex-direction:column; gap:3px; padding:5px 8px; white-space:nowrap; }
.bz-name b { font-weight:700; font-size:13px; }
.bz-turn { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--ink-3); }
.bz-turn__bar { width:48px; height:5px; border-radius:3px; background:var(--line); overflow:hidden; }
.bz-turn__fill { height:100%; background:var(--ink-3); border-radius:3px; }
.heat-cell { border-radius:8px; padding:10px 4px; font-variant-numeric:tabular-nums; font-weight:600; color:var(--ink); }
.heat-cell.win { box-shadow:inset 0 0 0 2px rgba(20,24,29,.55); font-weight:800; }

.reveal { opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s ease; }
.reveal.in { opacity:1; transform:none; }

@media (max-width:760px) {
    .hero__stats { grid-template-columns:repeat(2,1fr); }
    .foot__grid { grid-template-columns:1fr; }
    .barrow { grid-template-columns:1fr; gap:6px; }
    .swingrow { grid-template-columns:90px 1fr 52px; gap:10px; }
    .h2h { grid-template-columns:1fr; }
    .chart-card { padding:22px 16px; }
    .insight-row { grid-template-columns:repeat(2,1fr); }
    .coalitions { grid-template-columns:1fr; }
    .senat-grid { grid-template-columns:1fr; }
    .barrow { grid-template-columns:1fr auto; gap:6px 12px; }
    .barrow__name { grid-column:1/-1; }
}
@media (prefers-reduced-motion:reduce) { *{transition:none!important;} .reveal,.seat{opacity:1;transform:none;} }
