/* ==========================================================================
   World Map — interface styles
   Spacing follows an 8px grid (--s1 … --s4). Colours for the map itself live
   in app.js (THEMES); this file only styles the interface around it.
   ========================================================================== */

:root {
  /* 8px spacing scale */
  --s05: 4px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;

  --radius: 12px;
  --radius-sm: 8px;
  --btn: 40px;                       /* control button size */
  --edge: 16px;                      /* distance of floating panels from the screen edge */

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Light interface (default) */
  --panel-bg: rgba(255, 253, 249, 0.82);
  --panel-border: rgba(60, 50, 35, 0.08);
  --panel-shadow: 0 1px 2px rgba(40, 32, 20, 0.06), 0 8px 24px rgba(40, 32, 20, 0.10);
  --text: #2f2a24;
  --text-muted: #7a7166;
  --icon: #4a443c;
  --hover: rgba(60, 50, 35, 0.06);
  --active: rgba(60, 50, 35, 0.10);
  --accent: #6f8796;
  --focus: rgba(111, 135, 150, 0.55);
  --space-bg: radial-gradient(circle at 50% 45%, #eef1f2 0%, #e1e6e9 60%, #d5dce0 100%);
  --loader-bg: #f3efe6;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body[data-ui="dark"] {
  --panel-bg: rgba(30, 34, 39, 0.80);
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
  --text: #e9e4da;
  --text-muted: #9d978c;
  --icon: #d6d0c5;
  --hover: rgba(255, 255, 255, 0.07);
  --active: rgba(255, 255, 255, 0.12);
  --accent: #8fa6b4;
  --focus: rgba(143, 166, 180, 0.6);
  --space-bg: radial-gradient(circle at 50% 45%, #1a1f25 0%, #11151a 65%, #0b0e12 100%);
  --loader-bg: #1c2025;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

#map {
  position: fixed;
  inset: 0;
  background: var(--space-bg);       /* shows around the globe */
  transition: background 400ms var(--ease);
}

/* ---------- Floating panels ---------- */

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  transition: background 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease);
}

/* Top-left stack: title card, then search + category chips */
.top-left {
  position: fixed;
  z-index: 3;
  top: max(var(--edge), env(safe-area-inset-top));
  left: max(var(--edge), env(safe-area-inset-left));
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
  pointer-events: none;
}

.title-card {
  padding: var(--s1) var(--s2) var(--s1);
  pointer-events: none;              /* never blocks map dragging */
  user-select: none;
}

.title-card__name {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.title-card__tagline {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- Style switcher (segmented control) ---------- */

.style-switcher {
  position: fixed;
  z-index: 3;
  transition: right 300ms var(--ease), background 300ms var(--ease);
  top: max(var(--edge), env(safe-area-inset-top));
  right: max(var(--edge), env(safe-area-inset-right));
  display: flex;
  gap: var(--s05);
  padding: var(--s05);
}

.style-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  height: 32px;
  padding: 0 var(--s2) 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: 500 13px/1 var(--font);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.style-switcher__btn:hover { background: var(--hover); color: var(--text); }

.style-switcher__btn[aria-checked="true"] {
  background: var(--active);
  color: var(--text);
}

.style-switcher__swatch {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* ---------- Map control buttons (zoom, compass, reset, globe) ---------- */

.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right { z-index: 2; }

/* Bottom controls sit just above the timeline (its height is set by app.js) */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left {
  bottom: calc(var(--timeline-h, 0px) + var(--edge) + env(safe-area-inset-bottom) - 8px);
  transition: right 300ms var(--ease), bottom 200ms var(--ease);
}
.maplibregl-ctrl-bottom-right { right: max(0px, env(safe-area-inset-right)); }
.maplibregl-ctrl-bottom-left { left: max(0px, env(safe-area-inset-left)); }

.map-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  margin: 0 var(--edge) var(--s1) 0 !important;
}

.map-buttons__group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--s05);
  gap: 2px;
}

.map-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--btn);
  height: var(--btn);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.map-btn:hover { background: var(--hover); color: var(--text); }
.map-btn:active { background: var(--active); transform: scale(0.96); }
.map-btn[aria-pressed="true"] { color: var(--accent); }
.map-btn[disabled] { opacity: 0.35; cursor: default; background: transparent; transform: none; }

.map-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.map-btn--compass svg { transition: transform 120ms linear; }

/* Tooltips (desktop only, appear on hover) */
@media (hover: hover) {
  .map-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translate(4px, -50%);
    padding: var(--s05) var(--s1);
    border-radius: 6px;
    background: rgba(35, 32, 28, 0.88);
    color: #fff;
    font: 500 12px/16px var(--font);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms var(--ease), transform 140ms var(--ease);
  }
  .map-btn[data-tip]:hover::after { opacity: 1; transform: translate(0, -50%); transition-delay: 350ms; }
}

/* Keyboard focus rings */
.map-btn:focus-visible,
.style-switcher__btn:focus-visible,
.maplibregl-ctrl-attrib-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

/* Hide the button groups' default MapLibre look */
.map-buttons.maplibregl-ctrl { background: none; box-shadow: none; }

/* ---------- Scale bar ---------- */

.maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale {
  margin: 0 0 var(--edge) var(--edge);
  height: 24px;
  padding: 0 var(--s1);
  display: flex;
  align-items: center;
  border: 1px solid var(--panel-border);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-muted);
  font: 500 11px/1 var(--font);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  transition: width 200ms var(--ease);
}

/* ---------- Attribution ---------- */

.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib {
  margin: 0 var(--edge) var(--edge) 0;
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-muted);
  font: 400 11px/16px var(--font);
}

.maplibregl-ctrl-attrib-inner { padding: var(--s05) var(--s1); }
.maplibregl-ctrl-attrib a { color: var(--text-muted); text-decoration: none; }
.maplibregl-ctrl-attrib a:hover { color: var(--text); text-decoration: underline; }

.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; padding: 0; }
.maplibregl-ctrl-attrib.maplibregl-compact-show { padding: var(--s05) 32px var(--s05) var(--s1); border-radius: var(--radius-sm); }
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner { padding: 0; }
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner { padding: 0; }
.maplibregl-ctrl-attrib-button { border-radius: var(--radius-sm); }
body[data-ui="dark"] .maplibregl-ctrl-attrib-button { filter: invert(0.9); background-color: transparent; }

/* ---------- Loading states ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  background: var(--loader-bg);
  transition: opacity 600ms var(--ease), visibility 600ms;
}

.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader__globe {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(111, 135, 150, 0.25);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.loader__text {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease);
}

.progress.is-active { opacity: 1; }

.progress span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.2s var(--ease) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { from { left: -30%; } to { left: 100%; } }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 15px;
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  :root { --edge: 16px; }

  .title-card { padding: var(--s1) var(--s2); }
  .title-card__name { font-size: 15px; line-height: 24px; }   /* same height as the style switcher */


  .title-card__tagline { display: none; }

  .style-switcher__btn { padding: 0 var(--s1); font-size: 12px; gap: var(--s05); }
  .style-switcher__swatch { width: 10px; height: 10px; }
}

@media (max-width: 360px) {
  .style-switcher__swatch { display: none; }
}

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

body[data-ui="dark"] .style-switcher__swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }

/* ==========================================================================
   v2 — events, search, category chips, details panel, lightbox, timeline
   ========================================================================== */

:root {
  --panel-w: min(400px, calc(100vw - 32px));
  --track: rgba(60, 50, 35, 0.12);
  --tooltip-bg: rgba(35, 32, 28, 0.92);
  --skeleton: rgba(60, 50, 35, 0.07);
}
body[data-ui="dark"] {
  --track: rgba(255, 255, 255, 0.14);
  --tooltip-bg: rgba(12, 14, 17, 0.94);
  --skeleton: rgba(255, 255, 255, 0.06);
}

/* ---------- Generic small icon button ---------- */

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--active); }
.icon-btn[disabled] { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn svg { width: 18px; height: 18px; display: block; pointer-events: none; }
.icon-btn > span { display: grid; place-items: center; }
.icon-btn:focus-visible,
.chip:focus-visible,
.gallery__item:focus-visible,
.sources a:focus-visible,
.lightbox__btn:focus-visible,
.timeline__chart rect:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

@media (hover: hover) {
  .icon-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 4px);
    padding: var(--s05) var(--s1);
    border-radius: 6px;
    background: var(--tooltip-bg);
    color: #fff;
    font: 500 12px/16px var(--font);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms var(--ease), transform 140ms var(--ease);
  }
  .icon-btn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 350ms; }
  .event-panel .icon-btn[data-tip]::after { bottom: auto; top: calc(100% + 8px); transform: translate(-50%, -4px); }
  .event-panel .icon-btn[data-tip]:hover::after { transform: translate(-50%, 0); }
  #panel-share.is-done::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0ms; }
}

/* ---------- Search ---------- */

.toolbar {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  pointer-events: auto;
}

.search {
  display: flex;
  align-items: center;
  gap: var(--s05);
  height: 40px;
  padding: 0 var(--s05) 0 12px;
}
.search:focus-within { box-shadow: var(--panel-shadow), 0 0 0 3px var(--focus); }
.search__icon { display: grid; color: var(--text-muted); }
.search__icon svg { width: 16px; height: 16px; }
.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 var(--s05);
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 14px/20px var(--font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search__input::placeholder { color: var(--text-muted); opacity: 1; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear { display: none; }
.toolbar.has-query .search__clear { display: inline-grid; }
.search__filter { display: none; }
.search__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 600 10px/16px var(--font);
}
.search__badge[hidden] { display: none; }

.search-results {
  position: absolute;
  z-index: 5;
  top: 48px;
  left: 0;
  right: 0;
  max-height: min(360px, 50vh);
  margin: 0;
  padding: var(--s05);
  overflow-y: auto;
  list-style: none;
}
.search-results[hidden] { display: none; }

.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--s1);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.result:hover,
.result.is-active { background: var(--hover); }
.result--empty { cursor: default; color: var(--text-muted); font-size: 13px; }
.result--empty:hover { background: none; }
.result__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cat);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.result__icon svg { width: 15px; height: 15px; }
.result__text { min-width: 0; display: flex; flex-direction: column; }
.result__text strong,
.result__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__text strong { font: 500 13px/18px var(--font); color: var(--text); }
.result__text small { font: 400 12px/16px var(--font); color: var(--text-muted); }

/* ---------- Category chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}
.chips:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  height: 32px;
  padding: 0 12px 0 var(--s05);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  color: var(--text);
  font: 500 12px/1 var(--font);
  cursor: pointer;
  transition: opacity 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.chip:hover { background: var(--panel-bg); transform: translateY(-1px); }
.chip__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cat);
  color: #fff;
  transition: background 160ms var(--ease);
}
.chip__icon svg { width: 13px; height: 13px; }
.chip__count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: 0.55; }
.chip[aria-pressed="false"] .chip__icon { background: var(--text-muted); }
.chip[aria-pressed="false"] .chip__label { text-decoration: line-through; text-decoration-color: var(--text-muted); }

/* ---------- Hover tooltip ---------- */

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--tooltip-bg);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  font: 400 12px/16px var(--font);
}
.tooltip[hidden] { display: none; }
.tooltip strong { display: block; font-weight: 600; font-size: 13px; line-height: 18px; }
.tooltip span { opacity: 0.75; }

/* ---------- Notice (e.g. events could not load) ---------- */

.notice {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: calc(var(--timeline-h, 0px) + var(--edge) * 2);
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px var(--s1) 12px var(--s2);
  font: 400 13px/20px var(--font);
  color: var(--text);
}
.notice[hidden] { display: none; }
.notice > span { flex: 1; padding-top: 6px; }
.notice code { font-size: 12px; padding: 1px 4px; border-radius: 4px; background: var(--hover); }

/* ---------- Event details panel (desktop: slides in from the right) ---------- */

.event-panel {
  position: fixed;
  z-index: 6;
  top: max(var(--edge), env(safe-area-inset-top));
  right: max(var(--edge), env(safe-area-inset-right));
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 32px));
  visibility: hidden;
  transition: transform 380ms var(--ease), visibility 0s linear 380ms, background 300ms var(--ease);
}
.event-panel.is-open {
  transform: none;
  visibility: visible;
  transition: transform 380ms var(--ease), visibility 0s, background 300ms var(--ease);
}

.event-panel__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s05);
  padding: var(--s1) var(--s1) 0;
  flex: none;
}
.event-panel__handle { display: none; }

.event-panel__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--s3) var(--s3);
  -webkit-overflow-scrolling: touch;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  height: 28px;
  padding: 0 12px 0 var(--s05);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat) 14%, transparent);
  color: var(--text);
  font: 600 11px/1 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cat);
  color: #fff;
}
.badge__icon svg { width: 12px; height: 12px; }

.event__title {
  margin: 12px 0 var(--s1);
  font: 600 22px/28px var(--font);
  letter-spacing: -0.015em;
  color: var(--text);
  outline: none;
}

.event__meta {
  display: flex;
  gap: var(--s1);
  margin: 0 0 var(--s05);
  color: var(--text-muted);
  font: 400 13px/20px var(--font);
}
.event__meta svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.event__approx {
  display: inline-block;
  margin-left: var(--s05);
  padding: 0 var(--s1);
  border-radius: 999px;
  background: var(--hover);
  font: 500 11px/20px var(--font);
  font-style: normal;
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
  margin: var(--s2) 0;
}
.gallery--1 { grid-template-columns: 1fr; }
.gallery--3 > :first-child { grid-column: 1 / -1; }
.gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--skeleton);
  cursor: zoom-in;
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 300ms var(--ease), transform 400ms var(--ease);
}
.gallery__item img.is-loaded { opacity: 1; }
.gallery__item:hover img { transform: scale(1.03); }

.event__description { margin-top: var(--s2); }
.event__description p {
  margin: 0 0 12px;
  font: 400 14px/22px var(--font);
  color: var(--text);
}
.event__description strong { font-weight: 600; }

.event__section h3 {
  margin: var(--s3) 0 var(--s1);
  font: 600 11px/16px var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: var(--s1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.video iframe,
.video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.event__link,
.sources a { color: var(--text); text-decoration: none; }

.sources { margin: 0; padding: 0; list-style: none; }
.sources a {
  display: flex;
  gap: 12px;
  padding: var(--s1);
  margin: 0 calc(var(--s1) * -1);
  border-radius: var(--radius-sm);
  transition: background 160ms var(--ease);
}
.sources a:hover { background: var(--hover); }
.sources svg,
.event__link svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--text-muted); }
.sources a > span { min-width: 0; display: flex; flex-direction: column; }
.sources strong { font: 500 13px/20px var(--font); }
.sources small {
  font: 400 12px/16px var(--font);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event__link { display: inline-flex; gap: var(--s1); font: 500 13px/20px var(--font); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(12, 12, 14, 0.94);
  opacity: 0;
  transition: opacity 220ms var(--ease);
  touch-action: none;
  user-select: none;
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px 72px;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 250ms var(--ease);
  -webkit-user-drag: none;
}
.lightbox__stage img.is-loaded { opacity: 1; }
.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  cursor: pointer;
  transition: background 160ms var(--ease);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lightbox__prev,
.lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox__count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font: 500 13px/20px var(--font);
  font-variant-numeric: tabular-nums;
}

/* ---------- Timeline ---------- */

.timeline {
  position: fixed;
  z-index: 3;
  left: max(var(--edge), env(safe-area-inset-left));
  right: max(var(--edge), env(safe-area-inset-right));
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  padding: var(--s1) var(--s2) var(--s1) var(--s1);
  transition: right 300ms var(--ease), background 300ms var(--ease);
}

.timeline__bar {
  display: flex;
  align-items: center;
  gap: var(--s05);
  min-height: 32px;
}

.timeline__btn[aria-pressed="true"] { color: var(--accent); background: var(--hover); }

.timeline__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin: 0 0 0 var(--s1);
}
.timeline__range {
  font: 600 13px/20px var(--font);
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.timeline__count {
  font: 400 12px/20px var(--font);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline__toggle { display: none; }
.timeline__toggle svg { transition: transform 250ms var(--ease); }

.timeline__body { padding: var(--s05) 0 0 var(--s1); }

/* Chart, track and labels are inset by the slider thumb radius (8px) so they line up. */
.timeline__chart {
  display: block;
  width: calc(100% - 16px);
  height: 36px;
  margin: 0 8px;
  overflow: visible;
}
.timeline__chart rect { fill: var(--accent); fill-opacity: 0.85; cursor: pointer; transition: fill-opacity 200ms var(--ease); }
.timeline__chart rect:hover { fill-opacity: 1; }
.timeline__chart rect.is-out { fill-opacity: 0.22; }
.timeline__chart rect.bar--empty { fill: var(--text-muted); fill-opacity: 0.14; cursor: default; }

.timeline__slider { position: relative; height: 24px; }
.timeline__track {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--track);
}
.timeline__fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }

.timeline__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 2;
}
.timeline__input:focus { outline: none; }
.timeline__input::-webkit-slider-runnable-track { background: none; border: 0; height: 24px; }
.timeline__input::-moz-range-track { background: none; border: 0; }
.timeline__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: grab;
  pointer-events: auto;
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
.timeline__input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: grab;
  pointer-events: auto;
}
.timeline__input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.timeline__input:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.15); }
.timeline__input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus); }
.timeline__input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--focus); }

.timeline__ticks {
  position: relative;
  height: 16px;
  margin: 0 8px;
  color: var(--text-muted);
  font: 500 11px/16px var(--font);
  font-variant-numeric: tabular-nums;
}
.tick { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.tick--start { transform: none; }
.tick--end { transform: translateX(-100%); }

.timeline.is-collapsed .timeline__body,
.timeline.is-empty .timeline__body { display: none; }
.timeline.is-collapsed .timeline__toggle svg { transform: rotate(180deg); }
.timeline.is-empty .timeline__btn { opacity: 0.35; pointer-events: none; }

/* ---------- Desktop: make room for the open details panel ---------- */

@media (min-width: 601px) {
  body.panel-open .style-switcher { right: calc(var(--edge) * 2 + var(--panel-w)); }
  body.panel-open .maplibregl-ctrl-bottom-right { right: calc(var(--edge) + var(--panel-w)); }
  body.panel-open .timeline { right: calc(var(--edge) * 2 + var(--panel-w)); }
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  .top-left { right: max(var(--edge), env(safe-area-inset-right)); width: auto; }

  /* The attribution wraps onto two lines on phones: keep the scale bar above it */
  .maplibregl-ctrl-bottom-left { bottom: calc(var(--timeline-h, 0px) + var(--edge) + env(safe-area-inset-bottom) + 40px); }

  .search__filter { display: inline-grid; }
  .chips { display: none; }
  .toolbar.chips-open .chips { display: flex; }

  .timeline { padding: var(--s1) var(--s1) var(--s1) var(--s05); }
  .timeline__info { flex-direction: column; gap: 0; margin-left: var(--s05); }
  .timeline__range { line-height: 18px; }
  .timeline__count { font-size: 11px; line-height: 16px; }
  .timeline__toggle { display: inline-grid; }
  .timeline__body { padding-left: var(--s05); }
  .timeline__chart { height: 28px; }

  /* Details become a bottom sheet you can drag */
  .event-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: calc(100% - 48px - env(safe-area-inset-top));
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    transform: translateY(100%);
  }
  .event-panel.is-open[data-sheet="half"] { transform: translateY(calc(100% - 52vh)); }
  .event-panel.is-open[data-sheet="full"] { transform: none; }
  .event-panel.is-dragging { transition: none; }
  .event-panel__head {
    position: relative;
    min-height: 48px;
    padding: var(--s2) var(--s1) 0;
    touch-action: none;
    cursor: grab;
  }
  .event-panel__handle {
    display: block;
    position: absolute;
    top: var(--s1);
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: var(--text-muted);
    opacity: 0.4;
  }
  .event-panel__body { padding: 0 var(--s2) calc(var(--s3) + env(safe-area-inset-bottom)); }
  .event__title { font-size: 20px; line-height: 26px; }

  .lightbox__stage { padding: 64px 0; }
  .lightbox__prev,
  .lightbox__next { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; }
}

/* ==========================================================================
   v3 — Worlds (Earth | Orbit | Moon), demo events and the options menu
   ========================================================================== */

/* Starfield behind the globe in Orbit view and on the Moon (stars drawn by app.js) */
:root { --space-deep: radial-gradient(ellipse at 50% 42%, #151d2f 0%, #0a0f1a 55%, #05070c 100%); }
body[data-world="orbit"] #map,
.moon-map { background: var(--starfield, none) center / 512px 512px repeat, var(--space-deep); }

/* The Moon map sits on top of the Earth map and fades in */
.moon-map {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms var(--ease), visibility 0s linear 350ms;
}
body[data-world="moon"] .moon-map { opacity: 1; visibility: visible; transition: opacity 350ms var(--ease); }

/* Always a globe in Orbit and Moon views; map styles only apply to Earth */
body:not([data-world="earth"]) .map-btn--projection { display: none; }
body[data-world="orbit"] .maplibregl-ctrl-scale { display: none; }
body[data-world="moon"] .style-switcher { display: none; }

/* Dropdowns of the top-left stack (search results, chips, options) stay above the world switcher */
.top-left { z-index: 4; }

/* ---------- World switcher (segmented control) ---------- */

.world-switcher {
  position: fixed;
  z-index: 3;
  top: calc(max(var(--edge), env(safe-area-inset-top)) + 50px);   /* below the style switcher */
  right: max(var(--edge), env(safe-area-inset-right));
  display: flex;
  gap: var(--s05);
  padding: var(--s05);
  transition: right 300ms var(--ease), left 300ms var(--ease), top 300ms var(--ease), background 300ms var(--ease);
}
body[data-world="moon"] .world-switcher { top: max(var(--edge), env(safe-area-inset-top)); }

.world-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: 500 13px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.world-switcher__btn:hover { background: var(--hover); color: var(--text); }
.world-switcher__btn[aria-checked="true"] { background: var(--active); color: var(--text); }
.world-switcher__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.world-switcher__icon { display: grid; place-items: center; }
.world-switcher__icon svg { width: 16px; height: 16px; }
.world-switcher__count {
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--hover);
  color: var(--text-muted);
  font: 600 11px/18px var(--font);
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.world-switcher__btn[aria-checked="true"] .world-switcher__count { background: var(--accent); color: #fff; }

@media (min-width: 601px) {
  body.panel-open .world-switcher { right: calc(var(--edge) * 2 + var(--panel-w)); }
}
@media (min-width: 601px) and (max-width: 760px) {
  .world-switcher__label { display: none; }
}
/* Wide screens: centred at the top */
@media (min-width: 1180px) {
  .world-switcher,
  body[data-world="moon"] .world-switcher { top: max(var(--edge), env(safe-area-inset-top)); right: auto; left: 50%; transform: translateX(-50%); }
  body.panel-open .world-switcher { right: auto; left: calc((100% - var(--panel-w) - var(--edge)) / 2); }
}
@media (min-width: 1180px) and (max-width: 1399px) {
  body.panel-open .world-switcher {
    top: calc(max(var(--edge), env(safe-area-inset-top)) + 50px);
    left: auto;
    right: calc(var(--edge) * 2 + var(--panel-w));
    transform: none;
  }
  body.panel-open[data-world="moon"] .world-switcher { top: max(var(--edge), env(safe-area-inset-top)); }
}
/* Phones: full width, just below the search box */
@media (max-width: 600px) {
  .world-switcher,
  body[data-world="moon"] .world-switcher {
    top: calc(var(--search-bottom, 128px) + var(--s1));
    left: max(var(--edge), env(safe-area-inset-left));
    right: max(var(--edge), env(safe-area-inset-right));
  }
  .world-switcher__btn { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
}

/* ---------- Options menu ("Show demo events") ---------- */

.search__options[hidden] { display: none; }
.options-menu {
  position: absolute;
  z-index: 6;
  top: 48px;
  right: 0;
  width: min(300px, 100%);
  padding: var(--s05);
}
.options-menu[hidden] { display: none; }
.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--s1);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.option-row:hover { background: var(--hover); }
.option-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.option-row__text strong { font: 500 13px/18px var(--font); color: var(--text); }
.option-row__text small { font: 400 12px/16px var(--font); color: var(--text-muted); }

.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 10px;
  background: var(--active);
  cursor: pointer;
  transition: background 160ms var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 160ms var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

/* ---------- Panel, search and tooltip additions ---------- */

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.badge--demo {
  padding: 0 12px;
  background: var(--hover);
  border: 1px dashed color-mix(in srgb, var(--text-muted) 45%, transparent);
  color: var(--text-muted);
  font: 500 12px/1 var(--font);
  letter-spacing: 0;
  text-transform: none;
}

.result__text { flex: 1; }
.result__world {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text-muted);
  font: 500 11px/16px var(--font);
}
.result__world svg { width: 12px; height: 12px; }

.tooltip .tooltip__alt { display: block; opacity: 0.9; }

/* ---------- Moon imagery error message ---------- */

.moon-message {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 32px));
  padding: var(--s2);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  text-align: center;
  font: 400 13px/18px var(--font);
  color: var(--text);
}
.moon-message[hidden],
body:not([data-world="moon"]) .moon-message { display: none; }
.moon-message__btn {
  align-self: center;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font: 500 13px/1 var(--font);
  cursor: pointer;
}
.moon-message__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }


/* ---------- v4: grouped category chips, status badge, empty-state polish ---------- */

.toolbar:not(.has-chips) .search__filter { display: none; }

.chip-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex-basis: 100%;
  width: 100%;
}
.chip-group + .chip-group { margin-top: 2px; }
.chip-group__toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  height: 20px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: 600 10px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
}
.chip-group__toggle:hover { color: var(--text); }
.chip-group__toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.chip-group__toggle[aria-pressed="false"] .chip-group__label { opacity: 0.7; }
.chip-group__hint {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 10px;
  opacity: 0.75;
}
.chip-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  width: 100%;
}

.badge--status {
  background: var(--hover);
  color: var(--text-muted);
  font-weight: 500;
}

/* When a world has no events, keep a thin, quiet bar. */
.timeline.is-empty .timeline__info { padding-bottom: 2px; }

/* ---------- Credibility rating (optional per event: green / yellow / red) ---------- */

.cred-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--s1);
  margin: 0 0 var(--s1);
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--cred) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--cred) 38%, transparent);
  color: var(--text);
  font: 400 12px/18px var(--font);
}
.cred-badge__dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--cred);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cred) 28%, transparent);
}
.cred-badge__label { font-weight: 600; }
.cred-badge__meaning { color: var(--text-muted); }

/* Thin accent stripe on the panel edge (left on desktop, top on phones). */
.event-panel[data-credibility]::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  pointer-events: none;
}
.event-panel[data-credibility="green"]::before { background: #2F9E5F; }
.event-panel[data-credibility="yellow"]::before { background: #D9A21B; }
.event-panel[data-credibility="red"]::before { background: #D2483F; }

/* Credibility filter chips */
.chip[aria-pressed="false"] .chip__dot { background: var(--text-muted); box-shadow: none; }
.chip__dot {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--cat);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cat) 25%, transparent);
}

@media (max-width: 600px) {
  .event-panel[data-credibility]::before { bottom: auto; right: 0; width: auto; height: 4px; }
}

/* ==========================================================================
   v5 — Title-card info button, About modal, and event permalink footer
   ========================================================================== */

.title-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.title-card__text { min-width: 0; }
.title-card__btn {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  margin-right: -6px;
}
.title-card__btn svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .title-card .icon-btn[data-tip]::after {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translate(-50%, -4px);
  }
  .title-card .icon-btn[data-tip]:hover::after { transform: translate(-50%, 0); }
}

@media (max-width: 600px) {
  .title-card { padding: var(--s1) 12px; gap: 6px; }
  .title-card__btn { width: 24px; height: 24px; margin-right: -4px; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: var(--s2);
  background: rgba(15, 18, 22, 0.48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal-backdrop[hidden] { display: none; }

.about-modal {
  width: min(500px, 100%);
  max-height: min(85vh, 660px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px) scale(0.985);
  transition: transform 220ms var(--ease);
}
.modal-backdrop.is-open .about-modal { transform: none; }

.about-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) var(--s2) var(--s1) var(--s3);
  border-bottom: 1px solid var(--panel-border);
}
.about-modal__title {
  margin: 0;
  font: 600 18px/24px var(--font);
  letter-spacing: -0.01em;
}
.about-modal__sub {
  margin: 2px 0 0;
  font: 400 12px/18px var(--font);
  color: var(--text-muted);
}
.about-modal__body {
  padding: var(--s2) var(--s3) var(--s3);
  overflow-y: auto;
  font: 400 14px/22px var(--font);
  color: var(--text);
}
.about-modal__body p { margin: 0 0 12px; }
.about-modal__body h3 {
  margin: 16px 0 8px;
  font: 600 11px/16px var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.about-cred-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 19px;
}
.about-cred-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.about-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--cred);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cred) 25%, transparent);
}
.about-modal__note {
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted);
}
.about-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.about-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--hover);
  color: var(--text);
  font: 500 13px/1 var(--font);
  text-decoration: none;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.about-btn:hover { background: var(--active); }
.about-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.about-btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.about-btn--primary:hover { filter: brightness(1.06); background: var(--accent); }

.event__permalink {
  margin-top: var(--s3);
  padding-top: var(--s2);
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  font: 500 12px/18px var(--font);
}
.event__permalink a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.event__permalink a:hover { color: var(--text); text-decoration: underline; }
.event__permalink svg { width: 14px; height: 14px; }

.noscript { padding: var(--s3); text-align: center; }
.noscript a { color: var(--accent); font-weight: 500; }

.about-modal__links {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 500 12px/18px var(--font);
  color: var(--text-muted);
}
.about-modal__links a {
  color: var(--text-muted);
  text-decoration: none;
}
.about-modal__links a:hover { color: var(--text); text-decoration: underline; }


}

/* ---------- Support Pill (Sleek floating badge with close cross) ---------- */

.support-pill {
  position: fixed;
  z-index: 3;
  top: calc(max(var(--edge), env(safe-area-inset-top)) + 46px);
  right: max(var(--edge), env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 9px;
  border-radius: var(--radius-sm, 8px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  transition: right 300ms var(--ease), opacity 200ms var(--ease), transform 200ms var(--ease), background 300ms var(--ease);
}

body.panel-open .support-pill {
  right: calc(var(--edge) * 2 + var(--panel-w));
}

body[data-world="moon"] .support-pill {
  top: max(var(--edge), env(safe-area-inset-top));
}

.support-pill__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text);
  font: 500 13px/1 var(--font);
  text-decoration: none;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.support-pill__link:hover {
  background: var(--hover);
  color: var(--text);
}

.support-pill__heart {
  color: #f43f5e;
  flex: none;
}

.support-pill__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.support-pill__close:hover {
  background: var(--hover);
  color: var(--text);
}

/* On mobile / narrow screens, keep the screen completely unobstructed */
@media (max-width: 640px) {
  .support-pill {
    display: none !important;
  }
}
