/* ============================================================
   VOYAGEA v2 — Design System
   "High-End Editorial Travel"
   ============================================================ */

/* ── Tokens ── */
:root {
  --c-surface:      #fdffdb;
  --c-card:         #ffffff;
  --c-interactive:  #f0eee1;
  --c-container:    var(--c-card);  /* list cards on the surface; was referenced but never defined */
  --c-primary:      #b02d21;
  --c-primary-deep: #8b1e14;   /* gradient end for hero/budget surfaces */
  --c-primary-soft: #ffdad5;   /* tinted hover / selection */
  --c-primary-text: #ffffff;
  --c-text:         #38392e;
  --c-text-dim:     #656559;
  --c-border:       rgba(187,186,172,0.18);
  --c-success:      #166534;
  --c-success-bg:   #dcfce7;
  --c-danger:       #991b1b;
  --c-danger-bg:    #fee2e2;
  --font:           'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:      var(--font);   /* referenced across this file; was never defined */
  --r-sm:  0.75rem;
  --r-md:  1.25rem;
  --r-lg:  1.75rem;
  --r-xl:  2.25rem;
  --nav-h: 5rem;
}

[data-theme="dark"] {
  --c-surface:      #131315;
  --c-card:         #1e1d21;
  --c-interactive:  #2a2a2e;
  --c-primary:      #f65e4d;
  --c-primary-deep: #b02d21;
  --c-primary-soft: rgba(246,94,77,0.16);
  --c-success:      #86efac;
  --c-success-bg:   rgba(22,101,52,0.28);
  --c-danger:       #fca5a5;
  --c-danger-bg:    rgba(153,27,27,0.28);
  --c-text:         #e5e1e4;
  --c-text-dim:     #9a968e;
  --c-border:       rgba(255,255,255,0.07);
}

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

html, body {
  font-family: var(--font);
  background: var(--c-surface);
  color: var(--c-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ================================================================
   SIDEBAR (bottom-sheet style)
   app.js adds .is-open to #sidebar
================================================================ */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
/* app.js opens sidebar by adding .is-open */
#sidebar.is-open ~ .sidebar-overlay { opacity:1; pointer-events:all; }
.sidebar-overlay.is-visible { opacity:1; pointer-events:all; }

.v2-sidebar {
  position: fixed;
  inset: auto 0 0 0;
  max-height: 82dvh;
  background: var(--c-card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -12px 48px rgba(0,0,0,0.18);
  z-index: 201;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 2rem;
  transform: translateY(110%);
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1);
  overflow: hidden;
}
.v2-sidebar.is-open { transform: translateY(0); }

.v2-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.v2-sidebar-label {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.v2-icon-btn {
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-dim);
}
.v2-icon-btn .material-icons { font-size: 1.1rem; }

.v2-new-trip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--c-primary);
  color: var(--c-primary-text);
  border: none;
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  width: 100%;
  margin-bottom: 1rem;
}
.v2-new-trip-btn .material-icons { font-size: 1.1rem; }

.trip-list {
  flex: 1;
  overflow-y: auto;
}

/* app.js injects .trip-item elements */
.trip-list .trip-item {
  padding: 0.875rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--c-text);
}
.trip-list .trip-item:hover,
.trip-list .trip-item.is-active { background: var(--c-interactive); }

.v2-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.v2-user-email {
  flex: 1;
  min-width: 0;
  font-size: 0.7rem;
  color: var(--c-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v2-guest-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  padding: 0.2em 0.6em;
  border-radius: 999px;
  display: none;
}
.v2-text-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-dim);
  padding: 0.3rem 0.5rem;
}

/* ================================================================
   PLACE DRAWER (Add Place bottom-sheet)
================================================================ */
.place-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.place-drawer-overlay.is-active { opacity: 1; pointer-events: all; }

.v2-place-drawer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 410;
  background: var(--c-surface);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.14);
}
.v2-place-drawer.is-open { transform: translateY(0); }

/* drag handle pill */
.v2-place-drawer::before {
  content: "";
  display: block;
  width: 36px; height: 4px;
  background: var(--c-border);
  border-radius: 999px;
  margin: 0 auto 1.25rem;
}

.v2-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.v2-drawer-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.v2-drawer-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.5rem;
}

.v2-drawer-input {
  width: 100%;
  background: var(--c-interactive);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--c-text);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.v2-drawer-input:focus {
  outline: none;
  border-color: var(--c-primary);
}

/* status line (mirrors #mapStatusText) */
.v2-map-status {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  min-height: 1.3em;
  margin-top: 0.5rem;
}
.v2-map-status.is-loading { color: var(--c-primary); }
.v2-map-status.is-hidden  { visibility: hidden; }

/* Name + notes section — hidden until URL is entered */
.v2-drawer-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
  animation: drawerDetailsFade 0.22s ease;
}
.v2-drawer-details[hidden] { display: none; }

@keyframes drawerDetailsFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.v2-drawer-label-hint {
  font-weight: 400;
  opacity: 0.6;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.65rem;
}

/* Space between label rows inside details */
.v2-drawer-details .v2-drawer-label + .v2-drawer-label,
.v2-drawer-details .v2-drawer-input + .v2-drawer-label {
  margin-top: 0.875rem;
}

.v2-drawer-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.85rem;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity 0.15s;
}
.v2-drawer-submit:hover { opacity: 0.88; }
.v2-drawer-submit .material-icons { font-size: 1.1rem; }

/* ================================================================
   HERO
================================================================ */
.v2-hero {
  position: relative;
  width: 100%;
  height: 25vh;
  min-height: 200px;
  overflow: hidden;
  border-radius: 0 0 2.5rem 2.5rem;
  background: #1a1a2e;
}

.v2-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0;
  transform: scale(1.06);
  /* Desaturate slightly and warm up to match cream palette */
  filter: saturate(0.8) brightness(0.88);
  transition: opacity 1s ease, transform 12s ease;
}
.v2-hero-photo.loaded {
  opacity: 1;
  transform: scale(1);
}

.v2-hero-scrim {
  position: absolute;
  inset: 0;
  /* Warm black bottom for text legibility, subtle vignette top */
  background:
    linear-gradient(to top,  rgba(20,12,8,0.82)  0%,  rgba(20,12,8,0.08) 55%, transparent 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.28) 0%, transparent 40%);
  /* Warm color wash that matches primary brand red very subtly */
  mix-blend-mode: normal;
}

/* Top bar */
.v2-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 1.125rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.v2-burger {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 10px;
  width: 40px; height: 40px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
}
.v2-burger span {
  display: block;
  width: 17px; height: 2px;
  background: #fff;
  border-radius: 2px;
}

.v2-save-chip {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.8);
  padding: 0.3em 0.75em;
  border-radius: 999px;
}

/* Hero body */
.v2-hero-body {
  position: absolute;
  bottom: 3.75rem;
  left: 1.75rem;
  right: 1.75rem;
  z-index: 2;
  color: #fff;
}

.v2-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--c-primary);
  border-radius: 999px;
  padding: 0.32rem 0.875rem;
  margin-bottom: 0.875rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--c-primary) 45%, transparent);
}
.v2-countdown .material-icons { font-size: 0.85rem; }

.v2-hero-title {
  font-size: clamp(1.9rem, 7vw, 3.25rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
  margin-bottom: 0.4rem;
}

.v2-hero-dates {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ================================================================
   BUDGET CARD
================================================================ */
.v2-budget-card {
  margin: 0 1.25rem;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
  background: linear-gradient(145deg, var(--c-primary) 0%, var(--c-primary-deep) 100%);
  color: var(--c-primary-text);
  border-radius: var(--r-xl);
  padding: 1.375rem 1.625rem 1.375rem;
  box-shadow: 0 10px 36px color-mix(in srgb, var(--c-primary) 32%, transparent);
}

.v2-bc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.125rem;
}
.v2-bc-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.3rem;
}
.v2-bc-amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.v2-bc-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
}
.v2-bc-icon .material-icons { font-size: 1.2rem; }

.v2-bc-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}
.v2-bc-track {
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  overflow: hidden;
}
.v2-bc-fill {
  height: 100%;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
}

/* ================================================================
   MAP CONTAINER (Places tab — replaces budget card overlap)
================================================================ */
#v2MapContainer {
  margin: 0 1.25rem;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
  border-radius: var(--r-xl);
  overflow: hidden;
  height: 42vh;
  min-height: 220px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.22);
}

#tripMap {
  width: 100%;
  height: 100%;
}

/* Leaflet divIcon markers — numbered pins for individual-day view */
.numbered-marker {
  background: transparent;
  border: none;
}

.marker-number {
  width: 28px;
  height: 28px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-body);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  border: 2px solid #fff;
}

.hotel-marker .marker-number {
  background: #c69a55;
  border-radius: 6px;
  font-size: 11px;
}

/* Route arrows between numbered pins */
.route-arrow {
  background: transparent;
  border: none;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary);
  text-shadow:
    1px  1px 0 #fff,
   -1px -1px 0 #fff,
    1px -1px 0 #fff,
   -1px  1px 0 #fff;
}

/* ================================================================
   MAIN + PANELS
================================================================ */
.v2-main {
  padding: 1.25rem 1.25rem 0;
  padding-bottom: calc(var(--nav-h) + 1rem);
  min-height: 30vh;
}

/* app.js sets tableCard to display:flex — constrain the flex item so it never
   forces horizontal scroll at any viewport width */
#tableCard {
  background: transparent;
  overflow: hidden;
  width: 100%;
}
#tableBody {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.v2-panel {
  animation: fadein 0.22s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel toolbar (total chip + collapse + add button) */
.v2-panel-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.v2-panel-total {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: 0.04em;
  margin-right: auto;
}
.v2-add-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 0.6rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.v2-add-pill .material-icons { font-size: 1rem; }
.v2-add-pill:hover { opacity: 0.88; }

/* Cards list container */
.v2-bento {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ================================================================
   FLIGHT PASS CARD (v2 style)
   app.js renders .flight-pass elements into #bentoFlights
================================================================ */
.flight-pass {
  background: var(--c-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(56,57,46,0.07);
  transition: box-shadow 0.2s;
  position: relative;
  font-family: var(--font);
}
.flight-pass:has(.card-expanded-content:not([style*="display: none"])) {
  box-shadow: 0 6px 28px rgba(56,57,46,0.1);
}

/* ── Collapsed header ── */
.card-collapsed-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 1.125rem 1.125rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Route: codes + date stacked */
.card-collapsed-route { min-width: 0; }

.card-collapsed-codes {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.card-collapsed-code {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
  line-height: 1;
}
.card-collapsed-arrow {
  font-size: 0.9rem;
  color: var(--c-primary);
  font-weight: 700;
}
.card-collapsed-date {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}

/* Info: airline + price — right-aligned */
.card-collapsed-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 0;          /* label may ellipsize; the price never clips */
}
.card-collapsed-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.card-collapsed-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-text);
  white-space: nowrap;
}

/* Expand chevron button */
.card-expand-btn {
  background: var(--c-interactive);
  border: none;
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--c-text-dim);
  transition: background 0.15s;
}
.card-expand-icon {
  font-size: 0.55rem;
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.flight-pass:not(.is-collapsed) .card-expand-icon {
  transform: rotate(180deg);
}

/* ── Expanded content — animated with max-height ── */
.card-expanded-content {
  overflow: hidden;
  max-height: 0;
  transition:
    max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    padding    0.28s ease,
    opacity    0.2s ease;
  padding: 0 1rem;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  border-top: 0px solid var(--c-border);
}
.flight-pass:not(.is-collapsed) .card-expanded-content,
.hotel-voucher:not(.is-collapsed) .card-expanded-content {
  max-height: 700px;
  padding: 1rem;
  opacity: 1;
  border-top-width: 1px;
}

/* Flight number search */
.fp-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.fp-search input {
  flex: 1;
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.55rem 0.875rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text);
}
.fp-search input:focus { outline: 1.5px solid var(--c-primary); }
.fp-search-btn {
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--c-text-dim);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.fp-search-btn:hover { background: var(--c-primary); color: #fff; }

/* Airline input */
.fp-airline-input {
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  width: 100%;
  text-align: center;
}
.fp-airline-input:focus { outline: none; color: var(--c-text); }

/* Date chips (inserted after fp-search by app.js) */
.fp-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--c-interactive);
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c-text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin: 0 0.2rem 0.2rem 0;
}
.fp-date-chip.is-active,
.fp-date-chip:hover {
  background: var(--c-primary);
  color: #fff;
}
/* Wrapper that app.js may insert chips into */
.fp-date-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Route — Apple Wallet boarding pass */
.fp-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.fp-airport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.fp-airport.fp-destination { align-items: center; }

.fp-time {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
  line-height: 1;
}
.fp-code {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--c-text);
  line-height: 1;
}
.fp-city-input {
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  text-align: center;
  width: 100%;
}
.fp-city-input:focus { outline: none; color: var(--c-text); }

/* Connector */
.fp-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.25rem;
}
.fp-flight-badge {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  text-transform: uppercase;
  white-space: nowrap;
}
.fp-line {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
}
.fp-dash {
  flex: 1;
  height: 1.5px;
  background: var(--c-border);
  border-radius: 2px;
}
.fp-line svg {
  color: var(--c-primary);
  flex-shrink: 0;
}

/* Date/time pickers */
.fp-datetimes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.fp-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.fp-field label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.fp-dt-pair {
  display: flex;
  gap: 0.3rem;
}
.fp-dt-pair input {
  flex: 1;
  min-width: 0;
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.5rem 0.4rem;
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--c-text);
  text-align: center;
}
.fp-dt-pair input:focus { outline: 1.5px solid var(--c-primary); }

/* Price row */
.fp-price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--c-interactive);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.875rem;
}
.fp-price-row label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.fp-price-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  text-align: right;
  min-width: 0;
}
.fp-price-input:focus { outline: none; }

/* Footer */
.fp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.25rem;
}
.fp-collapse-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c-text-dim);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.fp-footer .btn-icon-small {
  background: none;
  border: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--c-text-dim);
  transition: background 0.15s, color 0.15s;
}
.fp-footer .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* ================================================================
   HOTEL VOUCHER CARD (v2 style)
   app.js renders .hotel-voucher elements into #bentoLodging
   Shares collapsed-header/expanded-content + expand animation
   with .flight-pass — only voucher-specific styles added here.
================================================================ */
.hotel-voucher {
  background: var(--c-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(56,57,46,0.07);
  transition: box-shadow 0.2s;
  font-family: var(--font);
}
.hotel-voucher:not(.is-collapsed) {
  box-shadow: 0 6px 28px rgba(56,57,46,0.1);
}

/* ── Collapsed name (replaces IATA codes for hotels) ── */
.card-collapsed-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-collapsed-city {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-top: 0.2rem;
}

/* ── Expanded: hotel name ── */
.voucher-main { margin-bottom: 0; }
.hotel-name-input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  padding: 0;
}
.hotel-name-input:focus { outline: none; border-bottom: 1.5px solid var(--c-primary); }
.hotel-name-input::placeholder { color: var(--c-text-dim); opacity: 0.55; }

/* ── Shared label style (used by both rows) ── */
.voucher-dates-label {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  white-space: nowrap;
}

/* ── Dates row — unified strip: Check-in | Check-out | City ──
   One shared background; hairline dividers separate the cells.
   Inputs sit directly on the strip background (no individual pills). */
.voucher-dates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--c-interactive);
  border-radius: var(--r-md);
  overflow: hidden;
}
.voucher-dates > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.625rem 0.75rem;
  min-width: 0;
}
.voucher-dates > div + div {
  border-left: 1px solid var(--c-border);
}
.voucher-dates input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
  padding: 0;
}
.voucher-dates input:focus { outline: none; color: var(--c-primary); }

/* ── Details row — unified strip: Nights | Total | Status | Paid By ── */
.voucher-details {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  background: var(--c-interactive);
  border-radius: var(--r-md);
  overflow: hidden;
  align-items: stretch;
}
.voucher-details > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.625rem 0.75rem;
  min-width: 0;
}
.voucher-details > div + div {
  border-left: 1px solid var(--c-border);
}
.voucher-details label {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  white-space: nowrap;
}
/* Nights: compact badge number instead of giant 1.5rem */
.voucher-nights-count {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1;
}
.voucher-details input,
.voucher-details select {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}
.voucher-details input:focus,
.voucher-details select:focus { outline: none; color: var(--c-primary); }

/* ── Maps row ── */
.hotel-map-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-interactive);
  border-radius: var(--r-md);
  padding: 0.55rem 0.75rem;
}
.hotel-map-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--c-text-dim);
}
.hotel-map-input:focus { outline: none; color: var(--c-text); }
/* Hotel place pill — replaces the old ✓ indicator */
.hotel-place-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 0.18em 0.3em 0.18em 0.6em;
  font-size: 0.65rem;
  font-weight: 700;
  max-width: 120px;
}
[data-theme="dark"] .hotel-place-pill { background: #14532d; color: #86efac; }

.hotel-place-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  min-width: 0;
}
.hotel-place-pill-name:hover { text-decoration: underline; }

.hotel-place-pill-remove {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border: none;
  background: rgba(0,0,0,0.12);
  color: inherit;
  border-radius: 50%;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s;
}
.hotel-place-pill-remove:hover { background: rgba(0,0,0,0.25); }

/* ── Footer ── */
.voucher-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}
.voucher-footer .btn-icon-small {
  background: none;
  border: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--c-text-dim);
  transition: background 0.15s, color 0.15s;
}
.voucher-footer .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* Narrow-screen: collapse to 2 columns for dates, 3 for details */
@media (max-width: 480px) {
  .voucher-dates   { grid-template-columns: 1fr 1fr; }
  /* city wraps to its own row — make it span full width */
  .voucher-dates > div:last-child { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--c-border); }
  .voucher-details { grid-template-columns: auto 1fr 1fr; }
  .voucher-details > div:last-child { display: none; }
}

/* Status pills (On-Time, Delayed, etc.) appended by app.js */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-chip.on-time  { background: var(--c-success-bg); color: var(--c-success); }
.status-chip.delayed  { background: #fef9c3; color: #854d0e; }
.status-chip.cancelled { background: var(--c-danger-bg); color: var(--c-danger); }

[data-theme="dark"] .status-chip.on-time  { background: #14532d; color: #86efac; }
[data-theme="dark"] .status-chip.delayed  { background: #422006; color: #fde68a; }
[data-theme="dark"] .status-chip.cancelled { background: #450a0a; color: #fca5a5; }

.v2-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--c-text-dim);
  text-align: center;
}
.v2-panel-empty .material-icons { font-size: 2.5rem; opacity: 0.35; }
.v2-panel-empty p { font-size: 0.875rem; font-weight: 600; opacity: 0.5; }

/* ================================================================
   BUDGET TAB — expenses + paid-by
================================================================ */

/* Mobile expense cards (default view) */
.v2-gastos-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gasto-card {
  background: var(--c-container);
  border-radius: var(--r-md);
  padding: 0.75rem 0.875rem;
}
.gasto-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.gasto-card-concept {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--c-text);
  font-family: inherit;
}
.gasto-card-concept::placeholder { color: var(--c-text-dim); font-weight: 500; }
.gasto-card-total {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-primary);
  white-space: nowrap;
}
.gasto-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
}
.gasto-card-field {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--c-text-dim);
  font-weight: 600;
}
.gasto-card-field input {
  flex: 1;
  min-width: 0;
  background: var(--c-interactive);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--c-text);
}
.gasto-card-notes,
.gasto-card-paidby {
  grid-column: 1 / -1;
  background: var(--c-interactive);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--c-text);
}
.gasto-card .btn-icon-small {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: none; background: none;
  color: var(--c-text-dim); cursor: pointer;
  border-radius: 50%; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.gasto-card .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* Desktop table — hidden on mobile, shown on wider screens */
.v2-gastos-table-wrap { display: none; }
@media (min-width: 640px) {
  .v2-gastos-list { display: none; }
  .v2-gastos-table-wrap { display: block; overflow-x: auto; }
}
.v2-gastos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.v2-gastos-table th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-dim);
  border-bottom: 1px solid var(--c-border);
}
.v2-gastos-table td {
  padding: 0.25rem 0.25rem;
  border-bottom: 1px solid var(--c-border);
}
.v2-gastos-table input {
  width: 100%;
  background: none;
  border: none;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--c-text);
  border-radius: 4px;
}
.v2-gastos-table input:focus { background: var(--c-interactive); outline: none; }
.v2-gastos-table .col-actions { width: 32px; text-align: center; }
.v2-gastos-table .btn-icon-small {
  width: 26px; height: 26px;
  border: none; background: none;
  color: var(--c-text-dim); cursor: pointer;
  border-radius: 50%; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.v2-gastos-table .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* Paid-by summary section */
.v2-paid-by-section {
  margin-top: 1.25rem;
  background: var(--c-container);
  border-radius: var(--r-md);
  padding: 1rem 0.875rem;
}
.v2-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-dim);
  margin-bottom: 0.75rem;
}
.paid-by-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--c-border);
}
.paid-by-row:last-child { border-bottom: none; }
.paid-by-name { font-size: 0.875rem; font-weight: 600; }
.paid-by-amount { font-size: 0.875rem; font-weight: 700; color: var(--c-primary); }
.paid-by-empty {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  font-weight: 500;
}

/* ================================================================
   PLACES TAB — itinerary + place form
================================================================ */

/* Day-selector pill row */
.v2-itin-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  scrollbar-width: none;
}
.v2-itin-tabs::-webkit-scrollbar { display: none; }

/* Day tab pill — renders multiple child spans */
.itinerary-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.45rem 0.875rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-container);
  color: var(--c-text-dim);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  position: relative;
}
.itinerary-tab:hover  { border-color: var(--c-primary); color: var(--c-primary); }
.itinerary-tab.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
/* Today indicator: subtle dot on top-right */
.itinerary-tab.is-today::after {
  content: "";
  position: absolute;
  top: 0.35rem; right: 0.4rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.tab-label {
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}
.tab-date {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1;
}
.tab-count {
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0.05em 0.5em;
  line-height: 1.5;
  align-self: flex-start;
}
.itinerary-tab.is-active .tab-count { background: rgba(255,255,255,0.2); }
.tab-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  line-height: 1.5;
}

/* ── Day header ── */
.v2-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  min-height: 1.75rem;
}
.day-header-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.day-title {
  font-size: 0.85rem;
  font-weight: 800;
}
.day-date {
  font-size: 0.7rem;
  color: var(--c-text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.day-header-right { flex-shrink: 0; }

/* Editable day tag pill (click opens editor) */
.day-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.day-tag:hover { opacity: 0.75; }

/* "+ tag" ghost button */
.day-tag-add {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c-text-dim);
  background: none;
  border: 1.5px dashed var(--c-border);
  border-radius: 999px;
  padding: 0.2em 0.6em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.day-tag-add:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* Tag color variants (tab + day header) */
.tab-tag-gray,  .day-tag-gray  { background: #e5e7eb; color: #374151; }
.tab-tag-blue,  .day-tag-blue  { background: #dbeafe; color: #1e40af; }
.tab-tag-green, .day-tag-green { background: #dcfce7; color: #166534; }
.tab-tag-orange,.day-tag-orange{ background: #ffedd5; color: #9a3412; }
.tab-tag-red,   .day-tag-red   { background: #fee2e2; color: #991b1b; }
.tab-tag-purple,.day-tag-purple{ background: #f3e8ff; color: #6b21a8; }
.tab-tag-pink,  .day-tag-pink  { background: #fce7f3; color: #9d174d; }
[data-theme="dark"] .tab-tag-gray,  [data-theme="dark"] .day-tag-gray  { background: #4b5563; color: #e5e7eb; }
[data-theme="dark"] .tab-tag-blue,  [data-theme="dark"] .day-tag-blue  { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .tab-tag-green, [data-theme="dark"] .day-tag-green { background: #14532d; color: #86efac; }
[data-theme="dark"] .tab-tag-orange,[data-theme="dark"] .day-tag-orange{ background: #431407; color: #fdba74; }
[data-theme="dark"] .tab-tag-red,   [data-theme="dark"] .day-tag-red   { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .tab-tag-purple,[data-theme="dark"] .day-tag-purple{ background: #3b0764; color: #d8b4fe; }
[data-theme="dark"] .tab-tag-pink,  [data-theme="dark"] .day-tag-pink  { background: #500724; color: #f9a8d4; }

/* ── Place cards ── */
.v2-places-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.itinerary-place {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--c-container);
  border-radius: var(--r-md);
  padding: 0.75rem 0.875rem;
  transition: background 0.15s;
}
.itinerary-place:hover { background: var(--c-interactive); }
.itinerary-place.is-highlighted {
  animation: placeHighlight 1.6s ease forwards;
}
@keyframes placeHighlight {
  0%   { background: color-mix(in srgb, var(--c-primary) 18%, var(--c-container)); }
  60%  { background: color-mix(in srgb, var(--c-primary) 18%, var(--c-container)); }
  100% { background: var(--c-container); }
}

/* Order badge */
.place-order {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* "•" in all-days view */
.itinerary-place .place-order:only-child { background: var(--c-border); }
/* Hotel badge: gold square */
.is-hotel-place .place-order {
  background: #c69a55;
  border-radius: 6px;
}

/* Place text */
.place-info { flex: 1; min-width: 0; }
.place-info-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.1rem;
}
.place-info-notes {
  font-size: 0.7rem;
  color: var(--c-text-dim);
  font-weight: 500;
}

/* Action buttons column */
.place-actions-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Drag handle */
.place-drag-handle {
  font-size: 1rem;
  color: var(--c-text-dim);
  cursor: grab;
  padding: 0 2px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  opacity: 0.45;
  transition: opacity 0.12s;
}
.itinerary-place:hover .place-drag-handle { opacity: 0.85; }
.place-drag-handle:active { cursor: grabbing; }

/* Drag states */
.itinerary-place.is-dragging {
  opacity: 0.4;
}
.itinerary-place.drag-over {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}

/* × unassign / delete button */
.itinerary-place .btn-icon-small {
  width: 26px; height: 26px;
  border: none;
  background: none;
  color: var(--c-text-dim);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.itinerary-place .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* Empty state */
.itinerary-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-dim);
  opacity: 0.6;
}

/* ── Unassigned section ── */
.unassigned-place {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--c-container);
  border-radius: var(--r-md);
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.4rem;
}
.unassigned-place .place-info-title {
  font-size: 0.82rem;
  font-weight: 600;
}
.btn-assign-day {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-primary);
  background: none;
  border: 1.5px solid var(--c-primary);
  border-radius: 999px;
  padding: 0.2em 0.65em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-assign-day:hover { background: var(--c-primary); color: #fff; }

/* ── Day tag editor overlay (injected by app.js into body) ── */
.day-tag-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 1rem);
}
.day-tag-editor {
  background: var(--c-surface);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.day-tag-editor-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  text-align: center;
}
.day-tag-input {
  width: 100%;
  background: var(--c-interactive);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--c-text);
  text-align: center;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.day-tag-input:focus { outline: none; border-color: var(--c-primary); }

.day-tag-colors {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  flex-wrap: wrap;
}
.day-tag-colors .color-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.day-tag-colors .color-btn:hover    { transform: scale(1.12); }
.day-tag-colors .color-btn.is-active{ transform: scale(1.18); box-shadow: 0 3px 10px rgba(0,0,0,0.22); outline: 3px solid var(--c-text); outline-offset: 2px; }

/* color swatches — same palette as v1 */
.color-gray   { background: #9ca3af; }
.color-blue   { background: #93c5fd; }
.color-green  { background: #86efac; }
.color-orange { background: #fdba74; }
.color-red    { background: #fca5a5; }
.color-purple { background: #d8b4fe; }
.color-pink   { background: #f9a8d4; }
[data-theme="dark"] .color-gray   { background: #6b7280; }
[data-theme="dark"] .color-blue   { background: #60a5fa; }
[data-theme="dark"] .color-green  { background: #4ade80; }
[data-theme="dark"] .color-orange { background: #fb923c; }
[data-theme="dark"] .color-red    { background: #f87171; }
[data-theme="dark"] .color-purple { background: #c084fc; }
[data-theme="dark"] .color-pink   { background: #f472b6; }

.day-tag-actions {
  display: flex;
  gap: 0.625rem;
}
.day-tag-actions button {
  flex: 1;
  padding: 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-save-tag {
  background: var(--c-primary);
  color: #fff;
  border: none;
}
.btn-save-tag:hover { opacity: 0.88; }
.btn-clear-tag {
  background: transparent;
  color: var(--c-text-dim);
  border: 1.5px solid var(--c-border);
}
.btn-clear-tag:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* Show-more button */
.v2-show-more {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1.5px dashed var(--c-border);
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-dim);
  cursor: pointer;
  margin-bottom: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}
.v2-show-more:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* Unassigned section — pad right to clear the FAB (52px + gap) */
.v2-unassigned {
  margin-top: 0.25rem;
  margin-bottom: 0.875rem;
  padding-right: calc(52px + 1.75rem);
}
.v2-unassigned-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.5rem;
}


/* ================================================================
   PLACES — search bar + floating add button
================================================================ */

/* Search bar (visible only on "All" tab) */
.v2-places-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-container);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0 0.875rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.v2-places-search-wrap:focus-within { border-color: var(--c-primary); }
.v2-places-search-wrap[hidden] { display: none; }

.v2-places-search-icon {
  font-size: 1.1rem;
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.v2-places-search-input {
  flex: 1;
  background: none;
  border: none;
  padding: 0.65rem 0;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--c-text);
}
.v2-places-search-input::placeholder { color: var(--c-text-dim); opacity: 0.7; }
.v2-places-search-input:focus { outline: none; }
/* hide the native × on search inputs — we clear on tab switch */
.v2-places-search-input::-webkit-search-cancel-button { display: none; }

/* No-results row shown when search has no matches */
.v2-search-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-dim);
  opacity: 0.6;
}

/* Floating Add Place button */
.v2-place-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--nav-h) + 1rem);
  z-index: 290; /* just below nav (300) */
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--c-primary) 38%, transparent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* hidden by default — bridge adds .is-visible when on Places tab */
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.v2-place-fab.is-visible {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}
.v2-place-fab:hover { opacity: 0.88; }
.v2-place-fab .material-icons { font-size: 1.4rem; }

/* ================================================================
   PLACE EDITOR MODAL (injected into body by app.js)
================================================================ */
.place-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.place-editor {
  background: var(--c-surface);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* drag handle */
.place-editor::before {
  content: "";
  display: block;
  width: 36px; height: 4px;
  background: var(--c-border);
  border-radius: 999px;
  margin: 0 auto -0.5rem;
}

.place-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.place-editor-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.place-editor-header .btn-icon-small {
  width: 32px; height: 32px;
  border: none;
  background: var(--c-interactive);
  color: var(--c-text-dim);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.place-editor-header .btn-icon-small:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* each label + input pair */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field-group label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.field-group input {
  background: var(--c-interactive);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.7rem 0.875rem;
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--c-text);
  transition: border-color 0.15s;
}
.field-group input:focus {
  outline: none;
  border-color: var(--c-primary);
}

.place-editor-fields { display: flex; flex-direction: column; gap: 0.75rem; }

.place-editor-actions {
  display: flex;
  gap: 0.625rem;
}

/* btn-ghost / btn-primary used by the editor */
.btn-ghost {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--c-text-dim);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-primary {
  flex: 1;
  padding: 0.75rem;
  background: var(--c-primary);
  border: none;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }

/* ================================================================
   BOTTOM NAV
================================================================ */
.v2-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 300; /* above Leaflet z-indexes */
  background: color-mix(in srgb, var(--c-surface) 82%, transparent);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid var(--c-border);
  border-radius: 1.5rem 1.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.25rem 0.5rem env(safe-area-inset-bottom, 0.5rem);
}

.v2-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: none;
  color: var(--c-text-dim);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.875rem;
  border-radius: var(--r-sm);
  transition: color 0.15s;
  min-width: 48px;
}
.v2-nav-btn .material-icons { font-size: 1.35rem; transition: transform 0.2s; }
.v2-nav-btn.is-active { color: var(--c-primary); }
.v2-nav-btn.is-active .material-icons { transform: scale(1.12); }

/* ================================================================
   MORE TAB — session row, collab pills, settings card
================================================================ */

/* Session row */
.v2-more-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-card);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  min-width: 0;
}
.v2-more-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}
.v2-more-user .material-icons {
  font-size: 1.1rem;
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.v2-more-email {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Theme toggle button */
.v2-theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.v2-theme-toggle-btn .material-icons { font-size: 1rem; }

/* Collab pills */
.v2-collab-section {
  background: var(--c-card);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}
.v2-more-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.625rem;
}
.v2-collab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* Pills populated by bridge — each is a span */
.v2-collab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--c-interactive);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-text);
}
.v2-collab-pill::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--dot-color, #4ade80);
  flex-shrink: 0;
}

/* Settings card — always visible, no accordion */
.v2-settings-card {
  background: var(--c-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(56,57,46,0.06);
}
.v2-settings-subtitle {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  text-align: center;
}

.v2-settings-body {
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
}

/* Fields */
.v2-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.v2-field label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  text-align: center;
  text-align: left;
}
.v2-field input,
.v2-field select {
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text);
  width: 100%;
  min-width: 0;
  text-align: center;
  transition: background 0.15s;
  font-family: var(--font);
}
.v2-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  cursor: pointer;
}
.v2-field input:focus,
.v2-field select:focus {
  outline: 1.5px solid var(--c-primary);
  background: var(--c-card);
}
.v2-field input[type="date"] {
  font-size: 0.8rem;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.v2-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  min-width: 0;
}

.v2-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
.v2-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--c-interactive);
  color: var(--c-text);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.65rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  transition: background 0.15s;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.v2-action-btn .material-icons { font-size: 0.9rem; flex-shrink: 0; }
.v2-action-danger { color: var(--c-primary); }

/* Logout button in More tab */
.v2-logout-btn {
  width: 100%;
  margin-top: 1.5rem;
  justify-content: center;
  color: var(--c-text-dim);
  background: var(--c-interactive);
  border: 1px solid var(--c-border);
  padding: 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.v2-logout-btn:active { opacity: 0.7; }

/* ================================================================
   GUEST MODAL
================================================================ */
.guest-name-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.guest-name-modal-overlay.is-active { display: flex; }

.v2-modal {
  background: var(--c-card);
  border-radius: var(--r-xl);
  padding: 2rem;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.v2-modal h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.4rem; }
.v2-modal p  { font-size: 0.8rem; color: var(--c-text-dim); margin-bottom: 1.25rem; }
.v2-modal input {
  width: 100%;
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--c-text);
  text-align: center;
  margin-bottom: 1rem;
  font-family: var(--font);
}
.v2-modal input:focus { outline: 1.5px solid var(--c-primary); }

.v2-btn-primary {
  background: var(--c-primary);
  color: var(--c-primary-text);
  border: none;
  border-radius: var(--r-md);
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  width: 100%;
}

/* ================================================================
   RESERVATION FORM OVERLAY
================================================================ */
.reservation-form-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.reservation-form-overlay.is-active { display: flex; }

.v2-res-form {
  background: var(--c-card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 1.5rem 1.5rem 2.5rem;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.v2-res-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 800;
}
.v2-res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.v2-res-actions { display: flex; gap: 0.75rem; margin-top: 0.25rem; }

.v2-res-form input,
.v2-res-form select {
  background: var(--c-interactive);
  border: none;
  border-radius: var(--r-sm);
  padding: 0.65rem 0.875rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--c-text);
  width: 100%;
}
.v2-res-form input:focus,
.v2-res-form select:focus { outline: 1.5px solid var(--c-primary); }

.image-paste-zone {
  border: 1.5px dashed var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  color: var(--c-text-dim);
  font-size: 0.8rem;
  font-weight: 600;
}
.paste-zone-content { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.paste-zone-content .material-icons { font-size: 1.75rem; opacity: 0.4; }
.paste-zone-preview img { max-width: 100%; border-radius: var(--r-sm); }
.btn-remove-image {
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 24px; height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ================================================================
   RESPONSIVE — date/time field stacking (≤ 560px)
   At ~550px the 4 native date+time inputs start clipping their icons.
   Stack DEP / ARR into two rows instead of two side-by-side columns.
================================================================ */
@media (max-width: 560px) {
  .fp-datetimes { grid-template-columns: 1fr; }
  .flight-pass:not(.is-collapsed) .card-expanded-content,
  .hotel-voucher:not(.is-collapsed) .card-expanded-content {
    max-height: 900px;
  }
}

/* ================================================================
   RESPONSIVE — narrow viewport hardening (≤ 390px)
================================================================ */
@media (max-width: 390px) {
  .v2-main         { padding-left: 0.75rem; padding-right: 0.75rem; }
  .v2-budget-card  { margin-left:  0.75rem; margin-right:  0.75rem; }

  /* Collapsed card: scale down IATA codes so long labels don't force overflow */
  .card-collapsed-code  { font-size: 1.3rem; }
  .card-collapsed-label { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* Expanded card: further reduce sizing */
  .fp-code { font-size: 1.75rem; }
  .fp-time { font-size: 1.3rem; }
  .card-expanded-content { padding: 0 0.75rem; }
  .flight-pass:not(.is-collapsed) .card-expanded-content,
  .hotel-voucher:not(.is-collapsed) .card-expanded-content { padding: 0.75rem; }
}

/* ================================================================
   UTILITY
================================================================ */
/* Make sure app.js's .is-active / display toggling on guest modal works */
#guestNameModalOverlay:not(.is-active) { display: none !important; }

/* Dark mode: the light basemap was the brightest thing on screen at night.
   Invert tiles only (markers, routes and popups keep their own colors). */
[data-theme="dark"] #tripMap .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6);
}
[data-theme="dark"] #tripMap .leaflet-bar a {
  background: var(--c-card);
  color: var(--c-text);
  border-bottom-color: var(--c-border);
}
[data-theme="dark"] #tripMap .leaflet-control-attribution {
  background: rgba(19,19,21,0.7);
  color: var(--c-text-dim);
}
[data-theme="dark"] #tripMap .leaflet-control-attribution a { color: var(--c-text-dim); }
