/* =====================================================================
   Winterthur Council Tools — gemeinsames Stylesheet
   Design-Tokens, Layout, Header/Nav/Footer, Karten, Buttons, Tabellen
   ===================================================================== */

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Partei-Farben (Fallback — zur Laufzeit aus data/party-meta.json
     via assets/js/parties.js als --party-<id> gespiegelt) */
  --clr-sp:        #e8001a;
  --clr-svp:       #3d7c3d;
  --clr-fdp:       #1565c0;
  --clr-glp:       #8fae00;
  --clr-gruene:    #1e9e1e;
  --clr-al:        #d95b0e;
  --clr-evp:       #e6a400;
  --clr-edu:       #555;
  --clr-mitte:     #e06400;

  /* Flächen & Linien */
  --clr-bg:        #f5f5f0;
  --clr-card:      #fff;
  --clr-border:    #c8c8c8;
  --clr-border-soft: #e2e2da;
  --clr-accent:    #c00;
  --clr-accent-dark: #a00;

  /* Text */
  --clr-text:      #222;
  --clr-muted:     #666;
  --clr-faint:     #999;

  /* Semantik */
  --clr-yes:       #2e7d32;
  --clr-no:        #c62828;
  --clr-abstain:   #8d8d8d;
  --clr-warn-bg:   #fff8e1;
  --clr-warn-border: #e6c76a;

  --radius:        6px;
  --radius-sm:     4px;
  --shadow:        0 1px 3px rgba(0, 0, 0, .08);
  --font:          'Helvetica Neue', Helvetica, Arial, sans-serif;
  --maxw:          1200px;
}

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

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #06c; }
a:hover { color: var(--clr-accent-dark); }

h1, h2, h3, h4 { line-height: 1.25; }

/* ─── Header ───────────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--clr-accent);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 80px;
}

.site-header .logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
}

.site-header .site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
}

.site-header .site-title span {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--clr-muted);
}

/* ─── Burger-Button (nur auf schmalen Viewports sichtbar) ──────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
}

.nav-toggle:hover { background: #f3f3ee; }

.nav-toggle .nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: #333;
  transition: transform .18s, opacity .18s;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Navigation ───────────────────────────────────────────────────── */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--clr-border);
  padding: 0 2rem;
  overflow-x: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.site-nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  color: #333;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.site-nav a:hover { background: #f3f3ee; color: #000; }

.site-nav a[aria-current='page'] {
  border-bottom-color: var(--clr-accent);
  font-weight: 700;
  color: #000;
}

/* ─── Main ─────────────────────────────────────────────────────────── */
main {
  width: 100%;
  max-width: var(--maxw);
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.page-title { font-size: 1.5rem; margin-bottom: 0.35rem; }
.page-lead   { font-size: 0.92rem; color: var(--clr-muted); line-height: 1.55; margin-bottom: 1.5rem; max-width: 70ch; }

/* ─── Karten ───────────────────────────────────────────────────────── */
.card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card > h2 { font-size: 1.25rem; margin-bottom: 0.45rem; }
.card > .subtitle { font-size: 0.82rem; color: var(--clr-muted); margin-bottom: 1rem; }
.card > h3 { font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: 0.4rem; }

.intro { }
.intro h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.intro p  { font-size: 0.9rem; color: #555; line-height: 1.55; }

.fact-list { padding-left: 1.5rem; }

/* ─── Tool-Kacheln (Landing Page) ──────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tool-tile {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  box-shadow: var(--shadow);
}

.tool-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  border-color: #999;
  color: inherit;
}

.tool-tile .tile-icon { font-size: 1.6rem; line-height: 1; }
.tool-tile h3 { font-size: 1rem; }
.tool-tile p { font-size: 0.82rem; color: var(--clr-muted); line-height: 1.5; }

.tool-tile.planned {
  opacity: .65;
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

/* ─── Buttons & Formulare ──────────────────────────────────────────── */
button, .btn {
  font-family: inherit;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bbb;
  background: #f0f0f0;
  cursor: pointer;
  font-size: 0.82rem;
  color: #222;
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn:hover { background: #e0e0e0; color: #222; }

button.primary, .btn.primary {
  background: var(--clr-accent);
  border-color: var(--clr-accent-dark);
  color: #fff;
}

button.primary:hover, .btn.primary:hover { background: var(--clr-accent-dark); color: #fff; }

button:disabled, .btn:disabled,
button:disabled:hover, .btn:disabled:hover {
  background: #ececec;
  border-color: #d5d5d5;
  color: var(--clr-faint);
  cursor: not-allowed;
}

button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 2px solid #06c;
  outline-offset: 2px;
}

input[type='text'], input[type='search'], input[type='number'], select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #bbb;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #222;
}

label { font-size: 0.85rem; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.status-msg {
  font-size: 0.82rem;
  color: #555;
  margin-left: auto;
}

/* Segmented control (Umschalter Partei/Fraktion o.ä.) */
.segmented {
  display: inline-flex;
  border: 1px solid #bbb;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0.35rem 0.9rem;
}

.segmented button + button { border-left: 1px solid #ddd; }
.segmented button[aria-pressed='true'] { background: var(--clr-accent); color: #fff; }

/* ─── Tabellen ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--clr-border-soft);
  vertical-align: top;
}

table.data thead th {
  background: #faf9f4;
  border-bottom: 2px solid var(--clr-border);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { background: #f0efe6; }
table.data tbody tr:hover { background: #fbfbf5; }
table.data tbody tr.selected { background: #fff4d6; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Badges & Chips ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--clr-faint);
  white-space: nowrap;
}

.badge.neutral { background: #e8e8e0; color: #444; font-weight: 400; }
.badge.ok { background: var(--clr-yes); }
.badge.bad { background: var(--clr-no); }

.chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  font-size: 0.75rem;
  background: #fafaf5;
  margin: 0 0.2rem 0.2rem 0;
}

/* ─── Kennzahlen-Kacheln ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.kpi {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
}

.kpi .kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi .kpi-label { font-size: 0.78rem; color: var(--clr-muted); margin-top: 0.2rem; }
.kpi .kpi-note  { font-size: 0.72rem; color: var(--clr-faint); margin-top: 0.15rem; }

/* ─── Hinweise / Zustände ──────────────────────────────────────────── */
.notice {
  border: 1px solid var(--clr-warn-border);
  background: var(--clr-warn-bg);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.notice.error { border-color: #e0a0a0; background: #fdeeee; }
.notice.info  { border-color: #a8c8e6; background: #eef5fc; }

.loading { font-size: 0.85rem; color: var(--clr-muted); padding: 1rem 0; }
.empty   { font-size: 0.85rem; color: var(--clr-faint); padding: 1rem 0; font-style: italic; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Traktanden-Download ──────────────────────────────────────────── */
.agenda-download {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}

/* Eigene Abstände (u.a. der negative von `.hint`) würden hier mit dem
   Button überlappen — der Abstand kommt allein vom `gap`. */
.agenda-download > * { margin: 0; }
.agenda-download .agenda-summary { font-size: 0.85rem; line-height: 1.5; }
.agenda-download .hint { max-width: 70ch; }
.agenda-download .loading { padding: 0; }

/* ─── Diagramme ────────────────────────────────────────────────────── */
.stats-section { margin-bottom: 1.6rem; }
.stats-section > h2 { font-size: 1.15rem; margin-bottom: 0.7rem; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chart-box {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.chart-box h3 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.chart-box .chart-sub { font-size: 0.75rem; color: var(--clr-muted); margin-bottom: 0.6rem; }
.chart-canvas-wrap { position: relative; height: 260px; }
.chart-fallback { font-size: 0.82rem; color: var(--clr-muted); }

/* ─── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--clr-border);
  margin-top: 2rem;
  padding: 1.2rem 2rem 1.6rem;
  font-size: 0.78rem;
  color: var(--clr-muted);
  line-height: 1.6;
}

.site-footer .footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
}

.site-footer p { max-width: 60ch; }
.site-footer .footer-meta { margin-left: auto; text-align: right; }

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .site-header { padding: 0 1rem; gap: 0.8rem; height: 68px; }
  .site-header .logo { height: 42px; }
  .site-header .site-title { font-size: 1.05rem; min-width: 0; }
  .site-header .site-title span { font-size: 0.72rem; }

  .nav-toggle { display: flex; }

  /* Navigation wird zum aufklappbaren Panel unter dem Header. */
  .site-nav {
    display: none;
    padding: 0;
    overflow-x: visible;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; max-width: none; }
  .site-nav li + li { border-top: 1px solid var(--clr-border-soft); }
  .site-nav a {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border-bottom: 0;
    border-left: 3px solid transparent;
    white-space: normal;
  }
  .site-nav a[aria-current='page'] {
    border-bottom-color: transparent;
    border-left-color: var(--clr-accent);
    background: #faf9f4;
  }

  main { margin: 1.2rem auto; }
  .card { padding: 1rem; }
  .chart-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 1rem; }
  .site-footer .footer-meta { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle .nav-toggle-bar { transition: none; }
}

/* ─── Mehrheitsrechner ─────────────────────────────────────────────── */
.hint { font-size: 0.78rem; color: var(--clr-muted); margin: -0.4rem 0 0.9rem; }

.majority-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.majority-groups {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  box-shadow: var(--shadow);
}

.group-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  border: 0;
  border-bottom: 1px solid var(--clr-border-soft);
  padding: 0.55rem 0;
}

.group-row:last-child { border-bottom: 0; }

.group-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  min-width: 190px;
  flex: 1 1 190px;
}

.group-dot {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
}

.vote-options { display: flex; gap: 0.15rem; flex-wrap: wrap; }

.vote-option {
  position: relative;
  font-size: 0.76rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  background: #fff;
  white-space: nowrap;
}

.vote-option input { position: absolute; opacity: 0; pointer-events: none; }
.vote-option:hover { background: #f2f2ec; }
.vote-option:has(input:focus-visible) { outline: 2px solid #06c; outline-offset: 1px; }
.vote-option:has(input:checked) { color: #fff; border-color: transparent; font-weight: 700; }
.vote-option.vote-yes:has(input:checked)     { background: var(--clr-yes); }
.vote-option.vote-no:has(input:checked)      { background: var(--clr-no); }
.vote-option.vote-abstain:has(input:checked) { background: var(--clr-abstain); }

.absence { font-size: 0.75rem; color: var(--clr-muted); display: flex; align-items: center; gap: 0.3rem; }
.absence input { width: 4rem; padding: 0.15rem 0.3rem; font-size: 0.78rem; }

.majority-result { position: sticky; top: 0.5rem; margin-bottom: 0; }

.result-badge {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  color: #fff;
  background: var(--clr-abstain);
}

.result-badge.outcome-accepted  { background: var(--clr-yes); }
.result-badge.outcome-rejected  { background: var(--clr-no); }
.result-badge.outcome-tie       { background: #b8860b; }
.result-badge.outcome-undecided { background: #8d8d8d; }

.vote-bar {
  display: flex;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  background: #eee;
}

.vote-bar span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  overflow: hidden;
  transition: width .15s;
}

.seg-yes     { background: var(--clr-yes); }
.seg-no      { background: var(--clr-no); }
.seg-abstain { background: var(--clr-abstain); }
.seg-absent  { background: #d5d5cc; color: #555 !important; }

.vote-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  font-size: 0.75rem;
  color: var(--clr-muted);
  margin: 0.5rem 0 0.6rem;
}

.vote-legend-item { display: flex; align-items: center; gap: 0.3rem; }
.vote-legend .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.result-summary { font-size: 0.82rem; line-height: 1.55; color: #444; }

/* Mögliche Allianzen */
.alliance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.alliance-table th, .alliance-table td {
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--clr-border-soft);
  vertical-align: middle;
}

.alliance-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--clr-muted);
  border-bottom: 2px solid var(--clr-border);
  white-space: nowrap;
}

.alliance-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.alliance {
  border-left: 4px solid var(--alliance-color, var(--clr-border));
  background: #fafaf5;
  cursor: pointer;
}

.alliance-table tbody tr:hover { background: #efeee2; }
.alliance:focus-visible { outline: 2px solid #06c; outline-offset: -2px; }
.alliance.is-active { background: #eceadb; }
.alliance.is-active .alliance-name { text-decoration: underline; text-underline-offset: 2px; }

.alliance-name { font-weight: 600; }

.alliance-label { display: flex; align-items: center; gap: 0.4rem; }

/* Fraktionsliste unter dem Bündnisnamen — nur in der Schmalansicht sichtbar. */
.alliance-parts-inline { display: none; }

.alliance-parts { color: var(--clr-muted); font-size: 0.78rem; }
.alliance-margin { white-space: nowrap; }
.alliance-margin .badge { min-width: 7.5rem; text-align: center; }

/* Rückmeldung nach einem Bündnis-Klick: Ergebniskarte blinkt kurz auf. */
@keyframes result-flash {
  0%   { box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.55); }
  100% { box-shadow: var(--shadow); }
}

.majority-result.is-updated { animation: result-flash 1s ease-out; }

/* Hinweis-Leiste, wenn die Ergebniskarte beim Klick ausserhalb des
   Sichtbereichs liegt (typisch auf dem Handy). */
.calc-feedback {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: min(94vw, 32rem);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: #222;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 130%);
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
}

.calc-feedback.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.calc-feedback button { flex-shrink: 0; background: #fff; border-color: #fff; }
.calc-feedback button:hover { background: #e6e6e6; }

@media (prefers-reduced-motion: reduce) {
  .calc-feedback { transition: none; }
  .majority-result.is-updated { animation: none; outline: 2px solid #06c; outline-offset: 2px; }
}

/* Kompaktes Widget auf der Landing Page */
.majority-groups.compact { border: 0; box-shadow: none; padding: 0; background: transparent; }
.majority-groups.compact .group-row { padding: 0.3rem 0; }
.majority-groups.compact .group-name { min-width: 120px; flex-basis: 120px; }
.majority-result.compact { margin-top: 0.8rem; }
.widget-link { font-size: 0.82rem; margin-top: 0.7rem; }

@media (max-width: 850px) {
  .majority-layout { grid-template-columns: minmax(0, 1fr); }
  .majority-result { position: static; }
}

@media (max-width: 560px) {
  /* Gruppenname auf eigene Zeile — sonst quetschen sich Name und
     Abstimmungsoptionen nebeneinander und die Karte läuft über. */
  .group-name { min-width: 0; flex: 1 1 100%; }
  .majority-groups.compact .group-name { min-width: 0; flex-basis: 100%; }
  .vote-option { padding: 0.25rem 0.55rem; }
  .absence { margin-left: auto; }

  .alliance-table { font-size: 0.78rem; }
  .alliance-table th, .alliance-table td { padding: 0.5rem 0.35rem; }
  .alliance-label { align-items: flex-start; gap: 0.3rem; }
  .alliance-label .group-dot { margin-top: 0.2rem; }
  .alliance-margin .badge { min-width: 0; }

  /* Die eigene Fraktions-Spalte weicht einer Zeile unter dem Bündnisnamen,
     damit die Tabelle ohne Querscrollen in die Karte passt. */
  .alliance-table thead th:nth-child(2),
  .alliance-table td.alliance-parts { display: none; }
  .alliance-parts-inline {
    display: block;
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--clr-muted);
  }
}

/* ─── Statistik ────────────────────────────────────────────────────── */
.stats-note { margin-bottom: 1.2rem; }

.dist-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dist-table th, .dist-table td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--clr-border-soft); }
.dist-table td.num, .dist-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.bar-cell { display: block; height: 10px; border-radius: 2px; background: var(--clr-faint); min-width: 2px; }

/* ─── Vorstösse (historische Auswertungen) ─────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--clr-border-soft);
}

.control-group { display: flex; flex-direction: column; gap: 0.25rem; }
.control-label { font-size: 0.74rem; color: var(--clr-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.segmented button[aria-checked='true'] { background: var(--clr-accent); color: #fff; }
.segmented button { font-size: 0.82rem; }

.table-scroll { overflow-x: auto; }

.party-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: baseline;
}

.heat-table th[scope='row'] { white-space: nowrap; font-weight: 600; }
.heat-table .heat-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  border: 1px solid #fff;
}
.heat-table .heat-strong { color: #fff; font-weight: 600; }

.quality-notes { margin: 0.5rem 0 0 1.1rem; font-size: 0.8rem; }
.quality-notes li { margin-bottom: 0.2rem; }
.quality-details { margin-top: 0.9rem; font-size: 0.85rem; }
.quality-details summary { cursor: pointer; color: var(--clr-muted); }
.quality-details > .table-scroll { margin-top: 0.6rem; }

/* ─── Mitglieder ───────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.filter-bar label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: #444; }
.filter-bar input[type='search'] { min-width: 220px; }

/* --- Mitgliederliste ----------------------------------------------------- */
.members-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.members-table th, .members-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--clr-border-soft); text-align: left; }
.members-table th { cursor: pointer; user-select: none; white-space: nowrap; font-size: 0.78rem; color: var(--clr-muted); }
.members-table th:hover { color: #000; }
.members-table th.num, .members-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.members-table td.tenure { white-space: nowrap; }
.members-table tbody tr[data-profile] { cursor: pointer; }
.members-table tbody tr:hover { background: #f7f7f2; }
.members-table tbody tr:focus-within { background: #eef2f7; }
.member-link { color: inherit; text-decoration: none; font-weight: 600; }
.member-link:hover, .member-link:focus-visible { color: var(--clr-accent); text-decoration: underline; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
