:root {
    /* Ocean + sunset palette — travel-appropriate and fresh */
    --primary: #0d9488;          /* teal-600 */
    --primary-dark: #0f766e;     /* teal-700 */
    --primary-light: #14b8a6;    /* teal-500 */
    --primary-soft: #ccfbf1;     /* teal-100 */
    --secondary: #0ea5e9;        /* sky-500  */
    --accent: #f97316;           /* orange-500 (sunset) */
    --accent-dark: #ea580c;
    --accent-soft: #ffedd5;      /* orange-100 */
    --danger: #ef4444;
    --success: #10b981;

    --bg: #f8fafc;               /* slate-50 */
    --bg-mesh: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f1f5f9;        /* slate-100 */
    --surface-3: #e2e8f0;        /* slate-200 */
    --text: #0f172a;             /* slate-900 */
    --text-muted: #526070;       /* slate-600-ish — AA >=4.5:1 on tinted bg (★3.5) */
    --text-faint: #94a3b8;       /* slate-400 */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
    --shadow: 0 10px 40px rgba(15,23,42,0.10);
    --shadow-lg: 0 24px 60px rgba(15,23,42,0.16);
    --shadow-glow: 0 8px 24px rgba(13,148,136,0.25);

    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --radius-pill: 999px;

    --grad-primary: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    --grad-accent: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);
    --grad-mesh: radial-gradient(at 0% 0%, rgba(13,148,136,0.10) 0px, transparent 50%),
                 radial-gradient(at 100% 0%, rgba(14,165,233,0.10) 0px, transparent 50%),
                 radial-gradient(at 50% 100%, rgba(249,115,22,0.06) 0px, transparent 50%);
}

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

/* ---------- ★3.5 Accessibility ---------- */
/* Visible keyboard focus (WCAG 2.4.7). Shown ONLY for keyboard/AT users via
   :focus-visible — mouse clicks never show the ring. */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}
/* The map target must be keyboard-focusable for OpenLayers' built-in
   KeyboardPan / KeyboardZoom interactions (arrows + +/-). */
.map-container:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}
/* Reduced motion (WCAG 2.3.3): kill animation & motion transitions for users
   who ask. Keeps instant state changes; nothing depends on animation to be
   understood (flash-highlight also shows via scroll position). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
    .activity-card.flash-highlight { background: var(--primary-soft); }
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        var(--bg-mesh);
    background-attachment: fixed;
}
body::before {
    content: '';
    position: fixed; inset: 0;
    background: var(--grad-mesh), linear-gradient(180deg, #eef2f7 0%, #e2e8f0 100%);
    z-index: -1;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ★3.5 — skip link (WCAG 2.4.1): visible only on keyboard focus, so sighted
   mouse users never see it. */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--primary); color: #fff;
    padding: 10px 16px; border-radius: 0 0 8px 8px;
    font-weight: 700; font-size: 14px; text-decoration: none;
}
.skip-link:focus {
    left: 0; outline: 3px solid #fff; outline-offset: -3px;
}
.skip-link:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

/* ---------- Chat shell ---------- */
.chat-container {
    max-width: 1040px;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    margin: 0 auto;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
/* ★3.4 — mobile-first: prefer the dynamic viewport height so the composer
   stays above the browser chrome (iOS/Android address bar). Falls back to
   the standard 100vh where 100dvh is unsupported. */
@supports (height: 100dvh) {
    .chat-container { max-height: 100dvh; height: 100dvh; }
}
@media (min-width: 640px) {
    .chat-container {
        height: 94vh;
        max-height: 940px;
        margin-top: 3vh;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(255,255,255,0.6);
    }
    @supports (height: 100dvh) {
        /* 94vh is fine on desktop; keep dvh only where the browser shrinks
           the viewport dynamically (mobile). */
        .chat-container { height: 94vh; }
    }
}

/* ---------- Header (glassmorphic) ---------- */
.chat-header {
    background: var(--grad-primary);
    color: #fff;
    padding: 10px 22px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.chat-header::after {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.18), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(249,115,22,0.20), transparent 45%);
    pointer-events: none;
}
.chat-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
/* Persistent header view toggle (Itinerary | Find tours). */
.chat-header .header-toggle {
    position: relative;
    display: inline-flex;
    gap: 4px;
    margin-top: 8px;
    background: rgba(255,255,255,0.18);
    padding: 3px;
    border-radius: var(--radius-pill);
    font-size: 12px;
}
.chat-header .header-toggle button {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    transition: all 0.18s;
}
.chat-header .header-toggle button.active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}
.chat-header p {
    font-size: 0.82rem;
    opacity: 0.92;
    font-weight: 500;
    position: relative;
}
.logo-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 15px;
    backdrop-filter: blur(6px);
}

/* ---------- Messages ---------- */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 22px 18px 8px;
    background: var(--bg);
    scroll-behavior: smooth;
}
.messages-container::-webkit-scrollbar { width: 8px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
.messages-container::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.message {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.message.user { flex-direction: row-reverse; }
.message-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.message.user .message-avatar {
    background: var(--grad-primary);
    color: #fff;
}
.message.assistant .message-avatar {
    background: #fff;
    border: 1px solid var(--border);
}
.message-content {
    max-width: min(80%, 540px);
    padding: 13px 17px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    position: relative;
}
.message.user .message-content {
    background: var(--grad-primary);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: var(--shadow-glow);
}
.message.assistant .message-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
}
.message-content p { margin: 0 0 8px 0; }
.message-content p:last-child { margin-bottom: 0; }
.message-content strong { font-weight: 700; color: inherit; }
.message-content em { font-style: italic; }
.message.user .message-content strong { color: #fff; }
.message-content code {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.88em;
    color: var(--primary-dark);
}
.message-content ul, .message-content ol { margin: 4px 0 8px 0; padding-left: 20px; }
.message-content li { margin-bottom: 2px; }
.message-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(13,148,136,0.35);
    font-weight: 500;
}
.message.user .message-content a { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }
.message-content a:hover { border-bottom-color: currentColor; }

/* ---------- Intent brief card ---------- */
.intent-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
    border: 1px solid #99f6e4;
    border-radius: 16px;
    padding: 14px 16px;
    margin: 4px 0 16px 46px;
    max-width: min(82%, 560px);
    font-size: 13px;
    color: #134e4a;
    box-shadow: 0 4px 14px rgba(13,148,136,0.08);
    position: relative;
}
.intent-card h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
    color: var(--primary-dark);
    display: flex; align-items: center; gap: 6px;
    font-weight: 700;
}
.intent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 7px 14px;
}
.intent-item {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.7);
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid rgba(153,246,228,0.6);
}
.intent-item .label { font-weight: 600; color: var(--primary-dark); }
.intent-item .value { color: #0f766e; font-weight: 500; }
.intent-missing { color: var(--text-muted); font-style: italic; }
.intent-ready-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #99f6e4;
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
}
.intent-ready-bar.ready { color: var(--success); }
.intent-ready-bar.partial { color: var(--accent-dark); }
.intent-ready-bar .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}
.intent-ready-bar.partial .dot { box-shadow: 0 0 0 4px rgba(249,115,22,0.15); }

/* Interactive trip brief card — 3 sections */
.brief-section { margin-bottom: 14px; }
.brief-section:last-child { margin-bottom: 0; }
.brief-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    margin-bottom: 7px; display: flex; align-items: center; gap: 5px;
}
.brief-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
    margin-bottom: 8px;
}
.brief-row:last-child { margin-bottom: 0; }
.brief-label {
    font-size: 12px; font-weight: 600; color: var(--text);
    min-width: 70px; display: flex; align-items: center; gap: 4px;
}
.brief-chip {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 13px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; color: var(--text);
    user-select: none; white-space: nowrap;
}
.brief-chip:hover { border-color: var(--primary-light); background: var(--surface); }
.brief-chip.selected {
    background: var(--grad-primary); color: #fff; border-color: transparent;
    box-shadow: var(--shadow-glow);
}
.brief-chip.selected:hover { filter: brightness(1.05); }
.brief-check {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 12px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; color: var(--text);
    user-select: none;
}
.brief-check:hover { border-color: var(--primary-light); }
.brief-check.selected {
    background: var(--primary-soft); color: var(--primary-dark);
    border-color: var(--primary-light);
}
.brief-check .check-icon { font-size: 11px; opacity: 0; transition: opacity 0.15s; }
.brief-check.selected .check-icon { opacity: 1; }
.brief-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    cursor: pointer; user-select: none; font-size: 13px; font-weight: 600;
    color: var(--text);
}
.brief-toggle .switch {
    width: 38px; height: 22px; border-radius: 11px;
    background: var(--surface-3); transition: background 0.2s;
    position: relative; flex-shrink: 0;
}
.brief-toggle .switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.brief-toggle.on .switch { background: var(--primary); }
.brief-toggle.on .switch::after { transform: translateX(16px); }
.brief-date-input {
    padding: 6px 10px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 13px; background: var(--surface-2);
    font-family: inherit; color: var(--text);
}
.brief-date-input:focus {
    outline: none; border-color: var(--primary-light); background: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}
.brief-country-edit {
    display: inline-flex; align-items: center; gap: 6px;
}
.brief-country-edit input {
    width: 110px; padding: 5px 9px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 13px; background: var(--surface-2);
    font-family: inherit;
}
.brief-country-edit input:focus {
    outline: none; border-color: var(--primary-light); background: #fff;
}
.brief-country-display {
    font-weight: 700; color: var(--text); font-size: 15px;
    display: inline-flex; align-items: center; gap: 6px;
}
.brief-edit-icon {
    cursor: pointer; font-size: 12px; opacity: 0.5;
    transition: opacity 0.15s;
}
.brief-edit-icon:hover { opacity: 1; }
.brief-deals-toggle {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* ---------- Itinerary card ---------- */
.itinerary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin: 4px 0 16px 46px;
    max-width: min(88%, 660px);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.itinerary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.itinerary-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}
.itinerary-price {
    background: var(--grad-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}
.expert-tip {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}
/* T17 — knowledge-tier banner (data_basis='knowledge'). */
.knowledge-banner {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #60a5fa;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.5;
}
.itinerary-media {
    display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px;
    padding-bottom: 4px;
}
.itinerary-media::-webkit-scrollbar { height: 6px; }
.itinerary-media::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
.media-card {
    flex-shrink: 0; width: 200px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border); background: var(--surface-2);
    cursor: pointer; transition: all 0.15s; text-decoration: none;
    display: block;
}
.media-card:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.media-card img { width: 100%; height: 110px; object-fit: cover; background: var(--surface-3); }
.media-card .media-info { padding: 7px 10px; }
.media-card .media-source {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--primary); letter-spacing: 0.05em; margin-bottom: 2px;
}
.media-card .media-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
/* T6 — inline video embed (curated external_content with embed_url). */
.media-card--embed { width: 280px; }
.media-card--embed iframe { width: 100%; height: 158px; border: 0; display: block; background: var(--surface-3); }
.view-toggle {
    display: flex;
    gap: 4px;
    margin: 12px 0;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-pill);
    width: fit-content;
}
.view-toggle button {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.18s;
}
.view-toggle button.active {
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}
.itinerary-card .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}
.day-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
    position: relative;
}
.day-card::before {
    content: '';
    position: absolute; left: 0; top: 12px; bottom: 12px;
    width: 3px;
    background: var(--grad-primary);
    border-radius: 0 3px 3px 0;
}
.day-card h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 6px;
}
.day-price {
    font-size: 11px;
    color: var(--accent-dark);
    font-weight: 700;
    background: var(--accent-soft);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}
.activity-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.activity-card:last-child { border-bottom: none; }
.activity-img {
    width: 64px; height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; color: var(--text); }
.activity-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.activity-time {
    font-size: 11px; color: var(--text-muted);
    background: var(--surface);
    padding: 2px 7px; border-radius: 6px;
    border: 1px solid var(--border);
}
.activity-price {
    font-size: 11px; font-weight: 700; color: var(--accent-dark);
    background: var(--accent-soft);
    padding: 2px 7px; border-radius: 6px;
}
.why-btn {
    background: transparent; border: none;
    color: var(--primary);
    font-size: 12px; font-weight: 600;
    cursor: pointer; padding: 0; margin-top: 6px;
}
.why-btn:hover { color: var(--primary-dark); text-decoration: underline; }
.why-text {
    font-size: 12px; color: var(--text-muted);
    margin-top: 8px; padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px; display: none;
    line-height: 1.5;
}
.why-text.open { display: block; }

/* ---------- Calendar view ---------- */
.calendar-view { display: flex; flex-direction: column; gap: 10px; }
.calendar-day { display: flex; gap: 12px; }
.calendar-date { width: 52px; text-align: center; flex-shrink: 0; }
.calendar-date .day-num {
    font-size: 22px; font-weight: 800; color: var(--primary);
    line-height: 1; letter-spacing: -0.02em;
}
.calendar-date .day-label {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.calendar-events {
    flex: 1; background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px;
}
.calendar-event {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--border);
}
.calendar-event:last-child { border-bottom: none; }
.calendar-event img {
    width: 42px; height: 42px; border-radius: 8px;
    object-fit: cover; background: var(--surface-3);
}
.calendar-event .ev-title { font-size: 12.5px; font-weight: 600; }
.calendar-event .ev-time { font-size: 11px; color: var(--text-muted); }

/* ---------- Map view ---------- */
.map-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.map-filter button {
    padding: 6px 12px; font-size: 11px; font-weight: 600;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius-pill); cursor: pointer;
    color: var(--text-muted); transition: all 0.15s;
}
.map-filter button.active {
    background: var(--grad-primary); color: #fff; border-color: transparent;
    box-shadow: var(--shadow-glow);
}
.map-container {
    width: 100%; height: 400px;
    border-radius: var(--radius-sm); overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--border);
}
.map-popup {
    position: absolute; background: #fff;
    border-radius: 10px; padding: 9px 12px;
    box-shadow: var(--shadow); font-size: 12px;
    min-width: 150px; display: none; z-index: 10;
    border: 1px solid var(--border);
}
.map-popup .popup-title { font-weight: 700; margin-bottom: 3px; color: var(--text); }
.map-popup .popup-meta { color: var(--text-muted); font-size: 11px; }
.map-popup-goto { margin-top: 6px; font-size: 11px; }

/* ★3.2 — flash highlight when jumping from a map marker to its card. */
@keyframes flashHighlight {
    0%   { background: rgba(102, 126, 234, 0.35); box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.6); }
    100% { background: transparent; box-shadow: 0 0 0 2px transparent; }
}
.activity-card.flash-highlight {
    animation: flashHighlight 1.1s ease-out 2;
    border-radius: 10px;
}

/* ---------- Typing & skeleton ---------- */
.typing-indicator {
    display: flex; gap: 5px; padding: 14px 17px;
    background: var(--surface); border-radius: 20px;
    width: fit-content; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.typing-indicator span {
    width: 8px; height: 8px; background: var(--primary-light);
    border-radius: 50%; animation: bounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}
.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }

/* ---------- Progress card ---------- */
.progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px 16px;
    margin: 4px 0 16px 46px;
    max-width: min(82%, 440px);
    box-shadow: var(--shadow);
}
.progress-step {
    display: flex; align-items: center; gap: 11px;
    padding: 6px 0; color: var(--text-muted); font-size: 13px;
    transition: color 0.3s;
}
.progress-step.active { color: var(--text); font-weight: 600; }
.progress-step.done { color: var(--success); }
.step-dot {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; flex-shrink: 0; transition: all 0.3s;
}
.progress-step.done .step-dot {
    background: var(--success); border-color: var(--success); color: #fff;
}
.progress-step.active .step-dot {
    border-color: var(--primary);
    background: var(--primary-soft);
    animation: pulse 1.4s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13,148,136,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(13,148,136,0); }
}
.progress-warning {
    margin-top: 10px; padding: 8px 11px;
    background: var(--accent-soft); color: var(--accent-dark);
    border-radius: 8px; font-size: 12px; font-weight: 600;
    display: none;
}
.progress-warning.show { display: block; }
.progress-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s;
}
.progress-meta.live {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- Status banner ---------- */
.status-banner {
    font-size: 0.78rem; font-weight: 500;
    color: var(--text-muted);
    padding: 8px 14px; text-align: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.status-banner.error { color: #991b1b; background: #fef2f2; }
.status-banner a { color: var(--primary); text-decoration: underline; }

/* ---------- Input area ---------- */
.input-container {
    padding: 10px 14px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}


/* Quick replies (single-fire action chips). Contextual: hidden once an
   itinerary is shown; reopened via the 💡 Suggestions composer button.
   Grouped so related chips (dates/budget) sit together in at most 2 rows
   without shrinking the font. */
.quick-replies {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: flex-start;
    align-items: center;
    max-height: 84px;      /* ~2 rows of 13px chips */
    overflow-y: auto;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    scrollbar-width: thin;
}
.quick-reply {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.18s;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.quick-reply:hover, .quick-reply:focus {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: var(--primary-light);
    outline: none;
    transform: translateY(-1px);
}
.quick-reply.surprise {
    background: var(--grad-accent);
    color: #fff; border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(249,115,22,0.3);
}
.quick-reply.surprise:hover { opacity: 0.92; transform: translateY(-1px); }

.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-container input,
.input-container textarea {
    flex: 1; padding: 13px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 15px; font-family: inherit; line-height: 1.5;
    outline: none; min-width: 0;
    background: var(--surface-2);
    transition: all 0.18s;
}
.input-container input:focus,
.input-container textarea:focus {
    border-color: var(--primary-light);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.15);
}
/* Multi-line composer: 2 lines tall on desktop, no drag-resize (scrolls if longer). */
.input-container textarea {
    border-radius: 18px;
    resize: none;
    min-height: 3.1em;   /* ~2 lines at 1.5 line-height plus padding */
    max-height: 12em;
    overflow-y: auto;
}
/* Persistent "Surprise me" button — compact dice in the input row, always
   available, reclaimed from the quick-reply chips to save vertical space. */
.input-container button.surprise-btn {
    padding: 0 14px;
    background: var(--grad-accent);
    color: #fff; border: none;
    font-size: 18px; font-weight: 700;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(249,115,22,0.28);
    min-height: 3.1em;
    line-height: 1;
    transition: all 0.18s;
}
.input-container button.surprise-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.input-container button.surprise-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Suggestions toggle (💡) — compact companion to Surprise-me in the input row. */
.input-container button.suggestions-btn {
    padding: 0 14px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    min-height: 3.1em;
    line-height: 1;
    box-shadow: none;
    transition: all 0.18s;
}
.input-container button.suggestions-btn:hover,
.input-container button.suggestions-btn[aria-pressed="true"] {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}
.input-container button.suggestions-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.input-container button {
    padding: 13px 22px;
    background: var(--grad-primary);
    color: #fff; border: none;
    border-radius: var(--radius-pill);
    cursor: pointer; font-weight: 600; font-size: 14px;
    transition: all 0.18s;
    box-shadow: var(--shadow-glow);
}
.input-container button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.input-container button:disabled { background: var(--surface-3); cursor: not-allowed; box-shadow: none; transform: none; }
.input-container button.clear-btn { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); box-shadow: none; }
.input-container button.clear-btn:hover { background: var(--surface-3); color: var(--text); transform: none; }
.input-container button.undo-btn {
    background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border); padding: 13px 15px; box-shadow: none;
}
.input-container button.undo-btn:hover { background: var(--surface-3); color: var(--text); }
.input-container button.undo-btn:disabled { opacity: 0.5; }

.message-actions {
    display: flex; gap: 8px;
    margin-left: 46px; margin-top: -8px; margin-bottom: 10px;
}
.message-actions button {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.message-actions button:hover { background: var(--surface-2); color: var(--text); }

/* Expandable days */
.days-all { display: none; animation: expandIn 0.25s ease-out; }
.days-all.open { display: block; }
@keyframes expandIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.show-more-btn {
    width: 100%; padding: 11px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--primary-dark); font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: center; margin-top: 4px;
    transition: all 0.15s;
}
.show-more-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light); border-style: solid;
}

/* ---------- STAGE 2: compact itinerary + discovery card ---------- */
.compact-itinerary { margin-top: 10px; }
.city-stays { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.city-stay {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600;
}
.city-stay .stay-days { color: var(--primary); font-weight: 800; }
.city-stay-arrow { color: var(--text-muted); font-weight: 700; }
.poi-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.poi-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--primary-soft); border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px;
    color: var(--primary-dark); text-decoration: none;
}
.poi-chip:hover { background: var(--primary); color: #fff; }
.poi-chip .chip-city { color: var(--text-muted); font-size: 11px; }
.compact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.compact-link {
    font-size: 12px; color: var(--primary); text-decoration: none;
    border-bottom: 1px dotted var(--primary); padding-bottom: 1px;
}
.compact-link:hover { color: var(--primary-dark); }
.expand-btn {
    width: 100%; padding: 11px; background: var(--surface-2);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--primary-dark); font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: center; margin-top: 8px;
}
.expand-btn:hover { background: var(--primary-soft); }
.discovery-card { margin: 10px 0; }
.discovery-card h4 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.discovery-back { padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.discovery-back .why-btn { font-size: 13px; }
.sight-chips, .city-explore { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sight-chip, .city-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 12px; font-size: 12px;
    color: var(--text); text-decoration: none;
}
.sight-chip:hover, .city-chip:hover { border-color: var(--primary); color: var(--primary); }
.route-card {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px; margin: 8px 0;
}
.route-card .route-title { font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.route-card .route-seq { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.route-card .route-pois { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.route-card .pick-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 7px 14px; font-size: 13px;
    font-weight: 700; cursor: pointer;
}
.route-card .pick-btn:hover { background: var(--primary-dark); }
.route-card .pick-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- ★3.4 Mobile-first ---------- */
/* Compact header for small screens. */
@media (max-width: 639px) {
    .chat-container { border-radius: 0; }
    .chat-header { padding: calc(14px + env(safe-area-inset-top)) 16px 12px; }
    .chat-header p { display: none; } /* save vertical space: title only */
    .chat-header h1 { font-size: 1.1rem; }
    .auth-btn { top: calc(10px + env(safe-area-inset-top)); right: 14px; }

    /* Composer: keep the send button primary, shrink the icon buttons to
       square touch targets (>=44px), and reserve space for the home
       indicator on notched phones. */
    .input-container {
        padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
    }
    .input-container textarea,
    .input-container input { font-size: 16px; } /* >=16px prevents iOS focus zoom */
    .input-container button { min-height: 44px; }
    .input-container button.undo-btn { padding: 13px 14px; }
    .quick-reply { min-height: 40px; display: inline-flex; align-items: center; }

    /* Messages: full-width bubbles, tighter spacing. */
    .messages-container { padding: 16px 12px 6px; }
    .message { gap: 8px; }
    .message-content { max-width: 88%; }
    .message-actions { margin-left: 0; }
    .progress-card, .intent-card, .itinerary-card { margin-left: 0; max-width: 100%; }

    /* Itinerary map: taller than the old 300px so markers are tappable, but
       capped so the chat scroll still works. */
    .map-container { height: min(55vh, 420px); }
    .map-filter button { min-height: 40px; padding: 8px 14px; }
    .view-toggle button { min-height: 40px; }
    .why-btn, .expand-btn { min-height: 40px; }

    /* Activity cards: image smaller, keep metadata tappable. */
    .activity-img { width: 56px; height: 56px; }
    .day-card h4 { font-size: 0.98rem; }

    /* Auth modal fills the screen on phones. */
    .modal { max-height: 92dvh; overflow-y: auto; }
}
@media (max-width: 480px) {
    /* Stack the composer on mobile: textarea on top, action buttons
       (Send / Undo / Clear) in a single row below it. The persistent
       Surprise-me dice stays compact beside the Send row, not full-width. */
    .input-row { flex-wrap: wrap; align-items: stretch; }
    .input-container textarea,
    .input-container input { flex-basis: 100%; width: 100%; }
    .input-container button:not(.surprise-btn):not(.suggestions-btn) { flex: 1; min-width: 0; }
    .input-container button.surprise-btn,
    .input-container button.suggestions-btn {
        flex: 0 0 auto; min-height: 44px; font-size: 20px;
    }
    .input-container button.suggestions-btn { font-size: 18px; }
}

/* ---------- Auth UI ---------- */
.auth-btn {
    position: absolute; top: 16px; right: 18px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-pill);
    padding: 7px 15px;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    backdrop-filter: blur(8px);
}
.auth-btn:hover { background: rgba(255,255,255,0.32); transform: translateY(-1px); }
.auth-btn:active { transform: scale(0.97); }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 400px;
    padding: 26px;
    animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; color: var(--text); letter-spacing: -0.01em; }
.modal .sub { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 18px; }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.modal-tab {
    flex: 1; text-align: center; padding: 9px; border-radius: 9px;
    font-size: 0.86rem; font-weight: 600; cursor: pointer;
    color: var(--text-muted); border: none; background: transparent;
    transition: all 0.15s;
}
.modal-tab.active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.modal-field { margin-bottom: 13px; }
.modal-field label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; }
.modal-field input, .modal-field select {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--border);
    border-radius: 11px; font-size: 0.92rem; box-sizing: border-box;
    background: var(--surface-2); transition: all 0.15s;
}
.modal-field input:focus, .modal-field select:focus {
    outline: none; border-color: var(--primary-light); background: var(--surface);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}
.modal-submit {
    width: 100%; padding: 12px; border: none; border-radius: 12px;
    background: var(--grad-primary); color: #fff; font-weight: 700;
    font-size: 0.94rem; cursor: pointer; margin-top: 4px;
    box-shadow: var(--shadow-glow); transition: all 0.15s;
}
.modal-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.modal-error { color: var(--danger); font-size: 0.8rem; margin-top: 8px; min-height: 1em; }
.modal-divider {
    display: flex; align-items: center; gap: 10px; margin: 18px 0 14px;
    color: var(--text-muted); font-size: 0.75rem; font-weight: 500;
}
.modal-divider::before, .modal-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.oauth-btn {
    width: 100%; padding: 11px; border: 1.5px solid var(--border);
    border-radius: 11px; background: var(--surface); font-size: 0.9rem;
    font-weight: 600; cursor: pointer; margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.15s;
}
.oauth-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.user-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-pill); padding: 5px 12px;
    color: #fff; font-size: 0.78rem; font-weight: 600;
    backdrop-filter: blur(8px);
}
.user-chip button {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 0.78rem; padding: 0 0 0 4px; opacity: 0.85;
}
.user-chip button:hover { opacity: 1; }

/* Compact trip brief */
.intent-card.compact { padding: 14px 16px; }

.brief-country-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}
.brief-soft-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 6px;
}
.quick-reply.guide-build,
.quick-reply.surprise {
    font-weight: 600;
}
.brief-row.compact-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 8px; }
.brief-row.compact-row .brief-label { min-width: auto; }
.brief-select {
    padding: 6px 10px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 13px; background: var(--surface-2);
    font-family: inherit; color: var(--text);
}
.brief-country-input {
    padding: 6px 10px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: 13px; background: var(--surface-2);
    font-family: inherit; color: var(--text); width: 140px;
}
/* Segmented "When are you traveling?" control (three mutually-exclusive modes). */
.when-row { align-items: flex-start; }
.when-column { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.when-head { font-size: 12px; font-weight: 700; color: var(--text); }
.when-seg {
    display: flex; gap: 4px; background: var(--surface-2);
    padding: 3px; border-radius: var(--radius-pill); width: fit-content; flex-wrap: wrap;
}
.when-seg-btn {
    padding: 6px 12px; font-size: 12px; font-weight: 600; border: none;
    background: transparent; border-radius: var(--radius-pill); cursor: pointer;
    color: var(--text-muted); transition: all 0.18s;
}
.when-seg-btn.active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.when-seg-btn.active .switch { background: var(--primary); }
.when-pane { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.when-flexible-hint { font-size: 12px; color: var(--text-muted); padding: 2px 2px; }
.brief-toggle.small { font-size: 12px; gap: 5px; }
.brief-toggle.small .switch { width: 32px; height: 18px; }
.brief-toggle.small .switch::after { width: 14px; height: 14px; }
.brief-toggle.small.on .switch::after { transform: translateX(14px); }
.intent-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.intent-actions-row button { flex: 1; min-width: 120px; border: none; border-radius: var(--radius-pill);
    padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-build { background: var(--grad-accent); color: #fff; }
.btn-build:disabled { background: var(--surface-3); cursor: not-allowed; opacity: 0.6; }
.btn-prefs { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.intent-status { margin-top: 8px; font-size: 12px; font-weight: 600; }
.intent-status.ready { color: var(--success); }
.intent-status.partial { color: var(--accent-dark); }
.intent-mustsee-row { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.intent-dests-row { flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.intent-dests-row .brief-chip { font-size: 12px; padding: 5px 11px; }
.drawer-section { margin-bottom: 18px; }
.drawer-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.drawer-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-footer { display: flex; gap: 8px; margin-top: 10px; }
.drawer-footer button { flex: 1; }

/* ★5.4 — long-term memory rows (view/delete in the preferences drawer). */
.memory-row {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 10px; margin-bottom: 8px;
}
.memory-body { flex: 1; min-width: 0; }
.memory-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.memory-kind {
    background: var(--primary-soft); color: var(--primary-dark);
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.memory-time { font-size: 11px; color: var(--text-muted); }
.memory-text { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.memory-del {
    background: transparent; border: 1px solid var(--border-strong);
    color: var(--text-muted); width: 28px; height: 28px; border-radius: 8px;
    cursor: pointer; font-size: 13px; line-height: 1; flex-shrink: 0;
}
.memory-del:hover { background: var(--accent-soft); color: var(--danger); border-color: var(--danger); }

/* #3 — "while you wait" ready-made tour rail (shown while a build runs) */
.wait-rail { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.wait-rail-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.wait-options { display: flex; flex-wrap: wrap; gap: 10px; }
.wait-option { flex: 1 1 240px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.wait-option-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.wait-option-meta { font-size: 0.78rem; color: var(--text-muted); margin: 3px 0 6px; }
.wait-option-cities { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.qw-dest { font-size: 0.72rem; background: var(--accent-soft); color: var(--text); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.wait-option-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

/* Tour-selection (0029) — ranked tour grid */
.tour-grid { margin: 12px 0; }
.tour-grid-head { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.tour-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tour-card { border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.tour-card-hero { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin: 0 0 8px; background: var(--surface-3); }
.tour-sites-head { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tour-sites { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tour-site-tile { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 10px; cursor: pointer; background: var(--surface); }
.tour-site-tile.selected { border-color: #2563eb; background: #2563eb; }
.tour-site-tile.selected .tour-site-name { color: #fff; }
.tour-site-tile.selected .tour-site-guide { color: #dbeafe; }
.tour-site-name { font-size: 0.8rem; }
.tour-site-guide { font-size: 0.68rem; color: var(--primary-dark); text-decoration: underline; margin-top: 2px; }
.tour-sites-head-narrow { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tour-map-row { margin-bottom: 10px; }
.tour-map-toggle { background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-pill, 999px); padding: 3px 14px; font-size: 0.76rem; color: var(--text); cursor: pointer; }
.tour-minimap { margin-top: 8px; max-width: 480px; }
.tour-minimap .map-container { width: 100%; height: 220px; }
.tour-covered { font-size: 0.76rem; color: var(--primary-dark); margin-bottom: 4px; }
.tour-missing-row { font-size: 0.76rem; color: #b45309; margin-bottom: 4px; }
.tour-missing { background: #fef3c7; color: #92400e; border-radius: 10px; padding: 1px 8px; font-size: 0.72rem; margin: 0 2px; }
.tour-no-match { background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 0.82rem; margin-bottom: 10px; }
.tour-sites-hint { font-size: 0.76rem; color: var(--text-muted); margin: 6px 0 8px; line-height: 1.4; }
.tour-guide-link { display: inline-block; margin-top: 10px; font-size: 0.8rem; color: var(--primary-dark); text-decoration: underline; }
.tour-guides-row { margin-top: 8px; }
.tour-guides-toggle { background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-pill, 999px); padding: 2px 12px; font-size: 0.76rem; color: var(--text-muted); cursor: pointer; }
.tour-guides-body { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 0.76rem; display: block; }
.tour-guides-body[hidden] { display: none; }
.tour-guide-item { margin: 4px 0; line-height: 1.4; color: var(--text); }
.tour-guide-item-name { font-weight: 600; }
.tour-guide-item-blurb { color: var(--text-muted); }
.tour-guide-item-link { color: var(--primary-dark); text-decoration: underline; margin-left: 6px; white-space: nowrap; }
.tour-brief-card { border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.tour-brief-card .intent-actions-row button { flex: 0 1 auto; min-width: 140px; max-width: 260px; }
@media (min-width: 768px) { .tour-brief-card .intent-actions-row button { min-width: 160px; } }
.tour-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.tour-meta { font-size: 0.78rem; color: var(--text-muted); margin: 3px 0 6px; }
.tour-themes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tour-reasons { margin: 0 0 6px; padding-left: 16px; font-size: 0.76rem; color: var(--text-muted); }
.tour-reasons li { margin: 1px 0; }

/* M1 — LocalHotels "more hotels in {city}" deep link on stay cards / day headers */
.more-hotels-link { color: #1d4ed8; font-weight: 600; text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
.more-hotels-link:hover { color: #e63946; text-decoration: underline; }
