:root {
  color-scheme: light dark;
  --bg: light-dark(#f3f7fa, #121e29);
  --surface: light-dark(#fff, #1b2c3a);
  --text: light-dark(#172f40, #e9f3fa);
  --muted: light-dark(#506574, #acc2d2);
  --line: light-dark(#ccdeea, #425d70);
  --brand: light-dark(#08739f, #66c9f2);
  --accent: #15a3dc;
  --accent-hover: light-dark(#149fd7, #38b6e8);
  --on-brand: #082b3b;
  --soft: light-dark(#e6f4fb, #193c50);
  --danger: light-dark(#ac3434, #ffaaa3);
  --on-danger: light-dark(#fff, #461815);
  --danger-soft: light-dark(#fff1ed, #462b2a);
  --overlay: light-dark(#172f4080, #050e17b3);
  --radius: 12px;
  --font-body: "Segoe UI", Arial, sans-serif;
  --font-heading: "Trebuchet MS", "Segoe UI", sans-serif;
  scrollbar-gutter: stable;
}
:root[data-theme="green"] {
  --bg: light-dark(#f1f6f5, #162322);
  --surface: light-dark(#fff, #20312f);
  --text: light-dark(#193b38, #e3efed);
  --muted: light-dark(#56716e, #adc1bd);
  --line: light-dark(#d5e3df, #405550);
  --brand: light-dark(#16665e, #92d7c8);
  --accent: light-dark(#16665e, #92d7c8);
  --accent-hover: light-dark(#11544e, #a8e4d7);
  --on-brand: light-dark(#fff, #113b34);
  --soft: light-dark(#e3f0ea, #2b4941);
  --overlay: light-dark(#243f3b80, #030e0cb3);
}
* {
  box-sizing: border-box;
  scrollbar-width: auto;
  scrollbar-color: var(--muted) var(--bg);
}
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-track {
  background: var(--bg);
}
*::-webkit-scrollbar-thumb {
  background: var(--muted);
  border: 3px solid var(--bg);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}
*::-webkit-scrollbar-thumb:active {
  background: var(--text);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
summary,
label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button:not(:disabled):active,
.button:not(:disabled):active {
  transform: translateY(1px);
}
input {
  accent-color: var(--brand);
}
a {
  color: var(--brand);
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  overflow-wrap: anywhere;
}
h1 {
  font-size: 32px;
  line-height: 1.17;
  letter-spacing: -1px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
}
svg {
  flex-shrink: 0;
  vertical-align: middle;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
input:focus-visible {
  outline-width: 2px;
  outline-offset: 1px;
}
.application {
  max-width: 1160px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.header {
  display: flex;
  align-items: center;
  padding: 26px 40px;
  border-bottom: 1px solid var(--line);
}
.header-logout {
  margin-inline-start: auto;
  flex-shrink: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font: 700 26px/1 var(--font-heading);
  letter-spacing: -0.8px;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 33px;
  height: 35px;
  background: var(--accent);
  color: var(--on-brand);
  border-radius: 9px;
  transform: rotate(-5deg);
}
.brand-mark svg {
  width: 23px;
  height: 23px;
}
.main {
  flex: 1;
  padding: 44px 40px 55px;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 20px 40px;
  color: var(--muted);
  font-size: 12px;
}
.footer a,
.footer a:hover {
  color: inherit;
  text-decoration: none;
}
.footer-github {
  display: inline-block;
  margin-inline-start: 12px;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line);
  white-space: nowrap;
}
.footer .footer-legal {
  margin-left: auto;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--surface);
  padding: 12px;
  z-index: 10;
}
.skip-link:focus {
  top: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 13px;
}
.intro {
  color: var(--muted);
  margin-top: 11px;
  max-width: 510px;
}
.micro {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background: var(--soft);
  border-color: var(--muted);
  text-decoration: none;
}
.primary {
  background: var(--accent);
  color: var(--on-brand);
  border-color: var(--accent);
}
.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.danger {
  background: var(--danger);
  color: var(--on-danger);
  border-color: var(--danger);
}
.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  filter: brightness(0.94);
}
.quiet {
  background: transparent;
  border-color: transparent;
  padding: 8px 0;
  min-height: 36px;
  color: var(--muted);
  font-weight: 400;
}
.quiet:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.button svg {
  width: 17px;
  height: 17px;
}
.full {
  width: 100%;
}
.center {
  text-align: center;
}
.button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  right: 17px;
  top: calc(50% - 7.5px);
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.button[aria-busy="true"] {
  position: relative;
}
.button[aria-busy="true"] > * {
  visibility: hidden;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.home-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 28px;
}
.home-title {
  font-size: clamp(36px, 4.5vw, 52px);
  letter-spacing: -1.8px;
}
.home-title span {
  color: var(--brand);
}
.home-layout .intro {
  margin: 20px 0 26px;
  font-size: 16px;
  max-width: 350px;
}
.home-reassurance {
  margin-top: 16px;
  padding-inline-start: 12px;
  border-inline-start: 3px solid var(--accent);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.example-ballot {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 7px 9px 0 var(--soft);
  transform: rotate(1.5deg);
}
.ballot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 18px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--soft);
  color: var(--brand);
  font-size: 11px;
  white-space: nowrap;
}
.example-ballot h2 {
  font-size: 24px;
}
.example-ballot > .micro:first-of-type {
  margin: 6px 0 18px;
}
.example-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
}
.chosen {
  background: var(--soft);
  border-color: var(--brand);
}
.example-box {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
}
.chosen .example-box {
  background: var(--accent);
  color: var(--on-brand);
  border-color: var(--accent);
}
.example-box svg {
  width: 13px;
  height: 13px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 65px;
}
.step-number {
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}
.steps h3 {
  margin: 7px 0 5px;
  font-size: 15px;
}
.steps p {
  font-size: 13px;
  color: var(--muted);
}
.page-top {
  max-width: 800px;
  margin: 0 auto 28px;
}
.back {
  margin: -10px 0 16px;
}
.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 28px;
  max-width: 800px;
  margin: auto;
  align-items: start;
}
.paper {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.form-section + .form-section {
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 24px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 17px;
}
.counter {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.field {
  display: block;
  margin-top: 17px;
}
.field:first-child {
  margin-top: 0;
}
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}
.input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}
/* Keep the native date editor within its field on narrow mobile browsers. */
.input[type="date"] {
  display: block;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
.input::placeholder {
  color: var(--muted);
}
.input:disabled {
  background: var(--bg);
  color: var(--muted);
}
.input[aria-invalid="true"] {
  border-color: var(--danger);
}
.answer-section {
  --answer-number-width: 18px;
  --answer-remove-width: 36px;
  --answer-gap: 9px;
}
.answer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--answer-gap);
  margin-bottom: 10px;
}
.answer-row > .input {
  flex: 1;
  width: 0;
}
.answer-number {
  flex: 0 0 var(--answer-number-width);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.answer-row > .icon-button {
  flex: 0 0 var(--answer-remove-width);
  width: var(--answer-remove-width);
  min-width: var(--answer-remove-width);
}
.answer-row > .field-error {
  width: 100%;
  padding-left: 27px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  min-width: 36px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover {
  background: var(--bg);
  color: var(--text);
}
.icon-button svg {
  width: 16px;
  height: 16px;
}
.add-answer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: calc(
    100% - var(--answer-number-width) - var(--answer-remove-width) - 2 *
      var(--answer-gap)
  );
  margin-inline-start: calc(var(--answer-number-width) + var(--answer-gap));
  min-height: 44px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
}
.add-answer:hover {
  border-color: var(--brand);
  background: var(--soft);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  min-height: 30px;
}
.check input {
  margin: 3px 0 0;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.check small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.optional {
  color: var(--muted);
  font-weight: 400;
}
.expiry-toggle {
  margin-top: 14px;
}
.side-note {
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.side-note h3 {
  margin-bottom: 16px;
  font-size: 15px;
}
.side-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.side-item > svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--brand);
}
.side-note strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
.edit-actions,
.actions-split {
  justify-content: space-between;
  align-items: stretch;
}
.field-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 7px;
}
.form-alert {
  border-left: 3px solid var(--danger);
  padding: 12px 14px;
  margin: 16px 0;
  background: var(--danger-soft);
  color: var(--text);
  font-size: 14px;
}
.narrow {
  max-width: 570px;
  margin: 0 auto;
}
.vote h1 {
  font-size: 30px;
}
.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 21px;
  color: var(--muted);
  font-size: 12px;
}
.question {
  font-size: 19px;
  font-weight: 600;
  margin-top: 27px;
  overflow-wrap: anywhere;
}
.vote .question + .micro {
  margin-top: 5px;
}
.choices {
  display: grid;
  gap: 12px;
  margin: 21px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.choice:has(input:checked) {
  background: var(--soft);
  border-color: var(--brand);
}
.choice:hover {
  border-color: var(--brand);
}
.choice input {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin: 0;
}
.choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.results {
  max-width: 800px;
  margin: auto;
}
.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: start;
}
.stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 26px;
  border-block: 1px solid var(--line);
  padding: 19px 0;
  margin-top: 26px;
}
.stat-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.badge-ended {
  background: var(--danger-soft);
  color: var(--danger);
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.stat strong {
  font: 700 28px var(--font-heading);
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.results-body {
  margin-top: 27px;
}
.result {
  margin-top: 21px;
}
.result-label {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 8px;
}
.result-label > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.result-label > span:last-child {
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.result-track {
  height: 11px;
  background: var(--soft);
  border-radius: 3px;
}
.result-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.result-explanation {
  margin-top: 20px;
}
.participants {
  margin-top: 27px;
}
.people {
  list-style: none;
  padding: 0;
  margin: 15px 0 0;
}
.person {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.person:last-child {
  border: 0;
  padding-bottom: 0;
}
.avatar {
  display: grid;
  place-items: center;
  min-width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.person strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.person > div {
  min-width: 0;
}
.person p {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}
.empty {
  text-align: center;
  padding: 50px 20px;
}
[data-results-countdown] {
  display: inline-block;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}
.empty.vote-saved {
  padding-bottom: 25px;
}
.empty-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 21px;
  border-radius: 15px;
  background: var(--soft);
  color: var(--brand);
}
.empty-mark svg {
  width: 28px;
  height: 28px;
}
.empty p {
  margin: 13px auto 23px;
  max-width: 410px;
  color: var(--muted);
}
.compact {
  padding: 26px 0 5px;
}
.empty .micro {
  font-size: 13px;
}
.dialog {
  width: min(520px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.dialog::backdrop {
  background: var(--overlay);
}
.dialog-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 42px);
}
.dialog-content {
  padding: 29px 29px 0;
  min-height: 0;
  overflow-y: auto;
}
.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.dialog-head .icon-button {
  margin: -8px -9px 0 0;
}
.dialog h2 {
  font-size: 24px;
}
.dialog p {
  font-size: 14px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 25px 29px 29px;
  margin: 0;
  flex-shrink: 0;
}
.created-dialog-actions,
.dialog-actions-split {
  justify-content: space-between;
}
.link-box {
  margin-top: 22px;
  text-align: left;
}
.link-box-private {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.link-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
}
.link-input {
  font:
    12px/1.4 Consolas,
    monospace;
}
.copy-button,
.share-button {
  flex: 0 0 44px;
  padding: 9px;
}
.tip {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 14px;
  margin-top: 21px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
}
.tip svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}
.copy-status {
  min-height: 19px;
}
.destructive-text {
  color: var(--danger);
}
.poll-object {
  margin: 18px 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.event-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 18px 0 26px;
}
.form-disclosure {
  margin-top: 17px;
}
.form-section > .form-disclosure:first-child {
  margin-top: 0;
}
.form-disclosure > summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.form-disclosure > summary:hover {
  color: var(--text);
}
.form-disclosure > .field {
  margin-top: 12px;
}
.description-input {
  resize: none;
  min-height: 145px;
  width: 100%;
}
.status-notice {
  padding: 14px 18px;
  background: var(--soft);
  border-radius: var(--radius);
  margin: 18px 0;
}
.management,
.mail-status {
  margin-top: 24px;
}
.management-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.management-edit,
.admin-results-link {
  margin-inline-start: auto;
}
.management > p,
.mail-status > p {
  margin-top: 12px;
}
.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}
.setup-progress {
  padding: 0;
  list-style: none;
}
.filter-label {
  align-self: center;
  font-weight: 600;
}
@media (max-width: 560px) {
  .filter-label {
    flex-basis: 100%;
  }
}
.admin-row {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.admin-details {
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-details > p {
  margin: 6px 0 12px;
}
.password-field {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.password-field input {
  min-width: 0;
  flex: 1;
}
.login .intro {
  margin: 16px 0 24px;
}
.admin-list h3 {
  font-size: 19px;
}
.results-switch {
  align-items: center;
  margin-top: 36px;
  margin-bottom: 18px;
}
.results-toolbar-separator {
  flex: 0 0 auto;
  height: 32px;
  margin-inline: 4px;
  border-inline-start: 1px solid var(--line);
}
.matrix-scroll {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}
.matrix-table th,
.matrix-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}
.matrix-table th {
  font-weight: 600;
}
.matrix-table thead th {
  background: var(--soft);
  font-size: 13px;
}
.matrix-table .matrix-option {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow-wrap: anywhere;
}
.matrix-table .matrix-name {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 0 var(--line);
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  text-align: left;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.matrix-table thead .matrix-name,
.matrix-table tfoot .matrix-name {
  background: var(--soft);
}
.matrix-table tfoot td {
  background: var(--soft);
  font-weight: 700;
}
.matrix-table tfoot th,
.matrix-table tfoot td {
  border-bottom: 0;
}
.matrix-table tr > :last-child {
  border-right: 0;
}
.matrix-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--brand);
}
.matrix-unselected {
  color: var(--muted);
}
.matrix-range {
  margin-top: 14px;
}
@media (max-width: 560px) {
  .management .row-actions,
  .admin-row .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .management-status-actions > form > .button {
    width: 100%;
  }
  .management-status-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .management-edit,
  .admin-results-link {
    margin-inline-start: 0;
  }
  .matrix-table .matrix-name {
    width: 115px;
    min-width: 115px;
    max-width: 115px;
  }
  .results-switch > .button {
    flex: 1 1 auto;
  }
  .results-toolbar-separator {
    flex-basis: 100%;
    height: 0;
    margin: 4px 0;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 800px) {
  .header {
    padding: 23px 26px;
  }
  .main {
    padding: 35px 26px;
  }
  .footer {
    padding: 20px 26px;
  }
  .home-layout {
    gap: 28px;
  }
  .home-title {
    font-size: 39px;
  }
  .example-ballot {
    padding: 21px;
  }
  .create-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-note {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
  }
  .side-note h3 {
    grid-column: 1/-1;
  }
}
@media (max-width: 560px) {
  .header {
    padding: 22px 20px;
  }
  .main {
    padding: 29px 20px 36px;
  }
  .footer {
    padding: 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  .footer span {
    width: 100%;
    text-align: center;
  }
  .password-field {
    flex-direction: column;
  }
  .footer .footer-legal {
    margin-left: 0;
  }
  .home-layout {
    grid-template-columns: 1fr;
    padding-top: 0;
    gap: 28px;
  }
  .home-title {
    font-size: 39px;
  }
  .home-layout .intro {
    max-width: none;
    margin: 17px 0 21px;
  }
  .example-ballot {
    transform: none;
    box-shadow: 4px 5px 0 var(--soft);
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 32px;
  }
  .paper {
    padding: 22px 17px;
  }
  .side-note {
    grid-template-columns: 1fr;
  }
  .results-heading {
    flex-wrap: wrap;
    gap: 16px;
  }
  h1 {
    font-size: 29px;
  }
  .vote h1 {
    font-size: 27px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions > .primary {
    flex: 1;
  }
  .edit-actions,
  .actions-split {
    flex-wrap: nowrap;
  }
  .edit-actions > .button,
  .actions-split > .button {
    min-width: 0;
    padding-inline: 10px;
  }
  .actions-split > .button {
    flex: 1;
  }
  .actions-split > .button svg {
    display: none;
  }
  .dialog-content {
    padding: 23px 19px 0;
  }
  .dialog-actions {
    padding: 23px 19px;
    gap: 9px;
  }
  .dialog-actions > .button {
    flex: 1 1 auto;
  }
  .dialog-actions-split > .button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 10px;
  }
  .dialog h2 {
    font-size: 22px;
  }
  .input {
    font-size: 16px;
  }
  .link-input {
    font-size: 12px;
  }
  .result-label {
    flex-wrap: wrap;
    gap: 3px;
  }
  .result-label > span:first-child {
    flex: 1 1 160px;
  }
  .stats {
    gap: 17px;
  }
  .section-head {
    flex-wrap: wrap;
  }
  .footer span {
    overflow-wrap: anywhere;
  }
  .answer-section {
    --answer-number-width: 16px;
    --answer-remove-width: 32px;
  }
  .icon-button {
    min-width: 30px;
  }
  .form-alert {
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  .badge,
  .result-fill,
  .brand-mark,
  .chosen .example-box {
    border: 1px solid currentColor;
  }
  .result-fill {
    background: Highlight;
  }
}

.button.danger[aria-busy="true"]::after {
  right: auto;
  left: 17px;
}

.home-examples {
  display: grid;
  gap: 28px;
  min-width: 0;
}
.home-example-viewport {
  position: relative;
  display: grid;
  gap: 28px;
  min-width: 0;
}
.home-examples.is-rotating .home-example-viewport > section {
  grid-area: 1 / 1;
  visibility: hidden;
  pointer-events: none;
}
.home-examples.is-rotating .home-example-viewport > .is-current {
  visibility: visible;
  pointer-events: auto;
}
.home-example-switch {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}
.home-example-switch:hover {
  box-shadow: 0 0 0 2px var(--line);
}
.home-example-switch:not(:disabled):active {
  transform: none;
  box-shadow: 0 0 0 2px var(--brand);
}
.example-results {
  transform: rotate(-1deg);
}
.example-results h2 {
  font-size: 22px;
}
.example-result {
  margin: 16px 0;
}
.example-result > div:first-child {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 7px;
}
.example-result strong {
  white-space: nowrap;
  color: var(--brand);
}
.example-result-track {
  height: 9px;
  background: var(--soft);
  border-radius: 8px;
  overflow: hidden;
}
.example-result-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.example-matrix {
  transform: rotate(-0.5deg);
  min-width: 0;
}
.example-matrix h2 {
  font-size: 22px;
}
.example-matrix-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}
.example-matrix-table th,
.example-matrix-table td {
  padding: 7px 4px;
  overflow-wrap: anywhere;
}
.example-matrix-table thead th {
  font-size: 11px;
}
.example-matrix-table tr > :first-child {
  text-align: left;
  width: 25%;
}
.example-matrix-table thead th:nth-child(2) {
  width: 28%;
}
.theme-options {
  padding: 0;
  border: 0;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.theme-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.theme-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--soft);
}
.theme-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.theme-swatch-blue {
  background: #15a3dc;
}
.theme-swatch-green {
  background: #16665e;
}
@media (max-width: 560px) {
  .example-results,
  .example-matrix {
    transform: none;
  }
  .home-examples {
    gap: 22px;
  }
}

.notification-preferences {
  border: 0;
  padding: 0;
  margin: 18px 0 14px;
  min-width: 0;
}
.notification-frequency {
  min-width: 0;
  margin: 0 0 16px 26px;
  border: 0;
  padding: 0;
}
.notification-preferences legend {
  padding: 0;
  margin-bottom: 12px;
}
.participant-settings .check,
.notification-preferences .check {
  margin: 12px 0;
}

.smtp-test {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 22px;
}
.smtp-test h3 {
  margin-bottom: 10px;
}
.smtp-test-report {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  margin-top: 20px;
  padding: 18px;
  overflow-wrap: anywhere;
}
.smtp-test-report[role="alert"] {
  border-color: var(--danger);
}
.smtp-test-report ul {
  margin: 12px 0;
  padding-left: 20px;
}

.security-section + .security-section,
.recovery-panel {
  margin-top: var(--space-6, 24px);
}
.security-section h2 {
  margin-top: 0;
}
.security-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.security-heading h2 {
  margin-bottom: 0;
}
.security-section .form-disclosure {
  margin-top: 24px;
}
.security-section .form-disclosure[open] summary {
  margin-bottom: 16px;
}
.security-section form + form {
  margin-top: 16px;
}
.auth-qr {
  width: min(100%, 240px);
  margin: 20px 0;
  background: #fff;
  line-height: 0;
}
.auth-qr svg {
  width: 100%;
  height: auto;
}
.auth-secret {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
  font-size: 1rem;
  margin: 16px 0;
}
.setup-steps {
  padding-left: 24px;
}
.setup-steps li + li {
  margin-top: 20px;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}
.recovery-codes code {
  user-select: all;
  overflow-wrap: anywhere;
}
.login form + form {
  margin-top: 12px;
}

/* Shared language control; flags are local assets with fixed dimensions. */
.header-actions { margin-inline-start:auto; display:flex; align-items:center; gap:12px; }
.header-actions .header-logout { margin:0; }
.language-switch { width:44px; min-width:44px; height:44px; padding:10px; }
.language-switch img { display:block; width:24px; height:16px; border:1px solid var(--line); }
@media (max-width:560px) { .header { flex-wrap:wrap; gap:12px; } .header-actions { gap:8px; } .header-actions .button { padding-inline:10px; } }

/* Shared authenticated header disclosure; native operation also works without JS. */
.admin-menu { position:relative; }
.admin-menu > summary { list-style:none; min-height:44px; }
.admin-menu > summary::-webkit-details-marker { display:none; }
.admin-menu > summary::after { content:""; width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); margin-inline-start:4px; margin-block-start:-4px; }
.admin-menu[open] > summary::after { transform:rotate(225deg); margin-block-start:4px; }
.admin-menu-panel { position:absolute; inset-inline-end:0; top:calc(100% + 8px); z-index:10; width:max-content; min-width:180px; max-width:calc(100vw - 32px); padding:8px; display:grid; gap:4px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:0 8px 24px var(--overlay); }
.admin-menu-panel .button { width:100%; justify-content:flex-start; min-height:44px; border-color:transparent; text-align:start; }
.admin-menu-panel .header-logout { border-top:1px solid var(--line); padding-top:4px; }

.cron-status { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.cron-status p + p { margin-top:6px; }

.dashboard-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:20px 0 0; }
.dashboard-counts dt { color:var(--muted); font-size:14px; overflow-wrap:anywhere; }
.dashboard-counts dd { margin:6px 0 0; font:700 32px/1.2 var(--font-heading); font-variant-numeric:tabular-nums; }
.dashboard-counts [data-survey-count="active"], .dashboard-counts [data-database-version] { color:var(--brand); }
.dashboard-counts [data-survey-count="closed"] { color:var(--danger); }
@media (max-width:560px) { .dashboard-counts { grid-template-columns:1fr; gap:18px; } }

.legal-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.legal-editor {
  min-height: 220px;
  resize: none;
}

.legal-page .results-heading {
  margin-bottom: 26px;
}

/* One authenticated menu: header on desktop, bottom navigation on mobile. */
.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-back,
.admin-menu-icon {
  display: none;
}
@media (max-width: 560px) {
  html.has-admin-controls {
    --admin-controls-bottom-inset: env(safe-area-inset-bottom, 0px);
    --admin-controls-row-height: 3rem;
    --admin-controls-space: calc(var(--admin-controls-row-height) + var(--admin-controls-bottom-inset));
    scroll-padding-bottom: calc(var(--admin-controls-space) + 16px);
  }
  .has-admin-controls body {
    padding-bottom: var(--admin-controls-space);
  }
  .has-admin-controls .application {
    min-height: calc(100dvh - var(--admin-controls-space));
  }
  .admin-controls {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 20;
    min-height: var(--admin-controls-space);
    align-items: stretch;
    gap: 0;
    padding: 0 env(safe-area-inset-right, 0px) var(--admin-controls-bottom-inset) env(safe-area-inset-left, 0px);
    background: var(--accent);
    color: var(--on-brand);
  }
  .admin-controls > .admin-back,
  .admin-controls > .admin-menu {
    flex: 1 1 50%;
    min-width: 0;
  }
  .admin-controls .admin-back,
  .admin-controls .admin-menu > summary {
    display: flex;
    width: 100%;
    min-height: var(--admin-controls-row-height);
    padding: 0 .375rem;
    gap: .375rem;
    font-size: 1rem;
    line-height: 1.6;
    border: 0;
    border-radius: 0;
    background: var(--accent);
    color: var(--on-brand);
  }
  .admin-controls .admin-back svg,
  .admin-controls .admin-menu-icon svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  .admin-controls .admin-back {
    border-inline-end: 1px solid var(--on-brand);
  }
  .admin-controls .admin-back:hover,
  .admin-controls .admin-menu > summary:hover {
    background: var(--accent-hover);
  }
  .admin-controls .admin-back:focus-visible,
  .admin-controls .admin-menu > summary:focus-visible {
    outline-color: var(--on-brand);
    outline-offset: -4px;
  }
  .admin-controls .admin-menu {
    position: static;
  }
  .admin-controls .admin-menu-icon {
    display: inline-flex;
  }
  .admin-controls .admin-menu > summary::after {
    display: none;
  }
  .admin-controls .admin-menu-panel {
    inset-inline: 0;
    top: auto;
    bottom: 100%;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: calc(100dvh - var(--admin-controls-space) - env(safe-area-inset-top, 0px) - .75rem);
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

.database-upgrades {
  padding-inline-start: 20px;
}
.database-upgrades code {
  font-size: 13px;
}

/* Legal text shares the administration field and focus primitives. */
.rich-editor { min-width: 0; }
.rich-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:10px; }
.rich-tool.button { min-width:44px; min-height:44px; padding:8px; font-size:16px; }
.rich-tool[data-rich-command="bold"] { font-weight:700; }
.rich-tool[data-rich-command="italic"] { font-style:italic; }
.rich-tool[data-rich-command="underline"] { text-decoration:underline; }
.rich-tool[aria-pressed="true"] { background:var(--soft); border-color:var(--brand); color:var(--brand); }
.rich-color { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.rich-color input { width:32px; height:32px; padding:2px; border:0; background:transparent; cursor:pointer; }
.rich-editor-body { min-height:260px; padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); line-height:1.65; overflow-wrap:anywhere; }
.rich-editor-body[aria-invalid="true"] { border-color:var(--danger); }
.rich-copy, .legal-copy-rich { white-space:normal; overflow-wrap:anywhere; }
.rich-copy > :first-child { margin-top:0; }
.rich-copy > :last-child { margin-bottom:0; }
.rich-copy p, .rich-copy div { margin:0 0 1em; }
.rich-copy h3 { font-size:1.25rem; margin:1.25em 0 .5em; }
.rich-copy h4 { font-size:1.125rem; margin:1.25em 0 .5em; }
.rich-copy h5, .rich-copy h6 { font-size:1rem; margin:1.25em 0 .5em; }
.rich-copy ul, .rich-copy ol { padding-inline-start:26px; margin:0 0 1em; }
.rich-copy li { margin:.25em 0; }
.rich-copy blockquote { border-inline-start:3px solid var(--line); margin:1em 0; padding-inline-start:16px; }
.rich-copy pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.rich-copy table { display:block; max-width:100%; width:max-content; overflow-x:auto; border-collapse:collapse; margin:1em 0; }
.rich-copy th, .rich-copy td { min-width:80px; max-width:360px; padding:10px 12px; border:1px solid var(--line); vertical-align:top; }
.rich-copy th { text-align:start; font-weight:700; }
.rich-copy caption { text-align:start; padding-bottom:8px; }
