/* ================================
   LAB - LABORATORY SPLIT VIEW STYLES
   Tema chiaro — coerentemente con index.html
   ================================ */

/* --- Body --- */
body.lab-body {
    background: var(--bg-primary);
    overflow: hidden;
}

/* --- Navbar Laboratory (dark glass - same as index.html) --- */
.lab-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 0;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
    height: auto;
    min-height: 60px;
}

.lab-navbar .mobile-menu-btn {
    display: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 8px;
}

.lab-navbar .nav-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    height: 100%;
    flex-shrink: 0;
}

.lab-navbar .nav-logo img {
    height: 38px;
    width: auto;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

.lab-navbar .nav-logo span {
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.4rem);
    line-height: 1;
    margin: 0;
    padding-top: 2px;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lab-navbar .nav-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    margin: 0 1rem;
}

.lab-badge {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.08) 0%, rgba(61, 220, 132, 0.08) 100%);
    border: 1px solid rgba(0, 168, 232, 0.25);
    color: var(--primary-sky);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lab-badge i {
    font-size: 0.9rem;
}

.lab-navbar .nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.lab-navbar .nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
}

.lab-navbar .nav-links a:not(.subscribe-btn):hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--primary-sky);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.1);
}

.lab-navbar .subscribe-btn {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 173, 85, 0.1));
    border: 1px solid var(--primary-sky);
    color: var(--primary-sky);
    font-weight: 600;
    padding: 0.5rem 0.9rem;
}

.lab-navbar .subscribe-btn:hover {
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.lab-navbar .nav-home-link {
    color: var(--primary-sky);
    background: rgba(0, 168, 232, 0.08);
    border: 1px solid rgba(0, 168, 232, 0.25);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.lab-navbar .nav-home-link:hover {
    background: var(--primary-sky);
    color: #fff;
}

/* Auth buttons in navbar */
.lab-navbar .auth-btn-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: all 0.25s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.lab-navbar .auth-btn-link:hover {
    color: var(--primary-sky);
    background: rgba(0, 168, 232, 0.06);
    border-color: rgba(0, 168, 232, 0.2);
}

.lab-navbar .auth-btn-link.highlight {
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    font-weight: 600;
    border: none;
}

.lab-navbar .auth-btn-link.highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 168, 232, 0.35);
}

/* --- Main Split View --- */
.lab-main {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
}

/* --- Left Panel --- */
.lab-left-panel {
    width: 40%;
    min-width: 400px;
    max-width: none;
    background: #ffffff;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.lab-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.lab-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lab-title i {
    font-size: 1.2rem;
    color: var(--primary-sky);
}

.lab-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* --- New Chat Button --- */
.new-chat-btn {
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.new-chat-btn:hover {
    background: var(--primary-sky);
    color: #fff;
    border-color: var(--primary-sky);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.25);
}

/* --- Welcome Screen Lab --- */
.lab-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lab-welcome .welcome-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lab-welcome .welcome-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.lab-welcome .welcome-header h1 .user-firstName {
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lab-welcome .welcome-header h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
}

.lab-welcome .sparkle-icon {
    font-size: 2rem;
    color: var(--primary-sky);
    margin-bottom: 0.75rem;
    display: block;
}

.lab-welcome .suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.lab-welcome .suggestion-pill {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.lab-welcome .suggestion-pill:hover {
    background: #f8fafc;
    border-color: rgba(0, 168, 232, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.lab-welcome .pill-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    flex-shrink: 0;
}

.lab-welcome .pill-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

.lab-welcome .pill-text span {
    color: var(--text-muted);
    font-weight: 400;
}

/* Il titolo della scheda («Pacchetto Completo») e' il primo span: in grigio
   come il sottotitolo non si distingueva (visto su iPhone, 2026-10-18). */
.lab-welcome .pill-text span:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Niente riquadro grigio di Safari al tocco su schede e pulsanti. */
.lab-welcome .suggestion-pill,
.search-form-container button,
.search-form-container input,
.search-form-container select,
.lab-navbar button {
    -webkit-tap-highlight-color: transparent;
}

/* Welcome input bar */
.lab-welcome .welcome-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
    padding: 10px 16px;
    background: #fff;
    border: 1.5px solid rgba(0, 168, 232, 0.25);
    border-radius: 50px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.lab-welcome .welcome-input-bar:focus-within {
    border-color: rgba(0, 168, 232, 0.6);
    box-shadow: 0 4px 24px rgba(0, 168, 232, 0.1);
}

.welcome-chat-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
}

.welcome-chat-textarea::placeholder {
    color: var(--text-muted);
}

.welcome-send-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 168, 232, 0.4);
}

/* --- Workspace Right Panel --- */
/* ATTENZIONE: questa non e' la regola che comanda. Piu' sotto, nel blocco
   "UNIFIED WORKSPACE CARD", `.lab-right-workspace` viene ridefinita con
   `flex: 1`, che essendo dopo vince su tutto quello che sta qui — compresa
   questa larghezza. La chiusura del pannello e' scritta li'. */
.lab-right-workspace {
    width: 60%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-warm);
}

/* --- Map Area --- */
.workspace-map-area {
    height: 50%;
    min-height: 250px;
    position: relative;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-light);
    transition: height 0.4s ease;
}

.workspace-map-area.collapsed {
    height: 0;
    min-height: 0;
    border-bottom: none;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 100%;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 0.75rem;
    background: #f8fafc;
}

.map-placeholder i {
    font-size: 2.5rem;
    opacity: 0.4;
}

.map-placeholder p {
    font-size: 0.85rem;
    max-width: 260px;
    text-align: center;
    line-height: 1.5;
}

/* --- Table Area --- */
.workspace-table-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.workspace-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.workspace-table-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-table-header h3 i {
    color: var(--primary-sky);
}

.table-header-actions {
    display: flex;
    gap: 0.5rem;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.table-action-btn:hover {
    background: var(--primary-sky);
    color: #fff;
    border-color: var(--primary-sky);
}

.itinerary-matrix-container {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.itinerary-workspace-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.matrix-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 0.75rem;
}

.matrix-placeholder i {
    font-size: 2.5rem;
    opacity: 0.4;
}

.matrix-placeholder p {
    font-size: 0.85rem;
    max-width: 220px;
    text-align: center;
    line-height: 1.5;
}

/* --- Agent Loading Container --- */
.agent-loading-container {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* --- Chat Container Lab --- */
.lab-left-panel .chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.lab-left-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

.lab-left-panel .message {
    max-width: 95%;
    animation: fadeIn 0.3s ease;
}

.lab-left-panel .message-content {
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.lab-left-panel .ai-message .message-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.lab-left-panel .user-message .message-content {
    background: linear-gradient(135deg, var(--primary-sky), #00c6ff);
    color: #fff;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

/* --- Chat Input Area (light) --- */
.lab-left-panel .chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.lab-left-panel .chat-input-area textarea {
    flex: 1;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #f8fafc;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lab-left-panel .chat-input-area textarea:focus {
    border-color: rgba(0, 168, 232, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.08);
}

.lab-left-panel .chat-input-area textarea::placeholder {
    color: var(--text-muted);
}

.lab-left-panel #send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.lab-left-panel #send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 168, 232, 0.4);
}

.lab-left-panel #save-trip-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lab-left-panel #save-trip-btn:hover {
    background: var(--primary-green);
    color: #fff;
    border-color: var(--primary-green);
}

.lab-left-panel #save-trip-btn.visible {
    display: flex;
}

.lab-left-panel #share-trip-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lab-left-panel #share-trip-btn:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.lab-left-panel #share-trip-btn.visible {
    display: flex;
}

/* Prompt guide container */
.prompt-guide-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary-sky);
    border-color: rgba(0, 168, 232, 0.3);
}

/* Info banner */
.info-banner {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    z-index: 10;
    min-width: 300px;
}

.info-banner .banner-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.info-banner .banner-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-banner .banner-content ul li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.info-banner .banner-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-sky);
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary-sky);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* --- Travel Summary (Streaming Itinerary) --- */
.travel-summary {
    background: #fff !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
}

.travel-summary .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.travel-summary .section-title i {
    color: var(--primary-sky);
}

/* --- Itinerary Matrix Streaming (in chat) --- */
.itinerary-matrix {
    display: flex;
    gap: 12px;
    min-width: max-content;
}

.matrix-day-column {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
}

.matrix-day-header {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.08), rgba(61, 220, 132, 0.06));
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-sky);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-light);
}

.matrix-day-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

/* --- Matrix Card --- */
.matrix-card {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: cardSlideIn 0.35s ease forwards;
}

.matrix-card:hover {
    background: #fff;
    border-color: rgba(0, 168, 232, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.matrix-card.dragging {
    opacity: 0.5;
    transform: scale(0.97);
}

.matrix-card-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
}

.matrix-card h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0 2px;
    line-height: 1.3;
}

.matrix-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matrix-time-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.matrix-time-badge.morning {
    background: rgba(0, 168, 232, 0.1);
    color: #0077b6;
}

.matrix-time-badge.afternoon {
    background: rgba(251, 191, 36, 0.12);
    color: #b8860b;
}

.matrix-time-badge.evening {
    background: rgba(124, 92, 231, 0.1);
    color: #6d28d9;
}

.matrix-card-icon-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 168, 232, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

/* Full-width placeholder for activity cards missing photos */
.matrix-day-body .matrix-card-icon-placeholder[style*="90px"],
.workspace-matrix .matrix-card-icon-placeholder[style*="90px"] {
    width: 100% !important;
    height: 90px !important;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    color: #94a3b8 !important;
    font-size: 2rem !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
}

.matrix-card-icon-placeholder i {
    font-size: 1rem;
    color: var(--primary-sky);
}

.matrix-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.matrix-action-btn {
    /* flex-basis sul contenuto, non 0: con "flex: 1" i due pulsanti si
       spartivano meta' e meta', e in tedesco "Tickets & Touren" andava a capo
       tre volte accanto a "Karte" su una riga sola. Cosi' ognuno prende la
       larghezza che gli serve, e la riga resta alta uguale in tutte le lingue. */
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.matrix-action-btn.btn-map {
    background: rgba(0, 168, 232, 0.08);
    color: var(--primary-sky);
    border: 1px solid rgba(0, 168, 232, 0.2);
}

.matrix-action-btn.btn-map:hover {
    background: rgba(0, 168, 232, 0.18);
}

.matrix-action-btn.btn-ticket {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.matrix-action-btn.btn-ticket:hover {
    background: rgba(245, 158, 11, 0.18);
}

/* Sostituisce "Biglietti" sui pasti (Pranzo/Cena): niente biglietto da
   caricare, ma un ristorante vero da scegliere → tab Cibo con quel
   giorno/pasto già collegato (verde brand, non l'ambra dei biglietti). */
.matrix-action-btn.btn-meal-choose {
    background: rgba(61, 220, 132, 0.1);
    color: #059669;
    border: 1px solid rgba(61, 220, 132, 0.25);
}

.matrix-action-btn.btn-meal-choose:hover {
    background: rgba(61, 220, 132, 0.2);
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Trip Cost Banner --- */
.trip-cost-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.04), rgba(61, 220, 132, 0.04));
    border: 1px solid rgba(0, 168, 232, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 1rem;
}

.cost-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cost-banner-left i {
    font-size: 1.4rem;
    color: var(--primary-sky);
}

.cost-banner-left .cost-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.cost-banner-left .cost-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}

.cost-banner-left .cost-disclaimer {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    font-style: italic;
}

.cost-banner-right {
    text-align: right;
}

.cost-banner-right .budget-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cost-banner-right .budget-status {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 2px;
}

.cost-banner-right.within-budget .budget-status {
    color: var(--primary-green);
}

.cost-banner-right.over-budget .budget-status {
    color: #ef4444;
}

/* --- Workspace Matrix --- */
.workspace-matrix {
    display: flex;
    gap: 14px;
    min-width: max-content;
}

.workspace-matrix .matrix-day-column {
    width: 220px;
}

.workspace-matrix .matrix-day-header {
    font-size: 0.8rem;
    padding: 10px 14px;
}

.workspace-matrix .matrix-day-body {
    padding: 10px;
}

.workspace-matrix .matrix-card {
    padding: 12px;
}

.workspace-matrix .matrix-card h4 {
    font-size: 0.88rem;
}

.workspace-matrix .matrix-desc {
    font-size: 0.75rem;
}

.workspace-matrix .matrix-card-img {
    height: 100px;
}

.workspace-matrix .matrix-action-btn {
    padding: 5px 10px;
    font-size: 0.68rem;
}

/* ================================
   AUTH MODAL (LIGHT THEME)
   ================================ */

.lab-body .auth-modal-overlay {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
}

.lab-body .auth-modal {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.lab-body .auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.lab-body .auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: 'Poppins', sans-serif;
}

.lab-body .auth-tab.active {
    color: var(--primary-sky);
    border-bottom-color: var(--primary-sky);
}

.lab-body .auth-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.lab-body .auth-input-group:focus-within {
    border-color: rgba(0, 168, 232, 0.5);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.08);
}

/* Selettore `> i:first-child` (specificità 0,3,1) per battere auth.css
   `.auth-input-group > i:first-child` (0,2,1), che è caricato DOPO e altrimenti
   vincerebbe rendendo l'icona assoluta → sovrapposta al testo nel tema lab. */
.lab-body .auth-input-group > i:first-child {
    color: var(--primary-sky);
    font-size: 0.9rem;
    /* Nel lab l'icona è un elemento flex (il group ha gap), NON assoluta. */
    position: static;
    transform: none;
    left: auto;
    top: auto;
}

.lab-body .auth-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 12px 0;
    font-family: 'Poppins', sans-serif;
}

.lab-body .auth-input::placeholder {
    color: var(--text-muted);
}

.lab-body .auth-input-with-toggle {
    padding-right: 8px;
}

.lab-body .password-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.lab-body .password-toggle-btn:hover {
    color: var(--primary-sky);
}

.lab-body .auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: 'Poppins', sans-serif;
    margin-top: 4px;
}

.lab-body .auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 168, 232, 0.3);
}

.lab-body .auth-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    text-align: center;
}

.lab-body .auth-message.error {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.lab-body .auth-message.success {
    background: rgba(61, 220, 132, 0.08);
    color: #16a34a;
    border: 1px solid rgba(61, 220, 132, 0.2);
}

.lab-body .auth-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lab-body .auth-close-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Gatekeeper Modal */
.gatekeeper-content {
    text-align: center;
    padding: 2rem;
}

.gatekeeper-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.08), rgba(61, 220, 132, 0.08));
    border: 1px solid rgba(0, 168, 232, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.gatekeeper-icon i {
    font-size: 1.5rem;
    color: var(--primary-sky);
}

/* ================================
   USER MENU (LIGHT THEME)
   ================================ */

.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 25px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.user-menu-container:hover {
    background: #fff;
    border-color: rgba(0, 168, 232, 0.3);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: rgba(0, 168, 232, 0.06);
    color: var(--primary-sky);
}

.user-dropdown-item i {
    width: 16px;
    color: var(--text-muted);
}

/* ================================
   LANGUAGE SELECTOR (LIGHT)
   ================================ */

.lab-navbar .lang-selector select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #fff;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.lab-navbar .lang-selector select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

.lab-navbar .lang-selector select:focus {
    border-color: var(--primary-sky);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.lab-navbar .lang-selector select option {
    background: var(--dark-blue);
    color: #fff;
}

/* ================================
   MY TRIPS PANEL (LIGHT)
   ================================ */

.my-trips-panel {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    max-height: 200px;
    overflow-y: auto;
    flex-shrink: 0;
}

.my-trips-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.my-trips-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.my-trips-close-btn:hover {
    color: var(--text-primary);
}

.my-trips-list {
    padding: 0.5rem;
}

.my-trips-loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.my-trip-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}

.my-trip-item:hover {
    background: #fff;
}

.my-trip-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.my-trip-item-dates {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ================================
   BUDGET EXCEEDED MODAL
   ================================ */

.budget-inline-card {
    background: #fff;
    border: 1px solid #fbbf24;
    border-radius: 14px;
    padding: 1rem;
    margin: 0.5rem 1rem;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.15);
}

.budget-inline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.budget-inline-icon {
    color: #f59e0b;
    font-size: 1.3rem;
}

.budget-inline-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.budget-inline-body {
    margin-bottom: 0.75rem;
}

.budget-inline-message {
    color: var(--text-primary);
    font-size: 0.88rem;
    margin: 0 0 4px 0;
}

.budget-overage-value {
    color: #ef4444;
    font-weight: 700;
}

.budget-inline-sub {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

.budget-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ================================
   MAP LEGEND (LIGHT)
   ================================ */

.map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.75rem;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-line {
    width: 14px;
    height: 2px;
    border-radius: 1px;
}

/* --- AmeryGo Map Markers --- */
.amerygo-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.amerygo-marker.active {
    transform: scale(1.3);
    z-index: 10;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
    .lab-left-panel {
        width: 40%;
        min-width: 320px;
    }
    .lab-navbar {
        top: 15px;
        padding: 0.7rem 1.2rem;
        max-width: 95%;
        /* Centrata: con left:0 e larghezza 95% restava attaccata a sinistra. */
        right: 0;
        margin-inline: auto;
    }
}

@media (max-width: 768px) {
    .lab-navbar {
        top: 10px;
        width: 95%;
        padding: 0.6rem 1rem;
        border-radius: 30px;
        /* Sulla chat bianca il vetro al 65% diventava grigio: blu notte
           pieno come la navbar della home. */
        background: rgba(15, 23, 42, 0.92);
    }

    .lab-navbar .mobile-menu-btn {
        display: block;
        color: #fff;
    }

    .lab-navbar .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% + 2rem);
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1.5rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        gap: 0.8rem;
        margin-top: 10px;
    }

    .lab-navbar .nav-links.active {
        display: flex;
    }

    .lab-navbar .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .lab-main {
        flex-direction: column;
    }

    .lab-left-panel {
        width: 100%;
        min-width: auto;
        max-width: none;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .lab-right-workspace {
        height: 50vh;
    }
}

@media (max-width: 480px) {
    .lab-navbar {
        padding: 0.5rem 0.8rem;
    }

    .lab-navbar .nav-logo img {
        height: 32px;
    }

    .lab-navbar .nav-logo span {
        font-size: clamp(0.85rem, 6vw, 1rem);
    }

    .lab-navbar .lab-badge {
        display: none;
    }

    .lab-welcome .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .lab-navbar .user-name {
        display: none;
    }
}

/* ================================
   CONFIRM BUTTONS
   ================================ */
.lab-body .confirm-activities-btn,
.lab-body .btn-confirm-selection {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.lab-body .confirm-activities-btn:hover,
.lab-body .btn-confirm-selection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 232, 0.35);
}

.lab-body .confirm-activities-btn:disabled,
.lab-body .btn-confirm-selection:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lab-body .select-btn,
.lab-body .btn-primary {
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lab-body .select-btn:hover,
.lab-body .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.3);
}

/* ================================
   BUDGET SUMMARY GRID (CONSOLIDATED)
   ================================ */
.lab-body .budget-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.04), rgba(61, 220, 132, 0.04));
    border: 1px solid rgba(0, 168, 232, 0.12);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.lab-body .budget-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lab-body .budget-summary-item.total {
    grid-column: 1 / -1;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 168, 232, 0.1);
}

.lab-body .budget-summary-item.grand-total {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 168, 232, 0.1);
    font-weight: 700;
}

.lab-body .budget-summary-item.over,
.lab-body .budget-summary-item.savings {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lab-body .budget-summary-item.over { color: #ef4444; }
.lab-body .budget-summary-item.savings { color: var(--primary-green); }

.lab-body .budget-summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.lab-body .budget-summary-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}

/* ================================
   TRANSPORT CARDS IN MATRIX
   ================================ */
.workspace-matrix .matrix-card {
    min-height: 80px;
}

.workspace-matrix .matrix-card.transport-card {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.05), rgba(61, 220, 132, 0.05));
    border: 1px solid rgba(0, 168, 232, 0.15);
}

.workspace-matrix .transport-card .transport-icon {
    color: var(--primary-sky);
    font-size: 1.2rem;
}

.workspace-matrix .transport-card .transport-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-sky);
    font-weight: 700;
}

/* ================================
   TRIPS MODAL (replaces slide panel)
   ================================ */
.trips-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trips-modal-overlay.hidden {
    display: none;
}

.trips-modal-card {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.trips-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: #f8fafc;
    flex-shrink: 0;
}

.trips-modal-header h3 {
    font-family: 'Playfair Display', serif;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trips-modal-header h3 i {
    color: var(--primary-sky);
}

.trips-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}

.trips-modal-close:hover {
    color: var(--text-primary);
}

.trips-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.trips-modal-item {
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    background: #fafbfc;
}

.trips-modal-item:hover {
    background: #fff;
    border-color: var(--primary-sky);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.1);
}

.trips-modal-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trips-modal-item-dates {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.trips-modal-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.trips-modal-item-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.trips-modal-item-btn.primary {
    background: var(--primary-sky);
    color: #fff;
}

.trips-modal-item-btn.primary:hover {
    background: #0090c0;
}

.trips-modal-item-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.trips-modal-item-btn.secondary:hover {
    border-color: var(--primary-sky);
    color: var(--primary-sky);
}

/* ================================
   UNIFIED WORKSPACE CARD
   ================================ */
/* Il pannello destro non e' piu' mezzo schermo sempre acceso: nasce chiuso
   e si apre quando ha davvero qualcosa dentro (l'itinerario generato, la
   lavagna del motore a step) — sezione D della spec
   docs/superpowers/specs/2026-09-10-viaggio-motore-a-step-design.md.
   Ad accendere `workspace-open` sul body e' 10-canvas.js, che gia' osserva
   quei contenitori: un posto solo, che guarda cosa c'e' invece di farselo
   dire dai nove punti che mostrano l'itinerario.
   Questa e' l'ULTIMA definizione di .lab-right-workspace del file: quella
   piu' in alto, con width 60%, non comanda piu' niente. */
.lab-right-workspace {
    flex: 0 0 0;
    width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-warm);
    padding: 0;
    transition: flex-basis .35s ease, width .35s ease;
}

/* La chat: il lato che deve ALLARGARSI. Fino al 2026-09-14 restava
   `width: 40%` (la definizione in cima al file) anche col pannello destro
   chiuso: il titolare apriva il Laboratorio e trovava la chat schiacciata a
   sinistra e il 60% dello schermo bianco. Chiudere un lato non allarga
   l'altro da solo: va scritto. Longhand (flex-grow, ...) e non `flex`, cosi'
   il collaudo tests/js/laboratorio_larghezza.js li legge davvero. */
.lab-left-panel {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    width: auto;
    min-width: 0;
    border-right: none;
    transition: flex-basis .35s ease, width .35s ease;
}

/* La divisione nasce solo quando si apre la lavagna, e solo su schermo
   largo. Sotto i 900px la lavagna e' un foglio che copre tutto lo schermo
   (22-canvas.css, width 100%) e la chat sotto deve restare intera. Tutte e
   due le regole stanno qui dentro per un motivo misurato il 2026-09-14: il
   60% del pannello, quando stava fuori, era piu' specifico del 100% di
   22-canvas.css e vinceva — sul telefono l'itinerario copriva il 60%
   dello schermo con la chat visibile dietro. */
@media (min-width: 901px) {
    body.workspace-open .lab-right-workspace {
        flex: 0 0 60%;
        width: 60%;
    }

    body.workspace-open .lab-left-panel {
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis: 40%;
        width: 40%;
        min-width: 400px;
        border-right: 1px solid var(--border-light);
    }
}

/* A tutta larghezza i messaggi non devono correre da un bordo all'altro:
   colonna centrata e leggibile. Con la lavagna aperta la chat e' gia'
   stretta e max() torna da solo al padding di sempre. */
.lab-left-panel .chat-messages {
    padding-left: max(1rem, calc((100% - 820px) / 2));
    padding-right: max(1rem, calc((100% - 820px) / 2));
}

/* I form di ricerca (max-width suo, 700px) stavano allineati a sinistra dentro
   la colonna da 820px: a tutta larghezza risultavano 60px fuori centro
   rispetto alla casella di testo sotto. Si centrano nella colonna. */
.lab-left-panel .chat-messages > .search-form-container {
    align-self: center;
    width: 100%;
}

/* La casella di testo NO: ha gia' `max-width: 1200px` + `margin: auto`
   (12-chat-input.css), e un padding in percentuale si calcola sul
   contenitore largo tutto lo schermo, non su di lei — a 1728px le toglieva
   454px per lato e restava una striscia di 166px. Si allinea alla colonna
   dei messaggi stringendo la sua larghezza massima, che e' gia' centrata. */
.lab-left-panel .chat-input-area {
    max-width: calc(820px + 2rem);
}

/* Su schermo stretto comanda il canvas di 22-canvas.css (position: fixed,
   width 100%): li' questa larghezza non conta, e il comportamento a chip
   resta quello di prima. */

.workspace-card {
    flex: 1;
    width: 100%;
    background: #fff;
    box-shadow: none;
    border-radius: 0;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* STATUS VIEW - shown during generation */
.workspace-status-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.workspace-status-view.hidden,
.workspace-empty-view.hidden,
.workspace-result-view.hidden,
.workspace-card-inner.hidden {
    display: none;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    transition: all 0.4s ease;
    opacity: 0.5;
}

.status-step.active {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.08), rgba(61, 220, 132, 0.08));
    border-color: rgba(0, 168, 232, 0.3);
    opacity: 1;
}

.status-step.done {
    background: rgba(61, 220, 132, 0.08);
    border-color: rgba(61, 220, 132, 0.3);
    opacity: 1;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.3s;
}

.status-step.active .step-icon {
    background: var(--primary-sky);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.3);
}

.status-step.done .step-icon {
    background: var(--primary-green);
    color: #fff;
}

.step-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-step.active .step-text {
    color: var(--text-primary);
    font-weight: 600;
}

.status-step.done .step-text {
    color: var(--primary-green);
}

/* CARD INNER - map + table side by side */
.workspace-card-inner {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.workspace-card-inner.hidden {
    display: none;
}

.workspace-map-view {
    width: 42%;
    min-width: 260px;
    min-height: 400px;
    border-right: 1px solid var(--border-light);
    position: relative;
    background: #f1f5f9;
    transition: width 0.3s ease;
}

.workspace-map-view.hidden {
    display: none;
}

.workspace-map-view .map-container {
    width: 100%;
    height: 100%;
}

.workspace-map-view .map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 0.75rem;
    background: #f8fafc;
}

.workspace-map-view .map-placeholder i {
    font-size: 2.5rem;
    opacity: 0.4;
}

.workspace-map-view .map-placeholder p {
    font-size: 0.82rem;
    max-width: 200px;
    text-align: center;
    line-height: 1.4;
}

.workspace-table-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

/* ================================
   INTENT PILLS BAR
   ================================ */
.intent-pills-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.intent-pills-bar.hidden {
    display: none;
}

.intent-pill {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.intent-pill:hover {
    border-color: var(--primary-sky);
    color: var(--primary-sky);
}

.intent-pill.active {
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.intent-pill i {
    font-size: 0.85rem;
}

/* ================================
   EMPTY STATE
   ================================ */
.workspace-empty-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    min-height: 520px;
}

.workspace-empty-view.hidden {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 380px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-sky);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ================================
   STATUS VIEW (during generation)
   ================================ */
.workspace-status-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    overflow: hidden;
    position: relative;
}

/* Override the old status view when in new mode */
.workspace-status-view:not(.old-style) {
    padding: 0;
}

.status-hero {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.status-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.5s ease;
}

.status-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 253, 250, 0) 0%,
        rgba(255, 253, 250, 0.2) 40%,
        rgba(255, 253, 250, 0.75) 70%,
        rgba(255, 253, 250, 0.95) 100%
    );
}

.status-city-overlay {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 2;
}

.status-city-overlay .status-city-name {
    color: #1e293b;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

/* Status Feed */
.status-feed {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 1.5rem 2rem 2rem;
    max-height: 55%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-feed::-webkit-scrollbar {
    width: 4px;
}
.status-feed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}
.status-feed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.feed-item {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: feedSlideIn 0.4s ease-out;
    backdrop-filter: blur(8px);
}

@keyframes feedSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feed-item.working {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
}

.feed-item.found {
    background: rgba(78, 205, 196, 0.12);
    color: #0d9488;
    border: 1px solid rgba(78, 205, 196, 0.25);
}

.feed-item.searching {
    background: rgba(0, 168, 232, 0.1);
    color: #0369a1;
    border: 1px solid rgba(0, 168, 232, 0.2);
}

.feed-item.done {
    background: rgba(61, 220, 132, 0.12);
    color: #15803d;
    border: 1px solid rgba(61, 220, 132, 0.2);
}

.feed-item .feed-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.feed-item.working .feed-icon { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }
.feed-item.found .feed-icon { background: rgba(78, 205, 196, 0.2); color: #0d9488; }
.feed-item.searching .feed-icon { background: rgba(0, 168, 232, 0.2); color: #0369a1; }
.feed-item.done .feed-icon { background: rgba(61, 220, 132, 0.2); color: #15803d; }

/* Agent color coding for feed items */
.feed-item[data-agent="flights"] { border-left: 3px solid #00a8e8; }
.feed-item[data-agent="hotels"] { border-left: 3px solid #3ddc84; }
.feed-item[data-agent="activities"] { border-left: 3px solid #ff6b35; }
.feed-item[data-agent="restaurants"] { border-left: 3px solid #f59e0b; }
.feed-item[data-agent="budget"] { border-left: 3px solid #7c5ce7; }

/* ================================
   RESULT VIEW (after generation)
   ================================ */
.workspace-result-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 520px;
    overflow: hidden;
}

.workspace-result-view.hidden {
    display: none;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.result-city-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.result-budget-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.budget-bar-track {
    width: 120px;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #38bdf8);
    border-radius: 3px;
    transition: width 0.6s ease;
    max-width: 100%;
}

.budget-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
}

.result-map-box {
    width: 100%;
    height: 30vh;
    min-height: 180px;
    max-height: 320px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    position: relative;
}

.result-map-box.hidden {
    display: none;
}

.result-map-box .map-container {
    height: 100%;
    border-radius: 0;
}

.result-table-box {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1rem 1.5rem;
}

.result-table-box .itinerary-matrix-container {
    min-height: auto;
}

/* ================================
   ACTIVITY BOOKING LIST
   Lista attività prenotabili nel workspace
   ================================ */

.activity-booking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0.5rem 0;
}

.activity-booking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.2s;
}

.activity-booking-item:hover {
    background: #fff;
    border-color: rgba(0, 168, 232, 0.3);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.activity-booking-item .booking-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 168, 232, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-sky);
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-booking-item .booking-info {
    flex: 1;
    min-width: 0;
}

.activity-booking-item .booking-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-booking-item .booking-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.activity-booking-item .booking-price {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.activity-booking-item .booking-action {
    flex-shrink: 0;
}

.booking-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: linear-gradient(135deg, var(--primary-sky), var(--primary-green));
    color: #fff;
    font-family: 'Poppins', sans-serif;
}

.booking-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 168, 232, 0.35);
}

.booking-btn.outline {
    background: transparent;
    border: 1px solid rgba(0, 168, 232, 0.3);
    color: var(--primary-sky);
}

.booking-btn.outline:hover {
    background: rgba(0, 168, 232, 0.06);
}

/* ══════════════════════════════════════════════════════════
   HOTEL CARDS
══════════════════════════════════════════════════════════ */
.hotel-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.hotel-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.hotel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.16);
}

.hotel-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-2, #f1f5f9);
}
.hotel-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hotel-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.hotel-card-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.hotel-card-stars {
  color: #f59e0b;
  font-size: .9rem;
  letter-spacing: 1px;
}

.hotel-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}
.hotel-price-label {
  font-size: .75rem;
  color: var(--text-secondary, #64748b);
}

.hotel-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}

.btn-prenota {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: var(--primary, #0f172a);
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: opacity .2s;
  white-space: nowrap;
}
.btn-prenota:hover { opacity: .82; }

.btn-booking {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: #003580;
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: opacity .2s;
  white-space: nowrap;
}
.btn-booking:hover { opacity: .82; }

.hotel-search-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  color: var(--text-secondary, #64748b);
}
.hotel-search-loading i {
  font-size: 1.6rem;
  color: var(--primary, #0f172a);
}

/* Hotel redirect card (Booking.com launcher) */
.hotel-redirect-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 20px;
  max-width: 420px;
}
.hotel-redirect-icon {
  font-size: 2rem;
  color: #003580;
  flex-shrink: 0;
  padding-top: 2px;
}
.hotel-redirect-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hotel-redirect-city {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
}
.hotel-redirect-details {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .85rem;
  color: var(--text-secondary, #64748b);
}
.hotel-redirect-details li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hotel-redirect-details i {
  width: 14px;
  text-align: center;
  color: #003580;
  opacity: .75;
}
.hotel-redirect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 18px;
  background: #003580;
  color: #fff !important;
  border-radius: 10px;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 700;
  transition: opacity .2s;
  align-self: flex-start;
}
.hotel-redirect-btn:hover { opacity: .85; }

/* Dark mode overrides */
[data-theme="dark"] .hotel-card {
  background: var(--card-bg, #1e293b);
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
[data-theme="dark"] .hotel-card-img {
  background: #334155;
}
[data-theme="dark"] .btn-prenota {
  background: #3b82f6;
}
[data-theme="dark"] .hotel-redirect-card {
  background: #1e293b;
  border-color: #334155;
}
