#calendar-filter-modal .modal-card {
  width: min(960px, calc(100vw - 32px));
  max-width: 960px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

#calendar-filter-modal .modal-content {
  display: grid;
  gap: 14px;
}

#calendar-filter-modal .submit-grid > label {
  display: grid;
  gap: 6px;
  width: fit-content;
  min-width: 180px;
  font-weight: 700;
  color: #2f2140;
}

#filter-view-select {
  min-height: 40px;
  min-width: 180px;
  border: 1px solid #d8cfe2;
  border-radius: 10px;
  background: #fff;
  color: #2d2138;
  padding: 7px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

#filter-view-select:hover {
  border-color: #8d6aac;
  background: #faf7fd;
}

#filter-view-select:focus-visible {
  outline: 3px solid rgba(91, 42, 134, .22);
  outline-offset: 2px;
  border-color: #76509a;
}

#calendar-filter-modal .filter-group-label {
  margin: 0 0 8px;
  font-weight: 800;
  color: #2f2140;
}

.event-town-filter-options,
.events-filter-section {
  margin: 0;
}

.events-filter-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px 10px;
}

.events-filter-check-option {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid #d8cfe2;
  border-radius: 10px;
  background: #fff;
  color: #2d2138;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.events-filter-check-option:hover {
  border-color: #8d6aac;
  background: #faf7fd;
}

.events-filter-check-option:has(input:focus-visible) {
  outline: 3px solid rgba(91, 42, 134, .22);
  outline-offset: 2px;
}

.events-filter-check-option:has(input:checked) {
  border-color: #76509a;
  background: #f4edf9;
  box-shadow: inset 0 0 0 1px rgba(91, 42, 134, .08);
}

.events-filter-check-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #5b2a86;
}

.events-filter-check-option span {
  min-width: 0;
}

.events-filter-check-option.is-required {
  cursor: default;
}

.events-filter-check-option.is-required input {
  opacity: .75;
}

.events-filter-proxy-button {
  display: none !important;
}

html[data-theme="dark"] #calendar-filter-modal .filter-group-label,
body.theme-dark #calendar-filter-modal .filter-group-label,
html[data-theme="dark"] #calendar-filter-modal .submit-grid > label,
body.theme-dark #calendar-filter-modal .submit-grid > label {
  color: #f2eafa;
}

html[data-theme="dark"] #filter-view-select,
body.theme-dark #filter-view-select {
  border-color: rgba(222, 207, 235, .28);
  background: rgba(42, 28, 56, .92);
  color: #f4eef9;
}

html[data-theme="dark"] #filter-view-select:hover,
body.theme-dark #filter-view-select:hover {
  border-color: rgba(226, 199, 247, .55);
  background: rgba(61, 39, 81, .96);
}

html[data-theme="dark"] .events-filter-check-option,
body.theme-dark .events-filter-check-option {
  border-color: rgba(222, 207, 235, .28);
  background: rgba(42, 28, 56, .92);
  color: #f4eef9;
}

html[data-theme="dark"] .events-filter-check-option:hover,
body.theme-dark .events-filter-check-option:hover {
  border-color: rgba(226, 199, 247, .55);
  background: rgba(61, 39, 81, .96);
}

html[data-theme="dark"] .events-filter-check-option:has(input:checked),
body.theme-dark .events-filter-check-option:has(input:checked) {
  border-color: #b990d7;
  background: rgba(91, 42, 134, .55);
}

@media (max-width: 640px) {
  #calendar-filter-modal .modal-card {
    width: min(94vw, 960px);
    max-height: calc(100dvh - 20px);
  }

  #calendar-filter-modal .submit-grid > label,
  #filter-view-select {
    width: 100%;
    min-width: 0;
  }

  .events-filter-checklist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-filter-check-option {
    padding: 9px;
    font-size: .93rem;
  }
}

@media (max-width: 420px) {
  .events-filter-checklist-grid {
    grid-template-columns: 1fr;
  }
}
