/* Dandies BARBERSTAR — black & gold. No inline styles anywhere (strict CSP). */
:root {
  --bg: #0a0a0a; --surface: #151515; --surface-2: #1f1f1f; --line: #3b3421;
  --gold: #d4af37; --gold-bright: #f2d675; --gold-deep: #9a7b1c;
  --text: #f6f1e4; --muted: #bdb5a0; --danger: #ff9a90; --ok: #9be29b; --warn: #ffd166;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--sans); min-height: 100vh; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; color: var(--gold-bright); letter-spacing: .01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; } a { color: var(--gold-bright); }
.muted { color: var(--muted); } .small { font-size: .9rem; } .center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- voter pages ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.brand .mark { width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.brand .name { font-family: var(--serif); font-size: 1.15rem; color: var(--gold-bright); letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; }
.brand .sub { color: var(--muted); font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.gold { border-color: var(--gold-deep); background: linear-gradient(180deg, #1b170a, #141414); }
.banner { border: 1px dashed var(--warn); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: .92rem; }
.rules { margin: 0 0 1em; padding-left: 1.2em; } .rules li { margin: .45em 0; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; }
.steps li[aria-current="step"] { color: var(--gold-bright); border-color: var(--gold); font-weight: 700; }
.steps li.done { color: var(--text); border-color: var(--gold-deep); }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; background: #0e0e0e; color: var(--text); border: 1px solid #5a4f2c; border-radius: 10px; font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input.code { font-size: 1.8rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; padding: 8px 0; cursor: pointer; }
.check input { width: 26px; height: 26px; flex: none; margin-top: 2px; accent-color: var(--gold); }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border-radius: 12px; border: 2px solid var(--gold); background: transparent; color: var(--gold-bright); font: 700 1rem var(--sans); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--gold); color: #000; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.msg { border-radius: 10px; padding: 12px 14px; margin: 12px 0; } .msg:empty { display: none; }
.msg.err { background: #2a1210; border: 1px solid var(--danger); color: var(--danger); }
.msg.ok { background: #102212; border: 1px solid var(--ok); color: var(--ok); }
.msg.info { background: #1f1b0c; border: 1px solid var(--gold-deep); color: var(--gold-bright); }

/* barber cards */
.cands { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.cand { width: 100%; display: grid; grid-template-columns: 72px 1fr 52px; gap: 14px; align-items: center; text-align: left; min-height: 92px; padding: 10px 14px 10px 10px; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: var(--radius); font: inherit; cursor: pointer; }
.cand[aria-pressed="true"] { border-color: var(--gold); background: #1c1708; box-shadow: 0 0 0 1px var(--gold) inset; }
.cand .photo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--gold); font: 700 1.5rem var(--serif); overflow: hidden; }
.cand .who strong { display: block; font-size: 1.08rem; } .cand .who span { color: var(--muted); font-size: .92rem; }
.badge { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--gold-deep); display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.cand[aria-pressed="true"] .badge { background: var(--gold); color: #000; border: 2px solid var(--gold); font-size: 1.2rem; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(10,10,10,.96); border-top: 1px solid var(--gold-deep); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.dock .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.dock .picks { flex: 1; font-size: .9rem; color: var(--muted); } .dock .picks b { color: var(--gold-bright); }
.review { list-style: none; counter-reset: r; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.review li { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.review .n { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; font-weight: 800; flex: none; }
.quote { border-left: 3px solid var(--gold-deep); padding: 4px 0 4px 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.thanks { text-align: center; padding: 36px 10px; } .thanks .big { font-size: 3.2rem; }

/* ---------- admin ---------- */
.admin { max-width: 1200px; margin: 0 auto; padding: 16px 16px 80px; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.topbar .who { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; min-height: 40px; font: 600 .95rem var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--gold); color: #000; border-color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile .v { font: 700 1.9rem var(--serif); color: var(--gold-bright); } .tile .l { color: var(--muted); font-size: .88rem; }
.tablewrap { overflow-x: auto; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid #262114; text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--gold-bright); white-space: nowrap; position: sticky; top: 0; }
td input[type="text"], td input[type="number"], td select { min-height: 38px; padding: 6px 8px; }
td input[type="number"] { width: 84px; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; border: 1px solid var(--line); margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.ok { border-color: var(--ok); color: var(--ok); } .chip.bad { border-color: var(--danger); color: var(--danger); } .chip.warn { border-color: var(--warn); color: var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.login { max-width: 420px; margin: 10vh auto; }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: 14px; padding: 20px; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.7); }
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, 92vw); z-index: 10; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
pre.links { white-space: pre-wrap; overflow-wrap: anywhere; background: #0e0e0e; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 240px; overflow: auto; font-size: .8rem; }
