/* Capitol at Night */
:root {
  --night: #0b0f1a; --night-2: #111727; --night-3: #182035; --line: #263150; --line-2: #34406a;
  --brass: #c9a24b; --brass-2: #e3c579; --brass-dim: #8a7136; --oxblood: #8b1e2d; --oxblood-2: #b23246;
  --ink: #e8e2d2; --muted: #9aa3b8; --faint: #6b7590; --ok: #5fae8a;
  --paper: #f3ead3; --paper-2: #e9dcbc; --paper-ink: #1d1a14; --paper-line: #b9a77c;
  --serif: 'Cinzel', 'Trajan Pro', Georgia, serif; --book: 'EB Garamond', Garamond, Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 10px; color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse 120% 70% at 50% -10%, #17203a 0%, var(--night) 60%) fixed, var(--night);
  color: var(--ink); font: 15px/1.55 var(--sans); overflow-x: hidden; }
body::before, body::after { content: ''; position: fixed; inset: -20%; pointer-events: none; z-index: 0; }
/* Fog: two slow drifting banks. */
body::before { background: radial-gradient(40% 25% at 20% 70%, rgba(120, 140, 190, .07), transparent 70%),
  radial-gradient(35% 20% at 80% 40%, rgba(150, 160, 200, .05), transparent 70%); animation: fog 60s ease-in-out infinite alternate; filter: blur(20px); }
/* Film grain. */
body::after { inset: 0; opacity: .07; mix-blend-mode: overlay; animation: grain 1.2s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes fog { from { transform: translate3d(-4%, 0, 0); } to { transform: translate3d(4%, -3%, 0); } }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6px, 4px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, -6px); } 80% { transform: translate(6px, 5px); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after, .light { animation: none !important; } }
#app, header, footer { position: relative; z-index: 1; }
a { color: var(--brass-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.eyebrow { font: 600 .72rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--brass); }
[hidden] { display: none !important; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: linear-gradient(rgba(11, 15, 26, .92), rgba(11, 15, 26, .75)); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand > span:last-child { min-width: 0; }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand small { display: block; font: 600 .62rem/1.2 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--brass); }
.brand strong { display: block; font: 600 .98rem/1.2 var(--serif); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.top .wrap { max-width: 1440px; }
.brand { flex-shrink: 0; }
.brand small { white-space: nowrap; }
.nav a { white-space: nowrap; color: var(--muted); padding: 8px 8px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.nav a:hover { color: var(--ink); background: var(--night-3); text-decoration: none; }
.nav a.active { color: var(--brass-2); background: rgba(201, 162, 75, .08); }
.top .menu-btn { display: none; margin-left: auto; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--night-3); border: 1px solid var(--line-2); object-fit: cover; flex: none; }
@media (max-width: 1400px) {
  .top .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--night-2); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; }
  .nav.open { display: flex; }
  .nav .status, .nav .who { align-self: flex-start; margin-top: 6px; }
  .brand strong { font-size: .85rem; }
}

/* Status light */
.status { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 10px; border: 1px solid var(--line-2); border-radius: 99px; font: 600 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; background: rgba(0, 0, 0, .25); }
.light { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.status.session { color: var(--brass-2); border-color: var(--brass-dim); }
.status.session .light { background: #ffcf6b; box-shadow: 0 0 0 0 rgba(255, 196, 90, .7); animation: pulse 2s ease-out infinite; }
.status.recess { color: #a9b6d8; }
.status.recess .light { background: #6f80ad; }
.status.adjourned { color: #d98a95; border-color: #5a2430; }
.status.adjourned .light { background: var(--oxblood-2); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 90, .65); } 70% { box-shadow: 0 0 0 12px rgba(255, 196, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 196, 90, 0); } }

/* Pieces */
main { padding: 28px 0 60px; min-height: 70vh; }
.card { background: linear-gradient(180deg, rgba(24, 32, 53, .85), rgba(17, 23, 39, .85)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--night-3); color: var(--ink); font: 600 .9rem/1.2 var(--sans); cursor: pointer; text-decoration: none !important; }
.btn:hover { border-color: var(--brass-dim); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-brass { background: linear-gradient(180deg, #d8b45e, #b08a37); color: #1b1407; border-color: #e3c579; }
.btn-brass:hover { filter: brightness(1.08); }
.btn-red { background: var(--oxblood); border-color: var(--oxblood-2); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip.gold { color: var(--brass-2); border-color: var(--brass-dim); }
.chip.red { color: #f0a1ac; border-color: #6b2633; background: rgba(139, 30, 45, .15); }
.chip.green { color: #8fd3b3; border-color: #2e5a49; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(0, 0, 0, .18); }
.stat b { display: block; font: 600 1.7rem/1 var(--serif); color: var(--brass-2); }
.stat span { font-size: .8rem; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.bill-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; color: var(--ink); }
.bill-row:hover { text-decoration: none; }
.bill-row:hover .t { color: var(--brass-2); }
.bill-no { font: 600 .78rem/1.3 var(--sans); letter-spacing: .08em; color: var(--brass); white-space: nowrap; }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }
.notice.red { border-color: #6b2633; background: rgba(139, 30, 45, .14); color: #f4c4cb; }

/* Forms */
label.f { display: block; }
label.f > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; letter-spacing: .02em; }
input, select, textarea { width: 100%; padding: 9px 11px; background: #0d1322; color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
input:focus, select:focus, textarea:focus, .editor-body:focus { outline: 2px solid rgba(201, 162, 75, .45); outline-offset: 1px; border-color: var(--brass-dim); }
input[type=checkbox] { width: auto; accent-color: var(--brass); }
textarea { min-height: 80px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--brass-2); border-color: var(--brass); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.scroll-x { overflow-x: auto; }

/* Hero */
.hero { padding: 26px; border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden;
  background: radial-gradient(80% 140% at 100% 0%, rgba(201, 162, 75, .10), transparent 60%), linear-gradient(180deg, #141b2e, #0e1424); }
.hero .seal-bg { position: absolute; right: -40px; top: -40px; width: 260px; opacity: .08; }
.hero h1 { margin-top: 8px; }
.daycount { font: 600 2.4rem/1 var(--serif); color: var(--brass-2); }
.progress { height: 6px; background: var(--night); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-dim), var(--brass-2)); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: center; padding: 4px 0; }
.cal .day { min-height: 82px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; font-size: .75rem; background: rgba(0, 0, 0, .15); overflow: hidden; }
.cal .day.out { opacity: .35; }
.cal .day.today { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass-dim); }
.cal .day.sday { background: rgba(201, 162, 75, .08); }
.cal .day.inses:not(.sday) { background: rgba(90, 110, 170, .06); }
.cal .num { font-weight: 600; color: var(--muted); }
.cal .ev { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 4px; background: var(--night-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--line-2); }
.cal .ev.session { border-color: var(--brass); color: var(--brass-2); }
.cal .ev.deadline { border-color: var(--oxblood-2); }
@media (max-width: 640px) { .cal .day { min-height: 52px; font-size: .62rem; padding: 3px; } .cal .ev { font-size: 0; height: 5px; padding: 0; border-left: 0; background: var(--line-2); } .cal .ev.session { background: var(--brass); } .cal .ev.deadline { background: var(--oxblood-2); } }
@media (max-width: 480px) { .brand small { font-size: .55rem; letter-spacing: .16em; } .brand strong { font-size: .74rem; } .brand svg { width: 34px; height: 34px; } }
.pickdays .day { cursor: pointer; min-height: 44px; }

/* Editor */
.editor { border: 1px solid var(--line-2); border-radius: 8px; background: #0d1322; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 68px; background: #0f1628; z-index: 2; border-radius: 8px 8px 0 0; }
.editor-bar button { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 6px; padding: 5px 9px; font: 600 .82rem var(--sans); cursor: pointer; }
.editor-bar button:hover { color: var(--ink); border-color: var(--line-2); }
.editor-bar .sep { width: 1px; background: var(--line); margin: 3px 4px; }
.editor-body { min-height: 360px; padding: 18px 20px; font: 1.06rem/1.6 var(--book); color: var(--ink); }
.editor-body h2 { font: 600 1rem var(--serif); color: var(--brass-2); margin: 1.2em 0 .4em; }
.editor-body blockquote { border-left: 3px solid var(--brass-dim); margin: .6em 0; padding: .2em 0 .2em 14px; color: #cfc8b6; }

/* Official document */
.paper { position: relative; max-width: 820px; margin: 0 auto; padding: 56px 64px 64px; color: var(--paper-ink); font: 1.08rem/1.6 var(--book);
  background: radial-gradient(120% 80% at 50% 0%, #f8f1de, var(--paper) 55%, var(--paper-2)); border-radius: 3px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3); }
.paper::before { content: ''; position: absolute; inset: 14px; border: 1px solid var(--paper-line); outline: 3px double rgba(120, 96, 50, .35); outline-offset: 4px; pointer-events: none; }
.paper .seal { display: block; width: 104px; margin: 0 auto 12px; color: #7a5d22; }
.paper .head { text-align: center; }
.paper .head .st { font: 600 .78rem/1.3 var(--serif); letter-spacing: .32em; text-transform: uppercase; }
.paper .head .ch { font: 600 1.35rem/1.3 var(--serif); letter-spacing: .08em; margin: 4px 0; }
.paper .head .ses { font-style: italic; }
.paper .no { font: 700 1.6rem/1 var(--serif); letter-spacing: .1em; margin: 22px 0 6px; text-align: center; }
.paper hr { border: 0; border-top: 1px solid var(--paper-line); margin: 18px 0; }
.paper .meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; font-size: .98rem; }
.paper .meta dt { font-variant: small-caps; letter-spacing: .06em; color: #5a4c2e; }
.paper .meta dd { margin: 0; }
.paper .entitled { text-align: center; font-variant: small-caps; letter-spacing: .1em; margin-top: 22px; }
.paper .ptitle { text-align: center; font: 600 1.3rem/1.35 var(--book); margin: 4px 0 6px; }
.paper .summary { font-style: italic; text-align: center; color: #3e3626; max-width: 620px; margin: 0 auto; }
.paper .enact { margin-top: 22px; font-variant: small-caps; letter-spacing: .05em; }
.paper .text { counter-reset: sec; }
.paper .text h2 { counter-increment: sec; font: 700 1rem/1.4 var(--book); letter-spacing: .02em; margin: 1.2em 0 .3em; color: var(--paper-ink); }
.paper .text h2::before { content: 'Section ' counter(sec) '. '; font-variant: small-caps; }
.paper .text h3 { font: italic 600 1rem var(--book); margin: .8em 0 .2em; }
.paper .text p { margin: .45em 0; text-align: justify; }
.paper .text blockquote { margin: .6em 2em; font-style: italic; }
.paper .text a { color: #6b4b12; }
.paper .statusbar { display: flex; margin: 26px 0 8px; border: 1px solid var(--paper-line); font: 600 .62rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.paper .statusbar span { flex: 1; text-align: center; padding: 7px 3px; color: #8d7d58; border-left: 1px solid var(--paper-line); }
.paper .statusbar span:first-child { border-left: 0; }
.paper .statusbar span.done { background: rgba(122, 93, 34, .14); color: #4b3a12; }
.paper .statusbar span.now { background: #1d1a14; color: #f3ead3; }
.paper .statusbar span.bad { background: var(--oxblood); color: #fff; }
.paper .sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 34px 40px; margin-top: 44px; }
.paper .sig { border-top: 1px solid var(--paper-ink); padding-top: 5px; font-size: .86rem; position: relative; min-height: 44px; }
.paper .sig .ink { position: absolute; bottom: calc(100% + 4px); left: 4px; font: italic 1.45rem/1 var(--book); color: #1f2d5a; transform: rotate(-3deg); }
.paper .sig small { display: block; color: #5a4c2e; }
.paper .foot { margin-top: 40px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: .72rem/1.4 var(--sans); color: #6b5d3d; letter-spacing: .04em; }
.watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font: 700 8rem/1 var(--serif); letter-spacing: .1em; color: rgba(139, 30, 45, .07); transform: rotate(-30deg); }
.stamp { position: absolute; right: 54px; top: 210px; padding: 8px 20px; border: 4px double currentColor; border-radius: 6px; font: 700 2rem/1 var(--serif); letter-spacing: .18em; transform: rotate(-12deg); opacity: .85; text-align: center; mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.stamp small { display: block; font: 600 .6rem/1.3 var(--sans); letter-spacing: .12em; margin-top: 4px; }
.stamp.gold { color: #a17a1f; }
.stamp.red { color: #8b1e2d; }
@media (max-width: 640px) {
  .paper { padding: 36px 22px 40px; font-size: 1rem; }
  .paper::before { inset: 8px; }
  .stamp { right: 14px; top: 150px; font-size: 1.3rem; padding: 6px 12px; }
  .watermark { font-size: 4rem; }
}
.doc-tools { max-width: 820px; margin: 0 auto 16px; }

/* Toasts and modal */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 8px; background: var(--night-3); border: 1px solid var(--brass-dim); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.error { border-color: var(--oxblood-2); background: #2a121a; }
.modal-bg { position: fixed; inset: 0; background: rgba(3, 5, 10, .7); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--faint); font-size: .8rem; }

@media print {
  body { background: #fff !important; }
  body::before, body::after, header, footer, .doc-tools, #toasts { display: none !important; }
  main { padding: 0; }
  .paper { box-shadow: none; max-width: none; background: var(--paper) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Elections */
.ecard { display: block; color: var(--ink); }
.ecard:hover { text-decoration: none; border-color: var(--brass-dim); }
.etimeline { display: grid; grid-template-columns: repeat(5, 1fr); margin: 16px 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.etimeline div { padding: 10px; border-left: 1px solid var(--line); font-size: .78rem; color: var(--faint); }
.etimeline div:first-child { border-left: 0; }
.etimeline b { display: block; font: 600 .7rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.etimeline .done { color: var(--muted); background: rgba(201, 162, 75, .05); }
.etimeline .now { color: var(--brass-2); background: rgba(201, 162, 75, .14); box-shadow: inset 0 -2px 0 var(--brass); }
@media (max-width: 640px) { .etimeline { grid-template-columns: 1fr 1fr; } .etimeline div { border-left: 0; border-top: 1px solid var(--line); } }
.vbar { height: 8px; background: var(--night); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; border: 1px solid var(--line); }
.vbar i { display: block; height: 100%; border-radius: 99px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.ad { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--brass-dim); border-radius: var(--r); background: linear-gradient(135deg, rgba(201, 162, 75, .1), rgba(17, 23, 39, .9)); margin: 12px 0; }
.ad img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.ad > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ad p { margin: 0; color: var(--muted); font-size: .88rem; }
.ad small { color: var(--faint); font-size: .7rem; }
.ad-tag { font: 600 .62rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.ad-big { flex-direction: column; }
.ad-big img { width: 100%; height: auto; max-height: 220px; }
.ballot { max-width: 720px; margin: 0 auto; padding: 34px 40px; background: radial-gradient(120% 80% at 50% 0%, #f8f1de, var(--paper)); color: var(--paper-ink); border-radius: 3px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); font-family: var(--book); }
.ballot-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid var(--paper-ink); padding-bottom: 14px; margin-bottom: 14px; }
.ballot h1 { font-size: clamp(1.2rem, 4.5vw, 1.8rem); }
.ballot-head .seal { width: 70px; color: #7a5d22; flex: none; }
.ballot fieldset { border: 1px solid var(--paper-line); border-radius: 4px; margin: 0 0 14px; padding: 10px 14px; }
.ballot legend { font: 700 1rem var(--book); padding: 0 6px; }
.ballot legend small { font: italic .85rem var(--book); color: #5a4c2e; }
.bopt { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px dotted var(--paper-line); cursor: pointer; font-size: 1.05rem; }
.bopt:first-of-type { border-top: 0; }
.bopt input { position: absolute; opacity: 0; }
.bopt .oval { width: 30px; height: 16px; border: 2px solid var(--paper-ink); border-radius: 50%; flex: none; }
.bopt input:checked + .oval { background: var(--paper-ink); }
.bopt input:focus-visible + .oval { outline: 2px solid var(--brass); outline-offset: 2px; }
.bopt input:disabled ~ span { opacity: .45; }
@media (max-width: 640px) { .ballot { padding: 22px 16px; } }
.live-top { grid-template-columns: minmax(200px, 1fr) minmax(280px, 1.6fr) minmax(200px, 1fr); margin-top: 14px; }
@media (max-width: 900px) { .live-top { grid-template-columns: 1fr; } }
.gauge { width: 100%; max-width: 220px; display: block; margin: 8px auto 0; }
.live .big { font: 600 2rem/1 var(--serif); color: var(--brass-2); }
.live .big small { display: block; font: .78rem var(--sans); color: var(--muted); margin-top: 4px; }
.dmap { width: 100%; height: auto; display: block; margin-top: 8px; }
.dmap path { transition: fill .8s; }
.dmap-n { font: 700 20px var(--serif); fill: var(--ink); }
.dmap-s { font: 9px var(--sans); fill: var(--muted); letter-spacing: .04em; }
.seats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.seat { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); --c: var(--line-2); }
.seat.lead { border-color: var(--c); animation: pulse 2s infinite; }
.seat.won { background: var(--c); border-color: var(--c); box-shadow: 0 0 10px var(--c); }
.h2h { position: relative; overflow: hidden; }
.h2h-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.h2h-row.win b { color: var(--brass-2); }
.cnt { font: 600 1.15rem var(--serif); }
.h2h:has(.race-stamp) { padding-top: 50px; }
.race-stamp { position: absolute; right: 12px; top: 10px; border: 3px double var(--brass); color: var(--brass-2); font: 700 1rem/1 var(--serif); letter-spacing: .2em; padding: 5px 10px; transform: rotate(-10deg); opacity: .85; pointer-events: none; }
.race-stamp.won { color: #8fd3b3; border-color: #5fae8a; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 3.2s cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes fall { to { top: 105vh; transform: translateX(40px) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .seat.lead { animation: none; } }

/* Notification bell */
.nav a.bell { position: relative; padding: 8px 10px; font-size: 1rem; }
.bell b { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--oxblood-2); color: #fff; font: 700 .62rem/16px var(--sans); text-align: center; }

/* Header: keep the name to the avatar's tooltip on narrower desktops */
.who-name { white-space: nowrap; }
@media (max-width: 1600px) and (min-width: 1401px) { .who-name { display: none; } }
.nav .btn { white-space: nowrap; }

/* Styled dropdown menus (dropdowns.js) */
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dd { position: relative; display: block; min-width: 0; }
.dd[hidden] { display: none; }
.dd > select { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.dd-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; background: #0d1322; color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; font: inherit; text-align: left; line-height: 1.4; cursor: pointer; }
.dd-trigger:hover:not(:disabled) { border-color: var(--brass-dim); }
.dd-trigger:focus-visible, .dd.is-open .dd-trigger { outline: 2px solid rgba(201, 162, 75, .45); outline-offset: 1px; border-color: var(--brass-dim); }
.dd-trigger:disabled { opacity: .55; cursor: not-allowed; }
.dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chevron { flex-shrink: 0; color: var(--muted); transition: transform .2s; }
.dd.is-open .dd-chevron { color: var(--brass-2); transform: rotate(180deg); }
.dd-menu { position: fixed; z-index: 120; display: grid; align-content: start; gap: 2px; padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 10px; background: #121a2c; border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.dd-menu:focus { outline: none; }
.dd-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.dd-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 36px; padding: 7px 10px; border-radius: 7px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.dd-option.is-active { background: var(--night-3); color: var(--ink); }
.dd-option[aria-selected="true"] { font-weight: 600; color: var(--brass-2); background: rgba(201, 162, 75, .1); }
.dd-option[aria-selected="true"].is-active { background: rgba(201, 162, 75, .18); }
.dd-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dd-text { min-width: 0; overflow-wrap: anywhere; }
.dd-check { flex-shrink: 0; visibility: hidden; color: var(--brass-2); }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }
@media (pointer: coarse) { .dd-option { min-height: 44px; } }
@media print { .dd-menu { display: none; } }
@media (max-width: 1600px) { .brand strong { font-size: .86rem; } .top .wrap { gap: 12px; } .nav .status { padding: 6px 10px 6px 8px; letter-spacing: .12em; } }
