﻿/* =========================
   THEME BASE
========================= */
:root {
    --bg: #0b1220;
    --panel: rgba(255,255,255,.06);
    --panel2: rgba(255,255,255,.10);
    --border: rgba(255,255,255,.12);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.65);
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --radius: 18px;
}

body {
    background: radial-gradient(1200px 600px at 20% -10%, rgba(56,189,248,.25), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(167,139,250,.18), transparent 55%), var(--bg);
    color: var(--text);
}

.page {
    min-height: 100vh;
}

/* =========================
   TOP BAR
========================= */
.top {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(10, 16, 30, .65);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    letter-spacing: .3px;
}

    .brand span {
        font-weight: 600;
        color: var(--muted);
    }

/* burger: visibile solo in mobile */
.burger {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

/* =========================
   LAYOUT
========================= */
.app {
    display: flex;
    gap: 14px;
    padding: 14px;
    max-width: 1300px;
    margin: 0 auto;
    /* ✅ fondamentale */
    height: calc(100vh - 64px);
    min-height: 0;
}

/* sidebar */
@media (max-width: 900px) {

    /* sidebar come pannello off-canvas (SENZA opacity) */
    .side {
        position: fixed;
        top: 64px;
        left: 10px;
        right: 10px;
        width: auto;
        min-width: 0;
        max-height: calc(100vh - 80px);
        overflow: auto;
        /* off */
        transform: translateY(18px);
        visibility: hidden;
        pointer-events: none;
        transition: transform .18s ease, visibility 0s linear .18s;
        z-index: 9002; /* sopra quasi tutto */
    }

    /* quando aperta */
    body.trips-open .side {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform .18s ease;
    }
}


.sideTitle {
    font-weight: 800;
    margin-bottom: 10px;
    color: rgba(255,255,255,.92);
}

.trip {
    padding: 12px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}

    .trip:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.10);
    }

    .trip small {
        display: block;
        margin-top: 4px;
        color: var(--muted);
    }

.newTrip {
    margin-top: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px dashed rgba(255,255,255,.20);
    background: rgba(56,189,248,.10);
    cursor: pointer;
    font-weight: 700;
    margin-bottom:10px;
}

/* main */
.main {
    flex: 1;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    /* ✅ fondamentale */
    min-height: 0;
}

/* chat prende tutto lo spazio disponibile e scrolla lei */
.chat {
    flex: 1 1 auto;
    min-height: 0; /* ✅ fondamentale */
    padding: 16px;
    overflow: auto;
    /* ❌ RIMUOVI la height calc che avevi */
    height: auto;
}

/* composer resta sempre visibile in fondo */
.composer {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    gap: 10px;
    background: rgba(10, 16, 30, .45);
    backdrop-filter: blur(10px);
}

    .composer textarea {
        flex: 1;
        resize: none;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,.14);
        background: rgba(255,255,255,.06);
        color: var(--text);
        padding: 12px 12px;
        outline: none;
    }

    .composer button {
        min-width: 120px;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,.18);
        background: rgba(56,189,248,.22);
        color: var(--text);
        font-weight: 800;
        cursor: pointer;
        transition: transform .12s ease, background .12s ease;
    }

        .composer button:hover {
            transform: translateY(-1px);
            background: rgba(56,189,248,.28);
        }

/* =========================
   DRAWER (tuo)
========================= */
.drawer {
    border-left: 1px solid var(--border);
    background: rgba(10, 16, 30, .86);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.tab {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--text);
}

    .tab.active {
        background: rgba(167,139,250,.22);
    }

/* =========================
   MOBILE: sidebar diventa drawer
========================= */
@media (max-width: 900px) {
    .app {
        padding: 10px;
    }

    .burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* sidebar come pannello off-canvas */
    .side {
        position: fixed;
        top: 64px; /* altezza top bar */
        left: 10px;
        right: 10px;
        width: auto;
        min-width: 0;
        max-height: calc(100vh - 80px);
        overflow: auto;
        transform: translateY(20px);
        opacity: 0;
        pointer-events: none;
        transition: all .18s ease;
        z-index: 80;
    }

    /* quando aperta */
    body.trips-open .side {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* main full width */
    .main {
        width: 100%;
    }

    .chat {
        height: calc(100vh - 160px);
    }
}


.side {
    z-index: 80;
}
/* già ce l’hai in mobile */
.drawer {
    z-index: 90;
}
/* così il drawer vero sta sopra */
.overlay {
    z-index: 85;
}


/* =========================
   CHAT STRUCTURE (manca nel tema scuro)
========================= */
.row {
    display: flex;
    margin: 10px 0;
}

.msg {
    max-width: min(860px, 78%);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    padding: 12px 14px;
    white-space: pre-wrap;
    box-shadow: 0 8px 22px rgba(0,0,0,.22);
}

    .msg.user {
        margin-left: auto;
        background: rgba(56,189,248,.12);
        border-color: rgba(56,189,248,.20);
    }

    .msg.assistant {
        margin-right: auto;
    }

    /* la gen card deve stare bene dentro la bolla */
    .msg .gen {
        margin-top: 10px;
        width: 100%;
    }


/* ===== Prompt esempio: SEMPRE sopra a tutto ===== */
#overlayObscure {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.60);
    z-index: 10000; /* ✅ sopra drawer/overlay */
}

/* il modal dei prompt */
#modalPromptEsempio.modal-slide {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 28px));
    max-height: min(80vh, 720px);
    overflow: hidden;
    background: rgba(10,16,30,.92);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    z-index: 10001; /* ✅ sopra overlayObscure */
    backdrop-filter: blur(10px);
}

/* header/body style (se vuoi mantenerlo leggibile col tema scuro) */
#modalPromptEsempio .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

#modalPromptEsempio .modal-title {
    font-weight: 900;
    color: rgba(255,255,255,.92);
}

#modalPromptEsempio .modal-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
    cursor: pointer;
}

#modalPromptEsempio .modal-body {
    padding: 14px 16px;
    overflow: auto;
    max-height: calc(80vh - 60px);
    color: rgba(255,255,255,.9);
}

/* lista prompt */
#modalPromptEsempio .prompt-item {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    border-radius: 14px;
}

/* =========================
   BUTTON SYSTEM (tutti i bottoni)
========================= */
button {
    font-family: inherit;
}

.btn, .btn-mini, .assistant-suggest-btn, #send,
.actions button, .drawerClose, .tab {
    -webkit-tap-highlight-color: transparent;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.92);
    font-weight: 800;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
}

    .btn:hover, .btn-mini:hover, .assistant-suggest-btn:hover, #send:hover,
    .actions button:hover, .drawerClose:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.10);
        border-color: rgba(255,255,255,.22);
    }

    .btn:active, .btn-mini:active, .assistant-suggest-btn:active, #send:active,
    .actions button:active, .drawerClose:active {
        transform: translateY(0px);
    }

    /* Primary (per "Apri viaggio" e Send) */
    .actions button.primary, #send {
        background: rgba(56,189,248,.22);
        border-color: rgba(56,189,248,.28);
    }

        .actions button.primary:hover, #send:hover {
            background: rgba(56,189,248,.30);
            border-color: rgba(56,189,248,.40);
        }

/* disabilitati */
button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}

/* "Guarda i prompt di esempio" */
.assistant-suggest-btn {
    margin-top: 10px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
}

/* bottoni nella card generazione */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

    .actions button {
        padding: 10px 12px;
    }

/* mini buttons nel modal prompt (se li usi) */
.btn-mini {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 12px;
}

    .btn-mini.secondary {
        background: rgba(255,255,255,.04);
    }

/* =========================
   DRAWER: overlay + slide da destra
========================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 9000;
}

    .overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

/* drawer vero e proprio */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 50vw;/* min(720px, 52vw); /* desktop */
    max-width: 100vw;
    transform: translateX(100%);
    transition: transform .22s ease;
    z-index: 9001;
    display: flex;
    flex-direction: column;
    /* il tuo tema */
    border-left: 1px solid var(--border);
    background: rgba(10, 16, 30, .86);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

    .drawer.open {
        transform: translateX(0);
    }
.msg.assistant.stagebox {
    opacity: .95;
}

/* === DRAWER BODY: deve essere un flex container chiuso === */
#drawerBody {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto; /* non auto qui */
    overflow-x: hidden;
    padding: 16px;
}
/* mobile: drawer full */
@media (max-width: 900px) {
    .drawer {
        width: 100vw;
    }
}

.bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.08);
    overflow: hidden;
    position: relative;
}

    .bar .barFill {
        height: 100%;
        width: 0%;
        display: block;
        border-radius: 999px;
        background: currentColor; /* oppure una variabile */
        opacity: .9;
        transition: width .15s linear; /* opzionale */
    }

/* ===== Summary Cards (Drawer) ===== */
.sumGrid {
    display: grid;
    gap: 14px;
    padding: 6px 2px;
}

/* Card moderna */
.sumCard {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(18, 28, 45, .10);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.6) inset;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header card */
.sumCardHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(15,23,42,.04), rgba(15,23,42,0));
    border-bottom: 1px solid rgba(18, 28, 45, .08);
}

.sumCardTitle {
    font-weight: 950;
    letter-spacing: .2px;
    font-size: 15px;
    color: #0f172a; /* slate-900 */
    display: flex;
    align-items: center;
    gap: 8px;
}

.sumCardMeta {
    font-size: 12px;
    color: rgba(15, 23, 42, .65);
    font-weight: 700;
    white-space: nowrap;
}

/* Body */
.sumCardBody {
    padding: 12px 14px 14px;
}

/* ===== Narrative content inside cards (FORCE readable colors) ===== */
.sumCard .narrative {
    color: #0f172a !important;
    font-size: 14px;
    line-height: 1.5;
}

    .sumCard .narrative strong {
        color: #0b1222 !important;
        font-weight: 950;
    }

    /* newline spacing */
    .sumCard .narrative br + br {
        display: block;
        content: "";
        margin-top: 10px;
    }

    /* “label: value” lines become nicer */
    .sumCard .narrative strong + span,
    .sumCard .narrative strong {
        letter-spacing: .1px;
    }

/* bullets */
.sumCard .narrative {
    word-break: break-word;
}

/* subtle divider between paragraphs when your formatter adds <br><br> */
.sumCard .narrativeBox {
    padding: 0;
}

/* optional: small badge-like accent for the emoji/icon */
.sumCardTitle::before {
    /* no default, icon already in text; keep blank */
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .sumCardHead {
        padding: 12px;
    }

    .sumCardBody {
        padding: 12px;
    }

    .sumCardTitle {
        font-size: 14px;
    }

    .sumCard .narrative {
        font-size: 13.5px;
    }
}

.kv2 {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 6px 10px;
}

    .kv2 .k {
        color: var(--muted);
        font-weight: 800;
    }

    .kv2 .v {
        font-weight: 900;
    }

.listMini {
    margin: 6px 0 0;
    padding-left: 18px;
}

.smallMuted {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
}

.miniLabel {
    margin-top: 10px;
    font-weight: 900;
    font-size: 12px;
    opacity: .8;
}

.dayList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dayCard {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 10px;
}

.dayTitle {
    font-weight: 900;
    margin-bottom: 6px;
}

.chip {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
    font-weight: 900;
    font-size: 12px;
    margin: 8px 0 6px;
}


.sumGrid {
    display: grid;
    gap: 12px;
}

.sumCard {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 10px 22px rgba(0,0,0,.05);
}

.sumCardHead {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sumCardTitle {
    font-weight: 900;
}

.sumCardMeta {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.narrativeBox {
    padding: 0;
}



/* =========================
   DRAWER HEADER (NUOVO)
   ========================= */

.drawerHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0b1020, #141a2e);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.drawerHeadLeft {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* evita overflow */
}

.drawerTitleRow {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.drawerIcon {
    font-size: 18px;
    line-height: 1;
    opacity: .95;
}

.drawerTitle {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawerSub {
    font-size: 13px;
    color: rgba(210,220,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* X tutto a destra, click comodo, look premium */
.drawerClose {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, background .2s ease, color .2s ease;
}

    .drawerClose:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
        transform: scale(1.04);
    }

/* =========================
   TABS (più belli)
   ========================= */

.tabs {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: #0b1020;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tab {
    border: 1px solid rgba(255,255,255,0.14);
    background: transparent;
    color: rgba(220,230,255,0.85);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

    .tab:hover {
        background: rgba(255,255,255,0.08);
    }

    .tab.active {
        background: #fff;
        color: #0b1020;
        border-color: #fff;
        font-weight: 700;
    }


/* =========================
   FULL WIDTH LAYOUT FIX
   ========================= */

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
}

.page {
    width: 100%;
    min-height: 100vh;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.app {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 64px); /* altezza header */
    max-width: none !important;
    margin: 0 !important;
}

/* assicura che la chat occupi tutto lo spazio */
.main {
    flex: 1;
    min-width: 0;
}

/* =========================
   BOOKING: ANDATA / RITORNO A COLONNE
   ========================= */

.bookingSplitWrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bookingSplitHead .narrative {
    opacity: .95;
}

/* griglia 2 colonne */
.bookingSplitGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.bookingCol {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
}


.bookingSplitWrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bookingSplitGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.bookingCol {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
}

@media (max-width: 900px) {
    .bookingSplitGrid {
        grid-template-columns: 1fr;
    }
}
 
/* mobile: una sotto l'altra */
@media (max-width: 900px) {
    .bookingSplitGrid {
        grid-template-columns: 1fr;
    }
}


/*START PAGE*/
/* ========= LANDING MODE ========= */
body.landing-mode .side {
    display: none !important;
}

body.landing-mode #chat {
    display: none !important;
}

body.landing-mode .composer {
    display: none !important;
}

body.landing-mode #drawer,
body.landing-mode #overlay {
    display: none !important;
}

/* centra la landing */
.landing {
    display: none;
    height: calc(100vh - 64px); /* header */
    padding: 24px;
}

body.landing-mode .landing {
    display: flex;
    align-items: center;
    justify-content: center;
}

.landingInner {
    width: min(820px, 92vw);
    text-align: center;
}

.landingBrand {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: .5px;
    margin-bottom: 50px;
    opacity: .9;
    margin-top:-20vh;
}

/* box input stile moderno */
.landingBox {
    background: #fff;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 16px;
    padding: 14px 14px 10px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

#promptLanding {
    width: 100%;
    border: 0;
    outline: none;
    resize: none;
    font-size: 16px;
    line-height: 1.35;
    padding: 8px 10px;
    min-height: 56px;
}

.landingActions {
    display: flex;
    justify-content: flex-end;
    padding: 6px 6px 2px 6px;
}

.landingSend {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

/* mobile */
@media (max-width: 768px) {
    .landingBrand {
        font-size: 44px;
    }
}

.logo-payoff {
    font-family: inherit; /* 🔑 usa il font dell'app */
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-top: 10px;
}

.landingHints {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.landingExamplesBtn {
    background: transparent;
    border: 0;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    opacity: .7;
}

    .landingExamplesBtn:hover {
        opacity: 1;
        text-decoration: underline;
    }

/* Landing: stato normale */
#landing {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition: opacity .25s ease, transform .25s ease, filter .25s ease;
    will-change: opacity, transform, filter;
}

    /* Landing: in uscita (animazione) */
    #landing.is-exiting {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
        filter: blur(6px);
        pointer-events: none;
    }

/* Chat/composer: inizialmente nascosti durante landing-mode */
body.landing-mode #chat,
body.landing-mode .composer {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

/* Chat/composer: in entrata quando si esce da landing */
body:not(.landing-mode) #chat,
body:not(.landing-mode) .composer {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: auto;
}

/* loader a 3 puntini in coda al messaggio */
.tail-loader {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
    opacity: .9;
}

    .tail-loader i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        opacity: .35;
        animation: tailDots 1s infinite ease-in-out;
    }

        .tail-loader i:nth-child(2) {
            animation-delay: .15s;
        }

        .tail-loader i:nth-child(3) {
            animation-delay: .30s;
        }

@keyframes tailDots {
    0%, 100% {
        transform: translateY(0);
        opacity: .35;
    }

    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* se vuoi più “soft” sui messaggi stage */
.msg.stagebox .tail-loader {
    opacity: .75;
}
/* overlay scuro full screen */
#overlayObscure {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    z-index: 10000;
}

#authModal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 92vw);
    padding: 18px;
    display: none;
    z-index: 10001;
    /* DEBUG VISIBILITÀ */
   /* background: #ffffff !important;
    color: #111 !important;
    border: 3px solid red !important;
    box-shadow: 0 20px 80px rgba(0,0,0,.6) !important;
    opacity: 1 !important;
    visibility: visible !important;*/
}


    /* header in alto con X */
    #authModal .authHead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    #authModal .authClose {
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        opacity: .8;
    }

        #authModal .authClose:hover {
            opacity: 1;
        }

/* bottone google bello */
#btnGoogleLogin {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

    #btnGoogleLogin:hover {
        background: rgba(255,255,255,.10);
    }

/* =========================
   AUTH MODAL (MINOICUM STYLE)
========================= */

/* overlay: già ok, ma gli aggiungo glow + blur "premium" */
#overlayObscure.auth-open {
    display: block;
    background:
      radial-gradient(1200px 600px at 20% 10%, rgba(56,189,248,.14), transparent 55%),
      radial-gradient(900px 500px at 85% 85%, rgba(167,139,250,.12), transparent 55%),
      rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
}

/* contenitore modale */
#authModal {
    display: none;
    z-index: 10001;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 92vw);
    padding: 0; /* 🔥 non padding qui, lo mettiamo dentro */
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    box-shadow: 0 30px 90px rgba(0,0,0,.55);
    backdrop-filter: blur(12px);
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

#authModal.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#authModal.is-opening {
    display: block;
    opacity: 0;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(10px) scale(.985);
}

/* header */
#authModal .authHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: rgba(10,16,30,.35);
}

#authModal .authTitleWrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#authModal .authKicker {
    font-size: 12px;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    font-weight: 800;
}

#authModal .authTitle {
    font-size: 18px;
    font-weight: 900;
    color: rgba(255,255,255,.92);
    line-height: 1.1;
}

/* close button */
#authModal .authClose {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
#authModal .authClose:hover {
    transform: scale(1.04);
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
}

/* body */
#authModal .authBody {
    padding: 16px;
}

#authModal .authText {
    margin: 0 0 14px 0;
    color: rgba(255,255,255,.70);
    line-height: 1.45;
}

/* CTA Google */
#btnGoogleLogin.googleBtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(180deg, rgba(56,189,248,.26), rgba(56,189,248,.14));
    color: rgba(255,255,255,.95);
    font-weight: 900;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

#btnGoogleLogin.googleBtn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(56,189,248,.32), rgba(56,189,248,.18));
    border-color: rgba(56,189,248,.40);
}

#btnGoogleLogin .gIcon {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: #fff;
    position: relative;
    flex: 0 0 auto;
}


body:not(.landing-mode) #landing {
    display: none;
}

.top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    flex: 1;
}
/* spinge user menu a destra */

.userMenu {
    position: relative;
}

.userBtn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
}

    .userBtn:hover {
        background: rgba(255,255,255,0.12);
    }

.userAvatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    font-size: 16px;
}

.userText {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.userName {
    font-weight: 800;
    font-size: 13px;
}

.userEmail {
    font-size: 12px;
    opacity: .85;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.userChevron {
    opacity: .8;
}

.userDropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    background: #0f1626;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    padding: 8px;
    z-index: 9999;
}

.userDropItem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

    .userDropItem:hover {
        background: rgba(255,255,255,0.10);
    }

/* mobile: nascondi email, lascia nome */
@media (max-width: 520px) {
    .userEmail {
        display: none;
    }

    .userBtn {
        padding: 8px 10px;
    }
}
/* il body del drawer deve avere un'altezza e poter contenere elementi a tutta altezza */
.drawerBody {
    height: calc(100vh - 140px); /* regola 140px se hai header+tabs più alti */
    overflow: hidden; /* evita scroll strani dentro il drawer */
    display: flex;
    flex-direction: column;
}

/* wrapper tab map */
.mapWrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* mappa deve avere altezza reale */
#mapboxMap {
    flex: 1 1 auto;
    min-height: 420px;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
}
/* Lista transfer sotto */

/* lista transfer scrolla lei */
.routeList {
    flex: 0 0 auto;
    max-height: 180px;
    overflow: auto;
}

/* pannello info (se lo usi) */
.mapInfo {
    flex: 0 0 auto;
}
.mapControls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
}

.mapSel {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 38px 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(20,24,35,0.65);
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;
    outline: none;
    /* freccia custom */
    background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.9) 50%), linear-gradient(135deg, rgba(255,255,255,.9) 50%, transparent 50%), linear-gradient(to right, transparent, transparent);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px), 0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}

    .mapSel:focus {
        border-color: rgba(120,170,255,0.65);
        box-shadow: 0 0 0 3px rgba(120,170,255,0.20);
    }

.mapBtn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(120,170,255,0.18);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

    .mapBtn:hover {
        background: rgba(120,170,255,0.26);
    }

/* pannello descrizione */


.mapInfoSection + .mapInfoSection {
    margin-top: 12px;
}

.mapInfoLabel {
    font-size: 12px;
    opacity: .75;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.mapInfoTitle {
    font-size: 16px;
    font-weight: 900;
    margin-top: 6px;
}

.mapInfoMeta {
    font-size: 13px;
    opacity: .85;
    margin-top: 4px;
}

.mapInfoText {
    margin-top: 8px;
    line-height: 1.45;
    opacity: .95;
}

/* ===== Trips List (drawer/side) ===== */
#tripsList {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    /* opzionale: evita che la card tocchi i bordi */
    padding-bottom: 12px;
    /* opzionale: su iOS */
    -webkit-overflow-scrolling: touch;
}

.tripListHeader {
    padding: 10px 8px 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 10px;
}

.tripListTitle {
    font-weight: 900;
    letter-spacing: .2px;
    font-size: 14px;
}

.tripListSub {
    margin-top: 3px;
    font-size: 12px;
    opacity: .7;
}

.tripListLoading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    font-size: 13px;
    opacity: .8;
}

.miniSpin {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: rgba(255,255,255,.8);
    display: inline-block;
    animation: miniSpin 0.8s linear infinite;
}

@keyframes miniSpin {
    to {
        transform: rotate(360deg);
    }
}

.tripListEmpty {
    padding: 12px 8px;
    font-size: 13px;
    opacity: .8;
}

.tripListGrid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height-max:80vh;
}

/* card cliccabile */
.tripCard {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
    outline: none;
}

    .tripCard:hover {
        background: rgba(255,255,255,.06);
        transform: translateY(-1px);
        border-color: rgba(255,255,255,.18);
    }

    .tripCard:focus-visible {
        box-shadow: 0 0 0 3px rgba(255,255,255,.12);
    }

    .tripCard.is-active {
        border-color: rgba(255,255,255,.30);
        background: rgba(255,255,255,.08);
    }

/* top row */
.tripCardTop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tripCardTitle {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.2;
}

.tripCardStatus {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    opacity: .9;
    white-space: nowrap;
}

/* preview */
.tripCardPreview {
    margin-top: 8px;
    font-size: 12.5px;
    opacity: .78;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* meta */
.tripCardMeta {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    opacity: .72;
}

.tripCardChevron {
    font-size: 18px;
    opacity: .55;
}

/* status accents (solo bordo/ombra, niente colori fissi aggressivi) */
.tripCard.st-done {
    box-shadow: inset 0 0 0 1px rgba(0,255,140,.10);
}

.tripCard.st-inprogress {
    box-shadow: inset 0 0 0 1px rgba(255,200,0,.10);
}

.tripCard.st-error {
    box-shadow: inset 0 0 0 1px rgba(255,80,80,.12);
}

.tripCard.st-draft {
    box-shadow: inset 0 0 0 1px rgba(120,170,255,.10);
}

/* ===== Trips cards: testo bianco ===== */
.tripCard,
.tripCard * {
    color: #ffffff;
}

/* sottotitoli / preview leggermente attenuati */
.tripCardPreview,
.tripCardMeta,
.tripListSub {
    color: rgba(255,255,255,0.75);
}

/* badge stato (Bozza, Completato, ecc.) */
.tripCardStatus {
    color: #ffffff;
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

/* testo "Nuovo viaggio" */
.newTrip {
    color: #ffffff;
}

/* placeholder / messaggi vuoti */
.tripListEmpty,
.smallMuted {
    color: rgba(255,255,255,0.65);
}

/* ============================
   SCROLLBAR – Trips List
============================ */

/* Chrome / Edge / Safari */
#tripsList::-webkit-scrollbar {
    width: 6px; /* 🔹 sottile */
}

#tripsList::-webkit-scrollbar-track {
    background: transparent; /* o rgba(255,255,255,0.05) */
}

#tripsList::-webkit-scrollbar-thumb {
    background: linear-gradient( 180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.25) );
    border-radius: 10px;
}

    #tripsList::-webkit-scrollbar-thumb:hover {
        background: linear-gradient( 180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.4) );
    }

/* Firefox */
#tripsList {
    scrollbar-width: thin; /* auto | thin */
    scrollbar-color: rgba(255,255,255,0.45) transparent;
}
/* ============================
   GLOBAL SCROLLBAR (site-wide)
============================ */

/* Firefox */
html {
    scrollbar-width: thin; /* auto | thin */
    scrollbar-color: rgba(255,255,255,0.45) transparent;
}

/* Chrome / Edge / Safari */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px; /* anche orizzontale */
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient( 180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.25) );
    border-radius: 10px;
}

    *::-webkit-scrollbar-thumb:hover {
        background: linear-gradient( 180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.40) );
    }

/* quando la composer viene messa DENTRO la chat */
/* stato base */
.composer {
    transition: transform 320ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease, box-shadow 220ms ease;
}

/* quando la sposti sotto il messaggio AI */
body.composer-docked .composer {
    transform: translateY(-12px) scale(0.98);
}

    /* fase finale: visibile e “agganciato” */
    body.composer-docked .composer.is-docked {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 30px rgba(0,0,0,.25);
    }

#send {
    display: inline-flex; /* ⬅️ NON flex */
    align-items: center; /* centro verticale */
    justify-content: center; /* centro orizzontale */
    gap: 8px;
    line-height: 1;
    padding: 10px 16px; /* dimensione naturale */
}

/* contenitore generale */
.composer {
    padding: 14px 16px;
}

/* bubble come “textarea UI” */
.composerBubble {
    position: relative;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    overflow: hidden; /* taglia bene */
}

/* textarea: trasparente dentro la bubble */
#prompt {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    resize: none;
    line-height: 1.35;
    font-size: 15px;
    box-sizing: border-box;
    /* 🔥 SPAZIO RISERVATO PER IL BOTTONE */
    padding: 14px 56px 18px 14px; /* right=56, bottom=18 */
    min-height: 56px;
}

/* bottone: piccolo, tondo, bello */
#send {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(56,189,248,.25);
    border: 1px solid rgba(56,189,248,.35);
    color: #fff;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

    /* hover/active */
    #send:hover {
        background: rgba(56,189,248,.35);
        box-shadow: 0 10px 25px rgba(0,0,0,.25);
        transform: translateY(-1px);
    }

    #send:active {
        transform: translateY(0) scale(.97);
    }

    /* disabilitato */
    #send:disabled {
        opacity: .45;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }

#prompt {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    resize: none;
    line-height: 1.4;
    font-size: 15px;
    box-sizing: border-box; /* 🔥 FONDAMENTALE */
    /* 🔥 SPAZIO RISERVATO REALE */
    padding: 14px 56px 52px 14px;
   /* margin-right:15%*/
    /*           ↑     ↑
             bottone  spazio verticale */
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* ❌ niente scroll pagina */
}
/* il composer deve occupare tutta la riga */
.composer {
    width: 100%;
}

/* la bubble deve prendere tutto lo spazio disponibile */
.composerBubble {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* il textarea deve essere block e pieno */
#prompt {
    display: block;
    width: 100%;
}

/* overlay obscure: di default NON deve intercettare click */
#overlayObscure {
    pointer-events: none;
    display: none; /* se vuoi tenerlo spento di default */
}

    /* quando serve davvero (prompt modal / auth) */
    #overlayObscure.auth-open,
    #overlayObscure.open,
    #overlayObscure.is-open {
        display: block;
        pointer-events: auto;
    }
@media (max-width: 900px) {
    body.trips-open .side {
        z-index: 9002;
    }
}
.userTokensRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.userTokensLabel {
    color: rgba(255,255,255,.70);
    font-size: 12.5px;
    font-weight: 700;
}

.userTokensValue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    font-weight: 900;
    font-size: 12.5px;
    letter-spacing: .2px;
}

/* =========================
   HOTEL GALLERY
========================= */
.hotelGalleryHost {
    margin-top: 12px;
}

.hotelGalleryScroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
}

    .hotelGalleryScroller a {
        display: block;
        flex: 0 0 auto;
        scroll-snap-align: start;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,.12);
        background: rgba(255,255,255,.04);
    }

    .hotelGalleryScroller img {
        display: block;
        width: 180px;
        height: 120px;
        object-fit: cover;
    }
/* =========================
   HOTEL GALLERY + LIGHTBOX
========================= */
.hotelGallery {
    margin-top: 12px;
}

.hotelGalleryScroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.hotelThumbBtn {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    flex: 0 0 auto;
}

    .hotelThumbBtn img {
        width: 110px;
        height: 78px;
        object-fit: cover;
        display: block;
        border-radius: 12px;
    }

/* blocca scroll dietro modal */
.noScroll {
    overflow: hidden;
}

/* lightbox overlay */
.hotelLightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
}

.hotelLightboxBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.72);
}

.hotelLightboxPanel {
    position: absolute;
    inset: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotelLbImg {
    max-width: 96vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.hotelLbClose {
    position: absolute;
    top: 18px;
    right: 18px;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
}

.hotelLbNav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 48px;
    height: 58px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .hotelLbNav.prev {
        left: 14px;
    }

    .hotelLbNav.next {
        right: 14px;
    }

.hotelLbCounter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.9);
    background: rgba(0,0,0,.35);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}
