:root {
  --bg: #0f1419;
  --bg-card: #1a222d;
  --bg-elevated: #232d3b;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #e8a838;
  --accent-soft: rgba(232, 168, 56, 0.15);
  --accent-hover: #f0bc5a;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* Site header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 4vw;
  max-width: 1120px;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.logo-img {
  height: 3rem;
  width: auto;
  display: block;
}

@media (max-width: 640px) {
  .logo-img {
    height: 2.25rem;
  }
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--accent); }

.dev-api-notice {
  margin: 0;
  padding: 0.55rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(180, 120, 40, 0.12);
  border-bottom: 1px solid var(--border);
}

.dev-api-notice[hidden] {
  display: none;
}

.app-load-error {
  margin: 0;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #8b2020;
  background: rgba(180, 40, 40, 0.12);
  border-bottom: 1px solid rgba(180, 40, 40, 0.25);
}

.app-load-error[hidden] {
  display: none;
}

/* Banner above places section */
.places-banner {
  width: 100%;
  height: min(44vh, 420px);
  min-height: 240px;
  position: relative;
  overflow: hidden;
}

.places-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(15, 20, 25, 0.9) 100%
  );
  pointer-events: none;
}

.places-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.places-banner[hidden],
#home-filters[hidden],
#home-intro[hidden] {
  display: none !important;
}

.saved-trip-resume {
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.saved-trip-resume[hidden] {
  display: none !important;
}

.saved-trip-resume-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(232, 168, 56, 0.08);
  border: 1px solid rgba(232, 168, 56, 0.28);
  border-radius: calc(var(--radius) - 2px);
}

.saved-trip-resume-copy {
  flex: 1 1 14rem;
  min-width: 0;
}

.saved-trip-resume-title {
  margin: 0 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.saved-trip-resume-detail {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.saved-trip-resume-route {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.saved-trip-resume-meta {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
}

.saved-trip-resume-inner .btn {
  flex-shrink: 0;
}

#nav-resume-trip[hidden] {
  display: none !important;
}

.places-section {
  padding-top: 3rem;
}

body.trip-started .places-section {
  padding-top: 1.5rem;
}

/* Split screen: trip sidebar (cities + picks + route) left, browse right */
.trip-workspace {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trip-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.trip-layout.split-screen-active .container {
  width: min(1320px, 96vw);
}

.trip-layout.split-screen-active .trip-workspace,
.trip-workspace.split-screen-active {
  display: grid;
  grid-template-columns: minmax(300px, 38%) 1fr;
  grid-template-rows: minmax(480px, calc(100vh - 11rem));
  gap: 0;
  align-items: stretch;
}

.trip-layout.split-screen-active .trip-sidebar,
.trip-workspace.split-screen-active .trip-sidebar {
  grid-column: 1;
  grid-row: 1;
  overflow-y: auto;
  padding-right: 1.25rem;
  border-right: 2px solid var(--border);
  min-height: 0;
}

.trip-layout.split-screen-active .browse-pane,
.trip-workspace.split-screen-active .browse-pane {
  grid-column: 2;
  grid-row: 1;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  padding-left: 1.25rem;
}

.trip-layout.split-screen-active .selection-panel,
.trip-workspace.split-screen-active .selection-panel {
  margin-top: 0;
  overflow: visible;
  max-height: none;
  border-radius: calc(var(--radius) + 4px);
}

.trip-layout.split-screen-active .route-layout,
.trip-workspace.split-screen-active .route-layout {
  grid-template-columns: 1fr;
}

.trip-layout.split-screen-active .route-map,
.trip-workspace.split-screen-active .route-map {
  height: 200px;
}

.trip-layout.split-screen-active .selection-list,
.trip-workspace.split-screen-active .selection-list {
  max-height: min(220px, 28vh);
  overflow-y: auto;
}

.trip-layout.split-screen-active .trip-cities-section,
.trip-workspace.split-screen-active .trip-cities-section {
  margin-top: 0;
  margin-bottom: 1rem;
  max-width: none;
  text-align: left;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.trip-layout.split-screen-active .trip-cities-list,
.trip-workspace.split-screen-active .trip-cities-list {
  justify-content: flex-start;
}

.trip-layout.split-screen-active .removed-cities-list,
.trip-workspace.split-screen-active .removed-cities-list {
  justify-content: flex-start;
}

.trip-layout.split-screen-active .selection-header,
.trip-workspace.split-screen-active .selection-header {
  justify-content: flex-start;
}

.trip-layout.split-screen-active .selection-hint,
.trip-layout.split-screen-active .trip-cities-hint,
.trip-workspace.split-screen-active .selection-hint,
.trip-workspace.split-screen-active .trip-cities-hint {
  text-align: left;
}

.city-bottom-pane {
  min-width: 0;
}

.browse-pane {
  min-width: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #1a1206;
  width: fit-content;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 28px rgba(232, 168, 56, 0.35);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-card); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

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

/* Sections */
.section {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 560px;
}

.places-section .section-header {
  text-align: center;
}

.places-section .section-header p {
  margin-left: auto;
  margin-right: auto;
}

/* Filters */
.places-section .filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
  position: relative;
  z-index: 100;
}

#home-filters {
  overflow: visible;
}

#search {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: center;
}

.city-search-wrap {
  position: relative;
  width: 100%;
}

.city-search-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.city-suggestions {
  position: fixed;
  z-index: 1500;
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: min(280px, 40vh);
  overflow-y: auto;
}

.city-suggestions[hidden] {
  display: none;
}

.city-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.city-suggestion:hover,
.city-suggestion:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.add-city-search-wrap {
  flex: 1;
  min-width: 0;
}

.places-section .category-filters {
  justify-content: center;
  margin-bottom: 2rem;
}

.city-view[hidden] {
  display: none;
}

.city-page-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.city-view .places-results-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.trip-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.35rem 0.15rem 0.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
}

.trip-city-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.move-city-earlier,
.move-city-later {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.move-city-earlier:hover,
.move-city-later:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--accent-soft);
}

.trip-city-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

.trip-city-link:hover {
  color: var(--accent);
}

.trip-city-chip.active {
  border-color: var(--accent);
  background: rgba(212, 168, 83, 0.12);
}

.trip-city-chip.active .trip-city-link {
  color: var(--accent);
}

.places-section .places-results-header {
  text-align: center;
}

#search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.places-results-header {
  margin-bottom: 1.5rem;
}

.places-results-header-row,
.trip-cities-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.places-export-actions,
.trip-places-export-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.trip-cities-header-row h3 {
  margin: 0;
}

.trip-places-export-actions[hidden] {
  display: none;
}

.places-results-header h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.places-results-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.places-source-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  opacity: 0.85;
}

.result-placeholder.loading {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.modal-wiki {
  margin-top: 1rem;
}

.modal-wiki a {
  color: var(--accent);
}

.category-filters[hidden] {
  display: none;
}

.places-results-header[hidden] {
  display: none;
}

/* Selection panel */
.selection-panel {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}

.selection-panel[hidden] {
  display: none;
}

.selection-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.selection-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.nav-auth-btn,
.nav-my-trips-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

.auth-modal-content {
  max-width: 420px;
}

.auth-modal-body {
  padding: 1.75rem;
}

.auth-modal-lead {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.auth-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}

.auth-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: inherit;
  font: inherit;
}

.auth-form .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-hint,
.auth-error {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.auth-error {
  color: #c44;
}

.my-trips-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.my-trip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.my-trip-item:last-child {
  border-bottom: none;
}

.my-trip-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.my-trip-title {
  font-weight: 600;
}

.my-trip-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.my-trip-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.my-trips-empty,
.my-trips-loading {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
  padding: 1rem 0;
}

.my-trips-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

.selection-header h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.selection-count {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.selection-hint,
.trip-cities-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.selection-list {
  list-style: none;
  margin-bottom: 1rem;
}

.selection-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.selection-empty {
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  background: transparent;
  border-style: dashed;
}

.selection-name {
  flex: 1;
  font-weight: 500;
}

.selection-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.remove-selected {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}

.remove-selected:hover {
  color: #e85a5a;
}

#clear-selection {
  display: block;
  margin: 1.25rem auto 0;
}

.trip-airports {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.trip-airports[hidden],
.trip-budget[hidden] {
  display: none;
}

.trip-airports h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.35rem;
}

.trip-airports-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.airport-picks {
  display: grid;
  gap: 0.85rem;
}

.airport-pick {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-align: left;
}

.airport-pick-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.airport-pick select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.airport-pick-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.trip-budget {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(232, 168, 56, 0.08);
  border: 1px solid rgba(232, 168, 56, 0.25);
}

.trip-budget-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.trip-budget-travelers {
  margin: -0.25rem 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.trip-budget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.home-airport-block {
  margin-bottom: 1rem;
}

.home-airport-pick {
  border-color: rgba(74, 144, 217, 0.35);
}

.home-airport-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.home-airport-row input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.home-airport-error {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #e85a5a;
}

.home-airport-error[hidden] {
  display: none;
}

.home-airport-results {
  list-style: none;
  margin-top: 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.home-airport-results[hidden] {
  display: none;
}

.home-airport-option {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.home-airport-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.home-airport-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.home-airport-selected {
  margin-top: 0.35rem;
}

.home-airport-selected[hidden] {
  display: none;
}

.airport-flight-leg {
  text-align: center;
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0.25rem 0;
  letter-spacing: 0.02em;
}

.trip-budget-item {
  font-size: 0.85rem;
}

.trip-budget-value {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.trip-budget-note {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.flight-dates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: flex-end;
}

.flight-dates-row[hidden] {
  display: none;
}

.flight-date-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.flight-date-field input {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.flight-settings {
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.flight-settings summary {
  cursor: pointer;
  color: var(--text-muted);
}

.flight-settings-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.flight-settings-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.flight-settings-form input {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.trip-budget-note-error {
  color: #e57373;
}

.flight-settings-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.route-stop-airport .stop-name::before {
  content: '✈ ';
  color: var(--accent);
}

.route-stop-city {
  flex-wrap: wrap;
  border-color: rgba(232, 168, 56, 0.35);
  background: rgba(232, 168, 56, 0.06);
}

.route-stop-city-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.route-overnight-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.route-stop-place .stop-name::before {
  content: '📍 ';
}

.route-recommendation {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.route-recommendation[hidden] {
  display: none;
}

.route-recommendation h4 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.35rem;
}

.route-rec-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.route-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.route-map {
  width: 100%;
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  z-index: 0;
}

.route-details {
  min-width: 0;
}

.route-marker-icon {
  background: none;
  border: none;
}

.route-marker-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1206;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.route-marker-num.airport {
  background: #4a90d9;
  color: #fff;
  font-size: 0.95rem;
}

.route-marker-num.city {
  background: #e8a838;
  color: #1a1206;
  font-size: 0.68rem;
}

.leaflet-container {
  font-family: var(--font-sans);
  background: var(--bg-elevated);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 8px;
}

.leaflet-popup-tip {
  background: var(--bg-card);
}

.route-rec-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.route-rec-note[hidden] {
  display: none;
}

.route-summary {
  margin-top: 1.25rem;
}

.route-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.route-summary-item {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.route-summary-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1.2;
}

.route-summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.route-disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.route-stop-place-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.route-visit-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.route-itinerary {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}

.route-itinerary[hidden] {
  display: none;
}

.route-itinerary-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}

.route-itinerary-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.35rem;
}

.route-itinerary-header .btn-sm {
  flex-shrink: 0;
}

.route-itinerary-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.itinerary-days {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.itinerary-day {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.itinerary-day-full {
  border-color: var(--accent);
}

.itinerary-day-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.itinerary-day-header h6 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.itinerary-day-total {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.itinerary-day-stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.itinerary-place {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

.itinerary-place-name {
  font-weight: 500;
}

.itinerary-place-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.itinerary-meals {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.itinerary-meals-label {
  font-style: italic;
}

.itinerary-meals-time {
  font-size: 0.75rem;
}

/* Trip cities */
.trip-cities-section {
  margin-top: 2.5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  overflow: visible;
}

.trip-cities-bar {
  margin-top: 0;
  margin-bottom: 1.25rem;
  max-width: none;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.trip-layout.split-screen-active .trip-cities-bar {
  position: static;
}

.trip-cities-section[hidden] {
  display: none;
}

.trip-cities-section h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.trip-cities-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.removed-cities-section {
  margin-bottom: 1.25rem;
  padding-top: 0.25rem;
}

.removed-cities-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.removed-cities-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.removed-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.removed-city-name {
  font-size: 0.88rem;
  font-weight: 500;
}

.removed-city-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(74, 144, 217, 0.18);
  color: #7eb8f0;
}

.restore-city-link {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.restore-city-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.trip-city-chip.primary {
  border-color: var(--accent);
  background: rgba(212, 168, 83, 0.08);
}

.trip-city-chip.primary.active {
  background: rgba(212, 168, 83, 0.18);
}

.trip-city-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(232, 168, 56, 0.2);
  color: var(--accent);
}

.trip-city-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(74, 144, 217, 0.18);
  color: #7eb8f0;
}

.selection-city-group {
  list-style: none;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.selection-city-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.selection-city-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.selection-city-header strong {
  flex: 1;
  font-weight: 600;
}

.selection-city-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.selection-city-group.detached {
  opacity: 0.92;
}

.selection-city-detached {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.04));
}

.browse-city-link,
.restore-city-link {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.browse-city-link:hover,
.restore-city-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.selection-city-places {
  list-style: none;
  margin: 0;
  padding: 0;
}

.selection-city-places li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
}

.selection-city-places .selection-name {
  flex: 1;
}

.remove-trip-city {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.1rem;
  margin-left: 0.15rem;
}

.remove-trip-city:hover {
  color: #e85a5a;
}

.add-city-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  overflow: visible;
}

.add-city-row input,
#add-city-search {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.add-city-row input:focus,
#add-city-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.add-city-error {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #e85a5a;
}

.add-city-error[hidden] {
  display: none;
}

.recommended-stops-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.recommended-stops-section[hidden] {
  display: none;
}

.recommended-stops-heading {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.35rem;
}

.recommended-stops-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 0.85rem;
}

.recommended-stops-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  counter-reset: stop-rank;
}

.recommended-stop-chip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(74, 144, 217, 0.25);
  background: rgba(74, 144, 217, 0.06);
}

.recommended-stop-rank {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(74, 144, 217, 0.18);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.recommended-stop-info {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.recommended-stop-name {
  display: block;
  font-size: 0.92rem;
}

.recommended-stop-leg {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recommended-stop-reason {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.35;
}

.recommended-stop-explanation {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.recommended-stop-chip .btn {
  flex-shrink: 0;
  align-self: flex-start;
}

#route-layout[hidden] {
  display: none;
}

@media (max-width: 540px) {
  .add-city-row {
    flex-direction: column;
  }

  .add-city-row .btn {
    width: 100%;
  }

  .recommended-stop-chip {
    flex-direction: column;
    align-items: stretch;
  }

  .recommended-stop-chip .btn {
    width: 100%;
  }
}

/* Legacy add-more (removed from UI) — kept for reference if re-added */
.add-more-section {
  margin-top: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.add-more-section[hidden] {
  display: none;
}

.add-more-section h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

#add-search {
  width: 100%;
  margin-bottom: 1rem;
}

.add-results-label {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.add-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.add-result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.add-result-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.add-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.add-result-info strong {
  font-weight: 500;
  font-size: 0.95rem;
}

.add-result-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.add-place-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.add-place-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover, .chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Places grid */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.places-load-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.5rem;
}

.places-load-more .btn {
  min-width: 12rem;
}

.place-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.place-rank {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 3;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 168, 56, 0.45);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.place-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 168, 56, 0.35);
}

.select-toggle {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  cursor: pointer;
}

.select-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.select-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 20, 25, 0.75);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.place-card.selected .select-mark,
.select-checkbox:checked + .select-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
}

.select-toggle:hover .select-mark {
  border-color: var(--accent);
}

.details-btn {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 3;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: none;
  background: rgba(15, 20, 25, 0.75);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.place-card:hover .details-btn,
.place-card:focus-within .details-btn {
  opacity: 1;
}

.details-btn:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}

.place-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(232, 168, 56, 0.3);
}

.place-image {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
}

.place-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.place-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, rgba(45, 55, 72, 0.85) 100%);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.place-image-placeholder.modal {
  min-height: 220px;
}

.place-card.no-photo .place-image::after {
  opacity: 0.35;
}

.place-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 20, 25, 0.7), transparent 50%);
}

.place-badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.place-body {
  padding: 1.25rem;
}

.place-body h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.place-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.place-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Calculator */
.calculator-section {
  background: linear-gradient(180deg, transparent, rgba(26, 34, 45, 0.5));
}

.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  margin-bottom: 3rem;
}

.calc-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group select,
.route-controls select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.swap-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
  margin-bottom: 0.1rem;
}

.swap-btn:hover {
  background: var(--accent-soft);
  transform: rotate(180deg);
}

.calc-results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.result-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.result-item {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.result-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--accent);
  line-height: 1.2;
}

.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-route {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-align: center;
}

/* Route builder */
.route-builder h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.route-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.route-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.route-controls select {
  flex: 1;
  min-width: 200px;
}

.route-list {
  list-style: none;
  counter-reset: stops;
  margin-bottom: 1rem;
}

.route-list li {
  counter-increment: stops;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.route-list li::before {
  content: counter(stops);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.route-list .stop-name { flex: 1; }

.route-list .remove-stop {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
}

.route-list .remove-stop:hover { color: #e85a5a; }

.route-total {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  min-height: 1.5rem;
}

.route-segment {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

.route-segment-drive {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
}

.route-segment-flight-rec {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  max-width: 14rem;
}

.route-flight-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warning, #d97706);
}

.route-flight-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.route-flight-links {
  font-size: 0.75rem;
}

.route-flight-links a {
  color: var(--accent);
}

.route-flight-summary {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--radius);
}

.route-flight-summary-heading {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warning, #d97706);
}

.route-flight-summary-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.route-flight-summary-list a {
  color: var(--accent);
  white-space: nowrap;
}

.route-flight-summary-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.route-flight-summary-item-accepted {
  color: var(--text);
}

.route-flight-accepted-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success, #16a34a);
}

.route-segment-accepted-flight {
  align-items: flex-end;
}

.route-segment-accepted-flight .route-segment-flight-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success, #16a34a);
}

.route-segment-accepted-flight .route-segment-flight-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.route-segment-flight-rec .accept-flight-leg,
.route-segment-accepted-flight .revert-flight-leg,
.route-flight-summary-item .accept-flight-leg,
.route-flight-summary-item .revert-flight-leg {
  margin-top: 0.35rem;
  align-self: flex-end;
}

.route-segment-train-rec {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  max-width: 14rem;
}

.route-train-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
}

.route-train-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.route-train-links {
  font-size: 0.75rem;
}

.route-train-links a {
  color: var(--accent);
}

.route-train-summary {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius);
}

.route-train-summary-heading {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
}

.route-train-summary-note {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.route-train-summary-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.route-train-summary-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.route-train-summary-item-accepted {
  color: var(--text);
}

.route-train-accepted-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success, #16a34a);
}

.route-segment-accepted-train {
  align-items: flex-end;
}

.route-segment-accepted-train .route-segment-train-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
}

.route-segment-accepted-train .route-segment-train-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.route-segment-train-rec .accept-train-leg,
.route-segment-accepted-train .revert-train-leg,
.route-train-summary-item .accept-train-leg,
.route-train-summary-item .revert-train-leg {
  margin-top: 0.35rem;
  align-self: flex-end;
}

/* Modal */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-elevated);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}

.modal-body { padding: 0; }

.modal-image {
  height: 220px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-info { padding: 1.75rem; }

.modal-info h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.modal-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-info p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.modal-highlights {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-highlights li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.modal-actions {
  padding: 0 1.75rem 1.75rem;
}

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-note {
  font-size: 0.78rem;
  opacity: 0.85;
}

.legal-page {
  padding: 3rem 0 4rem;
  max-width: 42rem;
  margin: 0 auto;
}

.legal-page h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.legal-page h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

.legal-page p,
.legal-page li {
  line-height: 1.6;
  color: var(--text-muted);
}

.legal-page ul {
  padding-left: 1.25rem;
}

.legal-page a {
  color: var(--accent);
}

@media (max-width: 640px) {
  .places-banner { min-height: 200px; }
  .route-layout {
    grid-template-columns: 1fr;
  }
  .route-map {
    height: 280px;
  }
  .trip-layout.split-screen-active .trip-workspace,
  .trip-workspace.split-screen-active {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 40vh) 1fr;
  }
  .trip-layout.split-screen-active .trip-sidebar,
  .trip-workspace.split-screen-active .trip-sidebar {
    grid-column: 1;
    grid-row: 1;
    padding-right: 0;
    padding-bottom: 1rem;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }
  .trip-layout.split-screen-active .browse-pane,
  .trip-workspace.split-screen-active .browse-pane {
    grid-column: 1;
    grid-row: 2;
    padding-left: 0;
    padding-top: 1.25rem;
  }
  .trip-layout.split-screen-active .route-map,
  .trip-workspace.split-screen-active .route-map {
    height: 160px;
  }
  .calc-row { flex-direction: column; align-items: stretch; }
  .swap-btn { align-self: center; transform: rotate(90deg); margin: 0; }
  .swap-btn:hover { transform: rotate(270deg); }
}

/* AI Copilot — floating dock (bottom-right) */
.ai-copilot-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.ai-copilot-dock > * {
  pointer-events: auto;
}

.ai-copilot-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(232, 168, 56, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #2a2115 0%, var(--bg-card) 100%);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.ai-copilot-fab:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(232, 168, 56, 0.2);
}

.ai-copilot-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.85rem;
}

.ai-copilot-dock.ai-open .ai-copilot-fab {
  border-color: var(--accent);
}

.ai-copilot-panel {
  width: min(420px, calc(100vw - 2rem));
  max-height: min(620px, calc(100vh - 6rem));
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.15rem;
}

.ai-copilot-panel[hidden] {
  display: none;
}

.ai-copilot-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.ai-copilot-panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
}

.ai-copilot-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.ai-copilot-close:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.nav-copilot-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.nav-traveler-wrap {
  position: relative;
}

.nav-traveler-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-traveler-btn:hover,
.nav-traveler-btn.open {
  color: var(--accent);
}

.nav-traveler-chevron {
  font-size: 0.72rem;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.nav-traveler-btn.open .nav-traveler-chevron {
  transform: rotate(180deg);
}

.nav-traveler-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 200;
  min-width: 12.5rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.nav-traveler-menu[hidden] {
  display: none !important;
}

.traveler-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem;
}

.traveler-row + .traveler-row {
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
  padding-top: 0.5rem;
}

.traveler-row-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.traveler-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.traveler-step-btn {
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.traveler-step-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.traveler-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.traveler-count {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.ai-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: min(280px, 34vh);
  overflow-y: auto;
  padding: 0.25rem 0.15rem 0.75rem;
  margin-bottom: 0.85rem;
}

.ai-message {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.ai-message-user {
  align-self: flex-end;
}

.ai-message-assistant {
  align-self: flex-start;
}

.ai-message-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ai-message-user .ai-message-bubble {
  background: var(--accent-soft);
  border: 1px solid rgba(232, 168, 56, 0.25);
  border-bottom-right-radius: 0.35rem;
}

.ai-message-assistant .ai-message-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.35rem;
}

.ai-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.ai-action-chip {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(74, 144, 217, 0.15);
  color: #7eb8f0;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.ai-quick-prompt {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ai-quick-prompt:hover {
  color: var(--accent);
  border-color: rgba(232, 168, 56, 0.35);
  background: var(--accent-soft);
}

.ai-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: end;
}

.ai-input-row textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  max-height: 140px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ai-input-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ai-settings {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-settings summary {
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.ai-settings summary:hover {
  color: var(--accent);
}

.ai-settings-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ai-settings-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
}

.ai-settings-form input {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.ai-settings-note {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ai-clear-chat {
  margin-top: 0.75rem;
}

.ai-copilot-dock.ai-busy .ai-message-assistant:last-child .ai-message-bubble {
  opacity: 0.7;
}

.manual-search-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  text-align: center;
}

@media (max-width: 640px) {
  .ai-copilot-dock {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .ai-copilot-fab-label {
    display: none;
  }

  .ai-copilot-fab {
    padding: 0.85rem;
    border-radius: 999px;
  }

  .ai-copilot-panel {
    width: calc(100vw - 1.25rem);
    max-height: min(70vh, 520px);
  }

  .ai-input-row {
    grid-template-columns: 1fr;
  }

  .ai-messages {
    max-height: min(220px, 30vh);
  }
}
