:root {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --border: #e3e5ea;
  --accent: #0b3d91;
  --accent-dark: #07285e;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 24, 40, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 24, 40, 0.12);
  --max-width: 1080px;
  --tag-bg: #eef1f6;
  --pill-in-bg: #e5f5ea;
  --pill-in-text: #1a7a3c;
  --pill-out-bg: #f3f0fa;
  --pill-out-text: #6a4fb8;
  --pill-none-bg: #eef1f6;
  --pill-none-text: #5b6270;
  /* Разделителният цвят в логото — трябва да съвпада с фона под него. */
  --logo-gap: #ffffff;
  /* Раздел в разработка */
  --wip-dot: #e0a422;
  --wip-halo: rgba(224, 164, 34, 0.18);
  --wip-text: #8a6410;
  --wip-bg: #fdf6e6;
  --wip-border: #f0dcae;
}

:root[data-theme="dark"] {
  --bg: #12151c;
  --bg-card: #1c212c;
  --text: #eef0f3;
  --text-muted: #9aa1ad;
  --border: #2b3140;
  --accent: #6ea3ff;
  --accent-dark: #a8c7ff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.45);
  --tag-bg: #232838;
  --pill-in-bg: rgba(52, 199, 118, 0.16);
  --pill-in-text: #6adf98;
  --pill-out-bg: rgba(150, 110, 255, 0.18);
  --pill-out-text: #c3b0ff;
  --pill-none-bg: #232838;
  --pill-none-text: #9aa1ad;
  --logo-gap: #1c212c;
  --wip-dot: #eab54a;
  --wip-halo: rgba(234, 181, 74, 0.2);
  --wip-text: #e0b463;
  --wip-bg: #2a2316;
  --wip-border: #4a3d21;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand svg { flex-shrink: 0; display: block; }
.brand-logo {
  width: 30px;
  height: 30px;
  color: var(--accent-dark);
}

.header-bar .brand { margin-right: auto; }

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { display: block; }

/* Hamburger button */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: background 0.15s ease;
}
.menu-btn:hover span { background: var(--accent); }

/* Overlay + side drawer menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 25;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--bg-card);
  box-shadow: 10px 0 30px rgba(20, 24, 40, 0.18);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.side-menu.open {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.menu-close {
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.menu-close:hover { color: var(--accent); }

.menu-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.menu-list > li {
  border-bottom: 1px solid var(--border);
}
.menu-list > li:last-child { border-bottom: none; }

.menu-list > li > a,
.menu-group-title {
  display: block;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.menu-list > li > a:hover,
.menu-group-title:hover {
  color: var(--accent);
}

/* Заглавие на раздел с подменю + стрелка за разгъване */
.menu-group-head {
  display: flex;
  align-items: center;
}
.menu-group-head .menu-group-title { flex: 1; }

.menu-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  align-self: stretch;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.menu-sub-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.menu-sub-toggle:hover { color: var(--accent); }

/* Подменюто е свито по подразбиране и се разгъва при посочване с курсора.
   Обвивката е grid с една редица: 0fr -> 1fr анимира до истинската височина
   на съдържанието, вместо до предположена стойност. Затова движението е плавно
   и не зависи от това колко партии има в списъка. */
.menu-sub-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s cubic-bezier(0.33, 1, 0.68, 1);
}
.menu-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease 0.04s, visibility 0.22s;
}
.menu-group:hover .menu-sub-wrap,
.menu-group:focus-within .menu-sub-wrap,
.menu-group.open .menu-sub-wrap {
  grid-template-rows: 1fr;
}
.menu-group:hover .menu-sub,
.menu-group:focus-within .menu-sub,
.menu-group.open .menu-sub {
  visibility: visible;
  opacity: 1;
  padding-bottom: 12px;
}
.menu-group:hover .menu-sub-toggle svg,
.menu-group:focus-within .menu-sub-toggle svg,
.menu-group.open .menu-sub-toggle svg {
  transform: rotate(180deg);
}

.menu-sub li a {
  display: block;
  padding: 8px 18px 8px 34px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.menu-sub li a:hover { color: var(--accent); }
.menu-sub li a.menu-more {
  font-weight: 700;
  color: var(--accent-dark);
}

/* Ако системата иска по-малко движение — разгъването става без плъзгане. */
@media (prefers-reduced-motion: reduce) {
  .menu-sub-wrap,
  .menu-sub,
  .menu-sub-toggle svg { transition: none; }
}

/* Там, където няма курсор, посочването не е надежден начин — остава стрелката. */
@media (hover: none) {
  .menu-group:hover .menu-sub-wrap { grid-template-rows: 0fr; }
  .menu-group:hover .menu-sub {
    visibility: hidden;
    opacity: 0;
    padding-bottom: 0;
  }
  .menu-group.open .menu-sub-wrap { grid-template-rows: 1fr; }
  .menu-group.open .menu-sub {
    visibility: visible;
    opacity: 1;
    padding-bottom: 12px;
  }
}

/* Раздел в разработка — показва се, но не е достъпен */
.menu-wip {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-wip-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: default;
}
.menu-wip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wip-text);
}
.wip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wip-dot);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--wip-halo);
}

/* Лента върху самата страница в разработка */
.wip-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--wip-bg);
  border: 1px solid var(--wip-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 26px 0 0;
}
.wip-banner .wip-dot { margin-top: 6px; }
.wip-banner-text { font-size: 0.9rem; }
.wip-banner-text strong { display: block; margin-bottom: 3px; }
.wip-banner-text span { color: var(--text-muted); }

body.menu-locked {
  overflow: hidden;
}

/* Hero */
.hero {
  padding: 48px 0 32px;
}
.hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.hero p {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 22px;
  font-size: 1.02rem;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
}
.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 120px;
}
.stat-chip .num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.stat-chip .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Landing hero */
.landing-hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0d2447;
}
.hero-illustration {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  filter: blur(7px) saturate(1.05);
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 38, 0.35) 0%, rgba(8, 18, 38, 0.65) 55%, rgba(8, 18, 38, 0.92) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 90px 20px;
}
.hero-inner .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 16px;
}
.hero-inner h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.15;
  max-width: 780px;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero-inner .lead {
  font-size: 1.12rem;
  max-width: 620px;
  opacity: 0.92;
  margin: 0 0 30px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--accent-dark);
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hero-cta:hover {
  background: #f0f2f6;
  transform: translateY(-2px);
}
.hero-secondary {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 2px;
}
.hero-secondary:hover { color: #fff; border-color: #fff; }

/* Teaser strip */
.teaser {
  margin: -46px auto 56px;
  position: relative;
  z-index: 3;
}
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.teaser-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.teaser-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-dark);
}
.teaser-label {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Explore section */
.explore {
  margin: 8px auto 64px;
}
.explore-head {
  margin-bottom: 18px;
}
.explore-head h2 {
  font-size: 1.3rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.explore-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.explore-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  flex-shrink: 0;
}
.explore-icon svg { width: 22px; height: 22px; }
.explore-card h3 {
  margin: 0;
  font-size: 1.05rem;
}
.explore-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  flex: 1;
}
.explore-link {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--accent-dark);
}

/* Party sections */
.party-section {
  margin: 44px 0 0;
}
.party-section:last-child { margin-bottom: 60px; }

.party-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.party-section-head h2 {
  font-size: 1.3rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.party-section-count {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.party-section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 5px 0 18px;
}

/* Party rows (stacked list) */
.party-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.party-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.party-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--party-color);
}

/* Цветът на партията присъства само като тънка вертикална лента отляво. */
.row-stripe {
  display: block;
  background: linear-gradient(180deg, var(--party-color), var(--party-color-dark));
  transition: width 0.15s ease;
}
/* Аватар на лидер: инициали отдолу, снимка отгоре (само на страницата на партията) */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(140deg, var(--party-color, var(--accent)), var(--party-color-dark, var(--accent-dark)));
  color: #fff;
  font-weight: 700;
  line-height: 1;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 1.5rem;
}

/* Карта „Лидер“ на страницата на партията */
.leader-block {
  display: flex;
  align-items: center;
  gap: 16px;
}
.leader-meta { min-width: 0; }
.leader-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.leader-role {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.row-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row-name {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.row-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 2px;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.row-leader { min-width: 0; }
.row-leader .k { font-weight: 600; }
.row-seats {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  white-space: nowrap;
}
.row-seats strong { font-size: 1rem; }
.row-seatbar {
  display: inline-block;
  width: 84px;
  height: 6px;
  border-radius: 999px;
  background: var(--tag-bg);
  overflow: hidden;
}
.row-seatbar span {
  display: block;
  height: 100%;
  background: var(--party-color);
  border-radius: 999px;
}

.row-chevron {
  display: flex;
  align-items: center;
  padding-right: 18px;
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.row-chevron svg { width: 20px; height: 20px; }
.party-row:hover .row-chevron {
  color: var(--party-color);
  transform: translateX(3px);
}

@media (max-width: 680px) {
  /* Лентата остава отляво и на телефон — само стрелката отпада. */
  .party-row {
    grid-template-columns: 5px 1fr;
  }
  .row-body {
    padding: 16px 16px;
  }
  .row-chevron {
    display: none;
  }
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.72rem;
  background: var(--tag-bg);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.gov-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.gov-pill.in {
  background: var(--pill-in-bg);
  color: var(--pill-in-text);
}
.gov-pill.out {
  background: var(--pill-out-bg);
  color: var(--pill-out-text);
}
.gov-pill.none {
  background: var(--pill-none-bg);
  color: var(--pill-none-text);
}

/* Detail page */
.party-hero {
  padding: 40px 0 28px;
  color: #fff;
}
.party-hero .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.party-hero .badge-lg {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 18px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}
/* Логото на партията се показва само тук — затова му даваме собствена бяла плоча. */
.party-hero .badge-lg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}
@media (max-width: 560px) {
  .party-hero .badge-lg { width: 84px; height: 84px; }
}
.party-hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}
.party-hero .tagline {
  opacity: 0.92;
  font-size: 1.02rem;
}
.back-link {
  display: inline-block;
  margin: 18px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.back-link:hover { color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin: 28px 0 60px;
  align-items: start;
}
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.card p { margin: 0 0 10px; color: var(--text); }

.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.info-list li:last-child { border-bottom: none; }
.info-list .k { color: var(--text-muted); }
.info-list .v { text-align: right; font-weight: 600; }

.positions { list-style: none; padding: 0; margin: 0; }
.positions li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.positions li:last-child { border-bottom: none; }
.positions .topic {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 3px;
}
.positions .pos {
  color: var(--text-muted);
  font-size: 0.9rem;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.results th, table.results td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
}
table.results th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 2px solid var(--border);
  font-size: 0.9rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline .y {
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  margin-right: 10px;
  margin-top: 4px;
}
.contact-btn:hover { border-color: var(--accent); color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.version-tag {
  margin-top: 10px;
  font-size: 0.75rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* Hemicycle seat diagram */
.hemicycle-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 10px;
  margin: 18px 0 0;
}
.hemicycle-wrap svg { width: 100%; height: auto; display: block; }
.hemicycle-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 14px 4px 18px;
  justify-content: center;
}
.hemicycle-legend .item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.hemicycle-legend .swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}
.hemicycle-legend strong { color: var(--text); font-weight: 700; }

/* Elections history — вертикална хронология */
.vote-timeline {
  list-style: none;
  margin: 30px 0 34px;
  padding: 0;
  position: relative;
}
/* Линията минава през центъра на пролуката между колоната с годината (96px) и картата (22px gap). */
.vote-timeline::before {
  content: "";
  position: absolute;
  left: 106px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.vote-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 22px;
  margin-bottom: 16px;
}

.vote-year {
  position: relative;
  text-align: right;
  padding-top: 16px;
}
.vote-year-num {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
/* Точката ляга точно върху линията: центърът ѝ съвпада със 106px от левия ръб. */
.vote-year::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--win-color);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}
.vote-badge {
  display: block;
  margin-top: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--win-color);
}

.vote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--win-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px 15px;
}
.vote-item.is-latest .vote-card {
  box-shadow: var(--shadow-hover);
}

.vote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.vote-assembly::before {
  content: "·";
  margin-right: 14px;
}

.vote-winner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.vote-winner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--win-color);
  flex-shrink: 0;
}
.vote-winner-name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.vote-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.vote-bar-row {
  display: grid;
  grid-template-columns: 64px 1fr 92px;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}
.vote-bar-label {
  color: var(--text-muted);
}
.vote-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  overflow: hidden;
}
.vote-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--win-color);
}
.vote-bar-fill.soft {
  opacity: 0.45;
}
.vote-bar-value {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.vote-bar-value .dim {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.vote-turnout {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.vote-turnout strong { color: var(--text); }

.timeline-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0 0 56px;
  max-width: 640px;
}

@media (max-width: 620px) {
  .vote-timeline::before { display: none; }
  .vote-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .vote-year {
    text-align: left;
    padding-top: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .vote-year::after { display: none; }
  .vote-badge { margin-top: 0; }
  .vote-bar-row {
    grid-template-columns: 58px 1fr 84px;
    gap: 8px;
    font-size: 0.76rem;
  }
}

/* ---------- Тест „Кой ми пасва" ---------- */
.quiz-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  transition: border-color 0.15s ease;
}
.quiz-q.answered { border-color: var(--accent); }

.quiz-q-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.quiz-q-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quiz-q.answered .quiz-q-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.quiz-q-topic {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 3px;
}
.quiz-q-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 40px;
}
.quiz-opt {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quiz-opt:hover { border-color: var(--accent); color: var(--accent); }
.quiz-opt.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.quiz-skip { color: var(--text-muted); }
.quiz-skip.selected {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 26px 0 60px;
}
.quiz-progress { color: var(--text-muted); font-size: 0.9rem; }
.quiz-progress strong { color: var(--text); }

.quiz-submit,
.quiz-restart {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.quiz-submit:hover:not(:disabled),
.quiz-restart:hover { transform: translateY(-2px); }
.quiz-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.quiz-secondary {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.quiz-secondary:hover { color: var(--accent); border-color: var(--accent); }

/* Резултати */
.quiz-results { margin-top: 26px; }

.quiz-top {
  background: linear-gradient(135deg, var(--party-color), var(--party-color-dark));
  border-radius: var(--radius);
  padding: 30px 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-hover);
}
.quiz-top-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.85;
}
.quiz-top-name {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}
.quiz-top-name:hover { text-decoration: underline; }
.quiz-top-pct { font-size: 1.05rem; font-weight: 700; }
.quiz-top-note { font-size: 0.8rem; opacity: 0.82; }

.quiz-rank {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 20px;
  margin-bottom: 24px;
}
.quiz-rank-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 1fr 48px 68px;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
}
.quiz-rank-row:last-child { border-bottom: none; }
.quiz-rank-name { font-weight: 600; }
.quiz-rank-name:hover { color: var(--accent); }
.quiz-rank-track {
  height: 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  overflow: hidden;
}
.quiz-rank-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--party-color);
}
.quiz-rank-pct { font-weight: 700; text-align: right; }
.quiz-rank-base {
  color: var(--text-muted);
  font-size: 0.74rem;
  text-align: right;
  white-space: nowrap;
}

.quiz-why-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 14px; }
.quiz-why-list { list-style: none; margin: 0; padding: 0; }
.quiz-why-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.quiz-why-list li:last-child { border-bottom: none; }
.quiz-why-q { font-weight: 600; font-size: 0.92rem; margin-bottom: 5px; }
.quiz-why-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.quiz-why-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.quiz-why-tag.ok { background: var(--pill-in-bg); color: var(--pill-in-text); }
.quiz-why-tag.mid { background: var(--tag-bg); color: var(--text-muted); }
.quiz-why-tag.no { background: var(--pill-out-bg); color: var(--pill-out-text); }
.quiz-why-src { color: var(--text-muted); font-size: 0.84rem; }

.quiz-disclaimer {
  color: var(--text-muted);
  font-size: 0.8rem;
  max-width: 680px;
  margin: 0 0 60px;
}

@media (max-width: 620px) {
  .quiz-options { padding-left: 0; }
  .quiz-rank-row {
    grid-template-columns: 1fr 44px;
    gap: 6px 10px;
  }
  .quiz-rank-track { grid-column: 1 / -1; order: 3; }
  .quiz-rank-base { grid-column: 1 / -1; order: 4; text-align: left; }
  .quiz-actions { justify-content: flex-start; }
}

/* ---------- Анкета до партиите ---------- */
.survey-intro {
  max-width: 720px;
  margin: 36px 0 26px;
}
.survey-intro h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 12px; }
.survey-facts {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.survey-facts li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.survey-facts li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.survey-form { margin-bottom: 60px; }

.survey-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px 22px;
  margin: 0 0 18px;
}
.survey-section legend {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0 10px;
  color: var(--accent-dark);
}

.survey-field {
  display: block;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}
.survey-field input {
  display: block;
  width: 100%;
  max-width: 460px;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 400;
}
.survey-field input:focus,
.survey-comment textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.req { color: #d64545; }

.survey-q {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.survey-q:last-of-type { border-bottom: none; }
.survey-q-text {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}
.survey-q-num { color: var(--text-muted); margin-right: 4px; }

.survey-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.survey-scale label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s ease;
}
.survey-scale label:hover { border-color: var(--accent); }
.survey-scale input { accent-color: var(--accent); margin: 0; }
.survey-scale input:checked + span { font-weight: 700; color: var(--accent); }

.survey-comment {
  display: block;
  margin-top: 16px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}
.survey-comment textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  resize: vertical;
}

.survey-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.88rem;
  cursor: pointer;
}
.survey-check input { margin-top: 3px; accent-color: var(--accent); }

.survey-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.survey-note { color: var(--text-muted); font-size: 0.82rem; }

/* Страница с благодарност след изпратена анкета */
.thanks-block { text-align: left; }
.thanks-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--pill-in-bg);
  color: var(--pill-in-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.thanks-mark svg { width: 28px; height: 28px; }

/* ---------- Политическа грамотност ---------- */
.edu-group { margin: 0 0 44px; }
.edu-group-head { margin-bottom: 18px; }
.edu-group-head h2 {
  font-size: 1.25rem;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.edu-group-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.edu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.edu-card-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.edu-card-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.89rem;
  flex: 1;
}
.edu-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.edu-arrow { color: var(--accent-dark); font-weight: 700; }
.edu-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0;
}

/* Статия в раздела */
.edu-eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent);
  margin: 26px 0 8px;
}

.edu-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 24px;
}
.edu-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.edu-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.edu-step strong { display: block; margin-bottom: 3px; }
.edu-step p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }

.edu-note,
.edu-warn {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 0.92rem;
}
.edu-note {
  background: var(--tag-bg);
  border: 1px solid var(--border);
}
.edu-warn {
  background: var(--wip-bg);
  border: 1px solid var(--wip-border);
}
.edu-note strong,
.edu-warn strong { display: block; margin-bottom: 4px; }
.edu-warn strong { color: var(--wip-text); }
.edu-note p,
.edu-warn p { margin: 0; color: var(--text-muted); }

.edu-sources {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 34px 0 0;
  font-size: 0.86rem;
}
.edu-sources strong { display: block; margin-bottom: 8px; }
.edu-sources ul { margin: 0; padding-left: 20px; }
.edu-sources li { margin-bottom: 4px; }
.edu-sources a { color: var(--accent-dark); }
.edu-sources a:hover { text-decoration: underline; }
.edu-updated {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.edu-next {
  max-width: 760px;
  margin: 22px auto 60px;
}
.edu-next a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.edu-next a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.edu-next-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}
.edu-next-title { font-weight: 700; font-size: 1rem; }

/* Prose pages (about / system) */
.prose {
  max-width: 760px;
  margin: 32px auto 60px;
}
.prose h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 18px; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.15rem; margin: 34px 0 10px; }
.prose p { margin: 0 0 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; color: var(--text); }
.prose li { margin-bottom: 6px; }
.prose .lead { color: var(--text-muted); font-size: 1.05rem; }

/* Party sources list */
.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sources-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.sources-list li:last-child { border-bottom: none; }
.sources-list a { color: var(--accent-dark); }
.sources-list a:hover { text-decoration: underline; }
.updated-note {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 10px 0 0;
}
