/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wine: #722F37;
  --wine-dark: #4A1C23;
  --wine-light: #9B4D55;
  --gold: #C9A96E;
  --gold-light: #E8D5A8;
  --gold-dark: #A68B4B;
  --cream: #FAFAF7;
  --warm-white: #FEFCF8;
  --charcoal: #1A1A1A;
  --text: #2D2D2D;
  --text-light: #6B6B6B;
  --border: #E5E5E5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --brew: #B8860B;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; }
a { color: var(--wine); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo h1 {
  font-size: 24px;
  color: var(--wine);
  letter-spacing: -0.5px;
}
.header-nav { display: flex; gap: 2px; }
.nav-btn {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  /* Only animate the hover-effect properties. `transition: 0.2s ease` defaults to "all",
     which was animating sub-pixel position changes during scroll and producing a wobble. */
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
  font-family: 'Inter', sans-serif;
}
.nav-btn:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.nav-btn.active { color: var(--wine); background: rgba(114,47,55,0.08); font-weight: 600; }
.itinerary-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--wine);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

/* ===== HERO ===== */
.hero {
  background: var(--charcoal);
  /* Shorter hero so cards appear sooner; user sees value not just marketing on first load */
  padding: 36px 24px 32px;
  text-align: center;
  position: relative;
  background-image: url('https://images.unsplash.com/photo-1560493676-04071c5f467b?w=1600&q=80');
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26,26,26,0.7) 0%, rgba(26,26,26,0.85) 100%);
}
.hero-content { max-width: 700px; margin: 0 auto; position: relative; z-index: 1; }
.hero-sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 8px;
}
.hero-content h2 {
  font-size: 38px;
  color: white;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.5);
}
.hero-steps {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 32px auto 0;
  flex-wrap: wrap;
  max-width: 960px;
}
.hero-step {
  flex: 1 1 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 12px;
}
.hero-step-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}
.hero-step-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  margin: 0;
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--charcoal);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

/* ===== HERO TEMPLATES ===== */
.hero-templates {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero-templates-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  margin-bottom: 10px;
}
.hero-templates-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-template-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}
.hero-template-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--gold);
}
.hero-template-btn .htb-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
}
.hero-template-btn .htb-meta {
  font-size: 11px;
  color: var(--gold);
  font-weight: 400;
}

/* ===== INFINITE SCROLL SENTINEL ===== */
.infinite-sentinel {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  letter-spacing: 0.3px;
}

/* ===== ITINERARY HEADER ===== */
/* "My Tour Itinerary" h2 hidden globally — the active tab + the trip-summary sentence
   already communicate the context, the title is redundant. */
.itinerary-header h2 { display: none; }

/* ===== GOOGLE MAPS INFOWINDOW ===== */
/* The default InfoWindow has heavy padding around the marker popup. Tighten to fit
   content size — venue name + small image + region. Affects all viewports. */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  max-width: 280px !important;
  border-radius: 10px !important;
}
.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  max-width: 280px !important;
  padding: 0 !important;
}
.gm-style .gm-style-iw { padding: 0 !important; }
.gm-style .gm-ui-hover-effect { top: 4px !important; right: 4px !important; }

/* ===== REGION BUTTONS ===== */
/* Mobile-only region dropdown — hidden at desktop where the chip row is the primary UI */
.region-select-mobile { display: none; }

.filter-row-regions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.filter-row-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding-top: 8px;
  flex-shrink: 0;
}
.region-bar-inner {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-row-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.region-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.region-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: rgba(114,47,55,0.03);
}
.region-btn.active {
  background: var(--wine);
  color: white;
  border-color: var(--wine);
}
.region-btn .region-count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--gold); color: var(--charcoal); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: rgba(201,169,110,0.1); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-wine { background: var(--wine); color: white; }
.btn-wine:hover { background: var(--wine-dark); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--wine); color: var(--wine); }

/* ===== FILTER TOGGLE BUTTON ===== */
.filter-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  display: none;
}
.filter-toggle-btn.visible { display: inline-flex; }
.filter-toggle-btn:hover { border-color: var(--wine); color: var(--wine); }

/* ===== FILTERS ===== */
.filters-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 60px;
  z-index: 900;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
  max-height: 500px;
  overflow: hidden;
  /* Contain layout/paint so the collapse animation doesn't reflow ancestors (which was
     making the header nav tabs visually shake during scroll). */
  contain: layout paint;
}
.filters-bar.filters-collapsed {
  max-height: 0;
  padding: 0;
  opacity: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}
.filters-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}
.filter-group select, .filter-group input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: var(--text);
  min-width: 150px;
}
.filter-group select:focus, .filter-group input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(114,47,55,0.08);
}
.search-group { flex: 1; min-width: 200px; }
.search-group input { width: 100%; }

/* Top-of-bar search — primary entry point above region/type filters */
.filter-row-search {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.filter-row-search input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}
.filter-row-search input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.08);
}
.filter-row-search input::placeholder { color: var(--text-light); }
.filter-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.chip:hover { border-color: var(--wine); color: var(--wine); }
.chip.active { background: var(--wine); color: white; border-color: var(--wine); }

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 60vh;
}
.view-panel { display: none; }
.view-panel.active { display: block; }

/* ===== RESULTS HEADER ===== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.results-header h3 { font-size: 14px; color: var(--text-light); font-family: 'Inter', sans-serif; font-weight: 500; }
.results-controls { display: flex; align-items: center; gap: 10px; }
.sort-group { display: flex; align-items: center; gap: 6px; }
.sort-group label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.sort-group select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: white;
}
.view-toggle { display: flex; gap: 2px; background: var(--border); border-radius: var(--radius-sm); padding: 2px; }
.toggle-btn {
  padding: 5px 14px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
}
.toggle-btn.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

/* ===== VENUE GRID ===== */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.venue-grid.list-layout { grid-template-columns: 1fr; }

/* ===== VENUE CARD ===== */
.venue-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}
.venue-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.venue-card .card-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #f0ece5;
}
.venue-card .card-image .card-monogram {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  font-weight: 700;
  color: rgba(255,255,255,0.15);
  background: linear-gradient(135deg, var(--wine-dark) 0%, var(--wine) 100%);
}
.venue-card .card-image .card-monogram.brew-mono {
  background: linear-gradient(135deg, #8B6914 0%, var(--brew) 100%);
}
.venue-card .card-type {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}
.venue-card .card-type.winery { background: var(--wine); color: white; }
.venue-card .card-type.brewery { background: var(--brew); color: white; }
.venue-card .card-region {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.venue-card .card-body { padding: 14px 16px; }
.venue-card .card-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--charcoal);
  line-height: 1.3;
}
.venue-card .card-known {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.venue-card .card-tasting {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--cream);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--wine-dark);
  margin-bottom: 8px;
}
.venue-card .card-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.venue-card .amenity-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--cream);
  border-radius: 4px;
  color: var(--text-light);
  font-weight: 500;
}
.venue-card .card-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.venue-card .card-actions .btn { flex: 1; justify-content: center; font-size: 12px; padding: 7px 10px; }

.list-layout .venue-card { display: grid; grid-template-columns: 260px 1fr; }
.list-layout .venue-card .card-image { height: 100%; min-height: 180px; }

/* ===== MAP ===== */
.map-container {
  display: grid;
  grid-template-columns: 1fr 0px;
  height: 75vh;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: grid-template-columns 0.3s ease;
}
.map-container:has(.map-sidebar:not(.collapsed)) {
  grid-template-columns: 1fr 380px;
}
#map { width: 100%; height: 100%; position: relative; }
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  gap: 12px;
  z-index: 10;
}
.map-loading p { font-size: 13px; color: var(--text-light); }
.map-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.map-loading.hidden { display: none; }
.map-sidebar {
  background: white;
  padding: 20px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  transition: width 0.3s ease, padding 0.3s ease;
}
.map-sidebar.collapsed {
  /* Hide the empty-state placeholder entirely until a marker is tapped. Removes the dead
     gray frame that was always sitting next to (or below) the map. */
  display: none;
}
.map-sidebar.collapsed * { display: none; }
.map-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-light);
}
.mse-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.map-sidebar-empty h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-light); }
.map-sidebar h3 { font-size: 18px; margin-bottom: 8px; color: var(--charcoal); }
.map-sidebar p { font-size: 13px; color: var(--text-light); }
.sidebar-venue .sv-image {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  background-color: #f0ece5;
}
.sidebar-venue .sv-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sidebar-venue .sv-type.winery { background: var(--wine); color: white; }
.sidebar-venue .sv-type.brewery { background: var(--brew); color: white; }
.sidebar-venue .sv-name { font-size: 20px; margin-bottom: 3px; color: var(--charcoal); }
.sidebar-venue .sv-region { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.sidebar-venue .sv-desc { font-size: 13px; color: var(--text); margin-bottom: 12px; line-height: 1.6; }
.sidebar-venue .sv-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.sidebar-venue .sv-detail:last-of-type { border-bottom: none; }
.sidebar-venue .sv-detail .label {
  font-weight: 600;
  min-width: 70px;
  color: var(--text-light);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 1px;
}
.sidebar-venue .sv-detail .value { color: var(--text); flex: 1; }
.sidebar-venue .sv-funfact {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--gold);
}
.sidebar-venue .sv-funfact strong { color: var(--gold-dark); }
.sidebar-venue .sv-links { display: flex; gap: 6px; margin-top: 12px; }
.sidebar-venue .sv-links a {
  flex: 1;
  text-align: center;
  padding: 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.sidebar-venue .sv-links a:hover { border-color: var(--wine); color: var(--wine); }
.sidebar-venue .sv-actions { margin-top: 10px; }
.sidebar-venue .sv-actions .btn { width: 100%; justify-content: center; }

/* ===== ITINERARY ===== */
.itinerary-container { max-width: 960px; margin: 0 auto; }
.itinerary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.itinerary-header h2 { font-size: 28px; color: var(--charcoal); }
.itinerary-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Trip overview card — styled as a deliberate "your trip at a glance" panel rather than
   a stray sentence. Matches the visual language of the optimizer panel and day cards
   (white background, subtle border, light shadow) with a wine-accent left border for
   brand continuity. Same treatment on phone and desktop. */
.trip-summary {
  margin: 4px 0 24px;
  padding: 16px 18px 14px;
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--wine);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.trip-summary-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 8px;
}
.trip-summary-text {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14.5px;
  font-style: normal;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.55;
}
.trip-summary-text strong { font-weight: 600; color: var(--charcoal); }

/* Trip stats strip — quick scannable counts under the narrative */
.trip-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.trip-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.trip-stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1;
}
.trip-stat-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 500;
}
.trip-stat-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}
.trip-stat-awards .trip-stat-num { color: var(--wine); }
.trip-stat-awards .trip-stat-label { color: var(--wine); }

/* Reminders */
.trip-reminders { margin-bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
.reminder {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--gold);
}

/* Empty state */
.itinerary-empty {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.empty-illustration { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.empty-line { width: 40px; height: 2px; background: var(--border); border-radius: 1px; }
.empty-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); }
.itinerary-empty h3 { font-size: 22px; color: var(--charcoal); margin-bottom: 8px; }
.itinerary-empty p { color: var(--text-light); margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Day blocks */
.day-block {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--charcoal);
  color: white;
}
.day-header h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; }
/* The day-header-top wraps title + date input so they sit side-by-side at all sizes
   (mobile bumps the date width). Without this, they'd stack vertically on desktop. */
.day-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
}
/* "Select date" hint shown when no date is chosen — browsers render the default
   yyyy-mm-dd placeholder for empty date inputs, which is cryptic. Overlay our own. */
.day-date-wrap {
  position: relative;
  display: inline-block;
}
.day-date-wrap[data-empty="true"]::after {
  content: 'Select date';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.2px;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}
.day-date-wrap[data-empty="true"] .day-date-input::-webkit-datetime-edit {
  color: transparent;
}
.day-date-wrap[data-empty="true"] .day-date-input {
  color: transparent;
}
/* On desktop the ⋯ overflow menu is hidden — there's room for Export and Remove inline.
   Mobile @media re-enables it and hides the standalone buttons. */
.day-overflow-wrap { display: none; }
.day-header input[type="date"], .day-header .day-date-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
}
.day-header input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
.day-header .day-actions { display: flex; gap: 6px; align-items: center; }
.day-header .day-actions button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}
.day-header .day-actions button:hover { background: rgba(255,255,255,0.2); }

/* Day summary bar */
.day-summary {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}
.day-summary .ds-item { display: flex; align-items: center; gap: 4px; }
.day-summary .ds-item strong { color: var(--text); font-weight: 600; }

.day-stops { padding: 10px; min-height: 50px; }
.day-stops.drag-over { background: rgba(114,47,55,0.03); }
.day-stop-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  margin: 4px;
}

/* Stop cards */
.stop-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  background: white;
  transition: var(--transition);
  cursor: grab;
}
.stop-card:active { cursor: grabbing; }
.stop-card:hover { box-shadow: var(--shadow-sm); }
.stop-card.dragging { opacity: 0.4; }
.stop-card .stop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wine);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.stop-card .stop-image {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: #f0ece5;
}
.stop-card .stop-info { flex: 1; min-width: 0; }
.stop-card .stop-name { font-weight: 600; font-size: 13px; color: var(--charcoal); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-card .stop-meta { font-size: 11px; color: var(--text-light); }
.stop-card .stop-hours {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop-card .stop-hours-icon { flex-shrink: 0; opacity: 0.75; }
.stop-card .stop-hours-warn { color: #8a5a00; }
.stop-card .stop-hours-warn .stop-hours-icon { opacity: 1; }
.stop-card .stop-badges { display: flex; gap: 5px; flex-shrink: 0; align-items: center; }
.stop-card .stop-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.stop-card .stop-badge.dining { background: #fff3cd; color: #7a4f00; border: 1px solid #f0c070; }
.stop-card .stop-badge.ev    { background: #d4edda; color: #155724; border: 1px solid #81c784; }
.stop-card .stop-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  opacity: 0.4;
}
.stop-card:hover .stop-remove { opacity: 1; }
.stop-card .stop-remove:hover { color: #dc3545; }

/* Drive time between stops */
.drive-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 18px 3px 44px;
  font-size: 12px;
  color: var(--charcoal);
}
.drive-indicator .drive-line {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}
.drive-indicator .drive-label { color: var(--charcoal); }
.drive-indicator .drive-label strong { color: var(--wine); }

/* Day notes */
.day-footer {
  padding: 0 10px 10px 10px;
}
.day-footer textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
  min-height: 36px;
  color: var(--text);
  background: var(--cream);
}
.day-footer textarea::placeholder { color: var(--text-light); }
.day-footer textarea:focus { outline: none; border-color: var(--wine); background: white; }

/* Quick Add (removed - replaced by inline add stop) */

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 10px 10px 0 0;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.modal-close:hover { background: var(--cream); color: var(--text); }
.modal-content .m-image {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: -46px;
  background-color: #f0ece5;
  position: relative;
}
/* Google Places photo attribution. Bottom-right of the modal hero, low-contrast white over
   a subtle gradient so it stays legible against varied photos without competing visually. */
.modal-content .m-photo-attribution {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 3px 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.45));
  border-radius: 10px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
.modal-content .m-photo-attribution a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.4);
}
.modal-content .m-photo-attribution a:hover { border-bottom-color: rgba(255,255,255,0.9); }
.modal-content .m-image .m-monogram {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 80px;
  font-weight: 700;
  color: rgba(255,255,255,0.12);
}
.modal-content .m-body { padding: 20px 24px 24px; }
.modal-content .m-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.modal-content .m-type.winery { background: var(--wine); color: white; }
.modal-content .m-type.brewery { background: var(--brew); color: white; }
.modal-content .m-name { font-size: 26px; color: var(--charcoal); margin-bottom: 3px; }
.modal-content .m-region { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }
.modal-content .m-desc { font-size: 14px; line-height: 1.7; color: var(--text); margin-bottom: 16px; }
.modal-content .m-funfact {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid var(--gold);
}
.modal-content .m-funfact strong { color: var(--gold-dark); display: block; margin-bottom: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-content .m-details { margin-bottom: 16px; }
.modal-content .m-detail-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.modal-content .m-detail-row:last-child { border-bottom: none; }
.modal-content .m-detail-row .m-label {
  min-width: 100px;
  font-weight: 600;
  color: var(--text-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2px;
}
.modal-content .m-detail-row .m-value {
  flex: 1;
  color: var(--text);
  min-width: 0;
  word-wrap: break-word;
  /* Hours often contain explicit \n to put each day-group on its own line; honor them
     without collapsing the rest of the string. */
  white-space: pre-line;
}
.modal-content .m-links { display: flex; gap: 8px; margin-bottom: 14px; }
.modal-content .m-links a {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.modal-content .m-links a:hover { border-color: var(--wine); }
.modal-content .m-add-btn { width: 100%; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 36px 24px;
  margin-top: 60px;
}
.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 10px;
}
.footer-note { font-size: 12px; margin-bottom: 4px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--wine-dark);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 3000;
  box-shadow: var(--shadow-xl);
  transition: transform 0.3s ease;
  white-space: nowrap;
  border: 1px solid var(--wine-light);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== GOOGLE MAPS OVERRIDES ===== */
.gm-style-iw { font-family: 'Inter', sans-serif !important; }
.map-popup { padding: 10px 14px; min-width: 180px; }
.map-popup h4 { font-family: 'Playfair Display', serif; font-size: 14px; margin-bottom: 3px; color: var(--charcoal); }
.map-popup .pop-type { font-size: 10px; color: var(--wine); font-weight: 600; text-transform: uppercase; }
.map-popup .pop-known { font-size: 11px; color: var(--text-light); margin-top: 4px; font-style: italic; }
.map-popup .pop-fee { font-size: 11px; margin-top: 3px; color: var(--text); font-weight: 600; }

/* ===== MAP HOVER LABEL ===== */
.map-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  text-shadow: 1px 1px 3px rgba(255,255,255,0.95), -1px -1px 3px rgba(255,255,255,0.95), 0 0 6px rgba(255,255,255,0.9);
}

/* ===== OPTIMIZER PANEL ===== */
.optimizer-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.optimizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.optimizer-header h3 { font-size: 20px; color: var(--charcoal); }
.optimizer-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.optimizer-close:hover { background: var(--cream); color: var(--text); }
.optimizer-desc { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.optimizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.opt-field { display: flex; flex-direction: column; gap: 4px; }
.opt-field label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}
.opt-field select, .opt-field input {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B6B6B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  cursor: pointer;
}
.opt-field select:focus, .opt-field input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(114,47,55,0.08);
}
.opt-regions-field { margin-top: 4px; }
.opt-region-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.opt-region-chip {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.opt-region-chip:hover { border-color: var(--wine); color: var(--wine); }
.opt-region-chip.active { background: var(--wine); color: white; border-color: var(--wine); }
.opt-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.opt-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-weight: 400;
}
.opt-check input[type="checkbox"] {
  accent-color: var(--wine);
  width: 16px;
  height: 16px;
}
.opt-venue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}
.opt-venue-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--text);
}
.opt-venue-tag .ovt-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.opt-venue-tag .ovt-dot.winery { background: var(--wine); }
.opt-venue-tag .ovt-dot.brewery { background: var(--brew); }
.optimizer-note { font-size: 12px; color: var(--text-light); }

/* ===== DAY ROUTE MAP ===== */
.day-route-map {
  height: clamp(180px, 38vh, 340px);
  border-top: 1px solid var(--border);
  position: relative;
}
.day-route-map .leaflet-container { height: 100%; width: 100%; }
.route-map-refresh {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  font-family: inherit;
}
.route-map-refresh:hover { border-color: var(--wine); color: var(--wine); }
.route-map-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  font-family: inherit;
}
.route-map-toggle:hover { border-color: var(--wine); color: var(--wine); }

/* ===== DAY PICKER POPUP ===== */
.day-picker-popup {
  position: absolute;
  z-index: 2500;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px 0;
  display: none;
}
.day-picker-title {
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}
.day-picker-option {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.day-picker-option:hover { background: var(--cream); }
.day-picker-option.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.day-picker-option .dpo-count {
  font-size: 11px;
  color: var(--text-light);
}
.day-picker-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.day-picker-new { color: var(--wine); font-weight: 500; }

/* ===== INLINE ADD STOP ===== */
.inline-add-stop {
  padding: 4px 4px 0 4px;
}
.inline-add-btn {
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.inline-add-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: rgba(114,47,55,0.02);
}
.inline-search-panel {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.inline-search-input {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.inline-search-input:focus { border-bottom-color: var(--wine); }
.inline-search-results {
  max-height: 200px;
  overflow-y: auto;
}
.inline-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.inline-result:hover { background: var(--cream); }
.inline-result .ir-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.inline-result .ir-dot.winery { background: var(--wine); }
.inline-result .ir-dot.brewery { background: var(--brew); }
.inline-result .ir-name { font-weight: 500; flex: 1; }
.inline-result .ir-region { font-size: 11px; color: var(--text-light); }
.inline-result-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
}

/* ===== TEMPLATES ===== */
.templates-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.templates-section h4 {
  font-size: 14px;
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  margin-bottom: 12px;
}
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.template-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.template-card:hover {
  border-color: var(--wine);
  box-shadow: var(--shadow-sm);
}
.template-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 2px;
  font-family: 'Playfair Display', serif;
}
.template-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.template-meta {
  font-size: 11px;
  color: var(--wine);
  font-weight: 500;
}

/* ===== DAY ROUTE LINK ===== */
.day-route-link {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.day-route-link:hover { background: rgba(255,255,255,0.2); color: white; }

/* ===== IN-ITINERARY INDICATOR ===== */
.in-itinerary-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(114,47,55,0.92);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  z-index: 2;
  backdrop-filter: blur(4px);
  letter-spacing: 0.3px;
}
.venue-card.is-in-itinerary {
  border-color: var(--wine-light);
  box-shadow: 0 0 0 2px rgba(114,47,55,0.12);
}
.btn.btn-in-itinerary {
  background: var(--cream);
  color: var(--wine);
  border: 1px solid var(--wine-light);
  cursor: default;
  pointer-events: none;
}

/* ===== PRINT ===== */
/* Printing uses the custom view opened by openPrintView() — suppress printing the main app page */
@media print {
  body { display: none !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { height: 52px; padding: 0 16px; }
  .logo h1 { font-size: 20px; }
  .hero { padding: 40px 16px; }
  .hero-content h2 { font-size: 32px; }
  .filter-row-regions { flex-direction: column; gap: 6px; }
  .filter-row-controls { flex-direction: column; align-items: stretch; }
  .filters-inner { padding: 0 16px; }
  .venue-grid { grid-template-columns: 1fr; }
  .map-container { grid-template-columns: 1fr; height: auto; }
  #map { height: 50vh; }
  .map-sidebar { border-left: none; border-top: 1px solid var(--border); max-height: 50vh; }
  .list-layout .venue-card { grid-template-columns: 1fr; }
  .itinerary-header { flex-direction: column; align-items: flex-start; }
  .trip-summary { font-size: 14px; }
  .trip-summary strong { font-size: 16px; }
  .modal { margin: 12px; max-height: 95vh; }
  .modal-content .m-image { height: 180px; }
  .optimizer-grid { grid-template-columns: 1fr 1fr; }
  .day-route-map { height: clamp(160px, 35vh, 252px); }
  .auth-sign-in-btn { font-size: 12px; padding: 5px 10px; }
  .auth-modal { margin: 12px; max-height: 95vh; overflow-y: auto; }
}

/* ===== PHONE-NARROW BREAKPOINT (≤480px) =====
   Tactical fixes for the screenshot review: nav overflow, logo wrap, hero overlay tighten,
   results-header stacking, results-controls fit. All scoped here — desktop unchanged. */
@media (max-width: 480px) {
  /* 0. Stop the page from scrolling horizontally. iOS Safari bounces horizontally if any
     descendant has horizontal overflow (e.g. the nav's internal scroll); clamping body
     keeps the page rooted at left edge while .header-nav still swipes internally. */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* === TOP NAV (two-row at mobile) ===
     Logo + Sign-In on row 1, tabs distributed across row 2. All 4 tabs fit without
     needing horizontal scroll. */
  .site-header { backdrop-filter: none; background: rgba(255,255,255,0.96); }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px 0;
    row-gap: 6px;
  }
  .logo { flex: 0 1 auto; }
  /* The auth controls live inside .header-nav in the DOM; pin them to the top-right of
     the header so they appear on row 1 instead of mixed with the tabs */
  .header-nav .auth-header-controls {
    position: absolute;
    top: 10px;
    right: 12px;
    margin-left: 0;
  }
  .auth-sign-in-btn { font-size: 12px; padding: 5px 12px; }
  /* Tab row: full-width second row, equal distribution */
  .header-nav {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    margin: 0 -12px;
    padding: 0 4px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    gap: 0;
    overflow: visible;
  }
  .header-nav .nav-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 0;
    text-align: center;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
  }
  .header-nav .nav-btn.active {
    color: var(--wine);
    background: none;
    font-weight: 600;
    border-bottom-color: var(--wine);
  }
  /* Hide Filters / auth from the tab row — they belong to the top row */
  .header-nav .filter-toggle-btn { display: none; }
  .filter-toggle-btn.visible {
    position: fixed;
    top: 100px;
    right: 12px;
    z-index: 950;
  }
  /* Bump the bottom-positioned itinerary count to sit above tab text, not over it */
  .header-nav .itinerary-count {
    position: static;
    margin-left: 2px;
    display: inline-flex;
  }

  /* 1. Logo: keep on one line, smaller */
  .logo h1 { font-size: 17px; white-space: nowrap; letter-spacing: -0.3px; }
  .header-inner { padding: 0 12px; gap: 8px; }

  /* "My Itinerary" → "Itinerary" at mobile so it fits as a tab label */
  .nav-btn[data-view="itinerary"] {
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .nav-btn[data-view="itinerary"]::before {
    content: 'Itinerary';
    font-size: 12px;
  }
  /* Badge inline with the text instead of as a corner overlay */
  .nav-btn[data-view="itinerary"] .itinerary-count {
    position: static;
    width: auto;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    font-size: 9px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .itinerary-count {
    width: 16px; height: 16px; min-width: 16px;
    font-size: 9px; top: 0; right: 0;
  }

  /* 3. Hero compression — get to the venues sooner. Skip the 3-step explainer at mobile
     (it's discoverable on desktop and via a "How it works" link if we ever add one). */
  .hero { padding: 24px 16px 18px; }
  .hero::before {
    background: linear-gradient(to bottom, rgba(26,26,26,0.55) 0%, rgba(26,26,26,0.78) 100%);
  }
  .hero-sub { font-size: 10px; letter-spacing: 2px; margin-bottom: 4px; }
  .hero-content h2 { font-size: 22px; line-height: 1.15; margin-bottom: 6px; }
  .hero-desc { font-size: 12.5px; margin-bottom: 0; }
  .hero-steps { display: none; }
  .hero-templates { margin-top: 18px; padding-top: 14px; }
  .hero-templates-label { font-size: 10px; }
  .hero-templates-grid {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none; padding-bottom: 4px;
  }
  .hero-templates-grid::-webkit-scrollbar { display: none; }
  .hero-template-btn { flex: 0 0 auto; min-width: 160px; }

  /* Regions: switch from horizontal-scroll chips to a native <select> dropdown on mobile.
     Chips are hidden; the dropdown picks up the same data. Native <select> on iOS gives a
     full-screen wheel picker which scrolls all 17 regions easily. */
  .filter-row-regions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  .filter-row-regions .filter-row-label { font-size: 10px; }
  .filter-row-regions .region-bar-inner { display: none; }
  .filter-row-regions .region-select-mobile {
    display: block;
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: white;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B6B6B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
  }

  /* 4. Results header: stack title above controls so "242 Places to Discover" gets its own
     full-width line instead of being squeezed into a tall column */
  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .results-header h3 { font-size: 13px; }

  /* 5. Sort / Grid-List row: tight horizontal layout, sort takes available space */
  .results-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .sort-group { flex: 1; min-width: 0; }
  .sort-group select { flex: 1; min-width: 0; }
  .view-toggle { flex-shrink: 0; }

  /* === COMPACT LIST VIEW (mobile default) ===
     Override the 768px-breakpoint rule that collapses list to single-column. Here we want
     a true horizontal row: small thumbnail + venue text. ~110px per card vs ~600px before.
     Many more venues visible per scroll. */
  .venue-grid.list-layout { gap: 8px; }
  .list-layout .venue-card {
    display: grid !important;
    grid-template-columns: 96px 1fr !important;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: none;
  }
  .list-layout .venue-card .card-image {
    width: 96px;
    height: 96px;
    min-height: 96px;
    border-radius: 0;
  }
  .list-layout .venue-card .card-image .card-type,
  .list-layout .venue-card .card-image .card-region,
  .list-layout .venue-card .card-image .in-itinerary-badge,
  .list-layout .venue-card .card-image .visited-badge { display: none; }
  /* Keep the closed stripe visible — it's a critical signal */
  .list-layout .venue-card .card-image .closed-badge {
    font-size: 8px;
    padding: 2px 4px;
  }
  .list-layout .venue-card .card-body { padding: 10px 12px; }
  .list-layout .venue-card .card-name { font-size: 14px; margin-bottom: 2px; }
  .list-layout .venue-card .google-rating { margin: 1px 0 4px; font-size: 11px; }
  .list-layout .venue-card .award-badge { display: none; }
  .list-layout .venue-card .card-known {
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 4px;
    -webkit-line-clamp: 2;
  }
  .list-layout .venue-card .card-tasting { display: none; }
  /* Amenities: wrap to multiple rows instead of horizontal-scroll. Users were missing
     amenities that scrolled off-screen. Now they all fit within the card width. */
  .list-layout .venue-card .card-amenities {
    margin: 4px 0 6px;
    display: flex; flex-wrap: wrap; gap: 4px;
  }
  .list-layout .venue-card .amenity-tag {
    font-size: 10px;
    padding: 2px 7px;
  }
  /* Hide the per-card action row — tap the card to open the modal which has all actions */
  .list-layout .venue-card .card-actions { display: none; }

  /* === ITINERARY VIEW COMPACT ===
     Day cards take a lot of vertical space on desktop — tighten everything for mobile. */
  .day-card { padding: 14px 12px; margin-bottom: 14px; }
  .day-header { gap: 8px; margin-bottom: 8px; }
  .day-header h3 { font-size: 18px; }
  .day-summary {
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11px;
    padding: 6px 0;
  }
  .day-summary .ds-item { font-size: 11px; }

  /* Stops: tighter than the already-compact desktop version. Hide non-essential bits. */
  .stop-card { padding: 6px 8px; gap: 8px; }
  .stop-card .stop-num { width: 20px; height: 20px; font-size: 10px; }
  .stop-card .stop-image { width: 44px; height: 44px; }
  .stop-card .stop-name { font-size: 12.5px; }
  .stop-card .stop-meta { font-size: 10px; }
  .stop-card .stop-hours { font-size: 10px; margin-top: 2px; }
  /* Dining/EV badges hidden — they're nice-to-have, room is tight */
  .stop-card .stop-badges { display: none; }
  /* Reorder buttons stack vertically to save horizontal space */
  .stop-card .stop-reorder { flex-direction: column; gap: 0; }
  .stop-card .stop-reorder-btn { padding: 0 5px; font-size: 11px; line-height: 1.5; }
  .stop-card .stop-remove { font-size: 14px; padding: 2px 4px; }

  /* Drive indicator: thinner */
  .drive-indicator { padding: 3px 0 3px 22px; font-size: 11px; }

  /* Day map toggle: more prominent so users know it's there */
  .day-route-toggle, .day-route-link { font-size: 12px; padding: 6px 10px; }

  /* Itinerary header stack vertically on mobile */
  .itinerary-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .itinerary-actions { flex-wrap: wrap; gap: 6px; }

  /* === DAY HEADER COMPACT ===
     Two visual sections: title + date input on one row, then a tight actions row with
     "Show Map" and a ⋯ overflow menu (Export, Remove Day) so secondary actions don't
     crowd the header. */
  .day-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .day-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
  }
  .day-header h3 { font-size: 15px; line-height: 1.2; flex: 0 1 auto; }
  /* Date input and buttons share dimensions so the dark band reads as a tidy row */
  .day-header .day-date-input,
  .day-header .day-actions > button {
    height: 28px;
    box-sizing: border-box;
    font-size: 12px;
    padding: 0 10px;
    line-height: 26px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    font-family: inherit;
    white-space: nowrap;
  }
  .day-header .day-date-input { flex: 0 0 140px; width: 140px; }
  .day-header .day-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
  }
  /* Right-justify the ⋯ on mobile so it sits at the far edge, away from Show Map */
  .day-header .day-actions > .day-overflow-wrap { margin-left: auto; }
  /* Hide standalone "Export" link + "Remove Day" — they live in the ⋯ menu now */
  .day-header .day-actions > a.day-route-link,
  .day-header .day-actions > button.day-remove-btn { display: none; }

  /* Per-day overflow menu — visible only at mobile (hidden by the global rule above) */
  .day-overflow-wrap { display: block; position: relative; }
  .day-overflow-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
  }
  .day-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    background: white;
    color: var(--text);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    overflow: hidden;
    min-width: 180px;
  }
  .day-overflow-menu.open { display: block; }
  .day-overflow-menu > a,
  .day-overflow-menu > button {
    display: block !important;
    width: 100%;
    text-align: left;
    background: white !important;
    border: none !important;
    color: var(--text) !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    cursor: pointer;
    text-decoration: none;
    border-radius: 0 !important;
  }
  .day-overflow-menu > a:hover,
  .day-overflow-menu > button:hover { background: var(--cream) !important; }
  .day-overflow-menu > button.day-remove-btn { color: #c0392b !important; }

  /* === EXPLORE FILTERS ===
     Hide the Type select on mobile — wineries/breweries/cideries are already shown via
     amenity-style filter chips and the type pill on each card; the dropdown is redundant. */
  .filter-row-controls > .filter-group:first-child { display: none; }

  /* === MAP SIDEBAR (venue popup on tap) ===
     Force single-column at phone — the desktop's `:has(.map-sidebar:not(.collapsed))` rule
     was setting `grid-template-columns: 1fr 380px` which collapsed the map column to ~13px
     of usable width on a 393px phone. Override with higher specificity. */
  .map-container,
  .map-container:has(.map-sidebar:not(.collapsed)) {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
  }
  /* Smaller map, larger sidebar — most users tapping a marker want venue details, not
     more map. Map stays useful for context above. */
  #map { height: 40vh; }
  .map-sidebar { max-height: 60vh; padding: 14px 14px 18px; }
  .map-sidebar h3 { font-size: 15px; margin-bottom: 6px; }
  .map-sidebar .sv-image { height: 140px; }
  .map-sidebar p, .map-sidebar .sv-meta { font-size: 12px; }

  /* === ITINERARY DAY CONTAINER ===
     Tighten the gap between days, the trip summary, and add-stop affordance */
  .itinerary-days { gap: 16px; }
  /* trip-summary uses the same styling at all sizes (see global rule) — no overrides */
  .inline-add-btn {
    font-size: 12px;
    padding: 8px 12px;
    width: 100%;
  }
  .day-stops { padding: 8px; }

  /* Itinerary view container - tighter padding, smaller h2 */
  .itinerary-container { padding: 14px 12px; }
  .itinerary-header h2 { font-size: 22px; letter-spacing: -0.5px; }
  .itinerary-actions .btn-sm {
    font-size: 11.5px;
    padding: 5px 10px;
  }
  /* "Optimize My Itinerary" is the longest label — shorten visually */
  .itinerary-actions button[onclick*="showOptimizer"] { font-size: 0; }
  .itinerary-actions button[onclick*="showOptimizer"]::before {
    content: 'Optimize';
    font-size: 11.5px;
  }
  /* Day summary: smaller icons + tighter spacing */
  .day-summary { padding: 10px 12px; }
  .day-summary .ds-item {
    font-size: 11px;
    line-height: 1.4;
  }
  /* Day notes textarea: cleaner */
  .day-notes textarea { font-size: 12px; min-height: 60px; }
  /* "Add a stop" inline search - tidier on mobile */
  .inline-search-input { font-size: 13px; padding: 8px 12px; }
  .inline-result { padding: 6px 8px; font-size: 12px; }

  /* Day route map (collapsed by default): when shown, give it sensible mobile height */
  .day-route-map { height: 200px !important; }

  /* === OPTIMIZER PANEL ===
     Stack fields in a single column so dropdowns don't overflow the viewport.
     Tighter padding so the panel fits more useful content per screen. */
  .optimizer-panel { padding: 16px 14px; }
  .optimizer-panel h3 { font-size: 16px; }
  .optimizer-desc { font-size: 12px; margin-bottom: 10px; }
  .optimizer-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .opt-field select, .opt-field input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 13px;
  }
  .opt-venue-list { max-height: 100px; overflow-y: auto; }
  .opt-mode-toggle { width: 100%; }
}

/* ===== AUTH HEADER CONTROLS ===== */
.auth-header-controls {
  display: flex;
  align-items: center;
  margin-left: 6px;
}
.auth-sign-in-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.auth-sign-in-btn:hover { border-color: var(--wine); color: var(--wine); }

/* ===== USER AVATAR & DROPDOWN ===== */
.auth-avatar-wrap { position: relative; }
.user-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--wine);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  transition: border-color var(--transition);
}
.user-avatar-btn:hover { border-color: var(--wine); }
.auth-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.auth-avatar-initial { color: white; font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif; }
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 2000;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-name {
  padding: 10px 14px 8px;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-item {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.user-dropdown-item:hover { background: var(--cream); }

/* ===== AUTH MODAL ===== */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.auth-modal-overlay.open { display: flex; }
.auth-modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  margin: 16px;
  box-shadow: var(--shadow-xl);
  position: relative;
}
.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.auth-modal-close:hover { background: var(--cream); color: var(--text); }
.auth-modal-header {
  padding: 28px 28px 0;
  text-align: center;
}
.auth-modal-header h2 {
  font-size: 22px;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.auth-modal-header p {
  font-size: 13px;
  color: var(--text-light);
}
.auth-modal-body { padding: 20px 28px 28px; }
.auth-social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
}
.auth-google-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}
.auth-google-btn:hover { background: var(--cream); border-color: #ccc; }
.auth-apple-btn {
  background: #000;
  border: 1px solid #000;
  color: white;
}
.auth-apple-btn:hover { background: #222; }
.auth-social-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  font-size: 12px;
  margin: 16px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-email-section h3 {
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: white;
  margin-bottom: 10px;
  transition: border-color var(--transition);
  outline: none;
}
.auth-input:focus { border-color: var(--wine); }
.auth-error {
  font-size: 12px;
  color: #c0392b;
  min-height: 16px;
  margin-bottom: 8px;
}
.auth-submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--wine);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 12px;
}
.auth-submit-btn:hover { background: var(--wine-dark); }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-form-toggle {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}
.auth-link {
  color: var(--wine);
  cursor: pointer;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* ===== TRIP SELECTOR ===== */
.trip-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 12px;
}
.trip-selector-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trip-label { font-size: 12px; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.trip-name-wrap { display: flex; align-items: center; gap: 4px; }
.trip-name-display { font-size: 16px; font-family: 'Playfair Display', serif; font-weight: 600; color: var(--charcoal); }
.trip-rename-btn {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: 13px; padding: 2px 4px; border-radius: 4px; line-height: 1;
  transition: var(--transition);
}
.trip-rename-btn:hover { color: var(--wine); background: rgba(114,47,55,0.08); }
.trip-switcher-dropdown { position: relative; }
.trip-switcher-btn {
  background: none; border: 1px solid var(--border); cursor: pointer;
  font-size: 10px; padding: 3px 7px; border-radius: var(--radius-sm);
  color: var(--text-light); transition: var(--transition);
}
.trip-switcher-btn:hover { border-color: var(--wine); color: var(--wine); }
.trip-switcher-list {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  min-width: 200px; z-index: 500; overflow: hidden;
}
.trip-switcher-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-size: 13px; cursor: pointer;
  transition: background var(--transition);
}
.trip-switcher-item:hover { background: var(--cream); }
.trip-switcher-item.active { color: var(--wine); font-weight: 600; }
.trip-delete-btn {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: 16px; padding: 0 4px; line-height: 1;
}
.trip-delete-btn:hover { color: #c0392b; }
.trip-switcher-new {
  padding: 9px 12px; font-size: 13px; cursor: pointer; color: var(--wine);
  font-weight: 500; border-top: 1px solid var(--border);
  transition: background var(--transition);
}
.trip-switcher-new:hover { background: var(--cream); }
.trip-share-btn { font-size: 12px; padding: 5px 12px; }

/* ===== VISITED BADGE & BUTTON ===== */
.visited-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(40, 167, 69, 0.9); color: white;
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; font-family: 'Inter', sans-serif;
}
.btn-visited-active {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: #1e7e34;
}
.btn-visited-active:hover { background: rgba(40, 167, 69, 0.2); }
.is-visited .card-image { opacity: 0.85; }
.m-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.m-btn-row .m-add-btn { flex: 1; min-width: 140px; }

/* ===== SHARE MODAL ===== */
.share-modal { max-width: 460px; }
.share-link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.share-link-input { flex: 1; margin-bottom: 0 !important; font-size: 12px; color: var(--text-light); cursor: text; }
.share-copy-btn { white-space: nowrap; padding: 10px 16px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-family: 'Inter', sans-serif; font-weight: 600; cursor: pointer; }
.share-members-section { font-size: 13px; color: var(--text-light); margin-bottom: 16px; min-height: 18px; }
.share-members-loading { font-style: italic; }
.share-members-label { }
.share-info-cards { display: flex; gap: 10px; }
.share-info-card {
  flex: 1; display: flex; gap: 10px; align-items: flex-start;
  background: var(--cream); border-radius: var(--radius-sm); padding: 12px;
}
.share-info-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.share-info-card strong { display: block; font-size: 13px; margin-bottom: 3px; }
.share-info-card p { font-size: 12px; color: var(--text-light); margin: 0; line-height: 1.5; }

/* ===== SHARED TRIP BANNER ===== */
/* ===== ITINERARY OVERFLOW MENU ===== */
.itin-overflow-wrap { position: relative; }
.overflow-trigger { font-size: 18px; padding: 4px 10px; letter-spacing: 1px; }
.itin-overflow-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  z-index: 600;
  overflow: hidden;
}
.itin-overflow-menu.open { display: block; }
.itin-overflow-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.itin-overflow-menu button:hover { background: var(--cream); }
.itin-overflow-menu button.danger { color: #c0392b; }
.itin-overflow-menu button.danger:hover { background: #fdf2f2; }

/* ===== UNDO TOAST ===== */
.undo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--charcoal);
  color: white;
  padding: 12px 16px 12px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow-xl);
  z-index: 3001;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.undo-toast.show { transform: translateX(-50%) translateY(0); }
.undo-toast-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition);
}
.undo-toast-btn:hover { background: rgba(255,255,255,0.15); }

/* ===== STOP TYPE PILL ===== */
.stop-type-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 5px;
  vertical-align: middle;
}
.stop-type-pill.winery { background: rgba(114,47,55,0.12); color: var(--wine); }
.stop-type-pill.brewery { background: rgba(184,134,11,0.12); color: var(--brew); }

/* ===== STOP REORDER BUTTONS ===== */
.stop-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 2px;
}
.stop-reorder-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
}
.stop-reorder-btn:hover:not(:disabled) { border-color: var(--wine); color: var(--wine); }
.stop-reorder-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* ===== COLLAPSIBLE NOTES ===== */
.notes-toggle-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 6px 0;
  display: block;
  transition: color var(--transition);
}
.notes-toggle-btn:hover { color: var(--wine); }
.day-notes-area {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  resize: vertical;
  min-height: 72px;
  background: white;
  transition: border-color var(--transition);
}
.day-notes-area:focus { outline: none; border-color: var(--wine); }

/* ===== SHARED TRIP BANNER ===== */
.shared-trip-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(201,169,110,0.12);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text);
}

/* ===== OPTIMIZER TRAVEL MODE TOGGLE =====
   Segmented control: tight pill pair, sized to its content (not stretched), aligned right of
   the desc paragraph. */
.opt-mode-toggle {
  display: inline-flex;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: #f7f4ef;
}
.opt-mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.opt-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.opt-mode-option:hover { color: var(--text); }
.opt-mode-option:has(input:checked) {
  background: white;
  color: var(--wine);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ===== VISITED VIEW ===== */
.visited-container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.visited-header { margin-bottom: 20px; }
.visited-header h2 { font-size: 28px; color: var(--charcoal); margin-bottom: 6px; }
.visited-summary {
  margin: 0;
  font-size: 16px;
  color: var(--text-light);
  letter-spacing: -0.2px;
  line-height: 1.5;
}
.visited-summary strong { font-weight: 700; color: var(--charcoal); }

.visited-map-wrap {
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
#visitedMap { width: 100%; height: clamp(220px, 35vh, 360px); }

.visited-empty {
  text-align: center;
  padding: 48px 20px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.visited-empty-inner h3 { font-size: 22px; color: var(--charcoal); margin-bottom: 8px; }
.visited-empty-inner p { color: var(--text-light); margin-bottom: 20px; max-width: 420px; margin-left: auto; margin-right: auto; }

.visited-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.visited-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  cursor: pointer;
}
.visited-date-label {
  font-size: 12px;
  color: #1e7e34;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.visited-date-input {
  font-size: 12px;
  font-family: inherit;
  color: var(--charcoal);
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
}
.visited-date-input:focus { outline: 2px solid rgba(40, 167, 69, 0.35); outline-offset: 1px; }

/* Nav badge for visited count */
.visited-count {
  display: inline-block;
  background: rgba(40, 167, 69, 0.85);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .visited-grid { grid-template-columns: 1fr; }
  #visitedMap { height: clamp(180px, 30vh, 260px); }
}

/* ===== GOOGLE RATING (cards + modal) =====
   Inline row of: blue G mark, gold star, rating, dot, review count. Renders as a link to
   the venue's Google Maps page (also covers Places API attribution for displayed data). */
.google-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
  margin: 2px 0 8px;
  line-height: 1.2;
}
.google-rating:hover .gr-rating { text-decoration: underline; }
.google-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #B0B0B0;
  color: white;
  font-size: 9px;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  margin-right: 2px;
}
.gr-star { color: #f5b400; font-size: 12px; line-height: 1; }
.gr-rating { font-weight: 600; }
.gr-count { color: var(--text-light); font-weight: 400; }

.google-rating-sm { font-size: 12px; }
.google-rating-md { font-size: 13px; margin: 4px 0 14px; }
.google-rating-md .google-mark { width: 16px; height: 16px; font-size: 10px; }
.google-rating-md .gr-star { font-size: 14px; }

/* ===== AWARD BADGE (cards + modal) =====
   Amber pill that quietly signals "this venue is recognized". Subtle so it doesn't compete
   with the photo or with the Google rating row directly below. */
.award-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 165, 116, 0.16);
  color: #8B6914;
  border: 1px solid rgba(212, 165, 116, 0.45);
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  margin: 2px 0 6px;
  width: max-content;
  max-width: 100%;
}
.award-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #d4a574 0%, #b8860b 100%);
  flex-shrink: 0;
}
.award-year {
  margin-left: 4px;
  opacity: 0.65;
  font-weight: 500;
}
/* Modal: stack multiple awards as a column instead of pills running side-by-side */
.modal-content .award-badge { display: flex; max-width: max-content; margin-bottom: 6px; }

/* ===== CURRENTLY CLOSED BADGE (cards + modal) =====
   Card: bottom stripe across the photo. Reads at a glance during browsing without obscuring
   the venue identity. Photo is dimmed slightly so closed cards visually de-emphasize. */
.venue-card.is-closed .card-image { filter: saturate(0.5) brightness(0.85); }
.venue-card .closed-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 5px 10px;
  background: rgba(180, 60, 40, 0.92);
  color: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
  text-transform: uppercase;
  z-index: 2;
}
/* Modal: a fuller notice block since the user is committing to view this venue */
.modal-content .m-closed-notice {
  background: rgba(180, 60, 40, 0.08);
  color: #a8341e;
  border: 1px solid rgba(180, 60, 40, 0.3);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  margin: 12px 0;
}


/* ===== SUPPORT / BUY ME A COFFEE ===== */
.support-container {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 24px;
}
.support-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.support-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}
.support-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  color: var(--charcoal);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.support-tagline {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 14px;
}
.support-body {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.55;
  margin-bottom: 26px;
}
.support-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFDD00;            /* Buy Me a Coffee brand yellow */
  color: #0d0c22;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.support-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.support-cta:active { transform: translateY(0); }
.support-cta-icon { font-size: 20px; }
.support-fineprint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 14px;
  letter-spacing: 0.2px;
}
.support-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}
.support-footer a { color: var(--wine); font-weight: 500; }

/* Footer Buy-Me-a-Coffee link */
.footer-actions { margin-top: 12px; }
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid rgba(114, 47, 55, 0.25);
  border-radius: 20px;
  transition: background 0.15s ease;
}
.footer-link:hover { background: rgba(114, 47, 55, 0.06); }

/* Discreet inline prompt at bottom of itinerary */
.itinerary-support-prompt {
  text-align: center;
  margin: 30px 0 8px;
  font-size: 13px;
  color: var(--text-light);
}
.itinerary-support-prompt a {
  color: var(--wine);
  font-weight: 600;
  margin-left: 6px;
  text-decoration: none;
  border-bottom: 1px dotted var(--wine);
}
.itinerary-support-prompt a:hover { border-bottom-style: solid; }

/* ===== MOBILE HAMBURGER MENU =====
   Hidden at desktop — the existing Sign In button + user avatar still live in the header
   nav. On phones the menu replaces the standalone Sign In button. */
.mobile-menu-wrap { display: none; }
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
}
.mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
  z-index: 1001;
  padding: 6px 0;
  overflow: hidden;
}
.mobile-menu.open { display: block; }
.mobile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.mobile-menu-item:hover { background: var(--cream); }
.mobile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.mobile-menu-name {
  padding: 10px 16px 4px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* Mobile-specific: show hamburger, hide standalone Sign In.
   Use flex flow (not absolute) so the hamburger sits inline with the logo on row 1 and
   stays vertically centered with it automatically. margin-left:auto pushes it right. */
@media (max-width: 480px) {
  .mobile-menu-wrap {
    display: flex;
    align-items: center;
    margin-left: auto;
    position: relative;
    z-index: 1001;
  }
  .header-nav .auth-header-controls { display: none !important; }
}

/* ===== DATA & ATTRIBUTIONS MODAL ===== */
.attr-modal { max-width: 560px; }
.attr-content { padding: 32px 28px 26px; }
.attr-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  margin-bottom: 18px;
}
.attr-list dt {
  font-weight: 600;
  font-size: 14px;
  margin-top: 14px;
}
.attr-list dd {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
  margin: 3px 0 0;
}
.attr-list .google-mark { vertical-align: text-bottom; }
.attr-fineprint {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #eee);
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
}
