:root {
  --bg: #f7f8fa; --card: #ffffff; --text: #111827; --muted: #6b7280; --border: #e5e7eb;
  --accent: #0891b2; --accent-text: #ffffff; --code-bg: #0f172a; --code-text: #e2e8f0;
  --ok: #059669; --warn: #b45309; --bar: #cbd5e1; --bar-win: #06b6d4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --card: #111827; --text: #f3f4f6; --muted: #9ca3af; --border: #1f2937;
    --accent: #22d3ee; --accent-text: #06202a; --code-bg: #020617; --code-text: #cbd5e1;
    --ok: #34d399; --warn: #fbbf24; --bar: #334155; --bar-win: #22d3ee;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
header, main, footer { max-width: 820px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 40px; }
h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 0 0 6px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.lead { color: var(--muted); margin: 0 0 8px; }
a { color: var(--accent); }
section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 18px 0; }
section.disabled { opacity: .45; pointer-events: none; }
section p { color: var(--muted); margin: 0 0 12px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 700; flex: none; }
.code { background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; margin: 12px 0; }
.code:empty { display: none; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 9px 16px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
button:disabled { opacity: .5; cursor: progress; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.link { background: none; color: var(--muted); padding: 4px 0; font-weight: 400; text-decoration: underline; }
button.active { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.form { margin-top: 14px; }
.row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.identities { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.identity { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.identity b { display: block; font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.list { display: grid; gap: 8px; margin-top: 12px; }
.item { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.item small { color: var(--muted); font-weight: 400; white-space: nowrap; }
.votes, .viewers { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.votes .voter { flex: 1 1 240px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.votes .voter select { margin-bottom: 10px; }
.out { margin-top: 12px; font-size: 14px; }
.out .ok { color: var(--ok); } .out .warn { color: var(--warn); }
.bars { margin-top: 10px; display: grid; gap: 8px; }
.bar-row { font-size: 13px; }
.bar-row .head { display: flex; justify-content: space-between; }
.bar { height: 8px; border-radius: 999px; background: var(--bar); overflow: hidden; margin-top: 3px; }
.bar > i { display: block; height: 100%; background: var(--bar-win); border-radius: 999px; }
.log { font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); max-height: 220px; overflow-y: auto; }
.log div.err { color: #ef4444; }
footer { color: var(--muted); font-size: 13px; padding: 8px 16px 40px; }
