/* Eleitos · Fala Reto identity (tokens from /marca/fala-reto.css; header/footer from /marca/cabecalho.js).
   Light theme only. Party colors come from MapKit's data palette. */
:root {
  color-scheme: light;
  --ink: #0D1117;
  --brand: #0A1A33;
  --lime: #12284A;
  --gold: #FFC20E;
  --muted: #5B6474;
  --line: #E1E5EA;
  --surface: #FFFFFF;
  --bg: #F2F4F7;
  --soft: #F2F4F7;
  --todo: #E1E5EA;
  --warn: #0A1A33;
  --warn-bg: #FFC20E33;
  --err: #0A1A33;
  font-family: Montserrat, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
main :focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.no-search [data-open-search] { display: none; }

/* ---------- page ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 18px 16px 24px; display: grid; gap: 12px; }
.intro h1 { margin: 6px 0 2px; font-size: 26px; letter-spacing: -.035em; color: var(--brand); font-weight: 800; }
.intro p { margin: 0; color: var(--muted); font-size: 13px; }

.houses { display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--soft); overflow-x: auto; scrollbar-width: none; }
.houses::-webkit-scrollbar { display: none; }
.houses button { flex: 1 0 auto; border: 0; background: none; border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--muted); min-height: 40px; text-align: center; line-height: 1.15; }
.houses button small { display: block; font-size: 10px; font-weight: 500; }
.houses button[aria-selected="true"] { background: var(--brand); color: var(--surface); box-shadow: 0 1px 4px #0002; }
.houses button[aria-selected="true"] small { color: var(--gold); }

.statusbar { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.statusbar .warn { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--gold); border-radius: 6px; padding: 2px 8px; }
.ghost { margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; font-size: 12px; min-height: 30px; color: var(--brand); font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 6px 20px #0A1A3314; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.card h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.scope { font-size: 12px; color: var(--muted); font-weight: 600; }

/* summary */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--soft); min-width: 0; }
.metric span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.metric strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--brand); line-height: 1.15; }
.metric small { display: block; font-size: 11px; color: var(--muted); }
.m-open strong { color: var(--muted); }
.metric:nth-child(3):last-child { grid-column: 1 / -1; }
@media (min-width: 600px) { .metric:nth-child(3):last-child { grid-column: auto; } }

.seatbar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: var(--todo); margin: 14px 0 6px; }
.seatbar .seg { display: block; height: 100%; background: var(--c); flex: none; }
.seatbar .seg + .seg { box-shadow: inset 1px 0 0 var(--surface); }
.seatbar .seg.hatch, .sw.hatch { background: repeating-linear-gradient(135deg, var(--c, #9AA5B1) 0 3px, #FFFFFF 3px 6px); opacity: .85; }
.seatbar .seg.open { background: var(--todo); box-shadow: none; flex: 1 1 auto; }
.seatlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--muted); }
.seatlegend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.solid { background: var(--muted); }
.sw.open { background: var(--todo); border: 1px solid var(--line); }

.parties h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; }
.parties ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.parties button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; min-height: 32px; }
.parties button[aria-pressed="true"] { border-color: var(--brand); background: var(--soft); box-shadow: inset 0 0 0 1px var(--brand); }
.parties .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.parties .cnt { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); }
.parties .cnt em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11px; }
.empty { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* filters */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
.filters label { display: grid; gap: 4px; min-width: 0; }
.filters label > span:first-child { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filters select, .filters input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 8px 10px; min-height: 40px; font-size: 14px; }
.uf-select { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uf-select img { width: 30px; height: 21px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); flex: none; }

.note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.placeholder { color: var(--muted); padding: 24px 0; text-align: center; }
.placeholder.error { color: var(--err); }

/* ---------- state cards ---------- */
.states { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.st { padding: 14px; }
.st-head { display: flex; align-items: center; gap: 10px; }
.flag { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); flex: none; }
.st-title { min-width: 0; flex: 1; }
.st-title h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.st-title h3 small { font-size: 11px; color: var(--muted); font-weight: 600; }
.st-title span { font-size: 11px; color: var(--muted); }
.tag { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.done { border-color: var(--brand); color: var(--brand); }
.prog { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ptrack { flex: 1; height: 5px; border-radius: 3px; background: var(--todo); overflow: hidden; }
.ptrack i { display: block; height: 100%; background: var(--brand); }
.st-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.st-counts b { color: var(--brand); font-variant-numeric: tabular-nums; }
.st h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.st h4 small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 11px; }
.caveat { margin: 0 0 8px; font-size: 11px; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--gold); border-radius: 8px; padding: 6px 8px; line-height: 1.4; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 0; overflow: hidden; min-width: 0; }
.person.k-leading { background: var(--soft); }
.pbar { align-self: stretch; width: 4px; background: var(--c); flex: none; border-radius: 0 3px 3px 0; }
.person.k-leading .pbar { opacity: .45; }
.pmain { flex: 1; min-width: 0; }
.pname { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.pmeta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pmeta b { color: var(--ink); }
.pvotes { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.pvotes strong { display: block; font-size: 14px; color: var(--brand); }
.pvotes small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.badge { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-top: 3px; white-space: nowrap; }
.b-elected { background: var(--gold); color: var(--brand); }
.b-guaranteed { background: var(--surface); color: var(--brand); border: 1px dashed var(--brand); }
.b-neutral { background: var(--todo); color: var(--muted); }
.follow { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 50%; font-size: 16px; line-height: 1; color: var(--muted); }
.follow[aria-pressed="true"] { color: var(--brand); border-color: var(--gold); background: #FFC20E33; }
.no-follow .follow { display: none; }
.more { margin-top: 8px; width: 100%; border: 1px dashed var(--line); background: var(--soft); border-radius: 9px; min-height: 36px; font-size: 12px; font-weight: 700; color: var(--brand); }

.foot { max-width: 1480px; margin: 0 auto; padding: 12px 16px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (min-width: 600px) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1.2fr 1fr 1.4fr; }
  .states { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .page { padding-inline: 24px; }
  .intro h1 { font-size: 32px; }
  .states { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .states.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
  .summary .card-head, .summary .metrics, .summary .seatbar, .summary .seatlegend { grid-column: 1; }
  .summary .parties { grid-column: 2; grid-row: 1 / span 4; }
  .summary .parties h3 { margin-top: 0; }
}
@media (min-width: 600px) and (max-width: 1099px) { .states.single { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) {
  .metric strong { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
