:root {
  /* Light only. Paris street-sign blue as the accent, cool slate neutrals.
     Free, sold out, saved and special keep their own meaning colours. */
  --bg: #fcfcfb;
  --bg-soft: #f0f2f5;
  --text: #1a1f29;
  --muted: #5d6573;
  --border: #dde1e7;
  --accent: #24427a;
  --accent-text: #ffffff;
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.14);
  /* The map: warm paper land, white streets with faint edges, soft water and parks. */
  --land: #f1eee8;
  --street-major: #ffffff;
  --street-minor: #ffffff;
  --street-casing: #ddd6ca;
  --street-outer: #faf8f4;
  --water: #b3d6ec;
  --park: #d3e7c4;
  --boundary: #857d70;
  --map-text: #3a3f47;
  --star: #b7790f;
  --special: #0f766e;
  --free: #1d7a46;
  --sold: #b42318;
  --wait: #8a5a00;
  --g-music: #b5267a;
  --g-stage: #6b3fd1;
  --g-art: #0b7392;
  --g-kids: #b8730a;
  --g-learn: #4f7a1c;
  --g-outdoor: #1e8a57;
  --g-other: #24427a;
  --lm: #0b7f8a;
  --lm-text: #086670;
  --panel-width: 380px;
  color-scheme: light;
}

/* Light by default, whatever the device or viewer theme; the map's Dark toggle adds .app-dark.
   (The app's own class, so the claude.ai viewer's theme setting doesn't flip it.) */
:root.app-dark {
  --bg: #13161b;
  --bg-soft: #1d222a;
  --text: #e7eaf0;
  --muted: #98a1ae;
  --border: #2d3440;
  --accent: #8fb0f5;
  --accent-text: #0f1520;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  --land: #1a1d22;
  --street-major: #363d49;
  --street-minor: #2a3039;
  --street-casing: #121418;
  --street-outer: #262a31;
  --water: #1d3449;
  --park: #1d3125;
  --boundary: #7d8798;
  --map-text: #d6dbe3;
  --star: #f2b632;
  --special: #5ccfc0;
  --free: #5fd18f;
  --sold: #ff7b6b;
  --wait: #f2b632;
  --g-music: #f07ab8;
  --g-stage: #b49cff;
  --g-art: #5cc6e6;
  --g-kids: #f2b94b;
  --g-learn: #a6d35f;
  --g-outdoor: #5fd18f;
  --g-other: #8fb0f5;
  --lm: #4cc0cb;
  --lm-text: #7fd6de;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* beats display: flex on hidden blocks */

html, body {
  margin: 0;
  height: 100%;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#map { position: fixed; inset: 0 0 0 calc(var(--panel-width) + 24px); }

.muted { color: var(--muted); }

/* ---------- panel ---------- */

.panel {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: var(--panel-width);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow: hidden;
}

.sheet-grip, .view-switch { display: none; }

.panel-header { padding: 16px 16px 8px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; text-wrap: balance; }

.banner {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 13px;
}
.banner code { font-size: 12px; }

/* One scrolling line per chip row keeps the list visible; the fade hints there's more. */
.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; }

.chip:focus-visible, .button:focus-visible, .seg:focus-visible,
.event-list li:focus-visible, .star:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip, .button {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-checked="true"], .chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.chip .n { opacity: 0.7; font-size: 11.5px; margin-left: 3px; font-variant-numeric: tabular-nums; }
.chip.empty { opacity: 0.45; }
.button[aria-expanded="true"] { border-color: var(--accent); }

.filter-bar { display: flex; gap: 8px; padding: 0 16px 10px; border-bottom: 1px solid var(--border); }
.filter-bar input { flex: 1; min-width: 0; }

input[type="search"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}

.more-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Two modes: events or places. Controls that only make sense in one are hidden in the other. */
body[data-mode="places"] .events-only, body[data-mode="places"] #open-chat, body[data-mode="places"] #late-museums { display: none !important; }
body:not([data-mode="places"]) .places-only { display: none !important; }

.mode-switch {
  display: flex;
  margin-top: 10px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.mode-switch button {
  flex: 1;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mode-switch button[aria-selected="true"] { background: var(--bg); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.mode-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip[aria-pressed] .swatch, .chip .swatch { width: 8px; height: 8px; display: inline-block; vertical-align: 0; }
.event-list .title .swatch { display: inline-block; vertical-align: 1px; margin-right: 2px; }

/* Landmarks: colour icons in the style of emoji, under the events; name on hover/tap.
   Only the drawn shape catches the pointer, so the empty corners never block the map. */
.leaflet-marker-icon.landmark { pointer-events: none !important; cursor: default; }
.lm-icon {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, 0.35));
  pointer-events: visiblePainted;
}
/* On the dark map, a pale halo keeps darker icons (the tower, the column) visible. */
.app-dark .lm-icon { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.7)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.lm-tip { font-weight: 600; }

.section-label {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ---------- map display: neutral switches on the map, apart from the event filters ---------- */

.map-tools {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 56px;
  z-index: 1001;
  display: flex;
  gap: 6px;
  align-items: center;
}
.map-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
}
.map-btn[aria-expanded="true"] { background: var(--bg-soft); }
.map-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* EN | FR: event text translated or original */
.lang-switch { display: flex; padding: 2px; gap: 2px; cursor: default; }
.lang-switch[hidden] { display: none; }
.lang-switch button {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 7px; border-radius: 6px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tr-status { margin: 0; padding: 0 16px 8px; font-size: 12.5px; }
/* Short notes from the map buttons, under them (so a longer one never squeezes the row). */
.map-tools { position: fixed; }
.map-status {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  max-width: min(320px, calc(100vw - 32px));
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: var(--shadow);
}
.map-status:empty { display: none; }

.layers-panel {
  position: fixed;
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: 56px;
  z-index: 1001;
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100% - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.layers-panel .note { margin: 0; }
.layers-panel .poi-categories { grid-template-columns: 1fr; gap: 4px; padding: 2px 0 0 4px; }
.layers-panel input[type="checkbox"]:not([role="switch"]) { accent-color: var(--boundary); }

/* On/off switches in neutral grey: they change the drawing, not the results. */
.switch { display: flex; align-items: center; gap: 10px; }
.switch input {
  appearance: none;
  flex: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.switch input:checked { background: var(--boundary); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); }


.poi-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 8px 0 0 2px;
}
.poi-categories label { display: flex; align-items: center; gap: 6px; }

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}


.note { margin: 6px 0 0; font-size: 12.5px; }

/* ---------- event details (phones) ---------- */

.panel.has-detail > :not(#detail):not(.sheet-grip) { display: none; }
.detail { flex: 1; min-height: 0; overflow-y: auto; }
.detail-bar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.detail-body { padding: 12px 16px 24px; }
.detail-body img { display: block; width: 100%; height: 210px; object-fit: cover; border-radius: 12px; }
.detail-body h2 { margin: 12px 0 4px; font-size: 20px; line-height: 1.25; text-wrap: balance; }
.detail-body h3 {
  margin: 16px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.detail-body p { margin: 4px 0; }
.detail-when { font-weight: 600; font-size: 15px; }
.detail-body .tags { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.date-list { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.date-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.detail-actions .button { text-decoration: none; display: inline-flex; align-items: center; }
.detail .save {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.detail .save[aria-pressed="true"] { border-color: var(--star); color: var(--star); }

/* ---------- chat ---------- */

.ask {
  flex: none;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ask:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.title-row h1 { flex: 1; min-width: 0; }

.panel.has-chat > :not(#chat):not(.sheet-grip):not(#detail) { display: none; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat .detail-bar { position: static; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 92%; padding: 8px 12px; border-radius: 14px; line-height: 1.45; }
.bubble p { margin: 4px 0; }
.bubble ul { margin: 4px 0; padding-left: 18px; }
.bubble li { margin: 4px 0; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--bg-soft); border-bottom-left-radius: 4px; }
.bubble .link { font-weight: 600; }
.bubble a { color: var(--accent); }
.thinking { color: var(--muted); }
.thinking::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chat-suggestions p { width: 100%; margin: 0 0 4px; font-size: 12.5px; }
.chat-suggestions .chip { white-space: normal; text-align: left; }

.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px 4px; border-top: 1px solid var(--border); }
.chat-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}
.send {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chat-note { margin: 0; padding: 0 16px 10px; font-size: 11.5px; }
.link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) { .thinking::after { animation: none; content: "…"; } }

/* ---------- results ---------- */

.results { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.results h2 {
  margin: 0;
  padding: 10px 16px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 8px 10px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.event-list .body { flex: 1; min-width: 0; }
.event-list li:hover, .event-list li:focus { background: var(--bg-soft); outline: none; }
.event-list .title { font-weight: 600; }
.event-list .meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Titles: one look whatever the organiser typed. A small "series" label, then the title,
   two lines at most in lists (the details show it whole). */
.kicker {
  display: block;
  margin-bottom: 1px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.ttl { font-weight: 650; }
.event-list .title .ttl, .preview-title .ttl {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.event-list .meta .badge, .preview-meta .badge { margin-left: 6px; }
.price { margin: 4px 0; }
/* Descriptions keep their paragraphs; in popups a long one folds after six lines. */
.about { white-space: pre-line; }
.about.folded { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
button.link.more { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
.note { font-size: 12.5px; margin: 2px 0 4px; }
/* Claude's compact line of days and hours, under the next date. */
.times { margin: 2px 0 4px; font-weight: 500; }
.times::before { content: "🕒 "; font-weight: 400; }
.price strong { color: var(--text); font-weight: 700; }
.event-list .when, .when-line .when, .preview-meta .when { color: var(--text); font-weight: 650; }
/* "● Now" and "Free" tags in front of the time. */
.pill {
  display: inline-block;
  margin-right: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  vertical-align: 1px;
  white-space: nowrap;
}
.pill.now { background: var(--accent); color: var(--accent-text); }
.pill.free { background: var(--free); color: var(--bg); }

.star {
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.star[aria-pressed="true"] { color: var(--star); }
.star:hover { background: var(--bg-soft); }
.event-list .empty { cursor: default; color: var(--muted); }
/* Sold out: grey text, but keep the badge at full strength so it stands out. */
.event-list li.is-sold-out .title, .event-list li.is-sold-out .meta, .event-list li.is-sold-out .when { color: var(--muted); }
.event-list li.more-row { justify-content: center; cursor: default; }
.event-list li.list-divider { cursor: default; padding-top: 14px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.event-list li.list-divider:hover { background: none; }

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--free);
  color: var(--bg);
  vertical-align: 1px;
}

.badge.sold { background: var(--sold); color: var(--bg); }
.badge.wait { background: var(--wait); color: var(--bg); }
.tickets { font-size: 13px; }
.tickets a { color: var(--accent); }
.badge.special { background: var(--special); color: var(--bg); }
.late-museums { margin: 6px 16px 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: 13px; }
.late-museums h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--special); }
.late-museums p { margin: 4px 0; }
.late-museums .small { font-size: 11.5px; }
.badge.lang { background: var(--boundary); color: var(--bg); letter-spacing: 0.03em; }
.lang-line { color: var(--muted); font-size: 12.5px; }

.panel-footer {
  padding: 8px 16px 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}

/* ---------- markers & popups ---------- */

.hit { width: 100%; height: 100%; display: grid; place-items: center; cursor: pointer; }
.dot {
  width: var(--dot, 14px);
  height: var(--dot, 14px);
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(40, 32, 20, 0.3);
}
.dot.event { background: var(--g-other); }
.dot.place { width: var(--place-dot, 11px); height: var(--place-dot, 11px); }
.g-music { --g: var(--g-music); }
.g-stage { --g: var(--g-stage); }
.g-art { --g: var(--g-art); }
.g-kids { --g: var(--g-kids); }
.g-learn { --g: var(--g-learn); }
.g-outdoor { --g: var(--g-outdoor); }
.g-other { --g: var(--g-other); }
.dot.event[class*="g-"] { background: var(--g); }
/* Free: a green ring outside the white edge. Happening now: a ring that pulses outwards. */
.dot.free { box-shadow: 0 0 0 2px var(--free), 0 1px 3px rgba(40, 32, 20, 0.3); }
.dot.live { position: relative; }
.dot.live::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--g);
  animation: live-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes live-pulse {
  from { transform: scale(0.55); opacity: 0.9; }
  to { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.live::after { animation: none; opacity: 0.6; transform: none; }
}
/* Saved events: gold stars, a little bigger than the dots. */
.star-mark {
  width: calc(max(var(--dot, 14px), 14px) * 1.5);
  height: calc(max(var(--dot, 14px), 14px) * 1.5);
  fill: var(--star);
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1.5px rgba(40, 32, 20, 0.35));
  overflow: visible;
}
.star-mark.live { animation: star-pulse 1.8s ease-in-out infinite; }
@keyframes star-pulse { 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .star-mark.live { animation: none; } }
/* Saved view: the date and filter chips don't apply, so they step back (a tap leaves the view). */
.saved-view .chip[data-when], .saved-view #type-chips .chip:not([data-saved-chip]), .saved-view #filters-toggle { opacity: 0.45; }
.saved-view .chip[data-when][aria-checked="true"] { background: transparent; color: var(--text); border-color: var(--border); }
/* The ★ map button: gold when only saved events are shown. */
.saved-btn { color: var(--star); font-weight: 650; }
.saved-btn .n { color: var(--text); font-weight: 600; }
.saved-btn[aria-pressed="true"] { background: var(--star); border-color: var(--star); color: #fff; }
.saved-btn[aria-pressed="true"] .n { color: #fff; }
.saved-sample { font-style: normal; color: var(--star); margin-right: 6px; }
/* Toilets and drinking water: small icons, growing a little with zoom. */
.amenity { display: grid; place-items: center; cursor: pointer; }
.amenity svg { width: var(--amenity, 18px); height: var(--amenity, 18px); filter: drop-shadow(0 1px 1.5px rgba(40, 32, 20, 0.35)); }
.am-popup .actions { margin-top: 6px; }
.am-key { display: inline-flex; gap: 3px; vertical-align: -3px; margin-right: 6px; }
.am-key svg { width: 15px; height: 15px; }
/* You are here: a small figure (the SVG in app.js) with a pulse on the ground under its feet.
   The ◎ button is blue while following you. */
.you-are-here { pointer-events: auto; }
.you-pulse { transform-origin: 18px 32.5px; animation: here-pulse 2s ease-out infinite; }
@keyframes here-pulse { from { transform: scale(0.5); opacity: 0.55; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .you-pulse { animation: none; opacity: 0.3; } }
#locate[aria-pressed="true"] { background: #2f80ed; border-color: #2f80ed; color: #fff; }
/* Same marks in the key. */
.tip-group.ring-free { box-shadow: 0 0 0 2px var(--free); }
.tip-group.ring-live { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--g-other); }
.tip-group { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--g); vertical-align: 0; }

/* Hover previews (desktop) */
.leaflet-tooltip.event-tip {
  width: max-content;
  max-width: 260px;
  white-space: normal;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  line-height: 1.35;
}
.leaflet-tooltip.event-tip::before { display: none; }

/* Short names next to single events once zoomed in */
.event-label span {
  display: inline-block;
  max-width: calc(var(--label, 11.5px) * 13);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--label, 11.5px);
  font-weight: 550;
  color: var(--map-text);
  text-shadow: 0 0 2px var(--land), 0 0 2px var(--land), 0 0 3px var(--land);
  cursor: pointer;
}

/* Phone: tap a dot for a compact card above the bottom panel */
.preview {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--peek-h, 186px) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 1002;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* The event's photo as a banner across the top of the card. */
.preview-photo {
  display: block;
  margin: -10px -12px 4px;
  width: calc(100% + 24px);
  height: 118px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}
.preview-photo[hidden] { display: none; }
.preview-photo, .preview-title { cursor: pointer; }
.preview-group { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.preview-title { font-weight: 700; line-height: 1.3; }
.preview-meta { font-size: 12.5px; color: var(--muted); }
.preview-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.preview-actions #preview-close { margin-left: auto; }
.preview .save {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.preview .save[aria-pressed="true"] { border-color: var(--star); color: var(--star); }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 12.5px; }
.legend i { font-style: normal; }

.cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
/* Clusters stay quiet (a soft tinted disc) so single, colour-coded events stand out. */
.cluster.events {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 1px 2px rgba(40, 32, 20, 0.15);
  font-size: 11px;
  font-weight: 650;
}
.cluster.pois {
  background: color-mix(in srgb, var(--boundary) 18%, var(--bg));
  color: var(--map-text);
  border: 1px solid color-mix(in srgb, var(--boundary) 45%, transparent);
  box-shadow: 0 1px 2px rgba(40, 32, 20, 0.15);
  font-size: 11px;
  font-weight: 650;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--bg);
  color: var(--text);
}
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; }
.popup h3 { margin: 0 0 4px; font-size: 15px; }
.popup p { margin: 4px 0; }
.popup img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.popup .tags { color: var(--muted); font-size: 12px; }
.popup a { color: var(--accent); }
.popup .sessions { margin: 4px 0; padding-left: 16px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.popup .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.popup .save {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.popup .save[aria-pressed="true"] { border-color: var(--star); color: var(--star); }

.leaflet-container { background: var(--land); font: inherit; }


.arr-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  color: var(--boundary);
  text-shadow: 0 0 2px var(--land), 0 0 3px var(--land);
  cursor: pointer;
}
.arr-label b { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.arr-count { display: none; font-weight: 700; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.arr-label:focus-visible { outline: 2px solid var(--accent); border-radius: 6px; }

/* Zoomed out: counts become the main mark, in pills so they read over any shading. */
.overview .arr-label { text-shadow: none; }
.overview .arr-label b { font-weight: 600; font-size: 11px; }
.overview .arr-close { color: var(--muted); font-weight: 600; }
/* Zoomed out the numbers are the controls, so they sit above any dots they've opened.
   Zoomed in the names are just labels: taps go through to the dots. */
.overview .leaflet-areaLabels-pane { z-index: 610 !important; } /* beats the pane's inline 450 */
body:not(.overview) .arr-label { pointer-events: none; }
.overview .arr-count {
  display: block;
  min-width: 28px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--map-text);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(40, 32, 20, 0.2);
  text-align: center;
}

/* "Paris Centre" stands in for the 1st–4th when zoomed far out. */
.arr-centre { display: none; }
.merge-centre .arr-centre { display: flex; }
.merge-centre .arr-in-centre { display: none; }

.map-hint {
  margin-top: 12px !important;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12.5px;
}

/* ---------- mobile: the panel becomes a draggable bottom sheet ---------- */

@media (max-width: 720px) {
:root { --peek-h: 232px; }
  #map { inset: 0; }
  .leaflet-control-zoom { display: none; }
  .map-tools, .layers-panel { right: 12px; }
  .map-tools { top: calc(56px + env(safe-area-inset-top, 0px)); }
  /* Room for longer (French) labels: "Near me" and the theme button become icons. */
  #locate .btn-text, #theme-toggle .btn-text { display: none; }
  /* With the panel at full height, the buttons move up into the strip above it. */
  body[data-sheet="full"] .map-tools { top: calc(7px + env(safe-area-inset-top, 0px)); }
  body[data-sheet="full"] .map-tools .map-btn { padding-top: 4px; padding-bottom: 4px; }
  body[data-sheet="full"] .layers-panel { display: none; }
  .layers-panel { top: calc(96px + env(safe-area-inset-top, 0px)); max-height: calc(100% - 96px - 200px); }

  .panel {
    --peek: calc(232px + env(safe-area-inset-bottom, 0px));
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 55%;
    max-height: calc(100% - 48px - env(safe-area-inset-top, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 16px 16px 0 0;
    transition: height 0.22s ease;
  }
  .panel[data-sheet="peek"] { height: var(--peek); }
  .panel[data-sheet="half"] { height: 55%; }
  .panel[data-sheet="full"] { height: calc(100% - 48px - env(safe-area-inset-top, 0px)); }
  .panel.dragging { transition: none; }

  .sheet-grip {
    display: block;
    flex: none;
    padding: 8px 0 2px;
    cursor: grab;
    touch-action: none;
  }
  .sheet-grip span {
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto;
    border-radius: 3px;
    background: var(--border);
  }
  .panel-header { padding: 4px 16px 8px; touch-action: none; }
  /* The filter rows pull the sheet up and down too; chip rows still scroll sideways. */
  .panel > .chip-row { touch-action: pan-x; }
  .panel > .filter-bar { touch-action: none; }
  .mode-switch { margin-top: 8px; }
  .mode-switch button { padding: 5px 10px; }
  .panel-header h1 { font-size: 18px; }

  .view-switch {
    display: flex;
    flex: none;
    padding: 2px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
  }
  .seg {
    border: none;
    background: none;
    color: var(--muted);
    border-radius: 999px;
    padding: 4px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .seg[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

  .results { flex: 1; min-height: 0; }
  .panel-footer { display: none; }
}

@media (max-width: 720px) {
  body[data-sheet="full"] .map-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .switch input, .switch input::after { transition: none; }
}

/* ---------- one event: the same layout in phone details and map popups ---------- */
.ev-title { margin: 12px 0 4px; font-size: 19px; line-height: 1.25; }
.popup .ev-title { font-size: 16px; margin-top: 8px; }
.ev-title .ttl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ev-badges { margin: 2px 0 6px; }
.ev-badges .badge { margin: 0 6px 0 0; }
.facts { list-style: none; margin: 8px 0 0; padding: 0; }
.facts > li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 7px 0; border-top: 1px solid var(--border); }
.facts > li:first-child { border-top: 0; padding-top: 2px; }
.facts .ico { font-size: 15px; line-height: 1.4; text-align: center; }
.facts p { margin: 0; }
.facts .when-line { font-weight: 600; }
.facts .times::before { content: none; }
.times.folded, .price.folded {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; cursor: pointer;
}
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.cta .button { text-decoration: none; display: inline-flex; align-items: center; }
.cta .button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.popup .cta .button { padding: 5px 10px; font-size: 13px; }
/* Four buttons on one row on a phone. */
#detail-map .short { display: none; }
@media (max-width: 480px) {
  .cta { gap: 5px; }
  .cta .button { padding: 6px 8px; font-size: 12.5px; }
  #detail-map .long { display: none; }
  #detail-map .short { display: inline; }
  #detail-map .short::before { content: "🗺 "; }
}
details.more-dates summary { cursor: pointer; color: var(--accent); font-size: 13.5px; padding: 6px 0; }
/* ---------- feedback dialog ---------- */
.feedback {
  width: min(440px, calc(100vw - 32px)); padding: 18px 18px 14px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg); color: var(--text); box-shadow: var(--shadow);
}
.feedback::backdrop { background: rgba(0, 0, 0, 0.35); }
.feedback h2 { margin: 0 0 4px; font-size: 18px; }
.feedback p { margin: 0 0 10px; font-size: 13.5px; }
.feedback textarea, .feedback input {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); color: var(--text); font: inherit;
}
.feedback textarea { resize: vertical; min-height: 96px; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fb-status { font-size: 13px; }
/* Narrow phones: a little less air between the map buttons so the whole row fits. */
@media (max-width: 400px) {
  .map-tools { gap: 4px; right: 8px; }
  .map-tools .map-btn { padding-left: 8px; padding-right: 8px; }
}
.feedback .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; } /* bots fill it, people never see it */
