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

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  /* Themeable tokens */
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #4b5563;
  --text-faint: #9ca3af;
  --shadow-color: rgba(0,0,0,0.08);
}

body.dark-mode {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273549;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --shadow-color: rgba(0,0,0,0.35);
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-400: #64748b;
  --gray-600: #94a3b8;
  --gray-800: #f1f5f9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  transition: background 0.2s, color 0.2s;
}

/* ── Sidebar ── */
:root {
  --sidebar-w: 240px;
}

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0 2rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 1rem;
}
.sidebar-logo-icon { font-size: 1.5rem; line-height: 1; display: flex; align-items: center; }
.sidebar-logo-text { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  padding: 0.5rem 1.25rem 0.35rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
  position: relative;
}
.sidebar-item:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  font-weight: 700;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: white;
  border-radius: 0 3px 3px 0;
}
.sidebar-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0.75rem 1.25rem;
}

.sidebar-trip-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0 0 0.5rem;
}

.sidebar-trip-search-wrap {
  padding: 0.35rem 1rem 0.5rem;
}

.sidebar-trip-search {
  width: 100%;
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  outline: none;
}
.sidebar-trip-search::placeholder { color: rgba(255,255,255,0.45); }
.sidebar-trip-search:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.18);
}

.sidebar-trip-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 0.25rem;
}
.sidebar-trip-list::-webkit-scrollbar { width: 4px; }
.sidebar-trip-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-trip-group-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  padding: 0.9rem 1.25rem 0.4rem;
  background: rgba(255,255,255,0.07);
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 0.25rem;
}
.sidebar-trip-group-label:first-child {
  border-top: none;
  margin-top: 0;
}

.sidebar-trip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  font-weight: 400;
  padding: 0.4rem 1.25rem 0.4rem 1.5rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-trip-item:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-trip-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  font-weight: 700;
}
.sidebar-trip-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: white;
  border-radius: 0 3px 3px 0;
}
.sidebar-trip-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-trip-item.past {
  color: rgba(255,255,255,0.4);
  font-style: italic;
}
.sidebar-trip-item.past {
  color: rgba(255,255,255,0.4);
  font-style: italic;
}
.sidebar-trip-item.past:hover { color: rgba(255,255,255,0.7); }

.sidebar-new-trip-btn {
  margin: 0.5rem 1rem 0;
  background: rgba(255,255,255,0.12);
  border: 1px dashed rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  width: calc(100% - 2rem);
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.sidebar-new-trip-btn:hover { background: rgba(255,255,255,0.2); color: white; }

.sidebar-api-counter {
  padding: 0.6rem 1.25rem 1rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}
.sidebar-api-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.sidebar-close { display: none; }

/* ── App content area ── */
.app-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Tab panes ── */
.tab-pane {
  flex: 1;
  padding: 2rem 2rem 3rem;
  max-width: 960px;
  width: 100%;
}

.pane-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}
.pane-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-800);
}
.pane-subtitle {
  font-size: 0.9rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

/* ── Mobile ── */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 300;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  width: 40px; height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .sidebar-close {
    display: block;
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    cursor: pointer;
  }
  .app-content { margin-left: 0; }
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .tab-pane { padding: 1rem 1rem 3rem; padding-top: 4rem; }
}

/* Search card */
.search-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none;
  padding: 0;
}

.field-group legend,
.field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.airport-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.iata-input {
  width: 72px;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.airport-name {
  font-size: 0.82rem;
  color: var(--gray-600);
  flex: 1;
}

input[type="text"],
input[type="date"],
input[type="number"] {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--gray-800);
  background: white;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

input[type="number"] { width: 80px; }

.btn-primary {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: var(--gray-400); cursor: not-allowed; }

/* Error banner */
.error-banner {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-600);
}
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sort bar */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--gray-600);
}
.sort-btn {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--gray-600);
}
.sort-btn:hover { border-color: var(--blue); color: var(--blue); }
.sort-btn.active { background: var(--blue); border-color: var(--blue); color: white; }

/* Section labels */
.section-label {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.standard-label { background: #f0fdf4; color: var(--green); border: 1.5px solid #bbf7d0; }
.mix-label { background: #fffbeb; color: var(--amber); border: 1.5px solid #fde68a; }

/* Results grid */
.results-grid { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }

/* Flight card */
.flight-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1.5px solid var(--gray-200);
  transition: box-shadow 0.15s;
}
.flight-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.price-tag {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
.price-note { font-size: 0.75rem; color: var(--gray-400); }

.route-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.legs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .legs { grid-template-columns: 1fr; } }

.leg { border-left: 3px solid var(--gray-200); padding-left: 0.75rem; }
.leg.outbound { border-color: var(--blue); }
.leg.return { border-color: var(--green); }

.leg-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.35rem;
}

.flight-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.airline-logo {
  width: 20px; height: 20px;
  object-fit: contain;
  border-radius: 3px;
}

.flight-num { font-weight: 600; font-size: 0.9rem; }
.flight-times { font-size: 0.88rem; color: var(--gray-600); }
.flight-duration { font-size: 0.8rem; color: var(--gray-400); }

.layover-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.total-time { font-size: 0.85rem; color: var(--gray-600); }

.book-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }

.book-btn {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.book-btn:hover { opacity: 0.85; }
.book-btn.outbound { background: #dbeafe; color: #1e40af; }
.book-btn.return { background: #dcfce7; color: #166534; }

/* No results */
.no-results { color: var(--gray-400); font-size: 0.9rem; padding: 1rem 0; }

/* Utility */
.hidden { display: none !important; }

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}

/* Autocomplete dropdown */
.autocomplete-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 280px;
  overflow: hidden;
}

.autocomplete-item {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.1s;
  font-size: 0.9rem;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--gray-100);
}

.autocomplete-code {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--blue);
  min-width: 36px;
}

.autocomplete-detail {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.autocomplete-city { font-weight: 600; color: var(--gray-800); }
.autocomplete-name { font-size: 0.75rem; color: var(--gray-400); }

/* Flexible dates toggle */
.flex-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-800);
  user-select: none;
}
.flex-toggle input { display: none; }
.flex-toggle-box {
  width: 36px; height: 20px;
  background: var(--gray-200);
  border-radius: 20px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.flex-toggle-box::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.flex-toggle input:checked ~ .flex-toggle-box { background: var(--blue); }
.flex-toggle input:checked ~ .flex-toggle-box::after { transform: translateX(16px); }
.flex-hint { color: var(--gray-400); font-size: 0.82rem; }

/* Flexible calendar */
.flex-label { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #bfdbfe; }
.flex-subtitle { font-size: 0.82rem; color: var(--gray-400); margin-bottom: 0.75rem; }

.calendar-scroll { overflow-x: auto; margin-bottom: 2rem; }

.price-calendar {
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 500px;
}
.price-calendar th {
  padding: 0.4rem 0.6rem;
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}
.price-calendar th.corner { background: white; border-color: transparent; }
.price-calendar td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--gray-200);
  text-align: center;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  min-width: 80px;
}
.price-calendar td:hover { background: #dbeafe; }
.price-calendar td.cheapest { background: #dcfce7; color: #166534; font-weight: 700; }
.price-calendar td.selected-cell { background: #dbeafe; outline: 2px solid var(--blue); }
.price-calendar td.loading-cell { color: var(--gray-400); font-style: italic; }
.price-calendar td.no-data { color: var(--gray-300); }
.cell-price { font-weight: 600; }
.cell-date { font-size: 0.72rem; color: var(--gray-400); }

/* View toggle */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.view-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.15s;
}
.view-btn:hover { border-color: var(--blue); color: var(--blue); }
.view-btn.active { background: var(--blue); border-color: var(--blue); color: white; }

/* Map */
#flightMap {
  width: 100%;
  height: 560px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 0;
}
.map-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
  text-align: center;
}

/* Map loading bar */
.map-loading-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.map-loading-inner {
  height: 100%;
  width: 30%;
  background: var(--blue);
  border-radius: 4px;
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Price marker labels */
.price-marker {
  background: white;
  border: 2px solid var(--blue);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.1s;
}
.price-marker:hover { transform: scale(1.1); }
.price-marker.cheap { border-color: var(--green); color: var(--green); }
.price-marker.mid { border-color: var(--amber); color: var(--amber); }
.price-marker.no-price { border-color: var(--gray-400); color: var(--gray-400); font-weight: 400; }

/* Usage warning banner */
.usage-banner {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.usage-banner.warn {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
}
.usage-banner.critical {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: var(--red);
}
.usage-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* API counter bar (used in sidebar) */
.api-counter-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}
.api-counter-fill {
  height: 100%;
  border-radius: 4px;
  background: rgba(255,255,255,0.8);
  transition: width 0.4s, background 0.4s;
}

/* Select outbound button */
.select-outbound-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.select-outbound-btn:hover { background: var(--blue-dark); }

.flight-card.selected-outbound {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* Return panel */
.return-panel {
  background: #f0f7ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.return-panel-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 1rem;
}

.return-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.return-option-card {
  background: white;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  padding: 1rem;
  transition: box-shadow 0.15s;
}
.return-option-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.return-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.return-option-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

/* ── Tab header (inside panes) ── */
.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.tab-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* Badge (count pill on sidebar items) */
.badge {
  background: rgba(255,255,255,0.25);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 0.1rem 0.45rem;
  min-width: 18px;
  text-align: center;
  margin-left: auto;
}
.filters-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.filter-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-group select {
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-800);
  background: white;
  cursor: pointer;
}
.filter-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Cabin class select ── */
#cabinClass {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--gray-800);
  background: white;
  width: 100%;
  cursor: pointer;
}
#cabinClass:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Ghost button ── */
.btn-ghost {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* ── Favorite button ── */
.fav-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  line-height: 1;
}
.fav-btn:hover { border-color: #f43f5e; transform: scale(1.1); }
.fav-btn.fav-active { border-color: #f43f5e; background: #fff1f2; }

/* ── Price trend indicator ── */
.price-trend {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.15rem;
}
.trend-down { background: #dcfce7; color: #166534; }
.trend-up   { background: #fef2f2; color: #991b1b; }

/* ── Alert cards ── */
.alert-form-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1.5px solid var(--gray-200);
}
.alert-form-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.alert-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--gray-200);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.alert-card.alert-triggered {
  border-color: #86efac;
  background: #f0fdf4;
}
.alert-route {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-800);
  flex: 1;
  min-width: 120px;
}
.alert-target { font-size: 0.88rem; color: var(--gray-600); }
.alert-hit {
  font-size: 0.88rem;
  color: var(--green);
  font-weight: 600;
}
.alert-meta { font-size: 0.78rem; color: var(--gray-400); }

/* ── Map price range slider ── */
.map-controls {
  background: white;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
  font-size: 0.88rem;
  color: var(--gray-600);
}
.price-range-wrap {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.price-range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--blue);
  padding: 0;
  border: none;
  box-shadow: none;
  width: auto;
}

/* ── Map results table ── */
.map-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.map-table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.map-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
}
.map-results-table thead th {
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--gray-200);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.map-results-table thead th:hover { color: var(--blue); }
.map-results-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.map-results-table tbody tr:hover { background: var(--gray-50); }
.map-results-table tbody tr:last-child { border-bottom: none; }
.map-results-table td {
  padding: 0.6rem 1rem;
  color: var(--gray-800);
}
.map-price-cell {
  font-weight: 700;
  color: var(--blue);
  font-size: 1rem;
}
.map-row-cheap { background: #f0fdf4 !important; }
.map-row-cheap .map-price-cell { color: var(--green); }

/* ── Region grouping headers (Anywhere mode) ── */
.region-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
  flex-wrap: wrap;
}
.region-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
}
.region-cheapest {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  background: #dcfce7;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}
.region-count {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ── API call cost preview ── */
.call-preview {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  text-align: center;
  min-height: 1.2em;
  transition: color 0.2s;
}
.call-preview-ok     { color: var(--gray-400); }
.call-preview-warn   { color: var(--amber); font-weight: 600; }
.call-preview-danger { color: var(--red);   font-weight: 600; }

/* ── Custom date picker ── */
.datepicker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s;
  min-height: 40px;
  user-select: none;
}
.datepicker-wrap:hover { border-color: var(--blue); }
.datepicker-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.datepicker-input {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 1px !important;
  min-width: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none;
}

.dp-display {
  font-size: 0.95rem;
  color: var(--gray-800);
  flex: 1;
}
.datepicker-wrap:not(:has(.dp-display))::before {
  content: attr(data-placeholder);
  color: var(--gray-400);
  font-size: 0.95rem;
}

.datepicker-icon {
  margin-left: auto;
  font-size: 1rem;
  opacity: 0.5;
}

/* Dropdown calendar */
.datepicker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 600;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  padding: 0.75rem;
  min-width: 280px;
}
.datepicker-dropdown.dp-open { display: block; }

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.dp-month-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
}
.dp-nav {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  width: 28px; height: 28px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.dp-nav:hover { background: var(--gray-100); border-color: var(--blue); color: var(--blue); }

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day-name {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  padding: 0.2rem 0;
  text-transform: uppercase;
}
.dp-cell {
  text-align: center;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--gray-800);
  transition: background 0.1s;
}
.dp-cell:not(.dp-disabled):not(.dp-empty):hover { background: #dbeafe; color: var(--blue); }
.dp-today { font-weight: 700; color: var(--blue); }
.dp-selected { background: var(--blue) !important; color: white !important; border-radius: 6px; position: relative; }
.dp-selected-plane {
  position: absolute;
  font-size: 0.5rem;
  bottom: 1px;
  right: 2px;
  opacity: 0.9;
  line-height: 1;
}
.dp-cell { position: relative; }
.dp-disabled { color: var(--gray-300); cursor: default; }
.dp-blocked { background: #fef3c7; color: #92400e; cursor: not-allowed; font-size: 0.75rem; border-radius: 4px; }
.dp-city-dot {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  margin: 1px auto 0;
}
.dp-empty { cursor: default; }

/* ── Region filter bar ── */
.region-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.region-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.region-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}
.region-chip {
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}
.region-chip:hover { border-color: var(--blue); color: var(--blue); }
.region-chip.active { background: var(--blue); border-color: var(--blue); color: white; }

/* Departure date marker shown on return calendar */
.dp-dep-marker {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  border-radius: 6px;
  position: relative;
}
.dp-dep-marker::after {
  content: '✈';
  position: absolute;
  font-size: 0.5rem;
  bottom: 1px;
  right: 2px;
  opacity: 0.6;
}

/* ── Inline date picker (used in modals) ── */
.dp-inline-wrap {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}
.dp-inline-wrap .dp-header {
  margin-bottom: 0.25rem;
}
.dp-inline-wrap .dp-grid {
  gap: 2px;
}
.dp-inline-wrap .dp-cell {
  padding: 0.3rem 0.1rem;
  font-size: 0.82rem;
  border-radius: 5px;
  cursor: pointer;
}
.dp-inline-selected {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 0.4rem;
  padding: 0.25rem 0.5rem;
  background: #eff6ff;
  border-radius: 6px;
  text-align: center;
}
.dp-inline-placeholder {
  font-size: 0.82rem;
  color: var(--gray-400);
  margin-bottom: 0.4rem;
  padding: 0.25rem 0.5rem;
  text-align: center;
}

/* ── Visa badges ── */
.visa-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.visa-free     { background: #dcfce7; color: #166534; }
.visa-eta      { background: #fef3c7; color: #92400e; }
.visa-required { background: #fef2f2; color: #991b1b; }

/* ── Pin / compare button ── */
.pin-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  line-height: 1;
}
.pin-btn:hover { border-color: var(--blue); transform: scale(1.1); }
.pin-btn.pin-active { border-color: var(--blue); background: #dbeafe; }

/* ── Months button ── */
.months-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
  line-height: 1;
}
.months-btn:hover { border-color: var(--blue); }

/* ── Compare bar (sticky bottom) ── */
.compare-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blue);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.compare-bar .btn-primary { background: white; color: var(--blue); }
.compare-bar .btn-ghost { border-color: rgba(255,255,255,0.4); color: white; }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal-box {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  margin: auto;
}
.modal-wide { max-width: 860px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }

/* ── Cheapest months chart ── */
.months-chart { width: 100%; }
.months-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-bottom: 0;
}
.month-bar-wrap { flex: 1; display: flex; justify-content: center; }
.month-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 160px;
  width: 100%;
  gap: 3px;
}
.month-price {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gray-600);
  text-align: center;
  white-space: nowrap;
}
.month-bar {
  width: 100%;
  background: #bfdbfe;
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: background 0.2s;
}
.month-bar-cheapest { background: var(--green); }
.month-label {
  font-size: 0.65rem;
  color: var(--gray-400);
  text-align: center;
  white-space: nowrap;
  margin-top: 4px;
}

/* ── Trip comparison grid ── */
.compare-grid {
  display: grid;
  gap: 1rem;
}
.compare-col {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
}
.compare-route {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.compare-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.75rem;
}
.compare-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.compare-label { color: var(--gray-400); font-weight: 600; }

/* ── Airline filter bar ── */
.airline-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════════
   TRIP PLANNER
══════════════════════════════════════════════ */

/* Top bar: trip selector + actions */
.planner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--gray-200);
}
.planner-trip-select {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.planner-trip-select select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--gray-800);
  background: white;
  min-width: 200px;
  cursor: pointer;
}
.planner-trip-select select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
#plannerTripActions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Planner inner tabs */
.planner-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0;
}
.planner-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.planner-tab:hover { color: var(--blue); }
.planner-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Section blocks */
.planner-section {
  margin-bottom: 2rem;
}
.planner-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}
.planner-section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* Cards */
.planner-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.planner-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1.5px solid var(--gray-200);
}
.planner-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.planner-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-left: 0.4rem;
}
.planner-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Info grid inside cards */
.planner-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
}
@media (max-width: 600px) {
  .planner-info-grid { grid-template-columns: 1fr; }
}
.planner-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.88rem;
}
.planner-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
}
.planner-notes {
  grid-column: 1 / -1;
  color: var(--gray-600);
}
.planner-ec-divider {
  border-top: 1.5px solid var(--gray-200);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}
.planner-ec-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.planner-conf {
  font-weight: 700;
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--blue);
  letter-spacing: 0.05em;
}

/* Badge pill */
.planner-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  vertical-align: middle;
}

/* Day blocks */
.planner-day-block {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
  margin-bottom: 1.25rem;
  overflow: visible;
}
.planner-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.planner-day-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.planner-day-num {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.planner-day-title-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.day-auto-label {
  font-style: italic;
  font-weight: 600;
  opacity: 0.85;
}
.planner-day-inline-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.planner-day-date-input {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  outline: none;
  color-scheme: dark;
}
.planner-day-date-input:hover,
.planner-day-date-input:focus {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.22);
}
.planner-day-label-input {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: white;
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  outline: none;
  min-width: 120px;
  max-width: 220px;
}
.planner-day-label-input::placeholder { color: rgba(255,255,255,0.4); }
.planner-day-label-input:hover,
.planner-day-label-input:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.18);
}
.planner-day-date {
  font-weight: 700;
  font-size: 1rem;
  color: white;
}
.planner-day-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  padding: 0.1rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  width: fit-content;
}
.planner-day-meta-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.planner-day-cost {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
}
.planner-day-header .btn-ghost {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}
.planner-day-header .btn-ghost:hover {
  border-color: white;
  color: white;
  background: rgba(255,255,255,0.1);
}
.planner-empty-day {
  font-size: 0.85rem;
  color: var(--gray-400);
  padding: 1rem 1.5rem;
}

/* Timeline */
.planner-timeline {
  padding: 0.5rem 0 0.75rem;
}
.planner-timeline-item {
  display: grid;
  grid-template-columns: 72px 20px 1fr;
  gap: 0;
  position: relative;
  padding: 0.5rem 1.25rem 0.5rem 0;
}
.planner-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(72px + 9px);
  top: calc(0.5rem + 20px);
  bottom: -0.5rem;
  width: 2px;
  background: var(--gray-200);
}
.planner-tl-time {
  text-align: right;
  padding-right: 0.75rem;
  padding-top: 0.15rem;
}
.planner-tl-time-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
.planner-tl-time-empty {
  color: var(--gray-300);
  font-weight: 400;
}
.planner-tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  border: 2.5px solid white;
  box-shadow: 0 0 0 2px var(--blue);
  margin-top: 0.2rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.planner-tl-body {
  padding: 0 0 0.75rem 0.85rem;
  border-bottom: 1px solid var(--gray-100);
}
.planner-timeline-item:last-child .planner-tl-body {
  border-bottom: none;
}
.planner-tl-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.planner-tl-title {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--gray-800);
  line-height: 1.3;
}
.planner-tl-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.act-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.act-reorder-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  color: var(--gray-500);
  font-size: 0.6rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.act-reorder-btn:hover:not(:disabled) { background: #dbeafe; color: var(--blue); border-color: #93c5fd; }
.act-reorder-btn:disabled { opacity: 0.25; cursor: default; }

/* Activity move menu */
.act-move-wrap {
  position: relative;
}
.act-move-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 2px solid var(--blue);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(37,99,235,0.18), 0 2px 8px rgba(0,0,0,0.1);
  min-width: 210px;
  z-index: 9999;
  overflow: hidden;
}
.act-move-menu.open { display: block; }
.act-move-menu-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  background: var(--blue);
  padding: 0.5rem 0.85rem;
}
.act-move-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid #e0eaff;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.1s;
}
.act-move-option:hover { background: #eff6ff; color: var(--blue); font-weight: 600; }
.planner-tl-detail {
  font-size: 0.83rem;
  color: var(--gray-600);
  margin-top: 0.2rem;
  display: flex;
  gap: 0.3rem;
  align-items: baseline;
}
.planner-tl-notes {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
  padding: 0.4rem 0.65rem;
  background: var(--gray-50);
  border-left: 3px solid var(--gray-200);
  border-radius: 0 4px 4px 0;
  font-style: italic;
}

/* Activity cards (legacy, kept for safety) */
.planner-activity-card {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.planner-activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.planner-activity-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  background: #eff6ff;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.35rem;
}
.planner-activity-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
}
.planner-activity-meta {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 0.2rem;
}
.planner-activity-notes {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--gray-200);
}
.planner-ticket-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
}

/* Modal form grid */
.planner-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
@media (max-width: 600px) {
  .planner-form-grid { grid-template-columns: 1fr; }
}
.planner-form-grid textarea {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-800);
  background: white;
  resize: vertical;
  font-family: inherit;
  width: 100%;
}
.planner-form-grid textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.planner-form-grid select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--gray-800);
  background: white;
  width: 100%;
  cursor: pointer;
}
.planner-form-grid select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.planner-form-grid input[type="number"] {
  width: 100%;
}

/* ── Trip overview banner ── */
.trip-overview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.trip-overview-dates {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.trip-overview-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.trip-overview-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}
.trip-overview-value {
  font-size: 1rem;
  font-weight: 700;
}
.trip-overview-arrow {
  font-size: 1.3rem;
  opacity: 0.6;
  padding-top: 0.75rem;
}
.trip-overview-nights-pill {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-top: 0.5rem;
}
.trip-overview-banner .btn-ghost {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
}
.trip-overview-banner .btn-ghost:hover {
  border-color: white;
  color: white;
}

/* Timezone widget inside the banner — override colors for dark bg */
#tripTimezoneWidget.trip-tz-widget {
  padding-left: 0;
  margin-left: 0;
}
#tripTimezoneWidget .trip-tz-label { color: rgba(255,255,255,0.6); }
#tripTimezoneWidget .trip-tz-value { color: white; }
#tripTimezoneWidget .trip-tz-time  { color: rgba(255,255,255,0.75); }
#tripTimezoneWidget .trip-tz-arrow { color: rgba(255,255,255,0.5); }

/* ── Destination chips ── */
.dest-autocomplete-wrap {
  position: relative;
}
.dest-autocomplete-wrap .autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 600;
}
.planner-dest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.dest-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #1e40af;
}
.dest-chip-flag { font-size: 1.1rem; line-height: 1; }
.dest-chip-name { font-weight: 600; }
.dest-chip-notes { font-size: 0.78rem; color: #6b7280; font-weight: 400; }
.dest-chip-remove {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 0.1rem;
  line-height: 1;
  margin-left: 0.1rem;
}
.dest-chip-remove:hover { color: #dc2626; }
.dest-chip-edit {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 0.1rem;
  line-height: 1;
  margin-left: 0.1rem;
  opacity: 0.7;
}
.dest-chip-edit:hover { opacity: 1; color: white; }

/* ── Safety Guide ── */
.safety-loading { color: var(--gray-400); font-size: 0.88rem; padding: 0.5rem 0; }

.safety-us-banner {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: white;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.safety-us-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; }
.safety-us-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.88rem;
  align-items: center;
}
.safety-us-numbers a { color: #93c5fd; }
.safety-us-numbers a:hover { color: white; }

.safety-country-card {
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.safety-country-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.safety-flag { font-size: 1.6rem; line-height: 1; }
.safety-country-name { font-size: 1.05rem; font-weight: 700; color: #111827; }
.safety-badge { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 20px; }
.safety-badge-112 { background: #dcfce7; color: #166534; }

.safety-numbers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 500px) { .safety-numbers-grid { grid-template-columns: 1fr; } }

.safety-num-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
}
.safety-dispatch {
  grid-column: 1 / -1;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.safety-num-label { color: var(--gray-500); font-size: 0.8rem; }
.safety-num-val { font-weight: 700; color: #111827; font-size: 0.92rem; }

.safety-embassy {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.6rem;
}
.safety-embassy-missing { background: #fafafa; border-color: var(--gray-200); }
.safety-embassy-title { font-size: 0.8rem; font-weight: 700; color: #166534; margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.safety-embassy-missing .safety-embassy-title { color: var(--gray-400); }
.safety-embassy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.88rem;
  align-items: center;
}
.safety-embassy-row a { color: #16a34a; font-size: 0.82rem; }

.safety-disclaimer {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Drag-and-drop activities ── */
.planner-timeline-item {
  grid-template-columns: 16px 72px 20px 1fr;
  cursor: default;
}
.planner-tl-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  font-size: 1rem;
  cursor: grab;
  padding-top: 0.15rem;
  user-select: none;
  transition: color 0.15s;
}
.planner-tl-drag-handle:hover { color: var(--blue); }
.planner-tl-drag-handle:active { cursor: grabbing; }

.planner-timeline-item.dragging {
  opacity: 0.4;
  background: #eff6ff;
  border-radius: 8px;
}

.planner-timeline.drag-over {
  background: #f0f7ff;
  border-radius: 0 0 var(--radius) var(--radius);
  outline: 2px dashed #93c5fd;
  outline-offset: -4px;
}

.drop-indicator {
  height: 3px;
  background: var(--blue);
  border-radius: 3px;
  margin: 2px 1.25rem 2px calc(72px + 20px + 0.85rem);
  pointer-events: none;
  position: relative;
}
.drop-indicator::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

/* Fix timeline connector line offset for new grid column */
.planner-timeline-item:not(:last-child)::after {
  left: calc(16px + 72px + 9px);
}

/* ── Collapsible sections ── */
.planner-section-header {
  user-select: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem 0.5rem;
  transition: background 0.15s;
}
.planner-section-header:hover {
  background: #eff6ff;
}
.section-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.planner-section-header:hover .section-collapse-icon {
  background: var(--blue);
  color: white;
}
.section-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}
.section-body.section-collapsed {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}
/* Collapsed section — stays visible as a compact bar */
.planner-section.is-collapsed {
  background: var(--gray-50);
  border-color: var(--gray-200);
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}
.planner-section.is-collapsed .planner-section-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
}
.planner-section.is-collapsed .planner-section-header h2 {
  color: var(--gray-500);
  font-size: 0.95rem;
}
.planner-section.is-collapsed .section-collapse-icon {
  background: var(--gray-300);
  color: var(--gray-700);
}
.planner-section.is-collapsed .section-header-right .btn-ghost {
  display: none;
}

/* ── Budget ── */
.budget-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.budget-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.budget-summary-item {
  flex: 1;
  min-width: 110px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.budget-summary-total {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-color: transparent;
}
.budget-summary-total .budget-summary-label,
.budget-summary-total .budget-summary-val {
  color: white;
}
.budget-summary-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}
.budget-summary-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-800);
}

.budget-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.budget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
}
.budget-table thead th {
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--gray-200);
}
.budget-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.budget-table tbody tr:last-child { border-bottom: none; }
.budget-table tbody tr:hover { background: var(--gray-50); }
.budget-table td {
  padding: 0.55rem 1rem;
  vertical-align: middle;
}
.budget-row-auto { opacity: 0.85; }
.budget-desc { color: var(--gray-700); }
.budget-amt {
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  text-align: right;
}
.budget-no-cost { color: var(--gray-300); font-weight: 400; }

.budget-cat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}
.budget-cat-flights    { background: #dbeafe; color: #1e40af; }
.budget-cat-hotels     { background: #dcfce7; color: #166534; }
.budget-cat-activities { background: #fef3c7; color: #92400e; }
.budget-cat-other      { background: #f3f4f6; color: #4b5563; }

/* ── Budget: Food category + currency ── */
.budget-cat-food { background: #fce7f3; color: #9d174d; }

.budget-amt-orig {
  font-size: 0.85rem;
  color: var(--gray-500);
  white-space: nowrap;
}
.budget-currency-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}
.budget-fx-note {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--amber);
  background: #fffbeb;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}
.budget-fx-preview {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.budget-fx-arrow { color: var(--blue); font-weight: 700; }
.budget-fx-rate {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-left: auto;
}

/* ── Visa Info section ── */
.visa-disclaimer {
  font-size: 0.82rem;
  color: var(--gray-600);
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.visa-disclaimer a { color: var(--amber); font-weight: 600; }

.visa-card {
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.visa-card-free     { border-color: #86efac; background: #f0fdf4; }
.visa-card-eta      { border-color: #fde68a; background: #fffbeb; }
.visa-card-required { border-color: #fca5a5; background: #fef2f2; }
.visa-card-unknown  { border-color: var(--gray-200); background: var(--gray-50); }

.visa-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.visa-card-flag { font-size: 1.8rem; line-height: 1; }
.visa-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.visa-card-country {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
}
.visa-card-heading {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gray-800);
  margin-bottom: 0.3rem;
}
.visa-card-desc {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 0.65rem;
  line-height: 1.5;
}
.visa-card-tips {
  margin: 0 0 0.75rem 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.visa-card-tips li {
  font-size: 0.84rem;
  color: var(--gray-600);
  line-height: 1.4;
}
.visa-card-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.visa-card-link:hover { text-decoration: underline; }

.customs-form-block {
  margin: 0.75rem 0 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 8px;
}
.customs-form-header {
  font-size: 0.85rem;
  color: #0c4a6e;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.customs-form-note {
  font-size: 0.8rem;
  color: #374151;
  margin: 0.2rem 0 0.4rem;
}
.customs-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.customs-required { background: #fef3c7; color: #92400e; }
.customs-optional { background: #f3f4f6; color: #6b7280; }
.customs-online   { background: #dbeafe; color: #1e40af; }

/* ── Cost value in planner cards ── */
.planner-cost-val {
  font-weight: 700;
  color: var(--blue);
  font-size: 0.95rem;
}

/* ══════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════ */
body.dark-mode .search-card,
body.dark-mode .flight-card,
body.dark-mode .alert-form-card,
body.dark-mode .alert-card,
body.dark-mode .return-panel,
body.dark-mode .map-controls,
body.dark-mode .planner-card,
body.dark-mode .planner-day-block,
body.dark-mode .planner-topbar,
body.dark-mode .modal-box,
body.dark-mode .compare-col,
body.dark-mode .budget-summary-item,
body.dark-mode .budget-table,
body.dark-mode .visa-card,
body.dark-mode .safety-country-card,
body.dark-mode .return-option-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .search-card,
body.dark-mode .flight-card,
body.dark-mode .planner-card,
body.dark-mode .planner-topbar,
body.dark-mode .modal-box {
  box-shadow: 0 2px 12px var(--shadow-color);
}

body.dark-mode input[type="text"],
body.dark-mode input[type="date"],
body.dark-mode input[type="number"],
body.dark-mode input[type="email"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="url"],
body.dark-mode input[type="time"],
body.dark-mode input[type="datetime-local"],
body.dark-mode input[type="file"],
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .planner-form-grid select,
body.dark-mode .planner-form-grid textarea,
body.dark-mode .filter-group select,
body.dark-mode #cabinClass,
body.dark-mode .planner-trip-select select {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
}
body.dark-mode .btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

body.dark-mode .sort-btn,
body.dark-mode .view-btn,
body.dark-mode .region-chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

body.dark-mode .section-label { background: var(--surface-2); }
body.dark-mode .standard-label { background: #052e16; color: #4ade80; border-color: #166534; }
body.dark-mode .mix-label { background: #1c1400; color: #fbbf24; border-color: #92400e; }
body.dark-mode .flex-label { background: #0c1a3a; color: #93c5fd; border-color: #1e40af; }

body.dark-mode .planner-section-header:hover { background: var(--surface-2); }
body.dark-mode .planner-section.is-collapsed { background: var(--surface-2); border-color: var(--border); }

body.dark-mode .planner-info-label { color: var(--text-faint); }
body.dark-mode .planner-tl-body { border-bottom-color: var(--border); }
body.dark-mode .planner-tl-notes { background: var(--surface-2); border-left-color: var(--border); }
body.dark-mode .planner-empty-day { color: var(--text-faint); }

body.dark-mode .budget-table thead th { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
body.dark-mode .budget-table tbody tr { border-color: var(--border); }
body.dark-mode .budget-table tbody tr:hover { background: var(--surface-2); }
body.dark-mode .budget-table-wrap { border-color: var(--border); }
body.dark-mode .budget-summary-item { border-color: var(--border); }

body.dark-mode .map-results-table { background: var(--surface); }
body.dark-mode .map-results-table thead th { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
body.dark-mode .map-results-table tbody tr { border-color: var(--border); }
body.dark-mode .map-results-table tbody tr:hover { background: var(--surface-2); }
body.dark-mode .map-table-scroll { border-color: var(--border); }

body.dark-mode .autocomplete-dropdown { background: var(--surface); border-color: var(--border); }
body.dark-mode .autocomplete-item:hover,
body.dark-mode .autocomplete-item.highlighted { background: var(--surface-2); }
body.dark-mode .autocomplete-city { color: var(--text); }

body.dark-mode .datepicker-wrap { background: var(--surface); border-color: var(--border); }
body.dark-mode .datepicker-dropdown,
body.dark-mode .dp-inline-wrap { background: var(--surface); border-color: var(--border); }
body.dark-mode .dp-cell:not(.dp-disabled):not(.dp-empty):hover { background: #1e3a5f; }
body.dark-mode .dp-selected { background: var(--blue) !important; }
body.dark-mode .dp-month-label { color: var(--text); }
body.dark-mode .dp-day-name { color: var(--text-faint); }
body.dark-mode .dp-cell { color: var(--text); }
body.dark-mode .dp-disabled { color: var(--text-faint); }
body.dark-mode .dp-nav { border-color: var(--border); color: var(--text-muted); }
body.dark-mode .dp-nav:hover { background: var(--surface-2); }

body.dark-mode .modal-overlay { background: rgba(0,0,0,0.65); }

body.dark-mode .act-move-menu { background: var(--surface); border-color: var(--blue); }
body.dark-mode .act-move-option { border-color: var(--border); color: var(--text-muted); }
body.dark-mode .act-move-option:hover { background: var(--surface-2); }

body.dark-mode .dest-chip { background: #0c1a3a; border-color: #1e40af; color: #93c5fd; }
body.dark-mode .safety-us-banner { background: linear-gradient(135deg, #0c1a3a, #1e3a8a); }
body.dark-mode .safety-num-row { background: var(--surface-2); }
body.dark-mode .safety-embassy { background: #052e16; border-color: #166534; }
body.dark-mode .safety-embassy-missing { background: var(--surface-2); border-color: var(--border); }
body.dark-mode .safety-dispatch { background: #1c0a0a; border-color: #7f1d1d; }

body.dark-mode .visa-card-free { background: #052e16; border-color: #166534; }
body.dark-mode .visa-card-eta { background: #1c1400; border-color: #92400e; }
body.dark-mode .visa-card-required { background: #1c0a0a; border-color: #7f1d1d; }
body.dark-mode .visa-card-unknown { background: var(--surface-2); border-color: var(--border); }
body.dark-mode .visa-disclaimer { background: #1c1400; border-color: #92400e; color: #fbbf24; }

body.dark-mode .no-results { color: var(--text-faint); }
body.dark-mode footer { border-color: var(--border); color: var(--text-faint); }
body.dark-mode .pane-header { border-color: var(--border); }
body.dark-mode .pane-title { color: var(--text); }
body.dark-mode .pane-subtitle { color: var(--text-faint); }

body.dark-mode .planner-day-header { background: linear-gradient(135deg, #0f2040, #1e3a8a); }
body.dark-mode .planner-tl-dot { border-color: var(--surface); }

body.dark-mode .region-filter-bar,
body.dark-mode .airline-filter-bar { background: var(--surface); border-color: var(--border); }

body.dark-mode .compare-bar { background: var(--blue-dark); }

body.dark-mode .usage-banner.warn { background: #1c1400; border-color: #92400e; color: #fbbf24; }
body.dark-mode .usage-banner.critical { background: #1c0a0a; border-color: #7f1d1d; color: #fca5a5; }

body.dark-mode .error-banner { background: #1c0a0a; border-color: #7f1d1d; }

body.dark-mode .price-calendar th { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
body.dark-mode .price-calendar td { border-color: var(--border); color: var(--text); }
body.dark-mode .price-calendar td:hover { background: #1e3a5f; }

body.dark-mode .layover-badge { background: #1c1400; color: #fbbf24; }

body.dark-mode .planner-day-date-input,
body.dark-mode .planner-day-label-input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }

/* ── Dark mode toggle button ── */
.sidebar-dark-toggle { margin-top: auto; }

/* ══════════════════════════════════════════════
   WEATHER FORECAST
══════════════════════════════════════════════ */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.weather-dest-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.weather-dest-header {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.weather-dest-flag { font-size: 1.4rem; }
.weather-dest-name { font-weight: 700; font-size: 0.95rem; }
.weather-dest-tz { font-size: 0.75rem; opacity: 0.8; margin-left: auto; }
.weather-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  padding: 0.6rem;
  gap: 0.4rem;
}
.weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.78rem;
  text-align: center;
}
.weather-day.today { background: #dbeafe; }
body.dark-mode .weather-day.today { background: #1e3a5f; }
.weather-day-name { font-weight: 700; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; }
.weather-day-icon { font-size: 1.4rem; line-height: 1; }
.weather-day-hi { font-weight: 700; color: var(--text); }
.weather-day-lo { color: var(--text-faint); }
.weather-day-rain { font-size: 0.68rem; color: #0ea5e9; }
.weather-loading { color: var(--text-faint); font-size: 0.88rem; padding: 0.5rem 0; }
.weather-error { color: var(--red); font-size: 0.82rem; padding: 0.5rem 0; }
.weather-note { font-size: 0.75rem; color: var(--text-faint); padding: 0.5rem 1rem 0.75rem; }
.weather-out-of-range {
  font-size: 0.85rem;
  color: var(--text-faint);
  padding: 1rem;
  text-align: center;
}

/* ══════════════════════════════════════════════
   TIMEZONE WIDGETS
══════════════════════════════════════════════ */
/* On flight search result cards */
.flight-tz-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}
body.dark-mode .flight-tz-badge { background: var(--surface-2); color: var(--text-faint); }

/* Trip overview timezone widget */
.trip-tz-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.trip-tz-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 110px;
}
.trip-tz-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.6;
}
.trip-tz-value {
  font-size: 0.92rem;
  font-weight: 700;
}
.trip-tz-time {
  font-size: 0.78rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.trip-tz-arrow {
  font-size: 1rem;
  opacity: 0.5;
  padding-top: 0.5rem;
}

/* ══════════════════════════════════════════════
   TRAVEL WISHLIST
══════════════════════════════════════════════ */
.wishlist-add-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.wishlist-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.wishlist-input-row input[type="url"] {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
}
.wishlist-input-row input[type="url"]:focus {
  outline: none;
  border-color: var(--blue);
}
.wishlist-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 0.5rem;
}
.wishlist-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

/* Grid of cards */
.wishlist-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wishlist-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  position: relative;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: default;
}
.wishlist-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(37,99,235,0.08);
}
.wishlist-card.wl-dragging {
  opacity: 0.45;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.wishlist-card.wl-over {
  border-color: var(--blue);
  background: #eff6ff;
}
body.dark-mode .wishlist-card.wl-over { background: #1e3a5f; }

.wishlist-drag-handle {
  font-size: 1.1rem;
  color: var(--gray-400);
  cursor: grab;
  padding-top: 0.1rem;
  flex-shrink: 0;
  user-select: none;
}
.wishlist-drag-handle:active { cursor: grabbing; }

.wishlist-rank {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-faint);
  min-width: 18px;
  text-align: center;
  padding-top: 0.15rem;
  flex-shrink: 0;
}

.wishlist-img-wrap {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wishlist-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wishlist-img-placeholder {
  font-size: 2rem;
  color: var(--gray-400);
}

.wishlist-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.wishlist-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.wishlist-site {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.wishlist-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--green);
}
.wishlist-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wishlist-title:hover { color: var(--blue); text-decoration: underline; }
.wishlist-title-input {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.wishlist-title-input:hover { border-color: var(--border); }
.wishlist-title-input:focus { outline: none; border-color: var(--blue); background: var(--surface-2); }
.wishlist-inline-fields {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.wishlist-price-input {
  width: 100px;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  -moz-appearance: textfield;
}
.wishlist-price-input::-webkit-outer-spin-button,
.wishlist-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wishlist-price-input:focus { outline: none; border-color: var(--blue); }
.wishlist-link {
  font-size: 0.78rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.wishlist-link:hover { text-decoration: underline; }
.wishlist-price-empty {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-style: italic;
}
.wishlist-url {
  display: block;
  font-size: 0.72rem;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: 0.7;
}
.wishlist-url:hover { opacity: 1; text-decoration: underline; }
.wishlist-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wishlist-notes {
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  resize: none;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  overflow: hidden;
  min-height: 32px;
}
.wishlist-notes:focus { outline: none; border-color: var(--blue); }

.wishlist-delete {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}
.wishlist-delete:hover { background: #fee2e2; color: var(--red); }

/* ── Flight booking tip ── */
.flight-booking-tip {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.flight-tip-status {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.flight-tip-msg {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}
.flight-tip-window {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.flight-tip-window strong {
  color: var(--text);
}
.flight-tip-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.1rem;
}

/* ── Recommended Activities ── */
.act-dest-block { margin-bottom: 1.5rem; }
.act-dest-header {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.act-anchor-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}
.act-tab-nav {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.85rem;
}
.act-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.act-tab-btn:hover { color: var(--text); }
.act-tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.act-tab-pane { display: none; }
.act-tab-pane.active { display: block; }
.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}
.act-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.act-card-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.act-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
body.dark-mode .act-type-badge { background: #1e3a5f; color: #93c5fd; }
.act-badge.act-free {
  font-size: 0.68rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
body.dark-mode .act-badge.act-free { background: #14532d; color: #86efac; }
.act-badge.act-outdoor {
  font-size: 0.68rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
body.dark-mode .act-badge.act-outdoor { background: #14532d; color: #86efac; }
.act-badge.act-price {
  font-size: 0.68rem;
  font-weight: 800;
  background: #fef9c3;
  color: #854d0e;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
body.dark-mode .act-badge.act-price { background: #422006; color: #fde68a; }
.act-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.act-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.act-wiki { color: var(--blue); text-decoration: none; font-size: 0.72rem; }
.act-wiki:hover { text-decoration: underline; }
.act-maps-link {
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.1rem;
}
.act-maps-link:hover { text-decoration: underline; }

/* ── New Trip Modal ── */
.new-trip-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 520px;
  overflow: visible;
  animation: slideDown 0.2s ease;
}

.new-trip-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  position: relative;
  border-radius: 16px 16px 0 0;
}
.new-trip-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.new-trip-title { color: white; font-size: 1.4rem; font-weight: 800; margin-bottom: 0.25rem; }
.new-trip-subtitle { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.new-trip-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.new-trip-close:hover { background: rgba(255,255,255,0.25); }

.new-trip-body {
  padding: 1.75rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.new-trip-row {
  display: flex;
  gap: 1rem;
}

.new-trip-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.new-trip-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.new-trip-required { color: var(--red); }
.new-trip-optional { color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.78rem; }

.new-trip-input {
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.new-trip-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.new-trip-type-row {
  display: flex;
  gap: 0.75rem;
}

.new-trip-type-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  background: var(--surface);
}
.new-trip-type-card input { display: none; }
.new-trip-type-card:hover { border-color: var(--blue); background: #eff6ff; }
.new-trip-type-card.selected {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
body.dark-mode .new-trip-type-card.selected { background: rgba(37,99,235,0.15); }
body.dark-mode .new-trip-type-card:hover { background: rgba(37,99,235,0.1); }

.new-trip-type-icon { font-size: 1.75rem; }
.new-trip-type-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.new-trip-type-desc { font-size: 0.75rem; color: var(--text-faint); line-height: 1.3; }

.new-trip-error {
  color: var(--red);
  font-size: 0.88rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.new-trip-submit {
  margin-top: 0.25rem;
  font-size: 1rem;
  padding: 0.8rem;
  border-radius: 10px;
}

/* ── Flight modal tabs ── */
.fm-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.fm-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
}
.fm-tab:hover { color: var(--blue); }
.fm-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.fm-tab-pane { display: none; }
.fm-tab-pane.active { display: block; }

/* Booking summary card (airline / conf / baggage) */
.fm-booking-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.fm-booking-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Leg sections */
.fm-leg-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem 0.75rem;
  margin-bottom: 0.5rem;
}
.fm-leg-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px solid var(--border);
}
.fm-leg-icon { font-size: 1.1rem; }
.fm-leg-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fm-leg-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fm-leg-divider::before,
.fm-leg-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
}

/* Round-trip / One-way toggle */
.fm-trip-type-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.fm-trip-type-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.fm-trip-type-btn:hover { border-color: var(--blue); color: var(--blue); }
.fm-trip-type-btn.active { background: var(--blue); border-color: var(--blue); color: white; }

/* Unified date+time card */
.fm-datetime-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.fm-leg-date-header { margin-bottom: 0.25rem; }
.fm-dt-date-display {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  min-height: 36px;
}

/* Takeoff / Landing time row */
.fm-leg-times {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.fm-leg-time-field { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.fm-leg-time-arrow {
  font-size: 1.1rem;
  color: var(--text-faint);
  padding-bottom: 0.5rem;
  flex-shrink: 0;
}
.fm-dt-label-dep { color: var(--blue); }
.fm-dt-label-arr { color: var(--green); }

/* Custom AM/PM time picker */
.fm-timepicker {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  transition: border-color 0.15s;
}
.fm-timepicker:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.fm-tp-sel {
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  outline: none;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}
.fm-tp-hr  { width: 2rem; }
.fm-tp-min { width: 2.2rem; }
.fm-tp-colon {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  margin: 0 1px;
}
.fm-tp-ampm {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-left: 0.25rem;
}
.fm-tp-ampm-btn {
  background: none;
  border: none;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.fm-tp-ampm-btn.active { background: var(--blue); color: white; }

/* Calendar container inside the card */
.fm-dt-cal-container { background: var(--surface); border-radius: 8px; padding: 0.5rem; margin-top: 0.6rem; }
.fm-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.fm-cal-dep { background: var(--blue) !important; color: white !important; border-radius: 6px; }
.fm-cal-ob-marker { background: #dbeafe !important; color: var(--blue) !important; border-radius: 6px; font-weight: 700; }

/* Field label style for flight modal */
.fm-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 0.3rem;
}
.fm-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 120px;
}
.fm-field input,
.fm-field textarea,
.fm-field select {
  width: 100%;
}
.fm-field-sm { flex: 0 0 auto; min-width: 90px; max-width: 130px; }

/* Route row: From ✈ To */
.fm-route-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.fm-route-field { flex: 1; display: flex; flex-direction: column; }
.fm-airport-input {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.fm-airport-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.fm-route-arrow {
  font-size: 1.4rem;
  color: var(--blue);
  padding-bottom: 0.5rem;
  flex-shrink: 0;
}


/* Details row (seat / terminal / gate / cost) */
.fm-details-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
}
.fm-details-row .fm-field-sm { flex: 1; min-width: 80px; }

/* ── New trip modal inline date pickers ── */
.nt-picker-wrap .dp-inline-wrap {
  font-size: 0.82rem;
}
.nt-picker-wrap .dp-cell {
  padding: 0.28rem 0.1rem;
  font-size: 0.8rem;
}


/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE — comprehensive overrides
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Topbar ── */
  .planner-topbar {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }
  .planner-trip-select {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  .planner-trip-select select { width: 100%; }
  .planner-trip-select .btn-primary { width: 100%; }
  #plannerTripActions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
  #plannerTripActions .btn-ghost { flex: 1; min-width: 80px; font-size: 0.78rem; padding: 0.4rem 0.5rem; }

  /* ── Trip overview banner ── */
  .trip-overview-banner {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }
  .trip-overview-dates { flex-wrap: wrap; gap: 0.5rem; }
  .trip-overview-arrow { display: none; }

  /* ── Planner sections ── */
  .planner-section { margin-bottom: 0.75rem; }
  .planner-section-header h2 { font-size: 0.95rem; }
  .section-header-right .btn-ghost { font-size: 0.78rem; padding: 0.3rem 0.6rem; }

  /* ── Cards ── */
  .planner-card { padding: 0.75rem; }
  .planner-card-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .planner-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
  .planner-card-actions .btn-ghost { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
  .planner-info-grid { grid-template-columns: 1fr; }

  /* ── Day blocks ── */
  .planner-day-block { margin-bottom: 0.75rem; }
  .planner-day-header { flex-direction: column; gap: 0.5rem; padding: 0.65rem 0.75rem; }
  .planner-day-meta-right { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
  .planner-day-inline-fields { flex-direction: column; gap: 0.35rem; }
  .planner-day-date-input, .planner-day-label-input { width: 100%; font-size: 0.85rem; }

  /* ── Activity cards ── */
  .planner-timeline-item { padding: 0.6rem 0.75rem; }
  .act-item-header { flex-wrap: wrap; gap: 0.35rem; }

  /* ── Modals ── */
  .modal-box {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem !important;
    margin: 2vh auto;
  }
  .planner-form-grid { grid-template-columns: 1fr !important; }
  .planner-form-grid .field-group[style*="grid-column"] { grid-column: 1 !important; }

  /* ── Flight modal ── */
  .fm-booking-row { flex-direction: column; gap: 0.6rem; }
  .fm-booking-row .fm-field { flex: unset !important; width: 100%; }
  .fm-route-row { gap: 0.4rem; }
  .fm-route-field { flex: 1; }
  .fm-leg-times { flex-direction: column; gap: 0.5rem; }
  .fm-leg-time-arrow { display: none; }
  .fm-details-row { flex-direction: column; gap: 0.5rem; }
  .fm-details-row .fm-field-sm { min-width: unset; width: 100%; }
  .fm-timepicker { flex-wrap: wrap; gap: 0.3rem; }

  /* ── Budget table ── */
  .budget-table { font-size: 0.78rem; }
  .budget-table th, .budget-table td { padding: 0.35rem 0.4rem; }
  .budget-amt-orig { display: none; }

  /* ── Destination chips ── */
  .planner-dest-list { flex-direction: column; gap: 0.4rem; }
  .dest-chip { width: 100%; }

  /* ── New trip modal ── */
  .new-trip-modal { width: 96vw; max-height: 92vh; overflow-y: auto; }
  .new-trip-type-row { flex-direction: column; gap: 0.5rem; }
  .new-trip-row { flex-direction: column; gap: 0; }

  /* ── Inline date pickers in modals — compact ── */
  .dp-inline-wrap .dp-grid { gap: 1px; }
  .dp-inline-wrap .dp-cell { padding: 0.3rem 0.1rem; font-size: 0.78rem; }

  /* ── Weather ── */
  .weather-days { gap: 0.4rem; }
  .weather-day { min-width: 52px; padding: 0.4rem 0.3rem; }

  /* ── Activities grid ── */
  .act-grid { grid-template-columns: 1fr !important; }

  /* ── Visa cards ── */
  .visa-card-header { flex-wrap: wrap; gap: 0.4rem; }
  .safety-numbers-grid { grid-template-columns: 1fr; }

  /* ── Tab pane padding ── */
  .tab-pane { padding: 0.75rem 0.75rem 5rem; padding-top: 4rem; }

  /* ── Wishlist ── */
  .wishlist-input-row { flex-direction: column; gap: 0.5rem; }
  .wishlist-input-row input { width: 100%; }
  .wishlist-input-row .btn-primary { width: 100%; }
  .wishlist-grid { grid-template-columns: 1fr !important; }
}

/* ── Extra small phones ── */
@media (max-width: 400px) {
  .pane-title { font-size: 1.1rem; }
  .planner-section-header h2 { font-size: 0.88rem; }
  .modal-box { padding: 0.75rem !important; }
  .fm-tp-sel { font-size: 0.8rem; }
}

/* ── Auth / user info ── */
.sidebar-user-info {
  padding: 0.25rem 0;
}

/* ── Settings tabs ── */
.settings-tab-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.settings-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.settings-tab-btn:hover { color: var(--blue); }
.settings-tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.settings-tab-content { padding: 0.25rem 0; }

/* ── Activity card add-to-trip button ── */
.act-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.act-add-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.act-add-btn:hover { background: var(--blue-dark); }

/* ── Currency widget ── */
.trip-currency-widget {
  padding: 0.5rem 0;
}
.currency-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
}
.currency-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
}
.currency-flag { font-size: 0.9rem; }
.currency-name { font-weight: 600; font-size: 0.78rem; }
.currency-rate { font-weight: 600; opacity: 0.85; }
.currency-heading { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.6; margin-right: 0.25rem; }

/* ── Banner row 2: timezone + currency side by side ── */
.trip-overview-row2 {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 0.5rem;
}

/* ── Login prompt overlay ── */
.login-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.login-prompt-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.login-prompt-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.login-prompt-title { font-size: 1.2rem; font-weight: 800; color: #1e40af; margin-bottom: 0.5rem; }
.login-prompt-desc { font-size: 0.88rem; color: #6b7280; line-height: 1.5; margin-bottom: 1.5rem; }
.login-prompt-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.login-prompt-btn-primary {
  display: block;
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}
.login-prompt-btn-primary:hover { background: #1d4ed8; }
.login-prompt-btn-ghost {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem;
}
.login-prompt-btn-ghost:hover { color: #6b7280; }

body.dark-mode .login-prompt-card { background: #1e293b; }
body.dark-mode .login-prompt-title { color: #93c5fd; }
body.dark-mode .login-prompt-desc { color: #94a3b8; }

/* ── Trip cover photo ── */
.trip-cover-photo {
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.trip-cover-img {
  width: 100%;
  max-height: 320px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #1e293b;
}
.trip-cover-photo-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.trip-cover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: white;
}
.trip-cover-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin: 0;
}
.trip-cover-dest {
  font-size: 0.88rem;
  opacity: 0.85;
  margin-top: 0.2rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Connect cover to banner below */
.trip-cover-photo + .trip-overview-banner {
  border-radius: 0 0 12px 12px;
}
