/* import-draft — UI Tool 1 "Pianifica da una bozza" (Fase 2, cantiere Import).
   PRIMO componente nato con le regole di docs/css-conventions.md:
   prefisso .imd-, token locali sul root (zero leak su :root), fallback verso
   futuri token globali, mobile-first, niente !important, specificità ≤ 2 classi. */

.imd-overlay {
    /* token locali del componente — palette Menevo (deep ocean) dal 2 ago */
    --imd-accent: var(--menevo-accent, #003E54);
    --imd-accent-soft: var(--menevo-accent-soft, #E7F0F4);
    --imd-navy: #243B5E;
    --imd-gold: #EFD06A;
    --imd-sand: #FDF8EF;
    --imd-butter: #FBF3C6;
    --imd-cinnamon: #3B2A22;
    --imd-ink: var(--menevo-ink, #1f2937);
    --imd-muted: var(--menevo-muted, #6b7280);
    --imd-line: var(--menevo-line, #e5e7eb);
    --imd-bg: var(--menevo-surface, #ffffff);
    --imd-warn: var(--menevo-warn, #b45309);
    --imd-danger: var(--menevo-danger, #b91c1c);
    --imd-radius: 16px;

    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    padding: 0;
}

.imd-panel {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    background: var(--imd-bg);
    color: var(--imd-ink);
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* il font delle daily card */
    border-radius: var(--imd-radius) var(--imd-radius) 0 0;
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
}

.imd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.imd-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.imd-sub {
    font-size: 0.85rem;
    color: var(--imd-muted);
    margin: 0.15rem 0 0;
}

.imd-close {
    border: 0;
    background: transparent;
    color: var(--imd-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}
.imd-close:hover { background: var(--imd-accent-soft); color: var(--imd-ink); }

/* ── ingest ────────────────────────────────────────────────────────────── */
.imd-drop {
    border: 2px dashed var(--imd-line);
    border-radius: 12px;
    padding: 1.1rem;
    text-align: center;
    color: var(--imd-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.imd-beta {
    display: inline-block; vertical-align: 0.25em;
    background: var(--imd-gold); color: var(--imd-navy);
    font-size: 0.5em; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    padding: 0.25em 0.6em; border-radius: 6px;
}

/* ── ingresso a metà (2 ago): sx carica/trascina · dx testo ── */
.imd-ingest { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; }
.imd-ing-col { display: flex; flex-direction: column; min-width: 0; }
.imd-ingest .imd-drop { flex: 1 1 auto; min-height: 9.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.55; padding: 1.1rem; }
.imd-ingest .imd-or { align-self: center; margin: 0; }
.imd-ingest .imd-textarea { flex: 1 1 auto; min-height: 9.5rem; resize: none; }
/* documenti caricati: righe ordinate SOTTO il box */
.imd-ingest .imd-files { display: block; margin: 0.45rem 0 0; padding: 0; list-style: none; }
.imd-ingest .imd-file { margin-top: 0.4rem; }
@media (max-width: 700px) {
    .imd-ingest { grid-template-columns: 1fr; }
    .imd-ingest .imd-or { justify-self: center; }
    .imd-ingest .imd-drop, .imd-ingest .imd-textarea { min-height: 7.5rem; }
}
.imd-drop.imd-drop-over { border-color: var(--imd-accent); background: var(--imd-accent-soft); }
.imd-drop-strong { color: var(--imd-accent); font-weight: 600; }

.imd-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
}
/* chip documento (4 ago): riga sand con badge oro del tipo file — niente pillole */
.imd-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--imd-sand);
    border: 1px solid var(--imd-gold);
    color: var(--imd-navy);
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(12, 21, 32, 0.05);
}
.imd-file-ext {
    flex: none;
    background: var(--imd-gold);
    color: var(--imd-navy);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.25em 0.55em;
    border-radius: 6px;
}
.imd-file-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.imd-file-x {
    flex: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--imd-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}
.imd-file-x:hover { background: var(--imd-butter); color: var(--imd-navy); }

.imd-or {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--imd-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0.9rem 0 0.5rem;
}
.imd-or::before, .imd-or::after { content: ""; flex: 1; height: 1px; background: var(--imd-line); }

.imd-textarea {
    width: 100%;
    min-height: 5.5rem;
    border: 1px solid var(--imd-line);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}
.imd-textarea:focus { outline: 2px solid var(--imd-accent); outline-offset: -1px; border-color: transparent; }

.imd-actions { margin-top: 1rem; display: flex; gap: 0.6rem; }

.imd-btn {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--imd-accent);
    color: #fff;
    transition: filter 0.15s ease;
}
.imd-btn:hover { filter: brightness(1.06); }
.imd-btn:disabled { opacity: 0.5; cursor: default; }
.imd-btn-ghost { background: transparent; color: var(--imd-accent); flex: 0 0 auto; }

.imd-error {
    margin-top: 0.8rem;
    background: #fef2f2;
    color: var(--imd-danger);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
}

/* ── percorso progressivo ─────────────────────────────────────────────── */
.imd-steps { margin: 0.5rem 0 0; padding: 0; list-style: none; }

.imd-step {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding: 0 0 1.1rem 0;
}
.imd-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 0.72rem;
    top: 1.6rem;
    bottom: 0.15rem;
    width: 2px;
    background: var(--imd-line);
}
.imd-step.imd-step-done:not(:last-child)::before { background: var(--imd-accent); }

.imd-dot {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: var(--imd-line);
    color: var(--imd-muted);
    margin-top: 0.05rem;
}
.imd-step-active .imd-dot { background: var(--imd-accent-soft); color: var(--imd-accent); }
.imd-step-done .imd-dot { background: var(--imd-accent); color: #fff; }
.imd-step-halt .imd-dot { background: #fef3c7; color: var(--imd-warn); }

.imd-spin {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid var(--imd-accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: imd-rot 0.8s linear infinite;
}
@keyframes imd-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .imd-spin { animation: none; border-top-color: var(--imd-accent); opacity: 0.5; }
}

.imd-step-label { font-weight: 600; font-size: 0.95rem; }
.imd-step-note { font-size: 0.83rem; color: var(--imd-muted); margin-top: 0.15rem; }

/* ── box a portafoglio (2 ago): sx stato+domande · dx chat VO' ── */
.imd-wallet { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 1.4rem; align-items: stretch; min-height: 0; }
.imd-wleft { min-height: 0; overflow-y: auto; padding-right: 0.25rem; }
.imd-ready {
    display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
    background: var(--imd-accent-soft);
    border: 1px solid var(--imd-accent);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    margin-top: 0.9rem;
    font-weight: 600; color: var(--imd-navy);
}
.imd-ready-go {
    flex: 0 0 auto;
    background: var(--imd-accent); color: #fff;
    border-radius: 10px; padding: 0.5rem 1rem;
    font-weight: 600; font-size: 0.9rem;
    text-decoration: none; text-align: center; white-space: nowrap;
}
.imd-ready-go:hover { filter: brightness(1.12); }
/* logo Menevo che pensa: onda che scorre + respiro (dot trasparente: solo la pallina) */
.imd-wallet .imd-step-active .imd-dot { background: transparent; }
.imd-mnv { width: 1.5rem; height: 1.5rem; display: block; animation: imdMnvBreath 1.8s ease-in-out infinite; filter: drop-shadow(0 1px 2px rgba(0, 25, 38, 0.2)); }
.imd-mnv-wave { animation: imdMnvWave 1.6s linear infinite; }
@keyframes imdMnvWave { from { transform: translateX(0); } to { transform: translateX(18px); } }
@keyframes imdMnvBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* step in orizzontale, essenziali: pallino + etichetta, cerchi COLLEGATI da
   una linea orizzontale (via il vecchio connettore verticale) */
.imd-wallet .imd-steps { display: flex; gap: 1rem; margin: 0.5rem 0 1.1rem; padding: 0; }
.imd-wallet .imd-step { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-align: center; padding: 0; border: none; }
.imd-wallet .imd-step::before { display: none; }
.imd-wallet .imd-step:not(:first-child)::after {
    content: "";
    position: absolute;
    top: 0.72rem;
    right: calc(50% + 0.95rem);
    left: calc(-50% + 0.95rem);
    height: 2px;
    background: var(--imd-line);
}
.imd-wallet .imd-step-done::after, .imd-wallet .imd-step-active::after { background: var(--imd-accent); }
.imd-wallet .imd-dot { position: relative; z-index: 1; }
.imd-wallet .imd-step-label { font-size: 0.79rem; font-weight: 600; color: var(--imd-muted); line-height: 1.3; }
.imd-wallet .imd-step-done .imd-step-label, .imd-wallet .imd-step-active .imd-step-label { color: var(--imd-navy); }
.imd-wallet .imd-step-note, .imd-wallet .imd-step-extra { display: none; }
.imd-bar { height: 7px; border-radius: 999px; background: var(--imd-accent-soft); overflow: hidden; }
.imd-bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--imd-accent); transition: width 0.45s ease; }
.imd-eta { font-size: 0.76rem; color: var(--imd-muted); margin: 0.35rem 0 0.6rem; }
.imd-qs-slot { min-height: 1px; }
/* chat VO' */
.imd-wright { display: flex; flex-direction: column; background: var(--imd-bg); border: 1px solid var(--imd-line); border-radius: 12px; padding: 0.8rem 0.85rem; min-height: 0; }
.imd-vo-head { display: flex; gap: 0.5rem; font-size: 0.76rem; color: var(--imd-muted); line-height: 1.45; padding-bottom: 0.55rem; border-bottom: 1px solid var(--imd-line); }
.imd-vo-head b { color: var(--imd-navy); }
.imd-vo-star { color: var(--imd-gold); font-size: 1rem; flex: 0 0 auto; }
.imd-vo-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; padding: 0.6rem 0.1rem; }
.imd-vo-msg { font-size: 0.8rem; line-height: 1.5; border-radius: 10px; padding: 0.45rem 0.6rem; max-width: 92%; white-space: pre-wrap; }
.imd-vo-msg .imd-vo-li { padding-left: 1.1em; text-indent: -1.1em; margin: 0.25rem 0; }
.imd-vo-msg .imd-vo-sp { height: 0.35rem; }
.imd-vo-msg b { font-weight: 700; color: inherit; }
/* domanda suggerita (4 ago): deve LEGGERSI come bottone — butter/oro, non pillola */
.imd-vo-sugg {
    align-self: flex-start;
    margin: 0.15rem 0 0.5rem;
    border: 1px solid var(--imd-gold);
    background: var(--imd-butter);
    color: var(--imd-navy);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(12, 21, 32, 0.08);
    transition: background 0.12s ease, border-color 0.12s ease;
}
.imd-vo-sugg:hover { background: var(--imd-gold); }
.imd-vo-ai { background: var(--imd-accent-soft); color: var(--imd-navy); align-self: flex-start; }
.imd-vo-tip { border-left: 3px solid var(--imd-gold); }
/* widget itinerario (4 ago): card BIANCA sotto la colonna di stato —
   giorni → tappe (dettagli); il mancante in cinnamon, niente evidenziatore */
.imd-itin { background: var(--imd-bg); border: 1px solid var(--imd-line); border-radius: 12px; padding: 0.7rem 0.85rem; margin-top: 0.9rem; }
.imd-itin-head { font-size: 0.78rem; font-weight: 700; color: var(--imd-navy); margin-bottom: 0.45rem; }
.imd-itin-row { display: flex; gap: 0.55rem; padding: 0.35rem 0; border-top: 1px solid rgba(36, 59, 94, 0.08); }
.imd-itin-row:first-child { border-top: none; }
.imd-itin-day { flex: 0 0 auto; min-width: 2.1rem; height: 1.35rem; display: inline-flex; align-items: center; justify-content: center;
    background: var(--imd-navy); color: #fff; border-radius: 6px; font-size: 0.66rem; font-weight: 700; padding: 0 0.3rem; margin-top: 0.1rem; }
.imd-itin-body { min-width: 0; }
.imd-itin-body b { font-size: 0.82rem; color: var(--imd-navy); }
.imd-itin-sure { font-size: 0.76rem; color: var(--imd-navy); opacity: 0.8; }
.imd-itin-gap { font-size: 0.76rem; color: var(--imd-cinnamon); margin-top: 0.1rem; }
.imd-vo-user { background: var(--imd-navy); color: #fff; align-self: flex-end; }
.imd-vo-row { display: flex; gap: 0.45rem; padding-top: 0.5rem; border-top: 1px solid var(--imd-line); }
.imd-vo-in { flex: 1 1 auto; border: 1px solid var(--imd-line); border-radius: 10px; padding: 0.45rem 0.6rem; font: inherit; font-size: 0.82rem; line-height: 1.4; resize: none; overflow-y: auto; max-height: 5.5rem; box-sizing: border-box; }
.imd-vo-msg, .imd-vo-in { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.imd-vo-in:focus { outline: 2px solid var(--imd-accent); outline-offset: -1px; }
.imd-vo-send { padding: 0.45rem 0.9rem; }
.imd-vo-left { font-size: 0.76rem; color: var(--imd-navy); margin-top: 0.35rem; }
.imd-vo-left b { font-weight: 700; }
/* mobile: colonna unica — barra in alto, poi la chat; quando c'è una domanda
   la scena passa a lei (la chat si nasconde finché non si risponde) */
@media (max-width: 700px) {
    .imd-wallet { display: flex; flex-direction: column; }
    .imd-wallet .imd-wleft { display: contents; }
    .imd-wallet .imd-steps { order: 1; }
    .imd-bar { order: 2; }
    .imd-eta { order: 3; }
    .imd-ready { order: 0; }
    /* tetto: quando VO' risponde la chat NON allunga il modal — scorre dentro */
    .imd-wright { order: 4; min-height: 16rem; max-height: min(24rem, 55dvh); overflow: hidden; }
    .imd-qs-slot { order: 5; }
    .imd-err-slot { order: 6; }
    .imd-skim-slot { order: 7; }
    .imd-wallet.imd-has-q .imd-wright { display: none; }
    .imd-wallet.imd-has-q .imd-qs-slot { order: 4; }
    /* campi a 16px: sotto quella soglia iOS Safari zooma al focus e sposta la vista */
    .imd-textarea, .imd-q-input, .imd-q-field input, .imd-vo-in { font-size: 16px; }
}

/* domande inline nello step fermo */
.imd-q {
    margin-top: 0.6rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
}
.imd-q-text { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.2rem; }
.imd-q-ev { font-size: 0.78rem; color: var(--imd-muted); font-style: italic; margin: 0 0 0.5rem; }
.imd-q-input {
    width: 100%;
    min-height: 3.2rem;
    border: 1px solid var(--imd-line);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    font: inherit;
    font-size: 0.88rem;
    box-sizing: border-box;
    resize: vertical;
}
.imd-q-input:focus { outline: 2px solid var(--imd-accent); outline-offset: -1px; }

/* domanda strutturata: contatore · problema · proposta · riferimento · opzioni · campi guidati */
.imd-q-count { font-size: 0.72rem; font-weight: 600; color: var(--imd-muted); letter-spacing: 0.03em; margin: 0 0 0.35rem; }
.imd-q-prop {
    font-size: 0.85rem;
    background: var(--imd-bg);
    border: 1px solid #fde68a;
    border-left: 3px solid var(--imd-warn);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    margin: 0 0 0.5rem;
}
.imd-q-refbtn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: none;
    padding: 0 0 0.35rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--imd-muted);
    cursor: pointer;
}
.imd-q-chev { display: inline-block; transition: transform 0.15s ease; }
.imd-q-refbtn.open .imd-q-chev { transform: rotate(90deg); }
.imd-q-ref { font-size: 0.78rem; color: var(--imd-muted); font-style: italic; margin: 0 0 0.5rem; padding-left: 0.85rem; }
.imd-q-opts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 0.5rem; }
.imd-q-opt {
    border: 1px solid var(--imd-line);
    background: var(--imd-bg);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.imd-q-opt:hover { border-color: var(--imd-accent); }
.imd-q-opt.on { border-color: var(--imd-accent); background: var(--imd-accent-soft); font-weight: 600; }
.imd-q-alt { color: var(--imd-muted); border-style: dashed; }
.imd-q-alt.on { color: inherit; border-style: solid; }
.imd-q-guided { margin-top: 0.15rem; }
.imd-q-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.5rem; }
.imd-q-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; font-weight: 600; color: var(--imd-muted); }
.imd-q-field--wide { flex: 1 1 100%; }
.imd-q-field input {
    border: 1px solid var(--imd-line);
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    font: inherit;
    font-size: 0.86rem;
    box-sizing: border-box;
    background: var(--imd-bg);
    color: var(--imd-ink);
    color-scheme: light;
    accent-color: var(--imd-accent);
}
.imd-q-field input[type="date"] { min-height: 2.3rem; }
.imd-q-field input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.55; }
.imd-q-field--wide input { width: 100%; }
.imd-q-field input:focus { outline: 2px solid var(--imd-accent); outline-offset: -1px; }
.imd-q-note { font-size: 0.74rem; color: var(--imd-muted); margin: 0.4rem 0 0; }

/* riepilogo finale */
.imd-done-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0.9rem;
}
.imd-stat {
    background: var(--imd-accent-soft);
    color: var(--imd-navy);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ── FAB d'ingresso in dashboard ──────────────────────────────────────── */
.imd-fab {
    position: fixed;
    right: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--menevo-accent, #0f766e);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
}
.imd-fab:hover { filter: brightness(1.07); }

/* ── desktop ──────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    .imd-overlay { align-items: center; padding: 2rem 1rem; }
    /* ingresso: modal COMPATTO · lettura: modal largo (--wide, il portafoglio respira) */
    .imd-panel { max-width: 52rem; border-radius: var(--imd-radius); max-height: 88dvh; }
    .imd-panel--wide { max-width: min(69rem, 96vw); width: 100%; height: min(88dvh, 56rem); display: flex; flex-direction: column; }
    .imd-panel--wide .imd-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .imd-panel--wide .imd-body > .imd-wallet { flex: 1 1 auto; min-height: 0; }
    .imd-fab { right: 1.5rem; bottom: 1.5rem; }
}

/* ── contenuto d'attesa: paese + articolo dal magazine ────────────────── */
.imd-wait {
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--imd-line);
}
.imd-wait-country { font-size: 1rem; margin-bottom: 0.15rem; }
.imd-wait-cap {
    font-size: 0.75rem;
    color: var(--imd-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.imd-wait-art {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    border: 1px solid var(--imd-line);
    border-radius: 12px;
    padding: 0.55rem;
    text-decoration: none;
    color: var(--imd-ink);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.imd-wait-art:hover { border-color: var(--imd-accent); background: var(--imd-accent-soft); }
.imd-wait-img {
    width: 4.5rem;
    height: 3.2rem;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 auto;
}
.imd-wait-title { font-size: 0.9rem; font-weight: 600; line-height: 1.25; }
.imd-wait-meta { font-size: 0.75rem; color: var(--imd-muted); margin-top: 0.2rem; }

/* ── SCHEDA PAESE d'attesa + motion (28 lug): l'aereo percorre la rotta in
   loop, la scheda entra morbida, i fatti compaiono in sequenza. Palette
   Menevo: navy come inchiostro, oro come accento. ── */
.imd-scheda {
    --imd-navy: var(--menevo-navy, #243B5E);
    --imd-gold: var(--menevo-gold, #EFD06A);
    background: var(--menevo-cream, #FDF8EF);
    border: 1px solid rgba(36, 59, 94, 0.12);
    border-radius: var(--imd-radius);
    padding: 1rem 1.1rem 1.05rem;
    animation: imd-sk-in 0.45s ease both;
}
@keyframes imd-sk-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.imd-sk-route {
    position: relative;
    height: 26px;
    margin: 0.15rem 0.2rem 0.7rem;
}
.imd-sk-track {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    border-top: 2px dashed rgba(36, 59, 94, 0.28);
}
.imd-sk-dot {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--imd-gold);
    box-shadow: 0 0 0 3px rgba(239, 208, 106, 0.35);
    transform: translateY(-50%);
    left: 0;
}
.imd-sk-dot-b { left: auto; right: 0; }
.imd-sk-plane {
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    color: var(--imd-navy);
    animation: imd-sk-fly 3.2s ease-in-out infinite;
}
.imd-sk-plane svg { width: 100%; height: 100%; transform: rotate(45deg); }
@keyframes imd-sk-fly {
    0%   { transform: translate(0, -50%) rotate(0.001deg); opacity: 0; }
    8%   { opacity: 1; }
    50%  { transform: translate(calc((100cqw - 20px) / 2 - 0px), calc(-50% - 7px)); }
    92%  { opacity: 1; }
    100% { transform: translate(calc(100cqw - 28px), -50%); opacity: 0; }
}
.imd-sk-route { container-type: inline-size; }

.imd-sk-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.55rem;
}
.imd-sk-flag { font-size: 2.1rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(36, 59, 94, 0.18)); }
/* bandiera-immagine (flagcdn dal DB): l'helper condiviso la emette 20×14 inline
   per i select — qui è il pezzo forte della scheda, va alla taglia dell'emoji */
.imd-sk-flag img { width: 40px !important; height: 28px !important; border-radius: 5px !important; }
.imd-sk-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--imd-muted);
}
.imd-sk-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--imd-navy);
    line-height: 1.15;
}
.imd-sk-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}
.imd-sk-fact {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid rgba(36, 59, 94, 0.12);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    color: var(--imd-navy);
    opacity: 0;
    animation: imd-sk-in 0.4s ease forwards;
}
.imd-sk-fact b {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--imd-muted);
}
@media (prefers-reduced-motion: reduce) {
    .imd-scheda, .imd-sk-fact { animation-duration: 0.01s; }
    .imd-sk-plane { animation: none; left: 45%; opacity: 1; }
}
