/* VotePoll Contests — creator dashboard (Phase 2 polish).
   Light, calm work area; VotePoll navy/blue in the sidebar, header accents,
   buttons and highlights (brand/BRAND.md: Navy #0B2557, Blue #0A84FF, Light Blue #4DA3FF).
   Layout: ≥ 1024 px persistent sidebar; below, the same sidebar slides in as a drawer.
   The public-style preview (bottom of this file) keeps the votepoll.io gradient. */
:root {
  --navy: #0b2557; --navy-2: #0e3270; --blue: #0a84ff; --blue-ink: #0b5cc4; --blue-hover: #094ca3; --light: #4da3ff;
  --blue-tint: #eaf3ff; --blue-tint-2: #d9e9ff;
  --app: #f4f6fb; --card: #fff; --surface: #f7f9fc; --surface-2: #eef2f7;
  --ink: #101828; --ink-soft: #5b6475; --ink-faint: #8a93a3; --line: #e3e8f0; --line-strong: #cdd5e1;
  --danger: #b42318; --danger-bg: #fef3f2; --warn: #93370d; --warn-bg: #fffaeb; --warn-line: #fedf89; --ok: #067647; --ok-bg: #ecfdf3;
  --premium: #6941c6; --premium-bg: #f4f3ff;
  --radius: 14px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 20px 50px -24px rgba(16, 24, 40, 0.35);
  --focus: 0 0 0 3px rgba(77, 163, 255, 0.55);
  --sidebar-w: 280px; --topbar-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); line-height: 1.5; font-size: 15.5px; background: var(--app);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif; }
img { max-width: 100%; }
a { color: var(--blue-ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50; display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); overflow-y: auto; }
.main-col { min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .main-col { margin-left: var(--sidebar-w); } #menuBtn, .scrim { display: none !important; } }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); visibility: hidden; }
  .shell.nav-open .sidebar { transform: none; visibility: visible; }
  .scrim { position: fixed; inset: 0; background: rgba(11, 37, 87, 0.45); z-index: 45; }
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.sb-brand img { display: block; height: 30px; width: auto; }
.sb-brand .product { font-weight: 700; font-size: 0.9rem; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.3); color: #fff; text-decoration: none; }
.sb-close { margin-left: auto; color: #fff; background: rgba(255, 255, 255, 0.12); border: 0; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: none; }
@media (max-width: 1023px) { .sb-close { display: inline-flex; align-items: center; justify-content: center; } }
.sb-contest { margin: 6px 12px 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; }
.sb-contest .thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.14); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.8); }
.sb-contest .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-contest .name { font-weight: 700; font-size: 0.93rem; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-contest .meta { font-size: 0.72rem; color: rgba(255, 255, 255, 0.72); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-top: 2px; }
.sb-label { margin: 14px 22px 6px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.sb-nav ul { list-style: none; margin: 0; padding: 0 10px; }
.sb-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; color: rgba(255, 255, 255, 0.82); text-decoration: none;
  font-weight: 600; font-size: 0.94rem; min-height: 44px; position: relative; }
.sb-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sb-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sb-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--light); }
.sb-nav .tag { margin-left: auto; background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.85); }
.sb-foot { margin-top: auto; padding: 14px 20px 20px; font-size: 0.8rem; color: rgba(255, 255, 255, 0.72); }
.sb-foot .meter .row { color: rgba(255, 255, 255, 0.85); }
.sb-foot .meter .bar { background: rgba(255, 255, 255, 0.18); }
.sb-foot .meter .bar i { background: var(--light); }

.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 20px; }
#menuBtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.92rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--blue-ink); text-decoration: underline; }
.crumbs .cur { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg.i { color: var(--ink-faint); }
.topbar .spacer { flex: 1; }
.top-link { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.top-link:hover { color: var(--blue-ink); }
/* Narrow screens: only the current section in the top bar (the contest name is in the header card). */
@media (max-width: 560px) { #mainLink { display: none; } .topbar { padding: 0 12px; } .crumbs a, .crumbs svg.i { display: none; } .crumbs .cur { font-size: 0.98rem; } }
.crumbs .cur { min-width: 0; flex: 0 1 auto; }
.crumbs a { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 22px 24px 110px; }
@media (max-width: 700px) { .content { padding: 14px 12px 110px; } }

/* ---------- type, cards ---------- */
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
.page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.page-title h1 { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
.page-title .grow { flex: 1 1 260px; min-width: 0; }
.page-title p { margin: 4px 0 0; color: var(--ink-soft); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2.2vw, 22px); margin-bottom: 18px; }
.card h2 { font-size: 1.06rem; margin: 0 0 4px; }
.card h3 { font-size: 0.97rem; margin: 18px 0 6px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-bottom: 14px; }
.card-head .grow { flex: 1 1 220px; min-width: 0; }
.card-head p { margin: 2px 0 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.88rem; }
.tiny { font-size: 0.78rem; }
.stack > * + * { margin-top: 12px; }
.cols2 { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .cols2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 0.93rem; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- contest header + summary (every contest section) ---------- */
.chead { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px 16px; align-items: center; padding: 16px 18px; margin-bottom: 12px; }
.chead .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--blue)); color: rgba(255, 255, 255, 0.9);
  display: flex; align-items: center; justify-content: center; }
.chead .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chead .thumb svg.i { width: 28px; height: 28px; stroke-width: 1.7; }
.chead .title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.chead h1 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.5rem); overflow-wrap: anywhere; }
.chead .access { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-soft); font-size: 0.86rem; }
.chead .access span { display: inline-flex; align-items: center; gap: 5px; }
.chead .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chead .actions .note { font-size: 0.8rem; color: var(--ink-faint); width: 100%; }
@media (min-width: 900px) { .chead { grid-template-columns: 64px minmax(0, 1fr) auto; } .chead .actions { grid-column: auto; justify-content: flex-end; max-width: 520px; } .chead .actions .note { text-align: right; } }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 2px 18px; font-size: 0.92rem; color: var(--ink-soft); }
.summary b { color: var(--ink); font-weight: 750; }
.summary .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.summary .spacer { flex: 1; }
.chip-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.chip-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-status.ok { background: var(--ok-bg); color: var(--ok); }
.chip-status.wait { background: var(--blue-tint); color: var(--blue-ink); }

/* ---------- buttons, pills, tags ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; text-decoration: none; color: #fff; background: var(--blue-ink); transition: background 0.15s, transform 0.08s; white-space: nowrap; }
.btn:hover { background: var(--blue-hover); }
.btn:active { transform: scale(0.98); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface); border-color: #b8c3d3; }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #912018; }
.btn-ghost { background: none; color: var(--blue-ink); padding: 8px 10px; }
.btn-ghost:hover { background: var(--blue-tint); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; border-radius: 9px; }
/* Planned features: visible so the structure is clear, never styled as clickable. */
.btn[disabled], .btn[disabled]:hover { background: var(--surface-2); color: var(--ink-faint); border-color: var(--line); cursor: not-allowed; transform: none; }
.btn[disabled] .tag { background: #fff; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-soft); cursor: pointer; flex: none; position: relative; }
.icon-btn:hover:not([disabled]) { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.icon-btn.danger:hover:not([disabled]) { color: var(--danger); border-color: #f4b8b2; background: var(--danger-bg); }
.icon-btn.more[aria-expanded="true"] { background: var(--blue-tint); color: var(--blue-ink); border-color: var(--blue-tint-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 750; line-height: 1.6; background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pill.plain::before { display: none; }
.pill.draft { background: #f2f4f7; color: #475467; }
.pill.live { background: var(--ok-bg); color: var(--ok); }
.pill.review { background: var(--warn-bg); color: var(--warn); }
.pill.closed { background: #f2f4f7; color: #344054; }
.pill.test { background: #eef4ff; color: var(--navy); border: 1px dashed #9db8e8; }
.pill.count { background: var(--blue-tint); color: var(--blue-ink); }
.pill.count.low { background: var(--warn-bg); color: var(--warn); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; background: var(--surface-2); color: var(--ink-soft); text-transform: uppercase; }
.tag.premium { background: var(--premium-bg); color: var(--premium); }

/* ---------- form controls ---------- */
label, .label { display: block; font-weight: 650; font-size: 0.91rem; color: var(--ink); }
.field { margin: 0 0 14px; }
.field:last-child { margin-bottom: 0; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.84rem; margin-top: 4px; }
.counter { float: right; font-weight: 400; color: var(--ink-faint); font-size: 0.78rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="datetime-local"], select, textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 1rem; padding: 9px 12px; min-height: 42px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #b4bfcf; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--light); }
.grid2 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid3 { display: grid; gap: 0 14px; }
@media (min-width: 760px) { .grid3 { grid-template-columns: 1.3fr 1fr 1fr; } }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search input { margin: 0; padding-left: 38px; }
.choices { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 640px) { .choices.cols-2 { grid-template-columns: 1fr 1fr; } .choices.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.choice { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: #fff; font-weight: 400; min-height: 44px; }
.choice input { margin: 3px 0 0; accent-color: var(--blue-ink); width: 18px; height: 18px; flex: none; }
.choice strong { display: block; font-size: 0.93rem; }
.choice span.d { display: block; color: var(--ink-soft); font-size: 0.84rem; }
.choice:has(input:checked) { border-color: var(--blue-ink); background: var(--blue-tint); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice.disabled { opacity: 0.62; cursor: not-allowed; }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.switch:first-of-type { border-top: 0; }
.switch .txt { flex: 1; }
.switch strong { display: block; font-size: 0.93rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #d0d5dd; position: relative; flex: none; cursor: pointer; transition: background 0.15s; margin: 2px 0 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform 0.15s; }
.switch input:checked { background: var(--blue-ink); }
.switch input:checked::after { transform: translateX(18px); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.stepper button { width: 44px; height: 42px; border: 0; background: var(--surface); font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper output { min-width: 52px; text-align: center; font-weight: 700; font-size: 1.05rem; }

/* notices */
.notice { border-radius: 12px; padding: 12px 14px; background: var(--blue-tint); color: #1a3e72; font-size: 0.91rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.notice .ico { flex: none; padding-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.error { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice p { margin: 0; }
.notice:empty { display: none; }
#flash { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 70; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); margin: 0; }
@media (min-width: 1024px) { #flash { left: calc(50% + var(--sidebar-w) / 2); } }

/* meters */
.meter { --pct: 0%; }
.meter .row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.86rem; margin-bottom: 5px; }
.meter .row b { font-weight: 650; }
.meter .bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: var(--pct); background: var(--blue-ink); border-radius: inherit; transition: width 0.3s; }
.meter.warn .bar i { background: #f79009; }
.meter.full .bar i { background: var(--danger); }
.meters { display: grid; gap: 14px; }
@media (min-width: 640px) { .meters.cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

/* ---------- my contests ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.86rem; font-weight: 650; cursor: pointer; min-height: 36px; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.ccard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; background: #fff; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s; }
.ccard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ccard .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy), var(--blue)); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: rgba(255, 255, 255, 0.85); }
.ccard .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ccard .cover svg.i { width: 42px; height: 42px; stroke-width: 1.6; }
.ccard .cover .pill { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow); }
.ccard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ccard h3 { margin: 0; font-size: 1.02rem; color: var(--ink); overflow-wrap: anywhere; }
.ccard .meta { color: var(--ink-soft); font-size: 0.85rem; }
.ccard .foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-soft); }
.todo { color: var(--warn); font-weight: 650; }
.done { color: var(--ok); font-weight: 650; }
.new-card { border: 2px dashed var(--line-strong); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 230px;
  color: var(--blue-ink); font-weight: 700; text-decoration: none; background: var(--surface); }
.new-card:hover { border-color: var(--blue-ink); background: var(--blue-tint); }
.new-card svg.i { width: 28px; height: 28px; }
.empty { text-align: center; padding: 40px 16px; }
.empty .big { color: var(--blue-ink); }
.empty .big svg.i { width: 48px; height: 48px; stroke-width: 1.6; }
.empty h2 { margin: 8px 0 6px; }
.empty p { color: var(--ink-soft); max-width: 460px; margin: 0 auto 16px; }

/* ---------- overview ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .mark { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.checklist .mark svg.i { width: 14px; height: 14px; }
.checklist .mark.todo { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.checklist .mark.tip { background: var(--blue-tint); color: var(--blue-ink); }
.checklist .mark.ok { background: var(--ok-bg); color: var(--ok); }
.checklist .txt { flex: 1; }
.progress-line { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.progress-line i { display: block; height: 100%; background: var(--blue-ink); width: var(--pct, 0%); border-radius: inherit; }
.versions { display: grid; gap: 12px; }
@media (min-width: 760px) { .versions { grid-template-columns: 1fr 1fr; } }
.version { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.version h3 { margin: 0 0 4px; }
.version.pending { border-color: var(--warn-line); background: var(--warn-bg); }

/* ---------- categories & nominees ---------- */
.upload-cover { width: 100%; max-width: 440px; aspect-ratio: 16 / 9; border-radius: 12px; border: 2px dashed var(--line-strong); background: var(--surface); display: flex; align-items: center;
  justify-content: center; overflow: hidden; position: relative; cursor: pointer; color: var(--ink-soft); text-align: center; padding: 0; font: inherit; }
.upload-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-cover.has { border-style: solid; border-color: var(--line); }
.upload-cover:hover { border-color: var(--blue-ink); }
.drop-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; font-size: 0.9rem; }
.drop-hint svg.i { width: 30px; height: 30px; stroke-width: 1.6; }
.busy { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; color: var(--navy); border-radius: inherit; }
.progress { width: 70%; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--pct, 0%); background: var(--blue-ink); transition: width 0.2s; }
.drag { border-color: var(--blue-ink) !important; background: var(--blue-tint) !important; }

.cat-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); align-items: start; }
.cat { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); min-width: 0; }
.cat.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px rgba(11, 92, 196, 0.35); } to { box-shadow: var(--shadow); } }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cat-head .num { font-weight: 800; color: var(--blue-ink); font-size: 0.85rem; min-width: 20px; }
.cat-head input { margin: 0; flex: 1 1 180px; font-weight: 700; min-height: 40px; }
.cat-head .tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.cat.collapsed .cat-head { border-bottom: 0; }
.cat-body { padding: 10px 14px 14px; }
.cat-desc { margin: 0 0 8px; }
.cat-desc textarea { min-height: 64px; margin-top: 0; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--blue-ink); font: inherit; font-size: 0.86rem; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }
.noms { list-style: none; margin: 0; padding: 0; }
.nom { border-top: 1px solid var(--line); }
.nom:first-child { border-top: 0; }
.nom-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.nom-row .rank { width: 20px; text-align: right; color: var(--ink-faint); font-size: 0.82rem; font-weight: 700; flex: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; border: 1px dashed var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; position: relative; padding: 0; color: var(--ink-faint); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has { border: 1px solid var(--line); }
.avatar:hover { border-color: var(--blue-ink); }
.avatar svg.i { width: 18px; height: 18px; }
.avatar .busy { border-radius: 50%; font-size: 0.62rem; }
.nom-row input[type="text"] { margin: 0; flex: 1 1 auto; min-width: 0; font-weight: 600; min-height: 40px; }
.nom-row .tools { display: flex; gap: 6px; flex: none; }
.nom-row .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-ink); }
.nom.invalid .nom-row input[type="text"] { border-color: #f4b8b2; background: var(--danger-bg); }
.nom-panel { margin: 0 0 10px 30px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.nom-panel textarea { margin-top: 6px; min-height: 72px; font-size: 0.95rem; }
.nom-panel .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.nom-panel .row .spacer { flex: 1; }
.only-narrow { display: none !important; }
@media (max-width: 640px) {
  .nom-row .tools .wide { display: none; }
  .only-narrow { display: inline-flex !important; }
  .nom-panel { margin-left: 0; }
  .nom-row .rank { display: none; }
}
.add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.cat-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.filter-note { font-size: 0.84rem; color: var(--ink-soft); }

/* save bar */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(16, 24, 40, 0.35);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .savebar { left: var(--sidebar-w); } }
.savebar .in { max-width: 1272px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.savebar .state { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 650; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; }
.savebar .state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.savebar[data-state="saved"] .dot { background: var(--ok); }
.savebar[data-state="dirty"] .dot { background: #f79009; }
.savebar[data-state="saving"] .dot { background: var(--blue); animation: pulse 1s infinite; }
.savebar[data-state="error"] .dot { background: var(--danger); }
.savebar[data-state="error"] .state { color: var(--danger); }
.savebar .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- results (layout for Phase 3/4; planned controls disabled) ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-left: 1px solid var(--line-strong); background: #fff; padding: 8px 13px; font: inherit; font-size: 0.88rem;
  font-weight: 650; color: var(--ink-soft); min-height: 40px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg button[disabled] { color: var(--ink-faint); background: var(--surface); cursor: not-allowed; }
.res-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.res-tools .spacer { flex: 1; }
.res-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); align-items: start; }
.res-card { padding: 16px 18px 12px; margin: 0; }
.res-card .card-head { margin-bottom: 8px; align-items: center; }
.res-row { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 8px 8px 10px; border-radius: 10px; }
.res-row.first { background: var(--blue-tint); }
.res-row .rk { color: var(--ink-faint); font-weight: 750; font-size: 0.85rem; text-align: right; }
.res-row .av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.res-row .av img { width: 100%; height: 100%; object-fit: cover; }
.res-row .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .ct, .res-row .pc { font-variant-numeric: tabular-nums; color: var(--ink-faint); font-size: 0.88rem; min-width: 36px; text-align: right; }
.res-row .track { grid-column: 3 / -1; height: 5px; border-radius: 999px; background: var(--surface-2); }
.res-row.first .track { background: #fff; }
.res-row .track > i { display: block; height: 100%; width: var(--pct, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--blue-ink), var(--light)); transition: width 0.4s; }
.res-row .pend { color: var(--warn); font-weight: 700; font-size: 0.8rem; }
.res-totals { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin-bottom: 16px; }
.res-totals:empty { display: none; }
.res-totals .stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.res-totals .stat .k { font-size: 0.8rem; color: var(--ink-soft); font-weight: 650; }
.res-totals .stat b { font-size: 1.45rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.res-totals .stat b.txt { font-size: 1.05rem; padding-top: 4px; }
.res-totals .stat .sub { font-size: 0.78rem; color: var(--ink-faint); }
.res-totals .stat.ok b { color: var(--ok); }
.res-totals .stat.warn b { color: var(--warn); }
.res-more { font-size: 0.84rem; color: var(--ink-soft); padding: 6px 8px 0; }
.planned-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 0.86rem; color: var(--ink-soft); }

/* placeholder (planned) sections */
.future { text-align: center; padding: 30px 16px 24px; }
.future .big { color: var(--blue-ink); }
.future .big svg.i { width: 46px; height: 46px; stroke-width: 1.6; }
.future h2 { margin: 6px 0; }
.future p { max-width: 540px; margin: 0 auto 8px; color: var(--ink-soft); }

/* ---------- Phase 4: results views, charts, analytics, vote log, reveal, per-category rules ---------- */
.sel-inline { display: inline-block; width: auto; min-width: 0; margin: 0; max-width: 100%; }
.res-tools .sel-inline { flex: 0 1 240px; }
.res-totals a.stat.link { text-decoration: none; border-color: var(--warn-line); background: var(--warn-bg); }
.res-totals a.stat.link b { color: var(--warn); }
.res-more.tie { color: var(--blue-ink); font-weight: 650; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.84rem; }
.strong { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
.h3 { font-size: 0.95rem; margin: 14px 0 8px; color: var(--ink); }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--blue-ink); cursor: pointer; font-weight: 650; }
.link-btn.muted { color: var(--ink-soft); font-weight: 500; }
.empty-chart { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 8px; color: var(--ink-faint); text-align: center; }
.empty-chart svg.i { width: 34px; height: 34px; stroke-width: 1.5; }
.empty-chart p { margin: 0; font-size: 0.9rem; }
.av.sm { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-faint); flex: none; }
.av.sm img { width: 100%; height: 100%; object-fit: cover; }
.av.sm svg.i { width: 15px; height: 15px; }
/* tooltip */
.viz-tip { position: absolute; z-index: 90; pointer-events: none; background: var(--navy); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 0.82rem; line-height: 1.4;
  box-shadow: var(--shadow-lg); max-width: 260px; }
.viz-tip .tt { font-weight: 750; margin-bottom: 2px; }
.viz-tip .tl { color: rgba(255, 255, 255, 0.88); font-variant-numeric: tabular-nums; }
/* donut */
.donut-wrap { display: grid; gap: 14px 22px; align-items: center; grid-template-columns: minmax(140px, 190px) minmax(0, 1fr); }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .donut-wrap .legend { width: 100%; } }
.donut { width: 100%; max-width: 190px; height: auto; overflow: visible; }
.donut .seg-mark { cursor: pointer; transition: opacity 0.15s; outline: none; }
.donut .seg-mark.dim { opacity: 0.28; }
.donut .seg-mark:focus-visible { opacity: 1; filter: drop-shadow(0 0 3px rgba(11, 92, 196, 0.6)); }
.donut text { pointer-events: none; }
.donut-n { font-size: 26px; font-weight: 800; fill: var(--ink); font-variant-numeric: tabular-nums; }
.donut-k { font-size: 12px; fill: var(--ink-soft); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.88rem; transition: opacity 0.15s; }
.legend li.dim { opacity: 0.4; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.legend .lv { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.legend.inline li { grid-template-columns: 12px auto; }
/* horizontal bars */
.hbars { display: grid; gap: 2px; container-type: inline-size; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 6px; border-radius: 8px; outline: none; }
.hbar:hover, .hbar:focus-visible { background: var(--surface); }
.hbar.click { cursor: pointer; }
.hbar.lead .hb-n { font-weight: 750; }
.hb-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-n { font-size: 0.9rem; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; overflow-wrap: break-word; }
.hb-t { height: 18px; display: flex; align-items: center; }
.hb-t > i { display: block; height: 18px; max-height: 24px; background: #2a78d6; border-radius: 0 4px 4px 0; transition: width 0.4s; }
.hbar.lead .hb-t > i { background: var(--blue-ink); }
.hb-v { font-variant-numeric: tabular-nums; font-size: 0.86rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 520px) { .hbar { grid-template-columns: minmax(0, 1fr) auto; } .hb-t { grid-column: 1 / -1; grid-row: 2; height: 12px; } .hb-t > i { height: 12px; } }
/* narrow cards (two-column analytics): name + value on one line, the bar underneath */
@container (max-width: 440px) { .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; } .hb-t { grid-column: 1 / -1; grid-row: 2; height: 12px; } .hb-t > i { height: 12px; } }
/* stacked columns */
.cols-scroll { overflow-x: auto; }
.cols-chart { display: block; max-width: none; }
.cols-chart .grid { stroke: #edf0f5; stroke-width: 1; }
.cols-chart .base { stroke: var(--line-strong); stroke-width: 1; }
.cols-chart .ax { font-size: 11px; fill: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cols-chart .hit { fill: transparent; }
.cols-chart .col { outline: none; cursor: default; }
.cols-chart .col:hover .hit, .cols-chart .col:focus-visible .hit { fill: rgba(11, 92, 196, 0.06); }
/* table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rtable th, .rtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rtable thead th { font-size: 0.78rem; color: var(--ink-soft); font-weight: 750; white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtable tr.lead td { background: var(--blue-tint); }
.rtable.compact th, .rtable.compact td { padding: 6px 8px; }
.th-sort { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
.rtable th.num .th-sort { flex-direction: row-reverse; }
.cellname { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.table-card .card-head .search { flex: 0 1 260px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
/* reveal controls */
details.reveal, details.rdisp { padding: 12px 18px; }
details.reveal > summary, details.rdisp > summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; min-height: 32px; }
details.reveal > summary::-webkit-details-marker, details.rdisp > summary::-webkit-details-marker { display: none; }
details.reveal > summary .grow, details.rdisp > summary .grow { flex: 1; }
details.reveal[open] > summary, details.rdisp[open] > summary { margin-bottom: 8px; }
.reveal-cats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 0 2px; border-top: 1px solid var(--line); }
.chip.hidden-cat { border-style: dashed; color: var(--ink-soft); }
/* analytics */
.an-filters .custom-range { display: inline-flex; gap: 6px; align-items: center; }
.an-filters input[type="date"] { font: inherit; padding: 8px 10px; min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.label-inline { color: var(--ink-soft); display: inline-flex; }
.explain { margin: -6px 0 16px; display: flex; gap: 6px; align-items: flex-start; }
.cols2.even { grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cols2.even > .card { margin-bottom: 0; }
.cols2.even { margin-bottom: 18px; }
.card.locked { background: var(--surface); border-style: dashed; box-shadow: none; }
.peaks { margin: 0 0 6px; padding-left: 20px; font-size: 0.9rem; }
.peaks li { padding: 3px 0; }
.peaks li b { float: right; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(9px, 1fr)); gap: 2px; font-size: 0.68rem; color: var(--ink-faint); }
.heat .hc { aspect-ratio: 1; border-radius: 3px; min-height: 9px; outline: none; }
.heat .hc:focus-visible { box-shadow: var(--focus); }
.heat .hy { align-self: center; }
.heat-legend { display: flex; gap: 3px; align-items: center; margin-top: 8px; }
.heat-legend .hc { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.split2 { display: grid; gap: 4px 22px; }
@media (min-width: 700px) { .split2 { grid-template-columns: 1fr 1fr; } }
.flag-list { list-style: none; margin: 0 0 6px; padding: 0; }
.flag-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.flag-list li:first-child { border-top: 0; }
.flag-ico { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--warn-bg); color: var(--warn); }
.flag-ico.f-shared_network { background: var(--blue-tint); color: var(--blue-ink); }
.ok-line { color: var(--ok); display: flex; gap: 6px; align-items: center; }
/* vote log */
.log-card { padding-bottom: 12px; }
.log-filters { display: grid; gap: 10px; margin-bottom: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .sel-inline { flex: 0 1 180px; }
.filter-row .search { flex: 1 1 220px; }
.review-bar { position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.review-bar > span { flex: 1 1 200px; }
.rtable.log td { vertical-align: top; }
.rtable.log td.when { white-space: nowrap; font-size: 0.86rem; }
.rtable.log .sel { width: 34px; }
.rtable.log td:nth-child(3) { min-width: 150px; }
.rtable.log td.mode { white-space: nowrap; }
.rtable.log td:nth-child(4) .small { max-width: 220px; }
.rtable.log td:nth-child(8) { min-width: 160px; }
.rtable.log input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; }
.rtable.log tr.st-invalidated td { color: var(--ink-soft); }
.rtable.log tr.st-invalidated .strong { text-decoration: line-through; text-decoration-color: rgba(91, 100, 117, 0.5); }
.rtable.log .empty-row { text-align: center; padding: 26px; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag.flag { background: var(--warn-bg); color: var(--warn); text-transform: none; letter-spacing: 0; font-size: 0.72rem; }
.tag.flag.f-shared_network { background: var(--blue-tint); color: var(--blue-ink); }
#reviewDialog { width: min(520px, calc(100% - 32px)); }
#reviewDialog textarea { min-height: 72px; }
/* per-category rules */
.cat-block { border-top: 1px solid var(--line); margin-top: 6px; }
.cat-rules { display: grid; gap: 6px; padding-bottom: 6px; }
.cr-head, .cat-rule { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 140px; gap: 10px; align-items: center; }
.cr-head { font-size: 0.78rem; font-weight: 750; color: var(--ink-soft); padding: 0 2px; }
.cat-rule { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cat-rule select, .cat-rule input { margin: 0; }
.cr-name { font-weight: 650; overflow-wrap: anywhere; }
.cr-period { display: grid; gap: 6px; }
.cr-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 640px) { .cr-head { display: none; } .cat-rule { grid-template-columns: 1fr 96px; } .cr-name { grid-column: 1 / -1; } }

/* activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.activity li.muted { display: block; }
.activity .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue-ink); margin-top: 6px; }
.activity .dot.admin { background: var(--premium); }
.activity .dot.system { background: var(--ink-faint); }
.activity .when { color: var(--ink-faint); font-size: 0.8rem; }

/* dialogs */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(11, 37, 87, 0.55); }
dialog .in { padding: 22px; }
dialog h2 { margin: 0 0 8px; color: var(--navy); font-size: 1.15rem; }
#confirmText { white-space: pre-line; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

/* logged-out / states */
.hero-card { max-width: 620px; margin: 40px auto; text-align: center; }
.hero-card .big { color: var(--blue-ink); }
.hero-card .big svg.i { width: 48px; height: 48px; stroke-width: 1.6; }
.hero-card h1 { margin: 6px 0 8px; }
.skeleton { height: 160px; border-radius: var(--radius); background: var(--surface-2); }

/* new contest */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 46px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-tint);
  color: var(--blue-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
@media (max-width: 520px) { .step { padding-left: 0; } .step::before { position: static; margin-bottom: 8px; } }
hr.sep-line { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.cat-input { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cat-input input { margin: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- public-style preview (votepoll.io look) ---------- */
body.pv-body { background: radial-gradient(circle at 12% 8%, rgba(10, 132, 255, 0.35) 0%, transparent 45%),
  radial-gradient(circle at 88% 92%, rgba(77, 163, 255, 0.18) 0%, transparent 45%), linear-gradient(160deg, #0b2557, #0b55ab); background-color: #0b2557; }
.pv-body .pv-tabs .chip { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.pv-body .pv-tabs .chip[aria-pressed="true"] { background: #fff; color: var(--navy); border-color: #fff; }
.pv-body .pv-nom .btn[disabled] { background: var(--blue-ink); color: #fff; opacity: 0.55; border-color: transparent; }
.pv-banner { position: sticky; top: 0; z-index: 30; background: #fff7e6; color: #7a4100; border-bottom: 1px solid #fedf89; font-size: 0.9rem; }
.pv-banner .in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.pv-banner .in .spacer { flex: 1; }
.pv { max-width: 1100px; margin: 0 auto; padding: 0 16px 60px; }
.pv-hero { border-radius: 0 0 16px 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow-lg); }
.pv-cover { aspect-ratio: 21 / 8; background: linear-gradient(135deg, var(--navy), var(--blue)); position: relative; overflow: hidden; }
.pv-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .pv-cover { aspect-ratio: 16 / 9; } }
.pv-head { padding: clamp(16px, 3vw, 28px); }
.pv-head h1 { margin: 0 0 4px; color: var(--navy); font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.15; overflow-wrap: anywhere; }
.pv-head .by { color: var(--ink-soft); margin: 0 0 10px; }
.pv-head .desc { white-space: pre-line; margin: 0 0 14px; }
.pv-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-facts .fact { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.88rem; }
.pv-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.pv-tabs::-webkit-scrollbar { display: none; }
.pv-tabs .chip { flex: none; }
.pv-cat h2 { color: #fff; margin: 14px 0 2px; }
.pv-cat > p { color: rgba(255, 255, 255, 0.85); margin: 0 0 12px; white-space: pre-line; }
/* Nominee cards: the shared picture-card design (picture-cards.css: .pc-grid / .pc-card / .pc-figure / .pc-body /
   .pc-name / .pc-result), identical to Picture Poll cards. Only contest-specific parts are styled here.
   Automatic columns (no .pc-cols-* class): the grid contests always had. */
.pv-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.pv-nom .ph { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.pv-nom .ph svg.i { width: 44px; height: 44px; stroke-width: 1.5; }
.pv-nom p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; white-space: pre-line; overflow-wrap: anywhere; }
.pv-nom .btn { margin-top: auto; }
/* The photo is a button that opens the enlarged view (image-viewer.js) — it never votes. Its magnifier matches
   Picture Poll's "View larger image" control (.pc-zoom). */
.pv-nom .ph .pc-photo-btn { position: absolute; inset: 0; width: 100%; height: 100%; display: block; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: none; color: inherit; cursor: zoom-in; }
.pv-nom .ph .pc-photo-btn:focus-visible { outline: 3px solid var(--light); outline-offset: -3px; }
.pv-nom .ph .pc-photo-btn .zoom-thumb-icon { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95); color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); pointer-events: none; }
.pv-nom .ph .pc-photo-btn .zoom-thumb-icon svg { width: 16px; height: 16px; }
.pv-nom .ph .pc-photo-btn:hover .zoom-thumb-icon { color: var(--blue-ink); border-color: var(--blue-ink); }
.pv-nom .ph .pc-photo-btn:disabled, .pv-nom .ph .pc-photo-btn.is-broken { cursor: default; }
.pv-nom .ph .pc-photo-btn:disabled .zoom-thumb-icon, .pv-nom .ph .pc-photo-btn.is-broken .zoom-thumb-icon { display: none; }
.pv-nom .ph .your-vote, .pv-nom .ph .nom-no { z-index: 1; pointer-events: none; }

/* Enlarged picture (image-viewer.js, the same viewer as Picture Polls): centered, darkened backdrop, Close,
   Escape, click outside, previous / next across the category's nominees. */
.image-viewer-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, 0.88); display: flex; align-items: center; justify-content: center; padding: 24px; }
.image-viewer-dialog { position: relative; max-width: min(92vw, 1000px); max-height: calc(var(--viewer-h, 100vh) * 0.92); display: flex; flex-direction: column; align-items: center; }
.image-viewer-dialog img { max-width: 100%; max-height: calc(var(--viewer-h, 100vh) * 0.8); object-fit: contain; border-radius: 10px; background: #0f172a; }
.image-viewer-close { position: absolute; top: -16px; right: -16px; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.image-viewer-caption { color: #fff; margin-top: 10px; font-size: 0.95rem; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.image-viewer-meta { color: #cbd5e1; margin-top: 8px; font-size: 0.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.image-viewer-meta + .image-viewer-caption { margin-top: 2px; }
.image-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.92);
  color: var(--ink); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.image-viewer-prev { left: -60px; }
.image-viewer-next { right: -60px; }
.image-viewer-nav:hover { background: #fff; }
.image-viewer-close:focus-visible, .image-viewer-nav:focus-visible { outline: 3px solid var(--light); outline-offset: 2px; }
.image-viewer-stage { position: relative; width: 100%; overflow: hidden; border-radius: 10px; }
.image-viewer-stage img { display: block; margin: 0 auto; width: auto; height: auto; }
@media (max-width: 1160px) {
  .image-viewer-dialog.has-nav { width: 100%; min-height: 180px; justify-content: center; }
  .image-viewer-prev { left: 6px; }
  .image-viewer-next { right: 6px; }
}
@media (max-width: 480px) {
  .image-viewer-close { top: 6px; right: 6px; }
  .image-viewer-backdrop { padding: 12px; }
  .image-viewer-dialog { max-width: 100%; }
}
.pv-rules { color: rgba(255, 255, 255, 0.9); font-size: 0.9rem; margin: 16px 0 0; }

/* ---------- public contest page (static/vote.js) ---------- */
.vote-body { padding-bottom: 24px; }
.vote-test { background: #eef4ff; color: var(--navy); border-bottom-color: #c7dbff; }
.vote-status { margin-bottom: 10px; min-height: 28px; }
.vchip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 700; }
.vchip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.18); }
.vchip.open { background: var(--ok-bg); color: var(--ok); }
.vchip.soon { background: var(--blue-tint); color: var(--blue-ink); }
.vchip.paused { background: var(--warn-bg); color: var(--warn); }
.vchip.ended { background: var(--surface-2); color: var(--ink-soft); }
.vote-changes { margin-top: 12px; font-size: 0.88rem; color: var(--ink-soft); }
.vote-changes summary { cursor: pointer; font-weight: 650; color: var(--blue-ink); }
.vote-changes ul { margin: 8px 0 6px; padding-left: 18px; }
.vote-changes li { margin: 3px 0; }
.vote-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff;
  box-shadow: var(--shadow-lg); font-weight: 600; color: var(--ink); }
.vote-banner.warn { background: var(--warn-bg); color: var(--warn); }
/* Human check (Turnstile): shown only while a vote is being checked; the widget itself is
   interaction-only, so most visitors just see "Checking…" for a moment. */
.ts-panel { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 61;
  width: min(420px, calc(100% - 32px)); padding: 14px 16px; border-radius: 14px; background: #fff; color: var(--ink);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5); }
.ts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-head strong { color: var(--navy); }
.ts-status { margin: 6px 0 0; font-weight: 600; }
.ts-box { margin-top: 8px; max-width: 100%; overflow: hidden; }
.ts-box:empty { margin-top: 0; }
.ts-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.vote-toast .toast-act { margin-left: 8px; padding: 6px 12px; min-height: 36px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 999px;
  background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.vote-toast .toast-act:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pv-tabs a.chip { text-decoration: none; display: inline-flex; align-items: center; }
.vote-left { color: #fff; font-weight: 650; margin: 0 0 14px; display: flex; align-items: center; gap: 6px; }
.vote-btn { width: 100%; justify-content: center; gap: 6px; min-height: 44px; }
.pv-body .pv-nom .vote-btn.voted, .pv-body .pv-nom .vote-btn.voted[disabled] { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; opacity: 1; }
.pv-nom.is-picked { box-shadow: 0 0 0 3px #75e0a7, var(--shadow-lg); border-color: #75e0a7; }
.pv-nom .ph .your-vote svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.your-vote { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--ok); color: #fff; font-size: 0.8rem; font-weight: 700; }
.vote-results { margin: 22px 0 0; padding: clamp(16px, 2.6vw, 24px); border: 0; box-shadow: var(--shadow-lg); }
.vr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--navy); }
.vr-head h2 { margin: 0; font-size: 1.2rem; }
.vr-head svg.i { width: 22px; height: 22px; color: var(--blue-ink); }
.vr-head .live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--ok); }
.vr-head .live .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: vr-pulse 1.6s infinite; }
@keyframes vr-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .vr-head .live .dot { animation: none; } }
.vr-list { list-style: none; margin: 0; padding: 0; }
.vr-row { display: grid; grid-template-columns: 26px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; }
.vr-row + .vr-row { margin-top: 2px; }
.vr-row.first { background: var(--blue-tint); }
.vr-row .rank { color: var(--ink-faint); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.vr-row.first .rank { color: var(--blue-ink); }
.vr-row .av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.vr-row .av img { width: 100%; height: 100%; object-fit: cover; }
.vr-row .nm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vr-row .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-row .track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.vr-row.first .track { background: #fff; }
.vr-row .fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-ink), var(--light)); transition: width 0.4s; }
.vr-row .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.9rem; color: var(--ink-soft); text-align: right; }
.vr-row .num strong { color: var(--ink); }
.vr-foot { margin: 12px 4px 0; font-size: 0.86rem; }
.vote-toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; width: min(560px, calc(100% - 32px));
  padding: 13px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5); }
.vote-toast.ok { background: #054f31; }
.vote-toast.err { background: #7a271a; }
.vote-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; color: rgba(255, 255, 255, 0.75); font-size: 0.82rem; padding: 0 16px; }
.vote-foot a { color: #fff; }
.vote-lock { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.vote-lock svg.i { width: 36px; height: 36px; color: var(--blue-ink); }
.vote-lock h1 { margin: 0; color: var(--navy); }
.vote-lock .by { margin: -6px 0 0; color: var(--ink-soft); }
.vote-lock input { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.vote-msg h1 { color: var(--navy); }
/* Phones: two nominee cards per row (long categories stay short); text a bit tighter. */
@media (max-width: 560px) {
  .vote-body .pv-grid:not(.pc-cols-2):not(.pc-cols-3):not(.pc-cols-4) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vote-body .pv-nom p { font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .vote-body .your-vote { left: 6px; top: 6px; padding: 3px 8px; font-size: 0.74rem; }
}
@media (max-width: 520px) { .vr-row { grid-template-columns: 22px 34px minmax(0, 1fr); } .vr-row .num { grid-column: 3; text-align: left; margin-top: -4px; } .vr-row .av { width: 34px; height: 34px; } }

/* Results on the nominee cards (rank · % · bar · votes) and the "Sort by" control above the grid. */
.pv-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 12px; }
.pv-tools .pv-note { margin: 0; color: rgba(255, 255, 255, 0.9); font-size: 0.9rem; font-weight: 600; }
.pv-tool-set { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; margin-left: auto; }
.pv-sort, .pv-tools .pc-layout { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 0.88rem; font-weight: 650; white-space: nowrap; }
.pv-sort select, .pv-tools .pc-layout select { font: inherit; font-size: 16px; /* ≥ 16px: no zoom on focus in iOS Safari */ font-weight: 600; color: var(--navy); background-color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 6px 30px 6px 10px; min-height: 38px; max-width: 62vw; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230b2557' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.pv-sort select:focus-visible, .pv-tools .pc-layout select:focus-visible { outline: 3px solid var(--light); outline-offset: 2px; }
.pv-tools .pc-layout select { max-width: 46vw; }
.pv-nom .pc-result + .btn { margin-top: 4px; }
/* Bottom results: the number column keeps one width, so every bar has the same length. */
.vr-row .num { min-width: 3.6em; }
.res-tools #resSort { max-width: 212px; }
/* Nominee number ("No. 3", number orders only): bottom-left of the photo; the magnifier is top-right. */
.nom-no { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(11, 37, 87, 0.86); color: #fff;
  font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .pv-tools { margin-bottom: 10px; }
  .pv-sort span { font-size: 0.84rem; }
  .nom-no { left: 6px; bottom: 6px; padding: 2px 7px; font-size: 0.72rem; }
}

/* server-rendered "not available" / not found pages (src/public.js page()) */
main.wrap { max-width: 620px; margin: 72px auto; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
main.wrap h1 { margin: 0 0 8px; font-size: 1.4rem; }

/* ---------- Present mode (TV / projector): sizes scale with the viewport ---------- */
body.pm-body { margin: 0; min-height: 100vh; color: #fff; background: radial-gradient(circle at 15% 10%, rgba(10, 132, 255, 0.35) 0%, transparent 45%),
  radial-gradient(circle at 85% 95%, rgba(77, 163, 255, 0.22) 0%, transparent 45%), linear-gradient(160deg, #081c45, #0b2557 45%, #0b4a96); background-color: #0b2557; overflow-x: hidden; }
.pm { min-height: 100vh; padding: clamp(16px, 2.6vw, 56px) clamp(16px, 4vw, 96px) clamp(90px, 9vh, 140px); display: flex; flex-direction: column; outline: none; }
.pm-head { display: flex; align-items: center; gap: clamp(10px, 1.4vw, 28px); }
.pm-logo { height: clamp(22px, 2.2vw, 46px); width: auto; }
.pm-contest { font-size: clamp(0.95rem, 1.35vw, 2.1rem); font-weight: 650; color: rgba(255, 255, 255, 0.82); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-live { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-weight: 750; font-size: clamp(0.8rem, 1vw, 1.5rem); }
.pm-live .dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; animation: pmPulse 1.6s infinite; }
@keyframes pmPulse { 50% { opacity: 0.35; } }
.pm-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 1700px; width: 100%; margin: 0 auto; }
.pm-msg { font-size: clamp(1.1rem, 2vw, 2.4rem); text-align: center; color: rgba(255, 255, 255, 0.85); }
.pm-cat { text-align: center; margin: clamp(10px, 2vh, 40px) 0 clamp(12px, 2.4vh, 48px); }
.pm-step { display: block; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 750; font-size: clamp(0.75rem, 1vw, 1.5rem); color: #8cc4ff; }
.pm-cat h1 { color: #fff; margin: 6px 0 0; font-size: clamp(1.8rem, 4.4vw, 6rem); line-height: 1.08; font-weight: 850; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.pm-sub { text-align: center; font-size: clamp(1rem, 1.8vw, 2.6rem); color: rgba(255, 255, 255, 0.85); margin: 0 0 clamp(10px, 2vh, 36px); }
.pm-await { text-align: center; font-size: clamp(1.4rem, 3vw, 4.4rem); font-weight: 800; margin: clamp(16px, 4vh, 70px) 0 0; color: #ffd166; }
.pm-noms { display: grid; gap: clamp(12px, 2vw, 44px); grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 13vw, 300px), 1fr)); justify-items: center; }
.pm-nom { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1vh, 18px); text-align: center; }
.pm-nom .pm-name { font-size: clamp(1rem, 1.6vw, 2.4rem); font-weight: 700; }
.pm-av { border-radius: 50%; overflow: hidden; flex: none; background: rgba(255, 255, 255, 0.14); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.pm-av img { width: 100%; height: 100%; object-fit: cover; }
.pm-av.md { width: clamp(44px, 4.4vw, 104px); height: clamp(44px, 4.4vw, 104px); }
.pm-av.lg { width: clamp(90px, 10vw, 240px); height: clamp(90px, 10vw, 240px); }
.pm-av.xl { width: clamp(56px, 6vw, 140px); height: clamp(56px, 6vw, 140px); }
.pm-ini { font-weight: 800; font-size: 1.6em; color: rgba(255, 255, 255, 0.9); }
.pm-av.md .pm-ini { font-size: clamp(1.1rem, 1.8vw, 2.6rem); } .pm-av.xl .pm-ini, .pm-av.lg .pm-ini { font-size: clamp(1.6rem, 3vw, 5rem); }
.pm-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(5px, 0.9vh, 18px); }
.pm-row { display: grid; grid-template-columns: clamp(30px, 3vw, 80px) auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: clamp(10px, 1.4vw, 32px); align-items: center;
  padding: clamp(6px, 0.9vh, 20px) clamp(12px, 1.4vw, 32px); border-radius: clamp(12px, 1.2vw, 28px); background: rgba(255, 255, 255, 0.07); }
.pm-row .pm-av { grid-row: 1 / span 2; }
.pm-row .pm-rk { grid-row: 1 / span 2; font-size: clamp(1.1rem, 2vw, 3.2rem); font-weight: 850; color: rgba(255, 255, 255, 0.6); text-align: center; font-variant-numeric: tabular-nums; }
.pm-row .pm-name { font-size: clamp(1.05rem, 2vw, 3.2rem); font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-row .pm-val { font-variant-numeric: tabular-nums; font-size: clamp(0.95rem, 1.6vw, 2.6rem); white-space: nowrap; }
.pm-row .pm-val span { color: rgba(255, 255, 255, 0.72); }
.pm-row .pm-bar { grid-column: 3 / -1; height: clamp(6px, 0.8vh, 16px); border-radius: 999px; background: rgba(255, 255, 255, 0.12); margin-top: clamp(4px, 0.6vh, 10px); }
.pm-row .pm-bar > i { display: block; height: 100%; width: var(--pct); border-radius: inherit; background: linear-gradient(90deg, #4da3ff, #8cc4ff); transition: width 0.8s ease; }
.pm-row.win { background: linear-gradient(90deg, rgba(255, 209, 102, 0.28), rgba(255, 209, 102, 0.08)); box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.65); }
.pm-row.win .pm-rk { color: #ffd166; }
.pm-row.win .pm-bar > i { background: linear-gradient(90deg, #ffb703, #ffd166); }
.pm-row.top1 .pm-name { font-size: clamp(1.25rem, 2.6vw, 4.2rem); }
.pm-rank.reveal .pm-row { animation: pmIn 0.7s both; animation-delay: calc(var(--i) * 0.55s); }
@keyframes pmIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.pm-more, .pm-total { text-align: center; color: rgba(255, 255, 255, 0.7); font-size: clamp(0.9rem, 1.3vw, 2rem); margin: clamp(8px, 1.4vh, 26px) 0 0; }
.pm-controls { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: clamp(10px, 2vh, 28px); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: 16px; background: rgba(4, 16, 44, 0.82); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); transition: opacity 0.3s; max-width: calc(100% - 20px); z-index: 20; }
.pm-controls button, .pm-controls a, .pm-controls select { font: inherit; font-size: 0.92rem; font-weight: 650; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px; min-height: 40px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.pm-controls select { max-width: 260px; width: auto; margin: 0; padding-right: 30px; -webkit-appearance: none; appearance: none; background-color: rgba(255, 255, 255, 0.1);
  /* Safari draws native selects white (white text vanished): own chevron from two gradients, no image URL */
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.pm-controls select option { color: #101828; }
.pm-controls button[disabled] { opacity: 0.4; cursor: default; }
.pm-controls button.primary { background: #ffd166; color: #3b2a00; border-color: #ffd166; }
.pm-controls button[aria-pressed="false"]#pmCounts, .pm-controls button[aria-pressed="true"]#pmHideW { background: rgba(255, 209, 102, 0.18); border-color: rgba(255, 209, 102, 0.6); }
.pm-controls .sep { width: 1px; height: 26px; background: rgba(255, 255, 255, 0.2); margin: 0 2px; }
.pm-controls :focus-visible { box-shadow: 0 0 0 3px rgba(140, 196, 255, 0.8); outline: none; }
body.pm-idle .pm-controls { opacity: 0; pointer-events: none; }
body.pm-idle { cursor: none; }
.pm-help { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); background: #fff; color: var(--ink); border-radius: 16px; padding: 22px 26px; width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow-lg); z-index: 30; }
.pm-help h2 { margin: 0 0 10px; color: var(--navy); }
.pm-help dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 10px; font-size: 0.92rem; }
.pm-help dt { font-weight: 750; }
.pm-help dd { margin: 0; }
.pm-help p { font-size: 0.86rem; color: var(--ink-soft); margin: 0; }
.pm-toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: rgba(4, 16, 44, 0.9); color: #fff; padding: 8px 16px; border-radius: 10px; font-weight: 650; z-index: 40; }
@media (max-width: 700px) { .pm-row { grid-template-columns: 28px auto minmax(0, 1fr); } .pm-row .pm-val { grid-column: 3; grid-row: 2; } .pm-row .pm-bar { display: none; } .pm-controls .sep { display: none; } }

/* ---------- printable report ---------- */
body.rp-body { background: #fff; color: #101828; margin: 0; }
.rp-bar { display: flex; gap: 10px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.rp { max-width: 900px; margin: 0 auto; padding: 28px 20px 40px; }
.rp-head { display: grid; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 14px; margin-bottom: 18px; }
@media (min-width: 700px) { .rp-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.rp-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 800; color: var(--blue-ink); }
.rp-head h1 { margin: 2px 0 0; font-size: 1.8rem; color: var(--navy); }
.rp-org { margin: 2px 0 0; color: var(--ink-soft); }
.rp-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 0.86rem; }
.rp-meta dt { color: var(--ink-soft); } .rp-meta dd { margin: 0; }
.rp-cat { break-inside: avoid-page; margin-bottom: 22px; }
.rp-cat h2 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.rp-sub { margin: 2px 0 8px; color: var(--ink-soft); font-size: 0.86rem; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rp-table th, .rp-table td { border-bottom: 1px solid #d0d5dd; padding: 5px 8px; text-align: left; }
.rp-table th { font-size: 0.76rem; color: #475467; }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 70px; }
.rp-table tr { break-inside: avoid; }
.rp-table tr.win td { font-weight: 750; }
.rp-foot { margin-top: 24px; font-size: 0.78rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 10px; }
@media print {
  @page { margin: 14mm; }
  .no-print, .sidebar, .topbar, .res-tools, .savebar, #flash, .viz-tip, .pm-controls { display: none !important; }
  .main-col { margin-left: 0 !important; }
  body { background: #fff !important; font-size: 11pt; }
  .rp { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* vote log on phones and narrow tablets: each vote is a compact card, filters two per row */
@media (max-width: 760px) {
  .filter-row .sel-inline { flex: 1 1 calc(50% - 4px); }
  .filter-row .search { flex: 1 1 100%; order: -1; }
  .rtable.log thead tr { display: flex; align-items: center; gap: 10px; }
  .rtable.log thead th { background: none; border: 0; padding: 4px 0; }
  .rtable.log thead th:not(.sel) { display: none; }
  .rtable.log thead th.sel::after { content: "Select all"; font-size: 0.82rem; font-weight: 650; margin-left: 8px; vertical-align: 3px; }
  .rtable.log thead th.sel { width: auto; display: flex; align-items: center; }
  .rtable.log tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .rtable.log tbody td { display: block; padding: 0; border: 0; }
  .rtable.log tbody td.sel { grid-row: 1 / span 5; }
  .rtable.log tbody td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .rtable.log tbody td:nth-child(4) { grid-column: 3; grid-row: 1; text-align: right; }
  .rtable.log tbody td.when { grid-column: 2 / -1; grid-row: 2; white-space: normal; display: flex; gap: 8px; align-items: baseline; color: var(--ink-soft); }
  .rtable.log tbody td:nth-child(5), .rtable.log tbody td:nth-child(6), .rtable.log tbody td:nth-child(7) { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
  .rtable.log tbody td:nth-child(7) > div { display: inline; }
  .rtable.log tbody td:nth-child(8) { grid-column: 2 / -1; }
  .rtable.log tbody td:nth-child(6):has(> .muted:only-child) { display: none; }
  .rtable.log tbody td:nth-child(8):has(> .muted:only-child) { display: none; }
  .rtable.log tbody td.empty-row { grid-column: 1 / -1; grid-row: auto; }
  .rtable.log tbody tr:has(td.empty-row) { display: block; }
}

/* Phase 5: report a problem (public contest page). */
.vote-report-row { margin: 18px 0 6px; text-align: center; }
.vote-report { background: none; border: 0; padding: 8px 10px; min-height: 44px; color: var(--ink-soft); font: inherit; font-size: 0.86rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.vote-report:hover, .vote-report:focus-visible { color: var(--ink); }
/* Total votes received (header) + "How vote counts work" link next to "Report a problem". */
.pv-facts .fact-votes strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.vote-report-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.vote-help { display: inline-flex; align-items: center; padding: 8px 10px; min-height: 44px; color: var(--ink-soft); font-size: 0.86rem; text-decoration: underline; text-underline-offset: 3px; }
.vote-help:hover, .vote-help:focus-visible { color: var(--ink); }
.vote-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.vote-dialog::backdrop { background: rgba(16, 24, 40, 0.55); }
.vote-dialog h2 { margin-top: 0; font-size: 1.2rem; }
.vote-dialog label { display: block; font-weight: 650; margin: 12px 0 4px; }
.vote-dialog select, .vote-dialog textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; }
.vote-dialog .rep-reasons { border: 0; padding: 0; margin: 12px 0 0; }
.vote-dialog .rep-reasons legend { font-weight: 650; margin-bottom: 4px; }
.vote-dialog .rep-reason { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; min-height: 40px; }
.vote-dialog .rep-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.vote-dialog .rep-actions .btn { min-height: 44px; }
/* Server-rendered content shown before vote.js takes over (and to crawlers). */
.ssr-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.ssr-list .nom { padding: 10px; }
.ssr-list .nom img { width: 100%; height: auto; border-radius: 10px; }
.ssr-list .nom h3 { margin: 6px 0 2px; font-size: 1rem; }

/* Dashboard → Results → Public results display (settings + a preview of a public nominee card). */
.rdisp .rd-grid { display: grid; gap: 18px; margin-top: 6px; }
@media (min-width: 1100px) { .rdisp .rd-grid { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; } }
.rdisp .rd-fields { min-width: 0; }
.rdisp .choices.is-off { opacity: 0.55; }
.rdisp .rd-hint { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.84rem; }
.rdisp .switch { align-self: end; }
.rd-preview { position: sticky; top: 76px; }
.rd-stage { border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: radial-gradient(circle at 15% 10%, rgba(10, 132, 255, 0.35) 0%, transparent 50%), linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); }
.rd-stage .pv-nom { width: 100%; max-width: 230px; pointer-events: none; }
.rd-stage .pv-nom .vote-btn { display: inline-flex; align-items: center; }
.rd-sort { align-self: flex-end; background: #fff; color: var(--navy); font-size: 0.78rem; font-weight: 700; border-radius: 8px; padding: 4px 9px; }
.rd-cap { margin: 8px 2px 0; }
@media (max-width: 1099px) { .rd-preview { position: static; } .rd-stage { flex-direction: row; justify-content: center; flex-wrap: wrap; } }
