
  :root{
    --paper: #EDEFF0;
    --paper-raised: #F7F8F7;
    --ink: #181B22;
    --ink-soft: #565C6B;
    --line: #D7DAE0;
    --red: #C81D25;
    --red-deep: #8C0F17;
    --gold: #B5872E;
    --green: #2F6B4F;
    --green-bg: #E8F0EA;
    --red-bg: #F8E7E6;
    --banner-bg: #F4E9E7;
    --shadow: 0 1px 2px rgba(20,22,30,0.04), 0 8px 24px rgba(20,22,30,0.06);
  }
  /* ---- Comparte tu voto ---- */
  .cv-section{max-width:1100px;margin:56px auto 0;padding:0 20px;}
  .cv-card{
    background:linear-gradient(160deg,var(--ink) 0%,var(--red-deep) 100%);
    border-radius:20px;padding:40px 32px 44px;position:relative;overflow:hidden;
    box-shadow:var(--shadow); transition:background 0.4s ease;
  }
  .cv-card.tipo-regional{ background:linear-gradient(160deg,var(--ink) 0%,var(--red-deep) 100%); }
  .cv-card.tipo-municipal{ background:linear-gradient(160deg,var(--ink) 0%,#123A63 100%); }
  .cv-card.tipo-distrital{ background:linear-gradient(160deg,var(--ink) 0%,#1F5C3D 100%); }
  .cv-card.tipo-general{ background:linear-gradient(160deg,var(--ink) 0%,#5A3B82 100%); }
  .cv-header{text-align:center;position:relative;z-index:1;}
  .cv-eyebrow{color:var(--gold);font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;margin-bottom:10px;}
  .cv-header h2{font-family:'Fraunces',serif;color:#fff;font-size:26px;margin:0 0 6px;}
  .cv-date{color:var(--gold);font-weight:700;font-size:15px;margin:0 0 14px;}
  .cv-hint{color:rgba(255,255,255,.6);font-size:13.5px;max-width:520px;margin:0 auto 26px;line-height:1.5;}
  .cv-tipos{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-bottom:20px;position:relative;z-index:1;}
  .cv-tipo-btn{
    background:rgba(255,255,255,.08);border:1.5px solid rgba(255,255,255,.2);color:#fff;
    padding:9px 20px;border-radius:999px;font-size:13.5px;font-weight:600;cursor:pointer;transition:.15s;
  }
  .cv-tipo-btn:hover{background:rgba(255,255,255,.16);}
  .cv-tipo-btn.active{background:var(--gold);border-color:var(--gold);color:var(--ink);}
  .cv-selects{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-bottom:8px;position:relative;z-index:1;}
  .cv-select{
    background:rgba(255,255,255,.08);border:1.5px solid rgba(255,255,255,.25);color:#fff;
    padding:10px 14px;border-radius:10px;font-size:13.5px;font-family:inherit;min-width:150px;cursor:pointer;
  }
  .cv-select option{color:#181B22;}
  .cv-select:disabled{opacity:.4;cursor:not-allowed;}
  .cv-section .share-panel{display:none;margin-top:28px;padding-top:24px;border-top:1px solid rgba(255,255,255,.15);position:relative;z-index:1;}
  .cv-section .share-canvas-wrap{text-align:center;margin-bottom:20px;position:relative;display:inline-block;width:100%;}
  .cv-section #cvCanvas{max-width:340px;width:100%;border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,.4);display:block;margin:0 auto;}
  .cv-section .photo-upload-btn{
    display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.12);
    border:1.5px dashed rgba(255,255,255,.3);color:#fff;padding:10px 20px;border-radius:10px;
    cursor:pointer;font-size:13.5px;font-weight:600;transition:background .15s;
  }
  .cv-section .photo-upload-btn:hover{background:rgba(255,255,255,.2);}
  .cv-section #cvPhotoInput{display:none;}
  .cv-section .share-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;}
  .cv-section .share-btn-item{
    display:inline-flex;align-items:center;gap:8px;padding:11px 20px;border-radius:10px;
    font-size:13.5px;font-weight:700;text-decoration:none;cursor:pointer;border:none;
    transition:opacity .15s;white-space:nowrap;
  }
  .cv-section .share-btn-item:hover{opacity:.85;}
  .cv-section .sbtn-dl{background:var(--gold);color:var(--ink);}
  .cv-section .sbtn-wa{background:#25D366;color:#fff;}
  .cv-section .sbtn-tw{background:#000;color:#fff;}
  .cv-section .sbtn-fb{background:#1877F2;color:#fff;}
  .cv-section .sbtn-native{background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.3);}
  @media(max-width:640px){
    .cv-card{padding:32px 18px 36px;}
    .cv-section .share-actions{flex-direction:column;align-items:stretch;}
    .cv-select{min-width:120px;flex:1 1 45%;}
  }

  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    margin:0;
    background:var(--paper);
    color:var(--ink);
    font-family:'Inter',sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  a{color:inherit;}

  /* ---------- Header ---------- */
  header.site{
    padding:48px 24px 0;
    max-width:1180px;
    margin:0 auto;
  }
  .eyebrow{
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    letter-spacing:0.12em;
    text-transform:uppercase;
    color:var(--red-deep);
    display:flex;
    align-items:center;
    gap:10px;
  }
  .eyebrow::before{
    content:"";
    width:7px;height:7px;border-radius:50%;
    background:var(--red);
    display:inline-block;
  }
  h1.title{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:clamp(36px,6vw,58px);
    line-height:1.02;
    margin:14px 0 10px;
    letter-spacing:-0.01em;
  }
  h1.title em{
    font-style:italic;
    font-weight:400;
    color:var(--red-deep);
  }
  .subhead{
    font-size:16px;
    color:var(--ink-soft);
    max-width:640px;
    line-height:1.55;
    margin:0 0 18px;
  }
  .loc-chip{
    display:inline-flex;
    align-items:center;
    gap:7px;
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    color:var(--ink);
    background:var(--paper-raised);
    border:1px solid var(--line);
    padding:7px 12px;
    border-radius:999px;
    margin-bottom:24px;
  }
  .loc-chip svg{width:13px;height:13px;color:var(--red-deep);}
  .stat-row{
    display:flex;
    gap:28px;
    flex-wrap:wrap;
    border-top:1px solid var(--line);
    padding:18px 0;
  }
  .stat{
    font-family:'IBM Plex Mono',monospace;
  }
  .stat b{
    display:block;
    font-size:22px;
    color:var(--ink);
  }
  .stat span{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color:var(--ink-soft);
  }

  /* ---------- Controls ---------- */
  .controls{
    position:sticky;
    top:0;
    z-index:20;
    background:rgba(237,239,240,0.92);
    backdrop-filter:blur(8px);
    border-bottom:1px solid var(--line);
    padding:14px 24px;
    margin-top:18px;
  }
  .controls-inner{
    max-width:1180px;
    margin:0 auto;
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
  }
  .search-wrap{
    position:relative;
    flex:1 1 260px;
  }
  .search-wrap input{
    width:100%;
    padding:11px 14px 11px 36px;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--paper-raised);
    font-family:'Inter',sans-serif;
    font-size:14px;
    color:var(--ink);
  }
  .search-wrap input:focus{
    outline:2px solid var(--red);
    outline-offset:-1px;
  }
  .search-wrap svg{
    position:absolute;
    left:11px;top:50%;
    transform:translateY(-50%);
    width:16px;height:16px;
    color:var(--ink-soft);
  }
  select{
    padding:10px 30px 10px 12px;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--paper-raised) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M0 0L5 6L10 0" fill="none" stroke="%23565C6B" stroke-width="1.4"/></svg>') no-repeat right 12px center;
    appearance:none;
    font-family:'Inter',sans-serif;
    font-size:13px;
    color:var(--ink);
    cursor:pointer;
    max-width:180px;
  }
  select:focus{outline:2px solid var(--red); outline-offset:-1px;}
  select:disabled{opacity:0.38; cursor:not-allowed; background-color:var(--paper);}

  /* Pinned party banner */
  .party-group.pinned{
    border-color: var(--red);
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(200,29,37,0.12), 0 8px 32px rgba(200,29,37,0.1);
  }
  .party-group.pinned .party-banner{
    background: linear-gradient(135deg, #F4E9E7 0%, #FDF5F4 100%);
  }
  .pin-label{
    font-family:'IBM Plex Mono',monospace;
    font-size:9.5px;
    letter-spacing:0.1em;
    text-transform:uppercase;
    color:var(--red-deep);
    background:#fff;
    border:1px solid var(--red-deep);
    padding:2px 8px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    gap:4px;
    margin-left:6px;
    vertical-align:middle;
  }

  /* PROGRESEMOS CTA buttons */
  .cta-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
    padding-top:12px;
    border-top:1px dashed var(--line);
  }
  .cta-btn{
    font-family:'Inter',sans-serif;
    font-size:12.5px;
    font-weight:600;
    padding:9px 16px;
    border-radius:8px;
    cursor:pointer;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    gap:7px;
    transition:opacity 0.15s;
  }
  .cta-btn:hover{opacity:0.85;}
  .cta-btn.cta-campaign{
    background:var(--red-deep);
    color:#fff;
    border:none;
  }
  .cta-btn.cta-web{
    background:#fff;
    color:var(--ink);
    border:1.5px solid var(--line);
  }

  .election-card-soon{
    background:var(--paper);
    cursor:default;
    border-style:dashed;
  }
  .election-card-soon:hover{transform:none; border-color:var(--line);}
  .tag-soon{color:var(--ink-soft); background:var(--paper); border:1px solid var(--line);}

  /* ---------- Mobile filter toggle ---------- */
  .filters-toggle{
    display:none;
    width:100%;
    padding:11px 14px;
    border:1px solid var(--line);
    border-radius:8px;
    background:var(--paper-raised);
    font-family:'Inter',sans-serif;
    font-size:14px;
    font-weight:600;
    color:var(--ink);
    cursor:pointer;
    text-align:left;
    justify-content:space-between;
    align-items:center;
  }
  .filters-toggle svg{transition:transform 0.2s;}
  .filters-toggle.open svg{transform:rotate(180deg);}

  .filters-grid{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
  }

  @media (max-width:640px){
    .filters-toggle{ display:flex; }
    .filters-grid{ display:none; }
    .filters-grid.open{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:8px;
      width:100%;
    }
    .filters-grid.open select{ max-width:none; }
    .filters-grid.open .clear-btn{ grid-column:1/-1; }
    .controls-inner{ flex-direction:column; align-items:stretch; }
    .search-wrap{ flex:1 1 auto; }
  }
  .clear-btn{
    font-family:'Inter',sans-serif;
    font-size:13px;
    color:var(--red-deep);
    background:none;
    border:1px solid var(--line);
    border-radius:8px;
    padding:10px 14px;
    cursor:pointer;
  }
  .clear-btn:hover{background:var(--red-bg);}

  /* ---------- Results ---------- */
  main.results{
    max-width:1180px;
    margin:0 auto;
    padding:26px 24px 80px;
  }
  .result-count{
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    color:var(--ink-soft);
    letter-spacing:0.02em;
  }
  .result-count b{color:var(--ink);}
  .last-updated{color:var(--ink-soft);font-size:0.85em;font-weight:400;}

  .result-count-row{
    display:flex;align-items:center;flex-wrap:wrap;gap:14px;
    margin-bottom:20px;
  }
  .share-list-wrap{display:flex;align-items:center;gap:8px;}
  .share-list-btn{
    position:relative;overflow:hidden;
    background:linear-gradient(100deg,var(--red) 0%,var(--red-deep) 60%,var(--red) 100%);
    background-size:200% auto;
    color:#fff;border:none;padding:8px 16px;border-radius:999px;
    font-size:12.5px;font-weight:700;cursor:pointer;
    box-shadow:0 2px 10px rgba(200,29,37,0.35);
    animation:shareShimmer 3.5s linear infinite;
  }
  .share-list-btn:hover{filter:brightness(1.08);}
  @keyframes shareShimmer{
    0%{background-position:0% center;}
    100%{background-position:200% center;}
  }
  .share-list-pulse{
    position:absolute;top:50%;left:14px;width:7px;height:7px;border-radius:50%;
    background:#fff;transform:translateY(-50%);display:none;
  }
  .share-list-icon{
    width:30px;height:30px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    color:#fff;transition:transform .15s;
  }
  .share-list-icon:hover{transform:scale(1.12);}
  .sli-fb{background:#1877F2;}
  .sli-ig{background:radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);}
  .sli-x{background:#000;}
  .sli-wa{background:#25D366;}
  @media(max-width:640px){
    .result-count-row{flex-direction:column;align-items:flex-start;}
  }

  /* ---------- Party group wrapper ---------- */
  .party-group{
    border:1.5px solid var(--line);
    border-radius:16px;
    overflow:hidden;
    margin-bottom:26px;
    box-shadow:var(--shadow);
  }
  .party-banner{
    display:flex;
    align-items:flex-start;
    gap:14px;
    flex-wrap:wrap;
    padding:18px 20px;
    background:var(--banner-bg);
    border-bottom:1.5px solid var(--line);
  }
  .party-logo{
    width:50px;height:50px;
    border-radius:10px;
    border:1px solid var(--line);
    background:#fff;
    object-fit:contain;
    flex-shrink:0;
    padding:4px;
  }
  .party-logo-fallback{
    width:50px;height:50px;
    border-radius:10px;
    border:1px solid var(--line);
    background:#fff;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:20px;
    color:var(--red-deep);
  }
  .party-id{flex:1 1 180px; min-width:160px;}
  .party-name{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:18px;
    line-height:1.2;
    margin:0 0 4px;
  }
  .party-meta{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:var(--ink-soft);
  }
  .party-docs{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-content:flex-start;
    flex:1 1 320px;
  }
  .party-docs a{
    font-size:11.5px;
    text-decoration:none;
    color:var(--ink);
    background:#fff;
    border:1px solid var(--line);
    padding:6px 10px;
    border-radius:6px;
    white-space:nowrap;
  }
  .party-docs a.primary{
    background:var(--red-deep);
    color:#fff;
    border-color:var(--red-deep);
    font-weight:600;
  }
  .party-docs a:hover{border-color:var(--red); color:var(--red-deep);}
  .party-docs a.primary:hover{opacity:0.9; color:#fff;}

  .party-body{
    padding:20px;
    background:var(--paper-raised);
  }
  .match-note{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:var(--ink-soft);
    margin-bottom:14px;
  }

  .grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
    gap:16px;
  }

  .card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:12px;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:11px;
  }
  .card-header-row{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
  }
  .card-top{
    display:flex;
    gap:14px;
    min-width:0;
    flex:1;
  }
  .photo{
    width:60px;height:60px;
    border-radius:10px;
    object-fit:cover;
    background:var(--paper);
    border:1px solid var(--line);
    flex-shrink:0;
  }
  .id-block{min-width:0;}
  .name{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:16.5px;
    line-height:1.2;
    margin:0 0 3px;
  }
  .cargo{
    font-size:12px;
    color:var(--red-deep);
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.02em;
  }

  .stamp{
    font-family:'IBM Plex Mono',monospace;
    font-size:10px;
    font-weight:600;
    letter-spacing:0.06em;
    text-transform:uppercase;
    padding:4px 8px;
    border-radius:5px;
    border:1.5px dashed currentColor;
    transform:rotate(3deg);
    white-space:nowrap;
    flex-shrink:0;
  }
  .stamp.adm{color:var(--green); background:var(--green-bg);}
  .stamp.inadm{color:var(--red-deep); background:var(--red-bg);}
  .stamp.otro{color:var(--gold); background:#F6EFE0;}

  .meta-row{
    display:flex;
    flex-wrap:wrap;
    gap:6px 14px;
    font-size:11.5px;
    color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace;
    border-top:1px dashed var(--line);
    padding-top:9px;
  }
  .meta-row span b{color:var(--ink); font-weight:500;}

  .links{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:auto;
  }
  .links a{
    font-size:11px;
    text-decoration:none;
    color:var(--ink);
    background:var(--paper);
    border:1px solid var(--line);
    padding:5px 9px;
    border-radius:6px;
    display:inline-flex;
    align-items:center;
    gap:5px;
  }
  .links a:hover{
    border-color:var(--red);
    color:var(--red-deep);
  }

  .empty-state{
    text-align:center;
    padding:80px 20px;
    color:var(--ink-soft);
  }
  .empty-state .big{
    font-family:'Fraunces',serif;
    font-size:24px;
    color:var(--ink);
    margin-bottom:8px;
  }

  footer{
    max-width:1180px;
    margin:0 auto;
    padding:24px 24px 50px;
    font-size:12px;
    color:var(--ink-soft);
    border-top:1px solid var(--line);
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;
  }
  .version-tag{
    font-family:'IBM Plex Mono',monospace;
    color:var(--ink-soft);
  }

  @media (max-width:640px){
    select{max-width:none; flex:1 1 calc(50% - 5px);}
    .controls-inner{flex-direction:column; align-items:stretch;}
    .search-wrap{flex:1 1 auto;}
    .party-docs{flex:1 1 100%;}
  }

  @media (prefers-reduced-motion: reduce){
    html{scroll-behavior:auto;}
  }

  /* ---------- View system ---------- */
  .view{display:none;}
  .view.active{display:block;}

  /* ---------- Globe (home) view ---------- */
  .home-hero{
    max-width:1180px;
    margin:0 auto;
    padding:48px 24px 8px;
    text-align:center;
  }
  .home-hero .eyebrow{justify-content:center;}
  .home-hero h1.title{font-size:clamp(36px,6vw,58px);}
  .home-hero .subhead{margin-left:auto; margin-right:auto;}

  .globe-search-wrap{
    max-width:440px;
    margin:0 auto 6px;
    position:relative;
  }
  .globe-search-wrap input{
    width:100%;
    padding:13px 16px 13px 40px;
    border:1px solid var(--line);
    border-radius:999px;
    background:var(--paper-raised);
    font-family:'Inter',sans-serif;
    font-size:14.5px;
    color:var(--ink);
    box-shadow:var(--shadow);
  }
  .globe-search-wrap input:focus{outline:2px solid var(--red); outline-offset:-1px;}
  .globe-search-wrap svg{
    position:absolute; left:15px; top:50%; transform:translateY(-50%);
    width:16px;height:16px;color:var(--ink-soft);
  }
  .globe-search-results{
    max-width:440px;
    margin:8px auto 0;
    background:var(--paper-raised);
    border:1px solid var(--line);
    border-radius:12px;
    box-shadow:var(--shadow);
    overflow:hidden;
    text-align:left;
    display:none;
  }
  .globe-search-results.show{display:block;}
  .globe-search-result-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:11px 16px;
    cursor:pointer;
    font-size:13.5px;
    border-bottom:1px solid var(--line);
  }
  .globe-search-result-row:last-child{border-bottom:none;}
  .globe-search-result-row:hover{background:var(--paper);}
  .globe-search-result-row .badge{
    font-family:'IBM Plex Mono',monospace;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:0.05em;
    padding:3px 8px;
    border-radius:999px;
  }
  .globe-search-result-row .badge.ok{color:var(--green); background:var(--green-bg);}
  .globe-search-result-row .badge.soon{color:var(--ink-soft); background:var(--paper);}

  .globe-wrap{
    max-width:620px;
    margin:18px auto 6px;
    display:flex;
    justify-content:center;
    position:relative;
  }
  #globe{
    cursor:grab;
    touch-action:none;
  }
  #globe:active{cursor:grabbing;}
  .ocean{fill:var(--paper-raised); stroke:var(--line); stroke-width:1;}
  path.country{fill:#E2E5E8; stroke:var(--paper); stroke-width:0.6; transition:fill 0.15s;}
  path.country.available{fill:#D8B9B7; cursor:pointer;}
  path.country.available:hover{fill:var(--red);}
  path.country.dim{fill:#E2E5E8;}
  .graticule{fill:none; stroke:var(--line); stroke-width:0.5; opacity:0.5;}

  .globe-hint{
    text-align:center;
    font-family:'IBM Plex Mono',monospace;
    font-size:11.5px;
    color:var(--ink-soft);
    margin:6px 0 30px;
  }
  .globe-tooltip{
    position:absolute;
    pointer-events:none;
    background:var(--ink);
    color:#fff;
    font-size:12px;
    padding:6px 10px;
    border-radius:6px;
    transform:translate(-50%,-130%);
    white-space:nowrap;
    opacity:0;
    transition:opacity 0.1s;
    z-index:5;
  }
  .globe-tooltip.show{opacity:1;}

  /* ---------- Country view ---------- */
  .crumb-bar{
    max-width:1180px;
    margin:0 auto;
    padding:28px 24px 0;
  }
  .crumb-btn{
    font-family:'Inter',sans-serif;
    font-size:13px;
    font-weight:600;
    color:var(--ink-soft);
    background:none;
    border:1px solid var(--line);
    border-radius:999px;
    padding:8px 16px 8px 12px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:6px;
  }
  .crumb-btn:hover{color:var(--red-deep); border-color:var(--red);}

  .country-hero{
    max-width:1180px;
    margin:0 auto;
    padding:20px 24px 8px;
  }
  .country-flag-stripe{
    width:44px; height:6px; border-radius:3px;
    margin-bottom:14px;
  }
  .country-flag-stripe.pe{background:linear-gradient(90deg, var(--red) 33%, #fff 33%, #fff 66%, var(--red) 66%); border:1px solid var(--line);}
  .country-flag-stripe.ar{background:linear-gradient(90deg, #6FA8DC 33%, #fff 33%, #fff 66%, #6FA8DC 66%); border:1px solid var(--line);}
  .country-hero h2{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:clamp(28px,4vw,40px);
    margin:0 0 8px;
  }
  .country-hero p{
    color:var(--ink-soft);
    font-size:15px;
    max-width:580px;
    line-height:1.55;
    margin:0 0 26px;
  }

  .election-grid{
    max-width:1180px;
    margin:0 auto;
    padding:0 24px 80px;
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:16px;
  }
  .election-card{
    background:var(--paper-raised);
    border:1px solid var(--line);
    border-radius:14px;
    padding:20px;
    box-shadow:var(--shadow);
    cursor:pointer;
    transition:border-color 0.15s, transform 0.1s;
  }
  .election-card:hover{border-color:var(--red); transform:translateY(-2px);}
  .election-card .tag{
    font-family:'IBM Plex Mono',monospace;
    font-size:10.5px;
    text-transform:uppercase;
    letter-spacing:0.06em;
    color:var(--red-deep);
    background:var(--red-bg);
    padding:4px 9px;
    border-radius:999px;
    display:inline-block;
    margin-bottom:12px;
  }
  .election-card h3{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:19px;
    margin:0 0 8px;
    line-height:1.25;
  }
  .election-card p{
    font-size:13px;
    color:var(--ink-soft);
    margin:0;
    line-height:1.5;
  }
  .election-card-empty{
    background:none;
    border:1.5px dashed var(--line);
    border-radius:14px;
    padding:30px 20px;
    text-align:center;
    color:var(--ink-soft);
    font-size:13.5px;
    cursor:default;
  }
  .election-card-empty:hover{border-color:var(--line); transform:none;}
  .election-card-empty .big{
    font-family:'Fraunces',serif;
    color:var(--ink);
    font-size:18px;
    margin-bottom:6px;
  }

  /* ---------- Upcoming world elections calendar ---------- */
  .calendar-section{
    max-width:880px;
    margin:8px auto 0;
    padding:0 24px 60px;
  }
  .calendar-head{
    text-align:center;
    margin-bottom:26px;
  }
  .calendar-head .eyebrow{justify-content:center; margin-bottom:10px;}
  .calendar-head h2{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:clamp(24px,3.5vw,32px);
    margin:0 0 8px;
  }
  .calendar-head p{
    color:var(--ink-soft);
    font-size:14px;
    max-width:520px;
    margin:0 auto;
    line-height:1.55;
  }

  .timeline{
    position:relative;
    border-left:1.5px dashed var(--line);
    margin-left:14px;
  }
  .timeline-row{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    padding:13px 0 13px 26px;
  }
  .timeline-row::before{
    content:"";
    position:absolute;
    left:-5.5px;
    top:50%;
    transform:translateY(-50%);
    width:9px;height:9px;
    border-radius:50%;
    background:var(--red);
    border:2px solid var(--paper);
    box-shadow:0 0 0 1.5px var(--red);
  }
  .timeline-flag{
    font-size:22px;
    line-height:1;
    flex-shrink:0;
    width:30px;
    text-align:center;
  }
  .timeline-body{
    flex:1;
    min-width:0;
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:4px 10px;
  }
  .timeline-country{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:15.5px;
    white-space:nowrap;
  }
  .timeline-election{
    font-size:13px;
    color:var(--ink-soft);
  }
  .timeline-date{
    font-family:'IBM Plex Mono',monospace;
    font-size:11.5px;
    color:var(--red-deep);
    background:var(--red-bg);
    padding:3px 9px;
    border-radius:999px;
    white-space:nowrap;
    margin-left:auto;
  }
  .calendar-source{
    text-align:center;
    font-size:11.5px;
    color:var(--ink-soft);
    margin-top:22px;
  }
  .calendar-source a{color:var(--red-deep); text-decoration:none;}
  .calendar-source a:hover{text-decoration:underline;}

  @media (max-width:560px){
    .timeline-date{margin-left:0;}
    .timeline-body{flex-direction:column; align-items:flex-start; gap:2px;}
  }

  /* ---------- Countdown ---------- */
  .countdown-block{
    display:flex;
    align-items:center;
    gap:14px;
    border-top:1px solid var(--line);
    padding-top:18px;
    margin-top:4px;
    flex-wrap:wrap;
  }
  .cd-label{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color:var(--ink-soft);
  }
  .cd-units{
    display:flex;
    gap:8px;
    align-items:center;
  }
  .cd-unit{
    background:var(--ink);
    color:#fff;
    border-radius:8px;
    padding:6px 10px;
    text-align:center;
    min-width:52px;
  }
  .cd-unit b{
    display:block;
    font-family:'IBM Plex Mono',monospace;
    font-size:22px;
    font-weight:600;
    line-height:1;
    color:#fff;
  }
  .cd-unit small{
    font-family:'IBM Plex Mono',monospace;
    font-size:9px;
    text-transform:uppercase;
    letter-spacing:0.06em;
    color:#9CA0AC;
    display:block;
    margin-top:3px;
  }
  .cd-sep{
    font-family:'IBM Plex Mono',monospace;
    font-weight:600;
    font-size:18px;
    color:var(--red);
    line-height:1;
    margin-bottom:10px;
  }
  .cd-date-note{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:var(--red-deep);
    background:var(--red-bg);
    padding:5px 10px;
    border-radius:999px;
    white-space:nowrap;
  }

  /* ---------- Share button + toast ---------- */
  .share-btn{
    font-family:'Inter',sans-serif;
    font-size:13px;
    font-weight:600;
    color:var(--paper-raised);
    background:var(--red-deep);
    border:none;
    border-radius:8px;
    padding:10px 16px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:7px;
    flex-shrink:0;
  }
  .share-btn:hover{background:var(--red);}
  .share-btn svg{width:15px;height:15px;}

  .toast{
    position:fixed;
    bottom:28px;
    left:50%;
    transform:translateX(-50%) translateY(20px);
    background:var(--ink);
    color:#fff;
    font-size:13.5px;
    padding:12px 22px;
    border-radius:10px;
    box-shadow:0 8px 30px rgba(0,0,0,0.2);
    z-index:999;
    opacity:0;
    pointer-events:none;
    transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    white-space:nowrap;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .toast.show{
    opacity:1;
    transform:translateX(-50%) translateY(0);
  }
  .toast svg{width:16px;height:16px;color:#5BBE8A;flex-shrink:0;}

  /* ---------- Search hero (above controls) ---------- */
  .search-hero{
    max-width:1180px;
    margin:0 auto;
    padding:22px 24px 0;
  }
  .search-hero-inner{
    background:linear-gradient(135deg, var(--ink) 0%, #2B2050 100%);
    border-radius:18px;
    padding:30px 32px;
    position:relative;
    overflow:hidden;
  }
  .search-hero-inner::before{
    content:"";
    position:absolute;
    top:-60px; right:-60px;
    width:260px; height:260px;
    background:radial-gradient(circle, rgba(200,29,37,0.25) 0%, transparent 70%);
    pointer-events:none;
  }
  .search-hero-inner::after{
    content:"";
    position:absolute;
    bottom:-40px; left:10%;
    width:200px; height:200px;
    background:radial-gradient(circle, rgba(181,135,46,0.15) 0%, transparent 70%);
    pointer-events:none;
  }
  .hero-eyebrow{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:0.1em;
    color:#9CA0AC;
    margin-bottom:12px;
  }
  .hero-headline{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:clamp(22px,3.5vw,32px);
    color:#fff;
    margin:0 0 6px;
    line-height:1.15;
  }
  .hero-headline em{
    font-style:italic;
    color:#E68F89;
  }
  .hero-rotating{
    display:inline-block;
    min-width:220px;
    color:#E68F89;
    border-bottom:2px solid rgba(230,143,137,0.4);
  }
  .hero-sub{
    font-size:14px;
    color:#9CA0AC;
    margin:0 0 22px;
    max-width:520px;
    line-height:1.5;
  }
  .quick-chips{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }
  .quick-chip{
    font-family:'Inter',sans-serif;
    font-size:12.5px;
    font-weight:500;
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.15);
    color:#D7D9DE;
    padding:7px 14px;
    border-radius:999px;
    cursor:pointer;
    transition:background 0.15s, border-color 0.15s;
    white-space:nowrap;
  }
  .quick-chip:hover{
    background:rgba(200,29,37,0.25);
    border-color:rgba(200,29,37,0.5);
    color:#fff;
  }

  /* ---------- Stats panel (shown before any filter) ---------- */
  .stats-panel{
    max-width:1180px;
    margin:0 auto;
    padding:22px 24px 40px;
  }
  .stats-panel-head{
    margin-bottom:22px;
  }
  .stats-panel-head h3{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:clamp(20px,3vw,26px);
    margin:0 0 6px;
  }
  .stats-panel-head p{
    font-size:13.5px;
    color:var(--ink-soft);
    max-width:560px;
    margin:0;
    line-height:1.5;
  }
  .auth-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:14px;
    margin-bottom:22px;
  }
  .auth-card{
    background:var(--paper-raised);
    border:1px solid var(--line);
    border-radius:14px;
    padding:18px 20px;
    box-shadow:var(--shadow);
  }
  .auth-card-head{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:14px;
  }
  .auth-icon{
    font-size:22px;
    line-height:1;
  }
  .auth-card-title{
    font-family:'Fraunces',serif;
    font-weight:600;
    font-size:16px;
    margin:0;
  }
  .auth-card-sub{
    font-size:12px;
    color:var(--ink-soft);
    margin:0;
  }
  .auth-rows{
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .auth-row{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:10px;
    font-size:13.5px;
    padding-bottom:8px;
    border-bottom:1px dashed var(--line);
  }
  .auth-row:last-child{border-bottom:none; padding-bottom:0;}
  .auth-row .label{color:var(--ink-soft);}
  .auth-row .val{
    font-family:'IBM Plex Mono',monospace;
    font-weight:600;
    font-size:16px;
    color:var(--ink);
  }
  .auth-total-card{
    background:var(--ink);
    color:#fff;
    border-radius:14px;
    padding:20px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    flex-wrap:wrap;
  }
  .auth-total-left{
    font-family:'Fraunces',serif;
    font-size:15px;
    color:#9CA0AC;
    font-style:italic;
  }
  .auth-total-left b{
    display:block;
    font-style:normal;
    font-size:clamp(28px,4vw,38px);
    color:#fff;
    line-height:1;
    margin-bottom:4px;
  }
  .auth-total-right{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
  }
  .auth-mini-stat{
    text-align:center;
    font-family:'IBM Plex Mono',monospace;
  }
  .auth-mini-stat b{
    display:block;
    font-size:20px;
    color:#E68F89;
    line-height:1;
  }
  .auth-mini-stat small{
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:0.06em;
    color:#6E7280;
  }
  .stats-cta{
    text-align:center;
    padding:30px 20px;
    color:var(--ink-soft);
  }
  .stats-cta .big{
    font-family:'Fraunces',serif;
    font-size:22px;
    color:var(--ink);
    margin-bottom:8px;
  }
  .stats-cta .hint{
    font-size:14px;
    color:var(--ink-soft);
    line-height:1.5;
  }

  /* ---------- Floating action buttons ---------- */
  .fab-group{
    position:fixed;
    bottom:28px;
    right:24px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
    z-index:200;
  }
  .fab{
    width:50px;height:50px;
    border-radius:50%;
    border:none;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 16px rgba(0,0,0,0.18);
    transition:transform 0.18s, opacity 0.18s;
  }
  .fab:hover{transform:scale(1.1);}
  .fab-top{
    background:var(--ink);
    color:#fff;
    opacity:0;
    pointer-events:none;
    transform:scale(0.85);
    transition:opacity 0.25s, transform 0.25s;
  }
  .fab-top.visible{
    opacity:1;
    pointer-events:auto;
    transform:scale(1);
  }
  .fab-top:hover{transform:scale(1.1);}
  .fab-top svg{width:20px;height:20px;}
  .fab-wa{
    background:#25D366;
    width:56px;height:56px;
  }
  .fab-wa svg{width:30px;height:30px;}
  .site-footer{
    background:var(--ink);
    color:#D7D9DE;
    margin-top:10px;
  }
  .footer-inner{
    max-width:1180px;
    margin:0 auto;
    padding:54px 24px 28px;
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr 1fr;
    gap:36px;
  }
  .footer-brand .eyebrow{color:#E68F89;}
  .footer-brand .eyebrow::before{background:#E68F89;}
  .footer-brand h3{
    font-family:'Fraunces',serif;
    font-style:italic;
    font-weight:500;
    font-size:26px;
    color:#fff;
    margin:12px 0 12px;
  }
  .footer-brand p{
    font-size:13px;
    line-height:1.6;
    color:#9CA0AC;
    max-width:280px;
    margin:0 0 18px;
  }
  .footer-pulse{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:#9CA0AC;
    border:1px solid #33363f;
    border-radius:999px;
    padding:6px 12px;
  }
  .footer-pulse .dot{
    width:6px;height:6px;border-radius:50%;
    background:#5BBE8A;
    box-shadow:0 0 0 3px rgba(91,190,138,0.18);
  }
  .footer-col h4{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color:#9CA0AC;
    margin:0 0 16px;
  }
  .footer-col ul{
    list-style:none;
    margin:0; padding:0;
    display:flex; flex-direction:column; gap:11px;
  }
  .footer-col a, .footer-col span{
    font-size:13.5px;
    color:#D7D9DE;
    text-decoration:none;
    cursor:pointer;
  }
  .footer-col a:hover{color:#fff;}
  .footer-stat-mini{
    font-family:'IBM Plex Mono',monospace;
    font-size:11px;
    color:#6E7280;
  }
  .footer-bottom{
    max-width:1180px;
    margin:0 auto;
    padding:20px 24px 30px;
    border-top:1px solid #2B2E37;
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    gap:10px;
    font-size:12px;
    color:#6E7280;
  }
  .footer-bottom .ftag{
    font-family:'IBM Plex Mono',monospace;
  }
  .footer-politon{
    display:flex;
    align-items:center;
  }
  .politon-link{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    padding:8px 14px;
    border:1px solid #33363f;
    border-radius:10px;
    transition:border-color 0.15s, background 0.15s;
  }
  .politon-link:hover{
    border-color:#C81D25;
    background:rgba(200,29,37,0.08);
  }
  .politon-logo{
    height:32px;
    width:auto;
    object-fit:contain;
    flex-shrink:0;
  }
  .politon-text{
    font-size:12px;
    color:#9CA0AC;
    line-height:1.35;
  }
  .politon-text strong{
    color:#fff;
    display:block;
    font-size:13px;
    letter-spacing:0.05em;
  }

  @media (max-width:760px){
    .footer-inner{grid-template-columns:1fr 1fr; gap:30px 24px;}
  }
  @media (max-width:480px){
    .footer-inner{grid-template-columns:1fr;}
  }

  /* ============================================================
     MOBILE FILTER FIX — v22 patch
     ============================================================ */

  /* Quick-chips: scroll horizontal en lugar de desbordarse */
  .quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .quick-chips::-webkit-scrollbar { display: none; }
  .quick-chip { white-space: nowrap; flex-shrink: 0; }

  /* ── mobile ≤ 640 px ── */
  @media (max-width: 640px) {

    /* Reducir padding del contenedor sticky */
    .controls {
      padding: 10px 12px;
    }

    .controls-inner {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    /* Barra de búsqueda: ancho completo */
    .search-wrap {
      flex: 1 1 100%;
      min-width: 0;
    }
    .search-wrap input {
      font-size: 15px; /* evita zoom en iOS */
      width: 100%;
      box-sizing: border-box;
    }

    /* Botón "Filtros" toggle: ancho completo */
    .filters-toggle {
      width: 100%;
      justify-content: space-between;
      padding: 10px 14px;
      font-size: 14px;
    }

    /* Grid de filtros desplegado: 2 columnas limpias */
    .filters-grid.open {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      width: 100%;
      padding-top: 4px;
    }

    /* Selects: ancho completo, texto truncado, sin desbordarse */
    .filters-grid.open select {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      font-size: 13px;
      padding: 9px 10px;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      -webkit-appearance: none;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      padding-right: 28px;
    }

    /* "Organización política" ocupa las 2 columnas por ser largo */
    #fOrg {
      grid-column: 1 / -1;
    }

    /* Botón limpiar: siempre en la última fila, ancho completo */
    .filters-grid.open .clear-btn {
      grid-column: 1 / -1;
      width: 100%;
      text-align: center;
      padding: 10px;
      margin-top: 2px;
    }
  }

  /* ── mobile muy pequeño ≤ 380 px ── */
  @media (max-width: 380px) {
    .controls { padding: 8px 10px; }

    /* 1 columna en pantallas muy estrechas */
    .filters-grid.open {
      grid-template-columns: 1fr;
    }
    #fOrg { grid-column: 1; }
    .filters-grid.open .clear-btn { grid-column: 1; }
  }

  /* Timeline year divider */
  .timeline-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--red, #C81D25);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 18px 0 6px 26px;
    opacity: 0.85;
  }
  /* Clickable timeline rows (linked countries) */
  .timeline-row-link {
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
  }
  .timeline-row-link:hover {
    background: rgba(200, 29, 37, 0.07);
  }
  .timeline-row-link .timeline-country::after {
    content: ' →';
    opacity: 0.5;
    font-size: 11px;
  }
