@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/montserrat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/montserrat-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  /* Marca: negro del logotipo de Odiseo + verde, blanco y rojo de la bandera de México. */
  --logo-black: #141211;
  --flag-green: #006847;
  --flag-white: #ffffff;
  --flag-red: #ce1126;
  --bg: #f4f2ef;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --ink: #171514;
  --ink-2: #45413e;
  --muted: #6d6863;
  --line: #e4e0db;
  --line-strong: #cdc7c0;
  --wine: #171514;
  --wine-soft: #a9cdbb;
  --scale-top: #006847;
  --scale: #a9cdbb;
  --medir: #ce1126;
  --interpretar: #171514;
  --actuar: #006847;
  --approve: #006847;
  --disapprove: #ce1126;
  --neutral: #b4aea8;
  --track: #eeebe7;
  --map-empty: #e9e5e0;
  --map-survey: #bcb5ae;
  --map-stroke: #ffffff;
  --seq-1: #cfe6da;
  --seq-2: #94c7ad;
  --seq-3: #4f9c78;
  --seq-4: #1d7a50;
  --seq-5: #004d33;
  --warn-ink: #7a4b00;
  --warn-bg: #fdf0d5;
  --shadow: 0 1px 2px rgb(20 18 17 / 6%), 0 8px 24px rgb(20 18 17 / 5%);
  --radius: 14px;
  --tricolor: linear-gradient(90deg, var(--flag-green) 0 33.33%, var(--flag-white) 33.33% 66.66%, var(--flag-red) 66.66% 100%);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050b11;
  --surface: #0c1720;
  --surface-2: #112029;
  --ink: #eaf3f6;
  --ink-2: #c4d4dc;
  --muted: #8aa1ad;
  --line: #1a2c38;
  --line-strong: #29414f;
  --wine: #eaf3f6;
  --wine-soft: #1f5a4c;
  --scale-top: #3fd0a0;
  --scale: #1f5a4c;
  --medir: #ff5a6a;
  --interpretar: #eaf3f6;
  --actuar: #3fd0a0;
  --approve: #3fd0a0;
  --disapprove: #ff5a6a;
  --neutral: #4c606c;
  --track: #172833;
  --map-empty: #172833;
  --map-survey: #3c5361;
  --map-stroke: #0c1720;
  --seq-1: #12352f;
  --seq-2: #18523f;
  --seq-3: #217556;
  --seq-4: #3fa37c;
  --seq-5: #8fe0bd;
  --warn-ink: #ffd27a;
  --warn-bg: #33290f;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--interpretar); outline-offset: 2px; }
[hidden] { display: none !important; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:disabled { opacity: .55; cursor: progress; }
.button-primary { background: var(--wine); color: #fff; }
:root[data-theme="dark"] .button-primary { color: var(--logo-black); }
.button-primary:hover { filter: brightness(1.08); }
.button-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.button-quiet:hover { background: var(--surface-2); color: var(--ink); }
.button-actuar { background: var(--actuar); color: #fff; }
:root[data-theme="dark"] .button-actuar { color: #06281b; }
.icon-button {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-button svg { width: 16px; height: 16px; fill: currentColor; }
.link-button { background: none; border: 0; padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap; text-decoration: none; vertical-align: middle;
}
.tag-link:hover { border-color: var(--line-strong); color: var(--ink); }
.tag-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag-soft { color: var(--muted); }

.party-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.party-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgb(0 0 0 / 8%); }

.empty { color: var(--muted); padding: 18px 0; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------------------------------------------------------------- barra superior */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px clamp(16px, 3vw, 32px) 12px;
  background: var(--logo-black); color: #f4f1ec;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-divider { width: 1px; height: 28px; background: rgb(255 255 255 / 22%); }
.brand-name { display: block; font-weight: 900; letter-spacing: .14em; font-size: 14px; line-height: 1.1; }
.brand-sub { display: block; font-size: 12px; color: #c9c2bb; font-weight: 600; line-height: 1.25; }
.brand-sub strong { display: block; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 12%); }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13px; color: #d6d0ca; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current] { background: #fff; color: var(--logo-black); box-shadow: none; }
.topbar .button-quiet, .topbar .icon-button { border-color: rgb(255 255 255 / 26%); color: #eee9e4; background: transparent; }
.topbar .button-quiet:hover, .topbar .icon-button:hover { background: rgb(255 255 255 / 9%); color: #fff; }
.topbar .sync { color: #bdb6af; }
.topbar .sync-dot { background: #3fbf86; }
.topbar .sync-dot.is-error { background: #ff5a6a; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-right: 6px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--actuar); }
.sync-dot.is-busy { background: var(--interpretar); animation: pulse 1.2s ease-in-out infinite; }
.sync-dot.is-error { background: var(--medir); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync-dot.is-busy { animation: none; } }

/* ---------------------------------------------------------------- páginas */
.view { padding: 24px clamp(16px, 3vw, 32px) 64px; max-width: 1480px; margin: 0 auto; outline: none; }
.page { display: grid; gap: 20px; }
.page-head { display: grid; gap: 6px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.page-note { color: var(--muted); max-width: 70ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title { font-size: 16px; font-weight: 800; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.kpi-detail { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.map-card { padding: 18px; position: sticky; top: 76px; }
.side { padding: 18px; display: grid; gap: 12px; align-content: start; }
.side-title { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.side-sub { font-size: 13px; font-weight: 700; margin-top: 6px; }
.side-note { font-size: 12.5px; color: var(--muted); }
.side-open { justify-self: start; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.back-link { font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--wine); color: #fff; }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { color: var(--logo-black); }

/* ---------------------------------------------------------------- mapa */
.map { margin: 0; display: grid; gap: 12px; }
.map svg { width: 100%; height: auto; display: block; }
.map-state { stroke: var(--map-stroke); stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: opacity .15s; }
.map-state:hover, .map-state:focus-visible { stroke: var(--ink); stroke-width: 1.6; outline: none; }
.map-state.is-faint { opacity: .5; }
.map-state.is-fainter { opacity: .28; }
.map-state.is-selected { stroke: var(--ink); stroke-width: 2.6; opacity: 1; }
.map-legend { display: grid; gap: 6px; }
.legend-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend-keys li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%); }
.legend-note { font-size: 12px; color: var(--muted); }

.tooltip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; max-width: 300px;
  background: var(--ink); color: var(--surface-solid); border-radius: 10px; padding: 8px 11px;
  font-size: 12.5px; display: grid; gap: 2px; box-shadow: 0 6px 20px rgb(0 0 0 / 22%);
}
.tooltip strong { font-weight: 800; }

.entity-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; }
.entity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border-radius: 10px; text-decoration: none; }
.entity-row:hover { background: var(--surface-2); }
.entity-list { display: grid; gap: 6px; }
.entity-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.entity-row:hover { background: var(--surface); border-color: var(--line-strong); }
.entity-list li + li .entity-row { }
.entity-left { display: grid; min-width: 0; }
.entity-name { font-weight: 700; }
.entity-sub { font-size: 12px; color: var(--muted); }
.entity-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }
.entity-lead { font-size: 12px; color: var(--muted); font-weight: 600; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-list a { font-weight: 600; text-decoration: none; display: block; }
.mini-list a:hover { text-decoration: underline; }
.mini-sub { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- barras */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bar.is-quiet .bar-label { color: var(--muted); }
.bar-track { height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--scale); min-width: 2px; }
.bar-fill.is-top { background: var(--scale-top); }
.bar-value { text-align: right; font-weight: 700; color: var(--ink); }
.bar.is-quiet .bar-value { color: var(--muted); font-weight: 600; }
.bar-more { font-size: 12px; color: var(--muted); }

.approval { display: grid; gap: 8px; }
.approval-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--track); }
.approval-yes { background: var(--approve); }
.approval-no { background: var(--disapprove); }
.approval-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; }
.approval-key { display: inline-flex; align-items: center; gap: 6px; }
.approval-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.approval-key-yes::before { background: var(--approve); }
.approval-key-no::before { background: var(--disapprove); }

/* ---------------------------------------------------------------- entidad */
.state-page { display: grid; gap: 16px; }
.state-head { display: grid; gap: 8px; }
.state-title { font-size: clamp(30px, 4vw, 46px); font-weight: 900; text-transform: uppercase; letter-spacing: -.015em; line-height: 1.05; }
.state-facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.waves { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.wave {
  flex: none; display: grid; gap: 2px; padding: 9px 14px; border-radius: 12px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); max-width: 280px;
}
.wave:hover { border-color: var(--line-strong); }
.wave[aria-current] { border-color: var(--line-strong); background: var(--surface-2); }
.wave.is-empty { opacity: .6; }
.wave-title { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave-meta { font-size: 12px; color: var(--muted); }
.survey-meta { color: var(--ink-2); font-size: 13px; }

.mia-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mia-tab {
  --tone: var(--medir);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 16px; border-radius: var(--radius); text-decoration: none; background: var(--surface); border: 1px solid var(--line);
}
.mia-tab-interpretar { --tone: var(--interpretar); }
.mia-tab-actuar { --tone: var(--actuar); }
.mia-tab:hover { border-color: var(--line-strong); }
.mia-tab[aria-current] { border-color: var(--line-strong); background: var(--surface-2); }
.mia-letter { grid-row: span 2; font-size: 38px; font-weight: 900; line-height: 1; color: var(--tone); opacity: .9; }
.mia-word { font-weight: 900; text-transform: uppercase; letter-spacing: .02em; font-size: 17px; color: var(--tone); }
.mia-sub { font-size: 12px; color: var(--muted); font-weight: 600; }

.mia-body { display: grid; gap: 26px; }
.mia-section { display: grid; gap: 12px; }
.section-head { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.section-number {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--wine); color: #fff; font-weight: 800; font-size: 13px; grid-row: span 2;
}
:root[data-theme="dark"] .section-number { color: var(--logo-black); }
.is-interpretar .section-number { background: var(--interpretar); }
.section-title { font-size: 19px; font-weight: 900; text-transform: uppercase; letter-spacing: -.005em; }
.section-head:not(:has(.section-number)) { grid-template-columns: 1fr; }
.section-note { font-size: 12.5px; color: var(--muted); }
.is-interpretar .section-title { color: var(--ink); }

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.qgrid-wide { grid-template-columns: minmax(0, 760px); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.qcard-head { display: grid; gap: 6px; }
.qcard-text { font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.qcard-meta { font-size: 12px; color: var(--muted); }

.place-picker { display: grid; gap: 8px; }
.place-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: var(--ink); }
.chip-n { font-size: 11px; opacity: .75; font-weight: 700; }

.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 172px), 1fr)); gap: 10px; }
.index-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; align-content: start; }
.index-label { font-size: 12.5px; font-weight: 700; color: var(--interpretar); }
.index-value { font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; display: flex; align-items: center; gap: 4px; }
.index-value .party-chip { font-size: 22px; }
.index-value .party-dot { width: 14px; height: 14px; }
.index-detail { font-size: 12.5px; color: var(--ink-2); }
.index-card .tag { justify-self: start; }

.findings { margin: 0; padding: 0; list-style: none; counter-reset: finding; display: grid; gap: 8px; }
.findings li {
  counter-increment: finding; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
}
.findings li::before { content: counter(finding, decimal-leading-zero); font-weight: 800; color: var(--interpretar); }
.findings-compact li { padding: 8px 10px; font-size: 13px; }

.coverage { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 6px 14px; }
.coverage li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.coverage-mark { font-weight: 800; width: 14px; }
.coverage .is-measured .coverage-mark { color: var(--interpretar); }
.coverage .is-missing { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table-wrap.card { padding: 4px 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }
.data-table td a { font-weight: 600; text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }
.data-table tr.is-link { cursor: pointer; }
.data-table tr.is-link:hover td { background: var(--surface-2); }
.data-table tr.is-faint td { color: var(--muted); }
.data-table td.is-lead { font-weight: 800; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); white-space: nowrap; }
.status-empate, .status-parejo { color: var(--interpretar); border-color: color-mix(in srgb, var(--interpretar) 45%, transparent); background: color-mix(in srgb, var(--interpretar) 8%, transparent); }
.status-sin-lectura { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type="search"], .filters select {
  min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
}
.filters input[type="search"] { min-width: min(100%, 280px); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.table-count { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- actuar */
.act-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.is-actuar .section-title { color: var(--ink); }
.action-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.action-form textarea, .action-body textarea {
  width: 100%; resize: vertical; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.form-error { grid-column: 1 / -1; color: var(--medir); font-size: 12.5px; }
.actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.action {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.action-number { font-weight: 900; color: var(--actuar); font-size: 15px; }
.action-body { display: grid; gap: 6px; }
.action-text { font-weight: 600; }
.action-hecho .action-text { text-decoration: line-through; color: var(--muted); }
.action-meta { font-size: 12px; color: var(--muted); }
.action-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.action-status { min-height: 32px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 10px; font-size: 12.5px; font-weight: 600; }
.action-tools .button { min-height: 32px; padding: 0 11px; font-size: 12.5px; }
.act-aside { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; position: sticky; top: 76px; }
.aside-title { font-size: 13px; font-weight: 800; color: var(--interpretar); }

/* ---------------------------------------------------------------- distritos */
.rank-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; gap: 1px; }
.rank-row { display: grid; grid-template-columns: minmax(120px, 42%) minmax(0, 1fr) 28px; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 8px; text-decoration: none; font-size: 13px; }
.rank-row:hover { background: var(--surface-2); }
.rank-row[aria-current] { background: color-mix(in srgb, var(--wine) 9%, var(--surface)); font-weight: 700; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { text-align: right; font-weight: 800; }
.district-list-head { align-items: end; margin-top: 4px; }
.district-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.district-group { display: grid; gap: 6px; padding: 14px 16px; }
.district-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.district-head h3 { font-size: 14px; font-weight: 800; }
.district-count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--wine); color: #fff;
  font-size: 12px; font-weight: 800; display: inline-grid; place-items: center;
}
:root[data-theme="dark"] .district-count { color: var(--logo-black); }
.district-head .tag { margin-left: auto; }
.district-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.district-list li { display: grid; grid-template-columns: 22px 44px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.district-order { color: var(--muted); font-size: 12px; text-align: right; }
.district-number { font-weight: 800; }
.district-list .is-case .district-seat { font-weight: 700; }

/* ---------------------------------------------------------------- presentación de entrada */
.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 40%, #24211f 0%, #0d0c0b 70%); color: #f4f1ec;
  transition: opacity .7s ease, visibility .7s;
}
html.intro-open { overflow: hidden; }
.intro.is-leaving { opacity: 0; visibility: hidden; }
.intro.is-leaving .intro-stage { transform: scale(1.04); }
.intro-stage {
  width: min(1180px, 94vw); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: clamp(20px, 4vw, 56px);
  align-items: center; transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.intro-map { width: 100%; height: auto; display: block; overflow: visible; }
.intro-state {
  fill: transparent; stroke: rgb(244 241 236 / 85%); stroke-width: 1.3; stroke-linejoin: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  transition: fill .7s ease var(--fd), stroke .7s ease var(--fd);
}
.is-drawing .intro-state { animation: intro-draw 1.5s cubic-bezier(.65, 0, .25, 1) var(--d) forwards; }
.is-filling .intro-state { fill: var(--fill); stroke: #0d0c0b; stroke-dashoffset: 0; }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
.intro-copy { display: grid; gap: 14px; justify-items: start; }
.intro-copy > * { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.is-titled .intro-copy > * { opacity: 1; transform: none; }
.is-titled .intro-copy > :nth-child(2) { transition-delay: .08s; }
.is-titled .intro-copy > :nth-child(3) { transition-delay: .16s; }
.is-titled .intro-copy > :nth-child(4) { transition-delay: .3s; }
.is-titled .intro-copy > :nth-child(5) { transition-delay: .42s; }
.is-titled .intro-copy > :nth-child(6) { transition-delay: .54s; }
.intro-logo { height: clamp(40px, 5vw, 58px); width: auto; }
.intro-kicker { font-size: 13px; font-weight: 700; color: #c9c2bb; letter-spacing: .08em; }
.intro-title { font-size: clamp(44px, 7vw, 92px); font-weight: 900; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; }
.intro-title span { display: block; font-weight: 300; color: #e9e4de; letter-spacing: .02em; }
.intro-flag { display: block; height: 5px; width: 0; border-radius: 3px; background: var(--tricolor); transition: width 1.1s cubic-bezier(.2, .8, .2, 1) .25s, opacity .7s ease; }
.is-titled .intro-flag { width: min(260px, 60%); }
.intro-sub { font-size: clamp(15px, 1.4vw, 18px); color: #e4ded8; max-width: 38ch; line-height: 1.5; }
.intro-stats { font-size: 13px; font-weight: 700; color: #bdb6af; }
.intro-skip {
  position: absolute; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 32px);
  background: transparent; color: #f4f1ec; border: 1px solid rgb(255 255 255 / 30%); border-radius: 999px;
  padding: 9px 18px; font-weight: 700; cursor: pointer;
}
.intro-skip:hover { background: rgb(255 255 255 / 10%); }

/* ---------------------------------------------------------------- aspirantes, imagen e INEGI */
.avatar {
  --ring: var(--line-strong);
  position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: color-mix(in srgb, var(--ring) 14%, var(--surface)); box-shadow: 0 0 0 2px var(--ring);
  color: var(--ink); font-weight: 800;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-md { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.bar-label.has-avatar { display: flex; align-items: center; gap: 8px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-candidate .bar, .bars-aspirant .bar { min-height: 26px; }

.qcard-kicker { font-size: 12px; font-weight: 800; color: var(--wine); }
.qcard-kicker.is-negative { color: var(--muted); }
.qcard-subject { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.qcard-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.qcard-foot strong { font-size: 15px; color: var(--ink); }
.qcard-foot-note { font-size: 12.5px; color: var(--muted); }

.image-bar { display: grid; gap: 8px; }
.image-pos { background: var(--approve); }
.image-reg { background: var(--neutral); }
.image-neg { background: var(--disapprove); }
.image-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; font-weight: 700; }
.image-key { display: inline-flex; align-items: center; gap: 6px; }
.image-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.image-key-pos::before { background: var(--approve); }
.image-key-reg::before { background: var(--neutral); }
.image-key-neg::before { background: var(--disapprove); }

.inegi { display: grid; gap: 14px; }
.inegi-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.inegi-big { font-size: 40px; font-weight: 900; color: var(--flag-green); letter-spacing: -.02em; line-height: 1; }
.inegi-text { max-width: 56ch; font-size: 13px; color: var(--ink-2); }
.inegi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.inegi-dim { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inegi-match { font-size: 12.5px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.compare { display: grid; gap: 8px; }
.compare-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; }
.compare-label { display: grid; font-size: 11px; color: var(--muted); line-height: 1.2; }
.compare-label strong { font-size: 11.5px; color: var(--ink); letter-spacing: .04em; }
.compare-bar { display: flex; gap: 2px; height: 26px; border-radius: 4px; overflow: hidden; }
.compare-part { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink); min-width: 0; overflow: hidden; white-space: nowrap; }
.compare-part.is-dark { color: #fff; }
:root[data-theme="dark"] .compare-part { color: #fff; }
:root[data-theme="dark"] .compare-part.is-dark { color: var(--logo-black); }
.compare-keys { font-size: 12px; }

/* ---------------------------------------------------------------- portada de la ola */
.survey-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mia-cover {
  display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.cover-candidate { display: flex; align-items: center; gap: 12px; }
.cover-who:empty { display: none; }
.cover-pick { display: grid; gap: 4px; min-width: 0; flex: 1; }
.cover-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cover-select { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 10px; font-weight: 700; max-width: 100%; }
.cover-hint { font-size: 12px; color: var(--muted); }
.cover-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cover-indices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cover-index { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 800; color: var(--ink); }
.cover-stat { display: grid; align-content: center; gap: 2px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 8%, var(--surface)); }
.cover-value { font-size: 28px; font-weight: 900; line-height: 1; color: var(--tone); }
.cover-text { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tone-medir { --tone: var(--medir); }
.tone-interpretar { --tone: var(--interpretar); }
.tone-actuar { --tone: var(--actuar); }

/* ---------------------------------------------------------------- índices y hallazgos */
.index-head { display: flex; align-items: baseline; gap: 8px; }
.index-key { font-size: 12px; font-weight: 900; color: #fff; background: var(--interpretar); border-radius: 6px; padding: 1px 7px; letter-spacing: .04em; }
:root[data-theme="dark"] .index-key { color: var(--logo-black); }
.index-head .index-label { color: var(--ink); }
.index-value.is-empty { font-size: 20px; color: var(--muted); }
.index-value.is-long { font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.index-card.is-missing { background: var(--surface-2); }
.index-how { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.index-how summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.index-how p { margin-top: 6px; }
.index-note { font-style: italic; }

.hallazgos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.hallazgo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; }
.hallazgo.is-missing { background: var(--surface-2); }
.hallazgo.is-missing .hallazgo-text { color: var(--muted); }
.hallazgo-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hallazgo-word { font-weight: 900; text-transform: uppercase; font-size: 13px; letter-spacing: .02em; }
.hallazgo-title { font-size: 15px; font-weight: 800; color: var(--interpretar); }
.hallazgo-head .tag { margin-left: auto; }
.hallazgo-figures { display: flex; flex-wrap: wrap; gap: 14px; }
.figure { display: grid; gap: 2px; min-width: 110px; }
.figure-value { font-size: 30px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; color: var(--tone, var(--ink)); }
.figure-label { font-size: 12px; font-weight: 700; color: var(--ink-2); max-width: 22ch; }
.hallazgo-text { font-size: 13.5px; }
.coverage-number { font-size: 11px; font-weight: 800; color: var(--muted); width: 18px; }

/* ---------------------------------------------------------------- recomendaciones y ficha técnica */
.act-main { display: grid; gap: 26px; }
.recs { display: grid; gap: 18px; }
.rec-form {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.rec-form .is-wide { grid-column: 1 / -1; }
.rec-field { display: grid; gap: 4px; min-width: 0; }
.rec-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.rec-form input, .rec-form textarea, .rec-form select, .ficha-input {
  width: 100%; min-height: 38px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
}
.rec-form textarea, textarea.ficha-input { resize: vertical; }
.rec-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-week { display: grid; gap: 10px; }
.rec-week-title { font-size: 13px; font-weight: 800; color: var(--actuar); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.rec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; }
.rec-head { display: flex; align-items: baseline; gap: 6px; color: var(--actuar); }
.rec-ordinal { font-size: 26px; font-weight: 900; line-height: 1; }
.rec-kicker { font-size: 13px; font-weight: 700; }
.rec-title { font-size: 15.5px; font-weight: 800; line-height: 1.35; }
.rec-text { font-size: 13.5px; color: var(--ink-2); }
.rec-hecho .rec-title { text-decoration: line-through; color: var(--muted); }
.rec .action-tools { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 10px; }
.rec .action-meta { margin-left: auto; }

.ficha { display: grid; gap: 12px; }
.ficha-table { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ficha-table dt, .ficha-table dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ficha-table dt { font-size: 11.5px; font-weight: 800; color: var(--wine); text-transform: uppercase; letter-spacing: .05em; align-self: center; }
.ficha-table dd { font-weight: 600; }
.ficha-table dt:last-of-type, .ficha-table dd:last-of-type { border-bottom: 0; }

/* ---------------------------------------------------------------- reporte para imprimir */
.report { display: grid; gap: 22px; max-width: 1120px; margin: 0 auto; }
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-cover { display: grid; gap: 10px; padding: 36px 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.report-brand { font-weight: 900; letter-spacing: .18em; font-size: 13px; color: var(--muted); }
.report-title { font-size: 80px; font-weight: 900; line-height: .95; letter-spacing: -.02em; }
.report-tagline { font-size: 20px; font-weight: 700; }
.report-state { font-size: 26px; font-weight: 900; text-transform: uppercase; color: var(--wine); }
.report-meta { color: var(--ink-2); }
.report-segment { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.report-segment.tone-medir { --tone: var(--medir); }
.report-segment.tone-interpretar { --tone: var(--interpretar); }
.report-segment.tone-actuar { --tone: var(--actuar); }
.report-letter { font-size: 54px; font-weight: 900; line-height: 1; color: var(--tone); }
.report-word { font-size: 24px; font-weight: 900; text-transform: uppercase; color: var(--tone); }
.report-sub { color: var(--muted); font-weight: 600; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  :root { --bg: #fff; --shadow: none; }
  body { background: #fff; font-size: 12px; }
  .topbar, .report-bar, .tooltip, .index-how summary::marker { display: none !important; }
  .view { padding: 0; max-width: none; }
  .report-cover { break-after: page; border: 0; }
  .report-segment { break-before: page; }
  .qcard, .index-card, .hallazgo, .rec, .compare, .ficha-table { break-inside: avoid; }
  .index-how { display: none; }
  .map-card { position: static; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- inicio de sesión */
.login-page { min-height: 100vh; margin: 0; color: #f4f1ec; background: radial-gradient(120% 90% at 30% 40%, #24211f 0%, #0d0c0b 70%); }
.login-stage {
  min-height: 100vh; width: min(1180px, 94vw); margin: 0 auto; padding: 40px 0;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center;
}
.login-copy { display: grid; gap: 22px; }
.login-form {
  display: grid; gap: 10px; padding: 20px; border-radius: var(--radius);
  background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 14%); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(12px); transition: opacity .6s ease .2s, transform .6s cubic-bezier(.2, .8, .2, 1) .2s;
}
.login-stage.is-titled .login-form, .login-stage.is-ready .login-form { opacity: 1; transform: none; }
.login-form label { font-weight: 700; font-size: 13px; color: #e4ded8; }
.login-form input { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid rgb(255 255 255 / 24%); background: rgb(0 0 0 / 30%); color: #fff; }
.login-form input:focus-visible { outline: 2px solid #3fbf86; outline-offset: 1px; }
.login-form .button-primary { min-height: 44px; margin-top: 4px; background: #fff; color: var(--logo-black); }
.login-form .button-primary:hover { filter: none; background: #ece8e3; }
.login-error { color: #ff8a95; font-size: 13px; font-weight: 600; }
.login-foot { font-size: 12.5px; color: #a8a19a; opacity: 0; transition: opacity .6s ease .5s; }
.login-stage.is-titled .login-foot, .login-stage.is-ready .login-foot { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .intro, .intro-stage, .intro-state, .intro-copy > *, .intro-flag, .login-form, .login-foot { transition: none !important; animation: none !important; }
  .intro-state { stroke-dashoffset: 0; }
}
@media (max-width: 860px) {
  .intro-stage, .login-stage { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .intro-map { max-width: 560px; margin: 0 auto; }
  .login-stage { align-content: center; padding: 28px 0; }
  .intro-title { font-size: clamp(40px, 13vw, 64px); }
}

/* ---------------------------------------------------------------- pantallas angostas */
@media (max-width: 1100px) {
  .mia-cover { grid-template-columns: minmax(0, 1fr); }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-card { position: static; }
  .act-layout { grid-template-columns: minmax(0, 1fr); }
  .act-aside { position: static; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 10px; }
  .topbar-tools { margin-left: 0; width: 100%; justify-content: flex-end; }
  .sync { margin-right: auto; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tabs a { flex: 1; text-align: center; padding: 6px 8px; }
  .mia-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mia-tab { grid-template-columns: 1fr; padding: 10px; text-align: center; }
  .mia-letter { grid-row: auto; font-size: 26px; }
  .mia-word { font-size: 13px; }
  .mia-sub { display: none; }
}
@media (max-width: 560px) {
  .kpi-value { font-size: 21px; }
  .cover-stats { grid-template-columns: minmax(0, 1fr); }
  .rec-form { grid-template-columns: minmax(0, 1fr); }
  .ficha-table { grid-template-columns: minmax(0, 1fr); }
  .ficha-table dt { border-bottom: 0; padding-bottom: 0; }
  .report-title { font-size: 56px; }
  .bar { grid-template-columns: minmax(90px, 42%) minmax(0, 1fr) 50px; gap: 8px; }
  .action { grid-template-columns: 28px minmax(0, 1fr); }
  .action-tools { grid-column: 1 / -1; justify-content: flex-start; }
  .action-form { grid-template-columns: 1fr; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 6px 6px; }
}
.trend-table td:first-child { min-width: 170px; }

/* ---------------------------------------------------------------- orden de la vista por entidad */
.mia-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.mia-content { display: grid; gap: 30px; min-width: 0; }
.mia-section { scroll-margin-top: 84px; }
.sheet-nav { position: sticky; top: 84px; display: grid; gap: 8px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.sheet-nav-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sheet-link {
  width: 100%; display: grid; grid-template-columns: 38px 1fr; gap: 6px; align-items: baseline; text-align: left;
  padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.sheet-link:hover { background: var(--surface); color: var(--ink); }
.sheet-link[aria-current] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.sheet-link-n { font-size: 11.5px; font-weight: 800; color: var(--wine); }
.is-interpretar .sheet-link-n, .mia-body.is-interpretar .sheet-link-n { color: var(--interpretar); }
.section-number { width: auto; min-width: 32px; padding: 0 8px; border-radius: 999px; }
.hallazgo-number {
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--interpretar); color: #fff; font-size: 12px; font-weight: 800; align-self: center;
}
:root[data-theme="dark"] .hallazgo-number { color: var(--logo-black); }
.rec-new { justify-self: start; }
@media (max-width: 1100px) {
  .mia-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sheet-nav { position: static; max-height: none; overflow: visible; padding: 0; }
  .sheet-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .sheet-link { width: auto; white-space: nowrap; grid-template-columns: auto auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; }
}
@media print { .sheet-nav { display: none; } .mia-layout { display: block; } }

/* ---------------------------------------------------------------- logos de partido */
.party-logo { flex: none; display: inline-grid; place-items: center; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.party-logo img { width: 100%; height: 100%; object-fit: contain; }
.party-logo-xs { width: 20px; height: 20px; border-radius: 50%; }
.party-logo-sm { width: 28px; height: 28px; border-radius: 50%; }
.party-logo-md { width: 38px; height: 38px; border-radius: 50%; }
.index-value .party-logo-xs { width: 22px; height: 22px; }
.qcard-subject .avatar { flex: none; }

/* ---------------------------------------------------------------- recomendaciones sugeridas */
.suggestions { display: grid; gap: 14px; }
.suggest-who { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.rec-sugerida { border-color: var(--line); }
.rec-head .tag { margin-left: auto; }
.suggest-pending { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 6px; }
.suggest-pending ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.rec .action-tools .button:disabled { opacity: 1; cursor: default; color: var(--ink-2); border-color: var(--line-strong); }

/* ---------------------------------------------------------------- colores por segmento del M.I.A. */
.mia-sheet .section-number { background: var(--medir); color: #fff; }
.is-interpretar .section-number { background: var(--interpretar); color: var(--surface-solid); }
.is-actuar .section-number { background: var(--actuar); color: #fff; }
:root[data-theme="dark"] .mia-sheet .section-number, :root[data-theme="dark"] .is-actuar .section-number { color: var(--logo-black); }
.mia-body.is-medir .sheet-link-n { color: var(--medir); }
.mia-body.is-actuar .sheet-link-n { color: var(--actuar); }
.mia-tab-interpretar .mia-letter, .mia-tab-interpretar .mia-word { color: var(--interpretar); }

.report-logo { height: 44px; width: auto; }
.report-flag { width: 220px; }
.report-cover { position: relative; overflow: hidden; }

/* ---------------------------------------------------------------- inicio: fondo electoral */
body.is-home {
  background-color: var(--bg);
  background-image:
    url("/assets/marca/fondo-panel-claro.svg"),
    radial-gradient(60% 40% at 0% 0%, rgb(0 104 71 / 7%), transparent 70%),
    radial-gradient(50% 40% at 100% 0%, rgb(206 17 38 / 6%), transparent 70%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 420px 420px, cover, cover;
  background-attachment: fixed, fixed, fixed;
  background-position: 0 0, 0 0, 0 0;
}
:root[data-theme="dark"] body.is-home {
  background-image:
    url("/assets/marca/fondo-panel-oscuro.svg"),
    radial-gradient(60% 40% at 0% 0%, rgb(0 104 71 / 14%), transparent 70%),
    radial-gradient(50% 40% at 100% 0%, rgb(206 17 38 / 10%), transparent 70%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 420px 420px, cover, cover;
  background-attachment: fixed, fixed, fixed;
  background-position: 0 0, 0 0, 0 0;
}

/* ---------------------------------------------------------------- inicio: portada */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; color: #f4f1ec;
  background: radial-gradient(80% 120% at 0% 100%, rgb(0 104 71 / 45%), transparent 60%),
    radial-gradient(70% 120% at 100% 0%, rgb(206 17 38 / 35%), transparent 60%), var(--logo-black);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .9fr); align-items: center; gap: 12px;
  padding: clamp(22px, 3.2vw, 40px) clamp(22px, 3.6vw, 48px);
}
.hero-copy { display: grid; gap: 12px; justify-items: start; position: relative; z-index: 1; }
.hero-kicker { font-size: 13px; font-weight: 700; color: #cfc8c1; letter-spacing: .06em; }
.hero-title { font-size: clamp(40px, 5.6vw, 76px); font-weight: 900; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; }
.hero-title span { font-weight: 300; color: #e9e4de; }
.hero-flag { display: block; width: 180px; height: 5px; border-radius: 3px; background: var(--tricolor); transform-origin: left; }
.hero-sub { max-width: 46ch; font-size: clamp(14px, 1.3vw, 17px); color: #e4ded8; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 10px 28px; margin-top: 6px; }
.hero-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 12%); backdrop-filter: blur(6px); }
.hero-number { font-size: clamp(26px, 2.6vw, 36px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-of { font-size: 13px; font-weight: 700; color: #cfc8c1; margin-left: 4px; }
.hero-stat:has(.hero-of) { grid-template-columns: auto 1fr; align-items: baseline; }

/* ---------------------------------------------------------------- tarjetas de candidatos */
.candidates-showcase {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(80% 60% at 20% 0%, rgb(0 104 71 / 6%), transparent 60%),
    radial-gradient(60% 50% at 100% 100%, rgb(206 17 38 / 5%), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
}
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}
.candidate-card {
  --candidate-party: var(--neutral);
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--surface-2) 0%, transparent 50%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease;
  animation: candidate-in .5s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--d, 0s);
}
.candidate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--candidate-party) 8%, transparent) 0%, transparent 40%);
  pointer-events: none;
}
.candidate-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 8%), 0 2px 8px rgb(0 0 0 / 8%);
  border-color: var(--line-strong);
}
.candidate-card.is-leading {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line);
}
.candidate-card.is-leading::after {
  content: "Líder";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--candidate-party);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.candidate-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.candidate-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--candidate-party) 35%, transparent), 0 2px 8px rgb(0 0 0 / 15%);
  transition: transform .3s ease, box-shadow .3s ease;
}
.candidate-card:hover .candidate-avatar {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--candidate-party) 50%, transparent), 0 4px 12px rgb(0 0 0 / 20%);
}
.candidate-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.candidate-avatar .avatar-initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--candidate-party) 20%, var(--surface));
  color: color-mix(in srgb, var(--candidate-party) 70%, var(--ink));
  font-size: 20px;
  font-weight: 800;
}
.candidate-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.candidate-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}
.candidate-party-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: color-mix(in srgb, var(--candidate-party) 80%, var(--ink));
}
.candidate-party-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--candidate-party);
}
.candidate-stats {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.candidate-pct {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--candidate-party);
}
.candidate-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.candidate-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--candidate-party);
  width: 0;
  transition: width 1s cubic-bezier(.2, .8, .2, 1) .2s;
}
.candidate-card:hover .candidate-bar-fill {
  filter: brightness(1.15);
}
.candidate-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.candidate-lead-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--candidate-party) 15%, transparent);
  color: color-mix(in srgb, var(--candidate-party) 80%, var(--ink));
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
@keyframes candidate-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .candidate-card { animation: none; transition: none; }
  .candidate-card:hover { transform: none; }
  .candidate-bar-fill { transition: none; width: var(--w, 0); }
}
.hero-stat:has(.hero-of) .hero-label { grid-column: 1 / -1; }
.hero-label { font-size: 12px; color: #cfc8c1; font-weight: 600; max-width: 16ch; }
.hero-art { position: relative; z-index: 1; }
.hero-art .urna { width: 100%; height: auto; display: block; max-height: 300px; }
.hero-right { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, .95fr); gap: 14px; align-items: stretch; position: relative; z-index: 1; }
.hero-right .activity-mini { width: 100%; background: var(--surface); color: var(--ink); }
.boleta-cae { animation: boleta-cae 6s cubic-bezier(.55, 0, .3, 1) infinite; }
@keyframes boleta-cae {
  0% { transform: translateY(-60px); opacity: 0; }
  12% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(170px); opacity: 1; }
  81%, 100% { transform: translateY(170px); opacity: 0; }
}
.flota { animation: flota 5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.flota-2 { animation-duration: 6.5s; animation-delay: -2s; }
.flota-3 { animation-duration: 4.2s; animation-delay: -1s; }
@keyframes flota { from { translate: 0 -5px; } to { translate: 0 7px; } }

/* ---------------------------------------------------------------- inicio: aparición escalonada */
.reveal { animation: reveal .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.home.is-static .reveal, .home.is-static .reveal * { animation: none; }
.hero.reveal .hero-flag { animation: flag-grow 1s cubic-bezier(.2, .8, .2, 1) .35s both; }
@keyframes flag-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 16px; align-items: start; margin-bottom: 2px; }
.hero-wrap .hero { margin: 0; }
.hero-wrap .activity-mini { width: 100%; }

/* ---------------------------------------------------------------- inicio: mapa */
.home .map-layout { margin-top: 2px; }
.map-stage {
  border-radius: 14px; padding: 8px 6px 2px;
  background: radial-gradient(70% 60% at 40% 45%, color-mix(in srgb, var(--flag-green) 6%, var(--surface)), var(--surface) 75%);
}
.map-stage .map svg { filter: drop-shadow(0 12px 18px rgb(20 18 17 / 12%)); }
:root[data-theme="dark"] .map-stage .map svg { filter: drop-shadow(0 12px 18px rgb(0 0 0 / 45%)); }
.map-state { transition: fill .5s ease, opacity .3s ease, stroke-width .2s ease; }
.map-state { cursor: pointer; }
.map-state:hover { filter: brightness(1.12) saturate(1.2); }
.legend-note { color: var(--ink-2); }
.map-enter .map-state { animation: estado-entra .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes estado-entra { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.map-state.is-selected { animation: estado-pulso 2.4s ease-in-out infinite; }
@keyframes estado-pulso { 50% { stroke-width: 4; } }
.side-col { display: grid; gap: 16px; align-content: start; }
.side-col .side .entity-list { max-height: 520px; overflow-y: auto; }

/* ---------------------------------------------------------------- actividad y notificaciones */
.activity { padding: 18px; display: grid; gap: 10px; }
.activity-title { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--flag-green); box-shadow: 0 0 0 0 rgb(0 104 71 / 50%); animation: latido 2s ease-out infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 9px rgb(0 104 71 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(0 104 71 / 0%); } }
.activity-list { display: grid; gap: 2px; margin: 0 -8px; }
.activity-note { font-size: 12px; color: var(--muted); }
.activity-mini { padding: 12px; gap: 6px; }
.activity-mini .activity-list { max-height: 200px; overflow-y: auto; margin: 0 -4px; }
.activity-mini .activity-note { font-size: 11px; }
.activity-mini .card-title { font-size: 14px; }
.notif-item {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 9px 8px; border-radius: 10px; text-decoration: none; color: var(--ink);
}
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--neutral); }
.notif-nueva .notif-dot { background: var(--flag-green); }
.notif-respuestas .notif-dot { background: var(--flag-red); }
.notif-body { display: grid; gap: 1px; min-width: 0; }
.notif-kind { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.notif-nueva .notif-kind { color: var(--actuar); }
.notif-respuestas .notif-kind { color: var(--medir); }
.notif-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-text { font-size: 12.5px; color: var(--ink-2); }
.notif-when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.notif-item.is-new { background: color-mix(in srgb, var(--flag-green) 7%, var(--surface)); }

.notif-wrap, .user-wrap { position: relative; }
.notif-button svg { width: 18px; height: 18px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--flag-red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--logo-black); animation: badge-entra .4s cubic-bezier(.2, .8, .2, 1.4);
}
@keyframes badge-entra { from { transform: scale(0); } }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 12px); width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 620px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; z-index: 40;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgb(0 0 0 / 28%); animation: panel-entra .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes panel-entra { from { opacity: 0; transform: translateY(-6px); } }
.notif-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.notif-head h2 { font-size: 15px; font-weight: 800; }
.notif-head p { font-size: 12px; color: var(--muted); }
.notif-list { overflow-y: auto; padding: 6px 8px; display: grid; gap: 2px; align-content: start; }
.notif-foot { font-size: 11.5px; color: var(--muted); padding: 8px 16px 12px; border-top: 1px solid var(--line); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 30px 4px 4px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 22%); animation: toast-entra .45s cubic-bezier(.2, .8, .2, 1);
}
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: opacity .5s ease, transform .5s ease; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.toast-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }

/* ---------------------------------------------------------------- usuario */
.user-button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 12px 3px 3px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgb(255 255 255 / 26%); background: transparent; color: #eee9e4; font-weight: 700; font-size: 13px;
}
.user-button:hover { background: rgb(255 255 255 / 9%); }
.user-initials {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800;
  background: #f4f1ec; color: var(--logo-black);
}
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 190px; z-index: 40; padding: 6px; display: grid;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgb(0 0 0 / 24%);
}
.user-menu a, .user-menu button {
  text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink);
  font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.users-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.users-create { padding: 18px; display: grid; gap: 12px; }
.users-create .rec-form { grid-template-columns: minmax(0, 1fr); padding: 0; border: 0; }
.users-list { display: grid; gap: 10px; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.form-ok { color: var(--actuar); font-weight: 700; font-size: 13px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.user-chip .user-initials { background: var(--logo-black); color: #fff; width: 26px; height: 26px; }
:root[data-theme="dark"] .user-chip .user-initials { background: #f4f1ec; color: var(--logo-black); }
.user-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-tools .button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.inline-password { display: flex; gap: 6px; }
.inline-password input { min-height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); padding: 0 8px; background: var(--surface); }
.status-activo { color: var(--actuar); border-color: color-mix(in srgb, var(--actuar) 45%, transparent); background: color-mix(in srgb, var(--actuar) 8%, transparent); }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 380px; justify-self: center; order: -1; }
  .hero-right { grid-template-columns: minmax(0, 1fr); }
  .hero-right .activity-mini { max-width: 420px; justify-self: center; }
  .hero-wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-wrap .activity-mini { max-width: 420px; justify-self: center; }
  .users-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-name { display: none; }
  .user-button { padding: 3px; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 112px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .boleta-cae, .flota, .map-enter .map-state, .map-state.is-selected, .live-dot, .hero-flag, .toast, .notif-panel, .notif-badge { animation: none !important; }
}
.toast .notif-when { margin-right: 10px; }

/* Hoja 13: cruces por perfil */
.mia-section, .sheet-cruces > * { min-width: 0; }
.cross-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; align-items: end; margin-bottom: 14px; }
.cross-field { display: grid; gap: 6px; min-width: 0; }
/* Selector de careos (Michoacán, Sinaloa, Zacatecas): renglón propio arriba de la pregunta. */
.cross-careo-field { grid-column: 1 / -1; justify-items: start; }
.cross-careos { flex-wrap: wrap; max-width: 100%; }
.cross-select { width: 100%; font-weight: 600; }
.cross-wrap { overflow-x: auto; }
.cross-table th { vertical-align: bottom; }
.cross-table th.num { text-align: right; }
.cross-col { display: block; color: var(--ink-2); white-space: normal; min-width: 64px; }
.cross-n { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.cross-label { min-width: 160px; }
.cross-table td.cross-total { font-weight: 800; background: var(--surface-2); }
.cross-table th.cross-total { background: var(--surface-2); }
.cross-cell { background: color-mix(in srgb, var(--scale-top) calc(var(--heat, 0) * 26%), transparent); font-variant-numeric: tabular-nums; }
.cross-cell.is-up::after, .cross-cell.is-down::after { font-size: 10px; margin-left: 4px; }
.cross-cell.is-up::after { content: "▲"; color: var(--approve); }
.cross-cell.is-down::after { content: "▼"; color: var(--disapprove); }
.cross-table .is-few { color: var(--muted); background: transparent; }
.cross-title { font-size: 13.5px; font-weight: 700; margin: 18px 0 8px; }
.cross-note { margin-top: 10px; }
@media (max-width: 760px) {
  .cross-controls { grid-template-columns: 1fr; }
  .cross-label { min-width: 120px; }
}
@media print { .cross-wrap { overflow: visible; } .cross-table { font-size: 10.5px; } }

/* ---------------------------------------------------------------- inicio: mejoras de jerarquía y lectura */
/* 1. Portada: el título respira; las cifras van en tarjetas de resumen flotantes, encima del borde. */
.hero-block { position: relative; display: grid; }
.hero-block .hero { padding-bottom: calc(clamp(22px, 3.2vw, 40px) + 48px); }
.summary-strip {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: -32px clamp(20px, 3vw, 44px) 0; padding: 6px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
}
.summary-card {
  display: grid; gap: 4px; padding: 16px 20px 18px 0; margin-left: 20px;
}
.summary-card:first-child { padding-left: 0; margin-left: 0; }
.summary-value { font-size: clamp(28px, 2.6vw, 38px); font-weight: 900; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.summary-of { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.summary-label { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.35; margin-top: 6px; }
.home .map-layout { margin-top: 6px; }

/* 2. Mapa: estado bajo el cursor resaltado (contorno encima, los demás se apagan) y leyenda flotante con más contraste. */
:root { --map-empty: #efece8; --map-survey: #c7c0b8; }
.map-state { stroke-width: 1.1; }
.map-state:hover { filter: none; }
.map-state.is-hover { filter: brightness(1.08) saturate(1.2); }
svg.is-hovering .map-state:not(.is-hover):not(.is-selected) { filter: opacity(.6) saturate(.8); }
.map-hover {
  fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; pointer-events: none; opacity: 0;
  transition: opacity .15s ease; filter: drop-shadow(0 3px 5px rgb(20 18 17 / 35%));
}
.map-hover.is-on { opacity: 1; }
.map-canvas { position: relative; }
.legend-float {
  display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.legend-float li { display: flex; align-items: center; gap: 8px; }
.legend-float .swatch {
  flex: none; width: 14px; height: 14px; border-radius: 4px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--ink) 28%, transparent);
}
@media (min-width: 761px) {
  .legend-float {
    position: absolute; left: 0; bottom: 0; display: grid; margin: 0; max-width: 44%; padding: 12px 14px; gap: 8px;
    background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
  }
}
@media (prefers-reduced-motion: reduce) { .map-hover { transition: none; } }

/* 3. Lista lateral: cada entidad es una tarjeta con borde del partido e insignia de color. */
.side-head { display: grid; gap: 2px; margin-bottom: 10px; }
.side-note { font-size: 12px; color: var(--muted); }
.side .entity-list { gap: 8px; margin: 0; padding: 2px 4px 4px 0; }
.side .entity-list li + li .entity-row { }
.side .entity-row {
  display: grid; gap: 8px; padding: 12px 14px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgb(20 18 17 / 5%);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.side .entity-row:hover { background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.entity-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.entity-top .entity-name { font-size: 14.5px; font-weight: 800; color: var(--ink); min-width: 0; }
.entity-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.entity-bottom .entity-sub { margin-right: auto; }
.party-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; white-space: nowrap;
  background: var(--party); color: var(--badge-ink, #fff); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.party-badge strong { font-weight: 900; }
.party-badge.is-plain { padding: 3px 10px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }
.badge-logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: block; overflow: hidden; box-shadow: 0 1px 4px rgb(20 18 17 / 12%); }
.badge-logo .party-logo { width: 100%; height: 100%; border-radius: 50%; }
.badge-logo .party-logo img { width: 100%; height: 100%; object-fit: cover; }
.mini-chip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.mini-chip.is-tie { border-style: dashed; }
.entity-bottom .tag { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .side .entity-row, .side .entity-row:hover { transition: none; transform: none; } }

/* 4. Navegación: la barra superior son las secciones; dentro del mapa, un filtro con otro estilo (subrayado). */
.map-modes { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 6px; border-bottom: 1px solid var(--line); }
.map-modes-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.map-modes-options { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.map-mode {
  border: 0; background: none; padding: 8px 0 9px; margin-bottom: -1px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.map-mode:hover { color: var(--ink); }
.map-mode[aria-pressed="true"] { color: var(--ink); font-weight: 800; border-bottom-color: var(--ink); }
.map-mode:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 900px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -28px 14px 0; }
  .summary-card { padding: 12px 14px 14px 0; margin-left: 14px; padding-left: 14px; }
  .summary-card:first-child { border-left: 0; padding-left: 0; margin-left: 0; }
  .summary-card:nth-child(3) { border-left: 0; padding-left: 0; margin-left: 0; }
  .hero-block .hero { padding-bottom: calc(clamp(22px, 3.2vw, 40px) + 36px); }
}
@media (max-width: 480px) {
  .summary-card { padding: 12px 14px 14px 0; margin-left: 14px; padding-left: 14px; }
}

/* Lista lateral con dona por entidad: reparto de la preferencia y logo del partido que encabeza al centro. */
.donut { position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut-track { stroke: var(--track); }
:root[data-theme="dark"] .donut-track { stroke: #2c2927; }
.donut-seg { stroke-linecap: butt; animation: donut-in .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--i, 0) * 90ms); }
@keyframes donut-in { from { stroke-dasharray: 0 400; } }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.donut-center .party-logo { width: 60px; height: 60px; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgb(20 18 17 / 14%); }
.donut-center .party-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.donut-text { font-size: 12px; font-weight: 900; color: var(--ink-2); }
.side .entity-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 16px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: 0 6px 18px rgb(20 18 17 / 8%); }
.entity-body { display: grid; gap: 7px; min-width: 0; }
.entity-top { align-items: baseline; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
.entity-top .entity-sub { flex: none; font-size: 11.5px; }
.entity-race { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.entity-race .party-badge { font-size: 13.5px; padding: 4px 11px; }
.entity-second { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.entity-second::before { content: "2.º"; font-size: 11px; font-weight: 700; color: var(--muted); }
.entity-second .party-logo-sm { width: 28px; height: 28px; }
.entity-second .party-dot { width: 10px; height: 10px; border-radius: 50%; }
.entity-bottom .entity-sub { margin-right: 0; }
.entity-hint { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) {
  .side .entity-row { column-gap: 10px; }
  .entity-donut { --size: 68px !important; }
  .donut-center .party-logo { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .donut-seg { animation: none; } }
.home.is-static .donut-seg { animation: none; }

/* Emblemas de partido nítidos (cuadrados generados en el navegador) e insignias del mismo tamaño. */
.party-logo img.party-emblem { width: 100%; height: 100%; object-fit: cover; display: block; }
.donut-center .party-logo { width: 54px; height: 54px; }
.entity-race { gap: 6px 8px; }
.entity-race .party-badge { min-height: 32px; padding: 3px 12px 3px 3px; font-size: 13.5px; gap: 7px; }
.entity-race .badge-logo, .entity-race .badge-logo .party-logo { width: 26px; height: 26px; }
.entity-race .badge-logo { background: transparent; }
.party-badge.is-second {
  background: color-mix(in srgb, var(--party) 14%, var(--surface)); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--party);
}
.badge-rank { font-size: 11px; font-weight: 800; color: var(--muted); margin-left: 6px; margin-right: -2px; }
.party-badge.is-second .badge-rank + .badge-logo { margin-left: 0; }

/* ---------------------------------------------------------------- vista por entidad: cabecera ordenada */
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.state-page { gap: 14px; }
.state-hero, .survey-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px clamp(16px, 2.2vw, 26px);
}
.state-hero { position: relative; overflow: hidden; display: grid; gap: 16px; }
.state-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.state-crumbs .back-link { margin: 0; }
.crumb-sep { opacity: .5; }
.crumb-here { color: var(--ink-2); }
.state-print { margin-left: auto; }
.state-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.state-identity .party-logo-lg { width: 68px; height: 68px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgb(20 18 17 / 14%); }
.state-naming { display: grid; gap: 8px; min-width: 0; }
.state-hero .state-title { font-size: clamp(30px, 3.6vw, 44px); }
.state-facts { gap: 8px; }
.state-fact {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none;
}
.state-fact .party-dot { width: 9px; height: 9px; border-radius: 50%; }
.state-fact.is-key { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.state-fact.is-link:hover { color: var(--ink); border-color: var(--line-strong); }
.waves-wrap { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.waves { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 240px); gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
.wave {
  display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  text-decoration: none; color: var(--ink); position: relative; transition: border-color .15s ease, background .15s ease;
}
.wave:hover { border-color: var(--line-strong); background: var(--surface); }
.wave[aria-current] { background: var(--surface); border-color: var(--ink); }
.wave-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wave-date { font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.wave-count { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wave-title { font-size: 12px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave.is-empty { opacity: .55; }

.survey-panel { display: grid; gap: 16px; }
.survey-panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.survey-panel-name { display: grid; gap: 3px; min-width: 0; }
.survey-name { font-size: 18px; font-weight: 800; line-height: 1.25; color: var(--ink); }
.survey-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.survey-fact { display: grid; gap: 3px; padding: 10px 14px; min-width: 0; }
.survey-fact + .survey-fact { border-left: 1px solid var(--line); }
.survey-fact dt { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.survey-fact dd { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.survey-panel-bottom { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 2fr); gap: 16px; align-items: stretch; }
.survey-panel .cover-candidate { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.survey-panel .cover-select { width: 100%; }
.survey-panel .cover-hint { margin-top: 2px; }
.survey-panel .cover-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.survey-panel .cover-stat {
  display: grid; align-content: start; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line);
}
.cover-word { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tone); }
.cover-letter { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--tone); color: var(--surface-solid); font-size: 11px; letter-spacing: 0; }
.survey-panel .cover-value { font-size: 30px; color: var(--ink); }
.cover-of { font-size: 15px; font-weight: 800; color: var(--muted); margin-left: 2px; }
.survey-panel .cover-text { font-size: 12px; color: var(--muted); }
.survey-panel .cover-indices { margin-top: 4px; gap: 6px; }
.survey-panel .cover-index { min-height: 22px; font-size: 11.5px; padding: 0 8px; }
.tone-medir { --tone: var(--medir); }
.tone-interpretar { --tone: var(--interpretar); }
.tone-actuar { --tone: var(--actuar); }

/* Pestañas Medir · Interpretar · Actuar más compactas. */
.mia-tabs { gap: 8px; }
.mia-tab { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 10px 14px; border-radius: 14px; min-height: 0; }
.mia-letter {
  grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: 20px; opacity: 1;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
}
.mia-word { font-size: 14px; letter-spacing: .04em; }
.mia-sub { font-size: 12px; }
.mia-tab[aria-current] { box-shadow: inset 0 -3px 0 var(--line-strong); }
.mia-tab[aria-current] .mia-letter { background: var(--tone); color: var(--surface-solid); }

/* Tarjetas de preguntas: dos columnas, nombres más completos y el porcentaje en una sola línea. */
.mia-body .qgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.bar { grid-template-columns: minmax(120px, 42%) minmax(0, 1fr) auto; }
.bar-value { min-width: 54px; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .survey-panel-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .survey-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .survey-fact + .survey-fact { border-left: 0; }
  .survey-fact { border-bottom: 1px solid var(--line); }
  .survey-fact:nth-child(even) { border-left: 1px solid var(--line); }
  .survey-fact:last-child { border-bottom: 0; }
  .survey-panel .cover-stats { grid-template-columns: minmax(0, 1fr); }
  .state-identity .party-logo-lg { width: 52px; height: 52px; }
  .mia-sub { display: none; }
  .mia-tab { padding: 8px 10px; column-gap: 8px; }
  .mia-letter { width: 30px; height: 30px; font-size: 16px; }
}
@media (max-width: 520px) {
  .state-print { display: none; }
  .mia-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mia-tab { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; row-gap: 4px; }
  .mia-letter { grid-row: auto; }
  .mia-word { font-size: 11.5px; }
}
@media (max-width: 520px) {
  .state-identity { align-items: flex-start; gap: 12px; }
  .state-identity .party-logo-lg { width: 46px; height: 46px; margin-top: 2px; }
  .state-hero .state-title { font-size: 28px; }
  .survey-name { font-size: 16px; }
}

/* ---------------------------------------------------------------- vista por entidad: filtro de encuesta y resultados primero */
.state-toolbar {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 12px 16px; align-items: end;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.survey-filter { display: grid; gap: 6px; min-width: 0; }
.filter-label, .state-toolbar .cover-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.filter-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.filter-select { flex: 1; min-width: 0; width: 100%; min-height: 40px; text-overflow: ellipsis; }
.filter-step { flex: none; width: 40px; height: 40px; font-size: 20px; line-height: 1; font-weight: 700; }
.filter-step:disabled { opacity: .35; cursor: default; }
.state-toolbar .cover-candidate { padding: 0; border: 0; align-items: flex-end; gap: 10px; }
.state-toolbar .cover-pick { gap: 6px; }
.state-toolbar .cover-select { width: 100%; min-height: 40px; }
.toolbar-strip:empty, .toolbar-candidate:empty { display: none; }
.survey-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 0; padding: 8px 4px 0; }
.strip-item { display: flex; align-items: baseline; gap: 6px; padding: 0 14px; border-left: 1px solid var(--line); }
.strip-item:first-child { padding-left: 0; border-left: 0; }
.strip-item dt { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.strip-item dd { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip-tag { border-left: 0; margin-left: auto; padding-right: 0; }
.state-hero { gap: 14px; }

/* Pestañas con icono (sin la letra de la metodología). */
.mia-letter svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mia-tab .mia-letter { color: var(--tone); }
.mia-tab[aria-current] .mia-letter { color: var(--surface-solid); }
.mia-tab-medir { --tone: var(--medir); }

/* Índice lateral sin números: una marca de color. */
.sheet-link-n { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); justify-self: center; }
.sheet-link[aria-current] .sheet-link-n { background: var(--medir); }
.mia-body.is-interpretar .sheet-link[aria-current] .sheet-link-n { background: var(--interpretar); }
.mia-body.is-actuar .sheet-link[aria-current] .sheet-link-n { background: var(--actuar); }
.section-head { padding-left: 0; }

@media (max-width: 860px) {
  .state-toolbar { grid-template-columns: minmax(0, 1fr); }
  .strip-item { padding: 0 10px; }
  .strip-tag { margin-left: 0; padding-left: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .survey-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .strip-item { display: grid; gap: 1px; padding: 0; border-left: 0; }
  .strip-tag { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- resumen, cambios, muestras chicas y descargas */
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.brief-card {
  display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--party, var(--ink)); box-shadow: 0 1px 2px rgb(20 18 17 / 5%);
}
.brief-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brief-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.brief-top .party-logo { width: 30px; height: 30px; border-radius: 50%; }
.brief-name { font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.brief-value { font-size: 30px; font-weight: 900; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.brief-detail { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.brief-disputa { border-top-color: var(--medir); }
.brief-tema { border-top-color: var(--actuar); }
.brief-aprobacion { border-top-color: var(--interpretar); }
.brief-compare { font-size: 12px; color: var(--muted); }
.sheet-resumen .section-note { font-size: 14px; color: var(--ink-2); max-width: 90ch; }
.sheet-resumen.is-thin .brief-value { color: var(--muted); }

.delta { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.is-up { color: var(--approve); }
.delta.is-down { color: var(--disapprove); }
.delta.is-flat { color: var(--muted); }
.bar { grid-template-columns: minmax(120px, 40%) minmax(0, 1fr) auto; }
.compare-note { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.qcard-head { position: relative; }
.qcard-csv {
  position: absolute; top: -4px; right: -6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s ease;
}
.qcard:hover .qcard-csv, .qcard-csv:focus-visible { opacity: 1; }
.qcard-csv:hover { color: var(--ink); border-color: var(--line-strong); }
@media (hover: none) { .qcard-csv { opacity: 1; } }
.qcard-head .qcard-text { padding-right: 34px; }
.cross-csv { margin-top: 10px; }
.state-csv { margin-left: auto; }
.state-csv + .state-print { margin-left: 0; }

@media print { .qcard-csv, .cross-csv, .state-csv { display: none; } }
@media (max-width: 520px) { .state-csv { display: none; } }

/* ---------------------------------------------------------------- gráficas de barras: nombre completo arriba, barra debajo */
.bars { gap: 12px; }
.bars .bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "track track";
  column-gap: 12px; row-gap: 6px; align-items: center; min-height: 0;
}
.bars .bar.has-icon { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon name value" "icon track track"; }
.bar-icon { grid-area: icon; display: grid; place-items: center; width: 40px; height: 40px; }
.bar-icon .party-logo, .bar-icon .avatar { width: 40px; height: 40px; border-radius: 50%; }
.bar-icon .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ring, var(--line-strong)); }
.bar-icon .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: 50%; }
.bar-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--neutral); }
.bars .bar-label { grid-area: name; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; white-space: normal; overflow: visible; }
.bars .bar-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
.bar-party { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.bars .bar-value { grid-area: value; font-size: 15px; font-weight: 800; color: var(--ink); min-width: 0; }
.bars .bar-track { grid-area: track; height: 10px; border-radius: 999px; background: var(--track); }
.bars .bar-fill { border-radius: 999px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bars .bar.is-lead .bar-name { font-weight: 800; }
.bars .bar.is-lead .bar-value { font-size: 17px; }
.bars .bar.is-lead .bar-track { height: 12px; }
.bars .bar.is-quiet .bar-name, .bars .bar.is-quiet .bar-value { color: var(--muted); font-weight: 600; font-size: 13px; }
.bars .bar.is-quiet .bar-track { height: 6px; }
:root[data-theme="dark"] .bars .bar-track { background: var(--track); }
@media (prefers-reduced-motion: reduce) { .bars .bar-fill { transition: none; } }
@media print { .bars .bar-fill { transition: none; } }

/* ---------------------------------------------------------------- acceso: carrusel de aspirantes con su entidad de fondo */
.login-stage { position: relative; z-index: 1; }
.login-ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.4s ease .4s; background: #0d0c0b; }
.login-ambient.is-on { opacity: 1; }
.ambient-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.3s ease; }
.ambient-slide.is-active { opacity: 1; }
.ambient-bg { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: var(--origin, 50% 50%); filter: saturate(1.05); }
.ambient-slide.is-active .ambient-bg { animation: ambient-kenburns calc(var(--dwell, 7s) + 1.6s) ease-out both; }
@keyframes ambient-kenburns { from { transform: scale(1.02); } to { transform: scale(1.14); } }
/* Fondo de color profesional (entidad sin foto de fondo): degradado del partido con el nombre del estado. */
.ambient-color { position: absolute; inset: 0; opacity: 0; transition: opacity 1.3s ease; display: grid; place-items: center; }
.ambient-color.is-active { opacity: 1; }
.ambient-color-text {
  font-family: var(--font);
  font-weight: 900; text-transform: uppercase; letter-spacing: .12em;
  color: rgb(244 241 236 / 22%); text-align: center; line-height: 1.05;
  font-size: clamp(140px, 28vw, 420px);
  mix-blend-mode: soft-light;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 40%));
}
/* Capa oscura: deja ver la ciudad a la izquierda y se cierra a la derecha (título y formulario) y abajo (aspirante). */
.login-ambient::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgb(13 12 11 / 85%) 0%, rgb(13 12 11 / 35%) 38%, transparent 60%),
    linear-gradient(90deg, rgb(13 12 11 / 35%) 0%, rgb(13 12 11 / 45%) 40%, rgb(13 12 11 / 86%) 64%, rgb(13 12 11 / 93%) 100%);
}

/* El aspirante: foto grande con el aro de su partido, entidad, nombre y partido. */
.login-spotlight {
  position: fixed; left: clamp(24px, 4vw, 72px); bottom: clamp(20px, 6vh, 60px); z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: clamp(20px, 2vw, 34px); max-width: min(720px, 60vw); color: #f4f1ec; opacity: 0;
  transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1);
}
.login-spotlight.is-on { opacity: 1; transform: none; transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.login-spotlight.is-entering { opacity: 1; transform: none; }
.spot-photo {
  flex: none; width: clamp(170px, 15vw, 260px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--track);
  box-shadow: 0 0 0 4px #0d0c0b, 0 0 0 9px var(--party), 0 22px 56px rgb(0 0 0 / 60%), 0 0 90px color-mix(in srgb, var(--party) 50%, transparent);
  transform: scale(1); transition: transform .6s ease, box-shadow .6s ease;
}
.login-spotlight.is-entering .spot-photo { animation: spot-photo-in .9s cubic-bezier(.2, .8, .2, 1) both; }
.spot-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; filter: contrast(1.05) saturate(1.08); }
.spot-text { display: grid; gap: 6px; min-width: 0; }
.spot-kicker { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: rgb(244 241 236 / 70%); }
.spot-state {
  font-size: clamp(34px, 4.2vw, 62px); font-weight: 900; line-height: .96; letter-spacing: -.02em; text-transform: uppercase;
  text-shadow: 0 2px 24px rgb(0 0 0 / 60%);
}
.spot-name { font-size: clamp(24px, 2.4vw, 36px); font-weight: 800; line-height: 1.15; text-shadow: 0 2px 16px rgb(0 0 0 / 65%); }
.spot-divider { width: clamp(40px, 6vw, 80px); height: 2px; background: var(--party); border-radius: 2px; align-self: start; margin: 6px 0 2px; }
.spot-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.spot-party { padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--party); color: #fff; box-shadow: 0 0 14px color-mix(in srgb, var(--party) 45%, transparent); }
.spot-count { font-size: 13px; font-weight: 700; color: rgb(244 241 236 / 65%); font-variant-numeric: tabular-nums; }
.spot-progress { display: block; width: min(300px, 100%); height: 4px; margin-top: 14px; border-radius: 4px; background: rgb(255 255 255 / 18%); overflow: hidden; }
.spot-progress-fill { display: block; height: 100%; width: 0; background: var(--party); }
.login-spotlight.is-entering .spot-progress-fill { animation: spot-progress var(--dwell, 7s) linear both; }
@keyframes spot-progress { to { width: 100%; } }
/* Entrada de cada aspirante: la foto crece y el texto sube, escalonado. */
.login-spotlight.is-entering .spot-photo { animation: spot-photo-in .9s cubic-bezier(.2, .8, .2, 1) both; }
.login-spotlight.is-entering .spot-text > * { animation: spot-text-in .8s cubic-bezier(.2, .8, .2, 1) both; }
.login-spotlight.is-entering .spot-text > :nth-child(2) { animation-delay: .08s; }
.login-spotlight.is-entering .spot-text > :nth-child(3) { animation-delay: .16s; }
.login-spotlight.is-entering .spot-text > :nth-child(4) { animation-delay: .24s; }
.login-spotlight.is-entering .spot-text > :nth-child(5) { animation-delay: .32s; }
.login-spotlight.is-entering .spot-text > .spot-progress { animation-name: none; }
@keyframes spot-photo-in { from { opacity: 0; transform: scale(.84); } to { opacity: 1; transform: none; } }
@keyframes spot-text-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* En el mapa: la entidad del aspirante se ilumina con el color de su partido. */
.intro-state { transition: filter .6s ease, stroke .6s ease, stroke-width .6s ease; }
.intro-state.is-spot { stroke: #fff; stroke-width: 2.2; filter: drop-shadow(0 0 10px rgb(255 255 255 / 70%)) brightness(1.15); }

@media (max-width: 860px) {
  .login-ambient::after { background: linear-gradient(180deg, rgb(13 12 11 / 55%), rgb(13 12 11 / 90%) 55%); }
  .login-spotlight { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .login-ambient, .ambient-slide, .intro-state { transition-duration: .01s; }
  .ambient-slide.is-active .ambient-bg, .login-spotlight.is-entering .spot-photo, .login-spotlight.is-entering .spot-text > * { animation: none; }
  .login-spotlight.is-entering .spot-progress-fill { animation: none; width: 100%; }
}

/* ---------------------------------------------------------------- vista por entidad: panel lateral fijo, un tema a la vez */
.mia-body.is-medir { --tone: var(--medir); }
.mia-body.is-interpretar { --tone: var(--interpretar); }
.mia-body.is-actuar { --tone: var(--actuar); }
.mia-layout.is-paged { grid-template-columns: 252px minmax(0, 1fr); gap: 22px; }
.is-paged .sheet-nav {
  position: sticky; top: 84px; display: grid; gap: 4px; align-content: start; max-height: calc(100vh - 104px); overflow-y: auto;
  padding: 12px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.sheet-nav-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.is-paged .sheet-nav-title { font-size: 11.5px; letter-spacing: .1em; color: var(--ink); }
.sheet-nav-count { font-size: 11px; font-weight: 700; color: var(--muted); }
.is-paged .sheet-list { display: grid; gap: 2px; }
.is-paged .sheet-link {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; text-align: left; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .15s ease, color .15s ease;
}
.is-paged .sheet-link:hover { background: var(--surface-2); color: var(--ink); }
.is-paged .sheet-link:focus-visible { outline: 2px solid var(--tone); outline-offset: 1px; }
.sheet-link-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: background .15s ease, color .15s ease; }
.sheet-link-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sheet-link-t { line-height: 1.25; }
.sheet-link-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.is-paged .sheet-link[aria-selected="true"] { background: color-mix(in srgb, var(--tone) 9%, var(--surface)); color: var(--ink); font-weight: 800; }
.is-paged .sheet-link[aria-selected="true"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tone); }
.is-paged .sheet-link[aria-selected="true"] .sheet-link-icon { background: var(--tone); color: var(--surface-solid); }
.is-paged .sheet-link[aria-selected="true"] .sheet-link-count { background: color-mix(in srgb, var(--tone) 16%, var(--surface)); color: var(--ink); }
.is-paged .sheet-link-n { display: none; }

.is-paged .mia-content {
  display: block; min-width: 0; padding: 18px clamp(16px, 2vw, 26px) 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); outline: none;
}
.is-paged .mia-content .mia-section { gap: 14px; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.pane-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pane-crumb strong { color: var(--tone); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-sep { opacity: .6; }
.pane-steps { display: flex; align-items: center; gap: 6px; flex: none; }
.pane-count { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.pane-step { width: 32px; height: 32px; font-size: 18px; font-weight: 700; line-height: 1; }
.pane-step:disabled { opacity: .35; cursor: default; }
.pane-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.pane-page {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease;
}
.pane-page.is-next { text-align: right; }
.pane-page:hover { border-color: var(--tone); background: var(--surface); }
.pane-page-word { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pane-page-title { font-size: 14px; font-weight: 800; color: var(--ink); }
.mia-content.is-entering > .mia-section { animation: pane-in .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .mia-layout.is-paged { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .is-paged .sheet-nav { position: static; max-height: none; overflow: visible; padding: 8px; }
  .sheet-nav-head { display: none; }
  .is-paged .sheet-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .is-paged .sheet-link { width: auto; flex: none; grid-template-columns: auto auto auto; white-space: nowrap; padding: 6px 10px 6px 6px; border: 1px solid var(--line); }
  .is-paged .sheet-link[aria-selected="true"]::before { display: none; }
  .sheet-link-icon { width: 24px; height: 24px; border-radius: 7px; }
  .sheet-link-icon svg { width: 14px; height: 14px; }
}
@media (max-width: 560px) {
  .pane-crumb > :not(strong) { display: none; }
  .pane-pager { grid-template-columns: 1fr; }
  .pane-page.is-next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .mia-content.is-entering > .mia-section { animation: none; } }
@media print { .is-paged .sheet-nav, .pane-bar, .pane-pager { display: none; } .is-paged .mia-content { border: 0; box-shadow: none; padding: 0; } }

/* ---------------------------------------------------------------- resumen: gráfica principal con foto y partido */
.result-hero {
  --lead: var(--ink);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center;
  padding: clamp(16px, 2.2vw, 26px); border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--lead) 13%, transparent), transparent 62%), var(--surface-2);
}
.result-donut .donut-track { stroke: color-mix(in srgb, var(--ink) 8%, transparent); }
.result-center { display: grid; place-items: center; }
.rank-visual { position: relative; display: inline-grid; place-items: center; flex: none; }
.rank-visual .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring); }
.rank-visual .avatar img { object-position: center 18%; }
.rank-visual.is-hero .avatar { width: 186px; height: 186px; font-size: 54px; box-shadow: 0 0 0 4px var(--surface), 0 12px 30px rgb(20 18 17 / 22%); }
.rank-visual.is-hero.is-party .party-logo { width: 150px; height: 150px; border-radius: 50%; }
.rank-badge {
  position: absolute; right: -2px; bottom: -2px; width: 34%; aspect-ratio: 1; min-width: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-solid); box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgb(20 18 17 / 25%); overflow: hidden;
}
.rank-badge .party-logo { width: 100%; height: 100%; border-radius: 50%; box-shadow: none; }
.rank-visual.is-hero .rank-badge { width: 58px; right: 6px; bottom: 6px; box-shadow: 0 0 0 3px var(--surface), 0 4px 10px rgb(20 18 17 / 30%); }
.result-side { display: grid; gap: 16px; min-width: 0; }
.result-head { display: grid; gap: 4px; }
.result-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.result-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.result-name { font-size: clamp(20px, 2vw, 28px); font-weight: 900; line-height: 1.1; color: var(--ink); }
.rank-party {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap;
  color: var(--ink); background: color-mix(in srgb, var(--party) 16%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--party) 70%, transparent);
}
.result-pct-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 2px; }
.result-pct { font-size: clamp(40px, 4.4vw, 60px); font-weight: 900; line-height: 1; color: var(--lead); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
:root[data-theme="dark"] .result-pct { color: color-mix(in srgb, var(--lead) 70%, #fff); }
.result-pct .delta { font-size: 13px; vertical-align: middle; }
.result-lead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--ink-2); }
.result-lead strong { color: var(--ink); font-weight: 900; }
.rank-tie { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--warn-ink); background: var(--warn-bg); white-space: nowrap; }
.result-list { list-style: none; margin: 0; padding: 14px 0 0; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.result-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
/* «No sabe, ninguno u otro»: renglón gris al final de la lista, como su parte de la dona. */
.result-rest-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 15px; font-weight: 800;
  color: var(--muted); background: color-mix(in srgb, var(--neutral) 35%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong); }
.result-row.is-rest .result-row-name, .result-row.is-rest .result-row-pct { color: var(--muted); font-weight: 600; }
.rank-visual.is-mini .avatar, .rank-visual.is-mini .party-logo { width: 38px; height: 38px; font-size: 13px; border-radius: 50%; }
.result-row-body { display: grid; gap: 5px; min-width: 0; }
.result-row-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.result-row-name { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row-pct { font-size: 14px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-row.is-lead .result-row-name { font-weight: 900; }
.result-track, .rank-track { display: block; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
:root[data-theme="dark"] .result-track, :root[data-theme="dark"] .rank-track { background: var(--track); }
.result-fill, .rank-fill { display: block; height: 100%; border-radius: 999px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.rank-fill { background: var(--party); }
.result-foot { font-size: 12px; color: var(--muted); }
.result-hero + .brief-grid { margin-top: 2px; }

/* ---------------------------------------------------------------- ranking */
.ranking { display: grid; gap: 22px; }
.ranking-switch { margin-bottom: 4px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; padding-top: 16px; }
.podium-card {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 14px 16px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--party) 10%, var(--surface)), var(--surface-2));
  border: 1px solid var(--line); border-top: 3px solid var(--party);
}
.podium-card.is-1 { padding-top: 32px; padding-bottom: 22px; box-shadow: 0 14px 34px rgb(20 18 17 / 12%); }
:root[data-theme="dark"] .podium-card.is-1 { box-shadow: 0 14px 34px rgb(0 0 0 / 45%); }
.podium-medal {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%); min-width: 34px; height: 30px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #fff; box-shadow: 0 4px 10px rgb(20 18 17 / 25%);
}
.podium-card.is-1 .podium-medal { background: linear-gradient(135deg, #f3c84b, #b8860b); }
.podium-card.is-2 .podium-medal { background: linear-gradient(135deg, #d9dbe0, #8e9299); }
.podium-card.is-3 .podium-medal { background: linear-gradient(135deg, #e0a06b, #9a5a2b); }
.rank-visual.is-podium .avatar, .rank-visual.is-podium.is-party .party-logo { width: 84px; height: 84px; font-size: 26px; border-radius: 50%; }
.rank-visual.is-podium-1 .avatar, .rank-visual.is-podium-1.is-party .party-logo { width: 112px; height: 112px; font-size: 34px; border-radius: 50%; }
.podium-name { font-size: 15px; font-weight: 900; line-height: 1.2; color: var(--ink); margin-top: 6px; }
.podium-card.is-1 .podium-name { font-size: 17px; }
.podium-pct { font-size: 30px; font-weight: 900; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.podium-card.is-1 .podium-pct { font-size: 38px; }
.podium-gap { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-row {
  display: grid; grid-template-columns: 44px auto minmax(0, 1.3fr) minmax(110px, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--party);
}
.rank-pos { font-size: 18px; font-weight: 900; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank-row.is-1 .rank-pos { color: #b8860b; }
.rank-row.is-2 .rank-pos { color: #8e9299; }
.rank-row.is-3 .rank-pos { color: #9a5a2b; }
.rank-visual.is-row .avatar, .rank-visual.is-row.is-party .party-logo { width: 48px; height: 48px; font-size: 16px; border-radius: 50%; }
.rank-who { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.rank-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.rank-name { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.rank-gap { font-size: 12px; color: var(--muted); font-weight: 600; }
.rank-pct { font-size: 20px; font-weight: 900; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-pct .delta { font-size: 11px; }

@media (max-width: 900px) {
  .result-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .result-side { width: 100%; }
  .rank-row { grid-template-columns: 34px auto minmax(0, 1fr) auto; }
  .rank-track { grid-column: 2 / -1; }
}
@media (max-width: 560px) {
  .podium { grid-template-columns: minmax(0, 1fr); padding-top: 18px; gap: 22px; }
  .podium-card.is-1 { order: -1; }
  .result-donut { --size: 210px !important; }
  .rank-visual.is-hero .avatar { width: 156px; height: 156px; }
}
@media (prefers-reduced-motion: reduce) { .result-fill, .rank-fill { transition: none; } }
.ranking-switch .chip[aria-pressed="true"] { background: var(--tone, var(--ink)); border-color: var(--tone, var(--ink)); color: var(--surface-solid); }

/* =====================================================================================================
   Sistema de diseño v2 · capa final
   Superficies neutras con bordes finos, el color sólo en los datos (barras, dona, logos), tipografía Inter
   para la interfaz (Montserrat queda para la marca), títulos en minúsculas y logos de partido completos.
   Va al final del archivo a propósito: sustituye los estilos anteriores sin reescribirlos uno por uno.
   ===================================================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-brand: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 18 17 / 4%), 0 1px 1px rgb(20 18 17 / 2%);
  --shadow-pop: 0 10px 30px rgb(20 18 17 / 10%), 0 2px 6px rgb(20 18 17 / 5%);
  font-feature-settings: "cv11", "ss01";
}
:root[data-theme="dark"] { --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-pop: 0 12px 32px rgb(0 0 0 / 50%); }
body { font-family: var(--font); letter-spacing: -.006em; }
.intro-title, .hero-title, .spot-state, .report-title, .brand-sub strong, .login-page .intro-copy { font-family: var(--font-brand); }

/* Títulos: oración normal, peso medio-alto, sin mayúsculas gritonas. */
.section-title { text-transform: none; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.section-note { font-size: 13.5px; line-height: 1.5; }
.state-hero .state-title { text-transform: none; font-size: clamp(28px, 3vw, 38px); font-weight: 700; letter-spacing: -.03em; }
.page-title { font-weight: 700; letter-spacing: -.025em; }
.card-title { font-weight: 650; letter-spacing: -.01em; }

/* Tarjetas: un solo estilo, sin orillas de color ni degradados de partido. */
.card, .qcard, .state-hero, .is-paged .mia-content, .is-paged .sheet-nav { border-radius: var(--radius); box-shadow: var(--shadow); }
.state-hero::before { display: none; }
.brief-card, .brief-disputa, .brief-tema, .brief-aprobacion { border-top: 1px solid var(--line); box-shadow: none; }
.brief-label, .result-kicker, .eyebrow, .filter-label, .state-toolbar .cover-label, .strip-item dt, .sheet-nav-title, .pane-crumb, .showcase-title {
  letter-spacing: .04em; font-weight: 600;
}
.brief-value, .result-pct, .podium-pct, .rank-pct, .summary-value { font-family: var(--font); font-weight: 700; letter-spacing: -.03em; }

/* Pestañas Resultados · Análisis · Estrategia: subrayado, como en un producto, no bloques de color. */
.mia-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.mia-tab, .mia-tab:hover, .mia-tab[aria-current] {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: -1px; min-height: 0;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; text-decoration: none;
}
.mia-tab .mia-letter, .mia-tab[aria-current] .mia-letter { width: auto; height: auto; background: none; color: var(--muted); grid-row: auto; }
.mia-letter svg { width: 18px; height: 18px; }
.mia-word { font-size: 14.5px; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: var(--muted); }
.mia-tab-interpretar .mia-word, .mia-tab-actuar .mia-word, .mia-tab-medir .mia-word { color: var(--muted); }
.mia-sub { display: none; }
.mia-tab:hover .mia-word, .mia-tab:hover .mia-letter { color: var(--ink); }
.mia-tab[aria-current] { border-bottom-color: var(--ink); }
.mia-tab[aria-current] .mia-word, .mia-tab[aria-current] .mia-letter { color: var(--ink); }

/* Panel lateral: neutro, el tema elegido sólo con fondo gris y texto en negro. */
.is-paged .sheet-link { font-weight: 500; }
.is-paged .sheet-link[aria-selected="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.is-paged .sheet-link[aria-selected="true"]::before { display: none; }
.sheet-link-icon, .is-paged .sheet-link[aria-selected="true"] .sheet-link-icon { background: none; color: var(--muted); width: 22px; height: 22px; }
.is-paged .sheet-link[aria-selected="true"] .sheet-link-icon { color: var(--ink); }
.is-paged .sheet-link { grid-template-columns: 22px minmax(0, 1fr) auto; }
.sheet-link-count, .is-paged .sheet-link[aria-selected="true"] .sheet-link-count { background: none; color: var(--muted); font-weight: 500; padding: 0; }
.pane-crumb strong { color: var(--ink); }
.pane-page:hover { border-color: var(--line-strong); }

/* Logos de partido: completos, en un cuadrado redondeado con borde fino (nunca recortados en círculo). */
.party-logo, .party-logo-xs, .party-logo-sm, .party-logo-md, .party-logo-lg,
.donut-center .party-logo, .badge-logo .party-logo, .state-identity .party-logo-lg, .bar-icon .party-logo,
.rank-visual.is-party .party-logo, .brief-top .party-logo, .entity-second .party-logo-sm {
  border-radius: 24% !important; box-shadow: 0 0 0 1px var(--line) !important;
}
.badge-logo { border-radius: 24%; background: transparent; }

/* Fotos: borde neutro fino, sin aro de color ni logos encimados. */
.avatar, .rank-visual .avatar, .bar-icon .avatar, .rank-visual.is-hero .avatar { box-shadow: 0 0 0 1px var(--line-strong); }
.rank-visual.is-hero .avatar { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-pop); }
.rank-badge { display: none; }

/* Resumen: el resultado en una tarjeta limpia; el color queda sólo en la dona y las barras. */
.result-hero { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.result-pct, :root[data-theme="dark"] .result-pct { color: var(--ink); }
.result-name { font-weight: 700; letter-spacing: -.025em; }
.rank-party {
  gap: 6px; padding: 2px 8px 2px 3px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.rank-party .party-logo { width: 18px; height: 18px; }
.rank-party .party-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; }
.result-track, .rank-track { height: 6px; }
.result-row-name { font-weight: 500; }
.result-row.is-lead .result-row-name { font-weight: 650; }
.result-row-pct { font-weight: 650; }
.rank-tie { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn-ink) 40%, transparent); }

/* Ranking: podio y tabla neutros; posición en número, sin medallas de colores. */
.podium-card, .podium-card.is-1 { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.podium-card.is-1 { box-shadow: var(--shadow-pop); }
.podium-medal, .podium-card.is-1 .podium-medal, .podium-card.is-2 .podium-medal, .podium-card.is-3 .podium-medal {
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); font-weight: 700;
}
.podium-card.is-1 .podium-medal { background: var(--ink); color: var(--surface-solid); box-shadow: none; }
.podium-name { font-weight: 650; }
.rank-row { background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; }
.rank-row:hover { border-color: var(--line-strong); }
.rank-pos, .rank-row.is-1 .rank-pos, .rank-row.is-2 .rank-pos, .rank-row.is-3 .rank-pos { color: var(--muted); font-weight: 600; font-size: 15px; }
.rank-row.is-1 .rank-pos { color: var(--ink); }
.rank-name { font-weight: 650; }
.rank-pct { font-weight: 700; }

/* Vitrina de aspirantes por partido (tarjetas): sin degradados del partido ni etiquetas de color. */
.candidate-card { background: var(--surface); }
.candidate-card::before { display: none; }
.candidate-card:hover { transform: none; box-shadow: var(--shadow-pop); }
.candidate-card.is-leading::after { background: var(--ink); color: var(--surface-solid); }
.candidate-avatar, .candidate-card:hover .candidate-avatar { box-shadow: 0 0 0 1px var(--line-strong); transform: none; }

/* Inicio: la lista por entidad sin la orilla de color; los datos llevan el color. */
.side .entity-row, .side .entity-row:hover { border-left: 1px solid var(--line); }
.side .entity-row:hover { border-color: var(--line-strong); transform: none; }
.summary-card { border-radius: var(--radius); }
.result-row-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.result-row-party { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
/* Selectores y etiquetas de partido en el inicio: neutros, con el logo; el color queda en la dona. */
.ranking-switch .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface-solid); }
.party-badge, .party-badge.is-second {
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600;
}
.party-badge strong { font-weight: 700; }
.party-badge.is-second { color: var(--ink-2); }
.badge-rank { color: var(--muted); }

/* ---------------------------------------------------------------- inicio: panel lateral según el filtro del mapa */
.side-mode { gap: 14px; }
.side-mode .side-list { max-height: 560px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.side-stat { display: grid; gap: 2px; padding: 10px 12px; }
.side-stat + .side-stat { border-left: 1px solid var(--line); }
.side-stat strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.side-stat span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.side-owners { display: grid; gap: 8px; }
.side-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.side-party {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.side-party .party-logo { width: 18px; height: 18px; }
.side-party .party-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: 5px; }
.side-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.side-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.side-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.side-row-logo .party-logo { width: 32px; height: 32px; }
.side-row-logo .party-dot { width: 12px; height: 12px; border-radius: 50%; display: block; margin: 0 10px; }
.side-row-main { display: grid; gap: 3px; min-width: 0; }
.side-row-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.side-row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-row-end { display: grid; justify-items: end; gap: 4px; text-align: right; }
.side-status { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.side-status.is-change { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.side-count { display: grid; justify-items: center; min-width: 44px; padding: 4px 0; }
.side-count strong { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.side-count span { font-size: 10.5px; color: var(--muted); }
.side-track { display: block; height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: 3px; }
:root[data-theme="dark"] .side-track { background: var(--track); }
.side-fill { display: block; height: 100%; border-radius: 999px; background: var(--seq-4); }
.side-versus { display: grid; justify-items: end; gap: 2px; }
.side-versus-us { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-versus-us.is-ahead { color: var(--approve); }
.side-versus-us.is-behind { color: var(--ink); }
@media (max-width: 560px) {
  .side-stats { grid-template-columns: minmax(0, 1fr); }
  .side-stat + .side-stat { border-left: 0; border-top: 1px solid var(--line); }
  .side-row { grid-template-columns: auto minmax(0, 1fr); }
  .side-row-end { grid-column: 2; justify-items: start; text-align: left; }
}

/* ---------------------------------------------------------------- distritos: resultado 2024 (INE) */
.district-list.has-results { gap: 0; }
.district-item {
  display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; grid-template-areas: "order num seat tag" ". . duel duel";
  gap: 4px 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.district-list.has-results li.district-item { grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
.district-item:last-child { border-bottom: 0; }
.district-item .district-order { grid-area: order; }
.district-item .district-number { grid-area: num; font-weight: 700; }
.district-seat { grid-area: seat; display: flex; align-items: center; gap: 6px; min-width: 0; }
.district-seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.district-item .margin-tag { grid-area: tag; }
.district-item .duel { grid-area: duel; }
.margin-tag { display: inline-flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.margin-tag strong { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.margin-tag.is-won strong { color: var(--approve); }
.margin-tag.is-close strong { color: var(--warn-ink); }
:root[data-theme="dark"] .margin-tag.is-close strong { color: #f0b54a; }
.margin-tag.is-uphill strong { color: var(--disapprove); }
.duel { display: grid; gap: 3px; }
.duel-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--track); }
:root[data-theme="dark"] .duel-bar { background: var(--track); }
.duel-us { background: var(--ink); }
.duel-them { background: var(--neutral); margin-left: auto; }
.duel-gap { flex: 1; }
.duel-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.district-sort { align-self: end; }
.dist-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dist-rank-row {
  display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1fr) 28px; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--ink);
}
.dist-rank-row:hover, .dist-rank-row[aria-current] { background: var(--surface-2); }
.dist-rank-name { display: grid; gap: 1px; font-size: 13px; font-weight: 600; }
.dist-rank-sub { font-size: 11px; font-weight: 500; color: var(--muted); }
.dist-rank-track { position: relative; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
:root[data-theme="dark"] .dist-rank-track { background: var(--track); }
.dist-rank-fill { position: absolute; inset: 0 auto 0 0; background: var(--seq-2); border-radius: 999px; }
.dist-rank-won { position: absolute; inset: 0 auto 0 0; background: var(--seq-5); border-radius: 999px; }
.dist-rank-value { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.side-row-past { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* ---------------------------------------------------------------- aspirantes en gubernaturas y en la ficha */
.side-faces { display: flex; align-items: center; margin-top: 4px; min-width: 0; }
.side-faces .avatar { width: 24px; height: 24px; font-size: 9px; box-shadow: 0 0 0 2px var(--surface); }
.side-faces .avatar + .avatar { margin-left: -6px; }
.side-faces-names { margin-left: 8px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.side-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.side-person .avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.side-person .avatar img { object-position: center 18%; }
.side-person-who { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.side-person-pct { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .district-item, .district-list.has-results li.district-item { grid-template-columns: 22px 40px minmax(0, 1fr); grid-template-areas: "order num seat" ". tag tag" ". duel duel"; }
}

/* ---------------------------------------------------------------- distritos: filtro de años y cambio entre elecciones */
.year-filter { display: flex; align-items: center; gap: 10px; margin-left: auto; margin-right: 10px; }
.year-filter-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.district-na { grid-area: duel; font-size: 12px; color: var(--muted); font-style: italic; }
.swing-line { grid-area: duel; display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.swing-line strong { color: var(--ink); font-weight: 600; }
.swing-arrow { opacity: .6; }
@media (max-width: 860px) {
  .year-filter { margin: 6px 0 0; width: 100%; flex-wrap: wrap; }
  .page-head-row:has(.year-filter) { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- resumen dividido: candidato | partido */
.result-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.duo-panel {
  --lead: var(--ink);
  display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--lead) 16%, transparent), transparent 70%), var(--surface);
}
.duo-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.duo-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: color-mix(in srgb, var(--lead) 18%, var(--surface)); color: color-mix(in srgb, var(--lead) 80%, var(--ink));
}
.duo-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.duo-head-text { min-width: 0; }
.duo-title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.duo-question { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-panel .result-hero.is-compact {
  display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 20px; border: 0; border-radius: 0; box-shadow: none; background: none;
}
.result-hero.is-compact > *, .result-top > * { min-width: 0; }
.result-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.result-hero.is-compact .rank-visual.is-hero .avatar { width: 128px; height: 128px; font-size: 38px; }
.result-hero.is-compact .rank-visual.is-hero.is-party .party-logo { width: 112px; height: 112px; }
.result-hero.is-compact .rank-visual.is-hero .rank-badge { width: 40px; right: 2px; bottom: 2px; }
.result-hero.is-compact .result-name { font-size: clamp(18px, 1.6vw, 24px); }
.result-hero.is-compact .result-pct { font-size: clamp(36px, 3.4vw, 50px); color: color-mix(in srgb, var(--lead) 75%, var(--ink)); }
:root[data-theme="dark"] .result-hero.is-compact .result-pct { color: color-mix(in srgb, var(--lead) 55%, #fff); }
.result-hero.is-compact .result-pct-row { flex-direction: column; align-items: flex-start; gap: 6px; }
.result-hero.is-compact .result-list { padding-top: 16px; gap: 12px; }
.result-hero.is-compact .result-track { height: 8px; }
.result-hero.is-compact .result-foot { margin: 0; }
.result-duo + .brief-grid { margin-top: 2px; }
@media (max-width: 1180px) {
  .result-duo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .result-top { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .result-top .result-name-row, .result-hero.is-compact .result-pct-row { justify-content: center; align-items: center; }
  .duo-head { padding: 14px 16px; }
  .duo-panel .result-hero.is-compact { padding: 16px; }
}

/* ---------------------------------------------------------------- animaciones de entrada del resumen */
.result-duo > .duo-panel { animation: duo-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.result-duo > .duo-panel:nth-child(2) { animation-delay: .12s; }
@keyframes duo-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.duo-panel { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.duo-panel:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--lead) 40%, var(--line)); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--lead) 55%, transparent); }
.sheet-resumen .brief-card { animation: duo-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.sheet-resumen .brief-card:nth-child(1) { animation-delay: .25s; }
.sheet-resumen .brief-card:nth-child(2) { animation-delay: .33s; }
.sheet-resumen .brief-card:nth-child(3) { animation-delay: .41s; }
.sheet-resumen .brief-card:nth-child(4) { animation-delay: .49s; }
/* Halo que respira alrededor de quien encabeza. */
.result-hero .rank-visual.is-hero::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--lead) 55%, transparent);
  animation: lead-halo 3.2s ease-out 1.2s infinite;
}
@keyframes lead-halo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lead) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 18px transparent; } }
/* Destello que recorre la barra del primer lugar una vez que se llena. */
.result-row.is-lead .result-fill { position: relative; overflow: hidden; }
.result-row.is-lead .result-fill::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent);
  animation: bar-sheen 1.4s ease 1.1s 2;
}
@keyframes bar-sheen { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .result-duo > .duo-panel, .sheet-resumen .brief-card,
  .result-hero .rank-visual.is-hero::after, .result-row.is-lead .result-fill::after { animation: none; }
  .duo-panel:hover { transform: none; }
}


/* ---------------------------------------------------------------- fondo animado: México como red de datos electorales */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; color: #00838a; }
.backdrop[data-scene="reporte"] { display: none; }
.backdrop-canvas { position: absolute; inset: 0; display: block; }
.view { position: relative; z-index: 1; }
:root body.has-backdrop.is-home, :root[data-theme="dark"] body.has-backdrop.is-home { background-image: none; }  /* la red sustituye la trama del inicio */
:root[data-theme="dark"] .backdrop {
  background:
    radial-gradient(70% 55% at 78% 18%, rgb(0 140 150 / 16%), transparent 70%),
    radial-gradient(50% 45% at 8% 30%, rgb(60 70 200 / 10%), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgb(0 104 71 / 12%), transparent 70%),
    var(--bg);
}
/* Detrás de tablas y listas, la red se atenúa; en la entidad va completa. */
:root[data-theme="dark"] .backdrop { color: #5ef2ea; }
.backdrop-vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 60% 30%, transparent 55%, rgb(0 0 0 / 7%)); }
:root[data-theme="dark"] .backdrop-vignette { background: radial-gradient(120% 90% at 60% 30%, transparent 50%, rgb(0 0 0 / 55%)); }

/* Urna de neón con boletas que caen (margen izquierdo, pantallas anchas). */
.backdrop-urn {
  position: absolute; left: clamp(12px, 2.2vw, 48px); top: 24vh; width: clamp(110px, 8vw, 150px); overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .55;
}
:root[data-theme="dark"] .backdrop-urn { opacity: .95; filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 18px rgb(94 242 234 / 35%)); }
.urn-face { fill: url(#urn-face); }
.urn-shadow { fill: currentColor; stroke: none; opacity: .12; animation: urn-shadow 6s ease-in-out infinite; }
.urn-band { stroke: #2fd38a; stroke-width: 2.2; }
.urn-slot { stroke-width: 3; }
.urn-float { animation: urn-float 6s ease-in-out infinite; }
.urn-ballot { fill: rgb(255 255 255 / 6%); animation: urn-ballot 4.2s cubic-bezier(.5, 0, .3, 1) infinite; }
.urn-check { stroke: #2fd38a; stroke-width: 2.2; }
@keyframes urn-float { 50% { transform: translateY(-8px); } }
@keyframes urn-shadow { 50% { transform: scaleX(.85); opacity: .07; } }
@keyframes urn-ballot {
  0% { transform: translate(-6px, -34px) rotate(-14deg); opacity: 0; }
  18% { opacity: 1; }
  55% { transform: translate(-4px, 4px) rotate(-24deg); opacity: 1; }
  75%, 100% { transform: translate(-4px, 34px) rotate(-24deg); opacity: 0; }
}
.urn-ballot { transform-box: fill-box; transform-origin: center; }

/* Línea de pulso (margen derecho, abajo). */
.backdrop-pulse { position: absolute; right: clamp(12px, 2vw, 40px); bottom: 9vh; width: clamp(120px, 9vw, 190px); height: 52px; overflow: visible; fill: none; stroke: currentColor; }
.pulse-base { stroke-width: 1.2; opacity: .22; stroke-linejoin: round; }
.pulse-line { stroke-width: 1.8; stroke-linejoin: round; stroke-dasharray: .32 .68; animation: pulse-run 2.6s linear infinite; opacity: .7; }
:root[data-theme="dark"] .pulse-line { filter: drop-shadow(0 0 4px currentColor); opacity: 1; }
@keyframes pulse-run { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (max-width: 1499px) { .backdrop-urn, .backdrop-pulse { display: none; } }

/* Tarjetas casi transparentes en ambos temas: el fondo se ve detrás y el texto conserva su contraste.
   Menús, avisos y tooltips quedan sólidos para leerse bien. */
:root {
  --surface-solid: #ffffff;
}
body.has-backdrop {
  --surface: rgb(255 255 255 / 50%);
  --surface-2: rgb(255 255 255 / 34%);
  --line: rgb(20 40 50 / 10%);
}
:root[data-theme="dark"] {
  --surface-solid: #0c1720;
  --line-strong: rgb(120 220 230 / 22%);
  --track: rgb(255 255 255 / 8%);
}
:root[data-theme="dark"] body.has-backdrop {
  --surface: rgb(8 17 24 / 30%);
  --surface-2: rgb(255 255 255 / 3%);
  --line: rgb(120 220 230 / 13%);
}
:root[data-theme="dark"] .topbar { background: rgb(5 11 17 / 78%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
/* Tarjetas dentro de tarjetas: sin relleno propio, sólo su orilla. */
body.has-backdrop :is(.mia-content, .card, .state-hero) :is(.duo-panel, .brief-card, .qcard, .card, .kpi, .result-hero) { background-color: transparent; }
:is(.notif-panel, .user-menu, .toast, .tooltip, select option) { background-color: var(--surface-solid); }
body.has-backdrop .state-hero { background: var(--surface); }
:root[data-theme="dark"] body.has-backdrop .state-hero { border-color: rgb(94 242 234 / 16%); }
:root[data-theme="dark"] :is(h1, h2, h3, .result-pct, .brief-value, .state-title) { text-shadow: 0 1px 12px rgb(5 11 17 / 70%); }
body.has-backdrop :is(.mia-content, .sheet-nav, .state-hero, .card, .kpi) { box-shadow: none; }

/* Escenas: la urna y el pulso acompañan al mapa; la aurora, a la red del inicio. */
.backdrop:not([data-scene="estado"]) :is(.backdrop-urn, .backdrop-pulse) { display: none; }
.backdrop-aurora {
  position: absolute; inset: auto -10% -30% -10%; height: 70vh; opacity: 0; transition: opacity 1s ease;
  background:
    radial-gradient(40% 60% at 20% 70%, rgb(0 140 90 / 28%), transparent 70%),
    radial-gradient(35% 55% at 52% 80%, rgb(0 180 190 / 22%), transparent 70%),
    radial-gradient(40% 60% at 82% 70%, rgb(220 30 60 / 22%), transparent 70%);
  filter: blur(20px); animation: aurora 18s ease-in-out infinite alternate;
}
.backdrop:not([data-scene="estado"]) .backdrop-aurora { opacity: .55; }
:root[data-theme="dark"] .backdrop:not([data-scene="estado"]) .backdrop-aurora { opacity: 1; }
@keyframes aurora { to { transform: translateX(6%) scaleY(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .urn-float, .urn-shadow, .urn-ballot, .pulse-line, .backdrop-aurora { animation: none; }
  .urn-ballot { opacity: 0; }
}
@media print { .backdrop { display: none; } }
/* La franja de cifras se monta sobre la portada del inicio: va sólida. */
body.has-backdrop .summary-strip { background: var(--surface-solid); }
/* Candidato | Partido: sin tinte de color, sólo el ícono y las cifras llevan el color del puntero. */
body.has-backdrop .duo-panel { background-image: none; }
body.has-backdrop .duo-head { background: transparent; }

/* ---------------------------------------------------------------- temas sin panel lateral: sólo flechas */
.mia-layout.is-paged.is-solo { grid-template-columns: minmax(0, 1fr); }
.is-solo .pane-bar { align-items: center; }
.is-solo .pane-crumb strong { font-size: 15px; }
.is-solo .pane-steps { gap: 10px; }
.is-solo .pane-step {
  width: 40px; height: 40px; font-size: 22px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.is-solo .pane-step:not(:disabled):hover { transform: translateY(-1px); border-color: currentColor; }
:root[data-theme="dark"] .is-solo .pane-step:not(:disabled):hover { color: #5ef2ea; box-shadow: 0 0 14px rgb(94 242 234 / 30%); }
.is-solo .pane-count { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------------------- candidato | partido, centrados */
.duo-panel .result-hero.is-compact { align-items: center; }
.duo-panel .result-top { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2.4vw, 32px); width: 100%; }
.duo-panel .result-top .result-head { flex: 0 1 auto; min-width: 0; }
.duo-panel .result-list, .duo-panel .result-foot { width: 100%; max-width: 560px; margin-inline: auto; }
.duo-panel .result-foot { text-align: center; }
.duo-head { justify-content: center; text-align: left; }
@media (max-width: 520px) {
  .duo-panel .result-top { flex-direction: column; text-align: center; }
}
/* Sin candidato de referencia: el filtro de encuesta ocupa todo el ancho. */
.state-toolbar { grid-template-columns: minmax(0, 1fr); }
:root[data-theme="dark"] .ranking-switch .chip[aria-pressed="true"] { color: var(--surface-solid); }

/* ---------------------------------------------------------------- fotos: llenan el círculo */
.avatar.has-photo .avatar-initials { opacity: 0; }
.avatar img { object-position: center 18%; }
.avatar.is-cutout img { object-position: center; }

/* ---------------------------------------------------------------- ranking: anillo en el podio y gráfica de anillos */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.podium-ring {
  --p: 0; --party: var(--ink);
  position: relative; display: inline-grid; place-items: center; padding: 9px; border-radius: 50%;
  transition: --p 1.3s cubic-bezier(.2, .8, .2, 1);
}
.podium-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--party) 55%, #ffffff), var(--party) calc(var(--p) * 1%), color-mix(in srgb, var(--ink) 10%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}
.podium-ring.is-2 { transition-delay: .15s; }
.podium-ring.is-3 { transition-delay: .3s; }
:root[data-theme="dark"] .podium-ring::before { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--party) 70%, transparent)); }
.podium-ring .rank-visual .avatar, .podium-ring .rank-visual .party-logo { box-shadow: none; }

.place-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; padding-top: 16px; }
.place-card {
  --party: var(--ink);
  position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 26px 18px 20px; text-align: center;
  border: 1px solid var(--line); border-radius: 18px;
  background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--party) 12%, transparent), transparent 70%), var(--surface);
  animation: duo-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
.place-card::before { content: ""; position: absolute; inset: 0 16px auto; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, transparent, var(--party), transparent); opacity: .85; }
.place-card.is-1 { padding-top: 34px; padding-bottom: 24px; border-color: color-mix(in srgb, var(--party) 35%, var(--line)); animation-delay: .1s; }
.place-card.is-2 { animation-delay: .2s; }
.place-card.is-3 { animation-delay: .3s; }
.place-medal {
  position: absolute; top: -13px; left: 50%; translate: -50% 0; min-width: 40px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-solid); color: var(--ink); border: 1px solid var(--line-strong);
}
.place-card.is-1 .place-medal { background: var(--ink); color: var(--surface-solid); border-color: var(--ink); }
.place-figure { position: relative; width: min(190px, 100%); aspect-ratio: 1; }
.place-card.is-1 .place-figure { width: min(230px, 100%); }
.place-chart { width: 100%; height: 100%; overflow: visible; }
.place-track { fill: none; stroke: color-mix(in srgb, var(--ink) 8%, transparent); }
.place-arc { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="dark"] .place-arc { filter: drop-shadow(0 0 7px currentColor); }
.place-tick { stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1; }
.place-tick.is-major { stroke: color-mix(in srgb, var(--ink) 34%, transparent); stroke-width: 1.4; }
/* Foto o logo dentro del anillo. */
.place-photo { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.place-photo .rank-visual .avatar, .place-photo .rank-visual .party-logo {
  width: calc(var(--photo, 62) * 1%); height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface-solid), 0 10px 26px rgb(0 0 0 / 25%);
}
.place-photo .rank-visual { width: 100%; height: 100%; display: grid; place-items: center; }
.place-photo .rank-visual .avatar { font-size: 34px; }
.place-card.is-small .place-photo .rank-visual .avatar { font-size: 18px; }
.place-name { margin: 6px 0 0; font-size: 15px; font-weight: 650; line-height: 1.25; color: var(--ink); }
.place-card.is-1 .place-name { font-size: 17px; }
.place-pct { margin: 2px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.place-card.is-1 .place-pct { font-size: 38px; }
.place-pct .delta { font-size: 12px; vertical-align: middle; margin-left: 6px; }
.place-facts { display: grid; gap: 6px; width: 100%; max-width: 250px; margin-top: 6px; }
.place-fact { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.place-fact strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.place-card .rank-tie { justify-self: center; margin-top: 4px; }
/* 4.º en adelante: tarjetas más pequeñas. */
.place-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }
.place-more .place-card { flex: 0 1 190px; }
.place-photo .rank-visual.is-party .party-logo { width: 54%; border-radius: 22%; }
.place-card.is-small { padding: 20px 12px 14px; gap: 4px; animation-delay: .4s; }
.place-card.is-small .place-medal { top: -11px; min-width: 34px; padding: 3px 8px; font-size: 11px; }
.place-card.is-small .place-figure { width: 110px; }
.place-card.is-small .place-name { font-size: 13px; }
.place-card.is-small .place-pct { font-size: 22px; }
.place-card.is-small .place-facts { margin-top: 2px; }
.place-card.is-small .place-fact { font-size: 11.5px; padding-top: 4px; }
@media (max-width: 820px) {
  .place-podium { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .place-card.is-1 { order: -1; }
}
@media (prefers-reduced-motion: reduce) { .place-arc { transition: none; } .place-card { animation: none; } }

/* ---------------------------------------------------------------- resumen: la cifra clave arriba de su gráfica */
.duo-stats { display: grid; gap: 10px; padding: 14px 20px 0; }
.duo-stat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text side" "bar bar"; gap: 6px 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.duo-stat-text { grid-area: text; display: grid; gap: 4px; min-width: 0; }
.duo-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.duo-stat-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.duo-stat-who .party-logo { width: 18px; height: 18px; border-radius: 5px; }
.duo-stat-side { grid-area: side; display: grid; justify-items: end; gap: 2px; }
.duo-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.duo-stat-detail { font-size: 12px; color: var(--muted); white-space: nowrap; }
.duo-stat-bar { grid-area: bar; display: block; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.duo-stat-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--muted); transition: width 1s cubic-bezier(.2, .8, .2, 1) .3s; }
.duo-stat.is-aprobacion .duo-stat-bar { background: color-mix(in srgb, var(--disapprove) 75%, transparent); }
.duo-stat.is-aprobacion .duo-stat-fill { background: var(--approve); }
.duo-stat.is-disputa .duo-stat-fill { background: #e0a43a; }


/* Preferencia por partido: sólo la pregunta a la izquierda y la gráfica de columnas a la derecha. */
.qgrid:has(> .qcard-split), .mia-body .qgrid:has(> .qcard-split) { grid-template-columns: minmax(0, 1fr); }
.qcard-split { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; align-items: center; padding: 22px 24px; }
.qcard-main { display: grid; gap: 12px; align-content: center; }
.qcard-split .qcard-text { font-size: 16px; line-height: 1.45; }
.party-charts { border-left: 1px solid var(--line); padding-left: 28px; }
.pc-block { display: grid; gap: 14px; align-content: start; }
.pc-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-plot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; height: 300px; align-items: stretch; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pc-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; min-width: 0; }
.pc-col-value { font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: center; }
.pc-col.is-quiet .pc-col-value { color: var(--muted); font-weight: 600; }
.pc-col-track { width: 100%; max-width: 64px; display: flex; align-items: flex-end; background: var(--track); border-radius: 6px 6px 0 0; overflow: hidden; }
.pc-col-fill { display: block; width: 100%; border-radius: 6px 6px 0 0; transition: height .9s cubic-bezier(.2, .8, .2, 1); }
.pc-col-label { height: 30px; display: grid; place-items: center; }
.pc-col-name { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 960px) {
  .qcard-split { grid-template-columns: minmax(0, 1fr); }
  .party-charts { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
}
@media (max-width: 640px) {
  .pc-plot { height: 220px; gap: 6px; }
}
@media print {
  .pc-col-fill { transition: none; }
}

/* ---------------------------------------------------------------- preguntas del tema, todas a la vista */
.qlist { display: grid; gap: 16px; }
.qlist .qcard-hero { padding: clamp(18px, 2vw, 26px); border-radius: 18px; }
.qlist > .qcard-hero .qcard-text { font-size: 17px; line-height: 1.35; }
.qgrid-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.qgrid-people .qcard-text { font-size: 14px; line-height: 1.4; }
.qgrid-people .result-hero.is-compact { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 4px 0 0; }
.qgrid-people .result-top { display: flex; align-items: center; justify-content: center; gap: 22px; }
.qgrid-people .result-hero.is-compact .rank-visual.is-hero .avatar { width: 120px; height: 120px; font-size: 36px; }
.qgrid-people .result-hero.is-compact .result-pct { font-size: clamp(32px, 2.8vw, 44px); }
.qgrid-people .result-hero.is-compact .result-pct-row { flex-direction: column; align-items: flex-start; gap: 4px; }
@media (max-width: 1100px) { .qgrid-people { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .qgrid-people .result-top { flex-direction: column; text-align: center; } }
/* La pregunta de personas: dona con la foto de quien encabeza y la lista completa. */
.qcard-hero { gap: 18px; }
.qcard-hero .result-hero { padding: 6px 0 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* INEGI: cuadrícula pareja de 2 columnas (sin huecos con 4 dimensiones). */
.inegi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .inegi-grid { grid-template-columns: minmax(0, 1fr); } }

/* Aprobación: foto circular de la persona evaluada + pregunta a la izquierda; dona y desglose a la derecha. */
.approval-person { display: flex; align-items: center; gap: 16px; }
.approval-photo {
  width: 88px; height: 88px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wine) 22%, transparent), 0 4px 14px rgb(0 0 0 / 18%);
}
.approval-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.approval-photo .avatar-initials { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; font-weight: 800; color: var(--ink-2); }
.approval-person-info { display: grid; gap: 4px; min-width: 0; }
.approval-person-name { font-size: 19px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.approval-person-role { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.qcard-approval .qcard-main { gap: 18px; }
.qcard-approval .qcard-text { font-size: 14px; font-weight: 500; color: var(--ink-2); }
/* Paleta de la evaluación: cian → azul (aprueba), coral → magenta (desaprueba), pizarra (resto). */
:root {
  --apr-aprueba-a: #22c1e8; --apr-aprueba-b: #2563eb;
  --apr-desaprueba-a: #ff8a4c; --apr-desaprueba-b: #e11d74;
  --apr-neutral-a: #a7b4c2; --apr-neutral-b: #6b7a8c;
  --apr-aprueba: #1d7fd0; --apr-desaprueba: #d93a62; --apr-neutral: #7b8898;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --apr-aprueba: #4cc3f2; --apr-desaprueba: #ff6b8a; --apr-neutral: #8d9cad; --apr-neutral-a: #7d8b9b; --apr-neutral-b: #4d5a69; }
}
:root[data-theme="dark"] { --apr-aprueba: #4cc3f2; --apr-desaprueba: #ff6b8a; --apr-neutral: #8d9cad; --apr-neutral-a: #7d8b9b; --apr-neutral-b: #4d5a69; }
.approval-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.approval-verdict { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.approval-verdict.is-up { color: var(--apr-aprueba); background: color-mix(in srgb, var(--apr-aprueba) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--apr-aprueba) 35%, transparent); }
.approval-verdict.is-down { color: var(--apr-desaprueba); background: color-mix(in srgb, var(--apr-desaprueba) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--apr-desaprueba) 35%, transparent); }
.approval-verdict.is-even { color: var(--muted); background: var(--track); }
.approval-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 40px; }
.approval-chart .approval-donut .donut-track { stroke: color-mix(in srgb, var(--muted) 18%, transparent); }
.approval-chart .pc-center { display: grid; justify-items: center; gap: 4px; }
.approval-chart .pc-center-value { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.approval-chart .pc-center-value.is-up { color: var(--apr-aprueba); }
.approval-chart .pc-center-value.is-down { color: var(--apr-desaprueba); }
.approval-chart .pc-center-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.approval-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 480px; }
.approval-stat {
  --tone: var(--apr-neutral); --tone-a: var(--apr-neutral-a); --tone-b: var(--apr-neutral-b);
  display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent);
  background: color-mix(in srgb, var(--tone) 7%, transparent);
  animation: candidate-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s);
}
.approval-stat.is-aprueba { --tone: var(--apr-aprueba); --tone-a: var(--apr-aprueba-a); --tone-b: var(--apr-aprueba-b); }
.approval-stat.is-desaprueba { --tone: var(--apr-desaprueba); --tone-a: var(--apr-desaprueba-a); --tone-b: var(--apr-desaprueba-b); }
.approval-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
}
.approval-stat-icon svg { width: 20px; height: 20px; }
.approval-stat-text { display: grid; gap: 8px; min-width: 0; }
.approval-stat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.approval-stat-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.approval-stat-value { font-size: 22px; font-weight: 900; color: var(--tone); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.approval-stat.is-neutral .approval-stat-label { font-weight: 600; color: var(--muted); }
.approval-stat.is-neutral .approval-stat-value { font-size: 17px; color: var(--muted); }
.approval-stat-track { display: block; height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.approval-stat-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tone-a), var(--tone-b)); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.approval-stats .approval-stat-compare { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 4px 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 1100px) {
  .approval-body { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; }
  .approval-stats { width: 100%; }
}
@media (max-width: 560px) {
  .approval-photo { width: 68px; height: 68px; }
  .approval-person-name { font-size: 17px; }
}
@media print { .approval-stat-fill { transition: none; } .approval-stat { animation: none; } }
.qgrid.qgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .qgrid.qgrid-2 { grid-template-columns: minmax(0, 1fr); } }
.qcard-imagen .qcard-subject { gap: 12px; }
.qcard-imagen .qcard-subject strong { font-size: 16px; }

/* Datos demográficos: una tarjeta por respuesta con ícono (sexo, edad, estudios, ingreso). */
.demo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.demo-tiles.is-dense { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.demo-tile {
  display: grid; justify-items: start; gap: 8px; padding: 16px; border-radius: 14px;
  background: linear-gradient(150deg, var(--surface-2) 0%, transparent 70%), var(--surface);
  border: 1px solid var(--line); animation: candidate-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s);
}
.demo-tile.is-lead { border-color: color-mix(in srgb, var(--scale-top) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--scale-top) 25%, transparent); }
.demo-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: var(--scale-top); background: color-mix(in srgb, var(--scale-top) 14%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--scale-top) 30%, transparent);
}
.demo-icon svg { width: 24px; height: 24px; }
.demo-money { font-size: 14px; font-weight: 900; letter-spacing: -.02em; }
.demo-tile.is-quiet .demo-icon { color: var(--muted); background: var(--track); box-shadow: none; }
.demo-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); line-height: 1.3; min-height: 2.6em; }
.demo-value { font-size: 24px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; display: inline-flex; align-items: baseline; gap: 6px; }
.demo-tile.is-quiet .demo-value { font-size: 18px; color: var(--muted); }
.demo-track { display: block; width: 100%; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.demo-fill { display: block; height: 100%; border-radius: inherit; background: var(--scale-top); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.demo-tile.is-quiet .demo-fill { background: var(--neutral); }

/* Lugar de residencia: barra de composición + ranking en dos columnas (sin mapa). */
.residence-chart { --residence-rest: #3e4c5c; }
.residence-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.residence-chip { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #3fd8b4; background: rgb(63 216 180 / 10%); box-shadow: inset 0 0 0 1px rgb(63 216 180 / 30%); }
.residence-stack { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--muted) 14%, transparent); }
.residence-seg { display: block; flex: 0 0 0%; min-width: 0; transition: flex-basis 1s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%); }
.residence-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; }
.residence-legend li { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.residence-legend strong { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.residence-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.residence-list { list-style: none; margin: 6px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px 28px; }
.residence-list.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
.residence-row { --tone: var(--residence-rest); display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 6px; padding: 8px 10px; border-radius: 12px; }
.residence-row.is-lead { background: color-mix(in srgb, var(--tone) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent); }
.residence-rank { grid-row: span 2; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); }
.residence-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.residence-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.residence-sub { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.residence-home { font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 1px 8px; border-radius: 999px; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.residence-value { font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.residence-row.is-lead .residence-value { font-size: 18px; color: var(--tone); }
.residence-track { grid-column: 2 / -1; display: block; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.residence-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 60%, transparent), var(--tone)); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.residence-more { margin: 0; font-size: 12px; color: var(--muted); }
/* Simulación 2027 de un distrito: tracking del margen (tarjetas de cada elección y gráfica con zonas). */
.mc-wrap { --mc-up: var(--approve); --mc-down: var(--disapprove); width: 100%; max-width: 980px; margin: 4px auto 0; }
.mc-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.mc-zone.is-up { fill: color-mix(in srgb, var(--mc-up) 9%, transparent); }
.mc-zone.is-down { fill: color-mix(in srgb, var(--mc-down) 9%, transparent); }
.mc-zone-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mc-zone-label.is-up { fill: color-mix(in srgb, var(--mc-up) 80%, var(--ink)); }
.mc-zone-label.is-down { fill: color-mix(in srgb, var(--mc-down) 80%, var(--ink)); }
.mc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }
.mc-grid.is-zero { stroke: var(--line-strong); stroke-width: 1.6; stroke-dasharray: none; }
.mc-tick { font-size: 12px; font-weight: 600; fill: var(--muted); font-variant-numeric: tabular-nums; }
.mc-ref { stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 7 6; opacity: .7; }
.mc-ref-label { font-size: 12px; font-weight: 700; fill: var(--ink-2); }
.mc-line { stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; }
.mc-line.is-projected { stroke-dasharray: 2 9; stroke-width: 3.5; }
.mc-range { fill: color-mix(in srgb, var(--ink-2) 14%, transparent); stroke: color-mix(in srgb, var(--ink-2) 40%, transparent); stroke-width: 1.2; }
.mc-range-label { font-size: 11.5px; font-weight: 600; fill: var(--muted); font-variant-numeric: tabular-nums; }
.mc-halo { opacity: .22; }
.mc-halo.is-up, .mc-dot.is-up { fill: var(--mc-up); }
.mc-halo.is-down, .mc-dot.is-down { fill: var(--mc-down); }
.mc-halo.is-tie, .mc-dot.is-tie { fill: var(--muted); }
.mc-dot { stroke: var(--surface-solid); stroke-width: 2.5; }
.mc-dot.is-projected { stroke-width: 3; }
.mc-pill { stroke-width: 1.2; }
.mc-pill.is-up { fill: color-mix(in srgb, var(--mc-up) 18%, var(--surface-solid)); stroke: color-mix(in srgb, var(--mc-up) 55%, transparent); }
.mc-pill.is-down { fill: color-mix(in srgb, var(--mc-down) 18%, var(--surface-solid)); stroke: color-mix(in srgb, var(--mc-down) 55%, transparent); }
.mc-pill.is-tie { fill: var(--surface-solid); stroke: var(--line-strong); }
.mc-pill-text { font-size: 13.5px; font-weight: 800; fill: var(--ink); font-variant-numeric: tabular-nums; }
.mc-x { font-size: 13px; font-weight: 700; fill: var(--ink); }
.mc-x-sub { font-size: 11.5px; fill: var(--muted); }
.mc-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.mc-milestones { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mc-milestone { flex: 1 1 180px; display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone, var(--muted)) 12%, transparent), transparent 70%), var(--surface); }
.mc-milestone.is-up { --tone: var(--approve); }
.mc-milestone.is-down { --tone: var(--disapprove); }
.mc-milestone.is-projected { border-style: dashed; border-color: color-mix(in srgb, var(--tone, var(--muted)) 45%, var(--line)); }
.mc-milestone-label { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mc-milestone-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--tone, var(--ink)); font-variant-numeric: tabular-nums; }
.mc-milestone-who { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.mc-change { justify-self: start; margin-top: 2px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.mc-change.is-up { color: var(--approve); background: color-mix(in srgb, var(--approve) 12%, transparent); }
.mc-change.is-down { color: var(--disapprove); background: color-mix(in srgb, var(--disapprove) 12%, transparent); }
.mc-arrow { align-self: center; font-size: 18px; color: var(--muted); }
.mc-table { margin-top: 10px; }
@media (max-width: 720px) { .mc-arrow { display: none; } }

/* Simulación 2027 de un distrito: un anillo por bloque con los logos de sus partidos al centro. */
.bloc-ranking { margin: 4px 0 6px; }
.bloc-ranking .place-podium.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bloc-logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; width: 62%; }
.bloc-logos .party-logo { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 4px 14px rgb(0 0 0 / 25%); }
.bloc-logos.is-1 .party-logo { width: 74px; height: 74px; border-radius: 18px; }
.bloc-logos.is-2 .party-logo { width: 54px; height: 54px; }
.place-card.is-small .bloc-logos .party-logo { width: 28px; height: 28px; border-radius: 8px; }
.place-card.is-small .bloc-logos.is-1 .party-logo { width: 42px; height: 42px; }
.bloc-logos-text { font-size: 18px; font-weight: 800; color: var(--party); }
.bloc-card .place-fact.is-up strong { color: var(--approve); }
.bloc-card .place-fact.is-down strong { color: var(--disapprove); }

/* Lugar de residencia con el estilo del ranking: anillos con brillo y un marcador de ubicación al centro. */
.residence-ranking { margin-top: 6px; }
.residence-ranking .place-podium.is-1 { grid-template-columns: minmax(0, 360px); justify-content: center; }
.residence-ranking .place-podium.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.residence-pin { display: grid; place-items: center; width: 46%; aspect-ratio: 1; border-radius: 50%;
  color: var(--party); background: color-mix(in srgb, var(--party) 16%, var(--surface-solid));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--party) 45%, transparent), 0 0 28px color-mix(in srgb, var(--party) 30%, transparent); }
.residence-pin svg { width: 48%; height: 48%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.residence-card .residence-sub { margin-top: -2px; }
.residence-card .residence-home { --tone: var(--party); justify-self: center; }
@media (max-width: 1180px) {
  .residence-list.is-two { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-template-rows: none; }
}
@media print { .demo-fill, .residence-fill { transition: none; } .demo-tile { animation: none; } }

/* ---------------------------------------------------------------- segunda opción por votante */
.sc-scenario { display: grid; gap: 14px; }
.sc-scenario + .sc-scenario { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.sc-scenario-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.sc-scenario-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.sc-scenario-names { margin: 0; font-size: 12.5px; color: var(--muted); }
.sc-overall {
  display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 18px 28px; align-items: center;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, #5ef2ea 9%, transparent), transparent 60%), var(--surface);
}
.sc-overall-intro { display: grid; gap: 4px; }
.sc-overall-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sc-overall-title { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.sc-overall-note { font-size: 12.5px; color: var(--muted); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.sc-card {
  --party: var(--ink);
  display: grid; gap: 12px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 18px;
  background: radial-gradient(100% 50% at 0% 0%, color-mix(in srgb, var(--party) 13%, transparent), transparent 70%), var(--surface);
  animation: duo-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
.sc-card-head { display: flex; align-items: center; gap: 14px; }
.sc-card-head .avatar-lg { width: 60px; height: 60px; box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--party); }
.sc-card-title { display: grid; gap: 3px; min-width: 0; }
.sc-card-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sc-card-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.sc-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.sc-card-n { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sc-card-label { margin: 2px 0 -4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sc-card-foot { margin: 0; font-size: 12px; color: var(--muted); }
.sc-card-warn { margin: 0; font-size: 12px; color: var(--warn-ink); background: var(--warn-bg); padding: 6px 10px; border-radius: 10px; }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-list.is-overall { gap: 12px; }
.sc-item { --party: var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.sc-item .avatar { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 3.5px var(--party); }
.sc-none-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line-strong); }
.sc-list.is-overall .sc-none-dot { width: 52px; height: 52px; }
.sc-item-body { display: grid; gap: 5px; min-width: 0; }
.sc-item-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sc-item-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-list.is-overall .sc-item-name { font-size: 15px; }
.sc-item-party { margin-left: 8px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.sc-item-pct { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-list.is-overall .sc-item-pct { font-size: 18px; }
.sc-track { display: block; height: 7px; border-radius: 999px; background: var(--track); overflow: hidden; }
.sc-list.is-overall .sc-track { height: 9px; }
.sc-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--party) 55%, #ffffff), var(--party)); transition: width 1s cubic-bezier(.2, .8, .2, 1) .2s; }
.sc-item.is-none .sc-item-name, .sc-item.is-none .sc-item-pct { color: var(--muted); font-weight: 500; }
:root[data-theme="dark"] .sc-fill { box-shadow: 0 0 8px color-mix(in srgb, var(--party) 60%, transparent); }
@media (max-width: 820px) { .sc-overall { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .sc-card { animation: none; } .sc-fill { transition: none; } }

/* Distritos alianza: paleta azul (PAN-PRI) en lugar del verde, y panel lateral que muestra la entidad elegida. */
.alliance-page {
  --seq-1: #dce8fb; --seq-2: #a9c6f3; --seq-3: #5d93e2; --seq-4: #2a63c8; --seq-5: #143f8f;
  --alliance-up: #2a63c8; --alliance-down: #d63c5e;
}
:root[data-theme="dark"] .alliance-page {
  --seq-1: #172a4a; --seq-2: #1f4075; --seq-3: #2d63b4; --seq-4: #4b8ef0; --seq-5: #a3cbff;
  --alliance-up: #6aa8ff; --alliance-down: #ff6b86;
}
.alliance-page .map-state.is-selected { stroke: var(--ink); stroke-width: 2; }
.alliance-page .dist-rank-fill { background: color-mix(in srgb, var(--seq-3) 45%, var(--track)); }
.alliance-page .dist-rank-won { background: linear-gradient(90deg, var(--seq-4), var(--seq-5)); }
.alliance-page .district-count { background: var(--seq-4); color: #fff; }
.dist-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 96px); min-height: 0; }
.dist-side > .dist-rank, .dist-side > .district-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; }
.dist-back { align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.dist-back:hover { color: var(--ink); border-color: var(--line-strong); }
.dist-side-title { display: flex; align-items: center; gap: 10px; }
.dist-side-title .card-title { font-size: 22px; }
.dist-side-title .tag { margin-left: auto; }
.dist-side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dist-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.dist-stat strong { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.dist-stat span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.dist-stat.is-up strong { color: var(--alliance-up); }
.dist-stat.is-down strong { color: var(--alliance-down); }
.dist-side .district-sort { align-self: flex-start; }
.district-pick { color: inherit; text-decoration: none; }
.district-pick:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .dist-side { position: static; max-height: none; }
  .dist-side > .dist-rank, .dist-side > .district-list { overflow: visible; }
}
.sc-grid.is-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .sc-grid.is-pairs { grid-template-columns: minmax(0, 1fr); } }

/* Aprobación al estilo del ranking: tarjetas con anillo de marcas, brillo e ícono al centro. */
.approval-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approval-net { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); }
.approval-net strong { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.approval-net.is-up strong { color: #22c98a; }
.approval-net.is-down strong { color: #f2436b; }
.approval-verdict.is-up { color: #22c98a; background: rgb(34 201 138 / 12%); box-shadow: inset 0 0 0 1px rgb(34 201 138 / 35%); }
.approval-verdict.is-down { color: #f2436b; background: rgb(242 67 107 / 12%); box-shadow: inset 0 0 0 1px rgb(242 67 107 / 35%); }
.approval-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; padding-top: 14px; }
.approval-card { padding: 22px 14px 18px; gap: 6px; background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--party) 12%, transparent), transparent 70%), transparent; }
.approval-card.is-1 { padding-top: 26px; }
.approval-card .place-figure { width: min(150px, 100%); }
.approval-card.is-1 .place-figure { width: min(180px, 100%); }
.approval-card .place-pct { font-size: 28px; }
.approval-card.is-1 .place-pct { font-size: 36px; color: var(--party); }
.approval-card.is-neutral .place-name { font-size: 12.5px; color: var(--muted); }
.approval-card.is-neutral .place-pct { font-size: 22px; color: var(--muted); }
.approval-ring-icon {
  width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: var(--party);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--party) 26%, transparent), color-mix(in srgb, var(--party) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--party) 40%, transparent), 0 10px 26px rgb(0 0 0 / 22%);
}
.approval-ring-icon svg { width: 44%; height: 44%; }
:root[data-theme="dark"] .approval-ring-icon svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--party) 70%, transparent)); }
.approval-people { margin: 0; font-size: 11.5px; color: var(--muted); }
.approval-compare { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .approval-podium { grid-template-columns: minmax(0, 1fr); } .approval-card.is-1 { order: -1; } }

/* Aprobación con foto: la foto ocupa toda la columna izquierda; nombre y pregunta encima, sobre un degradado. */
.qcard-approval.has-hero { padding: 0; align-items: stretch; overflow: hidden; gap: 0; }
.qcard-approval.has-hero > .party-charts { padding: 22px 24px 22px 28px; border-left: 0; }
.approval-hero {
  position: relative; display: grid; align-content: end; min-height: 440px; overflow: hidden;
  border-radius: var(--radius) 0 0 var(--radius); background: #0b1117; isolation: isolate;
}
.approval-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; z-index: -2; }
.approval-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(5 10 16 / 0%) 30%, rgb(5 10 16 / 55%) 55%, rgb(5 10 16 / 92%) 82%, rgb(5 10 16 / 97%) 100%);
}
.approval-hero-text { display: grid; gap: 14px; padding: 24px 24px 22px; }
.approval-hero .approval-person-name { font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgb(0 0 0 / 45%); }
.approval-hero .approval-person-role {
  justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  color: #e8eef3; background: rgb(255 255 255 / 12%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); backdrop-filter: blur(6px);
}
.approval-hero .approval-person-info { gap: 8px; }
.approval-hero .qcard-head { gap: 6px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 14%); }
.approval-hero .qcard-text { color: rgb(255 255 255 / 88%); font-size: 13.5px; font-weight: 500; line-height: 1.5; padding-right: 44px; }
.approval-hero .qcard-meta { color: rgb(255 255 255 / 60%); }
.approval-hero .qcard-csv { color: rgb(255 255 255 / 75%); border-color: rgb(255 255 255 / 25%); background: rgb(0 0 0 / 25%); }
.approval-hero.is-photoless { background: var(--surface-2); }
@media (max-width: 960px) {
  .approval-hero { min-height: 380px; border-radius: var(--radius) var(--radius) 0 0; }
  .qcard-approval.has-hero > .party-charts { padding: 18px; border-top: 0; }
}

/* ---------------------------------------------------------------- datos demográficos compactos
   Escala de un solo tono (azul pizarra claro -> azul profundo): sobria y ordenada, sin brillos. */
:root {
  --demo-light: #a9c3dd; --demo-deep: #1f3f78;
  --demo-quiet: color-mix(in srgb, var(--ink) 14%, transparent);
}
:root[data-theme="dark"] {
  --demo-light: #2b4566; --demo-deep: #8fc2ff;
  --demo-quiet: rgb(255 255 255 / 12%);
}
.qcard-demo { gap: 14px; }
.qcard-demo .qcard-text { font-size: 15px; }
.demo-compact { display: grid; gap: 16px; }
.demo-stack { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.demo-part {
  position: relative; display: grid; place-items: center; flex: 0 0 0; min-width: 0; overflow: hidden;
  transition: flex-basis 1s cubic-bezier(.2, .8, .2, 1);
}
.demo-stack.is-on .demo-part { flex-basis: var(--w); }
.demo-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 24px; }
.demo-legend.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-row { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; }
.demo-row.is-lead { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.demo-dot {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2);
}
.demo-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.demo-dot svg { width: 15px; height: 15px; }
.demo-row-label { font-size: 13px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-row.is-lead .demo-row-label { color: var(--ink); font-weight: 650; }
.demo-row-pct { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-row-pct .delta { font-size: 11px; margin-left: 4px; }
.demo-row.is-quiet .demo-row-label, .demo-row.is-quiet .demo-row-pct { color: var(--muted); font-weight: 500; }
@media (max-width: 520px) { .demo-legend.is-two { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .demo-part { transition: none; } }
.demo-dot { width: auto; min-width: 26px; padding: 0 5px; font-size: 11px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.compare-part, .compare-part.is-dark { color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 35%); }
.residence-rank { color: var(--ink-2); background: color-mix(in srgb, var(--tone) 32%, transparent); }
.residence-row.is-lead .residence-rank { color: #04120e; background: var(--tone); }
.residence-row.is-lead { background: color-mix(in srgb, var(--tone) 8%, transparent); }

/* Lugar de residencia: paleta propia, armónica y distinguible (joya suave). Claro: tonos profundos; oscuro: luminosos. */
.residence-chart {
  --res-1: #0e9f86; --res-2: #2f6fdb; --res-3: #7656d6; --res-4: #c9507f; --res-5: #c98a1c;
  --res-6: #1592ad; --res-7: #4f5bd1; --res-8: #a54fa0; --res-9: #cf6844; --res-10: #6f8f22;
  --residence-rest: #a3adba; --res-on: #fff;
}
:root[data-theme="dark"] .residence-chart {
  --res-1: #3ed6b5; --res-2: #6fa6ff; --res-3: #a88bfa; --res-4: #f08cb6; --res-5: #f4bc62;
  --res-6: #5ccfe6; --res-7: #8d96fa; --res-8: #dc8ad3; --res-9: #f39b7b; --res-10: #b9d46a;
  --residence-rest: #4d5d72; --res-on: #071420;
}
.residence-chip { color: var(--res-1); background: color-mix(in srgb, var(--res-1) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--res-1) 32%, transparent); }
.residence-stack { gap: 3px; height: 14px; background: transparent; }
.residence-seg { border-radius: 4px; box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), inset 0 -1px 0 rgb(0 0 0 / 10%); }
.residence-seg:first-child { border-radius: 999px 4px 4px 999px; }
.residence-seg:last-child { border-radius: 4px 999px 999px 4px; }
.residence-dot { width: 9px; height: 9px; border-radius: 50%; }
.residence-rank { color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 34%, transparent); }
.residence-row.is-lead .residence-rank { color: var(--res-on); background: var(--tone); box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--tone) 70%, transparent); }
.residence-row.is-lead { background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 13%, transparent), color-mix(in srgb, var(--tone) 3%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 28%, transparent); }
.residence-track { background: color-mix(in srgb, var(--tone) 12%, transparent); }
.residence-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 45%, transparent), var(--tone)); }
:root[data-theme="dark"] .residence-row.is-lead .residence-fill { box-shadow: 0 0 10px color-mix(in srgb, var(--tone) 55%, transparent); }

/* ---------------------------------------------------------------- aprobación: foto recortada, fondo transparente */
.approval-cutout { display: grid; align-content: start; gap: 14px; padding: 18px 22px 22px; background: transparent; }
.approval-cutout-stage {
  position: relative; display: grid; justify-items: center; align-items: end; height: 250px; margin: -4px -6px 0;
  border-bottom: 1px solid var(--line);
}
.approval-cutout-stage::before {  /* brillo detrás de la persona */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 82%; aspect-ratio: 1; translate: -50% 18%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #5ef2ea 26%, transparent), transparent 66%);
}
:root:not([data-theme="dark"]) .approval-cutout-stage::before { background: radial-gradient(circle, color-mix(in srgb, #0d9488 16%, transparent), transparent 66%); }
.approval-cutout-img {
  position: relative; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 14px 22px rgb(0 0 0 / 35%));
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent);
}
.approval-cutout .approval-person-info { display: grid; gap: 8px; justify-items: start; }
.approval-cutout .approval-person-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; }
.approval-cutout .approval-person-role {
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.approval-cutout .qcard-head { gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.approval-cutout .qcard-text { font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ink-2); padding-right: 44px; }
.qcard-approval.has-cutout { background: transparent; }
:root[data-theme="dark"] .qcard-approval.has-cutout { background: rgb(8 17 24 / 30%); }
@media (max-width: 960px) { .approval-cutout-stage { height: 220px; } }
.approval-cutout-stage { display: flex; justify-content: center; align-items: flex-end; overflow: hidden; }
.approval-cutout-img { height: 250px; max-height: 250px; }
@media (max-width: 960px) { .approval-cutout-img { height: 220px; max-height: 220px; } }

/* Panel de Análisis y Estrategia: fuera del cuadro de Resultados, a su derecha en pantallas anchas.
   Cambia junto con el tema que se está viendo. Estilo sobrio: filas separadas por líneas finas, sin bordes de color. */
.insights { --in-analysis: #3559c7; --in-strategy: #00805a; min-width: 0; }
.insights[hidden] { display: none; }
:root[data-theme="dark"] .insights { --in-analysis: #8fb0ff; --in-strategy: #5fd6ae; }
.insight-body {
  display: grid; gap: 22px; padding: 20px 20px 18px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); animation: insight-in .35s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes insight-in { from { opacity: 0; transform: translateY(6px); } }
/* Ficha técnica («Metodología»): tarjeta propia debajo de «Lectura del tema», con aire entre las dos. */
.insights:has(> .method-box) { display: grid; gap: 28px; align-content: start; }
.insights[hidden] { display: none; }
.method-box {
  display: grid; gap: 10px; align-content: start; padding: 18px 20px 16px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); min-width: 0;
}
.method-list { display: grid; margin: 0; }
.method-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.method-row:last-child { border-bottom: 0; padding-bottom: 0; }
.method-row dt { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.method-row dd { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.method-row dd.is-strong { font-weight: 700; color: var(--ink); }
.insight-head { display: grid; gap: 4px; }
.insight-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.insight-title { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }
.insight-section { --tone: var(--in-analysis); display: grid; gap: 0; }
.insight-section.is-actuar { --tone: var(--in-strategy); }
.insight-section-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.insight-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); flex: none; }
.insight-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.insight-section-title { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.insight-more { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.insight-more:hover { color: var(--ink); }

/* Una fila por índice, hallazgo o recomendación. */
.insight-item { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.insight-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.insight-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.insight-figures { display: grid; gap: 12px; }
.insight-figures.is-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.insight-figure { display: grid; gap: 3px; min-width: 0; }
.insight-figures.is-pair .insight-figure + .insight-figure { padding-left: 12px; border-left: 1px solid var(--line); }
.insight-number { font-size: 22px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.insight-figure:not(.is-main) .insight-number { font-size: 18px; color: var(--ink-2); }
.insight-number.is-long { font-size: 14px; font-weight: 700; letter-spacing: 0; line-height: 1.35; }
.insight-caption { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.insight-link { justify-self: start; font-size: 12.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.insight-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.insight-none { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Texto largo, sólo si se pide. */
.insight-detail summary {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none; user-select: none;
}
.insight-detail summary::-webkit-details-marker { display: none; }
.insight-detail summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.insight-detail[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.insight-detail summary:hover { color: var(--ink); }
.insight-detail p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

.insight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insight-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.insight-list-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.insight-list-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-empty { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* Ancho: Resultados a la izquierda y el panel a la derecha, a la altura del cuadro y fijo al bajar. */
@media (min-width: 1440px) {
  .view:has(> .state-page.has-insights) { max-width: 1880px; }
  .state-page.has-insights { grid-template-columns: minmax(0, 1fr) 350px; column-gap: 24px; }
  .state-page.has-insights > * { grid-column: 1; }
  .state-page.has-insights > .insights {
    grid-column: 2; grid-row: 3; align-self: start; position: sticky; top: 84px;
    max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; border-radius: 18px;
  }
  /* Distrito de la simulación: sin pestañas, el cuadro está en la segunda fila; el panel va a su lado. */
  .state-page.sim-district-page.has-insights > .insights { grid-row: 2; }
  body:has(.state-page.has-insights) .backdrop-pulse { display: none; }
}
/* Pantallas medianas: el panel va debajo del cuadro, con Análisis y Estrategia lado a lado. */
@media (min-width: 900px) and (max-width: 1439px) {
  .insight-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .insight-head { grid-column: 1 / -1; }
}
@media print { .insights { display: none; } }
@media (prefers-reduced-motion: reduce) { .insight-body { animation: none; } }

/* ---------------------------------------------------------------- aprobación: ficha profesional de la persona evaluada */
.approval-profile { --ring: #5ef2ea; display: grid; align-content: center; gap: 18px; padding: 22px 24px; background: transparent; }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-photo {
  position: relative; flex: none; width: 128px; height: 128px; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 210deg, var(--ring), color-mix(in srgb, var(--ring) 35%, transparent), var(--ring));
  box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--ring) 70%, transparent);
}
.profile-photo img, .profile-photo .profile-initials {
  display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 22%;
  border: 3px solid var(--surface-solid); background: var(--surface-solid);
}
.profile-photo .profile-initials { display: grid; place-items: center; font-size: 36px; font-weight: 700; color: var(--ink-2); }
.profile-info { display: grid; gap: 6px; min-width: 0; justify-items: start; }
.profile-role { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.profile-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.profile-party {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: color-mix(in srgb, var(--ring) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ring) 35%, transparent);
}
.profile-party .party-logo { width: 18px; height: 18px; border-radius: 50%; }
.approval-profile .qcard-head { gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.approval-profile .qcard-text { font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ink-2); padding-right: 44px; }
@media (max-width: 520px) { .profile-photo { width: 96px; height: 96px; } .profile-name { font-size: 19px; } }

/* Usuarios: rol de cada cuenta y formulario para cambiar su acceso. */
.role-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line-strong); }
.role-tag.is-admin { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.role-tag.is-cliente { color: #2a9590; border-color: rgb(42 149 144 / 45%); background: rgb(42 149 144 / 10%); }
:root[data-theme="dark"] .role-tag.is-cliente { color: #3fd8b4; border-color: rgb(63 216 180 / 40%); background: rgb(63 216 180 / 10%); }
.role-tag.is-gs { color: #b98a2e; border-color: rgb(201 151 52 / 45%); background: rgb(201 151 52 / 10%); }
:root[data-theme="dark"] .role-tag.is-gs { color: #e7c27a; border-color: rgb(231 194 122 / 40%); background: rgb(231 194 122 / 10%); }
.role-tag.is-simulacion { color: #3559c7; border-color: rgb(53 89 199 / 45%); background: rgb(53 89 199 / 10%); }
:root[data-theme="dark"] .role-tag.is-simulacion { color: #8fb0ff; border-color: rgb(143 176 255 / 40%); background: rgb(143 176 255 / 10%); }
.user-role .cell-sub { display: block; margin-top: 3px; }
.inline-access { display: grid; gap: 8px; min-width: 240px; text-align: left; }
.inline-access .rec-field { gap: 4px; }
.inline-access .field-hint { display: none; }

/* Distritos alianza: una sola lista ordenada de entidades; cada una se abre ahí mismo con sus distritos. */
.dist-side { gap: 14px; }
.dist-side-head { display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dist-side-head .side-note { margin: 4px 0 0; }
.dist-side-head .district-sort { justify-self: start; }
.dist-accordion { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 6px; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; }
.dist-entity { border: 1px solid transparent; border-radius: 12px; transition: border-color .2s ease, background-color .2s ease; }
.dist-entity.is-open { border-color: color-mix(in srgb, var(--seq-4) 45%, var(--line)); background: color-mix(in srgb, var(--seq-4) 6%, transparent); }
.dist-entity-head {
  width: 100%; display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(0, 1fr) auto 16px; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.dist-entity-head:hover { background: var(--surface-2); }
.dist-entity.is-open .dist-entity-head:hover { background: transparent; }
.dist-entity-head:focus-visible { outline: 2px solid var(--seq-4); outline-offset: -2px; }
.dist-entity.is-open .dist-rank-name > span:first-child { font-weight: 800; }
.dist-chevron { width: 8px; height: 8px; justify-self: center; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.dist-entity.is-open .dist-chevron { transform: rotate(-135deg) translateY(-2px); border-color: var(--seq-4); }
.dist-entity-body { display: grid; gap: 10px; padding: 2px 12px 12px; animation: insight-in .25s cubic-bezier(.2, .8, .2, 1) both; }
.dist-entity-tools { display: grid; gap: 8px; }
.dist-entity-tools .tag-link { justify-self: start; }
.dist-entity-body .district-list { border-top: 1px solid var(--line); padding-top: 4px; }
.is-client .dist-entity-head { cursor: default; }
.is-client .dist-chevron { display: none; }
@media (max-width: 860px) {
  .dist-accordion { overflow: visible; margin-right: 0; padding-right: 0; }
  .dist-entity-head { grid-template-columns: minmax(0, 1fr) auto 16px; }
  .dist-entity-head .dist-rank-track { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dist-entity-body { animation: none; } }
.dist-entity-body[hidden] { display: none; }

/* Acceso: video de fondo en bucle (bandera monumental sobre la Ciudad de México) bajo el mapa y el formulario.
   Se corre un poco a la derecha para que la bandera ondee junto al mapa y no detrás de él. */
.login-ambient { background: #070b10; transition: opacity 1.6s ease .2s; }
.ambient-poster, .ambient-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.2) translateX(8%); filter: saturate(.95) brightness(.7) contrast(1.06);
}
.ambient-video { opacity: 0; transition: opacity 1.2s ease; }
.ambient-video.is-playing { opacity: 1; }
.login-ambient::after {
  background:
    radial-gradient(120% 90% at 30% 50%, transparent 35%, rgb(5 8 12 / 55%) 100%),
    linear-gradient(0deg, rgb(5 8 12 / 70%) 0%, rgb(5 8 12 / 15%) 30%, transparent 50%),
    linear-gradient(90deg, rgb(5 8 12 / 35%) 0%, rgb(5 8 12 / 25%) 40%, rgb(5 8 12 / 70%) 60%, rgb(5 8 12 / 88%) 100%);
}
@media (max-width: 860px) {
  .ambient-poster, .ambient-video { transform: none; }
  .login-ambient::after { background: linear-gradient(180deg, rgb(5 8 12 / 50%), rgb(5 8 12 / 88%) 55%); }
}

/* Acceso: el encabezado, el formulario y la cuenta regresiva aparecen desde el inicio (el mapa entra a la vez). */
.login-page .intro-copy > *, .login-page .login-form, .login-page .login-foot { opacity: 1; transform: none; animation: login-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.login-page .intro-copy > :nth-child(2) { animation-delay: .05s; }
.login-page .intro-copy > :nth-child(3) { animation-delay: .1s; }
.login-page .intro-copy > :nth-child(4) { animation-delay: .15s; }
.login-page .intro-copy > :nth-child(5) { animation-delay: .2s; }
.login-page .intro-copy > :nth-child(6) { animation-delay: .25s; }
.login-page .login-form { animation-delay: .3s; }
.login-page .login-foot { animation-delay: .4s; }
.login-page .intro-flag { width: min(260px, 60%); }
@keyframes login-in { from { opacity: 0; transform: translateY(12px); } }

/* Cuenta regresiva a la jornada electoral: tarjeta con fotos que se alternan y cifras en mosaicos. */
.login-countdown {
  position: fixed; left: clamp(24px, 4vw, 72px); bottom: clamp(22px, 5.5vh, 60px); z-index: 2;
  display: grid; grid-template-columns: 150px minmax(0, 1fr); width: min(560px, calc(100vw - 48px)); overflow: hidden;
  border-radius: 20px; color: #f4f1ec; background: rgb(10 14 19 / 62%); border: 1px solid rgb(255 255 255 / 13%);
  box-shadow: 0 30px 70px rgb(0 0 0 / 45%), inset 0 1px 0 rgb(255 255 255 / 8%); backdrop-filter: blur(14px) saturate(1.15);
  opacity: 0; transform: translateY(14px); transition: opacity .8s ease .35s, transform .8s cubic-bezier(.2, .8, .2, 1) .35s;
}
.login-countdown.is-on { opacity: 1; transform: none; }
.countdown-media { position: relative; overflow: hidden; background: #111820; }
.countdown-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  filter: saturate(1.05) contrast(1.05) brightness(.82); transform: scale(1.06); transition: opacity 1.4s ease, transform 7s ease-out;
}
.countdown-photo.is-active { opacity: 1; transform: scale(1); }
.countdown-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 55%, rgb(10 14 19 / 70%)), linear-gradient(0deg, rgb(10 14 19 / 70%), transparent 45%);
}
.countdown-live {
  position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: rgb(0 0 0 / 45%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); backdrop-filter: blur(6px);
}
.countdown-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 0 0 rgb(255 77 94 / 60%); animation: countdown-pulse 1.6s ease-out infinite; }
@keyframes countdown-pulse { 70% { box-shadow: 0 0 0 7px rgb(255 77 94 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(255 77 94 / 0%); } }
.countdown-body { display: grid; gap: 14px; padding: 18px 20px 16px; min-width: 0; }
.countdown-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.countdown-kicker { margin: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: rgb(244 241 236 / 70%); }
.countdown-date { margin: 0; font-size: 12px; font-weight: 600; color: rgb(244 241 236 / 88%); }
.countdown-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 8px; }
.countdown-unit {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 3%)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
}
.countdown-unit:first-child { background: linear-gradient(180deg, rgb(255 255 255 / 15%), rgb(255 255 255 / 5%)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); }
.countdown-unit strong {
  font-family: var(--font-brand); font-size: clamp(24px, 2.2vw, 34px); font-weight: 800; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: #fff;
}
.countdown-unit:first-child strong { font-size: clamp(28px, 2.6vw, 40px); }
.countdown-unit strong.is-tick { animation: countdown-tick .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes countdown-tick { from { opacity: .2; transform: translateY(-40%); } to { opacity: 1; transform: none; } }
.countdown-unit span { font-size: 9.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: rgb(244 241 236 / 55%); }
.countdown-foot { display: flex; align-items: center; gap: 12px; }
.countdown-flag { flex: none; width: 54px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #006847 0 33.33%, #f4f1ec 33.33% 66.66%, #ce1126 66.66% 100%); }
.countdown-note { margin: 0; font-size: 12px; color: rgb(244 241 236 / 68%); }
@media (max-width: 860px), (max-height: 640px) { .login-countdown { display: none; } }
@media (max-width: 1180px) { .login-countdown { grid-template-columns: minmax(0, 1fr); width: min(400px, calc(100vw - 48px)); } .countdown-media { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .login-page .intro-copy > *, .login-page .login-form, .login-page .login-foot, .countdown-unit strong.is-tick, .countdown-dot { animation: none; }
  .login-countdown, .countdown-photo { transition: none; transform: none; }
}
.profile-photo.is-generic { display: grid; place-items: center; }
.profile-photo .profile-icon {
  width: 100%; height: 100%; padding: 30%; border-radius: 50%; border: 3px solid var(--surface-solid); background: var(--surface-solid);
  fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* Carrusel de tarjetas (aprobación de varias personas): una a la vez, con pestañas, flechas y avance automático. */
.qcarousel { display: grid; gap: 14px; outline: none; }
.qcarousel-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.qcarousel-tabs { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.qcarousel-tab {
  position: relative; display: grid; gap: 7px; min-width: 150px; max-width: 260px; padding: 9px 14px 10px; border-radius: 12px; cursor: pointer;
  font: inherit; text-align: left; color: var(--muted); background: transparent; border: 1px solid var(--line); transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.qcarousel-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.qcarousel-tab[aria-selected="true"] { color: var(--ink); border-color: var(--line-strong); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.qcarousel-tab:focus-visible { outline: 2px solid var(--interpretar); outline-offset: 2px; }
.qcarousel-tab-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcarousel-tab-progress { position: relative; display: block; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.qcarousel-tab-progress::after { content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: var(--ink); opacity: .8; }
.qcarousel-tab[aria-selected="true"] .qcarousel-tab-progress::after { transform: scaleX(1); }
.qcarousel.is-playing .qcarousel-tab[aria-selected="true"] .qcarousel-tab-progress::after { animation: qcarousel-progress var(--dwell, 8s) linear both; }
@keyframes qcarousel-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.qcarousel-controls { display: flex; align-items: center; gap: 8px; }
.qcarousel-count { margin-right: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.qcarousel-arrow { width: 38px; height: 38px; font-size: 20px; line-height: 1; }
.qcarousel-viewport { overflow: hidden; border-radius: var(--radius); touch-action: pan-y; }
.qcarousel-track { display: flex; transition: transform .7s cubic-bezier(.22, .8, .2, 1); will-change: transform; }
.qcarousel-slide { flex: 0 0 100%; min-width: 0; opacity: .35; transition: opacity .6s ease; }
.qcarousel-slide.is-current { opacity: 1; }
/* Al llegar a una tarjeta, su contenido entra escalonado. */
.qcarousel-slide.is-current .profile-head, .qcarousel-slide.is-current .qcard-head,
.qcarousel-slide.is-current .approval-card, .qcarousel-slide.is-current .approval-title { animation: qcarousel-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.qcarousel-slide.is-current .qcard-head { animation-delay: .08s; }
.qcarousel-slide.is-current .approval-title { animation-delay: .12s; }
.qcarousel-slide.is-current .approval-card:nth-child(1) { animation-delay: .18s; }
.qcarousel-slide.is-current .approval-card:nth-child(2) { animation-delay: .26s; }
.qcarousel-slide.is-current .approval-card:nth-child(3) { animation-delay: .34s; }
@keyframes qcarousel-in { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 640px) {
  .qcarousel-tab { min-width: 0; flex: 1 1 0; }
  .qcarousel-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .qcarousel-track, .qcarousel-slide { transition: none; }
  .qcarousel-slide.is-current * { animation: none !important; }
}
@media print {
  .qcarousel-bar { display: none; }
  .qcarousel-track { display: grid; gap: 14px; transform: none !important; }
  .qcarousel-slide { opacity: 1; }
}
/* Con muchas tarjetas: lista desplegable y una sola barra de avance. */
.qcarousel.is-many .qcarousel-bar { position: relative; padding-bottom: 10px; }
.qcarousel-select { flex: 1 1 280px; max-width: 460px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; }
.qcarousel-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.qcarousel-progress::after { content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: var(--ink); opacity: .8; }
.qcarousel.is-playing .qcarousel-progress::after { animation: qcarousel-progress var(--dwell, 8s) linear both; }

/* Aprobación: la foto de la persona llena toda la columna izquierda (sin marco circular); encima, abajo,
   sólo el cargo, el nombre y el partido sobre un degradado. */
.qcard-approval.has-cover { padding: 0; gap: 0; align-items: stretch; overflow: hidden; }
.qcard-approval.has-cover > .party-charts { padding: 22px 24px 22px 28px; border-left: 0; }
.approval-cover {
  --ring: #5ef2ea; position: relative; display: grid; align-content: end; min-height: 420px; padding: 0; overflow: hidden; isolation: isolate;
  border-radius: var(--radius) 0 0 var(--radius); background: #0b1117;
}
.cover-media { position: absolute; inset: 0; z-index: -2; }
.cover-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transform: scale(1.01); transition: transform 6s ease-out; }
.qcard-approval.has-cover:hover .cover-img { transform: scale(1.05); }
.cover-media.is-empty {
  display: grid; place-items: center; color: rgb(255 255 255 / 85%);
  background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--ring) 32%, #101820), #0b1117 75%);
}
.cover-initials { font-family: var(--font-brand); font-size: 76px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 70px; }
.cover-icon { width: 84px; height: 84px; margin-bottom: 70px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.approval-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(5 9 14 / 0%) 40%, rgb(5 9 14 / 55%) 62%, rgb(5 9 14 / 93%) 88%, rgb(5 9 14 / 97%) 100%);
}
.cover-caption { display: grid; gap: 8px; justify-items: start; padding: 22px 24px 24px; }
.cover-caption::before { content: ""; width: 40px; height: 3px; border-radius: 3px; background: var(--ring); margin-bottom: 4px; }
.approval-cover .profile-role { color: rgb(255 255 255 / 72%); }
.approval-cover .profile-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; color: #fff; text-shadow: 0 2px 14px rgb(0 0 0 / 45%); }
.approval-cover .profile-party { color: #fff; background: rgb(255 255 255 / 12%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%); backdrop-filter: blur(6px); }
.approval-cover .qcard-csv { top: 12px; right: 12px; opacity: 1; color: rgb(255 255 255 / 80%); border-color: rgb(255 255 255 / 25%); background: rgb(0 0 0 / 35%); backdrop-filter: blur(6px); }
.approval-cover .qcard-csv:hover { color: #fff; }
@media (max-width: 960px) {
  .approval-cover { min-height: 360px; border-radius: var(--radius) var(--radius) 0 0; }
  .qcard-approval.has-cover > .party-charts { padding: 18px; border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .cover-img { transition: none; transform: none; } }
/* En el carrusel, el nombre entra con la tarjeta. */
.qcarousel-slide.is-current .cover-caption { animation: qcarousel-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.qcarousel-slide.is-current .cover-img { animation: cover-in 1.1s ease both; }
@keyframes cover-in { from { opacity: .4; transform: scale(1.08); } }

/* Tooltip del mapa: el fondo es sólido (--surface-solid), así que el texto va en --ink para que se lea. */
.tooltip { color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 10px 28px rgb(0 0 0 / 35%); }
.tooltip span { color: var(--ink-2); }

/* Fuente de la encuesta (GobernArte para las entidades sin encuestas en Odiseo) y selector de encuesta. */
.state-source { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.source-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.source-tag.is-gobernarte { color: #b98a2e; background: rgb(201 151 52 / 12%); box-shadow: inset 0 0 0 1px rgb(201 151 52 / 40%); }
:root[data-theme="dark"] .source-tag.is-gobernarte { color: #e7c27a; background: rgb(231 194 122 / 10%); box-shadow: inset 0 0 0 1px rgb(231 194 122 / 35%); }
.source-link { font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.source-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.state-survey-select {
  max-width: min(520px, 100%); min-height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600;
}
/* Segunda opción con varios careos: los candidatos de cada uno. */
/* Carrusel de careos: flechas, botones, barra de tiempo y deslizamiento. */
.careo-carousel { display: grid; gap: 14px; }
.careo-carousel-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.careo-carousel-arrow { flex: none; width: 38px; height: 38px; font-size: 18px; }
.careo-carousel-viewport { overflow: hidden; }
.careo-carousel-slide { display: grid; gap: 16px; }
.careo-carousel-slide.is-from-right { animation: careo-in-right .55s cubic-bezier(.2, .8, .2, 1) both; }
.careo-carousel-slide.is-from-left { animation: careo-in-left .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes careo-in-right { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes careo-in-left { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .careo-carousel-slide { animation: none !important; } }
.sc-scenario-names { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 650; color: var(--ink);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); }
/* Vista previa de «Firmeza de la decisión» (usuario «Sólo GS», sin datos todavía): el diseño sin cifras. */
.firm-preview { display: grid; gap: 16px; }
.firm-preview-banner { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-2);
  border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.firm-preview-banner strong { color: var(--ink); margin-right: 4px; }
.firm-preview-body, .firm-preview-scenario { display: grid; gap: 16px; }
.firm-preview-switch { justify-self: start; }
.firm-preview-people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); }
.firm-preview-people-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.firm-preview-person { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.firm-preview-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.firm-preview-stat { display: grid; gap: 4px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 14%, transparent), transparent 70%), var(--surface); }
.firm-preview-stat.is-firm { --tone: #1f9d74; }
.firm-preview-stat.is-soft { --tone: #d6455a; }
.firm-preview-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--tone); }
.firm-preview-value { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--muted); }
.firm-preview-sub { font-size: 12px; color: var(--muted); }
.firm-preview-scale { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.firm-preview-end { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.firm-preview-track { height: 8px; border-radius: 999px; opacity: .55;
  background: linear-gradient(90deg, #1f9d74, #6fb34a, #d7a531, #e2763a, #d6455a); }
.firm-preview-cards { margin-top: 0; }
.firm-preview-card .place-medal { min-width: 0; white-space: nowrap; }
.firm-preview-card .place-name { min-height: 2.5em; }
.firm-preview-card .place-pct { color: var(--muted); }
.firm-preview-dash { font-size: 26px; font-weight: 800; color: var(--muted); }
.firm-preview-card .place-track { stroke: color-mix(in srgb, var(--party) 45%, transparent); stroke-dasharray: 3 6; }
/* Con datos: anillos llenos, el número al centro con el color de la respuesta y la escala partida en tramos. */
.firm-preview-card.has-data .place-track { stroke: color-mix(in srgb, var(--party) 16%, transparent); stroke-dasharray: none; }
.firm-preview-card.has-data .firm-preview-dash { color: var(--party); font-size: 30px; }
.firm-preview-unit { margin-left: 2px; font-size: .5em; font-weight: 700; }
.firm-preview-card.has-data .place-pct { color: var(--ink); }
.has-data .firm-preview-value { color: var(--tone); }
.firm-preview-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.firm-preview-fill { display: block; height: 100%; border-radius: 999px; background: var(--tone); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.firm-preview-track.is-data { display: flex; height: 14px; opacity: 1; gap: 2px; background: none; }
.firm-preview-part { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
@media (max-width: 560px) { .firm-preview-summary { grid-template-columns: minmax(0, 1fr); } }
/* Dato ajustado a petición del cliente (no es el de la encuesta): nota visible bajo la gráfica. */
.adjust-note { padding: 8px 12px; border-radius: 10px; color: var(--warn-ink); background: color-mix(in srgb, var(--warn-ink) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn-ink) 30%, transparent); }
:root[data-theme="dark"] .adjust-note { color: #f0b54a; }
/* Vista previa de segunda opción: barras vacías punteadas y «— %» tenue. */
.sc-preview .sc-track { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--party) 40%, transparent) 0 6px, transparent 6px 12px); opacity: .7; }
.sc-preview .sc-item-pct { color: var(--muted); }
/* Vista previa de expectativa de triunfo y antivoto: un anillo vacío por aspirante, con su foto. */
.cand-preview-question { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.cand-preview-cards { margin-top: 0; }
.cand-preview-card .place-medal { min-width: 0; white-space: nowrap; }
.cand-preview-card .place-pct { color: var(--muted); }
.cand-preview-card .place-track { stroke-dasharray: 3 6; }
/* Con datos: anillos llenos, el porcentaje fuerte, el 1.º resaltado y «No sabe» en gris. */
.cand-preview-card.has-data .place-track { stroke-dasharray: none; }
.cand-preview-card.has-data .place-pct { color: var(--ink); font-size: 24px; }
.cand-preview-card.is-top { border-color: color-mix(in srgb, var(--party) 45%, var(--line)); }
.cand-preview-card.is-top .place-medal { background: var(--ink); color: var(--surface-solid); border-color: var(--ink); }
.cand-preview-card.is-rest .place-name, .cand-preview-card.is-rest .place-pct { color: var(--muted); }
.cand-preview-card.is-rest .firm-preview-dash { font-size: 30px; }
/* Cruces del usuario «Sólo GS»: la pregunta fija, sin selector. */
.cross-question { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ink); }
/* Fechas de la encuesta cuando no hay selector (una sola encuesta, o el usuario «Sólo GS»). */
.state-dates { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-solid); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* «Sólo GS»: sin el estado de Odiseo ni su actividad. */
body[data-role="gs"] #sync, body[data-role="gs"] #notif-button, body[data-role="gs"] #notif-panel { display: none !important; }
/* «Sólo Simulación 2027»: sin notificaciones. */
body[data-role="simulacion"] #notif-button, body[data-role="simulacion"] #notif-panel { display: none !important; }
.party-generic { background: var(--surface-2); color: var(--muted); }
.party-generic svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.source-tag.is-odiseo { color: #1f8f7a; background: rgb(31 143 122 / 10%); box-shadow: inset 0 0 0 1px rgb(31 143 122 / 35%); }
:root[data-theme="dark"] .source-tag.is-odiseo { color: #5fd6ae; background: rgb(95 214 174 / 10%); box-shadow: inset 0 0 0 1px rgb(95 214 174 / 35%); }
.mini-sub .source-tag { padding: 1px 7px; font-size: 10.5px; }
.surveys-table td .source-tag { font-size: 11px; }

/* Ranking de aprobación de alcaldes y «¿Votaría por …?» (GobernArte): diseño sobrio, sin bordes de color;
   el color sólo en las barras, los anillos y un punto. */
.qcard-ranking, .qcard-yesno { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
:is(.mayor-ranking, .yesno-chart, .ranking-summary) { --tone-high: #1f9d78; --tone-mid: #c98f1e; --tone-low: #d9475f; --tone-rest: color-mix(in srgb, var(--muted) 55%, transparent); }
:root[data-theme="dark"] :is(.mayor-ranking, .yesno-chart, .ranking-summary) { --tone-high: #3fd0a0; --tone-mid: #f0b54a; --tone-low: #ff6b86; }

/* Resumen del ranking: tres cifras en filas limpias. */
.ranking-summary { display: grid; margin-top: 8px; }
.ranking-stat { --tone: var(--muted); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; row-gap: 2px; padding: 14px 0; border-top: 1px solid var(--line); }
.ranking-stat.is-high { --tone: var(--tone-high); } .ranking-stat.is-mid { --tone: var(--tone-mid); } .ranking-stat.is-low { --tone: var(--tone-low); }
.ranking-stat-label { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ranking-stat-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.ranking-stat-value { grid-row: span 2; font-size: 26px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ranking-stat-detail { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ranking-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ranking-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.ranking-key { display: inline-flex; align-items: center; gap: 6px; }
.ranking-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone-high); }
.ranking-key.is-mid .ranking-dot { background: var(--tone-mid); }
.ranking-key.is-low .ranking-dot { background: var(--tone-low); }

/* Lista de alcaldes: filas sin marco, separadas por líneas finas. */
.mayor-list { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 36px; }
.mayor-list.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mayor-row {
  --tone: var(--tone-high); display: grid; grid-template-columns: 22px 42px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 7px;
  padding: 12px 4px; border-bottom: 1px solid var(--line); animation: candidate-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s);
  transition: background-color .2s ease;
}
.mayor-row:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.mayor-row.is-mid { --tone: var(--tone-mid); } .mayor-row.is-low { --tone: var(--tone-low); }
.mayor-rank { grid-row: span 2; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.mayor-photo { grid-row: span 2; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.mayor-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.mayor-initials { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mayor-who { display: grid; gap: 1px; min-width: 0; }
.mayor-name { font-size: 13.5px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayor-place { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayor-value { font-size: 17px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 6px; }
.mayor-track { grid-column: 3 / -1; display: block; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.mayor-fill { display: block; height: 100%; border-radius: inherit; background: var(--tone); transition: width .9s cubic-bezier(.2, .8, .2, 1); }

/* «¿Votaría por …?»: anillo delgado y leyenda limpia. */
.yesno-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 44px; }
.yesno-ring .donut-track { stroke: color-mix(in srgb, var(--muted) 14%, transparent); }
.yesno-ring .donut-seg { stroke-linecap: round; }
.yesno-center { display: grid; justify-items: center; gap: 2px; }
.yesno-center strong { font-size: 32px; font-weight: 750; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.yesno-center span { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.yesno-side { display: grid; gap: 18px; max-width: 460px; }
.yesno-legend { list-style: none; margin: 0; padding: 0; display: grid; }
.yesno-legend li { --tone: var(--tone-rest); display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.yesno-legend li:first-child { padding-top: 0; }
.yesno-legend li.is-yes { --tone: var(--tone-high); } .yesno-legend li.is-no { --tone: var(--tone-low); }
.yesno-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); align-self: center; }
.yesno-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.yesno-value { font-size: 22px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.yesno-legend li.is-other .yesno-value { font-size: 18px; color: var(--muted); }
.yesno-balance { justify-self: start; display: inline-flex; align-items: baseline; gap: 10px; padding: 6px 14px; border-radius: 999px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.yesno-balance strong { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.yesno-balance .is-up { color: var(--tone-high); } .yesno-balance .is-down { color: var(--tone-low); }
@media (max-width: 1180px) { .mayor-list.is-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) { .qcard-ranking, .qcard-yesno { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .yesno-body { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; } .yesno-side { width: 100%; } }
/* El nombre del lugar no se recorta por la etiqueta «Entidad de la encuesta»: la etiqueta baja de renglón. */
.residence-name > span:first-child { flex-shrink: 0; white-space: normal; overflow-wrap: anywhere; }
.residence-home { white-space: nowrap; }

/* Distritos: al tocar un distrito se abre su ranking completo en una ventana. */
.district-item.is-clickable { cursor: pointer; border-radius: 8px; transition: background-color .15s ease; }
.district-item.is-clickable:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.district-item.is-clickable:focus-visible { outline: 2px solid var(--seq-4, var(--interpretar)); outline-offset: 2px; }
.dialog-open, .dialog-open body { overflow: hidden; }
.district-dialog-backdrop {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: rgb(4 8 12 / 62%); backdrop-filter: blur(4px); animation: insight-in .2s ease both;
}
.district-dialog {
  width: min(980px, 100%); max-height: min(88vh, 900px); overflow-y: auto; display: grid; gap: 18px; padding: 24px 26px 22px;
  border-radius: 20px; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--ink);
  box-shadow: 0 30px 80px rgb(0 0 0 / 45%); animation: insight-in .3s cubic-bezier(.2, .8, .2, 1) both;
}
.district-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.district-dialog-titles { display: grid; gap: 4px; min-width: 0; }
.district-dialog-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.district-dialog-title { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; text-transform: capitalize; }
.district-dialog-close { flex: none; width: 38px; height: 38px; font-size: 15px; }
.district-dialog-years { justify-self: start; }
.district-dialog-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.district-dialog-block { display: grid; gap: 12px; align-content: start; min-width: 0; }
.district-dialog-sub { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.district-dialog-sub:not(:first-child) { margin-top: 8px; }
.district-ranking { list-style: none; margin: 0; padding: 0; display: grid; }
.district-rank-row {
  --party: var(--neutral); display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 8px;
  padding: 13px 4px; border-bottom: 1px solid var(--line); animation: candidate-in .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s);
}
.district-rank-row:last-child { border-bottom: 0; }
.district-rank-pos { grid-row: span 2; font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.district-rank-row.is-first .district-rank-pos { color: var(--ink); }
.district-rank-logos { display: inline-flex; align-items: center; }
.district-rank-logos .party-logo { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--surface-solid); }
.district-rank-logos .party-logo + .party-logo { margin-left: -8px; }
.district-rank-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--party, var(--neutral)); }
.district-rank-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.district-rank-name strong { font-size: 14.5px; font-weight: 650; }
.district-rank-row.is-first .district-rank-name strong { font-size: 16px; font-weight: 750; }
.district-rank-badge { padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.district-rank-badge.is-alliance { color: var(--ink); background: color-mix(in srgb, var(--seq-4, #2a63c8) 16%, transparent); }
.district-rank-pct { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.district-rank-row.is-first .district-rank-pct { font-size: 20px; }
.district-rank-track { grid-column: 2 / -1; display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.district-rank-fill { display: block; height: 100%; border-radius: inherit; background: var(--party); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.district-dialog-stats { display: grid; }
.district-dialog-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.district-dialog-stat span { font-size: 13px; color: var(--ink-2); }
.district-dialog-stat strong { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.district-dialog-stat em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--muted); }
.district-dialog-stat.is-won strong { color: var(--approve); }
.district-dialog-stat.is-uphill strong { color: var(--disapprove); }
.district-party-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.district-party-list li { --party: var(--neutral); display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.district-party-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.district-party-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.district-party-name .party-logo { width: 20px; height: 20px; flex: none; }
.district-party-track { display: block; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.district-party-fill { display: block; height: 100%; border-radius: inherit; background: var(--party); }
.district-party-list strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.district-dialog-note { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }
@media (max-width: 820px) {
  .district-dialog { padding: 18px; }
  .district-dialog-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { .district-dialog, .district-dialog-backdrop, .district-rank-row { animation: none; } }

/* Simulación de gubernaturas 2027: mapa a la izquierda y el resultado de la entidad elegida a la derecha. */
.sim-page {
  --sim-off: color-mix(in srgb, var(--muted) 10%, transparent); --sim-empty: color-mix(in srgb, var(--muted) 24%, transparent);
  --sim-tie: #94a3b8; --sim-light: #dfe7ef; --sim-deep: #1f3f78; --sim-change: #c2410c; --sim-keep: #64748b;
}
:root[data-theme="dark"] .sim-page { --sim-light: #1d2c3a; --sim-deep: #8fc2ff; --sim-change: #fb923c; --sim-keep: #94a3b8; }
.sim-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
.sim-left { display: grid; gap: 16px; min-width: 0; }

/* Mapa */
.sim-map-card { display: grid; gap: 12px; padding: 18px 20px; }
.sim-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sim-map .map-canvas svg { width: 100%; height: auto; display: block; }
.sim-state.is-off { cursor: default; }
.sim-state.is-off:hover { stroke: var(--map-stroke); stroke-width: 1; }
.sim-tie-overlay { stroke: none; }
.sim-hatch-line { fill: rgb(255 255 255 / 55%); }
:root[data-theme="dark"] .sim-hatch-line { fill: rgb(0 0 0 / 40%); }
.sim-legend .swatch.is-tie { background: repeating-linear-gradient(135deg, var(--ink-2) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Gubernaturas proyectadas */
.sim-seats { display: grid; gap: 12px; padding: 16px 20px; }
.sim-seat-bar { display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); gap: 4px; }
.sim-seat { display: block; height: 26px; border-radius: 6px; background: var(--seat); }
.sim-seat.is-tie { background: repeating-linear-gradient(135deg, var(--sim-tie) 0 5px, color-mix(in srgb, var(--sim-tie) 50%, transparent) 5px 10px); }
.sim-seat-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-2); }
.sim-seat-legend li { display: inline-flex; align-items: center; gap: 7px; }
.sim-seat-legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.sim-swatch { width: 10px; height: 10px; border-radius: 3px; }
.sim-swatch.is-tie { background: repeating-linear-gradient(135deg, var(--sim-tie) 0 3px, transparent 3px 6px) !important; }

/* Panel de la entidad elegida */
.sim-detail { padding: 0; }
.sim-detail-body { display: grid; gap: 18px; padding: 20px 22px; animation: insight-in .3s cubic-bezier(.2, .8, .2, 1) both; }
.sim-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sim-detail-kicker { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sim-detail-title { margin: 2px 0 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.sim-governs { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 5%, transparent); white-space: nowrap; }
.sim-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.sim-donut .donut-track { stroke: color-mix(in srgb, var(--muted) 14%, transparent); }
.sim-donut-center { display: grid; justify-items: center; gap: 2px; }
.sim-donut-center .party-logo { width: 34px; height: 34px; margin-bottom: 4px; }
.sim-donut-center strong { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.sim-donut-center span { font-size: 11px; font-weight: 700; color: var(--muted); }
.sim-share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sim-share-list li { --party: var(--neutral); display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 5px; align-items: baseline; }
.sim-share-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sim-share-list strong { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sim-share-track { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.sim-share-fill { display: block; height: 100%; border-radius: inherit; background: var(--party); }
.sim-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.sim-fact { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sim-fact:nth-child(odd) { padding-right: 12px; }
.sim-fact:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.sim-fact span { font-size: 11px; color: var(--muted); }
.sim-fact strong { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-fact.is-tie strong { color: var(--muted); }
.sim-fact.is-change strong { color: var(--sim-change); }
.sim-fact.is-up strong { color: var(--approve); } .sim-fact.is-down strong { color: var(--disapprove); }
.sim-empty-text { margin: 0; padding: 14px 16px; border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 4%, transparent); }

/* Las 14 preguntas */
.sim-questions { display: grid; gap: 8px; }
.sim-questions-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sim-questions-head h3 { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sim-questions-head strong { font-size: 12.5px; color: var(--ink); }
.sim-question-list { list-style: none; margin: 0; padding: 0; display: grid; }
/* Recuadro a lo ancho, debajo del mapa: las 14 en dos columnas (01–07 y 08–14), sin deslizar. */
.sim-questions-card { padding: 18px 22px; }
.sim-questions-card .sim-questions { gap: 10px; }
.sim-questions-card .sim-question-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; column-gap: 36px; }
.sim-questions-card .sim-question:nth-child(7) { border-bottom: 0; }
.sim-question { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sim-question:last-child { border-bottom: 0; }
.sim-q-number { display: grid; place-items: center; width: 26px; height: 22px; border-radius: 6px; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--surface-solid); background: var(--ink-2); }
.sim-q-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.sim-answer { display: grid; justify-items: end; text-align: right; min-width: 0; }
.sim-answer strong { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sim-answer span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sim-question.is-no .sim-q-number, .sim-question.is-pausa .sim-q-number { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.sim-question.is-no .sim-q-label, .sim-question.is-no .sim-answer strong,
.sim-question.is-pausa .sim-q-label, .sim-question.is-pausa .sim-answer strong { color: var(--muted); font-weight: 500; }
.sim-source { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.sim-open { justify-self: start; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; }
.sim-open:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tabla de las 17 entidades */
.sim-table-card { display: grid; gap: 6px; padding: 18px 20px; }
.sim-table td, .sim-table th { white-space: nowrap; }
.sim-row { cursor: pointer; transition: background-color .15s ease; }
.sim-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.sim-row.is-current { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.sim-row.is-current .sim-row-name { font-weight: 800; }
.sim-row-name { font-weight: 650; }
.sim-row-note { color: var(--muted); font-size: 12.5px; }
.sim-party { display: inline-flex; align-items: center; gap: 6px; }
.sim-status { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sim-status.is-clara { color: var(--ink); background: color-mix(in srgb, var(--ink) 11%, transparent); }
.sim-status.is-tie { color: var(--muted); }

@media (max-width: 1100px) {
  .sim-layout { grid-template-columns: minmax(0, 1fr); }
  .sim-questions-card .sim-question-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .sim-questions-card .sim-question:nth-child(7) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .sim-chart { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .sim-share-list { width: 100%; }
  .sim-seat-bar { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .sim-detail-body { animation: none; } }
/* Foto de quien encabeza: llena el hueco de la dona (sólo una línea fina entre la foto y el anillo), a cualquier
   tamaño de la dona (normal 248 px, compacta 176 px y en el celular). */
.result-hero .result-donut .rank-visual.is-hero .avatar { width: calc(var(--size) * .871 - 12px); height: calc(var(--size) * .871 - 12px); }
.result-hero.is-compact .result-donut .rank-visual.is-hero .avatar,
.qgrid-people .result-hero.is-compact .result-donut .rank-visual.is-hero .avatar { width: calc(var(--size) * .852 - 12px); height: calc(var(--size) * .852 - 12px); }
.result-hero .result-donut .rank-visual.is-hero .avatar.has-photo { background: var(--surface-solid, var(--surface)); }
/* El porcentaje de cada fila nunca se parte en dos renglones; si falta espacio se recorta el nombre. */
.result-row-pct { white-space: nowrap; flex: none; }
.result-row-who { min-width: 0; }

/* ---------------------------------------------------------------- clientes: mapa sólo con sus entidades */
.map-state.is-locked { cursor: default; opacity: .35; }
.map-state.is-locked.is-painted { opacity: 1; }
.map-state.is-locked:hover { stroke: var(--map-stroke); stroke-width: 1.1; filter: none; }
svg.is-hovering .map-state.is-locked { filter: none; }
.client-row { align-items: start; }
.client-ranking { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 5px; }
.client-rank { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12.5px; }
.client-rank-pos { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.client-rank .avatar { width: 26px; height: 26px; font-size: 9.5px; }
.client-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-rank-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.client-open { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.client-row:hover .client-open { color: var(--ink); }

/* ---------------------------------------------------------------- resultados generales de la entidad */
.mia-tab-general { --tone: var(--medir); }
.mia-tab-general .mia-word { color: var(--muted); }
.mia-tab-general:hover .mia-word, .mia-tab-general[aria-current] .mia-word { color: var(--ink); }
.general { display: grid; gap: 16px; }
.general-head { display: grid; gap: 4px; }
.general-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.general-note, .general-card-note { margin: 0; font-size: 13px; color: var(--muted); }
.general-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.general-stat { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.general-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.general-stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.general-stat-detail { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.general-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.general-card { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.general-card-title { margin: 0; font-size: 16px; font-weight: 700; }
.general-card-foot { margin: 0; font-size: 12px; color: var(--muted); }
.general-table-wrap { overflow-x: auto; }
.general-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.general-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.general-table td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.general-table tr:last-child td { border-bottom: 0; }
.general-table tbody tr { cursor: pointer; }
.general-table tbody tr:hover { background: var(--surface-2); }
.general-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.general-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.general-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- vista completa de un distrito (INE) */
.district-stepper { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.state-crumbs .district-stepper + .state-print { margin-left: 0; }
.district-band.is-won { color: var(--approve); }
.district-band.is-close { color: var(--warn-ink); }
:root[data-theme="dark"] .district-band.is-close { color: #f0b54a; }
.district-band.is-uphill { color: var(--disapprove); }
.source-tag.is-ine { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.district-years { margin-left: 4px; }
.state-warning { margin: 10px 0 0; font-size: 13px; color: var(--warn-ink); }
:root[data-theme="dark"] .state-warning { color: #f0b54a; }
.brief-card.is-won .brief-value { color: var(--approve); }
.brief-card.is-close .brief-value { color: var(--warn-ink); }
:root[data-theme="dark"] .brief-card.is-close .brief-value { color: #f0b54a; }
.brief-card.is-uphill .brief-value { color: var(--disapprove); }
.district-duel { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.district-duel-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.district-duel-side { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.district-duel-side.is-them { justify-items: end; text-align: right; }
.district-duel-logos { display: flex; gap: 6px; }
.district-duel-logos .party-logo { width: 40px; height: 40px; }
.district-duel-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.district-duel-pct { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--party, var(--ink)); }
.district-duel-vs { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.district-duel-bar { display: flex; gap: 4px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--track); }
.district-duel-fill { display: block; height: 100%; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.district-duel-fill.is-them { margin-left: auto; }
.district-turnout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.district-turnout-center { display: grid; justify-items: center; gap: 2px; }
.district-turnout-center strong { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.district-turnout-center span { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  .district-turnout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .district-duel-pct { font-size: 28px; }
  .district-stepper { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .district-duel-fill { transition: none; } }

/* ---------------------------------------------------------------- simulación: distritos de la alianza */
.sim-scope { justify-self: start; margin-top: 6px; }
.sim-scope-note { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.sim-scope-sources { display: grid; gap: 4px; }
.sim-district-chips { display: grid; gap: 8px; padding: 4px 4px 2px; }
.sim-chips-title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sim-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px;
}
.sim-chip strong { font-variant-numeric: tabular-nums; }
.sim-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sim-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.sim-margin { font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-margin.is-won { color: var(--approve); }
.sim-margin.is-close { color: var(--warn-ink); }
:root[data-theme="dark"] .sim-margin.is-close { color: #f0b54a; }
.sim-margin.is-uphill { color: var(--disapprove); }
.sim-chip.has-status { box-shadow: inset 3px 0 0 var(--chip); }
.sim-chip.has-status[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--chip), inset 0 0 0 1px var(--ink); }
/* Simulación de distritos: cómo se calculó (base del INE + cambio de las encuestas) */
.sim-model { display: grid; gap: 8px; }
.sim-model-title { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sim-model-steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.sim-model-step { counter-increment: step; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sim-model-step:last-child { border-bottom: 0; }
.sim-model-step::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 800; color: var(--surface-solid); background: var(--ink-2); }
.sim-model-text { display: grid; gap: 2px; min-width: 0; }
.sim-model-label { font-size: 13px; font-weight: 650; color: var(--ink); }
.sim-model-note { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.sim-model-value { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.sim-model-step.is-up .sim-model-value { color: var(--approve); }
.sim-model-step.is-down .sim-model-value { color: var(--disapprove); }
.sim-warning { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: color-mix(in srgb, var(--warn-ink) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn-ink) 30%, transparent); }
.sim-status.is-orientativa { color: var(--warn-ink); }
.sim-status.is-gana { color: var(--approve); box-shadow: inset 0 0 0 1px currentColor; }
.sim-status.is-empate { color: var(--muted); }
.sim-status.is-pierde { color: var(--disapprove); box-shadow: inset 0 0 0 1px currentColor; }
.sim-share-name { display: inline-flex; align-items: center; gap: 4px; }
.sim-share-name .party-logo { width: 16px; height: 16px; }
.sim-tracking { display: grid; gap: 10px; padding: 18px 22px; }
.sim-tracking .side-note { margin: 0; }
.sim-track-wrap { overflow-x: auto; }
.sim-track-chart { width: 100%; min-width: 420px; height: auto; display: block; }
.sim-track-zero { stroke: var(--line-strong); stroke-width: 1; }
.sim-track-ref { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.sim-track-axis { font-size: 11px; fill: var(--muted); }
.sim-track-line { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.sim-track-dot { stroke: var(--surface); stroke-width: 2; }
.sim-track-dot.is-up { fill: var(--approve); }
.sim-track-dot.is-down { fill: var(--disapprove); }
.sim-track-value { font-size: 12px; font-weight: 700; fill: var(--ink); }
.sim-track-line.is-projected { stroke-dasharray: 6 5; }
.sim-track-range { fill: color-mix(in srgb, var(--ink-2) 14%, transparent); stroke: color-mix(in srgb, var(--ink-2) 35%, transparent); }
.sim-track-dot.is-projected { stroke-width: 3; }

/* Simulación 2027: página de un distrito (misma vista que un distrito de la alianza) */
.sim-district-page .sim-detail-body.is-plain { padding: 0; animation: none; }
.sim-district-page .sim-tracking { margin-top: 14px; padding: 16px 18px; box-shadow: none; }
.sim-timeline { display: grid; gap: 8px; }
.sim-origin { margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1px solid var(--line); }
.sim-origin-link { margin-left: auto; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.sim-origin-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.alliance-page .district-item .duel-legend .sim-duel-before { color: var(--ink-2); font-weight: 600; }
.sim-track-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sim-track-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sim-track-list li:last-child { border-bottom: 0; }
.sim-track-date { font-weight: 600; min-width: 64px; }
.sim-track-n { color: var(--muted); margin-left: auto; }
.sim-question.is-poca .sim-q-number { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.sim-question.is-poca .sim-q-label { color: var(--muted); }
.sim-question.is-poca .sim-answer strong { color: var(--warn-ink); font-weight: 600; }
:root[data-theme="dark"] .sim-question.is-poca .sim-answer strong { color: #f0b54a; }

/* Resumen con apartados: calificación global, calificación presidencial, partidos, careos y firmeza, en la misma hoja. */
.sheet-part { display: grid; gap: 14px; min-width: 0; }
.sheet-part + .sheet-part { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.sheet-part-head { display: grid; gap: 6px; }
.sheet-part-head::after { content: ""; order: 1; width: 44px; height: 3px; border-radius: 3px; background: var(--approve); }
.sheet-part-title { margin: 0; font-size: clamp(22px, 2vw, 27px); font-weight: 700; line-height: 1.15; color: var(--ink); }
.sheet-part-note { order: 2; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.sheet-resumen > .sheet-part:first-child { margin-top: 2px; }
.careo-list { display: grid; gap: 16px; }
.careo-item { display: grid; gap: 10px; min-width: 0; }
.careo-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.careo-item-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.careo-item-n { font-size: 12px; color: var(--muted); }
/* Firmeza de la decisión justo debajo de su careo (Michoacán, Sinaloa, Zacatecas). */
.careo-firm { display: grid; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.careo-firm-title { margin: 0; font-size: 13px; font-weight: 700; }
.careo-list:has(.careo-firm) { gap: 28px; }
/* Nombres largos en las barras del resultado: se cortan con «…» en lugar de salirse de la tarjeta (celular). */
.result-row-body { grid-template-columns: minmax(0, 1fr); }
.result-row-name, .result-row-party { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.result-row-pct { flex: none; }

/* ------------------------------------------------ tipografía de títulos
   Manrope (SIL Open Font License; fontsource 5.2.8, en assets/fonts): sans geométrica de paneles para títulos y subtítulos.
   Los textos, las cifras y las etiquetas siguen en Inter, que se lee mejor en tamaños chicos y tiene números tabulares. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root { --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif; }
:is(.state-title, .page-title, .section-title, .sheet-part-title, .insight-title, .card-title, .side-title, .general-title,
  .result-name, .duo-title, .sim-detail-title, .district-dialog-title) {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
}
.state-hero .state-title { font-size: clamp(32px, 3.4vw, 44px); letter-spacing: -.03em; line-height: 1.05; }
.section-title { font-size: clamp(22px, 2vw, 26px); }
.sheet-part-title { font-size: clamp(22px, 2vw, 26px); }
.insight-title { font-size: 21px; }
.result-hero.is-compact .result-name { font-size: clamp(20px, 1.8vw, 25px); }
.duo-title { font-size: 17px; text-transform: none; letter-spacing: -.01em; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.result-foot, .duo-question { color: var(--ink-2); }
/* Notas bajo los títulos («Todos los aspirantes en orden…»): subtítulo en Manrope, más grande y claro, con un halo del color del
   fondo que lo despega del mapa sin taparlo. */
:is(.section-note, .sheet-part-note) {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(15px, 1.15vw, 16.5px); line-height: 1.5; letter-spacing: -.005em;
  color: var(--ink-2); text-shadow: 0 0 10px rgb(255 255 255 / 95%), 0 0 2px rgb(255 255 255 / 90%);
}
:root[data-theme="dark"] :is(.section-note, .sheet-part-note) { color: var(--ink); text-shadow: 0 1px 2px rgb(5 11 17 / 95%), 0 0 14px rgb(5 11 17 / 90%); }

/* Firmeza de la decisión: los colores de siempre, del verde (más firme) al rojo (menos firme), con textos más claros. */
:root { --firm-1: #1f9d74; --firm-2: #6fb34a; --firm-3: #d7a531; --firm-4: #e2763a; --firm-5: #d6455a; }
.firm-preview-stat.is-firm { --tone: #1f9d74; }
.firm-preview-stat.is-soft { --tone: #d6455a; }
.firm-preview-stat { gap: 6px; padding: 18px 20px; }
.firm-preview-label { font-size: 12.5px; letter-spacing: .08em; color: var(--tone); }
.firm-preview-sub { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.firm-preview-value { font-size: 40px; }
.firm-preview-fill { background: var(--tone); }
.firm-preview-end { font-size: 12.5px; color: var(--ink-2); }
.firm-preview-track { background: linear-gradient(90deg, var(--firm-1), var(--firm-2), var(--firm-3), var(--firm-4), var(--firm-5)); }
.firm-preview-howto { margin: -4px 0 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.firm-preview-people-label { color: var(--ink-2); }
.firm-preview-card .place-medal { font-size: 12.5px; }
.firm-preview-card .place-name { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.firm-preview-card.has-data .firm-preview-dash { font-size: 32px; }


/* Resumen: «Clima social y aprobación» en la mitad izquierda (en lugar del candidato). La misma tarjeta de su tema, ajustada a
   media pantalla: foto y anillos lado a lado mientras quepan; en un recuadro angosto, la foto arriba y los anillos abajo. */
.duo-panel.is-aprobacion { --lead: var(--approve); }
.duo-approval { container-type: inline-size; min-width: 0; padding: 16px 18px 18px; display: grid; align-content: start; }
.duo-approval .qlist, .duo-approval .qgrid { gap: 12px; }
.duo-approval .qcarousel { gap: 12px; }
.duo-approval .qcarousel-tab-name { font-size: 12px; }
.duo-approval .qcard-split { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 0; }
.duo-approval .approval-cover { min-height: 380px; border-radius: var(--radius) 0 0 var(--radius); }
.duo-approval .qcard-approval.has-cover > .party-charts { padding: 16px 16px 16px 18px; border-left: 0; border-top: 0; }
.duo-approval .approval-cover .profile-name { font-size: 21px; }
.duo-approval .cover-caption { padding: 16px 18px 18px; }
.duo-approval .approval-title { gap: 8px; }
.duo-approval .approval-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.duo-approval .approval-podium { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; padding-top: 10px; }
.duo-approval .approval-card { padding: 18px 10px 14px; }
.duo-approval .approval-card .place-figure { width: min(120px, 100%); }
.duo-approval .approval-card.is-1 .place-figure { width: min(140px, 100%); }
.duo-approval .approval-card .place-pct { font-size: 24px; }
.duo-approval .approval-card.is-1 .place-pct { font-size: 30px; }
/* Tres respuestas (con «Ni aprueba ni desaprueba»): las tres en una fila, más compactas. */
.duo-approval .approval-podium:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card { padding: 16px 6px 12px; }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card .place-figure { width: min(96px, 100%); }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card.is-1 .place-figure { width: min(112px, 100%); }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card .place-pct { font-size: 20px; }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card.is-1 .place-pct { font-size: 26px; }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-card .place-name { font-size: 12px; line-height: 1.25; }
.duo-approval .approval-podium:has(> :nth-child(3)) .approval-people { font-size: 10.5px; }
@container (max-width: 560px) {
  .duo-approval .qcard-split { grid-template-columns: minmax(0, 1fr); }
  .duo-approval .approval-cover { min-height: 240px; border-radius: var(--radius) var(--radius) 0 0; }
  .duo-approval .qcard-approval.has-cover > .party-charts { padding: 14px 14px 16px; }
}

/* «Segunda opción» con «Rechazo» y «Expectativa de triunfo» debajo, cada una separada por una línea. */
.sheet-electorado > .sheet-part, .sheet-segunda > .sheet-part { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
/* Segunda opción con anillos (Dinámica del voto): en cada grupo, una tarjeta con anillo por aspirante, como los podios. */
.sc-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 190px)); justify-content: center; gap: 10px; padding-top: 16px; }
.sc-rings .place-card { padding: 22px 10px 14px; }
.sc-rings .place-card .place-figure { width: min(120px, 100%); }
.sc-rings .place-name { font-size: 13.5px; }
.sc-rings .place-pct { font-size: 24px; }
.sc-rings .place-card:first-child .place-pct { color: color-mix(in srgb, var(--party) 70%, var(--ink)); }
:root[data-theme="dark"] .sc-rings .place-card:first-child .place-pct { color: color-mix(in srgb, var(--party) 55%, #fff); }
/* Apartados movidos de otra hoja (p. ej. «Cruces por perfil»): pueden encogerse al ancho de la hoja, como en su hoja propia. */
.mia-sheet:has(> .sheet-part) { grid-template-columns: minmax(0, 1fr); }
.sheet-part > * { min-width: 0; }
/* Careos de la segunda opción separados (uno debajo de otro): cada uno con su encabezado y una línea entre ellos. */
.sheet-part.is-segunda .sc-scenario + .sc-scenario { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.sheet-part.is-segunda .sc-scenario-names { font-size: 14px; }
/* En «Calificación global», siempre en el mismo orden: Aprueba, Desaprueba y, si hay, Ni aprueba ni desaprueba. */
.duo-approval .approval-card.is-aprueba { order: 1; }
.duo-approval .approval-card.is-desaprueba { order: 2; }
.duo-approval .approval-card.is-neutral { order: 3; }
/* Tarjeta extra del cliente en un podio («Ninguno»): gris, sin lugar, con un ícono en lugar de logo. */
.place-card.is-extra .place-name, .place-card.is-extra .place-pct { color: var(--ink-2); }
.extra-mark { display: grid; place-items: center; width: 52%; aspect-ratio: 1; border-radius: 50%; color: var(--muted);
  background: color-mix(in srgb, var(--neutral) 22%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong); }
.extra-mark svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.place-card.is-extra .place-medal { min-width: 0; white-space: nowrap; }

/* Vista de un cliente con logo (GS): el logo en lugar del título, en su versión clara u oscura según el tema. */
.client-logo-title { display: flex; align-items: center; line-height: 0; margin-bottom: 8px; }
.client-logo { display: block; height: clamp(58px, 6vw, 84px); width: auto; }
.client-logo.is-dark { display: none; }
:root[data-theme="dark"] .client-logo.is-light { display: none; }
:root[data-theme="dark"] .client-logo.is-dark { display: block; }
/* Texto bajo el logo: como las notas bajo los títulos (Manrope, más grande y claro, con halo para despegarlo del fondo). */
.client-page .client-note {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.5; letter-spacing: -.005em;
  color: var(--ink-2); max-width: 70ch; text-shadow: 0 0 10px rgb(255 255 255 / 95%), 0 0 2px rgb(255 255 255 / 90%);
}
:root[data-theme="dark"] .client-page .client-note { color: var(--ink); text-shadow: 0 1px 2px rgb(5 11 17 / 95%), 0 0 14px rgb(5 11 17 / 90%); }
/* Logo del cliente encima de sus entidades: no recibe el cursor (el clic y el tooltip son de la entidad de abajo). */
.map-mark { pointer-events: none; filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 45%)); }
.map-enter .map-mark { animation: marca-entra .5s ease .6s both; }
@keyframes marca-entra { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .map-enter .map-mark { animation: none; } }
