    
    :root, [data-theme="light"] {
      --bg: #f7f5f0;
      --surface: #ffffff;
      --surface-2: #f1ede4;
      --surface-3: #e8e2d3;
      --ink-1: #14120f;
      --ink-2: #5a574f;
      --ink-3: #9a9689;
      --border: rgba(20,18,15,0.08);
      --border-strong: rgba(20,18,15,0.14);
      --shadow-sm: 0 1px 2px rgba(20,18,15,.04), 0 1px 3px rgba(20,18,15,.02);
      --shadow-md: 0 2px 8px rgba(20,18,15,.05), 0 8px 24px rgba(20,18,15,.04);
      --accent: #D91023;
      --accent-soft: #FBE6E8;
      --accent-ink: #8C0A16;
      --teal: #0F766E;
      --teal-soft: #CCFBEF;
      --c-fuji: #D87E2A;
      --c-rla: #2F6FD4;
      --c-nieto: #1A9C75;
      --c-belm: #8856C3;
      --c-sanch: #D42D3E;
    }
    [data-theme="dark"] {
      --bg: #0e0d0b;
      --surface: #1a1816;
      --surface-2: #242220;
      --surface-3: #2f2c28;
      --ink-1: #f3efe5;
      --ink-2: #a8a398;
      --ink-3: #6b6659;
      --border: rgba(255,255,255,0.08);
      --border-strong: rgba(255,255,255,0.14);
      --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
      --shadow-md: 0 2px 8px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.3);
      --accent-soft: rgba(217,16,35,0.14);
      --teal-soft: rgba(15,118,110,0.18);
      --c-fuji: #E89040;
      --c-rla: #5A94E0;
      --c-nieto: #2ECC9E;
      --c-belm: #A776D8;
      --c-sanch: #E5474F;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--ink-1);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      transition: background .35s ease, color .35s ease;
    }
    button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
    svg { display: block; }
    ::selection { background: var(--accent); color: white; }

    .wrap { max-width: 1440px; margin: 0 auto; padding: 24px 32px 40px; }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 18px 0;
      border-bottom: 1px solid var(--border);
      margin-bottom: 28px;
      gap: 20px;
      flex-wrap: wrap;
    }
    .brand { display: flex; align-items: center; gap: 14px; }
    .brand-flag {
      width: 36px; height: 24px; border-radius: 4px;
      background: linear-gradient(to right,
        var(--accent) 0 33%,
        #ffffff 33% 67%,
        var(--accent) 67% 100%);
      border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-sm);
    }
    [data-theme="dark"] .brand-flag { border-color: rgba(255,255,255,.15); }
    .brand-meta { line-height: 1.15; }
    .brand-name {
      font-family: 'Fraunces', serif;
      font-weight: 700;
      font-size: 19px;
      letter-spacing: -0.02em;
    }
    .brand-sub {
      font-size: 11px;
      color: var(--ink-3);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      font-weight: 500;
    }

    .tabs {
      display: inline-flex;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 3px;
      gap: 2px;
      box-shadow: var(--shadow-sm);
    }
    .tab {
      padding: 8px 18px;
      border-radius: 7px;
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-2);
      transition: all .18s ease;
      display: inline-flex;
      align-items: center;
      gap: 7px;
    }
    .tab:hover { color: var(--ink-1); }
    .tab.active {
      background: var(--ink-1);
      color: var(--surface);
    }
    .tab svg { width: 14px; height: 14px; }

    .actions { display: flex; align-items: center; gap: 10px; }
    .btn {
      display: inline-flex; align-items: center; gap: 7px;
      padding: 9px 14px;
      border-radius: 8px;
      font-weight: 600;
      font-size: 12.5px;
      transition: all .18s ease;
      border: 1px solid transparent;
    }
    .btn-ghost {
      background: var(--surface);
      color: var(--ink-2);
      border-color: var(--border);
    }
    .btn-ghost:hover { background: var(--surface-2); color: var(--ink-1); }
    .btn-primary {
      background: var(--accent);
      color: white;
    }
    .btn-primary:hover { background: var(--accent-ink); }
    .btn svg { width: 13px; height: 13px; }
    .btn.loading svg { animation: spin 1s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    .theme-toggle {
      width: 36px; height: 36px;
      border-radius: 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--ink-2);
      transition: background .18s ease;
    }
    .theme-toggle:hover { background: var(--surface-2); color: var(--ink-1); }
    .theme-toggle svg { width: 15px; height: 15px; }

    .status {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--ink-3);
      min-height: 14px;
      margin: -20px 0 18px;
    }
    .status.ok { color: var(--teal); }
    .status.err { color: var(--accent); }

    .page { display: none; animation: fadeIn .3s ease; }
    .page.active { display: block; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

    .hero-strip {
      display: grid;
      grid-template-columns: minmax(320px, 420px) 1fr;
      gap: 16px;
      margin-bottom: 20px;
    }
    .hero-main {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 24px 28px;
      border-radius: 16px;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-md);
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .hero-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.18em;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .hero-label::before, .hero-label::after {
      content: '';
      width: 24px;
      height: 1px;
      background: var(--accent);
      opacity: 0.4;
    }
    @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
    .hero-number {
      font-family: 'JetBrains Mono', monospace;
      font-size: 64px;
      font-weight: 700;
      line-height: 1;
      letter-spacing: -0.03em;
      margin: 10px 0 4px;
      background: linear-gradient(90deg, #D91023 0%, #E8943A 35%, #B55C1C 65%, #D91023 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .hero-number .sign {
      font-size: 38px;
      font-weight: 500;
      letter-spacing: -0.01em;
    }
    .hero-sub {
      font-size: 12px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .hero-meta {
      margin-top: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 11.5px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .hero-meta .live-dot {
      width: 7px; height: 7px; border-radius: 50%;
      background: var(--teal);
      animation: pulse 2s ease-in-out infinite;
    }
    .hero-meta span { font-family: 'Inter', sans-serif; }
    .hero-ts {
      margin-top: 6px;
      font-size: 12px;
      color: var(--teal);
      font-weight: 600;
      text-align: center;
    }
    .hero-ts:empty { display: none; }

    .hero-meta-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }
    .hm-cell {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 22px 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 8px;
      box-shadow: var(--shadow-sm);
      transition: box-shadow .2s ease, transform .2s ease;
      min-height: 160px;
    }
    .hm-cell:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
    }
    .hm-label {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--ink-3);
    }
    .hm-value {
      font-family: 'JetBrains Mono', monospace;
      font-size: 32px;
      font-weight: 700;
      color: var(--ink-1);
      line-height: 1;
      letter-spacing: -0.03em;
    }
    .hm-value.accent { color: var(--accent); }
    .hm-sub {
      font-size: 11.5px;
      color: var(--ink-3);
      font-weight: 500;
      line-height: 1.4;
    }
    .hm-sub strong {
      color: var(--ink-1);
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
    }

    .cand-row {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 12px;
      margin-bottom: 20px;
    }
    .cand {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      position: relative;
      box-shadow: var(--shadow-sm);
      border-top: 3px solid var(--c-fuji);
      transition: transform .2s ease, box-shadow .2s ease;
    }
    .cand:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .cand-head {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
    }
    .cand-photo {
      width: 48px; height: 48px;
      border-radius: 50%;
      object-fit: cover;
      background: var(--surface-2);
      border: 2px solid currentColor;
      flex-shrink: 0;
    }
    .cand-title { min-width: 0; flex: 1; }
    .cand-rank {
      font-family: 'Fraunces', serif;
      font-size: 10.5px;
      font-style: italic;
      color: var(--ink-3);
      font-weight: 600;
    }
    .cand-name {
      font-size: 14px;
      font-weight: 700;
      color: var(--ink-1);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      letter-spacing: -0.01em;
      line-height: 1.2;
    }
    .cand-party {
      font-size: 10.5px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .cand-value {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }
    .cand-pct {
      font-family: 'JetBrains Mono', monospace;
      font-size: 26px;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1;
    }
    .cand-trend {
      display: inline-flex;
      align-items: center;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10.5px;
      font-weight: 600;
    }
    .cand-trend.up { color: var(--teal); }
    .cand-trend.down { color: var(--accent); }
    .cand-trend svg { width: 11px; height: 11px; }
    .cand-bar {
      height: 5px;
      background: var(--surface-2);
      border-radius: 4px;
      overflow: hidden;
      margin-bottom: 6px;
    }
    .cand-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 1s cubic-bezier(.25,.8,.25,1);
      animation: barGrow 1.2s cubic-bezier(.25,.8,.25,1) forwards;
      transform-origin: left;
    }
    @keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    .cand-votes {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .cand-votes strong { color: var(--ink-2); font-weight: 600; }
    .cand-delta {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 600;
      padding: 2px 6px;
      border-radius: 4px;
      display: inline-block;
      line-height: 1.2;
    }
    .cand-delta.up { background: var(--teal-soft); color: var(--teal); }
    .cand-delta.down { background: var(--accent-soft); color: var(--accent); }
    .cand-delta.zero { background: var(--surface-2); color: var(--ink-3); }
    [data-theme="dark"] .cand-delta.up { color: #2ECC9E; }

    .cand-ghost {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 4px;
      min-height: 20px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
    }
    .cand-ghost-prev { color: var(--ink-3); text-decoration: line-through; }

    .cand-gap {
      display: inline-block;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10.5px;
      font-weight: 600;
      padding: 3px 8px;
      margin-top: 8px;
      border-radius: 6px;
      background: rgba(232,148,58,0.1);
      color: #B5761A;
      border: 1px solid rgba(232,148,58,0.2);
    }
    [data-theme="dark"] .cand-gap { color: #E8943A; }

    .cand-detail-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
      margin-top: 10px;
      padding: 9px 10px;
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-family: 'Inter', sans-serif;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--ink-2);
      cursor: pointer;
      transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
    }
    .cand-detail-btn svg { width: 13px; height: 13px; transition: transform .15s ease; }
    .cand-detail-btn:hover {
      background: var(--surface-2);
      border-color: currentColor;
      color: inherit;
    }
    .cand-detail-btn:hover svg { transform: translateX(3px); }
    .cand-detail-btn:active { transform: scale(0.98); }

    .cand-arrows {
      display: inline-flex;
      gap: 0;
      margin-left: 4px;
      vertical-align: middle;
    }
    .cand-arrows svg {
      width: 10px; height: 10px; margin: 0 -1px;
      filter: drop-shadow(0 0 2px currentColor);
    }
    .cand-arrows.up { color: var(--teal); }
    .cand-arrows.down { color: var(--accent); }
    .cand-arrows svg:nth-child(1) { animation: arrowB .8s ease-in-out infinite; }
    .cand-arrows svg:nth-child(2) { animation: arrowB .8s ease-in-out .15s infinite; }
    .cand-arrows svg:nth-child(3) { animation: arrowB .8s ease-in-out .3s infinite; }
    @keyframes arrowB { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-2px)} }
    .cand-arrows.down svg { animation-name: arrowBD; }
    @keyframes arrowBD { 0%,100%{transform:translateY(0)} 50%{transform:translateY(2px)} }


    .cand-prob {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      margin-top: 8px;
      border-radius: 8px;
      background: var(--surface-2);
      font-size: 11px;
      color: var(--ink-3);
    }
    .cand-prob-label {
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      flex-shrink: 0;
    }
    .cand-prob-track {
      flex: 1;
      height: 5px;
      background: var(--surface);
      border-radius: 3px;
      overflow: hidden;
    }
    .cand-prob-fill {
      display: block;
      height: 100%;
      border-radius: 3px;
      transition: width .8s cubic-bezier(.25,.8,.25,1);
    }
    .cand-prob-pct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 13px;
      min-width: 32px;
      text-align: right;
    }
    .cand-prob.clasified {
      background: var(--teal-soft);
      color: var(--teal);
      justify-content: center;
      font-weight: 700;
      font-size: 11.5px;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .prob-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px 22px;
      margin-bottom: 20px;
      box-shadow: var(--shadow-sm);
    }
    .prob-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
    }
    .prob-title {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-3);
      display: flex;
      align-items: center;
      gap: 7px;
    }
    .prob-title svg { width: 13px; height: 13px; color: var(--accent); }
    .prob-caption { font-size: 11px; color: var(--ink-3); font-style: italic; }
    .prob-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
    }
    .prob-item {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .prob-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--ink-1);
    }
    .prob-track {
      height: 8px;
      background: var(--surface-2);
      border-radius: 8px;
      overflow: hidden;
    }
    .prob-fill {
      height: 100%;
      border-radius: 8px;
      animation: barGrow 1.2s cubic-bezier(.25,.8,.25,1) forwards;
      transform-origin: left;
    }
    .prob-value {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 14px;
    }

    .panel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 20px;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .panel-head {
      margin-bottom: 14px;
    }
    .panel-head h2 {
      font-family: 'Fraunces', serif;
      font-size: 18px;
      font-weight: 600;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .panel-head p {
      font-size: 11.5px;
      color: var(--ink-3);
      margin-top: 2px;
    }

    .map-container {
      position: relative;
      width: 100%;
      aspect-ratio: 3/4;
      max-height: 560px;
    }
    .map-container svg { width: 100%; height: 100%; }
    .dept-path {
      stroke: var(--surface);
      stroke-width: 1;
      cursor: pointer;
      transition: opacity .15s, stroke-width .15s;
    }
    .dept-path:hover { opacity: .85; stroke-width: 2; }
    [data-theme="dark"] .dept-path { stroke: var(--bg); }

    .map-legend {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      justify-content: center;
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }
    .mlg-item {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--ink-2);
      font-size: 12px;
      font-weight: 500;
    }
    .mlg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
    .mlg-count {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      color: var(--ink-1);
      background: var(--surface-2);
      padding: 1px 7px;
      border-radius: 10px;
      font-size: 10.5px;
      margin-left: 2px;
    }

    .chart-container {
      position: relative;
      width: 100%;
      height: 320px;
    }
    .chart-skel {
      position: absolute;
      inset: 8px;
      pointer-events: none;
    }
    .chart-skel.hidden { display: none; }

    .proj-table-wrap {
      margin-top: 0;
    }
    .proj-head-row {
      display: grid;
      grid-template-columns: 20px 1fr 64px 14px 64px 56px;
      gap: 6px;
      padding: 0 8px 8px;
      font-size: 9.5px;
      font-weight: 700;
      color: var(--ink-3);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      border-bottom: 1px solid var(--border);
      margin-bottom: 4px;
    }
    .proj-row {
      padding: 8px 8px 6px;
      font-size: 12px;
      border-radius: 7px;
      transition: background .12s ease;
    }
    .proj-row:hover { background: var(--surface-2); }
    .proj-main {
      display: grid;
      grid-template-columns: 20px 1fr 64px 14px 64px 56px;
      gap: 6px;
      align-items: center;
    }
    .proj-delta {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 11.5px;
      text-align: right;
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 3px;
    }
    .proj-delta-tri {
      display: inline-block;
      width: 0; height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
    }
    .proj-delta.up .proj-delta-tri { border-bottom: 6px solid currentColor; }
    .proj-delta.down .proj-delta-tri { border-top: 6px solid currentColor; }
    .proj-delta.up   { color: var(--teal); }
    .proj-delta.down { color: var(--accent); }
    .proj-delta.zero { color: var(--ink-3); }
    .proj-sub {
      padding: 4px 0 0 32px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10.5px;
      color: var(--ink-3);
      text-align: right;
    }
    .proj-pos {
      font-family: 'Fraunces', serif;
      font-style: italic;
      font-weight: 600;
      color: var(--ink-3);
    }
    .proj-name { font-weight: 600; }
    .proj-num { font-family: 'JetBrains Mono', monospace; text-align: right; }
    .proj-final { font-weight: 700; font-size: 13px; }
    .proj-arr { color: var(--ink-3); text-align: center; font-size: 11px; }

    .stats-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 20px;
    }
    .stat {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px 18px;
      box-shadow: var(--shadow-sm);
    }
    .stat-label {
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-3);
      margin-bottom: 6px;
    }
    .stat-value {
      font-family: 'Fraunces', serif;
      font-size: 28px;
      font-weight: 500;
      letter-spacing: -0.02em;
      line-height: 1.1;
      color: var(--ink-1);
    }
    .stat-sub {
      font-size: 11px;
      color: var(--ink-3);
      margin-top: 2px;
      font-family: 'JetBrains Mono', monospace;
    }

    .table-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }
    .table-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 22px 24px 14px;
      border-bottom: 1px solid var(--border);
    }
    .table-head h2 {
      font-family: 'Fraunces', serif;
      font-size: 20px;
      font-weight: 600;
      letter-spacing: -0.02em;
    }
    .table-head p {
      font-size: 12px;
      color: var(--ink-3);
      margin-top: 2px;
    }
    .reg-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .reg-table th {
      text-align: left;
      padding: 12px 16px;
      font-weight: 700;
      font-size: 10.5px;
      color: var(--ink-3);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      background: var(--surface-2);
      position: sticky;
      top: 0;
    }
    .reg-table th.num { text-align: right; }
    .reg-table td {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
    }
    .reg-table tr:last-child td { border-bottom: none; }
    .reg-table tr:hover td { background: var(--surface-2); }
    .reg-table .num {
      font-family: 'JetBrains Mono', monospace;
      text-align: right;
    }
    .reg-winner {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-weight: 600;
      font-size: 12.5px;
    }
    .reg-winner .dot { width: 9px; height: 9px; border-radius: 50%; }
    .reg-progress {
      display: inline-block;
      width: 80px;
      height: 5px;
      background: var(--surface-2);
      border-radius: 3px;
      overflow: hidden;
      vertical-align: middle;
      margin-right: 8px;
    }
    .reg-progress-fill {
      display: block;
      height: 100%;
      background: var(--accent);
      border-radius: 3px;
      transition: width .6s cubic-bezier(.25,.8,.25,1);
    }

    .matchup-history-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 18px;
    }
    .map-pc-row {
      display: grid;
      grid-template-columns: minmax(420px, 1fr) minmax(380px, 0.9fr);
      gap: 16px;
      margin-bottom: 18px;
    }
    .pc-chart-col {
      display: flex;
      flex-direction: column;
      gap: 16px;
      min-width: 0;
    }
    .pc-chart-col .participacion-card { margin-bottom: 0; }
    .chart-panel {
      display: flex;
      flex-direction: column;
      flex: 1;
    }
    .chart-panel .chart-container { flex: 1; min-height: 280px; }
    .history-card { margin-bottom: 18px; }
    .proj-panel { padding-bottom: 14px; }

    .matchup-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 20px 22px;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .matchup-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .matchup-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Fraunces', serif;
      font-size: 18px;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--ink-1);
    }
    .matchup-title svg { width: 18px; height: 18px; color: var(--ink-3); }
    .matchup-tabs {
      display: flex;
      gap: 4px;
      background: var(--surface-2);
      padding: 3px;
      border-radius: 8px;
    }
    .matchup-tab {
      border: 0;
      background: transparent;
      padding: 6px 12px;
      border-radius: 6px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 700;
      color: var(--ink-3);
      cursor: pointer;
      transition: background .15s ease, color .15s ease;
    }
    .matchup-tab.active { background: var(--surface); color: var(--ink-1); box-shadow: var(--shadow-sm); }
    .matchup-tab:hover:not(.active) { color: var(--ink-2); }

    .matchup-versus {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 12px;
      align-items: center;
      padding: 12px 0;
    }
    .matchup-player {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      text-align: center;
      min-width: 0;
    }
    .matchup-photo {
      width: 56px; height: 56px;
      border-radius: 50%;
      object-fit: cover;
      border: 3px solid currentColor;
      background: var(--surface-2);
    }
    .matchup-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-3);
    }
    .matchup-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink-1);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    .matchup-votes {
      font-family: 'JetBrains Mono', monospace;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: -0.02em;
    }
    .matchup-vs {
      font-family: 'Fraunces', serif;
      font-style: italic;
      font-size: 16px;
      color: var(--ink-3);
    }

    .matchup-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      padding: 12px;
      background: var(--surface-2);
      border-radius: 10px;
    }
    .matchup-stat-label {
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-3);
      margin-bottom: 3px;
    }
    .matchup-stat-value {
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      font-weight: 700;
      color: var(--ink-1);
    }

    .matchup-verdict {
      padding: 12px 14px;
      border-radius: 10px;
      border: 1px dashed var(--border);
      background: var(--surface);
    }
    .matchup-verdict-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--ink-2);
      margin-bottom: 6px;
    }
    .matchup-verdict-text {
      font-size: 12.5px;
      line-height: 1.5;
      color: var(--ink-1);
    }
    .matchup-verdict-text strong {
      font-family: 'JetBrains Mono', monospace;
    }
    .matchup-difficulty {
      display: inline-block;
      margin-top: 8px;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .matchup-difficulty.factible { background: var(--teal-soft); color: var(--teal); }
    .matchup-difficulty.moderada { background: rgba(232,148,58,0.15); color: #B5761A; }
    .matchup-difficulty.dificil  { background: var(--accent-soft); color: var(--accent); }
    .matchup-difficulty.imposible { background: var(--surface-2); color: var(--ink-3); }
    [data-theme="dark"] .matchup-difficulty.moderada { color: #E8943A; }

    .matchup-edges {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      padding-top: 12px;
      border-top: 1px dashed var(--border);
    }
    .matchup-edge {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      font-size: 11.5px;
    }
    .matchup-edge-pos {
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-3);
      flex-shrink: 0;
    }
    .matchup-edge-name {
      font-weight: 600;
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .matchup-edge-votes {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 11px;
      color: var(--ink-2);
    }
    .participacion-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 22px 24px;
      box-shadow: var(--shadow-sm);
      display: grid;
      grid-template-columns: 1fr 180px;
      gap: 24px;
      align-items: center;
    }
    .pc-main { min-width: 0 }
    .pc-label {
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-3);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 7px;
    }
    .pc-label svg { width: 13px; height: 13px; color: var(--accent); }
    .pc-value {
      font-family: 'JetBrains Mono', monospace;
      font-size: 42px;
      font-weight: 700;
      letter-spacing: -0.03em;
      color: var(--accent);
      line-height: 1;
      margin: 6px 0 10px;
    }
    .pc-value .sign { font-size: 28px; font-weight: 500; opacity: 0.7 }
    .pc-breakdown {
      display: flex;
      gap: 18px;
      font-size: 12px;
      color: var(--ink-2);
      flex-wrap: wrap;
    }
    .pc-break-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .pc-break-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0 }
    .pc-break-item strong {
      font-family: 'JetBrains Mono', monospace;
      color: var(--ink-1);
      font-weight: 700;
    }
    .pc-meta {
      font-size: 11px;
      color: var(--ink-3);
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
    }
    .pc-meta strong {
      font-family: 'JetBrains Mono', monospace;
      color: var(--ink-2);
      font-weight: 700;
    }
    
    .pc-donut {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .pc-donut svg { width: 150px; height: 150px; transform: rotate(-90deg) }
    .pc-donut-bg { fill: none; stroke: var(--surface-2); stroke-width: 9 }
    .pc-donut-fill {
      fill: none;
      stroke: var(--accent);
      stroke-width: 9;
      stroke-linecap: round;
      transition: stroke-dashoffset 1.5s cubic-bezier(.25,.8,.25,1);
    }
    .pc-donut-center {
      position: absolute;
      text-align: center;
      pointer-events: none;
    }
    .pc-donut-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .pc-donut-text {
      font-family: 'JetBrains Mono', monospace;
      font-size: 20px;
      font-weight: 700;
      color: var(--accent);
      letter-spacing: -0.02em;
    }
    .pc-donut-sub {
      font-size: 9.5px;
      color: var(--ink-3);
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      margin-top: 2px;
    }

    .votos-card {
      display: grid;
      grid-template-columns: 1fr;
      gap: 14px;
    }
    .votos-bar {
      height: 14px;
      background: var(--surface-2);
      border-radius: 7px;
      overflow: hidden;
      display: flex;
      position: relative;
    }
    .votos-bar-seg {
      height: 100%;
      transition: width 1s cubic-bezier(.25,.8,.25,1);
    }
    .votos-bar-seg.validos { background: var(--teal) }
    .votos-bar-seg.blancos { background: #E8943A }
    .votos-bar-seg.nulos { background: var(--accent) }
    .votos-legend {
      display: flex;
      gap: 14px;
      flex-wrap: wrap;
      font-size: 12px;
    }
    .vl-item {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--ink-2);
    }
    .vl-dot { width: 10px; height: 10px; border-radius: 3px }
    .vl-item strong {
      font-family: 'JetBrains Mono', monospace;
      color: var(--ink-1);
      font-weight: 700;
      margin-left: 3px;
    }

    .cand-selector {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 12px;
      margin-bottom: 24px;
    }
    .cs-btn {
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: 14px;
      padding: 14px;
      display: flex;
      align-items: center;
      gap: 12px;
      text-align: left;
      transition: all .2s ease;
      box-shadow: var(--shadow-sm);
      cursor: pointer;
      min-width: 0;
    }
    .cs-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .cs-btn.active { border-color: currentColor; box-shadow: var(--shadow-md); }
    .cs-photo {
      width: 44px; height: 44px;
      border-radius: 50%;
      object-fit: cover;
      background: var(--surface-2);
      flex-shrink: 0;
      border: 2px solid currentColor;
    }
    .cs-info { min-width: 0; flex: 1; }
    .cs-name {
      font-weight: 700;
      font-size: 13px;
      color: var(--ink-1);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .cs-pct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 16px;
      margin-top: 2px;
    }

    .cand-detail {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }
    .cd-header {
      display: flex;
      gap: 28px;
      align-items: center;
      padding: 32px;
      background: linear-gradient(135deg, transparent 0%, var(--surface-2) 100%);
      border-bottom: 1px solid var(--border);
    }
    .cd-photo {
      width: 112px; height: 112px;
      border-radius: 50%;
      object-fit: cover;
      border: 4px solid var(--surface);
      box-shadow: var(--shadow-md);
      flex-shrink: 0;
      background: var(--surface-2);
    }
    .cd-info { flex: 1; min-width: 0; }
    .cd-rank {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 20px;
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--ink-2);
      border: 1px solid var(--border);
      margin-bottom: 8px;
    }
    .cd-name {
      font-family: 'Fraunces', serif;
      font-size: 38px;
      font-weight: 600;
      letter-spacing: -0.03em;
      line-height: 1;
    }
    .cd-party {
      font-size: 13px;
      color: var(--ink-2);
      font-weight: 500;
      margin-top: 4px;
    }
    .cd-mainpct {
      display: flex;
      align-items: baseline;
      gap: 20px;
      margin-top: 16px;
      flex-wrap: wrap;
    }
    .cd-pct-big {
      font-family: 'JetBrains Mono', monospace;
      font-size: 42px;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1;
    }
    .cd-votes-big {
      font-size: 12px;
      color: var(--ink-3);
    }
    .cd-votes-big strong {
      display: block;
      font-family: 'JetBrains Mono', monospace;
      font-size: 14px;
      color: var(--ink-1);
      font-weight: 700;
    }

    .cd-body {
      padding: 32px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 36px 32px;
    }
    .cd-section h3 {
      font-family: 'Fraunces', serif;
      font-size: 17px;
      font-weight: 600;
      letter-spacing: -0.02em;
      margin-bottom: 4px;
      color: var(--ink-1);
      line-height: 1.25;
    }
    .cd-section-sub {
      font-size: 12px;
      color: var(--ink-3);
      margin-bottom: 18px;
      line-height: 1.4;
    }
    .cd-region-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .cd-region-row {
      display: grid;
      grid-template-columns: 110px 1fr 56px;
      gap: 10px;
      align-items: center;
      font-size: 12.5px;
    }
    .cd-rname {
      font-weight: 600;
      color: var(--ink-1);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .cd-rbar {
      height: 8px;
      background: var(--surface-2);
      border-radius: 4px;
      overflow: hidden;
      position: relative;
    }
    .cd-rbar-fill {
      display: block;
      height: 100%;
      border-radius: 4px;
      transition: width .6s ease;
    }
    .cd-rpct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 12.5px;
      text-align: right;
    }
    .cd-all-regions {
      grid-column: 1 / -1;
      margin-top: 16px;
      padding-top: 32px;
      border-top: 1px solid var(--border);
    }
    .cd-region-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
      gap: 12px;
      margin-top: 4px;
    }
    .cd-mini {
      padding: 14px 14px 12px;
      background: var(--surface-2);
      border-radius: 10px;
      border: 1px solid transparent;
      transition: border-color .15s ease, transform .15s ease;
      cursor: pointer;
    }
    .cd-mini:hover { transform: translateY(-1px); }
    .cd-mini:hover { border-color: currentColor; }
    .cd-mini-name {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--ink-1);
      margin-bottom: 8px;
    }
    .cd-mini-bar {
      height: 6px;
      background: var(--surface);
      border-radius: 3px;
      overflow: hidden;
    }
    .cd-mini-fill { display: block; height: 100%; border-radius: 3px; }
    .cd-mini-meta {
      display: flex;
      justify-content: space-between;
      margin-top: 8px;
      font-size: 10.5px;
      color: var(--ink-3);
    }
    .cd-mini-pct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      color: var(--ink-1);
    }

    .cd-winner-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 4px;
      background: rgba(15,118,110,0.12);
      color: var(--teal);
      font-family: 'JetBrains Mono', monospace;
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .insights-grid {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 16px;
    }
    .in-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 24px 26px;
      box-shadow: var(--shadow-sm);
      transition: box-shadow .2s ease, transform .2s ease;
    }
    .in-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
    .in-card-label {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--ink-3);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .in-card-label svg { width: 13px; height: 13px; }
    .in-card-value {
      font-family: 'Fraunces', serif;
      font-size: 30px;
      font-weight: 600;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .in-card-sub {
      font-size: 12.5px;
      color: var(--ink-2);
      margin-top: 10px;
      font-weight: 500;
      line-height: 1.5;
    }
    .in-card-sub strong {
      font-family: 'JetBrains Mono', monospace;
      color: var(--ink-1);
    }

    .in-zones {
      grid-column: span 12;
    }
    .zones-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-top: 16px;
    }
    .zone {
      padding: 16px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface-2);
    }
    .zone-head {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ink-3);
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .zone-count {
      font-family: 'JetBrains Mono', monospace;
      background: var(--surface);
      padding: 2px 8px;
      border-radius: 10px;
      font-size: 10px;
      color: var(--ink-1);
      font-weight: 700;
    }
    .zone-winner {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 0;
    }
    .zone-winner-photo {
      width: 36px; height: 36px;
      border-radius: 50%;
      border: 2px solid currentColor;
      object-fit: cover;
      flex-shrink: 0;
    }
    .zone-winner-info { min-width: 0; flex: 1; }
    .zone-winner-name { font-weight: 700; font-size: 13px; color: var(--ink-1); }
    .zone-winner-pct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 15px;
      margin-top: 2px;
    }
    .zone-regions {
      font-size: 10.5px;
      color: var(--ink-3);
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
      line-height: 1.4;
    }

    .in-wins {
      grid-column: span 6;
    }
    .wins-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 14px;
    }
    .wins-row {
      display: grid;
      grid-template-columns: 120px 1fr 36px;
      gap: 10px;
      align-items: center;
      font-size: 12.5px;
    }
    .wins-name { font-weight: 600; color: var(--ink-1); }
    .wins-track {
      height: 10px;
      background: var(--surface-2);
      border-radius: 5px;
      overflow: hidden;
    }
    .wins-fill { display: block; height: 100%; border-radius: 5px; }
    .wins-count {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      text-align: right;
    }

    .in-stat { grid-column: span 3; }
    .in-stat-disputada { grid-column: span 3; }

    .share-overlay {
      position: fixed; inset: 0;
      z-index: 9990;
      background: rgba(14,13,11,.55);
      backdrop-filter: blur(6px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s ease;
    }
    .share-overlay.open { opacity: 1; pointer-events: all; }
    .share-modal {
      position: fixed;
      z-index: 9991;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%) scale(.94);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 28px 28px 24px;
      width: calc(100% - 40px);
      max-width: 420px;
      box-shadow: 0 20px 60px rgba(0,0,0,.3);
      opacity: 0;
      pointer-events: none;
      transition: all .3s cubic-bezier(.34,1.56,.64,1);
    }
    .share-modal.open {
      opacity: 1;
      pointer-events: all;
      transform: translate(-50%, -50%) scale(1);
    }
    .share-modal h3 {
      font-family: 'Fraunces', serif;
      font-size: 20px;
      font-weight: 600;
      letter-spacing: -0.02em;
      color: var(--ink-1);
      margin-bottom: 4px;
    }
    .share-modal p {
      font-size: 12.5px;
      color: var(--ink-3);
      margin-bottom: 20px;
    }
    .share-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 8px;
    }
    .share-grid button {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 16px 8px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: 12px;
      color: var(--ink-2);
      font-weight: 600;
      font-size: 11.5px;
      cursor: pointer;
      transition: all .2s ease;
    }
    .share-grid button:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }
    .share-grid button svg { width: 26px; height: 26px; }
    .share-grid .sh-wa:hover { border-color: #25D366; color: #25D366; background: rgba(37,211,102,.08); }
    .share-grid .sh-tw:hover { border-color: #0f1419; color: #0f1419; background: rgba(15,20,25,.05); }
    [data-theme="dark"] .share-grid .sh-tw:hover { border-color: #f7f9fa; color: #f7f9fa; background: rgba(247,249,250,.08); }
    .share-grid .sh-fb:hover { border-color: #1877F2; color: #1877F2; background: rgba(24,119,242,.08); }
    .share-grid .sh-tg:hover { border-color: #0088cc; color: #0088cc; background: rgba(0,136,204,.08); }
    .share-grid .sh-ig:hover { border-color: #E1306C; color: #E1306C; background: rgba(225,48,108,.08); }
    .share-grid .sh-cp:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
    .share-close {
      position: absolute; top: 14px; right: 14px;
      width: 32px; height: 32px;
      border-radius: 8px;
      background: var(--surface-2);
      display: inline-flex;
      align-items: center; justify-content: center;
      color: var(--ink-2);
      font-size: 18px;
      line-height: 1;
    }
    .share-close:hover { background: var(--surface-3); color: var(--ink-1); }

    .share-btn {
      width: 36px; height: 36px;
      border-radius: 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--ink-2);
      transition: all .18s ease;
    }
    .share-btn:hover {
      background: var(--accent-soft);
      color: var(--accent);
      border-color: rgba(217,16,35,0.3);
    }
    .share-btn svg { width: 15px; height: 15px; }

    .modal-overlay {
      display: none;
      position: fixed; inset: 0;
      background: rgba(14,13,11,.55);
      backdrop-filter: blur(6px);
      z-index: 100;
      align-items: center; justify-content: center;
      padding: 24px;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: var(--surface);
      border-radius: 16px;
      padding: 28px;
      max-width: 460px;
      width: 100%;
      max-height: 85vh;
      overflow-y: auto;
      position: relative;
      box-shadow: 0 20px 60px rgba(0,0,0,.3);
      animation: modalIn .3s cubic-bezier(.34,1.56,.64,1);
    }
    @keyframes modalIn { from { opacity: 0; transform: scale(.92) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
    .modal-close {
      position: absolute; top: 14px; right: 14px;
      width: 30px; height: 30px;
      border-radius: 7px;
      background: var(--surface-2);
      display: inline-flex;
      align-items: center; justify-content: center;
      color: var(--ink-2);
    }
    .modal-close:hover { background: var(--surface-3); color: var(--ink-1); }
    .modal h3 {
      font-family: 'Fraunces', serif;
      font-size: 24px;
      font-weight: 600;
      letter-spacing: -0.02em;
    }
    .modal-sub {
      font-size: 11.5px;
      color: var(--ink-3);
      font-family: 'JetBrains Mono', monospace;
      margin: 4px 0 16px;
    }
    .modal-stats {
      background: var(--surface-2);
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .modal-stat-line {
      display: flex; justify-content: space-between;
      font-size: 12.5px; color: var(--ink-2);
    }
    .modal-stat-line strong { font-family: 'JetBrains Mono', monospace; color: var(--ink-1); }
    .modal-cand {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 0;
      border-bottom: 1px solid var(--border);
    }
    .modal-cand:last-child { border-bottom: none; }
    .modal-cand-dot { width: 9px; height: 9px; border-radius: 50%; }
    .modal-cand-name { flex: 1; font-weight: 500; font-size: 13px; }
    .modal-cand-votes {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      color: var(--ink-3);
      font-weight: 600;
    }
    .modal-cand-pct {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 14px;
      min-width: 64px;
      text-align: right;
    }
    .modal-cand-bar {
      height: 4px;
      background: var(--surface-2);
      border-radius: 2px;
      overflow: hidden;
      margin: 2px 0 4px 19px;
    }
    .modal-cand-bar-fill { height: 100%; border-radius: 2px; }

    @media (max-width: 1280px) {
      .wrap { padding: 20px 24px 36px; }
      .hero-number { font-size: 58px; }
      .hero-number .sign { font-size: 34px; }
      .hm-value { font-size: 32px; }
    }

    @media (max-width: 1100px) {
      .hero-strip { grid-template-columns: 1fr; }
      .hero-meta-grid { grid-template-columns: repeat(4, 1fr); }
      .cand-row { grid-template-columns: repeat(5, 1fr); gap: 10px; }
      .cand { padding: 14px; }
      .cand-name { font-size: 13px; }
      .cand-pct { font-size: 22px; }
      .cand-photo { width: 42px; height: 42px; }
      .chart-container { height: 280px; }
      .cd-body { grid-template-columns: 1fr; gap: 20px; }
      .zones-grid { grid-template-columns: repeat(2, 1fr); }
      .in-wins, .in-stat, .in-stat-disputada { grid-column: span 6; }
    }

    @media (max-width: 900px) {
      .wrap { padding: 18px 20px 32px; }
      .topbar { gap: 12px; }
      .brand-name { font-size: 17px; }
      .brand-sub { font-size: 10.5px; }
      .cand-row { grid-template-columns: repeat(3, 1fr); }
      .cand-row .cand:nth-child(4),
      .cand-row .cand:nth-child(5) { grid-column: span 1; }
      .prob-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
      .stats-row { grid-template-columns: repeat(2, 1fr); }
      .hero-number { font-size: 52px; }
      .hero-number .sign { font-size: 32px; }
      .hero-meta-grid { grid-template-columns: repeat(2, 1fr); }
      .hm-value { font-size: 30px; }
      .hm-cell { min-height: 140px; }
      .cand-selector { grid-template-columns: repeat(3, 1fr); }
      .cd-header { flex-direction: column; text-align: center; gap: 16px; padding: 22px; }
      .cd-photo { width: 88px; height: 88px; }
      .cd-name { font-size: 30px; }
      .cd-mainpct { justify-content: center; }
    }

    @media (max-width: 760px) {
      .topbar {
        flex-wrap: wrap;
        gap: 10px;
      }
      .brand { flex: 1; min-width: 160px; }
      .tabs { order: 3; width: 100%; display: flex; }
      .tab { flex: 1; justify-content: center; padding: 8px 10px; font-size: 12px; }
      .actions { margin-left: auto; gap: 8px; }
      .actions .btn { padding: 8px 12px; font-size: 12px; }
      .cand-row { grid-template-columns: repeat(2, 1fr); }
      .cand-row .cand:nth-child(5) {
        grid-column: 1 / -1;
        max-width: calc(50% - 6px);
        margin: 0 auto;
      }
      .panel { padding: 16px; }
      .chart-container { height: 260px; }
      .map-container { aspect-ratio: 3/4.2; }
      .proj-head-row, .proj-main {
        grid-template-columns: 20px 1fr 58px 12px 58px 48px;
        gap: 5px;
      }
      .proj-sub { padding-left: 27px; font-size: 10px; }
      .proj-delta { font-size: 10.5px; }
    }

    @media (max-width: 900px) {
      .matchup-history-row { grid-template-columns: 1fr; }
      .map-pc-row { grid-template-columns: 1fr; }
      .participacion-card { grid-template-columns: 1fr; }
      .pc-donut { justify-self: center }
      .pc-main { text-align: center }
      .pc-breakdown { justify-content: center }
      .pc-label { justify-content: center }
    }

    @media (max-width: 640px) {
      .wrap { padding: 12px 14px 24px; }
      .topbar { padding: 12px 0 14px; margin-bottom: 18px; }
      .brand-flag { width: 30px; height: 20px; }
      .brand-name { font-size: 15px; }
      .brand-sub { font-size: 9.5px; letter-spacing: 0.05em; }
      .actions .btn:not(.btn-primary) span,
      .actions .btn-ghost { padding: 8px 10px; }
      .actions .btn-primary { padding: 8px 12px; }
      .hero-main { padding: 20px 18px; }
      .hero-label { font-size: 10px; letter-spacing: 0.14em; }
      .hero-label::before, .hero-label::after { width: 18px; }
      .hero-number { font-size: 42px; letter-spacing: -0.02em; margin: 8px 0 4px; }
      .hero-number .sign { font-size: 26px; }
      .hero-sub { font-size: 11px; }
      .hero-meta { font-size: 10.5px; gap: 6px; flex-wrap: wrap; justify-content: center; }
      .hero-ts { font-size: 11px; }
      .hero-meta-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
      .hm-cell { padding: 18px 14px; min-height: 120px; gap: 6px; }
      .hm-value { font-size: 26px; }
      .hm-label { font-size: 9.5px; }
      .hm-sub { font-size: 10.5px; }
      .cand-row { grid-template-columns: 1fr 1fr; gap: 8px; }
      .cand-row .cand:nth-child(5) {
        grid-column: 1 / -1;
        max-width: 100%;
        margin: 0;
      }
      .cand { padding: 12px; }
      .cand-head { gap: 8px; margin-bottom: 8px; }
      .cand-photo { width: 36px; height: 36px; }
      .cand-name { font-size: 12.5px; }
      .cand-party { font-size: 10px; }
      .cand-rank { font-size: 10px; }
      .cand-pct { font-size: 19px; }
      .cand-delta { font-size: 9.5px; padding: 1px 5px; }
      .cand-detail-btn { font-size: 10.5px; padding: 8px; margin-top: 8px; }
      .cand-votes { font-size: 10.5px; }
      .cand-gap { font-size: 10px; padding: 2px 6px; }
      .cand-arrows svg { width: 8px; height: 8px; }
      .prob-card { padding: 14px 16px; margin-bottom: 16px; }
      .prob-caption { display: none; }
      .prob-list { grid-template-columns: 1fr; gap: 10px; }
      .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
      .stat { padding: 14px; }
      .stat-value { font-size: 22px; }
      .stat-label { font-size: 10px; }
      .panel-head h2 { font-size: 16px; }
      .panel-head p { font-size: 11px; }
      .chart-container { height: 240px; }
      .map-container { aspect-ratio: 3/4.5; }
      .map-legend { gap: 10px; font-size: 11px; }
      .proj-head-row, .proj-main {
        grid-template-columns: 18px 1fr 52px 10px 52px 44px;
        gap: 4px;
        font-size: 11px;
      }
      .proj-row { padding: 8px 6px; }
      .panel { padding: 14px; }
      .modal { padding: 22px; }
      .modal h3 { font-size: 20px; }
      .app-footer { font-size: 10px; padding: 16px 8px; line-height: 1.7; }
      .app-footer-sep { margin: 0 5px; }
      
      .participacion-card { padding: 16px 18px; gap: 16px }
      .pc-value { font-size: 32px }
      .pc-value .sign { font-size: 22px }
      .pc-donut svg { width: 120px; height: 120px }
      .pc-donut-text { font-size: 18px }
      
      .table-head { padding: 16px 16px 12px; }
      .table-head h2 { font-size: 18px; }
      .reg-table th, .reg-table td { padding: 10px 12px; font-size: 12px; }
      .reg-progress { width: 50px; }
      
      .reg-table th:nth-child(4), .reg-table td:nth-child(4) { display: none; }
      
      .cand-selector { grid-template-columns: repeat(2, 1fr); gap: 8px; }
      .cs-btn { padding: 10px; }
      .cs-photo { width: 36px; height: 36px; }
      .cs-name { font-size: 12px; }
      .cs-pct { font-size: 14px; }
      .cd-pct-big { font-size: 32px; }
      .cd-region-row { grid-template-columns: 90px 1fr 52px; font-size: 11.5px; }
      
      .zones-grid { grid-template-columns: 1fr; }
      .in-wins, .in-stat, .in-stat-disputada { grid-column: span 12; }
      .in-card { padding: 16px 18px; }
      .in-card-value { font-size: 24px; }
    }

    @media (max-width: 420px) {
      .wrap { padding: 10px 12px 20px; }
      .brand-sub { display: none; }
      .actions { gap: 6px; }
      .actions .btn { padding: 7px 10px; font-size: 11px; }
      .actions .btn-primary span { font-size: 12px; }
      .theme-toggle { width: 32px; height: 32px; }
      .tab { padding: 7px 8px; font-size: 11px; gap: 5px; }
      .tab svg { width: 12px; height: 12px; }
      .hero-number { font-size: 36px; }
      .hero-number .sign { font-size: 22px; }
      .hero-main { padding: 18px 14px; }
      .hm-cell { padding: 16px 14px; min-height: 110px; }
      .hm-value { font-size: 22px; }
      .hero-meta-grid { grid-template-columns: 1fr; }
      .cand-row { grid-template-columns: 1fr; }
      .cand-row .cand:nth-child(5) { grid-column: 1; }
      .cand { padding: 14px; }
      .cand-head { gap: 10px; }
      .cand-photo { width: 44px; height: 44px; }
      .cand-name { font-size: 14px; }
      .cand-pct { font-size: 24px; }
      .stats-row { grid-template-columns: 1fr; }
      .chart-container { height: 220px; }
      .reg-table th:nth-child(5), .reg-table td:nth-child(5) { display: none; }
    }

    .app-footer {
      text-align: center;
      padding: 24px 16px 8px;
      margin-top: 8px;
      border-top: 1px solid var(--border);
      font-size: 11.5px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .app-footer-sep {
      display: inline-block;
      margin: 0 8px;
      color: var(--ink-3);
      opacity: 0.5;
    }

    .skel {
      display: inline-block;
      background: var(--surface-2);
      border-radius: 4px;
      position: relative;
      overflow: hidden;
      vertical-align: middle;
    }
    .skel::after {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
      animation: shim 1.5s infinite;
    }
    [data-theme="dark"] .skel::after {
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
    }
    .skel-circle { border-radius: 50%; }
    @keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

    .cand-skel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      box-shadow: var(--shadow-sm);
      border-top: 3px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 280px;
    }
    .cand-skel-head {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .cand-skel-meta {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .prob-card-skel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px 20px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 120px;
    }

    .history-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 20px 22px;
      box-shadow: var(--shadow-sm);
    }
    .history-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }
    .history-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Fraunces', serif;
      font-size: 18px;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--ink-1);
    }
    .history-title svg { width: 18px; height: 18px; color: var(--ink-3); }
    .history-sub {
      font-size: 11px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .history-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: 360px;
      overflow-y: auto;
    }
    .history-list::-webkit-scrollbar { width: 6px; }
    .history-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
    .history-entry {
      display: grid;
      grid-template-columns: 86px 1fr;
      gap: 14px;
      padding: 10px 0;
      border-top: 1px dashed var(--border);
    }
    .history-entry:first-child { border-top: 0; padding-top: 0; }
    .he-time {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .he-time-abs {
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      font-weight: 700;
      color: var(--ink-1);
      letter-spacing: -0.02em;
    }
    .he-time-rel {
      font-size: 10px;
      color: var(--ink-3);
      font-weight: 500;
    }
    .he-changes {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .he-change {
      display: grid;
      grid-template-columns: 1fr auto auto;
      align-items: center;
      gap: 8px;
      font-size: 11.5px;
      font-family: 'JetBrains Mono', monospace;
    }
    .he-name {
      color: var(--ink-2);
      font-weight: 600;
      font-family: 'Inter', sans-serif;
      font-size: 11.5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .he-transition {
      color: var(--ink-3);
      font-variant-numeric: tabular-nums;
    }
    .he-transition strong { color: var(--ink-1); font-weight: 700; }
    .he-delta {
      font-weight: 700;
      font-size: 10.5px;
      padding: 2px 6px;
      border-radius: 4px;
      min-width: 54px;
      text-align: center;
    }
    .he-delta.up { background: var(--teal-soft); color: var(--teal); }
    .he-delta.down { background: var(--accent-soft); color: var(--accent); }
    .he-delta.he-delta-none { background: transparent; color: var(--ink-3); font-weight: 500; }
    [data-theme="dark"] .he-delta.up { color: #2ECC9E; }
    .history-empty {
      padding: 20px;
      text-align: center;
      color: var(--ink-3);
      font-size: 12px;
    }
