:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --ink: #14213d;
  --muted: #5a6479;
  --line: #dde2ee;
  --brand: #0b3d91;
  --brand-soft: #e6edfb;
  --on-brand: #ffffff;
  --accent: #f2b705;
  --brand-accent: #c8102e;
  --for: #167a46;
  --for-soft: #e2f4ea;
  --against: #b3261e;
  --against-soft: #fbe6e4;
  --abstain: #5f6675;
  --abstain-soft: #eceef3;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .05);
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1322;
    --surface: #141c31;
    --surface-2: #19223b;
    --ink: #e8ecf6;
    --muted: #9ba6bf;
    --line: #27324f;
    --brand: #6b96f0;
    --brand-soft: #1b2a4f;
    --brand-accent: #f0506a;
    --on-brand: #0c1322;
    --for: #4cc38a;
    --for-soft: #143226;
    --against: #ff8a80;
    --against-soft: #3a1b1a;
    --abstain: #a9b1c2;
    --abstain-soft: #232b40;
    --warn: #f2c14e;
    --warn-soft: #3a2f10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }

.topbar { background: var(--brand); color: var(--on-brand); position: sticky; top: 0; z-index: 20; }
@media (prefers-color-scheme: dark) { .topbar { background: #101a33; color: var(--ink); border-bottom: 1px solid var(--line); } }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; color: inherit; text-decoration: none; }
.brand svg, .brand img { flex: none; }
.logo-img { display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 8px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .2); opacity: 1; font-weight: 600; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-menu .who { text-align: right; line-height: 1.2; }
.user-menu .who small { opacity: .8; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa5bd; display: inline-block; }
.live-dot.on { background: #43d17f; box-shadow: 0 0 0 3px rgba(67, 209, 127, .25); }
.btn-ghost-light { background: transparent; border: 1px solid rgba(255, 255, 255, .45); color: inherit; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .15); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumb { font-size: .9rem; margin-bottom: 8px; display: inline-block; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card > h2, .card > .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.body-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.body-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.body-card h3 { font-size: 1.05rem; }
.body-card .desc { color: var(--muted); font-size: .9rem; }
.status-line { font-size: .9rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--for); animation: pulse 1.6s infinite; flex: none; }
.pulse.alert { background: var(--accent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 122, 70, .5); } 70% { box-shadow: 0 0 0 9px rgba(22, 122, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 122, 70, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } * { transition: none !important; } }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--against); border-color: var(--against); }
.btn.danger.solid { background: var(--against); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: .85rem; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.chair { background: var(--accent); color: #2b2100; }
.chip.admin { background: #ffe3e0; color: #8a1c14; }
.chip.ok { background: var(--for-soft); color: var(--for); }
.chip.no { background: var(--against-soft); color: var(--against); }
.chip.neutral { background: var(--abstain-soft); color: var(--abstain); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; min-width: 28px; text-align: center; padding: 1px 6px; border-radius: 6px; font-size: .75rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); letter-spacing: .4px; }
.flag { display: inline-block; width: 22px; height: 16px; object-fit: cover; vertical-align: -3px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.faction { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; white-space: nowrap; }
.faction .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=search], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.toolbar input, .toolbar select { width: auto; min-width: 150px; flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.check input { width: 18px; height: 18px; }
.membership-list { border: 1px solid var(--line); border-radius: 9px; max-height: 220px; overflow: auto; }
.membership-list .m-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.membership-list .m-row:last-child { border-bottom: 0; }
.membership-list select { width: auto; padding: 4px 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 18px 0; overflow-x: auto; }
.tab { appearance: none; background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { appearance: none; border: 0; background: var(--surface); padding: 6px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

.room-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.presence-bar { height: 10px; border-radius: 999px; background: var(--abstain-soft); overflow: hidden; }
.presence-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.notice.ok { background: var(--for-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.no { background: var(--against-soft); }
.notice .ico { font-weight: 800; flex: none; }
.law-box { border-left: 4px solid var(--brand); padding: 4px 0 4px 14px; }
.law-box .code { color: var(--muted); font-size: .85rem; font-weight: 600; }
.law-box h3 { font-size: 1.2rem; margin: 2px 0 6px; }

.vote-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 8px; }
@media (max-width: 560px) { .vote-buttons { grid-template-columns: 1fr; } }
.vote-btn { appearance: none; cursor: pointer; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 18px 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: .5px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; }
.vote-btn .sym { font-size: 1.6rem; line-height: 1; }
.vote-btn.for { color: var(--for); border-color: var(--for); }
.vote-btn.against { color: var(--against); border-color: var(--against); }
.vote-btn.abstain { color: var(--abstain); border-color: var(--abstain); }
.vote-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.vote-btn.selected.for { background: var(--for); color: #fff; }
.vote-btn.selected.against { background: var(--against); color: #fff; }
.vote-btn.selected.abstain { background: var(--abstain); color: #fff; }
.vote-btn .sel-note { font-size: .72rem; font-weight: 600; opacity: .95; height: 1em; }
.vote-btn:disabled { opacity: .5; cursor: wait; }

.rule-options { display: grid; gap: 10px; }
.rule-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 11px; cursor: pointer; font-weight: 400; margin: 0; }
.rule-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.rule-option input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.rule-option b { display: block; }
.rule-option .need { color: var(--brand); font-weight: 600; font-size: .85rem; margin-top: 2px; }

.verdict { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; font-weight: 800; font-size: 1.35rem; }
.verdict .sym { font-size: 2rem; line-height: 1; }
.verdict.adopted { background: var(--for-soft); color: var(--for); }
.verdict.rejected { background: var(--against-soft); color: var(--against); }
.verdict small { display: block; font-size: .85rem; font-weight: 500; color: var(--ink); opacity: .8; }

.tally-bar { display: flex; height: 22px; border-radius: 7px; overflow: hidden; background: var(--abstain-soft); margin: 12px 0 8px; position: relative; }
.tally-bar.thin { height: 12px; margin: 0; min-width: 120px; }
.tally-bar > i { display: block; height: 100%; }
.tally-bar .b-for { background: var(--for); }
.tally-bar .b-against { background: var(--against); }
.tally-bar .b-abstain { background: var(--abstain); }
.tally-bar .b-none { background: repeating-linear-gradient(45deg, var(--line), var(--line) 4px, transparent 4px, transparent 8px); }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: .9rem; }
.legend b { font-variant-numeric: tabular-nums; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.sw.for { background: var(--for); } .sw.against { background: var(--against); } .sw.abstain { background: var(--abstain); } .sw.none { background: var(--line); }
.num-for { color: var(--for); font-weight: 700; } .num-against { color: var(--against); font-weight: 700; } .num-abstain { color: var(--abstain); font-weight: 700; }

.speaker { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.speaker:last-child { border-bottom: 0; }
.speaker.speaking { background: var(--for-soft); }
.speaker .pos { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.speaker.speaking .pos { background: var(--for); color: #fff; border-color: var(--for); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--for); }
details.pending summary { cursor: pointer; font-weight: 600; }
details.pending ul { margin: 8px 0 0; padding-left: 20px; columns: 2; }
@media (max-width: 560px) { details.pending ul { columns: 1; } }

.overlay { position: fixed; inset: 0; background: rgba(9, 14, 28, .55); display: grid; place-items: start center; padding: 5vh 12px; overflow: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.x-btn { appearance: none; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.x-btn:hover { background: var(--surface-2); }
.cred-pw { font-weight: 700; letter-spacing: .5px; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 520px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); pointer-events: auto; width: 100%; white-space: pre-line; }
.toast.error { background: var(--against); color: #fff; }
.toast.ok { background: var(--for); color: #fff; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { display: grid; place-items: center; margin-bottom: 14px; }
.login-card h1 { text-align: center; font-size: 1.4rem; }
.login-card .sub { text-align: center; color: var(--muted); margin: 4px 0 22px; }
.error-text { color: var(--against); font-size: .9rem; margin-bottom: 12px; white-space: pre-line; }

@media print {
  body > *:not(#modal-root) { display: none !important; }
  .overlay { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; border: 0; max-width: none; }
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

.law-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-height: 340px; overflow: auto; font-size: .93rem; line-height: 1.6; }
.hemi-box { max-width: 760px; margin: 4px auto 0; }
.card-vote { border: 2px solid var(--brand); }
.timer.warn { color: var(--warn); }
.timer.over { color: var(--against); }
.steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.secret-key { display: block; margin: 8px 0; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; font-size: 1.1rem; letter-spacing: 1px; font-weight: 700; word-break: break-all; }
.cols { columns: 2; margin: 8px 0 0; padding-left: 20px; }
@media (max-width: 560px) { .cols { columns: 1; } }

.minutes header { border-bottom: 2px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.minutes h2 { font-size: 1.4rem; }
.minutes section { margin-bottom: 20px; }
.minutes h3 { margin-bottom: 8px; }
.minutes h4 { margin: 12px 0 6px; font-size: .95rem; }
.minutes table { font-size: .9rem; }
.minutes th, .minutes td { padding: 6px 10px; }
.min-item { border-top: 1px solid var(--line); padding-top: 16px; }
.min-vote { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.minutes details { margin: 6px 0; }
.minutes summary { cursor: pointer; font-weight: 600; }
.minutes footer { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 10px; }

@media print {
  .minutes, .minutes * { color: #000 !important; }
  .minutes .min-vote { background: #f4f4f4 !important; }
  .law-text { max-height: none; }
}

.sw.voted { background: #b9a56a; }
.sw.present { background: var(--brand); }

.deadline { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.deadline-time { font-size: 2.2rem; font-weight: 800; color: var(--for); line-height: 1; }
.deadline-time.warn { color: var(--warn); }
.deadline-time.over { color: var(--against); }

.trk-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; line-height: 1.7; margin-top: 10px; font-size: .95rem; }
.trk-box.big { font-size: 1.1rem; }
.trk-ctx { color: var(--muted); }
.trk-del { color: var(--against); background: var(--against-soft); text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.trk-ins { color: var(--for); background: var(--for-soft); text-decoration: underline; text-decoration-style: solid; border-radius: 3px; padding: 0 2px; }
.trk-tag { font-size: .62rem; font-weight: 800; letter-spacing: .3px; padding: 1px 5px; border-radius: 4px; margin-right: 3px; color: #fff; background: var(--tag, #6b7a99); vertical-align: super; }
.trk-grp.c0 { --tag: #7a5af0; } .trk-grp.c1 { --tag: #d9730d; } .trk-grp.c2 { --tag: #0e8fa8; } .trk-grp.c3 { --tag: #c2347a; } .trk-grp.c4 { --tag: #5a8f1a; }
.trk-grp { border-bottom: 2px solid var(--tag); }
.pick-text { white-space: pre-wrap; user-select: text; cursor: text; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-height: 280px; overflow: auto; font-size: .95rem; line-height: 1.65; }
.pick-text::selection { background: var(--accent); color: #1a1500; }

.speaker { flex-wrap: wrap; }

.chip.vice { background: #ffe9b0; color: #5b4300; }
.lead-card { padding: 12px 16px; }
.lead-card.acting { border-color: var(--accent); background: var(--warn-soft); }
.proc-note { font-size: .9rem; margin-top: 3px; padding: 4px 8px; border-left: 3px solid var(--accent); background: var(--warn-soft); border-radius: 4px; }
.quota-list { display: grid; gap: 6px; }
.quota-row { display: grid; grid-template-columns: 9rem 1fr 4.5rem auto; align-items: center; gap: 10px; }
.quota-bar { height: 10px; border-radius: 999px; background: var(--abstain-soft); overflow: hidden; }
.quota-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.quota-left { text-align: right; font-weight: 700; color: var(--for); }
.quota-left.warn { color: var(--warn); }
.quota-left.over { color: var(--against); }
@media (max-width: 560px) { .quota-row { grid-template-columns: 1fr auto; } .quota-bar { grid-column: 1 / -1; order: 3; } }

.plan-card { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.plan-date { width: 66px; flex: none; text-align: center; background: var(--brand); color: var(--on-brand); border-radius: 12px; padding: 8px 4px; line-height: 1.15; }
.plan-date b { display: block; font-size: 1.6rem; }
.plan-date span { display: block; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; }
.plan-date small { display: block; margin-top: 3px; opacity: .85; }
.plan-agenda { margin: 8px 0 0; padding-left: 20px; font-size: .92rem; }
.plan-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 170px; }
.plan-actions .btn { white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-val { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.pct { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pct-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--abstain-soft); overflow: hidden; }
.pct-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.stats-table th { padding: 6px 10px; }
.stats-table td { padding: 8px 10px; white-space: nowrap; }
.sort-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sort-btn:hover { color: var(--brand); }

.sim-card { border-style: dashed; border-color: var(--accent); }

.notice.call { background: var(--warn-soft); border: 2px solid var(--accent); align-items: center; }
.notice.call .bell { font-size: 1.4rem; display: inline-block; animation: ring 1.1s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .notice.call .bell { animation: none; } }
.notes-card { border: 2px solid var(--brand); }
.chip.clerk { background: #e3f1ff; color: #0b4f8a; }
.chip.proc { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.proc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: step; }
.proc-step { position: relative; flex: 1 1 150px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 34px; background: var(--surface); counter-increment: step; }
.proc-step::before { content: counter(step); position: absolute; left: 9px; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.proc-step.st-adopted { border-color: var(--for); }
.proc-step.st-rejected { border-color: var(--against); }
.proc-step.st-active { border-color: var(--accent); }
.proc-step.st-next { border-style: dashed; background: transparent; }
.proc-stage { font-weight: 700; font-size: .9rem; }
.approval { box-shadow: none; background: var(--surface-2); margin-bottom: 14px; }
textarea.drop { outline: 3px dashed var(--brand); outline-offset: 2px; background: var(--brand-soft); }
.notice.whip.ok { background: var(--for-soft); }
.notice.whip.no { background: var(--against-soft); }
.fx-chat { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.fx-msg { max-width: 80%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.fx-msg.mine { align-self: flex-end; background: var(--brand-soft); }
.prog-now { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; border-left: 4px solid var(--for); }
.prog-day h2 { margin: 6px 0 8px; }
.prog-item { display: flex; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prog-item:last-child { border-bottom: none; }
.prog-time { width: 56px; flex: none; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.prog-time b { font-size: 1.15rem; }
.tl { overflow-x: auto; }
.tl-lane { display: grid; grid-template-columns: 150px minmax(520px, 1fr); align-items: center; border-bottom: 1px solid var(--line); min-height: 44px; }
.tl-lane:last-of-type { border-bottom: none; }
.tl-head { min-height: 26px; }
.tl-label { display: flex; flex-direction: column; padding-right: 10px; line-height: 1.2; overflow: hidden; }
.tl-label .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-axis, .tl-track { position: relative; height: 100%; min-height: 26px; }
.tl-axis span { position: absolute; transform: translateX(-50%); font-size: .72rem; color: var(--muted); top: 4px; }
.tl-track { height: 40px; }
.tl-plan, .tl-real { position: absolute; border-radius: 6px; overflow: hidden; font-size: .72rem; white-space: nowrap; padding: 0 6px; display: flex; align-items: center; }
.tl-plan { top: 3px; height: 16px; background: var(--brand-soft); border: 1px dashed var(--brand); color: var(--brand); }
.tl-plan.late { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.tl-real { top: 21px; height: 16px; background: var(--for); color: #fff; text-decoration: none; }
.tl-real.open { background: linear-gradient(90deg, var(--for), #2fbf71); box-shadow: 0 0 0 2px var(--for-soft); }
.tl-real.over { background: linear-gradient(90deg, var(--for) 0%, var(--for) 60%, var(--warn) 100%); }
.tl-real span, .tl-plan span { overflow: hidden; text-overflow: ellipsis; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--against); z-index: 2; }
.tl-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; margin-left: 8px; }
.tl-key.plan { background: var(--brand-soft); border: 1px dashed var(--brand); }
.tl-key.real { background: var(--for); }
.tl-key.over { background: var(--warn); }
.tl-key.late { background: var(--warn-soft); border: 1px dashed var(--warn); }
.news-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .news-layout { grid-template-columns: 1fr; } }
.news h2 { margin: 4px 0 6px; font-size: 1.25rem; }
.news-perex { font-weight: 600; margin-bottom: 8px; }
.news-text { white-space: pre-wrap; margin-bottom: 8px; }
.news-live { padding: 8px 0; border-bottom: 1px solid var(--line); }
.news-live:last-child { border-bottom: none; }
.chg-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.chg-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.chg-row.off { opacity: .55; cursor: default; }
.chg-row .chg { font-size: .9rem; white-space: pre-wrap; }
.q-card h3 { font-size: 1.05rem; }
.q-answer { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--for); background: var(--for-soft); border-radius: 6px; }
.qt-card { border: 2px solid var(--brand); }
.qt-card .timer { font-size: 1.4rem; font-weight: 800; }
.ov-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ov-card { display: flex; flex-direction: column; gap: 8px; }
.ov-card.ph-voting { border: 2px solid var(--brand); }
.ov-card.ph-call { border: 2px solid var(--accent); }
.ov-card.ph-recess { border: 2px dashed var(--warn); }
.ov-card .line { font-size: .9rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ov-card .big { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ov-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 80px; }
.ov-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
@media (prefers-color-scheme: dark) { .chip.clerk { background: #12304d; color: #9fd0ff; } }
.sim-card.on { background: var(--warn-soft); }
.sim-card select { width: auto; }

.i { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.16em; flex: none; }

.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: var(--accent); color: #2b2100; font-size: .72rem; font-weight: 800; text-align: center; line-height: 18px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-list { max-height: 72vh; overflow-y: auto; }
.chat-group { padding: 10px 14px 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.chat-item { display: block; padding: 9px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.on { background: var(--brand-soft); }
.chat-item .count { flex: none; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: .75rem; font-weight: 700; text-align: center; }
.chat-conv { display: flex; flex-direction: column; height: 72vh; padding: 0; overflow: hidden; }
.chat-conv.empty-conv { align-items: center; justify-content: center; }
.chat-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head details ul { columns: 1; max-height: 200px; overflow: auto; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.chat-msg { max-width: 78%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.chat-msg.mine { align-self: flex-end; background: var(--brand-soft); }
.chat-msg .txt { white-space: pre-wrap; word-break: break-word; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { min-height: 44px; max-height: 160px; }
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.with-conv .chat-list { display: none; }
  .chat-layout:not(.with-conv) .chat-conv { display: none; }
  .chat-back { display: inline-flex; }
  .chat-conv { height: 75vh; }
}
.pick-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; }
.pick-row { appearance: none; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; padding: 9px 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pick-row:hover { background: var(--surface-2); }
.map-stage { position: relative; line-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.map-stage img { width: 100%; height: auto; display: block; user-select: none; }
.map-stage.placing { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: -3px; }
.map-pin { position: absolute; transform: translate(-50%, -100%); appearance: none; border: 0; padding: 0; background: none; cursor: pointer; line-height: 1.2; }
.map-pin span { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--brand); color: var(--on-brand); font-size: .78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); position: relative; }
.map-pin span::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-bottom: 0; border-top-color: var(--brand); }
.map-pin.busy span { background: var(--for); }
.map-pin.busy span::after { border-top-color: var(--for); }
.map-pin.on span { background: var(--accent); color: #2b2100; }
.map-pin.on span::after { border-top-color: var(--accent); }
.room-row.on { background: var(--brand-soft); }

.chat-msg.deleted { opacity: .75; }
.msg-actions { display: inline-flex; gap: 8px; visibility: hidden; }
.chat-msg:hover .msg-actions, .chat-msg:focus-within .msg-actions { visibility: visible; }
@media (hover: none) { .msg-actions { visibility: visible; } }
.msg-actions button { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.msg-actions button:hover { color: var(--ink); }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; opacity: .85; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ' ▾'; font-size: .8em; }
.nav-menu summary:hover, .nav-menu[open] summary { background: rgba(255, 255, 255, .12); opacity: 1; }
.nav-menu summary[aria-current="page"] { background: rgba(255, 255, 255, .2); opacity: 1; font-weight: 600; }
.nav-menu-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 200px; display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.nav .nav-menu-list a { color: var(--ink); opacity: 1; padding: 8px 12px; border-radius: 6px; }
.nav .nav-menu-list a:hover { background: var(--surface-2); }
.nav .nav-menu-list a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-menu-list.grouped { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 4px 10px; left: auto; right: 0; }
.nav-menu-group { display: flex; flex-direction: column; }
.nav-menu-title { padding: 8px 12px 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 760px) {
  .nav-menu-list.grouped { grid-template-columns: 1fr; left: 0; right: auto; max-height: 70vh; overflow-y: auto; }
}

.fin-card { text-align: left; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.fin-card:hover { border-color: var(--brand); }
.fin-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.fin-balance { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.pick-row.on { background: var(--brand-soft); }

.crisis-bar { background: #8f1d16; color: #fff; border-bottom: 3px solid #f2b705; }
.crisis-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.crisis-ico { display: inline-flex; font-size: 1.6rem; color: #f2b705; animation: crisis-pulse 1.4s ease-in-out infinite; }
@keyframes crisis-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .crisis-ico { animation: none; } }
.crisis-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffd76a; }
.crisis-title { font-size: 1.1rem; font-weight: 800; line-height: 1.25; }
.crisis-text summary { cursor: pointer; font-size: .85rem; opacity: .9; }
.crisis-text div { font-size: .9rem; margin-top: 4px; max-width: 70ch; }
.crisis-deadline { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.crisis-deadline span { font-size: .72rem; opacity: .85; }
.crisis-deadline b { font-size: 1.5rem; }
.crisis-bar .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .5); }
.crisis-bar .btn:hover { background: rgba(255, 255, 255, .22); }

.person-link { color: inherit; text-decoration: none; }
.person-link:hover { color: var(--brand); text-decoration: underline; }
.lib-ico { display: inline-flex; font-size: 1.3rem; color: var(--brand); padding-top: 2px; }

.draft-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) {
  .topbar { position: static; }
  .topbar-inner { gap: 8px 12px; }
  .btn-label { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .draft-grid { grid-template-columns: 1fr; }
}
.notice-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.my-floor { background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 16px 18px; text-align: center; box-shadow: var(--shadow); }
.my-floor-label { font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.my-floor-time { font-size: clamp(3rem, 16vw, 5.5rem); font-weight: 800; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.my-floor-time.warn { color: var(--accent); }
.my-floor-time.over { color: #ffb4ab; }

.staff { display: grid; gap: 14px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.staff-body { border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-left: 6px solid var(--line); }
.staff-body.voting { border-left-color: var(--warn); } .staff-body.debate, .staff-body.law, .staff-body.attendance, .staff-body.open, .staff-body.result, .staff-body.call { border-left-color: var(--for); }
.staff-body.recess { border-left-color: var(--accent); } .staff-body.noquorum { border-left-color: var(--against); }
.staff-body.has-alert { box-shadow: 0 0 0 2px var(--warn) inset; }
.staff-alerts .speaker:hover { background: var(--surface-2, rgba(127, 127, 127, .08)); }
.staff-body h3 { margin: 0; font-size: 1.05rem; }
.staff-phase { font-size: 1.15rem; font-weight: 700; margin-top: 4px; }
.staff-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.staff-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.staff-clock { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.mv-item.mv-now { background: var(--warn-soft); }

.tour-bars { margin: 6px 0 10px; display: grid; gap: 4px; }
.tour-bar { position: relative; height: 10px; border-radius: 6px; background: var(--abstain-soft); overflow: visible; margin-bottom: 4px; }
.tour-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--for); }
.tour-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.tour-state { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.tour-state small { font-weight: 500; font-size: .72rem; }
.tour-state.for { background: var(--for-soft); border-color: var(--for); }
.tour-state.against { background: var(--against-soft); border-color: var(--against); }
.tour-state.abstain { background: var(--abstain-soft); }
.tour-state.reserve { background: var(--warn-soft); border-color: var(--warn); }
.tour-state.missing { opacity: .55; }
@media (max-width: 560px) { .tour-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; } .tour-state { padding: 4px 2px; font-size: .78rem; } .tour-state small { font-size: .66rem; } }

.readiness-list { list-style: none; margin: 0; padding: 0; }
.readiness-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.readiness-list li:first-child { border-top: 0; }
.readiness-list li > span:nth-child(2) { flex: 1; min-width: 0; }
.readiness-list .chip { flex: none; }
.readiness-list .btn { flex: none; }
@media (max-width: 760px) { .readiness-list li { flex-wrap: wrap; } .readiness-list li > span:nth-child(2) { flex-basis: 100%; order: 3; } }

.bulk-card h3 { margin: 0 0 6px; }
.bulk-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.bulk-row:first-of-type { border-top: 0; }
.bulk-label { flex: 0 0 210px; }
.bulk-ctrl { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-ctrl input { flex: 1 1 260px; min-width: 0; }
@media (max-width: 760px) { .bulk-row { flex-direction: column; align-items: stretch; } .bulk-label { flex: none; } .bulk-ctrl .seg { display: flex; flex-direction: column; width: 100%; } .bulk-ctrl .seg button { text-align: left; } }

.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.notes-list li:first-child { border-top: 0; }
.notes-list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notes-list .chip { flex: none; }

.act-menu { display: inline-block; position: relative; }
.act-menu summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; }
.act-menu summary::-webkit-details-marker { display: none; }
.act-menu-list { position: fixed; z-index: 60; min-width: 180px; display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.act-menu-list button { appearance: none; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.act-menu-list button:hover, .act-menu-list button:focus-visible { background: var(--surface-2); }
.act-menu-list button.danger { color: var(--against); }

@media (max-width: 760px) {
  .m-cards table, .m-cards tbody, .m-cards tr, .m-cards td { display: block; width: 100%; }
  .m-cards thead { display: none; }
  .m-cards tr { padding: 10px 14px; border-top: 1px solid var(--line); }
  .m-cards tr:first-child { border-top: 0; }
  .m-cards td { border: 0; padding: 3px 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
  .m-cards td[data-label]::before { content: attr(data-label); flex: 0 0 34%; color: var(--muted); font-size: .8rem; }
  .m-cards td:first-child { font-size: 1.02rem; }
  .m-cards td:first-child::before, .m-cards td:empty, .m-cards td[data-label=""]::before { display: none; }
  .m-cards td.actions { justify-content: flex-start; padding-top: 6px; }
}

.now-card { align-items: center; }
.now-card.banner { margin-bottom: 16px; }
.now-card .ico { font-size: 1.2rem; }
.now-card .grow b { font-size: 1.05rem; }
#room-voting, #room-tour, #room-debate { scroll-margin-top: 12px; }
@media (max-width: 760px) { .now-card { flex-wrap: wrap; } .now-card > .btn { width: 100%; } }

.body-card { border-left: 4px solid var(--line); }
.body-card.ph-open, .body-card.ph-debate { border-left-color: var(--for); }
.body-card.ph-voting, .body-card.ph-recess { border-left-color: var(--accent); }
.body-card.ph-voting { background: linear-gradient(90deg, var(--warn-soft), transparent 60%), var(--surface); }
.body-card-law { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.body-card-law .i { width: 14px; height: 14px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; line-height: 1.45; }
.empty::before { content: ''; width: 34px; height: 34px; background: currentColor; opacity: .45;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat; }
.empty a, .empty .btn { margin-top: 2px; }

.account-btn .account-name { display: none; }
@media (max-width: 760px) {
  .user-menu .who, .user-menu .logout-btn { display: none; }
  .account-btn .account-name { display: inline; }
  .account-btn .account-label { display: none; }
}

.tabs { scrollbar-width: thin; }
.tabs.more-right { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tabs.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 85%, transparent); }
.tabs.more-left:not(.more-right) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
.tab .tab-short { display: none; }
@media (max-width: 760px) { .tab { padding: 10px 12px; } .tab .tab-full { display: none; } .tab .tab-short { display: inline; } }

main.loading::after { content: ''; display: block; height: 340px; margin-top: 8px; border-radius: 14px; opacity: 0;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) 0 0 / 45% 26px no-repeat,
    linear-gradient(var(--surface-2), var(--surface-2)) 0 44px / 70% 14px no-repeat,
    linear-gradient(var(--surface), var(--surface)) 0 84px / 100% 110px no-repeat,
    linear-gradient(var(--surface), var(--surface)) 0 210px / 100% 110px no-repeat;
  animation: skeleton-in .2s ease .25s forwards, skeleton-pulse 1.4s ease-in-out .45s infinite; }
@keyframes skeleton-in { to { opacity: 1; } }
@keyframes skeleton-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { main.loading::after { animation: skeleton-in .01s .25s forwards; } }

.ring { position: relative; display: inline-grid; place-items: center; width: 96px; height: 96px; flex: none; color: var(--for); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-bg { stroke: currentColor; opacity: .16; }
.ring .ring-fg { stroke: currentColor; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .5s linear; }
.ring .ring-time { position: relative; font-size: 1.45rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: inherit; }
.ring.warn { color: var(--warn, #e0a200); }
.ring.over { color: var(--against); }
@keyframes anim-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.anim-in { animation: anim-in .38s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .anim-in, .scene-in { animation: none; } .ring .ring-fg { transition: none; } }
.flag-item { white-space: nowrap; }
.flag-item .flag { vertical-align: -2px; }

#conn-bar { position: fixed; left: 50%; top: 10px; z-index: 300; transform: translate(-50%, -150%); transition: transform .3s ease; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }
#conn-bar.show { transform: translate(-50%, 0); }
#conn-bar.lost { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--accent); }
#conn-bar.ok { background: var(--for-soft); color: var(--for); border: 1px solid var(--for); }
.conn-spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: conn-spin .8s linear infinite; flex: none; }
@keyframes conn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #conn-bar { transition: none; } .conn-spin { animation: none; } }

.mode-switch { border-color: rgba(255, 255, 255, .25); }
.mode-switch button { padding: 5px 10px; font-size: .85rem; background: transparent; color: inherit; opacity: .75; }
.mode-switch button[aria-pressed="true"] { background: var(--accent); color: #2b2100; opacity: 1; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.feature-item { align-items: flex-start; padding: 6px 0; }
.feature-item > span { display: block; }

.record-seg { flex-wrap: wrap; }
@media (max-width: 760px) { .record-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } .record-seg button { padding: 8px 6px; } }

.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.award-card h3 { margin: 0; }
.award-card p { margin: 2px 0 10px; }
.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--line); }
.award-list li:first-child { border-top: 0; }
.award-place { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); }
.award-list li.first .award-place { background: var(--accent); color: #2b2100; }
@media print { .award-card { break-inside: avoid; } }
.glossary { margin: 0; }
.glossary dt { font-weight: 700; margin-top: 12px; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; }

.participant-card .pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; }
.participant-card .pc-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.participant-card .pc-kv > .muted { font-size: .78rem; }

.maint-bar { background: var(--warn-soft); color: var(--ink); padding: 8px 16px; text-align: center; font-size: .9rem; border-bottom: 1px solid var(--warn); }

.perm-edit .perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.perm-edit .check { align-items: flex-start; }

.reg-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; }
.reg-card { width: 100%; max-width: 760px; }
.reg-head { display: flex; align-items: center; gap: 12px; }
.reg-pref { display: grid; grid-template-columns: 22px 1.4fr 1fr 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.reg-pref select[hidden] { display: none; }
.reg-code { font-size: 1.8rem; font-weight: 700; letter-spacing: .15em; text-align: center; padding: 10px; border: 2px dashed var(--line); border-radius: var(--radius); }
@media (max-width: 760px) { .reg-pref { grid-template-columns: 22px 1fr; } .reg-pref select:not(:first-of-type) { grid-column: 2; } }
.reg-section h3 { margin: 10px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 1rem; }
.reg-or { text-align: center; margin: 4px 0; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin: 4px 0 14px; }
.auth-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px; font: inherit; color: var(--muted); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.reg-overview { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2, rgba(127,127,127,.06)); }
.reg-ov-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.reg-kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.reg-steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.reg-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.reg-steps .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; flex: none; }
.reg-steps .dot svg { width: 14px; height: 14px; }
.reg-steps li.done { color: var(--ink); } .reg-steps li.done .dot { background: var(--for); border-color: var(--for); color: #fff; }
.reg-steps li.current { color: var(--ink); font-weight: 600; } .reg-steps li.current .dot { border-color: var(--brand); color: var(--brand); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.role-grid.two { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.role-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.role-card:hover:not(:disabled) { border-color: var(--brand); }
.role-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.role-card:disabled { cursor: default; opacity: .55; }
.role-card.selected:disabled { opacity: 1; }
.role-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2, rgba(127,127,127,.12)); }
.role-path { color: var(--brand); margin-top: 2px; }
.role-tag { position: absolute; top: 10px; right: 10px; }
.google-btn { margin-top: 0; }

.topbar { box-shadow: inset 0 -3px 0 var(--brand-accent); }
.login-card, .reg-card { border-top: 4px solid var(--brand-accent); }
.reg-kicker { color: var(--brand-accent); }
.reg-section h3 { display: flex; align-items: center; gap: 8px; }
.reg-section h3::before { content: ''; width: 4px; height: 1.05em; border-radius: 2px; background: var(--brand-accent); }
.reg-overview { border-left: 4px solid var(--brand-accent); }
