:root {
  color-scheme: light;
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --surface-muted: #fbfaf8;
  --ink: #191a18;
  --muted: #696762;
  --faint: #74716c;
  --line: #dfddd7;
  --line-strong: #c8c4bc;
  --accent: #376b59;
  --accent-strong: #254f41;
  --accent-soft: #edf3ec;
  --warning: #8a6200;
  --warning-soft: #fbf3db;
  --danger: #913735;
  --danger-soft: #fdebec;
  --info: #285f80;
  --info-soft: #e6f1f7;
  --radius-sm: 5px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --content: 1240px;
  --reading: 68ch;
  --font-sans: "Avenir Next", "SF Pro Display", "Geist Sans", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "Geist Mono", "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--canvas);
}

body {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  transform: translateY(-150%);
  transition: transform 140ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: calc(12px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
}

.topbar nav > a,
.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav > a:hover,
.nav-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.nav-form {
  display: contents;
}

.account-label {
  max-width: min(28vw, 260px);
  padding: 0 8px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  width: min(var(--content), calc(100% - 40px));
  min-height: calc(100dvh - 136px);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) 0 clamp(72px, 10vw, 136px);
}

.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: clamp(440px, 68dvh, 720px);
  margin-bottom: 24px;
  padding: clamp(48px, 10vw, 132px) clamp(24px, 8vw, 104px);
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.hero::after {
  content: "PLAN / VOTE / DECIDE";
  position: absolute;
  right: clamp(24px, 6vw, 80px);
  bottom: 30px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.hero h1,
.page-heading h1,
.poll-head h1,
.auth-shell h1 {
  max-width: 16ch;
}

.page-heading h1 {
  max-width: 18ch;
  overflow-wrap: normal;
  font-size: clamp(2.55rem, 5.2vw, 4rem);
  word-break: normal;
}

.hero .lead {
  max-width: 58ch;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-wrap: balance;
}

h1,
h2,
h3,
[role="alert"] {
  scroll-margin-top: 96px;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2.55rem, 6.5vw, 4.4rem);
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

p {
  max-width: var(--reading);
}

.lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1px;
  margin-bottom: 56px;
  border: 1px solid var(--line);
  background: var(--line);
}

.feature-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 138px;
  padding: clamp(24px, 4vw, 42px);
  background: var(--surface);
}

.feature-grid article:first-child {
  grid-row: span 2;
  min-height: 277px;
  align-content: end;
}

.feature-grid strong {
  font-size: 1.08rem;
}

.feature-grid span,
.muted,
.meta,
.final-copy,
.field-help {
  color: var(--muted);
}

.panel,
.poll-head,
.final-banner,
.warning,
.share,
.auth-shell {
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.legal-notice {
  max-width: 72ch;
  white-space: pre-line;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.65fr);
  gap: clamp(24px, 7vw, 96px);
  align-items: end;
  margin-bottom: clamp(36px, 6vw, 72px);
  padding: 0 clamp(0px, 3vw, 36px);
}

.page-heading .lead {
  margin: 0 0 6px;
}

.access-heading {
  grid-template-columns: minmax(0, 0.7fr) minmax(28rem, 1.3fr);
}

.auth-shell {
  width: min(680px, 100%);
  margin: clamp(36px, 8vw, 104px) 0 clamp(72px, 12vw, 150px) clamp(0px, 9vw, 120px);
  padding: clamp(30px, 6vw, 64px);
}

.auth-form {
  margin-top: 30px;
}

.otp-input {
  max-width: 14rem;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.24em;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 11px 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease;
}

.button:hover {
  border-color: var(--ink);
}

.button:active {
  transform: translateY(1px) scale(0.985);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.button.primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--surface));
}

.button.secondary {
  background: var(--surface-muted);
}

.button.danger,
.danger-text {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}

.button.quiet {
  min-height: 44px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  font-size: 13px;
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.form {
  display: grid;
  gap: 18px;
}

.compact-form {
  gap: 12px;
  margin: 26px 0;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 740;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}

input[readonly] {
  border-style: dashed;
  background: var(--surface-muted);
  color: var(--muted);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.field-help {
  display: block;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

.form-field .field-error {
  margin: 0;
}

.options {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.dategrid-options {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}

.dategrid-options legend {
  width: 100%;
  padding: 24px 24px 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  text-align: left;
}

.option-toolbar {
  display: flex;
  justify-content: flex-start;
  padding: 16px 24px 24px;
}

.option-toolbar label {
  width: min(280px, 100%);
}

.option-builder {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.85fr);
  border-top: 1px solid var(--line);
}

.calendar-picker {
  min-width: 0;
  min-height: 430px;
  padding: clamp(20px, 3vw, 32px);
}

.calendar-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.calendar-head strong {
  text-align: center;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 720;
  letter-spacing: -0.025em;
}

.round-button,
.calendar-day,
.date-group-header button,
.time-delete,
.add-time {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.round-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.25rem;
}

.round-button:hover,
.calendar-day:hover,
.date-group-header button:hover,
.time-delete:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(32px, 1fr));
  gap: clamp(2px, 0.7vw, 7px);
  text-align: center;
}

.calendar-weekdays {
  margin-bottom: 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.calendar-day {
  border-radius: 50%;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.calendar-day.muted {
  color: var(--faint);
}

.calendar-day.weekend {
  color: var(--danger);
}

.calendar-day.selected {
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.calendar-day:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.calendar-day[aria-current="date"]:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.selected-times {
  min-width: 0;
  min-height: 430px;
  padding: clamp(20px, 3vw, 28px);
  border-left: 1px solid var(--line);
  background: var(--accent-soft);
}

.selected-empty,
.empty-state {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  margin: 6px 0 0;
}

.date-group {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.date-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.time-row input[type="time"] {
  min-height: 40px;
  padding: 4px;
  border: 0;
  font-variant-numeric: tabular-nums;
}

.end-time {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.end-time small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.time-separator {
  color: var(--faint);
}

.add-time {
  width: 100%;
  border-top: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 750;
}

.option-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.option-cards,
.results {
  display: grid;
  gap: 12px;
}

.option-card,
.result-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.segmented label,
.vote-choice label {
  position: relative;
  display: block;
}

.segmented input,
.vote-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-right: 1px solid var(--line);
  font-weight: 750;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--ink);
  color: var(--surface);
}

.segmented input:focus-visible + span,
.vote-choice input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: -3px;
}

.vote-board {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr);
  grid-auto-columns: minmax(174px, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overscroll-behavior-inline: contain;
}

.vote-board-label,
.vote-option-card {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.vote-board-label {
  display: grid;
  align-content: center;
  gap: 12px;
  background: var(--info-soft);
}

.vote-option-card {
  display: grid;
  gap: 16px;
  background: var(--surface-muted);
}

.vote-option-time {
  display: grid;
  gap: 3px;
  text-align: center;
}

.vote-option-time span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.vote-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.vote-choice span {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.vote-choice .choice-yes {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--accent-strong);
}

.vote-choice .choice-maybe {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  color: var(--warning);
}

.vote-choice .choice-no {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  color: var(--danger);
}

.vote-choice input:checked + .choice-yes {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.vote-choice input:checked + .choice-maybe {
  background: var(--warning-soft);
  box-shadow: inset 0 0 0 1px var(--warning);
}

.vote-choice input:checked + .choice-no {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.result-card.best {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.result-card.final,
.final-banner {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--accent-soft);
}

.rank,
.badge,
.email-dot,
.count-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rank,
.email-dot {
  margin-right: 8px;
}

.badge,
.status-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-disabled {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.matrix,
.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

thead th {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody th,
tbody td {
  font-size: 14px;
}

.vote-yes {
  color: var(--accent-strong);
}

.vote-maybe {
  color: var(--warning);
}

.vote-no {
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.warning {
  display: grid;
  gap: 8px;
  border-color: color-mix(in srgb, var(--warning) 48%, var(--line));
  background: var(--warning-soft);
}

code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: 0.86em;
  white-space: nowrap;
}

.share {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.copy-control {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.copy-status {
  min-height: 1.3em;
  color: var(--muted);
  font-size: 0.88rem;
}

.errors,
.notice {
  margin: 14px 0 22px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
}

.errors {
  border: 1px solid color-mix(in srgb, var(--danger) 58%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.errors p {
  margin: 4px 0;
}

.field-error {
  margin: -9px 0 3px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 690;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 14%, transparent);
}

.notice {
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 20px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.domain-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.domain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.domain-list code {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  text-overflow: ellipsis;
}

.users-table {
  min-width: 0;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  padding-right: 8px;
  padding-left: 8px;
}

.users-table th:nth-child(1) {
  width: 30%;
}

.users-table th:nth-child(2) {
  width: 11%;
}

.users-table th:nth-child(3) {
  width: 14%;
}

.users-table th:nth-child(4) {
  width: 23%;
}

.users-table th:nth-child(5) {
  width: 22%;
}

.users-table tbody th {
  overflow-wrap: anywhere;
}

.row-action {
  text-align: right;
}

.row-action form {
  display: flex;
  justify-content: flex-end;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer {
  min-height: 72px;
  padding: 24px max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

@media (max-width: 940px) {
  .page-heading,
  .access-layout,
  .option-builder {
    grid-template-columns: 1fr;
  }

  .selected-times {
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .access-layout {
    gap: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topbar nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
    padding-bottom: 2px;
  }

  .account-label {
    display: none;
  }

  .page {
    width: min(100% - 24px, var(--content));
    padding-top: 26px;
  }

  .hero {
    min-height: 520px;
    padding: 42px 22px 76px;
  }

  .hero::after {
    right: 22px;
    bottom: 24px;
  }

  .feature-grid,
  .split,
  .option-edit,
  .share,
  .result-card,
  .page-heading {
    grid-template-columns: 1fr;
  }

  .feature-grid article:first-child {
    grid-row: auto;
    min-height: 170px;
  }

  .panel,
  .poll-head,
  .final-banner,
  .warning,
  .share,
  .auth-shell {
    padding: 20px 18px;
  }

  .auth-shell {
    margin: 28px 0 72px;
  }

  .button,
  .button.primary,
  .button.secondary {
    width: 100%;
  }

  .domain-list .button,
  .row-action .button,
  .nav-button {
    width: auto;
  }

  .users-table {
    min-width: 640px;
    table-layout: auto;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .segmented span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .segmented label:last-child span {
    border-bottom: 0;
  }

  .dategrid-options legend,
  .option-toolbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .calendar-picker,
  .selected-times {
    padding: 16px 12px;
  }

  .calendar-grid,
  .calendar-weekdays {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }

  .calendar-day {
    min-width: 40px;
    min-height: 44px;
  }

  .time-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 44px;
    padding: 8px;
  }

  .vote-board {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .vote-board-label,
  .vote-option-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .vote-option-time {
    text-align: left;
  }

  .actions {
    display: grid;
  }
}

@media (max-width: 390px) {
  .page {
    width: min(100% - 16px, var(--content));
  }

  .panel,
  .poll-head,
  .final-banner,
  .warning,
  .share,
  .auth-shell {
    padding: 18px 14px;
  }

  .calendar-picker,
  .selected-times {
    padding: 14px 8px;
  }

  .calendar-grid,
  .calendar-weekdays {
    gap: 1px;
  }

  .calendar-day {
    min-width: 36px;
  }

  .vote-choice {
    gap: 4px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #171816;
    --surface: #20211f;
    --surface-muted: #252624;
    --ink: #f0efeb;
    --muted: #b5b1aa;
    --faint: #8f8b84;
    --line: #383a36;
    --line-strong: #51534e;
    --accent: #79a994;
    --accent-strong: #b3d7c5;
    --accent-soft: #25372f;
    --warning: #e1ba62;
    --warning-soft: #3b321e;
    --danger: #e3a09c;
    --danger-soft: #442a2a;
    --info: #91bfd8;
    --info-soft: #24343d;
  }

  .calendar-day.selected,
  .button.primary {
    color: #171816;
  }

  .topbar {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: var(--line-strong);
  }

  .button,
  input,
  select,
  textarea {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .button,
  .status-badge,
  .badge,
  .calendar-day.selected,
  .vote-choice span {
    forced-color-adjust: auto;
  }
}
