: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: #64748b;       /* slate-500 */
    --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; }

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;
}

/* ---------- Chat shell ---------- */
.chat-container {
    max-width: 920px;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    margin: 0 auto;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
@media (min-width: 640px) {
    .chat-container {
        height: 94vh;
        max-height: 920px;
        margin-top: 3vh;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(255,255,255,0.6);
    }
}

/* ---------- Header (glassmorphic) ---------- */
.chat-header {
    background: var(--grad-primary);
    color: #fff;
    padding: 18px 22px 16px;
    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.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.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: 30px; height: 30px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 9px;
    font-size: 16px;
    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: 16px;
    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;
}
.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; }
.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; }

/* ---------- 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; }

/* ---------- 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: 14px 14px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}


/* Quick replies (single-fire action chips) */
.quick-replies {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.quick-reply {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 15px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.18s;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.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; }
.input-container input {
    flex: 1; padding: 13px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 15px; outline: none; min-width: 0;
    background: var(--surface-2);
    transition: all 0.18s;
}
.input-container input:focus {
    border-color: var(--primary-light);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.15);
}
.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); }
.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; }

@media (max-width: 480px) {
    .chat-header h1 { font-size: 1.1rem; }
    .message-content { max-width: 86%; font-size: 14px; padding: 11px 14px; }
    .intent-card, .itinerary-card, .progress-card { margin-left: 0; max-width: 100%; }
    .message-actions { margin-left: 0; }
    .input-container button { padding: 12px 14px; }
    .map-container { height: 300px; }
    .activity-img { width: 56px; height: 56px; }
}

/* ---------- 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;
}
.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; }
.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; }
