/* Uherskohradišťské komunálky — voter guide stylesheet.
   Visual language: Broadsheet (newsprint serif, paper ground, spot-colour accents).
   No frameworks, no tracking. Mobile first. */

:root {
  --color-bg: #f3f2f2;
  --color-paper: #faf9f9;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-muted: #5a5757;          /* ≥ 6:1 on the ground — for secondary text */
  --color-accent: #0088b0;         /* focus, primary buttons, interface chrome */
  --color-link: #006786;           /* accent-700: AA for body-size link text */
  --color-accent-2: #d6006c;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);
  --color-hair: color-mix(in srgb, #201e1d 9%, transparent);

  --color-neutral-100: #f8f4f4; --color-neutral-200: #eae7e7; --color-neutral-300: #d7d3d3;
  --color-neutral-700: #605d5d; --color-neutral-800: #444141;
  --color-accent-100: #e9f8ff; --color-accent-200: #cbeeff; --color-accent-300: #99e0ff;
  --color-accent-600: #1186ac; --color-accent-700: #006786; --color-accent-800: #004961;
  --color-accent-2-100: #fff1f4; --color-accent-2-200: #ffdee6; --color-accent-2-700: #aa0b56; --color-accent-2-800: #790e3d;

  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-heading: var(--font-body);

  --space-1: 5px; --space-2: 10px; --space-3: 15px; --space-4: 20px;
  --space-6: 30px; --space-8: 40px; --space-12: 60px; --space-16: 80px;
  --radius-sm: 1px; --radius-md: 2px; --radius-lg: 4px;
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  --wrap: 1180px;
  --measure: 44rem;
  --c: var(--color-text);
}

/* List accents — taken from each list's logo, darkened where needed so every
   accent passes 4.5:1 as text on the paper ground and under white numerals.
   Colour always travels with the ballot number, name or logo, never alone. */
[data-list="hradistaci"]     { --c: #9b1b30; }
[data-list="toz-hradiste"]   { --c: #2d2d2d; }
[data-list="kdu-csl"]        { --c: #2a2ab8; }
[data-list="mesto-generaci"] { --c: #c0392b; }
[data-list="nestranici"]     { --c: #5b4b8a; }
[data-list="top-stan"]       { --c: #b8135f; }
[data-list="ano"]            { --c: #22205a; }
[data-list="ods"]            { --c: #0b6aa0; }
[data-list="none"]           { --c: #6b6868; }

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font: 400 17px/1.6 var(--font-body);
  font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); text-decoration-thickness: 2px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: 600; line-height: 1.14;
  letter-spacing: -0.015em; margin: 0 0 var(--space-2); text-wrap: balance;
}
h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; letter-spacing: 0; }
p { margin: 0 0 var(--space-3); text-wrap: pretty; }
ul, ol { padding-left: 1.2rem; margin: 0 0 var(--space-3); }
li + li { margin-top: 4px; }
strong { font-weight: 600; }
@media (min-width: 760px) {
  body { font-size: 18px; }
  h1 { font-size: 44px; }
  h2 { font-size: 30px; }
  h3 { font-size: 21px; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--color-text); color: var(--color-bg); padding: 10px 16px;
}
.skip-link:focus { left: 0; }
.muted, .section-note { color: var(--color-muted); }
.section-note { font-size: 15px; }
.empty-note { color: var(--color-muted); font-style: italic; }
.source-meta { color: var(--color-muted); font-size: 14px; }
.nowrap { white-space: nowrap; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 760px) { .wrap { padding: 0 var(--space-8); } }
main { padding: var(--space-6) 0 var(--space-16); }
.measure { max-width: var(--measure); }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.site-header { padding-top: var(--space-3); }
.dateline {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--space-4);
  border-top: 3px solid var(--color-text); border-bottom: 1px solid var(--color-text);
  padding: 5px 0; font-size: 13px; color: var(--color-muted);
}
.dateline strong { color: var(--color-text); }
.header-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-2);
}
.brand { color: var(--color-text); text-decoration: none; display: inline-flex; flex-direction: column; }
.brand:hover { color: var(--color-text); }
.brand-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.brand-claim { font-size: 13px; color: var(--color-muted); line-height: 1.35; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px var(--space-4); font-size: 15px; padding-bottom: var(--space-2); }
.main-nav a { color: var(--color-text); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.main-nav a:hover { color: var(--color-link); border-bottom-color: var(--color-divider); }
.main-nav a[aria-current="page"] { color: var(--color-text); font-weight: 600; border-bottom-color: var(--color-text); }
@media (min-width: 900px) {
  .header-row { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); grid-template-areas: "brand search" "nav nav"; align-items: center; gap: var(--space-2) var(--space-8); }
  .header-row > .brand { grid-area: brand; }
  .header-row > .qs { grid-area: search; }
  .header-row > .main-nav { grid-area: nav; padding-bottom: 0; }
  .brand-claim { max-width: 34rem; }
}

/* ── Quick search (header + home) ─────────────────────────────────────── */
.qs { position: relative; }
.qs-field {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px 0 12px;
  background: var(--color-paper); border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.qs-field:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.qs-field:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }
.qs-field svg { flex: none; color: var(--color-muted); }


kbd {
  font: 600 12px/1 var(--font-body); color: var(--color-muted); padding: 3px 7px;
  border: 1px solid var(--color-divider); border-bottom-width: 2px; border-radius: var(--radius-lg);
}
@media (hover: none) { .qs-field kbd { display: none; } }
.qs-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 4px 0; background: var(--color-paper);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto;
}
.qs-results li { margin: 0; }
.qs-results a, .qs-results .qs-empty {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; color: var(--color-text); text-decoration: none; font-size: 16px; line-height: 1.3;
}
.qs-results .qs-empty { display: block; color: var(--color-muted); font-size: 15px; }
.qs-results a[aria-selected="true"], .qs-results a:hover { background: var(--color-accent-100); }
.qs-results .qs-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-results .qs-meta { font-size: 14px; color: var(--color-muted); }
.qs-results .qs-all { display: block; font-size: 15px; color: var(--color-link); border-top: 1px solid var(--color-hair); margin-top: 4px; }
.qs-lg .qs-field { min-height: 56px; padding: 0 14px 0 16px; background: var(--color-paper); border-color: color-mix(in srgb, var(--color-text) 30%, transparent); }


/* ── Tags / badges ────────────────────────────────────────────────────── */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; line-height: 1.2;
  font-weight: 600; padding: 3px 8px; border-radius: var(--radius-md); white-space: nowrap;
  background: var(--color-neutral-200); color: var(--color-neutral-800); text-decoration: none;
}
.badge::before { font-weight: 700; font-size: 12px; }
a.badge:hover { filter: brightness(.96); }
/* Status of a promise / project: glyph + word, colour only reinforces */
.badge-status-delivered { background: var(--color-accent-200); color: var(--color-accent-800); }
.badge-status-delivered::before { content: "✓"; }
.badge-status-partially_delivered { background: var(--color-accent-100); color: var(--color-accent-800); box-shadow: inset 0 0 0 1px var(--color-accent-300); }
.badge-status-partially_delivered::before { content: "◐"; }
.badge-status-in_progress { background: var(--color-neutral-200); color: var(--color-neutral-800); }
.badge-status-in_progress::before { content: "→"; }
.badge-status-not_delivered { background: var(--color-accent-2-100); color: var(--color-accent-2-800); box-shadow: inset 0 0 0 1px var(--color-accent-2-200); }
.badge-status-not_delivered::before { content: "✕"; }
.badge-status-abandoned { background: transparent; color: var(--color-neutral-800); box-shadow: inset 0 0 0 1px var(--color-divider); }
.badge-status-abandoned::before { content: "–"; }
.badge-status-unclear, .badge-status-proposed { background: transparent; color: var(--color-neutral-800); box-shadow: inset 0 0 0 1px var(--color-divider); }
.badge-status-unclear::before { content: "?"; }
.badge-status-proposed::before { content: "○"; }
/* Council position — deliberately neutral: neither reads as good or bad */
.badge-coalition { background: var(--color-text); color: var(--color-bg); }
.badge-coalition::before { content: "●"; font-size: 9px; }
.badge-opposition { background: transparent; color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.badge-opposition::before { content: "○"; font-size: 10px; }
.badge-mixed, .badge-not_elected { background: transparent; color: var(--color-neutral-800); box-shadow: inset 0 0 0 1px var(--color-divider); }
/* Candidate tier */
.badge-councillor { background: var(--color-accent-100); color: var(--color-accent-800); }
.badge-councillor::before { content: "◆"; font-size: 10px; }
.badge-new { background: transparent; color: var(--color-neutral-800); box-shadow: inset 0 0 0 1px var(--color-divider); }
.badge-official-only { background: transparent; color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-divider); font-weight: 400; }
.badge-official-only::before { content: "ⓘ"; font-weight: 400; }
.badge-severity-info { background: var(--color-neutral-200); color: var(--color-neutral-800); }
.badge-severity-notable { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.badge-severity-serious { background: var(--color-accent-2-700); color: #fff; }

/* A list, identified by ballot number + name (+ logo); accent reinforces */
.list-chip {
  display: inline-flex; align-items: center; gap: 8px; color: var(--c); font-weight: 600;
  text-decoration: none; font-size: 15px; line-height: 1.25;
}
a.list-chip:hover { color: var(--c); text-decoration: underline; }
.ballot-no {
  display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 26px; padding: 0 6px;
  background: var(--c); color: #fff; font-size: 14px; font-weight: 600; border-radius: var(--radius-md);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.ballot-no.lg { min-width: 40px; height: 40px; font-size: 22px; }

/* Logos always sit on a white tile — the marks are designed for white */
.party-logo {
  display: block; flex: none; width: auto; object-fit: contain; background: #fff;
  border-radius: var(--radius-md); padding: 3px;
}
.party-logo.xs { display: inline-block; height: 20px; max-width: 64px; padding: 2px; vertical-align: -5px; }
.party-logo.sm { height: 28px; max-width: 90px; }
.party-logo.md { height: 44px; max-width: 132px; padding: 5px; }
.party-logo.lg { height: 84px; max-width: 200px; padding: 10px; }

/* ── Avatars ──────────────────────────────────────────────────────────── */
.avatar {
  width: 56px; height: 56px; flex: none; overflow: hidden; border-radius: 50%;
  background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 104px; height: 104px; font-size: 32px; border-radius: var(--radius-lg); }
@media (min-width: 760px) { .avatar.lg { width: 148px; height: 184px; font-size: 44px; } }

/* ── Buttons & forms ──────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  font: 600 16px/1.2 var(--font-body); padding: 10px 18px; border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid var(--color-accent); background: var(--color-accent); color: #fff; text-decoration: none;
}
button:hover, .btn:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); color: #fff; }
button:active, .btn:active { background: var(--color-accent-700); }
button.secondary, .btn.secondary { background: transparent; color: var(--color-text); border-color: var(--color-divider); }
button.secondary:hover, .btn.secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
button:disabled { opacity: .45; cursor: not-allowed; }
input[type="text"], input[type="search"], input[type="number"], select {
  font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; color: var(--color-text);
  background: var(--color-paper); border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
input:hover, select:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
input:focus-visible, select:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.qs .qs-field input[type="search"] {
  flex: 1; min-width: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font: inherit; font-size: 16px; color: var(--color-text); padding: 10px 0; margin: 0; caret-color: var(--color-accent);
  -webkit-appearance: none; appearance: none;
}
.qs .qs-field input[type="search"]::placeholder { color: var(--color-muted); opacity: 1; }
.qs .qs-field input[type="search"]:focus-visible { outline: none; }
.qs .qs-field input[type="search"]::-webkit-search-cancel-button { display: none; }
.qs-lg .qs-field input[type="search"] { font-size: 19px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-accent); margin: 0; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3) var(--space-4); align-items: end; margin: var(--space-4) 0 var(--space-6); }
.filters .field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; min-width: 0; }
.filters .field-wide { grid-column: 1 / -1; }
.filters label { color: var(--color-muted); }
.filters .field input, .filters .field select { width: 100%; }
.checkbox-field { flex-direction: row !important; align-items: center; gap: 8px !important; min-height: 44px; font-size: 15px !important; }
.checkbox-field label { color: var(--color-text) !important; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.card > :last-child { margin-bottom: 0; }

/* ── Home: hero ───────────────────────────────────────────────────────── */
.home-hero { display: grid; gap: var(--space-6); padding: var(--space-4) 0 var(--space-8); }
.kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); margin-bottom: var(--space-2); }
.lead { font-size: 19px; line-height: 1.55; max-width: 38rem; }
@media (min-width: 760px) { .lead { font-size: 21px; } }
.home-hero .qs { max-width: 38rem; }
.hero-hint { font-size: 14px; color: var(--color-muted); margin-top: 8px; }
@media (min-width: 1000px) {
  .home-hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-12); align-items: start; }
}

/* AI disclaimer: prominent, calm — a quiet note in the margin, not an alarm */
.ai-disclaimer {
  background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4);
  font-size: 16px; line-height: 1.55;
}
.ai-disclaimer h2 { display: flex; gap: 10px; align-items: baseline; font-size: 19px; line-height: 1.3; letter-spacing: 0; margin-bottom: var(--space-2); }
.ai-disclaimer h2 .ai-mark {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-accent-2); color: #fff; font-size: 14px; font-weight: 700; transform: translateY(3px);
}
.ai-disclaimer p { margin-bottom: var(--space-2); }
.ai-disclaimer p:last-child { margin-bottom: 0; }

/* ── Sections ─────────────────────────────────────────────────────────── */
.sec { margin-top: var(--space-12); }
.sec:first-child { margin-top: 0; }
.sec-head { margin-bottom: var(--space-4); max-width: var(--measure); }
.sec-head h2 { margin-bottom: 4px; }
.sec-head p { color: var(--color-muted); font-size: 16px; margin: 0; }
.sec-head .sec-link { font-size: 16px; }
.sec h3 { margin-top: var(--space-8); }
.sec h3:first-of-type { margin-top: var(--space-4); }
@media (min-width: 760px) { .sec { margin-top: var(--space-16); } }

/* ── Leader cards ─────────────────────────────────────────────────────── */
.leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); list-style: none; padding: 0; margin: 0; }
@media (min-width: 760px) { .leaders { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-4); } }
.leaders > li { margin: 0; }
.leader { position: relative; display: flex; flex-direction: column; height: 100%; }
.leader-photo {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--c);
  border-radius: var(--radius-md); border-bottom: 4px solid var(--c);
}
.leader-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.leader-photo .initials { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 44px; font-weight: 600; }
.leader-body { display: flex; flex-direction: column; gap: 4px; padding-top: var(--space-2); flex: 1; }
.leader-list { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; font-weight: 600; color: var(--c); line-height: 1.25; }
.leader-list .ballot-no { min-width: 20px; height: 20px; font-size: 12px; padding: 0 4px; }
.leader-logo { margin: 2px 0 0; }
.leader-logo .party-logo { height: 26px; max-width: 100%; padding: 3px 5px; }
.leader-name { font-size: 19px; line-height: 1.2; margin: 2px 0 0; letter-spacing: -0.01em; }
.leader-name a { color: var(--color-text); text-decoration: none; }
.leader-name a::after { content: ""; position: absolute; inset: 0; }
.leader-hook { font-size: 15px; line-height: 1.4; color: var(--color-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.leader-cta { margin-top: auto; padding-top: 6px; font-size: 15px; color: var(--color-link); }
.leader:hover .leader-name a, .leader:focus-within .leader-name a { text-decoration: underline; text-decoration-thickness: 2px; }
.leader:hover .leader-photo img { transform: scale(1.03); }
.leader:focus-within { outline: 2px solid var(--color-accent); outline-offset: 4px; border-radius: var(--radius-md); }
.leader-name a:focus-visible { outline: none; }
@media (min-width: 760px) { .leader-name { font-size: 22px; } }

/* ── List comparison rows (home) ──────────────────────────────────────── */
.list-rows { list-style: none; padding: 0; margin: 0; }
.list-rows > li { margin: 0; }
.list-row {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px var(--space-3);
  padding: var(--space-3) 0; border-top: 1px solid var(--color-hair);
}
.list-rows > li:last-child .list-row { border-bottom: 1px solid var(--color-hair); }
.list-row .ballot-no { grid-row: span 2; margin-top: 2px; }
.list-row h3 { font-size: 19px; margin: 0; line-height: 1.25; }
.list-row h3 a { color: var(--color-text); text-decoration: none; }
.list-row h3 a::after { content: ""; position: absolute; inset: 0; }
.list-row:hover h3 a { text-decoration: underline; }
.list-row:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.list-row .row-meta { grid-column: 2; font-size: 15px; color: var(--color-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.list-row .party-logo { display: none; }
@media (min-width: 760px) {
  .list-row { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.1fr) 140px; align-items: center; padding: var(--space-4) var(--space-2); }
  .list-row .ballot-no { grid-row: auto; margin: 0; }
  .list-row .row-meta { grid-column: auto; }
  .list-row .party-logo { display: block; justify-self: end; }
}

/* ── How to vote ──────────────────────────────────────────────────────── */
.howto-steps { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .howto-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); } }
.howto-steps .step { margin: 0; }
.howto-steps .n { font-size: 40px; font-weight: 600; line-height: 1; color: var(--color-accent); margin-bottom: 6px; font-variant-numeric: lining-nums; }
.howto-steps h3 { margin: 0 0 6px !important; font-size: 19px; }
.howto-steps p { font-size: 16px; margin: 0; }
.key-dates { list-style: none; padding: 0; margin: 0; }
.key-dates li { display: grid; grid-template-columns: 1fr; gap: 2px 20px; padding: 10px 0; border-top: 1px solid var(--color-hair); margin: 0; }
.key-dates li:last-child { border-bottom: 1px solid var(--color-hair); }
.key-dates .kd-date { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 620px) { .key-dates li { grid-template-columns: 11rem minmax(0, 1fr); } }

.tools { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool { position: relative; background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4); }
.tool h3 { margin: 0 0 6px !important; font-size: 19px; }
.tool h3 a { color: var(--color-text); text-decoration: none; }
.tool h3 a::after { content: ""; position: absolute; inset: 0; }
.tool:hover { background: var(--color-neutral-300); }
.tool:hover h3 a { text-decoration: underline; }
.tool p { font-size: 15px; color: var(--color-muted); margin: 0; }

/* ── Profile pages: breadcrumb, hero, facts ───────────────────────────── */
.crumbs { font-size: 14px; color: var(--color-muted); margin-bottom: var(--space-4); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs a { color: var(--color-muted); }
.crumbs span[aria-hidden] { opacity: .6; }

.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; padding-bottom: var(--space-4); }
.hero .id-line { margin: 0 0 var(--space-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; }
.hero h1 { margin-bottom: var(--space-3); }
.hero .badges { margin-top: 0; }
.party-hero { grid-template-columns: minmax(0, 1fr); border-left: 4px solid var(--c); padding-left: var(--space-4); }
.party-hero .hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.cand-hero { border-left: 0; }
.cand-hero .avatar.lg { border-bottom: 4px solid var(--c); }
@media (min-width: 760px) { .hero { gap: var(--space-6); } }

/* Key-facts strip */
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 var(--space-6);
  border-top: 1px solid var(--color-text); border-bottom: 1px solid var(--color-hair);
}
.facts > div { padding: 10px 12px 12px 0; min-width: 0; }
.facts dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.facts dd .muted { font-weight: 400; }
@media (min-width: 760px) {
  .facts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .facts > div + div { padding-left: 16px; border-left: 1px solid var(--color-hair); }
}
@media (max-width: 759px) {
  .facts > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--color-hair); }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--color-hair); }
}
.summary { font-size: 19px; line-height: 1.6; max-width: var(--measure); }
@media (min-width: 760px) { .summary { font-size: 20px; } }

/* ── Long pages: TOC + content grid ───────────────────────────────────── */
.page-grid { display: block; }
.toc {
  position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--space-4)) var(--space-6);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-hair);
}
.toc-title { display: none; }
.toc ol {
  list-style: none; margin: 0; padding: 0 var(--space-4); display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.toc ol::-webkit-scrollbar { display: none; }
.toc li { margin: 0; flex: none; }
.toc a {
  display: block; padding: 12px 10px; font-size: 15px; color: var(--color-muted); text-decoration: none;
  white-space: nowrap; border-bottom: 2px solid transparent;
}
.toc a:hover { color: var(--color-text); }
.toc a[aria-current="true"] { color: var(--color-text); border-bottom-color: var(--c, var(--color-text)); font-weight: 600; }
@media (min-width: 760px) { .toc { margin-left: calc(-1 * var(--space-8)); margin-right: calc(-1 * var(--space-8)); } .toc ol { padding: 0 var(--space-8); } }
@media (min-width: 1100px) {
  .page-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-12); align-items: start; }
  .toc { top: var(--space-6); margin: 0; background: none; backdrop-filter: none; border: 0; }
  .toc-title { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 8px; }
  .toc ol { display: block; padding: 0; mask-image: none; border-left: 1px solid var(--color-hair); }
  .toc a { padding: 6px 0 6px 14px; margin-left: -1px; border-bottom: 0; border-left: 2px solid transparent; white-space: normal; line-height: 1.3; }
  .toc a[aria-current="true"] { border-left-color: var(--c, var(--color-text)); }
  .page-content { max-width: 50rem; }
}

/* ── Items: promises, projects, roles, media ──────────────────────────── */
.items { display: grid; gap: var(--space-3); }
.project { background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4); }
.project h4, .project .item-title { font-size: 18px; margin: 0 0 6px; line-height: 1.3; }
.project .status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.project .role { color: var(--color-muted); font-size: 15px; }
.project p { font-size: 16px; margin-bottom: 8px; }
.project > :last-child { margin-bottom: 0; }

details.more { margin-top: 6px; font-size: 15px; }
details.more > summary, details.sources > summary, details.vote-details > summary, details.collapse > summary {
  cursor: pointer; list-style: none; color: var(--color-link); font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; font-size: 15px;
}
details > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.sources > summary::before, details.vote-details > summary::before, details.collapse > summary::before {
  content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 15px; line-height: 1;
  border: 1px solid currentColor; border-radius: var(--radius-md); flex: none;
}
details[open].more > summary::before, details[open].sources > summary::before, details[open].vote-details > summary::before, details[open].collapse > summary::before { content: "−"; }
details.more > summary:hover, details.sources > summary:hover { color: var(--color-accent-800); }
details.more .more-body { padding-top: 6px; }
details.more .more-body > * { font-size: 15px; }
details.sources { margin-top: 6px; font-size: 14px; }
details.sources ul { list-style: none; padding: 8px 0 0; margin: 0; }
details.sources li { padding: 6px 0 6px 12px; border-left: 2px solid var(--color-divider); margin: 0 0 6px; }
.source-quote { color: var(--color-muted); font-style: italic; }
details.collapse { margin-top: var(--space-3); }
details.collapse > .collapse-body { padding-top: var(--space-3); }

.caveat { font-size: 15px; color: var(--color-muted); background: var(--color-neutral-100); border-radius: var(--radius-md); padding: 8px 12px; margin-top: 8px; }
.caveat::before { content: "Upozornění: "; font-weight: 600; color: var(--color-text); }
.gaps-box { font-size: 16px; background: transparent; border-left: 3px solid var(--color-divider); padding: 2px 0 2px var(--space-4); }
.gaps-box ul { margin: 0; }

/* Timeline rows (public roles, key dates) */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { display: grid; grid-template-columns: 1fr; gap: 2px 20px; padding: 12px 0; border-top: 1px solid var(--color-hair); margin: 0; }
.timeline > li:last-child { border-bottom: 1px solid var(--color-hair); }
.timeline .tl-date { font-size: 15px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.timeline .tl-body > :last-child { margin-bottom: 0; }
.timeline .tl-note { font-size: 15px; color: var(--color-muted); margin: 2px 0 0; }
@media (min-width: 620px) { .timeline > li { grid-template-columns: 9.5rem minmax(0, 1fr); } }

/* Plain link list (media, profiles) */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list > li { padding: 12px 0; border-top: 1px solid var(--color-hair); margin: 0; }
.link-list > li:last-child { border-bottom: 1px solid var(--color-hair); }
.link-list .ll-meta { display: block; font-size: 14px; color: var(--color-muted); }
.link-list .ll-gist { display: block; font-size: 15px; color: var(--color-muted); margin-top: 2px; }

/* Label/value pairs */
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 20px; margin: 0 0 var(--space-3); }
.kv dt { font-size: 14px; color: var(--color-muted); }
.kv dd { margin: 0 0 8px; }
@media (min-width: 620px) { .kv { grid-template-columns: 9.5rem minmax(0, 1fr); } .kv dd { margin: 0; } .kv > * { padding: 6px 0; } }

/* Promise tally — a text line + proportional strip (the strip is decorative) */
.tally { margin: 0 0 var(--space-4); }
.tally-strip { display: flex; height: 8px; gap: 2px; margin-bottom: 8px; }
.tally-strip span { display: block; min-width: 4px; border-radius: 1px; }
.tally-strip .t-delivered { background: var(--color-accent-700); }
.tally-strip .t-partially_delivered { background: var(--color-accent-400, #62c5ee); }
.tally-strip .t-in_progress { background: var(--color-neutral-700); }
.tally-strip .t-not_delivered { background: var(--color-accent-2); }
.tally-strip .t-abandoned, .tally-strip .t-unclear, .tally-strip .t-proposed { background: var(--color-neutral-300); }
.tally .badges { gap: 6px 8px; }

/* Candidate list on a party page */
.cand-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--space-8); }
@media (min-width: 900px) { .cand-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cand-list > li { margin: 0; }
.cand-row {
  position: relative; display: grid; grid-template-columns: 28px 44px minmax(0, 1fr); gap: 0 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--color-hair);
}
.cand-row .pos { font-variant-numeric: tabular-nums; color: var(--color-muted); font-size: 15px; text-align: right; }
.cand-row .avatar { width: 44px; height: 44px; font-size: 15px; }
.cand-row .cname { font-weight: 600; line-height: 1.25; }
.cand-row .cname a { color: var(--color-text); text-decoration: none; }
.cand-row .cname a::after { content: ""; position: absolute; inset: 0; }
.cand-row:hover .cname a { text-decoration: underline; }
.cand-row:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.cand-row .cmeta { font-size: 14px; color: var(--color-muted); line-height: 1.35; }
.cand-row .badges { margin-top: 3px; }
.cand-row .badge { font-size: 12px; padding: 2px 6px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px 10px 0; vertical-align: top; border-bottom: 1px solid var(--color-hair); }
th { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); border-bottom: 1px solid var(--color-text); }
tbody tr:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
tr.is-me td { background: color-mix(in srgb, var(--c, var(--color-accent)) 7%, transparent); }
.table-scroll { overflow-x: auto; }
/* Stacked tables: on phones each row becomes a small labelled block — no sideways scrolling */
@media (max-width: 619px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 0; border-top: 1px solid var(--color-hair); }
  table.stack tr:last-child { border-bottom: 1px solid var(--color-hair); }
  table.stack td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 10px; }
  table.stack td::before { content: attr(data-label); font-size: 14px; color: var(--color-muted); }
  table.stack td.stack-title { display: block; font-weight: 600; font-size: 17px; }
  table.stack td.stack-title::before { content: none; }
}

/* ── Search page results ──────────────────────────────────────────────── */
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list > li { margin: 0; }
.result-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--color-hair); color: var(--color-text); text-decoration: none;
}
.result-row:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); color: var(--color-text); }
.result-row:hover .rname { text-decoration: underline; }
.result-row .avatar { width: 44px; height: 44px; font-size: 15px; }
.result-row .rname { font-weight: 600; display: block; line-height: 1.3; }
.result-row .rlist { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--c); font-weight: 600; }
.result-row .rlist .ballot-no { min-width: 20px; height: 20px; font-size: 12px; padding: 0 4px; }
.result-row .rmeta { font-size: 14px; color: var(--color-muted); }
.result-row .party-logo { display: none; }
@media (min-width: 620px) { .result-row .party-logo { display: block; } }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { padding: var(--space-8) 0 var(--space-12); font-size: 15px; color: var(--color-muted); }
.site-footer .wrap > div { border-top: 3px solid var(--color-text); padding-top: var(--space-4); display: grid; gap: var(--space-4); }
.site-footer p { max-width: var(--measure); margin: 0; }
.site-footer a { color: var(--color-text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (min-width: 900px) { .site-footer .wrap > div { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

/* ── Ballot helper (kept compatible with ballot.js) ───────────────────── */
.ballot-summary {
  position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--color-bg) 94%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--color-hair); padding: 10px 0; margin-bottom: var(--space-4);
}
.ballot-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.ballot-count.over { color: var(--color-accent-2-700); }
.ballot-list { background: var(--color-surface); border-radius: var(--radius-md); margin-bottom: var(--space-2); overflow: hidden; }
.ballot-list > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; border-left: 4px solid var(--c); min-height: 52px; }
.ballot-list > summary .party-logo { margin-left: auto; }
.ballot-list .cand-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--color-hair); font-size: 16px; min-height: 44px; }
.ballot-explain { font-size: 16px; background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-4) 0; }

/* ── Council voting: stat tiles, bars, heatmaps ───────────────────────────
   One-hue sequential ramp (cyan). Every cell/bar also prints its number. */
:root {
  --bar: var(--color-accent-700);
  --h0: #e9f8ff; --h1: #cbeeff; --h2: #99e0ff; --h3: #62c5ee; --h4: #1186ac; --h5: #006786; --h6: #0a303e;
  --h0-ink: #201e1d; --h1-ink: #201e1d; --h2-ink: #201e1d; --h3-ink: #201e1d; --h4-ink: #ffffff; --h5-ink: #ffffff; --h6-ink: #ffffff;
}
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: var(--space-3) 0 var(--space-4); border-top: 1px solid var(--color-text); }
@media (min-width: 760px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tile { padding: 12px 12px 14px 0; border-bottom: 1px solid var(--color-hair); min-width: 0; }
@media (max-width: 759px) { .stat-tile:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--color-hair); } }
@media (min-width: 760px) { .stat-tile + .stat-tile { padding-left: 16px; border-left: 1px solid var(--color-hair); } }
.stat-value { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; }
.stat-label { font-size: 15px; line-height: 1.3; margin-top: 4px; }
.stat-note { font-size: 13px; color: var(--color-muted); margin-top: 2px; line-height: 1.35; }

.club-label { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.club-dot { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-sm); background: var(--c); flex: none; }

.bar-list { display: flex; flex-direction: column; gap: 2px; margin: var(--space-2) 0 var(--space-4); }
.bar-row { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr) 4.2rem; align-items: center; gap: 12px; padding: 5px 0; font-size: 15px; }
.bar-list.attendance .bar-row { grid-template-columns: minmax(10rem, 17rem) minmax(0, 1fr) 5.4rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--color-surface); border-radius: 1px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--bar); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .bar-row, .bar-list.attendance .bar-row { grid-template-columns: minmax(0, 1fr) 4.6rem; gap: 4px 12px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

table.heat { border-collapse: separate; border-spacing: 2px; width: auto; }
table.heat td { text-align: center; border: none; border-radius: 1px; padding: 6px 8px; min-width: 2.6rem; font-size: 14px; }
table.heat th { border: none; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--color-text); white-space: nowrap; font-weight: 400; }
table.heat thead th { vertical-align: bottom; }
table.heat td.heat-self { background: var(--color-surface); color: var(--color-muted); }
table.heat td.hna { background: transparent; }
table.heat tbody tr:hover { background: none; }
.h0 { background: var(--h0); color: var(--h0-ink); } .h1 { background: var(--h1); color: var(--h1-ink); }
.h2 { background: var(--h2); color: var(--h2-ink); } .h3 { background: var(--h3); color: var(--h3-ink); }
.h4 { background: var(--h4); color: var(--h4-ink); } .h5 { background: var(--h5); color: var(--h5-ink); }
.h6 { background: var(--h6); color: var(--h6-ink); }
table.heat td:hover { outline: 2px solid var(--color-text); outline-offset: -1px; }
table.heat-people td { font-size: 11px; min-width: 1.75rem; padding: 4px 1px; }
.heat-people th[scope="row"] { text-align: left; padding-right: 8px; position: sticky; left: 0; background: var(--color-bg); z-index: 1; }
.heat-people th.club-start { border-top: 2px solid var(--color-divider); }
.heat-people th.vert { height: 7.5rem; padding: 0 1px 4px; }
.heat-people th.vert span { writing-mode: vertical-rl; transform: rotate(180deg); }
.heat-scroll { margin-bottom: var(--space-4); overflow-x: auto; }
.full-bleed { position: relative; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); }
.full-bleed table.heat { margin: 0 auto; }
.heat-legend { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--color-muted); margin: 6px 0 10px; flex-wrap: wrap; }
.heat-legend span:first-child { margin-right: 6px; }
.heat-legend span:last-child { margin-left: 6px; }
.heat-swatch { width: 24px; height: 10px; border-radius: 1px; }
table.heat-clubs td { width: 5.6rem; }
table.heat-clubs thead th { white-space: normal; max-width: 5.6rem; text-align: center; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px var(--space-8); }
@media (min-width: 620px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.two-col h4 { margin: var(--space-3) 0 6px; }
.plain-list { margin: 0; padding-left: 1.3rem; font-size: 16px; }

.vote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 var(--space-3); border-top: 1px solid var(--color-hair); }
@media (min-width: 760px) { .vote-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.vote-grid > div { padding: 8px 8px 10px 0; border-bottom: 1px solid var(--color-hair); min-width: 0; }
.vote-grid dt { font-size: 14px; color: var(--color-muted); line-height: 1.25; }
.vote-grid dd { margin: 0; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vote-counts td, .vote-counts th { text-align: center; padding-right: 6px; padding-left: 6px; }
.vote-counts td { font-weight: 600; }
details.vote-details { margin: 6px 0 var(--space-4); }
.vote-list { list-style: none; padding: 0; margin: 8px 0 var(--space-4); font-size: 16px; }
.vote-list li { padding: 10px 0; border-top: 1px solid var(--color-hair); margin: 0; }
.vote-list .source-meta, .vote-list .vote-diff { display: block; }
.vote-diff { font-size: 15px; }

/* Legacy in-page nav used by council.html — same look as the sticky TOC bar */
nav.toc-inline, nav.toc:not(:has(> ol)) {
  position: static; display: flex; flex-wrap: wrap; gap: 0 18px; font-size: 15px; margin: var(--space-4) 0;
  background: none; backdrop-filter: none; border: 0; border-top: 1px solid var(--color-hair); border-bottom: 1px solid var(--color-hair);
}
nav.toc:not(:has(> ol)) a { padding: 8px 0; border: 0; }

.divider { border: 0; height: 1px; background: var(--color-hair); margin: var(--space-8) 0; }
.hr { border: 0; height: 1px; background: var(--color-divider); margin: var(--space-4) 0; }

@media print {
  .site-header nav, .qs, .toc, .foot-links, .skip-link, button { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  details > * { display: block !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
