/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light dark;
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --teal-light: #ccfbf1;
  --sky:        #0ea5e9;
  --amber:      #f59e0b;
  --amber-dark: #b45309;
  --sand:       #fef3c7;
  --coral:      #f97316;
  --white:      #ffffff;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1e293b;
  /* Tinted callout surfaces + their text colors — dark mode flips these */
  --tint-amber:        #fffbeb;
  --tint-amber-border: #fcd34d;
  --tint-amber-line:   #fde68a;
  --amber-text:        #92400e;
  --amber-text-strong: #78350f;
  --tint-red:          #fee2e2;
  --tint-red-border:   #fca5a5;
  --red-text:          #991b1b;
  --red-accent:        #b91c1c;
  --tint-green:        #ecfdf5;
  --tint-green-border: #6ee7b7;
  --green-text:        #166534;
  --green-text-strong: #047857;
  --tint-teal:         #f0fdfa;
  --tint-sky:          #e0f2fe;
  --sky-text:          #0369a1;
  --radius:     12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.15);
}

/* Device-preference dark theme: the palette flips, the components don't.
   Teal/sky/amber accents brighten a step for contrast on dark surfaces.
   --white is the SURFACE color (cards, inputs) — white text on teal/gradient
   backgrounds is written as literal #fff so it never flips. */
@media (prefers-color-scheme: dark) {
  :root {
    --teal:       #14b8a6;
    --teal-dark:  #5eead4;
    --teal-light: #134e4a;
    --sky:        #38bdf8;
    --amber-dark: #fbbf24;
    --sand:       #422e0c;
    --white:      #1e293b;
    --gray-50:    #0f172a;
    --gray-100:   #253147;
    --gray-200:   #38465e;
    --gray-300:   #4b5b76;
    --gray-400:   #94a3b8;
    --gray-500:   #a3b2c7;
    --gray-600:   #b6c2d4;
    --gray-700:   #cbd5e1;
    --gray-800:   #e8eef6;
    --tint-amber:        #3a2c0d;
    --tint-amber-border: #a16207;
    --tint-amber-line:   #854d0e;
    --amber-text:        #fcd34d;
    --amber-text-strong: #fde68a;
    --tint-red:          #43201f;
    --tint-red-border:   #7f2d2d;
    --red-text:          #fca5a5;
    --red-accent:        #f87171;
    --tint-green:        #12352a;
    --tint-green-border: #047857;
    --green-text:        #6ee7b7;
    --green-text-strong: #a7f3d0;
    --tint-teal:         #113533;
    --tint-sky:          #12314a;
    --sky-text:          #7dd3fc;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.35);
    --shadow-md:  0 4px 16px rgba(0,0,0,.45);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.55);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* Back/pricing nav link (used on index, my-trips, trip detail, upgrade) */
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 16px;
}
.back-link:hover { text-decoration: underline; }

/* ── Hero header ── */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #0ea5e9 60%, #f59e0b 100%);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.hero-tagline {
  margin-top: 10px;
  font-size: 17px;
  color: rgba(255,255,255,.85);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Main layout ── */
.page-wrap {
  max-width: 860px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Form grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  min-width: 0;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #b0bec5;
  opacity: 1;
}

/* Input with trailing unit label */
.input-with-unit {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.input-with-unit:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.input-with-unit input {
  border: none;
  border-radius: 0;
  flex: 1;
  box-shadow: none !important;
}
.input-with-unit input:focus { box-shadow: none !important; }
.input-unit {
  padding: 0 14px;
  font-size: 14px;
  color: var(--gray-400);
  background: var(--gray-50);
  border-left: 1.5px solid var(--gray-200);
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  user-select: none;
}
.upgrade-link {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
}
.upgrade-link:hover { text-decoration: underline; }

/* Date toggle buttons */
.date-toggle {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0;
}
.date-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--white);
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: background .15s, color .15s;
  border-right: 1px solid var(--gray-200);
}
.date-btn:last-child { border-right: none; }
.date-btn:hover { background: var(--gray-50); }
.date-btn.active {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}

/* Checkbox labels */
.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  gap: 4px;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}
.section-checkbox {
  font-size: 15px;
  font-weight: 600;
}

/* Park pass alert */
.park-pass-alert {
  background: var(--tint-green);
  border: 1.5px solid var(--tint-green-border);
  color: var(--green-text);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.park-pass-alert strong { color: var(--green-text-strong); }
.park-pass-alert a { color: var(--teal); font-weight: 600; }

.drive-hour-alert {
  background: var(--tint-amber);
  border: 1.5px solid var(--tint-amber-border);
  color: var(--amber-text);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.drive-hour-alert strong { color: var(--amber-dark); }

/* Upgrade banner */
.upgrade-banner {
  background: var(--tint-amber);
  border: 1.5px solid var(--tint-amber-border);
  color: var(--amber-text);
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 16px;
  display: none;
  line-height: 1.6;
}
.upgrade-banner.visible { display: block; }
.upgrade-banner strong { color: var(--amber-text-strong); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.field textarea { resize: vertical; min-height: 90px; }
.field .hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── Radio pills ── */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio-group input[type="radio"] { display: none; }
.radio-group label {
  padding: 8px 18px;
  border-radius: 99px;
  border: 1.5px solid var(--gray-200);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  color: var(--gray-600);
  text-transform: none;
  letter-spacing: 0;
}
.radio-group input[type="radio"]:checked + label {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* ── Submit button ── */
.btn-generate {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--sky) 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: .3px;
  box-shadow: var(--shadow-sm);
  transition: opacity .2s, transform .1s;
  margin-top: 8px;
}
.btn-generate:hover { opacity: .92; transform: translateY(-1px); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Loading spinner ── */
#loading {
  display: none;
  text-align: center;
  padding: 48px 0;
}
#loading.visible { display: block; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { color: var(--gray-600); font-size: 15px; }

/* ── Itinerary output ── */
#results { display: none; }
#results.visible { display: block; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.results-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
}

/* Trip dates row */
.trip-dates-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}
.trip-dates-label { color: var(--gray-600); font-weight: 600; }
.trip-dates-value { color: var(--teal-dark); font-weight: 700; }
.trip-dates-edit-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
}
.trip-dates-edit-btn:hover { text-decoration: underline; }
#trip-start-date-input {
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
}

/* Budget strip */
.budget-strip {
  background: linear-gradient(135deg, var(--teal-light), var(--tint-sky));
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.budget-stat { text-align: center; }
.budget-stat .amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--teal-dark);
}
.budget-stat .label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.budget-pill {
  margin-left: auto;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}
.budget-pill.ok   { background: var(--tint-green); color: var(--green-text); }
.budget-pill.over { background: var(--tint-red); color: var(--red-text); }

.budget-breakdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  width: 100%;
}
.budget-item {
  background: var(--white);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  flex: 1;
  min-width: 100px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.budget-item .bi-amount { font-weight: 700; font-size: 16px; color: var(--teal-dark); }
.budget-item .bi-label  { color: var(--gray-400); font-size: 11px; margin-top: 2px; }

/* Day cards */
.day-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.day-card-header {
  background: linear-gradient(90deg, var(--teal) 0%, var(--sky) 100%);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.day-card-header h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.day-card-header .chevron {
  color: rgba(255,255,255,.8);
  font-size: 18px;
  transition: transform .25s;
}
.day-card.collapsed .chevron { transform: rotate(-90deg); }
.day-card-body {
  padding: 20px 24px;
  line-height: 1.75;
  font-size: 15px;
}
.day-card.collapsed .day-card-body { display: none; }

/* Markdown inside day cards */
.day-card-body ul { padding-left: 20px; }
.day-card-body li { margin-bottom: 6px; }
.day-card-body strong { color: var(--teal-dark); }

/* Individually boxed itinerary items */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-box {
  position: relative;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14.5px;
  color: var(--gray-700);
  line-height: 1.6;
}
.item-box.type-drive  { border-left-color: var(--sky, #0ea5e9); }
.item-box.type-stay   { border-left-color: var(--amber, #d97706); }
.item-box.type-meal   { border-left-color: #16a34a; }
.item-box.type-visit  { border-left-color: var(--teal); }
.item-box.type-activity { border-left-color: #7c3aed; }
.item-box strong { color: var(--teal-dark); }
/* Suggested clock time — turns the day list into a schedule you can follow.
   Its own box LEFT of the item, mirroring the cost boxes on the right. */
.item-time-box {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 74px;
  background: var(--tint-teal, #f0fdfa);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--teal-dark);
  text-align: center;
  white-space: nowrap;
}
.item-time-box .item-time-sub {
  font-size: 10px; font-weight: 600; color: var(--gray-500);
  margin-top: 2px; letter-spacing: 0;
}
.item-time-box.item-time-overnight { color: var(--amber-text, #b45309); background: var(--tint-amber, #fffbeb); }
/* Clickable map-dot number beside an item — same number and color as the
   stop's dot on the route map; clicking scrolls back up and opens its popup.
   Text color is white on a colored dot in BOTH schemes, so it stays literal. */
.item-map-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  cursor: pointer; padding: 0;
  margin-right: 7px; vertical-align: text-bottom;
}
.item-map-dot:hover { transform: scale(1.15); }
/* Per-stop "how to do this" line — entrance, parking, which trail, what to skip. */
.item-details {
  font-size: 13px; color: var(--gray-600);
  line-height: 1.45; margin-top: 6px;
  padding-left: 10px; border-left: 2px solid var(--gray-200);
}
/* Paid-only toggle: exact clock times vs. Morning/Midday/Evening blocks. */
.sched-toggle-row { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.sched-toggle-label { font-size: 13px; font-weight: 600; color: var(--gray-500); }
.sched-toggle { display: inline-flex; border: 1px solid var(--gray-200); border-radius: 999px; padding: 2px; background: var(--gray-50, #f8fafc); }
.sched-opt {
  border: none; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--gray-500);
  padding: 5px 14px; border-radius: 999px;
}
.sched-opt.active { background: var(--teal); color: #fff; }
/* "Book these now" checklist — reservations/permits gathered after the days. */
.bc-card {
  background: var(--tint-amber, #fffbeb); border: 1px solid var(--amber, #d97706);
  border-radius: 12px; padding: 14px 16px; margin: 18px 0;
}
.bc-card-title { font-size: 15px; font-weight: 800; color: var(--amber-text, #b45309); }
.bc-sub { font-size: 12.5px; color: var(--gray-600); margin: 2px 0 10px; }
.bc-item { padding: 8px 0; border-top: 1px solid var(--tint-amber-border, #fde68a); }
.bc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bc-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.bc-by { font-size: 12px; font-weight: 700; color: var(--amber-text, #b45309); white-space: nowrap; }
.bc-day { font-size: 12px; color: var(--gray-500); }
.bc-note { font-size: 13px; color: var(--gray-600); line-height: 1.45; margin-top: 3px; }
/* Per-day "pack & prep" — what to bring and know for that specific day. */
.day-prep {
  background: var(--tint-teal, #f0fdfa); border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 10px 13px; margin-bottom: 12px;
  font-size: 13.5px; color: var(--gray-700); line-height: 1.5;
}
.day-prep-label {
  font-weight: 800; color: var(--teal-dark); margin-right: 6px;
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em;
}
.item-box-edit-btn {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; color: var(--gray-400);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 6px;
  border-radius: 6px;
}
.item-box-edit-btn:hover { color: var(--teal); background: var(--gray-100); }
.item-box-editing textarea {
  width: 100%; box-sizing: border-box; font-size: 14.5px; font-family: inherit;
  padding: 8px 10px; border: 1px solid var(--teal); border-radius: 6px; resize: vertical;
  line-height: 1.6;
}
.item-box-edit-actions { display: flex; gap: 8px; margin-top: 8px; }
.item-box-edit-actions button {
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer; border: none;
}
.item-box-save   { background: var(--teal); color: #fff; }
.item-box-cancel { background: var(--gray-100); color: var(--gray-600); }

/* Per-item cost badge, shown as its own box beside the item */
.item-row { display: flex; align-items: stretch; gap: 8px; }
.item-row .item-box { flex: 1; min-width: 0; }
.item-cost-box {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal-dark);
  text-align: center;
}
.item-cost-box .item-cost-label {
  font-size: 9.5px; font-weight: 600; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .4px; margin-top: 2px;
}
.item-drive-info-box {
  min-width: 90px;
  font-size: 12.5px;
  color: var(--gray-700);
  white-space: nowrap;
}

/* Hoverable place name -> Google-style info popup */
.place-hover { cursor: pointer; border-bottom: 1px dotted var(--teal); }
.place-tooltip {
  position: fixed;
  display: none;
  z-index: 9999;
  width: 280px;
  max-height: 340px;
  overflow-y: auto;
  background: #fff; /* stays white in dark mode — content matches Google InfoWindow styling */
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  border: 1px solid var(--gray-200);
}

/* Upgrade nav button */
.btn-upgrade-nav {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--teal), var(--sky));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .2s;
}
.btn-upgrade-nav:hover { opacity: .88; }

/* Deals strip */
.deals-strip {
  background: var(--tint-amber);
  border: 1.5px solid var(--tint-amber-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.deals-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--amber-text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.deal-item {
  font-size: 13px;
  color: var(--amber-text-strong);
  padding: 6px 0;
  border-bottom: 1px solid var(--tint-amber-line);
  line-height: 1.5;
  display: flex;
  gap: 8px;
}
.deal-item::before { content: "★"; color: var(--amber); flex-shrink: 0; }
.deal-item:last-child { border-bottom: none; }
.deal-item a { color: var(--teal-dark); font-weight: 600; }

/* Itinerary edit card */
.edit-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--teal-light);
  margin-top: 24px;
  overflow: hidden;
}
.edit-header {
  background: linear-gradient(135deg, var(--teal-light), var(--tint-sky));
  padding: 18px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.edit-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-dark);
}
.edit-subtitle {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}
.upgrade-badge {
  background: linear-gradient(135deg, var(--teal), var(--sky));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.edit-day-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.edit-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}
.edit-day-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}
.edit-day-btns { display: flex; gap: 6px; }
.edit-day-btn {
  padding: 5px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
}
.edit-day-btn.keep.active   { background: var(--tint-green); border-color: var(--tint-green-border); color: var(--green-text); }
.edit-day-btn.change.active { background: var(--tint-red); border-color: var(--tint-red-border); color: var(--red-text); }

.edit-text-section { padding: 0 20px 16px; }
.edit-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.edit-text-section textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  resize: vertical;
  outline: none;
}
.edit-text-section textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.edit-footer {
  padding: 14px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.edit-hint { font-size: 12px; color: var(--gray-400); flex: 1; }
.btn-regenerate {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--teal), var(--sky));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-regenerate:hover { opacity: .9; }
.btn-regenerate:disabled { opacity: .6; cursor: not-allowed; }

/* Export button */
.btn-export {
  padding: 10px 22px;
  background: var(--white);
  border: 1.5px solid var(--teal);
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
}
.btn-export:hover { background: var(--teal-light); }

/* ── Error banner ── */
.error-banner {
  background: var(--tint-red);
  border: 1px solid var(--tint-red-border);
  color: var(--red-text);
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 16px;
  display: none;
}
.error-banner.visible { display: block; }

/* ── Map card ── */
.map-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.map-header {
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--sky) 100%);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.map-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.map-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,.8);
}
#trip-map {
  width: 100%;
  height: 440px;
}

/* Drive legs panel */
.drive-legs {
  border-top: 1px solid var(--gray-200);
}
.leg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
  font-size: 14px;
}
.leg-row:last-child { border-bottom: none; }
.leg-row.leg-total {
  background: var(--gray-50);
  font-size: 14px;
}
.leg-labels {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.leg-from, .leg-to {
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.leg-arrow { color: var(--gray-400); flex-shrink: 0; }
.leg-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.leg-stat { color: var(--teal-dark); font-weight: 600; }
.leg-divider { color: var(--gray-400); }

/* Stops list dropdown */
.stops-list-toggle-row { border-top: 1px solid var(--gray-200); }
.stops-list-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--teal-dark);
}
.stops-list-toggle:hover { background: var(--gray-50); }
.stops-list-toggle .chevron { color: var(--teal); transition: transform .2s; }
.stops-list { border-top: 1px solid var(--gray-100); }
.stop-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.stop-row:last-child { border-bottom: none; }
.stop-row:hover { background: var(--gray-50); }
.stop-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700;
}
.stop-name { font-size: 14px; color: var(--gray-700); }
.stop-day { font-size: 12px; color: var(--gray-400); margin-left: auto; flex-shrink: 0; }

/* Map legend */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 10px 20px;
  border-top: 1px solid var(--gray-100);
  font-size: 12px; color: var(--gray-600);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Editable packing list ── */
.packing-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.5;
}
.packing-del {
  background: none;
  border: none;
  color: var(--gray-300);
  font-size: 17px;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.packing-del:hover { color: var(--red-accent); }
.packing-add-row { display: flex; gap: 8px; margin-top: 14px; }
.packing-add-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
}

/* ── School breaks ── */
.school-break-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--teal);
  background: var(--tint-teal);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.school-break-edit {
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.break-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.break-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 13px; }

/* ── Reverse search (Where can we afford to go?) ── */
.idea-toggle {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: 100%; background: none; border: none; padding: 0;
  cursor: pointer; text-align: left; font-family: inherit;
}
.idea-toggle-title { font-size: 16px; font-weight: 800; color: var(--teal); }
.idea-toggle-sub { font-size: 13px; color: var(--gray-500); flex: 1; }
.idea-toggle .chevron { color: var(--teal); font-size: 18px; transition: transform .2s; margin-left: auto; }
.idea-result {
  border: 1px solid var(--gray-100); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.idea-result.idea-over { opacity: .65; }
.idea-result-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.idea-result-name { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.idea-result-months { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.idea-result-price { font-size: 18px; font-weight: 800; color: var(--teal); white-space: nowrap; }
.idea-result-price.over { color: var(--amber-dark, #b45309); }
.idea-result-why { font-size: 14px; color: var(--gray-600); margin-top: 8px; line-height: 1.5; }
.idea-result-breakdown { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.idea-result-highlights { font-size: 13px; color: var(--gray-600); margin-top: 6px; font-weight: 600; }

/* ── Booking-site connections (Expedition) ── */
.booking-link-group { margin-bottom: 12px; }
.booking-link-group:last-child { margin-bottom: 0; }
.booking-link-cat {
  font-size: 12px; font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 6px;
}
.booking-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.booking-link {
  font-size: 13px; font-weight: 600;
  color: var(--teal);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 12px;
  text-decoration: none;
}
.booking-link:hover { border-color: var(--teal); background: var(--tint-teal); }

.hero-subline {
  font-size: 14px;
  opacity: .85;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .budget-strip { flex-direction: column; align-items: flex-start; }
  .budget-pill { margin-left: 0; }
  #trip-map { height: 300px; }
  .leg-from, .leg-to { max-width: 120px; }
  .page-wrap { padding: 14px; }
  .app-nav, .page-nav { flex-wrap: wrap; gap: 8px; }
  .nav-user { flex-wrap: wrap; row-gap: 6px; }
  .results-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .results-header h2 { font-size: 20px; }
  .results-header > div { width: 100%; }
  .btn-export, .btn-save-trip, .btn-upgrade-nav { flex: 1; text-align: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .idea-toggle-sub { flex-basis: 100%; }
  .trips-grid { grid-template-columns: 1fr; }
  .day-card-header h3 { font-size: 15px; }
  .booking-link-row { gap: 6px; }
  .booking-link { flex: 1; text-align: center; }
  .item-time-box { min-width: 56px; padding: 6px 6px; font-size: 11.5px; }
}

/* ── Reverse search: hotel vs camping/RV price options ── */
.idea-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--gray-100); border-radius: 10px;
  padding: 10px 12px; margin-top: 10px; background: var(--white);
}
.idea-option-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.idea-option-label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.idea-option-price { font-size: 15px; font-weight: 800; color: var(--teal); }
.idea-option-over .idea-option-price { color: var(--amber-dark, #b45309); }
.idea-option-breakdown { font-size: 11px; color: var(--gray-400); }

/* ── Line-by-line itinerary editing ── */
.item-box-btns { display: flex; gap: 2px; flex-shrink: 0; }
.item-box-del-btn:hover { color: var(--red-accent) !important; background: var(--tint-red) !important; }
.item-box-placeholder {
  border: 1px dashed var(--amber, #d97706) !important;
  background: var(--tint-amber) !important;
}
.item-edit-hint { font-size: 12px; color: var(--gray-400); margin-top: 6px; line-height: 1.4; }
.item-ai-input {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
  font-size: 13px; font-family: inherit;
}

/* ── Reservation-required warnings ── */
.reservation-warning {
  font-size: 12px; font-weight: 600; color: var(--amber-text);
  background: var(--sand); border-radius: 6px;
  padding: 5px 8px; margin-top: 6px; line-height: 1.45;
}
.reservation-backup {
  font-size: 12px; color: var(--gray-600);
  background: var(--tint-teal); border-radius: 6px;
  padding: 5px 8px; margin-top: 4px; line-height: 1.45;
}

/* Per-day notes: warnings/info shown on the day they apply to (drive over
   limit, spotty signal, airport transport) instead of trip-level banners. */
.day-notes { margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.day-note {
  font-size: 12.5px; line-height: 1.45; border-radius: 6px;
  padding: 7px 10px; display: flex; gap: 7px; align-items: flex-start;
}
.day-note .day-note-icon { flex: 0 0 auto; font-size: 13px; line-height: 1.3; }
.day-note-warn   { background: var(--sand); color: var(--amber-text); font-weight: 600; }
.day-note-signal { background: var(--sand); color: var(--amber-text); font-weight: 600; }
.day-note-info   { background: var(--tint-teal); color: var(--gray-700); }

/* ── "When are you going?" scheduler modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 440px; width: 100%; padding: 28px;
}
.modal-title { margin: 0 0 8px; font-size: 20px; color: var(--gray-800); }
.modal-sub { margin: 0 0 18px; font-size: 14px; color: var(--gray-600); line-height: 1.5; }
.modal-selects { display: flex; gap: 10px; }
.modal-selects select {
  flex: 1; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--gray-200); border-radius: 8px;
  background: var(--white); color: var(--gray-800); cursor: pointer;
}
.modal-msg { min-height: 18px; font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.modal-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px;
}
.modal-skip {
  background: none; border: none; color: var(--gray-600);
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: underline; padding: 8px 4px;
}
.modal-skip:hover { color: var(--gray-800); }

/* Reverse-search full-view subtitle */
.idea-results-sub { color: var(--gray-600); font-size: 14px; margin: 0 0 16px; }

/* Planner form sections + progressive disclosure */
.form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.form-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--teal); margin-bottom: 14px;
}
.form-advanced-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--teal);
}
.form-advanced-toggle .chevron { transition: transform .2s; margin-left: 2px; }

/* Map destination picker (planner "Where & when" section) */
.dest-picker-box {
  border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 14px; background: var(--gray-50, #f9fafb);
}
#dest-picker-map {
  width: 100%; height: 340px; border-radius: 10px;
  border: 1px solid var(--gray-200); background: var(--gray-100);
}
#dest-picker-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dest-pin-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-light); color: var(--teal-dark);
  border: 1px solid var(--teal); border-radius: 999px;
  padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 600;
}
.dest-pin-remove {
  background: none; border: none; color: var(--teal-dark);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 6px;
}
.dest-pin-remove:hover { color: var(--gray-800); }
.dest-picker-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.dest-filled-flash { box-shadow: 0 0 0 3px var(--teal-light); border-color: var(--teal) !important; transition: box-shadow .3s; }
@media (max-width: 640px) { #dest-picker-map { height: 260px; } }

/* ── Planner wizard (one step on screen at a time) ── */
.wizard-progress {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 4px; margin: 4px 0 26px;
}
.wizard-dot {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: inherit; min-width: 64px;
}
.wizard-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--gray-200); background: var(--white);
  color: var(--gray-500); font-size: 14px; font-weight: 700;
  transition: all .2s;
}
.wizard-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--gray-500);
}
.wizard-dot.current .wizard-num { background: var(--teal); border-color: var(--teal); color: #fff; }
.wizard-dot.current .wizard-lbl { color: var(--teal); }
.wizard-dot.done .wizard-num { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }
.wizard-dot.done .wizard-lbl { color: var(--teal-dark); }
.wizard-line { flex: 1; max-width: 70px; height: 2px; background: var(--gray-200); margin-top: 17px; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: wizardFade .25s ease; }
@keyframes wizardFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wizard-step-title { font-size: 21px; font-weight: 800; color: var(--gray-800); }
.wizard-step-sub { font-size: 14px; color: var(--gray-500); margin: 4px 0 18px; }

.wizard-nav { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.wizard-btn-back {
  padding: 12px 22px; border-radius: 10px; border: 1px solid var(--gray-200);
  background: var(--white); color: var(--gray-600); font-size: 15px;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.wizard-btn-back:hover { background: var(--gray-50, #f9fafb); }
.wizard-btn-next {
  flex: 1; padding: 14px; border-radius: 10px; border: none;
  background: var(--teal); color: #fff; font-size: 16px;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.wizard-btn-next:hover { background: #0f766e; }
.wizard-nav .btn-generate { flex: 1; width: auto; margin: 0; }

@media (max-width: 640px) {
  .wizard-dot { min-width: 48px; }
  .wizard-lbl { font-size: 10px; }
  .wizard-line { max-width: 30px; }
}

/* The picker's hover popup is hover-only — hide the InfoWindow close button
   on API versions that ignore the headerDisabled option (an unreachable X:
   moving the mouse toward it leaves the marker and closes the popup). */
#dest-picker-map .gm-ui-hover-effect { display: none !important; }

/* Route-map popups (index/trip-detail) DO want a visible close X. Google's
   default close button carries the class "gm-ui-hover-effect", which is
   low-opacity until hovered; with color-scheme:dark on :root the browser also
   renders it near-invisible, so it was clickable in the top-right but the X
   never showed (owner report 2026-07-08). Force the button and its icon fully
   opaque and dark. The picker rule above uses display:none, which still wins,
   so this can't un-hide the picker's button. The InfoWindow bubble is always
   white, so a slate icon reads on every theme. */
.gm-style-iw button.gm-ui-hover-effect {
  opacity: 1 !important;
  color-scheme: light;
}
.gm-style-iw button.gm-ui-hover-effect > span,
.gm-style-iw button.gm-ui-hover-effect img {
  opacity: 1 !important;
  background-color: #475569 !important;
}
