:root {
  --ink: #131a22;
  --muted: #5c6873;
  --line: rgba(19, 26, 34, 0.12);
  --panel: rgba(255, 255, 255, 0.75);
  --panel-strong: rgba(255, 255, 255, 0.86);
  --accent: #0d8a7b;
  --accent-2: #f07a28;
  --accent-3: #2f63d8;
  --shadow: 0 20px 50px rgba(12, 18, 24, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #d7e8f3;
}

.app-shell {
  width: 100%;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero {
  position: absolute;
  z-index: 800;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68)),
    linear-gradient(90deg, rgba(13, 138, 123, 0.03), rgba(240, 122, 40, 0.03));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.02;
  font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2.3rem);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 62ch;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-card {
  min-width: 120px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.stat-card span {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.05;
}

.stat-card small {
  color: var(--muted);
}

.stat-card.stat-action {
  min-width: 150px;
  align-content: start;
}

.stat-card.stat-action .ghost-btn {
  width: 100%;
  justify-self: stretch;
  font-weight: 600;
}

.stat-card.stat-action .ghost-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.layout {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  margin-top: 0;
}

.controls-panel,
.map-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.controls-panel {
  position: absolute;
  z-index: 700;
  top: 146px;
  left: 14px;
  width: min(350px, calc(100% - 28px));
  padding: 14px;
  overflow: auto;
  max-height: calc(100vh - 160px);
  background: rgba(255, 255, 255, 0.8);
}

.panel-section + .panel-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.panel-section h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.helper-text {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ghost-btn,
.quick-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.ghost-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.quick-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
}

.quick-btn:hover,
.ghost-btn:hover {
  border-color: rgba(13, 138, 123, 0.35);
  background: rgba(255, 255, 255, 0.94);
}

.toggle-stack {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  padding: 8px 10px;
  color: #38424c;
  font-size: 13px;
}

.toggle-row input {
  accent-color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.timeline-strip {
  margin-top: 10px;
  height: 68px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 244, 238, 0.92)),
    repeating-linear-gradient(
      90deg,
      rgba(19, 26, 34, 0.04) 0,
      rgba(19, 26, 34, 0.04) 1px,
      transparent 1px,
      transparent 14px
    );
  overflow: hidden;
  position: relative;
  cursor: ew-resize;
}

.timeline-strip:focus-visible {
  outline: 2px solid rgba(13, 138, 123, 0.5);
  outline-offset: 2px;
}

.timeline-bubble {
  position: absolute;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.76;
}

.timeline-marker {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent), var(--accent), transparent);
  box-shadow: 0 0 0 1px rgba(13, 138, 123, 0.08);
}

.timeline-window {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(13, 138, 123, 0.22);
  border-right: 1px solid rgba(13, 138, 123, 0.22);
  background: rgba(13, 138, 123, 0.08);
}

.range-label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.chip-grid {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--dot, var(--muted));
}

.chip.is-region::before {
  background: transparent;
  border: 1px solid rgba(19, 26, 34, 0.2);
}

.chip.is-off {
  opacity: 0.45;
}

.map-and-list {
  position: relative;
  min-height: 100vh;
  height: 100vh;
}

.map-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  min-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: 0;
  position: relative;
}

.map-style-float {
  position: absolute;
  top: 146px;
  left: 14px;
  z-index: 640;
}

.map-style-float-select {
  width: 170px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(8, 20, 28, 0.14);
}

.map-zoom-float {
  position: absolute;
  top: 146px;
  right: 14px;
  z-index: 640;
  display: grid;
  gap: 6px;
}

.map-zoom-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(19, 26, 34, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(8, 20, 28, 0.14);
  color: #14242e;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
}

.map-zoom-btn:hover,
.map-zoom-btn:focus-visible {
  outline: none;
  border-color: rgba(13, 138, 123, 0.32);
  background: rgba(255, 255, 255, 0.98);
}

.visible-events-toolbox {
  position: absolute;
  top: 192px;
  left: 14px;
  z-index: 640;
  width: 350px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 206px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(19, 26, 34, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 34px rgba(8, 20, 28, 0.12);
  overflow: hidden;
}

.visible-events-toolbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(19, 26, 34, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.visible-events-toolbox-head h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.visible-events-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(19, 26, 34, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.visible-events-listbox {
  overflow: auto;
  padding: 8px;
}

.visible-events-empty {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(19, 26, 34, 0.12);
}

.visible-events-category + .visible-events-category {
  margin-top: 10px;
}

.visible-events-category-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 700;
  color: #2b3a45;
}

.visible-events-category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.visible-events-category-count {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}

.visible-events-items {
  display: grid;
  gap: 6px;
}

.visible-event-item {
  width: 100%;
  border: 1px solid rgba(19, 26, 34, 0.1);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 8px 9px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.visible-event-item:hover,
.visible-event-item:focus-visible {
  border-color: rgba(13, 138, 123, 0.28);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

.visible-event-item.is-active {
  border-color: rgba(13, 138, 123, 0.38);
  box-shadow: inset 0 0 0 1px rgba(13, 138, 123, 0.18);
  background: rgba(239, 252, 249, 0.95);
}

.visible-event-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #14242e;
  line-height: 1.25;
  margin: 0 0 3px;
}

.visible-event-item-meta {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.map-toolbar {
  position: absolute;
  z-index: 650;
  left: 378px;
  right: 418px;
  top: 146px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.quick-range-switch {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scope-mode-switch {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.scope-mode-btn {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.scope-mode-btn:hover,
.scope-mode-btn:focus-visible {
  outline: none;
  border-color: rgba(13, 138, 123, 0.28);
  color: var(--ink);
}

.scope-mode-btn.is-active {
  color: var(--ink);
  background: rgba(239, 252, 249, 0.95);
  border-color: rgba(13, 138, 123, 0.35);
  box-shadow: inset 0 0 0 1px rgba(13, 138, 123, 0.12);
}

.quick-range-btn {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.quick-range-btn:hover,
.quick-range-btn:focus-visible {
  outline: none;
  border-color: rgba(13, 138, 123, 0.28);
  color: var(--ink);
}

.quick-range-btn.is-active {
  color: var(--ink);
  background: rgba(239, 252, 249, 0.95);
  border-color: rgba(13, 138, 123, 0.35);
  box-shadow: inset 0 0 0 1px rgba(13, 138, 123, 0.12);
}

.list-panel .map-toolbar {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: none;
}

.scope-note {
  margin: 6px 12px 2px;
  font-size: 11px;
  color: var(--muted);
}

.time-range-top {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.time-range-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.time-range-head strong {
  color: var(--ink);
  font-size: 12px;
}

#timeRangePresetLabel {
  color: var(--accent);
  font-weight: 700;
}

.time-range-top input[type="range"] {
  margin: 0;
}

.time-range-labels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}

.time-range-labels span {
  text-align: center;
}

.right-chip-grid {
  width: 100%;
  margin-top: 0;
  max-height: 120px;
  overflow: auto;
  padding-right: 2px;
}

.legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
}

.legend-item::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--legend-dot);
}

.toolbar-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: stretch;
  width: 100%;
}

.search-wrap input,
.sort-select {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  color: var(--ink);
  min-height: 36px;
}

.search-wrap input {
  width: 100%;
  padding: 7px 10px;
}

.sort-select {
  padding: 7px 10px;
  width: calc(50% - 3px);
  min-width: 0;
}

.search-wrap {
  width: 100%;
}

.search-wrap input:focus,
.sort-select:focus {
  outline: 2px solid rgba(13, 138, 123, 0.25);
  border-color: rgba(13, 138, 123, 0.35);
}

#map {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
}

.leaflet-container {
  background:
    radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.35), transparent 25%),
    linear-gradient(180deg, #dceaf5 0%, #c7ddea 100%);
  font-family: "IBM Plex Sans", sans-serif;
}

/* Basemap tuning for better event contrast */
.leaflet-container.map-style-dark .leaflet-tile {
  filter: brightness(1.78) contrast(0.74) saturate(1.22) hue-rotate(-10deg);
}

.leaflet-container.map-style-culture .leaflet-tile {
  filter: saturate(1.38) contrast(0.96) brightness(0.98) hue-rotate(-12deg);
}

.leaflet-container.map-style-soft .leaflet-tile {
  filter: brightness(0.98) contrast(0.95) saturate(1.05) hue-rotate(-8deg);
}

.leaflet-container.map-style-lightmono .leaflet-tile {
  filter: brightness(1.03) contrast(0.9) saturate(0.82) hue-rotate(-10deg);
}

/* Extra readability on roads/labels by lightening the whole tile stack slightly */
.leaflet-container .leaflet-tile-pane {
  opacity: 0.98;
}

.leaflet-control-zoom a {
  border-radius: 10px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.94);
}

.leaflet-popup-content {
  margin: 10px 12px;
}

.event-map-label {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.event-map-label span {
  display: inline-block;
  max-width: 180px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #121820;
  border: 1px solid rgba(18, 24, 32, 0.18);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-dot-symbol-wrap {
  background: transparent;
  border: 0;
  --symbol-scale: 1;
  width: 180px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.event-dot-symbol-wrap.is-urgent .event-dot-symbol {
  animation: urgentPulse 1s ease-in-out infinite;
}

.event-dot-title {
  display: none;
  max-width: 148px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #121820;
  border: 1px solid rgba(18, 24, 32, 0.16);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-dot-symbol-wrap.show-title .event-dot-title {
  display: inline-block;
}

.venue-bubble-wrap {
  background: transparent;
  border: 0;
}

.venue-bubble-shell {
  position: relative;
  width: 250px;
  min-height: 28px;
  pointer-events: auto;
}

.venue-bubble-shell.single-mini {
  width: 220px;
}

.venue-bubble-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #07141c;
  background: color-mix(in srgb, var(--vb-color, #0ea5b7) 88%, white 12%);
  border: 2px solid rgba(7, 20, 28, 0.9);
  box-shadow: 0 4px 12px rgba(8, 20, 28, 0.22);
  z-index: 3;
}

.venue-bubble-shell.is-left .venue-bubble-anchor {
  left: auto;
  right: 0;
}

.venue-bubble-shell.single-mini .venue-bubble-anchor {
  font-size: 13px;
}

.venue-bubble-panel {
  position: absolute;
  left: var(--vb-panel-x, 42px);
  top: var(--vb-shift-y, 0px);
  min-width: 150px;
  max-width: 210px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 22, 30, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 10px 26px rgba(8, 20, 28, 0.18);
  backdrop-filter: blur(8px);
  transform-origin: left center;
  z-index: 2;
}

.venue-bubble-shell.is-left .venue-bubble-panel {
  left: auto;
  right: var(--vb-panel-x, 42px);
  transform-origin: right center;
}

.venue-bubble-shell.single-mini .venue-bubble-panel {
  padding: 5px 8px;
  min-width: 120px;
  max-width: 200px;
}

.single-mini-wrap .venue-bubble-row {
  margin-top: 0;
}

.single-mini-wrap .venue-bubble-row-btn {
  padding: 1px 0;
}

.venue-bubble-shell.is-enter .venue-bubble-panel {
  animation: venueBubbleIn 180ms ease-out;
}

.venue-bubble-shell::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: var(--vb-line-w, 14px);
  height: 2px;
  background: rgba(14, 22, 30, 0.22);
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
  transform-origin: left center;
  transform: translateY(-1px) rotate(var(--vb-line-angle, 0deg));
}

.venue-bubble-shell.is-left::after {
  left: auto;
  right: 14px;
  transform-origin: right center;
}

.venue-bubble-head {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  margin-bottom: 6px;
  color: #121d24;
}

.venue-bubble-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
  color: #2b3a45;
  margin-top: 3px;
}

.venue-bubble-row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 2px 0;
  border-radius: 6px;
  cursor: pointer;
}

.venue-bubble-row-btn:hover,
.venue-bubble-row-btn:focus-visible {
  background: rgba(13, 138, 123, 0.08);
  outline: none;
}

.venue-bubble-row-btn.is-urgent {
  animation: urgentRowBlink 1.1s ease-in-out infinite;
  border-left: 2px solid rgba(214, 80, 44, 0.75);
  padding-left: 4px;
}

.venue-bubble-row-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venue-bubble-row-time {
  font-size: 10px;
  color: #4e6472;
  margin-left: 4px;
}

.venue-bubble-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.venue-bubble-more {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #0d7d74;
}

@keyframes venueBubbleIn {
  from {
    opacity: 0;
    transform: translateX(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes urgentPulse {
  0%, 100% {
    transform: scale(var(--symbol-scale, 1));
    filter: drop-shadow(0 0 0 rgba(214, 80, 44, 0));
  }
  50% {
    transform: scale(calc(var(--symbol-scale, 1) * 1.18));
    filter: drop-shadow(0 0 6px rgba(214, 80, 44, 0.75));
  }
}

@keyframes urgentRowBlink {
  0%, 100% { background: rgba(214, 80, 44, 0.04); }
  50% { background: rgba(214, 80, 44, 0.16); }
}

.event-cluster-wrap {
  background: transparent;
  border: 0;
  width: 230px;
  height: 42px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;
}

.event-cluster-dot {
  pointer-events: auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cluster-color, #0ea5b7) 88%, white 12%);
  color: #07141c;
  border: 2px solid rgba(7, 20, 28, 0.9);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(8, 20, 28, 0.24);
  user-select: none;
}

.event-cluster-preview {
  display: none;
  margin-top: -2px;
  min-width: 120px;
  max-width: 180px;
  padding: 4px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(18, 24, 32, 0.16);
  box-shadow: 0 4px 12px rgba(8, 20, 28, 0.12);
  pointer-events: none;
}

.event-cluster-wrap.show-preview .event-cluster-preview {
  display: block;
}

.event-cluster-preview-line {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: #15222b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-cluster-preview-line + .event-cluster-preview-line {
  margin-top: 2px;
}

.event-cluster-preview-more {
  margin-top: 3px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #0d7d74;
}

.event-dot-symbol {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #101820;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  pointer-events: none;
  user-select: none;
  transform: scale(var(--symbol-scale, 1));
  transform-origin: center;
  transition: transform 140ms ease, opacity 140ms ease;
}

.leaflet-container.map-style-dark .event-dot-symbol {
  color: #f7fbff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.leaflet-container.map-style-dark .event-dot-title {
  background: rgba(17, 22, 28, 0.92);
  color: #eef3f7;
  border-color: rgba(255, 255, 255, 0.16);
}

.leaflet-container.map-style-dark .venue-bubble-panel {
  background: rgba(17, 22, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
}

.leaflet-container.map-style-dark .venue-bubble-shell::after {
  background: rgba(255, 255, 255, 0.18);
}

.leaflet-container.map-style-dark .venue-bubble-head {
  color: #eff5fa;
}

.leaflet-container.map-style-dark .venue-bubble-row {
  color: #cfe0ea;
}

.leaflet-container.map-style-dark .venue-bubble-row-btn:hover,
.leaflet-container.map-style-dark .venue-bubble-row-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.leaflet-container.map-style-dark .venue-bubble-row-btn.is-urgent {
  border-left-color: rgba(255, 138, 104, 0.95);
}

.leaflet-container.map-style-dark .venue-bubble-row-time {
  color: #9fb8c7;
}

.leaflet-container.map-style-dark .event-cluster-dot {
  color: #f5fbff;
  border-color: rgba(233, 247, 255, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.leaflet-container.map-style-dark .event-cluster-preview {
  background: rgba(17, 22, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
}

.leaflet-container.map-style-dark .event-cluster-preview-line {
  color: #e6f0f5;
}

.leaflet-container.map-style-dark .event-map-label span {
  background: rgba(17, 22, 28, 0.92);
  color: #eef3f7;
  border-color: rgba(255, 255, 255, 0.18);
}

.popup-card h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.popup-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.map-hud {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.hud-pill {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: white;
  background: rgba(18, 24, 30, 0.72);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.list-panel {
  position: absolute;
  z-index: 700;
  top: 206px;
  right: 14px;
  bottom: 14px;
  width: min(390px, calc(100% - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
}

.list-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
}

.list-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.list-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.event-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 11px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  text-align: left;
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(13, 138, 123, 0.35);
  box-shadow: 0 10px 24px rgba(12, 18, 24, 0.08);
  outline: none;
}

.event-card.active {
  border-color: rgba(13, 138, 123, 0.7);
  box-shadow: 0 0 0 2px rgba(13, 138, 123, 0.12) inset;
}

.event-card.is-urgent {
  box-shadow: 0 0 0 1px rgba(214, 80, 44, 0.35), 0 8px 20px rgba(214, 80, 44, 0.12);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.event-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
  line-height: 1.15;
}

.event-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.event-meta {
  margin-top: 7px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.event-countdown {
  font-size: 11px;
  font-weight: 700;
  color: #245f73;
}

.event-countdown.is-urgent {
  color: #bf3f24;
  animation: urgentRowBlink 1.1s ease-in-out infinite;
}

.event-meta strong {
  color: #27313a;
  font-weight: 600;
}

.event-desc {
  margin: 8px 0 0;
  color: #414b55;
  font-size: 12px;
  line-height: 1.35;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
}

.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;
}

@media (max-width: 1220px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .hero {
    position: static;
    margin: 14px 14px 0;
    left: auto;
    right: auto;
    top: auto;
  }

  .layout {
    min-height: auto;
    height: auto;
  }

  .controls-panel {
    position: static;
    width: auto;
    max-height: none;
  }

  .map-and-list {
    min-height: auto;
    height: auto;
  }

  .map-panel {
    grid-template-rows: auto minmax(420px, 1fr);
    min-height: auto;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
  }

  .map-style-float {
    top: 10px;
    left: 10px;
  }

  .map-style-float-select {
    width: 150px;
  }

  .map-zoom-float {
    top: 10px;
    right: 10px;
  }

  .visible-events-toolbox {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    width: auto;
    max-width: none;
    max-height: 240px;
    margin-top: 48px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    backdrop-filter: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.45);
  }

  .map-toolbar {
    position: static;
    right: auto;
    top: auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.4);
  }

  .list-panel {
    position: static;
    width: auto;
    top: auto;
    right: auto;
    bottom: auto;
    min-height: 360px;
  }

  #map {
    min-height: 560px;
    height: 560px;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .hero {
    margin: 12px 12px 0;
    padding: 14px;
    flex-direction: column;
  }

  .hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-card {
    min-width: 0;
  }

  .map-toolbar {
    align-items: stretch;
  }

  .visible-events-toolbox {
    margin-top: 52px;
    max-height: 210px;
  }

  .toolbar-right {
    width: 100%;
  }

  .search-wrap {
    flex: 1 1 100%;
  }

  .search-wrap input {
    width: 100%;
  }

  .sort-select {
    width: 100%;
    border-radius: 12px;
  }

  #map {
    min-height: 430px;
    height: 430px;
  }
}

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

  .event-card {
    transition: none;
  }
}

.cluster-hover-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(8, 20, 28, 0.22);
}

.cluster-hover-popup .leaflet-popup-content {
  margin: 8px 10px;
}

.cluster-hover-popup .leaflet-popup-tip-container {
  display: none;
}

.cluster-hover-card {
  min-width: 180px;
  max-width: 240px;
}

.cluster-hover-head {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  color: #122029;
}

.cluster-hover-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 3px;
  color: #2b3a45;
}

.cluster-hover-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.cluster-hover-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cluster-hover-time {
  color: #516675;
  font-size: 10px;
}

.cluster-hover-more {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #0d7d74;
}

.leaflet-container.map-style-dark .cluster-hover-popup .leaflet-popup-content-wrapper {
  background: rgba(17, 22, 28, 0.94);
}

.leaflet-container.map-style-dark .cluster-hover-head {
  color: #eff5fa;
}

.leaflet-container.map-style-dark .cluster-hover-row {
  color: #d0e0ea;
}

.leaflet-container.map-style-dark .cluster-hover-time {
  color: #9fb8c7;
}
