/* ============================================================
   TRIP-PLAN PAGE STYLES
   Uses the shared design-system variables from styles.css.
   Only page-specific tokens are defined here.
   ============================================================ */
:root {
    --ocean: #1a8b9e;
    --ocean-light: #b3d9e6;
    --sand: #f5e6d3;
    --radius: 16px;
    --radius-lg: 24px;
    --success: #2a9d8f;
    --error: #e74c3c;
}
[data-theme="dark"] {
    --ocean: #3aa8c9;
    --ocean-light: #1f4a5a;
    --sand: #2d241a;
}

/* ===== TOP CTA STRIP ===== */
.top-cta-strip {
    position: fixed; top: calc(0 + constant(safe-area-inset-top)); left: 0; right: 0; z-index: 19;
    top: calc(0 + env(safe-area-inset-top));
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex; justify-content: center;
    padding: 0.6rem 1rem;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.top-cta-strip-inner {
    display: flex; gap: 0.8rem; align-items: center;
    max-width: 900px; width: 100%; justify-content: space-between;
}
.top-cta-strip a {
    padding: 0.4rem 1.2rem; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: white; font-weight: 600; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.top-cta-strip.is-hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }


/* ---------- HERO ---------- */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
    background: var(--surface-dark);
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.hero .eyebrow {

    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.8rem;
    color: var(--ink);
}
.hero h1 .highlight { color: var(--accent-deep); }
.hero p {
    color: var(--muted);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}
.hero .actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero .btn-hero {
    padding: 0.9rem 2.8rem; border-radius: 50px;
    font-size: 1.1rem; font-weight: 600; border: none; cursor: pointer;
    transition: all 0.3s;
}
.btn-primary-hero { background: var(--accent); color: var(--ink); }
.btn-primary-hero:hover { background: var(--accent-deep); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(232,144,42,0.3); }
.btn-secondary-hero { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-secondary-hero:hover { border-color: var(--accent); background: var(--surface-strong); }

/* ---------- WIZARD ---------- */
.wizard-section { padding: 3rem 0 4rem; background: var(--bg); }
.wizard-container {
    max-width: 780px; margin: 0 auto;
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 2rem 2.5rem;
}
.wizard-progress {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; position: relative;
}
.wizard-progress .step-dot {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.3rem; font-size: 0.75rem; color: var(--muted); flex: 1; position: relative;
}
.wizard-progress .step-dot::before {
    content: ""; position: absolute; top: 14px; left: -50%; right: 50%;
    height: 2px; background: var(--line); z-index: 0;
}
.wizard-progress .step-dot:first-child::before { display: none; }
.wizard-progress .step-dot .circle {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--muted); z-index: 1;
    transition: all 0.3s;
}
.wizard-progress .step-dot.active .circle { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.wizard-progress .step-dot.completed .circle { background: var(--success); border-color: var(--success); color: #fff; }
.wizard-progress .step-dot .label { text-align: center; font-weight: 500; }
.wizard-step { display: none; animation: fadeIn 0.35s ease; }
.wizard-step.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.wizard-step h2 { font-size: 1.6rem; margin-bottom: 0.3rem; color: var(--ink); }
.wizard-step .sub { color: var(--muted); margin-bottom: 1.5rem; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.card-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.card-grid.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.choice-card {
    background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius);
    padding: 1.2rem 1rem; text-align: center; cursor: pointer;
    transition: all 0.25s; display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.choice-card:hover { border-color: var(--accent); }
.choice-card.selected { border-color: var(--accent-deep); background: var(--surface-strong); box-shadow: 0 0 0 3px rgba(255,179,71,0.2); }
.choice-card .icon { font-size: 2.2rem; }
.choice-card .label { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.choice-card .desc { font-size: 0.8rem; color: var(--muted); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.5rem 0 1rem; }
.chip {
    padding: 0.5rem 1.2rem; border-radius: 30px; border: 2px solid var(--line);
    background: var(--bg); cursor: pointer; transition: all 0.25s;
    font-weight: 500; font-size: 0.9rem; color: var(--muted);
}
.chip:hover { border-color: var(--accent); }
.chip.selected { border-color: var(--accent-deep); background: var(--accent); color: var(--ink); }
.budget-slider { width: 100%; margin: 1rem 0; }
.budget-slider input[type="range"] {
    width: 100%; height: 6px; border-radius: 10px; background: var(--line);
    outline: none; -webkit-appearance: none;
}
.budget-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); cursor: pointer; border: 2px solid var(--surface-strong);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.budget-labels { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.budget-value { text-align: center; font-size: 1.8rem; font-weight: 700; color: var(--accent-deep); margin: 0.2rem 0; }
.btn {
    padding: 0.8rem 2rem; border-radius: 12px; border: none;
    font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-deep); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(232,144,42,0.3); }
.btn-secondary { background: var(--surface-strong); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #21867a; transform: translateY(-2px); }
.btn-pdf { background: #d32f2f; color: #fff; }
.btn-pdf:hover { background: #b71c1c; transform: translateY(-2px); }
.btn-group { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.spinner {
    width: 20px; height: 20px; border: 2px solid var(--line);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.notification { padding: 0.8rem 1.2rem; border-radius: 12px; margin-bottom: 1rem; display: none; }
.notification.show { display: block; }
.notification.success { background: rgba(42,157,143,0.12); border: 1px solid rgba(42,157,143,0.25); color: var(--success); }
.notification.error { background: rgba(231,76,60,0.12); border: 1px solid rgba(231,76,60,0.25); color: var(--error); }
.notification.info { background: rgba(255,179,71,0.12); border: 1px solid rgba(255,179,71,0.25); color: var(--accent-deep); }
.generation-messages { margin: 1.5rem 0; }
.gen-msg {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0;
    opacity: 0; transform: translateX(-10px); transition: all 0.4s ease;
}
.gen-msg.show { opacity: 1; transform: translateX(0); }
.gen-msg .icon { font-size: 1.2rem; }
.gen-msg .text { color: var(--ink); }
.itinerary-container { margin-top: 0.5rem; }
.itinerary-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; gap: 1rem; }
.itinerary-header h2 { font-size: 1.6rem; font-weight: 700; margin: 0; color: var(--ink); }
.itinerary-header .badge { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--surface-dark); padding: 0.3rem 1rem; border-radius: 20px; font-size: 0.85rem; color: var(--muted); }
.day-card { background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin-bottom: 1.2rem; transition: all 0.3s; }
.day-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.day-card .day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; flex-wrap: wrap; gap: 0.5rem; }
.day-card .day-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.day-card .day-date { color: var(--muted); font-size: 0.85rem; background: var(--bg); padding: 0.2rem 0.8rem; border-radius: 30px; }
.activity-item { display: flex; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: none; }
.activity-time { font-weight: 600; color: var(--ocean); min-width: 80px; font-size: 0.85rem; }
.activity-desc { flex: 1; }
.activity-desc .name { font-weight: 600; color: var(--ink); }
.activity-desc .detail { color: var(--muted); font-size: 0.85rem; }
.activity-desc .detail a { color: var(--ocean); text-decoration: underline; font-weight: 600; }
.activity-desc .detail a:hover { color: var(--accent-deep); }
.activity-agent { font-size: 0.7rem; color: var(--muted); background: var(--bg); padding: 0.1rem 0.6rem; border-radius: 10px; display: inline-block; margin-top: 0.2rem; }
.recommendation-card { background: var(--bg); border-radius: 12px; padding: 0.8rem 1rem; margin: 0.6rem 0 0.6rem 2.5rem; border-left: 3px solid var(--accent); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; }
.recommendation-card .rec-info { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.recommendation-card .rec-icon { font-size: 1.4rem; }
.recommendation-card .rec-name { font-weight: 600; color: var(--ink); }
.recommendation-card .rec-detail { color: var(--muted); font-size: 0.85rem; }
.recommendation-card .rec-rating { color: var(--accent-deep); font-weight: 600; }
.recommendation-card .rec-price { color: var(--ink); font-weight: 700; }
.rec-btn { padding: 0.3rem 1rem; border-radius: 20px; border: 1px solid var(--accent); background: transparent; color: var(--accent-deep); font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.3s; white-space: nowrap; }
.rec-btn:hover { background: var(--accent); color: var(--ink); }
.rec-btn.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.rec-btn.primary:hover { background: var(--accent-deep); color: #fff; }
.flight-section { background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin-top: 1.5rem; }
.flight-section h4 { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.flight-route { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.flight-route .airport { font-weight: 600; color: var(--ink); }
.flight-route .arrow { color: var(--muted); font-size: 1.2rem; }
.flight-route .date { color: var(--muted); font-size: 0.85rem; }
.share-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share-buttons { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.share-btn { padding: 0.4rem 1.2rem; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; transition: all 0.3s; font-size: 0.85rem; }
.share-btn:hover { border-color: var(--accent); background: var(--surface-strong); }
.ai-assistant {
    position: fixed; bottom: 28px; right: 28px; z-index: 50;
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--surface-strong); border: 1px solid var(--line);
    border-radius: 40px; padding: 0.6rem 1.2rem 0.6rem 0.6rem;
    box-shadow: var(--shadow); cursor: pointer; transition: all 0.3s;
}
.ai-assistant:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.ai-assistant .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.ai-assistant .label { font-weight: 600; color: var(--ink); }
.ai-assistant .sub { font-size: 0.7rem; color: var(--muted); }

/* ---------- CHAT MODAL ---------- */
.chat-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.chat-modal-overlay.open { opacity: 1; visibility: visible; }
.chat-modal { width: min(420px, 90vw); max-height: 80vh; background: var(--surface-strong); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-header h3 { margin: 0; font-size: 1.1rem; color: var(--ink); }
.chat-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; padding: 0.2rem; line-height: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.chat-message { display: flex; gap: 0.6rem; max-width: 85%; }
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-message .bubble { padding: 0.7rem 1rem; border-radius: 1.2rem; background: var(--bg); color: var(--ink); font-size: 0.9rem; line-height: 1.4; }
.chat-message.user .bubble { background: var(--accent); color: var(--ink); }
.chat-message .avatar-icon { font-size: 1.5rem; align-self: flex-end; }
.chat-input-area { display: flex; gap: 0.5rem; padding: 0.8rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input-area input { flex: 1; padding: 0.7rem 1rem; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; outline: none; }
.chat-input-area button { background: var(--accent); border: none; color: var(--ink); border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; transition: background 0.2s; }
.chat-input-area button:hover { background: var(--accent-deep); color: white; }
.chat-input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
.typing-indicator { display: flex; gap: 0.4rem; padding: 0.7rem 1rem; align-items: center; }
.typing-indicator span { width: 8px; height: 8px; background: var(--muted); border-radius: 50%; animation: typing 1.4s infinite ease-in-out; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
.chat-message .bubble ul, .chat-message .bubble ol { margin: 0.3rem 0 0.3rem 1rem; padding-left: 1rem; }
.chat-message .bubble li { margin-bottom: 0.15rem; }
.chat-message .bubble a { color: var(--ocean); text-decoration: underline; font-weight: 600; }
.chat-message .bubble a:hover { color: var(--accent-deep); }

/* ---------- SOLO OPTIONS ---------- */
.solo-options { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.solo-options h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--ink); }
.solo-options .option-group { margin-bottom: 1rem; }
.solo-options .option-group label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--muted); }
.solo-options .radio-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.solo-options .radio-group label { display: flex; align-items: center; gap: 0.3rem; font-weight: normal; color: var(--ink); cursor: pointer; }
.solo-options .radio-group input[type="radio"] { accent-color: var(--accent); }

/* ---------- FAQ ---------- */
.faq-section { padding: 4rem 0; background: var(--surface); border-top: 1px solid var(--line); }
.faq-section h2 { text-align: center; font-size: 2rem; color: var(--ink); margin-bottom: 2.5rem; }
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.faq-item { background: var(--bg); border-radius: var(--radius); padding: 1.2rem 1.5rem; border: 1px solid var(--line); }
.faq-question { font-weight: 700; font-size: 1.1rem; color: var(--ocean); margin-bottom: 0.4rem; }
.faq-answer { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .wizard-container { padding: 1.5rem 1.2rem; }
    .wizard-progress .step-dot .label { display: none; }
    .card-grid, .card-grid.three, .card-grid.four { grid-template-columns: 1fr 1fr; }
    .recommendation-card { margin-left: 0; flex-direction: column; align-items: stretch; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; justify-content: center; }
    .itinerary-header { flex-direction: column; align-items: flex-start; }
    .activity-item { flex-wrap: wrap; }
    .activity-time { min-width: 60px; }
}
@media (max-width: 480px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.8rem; }
    .wizard-container { padding: 1rem; }
    .card-grid, .card-grid.three, .card-grid.four { grid-template-columns: 1fr; }
    .choice-card { padding: 0.8rem; }
    .chip { font-size: 0.8rem; padding: 0.4rem 1rem; }
    .day-card { padding: 1rem; }
    .ai-assistant { bottom: 16px; right: 16px; padding: 0.4rem 1rem 0.4rem 0.4rem; }
    .ai-assistant .label { display: none; }
    .chat-modal { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .chat-modal .chat-header {
        padding-top: calc(1rem + constant(safe-area-inset-top));
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    .chat-modal .chat-input-area {
        padding-bottom: calc(0.8rem + constant(safe-area-inset-bottom));
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
    }
}

/* ============================================================
   GUEST LOCK (signed-out visitors)
   ============================================================ */
.guest-lock-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    background: rgba(232, 93, 4, 0.1);
    border: 1px solid rgba(232, 93, 4, 0.28);
    color: var(--ocean);
    font-weight: 600;
    font-size: 0.98rem;
}
.guest-lock-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Disabled state for the wizard while signed out */
.wizard-section.is-guest .wizard-step input,
.wizard-section.is-guest .wizard-step select,
.wizard-section.is-guest .wizard-step textarea,
.wizard-section.is-guest .wizard-step .choice-card,
.wizard-section.is-guest .wizard-step .chip,
.wizard-section.is-guest .wizard-step .btn {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}
.wizard-section.is-guest .wizard-step .btn-primary,
.wizard-section.is-guest .wizard-step .btn-success {
    opacity: 0.5;
}

/* Disabled chat input for signed-out visitors */
.chat-input-area.is-guest input,
.chat-input-area.is-guest button {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   CREDIT COST BOX (premium AI Trip Planner)
   ============================================================ */
.credit-cost-box {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 179, 71, 0.1);
    border: 1px solid rgba(255, 179, 71, 0.3);
}
.credit-cost-icon {
    font-size: 1.6rem;
    line-height: 1;
}
.credit-cost-title {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.95rem;
}
.credit-cost-detail {
    color: var(--muted);
    font-size: 0.85rem;
}
.credit-cost-detail strong {
    color: var(--accent-deep);
}
.credit-balance-info {
    font-weight: 600;
}

/* ============================================================
   RECOMMENDED VERIFIED GUIDES (Guide Ranking agent output)
   ============================================================ */
.guides-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}
.guides-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.guides-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}
.guide-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: all 0.3s;
}
.guide-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.guide-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    overflow: hidden;
}
.guide-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.guide-avatar-initials {
    font-weight: 700;
    color: var(--accent);
}
.guide-info {
    flex: 1;
    min-width: 0;
}
.guide-name {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.98rem;
}
.guide-meta {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.1rem;
}
.guide-trust {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(42, 157, 143, 0.12);
    color: var(--success);
    border: 1px solid rgba(42, 157, 143, 0.3);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.guide-reviews {
    color: var(--muted);
    font-size: 0.78rem;
}
.guide-link {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent-deep);
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s;
}
.guide-link:hover {
    background: var(--accent);
    color: var(--ink);
}

@media (max-width: 480px) {
    .guide-card {
        flex-wrap: wrap;
    }
    .guide-link {
        width: 100%;
        text-align: center;
    }
}

/* ===== TRIP MAP ===== */
.trip-map-section {
    margin-top: 1.5rem;
}
.trip-map-section h4 {
    margin-bottom: 0.6rem;
    color: var(--ink);
}
#trip-map {
    height: 450px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
}
#trip-distance {
    margin-top: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}
/* Leaflet popup theming to match the dark design system */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--surface);
    color: var(--ink);
}
.leaflet-popup-content {
    font-size: 0.85rem;
    line-height: 1.4;
}
.leaflet-popup-content b {
    color: var(--accent-deep);
}
.leaflet-container {
    font-family: inherit;
}

/* ============================================================
   BUDGET SUMMARY + CONFIRMATION FLOW
   Renders the Worker's budget_analysis, feasibility_score,
   and warnings inside the itinerary output.
   ============================================================ */
.budget-summary-section {
    margin-top: 1.5rem;
}
.budget-summary {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
}
.budget-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.budget-summary-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}
.budget-summary-sub {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.15rem;
}
.budget-status {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}
.budget-figures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.budget-figure {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    text-align: center;
}
.budget-figure-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.budget-figure-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-top: 0.2rem;
}
.budget-breakdown {
    margin-bottom: 0.8rem;
}
.budget-bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}
.budget-bar span {
    height: 100%;
    min-width: 2px;
}
.budget-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.budget-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.budget-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.budget-warnings {
    margin: 0.8rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.warning-group {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
}
.warning-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.warning-group-title i {
    width: 14px;
    height: 14px;
    color: var(--accent-deep);
}

.warning-group ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.warning-group li {
    margin-bottom: 0.3rem;
}
.warning-group li:last-child {
    margin-bottom: 0;
}

.budget-confirm {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: var(--ink);
    font-size: 0.9rem;
}
.budget-confirm p {
    margin: 0 0 0.8rem;
}
.budget-confirm-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.budget-confirm-actions .btn {
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
}
@media (max-width: 560px) {
    .budget-figures {
        grid-template-columns: 1fr;
    }
    .budget-summary-head {
        flex-direction: column;
    }
}

/* ============================================================
   GUIDE PREVIEW MODAL
   Reusable in-page modal for inspecting and booking a guide
   without leaving the trip-plan page.
   ============================================================ */
.guide-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.guide-modal-overlay.open {
    display: flex;
}
.guide-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 1.5rem;
}
.guide-modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.guide-modal-close:hover {
    background: var(--accent);
    color: var(--ink);
}
.guide-modal-loading {
    text-align: center;
    color: var(--muted);
    padding: 2rem 1rem;
}

/* Hero */
.guide-modal-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}
.guide-modal-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    flex: 0 0 72px;
    overflow: hidden;
}
.guide-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.guide-modal-hero-info {
    flex: 1;
    min-width: 0;
}
.guide-modal-hero-info h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.guide-modal-hero-info p {
    margin: 0.15rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    border-radius: 50%;
    background: #1d9bf0;
    color: #fff;
    font-size: 0.7em;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
}
.guide-modal-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}
.gm-stat {
    text-align: center;
}
.gm-stat .num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
}
.gm-stat .lbl {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Tabs */
.guide-modal-tabs {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}
.gm-tab {
    background: none;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.gm-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.gm-panel {
    display: none;
}
.gm-panel.active {
    display: block;
}

/* Overview */
.gm-section {
    margin-bottom: 1rem;
}
.gm-section h4 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: var(--ink);
}
.gm-bio {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.9rem;
}
.gm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.gm-tags span {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.gm-trust-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}
.gm-trust-num {
    font-size: 1.6rem;
    font-weight: 800;
}
.gm-trust-num.green { color: #2ecc71; }
.gm-trust-num.blue { color: #1d9bf0; }
.gm-trust-num.orange { color: #e67e22; }
.gm-trust-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}
.gm-trust-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}
.gm-trust-fill.green { background: #2ecc71; }
.gm-trust-fill.blue { background: #1d9bf0; }
.gm-trust-fill.orange { background: #e67e22; }
.gm-reliability {
    list-style: none;
    margin: 0;
    padding: 0;
}
.gm-reliability li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    color: var(--ink);
    font-size: 0.9rem;
}
.gm-reliability li .check {
    color: #2ecc71;
    font-weight: 800;
}

/* Reviews */
.gm-reviews-list {
    max-height: 260px;
    overflow-y: auto;
}
.gm-review-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
}
.gm-review-card:last-child {
    margin-bottom: 0;
}
.gm-review-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}
.gm-review-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex: 0 0 30px;
    overflow: hidden;
}
.gm-review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gm-review-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.9rem;
}
.gm-review-stars {
    color: #f4a261;
    font-size: 0.85rem;
}
.gm-review-date {
    color: var(--muted);
    font-size: 0.75rem;
    margin-left: auto;
}
.gm-review-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Availability calendar */
.gm-calendar {
    margin-bottom: 0.6rem;
}
.gm-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.gm-calendar-head button {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    font: inherit;
}
.gm-calendar-head .cal-title {
    font-weight: 700;
    color: var(--ink);
}
.gm-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}
.gm-cal-dow {
    text-align: center;
    color: var(--muted);
    font-size: 0.7rem;
    padding: 0.2rem 0;
}
.gm-cal-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: default;
    border: 1px solid transparent;
}
.gm-cal-day.available {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    cursor: pointer;
}
.gm-cal-day.available:hover {
    border-color: #2ecc71;
}
.gm-cal-day.unavailable {
    background: var(--bg);
    color: var(--muted);
}
.gm-cal-day.booked {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}
.gm-cal-day.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--ink);
    font-weight: 700;
}
.gm-cal-day.blank {
    visibility: hidden;
}
.gm-cal-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.gm-cal-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.gm-cal-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.gm-cal-legend .dot.green { background: #2ecc71; }
.gm-cal-legend .dot.gray { background: var(--muted); }
.gm-cal-legend .dot.red { background: #e74c3c; }
.gm-avail-msg {
    font-size: 0.85rem;
    margin-top: 0.4rem;
}
.gm-avail-msg.ok { color: #2ecc71; }
.gm-avail-msg.bad { color: #e74c3c; }

/* Booking form */
.gm-booking {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.gm-booking h4 {
    margin: 0 0 0.8rem;
    font-size: 1rem;
    color: var(--ink);
}
.gm-form-field {
    margin-bottom: 0.8rem;
}
.gm-form-field label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.gm-form-field select,
.gm-form-field textarea {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
.gm-form-field textarea {
    resize: vertical;
    min-height: 60px;
}
.gm-booked-note {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.5;
}
.gm-booked-note .gm-booked-date {
    font-weight: 700;
    color: #2ecc71;
}

@media (max-width: 480px) {
    .guide-modal {
        padding: 1rem;
    }
    .guide-modal-hero {
        flex-direction: column;
        text-align: center;
    }
    .guide-modal-stats {
        justify-content: center;
    }
}



