:root {
  color-scheme: light;
  --bg: #f8f6fb;
  --panel: #ffffff;
  --ink: #1f1829;
  --muted: #6d6178;
  --line: #e5ddec;
  --accent: #6f3bbd;
  --accent-dark: #4f2c86;
  --focus: #c4668d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fdfbff;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.export-menu {
  position: relative;
}

.export-menu summary {
  list-style: none;
}

.export-menu summary::-webkit-details-marker {
  display: none;
}

.export-menu-panel {
  position: absolute;
  right: 0;
  z-index: 1000;
  display: grid;
  min-width: 160px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgba(31, 24, 41, 0.16);
  overflow: hidden;
}

.export-menu-panel button,
.export-menu-panel a {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 11px 14px;
  text-align: left;
  text-decoration: none;
}

.export-menu-panel button:last-child,
.export-menu-panel a:last-child {
  border-bottom: 0;
}

.export-menu-panel button:hover,
.export-menu-panel a:hover {
  background: #f5effb;
  color: var(--accent-dark);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

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

.filters {
  display: grid;
  grid-template-columns: minmax(88px, 0.5fr) minmax(124px, 0.65fr) minmax(124px, 0.65fr) minmax(190px, 1.2fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

input:focus,
select:focus,
textarea:focus,
.button:focus,
.copy-action:focus {
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: transparent;
  color: var(--accent);
}

.button-secondary:hover {
  background: #f1e9f8;
}

.button[hidden] {
  display: none;
}

.button-disabled,
.button-disabled:hover {
  border-color: #c9bdd6;
  background: transparent;
  color: #8e819d;
  cursor: not-allowed;
}

.filter-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.filter-help {
  margin: -6px 0 8px;
  color: color-mix(in srgb, var(--muted) 78%, white);
  font-size: 0.86rem;
}

.filter-summary {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
  text-align: right;
}

.filter-summary strong {
  color: var(--ink);
  font-weight: 900;
}

.map-section {
  margin: 18px 0 30px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.section-heading .map-title {
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 900;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-embed-section {
  margin: 26px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(63, 38, 87, 0.08);
  padding: 16px;
}

.embed-map-heading {
  align-items: center;
  margin-bottom: 0;
}

.map-embed-section h2 {
  font-size: 1.04rem;
  font-weight: 900;
}

.map-embed-code-label {
  margin-top: 14px;
}

.map-embed-code {
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fdfbff;
  color: var(--ink);
  font: 0.84rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
  padding: 10px;
}

.map-embed-section .copy-status {
  min-height: 20px;
  margin: 10px 0 0;
}

.submission-intro,
.submission-panel,
.organization-section {
  margin: 28px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(63, 38, 87, 0.08);
  padding: 16px;
}

.submission-intro {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
  margin-top: 0;
}

.submission-intro h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.submission-intro p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.submission-chooser {
  display: grid;
  gap: 10px;
}

.choice-button {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 13px 14px;
  text-align: left;
}

.choice-button span {
  font-weight: 900;
}

.choice-button small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.choice-button:hover,
.choice-button-active {
  border-color: #cbb7dd;
  background: #f7f1fb;
}

.organization-heading {
  align-items: center;
  margin-bottom: 16px;
}

.submission-heading,
.organization-section h2 {
  font-size: 1.04rem;
  font-weight: 900;
}

.submission-heading {
  align-items: center;
  margin-bottom: 16px;
}

.submission-form,
.organization-form {
  display: grid;
  gap: 14px;
}

.submission-form label:has(:required) > span::after {
  content: " *";
  color: #b42318;
  font-size: 0.78rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.submission-form input::placeholder,
.submission-form textarea::placeholder {
  color: #8a6f9d;
  opacity: 1;
}

.submission-form-invalid input:invalid,
.submission-form-invalid textarea:invalid {
  border-color: #d92d20;
}

.field-error-flash {
  animation: field-error-flash 0.42s ease-in-out 0s 3;
  border-color: #d92d20 !important;
}

@keyframes field-error-flash {
  0%,
  100% {
    background: #ffffff;
    box-shadow: none;
  }

  50% {
    background: #fff1f0;
    box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.18);
  }
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
  padding: 10px 12px;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.organization-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.copy-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 12px;
  text-decoration: none;
}

.copy-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.copy-icon::before,
.copy-icon::after {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
  content: "";
}

.copy-icon::before {
  left: 4px;
  top: 1px;
}

.copy-icon::after {
  left: 1px;
  top: 5px;
  background: var(--accent);
}

.copy-action:hover,
.copy-action:focus {
  background: var(--accent-dark);
  color: #ffffff;
}

.copy-action:hover .copy-icon::after,
.copy-action:focus .copy-icon::after {
  background: var(--accent-dark);
}

.copy-status {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.82rem;
}

.events-map {
  position: relative;
  min-height: 380px;
  border: 1px solid #c9b5da;
  border-radius: 8px;
  background: #eee7f5;
  box-shadow: 0 14px 34px rgba(63, 38, 87, 0.12);
  overflow: hidden;
}

.embed-map-view {
  background: #ffffff;
}

.embed-map-view .topbar,
.embed-map-view .filters,
.embed-map-view .filter-status,
.embed-map-view .events-shell,
.embed-map-view .site-footer,
.embed-map-view .map-embed-section,
.embed-map-view .submission-intro,
.embed-map-view .submission-panel,
.embed-map-view .organization-section {
  display: none;
}

.embed-map-view main {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.embed-map-view .map-section {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  margin: 0;
}

.embed-map-view .section-heading {
  padding: 10px 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fdfbff;
}

.embed-map-view .events-map {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-purple .leaflet-tile {
  filter: grayscale(0.34) sepia(0.18) hue-rotate(218deg) saturate(1.65) brightness(1.03) contrast(1.08);
}

.map-purple .leaflet-control-zoom a {
  border-color: #c7b5d8;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
}

.map-purple .leaflet-popup-content-wrapper,
.map-purple .leaflet-popup-tip {
  border: 1px solid #d4c3df;
  background: #fffaff;
  color: var(--ink);
}

.event-marker-icon {
  background: transparent;
  border: 0;
}

.event-marker-dot {
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #5b2ca0;
  box-shadow: 0 4px 12px rgba(39, 25, 58, 0.38), 0 0 0 5px rgba(111, 59, 189, 0.18);
}

.static-map {
  background:
    linear-gradient(110deg, transparent 0 18%, rgba(255, 255, 255, 0.58) 18% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.5) 44% 46%, transparent 46%),
    linear-gradient(28deg, transparent 0 36%, rgba(111, 59, 189, 0.12) 36% 39%, transparent 39%),
    #efe9f5;
}

.static-marker {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(240px, 38vw);
  color: var(--ink);
  text-decoration: none;
  transform: translate(-10px, -10px);
}

.static-marker-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(31, 24, 41, 0.22);
}

.static-marker-label {
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(31, 24, 41, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup-title {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 800;
}

.map-popup-meta {
  margin: 0;
  color: var(--muted);
}

.map-popup-description {
  max-width: 260px;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.map-popup-source-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.map-popup-source-link:hover {
  color: var(--accent-dark);
}

.map-popup-calendar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7c8e5;
  border-radius: 6px;
  background: #ffffff;
  color: #5a5067;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  padding: 8px 9px;
}

.map-popup-calendar-button:hover {
  border-color: #c7b5d8;
  background: #f5effb;
  color: var(--accent-dark);
}

.events-shell {
  margin-top: 26px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.calendar-page main {
  width: min(1280px, calc(100% - 32px));
}

.calendar-shell {
  margin: 24px 0;
}

.calendar-heading {
  align-items: center;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.calendar-menu .export-menu-panel {
  min-width: 190px;
}

.calendar-embed-shell {
  position: relative;
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(63, 38, 87, 0.1);
  overflow: hidden;
}

.calendar-frame {
  display: block;
  width: 100%;
  min-height: 680px;
  border: 0;
  background: #ffffff;
}

.embed-instructions {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.embed-heading {
  margin-bottom: 12px;
}

.embed-code {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fdfbff;
  color: var(--ink);
  font: 0.86rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
  padding: 12px;
}

.calendar-copy-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.data-section {
  margin: 24px 0;
}

.data-page .data-section {
  margin-top: 0;
}

.data-intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.data-intro-row .snapshot-note {
  max-width: 920px;
  margin: 0;
  flex: 1;
  color: #51465f;
  font-size: 1.03rem;
  line-height: 1.55;
}

.data-intro-row .compact-select-label {
  margin-top: 2px;
}

.snapshot-error {
  margin: 0 0 18px;
  color: #9b1c31;
  font-size: 0.9rem;
}

.chart-caption {
  display: block;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-select-label {
  min-width: min(230px, 100%);
}

.compact-select-label select {
  min-height: 38px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.data-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.data-details-grid .metric-wide {
  min-height: 220px;
}

.source-analysis-card {
  grid-column: 1 / -1;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric > strong {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
}

.metric-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.breakdown {
  display: grid;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breakdown-row strong {
  color: var(--ink);
}

.breakdown-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: #eee6f4;
  overflow: hidden;
}

.breakdown-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.pie-breakdown {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-height: 220px;
}

.pie-chart {
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
}

.pie-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 9px 12px;
  width: 100%;
}

.pie-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  min-width: 0;
}

.pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-legend-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-legend-item strong {
  color: var(--ink);
}

.vertical-bar-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  align-items: end;
  gap: 14px;
  min-height: 240px;
  padding-top: 8px;
}

.vertical-bar-item {
  display: grid;
  grid-template-rows: 150px auto auto auto;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.vertical-bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: #f1edf5;
  overflow: hidden;
}

.vertical-bar-track span {
  display: block;
  width: min(46px, 68%);
  border-radius: 7px 7px 0 0;
}

.vertical-bar-item strong {
  color: var(--ink);
  font-size: 1rem;
}

.vertical-bar-item > span {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.vertical-bar-item em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.data-export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.data-export-panel strong {
  display: block;
  font-size: 1.15rem;
}

.data-export-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0eaf6;
  color: #40334f;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

th:first-child {
  padding-left: 52px;
}

tbody tr:hover,
tbody tr:focus-within {
  background: #fdfbff;
}

td {
  color: #2d2538;
  font-size: 0.94rem;
}

.event-date-cell {
  position: relative;
  padding-left: 52px;
}

.event-calendar-menu summary {
  list-style: none;
}

.event-calendar-menu summary::-webkit-details-marker {
  display: none;
}

.event-calendar-menu-row {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 34px;
}

.event-calendar-menu-row[open] {
  z-index: 20;
}

.event-calendar-tab {
  display: flex;
  width: 34px;
  height: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0 6px 6px 0;
  background: var(--accent);
  box-shadow: 4px 0 14px rgba(63, 38, 87, 0.18);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0.72;
  text-transform: uppercase;
  transform: translateX(-24px);
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease,
    transform 0.16s ease;
}

.event-calendar-tab span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.event-row:hover .event-calendar-tab,
.event-row:focus-within .event-calendar-tab,
.event-calendar-menu-row[open] .event-calendar-tab {
  opacity: 1;
  transform: translateX(0);
}

.event-calendar-tab:hover,
.event-calendar-tab:focus-visible {
  background: var(--accent-dark);
  box-shadow: 4px 0 16px rgba(63, 38, 87, 0.24);
}

.event-calendar-tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.event-calendar-panel {
  position: absolute;
  z-index: 30;
  display: grid;
  min-width: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(31, 24, 41, 0.18);
  overflow: hidden;
}

.event-calendar-menu-row .event-calendar-panel {
  top: 8px;
  left: 42px;
}

.event-calendar-panel a,
.event-calendar-panel button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.1;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.event-calendar-panel a:last-child,
.event-calendar-panel button:last-child {
  border-bottom: 0;
}

.event-calendar-panel a:hover,
.event-calendar-panel a:focus-visible,
.event-calendar-panel button:hover,
.event-calendar-panel button:focus-visible {
  background: #f5effb;
  color: var(--accent-dark);
}

.map-popup-calendar-menu {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.map-popup-calendar-menu .event-calendar-panel {
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
}

.event-title {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.event-description {
  max-width: 420px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.category-tag {
  border: 1px solid #d9cce6;
  border-radius: 999px;
  background: #f5effb;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
}

.source-link {
  color: var(--accent);
  font-weight: 800;
}

.source-cell {
  vertical-align: top;
}

.source-cell-content {
  display: flex;
  min-height: 74px;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

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

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-intro-row {
    flex-direction: column;
  }

  .data-intro-row .compact-select-label {
    width: 100%;
  }

  .embed-map-heading {
    justify-content: flex-start;
    width: 100%;
  }

  .calendar-heading {
    align-items: flex-start;
  }

  .calendar-actions {
    justify-content: flex-start;
  }

  .embed-heading {
    align-items: flex-start;
  }

  .filter-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-summary {
    justify-content: flex-start;
    text-align: left;
  }

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

  .data-details-grid {
    grid-template-columns: 1fr;
  }

  .data-export-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .submission-intro {
    grid-template-columns: 1fr;
  }

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

@media (hover: none) {
  .event-calendar-tab {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 20px, 1180px);
  }

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

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

  .export-menu-panel {
    left: 0;
    right: auto;
  }

  .calendar-page main {
    width: min(100% - 20px, 1280px);
  }

  .calendar-actions {
    width: 100%;
  }

  .organization-heading,
  .submission-heading {
    align-items: flex-start;
  }

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

  .calendar-actions .button {
    width: 100%;
  }

  .embed-heading .button,
  .embed-heading .copy-action {
    width: 100%;
  }

  .calendar-embed-shell,
  .calendar-frame {
    min-height: 560px;
  }
}

@media print {
  .filters,
  .map-section,
  .site-footer,
  .top-actions,
  .source-link {
    display: none;
  }

  .event-calendar-menu {
    display: none;
  }

  th:first-child,
  .event-date-cell {
    padding-left: 16px;
  }

  body {
    background: #ffffff;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .events-shell {
    border: 0;
  }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 18px 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
}

.copyright {
  flex-basis: 100%;
  text-align: center;
}

@media print {
  .site-footer {
    display: none;
  }
}
