:root {
  --bg: #f6f7f8;
  --card: #fff;
  --text: #1f2937;
  --muted: #667085;
  --line: #e5e7eb;
  --danger: #b42318;
  --warning: #f79009;
  --week: #fdb022;
  --season: #1570ef;
  --old: #98a2b3;
}

* { box-sizing: border-box; }

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

header {
  padding: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 12px;
  padding: 12px;
}

#map {
  width: 100%;
  height: calc(100vh - 124px);
  min-height: 620px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #ddd;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 8px rgba(16,24,40,.05);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
}

button.active {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  line-height: 1.6;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--old);
}

.legend .new::before { background: var(--danger); }
.legend .recent::before { background: var(--warning); }
.legend .week::before { background: var(--week); border: 1px solid #111827; }
.legend .season::before { background: var(--season); opacity: .55; }

.map-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.toggle-button {
  border-color: #d0d5dd;
  background: #f9fafb;
  color: #344054;
}

.toggle-button.active {
  border-color: #b42318;
  background: #fff4f3;
  color: #b42318;
  font-weight: 700;
}

.heat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 275px);
  overflow: auto;
}

.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.item:hover { border-color: #d0d5dd; }
.item.old { opacity: .56; }
.item.season { opacity: .78; border-style: dashed; }

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.badge {
  flex: 0 0 auto;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--old);
}

.badge.new { background: var(--danger); }
.badge.recent { background: var(--warning); }
.badge.week { background: var(--week); }
.badge.season { background: var(--season); }

.loc {
  color: #344054;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

.time, .body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.body {
  margin-top: 6px;
  white-space: pre-wrap;
  color: #344054;
}

.links {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.links a {
  color: #175cd3;
  text-decoration: none;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.custom-marker {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 4px solid #fff;
  outline: 2px solid rgba(0,0,0,.72);
  box-shadow:
    0 2px 10px rgba(0,0,0,.42),
    0 0 0 3px rgba(255,255,255,.25);
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.custom-marker span {
  display: block;
  font-size: 13px;
  line-height: 1;
  transform: translateX(-0.04em);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.custom-marker.new {
  width: 40px;
  height: 40px;
  background: var(--danger);
  border-width: 5px;
  outline-color: rgba(180,35,24,.95);
  animation: markerPulse 1.8s ease-out infinite;
}

.custom-marker.new span {
  font-size: 16px;
}

.custom-marker.recent {
  width: 34px;
  height: 34px;
  background: var(--warning);
  color: #111827;
  outline-color: rgba(17,24,39,.85);
}

.custom-marker.recent span,
.custom-marker.week span {
  text-shadow: none;
}

.custom-marker.week {
  width: 31px;
  height: 31px;
  background: var(--week);
  color: #111827;
  outline-color: rgba(17,24,39,.75);
}

.custom-marker.season {
  width: 25px;
  height: 25px;
  background: var(--season);
  color: #fff;
  border-width: 3px;
  outline-color: rgba(21,112,239,.9);
  box-shadow:
    0 2px 8px rgba(0,0,0,.32),
    0 0 0 3px rgba(21,112,239,.22);
}

.custom-marker.season span {
  font-size: 12px;
}

.custom-marker.old {
  width: 23px;
  height: 23px;
  background: #667085;
  color: #fff;
  border-width: 3px;
  outline-color: rgba(71,84,103,.75);
}

.custom-marker.old span {
  font-size: 11px;
}

@keyframes markerPulse {
  0% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 0 rgba(180,35,24,.50);
  }
  72% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 13px rgba(180,35,24,0);
  }
  100% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 0 rgba(180,35,24,0);
  }
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(17,24,39,.35);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: #111827;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  font-weight: 800;
}


@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  #map { height: 58vh; min-height: 420px; }
  .list { max-height: none; }
}