:root {
  --bg: #f5f7fb;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #dbe1ea;
  --border-dark: #b2bbc9;
  --accent: #0b5cab;
  --accent-green: #166534;
  --flash: #e9f6ed;
  --error: #fde8e8;
  --page-min-margin: 12px;
  --system-font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --body-font-family: "Inter", "Noto Sans JP", var(--system-font-family);
  --glyph-font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--body-font-family);
  color: var(--text);
  background: var(--bg);
}

.container { width: min(980px, calc(100% - var(--page-min-margin) * 2)); margin: 0 auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: grid; gap: 12px; }
/* Single-column grid stretches inputs, left-justify them.
   Use .field--full to opt-in to full-width. */
.stack > input,
.stack > select,
.stack > textarea,
.stack > button {
  justify-self: start;
}
.field--full { justify-self: stretch; width: 100%; }
.inline { display: inline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar nav { display: flex; gap: 12px; align-items: center; }
.brand { font-weight: 700; text-decoration: none; color: var(--accent); }
.nav-toggle-checkbox { display: none; }
.nav-toggle { display: none; cursor: pointer; }
main { padding: 24px 0 40px; }

a { color: var(--accent); }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
button i,
.button-link i,
.menu-link i {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke-width: 2.1;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;

  &.button-link--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
}
button:disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
}
input, textarea, select {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.card {
  background: var(--card);
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.flash, .error {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.flash { background: var(--flash); }
.error { background: var(--error); }
.event-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 4px 0 20px;
}
.event-tabs a {
  min-width: 0;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
}
.event-tabs a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.event-tabs a:hover:not([aria-current="page"]) {
  color: var(--text);
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.7rem;
  .event-meta__item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
  }
  .event-meta__item i {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    stroke-width: 2;
  }
}
.event-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;

  & .event-layout__sidebar .card {
    margin-top: 12px;
  }
}

.actions { display: flex; gap: 14px; margin: 10px 0 20px; flex-wrap: wrap; }
.button--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.discord-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 6px;
}
.discord-preview strong { display: block; margin-top: 10px; }
.discord-preview pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-muted, #f1f5f9);
  padding: 8px 10px;
  border-radius: 6px;
  margin: 4px 0 0;
}
.saved-pattern-loader-trigger {
  width: fit-content;
}
.saved-pattern-loader {
  margin: 8px 0 0;
  inset: auto;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline;
  width: min(360px, calc(100vw - var(--page-min-margin) * 2));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}
.saved-pattern-loader::backdrop {
  background: transparent;
}
.event-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  & .event-status-banner__main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
  }

  & .event-status-banner__badge-wrap {
    flex: 0 0 auto;
    padding-top: 2px;
  }

  & .event-status-banner__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;

    &.event-status-banner__badge--draft {
      background: #f8fafc;
      color: #475569;
      border-color: #dbe1ea;
    }

    &.event-status-banner__badge--open {
      background: #e8f3ff;
      color: #0b5cab;
      border-color: #bed7f5;
    }

    &.event-status-banner__badge--closed {
      background: #eef2f7;
      color: #64748b;
      border-color: #d7dee8;
    }

    &.event-status-banner__badge--none {
      background: #fff7ed;
      color: #9a3412;
      border-color: #fed7aa;
    }
  }

  & .event-status-banner__copy {
    min-width: 0;

    & h2 {
      margin: 0 0 6px;
    }

    & > p {
      margin: 0;
    }
  }

  & .event-status-banner__schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 12px;

    & p {
      margin: 0;
    }
  }

  & .event-status-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
  }
}
.event-active-ballot-link {
  margin: 0;
}
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-heading-row h2,
.section-heading-row h3 {
  margin: 0;
}
.finalize-prereq-banner {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface-alt, #f5f5f5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.finalize-prereq-banner p {
  margin: 0;
  color: var(--muted);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-finalize-form {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.summary-finalize-hint {
  margin: 8px 0 0;
  text-align: center;
}

.button-prominent {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
}
.menu-anchor {
  position: relative;
}
.menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  font-size: 1.1rem;
  line-height: 1;
}
.menu-trigger i {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}
.overflow-menu {
  position: fixed;
  inset: auto;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline;
  margin: 8px 0 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}
.overflow-menu::backdrop {
  background: transparent;
}
.menu-form {
  margin: 0;
  width: 100%;
}
.menu-link,
.menu-form button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
}
.menu-link:hover,
.menu-form button:hover {
  background: #f5f7fb;
}
.menu-link + .menu-link,
.menu-link + .menu-form,
.menu-form + .menu-link,
.menu-form + .menu-form {
  margin-top: 8px;
}
.scheduled-close-editor {
  gap: 10px;
}
.scheduled-close-fields {
  max-height: 160px;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: translateY(0);
}
.scheduled-close-editor:has(.scheduled-close-toggle:not(:checked)) .scheduled-close-fields {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
}

.ballot-section-body {
  transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.28s ease, margin-top 0.28s ease;
  border: 0;
  margin: 0;
  padding: 16px 0;
  box-sizing: border-box;
  max-height: 2200px;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
}

/* TODO: This progressive enhancement is not currently covered by our Go httptest suite. 
   If Playwright/E2E tests are added in the future, add visual/state assertions here. 
   Do not change the DOM grouping of these classes without updating this selector! */
.ballot-section-editor:has(.participation-toggle-cb:not(:checked)) .ballot-section-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  margin-top: -4px;
  padding: 0;
}

.ballot-section-editor {
  background: #fff;
  gap: 0;
}

.ballot-section-editor:has(.participation-toggle-cb:not(:checked)) {
  padding-bottom: 0;
}

.ballot-section-editor > .section-heading-row {
  margin: -16px -16px 0;
  padding: 14px 20px;
  border-radius: 12px 12px 0 0;
  background: #fbfdff;
  border-bottom: 1px solid #e4ebf4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ballot-section-editor:has(.participation-toggle-cb:checked) > .section-heading-row {
  border-bottom: 1px solid #e4ebf4;
}

.ballot-section-editor:has(.participation-toggle-cb:not(:checked)) > .section-heading-row {
  border-bottom: 0;
  border-radius: 12px;
}

.section-heading-row h3 {
  margin: 0;
}

.section-heading-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.section-heading-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-note-block {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.section-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.section-status-chip--closed {
  background: #eef2f7;
  color: #64748b;
  border: 1px solid #d7dee8;
}

.section-status-chip--open {
  display: none;
  background: #e8f3ff;
  color: #0b5cab;
  border: 1px solid #bed7f5;
}

.section-heading-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #64748b;
  transition: transform 0.2s ease, color 0.2s ease;
}

.participation-toggle-cb {
  position: absolute;
  /* Checkbox is used for state and focus, but the label/chevron/chip are visible UI.
     Hide from view but keep in accessibility tree. */
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Swap the optional-section status chip and chevron state using :has */
.ballot-section-editor:has(.participation-toggle-cb:checked) .section-status-chip--closed {
  display: none;
}

.ballot-section-editor:has(.participation-toggle-cb:checked) .section-status-chip--open {
  display: inline-flex;
}

.ballot-section-editor:has(.participation-toggle-cb:checked) .section-heading-chevron {
  transform: rotate(180deg);
  color: #0b5cab;
}

/* All-optional form submission prevention */
.vote-cta-wrap .fake-submit-btn {
  display: none;
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
}
form.all-optional-form:not(:has(.participation-toggle-cb:checked)) .vote-cta-wrap .real-submit-btn {
  display: none;
}
form.all-optional-form:not(:has(.participation-toggle-cb:checked)) .vote-cta-wrap .fake-submit-btn {
  display: inline-block;
}


.checkbox { display: block; margin-bottom: 8px; }
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.slot-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.slot-group-card {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e4ebf4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.slot-group-card-header {
  margin: 0;
  padding: 0;
}
.slot-group-card-header h4 {
  margin: 0;
  font-size: 1rem;
}
.slot-group-slot-list {
  gap: 10px;
}
.vote-slot-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}
.vote-slot-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.vote-slot-time {
  font-weight: 700;
}
.vote-slot-label {
  font-size: 0.92rem;
  color: var(--muted);
}
.vote-choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.vote-choice {
  position: relative;
  cursor: pointer;
}
.vote-choice-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.vote-choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-align: left;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.vote-choice-input:focus-visible + .vote-choice-chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.vote-choice-input:checked + .vote-choice-chip {
  border-color: #b8c6db;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.vote-choice-input:not(:checked) + .vote-choice-chip {
  color: var(--muted);
  background: #f8fafc;
}
.vote-choice-input:not(:checked) + .vote-choice-chip .glyph {
  background: #eef2f7;
  color: #6b7280;
}
.vote-choice-text {
  font-weight: 600;
}
.vote-choice-chip--textless {
  padding: 0;
  .vote-choice-text {
    display: none;
  }
}
.muted { color: var(--muted); }

.vote-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(120deg, #ffffff 0%, #eef4ff 100%);
}

.vote-hero h1 {
  margin: 0 0 8px;
}

.vote-hero-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.vote-hero-meta code {
  display: inline-block;
  background: #f1f5ff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}

.board-wrap {
  overflow-x: auto;
}

.vote-board {
  border-collapse: separate;
  border-spacing: 0;
}

.vote-board th,
.vote-board td {
  min-width: 140px;

  [lang="ja"] & {
    min-width: 84px;
  }
}

.vote-board th,
.vote-board td {
  border-right: 1px solid var(--border);
}

.vote-board .vote-group-end {
  border-right: 2px solid var(--border-dark);
}

.vote-board .vote-group-header:not(:last-child) {
  border-right: 2px solid var(--border-dark);
}

.vote-board thead tr:first-child th:first-child,
.vote-board tbody td:first-child {
  min-width: 120px;
  position: sticky;
  left: 0;
  background: #fff;
  border-right: 2px solid var(--border-dark);
  z-index: 1;

  [lang="ja"] & {
    min-width: 84px;
  }
}

.vote-board tfoot td:first-child {
  min-width: 120px;
  position: sticky;
  left: 0;
  background: #fff;
  border-right: 3px solid var(--border-dark);
  z-index: 1;

  [lang="ja"] & {
    min-width: 84px;
  }
}

[lang="ja"] .vote-slot {
  text-align: center;
}

.voter-link {
  text-decoration: none;
  font-weight: 600;
}

.voter-link.active {
  text-decoration: underline;
}

.voter-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.voter-note-cell {
  color: var(--muted);
}

.vote-cell {
  text-align: center;
}

.vote-cell.support-heat {
  background: rgba(11, 92, 171, 0);
}

.vote-cell.support-heat-1 {
  background: rgba(11, 92, 171, 0.01);
}

.vote-cell.support-heat-2 {
  background: rgba(11, 92, 171, 0.05);
}

.vote-cell.support-heat-3 {
  background: rgba(11, 92, 171, 0.12);
}

.vote-cell.support-heat-4 {
  background: rgba(11, 92, 171, 0.20);
}

.vote-cell.slot-selected {
  background: #c2e1c4;
}

.vote-cell .glyph {
  display: inline-flex;
  min-width: 24px;
  border-radius: 999px;
  font-weight: 700;
  height: 32px;
  width: 32px;
  justify-content: center;
  align-items: center;
  font-family: var(--glyph-font-family);

  [lang="ja"] & {
    text-shadow: -1px 0, 0 1px, 1px 0, 0 -1px, -1px -1px, 1px 1px, -1px 1px, 1px -1px;
  }
}

.vote-cell.yes .glyph {
  background: #dff3e4;
  color: #166534;
}

.vote-cell.maybe .glyph {
  background: #fef3c7;
  color: #92400e;
}

.vote-cell.no .glyph {
  background: #fde2e2;
  color: #991b1b;
}

.vote-cell.empty .glyph {
  background: #eef2f7;
  color: #6b7280;
}

.vote-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  text-align: left;
}

.slot-group-row td {
  background: #f6f9ff;
  font-size: 0.92rem;
}

.matrix-finalize-row td {
  background: #f8fafc;
  border-top: 2px solid var(--border);
  vertical-align: top;
}

.matrix-finalize-cell {
  text-align: center;
}

.matrix-finalize-cell.is-selected {
  background: #c2e1c4;
  button {
    background: var(--accent-green);
  }
}

.matrix-finalize-cell form {
  margin: 0;
}

.matrix-finalize-cell button {
  width: 100%;
}

.vote-cta-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.vote-clear-voter-btn {
  justify-self: start;
}

.vote-locked-voter-name {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.vote-cta-wrap button {
  display: inline-block;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.vote-cta-wrap button {
  background: linear-gradient(135deg, #0b5cab 0%, #1a7ddb 100%);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;

  & .cal-month-label {
    margin: 0;
    font-size: 1.15rem;
  }

  & .cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--border);

    & i {
      width: 18px;
      height: 18px;
    }
  }
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;

  & .cal-dow {
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  & .cal-day {
    min-height: 64px;
    padding: 4px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;

    &:nth-child(7n) {
      border-right: 0;
    }

    & .cal-day__num {
      font-size: 0.8rem;
      font-weight: 600;
      line-height: 1;
    }

    &.cal-day--outside {
      background: var(--bg);

      & .cal-day__num {
        color: var(--muted);
        opacity: 0.5;
      }
    }

    &.cal-day--today {
      & .cal-day__num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--accent);
        color: #fff;
      }
    }
  }

  & .cal-day__event {
    display: block;
    font-size: 0.7rem;
    line-height: 1.2;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    &.cal-day__event--cancelled {
      background: var(--muted);
      text-decoration: line-through;
    }
  }
}

.cal-mini-wrap {
  & .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;

    & .cal-month-label {
      margin: 0;
      font-size: 1rem;
    }
  }

  & .cal-mini-link {
    font-size: 0.85rem;
  }
}

.cal-grid--mini {
  & .cal-day {
    min-height: 40px;
    align-items: center;
    /* Center the day number vertically so it clears the month marker pinned to
       the top-left corner. */
    justify-content: center;
    /* Anchor for the absolutely-positioned month marker below. */
    position: relative;
  }

  & .cal-dow {
    font-size: 0.7rem;
    padding: 4px 2px;
  }

  & .cal-day__num {
    font-size: 0.75rem;
  }

  & .cal-day--past .cal-day__num {
    color: var(--muted);
    opacity: 0.55;
  }

  /* Month label on the first cell and each month boundary, standing in for the
     single month header a fixed-month grid would have. Pinned to the cell
     corner (out of flow) so it never shifts the day number off the row's
     baseline. */
  & .cal-day__month {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
    color: var(--muted);
    text-transform: uppercase;
    pointer-events: none;
  }

  & .cal-day__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5px;
  }
}

.cal-day__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}

.cal-day__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;

  &.cal-day__dot--cancelled {
    background: var(--muted);
  }
}

@media (max-width: 700px) {
  .card {
    margin-left: calc(-1 * var(--page-min-margin));
    margin-right: calc(-1 * var(--page-min-margin));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .board-wrap {
    margin-inline: -16px;
  }
  .event-tabs {
    /* Keep mobile event navigation in predictable rows as tabs are added. */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 0;
  }
  .event-tabs a {
    padding: 10px 8px;
    border-bottom-color: var(--border);
    margin-bottom: 0;
    overflow-wrap: anywhere;
  }
  .event-status-banner {
    align-items: stretch;
    flex-direction: column;

    & .event-status-banner__main {
      flex-direction: column;
      gap: 12px;
    }

    & .event-status-banner__schedule {
      display: grid;
      gap: 8px;
    }

    & .event-status-banner__actions {
      width: 100%;
      justify-content: space-between;

      & .button-link {
        flex: 1 1 auto;
      }
    }
  }
  .row { flex-direction: column; align-items: flex-start; }
  .topbar .row { flex-direction: row; flex-wrap: wrap; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-toggle-open { display: block; }
  .nav-toggle-close { display: none; }
  .nav-toggle-checkbox:checked ~ .nav-toggle .nav-toggle-open { display: none; }
  .nav-toggle-checkbox:checked ~ .nav-toggle .nav-toggle-close { display: block; }
  .topbar nav {
    display: none;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    padding: 8px 0;
  }
  .nav-toggle-checkbox:checked ~ nav { display: flex; }
  .vote-hero { flex-direction: column; }
  .vote-hero-heading { flex-direction: column; gap: 4px; }
  .vote-hero-sep { display: none; }
  .vote-slot-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .section-heading-title-wrap {
    flex-wrap: wrap;
  }
  .vote-choice-row {
    justify-content: flex-start;
  }
  table { font-size: 14px; }
  .cal-grid .cal-day {
    min-height: 48px;
  }
  .cal-grid .cal-day__event {
    font-size: 0;
    width: 8px;
    height: 8px;
    min-height: 8px;
    border-radius: 50%;
    padding: 0;
  }
}

@media (min-width: 860px) {
  .event-layout {
    grid-template-columns: 240px 1fr;
    grid-template-areas: "sidebar main";
    gap: 0 16px;

    & .event-layout__main {
      grid-area: main;
    }
    & .event-layout__sidebar {
      grid-area: sidebar;
      position: sticky;
      top: 60px;
      align-self: start;
    }
  }
  .slot-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .slot-group-grid:has(> .slot-group-card:only-child) {
    grid-template-columns: minmax(320px, 560px);
    justify-content: center;
  }
}
