/* ---------- Tokens ---------- */
:root {
  --paper: #F3EFE6;
  --paper-2: #EAE4D7;
  --card: #FBF9F4;
  --ink: #16140F;
  --ink-2: #47433A;
  --muted: #827B6D;
  --line: rgba(22, 20, 15, .12);
  --line-2: rgba(22, 20, 15, .22);
  --accent: #B3261E;
  --si: #1F8A5A;
  --no: #D2412C;
  --abs: #B4AC9C;
  --seat-off: rgba(22, 20, 15, .08);
  --shadow: 0 1px 0 rgba(22, 20, 15, .04), 0 12px 32px -16px rgba(22, 20, 15, .28);
  --r: 14px;
  --r-sm: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #100F0D;
    --paper-2: #1A1815;
    --card: #181613;
    --ink: #F1ECE1;
    --ink-2: #C5BEB0;
    --muted: #8D8677;
    --line: rgba(241, 236, 225, .1);
    --line-2: rgba(241, 236, 225, .2);
    --accent: #F0644F;
    --si: #3DBB82;
    --no: #F0644F;
    --abs: #6F6A60;
    --seat-off: rgba(241, 236, 225, .08);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #100F0D;
  --paper-2: #1A1815;
  --card: #181613;
  --ink: #F1ECE1;
  --ink-2: #C5BEB0;
  --muted: #8D8677;
  --line: rgba(241, 236, 225, .1);
  --line-2: rgba(241, 236, 225, .2);
  --accent: #F0644F;
  --si: #3DBB82;
  --no: #F0644F;
  --abs: #6F6A60;
  --seat-off: rgba(241, 236, 225, .08);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
em { font-style: italic; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.num, [data-count], .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 30px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.brand svg circle { fill: var(--accent); stroke: none; }
.brand em { font-family: var(--serif); font-weight: 400; font-size: 1.15em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color 150ms ease, color 150ms ease; }
.nav a.nav-cta { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { background: var(--paper-2); color: var(--ink); }
  .nav a.nav-cta:hover { background: var(--accent); color: #fff; }
}
.theme { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; border-radius: 999px; transition: transform 150ms var(--ease-out), background-color 150ms ease; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme:active { transform: scale(.94); }
@media (max-width: 760px) {
  .nav a:not(.nav-cta) { display: none; }
  .brand span { font-size: 15px; }
  .top { gap: 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { border-color: var(--line-2); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent); color: #fff; }
  .btn-ghost:hover { background: var(--paper-2); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--gutter) 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px); align-items: center;
}
.kicker, .eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-family: var(--serif); font-size: clamp(48px, 7.4vw, 104px); line-height: .94; letter-spacing: -.02em; margin: 18px 0 22px; }
.hero h1 em { color: var(--accent); }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-chamber { margin: 0; position: relative; }
.chamber { width: 100%; height: auto; overflow: visible; }
.chamber .seat { transform-box: fill-box; transform-origin: center; transition: opacity 250ms ease, fill 300ms ease; }
.chamber.ready .seat { animation: seat-in 600ms var(--ease-out) both; animation-delay: var(--sd, 0ms); }
@keyframes seat-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.chamber.dim .seat:not(.hi) { opacity: .16; }
.chamber-center { position: absolute; left: 50%; top: 0; transform: translateX(-50%); aspect-ratio: 400 / 214; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; pointer-events: none; padding-bottom: 2%; }
.chamber-center strong { font: 400 clamp(40px, 6vw, 72px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.chamber-center span { font-size: 13px; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.legend button {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 500;
  transition: border-color 150ms ease, transform 150ms var(--ease-out), background-color 150ms ease;
}
.legend button:active { transform: scale(.96); }
.legend button[aria-pressed="true"] { border-color: var(--ink); }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
@media (hover: hover) and (pointer: fine) { .legend button:hover { border-color: var(--line-2); } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-chamber { order: -1; max-width: 560px; margin: 0 auto; width: 100%; }
}

/* ---------- KPIs ---------- */
.kpis { max-width: var(--max); margin: 24px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.kpi { padding: 22px 0 6px; border-right: 1px solid var(--line); padding-left: 20px; }
.kpi:first-child { padding-left: 0; }
.kpi:nth-child(4) { border-right: 0; }
.kpi strong { display: block; font: 400 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.02em; }
.kpi span { font-size: 14px; color: var(--ink-2); }
.kpi-src { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding-top: 10px; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(3) { padding-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Blocks ---------- */
.block { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 128px) var(--gutter) 0; }
.block-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.block h2 { font-family: var(--serif); font-size: clamp(38px, 5.2vw, 68px); line-height: 1; letter-spacing: -.02em; margin: 14px 0 16px; }
.block h2 em { color: var(--accent); }
.block-lede { font-size: 18px; color: var(--ink-2); max-width: 60ch; }

/* ---------- Coalition ---------- */
.coalition { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.coalition-bar { position: relative; height: 56px; border-radius: 12px; background: var(--paper-2); overflow: visible; }
.coalition-fill { position: absolute; inset: 0; display: flex; border-radius: 12px; overflow: hidden; }
.coalition-fill i { height: 100%; flex: none; width: calc(var(--w) * 1%); background: var(--c); transition: width 500ms var(--ease-out); position: relative; }
.coalition-fill i::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.5); }
.coalition-line { position: absolute; top: -10px; bottom: -10px; left: calc(68 / 135 * 100%); width: 2px; background: var(--ink); border-radius: 2px; }
.coalition-line span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font: 600 12px var(--mono); background: var(--ink); color: var(--paper); padding: 2px 7px; border-radius: 6px; }
.coalition-read { display: flex; align-items: baseline; gap: 14px; margin: 22px 0 18px; flex-wrap: wrap; }
.coalition-read strong { font: 400 64px/1 var(--serif); font-variant-numeric: tabular-nums; min-width: 2ch; }
.coalition-read span { font-size: 17px; color: var(--ink-2); }
.coalition-read.ok span { color: var(--si); font-weight: 600; }
.coalition-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; font-weight: 600; font-size: 14px;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 150ms var(--ease-out);
}
.pick small { font: 500 12px var(--mono); color: var(--muted); }
.pick:active { transform: scale(.96); }
.pick[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--ci); }
.pick[aria-pressed="true"] small { color: inherit; opacity: .75; }
.pick[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--ci); }
.coalition-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: 14px; color: var(--muted); }
.coalition-presets button { background: none; border: 0; padding: 6px 0; font-weight: 500; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .coalition-presets button:hover { color: var(--ink); text-decoration-color: currentColor; } }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: clamp(20px, 3vw, 28px); }
.panel h3 { font-family: var(--serif); font-size: 30px; line-height: 1.05; }
.panel-sub { font-size: 14px; color: var(--muted); margin: 6px 0 18px; }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ranking li { display: grid; grid-template-columns: 74px 1fr 46px; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.ranking .lbl { display: flex; align-items: center; gap: 8px; }
.ranking .track { height: 12px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.ranking .track i { display: block; height: 100%; background: var(--c); border-radius: 6px; transform-origin: left; transform: scaleX(0); transition: transform 900ms var(--ease-out); transition-delay: var(--d, 0ms); }
.in .ranking .track i, .ranking.in .track i { transform: scaleX(var(--s)); }
.ranking .pct { text-align: right; font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.tight { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tight button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 10px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: 10px; transition: background-color 150ms ease; }
.tight strong { font-weight: 500; font-size: 15px; display: block; }
.tight small { color: var(--muted); font-size: 12px; }
.tight .score { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tight .score b { color: var(--si); font-weight: 600; }
.tight .score s { color: var(--no); text-decoration: none; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tight button:hover { background: var(--paper-2); } }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 14px; position: sticky; top: 61px; z-index: 20; background: color-mix(in oklab, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 14px 0; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .filters { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; } }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row-end { gap: 8px 18px; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; min-height: 44px; padding: 0 14px 0 42px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); transition: border-color 150ms ease, box-shadow 150ms ease; }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink) 10%, transparent); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color 200ms var(--ease-out), color 200ms ease, box-shadow 200ms ease; }
.seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.sel select { appearance: none; -webkit-appearance: none; min-height: 44px; padding: 0 38px 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23827B6D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; font-size: 14px; font-weight: 500; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms var(--ease-out); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip b { font: 500 11px var(--mono); opacity: .55; margin-left: 4px; }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { border-color: var(--line-2); color: var(--ink); } }
.chips-soft { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; padding-top: 12px; }
.perfils summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; min-height: 32px; }
.perfils summary::-webkit-details-marker { display: none; }
.perfils summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 200ms var(--ease-out); margin-right: 2px; }
.perfils[open] summary::before { transform: rotate(45deg); }
.perfils summary em { font-style: normal; font-weight: 500; color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 32px; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background-color 200ms ease; flex: none; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 200ms var(--ease-out); }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(14px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.count { margin-left: auto; font: 500 13px var(--mono); color: var(--muted); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: grid; gap: 14px; text-align: left; padding: 20px 20px 18px; border-radius: calc(var(--r) + 4px);
  background: var(--card); border: 1px solid var(--line); position: relative;
  transition: border-color 200ms ease, box-shadow 250ms var(--ease-out), transform 250ms var(--ease-out);
  animation: card-in 380ms var(--ease-out) both; animation-delay: var(--d, 0ms);
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); } }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card > .card-meta { padding-right: 96px; }
.card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.card h3 { font-family: var(--serif); font-size: 26px; line-height: 1.08; letter-spacing: -.005em; padding-right: 92px; }
.card .stamp { position: absolute; top: 18px; right: 18px; }
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stamp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stamp.si { color: var(--si); background: color-mix(in oklab, var(--si) 12%, transparent); }
.stamp.no { color: var(--no); background: color-mix(in oklab, var(--no) 12%, transparent); }
.card-link { position: absolute; inset: 0; border-radius: inherit; background: none; border: 0; z-index: 1; }
.card-link:focus-visible { outline-offset: -2px; }

.vbar { display: grid; gap: 7px; }
.vbar-track { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--paper-2); gap: 2px; }
.vbar-track i { display: block; height: 100%; transform-origin: left; animation: grow 800ms var(--ease-out) both; animation-delay: calc(var(--d, 0ms) + 120ms); }
.vbar-track i.si { background: var(--si); }
.vbar-track i.ab { background: var(--abs); }
.vbar-track i.no { background: var(--no); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.vbar-legend { display: flex; gap: 14px; font: 500 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); flex-wrap: wrap; }
.vbar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vbar-legend span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--k); }
.vbar-legend .unan { color: var(--si); font-weight: 600; }
.vbar-legend .unan::before { display: none; }
.gpos { display: flex; gap: 3px; flex-wrap: wrap; }
.gp { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 5px; border-radius: 6px; font-size: 11.5px; letter-spacing: -.01em; font-weight: 600; background: var(--paper-2); color: var(--ink-2); position: relative; }
.gp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.gp svg { width: 11px; height: 11px; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gp.S { background: color-mix(in oklab, var(--si) 14%, transparent); color: var(--ink); }
.gp.S svg { stroke: var(--si); }
.gp.N { background: color-mix(in oklab, var(--no) 14%, transparent); color: var(--ink); }
.gp.N svg { stroke: var(--no); }
.gp.A svg, .gp.X svg { stroke: var(--muted); }
.gp.X { background: repeating-linear-gradient(135deg, var(--paper-2) 0 4px, transparent 4px 8px); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--muted); }
.tag + .tag::before { content: '·'; margin-right: 6px; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.empty button { background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.more { display: flex; justify-content: center; margin-top: 20px; }

/* ---------- Sheet (detail) ---------- */
.sheet { border: 0; padding: 0; max-width: min(760px, calc(100vw - 32px)); width: 100%; max-height: min(88vh, 900px); border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 40px 120px -20px rgba(0,0,0,.45); overflow: hidden; }
.sheet::backdrop { background: rgba(16, 15, 13, .44); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in 260ms var(--ease-out); }
.sheet[open]::backdrop { animation: fade-in 260ms var(--ease-out); }
.sheet.closing { animation: sheet-out 180ms var(--ease-out) forwards; }
.sheet.closing::backdrop { animation: fade-out 180ms var(--ease-out) forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (max-width: 640px) {
  .sheet { max-width: 100vw; width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
}
.sheet-inner { overflow-y: auto; max-height: inherit; padding: 28px clamp(20px, 4vw, 36px) 32px; overscroll-behavior: contain; }
.sheet-close { position: sticky; top: 0; float: right; margin: -8px -12px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; z-index: 2; transition: transform 150ms var(--ease-out), background-color 150ms ease; }
.sheet-close:active { transform: scale(.92); }
.sheet-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sheet h2 { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.02; letter-spacing: -.015em; margin: 12px 0 14px; }
.sheet .resum { font-size: 17px; color: var(--ink-2); }
.sheet-chamber { margin: 22px 0 8px; position: relative; }
.sheet-chamber svg { width: 100%; height: auto; }
.sheet-chamber .seat { transition: fill 400ms var(--ease-out); }
.sheet-result { display: flex; justify-content: center; gap: clamp(16px, 4vw, 40px); margin-top: -4px; text-align: center; }
.sheet-result div strong { display: block; font: 400 clamp(34px, 5vw, 48px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.sheet-result div span { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sheet-result div span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--k); }
.gtable { width: 100%; border-collapse: collapse; margin: 24px 0 8px; font-size: 15px; }
.gtable th { text-align: left; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.gtable td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.gtable td:first-child { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.gtable th:nth-child(2) { text-align: right; padding-right: 18px; }
.gtable td:nth-child(2) { color: var(--muted); font-family: var(--mono); font-size: 13px; text-align: right; padding-right: 18px; }
.pos { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.pos::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.nota { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--paper-2); font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; }
.nota::before { content: 'i'; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); font: italic 600 13px/20px var(--serif); text-align: center; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.sheet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.sheet-tags span { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.copy { background: none; border: 1px solid var(--line-2); border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; transition: background-color 150ms ease, transform 150ms var(--ease-out); }
.copy:active { transform: scale(.96); }

/* ---------- Affinity matrix ---------- */
.affinity { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .affinity { grid-template-columns: 1fr; } }
.matrix-wrap { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: clamp(12px, 2.4vw, 24px); overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 4px; margin: 0 auto; }
.matrix th { font-size: 12px; font-weight: 600; padding: 0 4px; white-space: nowrap; }
.matrix thead th { height: 28px; vertical-align: bottom; }
.matrix tbody th { text-align: right; padding-right: 8px; }
.matrix th button { background: none; border: 0; padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; transition: background-color 150ms ease; }
.matrix th button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.matrix td { width: clamp(30px, 6vw, 58px); height: clamp(30px, 6vw, 52px); border-radius: 8px; text-align: center; font: 500 clamp(10px, 1.4vw, 13px) var(--mono); font-variant-numeric: tabular-nums; background: color-mix(in oklab, var(--ink) calc(var(--v) * 1%), var(--paper-2)); color: var(--tc); transition: transform 200ms var(--ease-out), box-shadow 200ms ease, opacity 200ms ease; cursor: default; }
.matrix td.self { background: repeating-linear-gradient(135deg, var(--paper-2) 0 3px, transparent 3px 7px); color: transparent; }
.matrix.focus td:not(.on):not(.self) { opacity: .5; }
@media (hover: hover) and (pointer: fine) { .matrix td:not(.self):hover { transform: scale(1.08); box-shadow: 0 6px 18px -6px rgba(0,0,0,.4); } }
.ally { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: clamp(20px, 3vw, 28px); }
.ally h3 { font-family: var(--serif); font-size: 32px; line-height: 1.02; display: flex; align-items: center; gap: 10px; }
.ally h3 .dot { width: 14px; height: 14px; }
.ally p { font-size: 14px; color: var(--muted); margin: 6px 0 16px; }
.ally ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ally li { display: grid; grid-template-columns: 70px 1fr 42px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.ally li .track { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.ally li .track i { display: block; height: 100%; background: var(--c); transform-origin: left; animation: grow 600ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.ally li .pct { text-align: right; font: 500 13px var(--mono); }

.profiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (max-width: 1000px) { .profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .profiles { grid-template-columns: 1fr; } }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); padding: 18px; position: relative; overflow: hidden; }
.gcard::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.gcard header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gcard h4 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 400; }
.gcard header span { font: 500 12px var(--mono); color: var(--muted); }
.gcard .full { font-size: 12px; color: var(--muted); margin: 2px 0 14px; }
.gcard .split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.gcard .split i.si { background: var(--si); } .gcard .split i.ab { background: var(--abs); } .gcard .split i.no { background: var(--no); }
.gcard dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0 0; }
.gcard dt { font-size: 11px; color: var(--muted); }
.gcard dd { margin: 0; font: 500 15px var(--mono); font-variant-numeric: tabular-nums; }
.gcard .win { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.gcard .win b { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* ---------- Diputats ---------- */
.dip-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 2fr); gap: clamp(16px, 3vw, 36px); align-items: start; }
@media (max-width: 900px) { .dip-layout { grid-template-columns: 1fr; } }
.map-box { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: 18px; }
@media (max-width: 900px) { .map-box { position: static; max-width: 420px; margin: 0 auto; width: 100%; } }
#map { width: 100%; height: auto; overflow: visible; }
#map .prov { fill: var(--paper-2); stroke: var(--card); stroke-width: 2.5; stroke-linejoin: round; cursor: pointer; transition: fill 200ms ease, transform 300ms var(--ease-out); transform-box: fill-box; transform-origin: center; }
#map .prov:focus-visible { outline: none; stroke: var(--accent); }
#map .prov.on { fill: var(--ink); }
@media (hover: hover) and (pointer: fine) { #map .prov:hover:not(.on) { fill: color-mix(in oklab, var(--ink) 18%, var(--paper-2)); } }
#map .plabel { pointer-events: none; text-anchor: middle; fill: var(--ink); transition: fill 200ms ease; }
#map .plabel.on { fill: var(--paper); }
#map .plabel .pn { font: 400 34px var(--serif); }
#map .plabel .ps { font: 500 19px var(--mono); opacity: .7; }
.map-help { font-size: 13px; color: var(--muted); margin-top: 10px; }
.dip-side .filter-row { margin-bottom: 10px; }
.dip-side .count { margin: 0 0 12px; text-align: right; }
.dip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dip { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; animation: card-in 340ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.dip figure { margin: 0; aspect-ratio: 7 / 8; background: var(--paper-2); position: relative; overflow: hidden; }
.dip img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; outline: 1px solid rgba(0,0,0,.06); outline-offset: -1px; }
.dip figure::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.dip .info { padding: 10px 12px 12px; display: grid; gap: 2px; flex: 1; }
.dip strong { font-size: 14px; line-height: 1.25; font-weight: 600; }
.dip small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dip .acts { display: flex; gap: 6px; padding: 0 12px 12px; }
.dip .acts a { flex: 1; text-align: center; font-size: 12px; font-weight: 600; text-decoration: none; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line); transition: background-color 150ms ease, border-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .dip .acts a:hover { background: var(--paper-2); border-color: var(--line-2); } }
.dip .pres { font-size: 11px; color: var(--accent); font-weight: 600; }
.more button { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-weight: 600; transition: background-color 150ms ease, transform 150ms var(--ease-out); }
.more button:active { transform: scale(.97); }

/* ---------- Quiz ---------- */
.quiz { background: var(--ink); color: var(--paper); border-radius: 28px; padding: clamp(24px, 5vw, 56px); position: relative; overflow: hidden; min-height: 460px; }
.quiz::before { content: ''; position: absolute; right: -120px; bottom: -220px; width: 520px; height: 520px; border-radius: 50%; border: 60px solid color-mix(in oklab, var(--paper) 6%, transparent); pointer-events: none; }
.qprog { display: flex; gap: 4px; margin-bottom: 28px; }
.qprog i { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in oklab, var(--paper) 18%, transparent); position: relative; overflow: hidden; }
.qprog i::after { content: ''; position: absolute; inset: 0; background: var(--paper); transform: scaleX(0); transform-origin: left; transition: transform 400ms var(--ease-out); }
.qprog i.done::after { transform: scaleX(1); }
.qprog i.skip::after { transform: scaleX(1); opacity: .35; }
.qstep { animation: q-in 380ms var(--ease-out) both; position: relative; }
@keyframes q-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.qnum { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.qq { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.04; letter-spacing: -.015em; margin: 14px 0 14px; max-width: 22ch; }
.qctx { font-size: 15px; opacity: .7; max-width: 60ch; }
.qbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.qbtn { min-height: 52px; padding: 0 24px; border-radius: 999px; font-weight: 600; font-size: 16px; border: 1px solid color-mix(in oklab, var(--paper) 25%, transparent); background: transparent; color: var(--paper); display: inline-flex; align-items: center; gap: 10px; transition: background-color 150ms ease, color 150ms ease, transform 150ms var(--ease-out), border-color 150ms ease; }
.qbtn:active { transform: scale(.96); }
.qbtn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; }
.qbtn.si { background: var(--si); border-color: var(--si); color: #fff; }
.qbtn.no { background: var(--no); border-color: var(--no); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .qbtn:hover { border-color: var(--paper); }
  .qbtn.si:hover, .qbtn.no:hover { filter: brightness(1.08); }
}
.qnav { display: flex; gap: 18px; margin-top: 22px; font-size: 14px; }
.qnav button { background: none; border: 0; color: inherit; opacity: .65; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--paper) 30%, transparent); transition: opacity 150ms ease; }
.qnav button:hover { opacity: 1; }
.qres h3 { font-family: var(--serif); font-size: clamp(34px, 5vw, 60px); line-height: 1; letter-spacing: -.02em; max-width: 18ch; }
.qres h3 em { color: var(--hl); }
.qres > p { opacity: .7; margin: 12px 0 28px; max-width: 56ch; }
.qbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 720px; }
.qbars li { display: grid; grid-template-columns: 80px 1fr 52px; gap: 14px; align-items: center; font-weight: 600; }
.qbars .track { height: 18px; border-radius: 9px; background: color-mix(in oklab, var(--paper) 12%, transparent); overflow: hidden; }
.qbars .track i { display: block; height: 100%; background: var(--c); border-radius: 9px; transform-origin: left; animation: grow 900ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
.qbars .pct { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.qbars .lbl { display: flex; align-items: center; gap: 8px; }
.qdetail { margin-top: 32px; display: grid; gap: 2px; max-width: 720px; }
.qdetail summary { cursor: pointer; font-weight: 600; opacity: .8; padding: 6px 0; }
.qdetail ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.qdetail li { font-size: 14px; display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid color-mix(in oklab, var(--paper) 14%, transparent); }
.qdetail li span { opacity: .65; font-size: 13px; }
.quiz .btn-primary { background: var(--paper); color: var(--ink); }
.quiz .btn-ghost { border-color: color-mix(in oklab, var(--paper) 30%, transparent); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .quiz .btn-ghost:hover { background: color-mix(in oklab, var(--paper) 10%, transparent); } .quiz .btn-primary:hover { background: var(--accent); color: #fff; } }
.qactions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- Method & footer ---------- */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); border-top: 1px solid var(--line); padding-top: 28px; }
@media (max-width: 860px) { .method-grid { grid-template-columns: 1fr; } }
.method h3 { font-family: var(--serif); font-size: 28px; margin-bottom: 10px; }
.method p { color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.foot { max-width: var(--max); margin: clamp(72px, 10vw, 120px) auto 0; padding: 28px var(--gutter) 48px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- Tooltip ---------- */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 13px; padding: 7px 10px; border-radius: 8px; max-width: 240px; opacity: 0; transform: translateY(4px); transition: opacity 120ms ease, transform 120ms var(--ease-out); }
.tip.on { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chamber.ready .seat, .card, .dip, .qstep, .vbar-track i, .ally li .track i, .qbars .track i { animation: none; }
  .ranking .track i { transition: none; transform: scaleX(var(--s)); }
  .sheet[open], .sheet[open]::backdrop, .sheet.closing, .sheet.closing::backdrop { animation: none; }
  .coalition-fill i, .qprog i::after, .toggle span::after, #map .prov, .card { transition: none; }
}
