/* VoteCheck design system.
   Brand colors sampled from public/assets/politiquera.png:
   navy #011689 (wordmark), red #FE0002 (check). The logo is 71% transparent
   with a NAVY wordmark, so it must sit on a light surface -- an earlier draft
   put it on a navy header where it was very nearly invisible. */

:root{
  --brand:#011689; --brand-600:#0a1f9c; --brand-700:#010f66;
  --brand-50:#eef0fb; --brand-100:#dce0f6;
  --accent:#fe0002; --accent-50:#fff0f0;

  --ink:#111726; --ink-2:#4a5468; --ink-3:#7b8598;
  --line:#e2e6ef; --line-2:#eef1f6;
  --bg:#f5f6fa; --surface:#fff;

  --ok:#0f7b45; --ok-bg:#eaf6ef;
  --warn:#a26500; --warn-bg:#fdf5e7;
  --bad:#c0271c; --bad-bg:#fdeeed;

  --r:10px; --r-sm:7px;
  --sh:0 1px 2px rgba(17,23,38,.05), 0 1px 3px rgba(17,23,38,.04);
  --sh-2:0 4px 12px rgba(17,23,38,.07);
  --focus:0 0 0 3px rgba(1,22,137,.16);

  /* Type. Same three faces as the landing page page. */
  --font-sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-slab:Rokkitt,Rockwell,"Roboto Slab",Georgia,serif;
  --font-mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;

  /* Aliases. The landing page names the same colors differently; keeping both
     means markup can be moved between them without a rewrite. */
  --rule:var(--line); --rule-soft:var(--line-2);
  --paper:var(--surface); --ground:var(--bg); --muted:var(--ink-3);
  --keep:var(--ok); --flag:var(--bad);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:15px/1.55 var(--font-sans);
  -webkit-font-smoothing:antialiased;
}

/* ---- header: white so the navy wordmark reads ---- */
.hdr{
  background:var(--surface); border-bottom:1px solid var(--line);
  padding:0 24px; display:flex; align-items:center; gap:16px; height:62px;
  position:sticky; top:0; z-index:50;
}
.hdr__logo{height:30px;width:auto;display:block}
/* The customer's mark sits FIRST, ahead of ours. Capped on both axes so a
   squarer logo is not blown up to the height of our 5.7:1 wordmark. */
.hdr__cust{max-height:34px;max-width:150px;width:auto;height:auto;display:block}
/* A flex child keeps its display, so the hidden attribute needs help here. */
[hidden]{display:none !important}
.hdr__div{width:1px;height:26px;background:var(--line)}
.hdr__name{font-size:15px;font-weight:650;letter-spacing:-.01em}
.hdr__sub{font-size:13px;color:var(--ink-3);font-weight:400}
.hdr__right{margin-left:auto;display:flex;align-items:center;gap:16px}
.hdr__right a{color:var(--ink-2);font-size:13.5px;text-decoration:none;font-weight:500}
.hdr__right a:hover{color:var(--brand)}

.wrap{max-width:1120px;margin:0 auto;padding:28px 24px 72px}
.wrap--narrow{max-width:820px}

/* ---- typography ---- */
h1,h2{font-family:var(--font-slab); text-wrap:balance}
h1{font-size:25px;font-weight:700;line-height:1.14;letter-spacing:-.015em;margin:0 0 6px}
h2{font-size:17.5px;font-weight:700;line-height:1.2;letter-spacing:-.008em;margin:0 0 4px}
h3{font-size:14.5px;font-weight:650;line-height:1.3;letter-spacing:-.005em;
   color:var(--ink);margin:0 0 6px}
h4{font-size:13px;font-weight:650;line-height:1.35;color:var(--ink);margin:0 0 4px}
p{margin:0 0 .9em}
strong,b{font-weight:650}
table{font-variant-numeric:tabular-nums}
.lede{color:var(--ink-2);font-size:14px;margin:0 0 22px}
.sub{color:var(--ink-3);font-size:13px;margin:0 0 18px}
.muted{color:var(--ink-3)}
code{background:var(--brand-50);color:var(--brand);padding:1.5px 6px;
     border-radius:5px;font-size:12.5px;font-family:var(--font-mono)}

/* ---- surfaces ---- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
      padding:22px;margin-bottom:20px;box-shadow:var(--sh)}
.card__hd{margin:-22px -22px 20px;padding:16px 22px;border-bottom:1px solid var(--line-2);
          background:linear-gradient(180deg,#fcfdff,#fff)}
.card__hd h2{margin:0}

/* ---- stat tiles ---- */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:14px;margin-bottom:22px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
      padding:16px 17px;box-shadow:var(--sh);position:relative;overflow:hidden}
.tile::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--line)}
.tile--ok::before{background:var(--ok)} .tile--brand::before{background:var(--brand)}
.tile--warn::before{background:var(--warn)} .tile--bad::before{background:var(--accent)}
.tile__n{font-size:28px;font-weight:680;letter-spacing:-.03em;line-height:1.1;
         font-variant-numeric:tabular-nums}
.tile__l{font-size:11.5px;color:var(--ink-3);text-transform:uppercase;
         letter-spacing:.06em;font-weight:600;margin-top:3px}
.tile__f{font-size:12px;color:var(--ink-3);margin-top:5px}
.tile--ok .tile__n{color:var(--ok)} .tile--warn .tile__n{color:var(--warn)}
.tile--bad .tile__n{color:var(--bad)} .tile--brand .tile__n{color:var(--brand)}

/* ---- forms ---- */
.field{margin-bottom:18px}
label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:var(--ink)}
.hint{font-size:12.5px;color:var(--ink-3);margin-top:6px}
input,select{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm);
  font:inherit;font-size:14.5px;background:var(--surface);color:var(--ink);
  transition:border-color .12s,box-shadow .12s;
}
input:focus,select:focus{outline:0;border-color:var(--brand);box-shadow:var(--focus)}
input::placeholder{color:#a6aebd}
input[type=file]{padding:9px 11px;background:var(--bg);cursor:pointer}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media (max-width:680px){.grid2{grid-template-columns:1fr}}

button,.btn{
  background:var(--brand);color:#fff;border:0;padding:10px 18px;border-radius:var(--r-sm);
  font:inherit;font-size:14px;font-weight:600;cursor:pointer;
  transition:background .12s,box-shadow .12s;
}
button:hover:not(:disabled){background:var(--brand-600)}
button:focus-visible{outline:0;box-shadow:var(--focus)}
button:disabled{opacity:.42;cursor:not-allowed}
button.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
button.ghost:hover:not(:disabled){background:var(--bg);border-color:#cfd6e2}
button.sm{padding:6px 12px;font-size:13px}
/* An anchor wearing .btn needs the bits a <button> gets for free. .ghost was
   scoped to button.ghost, so a link styled as a ghost button came out solid. */
a.btn{display:inline-flex;align-items:center;text-decoration:none;line-height:1.1}
.btn.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.btn.ghost:hover{background:var(--bg);border-color:#cfd6e2}

/* ---- tables ---- */
/* The wrapper bleeds to the card edges so the scrollbar spans the full width.
   Its side padding lives on the FIRST and LAST cells, not on the wrapper:
   padding-right on an overflow-x container is ignored at the end of the
   scroll, which clipped the last column against the card edge. */
.tbl-wrap{overflow-x:auto;margin:0 -22px;padding:0;
          -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
/* Fit the container. min-width:max-content did the opposite -- it sized the
   table to its content and guaranteed a sideways scroll on any narrow screen.
   overflow-x stays as a last resort for a table that genuinely cannot fit. */
.tbl-wrap>table{min-width:0;width:100%;table-layout:auto}
.tbl-wrap th:first-child,.tbl-wrap td:first-child{padding-left:22px}
.tbl-wrap th:last-child, .tbl-wrap td:last-child {padding-right:22px}

table{width:100%;border-collapse:collapse;font-size:14px}
th{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-3);
   font-weight:650;text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);
   white-space:nowrap}
td{padding:11px 10px;border-bottom:1px solid var(--line-2);vertical-align:top}

/* Wrapping is the default; a cell opts OUT with .nw. The old default was nowrap,
   which meant any long value pushed the table wider than the screen instead of
   taking a second line. Numbers, pills and short actions still never wrap. */
.tbl-wrap td{white-space:normal;overflow-wrap:anywhere}
.tbl-wrap td.nw{white-space:nowrap;overflow-wrap:normal;width:1%}
.tbl-wrap td.wrap{white-space:normal;min-width:0;max-width:none}
/* A URL or token in a table cell breaks anywhere rather than setting the width. */
.tbl-wrap td code{overflow-wrap:anywhere;word-break:break-all}
tbody tr:hover{background:#fbfcfe}
tbody tr:last-child td{border-bottom:0}

/* ---- pills ---- */
.pill{display:inline-block;padding:2.5px 9px;border-radius:99px;font-size:11.5px;
      font-weight:650;letter-spacing:.01em;white-space:nowrap}
.pill--ok{background:var(--ok-bg);color:var(--ok)}
.pill--no{background:#f1f3f7;color:var(--ink-3)}
.pill--warn{background:var(--warn-bg);color:var(--warn)}
.pill--bad{background:var(--bad-bg);color:var(--bad)}
.pill--brand{background:var(--brand-50);color:var(--brand)}

/* ---- notes ---- */
.note{border:1px solid var(--line);border-left:3px solid var(--ink-3);background:var(--surface);
      padding:13px 15px;border-radius:0 var(--r-sm) var(--r-sm) 0;font-size:13.5px;margin:14px 0}
.note--ok{border-left-color:var(--ok);background:var(--ok-bg);border-color:#cfe7d9}
.note--warn{border-left-color:var(--warn);background:var(--warn-bg);border-color:#f0e2c4}
.note--bad{border-left-color:var(--accent);background:var(--bad-bg);border-color:#f3d3d1}
.note b{font-weight:650}

/* ---- tabs ---- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin:-22px -22px 20px;padding:0 22px}
.tabs button{background:none;color:var(--ink-3);border:0;border-bottom:2px solid transparent;
             border-radius:0;padding:13px 14px;font-size:14px;font-weight:600}
.tabs button:hover{background:none;color:var(--ink)}
.tabs button.on{color:var(--brand);border-bottom-color:var(--brand)}
.tabs .count{font-size:11.5px;background:var(--warn-bg);color:var(--warn);
             padding:1px 7px;border-radius:99px;margin-left:5px;font-weight:650}

/* ---- misc ---- */
.map{height:430px;border-radius:var(--r-sm);border:1px solid var(--line)}
.legend{display:flex;gap:16px;font-size:12.5px;color:var(--ink-2);margin-top:11px}
.dot{display:inline-block;width:9px;height:9px;border-radius:99px;margin-right:6px;
     vertical-align:middle}
.cand{border:1px solid var(--line);border-radius:var(--r-sm);padding:12px 14px;margin:8px 0;
      transition:border-color .12s,background .12s}
.cand:hover{border-color:var(--brand-100);background:#fcfdff}
.toolbar{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.toolbar input{flex:1;min-width:210px}
.toolbar select{width:auto;min-width:150px}
.empty{text-align:center;padding:44px 20px;color:var(--ink-3);font-size:14px}
.spin{display:inline-block;width:14px;height:14px;border:2px solid var(--brand-100);
      border-top-color:var(--brand);border-radius:99px;animation:s .7s linear infinite;
      vertical-align:-2px;margin-right:7px}
@keyframes s{to{transform:rotate(360deg)}}
.hide{display:none}

/* ---- numbered steps ----------------------------------------------------- */
.steps{counter-reset:step}
.step{display:flex;gap:16px;position:relative;padding-bottom:26px}
.step:last-child{padding-bottom:0}
/* connector between the circles */
.step:not(:last-child)::before{
  content:'';position:absolute;left:15px;top:34px;bottom:6px;width:2px;
  background:var(--line);border-radius:2px;
}
.step__n{
  flex:0 0 auto;width:32px;height:32px;border-radius:99px;
  background:var(--brand);color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:700;line-height:1;
  font-variant-numeric:tabular-nums;
  box-shadow:0 0 0 4px var(--surface);   /* punches through the connector */
  position:relative;z-index:1;
}
.step--done .step__n{background:var(--ok)}
.step__body{flex:1;min-width:0;padding-top:4px}
.step__title{font-size:15px;font-weight:650;letter-spacing:-.01em;margin:0 0 2px}
.step__note{font-size:13px;color:var(--ink-3);margin:0 0 12px}
.step__body .field:last-child{margin-bottom:0}
@media (max-width:560px){
  .step{gap:12px}
  .step:not(:last-child)::before{left:13px}
  .step__n{width:28px;height:28px;font-size:13px}
}


/* Report cards: one uniform grid, all cells equal height. */
.rpick{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
       gap:12px;align-items:stretch}
