/* onboarding-1: Location + Interests setup overlay & Profile card (#ld-prefs-card) */
/* onboarding-3: Tour spotlight & card */

/* Modal overlay container */
.ld-setup-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: ldFadeIn 0.2s ease-out;
}

@keyframes ldFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ld-setup-card {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  box-sizing: border-box;
}

.ld-setup-head {
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, #2a2a45);
}

.ld-setup-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ld-setup-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #fff);
}

.ld-setup-step-num {
  font-size: 12px;
  color: var(--accent, #fbbf24);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ld-setup-close {
  background: none;
  border: none;
  color: var(--text-2, #94a3b8);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}

.ld-setup-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text, #fff);
}

.ld-setup-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.ld-setup-geo-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface, #24243e);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 12px;
  color: var(--text, #fff);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.ld-setup-geo-btn:hover {
  background: var(--border, #2a2a45);
  border-color: var(--accent, #fbbf24);
}

.ld-setup-geo-msg {
  font-size: 13px;
  color: var(--accent, #fbbf24);
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
}

.ld-setup-geo-msg.is-err {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.ld-setup-search-wrap {
  position: relative;
  width: 100%;
}

.ld-setup-search {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 38px;
  background: var(--bg, #0b1020);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 12px;
  color: var(--text, #fff);
  font-size: 14px;
  box-sizing: border-box;
}

.ld-setup-search:focus {
  outline: none;
  border-color: var(--accent, #fbbf24);
}

.ld-setup-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2, #94a3b8);
  pointer-events: none;
}

.ld-setup-hubs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.ld-setup-hub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg, #0b1020);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 12px;
  color: var(--text, #fff);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
  min-height: 48px;
  box-sizing: border-box;
}

.ld-setup-hub-item:hover {
  border-color: var(--accent, #fbbf24);
  background: var(--surface, #24243e);
}

.ld-setup-hub-item.is-selected {
  border-color: var(--accent, #fbbf24);
  background: #fbbf24;
  color: #1d1238;
  font-weight: 700;
}
.ld-setup-hub-item.is-selected .ld-setup-check { color: #1d1238; }

.ld-setup-check {
  color: var(--accent, #fbbf24);
  font-weight: bold;
}

/* Interests chips grid */
.ld-setup-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.ld-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--bg, #0b1020);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 22px;
  color: var(--text, #fff);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.ld-chip-btn:hover {
  border-color: var(--accent, #fbbf24);
  background: var(--surface, #24243e);
}

.ld-chip-btn.is-selected {
  background: var(--accent, #fbbf24);
  color: #0b1020;
  border-color: var(--accent, #fbbf24);
  font-weight: 600;
}

.ld-setup-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border, #2a2a45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ld-setup-skip-btn {
  background: none;
  border: none;
  color: var(--text-2, #94a3b8);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 10px;
}

.ld-setup-skip-btn:hover {
  color: var(--text, #fff);
  background: rgba(255,255,255,0.05);
}

.ld-setup-next-btn {
  min-height: 44px;
  padding: 0 24px;
  background: var(--accent, #fbbf24);
  color: #0b1020;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.ld-setup-next-btn:hover {
  opacity: 0.9;
}

/* Profile Card #ld-prefs-card */
#ld-prefs-card {
  background: var(--surface, #1a1a2e);   /* followed the dark fallback in light mode */
  border: 1px solid var(--line, #2a2a45);
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text, #fff);
  box-sizing: border-box;
}
#ld-prefs-card .ld-prefs-label, #ld-prefs-card small { color: var(--text-3, #9aa3b5); }

.ld-prefs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ld-prefs-label {
  font-size: 14px;
  color: var(--text-2, #94a3b8);
}

.ld-prefs-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #fff);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ld-prefs-edit-btn {
  background: var(--surface, #24243e);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 8px;
  color: var(--accent, #fbbf24);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ld-prefs-edit-btn:hover {
  background: var(--border, #2a2a45);
  border-color: var(--accent, #fbbf24);
}

.ld-prefs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ld-pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg, #0b1020);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text, #fff);
}

/* fix: card stays dark in both themes, keep title readable */
.ld-setup-modal .ld-setup-title { color: #f5f7ff !important; }

/* onboarding-2: Town Hall card & Near You styles */
.ld-th-card { background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a45); border-radius: 16px; padding: 16px; margin: 16px 0; color: var(--text, #fff); }
.ld-th-img-wrap { border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.ld-th-img-wrap img { width: 100%; height: 160px; object-fit: cover; display: block; }
.ld-th-credit { font-size: 11px; color: var(--text-2, #94a3b8); margin-top: 6px; }
.ld-th-credit a { color: var(--accent, #fbbf24); text-decoration: none; }
.ld-th-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--text, #fff); }
.ld-th-fields { display: flex; flex-direction: column; gap: 10px; }
.ld-th-field { display: flex; flex-direction: column; gap: 2px; }
.ld-th-field-label { font-size: 12px; color: var(--text-2, #94a3b8); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.ld-th-field-val { font-size: 14px; color: var(--text, #fff); font-weight: 500; word-break: break-all; }
.ld-th-field-val a { color: var(--accent, #fbbf24); text-decoration: none; }
.ld-th-source { font-size: 11px; color: var(--accent, #fbbf24); text-decoration: none; opacity: 0.8; margin-top: 2px; display: inline-block; }
.ld-th-source:hover { opacity: 1; text-decoration: underline; }

.ld-city-modal { position: fixed; inset: 0; background: rgba(11, 16, 32, 0.85); backdrop-filter: blur(8px); z-index: 10000; display: flex; align-items: flex-end; }
.ld-city-sheet { background: var(--card, #1a1a2e); border-top: 1px solid var(--border, #2a2a45); width: 100%; height: 90vh; border-radius: 20px 20px 0 0; padding: 20px; overflow-y: auto; box-sizing: border-box; color: var(--text, #fff); }
.ld-city-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border, #2a2a45); padding-bottom: 12px; }
.ld-city-head h2 { margin: 0; font-size: 20px; color: var(--text, #fff); }
.ld-city-section { margin-bottom: 24px; }
.ld-city-section h3 { margin: 0 0 12px; font-size: 16px; color: var(--accent, #fbbf24); }

.ld-near-section { margin: 20px 0; padding: 0 4px; }
.ld-near-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ld-near-header h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text, #fff); }
.ld-near-seeall { background: none; border: none; color: var(--accent, #fbbf24); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.ld-near-seeall:hover { background: rgba(251,191,36,0.1); }

.ld-near-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .ld-near-grid { grid-template-columns: repeat(4, 1fr); } }
.ld-near-card { background: var(--bg, #0b1020); border: 1px solid var(--border, #2a2a45); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease; display: flex; flex-direction: column; }
.ld-near-card:hover { border-color: var(--accent, #fbbf24); transform: translateY(-2px); }
.ld-near-thumb { height: 90px; background-size: cover; background-position: center; background-color: var(--surface, #24243e); }
.ld-near-info { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ld-near-info h5 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text, #fff); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ld-near-meta { font-size: 11px; color: var(--text-2, #94a3b8); display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.ld-near-dist { color: var(--accent, #fbbf24); font-weight: 500; }

/* beta fixes: same white heading both steps/themes, readable Skip, clear chip selection */
.ld-setup-modal .ld-setup-title { color: #f5f7ff !important; }
.ld-setup-modal .ld-setup-skip-btn { color: #d6dcf0 !important; text-decoration: underline; text-underline-offset: 3px; }
.ld-setup-modal .ld-chip-btn { background: rgba(255,255,255,.06) !important; color: #e8ecf8 !important; border: 1.5px solid rgba(255,255,255,.22) !important; }
.ld-setup-modal .ld-chip-btn.is-selected { background: #fbbf24 !important; color: #1a1300 !important; border-color: #fbbf24 !important; font-weight: 700; }
.ld-setup-modal .ld-chip-btn.is-selected::after { content: " ✓"; }

/* light theme: town hall card stays dark, keep text light */
.ld-th-title { color: #f5f7ff !important; }
.ld-near-card h5 { color: var(--text, #f5f7ff) !important; }

/* onboarding-3: Tour spotlight & card */
.ld-tour-overlay {
  z-index: 99999;
  background: transparent;
  transition: box-shadow 0.2s ease;
  pointer-events: none;
}
.ld-tour-overlay.is-pulsing {
  animation: ldPulse 1.5s infinite ease-in-out;
}
@keyframes ldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(251,191,36,0); }
}
.ld-tour-card {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #2a2a45);
  border-radius: 16px;
  padding: 16px;
  width: min(320px, 100vw - 24px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ld-tour-header { display: flex; justify-content: space-between; align-items: center; }
.ld-tour-title { font-weight: 700; color: var(--accent, #fbbf24); font-size: 16px; }
.ld-tour-count { font-size: 12px; color: var(--text-2, #94a3b8); }
.ld-tour-tip { margin: 0; font-size: 14px; color: var(--text, #fff); line-height: 1.4; }
.ld-tour-dots { display: flex; gap: 4px; justify-content: center; }
.ld-tour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border, #2a2a45); }
.ld-tour-dot.is-active { background: var(--accent, #fbbf24); }
.ld-tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.ld-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--card, #1a1a2e); color: var(--text, #fff); padding: 12px 24px; border-radius: 24px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 100001; }
.ld-toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }

/* no placeholder tiles (rule 4): photo rail shows only cards whose real photo loaded; elsewhere text-only cards */
.rail > .card:has(.media .initial) { display: none !important; }
.card .media:has(> .initial) { display: none !important; }
.card--compact .ctile { display: none !important; }
.card--compact { padding-left: 14px; }
.ld-tour-card { background: #1a1a2e !important; color: #f5f7ff !important; }
.ld-tour-card .ld-tour-tip, .ld-tour-card h3, .ld-tour-card h4 { color: #e8ecf8 !important; }
/* town hall card + tour toast are dark in both themes: keep their text light */
.ld-th-card, .ld-th-card * { color: #e8ecf8; }
.ld-th-card a { color: var(--accent, #fbbf24); }
.ld-toast { color: #f5f7ff !important; }
.ld-near-thumb:empty { min-height: 0; }

/* intro-2: two-track introduction */
.ldi{position:fixed;inset:0;z-index:10050;background:rgba(15,15,30,.55);display:flex;align-items:flex-end;justify-content:center;padding:12px}
@media (min-width:600px){.ldi{align-items:center}}
.ldi-card{width:100%;max-width:440px;background:var(--surface,#fff);color:var(--text,#16162a);border-radius:22px;padding:18px 20px 20px;box-shadow:0 18px 50px rgba(0,0,0,.25);text-align:center}
.ldi-top{display:flex;justify-content:space-between;align-items:center;min-height:28px}
.ldi-skip{background:none;border:0;color:var(--text-2,#666);font:inherit;font-size:14px;text-decoration:underline;cursor:pointer;padding:6px}
.ldi-dots{display:flex;gap:6px}.ldi-dots i{width:8px;height:8px;border-radius:50%;background:var(--border,#d6d6e2)}.ldi-dots i.on{width:22px;border-radius:4px;background:var(--accent,#7c3aed)}
.ldi-ico{font-size:46px;line-height:1;margin:10px 0 8px}
.ldi-h{margin:0 0 6px;font-size:21px}
.ldi-p{margin:0 auto 16px;max-width:34ch;color:var(--text-2,#555);font-size:15px;line-height:1.45}
.ldi-choices{display:grid;gap:10px;text-align:left}
.ldi-choice{display:grid;grid-template-columns:44px 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;padding:14px;border-radius:16px;border:1.5px solid var(--border,#e2e2ec);background:var(--surface-2,#f6f6fb);color:inherit;font:inherit;cursor:pointer}
.ldi-choice span{grid-row:1/3;font-size:30px;text-align:center}.ldi-choice b{font-size:16px}.ldi-choice small{color:var(--text-2,#666);font-size:13px}
.ldi-choice:hover,.ldi-choice:focus-visible{border-color:var(--accent,#7c3aed)}
.ldi-link{margin:0 0 14px}
.ldi-nav{display:flex;gap:10px}.ldi-nav .btn{flex:1}
.ldi-reopen{width:100%}
