:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8a8a8a;
  --line: #262626;
  --panel: #0e0e0e;
  --alfa: #a51a2d;
  --ok: #3fb950;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---- public voting page ---- */
.stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 24px;
}
.card { max-width: 720px; text-align: center; }
.logo { width: min(118px, 30vw); height: auto; margin-bottom: 7vh; }
.card h1 {
  font-size: clamp(30px, 7.5vw, 58px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.card h2 { font-weight: 700; margin: 0 0 24px; }
.sub { color: var(--muted); margin-top: 28px; font-size: 16px; letter-spacing: .04em; }

.loginform { display: flex; flex-direction: column; gap: 12px; width: min(320px, 80vw); margin: 0 auto; }

/* ---- shared controls ---- */
input, button, .btn {
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
}
button, .btn {
  cursor: pointer;
  background: #1c1c1c;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: #2a2a2a; }
button.danger { background: var(--alfa); border-color: var(--alfa); }
button.go { background: #16603a; border-color: #16603a; }
button.small { padding: 6px 10px; font-size: 13px; }
.err { color: #ff6b6b; }
.ok { color: var(--ok); }

/* ---- admin ---- */
.admin .wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }
.head { display: flex; justify-content: space-between; align-items: center; }
h2 { font-size: 24px; margin: 0 0 4px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 28px 0 10px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 18px; background: var(--panel); }
.panel h3 { margin-top: 18px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.inline { margin: 0; }
.stat { font-size: 18px; margin: 0 0 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.warn { color: #ffb454; max-width: 60ch; line-height: 1.5; }
.pill { font-size: 12px; letter-spacing: .1em; padding: 4px 10px; border-radius: 99px; }
.pill.on { background: #16603a; }
.pill.off { background: var(--alfa); }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
th.r, td.r { text-align: right; }

/* car number and vote count read as one pair: same size, weight and figures */
.results .big, .results .big input {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.results td.num { color: var(--fg); width: 1%; }
.results input.votes {
  width: 84px;
  text-align: right;
  padding: 4px 8px;
  background: transparent;
  border-color: transparent;
  color: var(--fg);
}
.results input.votes:hover { border-color: var(--line); }
.results input.votes:focus { background: var(--panel); border-color: #555; outline: none; }

td.sig { font-variant-numeric: tabular-nums; color: var(--muted); width: 1%; white-space: nowrap; }
td.sig.amber { color: #ffb454; }
td.sig.red { color: #ff6b6b; font-weight: 700; }

.chip {
  display: inline-block;
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip.ok   { color: #7ee2a8; border-color: #1e4c33; }
.chip.warn { color: #ffb454; border-color: #5a3d16; }
.chip.bad  { color: #ff8f8f; border-color: #5c2226; }
.chip.mute { color: var(--muted); border-color: var(--line); }
.legend { max-width: 100ch; }
.legend .chip { margin: 0 2px; }

td.flags { width: 1%; white-space: nowrap; }
td.labelcell input { width: 100%; min-width: 130px; padding: 6px 8px; }
td.labelcell { width: 22%; }
.results td.url { width: 230px; }
.results td.url input { width: 100%; font-size: 11px; color: var(--muted); padding: 5px 8px; }
tr.flag td.num { color: #ffb454; }
.danger-zone { margin-top: 36px; border-color: #3a1a1f; }
