/* ---------- Design-Tokens ---------- */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #121417;
  --text-2: #4a5160;
  --muted: #646b78;
  --border: #e3e6ea;
  --nav: #0b0f17;
  --nav-text: #e9ecf1;
  --accent: #cc0000;
  --focus: #2457d6;
  --pos: #1b7f3b;
  --neg: #c62828;
  --empty: #e9ebee;
  /* Warnung (Hinweis-Boxen, Status „nicht bestätigt“) und gefüllter Gefahren-Knopf: in beiden Schemata gleich */
  --warn: #e0a100;
  --danger: #c62828;
  --map-stroke: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: light dark;
}
:root[data-theme='light'] {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1016;
    --surface: #161a22;
    --surface-2: #1c212b;
    --text: #eef0f4;
    --text-2: #b9c0cc;
    --muted: #8790a0;
    --border: #262c38;
    --empty: #262c37;
    --map-stroke: #0d1016;
    --pos: #4cc27a;
    --neg: #ff6b6b;
    --focus: #7aa2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme='dark'] {
  --bg: #0d1016;
  --surface: #161a22;
  --surface-2: #1c212b;
  --text: #eef0f4;
  --text-2: #b9c0cc;
  --muted: #8790a0;
  --border: #262c38;
  --empty: #262c37;
  --map-stroke: #0d1016;
  --pos: #4cc27a;
  --neg: #ff6b6b;
  --focus: #7aa2ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}
::selection {
  background: color-mix(in srgb, var(--focus) 28%, transparent);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 56px;
  background: var(--nav);
  color: var(--nav-text);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
}
/* Zeichen (public/js/site.js): SVG in Signal-Rot, Name in exakter Schreibweise „ElectionDeck“ */
.brand-mark {
  display: flex;
  flex: none;
}
.brand-mark svg {
  display: block;
}
.tabs {
  display: flex;
  gap: 2px;
  height: 100%;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.tabs a {
  display: flex;
  align-items: center;
  text-decoration: none;
  border: 0;
  background: none;
  color: #c3cad6;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}
.tabs a:hover {
  color: #fff;
}
/* aktive Seite: weiß, fett, roter Balken und leicht hinterlegt (nicht nur über die Farbe erkennbar) */
.tabs a[aria-current='page'] {
  color: #fff;
  font-weight: 800;
  border-bottom-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}
.tabs .live-dot {
  margin-left: 6px;
}
.nav-select {
  background: #1b2230;
  color: var(--nav-text);
  border: 1px solid #2b3445;
  border-radius: 8px;
  padding: 6px 10px;
}

/* ---------- Seite ---------- */
.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}
.page-head .page-title {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
}
.page-head .sub {
  color: var(--text-2);
  margin-top: 4px;
  font-size: 0.92rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* Footer in Spalten (Produkt, Daten & Methodik, Rechtliches, Kontakt), darunter die Quellen der Seite mit Lizenzvermerk */
.footer {
  color: var(--text-2);
  font-size: 0.875rem;
  padding: 24px 20px 28px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 32px;
  max-width: 1100px;
  margin: 0 auto 16px;
}
.footer-cols h2 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-cols .link {
  font-size: inherit;
  color: inherit;
  text-decoration: underline;
}
/* Klickfläche mindestens 24 px hoch (WCAG 2.5.8), unabhängig von der Schrift des Systems */
.footer-cols a,
.footer-cols .link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
@media (max-width: 720px) {
  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad {
  padding: 16px 18px;
}
.card-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.grid-main {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
@media (max-width: 1020px) {
  .grid-main {
    /* minmax(0, …): waagerecht scrollende Bedienleiste darf die Spalte nicht verbreitern */
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Bedienelemente ---------- */
.select,
.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.9rem;
  min-height: 36px;
}
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}
.segmented button {
  border: 0;
  background: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.btn:hover {
  background: var(--surface-2);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.small {
  padding: 4px 9px;
  font-size: 0.875rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.link {
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.pill.live {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.error {
  color: var(--neg);
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}

/* ---------- Sitzverteilung ---------- */
.seats-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.seats-head h2 {
  font-size: 1rem;
  font-weight: 800;
}
.seat-bar {
  position: relative;
  display: flex;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0 6px;
  background: var(--empty);
}
.seat-bar > div {
  height: 100%;
  transition:
    flex-grow 0.5s,
    opacity 0.2s;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.875rem;
  min-width: 0;
  overflow: hidden;
}
.seat-bar > div.dim {
  opacity: 0.22;
}
.majority-line {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: var(--text);
  left: 50%;
}
.majority-label {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-2);
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-size: 0.875rem;
}
.chip .sw {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.chip b {
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed='true'] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}
.coalition {
  margin-top: 10px;
  font-size: 0.9rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 28px;
}
.coalition strong {
  font-size: 1.05rem;
}
.coalition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
  min-width: 0;
}
.coalition-list button {
  font-size: 0.875rem;
  white-space: normal;
  text-align: left;
  max-width: 100%;
}

/* ---------- Karte ---------- */
.map-card {
  position: relative;
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}
.crumbs button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--focus);
  font-weight: 700;
}
.crumbs span.sep {
  color: var(--muted);
}
.map-wrap {
  position: relative;
}
.map-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 72vh;
}
.map-svg path {
  vector-effect: non-scaling-stroke;
  stroke: var(--map-stroke);
  stroke-width: 0.8;
  cursor: pointer;
  transition:
    fill 0.35s,
    opacity 0.35s;
}
.map-svg path.state.zoomed-out {
  stroke-width: 1.2;
}
/* Klickflächen kleiner Gebiete: unsichtbar, unter den Gebieten (geoMap.updateHitAreas) */
.map-svg .hit-area {
  fill: transparent;
  stroke: none;
  pointer-events: all;
  cursor: pointer;
}
/* Kästchen kleiner Gebiete am Kartenrand (Ceuta, Melilla) */
.map-svg .callout {
  cursor: pointer;
}
.map-svg .callout-frame {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-width: 1;
}
.map-svg .callout-shape {
  stroke: var(--text);
  stroke-width: 0.6;
}
.map-svg .callout.nodata .callout-shape {
  fill: var(--empty);
}
.map-svg .callout-label {
  font-size: 13px;
  font-weight: 700;
  fill: var(--text);
  pointer-events: none;
}
.map-svg .callout:hover .callout-frame,
.map-svg .callout:focus-visible .callout-frame,
.map-svg .callout.selected .callout-frame {
  stroke: var(--text);
  stroke-width: 2.4;
}
.map-svg .callout:focus {
  outline: none;
}
.map-svg .inset-frame {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.map-svg path.state.faded {
  opacity: 0.28;
}
.map-svg path.state.hidden {
  opacity: 0;
  pointer-events: none;
}
.map-svg path.unit {
  stroke-width: 0.6;
}
.map-svg path.unit.faded {
  opacity: 0.28;
}
.map-svg path.unit.hidden {
  opacity: 0;
  pointer-events: none;
}
.map-svg path.municipality {
  stroke-width: 0.4;
}
.map-svg path.nodata,
/* noch nicht oder nicht geladen (z. B. Fehler beim Laden): neutrale Fläche statt Schwarz */
.map-svg path.state:not([fill]),
.map-svg path.unit:not([fill]) {
  fill: var(--empty);
}
.map-svg path:hover {
  stroke: var(--text);
  stroke-width: 1.6;
}
.map-svg path.selected {
  stroke: var(--text);
  stroke-width: 2.4;
}
.map-svg .labels text {
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
  fill: var(--text);
}
.map-svg .labels text.small {
  font-size: 9px;
}
.map-hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 0.875rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  padding: 4px 8px;
  border-radius: 6px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 14px 14px;
  font-size: 0.875rem;
  color: var(--text-2);
  border-top: 1px solid var(--border);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--border);
}
.legend .gradient {
  width: 160px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  min-width: 210px;
  max-width: 280px;
}
.tooltip h4 {
  margin: 0 0 2px;
  font-size: 0.92rem;
}
.tooltip .t-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 6px;
}
.tooltip .t-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
}
.tooltip .t-row i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.tooltip .t-row b {
  font-variant-numeric: tabular-nums;
}
/* Infokarte auf Touch-Geräten (geoMap.setupInfoCard): Inhalt wie der Tooltip, fest in der Karte (unten, sonst oben) */
.tooltip.map-infocard {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  pointer-events: auto;
  min-width: 0;
  max-width: 420px;
  max-height: 55%;
  /* Inhalt scrollt, der Knopf „Hineinzoomen und Details“ bleibt immer sichtbar */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 10px 10px;
  font-size: 0.8125rem;
}
.map-infocard-body {
  overflow: auto;
  min-height: 0;
}
.map-infocard .t-row {
  padding: 0;
}
.map-infocard .chips {
  margin-top: 6px;
  gap: 4px;
}
.map-infocard .chip {
  padding: 2px 8px;
  font-size: 0.8125rem;
}
/* unten getippt: Karte oben, neben den Zoom-Knöpfen */
.tooltip.map-infocard.at-top {
  top: 8px;
  bottom: auto;
  right: 54px;
}
.map-infocard[hidden] {
  display: none;
}
.map-infocard h4 {
  padding-right: 40px;
}
.map-infocard-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.map-infocard-zoom {
  flex: none;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  margin-top: 8px;
}

/* ---------- Ergebnisliste ---------- */
.detail-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
}
.detail-head .sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 2px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); /* Platz für „Wahrscheinlich“ */
  gap: 8px;
  margin: 12px 0;
}
.stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
}
.stat .k {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.stat .v {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.callout {
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.875rem;
  margin: 10px 0;
  /* Hinweis-Box nach DESIGN.md: getönte Fläche mit vollem Rahmen, kein Seitenbalken */
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.callout.ok {
  background: color-mix(in srgb, var(--pos) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--pos) 45%, var(--border));
}
.callout.warn {
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.results {
  display: flex;
  flex-direction: column;
}
.result-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.result-row:last-child {
  border-bottom: 0;
}
.result-row .sw {
  grid-row: span 3;
  align-self: stretch;
  border-radius: 2px;
}
.result-row .name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-row .check {
  color: #fff;
  background: var(--pos);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  font-size: 0.875rem;
}
.result-row .pct {
  font-weight: 800;
  font-size: 1.05rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.result-row .meta {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.result-row .meta.right {
  text-align: right;
}
.result-row .bar {
  grid-column: 2 / 4;
  height: 6px;
  background: var(--empty);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.result-row .bar > div {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
}
.result-row.leader .name {
  font-size: 1.02rem;
}
.more {
  margin-top: 8px;
}

/* ---------- Listen ---------- */
.race {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.race:last-child {
  border-bottom: 0;
}
.race:hover .race-name {
  text-decoration: underline;
}
.race-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.race-sub {
  font-size: 0.875rem;
  color: var(--muted);
}
.race-margin {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.9rem;
}
.tag {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 4px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
table.data th,
table.data td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
table.data th {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface);
  position: sticky;
  top: 0;
  /* über den Zellen darunter: Zellen mit Screenreader-Text sind positioniert (position: relative) und lägen sonst
     beim Scrollen über der Kopfzeile (Trendpfeile über den Parteinamen) */
  z-index: 2;
}
table.data th:first-child,
table.data td:first-child,
table.data .left {
  text-align: left;
}
table.data td.lead {
  font-weight: 800;
}
table.data tr.clickable {
  cursor: pointer;
}
table.data tr.clickable:hover td {
  background: var(--surface-2);
}
.table-wrap {
  overflow: auto;
  max-height: 520px;
}

/* ---------- Umfragen ---------- */
.bars .bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px 52px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 0.9rem;
}
.bars .track {
  height: 18px;
  background: var(--empty);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.bars .fill {
  height: 100%;
  border-radius: 4px;
}
.bars .marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text);
  opacity: 0.6;
}
.bars .val {
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bars .delta {
  font-size: 0.875rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.trend-svg text {
  font-size: 11px;
  fill: var(--muted);
}
.trend-svg .grid line {
  stroke: var(--border);
}
.trend-svg .domain {
  display: none;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 1020px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Wahlnacht ---------- */
/* Wahlnacht vor der Sperrfrist: Countdown bis zur Freigabe der Zahlen */
.live-countdown {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.live-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 12px 16px;
}
.progress {
  flex: 1;
  min-width: 180px;
  height: 10px;
  background: var(--empty);
  border-radius: 5px;
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--accent);
  transition: width 0.6s;
}

/* ---------- Dialog ---------- */
.dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  width: min(560px, 94vw);
  padding: 20px;
}
.dialog::backdrop {
  background: rgba(5, 8, 15, 0.55);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.form-grid label,
.party-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--text-2);
  font-weight: 600;
}
.party-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
@media (max-width: 560px) {
  .party-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.skeleton {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
@media (max-width: 640px) {
  .page {
    padding: 12px;
  }
  .nav {
    gap: 12px;
    padding: 0 12px;
  }
  .brand span:not(.brand-mark, .beta-badge) {
    display: none;
  }
  /* „Beta“ bleibt auch ohne Schriftzug beim Logo */
  .beta-badge {
    margin-left: -2px;
  }
  .bars .bar-row {
    grid-template-columns: 84px 1fr 58px 44px;
  }
}

/* ---------- Konto & Premium ---------- */
.nav-account {
  text-decoration: none;
  border: 1px solid #3a4456;
  background: transparent;
  color: #ffd84d;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.nav-account:hover,
.nav-account[aria-current='page'] {
  background: #1b2230;
}
.nav-account.is-premium {
  color: #ffd84d;
  border-color: #ffd84d;
}
.pill.premium {
  background: #fff4c2;
  border-color: #f0c419;
  color: #6b5200;
}
.upsell {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid #f0c419;
  background: linear-gradient(135deg, #fffbea, #fff4c2);
  color: #3d2f00;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.upsell p {
  margin: 2px 0 0;
}
.features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.features p {
  margin: 2px 0 0;
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.plan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
}
.plan:hover {
  border-color: var(--accent);
}
.plan-name {
  font-weight: 700;
}
.plan-price {
  font-size: 1.3rem;
  font-weight: 800;
}
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-width: 420px;
}
.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}
.stack-form label.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}
.btn.danger {
  color: var(--neg);
  border-color: var(--neg);
}
code {
  background: var(--surface-2);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.85em;
  word-break: break-all;
}
.scenario-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 10px 0;
  padding: 8px 12px 12px;
}
.scenario-group legend {
  font-weight: 700;
  padding: 0 4px;
}
.chip.static {
  cursor: default;
}
.footer p {
  margin: 4px 0;
}
.footer a {
  color: inherit;
}

/* ---------- Rechtstexte ---------- */
.legal {
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.6;
}
/* klare Abstufung: Titel bis 2rem (Handy 1.6rem), Abschnitte 1.25rem, Text 1rem (mindestens 1.25× je Stufe) */
.legal {
  font-size: 1rem;
  /* lange deutsche Wörter (Datenschutzerklärung, Auftragsverarbeitung) trennen statt die Seite zu verbreitern */
  overflow-wrap: break-word;
  hyphens: auto;
}
.legal h1 {
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  margin-bottom: 16px;
}
.legal h2 {
  margin: 32px 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}
.legal p {
  margin: 0 0 12px;
  max-width: 70ch;
}
.todo {
  background: #fff4c2;
  color: #3d2f00;
  padding: 0 4px;
  border-radius: 4px;
}

/* ---------- Serverseitig gerenderte Texte (SEO) ---------- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 30;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 8px;
}
.page-intro,
.seo-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-intro {
  padding-top: 18px;
}
.page-intro h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 800;
}
.page-intro .lead {
  margin: 6px 0 0;
  color: var(--text-2);
  max-width: 900px;
  line-height: 1.45;
}
.page-intro + .page {
  padding-top: 12px;
}
.page .page-head .page-title {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
}
.crumbs-nav {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crumbs-nav .sep {
  color: var(--muted);
}
.app-skeleton,
.page.is-loading {
  min-height: min(900px, 120vh);
}
.seo-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  padding-bottom: 24px;
}
.seo-content:empty {
  display: none;
}
.seo-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  min-width: 0;
  overflow-x: auto;
}
.seo-section h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.seo-section p {
  color: var(--text-2);
  line-height: 1.5;
  font-size: 1rem;
}
/* reine Linklisten („Weitere Seiten“) als schmale Zeile über die ganze Breite statt als halbleere Spalte */
.seo-section:has(> h2 + .link-list:last-child) {
  grid-column: 1 / -1;
}
.seo-section:has(> h2 + .link-list:last-child) .link-list {
  columns: 4 200px;
}
/* Korrekturen (/korrekturen) und „So prüfen wir Daten“ (Methodik): über die ganze Breite, gut lesbare Zeilen */
.seo-section.correction,
#datenpruefung {
  grid-column: 1 / -1;
}
.correction-list {
  display: grid;
  gap: 4px 0;
  max-width: 70ch;
  margin: 8px 0 0;
}
.correction-list dt {
  font-weight: 600;
  margin-top: 8px;
}
.correction-list dd {
  margin: 0;
  color: var(--text-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#datenpruefung li {
  max-width: 70ch;
  line-height: 1.5;
  margin-bottom: 6px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.data-table caption {
  text-align: left;
  color: var(--text-2);
  font-size: 0.875rem;
  padding-bottom: 6px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}
.data-table thead th {
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.875rem;
}
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: baseline;
}
.table-scroll {
  overflow-x: auto;
}
.link-list {
  margin: 0;
  padding-left: 18px;
  columns: 2 160px;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.7;
}
.premium-teaser {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ---------- Sprachumschalter ---------- */
.nav-lang {
  max-width: 8.5rem;
}
@media (max-width: 640px) {
  .nav {
    gap: 8px;
  }
  .nav-select {
    min-width: 0;
    max-width: 30vw;
    padding: 6px;
  }
}

/* ---------- Teilen: Symbol mit Menü ---------- */
.share {
  position: relative;
}
.share-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.share-toggle::-webkit-details-marker {
  display: none;
}
.share-toggle:hover {
  border-color: var(--text-2);
}
.share-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.share-toggle svg {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}
.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.share-item {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.share-item:hover,
.share-item:focus-visible {
  background: var(--surface-2);
}

/* ---------- Preisseite ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  max-width: 820px;
}
.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.price-card.featured {
  border: 2px solid var(--accent);
}
.price-card .pill {
  align-self: flex-start;
}
.price-card .price {
  font-size: 1.9rem;
  font-weight: 800;
}
.btn.big {
  padding: 12px 18px;
  font-size: 1rem;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.compare-table .premium-cell {
  font-weight: 700;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
}
.faq p {
  margin: 8px 0 0;
}

/* ---------- Gesperrte Vorschau (Premium-Prognose je Wahlkreis) ---------- */
.map-svg.locked-units .unit,
.map-svg.locked-municipalities .municipality {
  filter: blur(3px);
}
.map-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(92%, 340px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 16px 18px;
  text-align: center;
}
.map-lock p {
  margin: 6px 0 12px;
  color: var(--text-2);
}

/* ---------- Einbetten ---------- */
.input.code {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.875rem;
  resize: vertical;
}
body.embed {
  min-height: 0;
}
body.embed .page {
  padding: 8px;
  gap: 8px;
}
body.embed .page-head,
body.embed [data-scenario],
body.embed [data-races],
body.embed [data-info],
body.embed [data-live],
body.embed .map-toolbar .toolbar,
body.embed .map-lock .btn {
  display: none !important;
}
body.embed .grid-main {
  grid-template-columns: 1fr;
}
.embed-brand {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--nav);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 6px 10px 6px 6px;
  border-radius: 8px;
}

/* ---------- Konto (/konto): Einstellungen mit Seitennavigation, Anmeldung; Gestaltung .impeccable/surfaces ---------- */
.acc-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1080px;
}
.acc-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 1.15rem;
  font-weight: 800;
}
.acc-identity-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.acc-email {
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.acc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.acc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.acc-badge.is-ok {
  color: var(--pos);
  background: color-mix(in srgb, var(--pos) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--pos) 40%, var(--border));
}
.acc-badge.is-warn {
  color: var(--text);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.acc-icon {
  flex: none;
  width: 18px;
  height: 18px;
}
.acc-badge-icon {
  width: 13px;
  height: 13px;
}
.acc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1080px;
}
.acc-nav {
  position: sticky;
  top: 72px;
}
.acc-nav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acc-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease-out,
    color 0.15s ease-out;
}
.acc-nav a .acc-icon {
  color: var(--muted);
}
.acc-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.acc-nav a[aria-current='page'] {
  background: color-mix(in srgb, var(--focus) 10%, transparent);
  color: var(--focus);
}
.acc-nav a[aria-current='page'] .acc-icon {
  color: var(--focus);
}
.acc-nav a:focus-visible,
.acc-country summary:focus-visible,
.pick-chip button:focus-visible,
.acc-search-results button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.acc-panel {
  min-width: 0;
}
.acc-panel-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.acc-panel-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
}
.acc-panel-head h2:focus {
  outline: none;
}
.acc-panel-head p {
  margin: 4px 0 0;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.acc-panel > :not(.acc-panel-head) {
  margin-left: 24px;
  margin-right: 24px;
}
.acc-panel > :last-child {
  margin-bottom: 24px;
}
.acc-rows-top {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}
.acc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.acc-rows > .acc-row:last-child,
.acc-danger .acc-row {
  border-bottom: 0;
}
.acc-row-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
a.acc-row-label {
  overflow-wrap: anywhere;
}
.acc-row-hint {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.45;
  max-width: 62ch;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.acc-strong {
  color: var(--text);
  font-weight: 600;
}
.acc-row-control {
  display: flex;
  justify-content: flex-end;
}
.acc-row-control a.btn {
  text-decoration: none;
}
.acc-muted {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.45;
}
.acc-empty {
  margin: 18px 0 0;
  color: var(--text-2);
}
.acc-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
  margin-top: 16px;
}
.acc-form-wide {
  margin-top: 20px;
}
.acc-field {
  display: grid;
  gap: 6px;
}
.acc-field > span:first-child {
  font-size: 0.875rem;
  font-weight: 600;
}
.acc-field .input {
  width: 100%;
  min-height: 40px;
  font-size: 0.95rem;
}
.acc-field small {
  color: var(--text-2);
  font-size: 0.875rem;
}
.acc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
}
.acc-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--focus);
}
.acc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.acc-actions p {
  margin: 0;
}
.acc-submit {
  justify-content: center;
  min-height: 42px;
  font-size: 0.92rem;
}
.btn.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.danger-solid:hover {
  background: color-mix(in srgb, var(--danger) 82%, #000);
}
.acc-danger {
  margin-top: 24px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--neg) 40%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--neg) 5%, var(--surface));
}
.acc-delete-form {
  margin: 0 0 16px;
}
.acc-delete-form p:empty {
  display: none;
}
.acc-code {
  margin: 0 0 4px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}
.acc-code code {
  padding: 0;
  background: none;
}
.acc-key {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--pos) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--pos) 40%, var(--border));
  border-radius: 8px;
}
.acc-key p {
  margin: 0 0 8px;
}
.acc-key-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.acc-key-line code {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 0.875rem;
}
.acc-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.acc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.acc-list li:last-child {
  border-bottom: 0;
}
.acc-inline-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
}
/* Benachrichtigungen: Chips, Suche, Länder zum Aufklappen */
.acc-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 22px 0 10px;
}
.acc-subhead h3 {
  font-size: 1rem;
  font-weight: 700;
}
.acc-save-state {
  font-size: 0.875rem;
  color: var(--text-2);
}
.acc-save-state.is-ok {
  color: var(--pos);
}
.acc-save-state.is-error {
  color: var(--neg);
}
.acc-alerts .acc-empty {
  margin: 0;
}
.pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
}
.pick-chip small {
  font-weight: 400;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--surface) 78%, var(--text));
}
.pick-chip button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.pick-chip button:hover {
  background: color-mix(in srgb, var(--surface) 18%, transparent);
}
.acc-chip-x {
  width: 15px;
  height: 15px;
}
.acc-search {
  margin-top: 18px;
  max-width: 520px;
}
.acc-search-box {
  position: relative;
  display: block;
}
.acc-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
}
.acc-search-box .input {
  padding-left: 36px;
  padding-right: 40px;
}
.acc-search-box .input::-webkit-search-cancel-button {
  display: none;
}
.acc-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.acc-search-clear:hover {
  background: var(--surface-2);
  color: var(--text);
}
.acc-search-clear:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.acc-search-results [aria-selected='true'] button {
  background: var(--surface-2);
}
.acc-search-results {
  margin: 6px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.acc-search-results button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
}
.acc-search-results button:hover:not([disabled]) {
  background: var(--surface-2);
}
.acc-search-results button[disabled] {
  cursor: default;
  color: var(--text-2);
}
.acc-search-results small {
  margin-left: auto;
  color: var(--text-2);
  font-size: 0.875rem;
}
.acc-search-none {
  padding: 8px 10px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.acc-countries {
  border-bottom: 1px solid var(--border);
}
.acc-country {
  border-top: 1px solid var(--border);
}
.acc-country summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}
.acc-country summary::-webkit-details-marker {
  display: none;
}
.acc-country summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate 0.2s ease-out;
}
.acc-country[open] summary::after {
  rotate: 225deg;
  translate: 0 2px;
}
.acc-country summary:hover {
  background: var(--surface-2);
}
.acc-country-name {
  flex: 1;
  font-weight: 600;
}
.acc-country-count {
  color: var(--text-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.acc-country-count.has {
  color: var(--text);
  font-weight: 600;
}
.acc-country-body {
  columns: 2 220px;
  column-gap: 24px;
  padding: 0 0 14px;
}
.acc-country-body .acc-check {
  break-inside: avoid;
  padding: 5px 0;
}
/* Abgemeldet: Formular und Nutzen nebeneinander */
.acc-auth {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 340px);
  justify-content: start;
  gap: 24px 48px;
  align-items: start;
}
.acc-auth-card {
  padding: 24px;
}
.acc-auth-card > .callout:first-child {
  margin-top: 0;
}
.acc-switch {
  display: flex;
}
.acc-switch button {
  flex: 1;
  padding: 7px 12px;
}
.acc-form-title {
  font-size: 1.1rem;
  font-weight: 800;
}
.acc-forgot {
  margin-top: 4px;
}
.acc-auth-aside {
  padding-top: 6px;
}
.acc-aside-title {
  font-size: 1rem;
  font-weight: 800;
}
.acc-benefits {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.acc-benefits li {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.45;
}
.acc-tick {
  margin-top: 1px;
  color: var(--pos);
}
/* Hinweis „E-Mail bestätigen“ auf allen Seiten (public/js/app.js) */
.verify-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 50%, var(--border));
  font-size: 0.88rem;
}
.verify-notice p {
  flex: 1;
  margin: 0;
}
.verify-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -5px -6px -5px 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.verify-close:hover {
  color: var(--text);
}
@media (max-width: 860px) {
  .acc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .acc-nav {
    position: static;
    margin: 0 -12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .acc-nav ul {
    display: flex;
    gap: 4px;
    padding: 2px 12px 4px;
    width: max-content;
  }
  .acc-nav a {
    padding: 8px 12px;
  }
  .acc-auth {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .acc-panel-head {
    padding: 18px 16px 14px;
  }
  .acc-panel > :not(.acc-panel-head) {
    margin-left: 16px;
    margin-right: 16px;
  }
  .acc-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .acc-row-control {
    justify-content: flex-start;
  }
  .acc-auth-card {
    padding: 18px 16px;
  }
}

/* ---------- Mobile Kopfzeile: Tabs in eigener, waagrecht scrollbarer Zeile ---------- */
@media (max-width: 760px) {
  .nav {
    flex-wrap: wrap;
    height: auto;
    row-gap: 0;
    padding-top: 8px;
  }
  .nav .brand {
    margin-right: auto;
  }
  .nav .tabs {
    order: 10;
    flex: 1 0 100%;
    height: 44px;
    margin: 0 -12px;
    padding: 0 6px;
  }
  .nav .tabs a {
    padding: 0 12px;
  }
}

/* ---------- Kartensteuerung ---------- */
.map-zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.map-zoom button {
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}
.map-zoom button + button {
  border-top: 1px solid var(--border);
}
.map-zoom button:hover {
  background: var(--surface-2);
}
.map-svg path {
  outline: none;
}
.map-svg path:focus-visible {
  stroke: var(--focus);
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
}
body.embed .map-zoom {
  top: 6px;
}

/* ---------- Fokus (Tastaturbedienung) ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.tabs a:focus-visible,
.nav-account:focus-visible,
.nav-select:focus-visible {
  outline-color: #ffffff;
}

/* ---------- Ladezustand: Platzhalter in Form der Seite ---------- */
.app-skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-rows: 90px 1fr;
  gap: 16px;
  color: transparent;
  place-items: stretch;
}
.app-skeleton::before,
.app-skeleton::after {
  content: '';
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 300% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}
.app-skeleton::before {
  grid-column: 1 / -1;
}
.app-skeleton::after {
  min-height: min(700px, 90vh);
}
@media (max-width: 1020px) {
  .app-skeleton {
    grid-template-columns: 1fr;
  }
}
@keyframes skeleton {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-skeleton::before,
  .app-skeleton::after {
    animation: none;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    /* auch Dauer-Animationen (z. B. Live-Punkt) anhalten */
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Fehlerseiten ---------- */
.error-code {
  margin: 12px 0 0;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}
body[data-page='error'] .page-intro {
  padding-top: 40px;
  padding-bottom: 12px;
}
.app-skeleton > span {
  display: none;
}
@media (max-width: 760px) {
  .nav .nav-select {
    max-width: 27vw;
    padding: 6px 2px;
    font-size: 0.875rem;
  }
  .nav .nav-lang {
    max-width: 19vw;
  }
  .nav .nav-account {
    padding: 6px 8px;
    font-size: 0.875rem;
  }
}

/* ---------- Ein Kopfbereich mit festen Positionen (kein Layoutsprung) ---------- */
.intro-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
/* Einleitung: höchstens zwei Zeilen (Handy: drei), Höhe fest reserviert – wechselnde Texte verschieben nichts */
.page-intro .lead {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.45em);
}
.page .page-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}
.control-bar {
  min-height: 40px;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.6em;
  white-space: nowrap;
  overflow: hidden;
}
.status-line .sub {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-note {
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.4;
  min-height: calc(2 * 1.4em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.status-note.warn {
  color: var(--neg);
  font-weight: 600;
}
.empty-notice p {
  margin: 0 0 12px;
  font-size: 1rem;
}
@media (max-width: 640px) {
  .page-intro .lead {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: calc(3 * 1.45em);
  }
  .status-line {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: calc(2 * 1.45em);
  }
  .status-note {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: calc(3 * 1.4em);
  }
}

/* Alte Umfragen in Tabellen hervorheben */
td.stale {
  color: var(--neg);
}

/* Offenes Rennen: Schraffur in der Legende (auf der Karte: SVG-Muster in den Parteifarben) */
.legend i.hatch {
  background: repeating-linear-gradient(45deg, var(--text-2) 0 3px, var(--surface) 3px 6px);
  border: 1px solid var(--border);
}

/* hidden gilt auch für Bereiche mit eigener display-Regel */
[hidden] {
  display: none !important;
}

/* Brotkrumen und Überschrift mit fester Höhe: Wechsel zwischen Seiten verschiebt die Bedienleiste nicht */
.page-intro .crumbs-nav {
  min-height: 18px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intro-head h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 1100px) {
  .intro-head h1 {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.2;
    min-height: calc(2 * 1.2em);
    flex-basis: 100%;
  }
}

/* ---------- Halbkreis-Sitzgrafik ---------- */
.hemicycle-wrap {
  max-width: 640px;
  margin: 8px auto 0;
}
svg.hemicycle {
  display: block;
  width: 100%;
  height: auto;
}
svg.hemicycle g.party {
  cursor: pointer;
  transition: opacity 0.2s;
}
svg.hemicycle g.party.dim {
  opacity: 0.18;
}
svg.hemicycle .empty-seats {
  fill: var(--empty);
}
svg.hemicycle .majority-mark {
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-dasharray: 3 2;
}
svg.hemicycle .hemicycle-total {
  font-size: 26px;
  font-weight: 800;
  fill: var(--text);
}
svg.hemicycle .hemicycle-label {
  font-size: 11px;
  fill: var(--text-2);
}
/* Serverseitig gerenderte Grafik hat Originalfarben: im Dunkelmodus feine Kontur, damit dunkle Parteien sichtbar bleiben */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .seo-content svg.hemicycle circle {
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 0.6;
  }
}
:root[data-theme='dark'] .seo-content svg.hemicycle circle {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 0.6;
}
.coalition-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 12px;
  min-height: 44px;
  margin-top: 6px;
  text-align: center;
}
.coalition-total .coalition-names {
  font-weight: 600;
}
.coalition-total .coalition-seats {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.coalition-total .coalition-verdict {
  font-size: 1.1rem;
  font-weight: 800;
}
.coalition-total.ok .coalition-verdict {
  color: var(--pos);
}
.coalition-total.short .coalition-verdict {
  color: var(--neg);
}
.coalition-total .coalition-chance {
  color: var(--text-2);
  font-weight: 600;
}
.seats-head .btn[data-seat-export] {
  margin-left: auto;
}

.seat-figure {
  max-width: 560px;
  margin: 8px 0 16px;
}
.seat-figure figcaption {
  text-align: center;
  color: var(--text-2);
  font-size: 0.875rem;
}

/* ---------- Zeitleiste der Wahlen ---------- */
.timeline {
  display: grid;
  gap: 2px;
  min-width: 220px;
  flex: 1 1 260px;
  max-width: 520px;
}
.timeline input[type='range'] {
  width: 100%;
  /* Zielgröße mindestens 24 px (WCAG 2.2, 2.5.8) */
  min-height: 24px;
  accent-color: var(--accent);
  margin: 0;
}
.timeline-ticks {
  display: flex;
  justify-content: space-between;
}
.timeline-ticks button {
  background: none;
  border: 0;
  /* Zielgröße mind. 24 × 24 px (WCAG 2.5.8) */
  min-width: 24px;
  min-height: 24px;
  padding: 0 2px;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
}
.timeline-ticks button.active {
  color: var(--text);
  font-weight: 800;
}
.timeline-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.timeline-compare .select {
  max-width: 16rem;
}

/* ---------- Prognose-Zeitreise ---------- */
.timetravel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  max-width: 720px;
}
.timetravel input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}
.timetravel-date {
  min-width: 7.5em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
}

/* nur für Screenreader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Bezugsrahmen in Tabellenzellen: sonst ragt der unsichtbare Text aus scrollbaren Tabellen heraus und verbreitert die
   Seite auf dem Handy */
:where(th, td):has(.sr-only) {
  position: relative;
}

/* Quellenvermerke mit langen URLs (z. B. Datenquellen des BKG) umbrechen statt die Spalte zu verbreitern */
[data-info] {
  overflow-wrap: anywhere;
}

/* Landtage: Sitzbalken je Land in der Übersichtstabelle */
.seat-strip {
  display: inline-flex;
  width: 120px;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  gap: 1px;
}

/* Wahltag-Banner (Countdown, heute, live) */
.election-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.election-banner.live,
.election-banner.today {
  background: var(--accent);
  color: #fff;
}
.election-banner.live a,
.election-banner.today a {
  color: #fff;
  text-decoration: underline;
}

/* Wahlnacht: zuletzt ausgezählte Wahlkreise */
.live-ticker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 16px 12px;
}

/* Verkaufsseite Premium */
.premium-hero {
  margin: 4px 0 18px;
}
.premium-hero .lead {
  font-size: 1.1rem;
  max-width: 70ch;
}
.showcase h2 {
  margin: 0 0 4px;
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin: 12px 0 22px;
}
.showcase-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.showcase-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top center;
}
.showcase-item figcaption {
  padding: 10px 12px;
  font-size: 0.9rem;
}
.showcase-item figcaption b {
  display: block;
}
.premium-hero a.btn {
  text-decoration: none;
}

/* ---------- Kachelseiten (Startseite, Kontinent, Land; docs/konzept.md, Abschnitt 3) ---------- */
:root {
  --shape: #2b3442;
  --shape-soon: #b4bac3;
  --star: #f5c518;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --shape: #d6dbe3;
    --shape-soon: #3a4352;
  }
}
:root[data-theme='dark'] {
  --shape: #d6dbe3;
  --shape-soon: #3a4352;
}
.tile-group {
  margin: 8px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.tile-group a {
  color: inherit;
  text-decoration: none;
}
.tile-group a:hover {
  text-decoration: underline;
}
.tile-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tile-filter input {
  flex: 1 1 260px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.tile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
.tile-grid[hidden],
.tile[hidden],
.tile-group[hidden] {
  display: none;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 180px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s,
    border-color 0.15s;
}
a.tile:hover {
  transform: translateY(-2px);
  border-color: var(--focus);
}
a.tile:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.tile.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.tile-shape {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 6px;
}
.silhouette {
  width: 100%;
  height: 100%;
  max-height: 110px;
}
.silhouette path {
  fill: var(--shape);
  stroke: var(--shape);
  stroke-width: 0.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.silhouette .star {
  fill: var(--star);
}
.tile-name {
  font-weight: 700;
  line-height: 1.2;
}
.tile-info {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  color: var(--muted);
}
.tile-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}
.tile.soon {
  background: var(--surface-2);
  box-shadow: none;
}
.tile.soon .tile-name {
  color: var(--text-2);
}
.tile.soon .silhouette path {
  fill: var(--shape-soon);
  stroke: var(--shape-soon);
}
.soon-label {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.live,
.badge.today {
  background: var(--accent);
  color: #fff;
}
.badge.live .live-dot {
  background: #fff;
}
.badge.level,
.badge.countdown {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.tile-empty {
  margin: 0;
}
.next-strip {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.next-strip h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
}
.next-strip ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.next-strip li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.next-strip time {
  font-weight: 700;
}
@media (max-width: 520px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .next-strip ol {
    flex-direction: column;
  }
}

/* Verfügbare Länder groß, Kontinente kompakt */
.tiles-large {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.tiles-large .tile {
  min-height: 220px;
}
.tiles-large .silhouette {
  max-height: 140px;
}
.tiles-continents .tile {
  min-height: 0;
  padding: 10px;
}
.tiles-continents .tile-shape {
  min-height: 56px;
}
.tiles-continents .silhouette {
  max-height: 56px;
}

/* Weitere Länder „bald“: eingeklappt, kompakte Liste, Benachrichtigung */
.soon-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.soon-section > summary {
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.soon-section > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.soon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 4px 16px 12px;
  list-style: none;
}
.soon-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
}
.silhouette.mini {
  width: 22px;
  height: 22px;
  flex: none;
}
.silhouette.mini path {
  fill: var(--shape-soon);
  stroke: var(--shape-soon);
}
.notify-form {
  margin: 0 16px 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.notify-form h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.notify-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.notify-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}
.notify-fields input,
.notify-fields select {
  min-width: 220px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
.notify-consent {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--text-2);
}
.notify-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.notice {
  padding: 12px 16px;
  background: color-mix(in srgb, var(--pos) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--pos) 45%, var(--border));
  border-radius: var(--radius);
}
.notice.error {
  background: color-mix(in srgb, var(--neg) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--neg) 45%, var(--border));
}
.notice form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.notice p {
  margin: 0;
}
@media (max-width: 520px) {
  .notify-fields input,
  .notify-fields select,
  .notify-fields button {
    min-width: 0;
    width: 100%;
  }
  .notify-fields label {
    width: 100%;
  }
}

/* Quellen & Lizenzen */
.sources-table th[scope='row'] {
  text-align: left;
  white-space: nowrap;
}
.footer-sources {
  max-width: 1100px;
  margin-inline: auto !important;
}

/* ---------- Wahlansicht (docs/konzept.md, Abschnitt 3): Karte groß, Bedienleiste direkt darunter, rechts Sitz-Ring ---------- */
.view-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.view-main .map-card {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
/* Durchgehende Kante: die Bedienleiste setzt die Kartenkarte ohne Abstand fort */
.view-controls {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
  padding: 12px 14px 0;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: var(--surface-2);
}
.view-controls .legend {
  margin: 0 -14px;
  background: var(--surface);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.view-controls .toolbar:empty,
.view-controls [data-time-row]:empty {
  display: none;
}
/* Bezugsrahmen für absolut positionierte Hilfstexte (sr-only), damit nichts aus der Scrollleiste herausragt */
.view-controls .toolbar,
.view-controls [data-time-row] {
  position: relative;
}
.view-main .empty-notice {
  margin-top: 16px;
}
.view-below {
  display: grid;
  gap: 16px;
}
.view-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.seat-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.seat-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.seat-ring {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 8px auto 4px;
}
.ring-seg {
  stroke: var(--surface);
  stroke-width: 0.8;
}
.ring-majority {
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.ring-majority-label {
  fill: var(--text);
  font-size: 9px;
  font-weight: 700;
}
.ring-total {
  fill: var(--text);
  font-size: 24px;
  font-weight: 800;
}
.ring-total-label {
  fill: var(--text-2);
  font-size: 9px;
}
.party-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.party-list th,
.party-list td {
  padding: 5px 0;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.party-list th[scope='row'] {
  font-weight: 600;
  text-align: left;
}
.party-list .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
}
.pl-bar {
  display: block;
  height: 4px;
  margin-top: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.pl-bar i {
  display: block;
  height: 100%;
}
.pl-share,
.pl-seats {
  padding-left: 10px !important;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  /* Handy: Bedienleiste als waagerecht scrollbare Leiste direkt unter der Karte */
  .view-controls .control-bar,
  .view-controls [data-map-controls] {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

/* Hinweis ohne Daten: auf der leeren Karte statt anstelle der Karte (kein Layoutsprung) */
.map-empty {
  position: absolute;
  inset: 50% 16px auto;
  transform: translateY(-50%);
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Koalitionsplaner (docs/konzept.md, Abschnitt 4) ---------- */
.coalition-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .coalition-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.coalition-main .hemicycle-wrap {
  max-width: 620px;
  margin: 8px auto 0;
}
.coalition-grown {
  margin: 6px 0 0;
  color: var(--text-2);
}
/* Füllbalken: gewählte Parteien von links bis zur Mehrheit; Marke außen über und unter dem Balken */
.fill-bar-wrap {
  position: relative;
  margin: 26px 0 14px;
}
.fill-bar {
  display: flex;
  height: 26px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.fill-bar > div {
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 700;
}
.fill-mark {
  position: absolute;
  width: 2px;
  height: 8px;
  margin-left: -1px;
  background: var(--text);
}
.fill-mark.top {
  top: -10px;
}
.fill-mark.bottom {
  bottom: -10px;
}
.fill-mark-label {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  font-size: 0.875rem;
  font-weight: 700;
}
.coalition-parties .party-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.coalition-parties .party-toggle[aria-pressed='true'] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.coalition-parties .party-toggle .sw {
  margin-right: 0;
}
.coalition-parties tr.excluded .party-name {
  text-decoration: line-through;
}
.coalition-parties tr.excluded .party-toggle {
  opacity: 1;
  color: var(--text-2);
  cursor: not-allowed;
}
.coalition-parties td:last-child {
  padding-left: 10px;
  text-align: right;
  white-space: nowrap;
}
.coalition-subtitle {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}
.seat-note {
  margin: 8px 0;
}
.timetravel [disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ---------- Suche (Kopfzeile global, Bedienleiste je Land) ---------- */
.search-box {
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
/* Suche gut sichtbar: hellerer Rand und Lupe im Feld */
.nav-search {
  flex: 0 1 360px;
  min-width: 180px;
  margin-left: auto;
}
.nav-search input {
  background: #1a2130
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%23c3cad6' stroke-width='2'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%23c3cad6' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat 10px center;
  padding-left: 36px;
  border-color: #4a5568;
  color: var(--nav-text);
}
.nav-search input:hover {
  border-color: #6b778c;
}
.nav-search input::placeholder {
  color: #a9b2c1;
}
.nav-search-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--nav-text);
  cursor: pointer;
}
.nav-search-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.map-search {
  flex: 1 1 200px;
  min-width: 160px;
}
.search-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  min-width: 280px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.search-group {
  padding: 8px 10px 4px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}
.search-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.search-item[aria-selected='true'],
.search-item:hover {
  background: var(--surface-2);
}
.search-name {
  font-weight: 600;
}
.search-context {
  font-size: 0.875rem;
  color: var(--text-2);
}
.search-empty {
  padding: 10px;
  color: var(--text-2);
}
.map-clear {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
@media (max-width: 760px) {
  .nav-search-toggle {
    display: grid;
  }
  .nav .nav-search {
    display: none;
    order: 11;
    flex: 1 0 100%;
    margin: 0 0 8px;
  }
  .nav.search-open .nav-search {
    display: block;
  }
}

/* Darstellung und Kartensuche in einer Zeile (die Suche bleibt beim Neuzeichnen erhalten) */
.map-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.map-controls-row [data-map-controls] {
  flex: 0 1 auto;
}
.map-controls-row [data-map-search] {
  flex: 1 1 220px;
  min-width: 0;
}

/* Hinweise zur Grundlage der Prognose (z. B. Teilstichprobe, Sitzverteilung) */
.projection-notes {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.875rem;
  color: var(--text-2);
}
.projection-notes li + li {
  margin-top: 4px;
}

/* Gebiete außerhalb des Gesamtgebiets der Wahlebene: neutral, nicht anklickbar */
.map-svg path.state.outside {
  fill: var(--empty);
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* Info-Box „So rechnen wir“ */
.method-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.method-box ul {
  margin: 6px 0;
  padding-left: 18px;
}
/* eingeklappt: Titel und ein Satz Zusammenfassung; „mehr“ für weitere Punkte */
.info-how > summary {
  cursor: pointer;
}
.info-how .info-summary {
  color: var(--text-2);
}
.info-how[open] > summary {
  margin-bottom: 4px;
}
.method-box > summary,
.method-more > summary {
  cursor: pointer;
  list-style-position: outside;
  margin-left: 16px;
}
.method-box .method-summary {
  color: var(--text-2);
}
.method-box[open] > summary {
  margin-bottom: 4px;
}
.method-more {
  margin: 0 0 6px;
}
.method-more > summary {
  color: var(--text-2);
}

/* ---------- Koalitionsrechner: Sitze nach Winkel, Koalition von links, Opposition von rechts ---------- */
svg.coalition-hemicycle circle {
  transition: fill 0.35s ease;
  cursor: pointer;
}
svg.coalition-hemicycle circle.empty {
  cursor: default;
}
svg.coalition-hemicycle .majority-number {
  font-size: 11px;
  font-weight: 800;
  fill: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  svg.coalition-hemicycle circle {
    transition: none;
  }
}
.coalition-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.coalition-order li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: grab;
}
.coalition-order li:not(:last-child)::after {
  content: '+';
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
}
.coalition-order li:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.coalition-order .sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.coalition-controls .control-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.coalition-groups {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}
.coalition-groups li.ok {
  color: var(--pos);
}
.coalition-groups li.short {
  color: var(--neg);
}
.coalition-group-filter {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

/* Umfrage nicht mehr in der Quelle (Datenschleuse: nie löschen, nur vermerken) */
.badge.muted-badge {
  margin-left: 6px;
  background: var(--surface-2, transparent);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* Prognose-Annahme (So rechnen wir): gesetzte Werte, kein Gesetz und keine Messung */
.badge.assumption {
  background: transparent;
  color: var(--text-2);
  border: 1px dashed var(--muted);
  font-weight: 600;
  margin-right: 2px;
}

/* Quelle und Stand eines Ergebnisses */
.source-line {
  margin: 0 0 6px;
}
.source-line .source-status {
  color: var(--accent);
}

/* Rechtstexte: Verweise untereinander und auf Quellen & Lizenzen */
.legal-links {
  max-width: 820px;
  margin: 24px auto 8px;
  font-size: 0.9rem;
  color: var(--text-2);
}

/* ---------- Darstellung: Hell / Dunkel / System (Symbol folgt data-theme, auch vor dem Laden des JavaScripts) ---------- */
.nav-theme {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid #2b3445;
  border-radius: 8px;
  background: #1b2230;
  color: var(--nav-text);
  cursor: pointer;
}
.nav-theme:hover {
  background: #232c3d;
}
.nav-theme:focus-visible {
  outline-color: #ffffff;
}
.nav-theme svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.nav-theme svg .fill {
  fill: currentColor;
  stroke: none;
}
.nav-theme svg.ic-dark .fill {
  fill: none;
  stroke: currentColor;
}
.nav-theme .ic-light,
.nav-theme .ic-dark,
:root[data-theme] .nav-theme .ic-system {
  display: none;
}
:root[data-theme='light'] .nav-theme .ic-light,
:root[data-theme='dark'] .nav-theme .ic-dark {
  display: block;
}

/* ---------- Vollbild: Karte, Sitz-Ring und Legende (Fullscreen-API bzw. Ebene über der Seite) ---------- */
.view-grid.is-fullscreen {
  background: var(--bg);
  padding: 12px;
  overflow: auto;
  align-content: start;
}
.view-grid.is-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
}
body.no-scroll {
  overflow: hidden;
}
.view-grid.is-fullscreen [data-detail],
.view-grid.is-fullscreen [data-head-controls],
.view-grid.is-fullscreen [data-time-row],
.view-grid.is-fullscreen .map-controls-row,
.view-grid.is-fullscreen .map-toolbar .toolbar,
.view-grid.is-fullscreen .seat-panel .btn,
.view-grid.is-fullscreen .projection-notes {
  display: none;
}
.view-grid.is-fullscreen .view-controls {
  padding-top: 0;
}
.view-grid.is-fullscreen .map-svg {
  /* Kopfzeile der Karte (ca. 50 px), Legende (ca. 60 px) und Rand */
  max-height: calc(100dvh - 150px);
}
.map-zoom button[aria-pressed='true'] {
  background: var(--surface-2);
  color: var(--focus);
}
.map-zoom svg {
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 1020px) {
  .view-grid.is-fullscreen .map-svg {
    max-height: calc(100dvh - 200px);
  }
}

/* ---------- Wahlkalender ---------- */
.next-strip h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.next-strip h2 a {
  text-decoration: none;
}
.next-strip h2 a:hover {
  text-decoration: underline;
}
.next-strip-all {
  font-weight: 600;
  color: var(--focus);
}
.cal-next-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 6px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.cal-next-line time {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-2);
}
.cal-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.cal-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cal-filter [data-ics] {
  margin-left: auto;
}
.cal-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cal-item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 12px 16px;
}
.cal-item + .cal-item {
  border-top: 1px solid var(--border);
}
.cal-item[hidden] {
  display: none;
}
.cal-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.cal-date {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cal-what {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cal-name {
  font-weight: 700;
}
@media (max-width: 640px) {
  .cal-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .cal-filter [data-ics] {
    margin-left: 0;
  }
  .cal-link {
    justify-self: start;
  }
}
.cal-list .btn,
.cal-filter .btn {
  text-decoration: none;
}

/* ---------- Veränderung: Pfeil und Wert (Umfragen) ---------- */
.trend {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-left: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
}
.trend.up {
  color: var(--pos);
}
.trend.down {
  color: var(--neg);
}
.data td .trend {
  display: block;
  margin: 1px 0 0;
}
.bars.with-trend .bar-row {
  grid-template-columns: 110px 1fr 64px 52px 58px;
}
.bar-trend {
  text-align: right;
}
.bar-trend .trend {
  margin: 0;
}
.trend-note {
  margin: 8px 0 0;
}
@media (max-width: 520px) {
  .bars.with-trend .bar-row {
    grid-template-columns: 84px 1fr 52px 44px 50px;
    gap: 6px;
  }
}

/* ---------- Absolute Zahlen: vollständig, auf dem Handy ab 1 Mio. gekürzt (voller Wert im Titel und für Screenreader) ---------- */
.count-short {
  display: none;
}
@media (max-width: 640px) {
  .count-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .count-short {
    display: inline;
  }
}

/* ---------- Gewinne und Verluste je Partei (Balken links/rechts um die Mittellinie) ---------- */
.swing-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  font-size: 0.9rem;
}
.swing-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.2fr) minmax(0, 2fr) 4.5rem;
  gap: 8px 12px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.swing-list.with-votes .swing-row {
  grid-template-columns: minmax(7rem, 1.2fr) minmax(0, 2fr) 4.5rem 7.5rem;
}
.swing-list.with-seats .swing-row {
  grid-template-columns: minmax(7rem, 1.2fr) minmax(0, 2fr) 4.5rem 3.5rem;
}
.swing-list.with-votes.with-seats .swing-row {
  grid-template-columns: minmax(7rem, 1.2fr) minmax(0, 2fr) 4.5rem 7.5rem 3.5rem;
}
.swing-row:last-child {
  border-bottom: 0;
}
.swing-head {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.swing-bar-head {
  text-align: center;
}
.swing-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  min-width: 0;
}
.swing-name .sw {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.swing-bar {
  position: relative;
  height: 14px;
  background: linear-gradient(var(--text-2), var(--text-2)) center / 1px 100% no-repeat;
}
.swing-bar i {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 2px;
}
.swing-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.swing-row .num.pos {
  color: var(--pos);
}
.swing-row .num.neg {
  color: var(--neg);
}
@media (max-width: 640px) {
  .swing-row,
  .swing-list.with-votes .swing-row,
  .swing-list.with-seats .swing-row,
  .swing-list.with-votes.with-seats .swing-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }
  .swing-row .swing-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .swing-head .swing-bar-head {
    display: none;
  }
}

/* ---------- Verschiebungspfeile auf der Karte ---------- */
.map-svg .arrows path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  vector-effect: none;
}
.map-svg .arrows path.halo {
  stroke: var(--surface);
  stroke-width: 6;
}
.map-svg .arrows path.arrow {
  stroke-width: 2.8;
}
[data-map-controls] .btn[aria-pressed='true'] {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.legend-arrows {
  font-weight: 600;
}

/* ---------- Größte Gewinne und Verluste je Partei ---------- */
[data-shifts] .seats-head .select {
  max-width: 12rem;
}
.shift-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}
.shift-cols h3 {
  margin: 8px 0 4px;
}
.shift-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.shift-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  cursor: pointer;
}
.shift-list li:last-child .shift-row {
  border-bottom: 0;
}
.shift-row:hover .shift-name {
  text-decoration: underline;
}
.shift-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.shift-val {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.shift-val.pos {
  color: var(--pos);
}
.shift-val.neg {
  color: var(--neg);
}
@media (max-width: 640px) {
  .shift-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Hochburgen: oberste 10 % hervorgehoben ---------- */
.map-svg path.top {
  stroke: var(--text);
  stroke-width: 1.4;
}

/* ---------- Absolute Stimmen in Tooltip und Parteiliste ---------- */
.tooltip .t-row {
  grid-template-columns: 10px 1fr auto auto;
}
.tooltip .t-votes {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pl-votes {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Geteilte Szenarien ---------- */
.shared-scenario .shared-description {
  margin: 10px 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ---------- Beta (BETA_ALL_FREE): Kennzeichen beim Logo und schließbarer Hinweis unter der Kopfzeile ---------- */
.beta-badge {
  margin-left: -4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #2b3445;
  background: #1b2230;
  color: var(--nav-text);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Wahltag-Leiste und Beta-Hinweis teilen sich eine Zeile (Desktop); auf dem Handy der Beta-Hinweis in Kurzform */
.top-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.top-strip > .election-banner {
  flex: 0 1 auto;
  border-bottom: 0;
}
.top-strip > .election-banner:not(.live):not(.today) {
  background: none;
}
.top-strip > .election-banner.live,
.top-strip > .election-banner.today {
  flex: 1 1 100%;
}
.beta-notice {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 16px;
  font-size: 0.875rem;
  color: var(--text-2);
}
.top-strip > .election-banner + .beta-notice {
  border-left: 1px solid var(--border);
}
.beta-short {
  display: none;
}
/* neben der Wahltag-Leiste genügt die Kurzform (eine Zeile) */
.top-strip > .election-banner + .beta-notice .beta-long {
  display: none;
}
.top-strip > .election-banner + .beta-notice .beta-short {
  display: inline;
}
@media (max-width: 720px) {
  .beta-long {
    display: none;
  }
  .beta-short {
    display: inline;
  }
  /* mit Wahltag-Leiste: beides in einer Zeile – Leiste gekürzt, daneben nur „Beta“ und ✕ */
  .top-strip:has(> .election-banner:not(.live):not(.today)) {
    flex-wrap: nowrap;
  }
  .top-strip > .election-banner:not(.live):not(.today) {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding-right: 8px;
  }
  .top-strip > .election-banner:not(.live):not(.today) + .beta-notice {
    flex: none;
    padding-left: 10px;
  }
  .top-strip > .election-banner:not(.live):not(.today) + .beta-notice :is(.beta-short, .link) {
    display: none;
  }
  .top-strip > .election-banner.live + .beta-notice,
  .top-strip > .election-banner.today + .beta-notice {
    border-left: 0;
  }
}
.beta-notice p {
  flex: 1;
  margin: 0;
}
.beta-close {
  flex: none;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
/* geschlossen gemerkt: das Kopf-Script setzt data-beta-closed vor dem Zeichnen (public/js/theme.js) */
[data-beta-closed] .beta-notice {
  display: none;
}

/* ---------- „Fehler melden“, Fehler- und Leerzustände ---------- */
.map-report {
  margin: 0;
  padding: 6px 12px 8px;
  text-align: right;
  color: var(--text-2);
}
.report-form {
  display: grid;
  gap: 12px;
}
.report-form h2 {
  margin: 0;
  font-size: 1.15rem;
}
.report-form label {
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}
.report-form label .small {
  font-weight: 400;
}
.report-form p {
  margin: 0;
}
/* Honeypot: für Menschen unsichtbar und nicht erreichbar, Bots füllen es aus */
.report-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.recovery {
  margin-top: 10px;
}
#error-box p {
  margin: 0;
}
.error-close {
  margin-top: 8px;
}
.footer-version {
  white-space: nowrap;
}

/* Angaben je Umfrage unter dem Institut: Auftraggeber, Feldzeit, Stichprobe, Quellen (Transparenz) */
.poll-meta {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-2);
  white-space: normal;
  min-width: 16ch;
  max-width: 34ch;
  line-height: 1.4;
}
.poll-meta a {
  display: inline-block;
  min-height: 24px;
}
/* Wahlnacht ohne Live-Abruf (1.16.7): Hinweis mit Link zur amtlichen Ergebnisseite, oben im Live-Streifen */
.live-night-notice {
  margin: 12px 16px 0;
}
