.vote-announcement {
  border-bottom: 1px solid #795949;
  background: linear-gradient(105deg, #291747, #352047 75%, #452d39);
}

.vote-announcement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .9rem;
  flex-wrap: wrap;
  padding-block: .25rem;
}

.vote-announcement p {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: .88rem;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.vote-announcement button, .vote-panel-link {
  color: var(--focus);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.vote-announcement button {
  min-height: 2.75rem;
  padding: .25rem .15rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
}
.vote-eyebrow {
  color: var(--focus);
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.vote-announcement .vote-eyebrow { margin-inline-end: .45rem; }

.vote-trigger {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  padding: .35rem .72rem;
  border: 1px solid #806052;
  border-radius: .8rem;
  background: #281946;
  color: var(--focus);
  font: inherit;
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.vote-trigger:hover { background: #392355; }
.vote-trigger::before {
  width: .42rem;
  height: .42rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  content: '';
}
.vote-trigger[data-state='live']::before, .vote-launcher .vote-trigger::before {
  animation: vote-signal .95s ease-out 3;
}
.vote-announcement[hidden], .vote-trigger[hidden], .vote-launcher[hidden] { display: none; }

.vote-launcher {
  position: fixed;
  z-index: 4;
  inset-inline-start: max(.75rem, env(safe-area-inset-left));
  inset-block-end: max(.75rem, env(safe-area-inset-bottom));
}
.vote-launcher .vote-trigger {
  border-color: #b18c52;
  background: linear-gradient(125deg, #432576, #261743);
  box-shadow: 0 .45rem 1.6rem #0c0618a0;
}

.vote-panel {
  position: fixed;
  inset: auto auto .85rem .85rem;
  inset-inline-start: max(.85rem, env(safe-area-inset-left));
  inset-block-end: max(.85rem, env(safe-area-inset-bottom));
  width: min(26rem, calc(100% - 1.7rem));
  max-width: none;
  max-height: calc(100vh - 1.7rem);
  max-height: calc(100dvh - 1.7rem);
  margin: 0;
  padding: clamp(.95rem, 3.5vw, 1.4rem);
  border: 1px solid #9c764d;
  border-radius: 1.15rem;
  background: radial-gradient(ellipse at 12% 0, #4c2b71 0%, #261641 50%, #19112d 100%);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 1.25rem 4rem #06030bc9;
}
.vote-panel[open] { animation: vote-panel-enter .24s ease-out; }
.vote-panel::backdrop { background: #080612ac; }
.vote-panel-header { display: flex; align-items: start; justify-content: space-between; gap: .65rem; }
.vote-panel h2 { margin-top: .2rem; font-size: 1.6rem; }
.vote-panel-close {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: .65rem;
  background: #321d4f;
  color: var(--focus);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.vote-panel-close:hover { background: #513172; }
.vote-status, .vote-event-info { margin-block: .75rem; color: var(--muted); font-size: .88rem; }
.vote-choice { margin-block: 1rem; }
.vote-choice label { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .85rem; }
.vote-choice select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .35rem .55rem;
  border: 1px solid #715590;
  border-radius: .6rem;
  background: #19112d;
  color: var(--text);
  font: inherit;
  text-overflow: ellipsis;
}
.vote-event { margin-top: 1rem; overflow-wrap: anywhere; }
.vote-event-state { color: var(--focus); font-size: .81rem; font-weight: 750; }
.vote-event h3 { margin-top: .25rem; font-size: 1.22rem; }
.vote-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-block: .95rem; }
.vote-totals > div { padding: .55rem .65rem; border-radius: .65rem; background: #171025; }
.vote-totals dt { color: var(--muted); font-size: .75rem; }
.vote-totals dd { margin: .15rem 0 0; color: var(--focus); font-weight: 800; font-variant-numeric: tabular-nums; }
.vote-event h4 { margin: 1rem 0 .3rem; font-size: .97rem; }
.vote-rankings { margin: .35rem 0; padding-inline-start: 1.6rem; }
.vote-rankings li { padding: .4rem .2rem .4rem .15rem; border-bottom: 1px solid #59426a; }
.vote-rankings li::marker { color: var(--focus); font-weight: 750; }
.vote-rankings li > div { display: flex; justify-content: space-between; align-items: baseline; gap: .55rem; font-size: .9rem; }
.vote-rankings strong { flex: none; color: var(--focus); font-variant-numeric: tabular-nums; }
.vote-panel-link { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; margin-top: .45rem; font-size: .85rem; }
.vote-status:empty { margin: 0; }

.vote-directory { max-width: 68rem; }
.vote-directory h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
.vote-directory-filter:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 25rem) auto;
  align-items: end;
  justify-content: start;
  gap: .4rem .65rem;
  margin-bottom: 1.35rem;
}
.vote-directory-filter label { grid-column: 1 / -1; font-weight: 700; }
.vote-directory-filter select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .4rem .55rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.vote-directory-status:empty { margin: 0; padding: 0; }
.vote-directory-events, .vote-directory-candidates { margin: 1rem 0 0; padding: 0; list-style: none; }
.vote-directory-events li, .vote-directory-detail { overflow-wrap: anywhere; }
.vote-directory-events h3 { margin: .4rem 0; font-size: 1.15rem; }
.vote-directory-events .text-link { display: inline-block; margin-top: 0; }
.vote-directory-back { display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: .65rem; }
.vote-directory-back[hidden], .vote-directory-pages a[hidden] { display: none; }
.vote-directory-detail .vote-totals { max-width: 32rem; }
.vote-directory-detail h2, .vote-directory-detail h3 { margin-block: .45rem; }
.vote-directory-candidates li { display: flex; align-items: baseline; justify-content: space-between; gap: .65rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.vote-directory-candidates strong { max-width: 55%; color: var(--focus); text-align: right; font-variant-numeric: tabular-nums; }
.vote-directory-pages:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: 1.2rem; }

@keyframes vote-signal { from { box-shadow: 0 0 0 0 #ffd27a88; } to { box-shadow: 0 0 0 .38rem #ffd27a00; } }
@keyframes vote-panel-enter { from { opacity: .25; transform: translateY(.5rem); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 34rem) {
  .site-header .header-inner { flex-wrap: wrap; gap: .45rem; }
  .site-header .header-download { margin-inline-start: 0; }
  .site-header .mobile-nav { margin-inline-start: auto; }
  .vote-announcement-inner { gap: 0 .7rem; }
  .vote-directory-filter:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .vote-directory-filter button { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .vote-trigger[data-state='live']::before, .vote-launcher .vote-trigger::before, .vote-panel[open] { animation: none; }
}
