*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --card-header-from: #5b3cb5;
  --card-header-to: #3b1f8a;
  --card-border-a: #8b5cf6;
  --card-border-b: #a78bfa;
  --card-footer-bg: #0f172a;
  --app-bg: #f8f8fc;
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --accent: #f59e0b;
  --score-from: #F5CC40;
  --score-to: #E8A030;
  --text: #1f2937;
  --text-mid: #4b5563;
  --text-muted: #6b7280;
  --white: #fff;
  --nav-h: 62px;
  --header-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(139,92,246,.10);
  --shadow: 0 4px 18px rgba(139,92,246,.13);
  --shadow-lg: 0 8px 36px rgba(139,92,246,.20);
  --card-border-grad: linear-gradient(145deg, #8b5cf6, #6d28d9, #a78bfa, #8b5cf6);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--app-bg);
  color: var(--text);
}

/* ─── App Shell ─── */
#app {
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  overflow: hidden;
  position: relative;
}

/* ─── Header ─── */
.app-header {
  height: var(--header-h);
  background: #fff;
  color: #1a0a3c;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  z-index: 10;
}

.app-header-logo { display: flex; align-items: center; line-height: 1; }

.app-header-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .3px;
  flex: 1;
  color: #1a0a3c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-logo-img {
  height: 40px;
  width: 40px;
  object-fit: cover;
  border-radius: 0;
  flex-shrink: 0;
  display: block;
  align-self: flex-end;
}

/* Profile button in header */
.profile-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(139,92,246,.30);
  background: rgba(139,92,246,.10);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  overflow: hidden;
  padding: 0;
}
.profile-btn:active { background: rgba(139,92,246,.20); }
.profile-btn.signed-in { border-color: rgba(139,92,246,.55); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.profile-btn-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-btn-initial {
  font-size: 14px;
  font-weight: 800;
  color: inherit;
  line-height: 1;
}

/* ─── Profile overlay (full-screen, matches card view) ─── */
#profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6,2,20,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
#profile-overlay.closing {
  animation: fadeOut .22s ease forwards;
}

.profile-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  height: 100dvh;
  overflow-y: auto;
  background: transparent;
  animation: cardIn .32s cubic-bezier(.25,.46,.45,.94);
  gap: 0;
}
#profile-overlay.closing .profile-sheet {
  animation: cardOut .22s cubic-bezier(.25,.46,.45,.94) forwards;
}

.profile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: max(env(safe-area-inset-top), 14px) 18px 12px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  position: sticky;
  top: 0;
  z-index: 1;
}
.profile-sheet-title {
  display: none;
}
.profile-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.90);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.profile-close-btn:active { background: rgba(255,255,255,.24); }

/* Card wrapping the profile content */
#profile-content {
  flex: 1;
  margin: 0 18px max(env(safe-area-inset-bottom), 20px);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0,0,0,.65),
              0 0 0 1px rgba(139,92,246,.20) inset;
  border: 3.5px solid transparent;
  background-clip: padding-box;
}

/* Logged-in profile content */
.profile-hero {
  background: linear-gradient(160deg, var(--card-header-from), var(--card-header-to));
  padding: 32px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.profile-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5);
  object-fit: cover;
}
.profile-avatar-initial {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
}
.profile-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}
.profile-email {
  font-size: 13px;
  opacity: .75;
  font-weight: 500;
}
.profile-stats {
  display: flex;
  gap: 1px;
  background: rgba(139,92,246,.10);
  margin: 0;
}
.profile-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  background: #fff;
  gap: 3px;
}
.profile-stat-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
}
.profile-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Sign-in state */
.profile-sign-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px 24px;
  gap: 12px;
  text-align: center;
}
.profile-sign-in-icon { line-height: 1; }
.profile-sign-in-logo {
  width: 125px;
  height: 125px;
  border-radius: 0;
  object-fit: cover;
  display: block;
  padding: 10px;
  box-shadow: 0 4px 18px rgba(108,63,197,.22);
}
.profile-sign-in-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}
.profile-sign-in-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 280px;
}
.btn-google {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 28px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: box-shadow .15s;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.profile-sign-in-error {
  font-size: 13px;
  color: #dc2626;
  min-height: 18px;
}

/* Sign-out button padding */
#profile-content > .btn { margin: 16px; width: calc(100% - 32px); }
.profile-signout-btn {
  background: rgba(139,92,246,.10);
  color: var(--primary);
  box-shadow: none;
  border: 1.5px solid rgba(139,92,246,.22);
  margin: 0 16px 16px;
  width: calc(100% - 32px);
  border-radius: 14px;
}

/* Travel Plans section */
.profile-section {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 4px;
}
.profile-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}
.profile-plans-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}
.profile-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139,92,246,.05);
  border: 1.5px solid rgba(139,92,246,.12);
  border-radius: 14px;
  padding: 10px 12px;
}
.profile-plan-info { flex: 1; min-width: 0; }
.profile-plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-plan-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.profile-plan-actions { display: flex; gap: 6px; flex-shrink: 0; }
.profile-plan-btn {
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.profile-plan-btn:active { opacity: .75; }
.profile-plan-btn.load {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.profile-plan-btn.del {
  background: rgba(239,68,68,.10);
  color: #dc2626;
}

/* Constrain profile-sign-in padding inside card */
.profile-sign-in { padding: 40px 24px 28px; }

/* ─── Main scroll area ─── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.view { padding: 14px 12px; min-height: 100%; }

/* Discover view — zero padding so video can fill edge-to-edge */
.discover-view { padding: 0; display: flex; flex-direction: column; min-height: 100%; position: relative; }

/* AI results shown: add margin below search bar */
.discover-search-wrap:not(.hero-mode) {
  margin-bottom: 12px;
}
.discover-search-wrap {
  padding: 14px 12px 0;
  position: relative;
  z-index: 2;
}
.discover-search-wrap.hero-mode {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 14px 12px 0;
}

/* Full-bleed hero image */
.discover-hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* Glassmorphism scattered portrait onboarding cards */
.onboarding-card-1 { left: 6%;  top: 20%; }
.onboarding-card-2 { right: 5%; top: 36%; }
.onboarding-card-3 { left: 10%; top: 57%; }

/* On small screens push cards below the search bar */
@media (max-height: 680px) {
  .onboarding-card-1 { top: 28%; }
  .onboarding-card-2 { top: 46%; }
  .onboarding-card-3 { top: 65%; }
}

.onboarding-card {
  position: absolute;
  width: 42%;
  max-width: 172px;
  padding: 16px 14px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .22);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.40);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  z-index: 2;
  transition: opacity .2s ease, transform .2s ease;
}
/* Hide onboarding cards when the filter panel is open */
.discover-search-wrap.search-focused ~ .discover-hero .onboarding-card {
  opacity: 0;
  pointer-events: none;
  transform: scale(.95);
}

.onboarding-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(255,255,255,.50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.onboarding-step-num {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,.30);
}

.onboarding-step-text {
  font-size: 11px;
  color: rgba(255,255,255,.88);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,.22);
}

/* Ask AI card — jiggle + glow */
.onboarding-card-ai {
  cursor: pointer;
  animation: aiCardJiggle 3s ease-in-out infinite;
  transform-origin: center bottom;
}

.onboarding-card-ai:active {
  transform: rotate(-4deg) scale(.96) !important;
}

@keyframes aiCardJiggle {
    0%  { transform: rotate(-4deg)          ; box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.40); }
   15%  { transform: rotate(-6.5deg) scale(1.03); box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 0 22px 4px rgba(168,85,247,.55), inset 0 1px 0 rgba(255,255,255,.50); }
   30%  { transform: rotate(-2deg)          ; box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.40); }
   45%  { transform: rotate(-5deg) scale(1.015); box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 0 14px 2px rgba(168,85,247,.35), inset 0 1px 0 rgba(255,255,255,.45); }
   60%  { transform: rotate(-4deg)          ; box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.40); }
  100%  { transform: rotate(-4deg)          ; box-shadow: 0 8px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.40); }
}

.discover-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 5-image crossfade: 3s hold + 2s fade each = 25s total cycle      */
/* Stagger: each image offset by 5s using animation-delay            */
/* Keyframe: visible → hold → fade out → hidden → fade in → visible */
.discover-hero-anim {
  animation: heroCrossfade 25s ease-in-out infinite;
}

@keyframes heroCrossfade {
  0%   { opacity: 1; }   /* hold start */
  12%  { opacity: 1; }   /* 3 s hold (3/25) */
  20%  { opacity: 0; }   /* fade out (5/25) */
  92%  { opacity: 0; }   /* stay hidden (23/25) */
  100% { opacity: 1; }   /* fade back in */
}

.discover-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.18) 0%,
    rgba(0,0,0,.04) 40%,
    transparent 100%
  );
}

/* ─── Search Filter Panel ─── */
.search-filter-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: 14px 14px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.60);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 4px 20px rgba(100,60,180,.10);
}
.discover-search-wrap.search-focused .search-filter-panel { display: flex; animation: sfPanelIn .18s ease; }
@keyframes sfPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sf-group { display: flex; flex-direction: column; gap: 5px; }
.sf-group-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1.1px;
  text-transform: uppercase; color: #9b7fcb;
}
.sf-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sf-chip {
  padding: 4px 11px; border-radius: 20px;
  border: 1.5px solid rgba(108,63,197,.22);
  background: rgba(255,255,255,.65); color: #6c3fc5;
  font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .12s ease;
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.sf-chip.active {
  background: linear-gradient(135deg,#6c3fc5,#a855f7);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(108,63,197,.35);
}
.sf-chip:active { transform: scale(.94); }
.sf-ask-btn {
  align-self: flex-end; margin-top: 4px;
  padding: 8px 20px; border-radius: 20px; border: none;
  background: linear-gradient(135deg,#6c3fc5,#a855f7);
  color: #fff; font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 3px 12px rgba(108,63,197,.40);
  display: flex; align-items: center; gap: 5px;
  transition: opacity .12s;
}
.sf-ask-btn:active { opacity: .8; transform: scale(.97); }

/* ─── Fly-to-bucket animation ─── */
@keyframes bucketPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(.88); }
  100% { transform: scale(1); }
}
.bucket-pulse { animation: bucketPulse .45s cubic-bezier(.34,1.56,.64,1); }

/* ─── Find More button (bottom of AI card grid) ─── */
.find-more-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 16px 28px;
}
.find-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 28px;
  border: none;
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(108,63,197,.40);
  -webkit-appearance: none;
  appearance: none;
  transition: opacity .15s, transform .15s;
}
.find-more-btn:active { opacity: .82; transform: scale(.96); }
.find-more-btn:disabled { opacity: .65; cursor: default; transform: none; }
.find-more-btn.loading { background: linear-gradient(135deg, #5a30b0, #8b3fd4); }

/* ─── Find-more spinner dot ─── */
.find-more-spinner {
  width: 14px;
  height: 14px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aiSpin .7s linear infinite;
  flex-shrink: 0;
}

/* ─── AI Skeleton loader ─── */
@keyframes aiSpin {
  to { transform: rotate(360deg); }
}
@keyframes aiShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.ai-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 12px 20px;
}
.ai-skeleton-grid--full {
  padding-top: 14px;
}
.ai-skeleton-card {
  border-radius: 16px;
  overflow: hidden;
  background: #f0eef8;
}
.ai-skeleton-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #e8e4f5 25%, #d8d2ed 50%, #e8e4f5 75%);
  background-size: 800px 100%;
  animation: aiShimmer 1.4s ease-in-out infinite;
}
.ai-skeleton-line {
  height: 11px;
  margin: 10px 12px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8e4f5 25%, #d8d2ed 50%, #e8e4f5 75%);
  background-size: 800px 100%;
  animation: aiShimmer 1.4s ease-in-out infinite;
}
.ai-skeleton-line--title {
  height: 14px;
  width: 75%;
}
.ai-skeleton-line--short {
  width: 50%;
  margin-bottom: 14px;
}

/* ─── Bottom Nav ─── */
.bottom-nav {
  height: calc(var(--nav-h) + var(--safe-b));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -2px 12px rgba(0,0,0,.05);
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  padding-bottom: var(--safe-b);
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 6px;
  gap: 3px;
  cursor: pointer;
  color: var(--text-muted);
  position: relative;
  transition: color .2s;
  height: var(--nav-h);
}

.nav-btn.active { color: var(--primary); }

.nav-btn.active .nav-icon-wrap::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-icon-wrap { position: relative; display: flex; align-items: center; justify-content: center; }

.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .3px; }

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  pointer-events: none;
}

/* ─── Holiday Card ─── */
.holiday-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #d0c8bc;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  user-select: none;
}

.holiday-card:active { transform: scale(.96); box-shadow: var(--shadow-sm); }

/* Full-bleed image fills entire card */
.card-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: #d0c8bc;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.holiday-card:active .card-img { transform: scale(1.03); }

/* Dark gradient scrim over bottom portion */
.card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 25%,
    rgba(0,0,0,.08) 50%,
    rgba(0,0,0,.62) 76%,
    rgba(0,0,0,.82) 100%
  );
  pointer-events: none;
}

/* Overlay container */
.card-overlays {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  pointer-events: none;
}

/* Top row: category pill + heart */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

/* Frosted glass category pill */
.card-category-pill {
  background: rgba(255,255,255,.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.25);
  line-height: 1;
  pointer-events: none;
}

/* Frosted glass heart badge */
.card-heart-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.80);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  pointer-events: none;
}

.card-heart-btn.collected {
  background: rgba(139,92,246,.85);
  color: #fff;
  border-color: rgba(139,92,246,.40);
}

/* Bottom content */
.card-bottom-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-name {
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.card-flag { font-size: 13px; flex-shrink: 0; }

.card-loc-text {
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,.78);
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score pill — dark with gold star */
.card-score-pill {
  flex-shrink: 0;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--score-from);
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 12px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.10);
  line-height: 1.4;
}

/* Status badge (in-plan indicator kept for bucket view) */
.card-status-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(16,185,129,.88);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 8px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 10px;
  letter-spacing: .5px;
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-status-badge.in-plan { background: rgba(16,185,129,.88); }

/* ─── Cards Grid ─── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

/* ─── Section title ─── */
.section-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ─── Search & Filters ─── */
/* ─── Search prompt label (above search bar) ─── */
.search-prompt-label {
  margin: 0 2px 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 4px rgba(0,0,0,.40);
  line-height: 1.4;
  letter-spacing: .15px;
}
.discover-search-wrap:not(.hero-mode) .search-prompt-label {
  color: var(--text-muted);
  text-shadow: none;
}

.search-bar {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  box-shadow: 0 4px 24px rgba(139,92,246,.08);
  border: 1.5px solid rgba(139,92,246,.12);
  transition: border-color .2s, box-shadow .2s;
}

.search-bar:focus-within {
  border-color: rgba(139,92,246,.40);
  box-shadow: 0 4px 24px rgba(139,92,246,.12), 0 0 0 3px rgba(167,139,250,.18);
}

.search-bar textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  resize: none;
  line-height: 1.5;
  padding: 0;
  min-height: 0;
}

.search-bar textarea::placeholder { color: var(--text-muted); }

/* Actions column: clear + Ask AI stacked at bottom-right */
.search-bar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}

.search-icon { display: flex; align-items: center; color: var(--text-muted); padding-top: 2px; }

.search-clear {
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.ask-ai-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 11px;
  height: 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.ask-ai-btn:disabled { opacity: .55; cursor: default; }

.ai-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-dark);
}

.ai-clear-btn {
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  background: transparent !important;
}

/* AI compact pill row */
.ai-pill-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,.10);
  border: 1.5px solid rgba(139,92,246,.22);
  border-radius: 20px;
  padding: 5px 10px 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  max-width: 100%;
  overflow: hidden;
}

.ai-pill-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ai-pill-clear {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(139,92,246,.18);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
  display: flex;
  align-items: center;
}

.filter-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  background: var(--white);
  border: 1.5px solid rgba(0,0,0,.12);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-mid);
  transition: all .15s;
  white-space: nowrap;
}

.chip.active {
  background: linear-gradient(to right, #8b5cf6, #6d28d9);
  border-color: transparent;
  color: var(--white);
}

/* ─── Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  text-align: center;
  gap: 10px;
}

.empty-icon { display: flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 8px; }

.empty-state h3 { font-size: 19px; font-weight: 800; }

.empty-state p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.55;
  max-width: 260px;
}

/* ─── Plans drawer (right-side, non-blocking) ─── */
#plans-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(0,0,0,.18);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.plans-sheet {
  width: min(340px, 88vw);
  background: #fff;
  border-radius: 20px 0 0 20px;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 40px rgba(0,0,0,.16);
  animation: slideInRight .25s cubic-bezier(.25,.46,.45,.94);
  overflow: hidden;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.plans-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  flex-shrink: 0;
}

.plans-sheet-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.plans-sheet-content {
  overflow-y: auto;
  padding: 12px 16px 24px;
  flex: 1;
}

.plans-sheet-signin {
  padding: 20px 0;
  text-align: center;
  color: var(--text-mid);
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 22px;
  border: none;
  border-radius: 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Montserrat', inherit;
  letter-spacing: .5px;
}

.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: linear-gradient(to right, #8b5cf6, #6d28d9);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(139,92,246,.40);
}

.btn-success {
  background: linear-gradient(to right, #10b981, #059669);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
}

.btn-danger {
  background: linear-gradient(to right, #ef4444, #dc2626);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(239,68,68,.30);
}

.btn-ai {
  background: linear-gradient(to right, rgba(139,92,246,.12), rgba(109,40,217,.12));
  color: var(--primary-dark);
  border: 1.5px solid rgba(139,92,246,.40);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1.5px solid rgba(0,0,0,.15);
  box-shadow: none;
}

.btn-full { width: 100%; }

/* ─── Bucket List Extras ─── */
.bucket-summary {
  background: linear-gradient(135deg, var(--card-header-from), var(--card-header-to));
  border-radius: 16px;
  padding: 16px 18px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.bucket-summary-icon { display: flex; align-items: center; color: var(--primary); }

.bucket-summary-text h3 { font-size: 19px; font-weight: 900; }

.bucket-summary-text p { font-size: 12px; opacity: .75; margin-top: 2px; }

/* ─── Bucket toolbar (group / sort chips) ─── */
.bucket-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

.bucket-toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bucket-toolbar-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-right: 2px;
}

.bucket-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(108,63,197,.20);
  background: rgba(255,255,255,.65);
  color: #6c3fc5;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s ease;
  -webkit-appearance: none;
  appearance: none;
}

.bucket-chip.active {
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(108,63,197,.30);
}

.bucket-chip:active { transform: scale(.94); }

/* ─── Country group headings ─── */
.bucket-country-group {
  margin-bottom: 20px;
}

.bucket-country-heading {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .3px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(139,92,246,.08);
  border-radius: 10px;
  border-left: 3px solid rgba(139,92,246,.40);
}

/* ─── Travel Plan ─── */

/* Glassmorphism background for plan view */
.plan-view {
  background:
    linear-gradient(170deg, rgba(255,255,255,.72) 0%, rgba(235,228,255,.55) 50%, rgba(255,255,255,.60) 100%),
    url('../bground.png') center/cover no-repeat;
}

/* Glassy plan summary card */
.plan-view .plan-summary {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .80);
  box-shadow: 0 4px 24px rgba(100, 60, 180, .10), inset 0 1px 0 rgba(255,255,255,.90);
  color: #1a0a3c;
}

/* Buttons stay readable on light glass */
.plan-view .plan-action-btn {
  border-color: rgba(108, 63, 197, .35);
  background: rgba(108, 63, 197, .10);
  color: #4c1d95;
}
.plan-view .plan-action-btn:active { background: rgba(108,63,197,.20); }
.plan-view .plan-action-btn.primary,
.plan-view .plan-action-btn.share-active {
  background: rgba(108, 63, 197, .18);
  border-color: rgba(108, 63, 197, .55);
}

/* Section row + labels on light bg */
.plan-view .section-row { border-bottom-color: rgba(108,63,197,.12); }
.plan-view .section-title { color: #7c5cbf; }
.plan-view .plan-drag-hint { color: #a99cc4; }

/* Glassmorphism plan items */
.plan-view .plan-item {
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 4px 20px rgba(100, 60, 180, .08), inset 0 1px 0 rgba(255,255,255,.95);
}

.plan-view .plan-item.drop-target {
  box-shadow: 0 0 0 2px rgba(108,63,197,.60), 0 4px 20px rgba(100,60,180,.15);
}

/* Text colours on light/glassy cards */
.plan-view .plan-item-cat { color: #9b7fcb; }
.plan-view .plan-item-name { color: #1a0a3c; }
.plan-view .plan-item-loc { color: #6b5b8e; }

/* Action buttons on light bg */
.plan-view .icon-btn.drag-handle { color: #c4b8dd; }
.plan-view .icon-btn.edit-item { color: #9b7fcb; }
.plan-view .icon-btn.edit-item:active { background: rgba(108,63,197,.12); }
.plan-view .icon-btn.discard {
  background: rgba(220, 60, 60, .08);
  color: rgba(200, 50, 50, .75);
}
.plan-view .icon-btn.discard:active { background: rgba(220,60,60,.16); }

/* View toggle pills on light bg */
.plan-view .view-toggle-btn {
  border-color: rgba(108,63,197,.22);
  color: #7c5cbf;
  background: rgba(255,255,255,.45);
}
.plan-view .view-toggle-btn:hover:not(.active) {
  border-color: rgba(108,63,197,.40);
  background: rgba(255,255,255,.65);
  color: #4c1d95;
}

.plan-summary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 16px;
  padding: 16px 18px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.plan-summary-text h3 { font-size: 19px; font-weight: 900; }

.plan-summary-text p { font-size: 12px; opacity: .75; margin-top: 2px; }

.plan-summary-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.plan-action-btn {
  border: 1.5px solid rgba(255,255,255,.40);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.plan-action-btn:active { background: rgba(255,255,255,.24); }
.plan-action-btn.primary {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
}
.plan-action-btn.share-active {
  background: rgba(255,255,255,.30);
  border-color: #fff;
}

/* ─── Plan AI Search Bar ─── */
.plan-ai-bar {
  margin-bottom: 10px;
}

.plan-ai-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 28px;
  border: 1.5px solid rgba(139,92,246,.30);
  background: rgba(139,92,246,.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: .3px;
}

.plan-ai-toggle.open {
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(108,63,197,.35);
}

.plan-ai-toggle:active { opacity: .82; transform: scale(.97); }

.plan-ai-panel {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(139,92,246,.18);
  border-radius: 16px;
  padding: 12px 12px 14px;
  margin-bottom: 12px;
  animation: sfPanelIn .18s ease;
}

.plan-ai-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-ai-search-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.plan-ai-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}

.plan-ai-ask {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.plan-ai-ask:active { opacity: .8; }
.plan-ai-ask:disabled { opacity: .55; cursor: default; }

.plan-ai-results-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #9b7fcb;
  margin: 14px 0 8px;
}

/* Breadcrumb back navigation */
.plan-ai-breadcrumb {
  margin-bottom: 10px;
}

.plan-ai-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(139,92,246,.25);
  background: rgba(139,92,246,.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-ai-back:active { background: rgba(139,92,246,.16); }

.plan-ai-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -2px;
  padding: 2px 2px 6px;
}
.plan-ai-strip::-webkit-scrollbar { display: none; }

.plan-ai-strip .holiday-card {
  width: 128px;
  flex-shrink: 0;
}

/* ── Shared plan view ──────────────────────────────────────────── */
#shared-view {
  position: fixed;
  inset: 0;
  background: #f8f8fc;
  overflow-y: auto;
  z-index: 9999;
}
.shared-view-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}
.shared-view-header {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #ebebf5;
}
.shared-view-logo {
  font-size: 15px;
  font-weight: 800;
  color: #6c3fc5;
  letter-spacing: -.3px;
}
.shared-plan-summary {
  padding: 24px 20px 12px;
}
.shared-plan-summary h1 {
  font-size: 22px;
  font-weight: 800;
  color: #1a0a3c;
  margin: 0 0 4px;
}
.shared-plan-summary p {
  font-size: 13px;
  color: #888;
  margin: 0;
}
.shared-view-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
}
.shared-view-cta {
  display: inline-block;
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 14px 28px;
  border-radius: 28px;
  text-decoration: none;
}

/* ── Share dialog ──────────────────────────────────────────────── */
#share-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .2s ease;
}
.share-dialog {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 480px;
  position: relative;
}
.share-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f7;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}
.share-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a0a3c;
  margin-bottom: 6px;
}
.share-dialog-sub {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}
.share-url-box {
  background: #f4f4fa;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.share-url-text {
  font-size: 12px;
  font-family: monospace;
  color: #555;
  word-break: break-all;
}
.share-dialog-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.share-btn-copy {
  flex: 1;
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.share-btn-native {
  flex: 1;
  background: #f0f0f7;
  color: #6c3fc5;
  border: none;
  border-radius: 20px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.share-btn-stop {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #e53935;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
}

.plan-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.plan-item {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: linear-gradient(var(--white), var(--white)) padding-box,
              var(--card-border-grad) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, opacity .2s;
  position: relative;
  touch-action: none;
}

.plan-item.is-dragging {
  opacity: .45;
  transform: scale(.97);
}

.plan-item.drop-target {
  box-shadow: 0 0 0 3px var(--primary), var(--shadow-lg);
  transform: scale(1.01);
}

.plan-item-stop {
  background: linear-gradient(160deg, var(--card-header-from) 0%, var(--card-header-to) 100%);
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  padding: 10px 4px;
  gap: 2px;
}

.plan-item-stop-label {
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .65;
}

.plan-item-stop-num {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.plan-item-img {
  width: 88px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

/* Placeholder for custom stops with no image */
.plan-item-img-ph {
  width: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

/* Add custom stop button */
.add-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border-radius: var(--radius);
  border: 2px dashed rgba(108, 63, 197, .30);
  background: rgba(255, 255, 255, .35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #7c5cbf;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.add-stop-btn:hover {
  background: rgba(255,255,255,.55);
  border-color: rgba(108,63,197,.55);
  color: #4c1d95;
}

/* ── Confirm delete plan dialog ─────────────────────────────────── */
#confirm-delete-plan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.confirm-delete-dialog {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 44px;
  width: 100%;
  max-width: 480px;
}
.confirm-delete-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a0a3c;
  margin-bottom: 8px;
}
.confirm-delete-sub {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.5;
}
.confirm-delete-actions {
  display: flex;
  gap: 12px;
}
.confirm-delete-btn-cancel {
  flex: 1;
  background: #f0f0f7;
  color: #4b5563;
  border: none;
  border-radius: 20px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.confirm-delete-btn-ok {
  flex: 1;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* Add stop dialog overlay */
#add-stop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.add-stop-dialog {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  width: 100%;
  max-width: 480px;
  position: relative;
}
.add-stop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.add-stop-title {
  font-size: 17px;
  font-weight: 800;
  color: #1a0a3c;
}
.add-stop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.add-stop-pill {
  background: #f4f0ff;
  border: 1.5px solid #e0d4ff;
  color: #6c3fc5;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.add-stop-pill svg { flex-shrink: 0; }
.add-stop-pill:hover { background: #ede8ff; }
.add-stop-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e5e0f5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1a0a3c;
  background: #faf9ff;
  margin-bottom: 10px;
  outline: none;
  transition: border-color .15s;
}
.add-stop-input:focus { border-color: #8b5cf6; }
.add-stop-input.shake {
  border-color: #e53935;
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  60%      { transform: translateX(6px); }
}
.add-stop-submit {
  width: 100%;
  background: linear-gradient(135deg, #6c3fc5, #a855f7);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
}

.plan-item-body {
  flex: 1;
  padding: 10px 10px 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.plan-item-cat {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.plan-item-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.plan-item-loc {
  font-size: 11px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.plan-item-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  transition: background .15s;
}

.icon-btn:active { background: rgba(0,0,0,.08); }

.icon-btn.drag-handle {
  cursor: grab;
  font-size: 20px;
  color: #bbb;
}

.icon-btn.drag-handle:active { cursor: grabbing; }

.icon-btn.discard {
  color: #c0392b;
  background: rgba(192,57,43,.10);
  font-size: 14px;
  font-weight: 900;
}

/* ─── Modal (full-screen collectible card view) ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,10,60,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: fadeIn .2s ease;
}

.modal-overlay.closing {
  animation: fadeOut .22s ease forwards;
}

.modal-sheet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 400px;
  height: 100dvh;
  padding: max(env(safe-area-inset-top), 14px) 18px max(env(safe-area-inset-bottom), 16px);
  overflow-y: auto;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  gap: 12px;
  animation: cardIn .32s cubic-bezier(.25,.46,.45,.94);
}

.modal-sheet.closing {
  animation: cardOut .22s cubic-bezier(.25,.46,.45,.94) forwards;
}

/* ✕ close button */
.modal-close-btn {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.80);
  color: #4a3080;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s;
  border: 1px solid rgba(255,255,255,.70);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.modal-close-btn:active { background: rgba(255,255,255,.95); }

/* ─── Glass card ─── */
.modal-card-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid rgba(255,255,255,.90);
  box-shadow:
    0 24px 60px rgba(30,10,60,.22),
    0 2px 0 rgba(255,255,255,.95) inset;
  min-height: 0;
}

/* Hero: full-bleed image with glassmorphism name overlay */
.modal-hero {
  position: relative;
  flex-shrink: 0;
}

.modal-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.modal-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 16px 14px;
  background: linear-gradient(to top, rgba(8,3,20,.65) 0%, rgba(8,3,20,.20) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-hero-overlay .card-category {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(196,181,253,.90);
}

.modal-hero-overlay .card-name {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.50);
  line-height: 1.15;
}

/* Description body — frosted white */
.modal-card-body {
  flex-shrink: 0;
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(220,210,255,.50);
  padding: 12px 16px;
}

.modal-description {
  font-size: 13.5px;
  line-height: 1.65;
  color: #3c2a6e;
}

/* Hotel strip */
.hotel-strip {
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(217,119,6,.08));
  border: 1.5px solid rgba(245,158,11,.30);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hotel-strip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hotel-stars       { color: #f59e0b; font-size: 15px; letter-spacing: 1px; }
.hotel-stars-empty { color: #d1d5db; }
.hotel-score {
  background: #f59e0b; color: #fff;
  font-weight: 800; font-size: 12px;
  border-radius: 8px; padding: 2px 7px;
}
.hotel-reviews { color: #6b4fa0; font-size: 12px; }
.hotel-address { color: #6b4fa0; font-size: 12px; }
.hotel-price   { font-size: 13px; color: #3c2a6e; }
.hotel-price strong { color: #d97706; font-weight: 800; }
.hotel-score-denom  { font-size: 10px; font-weight: 500; opacity: .8; }
.btn-book {
  display: block; text-align: center;
  background: linear-gradient(to right, #f59e0b, #d97706);
  color: #fff; font-weight: 700; font-size: 13px;
  border-radius: 24px; padding: 9px 18px;
  text-decoration: none; margin-top: 2px;
}

/* Footer — frosted glass with score badge */
.modal-card-footer {
  background: rgba(248,245,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(220,210,255,.55);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-card-footer .card-flag     { font-size: 20px; }
.modal-card-footer .card-loc-text { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: #6b4f9e; flex: 1; }

.modal-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(139,92,246,.25);
  background: rgba(139,92,246,.08);
  color: #6c3fc5;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.modal-map-btn:active { background: rgba(139,92,246,.18); }

.modal-score {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--score-from), var(--score-to));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #3A1A00;
  box-shadow: 0 3px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.4);
  flex-shrink: 0;
}
.modal-score::before {
  content: '★';
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 17px; color: var(--score-from);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); line-height: 1;
}

/* ─── Modal booking buttons ─── */
.modal-booking-row {
  display: flex;
  gap: 9px;
  margin-bottom: 4px;
}

.btn-book-flight,
.btn-book-hotel {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .3px;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-book-flight {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  box-shadow: 0 3px 12px rgba(14,165,233,.35);
}

.btn-book-hotel {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  box-shadow: 0 3px 12px rgba(16,185,129,.35);
}

.btn-book-flight:active,
.btn-book-hotel:active { opacity: .82; transform: scale(.96); }

/* ─── Modal research links (Tripadvisor + Google) ─── */
.modal-research-row {
  display: flex;
  gap: 9px;
  margin-top: -2px;
  margin-bottom: 4px;
}

.btn-research {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 8px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .2px;
  text-decoration: none;
  border: 1.5px solid rgba(139,92,246,.18);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #6c3fc5;
  box-shadow: 0 2px 8px rgba(108,63,197,.08);
  transition: opacity .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-research:active { opacity: .75; transform: scale(.96); }

/* Action buttons */
.modal-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
}

/* All modal buttons default to light/ghost style */
.modal-actions .btn {
  background: rgba(255,255,255,.88);
  color: #4a2d9e;
  border: 1.5px solid rgba(139,92,246,.20);
  box-shadow: 0 2px 8px rgba(108,63,197,.10);
}
.modal-actions .btn:active { background: rgba(255,255,255,.98); }

/* Keep success (Add to Plan / Add to Itinerary / Add to Bucket List) green */
.modal-actions .btn-success {
  background: linear-gradient(to right, #10b981, #059669);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(16,185,129,.30);
}

/* Softer, smaller danger button */
.modal-actions .btn-danger {
  background: rgba(255,255,255,.88);
  color: #b91c1c;
  border: 1.5px solid rgba(185,28,28,.18);
  box-shadow: none;
  font-size: 12px;
  padding: 9px 18px;
}
.modal-actions .btn-danger:active { background: rgba(254,242,242,.98); }

.modal-ai-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(139,92,246,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(139,92,246,.40);
  border-radius: 14px;
  padding: 8px 10px 8px 12px;
}

.modal-ai-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0;
}

.modal-ai-icon {
  color: rgba(196,181,253,1); flex-shrink: 0; display: flex; align-items: center;
}

.modal-ai-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13px; font-family: inherit; color: rgba(255,255,255,.92); min-width: 0;
}
.modal-ai-input::placeholder { color: rgba(196,181,253,.55); }

.modal-ai-submit {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: 10px;
  padding: 7px 14px; font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: opacity .15s;
}
.modal-ai-submit:active { opacity: .8; }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,15,15,.88);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 200;
  backdrop-filter: blur(8px);
  pointer-events: none;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  max-width: calc(100dvw - 32px);
  text-align: center;
}

/* ─── Animations ─── */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut  { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown{ from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes cardIn   { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes cardOut  { from { opacity: 1; transform: scale(1); }   to { opacity: 0; transform: scale(.88); } }
@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

@keyframes cardPop  {
  from { opacity: 0; transform: scale(.87) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.card-pop {
  animation: cardPop .28s cubic-bezier(.34,1.56,.64,1) both;
}

.plan-drag-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 0 10px;
  font-weight: 600;
}

/* ─── Section Row (title + toggle) ─── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-row .section-title { margin-bottom: 0; }

/* ─── View Toggle ─── */
.view-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.view-toggle-btn {
  border: 1.5px solid rgba(139,92,246,.22);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all .18s;
  font-family: 'Montserrat', inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.view-toggle-btn:hover:not(.active) {
  border-color: rgba(139,92,246,.45);
  background: rgba(139,92,246,.06);
  color: #7c3aed;
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px -1px rgba(139,92,246,.40);
}

/* ─── Map ─── */
.main-content.map-mode { overflow: hidden; }

.map-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-toolbar {
  background: var(--app-bg);
  padding: 11px 12px 10px;
  border-bottom: 1px solid rgba(0,0,0,.09);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.map-area {
  flex: 1;
  position: relative;
}

#map-el {
  height: 100%;
  width: 100%;
}

/* ─── Map Markers ─── */
.holi-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  border: 2.5px solid rgba(255,255,255,.92);
  box-shadow: 0 3px 12px rgba(139,92,246,.50);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.holi-marker::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid #6d28d9;
}

.holi-marker.plan-marker {
  background: linear-gradient(145deg, #10b981, #059669);
}
.holi-marker.plan-marker::after { border-top-color: #059669; }

.holi-marker.bucket-marker { border-color: var(--accent); }

.holi-marker-inner {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1;
  letter-spacing: -.3px;
}
