/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  /* Brand – warm terracotta */
  --primary:    #c2652a;
  --blue:       #c2652a;
  --blue-dark:  #a0521f;
  --blue-light: #f7e3d0;
  --green:      #3a8a5c;
  --amber:      #d97706;
  --red:        #dc2626;
  /* Warm gray palette */
  --gray-50:    #fdf9f5;
  --gray-100:   #f5efe6;
  --gray-200:   #ecddd0;
  --gray-300:   #d9c5b4;
  --gray-400:   #b89d8a;
  --gray-500:   #8c7060;
  --gray-700:   #4a3228;
  --gray-900:   #1e120c;
  --white:      #ffffff;
  --shadow-sm:  0 1px 3px rgba(60,30,10,.07);
  --shadow:     0 4px 12px rgba(60,30,10,.10);
  --shadow-lg:  0 8px 28px rgba(60,30,10,.14);
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --font:       'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  /* Semantic aliases */
  --card:       #ffffff;
  --surface:    #fdf9f5;
  --text:       #1e120c;
  --text-muted: #8c7060;
  --border:     #ecddd0;
  /* App background */
  --bg:         #faf7f2;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  color: var(--gray-900);
  background: var(--bg);
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, select, button, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue); text-decoration: none; }
/* Phosphor Icons sizing */
.ph { font-size: 1.1em; vertical-align: -0.15em; line-height: 1; }
.btn .ph { font-size: 1em; }
.btn-icon .ph { font-size: 1.3em; }
.header-logo .ph { font-size: 1.2em; }
label .ph { font-size: 1em; color: var(--gray-500); }
.empty-icon .ph { font-size: 48px; display: block; color: var(--gray-300); }
ul { list-style: none; }

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

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--blue); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-ghost    { color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-block    { width: 100%; }
.btn-lg       { padding: 13px 24px; font-size: 16px; }
.btn-back     { padding: 8px 12px; font-size: 14px; color: var(--gray-700); }
.btn-icon     { padding: 8px; font-size: 18px; }
.btn-sm       { padding: 6px 12px; font-size: 13px; }
.btn-outline  { border: 1.5px solid var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue-light); }

/* ── Views ───────────────────────────────────────────────────────────────── */
.view { min-height: 100dvh; }
.view:not(#view-auth) { padding-top: 56px; }

/* ── App Header ──────────────────────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1010;
  background: var(--white);
  border-bottom: 1px solid var(--gray-150, #eee);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.header-logo { font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: -0.01em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.trip-header-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

/* ── Lang switch ─────────────────────────────────────────────────────────── */
.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--gray-400); }
.lang-btn { font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 4px; color: var(--gray-500); }
.lang-btn.active { color: var(--blue); background: var(--blue-light); }

/* ── Auth View ───────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, #faf0e6 0%, #f5e6d4 40%, #ede0d5 100%);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon { font-size: 48px; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-family: var(--font-display); font-size: 34px; font-weight: 400; color: var(--gray-900); letter-spacing: -0.02em; }
.logo-sub { color: var(--gray-500); margin-top: 6px; font-size: 14px; letter-spacing: 0.02em; }

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
}
.tab-btn {
  flex: 1;
  padding: 14px;
  font-weight: 500;
  color: var(--gray-500);
  font-size: 14px;
  transition: color .15s, border-bottom .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

.auth-form { padding: 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color .15s;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(194,101,42,.12); }
.field input::placeholder { color: var(--gray-300); }

.form-error {
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  margin-bottom: 14px;
}

.form-success {
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 18px;
  line-height: 1.5;
}

.auth-link-row {
  text-align: center;
  margin-top: 14px;
}

.btn-text-link {
  font-size: 13px;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-text-link:hover { color: var(--blue-dark); }

/* ── Autocomplete ────────────────────────────────────────────────────────── */
.autocomplete-field { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 200px; overflow-y: auto;
  margin-top: 2px;
}
.autocomplete-list:empty { display: none; }
.autocomplete-list li {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover { background: var(--blue-light); color: var(--blue); }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard-main {
  max-width: 1140px; margin: 0 auto;
  padding: 24px 20px;
}
.dashboard-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.dashboard-top h2 { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: -0.02em; }

.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.trip-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.trip-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* Route header area */
.tc-route-header {
  position: relative;
  background: linear-gradient(160deg, #fdf6ee 0%, #f5ece0 100%);
  border-bottom: 1px solid var(--gray-200);
  padding: 6px 0 0;
}
.tc-route-viz {
  width: 100%;
  overflow: hidden;
}
.tc-route-viz svg {
  width: 100%;
  height: auto;
  display: block;
}
.tc-route-empty { height: 100px; }
@keyframes routeDraw {
  to { stroke-dashoffset: 0; }
}

/* Status badge */
.trip-card-status {
  position: absolute; top: 8px; right: 10px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.status-ready    { background: #dcfce7; color: #166534; }
.status-planning { background: #fef9c3; color: #713f12; }
.status-error    { background: #fee2e2; color: #991b1b; }

/* Text area */
.trip-card-body {
  padding: 14px 16px 16px;
}
.trip-card-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--gray-900); letter-spacing: -0.01em; margin-bottom: 6px; }
.trip-card-route { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.trip-card-meta  { font-size: 12px; color: var(--gray-400); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-card-delete {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--gray-300); font-size: 15px; padding: 2px 4px;
  transition: color .15s;
}
.btn-card-delete:hover { color: var(--danger, #dc2626); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state p { color: var(--gray-500); margin-bottom: 20px; font-size: 15px; }

/* ── Create form ─────────────────────────────────────────────────────────── */
.create-main {
  max-width: 560px; margin: 0 auto;
  padding: 28px 16px 48px;
}
.create-main h2 {
  font-family: var(--font-display); font-size: 30px; font-weight: 400;
  margin-bottom: 24px; letter-spacing: -0.02em; color: var(--gray-900);
}
.create-form { display: flex; flex-direction: column; gap: 12px; }
.create-section {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 16px 6px;
}
.create-section .form-row { margin-bottom: 0; }
.create-section .field:last-child { margin-bottom: 12px; }

/* Route Von→Nach */
.route-fields {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0;
}
.route-field { margin-bottom: 12px; }
.route-arrow {
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 18px;
  color: var(--blue); font-size: 18px;
}
@media (max-width: 500px) {
  .route-fields { grid-template-columns: 1fr; }
  .route-arrow { display: none; }
}

/* Field label row (used outside .field) */
.field-label-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--gray-700);
  margin-bottom: 10px;
}

/* Transport cards */
.transport-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.transport-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
  font-size: 12px; font-weight: 500; color: var(--gray-500);
  text-align: center;
}
.transport-card i { font-size: 22px; color: var(--gray-400); transition: color .15s; }
.transport-card input[type="radio"] { display: none; }
.transport-card:hover { border-color: var(--gray-300); background: var(--white); color: var(--gray-700); }
.transport-card:hover i { color: var(--gray-600); }
.transport-card:has(input:checked) {
  border-color: var(--blue); background: var(--blue-light); color: var(--blue);
}
.transport-card:has(input:checked) i { color: var(--blue); }
@media (max-width: 400px) { .transport-cards { grid-template-columns: repeat(2, 1fr); } }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── Round trip toggle ─────────────────────────────────────────────────── */
.round-trip-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 0; cursor: pointer;
  font-size: 11.5px; color: var(--gray-500); user-select: none;
  white-space: nowrap;
}
.field .round-trip-toggle { margin-top: 2px; display: flex; }
.round-trip-toggle input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--primary);
  flex-shrink: 0;
}
.round-trip-toggle .round-trip-label {
  display: inline-flex; align-items: center; gap: 3px;
}
.round-trip-toggle:has(input:checked) .round-trip-label {
  color: var(--primary); font-weight: 600;
}

/* ── Must-Have Tags ────────────────────────────────────────────────────── */
.must-have-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 4px;
}
.must-have-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blue-light); color: var(--blue);
  border: 1px solid var(--blue); border-radius: 20px;
  padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.must-have-tag button {
  background: none; border: none; cursor: pointer;
  color: var(--blue); font-size: 14px; line-height: 1; padding: 0;
  opacity: 0.6; transition: opacity .15s;
}
.must-have-tag button:hover { opacity: 1; }
.must-have-input-row {
  display: flex; gap: 6px;
}
.must-have-input-row input { flex: 1; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* ── Trip detail: map ────────────────────────────────────────────────────── */
.map-tabs-container {
  position: relative;
}
/* ── Overview route map tile ─────────────────────────────────────────────── */
.ov-route-tile {
  position: relative; overflow: hidden;
  background: var(--gray-100); cursor: pointer;
}
.ov-route-tile-map {
  width: 100%; height: 100%;
  pointer-events: none;
}
/* Transparent click overlay on top of Leaflet */
.ov-route-tile::after {
  content: ''; position: absolute; inset: 0; z-index: 500;
}
.ov-route-tile-expand {
  position: absolute; bottom: 8px; right: 8px; z-index: 501;
  background: rgba(255,255,255,0.9); border: none;
  border-radius: 6px; padding: 5px 8px;
  font-size: 11px; font-weight: 600; color: var(--gray-700);
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  pointer-events: none; /* tile::after handles click */
}
.ov-route-tile:hover .ov-route-tile-expand { background: #fff; }

/* ── Route map modal ─────────────────────────────────────────────────────── */
.route-map-modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
}
.route-map-modal.hidden { display: none; }
.route-map-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); cursor: pointer;
}
.route-map-modal-inner {
  position: relative; z-index: 1;
  width: min(900px, 92vw); height: min(600px, 80vh);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.route-map-modal-close-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2000;
  background: rgba(255,255,255,.95); border: none;
  border-radius: 50%; width: 36px; height: 36px;
  font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
#route-map-modal-map { width: 100%; height: 100%; }
#trip-map { width: 1px; height: 1px; }

/* ── Day map modal (side-by-side layout) ─────────────────────────────────── */
.day-map-modal-inner {
  position: relative; z-index: 1;
  width: min(1020px, 96vw); height: min(600px, 80vh);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  display: flex;
}
.day-modal-map {
  flex: 1; height: 100%; min-width: 0; position: relative;
}
.day-modal-station-list {
  width: 185px; flex-shrink: 0;
  background: #fff; overflow-y: auto;
  padding: 12px 12px; border-left: 1px solid var(--gray-200);
}

/* ── Day mini map tile ───────────────────────────────────────────────────── */
.day-mini-map-tile {
  position: relative; overflow: hidden; height: 180px;
  border-radius: var(--radius-lg); cursor: pointer;
  background: var(--gray-100);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  z-index: 0;
}
.day-mini-map-tile::after {
  content: ''; position: absolute; inset: 0; z-index: 500; cursor: pointer;
}
.day-mini-map { width: 100%; height: 100%; pointer-events: none; }
.day-mini-map-expand {
  position: absolute; bottom: 8px; right: 8px; z-index: 501;
  background: rgba(255,255,255,.9); border: none;
  border-radius: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; color: var(--gray-700);
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15); pointer-events: none;
}
.day-mini-map-tile:hover .day-mini-map-expand { background: #fff; }

/* ── Trip meta bar ───────────────────────────────────────────────────────── */
.trip-meta-bar {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 56px; z-index: 1002;
}
.trip-meta-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.trip-meta-route {
  grid-column: 2;
  text-align: center;
  font-family: var(--font-display, 'DM Serif Display', serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--gray-900, #1f2937);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.btn-meta-nav {
  grid-column: 3;
  justify-self: end;
  padding: 5px 14px !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  gap: 4px;
  white-space: nowrap;
}
.route-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  padding: 0 12px 10px;
}
.trip-task-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.trip-task-link:hover {
  text-decoration: underline;
}

/* ── Day tabs ────────────────────────────────────────────────────────────── */
.day-tabs-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 96px; z-index: 1001;
}
.day-tabs {
  display: flex;
  overflow-x: auto;
  max-width: 1140px;
  margin: 0 auto;
  padding: 6px 20px 0;
  gap: 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex-shrink: 0;
  padding: 7px 12px 6px;
  border-radius: 6px 6px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--gray-400);
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
  min-width: 44px;
  position: relative;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
}
.tab-daynum { font-size: 13px; font-weight: 700; color: inherit; line-height: 1; }
.tab-city   { font-size: 10px; font-weight: 500; color: inherit; opacity: 0.7; line-height: 1; }
.tab-weather { font-size: 11px; margin-left: 2px; }
.day-tab.active {
  color: var(--primary);
  background: var(--gray-50);
  border-color: var(--gray-200);
  box-shadow: 0 1px 0 var(--gray-50);
}
.day-tab.active .tab-city { opacity: 1; }
.day-tab:hover:not(.active) { color: var(--gray-700); background: var(--gray-100); border-color: var(--gray-200); }
.day-tab.overview-tab { padding: 7px 12px 6px; font-size: 12px; font-weight: 600; min-width: auto; }
.day-tab.overview-tab:not(.active) { background: rgba(194,101,42,.08); color: var(--primary); border-color: rgba(194,101,42,.15); }

/* ── Day content ─────────────────────────────────────────────────────────── */
.day-content {
  max-width: 1140px; margin: 0 auto;
  padding: 20px 20px;
}

/* 2-column layout */
.day-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 800px) {
  .day-layout { grid-template-columns: 1fr; }
  .day-sidebar { position: static !important; }
  .day-route-overview { position: static !important; }
}
.day-sidebar {
  display: flex; flex-direction: column; gap: 12px;
}
.day-main {
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}

/* Day header — redesigned */
.day-header {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.day-header-top {
  display: flex; align-items: flex-start; gap: 14px;
}
.day-header-num {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 700; line-height: 1;
  color: var(--primary); opacity: 0.18;
  flex-shrink: 0; user-select: none;
}
.day-header-info h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 400;
  letter-spacing: -0.02em; color: var(--gray-900); margin-bottom: 4px;
}
.day-header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-header-date { font-size: 12px; color: var(--gray-400); }
.day-weather { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.day-drive-badge {
  font-size: 11px; font-weight: 600; color: var(--blue-dark);
  background: #eff6ff; padding: 1px 6px; border-radius: 4px;
}
.day-header-desc {
  font-size: 12px; color: var(--gray-500); line-height: 1.5;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.tab-weather { font-size: 11px; margin-left: 2px; }
.weather-historical { font-size: 11px; color: var(--gray-400); font-style: italic; }

.day-description {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px; color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 14px;
  font-style: italic;
}
.day-description-icon { font-style: normal; flex-shrink: 0; margin-top: 1px; }

/* ── AI: Drive info ──────────────────────────────────────────────────────── */
.day-drive {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.drive-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.drive-info { font-weight: 500; color: var(--gray-700); }
.drive-route {
  color: var(--gray-400);
  font-size: 12px;
  margin-left: auto;
  text-align: right;
  line-height: 1.4;
}

/* ── AI: Section label ───────────────────────────────────────────────────── */
.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray-500);
  margin-bottom: 10px;
}

/* ── Traveler ages grid ──────────────────────────────────────────────────── */
.traveler-ages-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 4px;
}
.traveler-age-item {
  display: flex; align-items: center; gap: 6px;
}
.traveler-age-item label {
  font-size: 12px; font-weight: 600; color: var(--gray-500);
  white-space: nowrap; min-width: 20px;
}
.traveler-age-item input {
  width: 58px;
  padding: 7px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.traveler-age-item input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(194,101,42,.12); }

/* ── AI: Highlights ──────────────────────────────────────────────────────── */
.day-highlights {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.highlight-card {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.highlight-card:last-child { border-bottom: none; padding-bottom: 0; }
.highlight-name { font-size: 13.5px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.highlight-reason { font-size: 12px; color: var(--gray-500); line-height: 1.4; }

/* ── Stop card: AI description + kid badge ───────────────────────────────── */
.stop-ai-desc {
  font-size: 12px; color: var(--gray-500); line-height: 1.45;
  margin: 4px 0 2px;
}
.stop-kid-badge {
  font-size: 11px; font-weight: 600; color: #166534;
  background: #dcfce7; padding: 1px 6px; border-radius: 4px;
}

/* ── AI: Insider tip ─────────────────────────────────────────────────────── */
.day-insider-tip {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.day-insider-tip strong { font-size: 13px; font-weight: 700; color: var(--blue-dark); display: block; margin-bottom: 3px; }
.day-insider-tip p { font-size: 13px; color: var(--gray-600); line-height: 1.5; margin: 0; }

.stops-list { display: flex; flex-direction: column; gap: 12px; }

/* ── Tagesroute Übersicht ────────────────────────────────────────────────── */
/* ── Tagesroute Übersicht - Neue kompakte Timeline ────────────────────────── */
.day-route-overview {
  position: sticky;
  top: 110px;
  z-index: 50;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.day-route-overview .section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Neue vertikale Timeline-Layout */
.route-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.route-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  position: relative;
}

.route-item:not(:last-child) {
  border-bottom: 1px dashed var(--gray-200);
}

.route-item-icon {
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.route-item-icon.start { background: #dcfce7; }
.route-item-icon.hotel { background: #ede9fe; }
.route-item-icon.restaurant { background: #fef3c7; }
.route-item-icon.activity { background: #f7e3d0; }
.route-item-icon.end { background: #fee2e2; }
.route-item-icon.transit { background: #f1f5f9; font-size: 13px; }
.route-item.transit-row { padding: 3px 0; opacity: 0.7; }

.route-item-content {
  flex: 1;
  min-width: 0;
}

.route-item-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 2px;
}

.route-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

.route-item-note {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Alte horizontale Route für breite Screens (optional) */
.route-flow {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.route-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 70px;
  box-shadow: var(--shadow-sm);
}
.route-point .rp-icon {
  font-size: 20px;
  margin-bottom: 4px;
}
.route-point .rp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-900);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-point small {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 2px;
}
.route-point.start { border-left: 3px solid #22c55e; }
.route-point.end { border-left: 3px solid #ef4444; }
.route-point.hotel { border-left: 3px solid #8b5cf6; }
.route-point.restaurant { border-left: 3px solid #f59e0b; }
.route-point.activity { border-left: 3px solid #3b82f6; }
.route-arrow {
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 700;
}

/* ── Insider Tip inline (unter Highlights) ───────────────────────────────── */
.day-insider-tip-inline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
}
.day-insider-tip-inline .tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.day-insider-tip-inline strong { font-size: 13px; font-weight: 700; color: var(--blue-dark); display: block; margin-bottom: 3px; }
.day-insider-tip-inline p { font-size: 13px; color: var(--gray-600); line-height: 1.5; margin: 0; }

/* ── Kollapsible Tag-Karte ─────────────────────────────────────────────── */
.day-map-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: background .15s, color .15s;
}
.day-map-toggle:hover { background: var(--gray-50); color: var(--gray-900); }
.day-map-toggle i:last-child { margin-left: auto; }
.day-map-inner { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.day-map-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  font-size: 11px; color: var(--gray-500);
}

/* ── Stop Card — horizontal redesign ─────────────────────────────────── */
.stops-list { display: flex; flex-direction: column; gap: 12px; }

/* ─── Stop Card Shell ───────────────────────────────────────────────────────── */
.stop-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.06);
  border-left: 3px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stop-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.07); transform: translateY(-1px); }
.stop-card.is-manual    { border-left-color: var(--amber); }
.stop-card.stop-hotel      { border-left-color: #6366f1; }
.stop-card.stop-activity   { border-left-color: var(--primary); }
.stop-card.stop-restaurant { border-left-color: var(--green); }
.stop-card.stop-drive      { border-left-color: var(--blue); background: #f5f8ff; padding-bottom: 0; }
.stop-card.stop-insider-tip { border-left-color: var(--amber); }
.stop-card.stop-drive .stop-type-label.drive { color: var(--gray-500); }

/* ── Geheimtipp Card ──────────────────────────────────────────────────────── */
.insider-tip-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.itc-icon { font-size: 22px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.itc-label {
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #92400e; margin-bottom: 5px;
}
.itc-text {
  font-size: 14px; line-height: 1.55; color: #78350f;
  font-style: italic;
}

/* Drive card visual */
.drive-header { border-bottom: 1px solid var(--gray-100); }
.drive-visual {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}
.drive-endpoint { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 72px; }
.drive-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--blue);
}
.drive-dot.origin { background: var(--white); }
.drive-dot.dest   { background: var(--blue); }
.drive-city { font-size: 13px; font-weight: 600; color: var(--gray-800); text-align: center; line-height: 1.2; }
.drive-connector {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.drive-line {
  width: 100%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 6px, transparent 6px 12px);
  border-radius: 1px;
}
.drive-route-chip {
  font-size: 10px; color: var(--gray-500);
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.drive-route-chip i { font-size: 10px; }
.drive-stats-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 8px 16px 12px;
  font-size: 12px; color: var(--gray-600);
  border-top: 1px solid var(--gray-100);
}
.drive-stats-row span { display: flex; align-items: center; gap: 4px; }
.drive-stats-row i { font-size: 11px; color: var(--blue); }

/* Clickable Tagesablauf items */
.route-item.tl-clickable { cursor: pointer; border-radius: 5px; margin: 0 -4px; padding: 2px 4px; }
.route-item.tl-clickable:hover { background: var(--gray-100); }

/* ─── Header (no-photo fallback) ──────────────────────────────────────────── */
.stop-card-header {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}

/* ─── Star Bar ────────────────────────────────────────────────────────────── */
.star-bar {
  position: relative; display: inline-block;
  font-size: 13px; color: var(--gray-200);
  letter-spacing: 1.5px; line-height: 1;
}
.star-bar::after {
  content: attr(data-stars);
  position: absolute; left: 0; top: 0;
  width: var(--fill); overflow: hidden;
  color: var(--amber); white-space: nowrap;
}
.star-bar-dark { color: var(--gray-200); }
.star-bar-dark::after { color: var(--amber); }

/* ─── Body — photo left (fixed size), content right ─────────────────────── */
.stop-card-body {
  display: flex; gap: 0;
}
.stop-card-photo-col {
  flex-shrink: 0; width: 140px;
  align-self: flex-start; /* don't stretch to full card height */
  overflow: hidden;
}
.stop-card-photo-col img {
  width: 140px; height: 120px; object-fit: cover; display: block;
}
.stop-card-content-col {
  flex: 1; min-width: 0;
  padding: 10px 13px 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.stop-rating-row { display: flex; align-items: center; gap: 5px; }
.stop-rating-val { font-size: 12px; font-weight: 700; color: var(--gray-800); }
.stop-reviews-count { font-size: 11px; color: var(--gray-400); }
.stop-card-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 11px; color: var(--gray-500);
}
.stop-meta-pill { display: inline-flex; align-items: center; gap: 3px; }
.stop-meta-pill i { font-size: 10px; color: var(--gray-400); }
.stop-card-tags-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.stop-tag {
  font-size: 10px; font-weight: 500; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 20px;
  background: var(--gray-100); color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.stop-tag-price { background: #fef9ec; color: #a16207; border-color: #fde68a; }
.stop-tag-kid   { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.stop-ta-link {
  font-size: 10px; font-weight: 600; color: var(--primary);
  text-decoration: none; display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px; border-radius: 20px;
  background: rgba(194,101,42,.08); border: 1px solid rgba(194,101,42,.2);
  transition: background .15s;
}
.stop-ta-link:hover { background: rgba(194,101,42,.15); }
.stop-ta-link i { font-size: 10px; }

/* Description — hard limits to keep cards compact */
.stop-desc-block { display: flex; flex-direction: column; gap: 3px; }
.stop-ai-desc {
  font-size: 12px; color: var(--gray-600); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Wikipedia text hidden — TA review_snippet is used instead */
.stop-wiki-text { display: none; }
.stop-highlight-reason {
  font-size: 11.5px; color: var(--primary); line-height: 1.4; font-style: italic;
  padding: 4px 9px; background: rgba(194,101,42,.06); border-radius: var(--radius-sm);
  border-left: 2px solid var(--primary);
}

/* Review — max 2 lines */
.stop-review-quote {
  margin: 0; padding: 6px 10px 6px 11px;
  border-left: 2px solid var(--primary);
  background: #fff9f6; border-radius: 0 5px 5px 0;
  font-size: 11.5px; color: var(--gray-600); font-style: italic; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stop-review-quote i { color: var(--primary); margin-right: 3px; vertical-align: -1px; }

/* ─── Controls (no-photo header) ─────────────────────────────────────────── */
.stop-reorder-btns { margin-left: auto; display: flex; gap: 3px; flex-shrink: 0; align-items: center; }
.btn-reorder {
  background: none; border: 1px solid var(--gray-200); border-radius: 4px;
  color: var(--gray-400); cursor: pointer; font-size: 10px; line-height: 1;
  padding: 2px 5px; transition: background .15s, color .15s;
}
.btn-reorder:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-700); }
.btn-reorder:disabled { opacity: .3; cursor: default; }
.btn-edit-stop {
  background: none; border: 1px solid var(--gray-200); border-radius: 4px;
  color: var(--gray-400); cursor: pointer; padding: 2px 5px;
  font-size: 13px; line-height: 1; transition: background .15s, color .15s, border-color .15s;
}
.btn-edit-stop:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.btn-debug-stop {
  background: none; border: 1px solid var(--gray-200); border-radius: 4px;
  color: var(--gray-400); cursor: pointer; padding: 2px 5px;
  font-size: 13px; line-height: 1; transition: background .15s, color .15s, border-color .15s;
}
.btn-debug-stop:hover { background: #fef3c7; border-color: #f59e0b; color: #f59e0b; }
.stop-type-badge    { font-size: 18px; flex-shrink: 0; }
.stop-time-label    { font-size: 12px; font-weight: 600; color: var(--gray-400); flex-shrink: 0; }
.stop-type-label    { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stop-type-label.hotel      { color: #4338ca; }
.stop-type-label.restaurant { color: var(--green); }
.stop-type-label.activity   { color: var(--blue-dark); }
.stop-type-label.insider-tip { color: #92400e; }
.stop-manual-badge  { margin-left: auto; font-size: 11px; color: var(--amber); font-weight: 600; }
.stop-highlight-badge {
  font-size: 10px; font-weight: 700; color: #92400e;
  background: #fef3c7; border: 1px solid #fcd34d;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.stop-card.stop-insider-tip { border-left-color: var(--amber); }
.stop-selected-name { font-family: var(--font-display); font-size: 17px; font-weight: 400; color: var(--gray-900); letter-spacing: -0.01em; }
.stop-photo { display: none; }

/* ─── Inline Edit ─────────────────────────────────────────────────────────── */
.stop-inline-edit {
  padding: 12px 14px;
  border-top: 1.5px dashed var(--gray-200);
  background: var(--gray-50);
}
.sie-row { display: grid; grid-template-columns: 1fr 100px; gap: 10px; margin-bottom: 8px; }
.sie-field { display: flex; flex-direction: column; gap: 4px; }
.sie-field label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.sie-field input, .sie-field textarea {
  padding: 7px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--gray-900); background: var(--white);
  outline: none; transition: border-color .15s; font-family: var(--font); resize: none;
}
.sie-field input:focus, .sie-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(194,101,42,.1); }
.sie-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.stop-card-footer {
  padding: 9px 14px;
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.btn-booking {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 6px 13px;
  background: var(--primary); color: var(--white);
  border-radius: var(--radius-sm);
  text-decoration: none; transition: filter .15s;
}
.btn-booking:hover { filter: brightness(1.1); }
.btn-alternatives {
  font-size: 12px; font-weight: 600; color: var(--blue);
  padding: 5px 12px;
  border: 1.5px solid var(--blue-light);
  border-radius: var(--radius-sm);
  background: var(--blue-light); cursor: pointer;
  transition: border-color .15s;
}
.btn-alternatives:hover { border-color: var(--blue); }
.alternatives-count { font-size: 11px; color: var(--gray-400); margin-left: auto; }

/* ── Planning overlay ────────────────────────────────────────────────────── */
.planning-overlay {
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 60vh;
  padding: 32px 16px 40px;
}
.planning-card {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  max-width: 760px;
  width: 100%;
}
.planning-card p { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.planning-card small { color: var(--gray-400); font-size: 13px; }

/* ── Live plan log ── */
.plan-log {
  margin-top: 20px;
  background: var(--gray-900);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-height: 65vh;
  overflow-y: auto;
  text-align: left;
  scroll-behavior: smooth;
}

/* Einzelner Request-/Response-Block */
.plan-log-entry {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.plan-log-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Statuszeile */
.log-status {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray-300);
  padding: 1px 0;
}
.log-status.log-success { color: #86efac; }
.log-status.log-warning { color: #fbbf24; }

/* ── Destination picker (Round 3 in clarify modal) ──────────────────────────── */
.dest-pick-hint {
  font-size: 13px; color: var(--gray-500); margin: 0 0 12px;
}
.dest-pick-list {
  display: flex; flex-direction: column; gap: 6px;
}
.dest-pick-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius); padding: 10px 12px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.dest-pick-card:hover { border-color: var(--gray-300); }
.dest-pick-card:has(input:checked) {
  border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary);
}
.dest-pick-card input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--primary); flex-shrink: 0;
}
.dest-pick-body {
  display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0;
}
.dest-pick-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.dest-pick-info { flex: 1; min-width: 0; }
.dest-pick-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.dest-pick-region { font-size: 11px; color: var(--gray-500); }
.dest-pick-reason { font-size: 12px; color: var(--gray-600); margin-top: 2px; line-height: 1.3; }
.dest-pick-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 8px;
}
.dest-pick-toggle {
  font-size: 12px;
  color: var(--primary); cursor: pointer; user-select: none;
}
.dest-pick-toggle:hover { text-decoration: underline; }
.dest-pick-custom { margin-top: 10px; }
.dest-pick-custom-row {
  display: flex; gap: 8px; align-items: center;
}
.dest-pick-custom-row .input {
  flex: 1; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
}
.dest-pick-custom-row .btn-sm {
  padding: 6px 12px; font-size: 16px; font-weight: 700; line-height: 1;
  border-radius: var(--radius);
}

/* Prompt-Block */
.log-prompt {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border-left: 2px solid #3b82f6;
  border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.55;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
}

/* Response-Block */
.log-response {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border-left: 2px solid #10b981;
  border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.55;
  color: #86efac;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
}

.log-label {
  font-weight: 700;
  white-space: nowrap;
  min-width: 60px;
  color: #7dd3fc;
}
.log-spin { opacity: .7; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error state ─────────────────────────────────────────────────────────── */
.error-state {
  text-align: center;
  padding: 60px 20px;
}
.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-state p { color: var(--gray-600); margin-bottom: 20px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 560px;
  max-height: 85dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 600px) {
  .modal { border-radius: var(--radius-lg); }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 18px; color: var(--gray-400); padding: 4px 8px; }
.modal-close:hover { color: var(--gray-700); }
.modal-body { overflow-y: auto; padding: 12px; }

/* ── Clarify Modal ───────────────────────────────────────────────────────── */
.modal-clarify { max-width: 540px; border-radius: var(--radius-lg); }
.clarify-round-label { font-size: 12px; color: var(--primary); font-weight: 500; margin-top: 2px; }
.clarify-question { margin-bottom: 24px; }
.clarify-question-label { font-weight: 600; font-size: 15px; margin-bottom: 10px; display: block; }
.clarify-options { display: flex; flex-direction: column; gap: 8px; }
.clarify-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 14px;
}
.clarify-option:hover { border-color: var(--primary); background: var(--primary-light, #fdf4f0); }
.clarify-option.selected {
  border-color: var(--primary);
  background: var(--primary-light, #fdf4f0);
  font-weight: 500;
}
.clarify-option.no-pref { border-style: dashed; opacity: 0.6; }
.clarify-option.no-pref:hover, .clarify-option.no-pref.selected { opacity: 1; }
.clarify-option input[type="radio"] { accent-color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.clarify-option-content { display: flex; flex-direction: column; gap: 2px; }
.clarify-option-text { line-height: 1.3; }
.clarify-option-description { font-size: 12px; color: var(--gray-400); font-weight: 400; line-height: 1.4; }
.clarify-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
}
.clarify-loading { text-align: center; padding: 32px; color: var(--gray-400); font-size: 14px; }
.clarify-loading .spinner { font-size: 28px; display: block; margin-bottom: 10px; animation: spin 1s linear infinite; }

.alt-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.alt-card:hover { border-color: var(--blue); background: var(--blue-light); }
.alt-card.selected { border-color: var(--green); background: #f0fdf4; }
.alt-icon { font-size: 24px; flex-shrink: 0; }
.alt-info { flex: 1; min-width: 0; }
.alt-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.alt-address { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alt-meta { display: flex; gap: 8px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.alt-score { font-size: 11px; font-weight: 700; color: var(--green); }
.alt-booking {
  font-size: 11px; font-weight: 600; color: var(--blue); padding: 3px 8px;
  border: 1px solid var(--blue); border-radius: 4px; text-decoration: none; flex-shrink: 0;
}
.alt-booking:hover { background: var(--blue-light); }

/* ── Fallback banner ─────────────────────────────────────────────────────── */
.fallback-notice {
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #713f12;
  margin-bottom: 8px;
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .dashboard-top h2 { font-size: 18px; }
  .trips-grid { grid-template-columns: 1fr; }
  .trip-meta-bar { gap: 10px; font-size: 12px; }
  #trip-map { height: 200px; }
  .route-map-wrap.route-map-expanded { max-height: 240px; }
}

/* ── Admin View ─────────────────────────────────────────────────────────── */
.admin-main {
  padding: 16px 20px;
  max-width: 1140px;
  margin: 0 auto;
}

.admin-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.admin-filter-input {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ── Table ── */
.admin-table-wrap, #admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead th {
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.admin-row {
  cursor: pointer;
  transition: background 0.12s;
}
.admin-row:hover { background: var(--surface); }
.admin-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-row:last-child td { border-bottom: none; }
.admin-row.expanded { background: var(--surface); }
.admin-inline-detail td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}
.admin-inline-detail-inner {
  padding: 16px 20px;
  background: var(--bg);
  border-top: 2px solid var(--primary, #c2652a);
  max-height: 600px;
  overflow-y: auto;
}

.admin-td-time  { white-space: nowrap; color: var(--text-muted); font-size: 12px; }
.admin-td-trip  { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.admin-td-phase { font-weight: 500; }
.admin-td-dur   { white-space: nowrap; color: var(--text-muted); }
.admin-td-status { text-align: center; }

.admin-empty {
  text-align: center;
  padding: 32px !important;
  color: var(--text-muted);
}
.admin-error { color: var(--danger, #dc2626); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-ok  { background: #d1fae5; color: #065f46; }
.badge-err { background: #fee2e2; color: #991b1b; }

/* ── Pagination ── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Detail overlay ── */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.admin-detail-card {
  background: var(--card);
  width: 100%;
  max-width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.admin-detail-meta {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text);
}
.admin-detail-meta code {
  font-family: monospace;
  font-size: 11px;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}
.admin-meta-sep { color: var(--border); }

/* Close button – prominent X */
.admin-close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  background: #e2e8f0; color: #334155;
  font-size: 16px; line-height: 1; cursor: pointer;
  flex-shrink: 0; transition: background 0.15s;
}
.admin-close-btn:hover { background: #ef4444; color: #fff; }

/* Tab bar */
.admin-detail-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}
.admin-tab {
  padding: 10px 20px;
  font-size: 13px; font-weight: 500;
  color: #64748b; cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.admin-tab:hover  { color: #334155; }
.admin-tab.active { color: #c2652a; border-bottom-color: #c2652a; background: #fff; }

/* Tab body + panes */
.admin-detail-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-tab-pane {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Readable view container */
.admin-readable {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  color: #0f172a;
  background: #ffffff;
}
.admin-readable-day {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-readable-day:last-child { border-bottom: none; }
.admin-readable-day-hd {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 5px;
}
.admin-readable-city { font-size: 14px; font-weight: 600; color: var(--text); }
.admin-readable-region { font-size: 12px; color: var(--text-muted); }
.admin-readable-section {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-readable-section:last-child { border-bottom: none; }
.admin-readable-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 5px;
}
.admin-readable-row {
  font-size: 12.5px; color: var(--text);
  padding: 2px 0;
}
.admin-readable-empty {
  padding: 20px 16px;
  color: var(--text-muted);
  font-style: italic; font-size: 13px;
}

.admin-code {
  flex: 1;
  margin: 0;
  padding: 16px;
  overflow: auto;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border: none;
}

/* JSON syntax colours */
.json-key  { color: #7dd3fc; }   /* light blue  */
.json-str  { color: #86efac; }   /* light green */
.json-num  { color: #fca5a5; }   /* light red   */
.json-bool { color: #fbbf24; }   /* amber       */
.json-null { color: #94a3b8; }   /* slate       */

/* Task Detail Styles */
.admin-task-detail {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.admin-task-card {
  padding: 16px;
}
.admin-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.admin-task-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.admin-task-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.admin-task-meta code {
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.admin-logs-list {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.admin-logs-list h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.admin-log-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
}
.admin-log-item:hover {
  background: var(--surface);
}
.admin-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-log-phase {
  font-size: 13px;
  font-weight: 500;
}
.admin-log-dur {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.admin-log-status {
  font-size: 12px;
  font-weight: 600;
}
.admin-log-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.admin-log-legacy {
  opacity: 0.7;
  background: var(--surface);
}
.admin-log-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ── Log Tabs ────────────────────────────────────────────────────────────── */
.admin-logs-container {
  margin-top: 16px;
}

/* Split layout: phase list left, detail right */
.admin-logs-split {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 300px;
}
.admin-phase-list {
  width: 200px;
  min-width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 500px;
}
.admin-phase-list-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.admin-phase-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.admin-phase-item:hover { background: rgba(0,0,0,.04); }
.admin-phase-item.active {
  background: var(--bg);
  border-left: 3px solid var(--primary, #c2652a);
  padding-left: 11px;
}
.admin-phase-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.admin-phase-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-phase-item-status.ok { color: #16a34a; }
.admin-phase-item-status.err { color: #dc2626; }

.admin-phase-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  max-height: 500px;
}

/* Phase Selector (Dropdown - legacy detail view) */
.admin-phase-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.admin-phase-selector label {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.admin-phase-selector select {
  padding: 8px 12px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  min-width: 220px;
}

/* Main 3-Tab Navigation - v2 */
.admin-main-tabs {
  display: flex !important;
  flex-direction: row !important;
  gap: 4px !important;
  margin: 0 0 -2px 0 !important;
  padding: 8px 8px 0 8px !important;
  background: #f3f4f6 !important;
  border-bottom: 2px solid #c2652a !important;
  border-radius: 8px 8px 0 0 !important;
}
.admin-main-tab-btn {
  display: inline-block !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  background-color: #d1d5db !important;
  color: #4b5563 !important;
  border: none !important;
  border-radius: 6px 6px 0 0 !important;
  cursor: pointer !important;
  margin: 0 !important;
}
.admin-main-tab-btn:hover {
  background-color: #9ca3af !important;
  color: #1f2937 !important;
}
.admin-main-tab-btn.active {
  background-color: #c2652a !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Main Tab Content */
.admin-main-tab-content {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: var(--bg);
}
.admin-main-tab-panel {
  display: none;
  padding: 16px;
}
.admin-main-tab-panel.active {
  display: block;
}

/* Phase Content within each tab */
.admin-phase-content {
  display: none;
}
.admin-phase-content.active {
  display: block;
}

/* Formatted View Styles */
.admin-formatted-view {
  font-size: 14px;
  line-height: 1.6;
}

.admin-formatted-highlevel,
.admin-formatted-day {
  max-width: 100%;
}

.admin-fv-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-fv-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--primary);
}

.admin-fv-section h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.admin-fv-desc {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.admin-fv-itinerary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.admin-fv-itinerary-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  border: 1px solid #bae6fd !important;
}

.admin-fv-day-card {
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  text-align: center;
}

.admin-fv-day-num {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.admin-fv-day-city {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.admin-fv-day-region {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-fv-day-highlight {
  font-size: 11px;
  color: #4b5563;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.1);
  line-height: 1.4;
  font-style: italic;
}

/* ── Enhanced Admin Day Card (detailed view) ─────────────────────────────── */
.admin-fv-day-card {
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: left;
  transition: all .15s ease;
}

.admin-fv-day-card:hover {
  border-color: var(--primary, #c2652a);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-fv-day-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.admin-fv-day-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-fv-day-city {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.admin-fv-day-region {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.admin-fv-day-coords {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  margin-bottom: 6px;
}

.admin-fv-day-drive {
  font-size: 11px;
  color: #4b5563;
  background: #f7e3d0;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 8px 0;
}

.admin-fv-day-drive small {
  color: #6b7280;
  display: block;
  margin-top: 2px;
}

.admin-fv-day-desc {
  font-size: 12px;
  color: #4b5563;
  font-style: italic;
  margin: 8px 0;
  padding: 8px 10px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

.admin-fv-day-section {
  margin-top: 10px;
}

.admin-fv-day-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.admin-fv-day-item {
  font-size: 11px;
  color: #4b5563;
  padding: 3px 0;
  line-height: 1.4;
}

.admin-fv-day-item strong {
  color: var(--text);
}

.admin-fv-day-item small {
  color: var(--text-muted);
}

.admin-fv-day-tip {
  font-size: 11px;
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.admin-fv-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-fv-day-header h4 {
  margin: 0;
  font-size: 18px;
}

.admin-fv-region {
  padding: 4px 10px;
  background: var(--primary-light, #f7e3d0);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.admin-fv-insider {
  padding: 12px 16px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.admin-fv-activities,
.admin-fv-restaurants {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-fv-activity,
.admin-fv-restaurant {
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-fv-act-name,
.admin-fv-rest-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.admin-fv-act-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.admin-fv-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 12px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
}

.admin-fv-route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13px;
}

.admin-fv-route-item {
  padding: 6px 0;
}

.admin-fv-route-label {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-fv-act-tags,
.admin-fv-rest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.admin-fv-rest-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.admin-fv-hotels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-fv-hotel {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-fv-hotel-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.admin-fv-notes {
  padding: 12px;
  background: #fefce8;
  border-left: 4px solid #eab308;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

/* Generic Object Renderer Styles */
.admin-fv-object {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-fv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-fv-field-primitive {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.admin-fv-field-primitive:last-child {
  border-bottom: none;
}

.admin-fv-key {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  min-width: 120px;
}

.admin-fv-value {
  color: var(--text);
  font-size: 13px;
  flex: 1;
}

.admin-fv-field-nested {
  padding: 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-fv-field-nested > .admin-fv-key {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--primary);
}

.admin-fv-array {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-fv-array-item {
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.admin-fv-item-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.admin-fv-item-title {
  color: var(--primary);
}

.admin-fv-item-num {
  color: var(--text-muted);
}

.admin-fv-item-content {
  padding-left: 8px;
}

.admin-fv-nested {
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

.admin-fv-null,
.admin-fv-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Meta info for each phase */
.admin-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border);
}

/* Code display */
.admin-main-tab-panel pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  max-height: 500px;
  overflow-y: auto;
}
.admin-td-type { font-size: 12px; }
.admin-td-reqs { text-align: center; font-size: 12px; }

@media (max-width: 640px) {
  .admin-split { flex-direction: column; }
  .admin-pane  { border-right: none; border-bottom: 1px solid var(--border); }
  .admin-pane:last-child { border-bottom: none; }
  .admin-code { font-size: 11px; }
  .admin-detail-meta { font-size: 12px; }
}

/* ── Leaflet overrides ───────────────────────────────────────────────────── */
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}

/* ── Overview Tab ─────────────────────────────────────────────────────────── */
.overview-tab {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-bottom: 2px solid transparent;
}
.overview-tab.active {
  background: linear-gradient(135deg, #f7e3d0, #efc9a8);
  color: var(--blue-dark);
}

/* Overview Content Styles */
.overview-header {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.overview-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.overview-route {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
}
.btn-enrich-trip {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-enrich-trip:hover { opacity: 0.85; }
.btn-enrich-trip:disabled { opacity: 0.5; cursor: default; }

/* Stats Grid */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .overview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Date Range */
.overview-date-range {
  text-align: center;
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
  padding: 10px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

/* Route Section */
.overview-route-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.overview-route-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-100);
}

/* Route Timeline */
.overview-route-timeline {
  display: flex;
  flex-direction: column;
}
.route-day-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  cursor: pointer;
  transition: background .15s;
  border-radius: var(--radius-sm);
}
.route-day-item:hover {
  background: var(--gray-50);
}
.route-day-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.route-day-content {
  flex: 1;
  min-width: 0;
}
.route-day-city {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.route-day-drive {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.route-day-desc {
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.4;
}
.route-connector {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, var(--blue), var(--blue-light));
  margin-left: 15px;
  margin-top: -6px;
  margin-bottom: -6px;
}

/* Highlights Section */
.overview-highlights-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
}
.overview-highlights-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-100);
}
.overview-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.overview-highlight-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.overview-highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.oh-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.oh-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.oh-reason {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
  margin-bottom: 8px;
}
.oh-city {
  font-size: 11px;
  color: var(--gray-400);
}

/* Compact list view for many highlights */
.overview-highlights-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.oh-city-group {
  padding: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}
.oh-city-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.oh-day-range {
  font-size: 11px;
  font-weight: 500;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.oh-highlights-ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.6;
}
.oh-highlights-ul li {
  margin-bottom: 6px;
}
.oh-highlights-ul li:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .overview-highlights-grid {
    grid-template-columns: 1fr;
  }
  .overview-highlight-card {
    padding: 12px;
  }
  .oh-city-group {
    padding: 12px;
  }
}

/* ── Overview Days Grid (Tagesübersicht mit allen Daten) ──────────────────── */
.overview-days-section {
  margin: 24px 0;
}

.overview-days-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding: 0 4px;
}

.overview-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.overview-day-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all .15s ease;
}

.overview-day-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.overview-day-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

.overview-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.overview-day-city {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.overview-day-region {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.overview-day-date {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.overview-day-drive {
  font-size: 12px;
  color: var(--gray-600);
  background: var(--blue-light);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.overview-day-drive small {
  color: var(--gray-500);
  display: block;
  margin-top: 2px;
}

.overview-day-desc {
  font-size: 13px;
  color: var(--gray-700);
  font-style: italic;
  margin-bottom: 12px;
  padding: 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber);
}

.overview-day-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 12px 0 6px 0;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
}

.overview-day-highlights,
.overview-day-activities,
.overview-day-restaurants,
.overview-day-accommodation,
.overview-day-insider-tip {
  margin-top: 8px;
}

.overview-day-highlight,
.overview-day-activity,
.overview-day-restaurant,
.overview-day-hotel,
.overview-day-tip {
  font-size: 12px;
  color: var(--gray-700);
  padding: 4px 0;
  line-height: 1.4;
}

.overview-day-highlight strong,
.overview-day-activity strong,
.overview-day-restaurant strong,
.overview-day-hotel strong {
  color: var(--gray-900);
}

.overview-day-highlight small,
.overview-day-activity small,
.overview-day-restaurant small,
.overview-day-hotel small {
  color: var(--gray-500);
}

.overview-day-insider-tip .overview-day-tip {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green);
  font-size: 12px;
  color: var(--gray-700);
}

.overview-day-coords {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
  font-family: 'SF Mono', monospace;
}

@media (max-width: 640px) {
  .overview-days-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Admin Navigation ─────────────────────────────────────────────────────── */
.admin-nav {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  max-width: 1140px;
  margin: 0 auto;
}
.admin-nav-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.admin-nav-btn:hover {
  background: var(--gray-200);
}
.admin-nav-btn.active {
  background: var(--blue);
  color: white;
}

/* ── Admin Views ──────────────────────────────────────────────────────────── */
.admin-view.hidden {
  display: none;
}

/* ── Prompt Editor ────────────────────────────────────────────────────────── */
.prompts-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.prompt-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.prompt-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--gray-200);
}
.prompt-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.prompt-description {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
}

.prompt-form {
  padding: 20px;
}

.prompt-field {
  margin-bottom: 16px;
}
.prompt-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.prompt-field input,
.prompt-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s;
  resize: vertical;
}
.prompt-field input:focus,
.prompt-field textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.prompt-field textarea {
  min-height: 80px;
}

.prompt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prompt-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-400);
  font-family: var(--font);
}

.prompt-vars-box {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.prompt-vars-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.prompt-vars-list {
  display: grid;
  gap: 4px;
}

.prompt-var {
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

.prompt-var-desc {
  color: var(--gray-500);
  margin-left: 8px;
}

/* ── Tageskarte ──────────────────────────────────────────────────────────── */
.day-map-container {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.day-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid var(--gray-200);
}

.day-map-title {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
}

.day-map-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--gray-500);
}

.map-legend-item {
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}


.day-map {
  height: 200px;
  width: 100%;
}

@media (max-width: 640px) {
  .day-map-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .day-map-legend {
    flex-wrap: wrap;
    gap: 8px;
  }
  .day-map {
    height: 200px;
  }
}

.prompt-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

@media (max-width: 600px) {
  .admin-nav {
    padding: 10px 12px;
    gap: 6px;
  }
  .admin-nav-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  .prompt-form {
    padding: 16px;
  }
  .prompt-row {
    grid-template-columns: 1fr;
  }
  .prompt-actions {
    flex-direction: column;
  }
  .prompt-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* User Preferences Styles */
.prefs-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.prefs-section h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}
.prefs-desc {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.prefs-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.prefs-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.prefs-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.prefs-option.selected {
  border-color: #c2652a;
  background: #fdf3ea;
}
.prefs-option-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 10px;
}
.prefs-option.selected .prefs-option-icon {
  background: #f7e3d0;
}
.prefs-option-content {
  flex: 1;
}
.prefs-option-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.prefs-option-price {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.prefs-option-desc {
  font-size: 13px;
  color: var(--text-muted);
}
.prefs-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.prefs-saved {
  color: #16a34a;
  font-weight: 500;
  font-size: 14px;
}

/* Hotel Alternatives Styles */
.alt-card.preferred {
  border-color: #c2652a;
  background: #fdf3ea;
}
.alt-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}
.alt-category.budget {
  background: #dcfce7;
  color: #166534;
}
.alt-category.standard {
  background: #f7e3d0;
  color: #7a3e15;
}
.alt-category.premium {
  background: #f3e8ff;
  color: #6b21a8;
}
.alt-category.luxury {
  background: #fef3c7;
  color: #92400e;
}
.alt-preferred-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  background: #c2652a;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
}

/* Pref Info Box */
.pref-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pref-icon {
  font-size: 20px;
}
.pref-label {
  font-weight: 500;
  color: var(--text);
}
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.field-hint a {
  color: #c2652a;
  text-decoration: underline;
}

/* Extended User Preferences Styles */
.prefs-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.prefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

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

.prefs-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.prefs-card-wide {
  grid-column: 1 / -1;
}

.prefs-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.prefs-desc {
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.prefs-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.prefs-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prefs-form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.prefs-form-field input,
.prefs-form-field select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.prefs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prefs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}

.prefs-chip:hover {
  background: #e2e8f0;
}

.prefs-chip.selected {
  background: #f7e3d0;
  border-color: #c2652a;
  color: #7a3e15;
}

.prefs-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.prefs-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}

.prefs-checkbox:hover {
  background: #f1f5f9;
}

.prefs-checkbox input {
  display: none;
}

.prefs-checkbox input:checked + span {
  color: #c2652a;
  font-weight: 500;
}

.prefs-checkbox:has(input:checked) {
  background: #f7e3d0;
  border-color: #c2652a;
}

.prefs-save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  margin: 0 -24px -24px -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.admin-json-toggle {
  margin-bottom: 8px;
  padding: 8px;
  background: var(--surface);
  border-radius: 4px;
}

.admin-json-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.admin-json-toggle input[type="checkbox"] {
  cursor: pointer;
}

/* ── Admin: Prompt Test ───────────────────────────────────────────────────── */
.prompt-test-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .prompt-test-container {
    grid-template-columns: 1fr;
  }
}

.prompt-test-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.prompt-test-form h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
}

.prompt-test-form .form-group {
  margin-bottom: 16px;
}

.prompt-test-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.prompt-test-form .form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.prompt-test-form textarea.form-control {
  resize: vertical;
  min-height: 80px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.prompt-test-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prompt-test-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.prompt-test-result h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.prompt-test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.prompt-test-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.prompt-test-tabs .btn {
  padding: 6px 12px;
  font-size: 13px;
}

.prompt-test-tabs .btn.active {
  background: var(--primary);
  color: white;
}

.prompt-test-content {
  max-height: 500px;
  min-height: 200px;
  overflow: auto;
  background: #0f172a;
  border-radius: 8px;
  padding: 16px;
}

.prompt-test-content .admin-code {
  border-radius: 8px;
  margin: 0;
}

.prompt-test-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Admin: AI Stats ───────────────────────────────────────────────────────── */
.ai-stats-container {
  max-width: 1000px;
  margin: 0 auto;
}

.ai-stats-container h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stats-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stats-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stats-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.stats-section {
  margin-bottom: 32px;
}

.stats-section h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-chart-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-height: 200px;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  gap: 12px;
}

.stats-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stats-bar {
  width: 100%;
  max-width: 60px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.stats-bar-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stats-bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════════════
   TIMELINE V2 — Magazine / Editorial Redesign
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Stop Card: Hero Photo Layout ──────────────────────────────────────── */

.stop-hero {
  position: relative; width: 100%; height: 240px; overflow: hidden;
}
@media (max-width: 600px) { .stop-hero { height: 190px; } }

.stop-hero img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.stop-card:hover .stop-hero img { transform: scale(1.04); }

.stop-hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 52px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 55%, transparent 100%);
  display: flex; flex-direction: column; gap: 4px;
}

.stop-hero-price {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.22);
}

/* Rating row on dark photo background */
.stop-hero-overlay .stop-rating-row { gap: 6px; }
.stop-hero-overlay .star-bar { color: rgba(255,255,255,.25); font-size: 13px; }
.stop-hero-overlay .star-bar::after { color: #fbbf24; }
.stop-hero-overlay .stop-rating-val { color: #fbbf24; font-size: 13px; font-weight: 700; }
.stop-hero-overlay .stop-reviews-count { color: rgba(255,255,255,.6); font-size: 11px; }

/* Name + address on dark background */
.stop-hero-overlay .stop-selected-name {
  color: #fff !important;
  font-size: 20px; font-weight: 600;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
  letter-spacing: -0.02em; line-height: 1.2;
  font-family: var(--font-display);
}
.stop-hero-address {
  color: rgba(255,255,255,.72); font-size: 11.5px;
  display: flex; align-items: center; gap: 3px;
}

/* Card body for photo cards — override flex */
.stop-card.has-photo .stop-card-body { display: block; }
.stop-card.has-photo .stop-card-content-col {
  padding: 12px 16px 8px;
  display: flex; flex-direction: column; gap: 6px;
}

/* Review: allow 3 lines on photo cards */
.stop-card.has-photo .stop-review-quote { -webkit-line-clamp: 3; font-size: 12.5px; }

/* No-photo cards — bigger name, better spacing */
.stop-card.no-photo .stop-card-body { display: block; }
.stop-card.no-photo .stop-card-content-col {
  padding: 14px 16px 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.stop-card.no-photo .stop-selected-name {
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.015em; line-height: 1.25;
  color: var(--gray-900);
  font-family: var(--font-display);
}
.stop-card.no-photo .stop-rating-row { gap: 6px; }

/* ── Day Hero Strip (above map toggle in day view) ─────────────────────── */

.day-hero-strip {
  position: relative; height: 180px;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #3d2b1f 0%, #c2652a 60%, #7c3a16 100%);
}
.day-hero-strip img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* No-photo fallback: overlay covers full strip with opaque gradient */
.day-hero-strip:not(:has(img)) .day-hero-strip-overlay,
.day-hero-strip.img-error .day-hero-strip-overlay {
  background: linear-gradient(135deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 100%);
}
.day-hero-strip-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.05) 55%);
  display: flex; align-items: flex-end;
  padding: 14px 18px;
}
.day-hero-strip-city {
  font-family: var(--font-display); font-size: 24px; color: #fff;
  letter-spacing: -0.02em; text-shadow: 0 1px 6px rgba(0,0,0,.4);
  line-height: 1.15;
}

/* ── Overview V2: Photo Mosaic + Photo Day Cards ────────────────────────── */

/* Photo Mosaic */
.ov-photo-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 120px;
  gap: 4px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.ov-mosaic-item {
  background-size: cover; background-position: center;
  background-color: var(--gray-200);
  position: relative; cursor: pointer;
  transition: opacity .15s;
}
.ov-mosaic-item:hover { opacity: .88; }
.ov-mosaic-main {
  grid-column: span 2;
  grid-row: span 2;
}
.ov-mosaic-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 11px; font-weight: 600;
}
@media (max-width: 600px) {
  .ov-photo-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; }
  .ov-mosaic-main { grid-column: span 2; grid-row: span 1; }
}

/* Title row */
.ov-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.ov-title-inline {
  font-family: var(--font-display); font-size: 24px; font-weight: 400;
  color: var(--gray-900); letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 2px;
}
.ov-route-inline { font-size: 13px; color: var(--gray-400); }
.ov-title-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.ov-title-actions .ov-icon-btn,
.ov-title-actions .ov-enrich-btn,
.ov-title-actions .ov-task-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--gray-100); color: var(--gray-500);
  border: 1px solid var(--gray-200);
  font-size: 18px; cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none; padding: 0;
}
.ov-title-actions .ov-enrich-btn { background: var(--primary-light, #f5e6d8); color: var(--primary); border-color: var(--primary-border, #e8cdb8); }
.ov-title-actions .ov-enrich-btn:hover:not(:disabled) { background: var(--primary-border, #e8cdb8); }
.ov-title-actions .ov-enrich-btn:disabled { opacity: .5; cursor: not-allowed; }
.ov-title-actions .ov-task-icon-btn:hover { background: var(--gray-200); color: var(--gray-700); }

/* Stats */
.ov-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.day-header-stats {
  margin-top: 0; margin-bottom: 0;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 600px) { .ov-stats { grid-template-columns: repeat(2, 1fr); } }
.ov-stat {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px 16px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.ov-stat-icon { font-size: 22px; margin-bottom: 8px; }
.ov-stat-val {
  font-family: var(--font-display); font-size: 30px; line-height: 1;
  color: var(--gray-900); letter-spacing: -0.03em; margin-bottom: 5px;
}
.ov-stat-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray-400);
}

.ov-section-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 400;
  color: var(--gray-900); letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* Day cards grid */
.ov-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
@media (max-width: 600px) { .ov-days-grid { grid-template-columns: 1fr; } }

.ov-day-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200);
  overflow: hidden; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.ov-day-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.ov-day-photo {
  height: 150px; position: relative;
  background-size: cover; background-position: center;
  background-color: var(--gray-100);
}
.ov-day-photo-no-photo {
  height: 100%;
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-100) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; opacity: .4;
}
.ov-day-weather {
  position: absolute; top: 10px; right: 10px; font-size: 24px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}
.ov-day-photo-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 36px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 100%);
}
.ov-day-num {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: rgba(255,255,255,.7); margin-bottom: 2px;
}
.ov-day-city {
  font-family: var(--font-display); font-size: 17px; color: #fff;
  letter-spacing: -0.01em; line-height: 1.15;
}
.ov-day-body { padding: 12px 14px 14px; }
.ov-day-date { font-size: 11px; color: var(--gray-400); margin-bottom: 6px; }
.ov-day-desc {
  font-size: 12.5px; color: var(--gray-600); line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ov-day-hl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ov-day-hl-chip {
  font-size: 10.5px; font-weight: 500;
  color: var(--blue-dark); background: var(--blue-light);
  border-radius: 20px; padding: 2px 8px;
}
.ov-day-drive {
  font-size: 11px; color: var(--gray-400);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
}

/* ── Summary / Buchungen Tab ──────────────────────────────────────────── */
.summary-page { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.summary-title {
  font-size: 22px; font-weight: 700; color: var(--gray-600);
  margin-bottom: 28px; text-align: center;
}
.summary-section { margin-bottom: 32px; }
.summary-section-title {
  font-size: 17px; font-weight: 700; color: var(--primary);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}
.summary-list { display: flex; flex-direction: column; gap: 12px; }
.summary-item {
  display: flex; gap: 14px;
  background: var(--white); border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden; transition: box-shadow .15s;
}
.summary-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.summary-item-photo {
  width: 120px; min-height: 100px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.summary-item-body { padding: 12px 14px 12px 0; flex: 1; min-width: 0; }
.summary-item-body:first-child { padding-left: 14px; }
.summary-item-header {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.summary-item-name {
  font-size: 15px; font-weight: 600; color: var(--gray-600);
}
.summary-item-price {
  font-size: 12px; font-weight: 600; color: var(--gray-400);
  background: var(--gray-100); border-radius: 4px; padding: 1px 6px;
}
.summary-item-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--gray-400); margin-top: 3px;
}
.summary-item-meta span:not(:last-child)::after { content: '·'; margin-left: 8px; }
.summary-item-rating {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; margin-top: 4px;
}
.summary-item-rating .star-bar { font-size: 13px; }
.summary-item-reviews { color: var(--gray-400); }
.summary-item-desc {
  font-size: 12.5px; color: var(--gray-400); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.summary-item-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--white);
  background: var(--primary); border-radius: 6px;
  padding: 4px 12px; margin-top: 8px; text-decoration: none;
  transition: opacity .15s;
}
.summary-item-link:hover { opacity: .85; }

@media (max-width: 600px) {
  .summary-item { flex-direction: column; }
  .summary-item-photo { width: 100%; height: 140px; }
  .summary-item-body { padding: 12px 14px !important; }
}

/* ── Xotelo Hotel Prices ─────────────────────────────────────────────── */
.summary-prices-loading {
  font-size: 12px; color: var(--gray-400);
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.summary-prices-loading .ph-spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.summary-prices { margin-top: 8px; }
.summary-prices-best {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.summary-prices-total {
  font-size: 22px; font-weight: 700; color: var(--primary);
}
.summary-prices-detail {
  font-size: 12px; color: var(--gray-400);
}
.summary-prices-providers {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.summary-price-chip {
  font-size: 11.5px; color: var(--gray-500);
  background: var(--gray-100); border-radius: 6px;
  padding: 3px 8px; white-space: nowrap;
}
.summary-price-chip strong {
  color: var(--gray-600); margin-left: 2px;
}
a.summary-price-link {
  text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s;
  border: 1px solid var(--gray-200);
}
a.summary-price-link:hover {
  background: var(--primary-light); border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(194,101,42,.15);
}
a.summary-price-link:hover strong { color: var(--primary); }
