/* ── Design tokens (UI.md palette) ── */
:root {
  --primary: #0B2545;
  --primary-light: #133C73;
  --secondary: #C4CDD5;
  --secondary-light: #E2E8F0;
  --base: #F5F0EB;
  --base-light: #FAF8F5;
  --accent: #2A7DE1;
  --accent-hover: #1D6DC1;
  --accent-soft: #EDF2FB;
  --heading: #0B2545;
  --text: #1E293B;
  --text-muted: #475569;
  --text-on-dark: #F5F0EB;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow-sm: 0 1px 3px rgba(11,37,69,.06), 0 1px 2px rgba(11,37,69,.04);
  --shadow-md: 0 4px 16px rgba(11,37,69,.08), 0 2px 6px rgba(11,37,69,.04);
  --shadow-lg: 0 12px 40px rgba(11,37,69,.12), 0 4px 12px rgba(11,37,69,.06);
  /* Legacy aliases for JS-generated markup */
  --bg: var(--base);
  --surface: var(--primary);
  --card: var(--base-light);
  --border: var(--secondary);
  --gray: var(--text-muted);
  --gray-light: var(--secondary-light);
  --muted: var(--text-muted);
  --ink: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', 'Inter', system-ui, sans-serif;
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ── Topbar ── */
.topbar {
  padding: 16px 32px;
  background: var(--primary);
  color: var(--text-on-dark);
  border-bottom: none;
  position: relative;
  z-index: 100;
}
.topbar h1 { margin: 0 0 2px; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text-on-dark); }
.topbar p { margin: 0; font-size: .85rem; color: rgba(245,240,235,.6); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.mode-toggle {
  display: inline-flex;
  border: 1px solid rgba(245,240,235,.2);
  border-radius: 999px;
  overflow: hidden;
}
.mode-btn {
  border: 0;
  border-radius: 0;
  padding: 7px 14px;
  font-size: .85rem;
  background: transparent;
  color: rgba(245,240,235,.6);
  transition: background .18s ease, color .18s ease;
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.link-btn {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(245,240,235,.2);
  border-radius: 999px;
  font-size: .85rem;
  transition: border-color .18s ease, background .18s ease;
}
.link-btn:hover { border-color: rgba(245,240,235,.5); background: rgba(245,240,235,.08); }

/* ── Layout ── */
.container { max-width: 960px; margin: 28px auto; padding: 0 24px 48px; }

/* ── Step indicator ── */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step {
  flex: 1;
  background: var(--base-light);
  color: var(--text-muted);
  border: 1px solid var(--secondary);
  padding: 10px 12px;
  border-radius: 999px;
  text-align: center;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .01em;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.step.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.step.reachable:not(.active) {
  cursor: pointer;
  color: var(--text);
  border-color: var(--accent);
}
.step.reachable:not(.active):hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  opacity: .85;
}

/* ── Panels ── */
.panel {
  background: var(--base-light);
  border: none;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: none;
  color: var(--text);
}
.panel.active { display: block; }
.card-panel {
  background: var(--base-light);
  border: none;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

/* ── Execution mode ── */
.execution-panel { margin-bottom: 14px; }
.execution-head p { margin: 0; }
.execution-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.execution-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.execution-summary-card {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  padding: 14px;
  background: var(--base-light);
  box-shadow: var(--shadow-sm);
}
.execution-summary-card h4 {
  margin: 0 0 4px;
  font-size: .82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.execution-summary-card p { margin: 0; font-weight: 700; color: var(--text); }

.execution-confirmations-panel {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  padding: 14px;
  background: var(--base-light);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.execution-confirmations-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.execution-confirmations { display: grid; gap: 6px; }
.execution-confirmation-item {
  border: 1px solid var(--secondary-light);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--base-light);
}
.execution-confirmation-item p { margin: 2px 0; font-size: .9rem; }

.execution-list { display: flex; flex-direction: column; gap: 8px; }
.execution-item {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  background: var(--base-light);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.execution-time { font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.execution-place { font-weight: 700; margin-bottom: 4px; color: var(--heading); }
.execution-note { margin: 0 0 8px; color: var(--text-muted); font-size: .93rem; }
.execution-meta { margin: 0 0 8px; color: var(--text-muted); font-size: .88rem; }
.execution-actions { display: flex; gap: 8px; }
.execution-actions a,
.execution-actions button {
  text-decoration: none;
  border: 1px solid var(--secondary);
  border-radius: 999px;
  background: var(--base-light);
  color: var(--text);
  padding: 6px 12px;
  font-weight: 600;
  font-size: .84rem;
  transition: background .18s ease, border-color .18s ease;
}
.execution-actions a:hover,
.execution-actions button:hover {
  background: var(--secondary-light);
  border-color: var(--accent);
}

body.execution-mode .steps,
body.execution-mode .step-panel { display: none !important; }
body.execution-mode #executionModeView { display: block !important; }

/* ── Forms ── */
label { display: block; margin-bottom: 12px; font-weight: 600; color: var(--text); }
input, textarea, button { font: inherit; }
input, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--secondary);
  border-radius: 10px;
  margin-top: 6px;
  background: var(--base-light);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 125, 225, .12);
}
select {
  padding: 10px 14px;
  border: 1px solid var(--secondary);
  border-radius: 10px;
  background: var(--base-light);
  color: var(--text);
  font: inherit;
  transition: border-color .18s ease;
}
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 125, 225, .12);
}

/* ── Buttons ── */
button {
  border: 0;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background .18s ease, opacity .18s ease, transform .12s ease, box-shadow .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
button:active:not(:disabled) { transform: scale(0.97); }
button.primary { background: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(42, 125, 225, .3); transform: translateY(-1px); }
button.secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
button.secondary:hover:not(:disabled) { background: var(--primary); color: var(--text-on-dark); }
button.danger { background: var(--bad); color: white; }
button.danger:hover:not(:disabled) { background: #b91c1c; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Setup ── */
.setup-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.setup-insights {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 14px 16px;
  margin-bottom: 12px;
  min-height: 44px;
}
.setup-insights strong { color: var(--heading); }
.setup-insights .warn { color: var(--bad); font-weight: 700; }

/* ── City rows ── */
.city-row {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--base-light);
  box-shadow: var(--shadow-sm);
}
.city-row-main {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto minmax(140px, 0.6fr) auto;
  gap: 6px;
  align-items: center;
}
.city-row-toggle { min-width: 32px; padding: 4px 8px; }
.city-drawer { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--secondary-light); }
.city-dropdown-grid { display: grid; gap: 10px; }
.city-dropdown-section { border: 1px solid var(--secondary-light); border-radius: 14px; padding: 14px; background: var(--secondary-light); }
.city-dropdown-label { display: block; font-size: .86rem; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.city-dropdown-row { display: grid; gap: 6px; }
.accommodation-row { grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(130px, 1fr)); }
.arrival-row,
.departure-row { grid-template-columns: minmax(180px, 1fr) auto; }
.city-dropdown-row input,
.city-dropdown-row select { margin-top: 0; }
.city-dropdown-error { margin: 0; color: var(--bad); font-weight: 700; font-size: .9rem; }
.city-section-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 4px; }
.city-section-head h4 { margin: 0; font-size: .92rem; }
.city-hotels-list { display: flex; flex-direction: column; gap: 6px; }
.hotel-row { display: grid; grid-template-columns: 1.2fr repeat(2, minmax(120px, auto)) auto; gap: 6px; }
.travel-row { display: grid; grid-template-columns: 1.4fr minmax(130px, auto) minmax(120px, auto); gap: 6px; margin-bottom: 6px; }
.travel-row input, .travel-row select { margin-top: 0; }

.place-autocomplete-fallback { display: none; }
.tp-place-autocomplete { display: block; width: 100%; }
.city-autocomplete { position: relative; }
.city-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 30;
  background: var(--base-light);
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.city-suggestion-item {
  display: block; width: 100%; text-align: left;
  border: 0; border-radius: 0;
  background: transparent; color: var(--text);
  padding: 10px 14px; font-weight: 600;
}
.city-suggestion-item + .city-suggestion-item { border-top: 1px solid var(--secondary-light); }
.city-suggestion-item:hover, .city-suggestion-item.active { background: var(--accent-soft); }

/* ── Review toolbar ── */
.review-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 0.7fr)) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}
.review-toolbar input, .review-toolbar select { margin-top: 0; }

/* ── Activity cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  border: 1px solid rgba(196,205,213,.4);
  border-radius: 18px;
  background: var(--base-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.activity-card-placeholder { min-height: 520px; border-radius: 20px; background: var(--secondary-light); }
.card-reveal { opacity: 0; transform: translateY(24px); }
.card-revealed { opacity: 1; transform: translateY(0); transition: opacity .4s ease, transform .4s ease; }
.activity-card { transition: background .2s ease, border-left-color .2s ease, opacity .4s ease, transform .4s ease; perspective: 1200px; min-height: 520px; }
.activity-card-inner { position: relative; width: 100%; min-height: 520px; transition: transform .55s ease; transform-style: preserve-3d; }
.activity-card.is-flipped .activity-card-inner { transform: rotateY(180deg); }
.activity-card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--base-light); overflow: auto; -webkit-overflow-scrolling: touch; }
.activity-card-back { transform: rotateY(180deg); }
.card img { width: 100%; height: 160px; object-fit: cover; background: var(--secondary-light); }
.card-content { padding: 14px; }
.activity-card-head-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.flip-btn { min-width: 42px; padding: 6px 8px; }
.map-back-content { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.mini-map-wrap { border: 1px solid var(--secondary-light); background: var(--secondary-light); padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; }
.mini-map { width: 100%; height: 220px; display: block; }
.mini-map-loading { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray); font-size: 13px; }

.badge { display: inline-block; border-radius: 999px; padding: 5px 10px; font-size: 12px; letter-spacing: .02em; margin-right: 6px; background: var(--secondary-light); color: var(--text); }
.badge.verdict-Recommend { background: #dcfce7; color: #166534; }
.badge.verdict-Recommend-with-caveats { background: #fef3c7; color: #92400e; }
.badge.verdict-Skip { background: #fee2e2; color: #991b1b; }
.actions { display: flex; gap: 8px; margin-top: 10px; }

.btn-approve.active { background: var(--ok); color: white; }
.btn-approve.inactive { opacity: 0.35; cursor: default; }
.btn-decline.active { background: var(--bad); color: white; }
.btn-decline.inactive { opacity: 0.35; cursor: default; }
.activity-card.approved { border-left: 4px solid var(--ok); background: rgba(34,197,94,0.04); }
.activity-card.declined { border-left: 4px solid var(--bad); background: rgba(239,68,68,0.04); }
.activity-card.map-highlight { box-shadow: 0 0 0 3px rgba(26, 111, 244, 0.35); }

/* ── Map overlay ── */
.activity-map-overlay { position: fixed; inset: 0; z-index: 1600; background: rgba(11, 37, 69, 0.6); backdrop-filter: blur(6px); padding: 18px; }
.activity-map-shell { height: 100%; background: var(--base-light); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.activity-map-topbar { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--secondary-light); }
.activity-map-canvas { flex: 1; min-height: 360px; }
.activity-map-marker { width: 38px; height: 38px; border-radius: 999px; background: var(--accent); color: #fff; border: 2.5px solid rgba(255,255,255,0.9); box-shadow: 0 4px 10px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; }
.activity-map-marker i { font-size: 17px; line-height: 1; }
.activity-map-marker.star { background: #f59e0b; box-shadow: 0 4px 12px rgba(245,158,11,0.5), 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-museum    { background: #6366f1; box-shadow: 0 4px 10px rgba(99,102,241,0.45), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-gallery   { background: #ec4899; box-shadow: 0 4px 10px rgba(236,72,153,0.45), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-landmark  { background: #8b5cf6; box-shadow: 0 4px 10px rgba(139,92,246,0.45), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-park      { background: #22c55e; box-shadow: 0 4px 10px rgba(34,197,94,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-neighborhood { background: #0ea5e9; box-shadow: 0 4px 10px rgba(14,165,233,0.45), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-market    { background: #f97316; box-shadow: 0 4px 10px rgba(249,115,22,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-food,
.activity-map-marker.cat-restaurant,
.activity-map-marker.cat-lunch     { background: #ef4444; box-shadow: 0 4px 10px rgba(239,68,68,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-breakfast { background: #f59e0b; box-shadow: 0 4px 10px rgba(245,158,11,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-dinner    { background: #be123c; box-shadow: 0 4px 10px rgba(190,18,60,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-nightlife { background: #7c3aed; box-shadow: 0 4px 10px rgba(124,58,237,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-show      { background: #db2777; box-shadow: 0 4px 10px rgba(219,39,119,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-tour      { background: #0891b2; box-shadow: 0 4px 10px rgba(8,145,178,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-walk      { background: #16a34a; box-shadow: 0 4px 10px rgba(22,163,74,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-sunset    { background: #ea580c; box-shadow: 0 4px 10px rgba(234,88,12,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-sports    { background: #16a34a; box-shadow: 0 4px 10px rgba(22,163,74,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-cultural  { background: #d97706; box-shadow: 0 4px 10px rgba(217,119,6,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-shopping  { background: #e11d48; box-shadow: 0 4px 10px rgba(225,29,72,0.45),   0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.cat-spa       { background: #0d9488; box-shadow: 0 4px 10px rgba(13,148,136,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.log-accommodation { background: #0f766e; box-shadow: 0 4px 10px rgba(15,118,110,0.45), 0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.log-arrival   { background: #7c3aed; box-shadow: 0 4px 10px rgba(124,58,237,0.45),  0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }
.activity-map-marker.log-departure { background: #b45309; box-shadow: 0 4px 10px rgba(180,83,9,0.45),    0 1px 3px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25); }

/* ── Notes row ── */
.notes-row { display: flex; gap: 6px; align-items: flex-start; }
.notes-row .notes { flex: 1; }
.notes-row .apply-note { padding: 4px 10px; border: 1px solid var(--secondary); border-radius: 999px; background: var(--base-light); cursor: pointer; font-size: 14px; line-height: 1; }
.notes-row .apply-note:disabled { opacity: 0.3; cursor: default; }
.notes-row .apply-note:not(:disabled):hover { background: #dcfce7; border-color: var(--ok); }

/* ── Decline feedback ── */
.decline-feedback { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.decline-feedback .decline-reason { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--secondary); border-radius: 10px; padding: 6px 8px; font-size: 14px; }
.decline-feedback-actions { display: flex; gap: 8px; justify-content: flex-end; }

.hidden { display: none !important; }

/* ── Auth ── */
.auth-controls { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: 0.5rem; }
#forwardingPanel code {
  display: inline-block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--secondary-light);
  font-weight: 600;
  color: var(--text);
}

/* ── Shared layout utils ── */
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ── Day columns / Arrange ── */
.day-columns { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.day-col { min-width: 280px; max-width: 280px; border: 1px solid var(--secondary-light); border-radius: 16px; background: var(--base-light); box-shadow: var(--shadow-sm); }
.day-head { padding: 12px; border-bottom: 1px solid var(--secondary-light); font-weight: 700; background: var(--secondary-light); border-radius: 16px 16px 0 0; color: var(--heading); }
.list { min-height: 80px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--secondary-light); border-radius: 12px; padding: 10px; background: var(--base-light); color: var(--text); box-shadow: var(--shadow-sm); }
.item h4 { margin: 0 0 6px; color: var(--heading); }

.arrange-city-nav { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.arrange-header { margin-bottom: 4px; }
.arrange-actions { display: flex; align-items: center; gap: 8px; }
.auto-arrange-btn {
  background: transparent !important;
  border: 1px solid var(--secondary) !important;
  color: var(--text-muted) !important;
}
.auto-arrange-btn:hover { background: var(--accent-soft) !important; color: var(--accent) !important; }
.arrange-city-tabs { display: flex; gap: 8px; overflow-x: auto; flex: 1; }
.arrange-city-tab {
  white-space: nowrap;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--secondary);
}
.arrange-city-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.arrange-city-arrow { min-width: 40px; }

/* ── Staging area ── */
.staging {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 14px;
  min-height: 100px;
  align-items: center;
  margin-bottom: 14px;
  background: var(--secondary-light);
  border: 1px dashed var(--secondary);
  border-radius: 16px;
}
.staging-card {
  flex-shrink: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 8px;
  cursor: grab;
  border-radius: 10px;
  border-left: 4px solid var(--activity-border, #94a3b8);
  background: var(--activity-bg, #f8fafc);
  color: var(--activity-text, #334155);
}
.staging-card h4 {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.activity-icon { margin-right: 4px; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; }
.activity-icon i { font-size: 15px; line-height: 1; }
.activity-name { overflow: hidden; text-overflow: ellipsis; }

/* ── Schedule columns ── */
.schedule-col { min-width: 220px; max-width: 220px; }
.schedule-col .day-head small { display: block; margin-top: 4px; color: var(--gray); font-weight: 600; }
.day-grid-wrap { position: relative; height: 1080px; }
.hour-grid { position: absolute; inset: 0; }
.hour-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(0,0,0,0.06); }
.hour-line span { position: absolute; top: -9px; left: 6px; font-size: 11px; color: var(--gray); background: rgba(255,255,255,0.95); padding: 0 4px; }
.day-schedule { position: absolute; inset: 0; padding: 4px; }

/* ── Placed cards ── */
.placed-card {
  position: absolute;
  left: 4px; right: 4px;
  border: 1px solid var(--activity-border, var(--secondary-light));
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--activity-bg, var(--base-light));
  color: var(--activity-text, var(--text));
  overflow: visible;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.placed-card.resize-hover { cursor: ns-resize; }
.placed-card.resize-hover::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 6px;
  height: 1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.placed-body {
  padding: 8px 8px 2px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.placed-head-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.placed-body h4 { margin: 0; font-size: 13px; line-height: 1.2; display: inline-flex; align-items: center; gap: 6px; }
.activity-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.placed-info-wrap {
  position: absolute; top: -3px; left: -5px;
  width: 12px; height: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; padding: 0; background: transparent; cursor: pointer;
}
.placed-info-icon { font-size: 10px; line-height: 1; opacity: .4; transition: opacity .16s ease, transform .16s ease; }
.placed-info-wrap:hover .placed-info-icon { opacity: .98; transform: scale(1.1); }

.placed-tooltip-layer {
  position: fixed;
  width: min(300px, 72vw);
  background: var(--primary);
  color: var(--text-on-dark);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
  text-align: left;
  z-index: 2200;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  pointer-events: none;
}
.placed-tooltip-layer.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.placed-tooltip-title { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: var(--text-on-dark); }
.placed-tooltip-row { font-size: 11px; line-height: 1.35; color: rgba(245,240,235,.7); margin-bottom: 4px; }
.placed-tooltip-row:last-child { margin-bottom: 0; }

/* ── Logistics cards ── */
.logistics-card {
  position: absolute;
  left: 4px; right: 4px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--gray-light);
  border: 1.5px dashed #94a3b8;
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
  z-index: 8;
  pointer-events: none;
}
.logistics-card-icon { font-size: 16px; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; }
.logistics-card-icon i { font-size: 16px; line-height: 1; }
.logistics-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.logistics-card-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logistics-card-sub { font-size: 10px; font-weight: 400; color: var(--muted); }
.logistics-card-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.logistics-transit {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.logistics-transit-line {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: #94a3b8;
  margin-right: 2px;
}

/* ── Commute selector ── */
.commute-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  white-space: nowrap;
}
.commute-selector { position: relative; pointer-events: auto; }
.commute-selector-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(2px);
}
.commute-selector:hover .commute-selector-trigger,
.commute-selector.open .commute-selector-trigger {
  border-color: var(--secondary-light);
  color: var(--text);
}
.commute-selector-arrow { opacity: 0; transform: translateY(-1px); transition: opacity .14s ease; }
.commute-selector:hover .commute-selector-arrow,
.commute-selector.open .commute-selector-arrow { opacity: .85; }
.commute-selector-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  background: var(--base-light);
  border: 1px solid var(--secondary-light);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
}
.commute-selector.open .commute-selector-menu { display: block; }
.commute-option {
  width: 100%; border: 0; border-radius: 0;
  background: transparent; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; padding: 8px 12px;
}
.commute-option + .commute-option { border-top: 1px solid var(--secondary-light); }
.commute-option:hover, .commute-option.active { background: var(--accent-soft); }
.commute-option-check { color: var(--accent); }

/* ── Activity type colors ── */
.activity-food { --activity-bg: #fff7ed; --activity-border: #f59e0b; --activity-text: #9a3412; }
.activity-show { --activity-bg: #faf5ff; --activity-border: #a855f7; --activity-text: #6b21a8; }
.activity-tour { --activity-bg: #f0fdfa; --activity-border: #14b8a6; --activity-text: #0f766e; }
.activity-cultural { --activity-bg: #eef2ff; --activity-border: #6366f1; --activity-text: #3730a3; }
.activity-walk,
.activity-neighborhood { --activity-bg: #f3f8f2; --activity-border: #84a98c; --activity-text: #3f5f46; }
.activity-sports { --activity-bg: #fff1f2; --activity-border: #fb7185; --activity-text: #9f1239; }
.activity-sunset { --activity-bg: #fff7ed; --activity-border: #f9a8d4; --activity-text: #9d174d; }
.activity-default { --activity-bg: #f8fafc; --activity-border: #94a3b8; --activity-text: #334155; }

/* ── API banner ── */
.api-banner { padding: 12px 16px; border-radius: 14px; margin-bottom: 12px; background: #fef3c7; color: #92400e; border-left: 4px solid var(--warn); border: 1px solid #fde68a; border-left: 4px solid var(--warn); }

/* ── Planning overlay ── */
.planning-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(11, 37, 69, .55);
  backdrop-filter: blur(6px);
  z-index: 999;
}
.planning-overlay-card {
  width: min(600px, 100%);
  padding: 36px 32px;
  text-align: center;
  color: var(--text-on-dark);
  background: linear-gradient(145deg, rgba(19, 60, 115, .97), rgba(11, 37, 69, .95));
  border: none;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}
.planning-trip { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.planning-status { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.planning-progress { font-size: .95rem; opacity: .75; margin-bottom: 10px; }
.planning-message {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  opacity: .35;
  transform: translateY(4px);
  transition: opacity .4s ease, transform .4s ease;
  animation: planningPulse 1.6s ease-in-out infinite;
}
.planning-message.loading-visible { opacity: 1; transform: translateY(0); }
@keyframes planningPulse {
  0%, 100% { opacity: .92; }
  50% { opacity: .65; }
}

/* ── Modal ── */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 37, 69, .45);
  backdrop-filter: blur(6px);
  z-index: 1200;
}
.modal-card {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--base-light);
  border-radius: 24px;
  padding: 24px;
  border: none;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.prefs-section { margin-bottom: 12px; }
.prefs-divider { border: 0; border-top: 1px solid var(--secondary-light); margin: 18px 0; }
.profile-section h4 { margin: 0 0 12px; }
.profile-label { margin-bottom: 8px; }
.ai-summary-hint { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-muted); }

.profile-textarea-fixed { resize: none !important; }
.textarea-expand-wrap {
  position: relative;
}
.textarea-expand-wrap .profile-textarea-fixed {
  display: block;
  width: 100%;
}
.textarea-expand-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(250,248,245,.85);
  border: 1px solid var(--secondary);
  padding: 3px 6px;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  backdrop-filter: blur(2px);
  transition: color .15s, background .15s, border-color .15s;
}
.textarea-expand-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--base-light); }

/* ── Textarea expand modal ── */
.textarea-expand-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.textarea-expand-modal.hidden { display: none; }
.textarea-expand-backdrop { position: absolute; inset: 0; background: rgba(11,37,69,.4); }
.textarea-expand-dialog {
  position: relative;
  background: var(--base-light);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.textarea-expand-dialog-header { display: flex; align-items: center; justify-content: space-between; }
.textarea-expand-dialog-title { font-weight: 700; font-size: 1rem; }
.textarea-expand-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color .15s, background .15s;
}
.textarea-expand-close:hover { color: var(--text); background: var(--secondary-light); }
.textarea-expand-editor {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--secondary);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  background: var(--base-light);
  box-sizing: border-box;
}
.textarea-expand-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,125,225,.12); }
.textarea-expand-actions { display: flex; justify-content: flex-end; }

.profile-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.profile-dropdown,
.profile-name-input {
  width: auto;
  min-width: 220px;
  margin-top: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
}
.profile-dropdown {
  appearance: none;
  background: var(--secondary-light);
  color: var(--text);
  border: 1px solid var(--secondary);
  line-height: 40px;
}
.profile-selector-row button { height: 40px; padding: 0 14px; }
.profile-name-input::placeholder { color: var(--text-muted); }
#newProfileBtn:disabled { background: var(--secondary-light); color: var(--text-muted); border: 1px solid var(--secondary); }
#deleteProfileBtn { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
#deleteProfileBtn:disabled { background: #fef2f2; color: #d4a0a0; border-color: #fce4e4; }

.muted-text { color: var(--text-muted); }

/* inside panels, muted text uses same token */
.panel .muted-text { color: var(--text-muted); }

.profile-delete-bottom { width: 100%; margin-top: 12px; }
.profile-questions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.profile-question { display: flex; align-items: center; gap: 12px; }
.profile-question p { margin: 0; font-weight: 600; font-size: .88rem; flex: 1; min-width: 0; }

/* ── Dot scale ── */
.dot-scale-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dot-scale {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot-scale-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background .15s, transform .12s;
  flex-shrink: 0;
}
.dot-scale-dot:hover {
  background: rgba(26, 111, 244, 0.25);
  transform: scale(1.25);
}
.dot-scale-dot.active {
  background: var(--accent);
  transform: scale(1.15);
}
.dot-scale-label {
  font-size: .82rem;
  color: var(--gray);
  font-weight: 600;
  text-align: right;
  min-width: 110px;
  flex-shrink: 0;
}

/* ── Step nav (sticky bottom bar) ── */
.step-nav { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.step-nav-split { flex-direction: row; justify-content: flex-end; align-items: center; }
.sticky-nav {
  position: sticky;
  bottom: 10px;
  z-index: 10;
  padding: 14px;
  border: 1px solid var(--secondary-light);
  border-radius: 16px;
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
}
.nav-primary {
  background: var(--accent) !important;
  color: #fff !important;
  font-size: 1rem;
  padding: 12px 20px;
}
.nav-primary:hover { background: var(--accent-hover) !important; }
.nav-secondary {
  border: 1px solid var(--secondary);
  background: var(--base-light) !important;
  color: var(--text) !important;
  font-size: .98rem;
  padding: 12px 16px;
}
.nav-secondary:hover { background: var(--secondary-light) !important; }
.step-nav .nav-primary,
.step-nav .nav-secondary { width: 100%; }
.step-nav-split .nav-secondary { max-width: 180px; }
.step-nav-split .nav-primary { max-width: 320px; }
.save-progress-btn { border: 1px solid var(--secondary); }

/* ── Chat widget ── */
#chatWidget { position: fixed; bottom: 24px; right: 24px; z-index: 1000; }
#chatBubble {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(42, 125, 225, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}
#chatBubble:hover { transform: scale(1.05); box-shadow: 0 8px 28px rgba(42, 125, 225, .45); }
#chatPanel {
  width: 360px; height: 480px;
  background: var(--base-light);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  position: absolute; bottom: 70px; right: 0;
  color: var(--text);
}
#chatHeader {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: var(--primary);
  color: var(--text-on-dark);
  border-radius: 20px 20px 0 0;
  font-weight: 700;
}
#chatHeader button { background: transparent; padding: 4px 8px; color: rgba(245,240,235,.6); }
#chatHeader button:hover { color: var(--text-on-dark); }
#chatMessages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 14px 14px 2px 14px;
  max-width: 80%;
  font-size: .9rem;
}
.chat-msg-assistant {
  align-self: flex-start;
  background: var(--secondary-light);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 2px;
  max-width: 80%;
  font-size: .9rem;
}
#chatInputArea {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--secondary-light);
}
#chatInput {
  flex: 1;
  border-radius: 999px;
  padding: 10px 14px;
  margin-top: 0;
  border: 1px solid var(--secondary);
  background: var(--base-light);
}
#chatSend {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
}
#chatSend:hover { background: var(--accent-hover); }

/* ── Nav hint ── */
.nav-hint { margin: 0; font-size: .9rem; }

/* ── Itinerary insights ── */
.itinerary-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.itinerary-insight-card {
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  background: var(--base-light);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.itinerary-insight-card h4 { margin: 0 0 6px; }
.itinerary-insight-card p { margin: 0 0 4px; font-size: .92rem; }
.pace-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
}
.pace-pill.pace-light { background: #dcfce7; color: #166534; }
.pace-pill.pace-balanced { background: #fef3c7; color: #92400e; }
.pace-pill.pace-packed { background: #fee2e2; color: #991b1b; }

/* ── My trips / saved itineraries ── */
.my-trips-panel {
  margin-top: 18px;
  border: 1px solid var(--secondary-light);
  border-radius: 16px;
  background: var(--secondary-light);
  padding: 16px;
}
.draft-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
  margin-left: 6px;
}
.draft-item { border-color: #fde68a; background: #fffbeb; }
.saved-itineraries-panel {
  margin-top: 14px;
  border: 1px solid var(--secondary-light);
  border-radius: 16px;
  background: var(--secondary-light);
  padding: 16px;
}
.saved-itineraries-list { display: flex; flex-direction: column; gap: 10px; }
.saved-itinerary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--secondary-light);
  border-radius: 14px;
  background: var(--base-light);
  box-shadow: var(--shadow-sm);
}
.saved-itinerary-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42, 125, 225, .12);
}
.saved-itinerary-item h4 { margin: 0 0 4px; }
.saved-itinerary-item p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.saved-itinerary-actions { display: flex; gap: 8px; }

/* ── Toast notifications ── */
.toast-host {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 1500;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(250, 248, 245, 0.98);
  border: 1px solid var(--secondary-light);
  border-left-width: 4px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  transform: translateY(12px);
  opacity: 0;
  transition: transform .24s ease, opacity .24s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.hide { transform: translateY(8px); opacity: 0; }
.toast-icon {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; margin-top: 1px;
}
.toast-message { line-height: 1.35; font-weight: 600; }
.toast-success { border-left-color: var(--ok); }
.toast-success .toast-icon { background: #dcfce7; color: #166534; }
.toast-error { border-left-color: var(--bad); }
.toast-error .toast-icon { background: #fee2e2; color: #991b1b; }
.toast-info { border-left-color: var(--accent); }
.toast-info .toast-icon { background: #dbeafe; color: #1e40af; }

/* ── Responsive: Compact (<768px) ── */
@media (max-width: 767px) {
  /* Scale the entire UI down — everything using rem/inherit cascades from this */
  html { font-size: 13px; }

  .container { padding: 0 10px 24px; margin-top: 10px; }
  .panel { padding: 14px 10px; }

  /* Forms: tighten padding globally */
  input, textarea, select { padding: 6px 10px; font-size: 0.85rem; }
  .tp-place-autocomplete { max-width: 100%; overflow: hidden; box-sizing: border-box; }
  .city-autocomplete { max-width: 100%; overflow: hidden; }
  label { margin-bottom: 6px; font-size: 0.85rem; }

  /* Buttons: compact */
  button { min-height: 34px; padding: 5px 10px; font-size: 0.82rem; }
  .nav-primary, .nav-secondary { padding: 7px 12px; font-size: 0.85rem; }

  /* Setup actions: stay inline */
  .setup-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; }

  .review-toolbar { grid-template-columns: 1fr; }

  /* City row: 3-row compact grid */
  .city-row { padding: 8px; margin-bottom: 6px; border-radius: 10px; }
  .city-row-main {
    grid-template-columns: auto 1fr 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 4px;
  }
  .city-row-main > :nth-child(1) { grid-column: 1; grid-row: 1; min-height: unset; align-self: center; }
  .city-row-main > :nth-child(2) { grid-column: 2 / 4; grid-row: 1; }
  .city-row-main > :nth-child(6) { grid-column: 4; grid-row: 1; min-height: unset; padding: 4px 8px; font-size: .75rem; align-self: center; }
  .city-row-main > :nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
  .city-row-main > :nth-child(4) { grid-column: 3 / 5; grid-row: 2; }
  .city-row-main > :nth-child(5) { grid-column: 1 / -1; grid-row: 3; }
  .city-row-main input[type="date"] { width: 100%; min-width: 0; padding: 4px 2px; font-size: 0.75rem; -webkit-appearance: none; }

  /* Drawer sections: tighter */
  .city-dropdown-section { padding: 6px; border-radius: 10px; overflow: hidden; max-width: 100%; box-sizing: border-box; }
  .city-dropdown-grid { gap: 4px; overflow: hidden; }
  .city-dropdown-label { font-size: 0.75rem; margin-bottom: 3px; }
  .city-drawer { overflow: hidden; }
  .hotel-row, .travel-row { grid-template-columns: 1fr; }
  .accommodation-row { grid-template-columns: 1fr 1fr; }
  .accommodation-row > :first-child { grid-column: 1 / -1; }
  .accommodation-row input[type="date"] { padding: 4px 2px; font-size: 0.75rem; min-width: 0; width: 100%; }
  .arrival-row, .departure-row { grid-template-columns: 1fr auto; }
  .arrival-row input[type="date"],
  .arrival-row input[type="time"],
  .departure-row input[type="date"],
  .departure-row input[type="time"] { padding: 4px 2px; font-size: 0.75rem; min-width: 0; }

  /* Topbar */
  .topbar { padding: 8px 10px; }
  .topbar-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .topbar-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }

  /* Step nav */
  .step-nav-split { flex-direction: row; gap: 8px; justify-content: space-between; }
  .step-nav-split .nav-secondary { max-width: none; width: auto; }
  .step-nav-split .nav-primary { max-width: none; flex: 1; text-align: center; }
  .sticky-nav { padding: 8px; border-radius: 10px; }

  /* Activity cards: compact preview on mobile — tap to expand */
  .activity-card { perspective: none; min-height: unset; cursor: pointer; }
  .activity-card.is-flipped { perspective: 1200px; }
  .activity-card-inner { min-height: unset; transform-style: flat; }
  .activity-card-face { position: relative; inset: auto; overflow: hidden; }
  .activity-card-back { display: none; }
  .activity-card .card-content > *:nth-child(n+3) { display: none; }
  .activity-card .card-content > .activity-card-head-actions { display: flex; }
  .activity-card .card-content > h3 { display: block; }
  .activity-card .flip-btn { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .activity-card-placeholder { min-height: 180px; }

  /* Fullscreen expanded card overlay */
  .card-expand-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: var(--base-light);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    animation: cardExpandIn .3s ease;
  }
  .card-expand-overlay.closing { animation: cardExpandOut .25s ease forwards; }
  @keyframes cardExpandIn { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes cardExpandOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(40px); } }
  .card-expand-close {
    position: fixed; top: 12px; right: 12px; z-index: 2001;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(11,37,69,.7); color: #fff; border: 0;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
  }
  .card-expand-body { padding: 0 0 80px; }
  .card-expand-body img { width: 100%; height: 220px; object-fit: cover; }
  .card-expand-body .card-content { padding: 16px; }
  .card-expand-body .card-content > * { display: block !important; }

  /* Misc */
  .execution-head { flex-direction: column; align-items: flex-start; }
  .execution-toolbar { width: 100%; }
  .execution-toolbar button { flex: 1; min-height: 34px; }
  .toast-host { left: 8px; right: 8px; bottom: 8px; max-width: none; }
  .steps { flex-wrap: wrap; }
  .modal-card { border-radius: 16px 16px 0 0; max-height: 92vh; position: fixed; bottom: 0; }
  #chatPanel { position: fixed; width: 100vw; height: 70vh; left: 0; right: 0; bottom: 0; border-radius: 16px 16px 0 0; }
}

/* ── Responsive: Medium (768–1024px) ── */
@media (min-width: 768px) and (max-width: 1024px) {
  .container { max-width: 720px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Print ── */
@media print {
  .topbar, .mode-toggle, .steps, .step-panel, #chatWidget,
  .execution-toolbar, .saved-itineraries-panel, #downloadCalendarBtn, .sticky-nav {
    display: none !important;
  }
  body, .container, .panel, #executionModeView {
    display: block !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000 !important;
  }
}

/* ── Calendar sync ── */
.calendar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Budget tracker ── */
.budget-tracker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}
.budget-tracker.budget-green { background: #dcfce7; color: #166534; }
.budget-tracker.budget-yellow { background: #fef3c7; color: #92400e; }
.budget-tracker.budget-red { background: #fee2e2; color: #991b1b; }
.budget-label { font-weight: 700; }
.budget-remaining { margin-left: auto; }
.budget-caveat { font-size: 0.8rem; opacity: 0.8; }

/* ── Activity cost + booking links ── */
.activity-cost { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.booking-links { display: flex; gap: 6px; flex-wrap: wrap; }
.booking-link {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease;
}
.booking-link:hover { background: var(--accent-hover); }

/* ── Trip meta row ── */
.trip-meta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.trip-meta-row label { flex: 1; min-width: 180px; }

/* ── Drag & drop polish ── */
.sortable-ghost {
  opacity: .4;
  border: 2px dashed var(--accent) !important;
  border-radius: 12px;
}
.sortable-chosen {
  box-shadow: 0 8px 28px rgba(0,0,0,.15) !important;
  transform: rotate(1deg);
  z-index: 100;
}
.sortable-drag {
  opacity: 1 !important;
}

/* ── Card hover polish ── */
.card {
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Smooth panel transitions ── */
.panel.active {
  animation: panelFadeIn .25s ease;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
