/* ─────────────────────────────────────────────────────────────
   what's happening — theming
   Two themes, switched via [data-theme] on <html>:
     day   → Mango Sticky Rice (warm, rounded, playful)
     night → Hoi An Lantern   (navy, glowing, serif)
   ───────────────────────────────────────────────────────────── */

[data-theme="day"] {
  --bg: #f5e8d5;
  --surface: #fff7e8;
  --surface-2: #ffffff;
  --fg: #3a2e22;
  --fg-muted: rgba(58, 46, 34, 0.45);
  --accent: #f4b942;
  --accent-2: #f08aa0;
  --accent-grad: linear-gradient(135deg, #f4b942, #e8a030);
  --accent-soft: rgba(244, 185, 66, 0.15);
  --border: rgba(244, 185, 66, 0.28);
  --danger: #e0564a;
  --radius: 20px;
  --radius-lg: 32px;
  --font-display: 'Nunito', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
  --map-filter: saturate(1.5) brightness(1.06) hue-rotate(8deg) contrast(1.02);
  --fab-fg: #ffffff;
  --overlay: rgba(58, 46, 34, 0.32);
  --shadow: 0 12px 40px rgba(58, 46, 34, 0.18);
  --caption-style: normal;
}

[data-theme="night"] {
  --bg: #0a1018;
  --surface: #162230;
  --surface-2: rgba(246, 184, 96, 0.05);
  --fg: #e9dfd0;
  --fg-muted: rgba(233, 223, 208, 0.4);
  --accent: #f6b860;
  --accent-2: #ec6f5a;
  --accent-grad: linear-gradient(135deg, #f6b860, #e8a040);
  --accent-soft: rgba(246, 184, 96, 0.1);
  --border: rgba(246, 184, 96, 0.18);
  --danger: #ec6f5a;
  --radius: 16px;
  --radius-lg: 24px;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --map-filter: brightness(0.28) saturate(1.4) hue-rotate(190deg) contrast(1.15);
  --fab-fg: #0f1820;
  --overlay: rgba(5, 10, 16, 0.58);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --caption-style: italic;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.4s ease, color 0.4s ease;
}

#map { position: fixed; inset: 0; background: var(--bg); }
.leaflet-tile-pane { filter: var(--map-filter); transition: filter 0.4s ease; }
.leaflet-control-attribution {
  background: var(--overlay) !important;
  color: var(--fg-muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--fg-muted) !important; }
.leaflet-control-zoom { display: none; }

/* ───────────────────────────────────────────────── topbar ── */
#topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 600;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.top-right { display: inline-flex; align-items: center; gap: 8px; }

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
  box-shadow: var(--shadow);
}
[data-theme="night"] .brand { font-weight: 400; letter-spacing: 0.04em; color: var(--accent); }
#happening-toggle { cursor: pointer; transition: transform 0.15s ease; }
#happening-toggle:active { transform: scale(0.96); }
.brand-caret { margin-left: 2px; font-size: 12px; opacity: 0.6; line-height: 1; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
[data-theme="night"] .dot { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.18); }
}

/* Round icon buttons in the topbar (search, etc.) */
.topbar-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.topbar-icon:active { transform: scale(0.92); }

/* Search result type chip (city / address / POI) */
.search-type-chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 6px;
  vertical-align: middle;
}

/* Search input — pick up the same look as email/text inputs */
.sheet input[type="search"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  margin-top: 6px;
  -webkit-appearance: none;
}
.sheet input[type="search"]:focus { outline: none; border-color: var(--accent); }

.account-wrap { position: relative; }
#user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  box-shadow: var(--shadow);
  max-width: 56vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.15s ease;
}
#user-chip:active { transform: scale(0.96); }
#user-chip[aria-expanded="true"] { border-color: var(--accent); }

#account-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  z-index: 700;
  animation: fade 0.15s ease;
}
.account-label { margin-bottom: 4px; }
.account-email-line {
  margin: 0 0 14px 0;
  font-weight: 800;
  color: var(--fg);
  word-break: break-all;
  font-size: 14.5px;
}
[data-theme="night"] .account-email-line { color: var(--accent); }
#signout-btn { width: 100%; margin-top: 0; }

.story-btn { margin-top: 10px; justify-content: center; gap: 8px; border-style: solid; }

/* ─────────────────────────────────────────────── add button ── */
#add-btn {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--fab-fg);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 600;
  transition: transform 0.15s ease;
}
[data-theme="day"] #add-btn { box-shadow: 0 4px 20px rgba(244, 185, 66, 0.52), 0 2px 8px rgba(58, 46, 34, 0.15); }
[data-theme="night"] #add-btn { box-shadow: 0 0 30px rgba(246, 184, 96, 0.48), 0 4px 16px rgba(0, 0, 0, 0.4); }
#add-btn:active { transform: translateX(-50%) scale(0.94); }

/* Recenter button */
#locate-btn {
  position: fixed;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 8px));
  right: 18px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 600;
  box-shadow: var(--shadow);
  animation: fade 0.2s ease;
  transition: transform 0.15s ease;
}
#locate-btn:active { transform: scale(0.9); }
#locate-btn.locating { animation: pulse 1.2s ease-in-out infinite; }

/* ─────────────────────────────────────────────── empty hint ── */
#empty-hint {
  position: fixed;
  bottom: max(110px, calc(env(safe-area-inset-bottom) + 110px));
  left: 50%; transform: translateX(-50%);
  text-align: center;
  background: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  z-index: 600;
  pointer-events: none;
  box-shadow: var(--shadow);
}
#empty-hint p { margin: 2px 0; }

/* ────────────────────────────────────────────────── modals ── */
.modal {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 22px max(28px, env(safe-area-inset-bottom)) 22px;
  position: relative;
  animation: slideUp 0.22s ease;
  border-top: 1px solid var(--border);
  /* Scroll within the sheet when its content is taller than the screen (mobile too). */
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@media (min-width: 600px) {
  .modal { align-items: center; }
  .sheet { border-radius: var(--radius-lg); max-height: 90vh; }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.sheet h2 {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
[data-theme="night"] .sheet h2 { font-weight: 400; color: var(--accent); }
.sheet label { display: block; margin: 16px 0 8px; font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.sheet input[type="email"],
.sheet input[type="text"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
}
.sheet input:focus { outline: none; border-color: var(--accent); }

.close {
  position: absolute; top: 14px; right: 14px;
  background: var(--accent-soft);
  border: none;
  color: var(--fg);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

button.primary {
  width: 100%;
  background: var(--accent-grad);
  color: var(--fab-fg);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
}
[data-theme="night"] button.primary { font-weight: 400; font-size: 20px; }
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }

button.ghost {
  width: 100%;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

button.link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  margin-top: 6px;
}
button.link.danger { color: var(--danger); }

.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }

/* ─────────────────────────────────────────────── vibe picker ── */
#vibe-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#vibe-picker button {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--fg-muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#vibe-picker button.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--fab-fg);
}

/* ─────────────────────────────────────────── happening list ── */
.happening-list { margin-top: 10px; max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.happening-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.happening-row:last-child { border-bottom: none; }
.happening-row:active { background: var(--accent-soft); }
.h-emoji {
  font-size: 20px; flex: none;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
}
.h-main { flex: 1; min-width: 0; }
.h-title {
  font-size: 15px; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="night"] .h-title { font-weight: 500; }
.h-sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.h-right { text-align: right; flex: none; }
.h-dist { font-size: 14px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.h-time { font-size: 11px; color: var(--accent-2); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ───────────────────────────────────────────── photo preview ── */
#photo-preview-wrap { margin-top: 8px; text-align: center; }
#photo-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  border: 1.5px solid var(--border);
}

/* ─────────────────────────────────────────────── post sheet ── */
#post-sheet {
  position: fixed;
  left: 12px; right: 12px;
  bottom: max(110px, calc(env(safe-area-inset-bottom) + 110px));
  max-width: 460px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 700;
  animation: slideUp 0.22s ease;
}
#post-sheet .close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0, 0, 0, 0.45); color: #fff; }
#post-photo { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.post-meta { padding: 16px; }
.post-meta .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.vibe-chip {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.countdown {
  font-size: 12px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid var(--border);
}
#post-caption {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  font-style: var(--caption-style);
  line-height: 1.42;
  color: var(--fg);
}

/* ───────────────────────────────────────── create: segmented ── */
.segmented {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 9px;
  border-radius: 999px;
  cursor: pointer;
}
.segmented button.active {
  background: var(--accent);
  color: var(--fab-fg);
}

input[type="datetime-local"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--fg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
}
input[type="datetime-local"]:focus { outline: none; border-color: var(--accent); }
[data-theme="night"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

#place-on-map { justify-content: flex-start; gap: 10px; }
#place-on-map.is-set { border-style: solid; border-color: var(--accent); color: var(--accent); }

/* ──────────────────────────────────────── place overlay ── */
#place-overlay {
  position: fixed; inset: 0;
  z-index: 900;
  pointer-events: none;
}
#place-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  color: var(--accent);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  animation: placebob 1.6s ease-in-out infinite;
}
@keyframes placebob {
  0%, 100% { transform: translate(-50%, -100%); }
  50% { transform: translate(-50%, -112%); }
}
#place-bar {
  position: absolute;
  left: 12px; right: 12px;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: 460px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  text-align: center;
}
.place-actions { display: flex; gap: 10px; margin-top: 12px; }
.place-actions button { flex: 1; margin-top: 0; }

/* ───────────────────────────────────────── post: events ── */
.post-title {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
}
[data-theme="night"] .post-title { font-weight: 500; color: var(--accent); }

.post-placeholder {
  width: 100%; height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
}
.post-placeholder span { font-size: 56px; }

.interested-btn {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.interested-btn.on {
  background: var(--accent);
  color: var(--fab-fg);
}

.directions-btn {
  margin-top: 12px;
  justify-content: center;
  gap: 8px;
  border-style: solid;
}

.calendar-btn {
  margin-top: 10px;
  justify-content: center;
  gap: 8px;
  border-style: solid;
}

/* ── Live location sharing (attendees → host) ─────────────────── */
#post-sharing { margin-top: 14px; }
.share-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}
.share-toggle input[type="checkbox"] {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 1px;
  accent-color: var(--accent);
}
.share-toggle-label { display: flex; flex-direction: column; gap: 2px; }
.share-toggle-title { font-weight: 700; font-size: 14px; color: var(--fg); }
.share-toggle-sub { display: block; }

#participants-block { margin-top: 4px; }
.participants-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}
.participants-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.participants-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.participants-list:empty + .participants-empty { display: block; }
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}
.p-num {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.p-main { flex: 1; min-width: 0; }
.p-status { font-weight: 700; color: var(--fg); }
.p-status.live { color: var(--accent); }
.p-status.stationary { color: var(--accent-2); }
.p-status.stale { color: var(--fg-muted); font-weight: 600; }
.p-sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* ── Event photo album ────────────────────────────────────────── */
#post-album { margin-top: 14px; }
.album-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.album-strip:empty { display: none; }
.album-thumb {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.album-thumb.more {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
}
.album-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.album-btn {
  flex: 1;
  margin-top: 0;
  justify-content: center;
  gap: 6px;
  border-style: solid;
  font-size: 13px;
  padding: 11px;
}
.album-sheet { max-height: 90vh; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.album-cell {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  cursor: pointer;
  background-color: var(--surface-2);
}

/* Lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  animation: fade 0.18s ease;
}
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
#lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.14);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  border-radius: 999px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
#lightbox-close { top: max(14px, env(safe-area-inset-top)); right: 14px; }
#lightbox-prev  { left: 10px;  top: 50%; transform: translateY(-50%); }
#lightbox-next  { right: 10px; top: 50%; transform: translateY(-50%); }
#lightbox-delete {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  width: auto;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
}

/* Calendar provider options */
.cal-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.cal-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg);
  text-decoration: none;
  font-family: inherit;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.cal-option:active { transform: scale(0.98); }
.cal-option:hover { border-color: var(--accent); }
.cal-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 50%;
  font-weight: 800; font-size: 18px;
  flex-shrink: 0;
}
.cal-text { display: flex; flex-direction: column; line-height: 1.3; }
.cal-title { font-weight: 700; font-size: 15px; color: var(--fg); }
.cal-sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

.private-badge {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.post-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px;
}
.post-foot .link { margin-top: 0; }
#post-delete { margin-left: auto; }

/* "Live now" countdown variant */
.countdown.live {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
  font-weight: 700;
}

/* ──────────────────────────────────────────────── map pins ── */
.pin-wrap { text-align: center; }
.pin-wrap, .pin-wrap * { -webkit-user-select: none; user-select: none; }

.vibe-pin {
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.vibe-pin span { font-size: 20px; line-height: 1; }

/* Day pins — fruit-style circles */
[data-theme="day"] .vibe-pin {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 12px rgba(58, 46, 34, 0.25);
}

/* Night pins — glowing lanterns */
[data-theme="night"] .vibe-pin {
  width: 36px; height: 40px;
  position: relative;
  filter: drop-shadow(0 0 9px rgba(246, 184, 96, 0.75));
}
[data-theme="night"] .vibe-pin::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 184, 96, 0.28), transparent 70%);
}

.vibe-pin.fresh { animation: ping 2.4s ease-in-out infinite; }
@keyframes ping {
  0% { box-shadow: 0 3px 12px rgba(0,0,0,0.3), 0 0 0 0 var(--accent); }
  70% { box-shadow: 0 3px 12px rgba(0,0,0,0.3), 0 0 0 14px transparent; }
  100% { box-shadow: 0 3px 12px rgba(0,0,0,0.3), 0 0 0 0 transparent; }
}

.pin-label {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}
[data-theme="day"] .pin-label { background: #fff; color: var(--fg); box-shadow: 0 1px 6px rgba(58, 46, 34, 0.12); }
[data-theme="night"] .pin-label { background: transparent; color: var(--accent); font-weight: 400; }
.pin-timer { margin-top: 3px; font-size: 9px; font-weight: 600; color: var(--accent-2); }
.pin-timer.live { color: #fff; background: var(--accent-2); padding: 1px 6px; border-radius: 999px; font-weight: 700; }

/* Event pins — distinct rounded-square badge in the contrasting accent */
[data-theme="day"] .vibe-pin.event { border-radius: 13px; border-color: var(--accent-2); }
[data-theme="night"] .vibe-pin.event { filter: drop-shadow(0 0 9px rgba(236, 111, 90, 0.85)); }
[data-theme="night"] .vibe-pin.event::before { background: radial-gradient(circle, rgba(236, 111, 90, 0.3), transparent 70%); }

/* Cluster bubbles */
.cluster-wrap { background: transparent; }
.cluster-bubble {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--fab-fg);
  background: var(--accent-grad);
  border: 2.5px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
[data-theme="night"] .cluster-bubble {
  border-color: rgba(246, 184, 96, 0.55);
  box-shadow: 0 0 16px rgba(246, 184, 96, 0.45);
  font-weight: 600;
}
.cluster-bubble span { font-size: 15px; line-height: 1; }

/* Me marker */
.me-marker {
  width: 16px; height: 16px;
  background: #5eb1ff;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(94, 177, 255, 0.25);
}
