:root {
  --ink: #21181a;
  --muted: #706165;
  --forest: #b5121b;
  --forest-dark: #7f0f17;
  --moss: #d9c0b1;
  --brick: #d71920;
  --gold: #f0b24d;
  --canvas: #f6f1ee;
  --paper: #ffffff;
  --line: #e6d7d2;
  --shadow: 0 12px 30px rgba(89, 19, 25, 0.14);
  --header-height: 72px;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.brand strong {
  font-family: "Manrope", sans-serif;
  letter-spacing: 0;
}

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 clamp(20px, 3.5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 251, 250, 0.98);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
}

.brand__mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #d71920, #870f17);
  color: #fff;
  font: 800 13px/1 "Manrope", sans-serif;
}

.brand__copy {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.site-nav {
  display: flex;
  align-self: stretch;
  gap: 32px;
}

.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--ink);
}

.site-nav__link--active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brick);
  content: "";
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button--outline {
  border-color: var(--forest);
  background: #fff;
  color: var(--forest);
}

.button--outline:hover {
  background: var(--forest);
  color: #fff;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
  padding: 27px clamp(20px, 3.5vw, 56px) 24px;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.06), rgba(127, 15, 23, 0.02)),
    #fff;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--brick);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-band h1 {
  margin-bottom: 0;
  font-size: clamp(31px, 3vw, 48px);
  line-height: 1.05;
}

.intro-band__copy {
  max-width: 520px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.live-count {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 8px;
  min-width: 104px;
  align-items: center;
  padding-left: 21px;
  border-left: 1px solid var(--line);
}

.live-count__dot {
  grid-row: span 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brick);
  box-shadow: 0 0 0 4px rgba(182, 79, 53, 0.13);
}

.live-count strong {
  font: 800 22px/1 "Manrope", sans-serif;
}

.live-count span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.72fr) minmax(150px, 0.72fr) minmax(190px, 1fr) minmax(190px, 0.92fr) 42px;
  gap: 12px;
  align-items: end;
  padding: 13px clamp(20px, 3.5vw, 56px) 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbf7f5;
}

.filter-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.filter-field > span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.input-with-icon {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 11px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--forest);
  pointer-events: none;
}

.input-with-icon input,
.input-with-icon select,
.sort-control select {
  width: 100%;
  height: 39px;
  padding: 0 30px 0 36px;
  border: 1px solid #cfd7d1;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.input-with-icon input:focus,
.input-with-icon select:focus,
.sort-control select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.12);
}

.filter-field--search input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

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

.icon-button svg {
  width: 18px;
  height: 18px;
}

.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(370px, 0.85fr);
  min-height: 610px;
  height: calc(100vh - 271px);
  max-height: 780px;
  background: #fff;
}

.map-shell {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: #dce7e1;
}

.leaflet-container {
  font-family: "DM Sans", sans-serif;
}

.leaflet-control-attribution {
  font-size: 9px;
}

.event-marker {
  position: relative;
  width: 28px;
  height: 36px;
  filter: drop-shadow(0 4px 5px rgba(20, 33, 25, 0.3));
  transition: transform 160ms ease;
}

.event-marker::before {
  position: absolute;
  top: 0;
  left: 1px;
  width: 26px;
  height: 26px;
  transform: rotate(45deg);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 3px;
  background: var(--forest);
  content: "";
}

.event-marker::after {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.event-marker--hot::before {
  background: var(--brick);
}

.event-marker--active {
  transform: scale(1.25) translateY(-3px);
}

.map-key {
  position: absolute;
  z-index: 500;
  right: 16px;
  bottom: 22px;
  display: flex;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(22, 44, 32, 0.14);
  color: var(--muted);
  font-size: 10px;
  backdrop-filter: blur(8px);
}

.map-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-key__marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--forest);
}

.map-key__marker--hot {
  background: var(--brick);
}

.map-control {
  position: absolute;
  z-index: 500;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(22, 44, 32, 0.2);
  color: var(--ink);
  cursor: pointer;
}

.map-control--locate {
  top: 62px;
}

.map-control--active {
  border-color: var(--forest);
  background: #edf5ef;
  color: var(--forest);
}

.map-control--loading svg {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.user-location-marker {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2e79d0;
  box-shadow: 0 0 0 5px rgba(46, 121, 208, 0.2), 0 2px 7px rgba(20, 41, 60, 0.35);
}

.user-location-marker span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.map-control svg {
  width: 17px;
  height: 17px;
}

.event-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.event-panel__heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.event-panel__heading .eyebrow {
  margin-bottom: 4px;
}

.event-panel__heading h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.sort-control select {
  width: 185px;
  height: 35px;
  padding: 0 24px 0 10px;
  font-size: 11px;
}

.event-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #bdc9c0 transparent;
  scrollbar-width: thin;
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  min-height: 126px;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: #fff;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.event-card:hover,
.event-card:focus,
.event-card--active {
  z-index: 1;
  background: #fff7f6;
  box-shadow: inset 4px 0 0 var(--brick);
}

.event-card__media {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  background: #dfe6e1;
}

.event-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.event-card:hover .event-card__media img {
  transform: scale(1.035);
}

.event-card__category {
  position: absolute;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  padding: 5px 7px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(23, 36, 30, 0.87);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.event-card__body {
  display: grid;
  grid-template-columns: 67px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 17px 16px;
}

.event-card__date {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 5px;
  align-items: center;
  color: var(--brick);
}

.event-card__date > small {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-card__day {
  font: 800 27px/1 "Manrope", sans-serif;
}

.event-card__date > span:last-child {
  display: flex;
  flex-direction: column;
}

.event-card__month {
  font-size: 9px;
  text-transform: uppercase;
}

.event-card__time {
  color: var(--muted);
  font-size: 9px;
}

.event-card__info {
  min-width: 0;
}

.event-card__info h3 {
  display: -webkit-box;
  margin-bottom: 8px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-card__info p {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.event-card__info .event-card__end {
  margin-top: 6px;
  color: #4c5b53;
}

.event-card__info svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: var(--forest);
}

.event-card__place {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card__rating {
  color: var(--gold);
  font-size: 9px;
  white-space: nowrap;
}

.event-skeleton {
  height: 126px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, #f2f4f2 30%, #fafbfa 50%, #f2f4f2 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to { background-position-x: -200%; }
}

.empty-state,
.error-state {
  display: grid;
  min-height: 240px;
  padding: 30px;
  place-content: center;
  text-align: center;
}

.empty-state svg,
.error-state svg {
  width: 26px;
  height: 26px;
  margin: 0 auto 12px;
  color: var(--brick);
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Manrope", sans-serif;
}

.empty-state p,
.error-state p {
  max-width: 270px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.territory-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 58px clamp(20px, 7vw, 110px);
  background: var(--forest-dark);
  color: #fff;
}

.territory-band h2 {
  max-width: 600px;
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 40px);
}

.territory-band .eyebrow {
  color: #e4bd6b;
}

.territory-stats {
  display: flex;
  gap: clamp(25px, 4vw, 58px);
}

.territory-stats span {
  display: flex;
  flex-direction: column;
  color: #b8cabf;
  font-size: 11px;
}

.territory-stats strong {
  margin-bottom: 3px;
  color: #fff;
  font: 800 29px/1 "Manrope", sans-serif;
}

.event-dialog {
  width: min(580px, calc(100vw - 30px));
  max-height: min(760px, calc(100vh - 30px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 7px;
  box-shadow: 0 24px 70px rgba(10, 29, 18, 0.32);
}

.event-dialog::backdrop {
  background: rgba(15, 28, 21, 0.7);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.93);
}

#dialog-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #dfe6e1;
}

.event-dialog__content {
  padding: 25px 28px 30px;
}

.dialog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--brick);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

#dialog-popularity {
  color: var(--gold);
}

.event-dialog h2 {
  margin-bottom: 9px;
  font-size: 25px;
  line-height: 1.22;
}

.dialog-summary {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dialog-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialog-facts div {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
}

.dialog-facts div > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.dialog-facts div small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.dialog-facts div strong {
  font-size: 11px;
  line-height: 1.35;
}

.dialog-facts__place {
  grid-column: 1 / -1;
}

.dialog-facts svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--forest);
}

.dialog-description {
  margin: 19px 0 22px;
  color: #4f5b55;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  gap: 9px;
}

.dialog-actions .button:first-child {
  background: var(--forest);
  color: #fff;
}

.dialog-actions .button:last-child {
  border-color: var(--line);
}

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

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

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

  .intro-band__copy {
    display: none;
  }

  .filters {
    grid-template-columns: repeat(5, minmax(150px, 1fr)) 42px;
    overflow-x: auto;
  }

  .filter-field {
    min-width: 150px;
  }

  .explorer {
    grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  }

  .event-card {
    grid-template-columns: 106px minmax(0, 1fr);
  }

  .event-card__body {
    grid-template-columns: 67px minmax(0, 1fr);
  }

  .event-card__rating {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .site-header {
    padding: 0 14px;
  }

  .brand__copy small {
    display: none;
  }

  .brand__mark {
    width: 35px;
    height: 35px;
  }

  .intro-band {
    gap: 12px;
    padding: 19px 16px 17px;
  }

  .intro-band h1 {
    font-size: 29px;
  }

  .intro-band .eyebrow {
    font-size: 9px;
  }

  .live-count {
    min-width: auto;
    padding-left: 13px;
  }

  .live-count strong {
    font-size: 18px;
  }

  .live-count span:last-child {
    max-width: 50px;
    line-height: 1.15;
  }

  .filters {
    grid-template-columns: 145px 145px 180px 180px 40px;
    padding: 11px 16px 12px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .explorer {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .map-shell {
    height: min(47vh, 410px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #map {
    min-height: 0;
  }

  .map-key {
    right: 10px;
    bottom: 12px;
  }

  .event-panel {
    overflow: visible;
  }

  .event-panel__heading {
    min-height: 76px;
    padding: 13px 16px;
  }

  .event-list {
    max-height: none;
    overflow: visible;
  }

  .event-card {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .event-card__body {
    padding: 15px 13px;
  }

  .territory-band {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }

  .territory-stats {
    justify-content: space-between;
  }

  #dialog-image {
    height: 210px;
  }

  .event-dialog__content {
    padding: 21px 20px 25px;
  }

  .dialog-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .brand strong {
    font-size: 13px;
  }

  .intro-band h1 {
    font-size: 26px;
  }

  .event-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .event-card__body {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
  }

  .event-card__day {
    font-size: 23px;
  }

  .territory-stats {
    gap: 12px;
  }

  .territory-stats strong {
    font-size: 23px;
  }
}

/* Fixed map dashboard */
html,
body {
  height: 100%;
}

body {
  display: flex;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.site-header {
  position: relative;
  display: flex;
  flex: 0 0 var(--header-height);
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(91, 23, 28, 0.08);
}

.header-context {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.header-context > span {
  padding-right: 13px;
  border-right: 1px solid var(--line);
}

.header-context strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--forest);
  font-size: 11px;
}

.header-context svg {
  width: 15px;
  height: 15px;
}

main#esplora {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.intro-band {
  flex: 0 0 auto;
  padding-top: 16px;
  padding-bottom: 16px;
}

.intro-band h1 {
  font-size: clamp(29px, 2.5vw, 39px);
}

.filters {
  position: relative;
  z-index: 700;
  flex: 0 0 auto;
}

.checkbox-select {
  position: relative;
  min-width: 0;
}

.checkbox-select__button {
  display: grid;
  width: 100%;
  height: 39px;
  grid-template-columns: 17px minmax(0, 1fr) 15px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid #cfd7d1;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.checkbox-select__button:hover,
.checkbox-select__button:focus,
.checkbox-select__button--active {
  border-color: var(--forest);
}

.checkbox-select__button:focus {
  box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.12);
}

.checkbox-select__button > svg:first-child {
  width: 16px;
  height: 16px;
  color: var(--forest);
}

.checkbox-select__button > svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 150ms ease;
}

.checkbox-select__button[aria-expanded="true"] > svg:last-child {
  transform: rotate(180deg);
}

.checkbox-select__button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-select__menu {
  position: fixed;
  z-index: 1600;
  max-height: min(320px, calc(100vh - 90px));
  padding: 7px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(22, 44, 32, 0.2);
}

.checkbox-select__menu[hidden] {
  display: none;
}

.checkbox-option {
  position: relative;
  display: grid;
  min-height: 38px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-option:hover {
  background: #fdf1f1;
}

.checkbox-option input {
  position: absolute;
  opacity: 0;
}

.checkbox-option__box {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1px solid #aebbb2;
  border-radius: 3px;
  background: #fff;
}

.checkbox-option input:checked + .checkbox-option__box {
  border-color: var(--forest);
  background: var(--forest);
}

.checkbox-option input:checked + .checkbox-option__box::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  transform: rotate(45deg);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
}

.checkbox-option input:focus-visible + .checkbox-option__box {
  box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.16);
}

.explorer {
  --event-drawer-width: min(430px, calc(100vw - 44px));
  position: relative;
  display: block;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 1;
  overflow: hidden;
}

.map-shell {
  position: absolute;
  inset: 0;
  border: 0;
  transition: right 220ms ease;
}

.explorer--panel-open .map-shell {
  right: var(--event-drawer-width);
}

#map {
  min-height: 0;
}

.map-status {
  position: absolute;
  z-index: 520;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 11px;
  transition: opacity 180ms ease;
}

.map-status span {
  width: 13px;
  height: 13px;
  border: 2px solid #b9c7bd;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.map-status--hidden {
  opacity: 0;
  pointer-events: none;
}

.map-status--error {
  color: var(--danger, #a53d31);
}

.event-marker {
  --marker-color: #53625a;
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  overflow: visible;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 2px var(--marker-color), 0 7px 16px rgba(21, 44, 31, 0.3);
  color: #fff;
  filter: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.event-marker__icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}

.event-marker__icon svg {
  width: 17px;
  height: 17px;
  max-width: 17px;
  max-height: 17px;
  stroke-width: 2.4;
}

.event-marker::before {
  position: absolute;
  top: auto;
  bottom: -12px;
  left: 13px;
  width: 8px;
  height: 8px;
  transform: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 2px 4px rgba(21, 44, 31, 0.25);
  content: "";
}

.event-marker::after {
  display: none;
}

.event-marker--concerto { --marker-color: #b64f35; }
.event-marker--sagra { --marker-color: #c07b25; }
.event-marker--trekking { --marker-color: #2f7650; }
.event-marker--festival { --marker-color: #74539a; }
.event-marker--teatro { --marker-color: #8b405e; }
.event-marker--mostra { --marker-color: #39718c; }
.event-marker--mercato { --marker-color: #a76432; }
.event-marker--sport { --marker-color: #2878a3; }
.event-marker--famiglie { --marker-color: #b95b7c; }
.event-marker--altro { --marker-color: #596760; }

.event-marker--active {
  z-index: 2;
  transform: scale(1.18) translateY(-4px);
  box-shadow: 0 0 0 4px var(--gold), 0 10px 22px rgba(21, 44, 31, 0.4);
}

.event-marker-tooltip {
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 7px 18px rgba(21, 44, 31, 0.2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.map-control {
  top: 16px;
}

.map-control--locate {
  top: 62px;
}

.event-drawer-toggle {
  position: absolute;
  z-index: 660;
  top: 50%;
  right: 0;
  display: flex;
  width: 42px;
  height: 68px;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  box-shadow: -5px 4px 15px rgba(22, 44, 32, 0.15);
  color: var(--forest);
  cursor: pointer;
  transition: right 220ms ease, background 150ms ease;
}

.event-drawer-toggle[aria-expanded="true"] {
  right: var(--event-drawer-width);
}

.event-drawer-toggle:hover {
  background: #fff0f0;
}

.event-drawer-toggle svg {
  width: 18px;
  height: 18px;
}

.event-drawer-toggle__close {
  display: none;
}

.event-drawer-toggle[aria-expanded="true"] .event-drawer-toggle__close {
  display: block;
}

.event-drawer-toggle[aria-expanded="true"] .event-drawer-toggle__open {
  display: none;
}

.event-drawer-toggle strong {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 10px;
  background: var(--brick);
  color: #fff;
  font-size: 9px;
}

.event-panel {
  position: absolute;
  z-index: 650;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--event-drawer-width);
  min-width: 0;
  transform: translateX(102%);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 35px rgba(23, 48, 33, 0.16);
  visibility: hidden;
  transition: transform 220ms ease, visibility 220ms ease;
}

.event-panel--open {
  transform: translateX(0);
  visibility: visible;
}

.event-panel__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.event-panel__actions .icon-button {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
}

.site-footer {
  display: flex;
  min-height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(16px, 3.5vw, 56px);
  background: var(--forest-dark);
  color: #bcd0c3;
  font-size: 9px;
}

.site-footer strong {
  color: #fff;
  font-family: "Manrope", sans-serif;
}

@media (max-width: 760px) {
  .header-context > span {
    display: none;
  }

  .header-context {
    gap: 0;
  }

  .intro-band {
    padding: 10px 16px;
  }

  .intro-band h1 {
    font-size: 25px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
    gap: 8px;
    padding: 9px 12px 10px;
    overflow: visible;
  }

  .filter-field {
    min-width: 0;
  }

  .filter-field--search { grid-column: 1 / span 2; grid-row: 1; }
  .filter-field--date:nth-child(2) { grid-column: 1; grid-row: 2; }
  .filter-field--date:nth-child(3) { grid-column: 2; grid-row: 2; }
  .filter-field--category { grid-column: 1; grid-row: 3; }
  .filter-field--category + .filter-field { grid-column: 2; grid-row: 3; }
  #reset-filters { grid-column: 3; grid-row: 1 / span 3; align-self: end; }

  .input-with-icon input,
  .input-with-icon select,
  .checkbox-select__button,
  .sort-control select {
    font-size: 16px;
  }

  .checkbox-select__menu {
    top: auto !important;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px !important;
    width: auto !important;
    max-height: min(60dvh, 430px);
    padding: 10px;
    border-radius: 12px;
  }

  .checkbox-option {
    min-height: 46px;
    font-size: 15px;
  }

  .explorer {
    --event-drawer-width: calc(100vw - 18px);
  }

  .explorer,
  .map-shell {
    height: auto;
    min-height: 0;
  }

  .map-shell {
    border: 0;
  }

  .event-panel {
    width: calc(100vw - 18px);
    max-width: 430px;
    overflow: hidden;
  }

  .event-panel__heading {
    padding-left: 62px;
  }

  .event-drawer-toggle {
    top: auto;
    right: 12px;
    bottom: 14px;
    width: 50px;
    height: 50px;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(22, 44, 32, 0.24);
  }

  .event-drawer-toggle[aria-expanded="true"] {
    top: 13px;
    right: calc(var(--event-drawer-width) - 55px);
    bottom: auto;
    border-radius: 50%;
  }

  .map-control {
    width: 44px;
    height: 44px;
  }

  .map-control--locate {
    top: 68px;
  }

  .event-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .dialog-actions {
    flex-direction: column;
  }

  .event-list {
    max-height: none;
    overflow-y: auto;
  }

  .map-key {
    display: none;
  }

  .site-footer {
    min-height: 32px;
    flex-basis: 32px;
    justify-content: center;
  }

  .site-footer span:last-child {
    display: none;
  }
}

@media (max-width: 420px) {
  .header-context { display: none; }
  .intro-band { padding: 8px 12px; }
  .intro-band h1 { font-size: 22px; }
  .intro-band .eyebrow { margin-bottom: 3px; }
  .live-count { padding-left: 10px; }
  .filter-field > span:first-child { font-size: 9px; }
  .input-with-icon input,
  .input-with-icon select,
  .checkbox-select__button { padding-right: 7px; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .intro-band {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}
