:root {
  --bg: #0a0f1d;
  --bg2: #0e1528;
  --card: #121b31;
  --card2: #172340;
  --line: #22304f;
  --ink: #0a0f1d;
  --text: #eef2fb;
  --muted: #94a1bf;
  --faint: #5d6a88;
  --gold: #f7c948;
  --green: #1fbf75;
  --red: #ff5a5f;
  --blue: #4f8cff;
  --paper: #fbf8ef;
  --paper-ink: #1d1b16;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tabs-h: 64px;
  --display: "Archivo", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f5fa;
    --bg2: #e9edf6;
    --card: #ffffff;
    --card2: #f4f6fb;
    --line: #dde3ef;
    --text: #0f1729;
    --muted: #55617d;
    --faint: #8b95ad;
    --shadow: 0 8px 24px rgba(20, 30, 60, .08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 80% -200px, rgba(247, 201, 72, .08), transparent 60%),
                    radial-gradient(900px 400px at -10% -100px, rgba(31, 191, 117, .07), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 15px/1.45 var(--body);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
.num, .tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ header */
.demo-banner {
  display: flex; gap: 12px; justify-content: center; align-items: center;
  padding: 8px 16px; font-size: 13px; text-align: center;
  background: repeating-linear-gradient(-45deg, #f7c948, #f7c948 12px, #f0b92d 12px, #f0b92d 24px);
  color: #1d1b16;
}
.demo-banner a { font-weight: 700; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font: 800 18px/1.1 var(--display); letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 12px; }

.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.live.on .live-dot { background: var(--red); box-shadow: 0 0 0 0 rgba(255, 90, 95, .7); animation: pulse 1.8s infinite; }
.live.wait .live-dot { background: var(--gold); }
.live.err .live-dot { background: var(--faint); }
.live b { color: var(--text); font-weight: 600; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 95, .6); } 70% { box-shadow: 0 0 0 9px rgba(255, 90, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 95, 0); } }

.progress-strip { position: sticky; top: 58px; z-index: 19; height: 3px; background: transparent; }
.progress-strip div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 1s ease; }

/* ------------------------------------------------------------ tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.active { color: var(--gold); }
.tabs a.active svg { stroke-width: 2.2; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .tabs {
    position: sticky; top: 61px; bottom: auto; height: auto; z-index: 18;
    display: flex; justify-content: center; gap: 4px; padding: 8px;
    background: transparent; border: 0; backdrop-filter: none;
  }
  .tabs a { flex-direction: row; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
  .tabs a.active { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
  .tabs a.active svg { stroke: var(--gold); }
  .progress-strip { top: 60px; }
}

/* ------------------------------------------------------------ layout */
.view { max-width: 1120px; margin: 0 auto; padding: 16px; outline: none; }
.grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .grid-2e { grid-template-columns: 1fr 1fr; align-items: start; }
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card h2, .section-title {
  margin: 0 0 12px; font: 800 13px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h2 .aside { font: 500 12px var(--body); letter-spacing: 0; text-transform: none; color: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-pct { font: 900 clamp(44px, 12vw, 76px)/.9 var(--display); letter-spacing: -.03em; }
.hero-pct small { font-size: .45em; font-weight: 800; color: var(--muted); margin-left: 2px; }
.hero-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hero-bar { height: 10px; border-radius: 99px; background: var(--card2); overflow: hidden; margin: 14px 0 12px; box-shadow: inset 0 0 0 1px var(--line); }
.hero-bar div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi b { display: block; font: 800 20px/1.1 var(--display); }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi i { font-style: normal; font-size: 12px; color: var(--faint); margin-left: 4px; }

.verdict {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  font-size: 14px;
}
.verdict.win { background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.verdict svg { width: 22px; height: 22px; flex: none; }
.verdict b { font-weight: 700; }

.countdown { text-align: center; padding: 22px 16px; }
.countdown .clock { font: 900 clamp(40px, 11vw, 64px)/1 var(--display); letter-spacing: -.02em; margin: 6px 0; }
.countdown p { margin: 6px 0; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2);
  font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn.primary { background: var(--gold); color: #1d1b16; border-color: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------------ duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.duel-side { text-align: center; min-width: 0; }
.duel-side .ph { width: 84px; height: 84px; margin: 0 auto 8px; }
.duel-name { font: 800 16px/1.15 var(--display); overflow-wrap: anywhere; }
.duel-party { font-size: 12px; color: var(--muted); }
.duel-pct { font: 900 34px/1 var(--display); margin-top: 6px; letter-spacing: -.02em; }
.duel-votes { font-size: 12px; color: var(--muted); }
.duel-vs { font: 800 12px var(--display); color: var(--faint); text-align: center; }
.duel-gap { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.duel-gap b { color: var(--text); }
.tug { position: relative; height: 12px; border-radius: 99px; overflow: hidden; display: flex; margin-top: 14px; background: var(--card2); }
.tug div { height: 100%; transition: width 1s ease; }
.tug::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .7; }

/* ------------------------------------------------------------ candidates */
.cands { list-style: none; margin: 0; padding: 0; }
.cand { display: grid; grid-template-columns: 48px 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cand:first-child { border-top: 0; }
.cand .ph { width: 48px; height: 48px; grid-row: span 2; }
.cand-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-meta { font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-pct { font: 800 20px/1 var(--display); text-align: right; }
.cand-votes { font-size: 12px; color: var(--muted); text-align: right; }
.cand-bar { grid-column: 2 / -1; position: relative; height: 6px; border-radius: 99px; background: var(--card2); overflow: visible; }
.cand-bar div { height: 100%; border-radius: 99px; width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.cand-bar .half { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 0; border-left: 2px dotted var(--faint); }
.cand.compact { grid-template-columns: 36px 1fr auto; padding: 8px 0; }
.cand.compact .ph { width: 36px; height: 36px; }
.cand.compact .cand-pct { font-size: 17px; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; margin-left: 6px; }
.tag.win { background: var(--green); color: #04170d; }
.tag.run { background: var(--gold); color: #1d1b16; }
.tag.lead { background: var(--card2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--gold) 22%, transparent); } 100% { background: transparent; } }

.ph { position: relative; border-radius: 50%; overflow: hidden; background: var(--card2); box-shadow: 0 0 0 3px var(--pc, var(--line)); flex: none; }
.ph img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.ph .ini { position: absolute; inset: 0; display: grid; place-items: center; font: 800 15px var(--display); color: #fff; background: var(--pc, var(--faint)); }

.others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.others div { background: var(--card2); border-radius: 10px; padding: 8px; text-align: center; }
.others b { display: block; font: 800 16px var(--display); }
.others span { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------ chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--body); fill: var(--faint); }
.chart .grid line { stroke: var(--line); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .fifty { stroke: var(--gold); stroke-dasharray: 4 4; opacity: .8; }
.chart .lbl { font: 700 11px var(--body); }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.empty svg { width: 36px; height: 36px; stroke: var(--faint); fill: none; stroke-width: 1.6; margin-bottom: 6px; }

/* ------------------------------------------------------------ segmented */
.seg { display: inline-flex; background: var(--card2); border-radius: 999px; padding: 4px; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; min-height: 36px; }
.seg button.on { background: var(--gold); color: #1d1b16; }

/* ------------------------------------------------------------ map */
.map-wrap { position: relative; }
.map { width: 100%; height: auto; display: block; max-height: 72vh; }
.map path { stroke: var(--bg); stroke-width: 1.4; cursor: pointer; transition: fill .6s ease, opacity .6s ease; }
.map path:hover, .map path.sel { stroke: var(--text); stroke-width: 2.4; }
.map text { font: 800 24px var(--display); fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0, 0, 0, .5); stroke-width: 4px; text-transform: uppercase; }
.map text.small { font-size: 17px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card2); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; text-transform: uppercase; min-width: 40px; text-align: center; }
.chip.on { background: var(--gold); color: #1d1b16; border-color: transparent; }

.uf-list { list-style: none; margin: 0; padding: 0; }
.uf-row { display: grid; grid-template-columns: 34px 1fr 64px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; }
.uf-row:first-child { border-top: 0; }
.uf-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font: 800 12px var(--display); text-transform: uppercase; color: #fff; }
.uf-main { min-width: 0; }
.uf-main b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.uf-prog { text-align: right; font: 700 13px var(--display); }
.mini-bar { height: 4px; border-radius: 99px; background: var(--card2); margin-top: 4px; overflow: hidden; }
.mini-bar div { height: 100%; background: var(--green); width: 0; transition: width 1s ease; }

/* ------------------------------------------------------------ sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 80vh; overflow: auto;
  background: var(--card); border-top-left-radius: 22px; border-top-right-radius: 22px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .45); padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .25s ease;
}
@media (min-width: 900px) { .sheet { left: auto; right: 24px; bottom: 24px; width: 420px; border-radius: 22px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet-head h3 { margin: 0; font: 800 20px var(--display); flex: 1; }
.x { border: 0; background: var(--card2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ congress */
.hemi { width: 100%; height: auto; display: block; }
.hemi-total { font: 900 44px var(--display); fill: var(--text); }
.hemi-sub { font: 600 17px var(--body); fill: var(--muted); }
.party-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.party-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.party-list i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.party-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.party-list b { font-variant-numeric: tabular-nums; }
.seatbar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: var(--card2); }
.seatbar div { height: 100%; transition: width .8s ease; }
.sen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sen-uf { background: var(--card2); border-radius: 12px; padding: 8px 10px; text-decoration: none; display: block; }
.sen-uf .h { display: flex; justify-content: space-between; font: 800 12px var(--display); text-transform: uppercase; color: var(--muted); }
.sen-uf .s { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 5px; min-width: 0; }
.sen-uf .s i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sen-uf .s span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  min-height: 44px; appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggest { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); max-height: 240px; overflow: auto; }
.suggest li { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.suggest li:hover, .suggest li.on { background: var(--card); }
.saved { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* ------------------------------------------------------------ receipt (BU) */
.receipt-wrap { display: flex; justify-content: center; padding: 6px 0 12px; }
.receipt {
  width: 100%; max-width: 380px; background: var(--paper); color: var(--paper-ink);
  font: 12.5px/1.45 var(--mono); padding: 22px 18px 26px; position: relative;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  animation: print .7s ease;
}
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -20px 0); } }
.receipt::before, .receipt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 10px repeat-x,
              linear-gradient(-135deg, var(--paper) 50%, transparent 50%) 0 0 / 12px 10px repeat-x;
}
.receipt::after { bottom: -10px; }
.receipt::before { top: -10px; transform: scaleY(-1); }
.receipt h4 { font: 700 14px var(--mono); text-align: center; margin: 0 0 2px; letter-spacing: .08em; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1.5px dashed rgba(0, 0, 0, .35); margin: 10px 0; }
.receipt .kv { display: flex; justify-content: space-between; gap: 10px; }
.receipt .kv span:last-child { text-align: right; }
.receipt .cargo { font-weight: 700; margin-top: 4px; text-transform: uppercase; }
.receipt .v { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.receipt .v .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt .tot { font-weight: 700; }
.receipt .hash { word-break: break-all; font-size: 10.5px; opacity: .75; }
.receipt .seal { display: block; margin: 12px auto 0; width: 72px; height: 72px; opacity: .85; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--card2); }
.status-pill.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.status-pill.wait { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* ------------------------------------------------------------ misc */
.foot { max-width: 1120px; margin: 8px auto 0; padding: 0 16px 16px; color: var(--faint); font-size: 12px; text-align: center; }
.foot a { color: var(--muted); }
.foot-links a { font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 60; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.skeleton { background: linear-gradient(90deg, var(--card2), var(--line), var(--card2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sig { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--green); font-weight: 700; }
.sig svg { width: 13px; height: 13px; }
.err { color: var(--red); }
.state-head { display: flex; align-items: center; gap: 12px; }
.state-head h1 { margin: 0; font: 900 28px/1.05 var(--display); letter-spacing: -.02em; }
.state-head .uf-badge { width: 46px; height: 46px; font-size: 16px; border-radius: 12px; }
.city-res { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------ bulk download */
.scopes { display: flex; flex-direction: column; gap: 6px; }
.scope { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); cursor: pointer; font-size: 14px; min-height: 44px; }
.scope input { accent-color: var(--gold); width: 18px; height: 18px; margin: 0; flex: none; }
.scope span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope b { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.scope:has(input:checked) { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.scope.off { opacity: .5; cursor: default; }
.job { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--card2); }
.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 600; min-height: 44px; }
.file:first-child { background: var(--gold); color: #1d1b16; border-color: transparent; }
.file svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.file span { flex: 1; }
.file b { font-size: 12px; font-weight: 600; opacity: .75; }

/* ------------------------------------------------------------ BU summary */
.sub { margin: 16px 0 8px; font: 800 12px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.sub .aside { font: 500 12px var(--body); letter-spacing: 0; text-transform: none; color: var(--faint); }
.bd { display: flex; flex-direction: column; }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.bd-row:first-child { border-top: 0; }
.bd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bd-prog { color: var(--muted); font-size: 12px; text-align: right; }
.bd-lead { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.bd-lead i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bd-lead b { font-weight: 700; }
.more summary { cursor: pointer; padding: 9px 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "▸ "; }
.more[open] summary::before { content: "▾ "; }
.linkish { border: 0; background: none; color: var(--gold); font-weight: 600; font-size: 13px; padding: 8px 0 0; cursor: pointer; }
