:root{
    --bg:#F8F7F1;
    --surface:#FFFFFF;
    --surface-2:#F1EEE3;
    --ink:#191D24;
    --ink-soft:#535A6B;
    --ink-faint:#8B8F9C;
    --line:#E2DDCE;
    --line-strong:#CFC8B3;
    --accent:#2F5D46;
    --accent-ink:#FFFFFF;
    --accent-soft:#E3ECE6;
    --accent-strong:#234A38;
    --seal:#A6862F;
    --seal-soft:#F3E9D2;
    --danger:#8C3F3F;
    --danger-soft:#F5E5E1;
    --map-ocean:#EFEBDC;
    --map-land:#D9D2BC;
    --map-land-hover:#BFCFC3;
    --map-land-active:#8FB39C;
    --map-border:#F8F7F1;
    --radius-s:6px;
    --radius-m:12px;
    --radius-l:20px;
    --shadow-card:0 1px 2px rgba(25,29,36,0.06), 0 1px 1px rgba(25,29,36,0.04);
    --font-display:'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body:'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#14171C; --surface:#1B1F26; --surface-2:#20242D; --ink:#EDEBE3; --ink-soft:#ABB0BD; --ink-faint:#6E7482;
      --line:#2B303A; --line-strong:#3A404C; --accent:#6FBE95; --accent-ink:#0D1712; --accent-soft:#1E2E27; --accent-strong:#8ED4AC;
      --seal:#D8B565; --seal-soft:#2E2717; --danger:#D98F8F; --danger-soft:#332020; --shadow-card:0 1px 2px rgba(0,0,0,0.35);
      --map-ocean:#171B21; --map-land:#2B3038; --map-land-hover:#37473F; --map-land-active:#3E6E56; --map-border:#14171C;
    }
  }
  :root[data-theme="dark"]{
    --bg:#14171C; --surface:#1B1F26; --surface-2:#20242D; --ink:#EDEBE3; --ink-soft:#ABB0BD; --ink-faint:#6E7482;
    --line:#2B303A; --line-strong:#3A404C; --accent:#6FBE95; --accent-ink:#0D1712; --accent-soft:#1E2E27; --accent-strong:#8ED4AC;
    --seal:#D8B565; --seal-soft:#2E2717; --danger:#D98F8F; --danger-soft:#332020; --shadow-card:0 1px 2px rgba(0,0,0,0.35);
    --map-ocean:#171B21; --map-land:#2B3038; --map-land-hover:#37473F; --map-land-active:#3E6E56; --map-border:#14171C;
  }

  *{box-sizing:border-box;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font-family:var(--font-body);
    font-size:16px;
    line-height:1.55;
    padding-inline:20px;
  }
  a{color:inherit;}
  h1,h2,h3{font-family:var(--font-display); text-wrap:balance; margin:0;}
  .mono{font-family:var(--font-mono); letter-spacing:0.01em;}
  .eyebrow{
    font-family:var(--font-mono);
    font-size:0.72rem;
    letter-spacing:0.09em;
    text-transform:uppercase;
    color:var(--ink-faint);
  }
  .visually-hidden{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
  .skip-link{
    position:absolute; left:-999px; top:0; background:var(--accent); color:var(--accent-ink);
    padding:10px 16px; border-radius:0 0 8px 0; z-index:100;
  }
  .skip-link:focus{left:0;}

  button, .btn{
    font-family:var(--font-body);
    font-size:0.95rem;
    font-weight:600;
    border-radius:999px;
    border:1px solid transparent;
    padding:11px 22px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
    text-decoration:none;
    transition:transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  }
  button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, path.country:focus-visible{
    outline:2px solid var(--accent);
    outline-offset:2px;
  }
  .btn-primary{ background:var(--accent); color:var(--accent-ink); }
  .btn-primary:hover{ transform:translateY(-1px); }
  .btn-ghost{ background:transparent; color:var(--ink); border-color:var(--line-strong); }
  .btn-ghost:hover{ border-color:var(--accent); }
  .btn-sm{ padding:8px 16px; font-size:0.85rem; }
  .btn-block{ width:100%; justify-content:center; }
  @media (prefers-reduced-motion: reduce){
    *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
  }

  /* ---------- shell ---------- */
  .wrap{ max-width:1080px; margin-inline:auto; }
  .wrap-narrow{ max-width:720px; margin-inline:auto; }
  .wrap-wide{ max-width:1160px; margin-inline:auto; }

  .site-header{
    padding-block:18px;
    border-bottom:1px solid var(--line);
  }
  .header-inner{
    max-width:1160px; margin-inline:auto;
    display:flex; align-items:center; justify-content:space-between; gap:20px;
    flex-wrap:wrap;
  }
  .wordmark{
    display:flex; align-items:center; gap:10px;
    font-family:var(--font-display); font-weight:600; font-size:1.28rem;
    text-decoration:none; color:var(--ink);
  }
  .wordmark svg{ flex:none; }
  .site-nav{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .nav-link{
    font-size:0.92rem; font-weight:600; text-decoration:none; color:var(--ink-soft);
    padding:8px 12px; border-radius:999px;
  }
  .nav-link:hover{ color:var(--ink); background:var(--surface-2); }
  .nav-link.is-active{ color:var(--ink); background:var(--surface-2); }
  .nav-cta{ color:var(--accent-ink) !important; background:var(--accent); }
  .nav-cta:hover{ background:var(--accent-strong); }

  /* Language switcher (shell/category-label translations — see growth-strategy.md Tier 2).
     Styled to sit quietly alongside the nav links it's appended next to by i18n.js, not to compete
     with them visually. */
  #lang-switcher{
    font-size:0.82rem; font-weight:600; color:var(--ink-soft);
    background:var(--surface-2); border:1px solid var(--line); border-radius:999px;
    padding:6px 10px; margin-inline-start:4px; cursor:pointer;
  }
  #lang-switcher:hover{ color:var(--ink); }

  main{ display:block; padding-bottom:80px; }

  .site-footer{
    border-top:1px solid var(--line);
    padding-block:28px;
    margin-top:40px;
  }
  .footer-inner{
    max-width:1160px; margin-inline:auto;
    display:flex; flex-direction:column; gap:14px;
    color:var(--ink-faint); font-size:0.85rem;
  }
  .footer-inner a{ color:var(--ink-soft); text-decoration:underline; text-underline-offset:2px; }
  /* Privacy/Terms/About/Contact — utility pages, deliberately kept out of the main nav (per
     Francis, 2026-09-30) and given their own quiet row here instead, above the existing
     copyright/contact line, so they read as a secondary tier rather than competing with the
     product's real navigation (Explore/Directory/How it works/Submit). */
  .footer-links{ display:flex; gap:16px; flex-wrap:wrap; }
  .footer-links a{ font-weight:600; text-decoration:none; }
  .footer-links a:hover{ text-decoration:underline; color:var(--ink); }
  .footer-bottom{ display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }

  /* ---------- explore / home ---------- */
  .explore-hero{
    padding-block:44px 8px;
    text-align:center;
  }
  .explore-hero-inner{ max-width:640px; margin-inline:auto; display:grid; gap:14px; justify-items:center; }
  .explore-hero h1{ font-size:clamp(1.9rem, 4vw, 2.6rem); font-weight:600; line-height:1.12; }
  .explore-hero p.lede{ color:var(--ink-soft); font-size:1.02rem; max-width:48ch; }
  .hero-stat{
    display:inline-flex; align-items:baseline; gap:8px;
    font-family:var(--font-mono); font-size:0.85rem; color:var(--ink-faint);
  }
  .hero-stat strong{ font-size:1.02rem; color:var(--ink); font-family:var(--font-mono); }

  /* search / jump bar */
  .search-bar{
    max-width:720px; margin:22px auto 0;
    display:flex; align-items:stretch;
    background:var(--surface);
    border:1px solid var(--line-strong);
    border-radius:999px;
    box-shadow:var(--shadow-card);
    padding:6px;
    gap:6px;
    position:relative;
  }
  .search-bar .icon{ display:flex; align-items:center; padding-left:12px; color:var(--ink-faint); flex:none; }
  .search-bar input[type="search"]{
    flex:1 1 auto; min-width:0; border:none; background:transparent; font-family:var(--font-body);
    font-size:0.98rem; padding:10px 8px; color:var(--ink); outline:none;
  }
  .search-bar .divider{ width:1px; background:var(--line); margin-block:8px; flex:none; }
  .jump-field{ display:flex; align-items:center; gap:6px; flex:none; padding-right:6px; }
  .jump-field select{
    border:none; background:transparent; font-family:var(--font-body); font-weight:600; font-size:0.88rem;
    color:var(--ink-soft); padding:10px 10px 10px 2px; outline:none; cursor:pointer; max-width:170px;
  }
  @media (max-width:600px){
    .search-bar{ flex-wrap:wrap; border-radius:var(--radius-m); }
    .search-bar .divider{ display:none; }
    .jump-field{ width:100%; border-top:1px solid var(--line); padding-top:6px; justify-content:flex-start; }
  }
  .search-suggest{
    position:absolute; top:calc(100% + 8px); left:0; right:0;
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-m);
    box-shadow:var(--shadow-card); overflow:hidden; z-index:20; text-align:left;
  }
  .search-suggest button{
    display:flex; width:100%; justify-content:space-between; gap:10px;
    border-radius:0; border:none; background:none; padding:11px 16px; font-weight:500;
    color:var(--ink); border-bottom:1px solid var(--line); cursor:pointer;
  }
  .search-suggest button:last-child{ border-bottom:none; }
  .search-suggest button:hover, .search-suggest button:focus-visible{ background:var(--surface-2); }
  .search-suggest .kind{ font-family:var(--font-mono); font-size:0.72rem; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.06em; }

  /* map */
  .map-section{ padding-block:30px 10px; }
  .map-frame{
    max-width:980px; margin-inline:auto;
    background:var(--map-ocean);
    border:1px solid var(--line);
    border-radius:var(--radius-l);
    padding:18px;
  }
  .map-frame svg{ width:100%; height:auto; display:block; }
  path.country{
    fill:var(--map-land);
    stroke:var(--map-border);
    stroke-width:0.6;
    cursor:pointer;
    transition:fill 0.12s ease;
  }
  path.country:hover{ fill:var(--map-land-hover); }
  path.country.has-entries{ fill:var(--map-land-active); }
  path.country.has-entries:hover{ fill:var(--accent); }
  .map-legend{
    display:flex; justify-content:center; gap:22px; flex-wrap:wrap;
    margin-top:14px; font-size:0.82rem; color:var(--ink-soft);
  }
  .map-legend span{ display:inline-flex; align-items:center; gap:7px; }
  .legend-swatch{ width:12px; height:12px; border-radius:3px; display:inline-block; }
  .browse-all-link{ text-align:center; margin-top:18px; font-size:0.9rem; }

  /* upcoming elections panel (homepage, below the map) */
  .upcoming-section{ padding-block:18px 40px; }
  .upcoming-frame{ max-width:900px; margin-inline:auto; }
  .upcoming-head{ text-align:center; margin-bottom:18px; }
  .upcoming-head h2{ font-size:1.4rem; margin-top:4px; }
  .upcoming-table-wrap{
    overflow-x:auto; background:var(--surface); border:1px solid var(--line);
    border-radius:var(--radius-m); box-shadow:var(--shadow-card);
  }
  .upcoming-table{ width:100%; border-collapse:collapse; min-width:640px; }
  .upcoming-table th{
    text-align:left; font-family:var(--font-mono); font-size:0.7rem; letter-spacing:0.06em;
    text-transform:uppercase; color:var(--ink-faint); font-weight:600;
    padding:12px 16px; border-bottom:1px solid var(--line); background:var(--surface-2); white-space:nowrap;
  }
  .upcoming-table td{ padding:12px 16px; border-bottom:1px solid var(--line); vertical-align:middle; }
  .upcoming-table tr:last-child td{ border-bottom:none; }
  .upcoming-td-flag{ width:1%; padding-right:0; }
  .upcoming-flag{ flex:none; width:26px; height:19px; display:flex; align-items:center; justify-content:center; }
  .upcoming-flag svg{ width:100%; height:100%; display:block; }
  .upcoming-flag path{ fill:var(--accent-soft); stroke:var(--accent); stroke-width:1.4; }
  .country-flag-mark{ display:inline-flex; }
  .country-flag-img{
    width:26px; height:19px; object-fit:cover; border-radius:3px;
    border:1px solid var(--line); box-shadow:0 0 0 1px rgba(0,0,0,0.02);
  }
  .country-flag-fallback{ display:inline-flex; width:26px; height:19px; }
  .upcoming-country{ font-family:var(--font-display); font-weight:600; font-size:0.98rem; color:var(--ink); text-decoration:none; white-space:nowrap; }
  .upcoming-country:hover{ color:var(--accent); }
  .upcoming-office{ color:var(--ink); font-size:0.9rem; }
  .upcoming-note{ color:var(--ink-faint); font-size:0.8rem; margin-top:4px; max-width:42ch; }
  .upcoming-note a{ color:var(--ink-faint); text-decoration:underline; text-underline-offset:2px; }
  .upcoming-date{ color:var(--ink-soft); font-size:0.88rem; white-space:nowrap; }
  .upcoming-countdown{
    display:inline-block; background:var(--seal-soft); color:var(--seal);
    border-radius:999px; padding:3px 11px; font-size:0.74rem; font-weight:600;
    font-family:var(--font-mono); white-space:nowrap;
  }
  .upcoming-countdown.is-soon{ background:var(--accent); color:var(--accent-ink); }
  .upcoming-more-note{ text-align:center; color:var(--ink-faint); font-size:0.82rem; margin-top:12px; }
  @media (max-width:640px){
    /* 5 columns is too dense to force onto a phone width without either scroll or crushed text.
       table-layout:fixed with explicit widths + wrapping keeps the 4 most important columns
       (flag/country/election type/countdown) legible without horizontal scroll; the exact date
       and the note/source line — both nice-to-haves once the countdown already tells you "how
       soon" — are hidden at this width rather than fought for. The full 5-column table (with
       exact dates) is still one swipe away via .upcoming-table-wrap's horizontal scroll if
       someone really wants it on a narrow screen — nothing is lost, just deprioritized. */
    .upcoming-table{ min-width:0; table-layout:fixed; }
    .upcoming-table th:nth-child(1), .upcoming-table td:nth-child(1){ width:11%; }
    .upcoming-table th:nth-child(2), .upcoming-table td:nth-child(2){ width:31%; }
    .upcoming-table th:nth-child(3), .upcoming-table td:nth-child(3){ width:35%; }
    .upcoming-table th:nth-child(4), .upcoming-table td:nth-child(4){ display:none; }
    .upcoming-table th:nth-child(5), .upcoming-table td:nth-child(5){ width:23%; }
    .upcoming-table th, .upcoming-table td{ padding:10px 4px; font-size:0.78rem; overflow-wrap:break-word; }
    .upcoming-country{ white-space:normal; }
    .upcoming-note{ display:none; }
    .country-flag-img, .country-flag-fallback{ width:22px; height:16px; }
    .upcoming-countdown{ padding:3px 6px; font-size:0.66rem; white-space:normal; display:inline; }
  }

  /* ---------- how it works strip (used on how-it-works page) ---------- */
  .steps{ display:grid; grid-template-columns:repeat(3,1fr); gap:0; border:1px solid var(--line); border-radius:var(--radius-m); overflow:hidden; margin-block:22px; }
  .step{ padding:22px 22px; border-left:1px solid var(--line); background:var(--surface); }
  .step:first-child{ border-left:none; }
  .step .step-num{ font-family:var(--font-mono); color:var(--seal); font-size:0.85rem; font-weight:600; display:block; margin-bottom:10px; }
  .step h3{ font-size:1.02rem; margin-bottom:6px; }
  .step p{ color:var(--ink-soft); font-size:0.9rem; margin:0; }
  @media (max-width:760px){
    .steps{ grid-template-columns:1fr; }
    .step{ border-left:none; border-top:1px solid var(--line); }
    .step:first-child{ border-top:none; }
  }

  /* ---------- directory / list pages ---------- */
  .section{ padding-block:44px; }
  .section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:22px; }
  .section-head h2{ font-size:1.5rem; }
  .country-head{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:6px; }
  .country-flag-dot{ width:34px; height:34px; border-radius:50%; background:var(--accent-soft); display:flex; align-items:center; justify-content:center; color:var(--accent); flex:none; }

  .filters{ display:grid; gap:10px; margin-bottom:26px; }
  .filters .search-row{ display:block; }
  .filters .select-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
  @media (max-width:760px){ .filters .select-row{ grid-template-columns:1fr 1fr; } }

  .field-control{
    font-family:var(--font-body); font-size:0.92rem; padding:11px 14px; border-radius:var(--radius-s);
    border:1px solid var(--line-strong); background:var(--surface); color:var(--ink); width:100%;
  }
  select.field-control{ appearance:none; background-image:linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%); background-position:calc(100% - 18px) center, calc(100% - 13px) center; background-size:5px 5px, 5px 5px; background-repeat:no-repeat; padding-right:34px;}

  .entry-list{ display:grid; gap:14px; }
  .entry-card{
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-m);
    padding:22px 24px; box-shadow:var(--shadow-card); display:grid; gap:10px; text-decoration:none; color:inherit;
  }
  .entry-card:hover{ border-color:var(--line-strong); }
  .entry-top{ display:flex; justify-content:space-between; gap:16px; align-items:flex-start; flex-wrap:wrap; }
  .entry-name{ font-family:var(--font-display); font-size:1.25rem; font-weight:600; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
  /* Small country flag riding next to the candidate's name — added purely for visual warmth on
     what would otherwise be a page of plain black-on-white text cards (per Francis, 2026-09-30).
     Reuses countryFlagHtml()'s image+fallback markup (same bundled flag-icons SVGs already used
     in the upcoming-elections table) but at a smaller size that sits comfortably next to text. */
  .name-flag .country-flag-img, .name-flag .country-flag-fallback{ width:22px; height:16px; }
  .name-flag{ flex:none; display:inline-flex; vertical-align:middle; margin-left:4px; border-radius:3px; overflow:hidden; }
  .party-row{ display:inline-flex; align-items:center; gap:6px; font-size:0.82rem; font-weight:600; color:var(--ink-soft); margin:3px 0 2px; }
  .party-mark{ display:inline-flex; align-items:center; }
  .party-logo{ width:18px; height:18px; object-fit:contain; border-radius:4px; background:#fff; border:1px solid var(--line); flex-shrink:0; }
  .detail-party{ margin-bottom:8px; }
  .detail-party .party-row{ font-size:0.9rem; }
  .detail-party .party-logo{ width:26px; height:26px; border-radius:5px; }
  .entry-meta{ color:var(--ink-soft); font-size:0.9rem; }
  .entry-meta .sep{ color:var(--ink-faint); margin-inline:6px; }
  .entry-excerpt{ color:var(--ink-soft); font-size:0.95rem; max-width:70ch; }
  .entry-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .read-link{ font-weight:600; font-size:0.9rem; color:var(--accent); }

  /* Checkbox sits beside the card rather than inside its <a>, so selecting it never triggers
     card navigation and needs no click-propagation handling. */
  .entry-card-row{ display:flex; align-items:flex-start; gap:10px; }
  .entry-card-row .entry-card{ flex:1 1 auto; }
  .entry-compare-check{
    flex:none; display:flex; align-items:center; justify-content:center; width:24px; height:22px;
    margin-top:22px; cursor:pointer;
  }
  .entry-compare-check input{ width:18px; height:18px; cursor:pointer; accent-color:var(--accent); }
  .entry-compare-check input:disabled{ cursor:not-allowed; opacity:0.4; }

  .compare-bar{
    position:sticky; bottom:16px; margin-top:16px; border:1px solid var(--accent); background:var(--surface);
    border-radius:var(--radius-m); padding:14px 18px; display:flex; align-items:center; justify-content:space-between;
    gap:14px; flex-wrap:wrap; box-shadow:var(--shadow-card); font-size:0.92rem;
  }
  .compare-grid{ display:grid; gap:20px; align-items:start; }
  .compare-grid-2{ grid-template-columns:1fr 1fr; }
  .compare-grid-3{ grid-template-columns:1fr 1fr 1fr; }
  @media (max-width:820px){
    .compare-grid-2, .compare-grid-3{ grid-template-columns:1fr; }
  }
  .compare-card{
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-m);
    padding:22px 24px; box-shadow:var(--shadow-card); min-width:0;
  }
  .compare-card .detail-body{ max-width:none; font-size:0.96rem; }
  .compare-card .references-section{ max-width:none; }

  .seal-badge{
    display:inline-flex; align-items:center; gap:6px; background:var(--seal-soft); color:var(--seal);
    border-radius:999px; padding:5px 10px 5px 8px; font-family:var(--font-mono); font-size:0.72rem; font-weight:500;
    letter-spacing:0.02em; white-space:nowrap;
  }

  .empty-state{
    border:1px dashed var(--line-strong); border-radius:var(--radius-m); padding:48px 28px; text-align:center;
    display:grid; gap:14px; justify-items:center; background:var(--surface-2);
  }
  .empty-state h3{ font-size:1.2rem; }
  .empty-state p{ color:var(--ink-soft); max-width:46ch; margin:0; }

  /* ---------- how it works page ---------- */
  .prose h2{ font-size:1.7rem; margin-bottom:14px; }
  .prose h3{ font-size:1.15rem; margin:26px 0 8px; }
  .prose p{ color:var(--ink-soft); max-width:66ch; }
  .callout{
    border-left:3px solid var(--seal); background:var(--seal-soft); border-radius:0 var(--radius-s) var(--radius-s) 0;
    padding:16px 18px; color:var(--ink); font-size:0.94rem; max-width:66ch; margin-block:20px;
  }
  .callout strong{ color:var(--ink); }

  /* ---------- forms ---------- */
  .form-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-l); padding:32px; box-shadow:var(--shadow-card); }
  @media (max-width:600px){ .form-card{ padding:22px 18px; } }
  .form-grid{ display:grid; gap:18px; }
  .form-row{ display:grid; gap:14px; grid-template-columns:1fr 1fr; }
  @media (max-width:600px){ .form-row{ grid-template-columns:1fr; } }
  label{ font-size:0.86rem; font-weight:600; display:block; margin-bottom:6px; }
  .field-hint{ font-size:0.8rem; color:var(--ink-faint); margin-top:5px; }
  textarea.field-control{ min-height:220px; resize:vertical; font-family:var(--font-body); line-height:1.6; }
  .checkbox-row{ display:flex; gap:10px; align-items:flex-start; font-size:0.88rem; color:var(--ink-soft); }
  .checkbox-row input{ margin-top:3px; flex:none; }
  .field-control:disabled{ opacity:0.5; cursor:not-allowed; }
  .tag-insert-row{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
  .tag-insert-btn{
    font-family:var(--font-mono); font-size:0.72rem; font-weight:500; letter-spacing:0.01em;
    background:var(--accent-soft); color:var(--accent-strong); border:1px solid transparent;
    border-radius:999px; padding:5px 11px; cursor:pointer;
  }
  .tag-insert-btn:hover{ border-color:var(--accent); }
  .reference-row{ display:grid; grid-template-columns:1fr 1.3fr auto; gap:8px; margin-bottom:8px; align-items:center; }
  @media (max-width:600px){ .reference-row{ grid-template-columns:1fr; } }
  .reference-remove{
    width:32px; height:32px; border-radius:50%; border:1px solid var(--line-strong); background:var(--surface);
    color:var(--ink-soft); font-size:1rem; line-height:1; cursor:pointer; flex:none;
  }
  .reference-remove:hover{ border-color:var(--danger); color:var(--danger); }
  @media (max-width:600px){ .reference-remove{ justify-self:start; } }
  .add-reference-btn{
    font-family:var(--font-body); font-size:0.85rem; font-weight:600; color:var(--accent);
    background:none; border:none; padding:4px 0; cursor:pointer;
  }
  .campaign-link{ display:inline-flex; align-items:center; gap:5px; font-size:0.88rem; font-weight:600; color:var(--accent); text-decoration:none; margin-bottom:10px; }
  .campaign-link:hover{ text-decoration:underline; }
  .references-section{ margin-top:24px; max-width:70ch; }
  .references-section h3{ font-size:1.05rem; margin-bottom:10px; }
  .references-section ul{ margin:0; padding-left:18px; display:grid; gap:6px; font-size:0.92rem; }
  .references-section a{ color:var(--accent); }
  .error-list{ background:var(--danger-soft); color:var(--danger); border-radius:var(--radius-s); padding:14px 16px; font-size:0.88rem; display:grid; gap:4px; }
  .confirm-panel{ border:1px solid var(--accent); background:var(--accent-soft); border-radius:var(--radius-m); padding:22px; display:grid; gap:12px; margin-top:20px; }
  .confirm-panel h3{ font-size:1.05rem; }
  .copy-box{ width:100%; min-height:180px; font-family:var(--font-mono); font-size:0.82rem; border-radius:var(--radius-s); border:1px solid var(--line-strong); padding:12px; background:var(--surface); color:var(--ink); }

  /* ---------- detail ---------- */
  .detail-head{ margin-bottom:24px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .back-link{ display:inline-flex; align-items:center; gap:6px; font-size:0.88rem; font-weight:600; color:var(--ink-soft); text-decoration:none; }
  .back-link:hover{ color:var(--ink); }
  .detail-title{ font-size:clamp(1.6rem, 4vw, 2.2rem); margin-bottom:10px; }
  .detail-meta{ color:var(--ink-soft); font-size:0.95rem; margin-bottom:18px; }
  .detail-body{ display:grid; gap:16px; max-width:70ch; font-size:1.02rem; color:var(--ink); }
  .detail-body p{ margin:0; }
  .permanence-note{ margin-top:32px; padding-top:20px; border-top:1px solid var(--line); color:var(--ink-faint); font-size:0.85rem; max-width:60ch; }

  /* ---------- country dashboard ---------- */
  .country-dashboard{ display:grid; grid-template-columns:minmax(220px,20%) 1fr; border:1px solid var(--line); border-radius:var(--radius-l); overflow:hidden; background:var(--surface); box-shadow:var(--shadow-card); }
  .dash-sidebar{ background:var(--surface-2); border-right:1px solid var(--line); padding:26px 22px; display:flex; flex-direction:column; gap:18px; }
  .dash-sidebar h2{ font-size:1.3rem; }
  .dash-back{ font-size:0.85rem; font-weight:600; color:var(--ink-soft); text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
  .dash-back:hover{ color:var(--ink); }
  .dash-outline{ display:flex; justify-content:center; padding-block:4px; }
  .dash-outline svg{ width:100%; max-width:140px; height:auto; }
  .dash-outline path{ fill:var(--accent-soft); stroke:var(--accent); stroke-width:1.4; }
  .dash-divider{ height:1px; background:var(--line); }
  .dash-elections h3{ font-family:var(--font-mono); font-size:0.7rem; letter-spacing:0.09em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:12px; }
  .election-row{ display:flex; justify-content:space-between; gap:10px; font-size:0.85rem; padding-block:7px; border-bottom:1px dashed var(--line); }
  .election-row:last-child{ border-bottom:none; }
  .election-row .office{ color:var(--ink-soft); }
  .election-row .date{ font-family:var(--font-mono); font-size:0.78rem; color:var(--ink); text-align:right; }
  .dash-main{ padding:26px 28px; min-width:0; }
  .level-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:22px; }
  .level-tab{ font-family:var(--font-body); font-size:0.86rem; font-weight:600; padding:9px 16px; border-radius:999px; border:1px solid var(--line-strong); background:var(--surface); color:var(--ink-soft); cursor:pointer; }
  .level-tab:hover{ border-color:var(--accent); color:var(--ink); }
  /* A level tab with at least one manifesto on record gets a light accent tint, so it's obvious
     at a glance which tabs are worth clicking before you click them; a tab with nothing yet
     stays plain white/outline (.level-tab's default look) rather than inviting a click into an
     empty state. Declared after the base/:hover rule but before .is-active (same specificity as
     .is-active) so the active tab's solid fill always wins over the tint when a tab is both. */
  .level-tab.has-content{ border-color:var(--accent); color:var(--accent-strong); background:var(--accent-soft); }
  .level-tab.has-content:hover{ border-color:var(--accent-strong); color:var(--accent-strong); }
  .level-tab.is-active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
  @media (max-width:820px){
    .country-dashboard{ grid-template-columns:1fr; }
    .dash-sidebar{ border-right:none; border-bottom:1px solid var(--line); flex-direction:row; flex-wrap:wrap; align-items:center; }
    .dash-outline{ order:1; flex:none; width:100px; }
    .dash-sidebar h2{ order:0; flex:1 1 auto; }
    .dash-divider{ display:none; }
    .dash-elections{ order:2; flex:1 1 100%; }
  }

  /* tag pills */
  .tag-pill{ display:inline-flex; align-items:center; font-family:var(--font-mono); font-size:0.7rem; letter-spacing:0.03em; text-transform:uppercase; padding:3px 10px; border-radius:999px; background:var(--accent-soft); color:var(--accent-strong); margin:0 8px 8px 0; }
  .tag-pill.tag-other{ background:var(--surface-2); color:var(--ink-soft); }

  /* purpose */
  .purpose-line{ font-size:1.05rem; color:var(--ink); font-weight:500; background:var(--accent-soft); border-radius:var(--radius-s); padding:14px 16px; margin-bottom:18px; max-width:70ch; }
  .purpose-line .purpose-label{ font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase; color:var(--accent-strong); display:block; margin-bottom:4px; }
  .entry-purpose{ font-size:0.92rem; color:var(--ink); font-style:italic; }

  /* accountability updates */
  .updates-section{ margin-top:32px; padding-top:24px; border-top:1px solid var(--line); max-width:70ch; }
  .updates-section h3{ font-size:1.1rem; margin-bottom:12px; }
  .update-item{ border-left:3px solid var(--seal); background:var(--seal-soft); border-radius:0 var(--radius-s) var(--radius-s) 0; padding:12px 16px; margin-bottom:10px; font-size:0.9rem; }
  .update-item .update-date{ font-family:var(--font-mono); font-size:0.72rem; color:var(--ink-faint); display:block; margin-bottom:4px; }
  .updates-empty{ color:var(--ink-faint); font-size:0.9rem; }
