/* ============================================================
   Been There — visual style
   Dark glassmorphism with animated aurora background.
   ============================================================ */

:root {
  /* Ubuntu-inspired: deep aubergine bg, signature orange + plum accents. */
  --bg-0:        #1a0010;
  --bg-1:        #2c001e;     /* canonical Ubuntu aubergine */
  --bg-2:        #3d0e2a;
  --surface:     rgba(255,255,255,0.05);
  --surface-2:   rgba(255,255,255,0.10);
  --border:      rgba(255,255,255,0.10);
  --border-2:    rgba(255,255,255,0.18);
  --text:        #f7f4f6;
  --muted:       #b8a5b1;     /* warm purple-gray */
  --accent:      #e95420;     /* Ubuntu orange */
  --accent-2:    #f7a878;     /* lighter orange */
  --accent-3:    #77216f;     /* mid aubergine — purple highlight */
  --accent-4:    #aea79f;     /* Canonical "warm gray" */
  --good:        #4cb78a;
  --warn:        #f4a261;
  --bad:         #c44d3a;
  --shadow-lg:   0 22px 50px rgba(0,0,0,0.55);
  --shadow-md:   0 10px 30px rgba(0,0,0,0.42);
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  background:
    radial-gradient(1200px 800px at 80% -10%, #4d1a3a 0%, transparent 60%),
    radial-gradient(900px 700px at -10% 120%, #77216f 0%, transparent 55%),
    radial-gradient(700px 500px at 100% 100%, rgba(233,84,32,0.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea, button { color: inherit; font-family: inherit; }
input, select, textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,84,32,0.22);
  background: rgba(255,255,255,0.08);
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- Aurora background ---------- */
.aurora {
  position: fixed; inset: 0;
  background:
    radial-gradient(40rem 28rem at 18% 25%, rgba(233,84,32,0.18), transparent 60%),
    radial-gradient(38rem 28rem at 82% 72%, rgba(119,33,111,0.30), transparent 60%),
    radial-gradient(30rem 22rem at 50% 100%, rgba(174,167,159,0.10), transparent 60%);
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
  animation: aurora-shift 22s ease-in-out infinite alternate;
}
.aurora.subtle { opacity: 0.55; }
@keyframes aurora-shift {
  0%   { transform: translate3d(0,0,0) scale(1.0); }
  50%  { transform: translate3d(-2%,1%,0) scale(1.05); }
  100% { transform: translate3d(2%,-1%,0) scale(1.02); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600;
  transition: transform .15s, background .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); background: var(--surface-2); border-color: var(--border-2); }
.btn:active { transform: translateY(0); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 8px 22px rgba(233,84,32,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(233,84,32,0.45); }
.btn-ghost { background: transparent; }
.btn-danger { background: linear-gradient(135deg, var(--bad), #e07060); border-color: rgba(255,255,255,0.14); }

.alert {
  background: rgba(196,77,58,0.16);
  border: 1px solid rgba(196,77,58,0.45);
  color: #f5c9bd;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}

label { display: block; }
label > span:first-child { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.02em; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: end; }
.row .grow { flex: 1; }
.row .lat-lng { width: 110px; }

/* ---------- Auth pages ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; position: relative; }

/* Backdrop layers shared by login.php / setup.php.
   Stack order, back to front:
     .photo-backdrop  (optional, family photos crossfading)
     .aurora          (color wash)
     .ca-pano         (panorama silhouette pinned to bottom)
     .auth-card       (form, on top)                                          */
.photo-backdrop {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
/* Vignette + bottom-ramp overlay so the auth card stays readable
   while the duotone photo carries the page. */
.photo-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(80% 70% at 50% 45%, transparent 38%, rgba(26,0,16,0.72) 100%),
    linear-gradient(180deg, rgba(26,0,16,0.22) 0%, rgba(26,0,16,0.55) 100%);
}
.photo-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: url(#bt-duotone) contrast(1.08) blur(0.4px);
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: opacity, transform;
}
.photo-layer.is-on {
  opacity: 0.85;
  animation: ken-burns 22s ease-in-out infinite alternate;
}
@keyframes ken-burns {
  from { transform: scale(1.05) translate(-1%, 0); }
  to   { transform: scale(1.13) translate(1.5%, -1.5%); }
}
@media (prefers-reduced-motion: reduce) {
  .photo-layer.is-on { animation: none; transform: scale(1.05); }
}

/* Empty-state hint when no photos are present. */
.auth-page:not(.has-photos) .photo-empty-hint {
  position: fixed; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); opacity: 0.5;
  z-index: 1; pointer-events: none;
}

.ca-pano {
  position: fixed; left: 0; right: 0; bottom: 0;
  width: 100%; height: clamp(190px, 32vh, 320px);
  z-index: 0; pointer-events: none;
  filter: drop-shadow(0 -10px 20px rgba(26,0,16,0.45));
}
.ca-pano .ca-sun > circle:last-child {
  animation: sun-pulse 4.5s ease-in-out infinite alternate;
  transform-origin: 160px 170px;
}
@keyframes sun-pulse {
  from { opacity: 0.82; }
  to   { opacity: 1.00; }
}
.ca-pano .ca-olive {
  animation: olive-fade 8s ease-in-out infinite alternate;
}
@keyframes olive-fade {
  from { opacity: 0.45; }
  to   { opacity: 0.65; }
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 6px 0 4px; font-size: 22px; }

/* Minimal "key icon" login — used on login.php / setup.php */
.auth-card-mini {
  max-width: 320px;
  padding: 22px 22px 20px;
}
.auth-mini-icon {
  display: block;
  width: 44px; height: 44px;
  margin: 2px auto 14px;
  font-size: 20px;
  line-height: 44px;
  text-align: center;
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(233,84,32,0.10);
  border: 1px solid rgba(233,84,32,0.30);
}
.auth-mini-title {
  text-align: center;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.center { text-align: center; }
.stack.tight > * + * { margin-top: 10px; }
.btn-block { width: 100%; }

/* Floating-label inputs for the minimal auth card */
.floating { position: relative; }
.floating > input {
  padding: 14px 12px 8px;
}
.floating > span {
  position: absolute; left: 12px; top: 11px;
  font-size: 14px; color: var(--muted);
  pointer-events: none;
  transition: transform .15s ease, font-size .15s ease, color .15s ease;
}
.floating > input:focus + span,
.floating > input:not(:placeholder-shown) + span {
  transform: translateY(-9px);
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.04em;
}
.auth-card .auth-logo {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin: 0 auto 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 55%, var(--accent-3) 110%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(233,84,32,0.40), 0 4px 14px rgba(119,33,111,0.50), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: logo-bob 4.5s ease-in-out infinite alternate;
}
@keyframes logo-bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.auth-card form { margin-top: 14px; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-foot { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 13px; }

/* ---------- App layout ---------- */
.app { position: relative; z-index: 1; }
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px;
  background: rgba(26,0,16,0.70);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer;
}
.brand .brand-icon {
  display: inline-block;
  width: 30px; height: 30px;
  background-color: var(--accent);
  -webkit-mask: url('../img/boomstick-logo.png') center / contain no-repeat;
          mask: url('../img/boomstick-logo.png') center / contain no-repeat;
  filter: drop-shadow(0 4px 10px rgba(233,84,32,0.45));
  transition: transform .25s, background-color .25s;
}
.brand:hover .brand-icon {
  animation: pin-wobble 0.7s ease;
  background-color: var(--accent-2);
}
@keyframes pin-wobble {
  0%,100% { transform: rotate(0); }
  30%     { transform: rotate(-12deg); }
  60%     { transform: rotate(8deg); }
}
.page-title { font-weight: 600; opacity: 0.85; }

.map-tabs { position: relative; display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; margin-left: auto; }
.tab {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; background: transparent;
  border-radius: 999px; color: var(--muted); font-weight: 600;
  transition: color .2s;
}
.tab.is-active { color: var(--text); }
.tab:hover { color: var(--text); }
.tab-slider {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px; z-index: 1;
  transition: transform .35s cubic-bezier(.2,.9,.25,1.2), width .35s ease;
  box-shadow: 0 6px 18px rgba(233,84,32,0.45);
}

.user-chip-wrap {
  position: relative;
  margin-left: 4px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font: inherit; color: inherit; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--border-2); }
.user-chip:active { transform: translateY(0.5px); }
.user-chip .name { font-weight: 600; }
.role-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--muted);
}
.role-admin  { color: #fcc99e; border-color: rgba(247,168,120,0.45); background: rgba(233,84,32,0.14); }
.role-editor { color: #b8a5b1; border-color: rgba(174,167,159,0.30); background: rgba(174,167,159,0.10); }
.role-viewer { color: #b8a5b1; border-color: rgba(119,33,111,0.45);  background: rgba(119,33,111,0.18); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 180px; padding: 6px;
  background: rgba(44,0,30,0.95);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: menu-in .18s ease;
}
.user-menu[hidden] { display: none; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 8px 12px; border-radius: 8px;
  background: transparent; border: 0; color: var(--text); text-decoration: none;
  font-size: 14px;
}
.user-menu a > i, .user-menu button > i { width: 16px; color: var(--muted); }
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.user-menu a:hover > i, .user-menu button:hover > i { color: var(--accent-2); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }

/* Reusable "user mark" — colored circle with the user's chosen FA / boomstick icon. */
.user-mark {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c, var(--accent));
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 0 0 1px rgba(0,0,0,0.18);
}
.user-mark .user-icon { font-size: 11px; line-height: 1; }
.user-mark-dot { width: 14px; height: 14px; }
.user-icon-boomstick {
  display: inline-block;
  width: 1em; height: 1em;
  background-color: currentColor;
  -webkit-mask: url('../img/boomstick-logo.png') center / contain no-repeat;
          mask: url('../img/boomstick-logo.png') center / contain no-repeat;
}

.layout {
  display: grid; grid-template-columns: 340px 1fr;
  height: calc(100vh - 61px);
}

/* ---------- Sidebar ---------- */
.sidebar {
  overflow-y: auto;
  padding: 18px;
  background: rgba(26,0,16,0.60);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 18px;
}
.sidebar h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar h3 i { color: var(--accent-2); font-size: 11px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 10px; border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(233,84,32,0.12), rgba(119,33,111,0.18));
  border: 1px solid var(--border);
}
.stat .stat-icon { color: var(--accent-2); font-size: 14px; opacity: 0.75; margin-bottom: 4px; }
.stat .num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(135deg, #fff, #f7a878); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }

.user-filters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 10px; cursor: pointer;
  transition: background .2s;
}
.user-row:hover { background: var(--surface); }
.user-row input { width: auto; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.user-row .name { flex: 1; font-weight: 600; font-size: 15px; letter-spacing: 0.005em; }
.count-ring {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 0 2px rgba(255,255,255,0.08),
    0 4px 10px rgba(0,0,0,0.35);
  transition: box-shadow .25s, transform .15s;
}
.user-row:hover .count-ring {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 0 0 2px rgba(255,255,255,0.16),
    0 0 18px -2px var(--c, transparent),
    0 4px 12px rgba(0,0,0,0.40);
  transform: scale(1.08);
}

.add-block .row { gap: 8px; }
.sign-in-link { padding: 8px 14px; }
.drop-pin-btn { display: flex; margin: 6px auto 0; min-width: 140px; }

/* Compact add-place form: title + search + location confirm + drop button.
   Notes / visited tucked behind a <details> toggle. */
.add-block.compact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
}
.add-block.compact h3 { margin: 0 0 10px; }
.add-block.compact .title-input { font-weight: 600; }
.loc-confirm {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  background: rgba(233,84,32,0.10);
  border: 1px solid rgba(233,84,32,0.28);
  font-size: 13px;
}
.loc-confirm > i { color: var(--accent-2); flex-shrink: 0; }
.loc-confirm .loc-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.loc-confirm strong { font-weight: 600; font-size: 13px; }
.loc-confirm em {
  font-style: normal; color: var(--muted); font-size: 11px;
  font-variant-numeric: tabular-nums;
}

details.more-options {
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
}
details.more-options summary {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex; align-items: center; gap: 6px;
}
details.more-options summary::-webkit-details-marker { display: none; }
details.more-options summary i { transition: transform .2s; }
details.more-options[open] summary i { transform: rotate(90deg); }
details.more-options .more-fields {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 12px 12px;
}
.wishlist-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: rgba(247,168,120,0.10);
  border: 1px dashed rgba(247,168,120,0.45);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.wishlist-toggle input { width: auto; flex-shrink: 0; accent-color: var(--accent); }
.wishlist-toggle i { color: var(--accent-2); }
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; z-index: 2; pointer-events: none;
}
.search-wrap input { padding-left: 34px; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  list-style: none; margin: 0; padding: 6px;
  background: rgba(44,0,30,0.97);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto;
}
.search-results li { padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.search-results li:hover { background: var(--surface-2); }
.search-results .search-empty { color: var(--muted); font-style: italic; cursor: default; }
.search-results .search-empty:hover { background: transparent; }

.list-block {
  margin-top: auto;          /* lock recents to the bottom of the sidebar */
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.pin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pin-item {
  display: flex; align-items: stretch; gap: 4px;
  border-radius: 10px;
  transition: background .2s, transform .15s;
}
.pin-item:hover { background: var(--surface); transform: translateX(2px); }
.pin-go {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: transparent; border: 0; text-align: left;
  border-radius: 10px;
}
.pin-go .text { display: flex; flex-direction: column; line-height: 1.2; }
.pin-go strong { font-size: 14px; }
.pin-go em { font-style: normal; color: var(--muted); font-size: 12px; }
.pin-del { background: transparent; border: 0; color: var(--muted); padding: 0 12px; border-radius: 8px; font-size: 13px; transition: background .15s, color .15s; }
.pin-del:hover { background: rgba(196,77,58,0.20); color: #f5c9bd; }

/* ---------- Map stage ---------- */
.map-stage { position: relative; }
.map-pane {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.map-pane.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
#map-world { background: #1a0010; }
/* Hue-shift Dark Matter tiles toward aubergine and warm them slightly. */
#map-world .leaflet-tile-pane {
  filter: hue-rotate(285deg) saturate(0.78) brightness(0.95) contrast(1.04);
}
/* Soft warm vignette between tiles and markers — z-index 401 sits above
   tile + overlay panes (200, 400) but below markers (600). */
#map-world::after {
  content: "";
  position: absolute; inset: 0; z-index: 401;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(26,0,16,0.40) 100%),
    radial-gradient(60% 40% at 80% 90%, rgba(233,84,32,0.06), transparent 70%);
}
#map-us {
  background: radial-gradient(900px 600px at 50% 50%, #3d0e2a 0%, #1a0010 70%);
}

/* Leaflet on dark UI: punch up attribution + tweaks */
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution {
  background: rgba(26,0,16,0.75) !important;
  color: var(--muted) !important;
  border-top-left-radius: var(--r-sm);
}
.leaflet-control-attribution a { color: var(--text) !important; }

/* ---------- Pin markers (Leaflet HTML icon) ---------- */
.bt-pin-wrap { background: transparent !important; border: 0 !important; }
.bt-pin {
  position: relative; display: block; width: 34px; height: 42px;
  --c: var(--accent);
}
.bt-pin .bt-pin-head {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 80%, white 20%), var(--c) 70%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  display: grid; place-items: center;
  color: #fff;
}
.bt-pin .bt-pin-head .user-icon { font-size: 18px; line-height: 1; }
.bt-pin .bt-pin-tail {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--c);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.35));
}
.bt-pin .bt-pin-shadow {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 4px; border-radius: 50%;
  background: rgba(0,0,0,0.4); filter: blur(2px);
}
.bt-pin-wrap:hover .bt-pin { animation: pin-bounce 0.5s ease; }

/* Wishlist ("want to visit") pins — same shape, different texture/feel */
.bt-pin.is-wishlist .bt-pin-head {
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 70%, white 30%), var(--c) 75%);
  opacity: 0.78;
  outline: 1.5px dashed rgba(255,255,255,0.85);
  outline-offset: -2px;
  animation: wishlist-pulse 2.4s ease-in-out infinite;
}
.bt-pin.is-wishlist .bt-pin-tail   { opacity: 0.78; }
.bt-pin.is-wishlist .user-icon     { color: rgba(255,255,255,0.95); }
@keyframes wishlist-pulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,255,255,0.0); }
  50%      { box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 0 6px rgba(255,255,255,0.15); }
}

/* ---------- World-map city reference markers ---------- */
.bt-city-wrap { background: transparent !important; border: 0 !important; pointer-events: none; }
.bt-city {
  position: absolute; top: -2px; left: -2px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.bt-city-dot {
  display: inline-block;
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55);
  flex-shrink: 0;
}
.bt-city-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.01em;
  color: rgba(255,255,255,0.92);
  text-shadow:
    0 0 2px rgba(0,0,0,0.85), 0 0 4px rgba(0,0,0,0.65),
    0 1px 2px rgba(0,0,0,0.85);
}
@keyframes pin-bounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* ---------- Leaflet popup styling ---------- */
.leaflet-popup-content-wrapper {
  background: rgba(44,0,30,0.96);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.leaflet-popup-tip { background: rgba(44,0,30,0.96); }
.leaflet-popup-content { margin: 0; min-width: 220px; }
.pin-popup { padding: 12px 14px; }
.pin-popup .pp-hero {
  position: relative;
  margin: -12px -14px 10px;
  height: 110px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(119,33,111,0.45), rgba(247,168,120,0.18));
}
.pin-popup .pp-hero img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; opacity: 0; transition: opacity .35s ease;
}
.pin-popup .pp-hero img.is-loaded { opacity: 1; }
.pin-popup .pp-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(44,0,30,0) 55%, rgba(44,0,30,0.85) 100%);
  pointer-events: none;
}
.pin-popup .pp-hero.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.35); font-size: 20px;
}
.pin-popup .pp-head { padding-bottom: 6px; border-bottom: 2px solid var(--c, var(--accent)); margin-bottom: 8px; }
.pin-popup .pp-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pin-popup .pp-meta .who { display: flex; align-items: center; gap: 6px; }
.pin-popup .pp-meta .who i.dot { width: 8px; height: 8px; box-shadow: none; }
.pp-country {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text);
  margin: -2px 0 8px;        /* nestles up under the title */
  font-weight: 500;
}
.pp-country .pp-flag {
  font-size: 16px; line-height: 1;
  /* keep emoji flags from getting filter-tinted by parent rules */
  filter: none;
}
/* Attribution footer — who placed it + when. Sits last, quietly. */
.pp-footer {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pin-popup p { margin: 6px 0; line-height: 1.4; }
.pin-popup .pp-del {
  margin-top: 6px; background: rgba(196,77,58,0.18); color: #f5c9bd;
  border: 1px solid rgba(196,77,58,0.40); border-radius: 8px;
  padding: 4px 10px; font-size: 12px;
}
.pin-popup .pp-del:hover { background: rgba(196,77,58,0.32); }

/* ---------- US map (D3 SVG) ---------- */
.us-map-svg path.state {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(255,255,255,0.15);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
  transition: fill .35s ease, stroke .25s ease, transform .25s ease;
}
.us-map-svg path.state:hover {
  fill: rgba(255,255,255,0.10);
  cursor: pointer;
}
.us-map-svg path.state.is-visited {
  fill: url(#visited-grad);
  stroke: rgba(255,255,255,0.30);
}
.us-map-svg path.state.is-zoomed {
  stroke: var(--accent-2);
  stroke-width: 1.3;
  filter: drop-shadow(0 0 6px rgba(247,168,120,0.45));
}
/* Wishlist pin body on the US (D3) map: dashed outline, slightly faded fill */
.us-map-svg .pin-body.is-wishlist {
  stroke: rgba(255,255,255,0.95);
  stroke-width: 1.1;
  stroke-dasharray: 1.6 1.4;
  fill-opacity: 0.78;
}

/* Floating "Back to U.S." button shown when a state is zoomed in */
.map-back-btn {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: rgba(44,0,30,0.88);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  animation: menu-in .2s ease;
  transition: background .15s, transform .15s, border-color .15s;
}
.map-back-btn:hover {
  background: var(--accent);
  border-color: rgba(255,255,255,0.30);
  transform: translateY(-1px);
}
.map-back-btn i { color: var(--accent-2); transition: color .15s, transform .25s; }
.map-back-btn:hover i { color: #fff; transform: translateX(-2px); }
.map-back-btn.is-hidden { display: none; }
.us-map-svg .state-border { stroke: rgba(255,255,255,0.45); stroke-width: 0.8; pointer-events: none; vector-effect: non-scaling-stroke; }
.us-map-svg .city-dot {
  fill: rgba(255,255,255,0.85);
  stroke: rgba(0,0,0,0.55);
  stroke-width: 0.5;
  transition: r .15s, fill .15s, opacity .25s;
}
.us-map-svg .city-label {
  fill: rgba(255,255,255,0.78);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.85);
  stroke-width: 2.2px;
  stroke-linejoin: round;
  pointer-events: none;
  transition: opacity .25s;
}
/* Tier-2 cities: dot smaller and label hidden until zoomed in */
.us-map-svg .us-city.tier-2 .city-dot { fill: rgba(255,255,255,0.55); opacity: 0.7; }
.us-map-svg .us-city.tier-2 .city-label { opacity: 0; }
.us-map-svg.is-zoomed-2 .us-city.tier-2 .city-dot { opacity: 1; }
.us-map-svg.is-zoomed-4 .us-city.tier-2 .city-label { opacity: 1; }
.us-map-svg .us-city:hover .city-dot {
  fill: var(--accent-2);
  r: 3.4;
}
.us-map-svg .us-city:hover .city-label {
  fill: #fff;
  font-weight: 700;
}
/* Region labels — text-only callouts (Hawaiian islands etc.) */
.us-map-svg .region-label {
  fill: rgba(247,168,120,0.85);
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.85);
  stroke-width: 2.4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.bt-pin-svg { cursor: pointer; }
.bt-pin-svg:hover .bt-pin { animation: pin-bounce 0.5s ease; }
.bt-pin-svg:hover .bt-pin-head { filter: brightness(1.15); }
/* foreignObject contents need explicit overflow so the shadow span isn't clipped */
.bt-pin-svg foreignObject { overflow: visible; }
.focus-halo { fill: none; stroke: var(--accent-2); stroke-width: 2.5; pointer-events: none; }

/* ---------- Legend ---------- */
.legend {
  position: absolute; bottom: 16px; left: 16px; z-index: 5;
  background: rgba(44,0,30,0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.legend > span { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; font-size: 10px; letter-spacing: 0.12em; }
.legend > span i { color: var(--accent-2); }
.legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.legend ul li { display: flex; align-items: center; gap: 8px; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 10px 14px; min-width: 220px;
  background: rgba(44,0,30,0.95);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: 14px;
}
.toast-error { border-color: rgba(196,77,58,0.50); }
.toast-info  { border-color: rgba(233,84,32,0.45); }

/* ---------- Admin page ---------- */
.admin-page .topbar .brand { margin-right: 16px; }
.admin-shell {
  display: grid; grid-template-columns: 380px 1fr; gap: 18px;
  padding: 18px;
}
.admin-shell.single { grid-template-columns: minmax(0, 720px); justify-content: center; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.kv {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px;
  margin: 14px 0 4px;
}
.kv > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.rule { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.glow-on-hover { transition: box-shadow .35s, transform .25s, border-color .25s; }
.glow-on-hover:hover { border-color: var(--border-2); box-shadow: 0 18px 40px rgba(233,84,32,0.20), 0 8px 20px rgba(119,33,111,0.30); transform: translateY(-2px); }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.grid .full { grid-column: 1 / -1; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.palette .swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s;
  padding: 0;
}
.palette .swatch:hover { transform: scale(1.10); }
.palette .swatch.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.30); }
.palette .swatch-custom {
  background: conic-gradient(from 0deg, #ff5050, #ff9b3d, #ffd166, #4cb78a, #4a8ddc, #8c52d6, #d65fb1, #ff5050) !important;
  border: 2px dashed rgba(255,255,255,0.55) !important;
  position: relative;
  -webkit-appearance: none; appearance: none;
}
.palette .swatch-custom::-webkit-color-swatch-wrapper { padding: 0; }
.palette .swatch-custom::-webkit-color-swatch { border: 0; border-radius: 50%; }
.palette .swatch-custom::-moz-color-swatch    { border: 0; border-radius: 50%; }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
}
.icon-tile {
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.icon-tile:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.icon-tile.active {
  background: rgba(233,84,32,0.20);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 10px rgba(233,84,32,0.30);
}
.icon-tile .user-icon-boomstick { width: 18px; height: 18px; }

.users-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.users-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.users-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 14px; }
.users-table code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.users-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { padding: 3px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }

/* ---------- US-map "closest cities" popover ---------- */
.city-menu {
  position: fixed; z-index: 250;
  min-width: 220px;
  background: rgba(44,0,30,0.97);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: menu-in .16s ease;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.city-menu[hidden] { display: none; }
.city-menu header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 8px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
}
.city-menu header i { color: var(--accent-2); margin-right: 6px; }
.city-menu-close {
  background: transparent; border: 0; color: var(--muted);
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.city-menu-close:hover { background: var(--surface-2); color: var(--text); }
.city-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.city-menu li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
  transition: background .15s;
}
.city-menu li:hover { background: var(--surface-2); }
.city-menu .city-name { font-weight: 600; flex: 1; font-size: 14px; }
.city-menu .city-dist { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.city-menu .city-add {
  background: transparent; border: 0; color: var(--accent-2);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  transition: background .15s, color .15s, transform .15s;
}
.city-menu .city-add:hover {
  background: var(--accent); color: #fff; transform: scale(1.10);
}

/* ---------- Floating pin info card (US map pin clicks) ---------- */
.pin-card {
  position: fixed; z-index: 260;
  width: 260px; max-width: calc(100vw - 24px);
  background: rgba(44,0,30,0.97);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 14px 12px;
  animation: menu-in .16s ease;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  color: var(--text);
}
.pin-card[hidden] { display: none; }
.pin-card .pp-hero {
  position: relative;
  margin: -14px -14px 10px;
  height: 120px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(119,33,111,0.45), rgba(247,168,120,0.18));
}
.pin-card .pp-hero img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; opacity: 0;
  transition: opacity .35s ease;
}
.pin-card .pp-hero img.is-loaded { opacity: 1; }
.pin-card .pp-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(44,0,30,0) 55%, rgba(44,0,30,0.85) 100%);
  pointer-events: none;
}
.pin-card .pp-hero.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.35); font-size: 22px;
}
.pin-card-close {
  position: absolute; top: 6px; right: 6px;
  background: transparent; border: 0; color: var(--muted);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.pin-card-close:hover { background: var(--surface-2); color: var(--text); }
.pin-card .pp-head {
  padding-right: 22px; padding-bottom: 6px;
  border-bottom: 2px solid var(--c, var(--accent));
  margin-bottom: 8px;
  font-size: 15px;
}
.pin-card .pp-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.pin-card .pp-meta .who { display: flex; align-items: center; gap: 6px; }
.pin-card .pp-meta .who i.dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.pin-card p { margin: 6px 0 0; line-height: 1.4; font-size: 13px; }
.pin-card .pp-wishlist {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 2px 8px; font-size: 11px;
  border: 1px solid var(--accent-2); border-radius: 999px;
  color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em;
}
.pin-card .pp-del {
  margin-top: 10px; background: rgba(196,77,58,0.18); color: #f5c9bd;
  border: 1px solid rgba(196,77,58,0.40); border-radius: 8px;
  padding: 5px 10px; font-size: 12px;
}
.pin-card .pp-del:hover { background: rgba(196,77,58,0.32); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  animation: modal-fade .2s ease;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,0,6,0.62);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
}
.modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: rgba(44,0,30,0.97);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: modal-pop .25s cubic-bezier(.2,.9,.25,1.2);
}
.modal-title { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.modal-title i { color: var(--accent-2); }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0; color: var(--muted);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.field-label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.02em; }
.field { display: flex; flex-direction: column; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop  { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Animation hooks ---------- */
[data-anim] { will-change: transform, opacity; }

/* ---------- Mobile niceties ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { max-height: 50vh; }
  .map-stage { height: 60vh; }
  .map-tabs { order: 3; width: 100%; margin: 0; }
  .topbar { flex-wrap: wrap; }
}

/* ---------- Reduced motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .aurora { animation: none; }
}
