:root {
  --bg: #0d0c0a;
  --bg-elev: #161513;
  --bg-elev-2: #1d1c19;
  --bg-soft: #232220;
  --bg-input: #1a1916;

  --fg: #f3f1ec;
  --fg-mute: #a39d92;
  --fg-dim: #6c685f;

  --border: rgba(var(--ovr),0.07);
  --border-strong: rgba(var(--ovr),0.14);

  --accent: oklch(0.75 0.13 250);
  --accent-soft: oklch(0.35 0.10 250 / 0.30);

  --danger: oklch(0.70 0.19 25);
  --danger-soft: oklch(0.35 0.14 25 / 0.28);

  --gov: oklch(0.78 0.16 145);
  --gov-soft: oklch(0.40 0.13 145 / 0.22);
  --opp: oklch(0.72 0.20 25);
  --opp-soft: oklch(0.40 0.16 25 / 0.22);

  /* RGB triplet for theme-flippable overlays — white on dark, black on light */
  --ovr: 255,255,255;
  --seat-empty: #2a2825;     /* puste miejsce w hemicyklu */
  --fg-hover: #ffffff;       /* hover wypełnionych przycisków (tło = --fg) */
  --on-fg: #0e0e0e;          /* tekst na tle --fg */
  --on-accent: #0b0b0b;      /* tekst na tle --accent / --opp */
  --floor-blend: screen;     /* tryb mieszania kolorowej poświaty pod hemicyklem */

  --shadow-soft:
    0 1px 0 rgba(var(--ovr),0.04) inset,
    0 8px 24px rgba(0,0,0,0.30),
    0 24px 60px rgba(0,0,0,0.30);
  --shadow-card:
    0 1px 0 rgba(var(--ovr),0.04) inset,
    0 12px 30px rgba(0,0,0,0.35),
    0 32px 80px rgba(0,0,0,0.30);
  --shadow-glow-gov:
    0 0 0 1px rgba(95,195,135,0.18) inset,
    0 12px 30px rgba(40,140,80,0.18),
    0 1px 0 rgba(var(--ovr),0.05) inset;
  --shadow-glow-opp:
    0 0 0 1px rgba(240,110,100,0.18) inset,
    0 12px 30px rgba(180,60,60,0.20),
    0 1px 0 rgba(var(--ovr),0.05) inset;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-feature-settings: "tnum" 1; }
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
::selection { background: var(--accent-soft); color: var(--fg); }

/* ============ TOP SECTION ============ */
.top-section {
  position: relative;
  min-height: 100vh;
  border-bottom: 1px solid var(--border);
  padding: 32px 44px 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 95%, rgba(255, 220, 150, 0.025) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 45%, rgba(140, 170, 220, 0.04) 0%, transparent 70%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

.header-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.header-utility .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-utility .eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--fg-mute);
}
.section-eyebrow-bar {
  padding: 36px 44px 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.section-eyebrow-bar .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow-bar .eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--fg-mute);
}
.header-utility .header-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.edit-clubs-btn {
  padding: 11px 16px;
  border-radius: 11px;
  background: var(--fg);
  color: var(--on-fg);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}
.edit-clubs-btn:hover { background: var(--fg-hover); }
.ghost-btn-lg {
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(var(--ovr),0.04);
  border: 1px solid var(--border);
  color: var(--fg);
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ghost-btn-lg:hover { background: rgba(var(--ovr),0.08); border-color: var(--border-strong); }

/* Centered government name */
.gov-name-block {
  text-align: center;
  margin: 8px auto 28px;
}
.fit-input-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  text-align: left;
}
.fit-input-mirror {
  visibility: hidden;
  pointer-events: none;
  white-space: pre;
  display: block;
  min-width: 2ch;
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  margin: 0 !important;
  width: auto !important;
  text-align: left !important;
}
.fit-input-wrap > input {
  position: absolute;
  inset: 0;
  width: 100% !important;
  margin: 0 !important;
}
.gov-name-input {
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: var(--fg);
  font-size: clamp(40px, 5.6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.030em;
  line-height: 1.5;
  text-align: center;
  padding: 4px 14px;
  border-radius: 12px;
  transition: background 120ms, box-shadow 120ms;
  box-sizing: border-box;
}
.gov-name-input:hover { background: rgba(var(--ovr),0.03); }
.gov-name-input:focus { background: rgba(var(--ovr),0.05); box-shadow: inset 0 0 0 1px var(--accent); }
.gov-name-input::placeholder { color: var(--fg-dim); font-style: italic; }
.gov-name-block .sub {
  color: var(--fg-mute);
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: -0.005em;
}
.gov-name-block .sub-input {
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: var(--fg-mute);
  text-align: center;
  width: 100%;
  max-width: 600px;
  padding: 4px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  transition: background 120ms, box-shadow 120ms;
}
.gov-name-block .sub-input:hover { background: rgba(var(--ovr),0.03); }
.gov-name-block .sub-input:focus { background: rgba(var(--ovr),0.05); box-shadow: inset 0 0 0 1px var(--accent); }
.gov-name-block .sub-input::placeholder { color: var(--fg-dim); font-style: italic; }

/* Summary bar */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.summary-pill {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
}
.summary-pill .pill-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-pill .pill-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.summary-pill .pill-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.025em;
}
.summary-pill .pill-sub {
  font-size: 12px;
  color: var(--fg-mute);
  font-family: "IBM Plex Mono", monospace;
}
.summary-pill .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.summary-pill.gov {
  background: linear-gradient(180deg, var(--gov-soft), rgba(0,0,0,0)), var(--bg-elev);
  border-color: rgba(95,195,135,0.20);
  box-shadow: var(--shadow-glow-gov), var(--shadow-soft);
}
.summary-pill.gov .pill-label,
.summary-pill.gov .pill-num,
.summary-pill.gov .pill-sub { color: var(--gov); }
.summary-pill.opp {
  background: linear-gradient(180deg, var(--opp-soft), rgba(0,0,0,0)), var(--bg-elev);
  border-color: rgba(240,110,100,0.20);
  box-shadow: var(--shadow-glow-opp), var(--shadow-soft);
}
.summary-pill.opp .pill-label,
.summary-pill.opp .pill-num,
.summary-pill.opp .pill-sub { color: var(--opp); }
.summary-pill.danger {
  background: linear-gradient(180deg, var(--danger-soft), rgba(0,0,0,0)), var(--bg-elev);
  border-color: rgba(240,100,90,0.20);
}
.summary-pill.danger .pill-label,
.summary-pill.danger .pill-num,
.summary-pill.danger .pill-sub { color: var(--danger); }

/* ============ MAJORITY INDICATOR ============ */
.majority-bar {
  margin-top: 26px;
  border-radius: 14px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.majority-bar.ok {
  background: linear-gradient(90deg, var(--gov-soft) 0%, rgba(0,0,0,0) 60%), var(--bg-elev);
  border-color: rgba(95,195,135,0.25);
}
.majority-bar.warn {
  background: linear-gradient(90deg, var(--danger-soft) 0%, rgba(0,0,0,0) 60%), var(--bg-elev);
  border-color: rgba(240,100,90,0.30);
}
.majority-bar .mb-status {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.majority-bar .mb-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; line-height: 1;
  flex-shrink: 0;
}
.majority-bar.ok .mb-icon { background: rgba(110,220,150,0.18); color: var(--gov); }
.majority-bar.warn .mb-icon { background: rgba(240,110,100,0.18); color: var(--danger); }
.majority-bar .mb-title {
  font-size: 13px; font-weight: 700; letter-spacing: -0.005em;
  line-height: 1.2;
}
.majority-bar.ok .mb-title { color: var(--gov); }
.majority-bar.warn .mb-title { color: var(--danger); }
.majority-bar .mb-sub {
  font-size: 11px; color: var(--fg-mute);
  font-family: "IBM Plex Mono", monospace;
  margin-top: 2px;
}
.majority-bar .mb-thresholds {
  display: flex; gap: 8px;
  flex-wrap: wrap;
}
.majority-bar .mb-thr {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(var(--ovr),0.03);
  border: 1px solid var(--border);
  opacity: 0.55;
  transition: opacity 150ms, background 150ms, border-color 150ms;
}
.majority-bar .mb-thr.met {
  opacity: 1;
  background: rgba(110,220,150,0.10);
  border-color: rgba(95,195,135,0.30);
}
.majority-bar .mb-thr-mark {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 800; font-size: 12px; line-height: 1;
  color: var(--fg-dim);
  width: 10px; text-align: center;
}
.majority-bar .mb-thr.met .mb-thr-mark { color: var(--gov); }
.majority-bar .mb-thr-n {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700; font-size: 12px; line-height: 1;
}
.majority-bar .mb-thr-l {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-mute); font-weight: 600; margin-top: 2px;
}
@media (max-width: 760px) {
  .majority-bar { grid-template-columns: 1fr; padding: 14px 18px; }
  .majority-bar .mb-thresholds { gap: 6px; }
}

/* Party chips inside summary pill (BIG) */
.party-chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.party-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(var(--ovr),0.04);
  border: 1px solid rgba(var(--ovr),0.10);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  transition: background 120ms, border-color 120ms;
}
.party-chip:hover {
  background: rgba(var(--ovr),0.08);
  border-color: rgba(var(--ovr),0.18);
}
.party-chip .chip-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.30), inset 0 1px 0 rgba(var(--ovr),0.12);
}
.party-chip .chip-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Hemicycle */
.hemicycle-wrap {
  flex: 1;
  min-height: 580px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.hemicycle-svg {
  width: 100%;
  height: 100%;
  max-height: 80vh;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.seat {
  cursor: pointer;
  transition: opacity 180ms ease, filter 180ms ease;
}
.seat.dimmed { opacity: 0.10; }
.seat:hover { filter: brightness(1.15); }

/* Label group */
.party-label-group {
  transition: opacity 180ms ease;
}
.party-label-group.dim { opacity: 0.20; }
.party-label-name {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  fill: var(--fg);
}
.party-label-count {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}
.label-logo-stroke {
  stroke: rgba(0,0,0,0.30);
  stroke-width: 0.003;
}
.label-logo-text {
  fill: #fff;
  font-weight: 800;
  font-family: "Manrope", sans-serif;
  pointer-events: none;
}

/* Info card */
.info-card {
  position: fixed;
  pointer-events: none;
  background: rgba(15,14,12,0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(var(--ovr),0.10);
  color: #fff;
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
  z-index: 50;
  min-width: 240px;
  max-width: 320px;
  display: none;
  transform: translate(-50%, calc(-100% - 18px));
  opacity: 0;
  transition: opacity 120ms ease;
}
.info-card.visible { display: block; opacity: 1; }
.info-card::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(15,14,12,0.92);
  border-right: 1px solid rgba(var(--ovr),0.10);
  border-bottom: 1px solid rgba(var(--ovr),0.10);
}
.info-card .row1 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.info-card .info-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background-position: center;
  background-size: cover;
}
.info-card .info-name { font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.info-card .info-sub { font-size: 12px; color: rgba(var(--ovr),0.55); font-family: "IBM Plex Mono", monospace; margin-top: 2px; }
.info-card .info-stats { display: flex; gap: 14px; margin-bottom: 12px; }
.info-card .info-stat { flex: 1; }
.info-card .info-stat .v { font-family: "IBM Plex Mono", monospace; font-size: 20px; font-weight: 700; }
.info-card .info-stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(var(--ovr),0.5); font-weight: 600; margin-top: 2px; }
.info-card .role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.info-card .role-pill .role-dot { width: 7px; height: 7px; border-radius: 50%; }
.info-card .role-pill.gov { background: rgba(110, 220, 150, 0.15); color: #7cf0a8; }
.info-card .role-pill.opp { background: rgba(240, 110, 100, 0.15); color: #ff9990; }
.info-card .role-pill.none { background: rgba(var(--ovr),0.08); color: rgba(var(--ovr),0.65); }
.info-card .role-pill.gov .role-dot { background: #7cf0a8; }
.info-card .role-pill.opp .role-dot { background: #ff9990; }
.info-card .role-pill.none .role-dot { background: rgba(var(--ovr),0.5); }
.info-card .split-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.info-card .split-item { border-radius: 8px; padding: 6px 8px; background: rgba(var(--ovr),0.06); text-align: center; }
.info-card .split-item .v { font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 15px; }
.info-card .split-item .l { font-size: 9px; text-transform: uppercase; letter-spacing: 0.10em; color: rgba(var(--ovr),0.55); font-weight: 600; margin-top: 1px; }
.info-card .split-item.gov .v { color: #7cf0a8; }
.info-card .split-item.opp .v { color: #ff9990; }

.info-card.is-list {
  min-width: 280px;
  max-width: 340px;
}
.info-card .info-logos {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.info-card .info-logo-stack {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-left: -10px;
  position: relative;
  box-shadow: 0 0 0 2px rgba(15,14,12,0.92);
}
.info-card .info-logo-stack:first-child { margin-left: 0; }

.info-card .coalition-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--ovr),0.08);
}
.info-card .coalition-member {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(var(--ovr),0.04);
  border-left: 3px solid;
}
.info-card .coalition-member .cm-info { flex: 1; min-width: 0; }
.info-card .coalition-member .cm-name {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.info-card .coalition-member .cm-stats {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: rgba(var(--ovr),0.55);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ============ DRAWER ============ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 240ms ease;
  z-index: 25;
}
.drawer-backdrop.open { background: rgba(0,0,0,0.5); pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 100vw;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: none;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 30;
  display: flex; flex-direction: column; min-height: 0;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.drawer-header .h { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 8px; }
.drawer-header .t { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-header .x { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--fg-mute); flex-shrink: 0; }
.drawer-header .x:hover { background: var(--bg-soft); color: var(--fg); }
.drawer-stats {
  padding: 14px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
}
.drawer-stats .stat-pill { flex: 1; padding: 10px 12px; border-radius: 10px; background: rgba(var(--ovr),0.03); border: 1px solid var(--border); }
.drawer-stats .stat-pill.gov { background: var(--gov-soft); border-color: rgba(95,195,135,0.18); }
.drawer-stats .stat-pill.opp { background: var(--opp-soft); border-color: rgba(240,110,100,0.18); }
.drawer-stats .stat-pill .l { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.drawer-stats .stat-pill.gov .l { color: var(--gov); }
.drawer-stats .stat-pill.opp .l { color: var(--opp); }
.drawer-stats .stat-pill .v { font-family: "IBM Plex Mono", monospace; font-size: 18px; font-weight: 700; }
.drawer-stats .stat-pill.gov .v { color: var(--gov); }
.drawer-stats .stat-pill.opp .v { color: var(--opp); }

.club-list { flex: 1; overflow-y: auto; padding: 8px 12px 6px; }
.club-list::-webkit-scrollbar { width: 8px; }
.club-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.club-list::-webkit-scrollbar-track { background: transparent; }

.club-item { border-radius: 12px; margin-bottom: 4px; transition: background 120ms; }
.club-item.hovered { background: rgba(var(--ovr),0.06); }
.club-item.editing { background: var(--bg-soft); }
.club-item:not(.editing):hover { background: rgba(var(--ovr),0.04); }
.club-item.independents { background: rgba(120,120,120,0.05); }

.club-row { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px; }
.club-handle { display: flex; flex-direction: column; gap: 1px; }
.club-handle button { width: 22px; height: 18px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--fg-mute); font-size: 9px; }
.club-handle button:hover:not(:disabled) { background: var(--bg-soft); color: var(--fg); }
.club-handle button:disabled { opacity: 0.25; cursor: not-allowed; }

.club-logo {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
  background-position: center; background-size: cover;
  letter-spacing: 0.02em; cursor: pointer;
}
.club-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; cursor: pointer; }
.club-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.club-sub { font-size: 11px; color: var(--fg-mute); font-family: "IBM Plex Mono", monospace; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.role-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-family: "Manrope", sans-serif; white-space: nowrap; flex-shrink: 0; }
.role-tag .role-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.role-tag.gov { color: var(--gov); }
.role-tag.opp { color: var(--opp); }
.role-tag.none { color: var(--fg-dim); }
.role-tag.mix { color: var(--fg-mute); }

.club-seats-input { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); width: 60px; text-align: right; background: var(--bg-input); color: var(--fg); outline: none; }
.club-seats-input:focus { border-color: var(--accent); }
.club-actions { display: flex; gap: 2px; }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--fg-mute); }
.icon-btn:hover { background: var(--bg-soft); color: var(--fg); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.club-editor { padding: 0 14px 14px 14px; border-top: 1px dashed var(--border-strong); margin: 4px 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding-top: 14px; }
.club-editor label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); display: block; margin-bottom: 6px; }
.club-editor .field-full { grid-column: 1 / -1; }
.text-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); color: var(--fg); outline: none; font-size: 13px; }
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--fg-dim); }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; position: relative; border: 2px solid transparent; }
.swatch.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--bg-elev); }
input[type="color"] { width: 26px; height: 26px; border: 1px dashed var(--border-strong); background: transparent; padding: 0; cursor: pointer; border-radius: 50%; }

.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ghost-btn { padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; font-weight: 500; background: rgba(var(--ovr),0.03); color: var(--fg); }
.ghost-btn:hover { background: var(--bg-soft); }
.ghost-btn.danger { color: var(--danger); }
.ghost-btn.danger:hover { background: var(--danger-soft); }

.role-segment { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; background: rgba(var(--ovr),0.03); border-radius: 9px; padding: 3px; }
.role-segment button { padding: 7px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--fg-mute); }
.role-segment button:hover { background: rgba(var(--ovr),0.06); color: var(--fg); }
.role-segment button.active { background: var(--bg-elev-2); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.role-segment button.active.gov { color: var(--gov); }
.role-segment button.active.opp { color: var(--opp); }

.splits-editor { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.split-field { background: rgba(var(--ovr),0.03); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.split-field.gov { background: var(--gov-soft); border-color: rgba(95,195,135,0.18); }
.split-field.opp { background: var(--opp-soft); border-color: rgba(240,110,100,0.18); }
.split-field .l { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 4px; }
.split-field.gov .l { color: var(--gov); }
.split-field.opp .l { color: var(--opp); }
.split-field input { width: 100%; background: transparent; border: none; outline: none; font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 18px; color: var(--fg); padding: 0; }
.split-field.gov input { color: var(--gov); }
.split-field.opp input { color: var(--opp); }
.splits-meta { font-size: 11px; color: var(--fg-dim); font-family: "IBM Plex Mono", monospace; margin-top: 6px; display: flex; justify-content: space-between; }
.splits-meta.error { color: var(--danger); }

/* Electoral lists editor */
.lists-section { padding: 8px 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.lists-section-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 8px; }
.lists-section-header h4 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); }
.lists-empty { font-size: 11px; color: var(--fg-dim); padding: 6px 4px 10px; line-height: 1.4; }
.list-folder { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: rgba(var(--ovr),0.02); transition: background 120ms, border-color 120ms; }
.list-folder.drag-over { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.list-folder.unassigned { border-style: dotted; opacity: 0.85; }
.list-folder-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.list-folder-header .folder-ico { color: var(--fg-mute); flex-shrink: 0; }
.list-name-input { flex: 1; background: transparent; border: 1px solid transparent; outline: none; padding: 6px 8px; border-radius: 7px; color: var(--fg); font-size: 13px; font-weight: 600; }
.list-name-input:hover { background: rgba(var(--ovr),0.03); }
.list-name-input:focus { background: var(--bg-input); border-color: var(--border-strong); }
.list-name-input::placeholder { color: var(--fg-dim); font-style: italic; font-weight: 500; }
.list-folder-body { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.list-folder-club { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--fg); }
.list-folder-club .lfc-x { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--fg-mute); }
.list-folder-club .lfc-x:hover { background: var(--danger-soft); color: var(--danger); }
.list-folder-empty { font-size: 11px; color: var(--fg-dim); font-style: italic; padding: 4px 2px; }
.list-folder-meta { font-size: 10px; font-family: "IBM Plex Mono", monospace; color: var(--fg-dim); margin-left: 4px; }

.club-item { cursor: grab; }
.club-item:active { cursor: grabbing; }
.club-item.dragging { opacity: 0.4; }

.drawer-footer { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.primary-btn { flex: 1; min-width: 130px; padding: 11px 14px; background: var(--fg); color: var(--on-fg); border-radius: 9px; font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.primary-btn:hover { background: var(--fg-hover); }
.secondary-btn { padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px; font-weight: 500; font-size: 13px; color: var(--fg); background: rgba(var(--ovr),0.02); }
.secondary-btn:hover { background: var(--bg-soft); }
.hint { font-size: 11px; color: var(--fg-dim); line-height: 1.4; margin-top: 6px; }

.chart-section-wrapper {
  border-bottom: 1px solid var(--border);
  position: relative;
  background: var(--bg);
}
.chart-section { padding: 32px 48px 40px; max-width: 1400px; margin: 0 auto; }
.chart-container {
  height: 800px;
  padding: 180px 0 24px;
  position: relative;
  border-bottom: 2px solid var(--border-strong);
  margin-top: 40px;
}
.chart-plot {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}
.chart-y-axis {
  position: absolute;
  left: -40px; top: 180px; bottom: 24px;
  width: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--fg-dim);
  text-align: right;
  z-index: 1;
}
.threshold-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 2px dashed rgba(var(--ovr),0.45);
  z-index: 20;
  pointer-events: none;
}
.threshold-line.t-5 { border-color: rgba(var(--ovr), 0.55); }
.threshold-line.t-8 { border-color: rgba(255, 200, 100, 0.65); }
.threshold-label {
  position: absolute;
  right: -84px;
  top: -10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 21;
}
.threshold-line.t-8 .threshold-label { color: rgba(255, 220, 160, 0.95); }

.list-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  min-width: 60px;
}
.list-bar {
  width: 100%;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column-reverse;
  transition: transform 200ms ease, opacity 200ms ease;
  cursor: default;
  -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
}
.list-bar:hover {
  transform: scaleX(1.05) translateY(-4px);
  z-index: 10;
}
.list-bar.failed { opacity: 0.35; filter: grayscale(0.5); }

.bar-segment {
  width: 100%;
  transition: background 150ms;
}
.list-bar:hover .bar-segment { background: rgba(var(--ovr),0.08); }

.list-top {
  position: absolute;
  bottom: 100%;
  left: -4px; right: -4px;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 10;
}
.list-logos {
  display: flex;
  align-items: center;
  justify-content: center;
}
.list-logo-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5), 0 0 0 3px var(--bg-elev);
  margin-left: -14px;
  position: relative;
  cursor: pointer;
  transition: transform 150ms;
}
.list-logo-wrap:first-child { margin-left: 0; }
.list-logo-wrap:hover { transform: scale(1.15); z-index: 20 !important; }

.list-coalition-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
}
.list-club-names {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
}
.list-club-name {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  max-width: 140px;
  word-break: break-word;
}
.list-val {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-mute);
  margin-top: 2px;
}
.list-bar.failed ~ .list-top .list-val { color: var(--danger); }

/* ============ GOVERNMENT SECTION ============ */
.gov-section-wrapper { border-bottom: 1px solid var(--border); }
.gov-section { padding: 32px 48px 96px; max-width: 1400px; margin: 0 auto; }
.gov-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 40px; flex-wrap: wrap; gap: 16px;
}
.gov-header h2 { font-size: 40px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.gov-header .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.gov-header .eyebrow::before { content: ""; display: inline-block; width: 20px; height: 1px; background: var(--fg-mute); }
.gov-header .desc { color: var(--fg-mute); font-size: 14px; max-width: 380px; line-height: 1.55; }

.gov-edit-toggle {
  padding: 11px 18px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ovr),0.03);
  color: var(--fg);
  transition: background 120ms, border-color 120ms;
}
.gov-edit-toggle:hover { background: rgba(var(--ovr),0.06); }
.gov-edit-toggle.active {
  background: var(--fg);
  color: var(--on-fg);
  border-color: var(--fg);
}
.gov-edit-toggle.active:hover { background: var(--fg-hover); }

.group-label {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 16px;
}
.group-label h3 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-mute); margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.group-label h3::before { content: ""; display: inline-block; width: 20px; height: 1px; background: var(--fg-mute); }
.group-label .count { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--fg-dim); }

.leaders { display: grid; gap: 18px; margin-bottom: 32px; }
.leaders.leaders-solo { grid-template-columns: minmax(0, 720px); justify-content: center; }
.leaders.leaders-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) {
  .leaders.leaders-pair { grid-template-columns: minmax(0, 1fr); }
  .leaders.leaders-solo { grid-template-columns: minmax(0, 1fr); }
}

.person-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
  transition: border-color 150ms, background 150ms;
  position: relative;
  box-shadow: var(--shadow-card);
}
.person-card[data-has-club="true"] {
  background:
    linear-gradient(155deg, var(--club-tint-strong) 0%, var(--club-tint-soft) 35%, var(--bg-elev) 70%),
    var(--bg-elev);
  border-color: var(--club-border);
  box-shadow:
    0 16px 40px -10px var(--club-tint-strong),
    var(--shadow-card);
}
.person-card:hover { border-color: var(--border-strong); }
.person-card[data-has-club="true"]:hover { border-color: var(--club-border-strong); }
.person-card.size-md {
  padding: 18px;
  border-radius: 16px;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}
.person-card.size-sm {
  padding: 16px;
  border-radius: 14px;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}
.person-card.size-md[data-has-club="true"] {
  box-shadow:
    0 12px 32px -10px var(--club-tint-strong),
    var(--shadow-soft);
}
.person-card.size-sm[data-has-club="true"] {
  box-shadow:
    0 10px 26px -8px var(--club-tint-strong),
    var(--shadow-soft);
}

.person-card { min-width: 0; }
.person-main {
  display: flex; gap: 22px; align-items: center;
  min-width: 0;
}
.person-main > *:not(.avatar) { min-width: 0; flex: 1; }
.person-card.size-md .person-main { gap: 16px; }
.person-card.size-sm .person-main { gap: 14px; }

.person-card .role-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-mute); margin-bottom: 6px;
}
.person-card[data-has-club="true"] .role-eyebrow { color: var(--club-color-mute); }
.person-card.size-lg .role-eyebrow { font-size: 13px; margin-bottom: 8px; }
.person-card.size-sm .role-eyebrow { font-size: 10px; letter-spacing: 0.12em; }

.person-card .name-line {
  font-size: clamp(18px, 2.0vw, 22px); font-weight: 700;
  letter-spacing: -0.015em; line-height: 1.15;
}
.person-card.size-lg .name-line { font-size: clamp(22px, 2.4vw, 27px); }
.person-card.size-md .name-line { font-size: 17px; }
.person-card.size-sm .name-line { font-size: 14px; line-height: 1.25; }

.person-card .title-edit {
  font-size: 16px; font-weight: 700; line-height: 1.25;
  margin-bottom: 6px; letter-spacing: -0.005em;
}
.person-card.size-sm .title-edit { font-size: 14px; }
.person-card .meta-row { color: var(--fg-mute); font-size: 13px; font-weight: 500; }
.person-card.size-sm .meta-row { font-size: 12px; }

.inline-edit {
  background: transparent; border: none; outline: none;
  width: 100%; padding: 2px 4px; margin: -2px -4px;
  border-radius: 6px;
  font: inherit; color: inherit;
  transition: background 120ms, box-shadow 120ms;
}
.inline-edit:hover { background: rgba(var(--ovr),0.05); }
.inline-edit:focus { background: rgba(var(--ovr),0.08); box-shadow: inset 0 0 0 1px var(--accent); }
.inline-edit:read-only { cursor: default; }
.inline-edit:read-only:hover { background: transparent; }
.inline-edit::placeholder { color: var(--fg-dim); }
.name-edit-row { display: flex; gap: 6px; flex-wrap: wrap; }
.name-edit-row .inline-edit { width: auto; flex: 1; min-width: 60px; }
.inline-edit.name-full { width: 100%; display: block; }

.person-card-body { flex: 1; min-width: 0; }

.avatar {
  border-radius: 50%;
  background-color: var(--bg-soft);
  background-position: center;
  background-size: cover;
  color: var(--fg-mute);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(var(--ovr),0.04), 0 6px 18px rgba(0,0,0,0.3);
}
.avatar.disabled { cursor: default; }
.avatar.disabled .upload-overlay { display: none; }
.person-card[data-has-club="true"] .avatar {
  border-color: var(--club-border-strong);
  box-shadow: inset 0 1px 0 rgba(var(--ovr),0.06), 0 6px 18px rgba(0,0,0,0.35);
}
.avatar .upload-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  opacity: 0; transition: opacity 150ms;
}
.avatar:hover .upload-overlay { opacity: 1; }
.avatar.size-lg { width: 120px; height: 120px; font-size: 28px; }
.avatar.size-md { width: 84px; height: 84px; font-size: 20px; }
.avatar.size-sm { width: 64px; height: 64px; font-size: 16px; }

/* Party footer on person card */
.party-footer {
  margin-top: 12px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  min-height: 40px;
  min-width: 0;
  border-radius: 10px;
  background: rgba(var(--ovr),0.025);
  border: 1px solid var(--border);
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}
.person-card[data-has-club="true"] .party-footer {
  background: linear-gradient(180deg, var(--club-tint-soft), rgba(0,0,0,0)), rgba(var(--ovr),0.02);
  border-color: var(--club-border);
  box-shadow: 0 0 18px -4px var(--club-tint-strong), inset 0 1px 0 rgba(var(--ovr),0.04);
}
.party-footer .pf-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background-position: center; background-size: cover;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.party-footer .pf-name {
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--fg);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-footer .pf-empty {
  font-size: 12px; color: var(--fg-dim);
  font-style: italic;
  flex: 1;
}
.party-footer select {
  background: var(--bg-input);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a39d92' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}
.party-footer select:hover { background-color: var(--bg-soft); }
.party-footer select:focus { border-color: var(--accent); }

.deputy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; margin-bottom: 40px; }
.ministries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.deputy-grid > *, .ministries-grid > *, .leaders > * { min-width: 0; }

.remove-card-btn {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-dim);
  opacity: 0;
  transition: opacity 150ms, background 120ms, color 120ms;
  background: rgba(var(--ovr),0.05);
}
.person-card:hover .remove-card-btn { opacity: 1; }
.remove-card-btn:hover { background: var(--danger-soft); color: var(--danger); }

.add-card {
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  padding: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--fg-mute);
  font-weight: 600; font-size: 13px;
  min-height: 120px; cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.add-card.tall { min-height: 130px; border-radius: 16px; }
.add-card:hover { border-color: var(--fg); color: var(--fg); background: rgba(var(--ovr),0.02); }

@media (max-width: 760px) {
  .top-section { padding: 24px 20px 0; }
  .gov-header h2 { font-size: 28px; }
  .gov-section { padding: 48px 20px 72px; }
}

/* Brand bar */
.brand-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 44px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(220, 40, 40, 0.05) 0%, transparent 100%),
    var(--bg);
  position: relative;
}
.brand-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 40, 40, 0.30), transparent);
}
.brand-mark {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #d63333 0%, #a01616 100%);
  box-shadow:
    0 6px 18px -4px rgba(214, 51, 51, 0.55),
    inset 0 1px 0 rgba(var(--ovr),0.30),
    inset 0 -1px 0 rgba(0,0,0,0.20);
  border: 1px solid rgba(var(--ovr),0.08);
  flex-shrink: 0;
}
.brand-mark span {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.10em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-full {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.020em;
  color: var(--fg);
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-full .brand-strong {
  color: #ea5a5a;
}
.brand-full .brand-paren {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--fg-mute);
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(var(--ovr),0.03);
}
.brand-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.brand-spacer { flex: 1; }
@media (max-width: 760px) {
  .brand-bar { padding: 14px 20px; gap: 12px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark span { font-size: 12px; }
  .brand-full { font-size: 16px; }
  .brand-full .brand-paren { font-size: 11px; padding: 1px 6px; }
  .brand-sub { font-size: 10px; letter-spacing: 0.12em; }
}

/* Header utility actions */
.header-actions { display: inline-flex; align-items: center; gap: 8px; }

/* Photo cropper modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.cropper-modal {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  max-width: 95vw;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-card);
}
.cropper-title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.cropper-hint {
  font-size: 12px; color: var(--fg-mute); margin-top: -8px;
}
.cropper-stage {
  touch-action: none;
  position: relative;
  background:
    linear-gradient(45deg, rgba(var(--ovr),0.025) 25%, transparent 25%, transparent 75%, rgba(var(--ovr),0.025) 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, rgba(var(--ovr),0.025) 25%, transparent 25%, transparent 75%, rgba(var(--ovr),0.025) 75%) 10px 10px / 20px 20px,
    var(--bg);
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  border: 1px solid var(--border);
  align-self: center;
}
.cropper-stage:active { cursor: grabbing; }
.cropper-img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  pointer-events: none;
  max-width: none;
  max-height: none;
  -webkit-user-drag: none;
}
.cropper-circle-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle closest-side at center, transparent 99%, rgba(0,0,0,0.55) 100%);
}
.cropper-controls {
  display: flex; align-items: center; gap: 12px;
}
.cropper-zoom-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-mute);
  min-width: 96px;
}
.cropper-zoom-slider {
  flex: 1;
  accent-color: var(--accent);
}
.cropper-actions {
  display: flex; gap: 8px; align-items: center;
}

/* ============ Rozmowa z politykiem ============ */
.chat-card-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ovr),0.03);
  color: var(--fg);
  font-weight: 600; font-size: 13px;
  transition: background 140ms, border-color 140ms, color 140ms, transform 80ms;
}
.person-card[data-has-club="true"] .chat-card-btn {
  border-color: var(--club-border);
  background: var(--club-tint-soft);
  color: var(--club-color-mute);
}
.chat-card-btn:hover {
  background: rgba(var(--ovr),0.07);
  border-color: var(--fg-dim);
  color: var(--fg);
}
.person-card[data-has-club="true"] .chat-card-btn:hover {
  background: var(--club-tint-strong);
  border-color: var(--club-border-strong);
  color: var(--fg);
}
.chat-card-btn:active { transform: translateY(1px); }
.chat-card-btn svg { flex: none; }
.person-card.size-sm .chat-card-btn { padding: 8px 10px; font-size: 12px; }

/* Modal */
.chat-modal {
  width: 560px; max-width: 95vw;
  height: 640px; max-height: 88vh;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.chat-modal[data-has-club="true"] { border-color: var(--club-border-strong); }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 18px; flex: none;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(var(--ovr),0.04) 0%, transparent 72%);
}
.chat-modal[data-has-club="true"] .chat-header {
  background: linear-gradient(160deg, var(--club-tint-strong) 0%, transparent 72%);
}
.chat-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-modal .chat-id .avatar { width: 42px; height: 42px; font-size: 15px; border-radius: 50%; flex: none; }
.chat-id-text { min-width: 0; }
.chat-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; line-height: 1.2; }
.chat-role {
  font-size: 12px; color: var(--fg-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px;
}
.chat-modal[data-has-club="true"] .chat-role { color: var(--club-color-mute); }
.chat-header-actions { display: flex; gap: 6px; flex: none; }
.chat-icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-mute); background: rgba(var(--ovr),0.04);
  transition: background 120ms, color 120ms;
}
.chat-icon-btn:hover { background: var(--bg-soft); color: var(--fg); }

/* Settings */
.chat-settings {
  padding: 16px 18px; flex: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  display: flex; flex-direction: column; gap: 12px;
}
.chat-settings-row { display: flex; flex-direction: column; gap: 6px; }
.chat-settings-row label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-mute);
}
.chat-settings input, .chat-settings select {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--fg);
  font-family: inherit; font-size: 13px;
}
.chat-settings input:focus, .chat-settings select:focus { border-color: var(--accent); outline: none; }
.chat-settings-hint { font-size: 11.5px; color: var(--fg-dim); line-height: 1.5; }
.chat-settings-actions { display: flex; gap: 8px; }
.chat-settings-actions .primary-btn { flex: none; }

/* Body / messages */
.chat-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.chat-empty {
  margin: auto; text-align: center;
  color: var(--fg-dim); font-size: 13px; max-width: 320px; line-height: 1.55;
}
.chat-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.chat-msg.assistant { margin-right: auto; }
.chat-msg.user { margin-left: auto; flex-direction: row-reverse; }
.chat-modal .chat-msg .avatar { width: 30px; height: 30px; font-size: 12px; border-radius: 50%; flex: none; }
.chat-bubble {
  padding: 11px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-msg.assistant .chat-bubble {
  background: var(--bg-soft); color: var(--fg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--accent); color: var(--on-accent); font-weight: 500;
  border-bottom-right-radius: 4px;
}
.chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 2px; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--fg-mute);
  animation: chat-bounce 1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.chat-error {
  font-size: 12.5px; color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-soft);
  padding: 10px 12px; border-radius: 10px;
}

/* Input */
.chat-input-row {
  display: flex; gap: 10px; align-items: flex-end; flex: none;
  padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.chat-input {
  flex: 1; resize: none; max-height: 140px; min-height: 22px;
  padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--fg);
  font-family: inherit; font-size: 14px; line-height: 1.45;
}
.chat-input:focus { border-color: var(--accent); outline: none; }
.chat-input:disabled { opacity: 0.6; }
.chat-send {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--fg); color: var(--on-fg);
  transition: background 120ms, opacity 120ms;
}
.chat-send:hover:not(:disabled) { background: var(--fg-hover); }
.chat-send:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 760px) {
  .chat-modal { height: 92vh; max-height: 92vh; border-radius: 14px; }
  .modal-backdrop { padding: 10px; }
}

/* ============ Sekcja opozycji (czerwone akcenty) ============ */
.opp-section-wrapper {
  background:
    linear-gradient(180deg, var(--opp-soft) 0%, rgba(0,0,0,0) 260px),
    var(--bg);
}
.opp-section-wrapper .section-eyebrow-bar .eyebrow { color: var(--opp); }
.opp-section-wrapper .section-eyebrow-bar .eyebrow::before { background: var(--opp); }

.opp-section .group-label h3 { color: var(--opp); }
.opp-section .group-label h3::before { background: var(--opp); }

.opp-section .gov-edit-toggle:hover { background: var(--opp-soft); border-color: rgba(240,110,100,0.35); }
.opp-section .gov-edit-toggle.active {
  background: var(--opp);
  color: var(--on-accent);
  border-color: var(--opp);
  box-shadow: var(--shadow-glow-opp);
}
.opp-section .gov-edit-toggle.active:hover { background: oklch(0.77 0.21 25); }

.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 14px;
}
.opp-grid > * { min-width: 0; }

/* Karty bez przypisanego koloru partii dostają delikatny czerwony akcent sekcji */
.opp-grid .person-card:not([data-has-club="true"]) { border-color: rgba(240,110,100,0.20); }
.opp-grid .person-card:not([data-has-club="true"]) .role-eyebrow { color: var(--opp); }

.opp-empty {
  padding: 28px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 13px;
  border: 1px dashed rgba(240,110,100,0.30);
  border-radius: 14px;
  background: rgba(240,110,100,0.04);
}

/* ============ Tryb jasny ============ */
[data-theme="light"] {
  --bg: #f3efe7;
  --bg-elev: #ffffff;
  --bg-elev-2: #f7f4ee;
  --bg-soft: #eae4d9;
  --bg-input: #ffffff;

  --fg: #1d1a15;
  --fg-mute: #5e584d;
  --fg-dim: #8c857a;

  --ovr: 0,0,0;                /* overlaye stają się ciemne na jasnym tle */
  --seat-empty: #d8d2c6;
  --fg-hover: #3a342b;
  --on-fg: #f6f3ec;
  --on-accent: #ffffff;
  --floor-blend: multiply;

  --accent: oklch(0.55 0.16 250);
  --accent-soft: oklch(0.55 0.13 250 / 0.16);

  --danger: oklch(0.55 0.20 25);
  --danger-soft: oklch(0.62 0.17 25 / 0.16);

  --gov: oklch(0.52 0.15 145);
  --gov-soft: oklch(0.72 0.14 145 / 0.20);
  --opp: oklch(0.55 0.21 25);
  --opp-soft: oklch(0.70 0.18 25 / 0.18);

  --shadow-soft:
    0 1px 2px rgba(60,45,20,0.05),
    0 6px 16px rgba(60,45,20,0.07);
  --shadow-card:
    0 1px 2px rgba(60,45,20,0.06),
    0 10px 28px rgba(60,45,20,0.09),
    0 24px 56px rgba(60,45,20,0.07);
  --shadow-glow-gov:
    0 0 0 1px rgba(40,140,80,0.22) inset,
    0 10px 26px rgba(40,140,80,0.14);
  --shadow-glow-opp:
    0 0 0 1px rgba(200,60,55,0.22) inset,
    0 10px 26px rgba(200,60,55,0.16);
}

/* Tooltip i logo-marka zostają „ciemne" także w trybie jasnym — lokalnie przywracamy biały overlay */
[data-theme="light"] .info-card,
[data-theme="light"] .brand-mark { --ovr: 255,255,255; }

/* ============ Przełącznik motywu ============ */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ovr), 0.03);
  color: var(--fg-mute);
  flex-shrink: 0;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.theme-toggle:hover { background: var(--bg-soft); color: var(--fg); border-color: var(--fg-dim); }

/* ============ Urządzenia mobilne ============ */
@media (max-width: 760px) {
  /* Sekcje — mniejszy padding poziomy */
  .top-section { min-height: auto; padding: 20px 16px 0; }
  .section-eyebrow-bar { padding: 26px 16px 0; }
  .chart-section { padding: 22px 16px 32px; }
  .gov-section { padding: 36px 16px 64px; }

  /* Górny pasek narzędzi — eyebrow nad przyciskami, przyciski 2×2 */
  .header-utility { flex-wrap: wrap; gap: 12px; }
  .header-utility .header-actions { width: 100%; gap: 8px; }
  .header-utility .header-actions > button { flex: 1 1 calc(50% - 4px); justify-content: center; }

  /* Nazwa rządu */
  .gov-name-block { margin: 4px auto 20px; }
  .gov-name-input { font-size: clamp(24px, 7vw, 40px); }
  .gov-name-block .sub { font-size: 13px; }

  /* Podsumowanie — jedna kolumna */
  .summary-bar { grid-template-columns: 1fr; gap: 10px; }
  .summary-pill { padding: 14px 16px; min-height: 0; }
  .summary-pill .pill-num { font-size: 30px; }

  /* Hemicykl — pudełko dopasowane do proporcji rysunku (bez pustej przestrzeni) */
  .hemicycle-wrap {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    width: 100%;
    aspect-ratio: 3.24 / 1.58;
    max-height: 62vh;
    align-items: center;
  }

  /* Nagłówki sekcji rządu / opozycji / wykresu */
  .gov-header { gap: 12px; margin-bottom: 28px; }
  .gov-header h2 { font-size: 26px; }

  /* Wykres słupkowy — oś Y schowana (wartości są na słupkach), etykiety progów do środka */
  .chart-container { padding-top: 120px; }
  .chart-y-axis { display: none; }
  .chart-plot { gap: 8px; }
  .threshold-label {
    right: 4px;
    align-items: flex-end;
    background: var(--bg-elev);
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
  }

  /* Szuflada klubów — pełna szerokość, edytor jednokolumnowy */
  .drawer { width: 100vw; max-width: 100vw; }
  .club-editor { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .top-section { padding: 16px 12px 0; }
  .section-eyebrow-bar { padding: 22px 12px 0; }
  .chart-section, .gov-section { padding-left: 12px; padding-right: 12px; }
  .summary-pill .pill-num { font-size: 26px; }
  .person-card.size-lg { padding: 18px; }
  .person-card.size-lg .person-main { gap: 14px; }
}

/* ============ Przycisk „do debaty" w rogu karty ============ */
.debate-card-btn {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); background: rgba(var(--ovr),0.05);
  color: var(--fg-mute);
  transition: background 140ms, color 140ms, border-color 140ms, transform 90ms;
}
.debate-card-btn:hover { background: rgba(var(--ovr),0.10); color: var(--fg); border-color: var(--fg-dim); transform: scale(1.06); }
.debate-card-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.person-card[data-has-club="true"] .debate-card-btn.active { background: var(--club-color); border-color: var(--club-color); color: #fff; }

/* ============ Sekcja debat ============ */
/* sekcja debat — eyebrow w domyślnym kolorze (jak pozostałe sekcje) */

.debate-topic-block { text-align: center; margin: 6px auto 10px; }
.debate-topic-label { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 6px; }
.debate-topic-input {
  background: transparent; border: none; outline: none; font: inherit;
  color: var(--fg); font-size: clamp(24px, 3.2vw, 38px); font-weight: 700;
  letter-spacing: -0.02em; text-align: center; padding: 4px 12px; border-radius: 10px;
  transition: background 120ms, box-shadow 120ms;
}
.debate-topic-input:hover { background: rgba(var(--ovr),0.03); }
.debate-topic-input:focus { background: rgba(var(--ovr),0.05); box-shadow: inset 0 0 0 1px var(--accent); }
.debate-topic-input::placeholder { color: var(--fg-dim); font-style: italic; }

/* Studio stage (zawsze ciemne, niezależnie od motywu) */
.debate-stage {
  position: relative; margin: 8px 0 22px;
  border-radius: 20px; padding: 56px 24px 0;
  background: radial-gradient(120% 85% at 50% -12%, #2c2d36 0%, #16161d 46%, #0b0b0f 100%);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden; min-height: 360px;
}
.debate-stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent); pointer-events: none;
}
.debate-podiums {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  max-width: 760px; margin: 0 auto;
}
.debate-vs {
  align-self: center; padding-bottom: 64px;
  font-family: "IBM Plex Mono", monospace; font-weight: 800; font-size: 20px;
  color: rgba(255,255,255,0.45); letter-spacing: 0.05em;
}
.debate-podium {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding-top: 40px; transition: opacity 240ms; min-width: 0;
}
.debate-podium:not(.active) { opacity: 0.6; }
.debate-podium.empty { opacity: 0.45; }

/* Światło studyjne — zakotwiczone u samej góry sceny, nie rusza się z tekstem */
.debate-beam {
  position: absolute; top: 0; width: 300px; height: 82%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(255,249,232,0.16), rgba(255,249,232,0.045) 50%, transparent 82%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  filter: blur(11px); mix-blend-mode: screen;
  opacity: 0; transition: opacity 450ms ease; pointer-events: none; z-index: 1;
}
.debate-beam.side-l { left: calc(50% - 200px); }
.debate-beam.side-r { left: calc(50% + 200px); }
.debate-beam.on { opacity: 1; }

.debate-figure { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.debate-section .debate-figure .avatar {
  width: 92px; height: 92px; border-radius: 50%; font-size: 26px;
  border: 3px solid rgba(255,255,255,0.15); box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: border-color 240ms, box-shadow 240ms, transform 240ms; flex: none;
}
.debate-podium.active .debate-figure .avatar {
  border-color: var(--club-color, #ffe8a0); transform: translateY(-4px);
  box-shadow: 0 0 0 4px var(--club-tint-strong, rgba(255,232,160,0.22)), 0 0 42px var(--club-tint-strong, rgba(255,232,160,0.4)), 0 10px 30px rgba(0,0,0,0.5);
}
.debate-name { font-weight: 700; font-size: 15px; color: #fff; text-align: center; line-height: 1.2; }
.debate-role { font-size: 11px; color: rgba(255,255,255,0.6); text-align: center; max-width: 170px; line-height: 1.3; }
.debate-podium[data-has-club="true"] .debate-role { color: var(--club-color-mute); }

.debate-lectern {
  position: relative; z-index: 1; width: 120px; height: 88px; margin-top: 6px;
  background: linear-gradient(180deg, var(--club-color, #4a4a55) 0%, #1c1c24 72%);
  clip-path: polygon(9% 0, 91% 0, 70% 100%, 30% 100%);
  border-radius: 4px 4px 0 0; box-shadow: inset 0 2px 0 rgba(255,255,255,0.08); opacity: 0.9;
}

.debate-bubble {
  position: relative; z-index: 3; max-width: min(280px, 100%); min-height: 42px;
  margin-bottom: 18px; padding: 12px 15px;
  background: rgba(255,255,255,0.97); color: #16151a; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.debate-bubble::after {
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px; background: rgba(255,255,255,0.97);
}
.debate-bubble.empty { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); box-shadow: none; }
.debate-bubble.empty::after { background: rgba(255,255,255,0.08); }
.debate-bubble .ph { font-style: italic; }
.debate-caret { display: inline-block; margin-left: 1px; color: var(--club-color-mute, #999); animation: debate-blink 0.9s steps(1) infinite; }
@keyframes debate-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.debate-remove {
  position: absolute; top: 0; right: 4px; z-index: 5;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.7);
  opacity: 0; transition: opacity 150ms, background 120ms;
}
.debate-podium:hover .debate-remove { opacity: 1; }
.debate-remove:hover { background: var(--danger); color: #fff; }

.debate-empty-fig {
  width: 92px; height: 92px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.35);
}
.debate-empty-hint { font-size: 11px; color: rgba(255,255,255,0.42); text-align: center; max-width: 150px; margin-top: 10px; line-height: 1.35; }

.debate-controls { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.debate-controls .primary-btn { flex: 0 0 auto; min-width: 220px; }
.debate-hint { font-size: 12px; color: var(--fg-mute); }
.debate-keyrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.debate-keyrow input {
  width: min(360px, 90%); padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--fg); font-size: 13px; outline: none;
}
.debate-keyrow input:focus { border-color: var(--accent); }

@media (max-width: 600px) {
  .debate-podiums { gap: 8px; }
  .debate-section .debate-figure .avatar { width: 64px; height: 64px; font-size: 18px; }
  .debate-lectern { width: 84px; height: 64px; }
  .debate-vs { font-size: 15px; padding-bottom: 42px; }
  .debate-bubble { font-size: 12px; padding: 9px 11px; }
  .debate-beam { width: 180px; }
  .debate-beam.side-l { left: calc(50% - 88px); }
  .debate-beam.side-r { left: calc(50% + 88px); }
  .debate-stage { padding: 40px 10px 0; min-height: 300px; }
  .debate-empty-fig { width: 64px; height: 64px; }
}

/* Ustawienia API/model, dodatkowy kontekst, pytanie prowadzącego, baner */
.debate-settings {
  max-width: 460px; margin: 12px auto 0;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px;
}
.debate-settings input, .debate-settings select {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--fg);
  font-family: inherit; font-size: 13px; outline: none;
}
.debate-settings input:focus, .debate-settings select:focus { border-color: var(--accent); }

.debate-extra { max-width: 620px; margin: 6px auto 0; }
.debate-extra-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 6px; text-align: center; }
.debate-extra-input {
  width: 100%; resize: vertical; min-height: 48px; max-height: 160px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--fg); font-family: inherit; font-size: 13px; line-height: 1.45; outline: none;
}
.debate-extra-input:focus { border-color: var(--accent); }

.debate-gear { border: 1px solid var(--border-strong); width: 38px; height: 38px; }
.debate-ask { display: flex; gap: 8px; max-width: 620px; margin: 12px auto 0; }
.debate-ask-input {
  flex: 1; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--fg); font-size: 13px; outline: none;
}
.debate-ask-input:focus { border-color: var(--accent); }

.debate-mod-banner {
  position: relative; z-index: 3; max-width: 560px; margin: 0 auto 20px;
  background: rgba(217,165,33,0.14); border: 1px solid rgba(217,165,33,0.40);
  color: #f0d488; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.4; text-align: center;
}
.debate-mod-banner .mod-label {
  display: inline-block; margin-right: 8px; font-weight: 800; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #d9a521;
}
