/* Ilme: äänestyslippu. Mustavalkoinen paperi ja lyijykynä, ei puoluevärejä.
   Värejä käytetään vain kartalla, jossa ne erottavat puolueet toisistaan.
   Fontit ovat järjestelmäfontteja: sivu ei lataa mitään kolmansilta osapuolilta. */
:root {
  --paper: #f4f5f7; --surface: #ffffff; --ink: #15181c; --ink-2: #4b535d; --ink-3: #6f7883;
  --line: #e1e4e9; --line-2: #c9ced6; --wash: #eceef2; --on-ink: #ffffff;
  --hl: #fff3c4; --hl-ink: #5c4500;
  --font-display: ui-sans-serif, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 14px; --r-s: 8px;
  --shadow: 0 1px 2px rgba(21,24,28,.06), 0 8px 24px rgba(21,24,28,.06);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #7a5bd1; --series-8: #8a6d3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111316; --surface: #1a1d22; --ink: #eef0f3; --ink-2: #b4bbc4; --ink-3: #8a929c;
    --line: #2a2f36; --line-2: #3b424b; --wash: #22262c; --on-ink: #111316;
    --hl: #3d3416; --hl-ink: #f3dc8f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9378e0; --series-8: #a68a55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111316; --surface: #1a1d22; --ink: #eef0f3; --ink-2: #b4bbc4; --ink-3: #8a929c;
  --line: #2a2f36; --line-2: #3b424b; --wash: #22262c; --on-ink: #111316;
  --hl: #3d3416; --hl-ink: #f3dc8f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9378e0; --series-8: #a68a55;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.1rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.75rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: 820px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-block: 8px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
main.wrap > * { min-width: 0; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); font-size: .92rem; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* Yläpalkki */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; border: 2.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center;
  font: 700 .85rem/1 var(--font-num); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }

/* Pinnat */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow); }
.panel > * + * { margin-top: 14px; }
.section-head { display: grid; gap: 6px; }
.notice { background: var(--hl); color: var(--hl-ink); border-radius: var(--r-s); padding: 10px 14px; font-size: .9rem; }

/* Painikkeet */
button, .button { font: 600 .98rem/1 var(--font-body); cursor: pointer; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); padding: 12px 20px; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; transition: border-color .15s, background .15s, transform .1s; }
button:hover, .button:hover { border-color: var(--ink); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
button.primary:hover, .button.primary:hover { opacity: .9; }
.button.big { padding: 16px 28px; font-size: 1.05rem; }
button.ghost { border-color: transparent; background: none; color: var(--ink-2); padding-inline: 8px; }
button.ghost:hover { color: var(--ink); border-color: transparent; }
button:disabled { opacity: .35; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

select { font: inherit; padding: 12px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); width: 100%; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }

/* Etusivun avaus ja äänestyslippu */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 48px); align-items: center; padding-block: clamp(24px, 6vw, 56px) 8px; }
.hero-text { display: grid; gap: 18px; min-width: 0; }
.hero-text .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; font-size: .9rem; color: var(--ink-2); }
.facts li::before { content: "✓"; margin-right: 6px; color: var(--ink); font-weight: 700; }
.ballot { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow);
  aspect-ratio: 3 / 4; max-width: 100%; padding: 20px; display: grid; grid-template-rows: auto 1fr auto; text-align: center;
  transform: rotate(-3deg); position: relative; }
.ballot::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line-2); }
.ballot-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ballot-circle { align-self: center; justify-self: center; width: min(62%, 150px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font: 600 clamp(2rem, 7vw, 3.2rem)/1 var(--font-num); color: var(--ink-3); background: var(--surface); z-index: 1; }
.ballot-foot { font-size: .7rem; color: var(--ink-3); }

/* Periaatteet */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px 28px; margin-top: 20px; }
.principles > div { display: grid; gap: 4px; align-content: start; }
.principles p { color: var(--ink-2); font-size: .95rem; }
.principles code { font: .85em var(--font-num); background: var(--wash); padding: 1px 5px; border-radius: 4px; }
dl.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 16px 0 0; }
dl.facts-list dt { font-weight: 700; }
dl.facts-list dd { margin: 0; color: var(--ink-2); }

/* Kysymys */
.quiz-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.counter { font: 600 .9rem var(--font-num); color: var(--ink-3); }
.progress { height: 4px; background: var(--wash); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ink); transition: width .25s ease; }
.statement { font-size: clamp(1.45rem, 4vw, 2.1rem); font-weight: 750; min-height: 3.5em; display: flex; align-items: center; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.scale button { flex-direction: column; justify-content: flex-start; gap: 12px; border-radius: var(--r); padding: 18px 6px 14px;
  font-size: .82rem; font-weight: 600; line-height: 1.25; text-align: center; border-color: var(--line); color: var(--ink-2); }
.scale button:hover { color: var(--ink); }
.scale .dot { display: block; border: 2px solid currentColor; border-radius: 50%; flex: none; }
.scale button:nth-child(1) .dot, .scale button:nth-child(5) .dot { width: 34px; height: 34px; }
.scale button:nth-child(2) .dot, .scale button:nth-child(4) .dot { width: 26px; height: 26px; margin-block: 4px; }
.scale button:nth-child(3) .dot { width: 18px; height: 18px; margin-block: 8px; border-style: dashed; }
.scale button.on { border-color: var(--ink); color: var(--ink); background: var(--wash); }
.scale button.on .dot { background: var(--ink); border-color: var(--ink); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
label.chk { display: inline-flex; gap: 10px; align-items: center; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
label.chk input { width: 18px; height: 18px; accent-color: var(--ink); }
.hint { font-size: .8rem; color: var(--ink-3); }

/* Tulokset */
.results-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs button { border: 0; border-radius: 0; background: none; padding: 12px 14px; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; padding-top: 4px; }
.num { width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center;
  font: 600 .95rem/1 var(--font-num); }
.num.empty { border-style: dashed; border-color: var(--line-2); }
.result .who { min-width: 0; }
.result .who strong { font-size: 1.05rem; }
.result .pct { font: 700 1.35rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result .pct small { font-size: .65em; color: var(--ink-3); margin-left: 1px; }
.result .bar { grid-column: 2 / -1; height: 6px; background: var(--wash); border-radius: 3px; overflow: hidden; }
.result .bar > div { height: 100%; background: var(--ink); border-radius: 3px; }
.result .details { grid-column: 2 / -1; min-width: 0; }
.result.no-num { grid-template-columns: minmax(0, 1fr) auto; }
.result.no-num .bar, .result.no-num .details { grid-column: 1 / -1; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.me-swatch { background: none; border: 2px solid var(--ink); width: 11px; height: 11px; vertical-align: -1px; }

details summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; font-weight: 600; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; font: 700 1rem/1 var(--font-num); }
details[open] summary::before { content: "–"; }
details summary:hover { color: var(--ink); }
details[open] > summary { margin-bottom: 10px; }

.minis { display: grid; gap: 6px; margin: 4px 0 14px; padding: 14px; background: var(--wash); border-radius: var(--r-s); }
.mini { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3.2rem; gap: 10px; align-items: center; font-size: .85rem; }
.mini-bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.mini-bar > span { display: block; height: 100%; background: var(--ink); }
.pct-s { font: 600 .85rem var(--font-num); text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
td, th { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
td:nth-child(n+2) { white-space: nowrap; color: var(--ink-2); }
tr.far td { background: var(--hl); color: var(--hl-ink); }
.reason { color: var(--ink-2); margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-2); font-size: .9em; }
tr.far .reason { color: inherit; }

.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.theme { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.theme-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.theme-row:first-of-type { border-top: 0; }
.challenge { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.challenge:first-child { border-top: 0; padding-top: 4px; }
.challenge-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.challenge ul { padding: 0; margin: 0; list-style: none; display: grid; gap: 12px; }
.challenge li { padding: 12px 14px; background: var(--wash); border-radius: var(--r-s); display: grid; gap: 4px; }

/* Jatkokierrokset */
.rounds { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.round { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.round:first-child { border-top: 0; }
.round-no { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: 700 .9rem/1 var(--font-num); }
.round.done .round-no { background: var(--ink); color: var(--on-ink); }
.round-body { display: grid; gap: 8px; min-width: 0; }
.round-pick { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.round-pick .field { flex: 1 1 220px; }

/* Kartta */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); }
.map-wrap { position: relative; max-width: 100%; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-bg { fill: var(--paper); stroke: var(--line); }
.map-axis { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.map-label { fill: var(--ink-3); font: 600 12px var(--font-body); }
.pt { cursor: pointer; outline: none; }
.pt .hit { fill: transparent; }
.pt .dot { stroke: var(--surface); stroke-width: 2; }
.pt:hover .dot, .pt:focus .dot { stroke: var(--ink); }
.pt.dim { opacity: .2; }
.me-path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.me-past { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.me-past-label { fill: var(--ink-2); font: 700 11px var(--font-num); }
.me-ring { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.me-dot { fill: var(--ink); }
.me-label { fill: var(--ink); font: 800 12px var(--font-body); }
.tooltip { position: absolute; transform: translate(-50%, calc(-100% - 6px)); background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-s); padding: 8px 12px; font-size: .8rem; line-height: 1.4; pointer-events: none; white-space: nowrap; }

/* Mainospaikka: aina selvästi merkitty mainokseksi */
.ad-slot { min-height: 100px; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 10px; }
.ad-slot::before { content: "Mainos"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

/* Alatunniste */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; gap: 8px 20px; flex-wrap: wrap; padding-block: 24px 40px; font-size: .88rem; color: var(--ink-3); }
.site-footer button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; font: inherit; border-radius: 0; }

/* Evästebanneri: hyväksy ja hylkää ovat samanarvoiset */
.consent { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -8px 24px rgba(0,0,0,.1); z-index: 10; }
.consent > div { max-width: 820px; margin: 0 auto; display: grid; gap: 8px; }
.consent .actions button { flex: 1 1 140px; justify-content: center; }

/* Tietosuojaseloste */
.prose h3 { margin-top: 22px; }
.prose p { color: var(--ink-2); margin-top: 6px; max-width: 68ch; }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .ballot { max-width: 200px; justify-self: center; order: -1; }
  .scale { grid-template-columns: 1fr; }
  .scale button { flex-direction: row; padding: 12px 16px; text-align: left; gap: 14px; }
  .scale .dot { margin-block: 0 !important; }
  .scale button:nth-child(1) .dot, .scale button:nth-child(5) .dot { width: 26px; height: 26px; }
  .scale button:nth-child(2) .dot, .scale button:nth-child(4) .dot { width: 20px; height: 20px; margin-inline: 3px; }
  .scale button:nth-child(3) .dot { width: 14px; height: 14px; margin-inline: 6px; }
  .hint { display: none; }
  .mini { grid-template-columns: minmax(0, 1fr) 3.2rem; }
  .mini .mini-bar { grid-column: 1 / -1; grid-row: 2; }
  dl.facts-list { grid-template-columns: 1fr; gap: 2px; }
  dl.facts-list dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .ballot { transform: none; } }

/* Lomakekentät */
input[type="text"], input:not([type]), textarea { font: inherit; width: 100%; padding: 10px 12px; border-radius: var(--r-s);
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); }
textarea { resize: vertical; margin-top: 6px; }
input[readonly], textarea[readonly] { background: var(--wash); }

/* Ehdokkaan lomake */
.cq-list { display: grid; gap: 14px; }
.cq-text { font-size: clamp(1.1rem, 2.6vw, 1.3rem); }
.savebar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 5;
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
.savebar .wrap { display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 12px; }
.savebar #status { flex: 1 1 200px; }

/* Ehdokassivut */
.profile-head { display: flex; gap: 18px; align-items: center; }
.num.big { width: 72px; height: 72px; font-size: 1.5rem; border-width: 3px; flex: none; }
.num.small { width: 34px; height: 34px; font-size: .8rem; border-width: 1.5px; flex: none; }
.profile-theme { display: grid; gap: 10px; padding-top: 16px; }
.profile-theme + .profile-theme { border-top: 1px solid var(--line); margin-top: 8px; }
.profile-q { display: grid; gap: 4px; }
.answer { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
.answer .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.answer.a4 .dot, .answer.a5 .dot { background: var(--ink); }
.answer.a3 .dot { border-style: dashed; }
.district { border-top: 1px solid var(--line); padding: 12px 0; }
.district summary { font-size: 1rem; color: var(--ink); }
.cand-index { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.cand-index li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.result .who a { color: inherit; }
.profile-link { font-size: .88rem; font-weight: 600; }

/* Etusivun toinen polku ja vaalikoneen aloitusvalinnat */
.start-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.path { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; align-content: start; }
.path.alt { background: var(--wash); border-color: transparent; }

/* Lupaukset ja teot */
table.ranking td { white-space: normal; }
.records { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rec { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px; display: grid; gap: 10px; }
.rec-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; }
.rec-grid p { font-weight: 600; }
.outcome { font-weight: 700; font-size: .82rem; padding: 3px 8px; border-radius: 999px; border: 1.5px solid var(--line-2); white-space: nowrap; }
.o-linjassa .outcome { border-color: var(--ink); }
.rec.o-vastoin { background: var(--hl); color: var(--hl-ink); border-color: transparent; }
.o-vastoin .outcome { background: var(--hl-ink); color: var(--hl); border-color: var(--hl-ink); }
.rec.o-vastoin .muted, .rec.o-vastoin a, .rec.o-vastoin .eyebrow { color: inherit; }
.rec.o-poissa { color: var(--ink-3); }
.num-cell { font: 600 .9rem var(--font-num); text-align: right; }
table.ranking th { white-space: nowrap; }
.response { background: var(--wash); border-radius: var(--r-s); padding: 12px 14px; display: grid; gap: 4px; }
.vote-list { padding-left: 18px; display: grid; gap: 10px; }
.lead { font-size: 1.1rem; color: var(--ink-2); }
table.ranking td:first-child { min-width: 13rem; }

/* Seuraaminen */
button.small, .button.small { padding: 7px 12px; font-size: .85rem; }
button.follow.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.row-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cand-index li { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.follow-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.follow-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px; }
.fc-body { display: grid; gap: 4px; min-width: 0; }
.fc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fc-head a { text-decoration: none; }
.badge { background: var(--hl); color: var(--hl-ink); font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
table.compare th { text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--ink); min-width: 9rem; vertical-align: bottom; }
table.compare td:first-child { min-width: 16rem; white-space: normal; color: var(--ink); }
table.compare td { white-space: nowrap; }
table.compare .answer { font-size: .82rem; }
@media (max-width: 640px) {
  .follow-card { grid-template-columns: auto minmax(0, 1fr); }
  .follow-card > button { grid-column: 2; justify-self: start; }
}

/* Toiminta eduskunnassa ja vaalirahoitus */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--wash); border-radius: var(--r-s); padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.stat strong { font: 750 1.6rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fund-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--surface); }
.fund-bar span { display: block; height: 100%; }
.f0 { background: var(--series-1); } .f1 { background: var(--series-2); } .f2 { background: var(--series-3); }
.f3 { background: var(--series-4); } .f4 { background: var(--series-5); } .f5 { background: var(--series-6); }
.fund-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.fund-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 3rem; gap: 10px; align-items: center; font-size: .92rem; }
.fund-legend .sw { width: 10px; height: 10px; border-radius: 50%; }
.fund-legend strong, .fund-legend .muted { font-variant-numeric: tabular-nums; text-align: right; }
.mp-group + .mp-group { margin-top: 18px; }

/* Viikkokooste */
.week-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.week-nav { display: flex; gap: 6px; align-items: center; }
.week-nav select { width: auto; padding: 7px 10px; font-size: .88rem; }
.week-list { display: grid; gap: 16px; }
.week-mp { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.week-mp h3 { margin: 0; }
.week-mp h4 { margin: 4px 0 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.wvotes, .wspeech { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.wv { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.wv:first-child { border-top: 0; }
.wv.dev { background: var(--hl); color: var(--hl-ink); border-radius: var(--r-s); padding: 8px 10px; border-top-color: transparent; }
.wv.dev .muted, .wv.dev a { color: inherit; }
.pill { font-size: .78rem; font-weight: 700; text-align: center; padding: 3px 6px; border-radius: 999px; border: 1.5px solid var(--line-2); }
.pill.v-J { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pill.v-E { border-color: var(--ink); }
.pill.v-P, .pill.v-- { color: var(--ink-3); border-style: dashed; }
.tag { display: inline-block; margin-top: 4px; font-size: .8rem; background: var(--wash); border-radius: 6px; padding: 3px 8px; }
.tag.warn { background: var(--hl-ink); color: var(--hl); }
.wspeech li { font-size: .92rem; }
.duties { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.duties li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 6px; }
.duties li:first-child { border-top: 0; padding-top: 0; }
#tehtavat h3 { margin-top: 10px; }

/* Päivitystieto */
.updated::before { content: "↻ "; }
.updated.stale { color: var(--hl-ink); background: var(--hl); border-radius: 6px; padding: 2px 8px; }
.updated-note { font-size: .82rem; color: var(--ink-3); margin: 0; }

/* Uutiset */
.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.news li { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.news li:first-child { border-top: 0; padding-top: 0; }
.news a { font-weight: 600; text-decoration: none; }
.news a:hover { text-decoration: underline; }
.latest-news { font-size: .9rem; }
.latest-news .eyebrow { margin-right: 6px; }

/* Edustajahaku */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
input[type="search"] { font: inherit; width: 100%; padding: 12px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); }
.mp-list { list-style: none; padding: 0; margin: 0; display: grid; }
.mp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.mp-row:first-child { border-top: 0; }
.mp-main { display: grid; gap: 2px; min-width: 0; }
.mp-main a { text-decoration: none; }
.mp-main .tag { justify-self: start; }
.mp-stats { display: flex; gap: 16px; font: 600 .9rem var(--font-num); white-space: nowrap; }
.mp-stats .eyebrow { display: block; font-family: var(--font-body); }
@media (max-width: 640px) {
  .mp-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mp-stats { grid-column: 1; grid-row: 2; }
  .mp-row > button { grid-row: 1 / span 2; grid-column: 2; }
}

/* Etusivu */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feature { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 8px; align-content: start; background: var(--surface); }
.feature h3 { margin: 0; }
.district-links { display: flex; flex-wrap: wrap; gap: 8px; }
.district-links a { font-size: .88rem; padding: 6px 12px; border: 1.5px solid var(--line-2); border-radius: 999px; text-decoration: none; }
.district-links a:hover { border-color: var(--ink); }
.vaalikone-teaser { background: var(--wash); border-color: transparent; }

/* Julkisuudessa-osion suodatus (media.js) */
[hidden] { display: none !important; }
#julkisuudessa .tabs { margin-bottom: 8px; }
#julkisuudessa .tabs .muted { font-size: .85em; }
@media (max-width: 560px) { dl.facts-list { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.facts-list dd { margin-bottom: 10px; } }

/* Puolueiden ohjelmat: hyppylinkit */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--line-2); border-radius: 999px; font-size: .88rem; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
#ohjelmat h3 { margin: 18px 0 4px; font-size: 1rem; }
#ohjelmat .section-head + h3 { margin-top: 4px; }
#families td:first-child { min-width: 15rem; }
#families td:last-child { min-width: 12rem; }

/* Kuukausikirje ja omat tiedot (tili.html) */
input[type="email"], input[type="search"] { font: inherit; width: 100%; padding: 10px 12px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); }
.picker-results, .picker-selected { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.picker-results li, .picker-selected li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.picker-selected li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.picker-selected li button { margin-left: auto; }
#page form.panel h2 { margin-top: 22px; }
#page form.panel h2:first-child { margin-top: 0; }
.letter-preview { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; margin-top: 10px; }
label.chk span { line-height: 1.45; }

/* Kuukausikirjeen demo (tili.html) */
.demo-box { margin-top: 18px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r-s); }
.demo-box h3 { margin: 0 0 4px; }
