/* KS Home Manager — Blocco A / Fields — v2.0 */

/* ── Sezione Blocco A — card "scelte" in evidenza ──────────── */
.kshm-block-a, .ks-block-b {
    margin: 6px 0 12px;
    padding: 35px;
    background: linear-gradient(135deg, #FFFFFF 0%, #EFF5FF 100%);
    border: 1px solid #E3EDFB;
    border-radius: 16px;
    border-bottom: none;             /* annulla il bordo di .kshm-block */
    box-shadow: 0 6px 20px rgba(22, 38, 96, 0.07);
}

/* ── Toggle "Dati di zona" ──────────────────────── */
.kshm-zone-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 24px;
    background: #F6F9FC;
    border: none;
    border-top: 1px solid rgba(218,234,245,0.80);
    border-bottom: 1px solid rgba(218,234,245,0.80);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: #8fa5b8;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    transition: background 160ms ease;
}

.kshm-zone-toggle:hover {
    background: #edf4fb;
    color: #5a7290;
}

.kshm-zone-toggle-icon {
    display: inline-block;
    font-size: 9px;
    transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.kshm-zone-details.collapsed .kshm-zone-toggle-icon {
    transform: rotate(180deg);
}

/* Collasso fluido della sezione zona */
.kshm-zone-details-content {
    overflow: hidden;
    max-height: 9999px;
    opacity: 1;
    transition:
        max-height 480ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity    300ms ease;
}

.kshm-zone-details.collapsed .kshm-zone-details-content {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* I dati di zona si vedono solo nello step 1; negli step successivi spariscono */
.kshm-zone-details.kshm-zone-hidden {
    display: none !important;
}

/* Nello step 1 sono sempre aperti: il toggle diventa una semplice intestazione */
.kshm-zone-toggle {
    cursor: default;
    pointer-events: none;
}
.kshm-zone-toggle-icon {
    display: none;
}

/* ── Riga header step: back button + dots ────── */
.kshm-ba-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* Micro-copy di spinta (Intervento 1): indicatore di progresso */
.kshm-step-indicator {
    margin: 0 0 16px;
    font-size: 13px;
    color: #84A8D5;
    font-weight: 500;
}

/* Eyebrow sopra la prima domanda (Intervento 2, solo step 1) */
.kshm-step-eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    padding-bottom: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #84A8D5;
}

/* Riga anti-obiezione sotto la CTA (Intervento 3) */
.kshm-ba-reassure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 14px 0 0;
    font-size: 13px;
    color: #5a7290;
    text-align: center;
}

/* Pulsante Indietro */
.kshm-ba-back-btn {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #8fa5b8;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 160ms ease;
}

.kshm-ba-back-btn:hover { color: #5a7290; }

/* Step dots */
.kshm-ba-steps {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.kshm-ba-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #DAEAF5;
    transition: background 300ms ease, transform 200ms ease;
    flex-shrink: 0;
}

.kshm-ba-dot.active { background: #0063FA; transform: scale(1.25); }
.kshm-ba-dot.done   { background: #162660; }

.kshm-ba-line {
    flex: 1;
    height: 2px;
    background: #DAEAF5;
    transition: background 300ms ease;
}

.kshm-ba-line.done { background: #162660; }

/* ── Pallini "di completamento" (nome/cognome + gate) ──────────────
   2026-07-13 — più grandi e chiari dei pallini-step reali, dopo un connettore
   tratteggiato: leggono come rifiniture finali, non come step di valutazione. */
.kshm-ba-line--completion {
    flex: 0 0 22px;
    height: 0;
    background: transparent;
    border-top: 2px dashed #c7d7f0;
    align-self: center;
}
.kshm-ba-line--completion.done { background: transparent; }  /* resta tratteggiato */
.kshm-ba-line--tiny { flex-basis: 12px; }
.kshm-ba-dot--completion {
    width: 13px;
    height: 13px;
    box-sizing: border-box;
    background: #EAF1FF;
    border: 2px solid #c7d7f0;
}
.kshm-ba-dot--completion.active { background: #9DC0FF; border-color: #9DC0FF; transform: scale(1.1); }
.kshm-ba-dot--completion.done   { background: #6f9be6; border-color: #6f9be6; }

/* ── Viewport / Slide track ────────────────────── */
.kshm-ba-viewport {
    overflow: hidden;
    position: relative;
    width: 100%;
    /* L'altezza segue lo step attivo (impostata via JS): il blocco cresce
       solo quando serve la sotto-scelta, niente gap sotto. */
    transition: height 340ms cubic-bezier(0.4, 0, 0.2, 1);
}

.kshm-ba-track {
    display: flex;
    width: 100%;
    /* flex-start: ogni pannello mantiene la sua altezza naturale (non si
       allunga al più alto), così la misura per-step è corretta. */
    align-items: flex-start;
    transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.kshm-ba-panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 5px;
    padding-right: 5px;
}

/* ── Titolo campo ──────────────────────────────── */
.kshm-field-label {
    font-size: 16px;
    font-weight: 600;
    color: #1A2A4F;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* v2.0: impact text — uppercase 11px, colore #84A8D5 */
.kshm-field-impact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #3e597b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 18px;
}

input#kshm-superficie-input, input#ks-gate-email{
    border: #d0e5ff 1px solid;
    border-radius: 5px;
}

.kshm-impact-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kshm-impact-dot.high   { background: #84A8D5; }
.kshm-impact-dot.medium { background: #b0c4d4; }

/* ── Slider Superficie ─────────────────────────── */
.kshm-slider-wrap { margin-bottom: 18px; }

.kshm-slider-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.kshm-superficie-input {
    width: 80px;
    font-size: 36px;
    font-weight: 600;
    color: #1A2A4F;
    letter-spacing: -0.03em;
    border: none;
    border-bottom: 2px solid #DAEAF5;
    background: transparent;
    padding: 0 4px 4px;
    outline: none;
    transition: border-color 200ms ease;
    -moz-appearance: textfield;
}

.kshm-superficie-input::-webkit-inner-spin-button,
.kshm-superficie-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.kshm-superficie-input:focus { border-bottom-color: #0063FA; }

.kshm-superficie-unit {
    font-size: 18px;
    color: #8fa5b8;
    font-weight: 500;
}

/* Slider track custom */
.kshm-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(
        to right,
        #162660 0%,
        #0063FA var(--slider-pct, 20%),
        #DAEAF5 var(--slider-pct, 20%),
        #DAEAF5 100%
    );
    outline: none;
    cursor: pointer;
}

.kshm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #0063FA;
    box-shadow: 0 2px 8px rgba(0,99,250,0.22);
    cursor: grab;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.kshm-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0,99,250,0.30);
    cursor: grabbing;
}

.kshm-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #0063FA;
    cursor: grab;
}

.kshm-slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #b0c4d4;
}

/* ── Pulsante conferma A1 ──────────────────────── */
.kshm-field-confirm-btn {
    width: 100%;
    height: 70px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #162660 0%, #0063FA 100%);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 180ms ease, transform 130ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.kshm-field-confirm-btn:hover  { opacity: 0.90; transform: translateY(-1px); }
.kshm-field-confirm-btn:active { opacity: 1;    transform: translateY(0); }

/* ── Step nome/cognome (2026-07-13) ────────────────
   Bassa frizione: due campi affiancati con autofill nativo (given/family-name),
   Enter che avanza, autofocus su desktop. */
.kshm-name-sub {
    margin: 6px 0 18px;
    font-size: 14px;
    line-height: 1.4;
    color: #5a7290;
}
.kshm-name-fields {
    display: flex;
    gap: 10px;
}
.kshm-name-fields .kshm-field-group { flex: 1 1 0; min-width: 0; }
.kshm-name-input {
    width: 100%;
    padding: 15px 16px;
    font-family: inherit;
    font-size: 16px;              /* ≥16px: niente zoom automatico iOS al focus */
    color: #162660;
    background: #fff;
    border: 1.5px solid #d5e0ef;
    border-radius: 12px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.kshm-name-input::placeholder { color: #9fb2ca; }
.kshm-name-input:focus {
    outline: none;
    border-color: #0063FA;
    box-shadow: 0 0 0 3px rgba(0, 99, 250, 0.12);
}
.kshm-name-error { margin: 10px 0 0; font-size: 13px; color: #d33a3a; }
#kshm-name-confirm { margin-top: 16px; }
.kshm-name-note { margin: 14px 0 0; font-size: 12.5px; color: #8a99b0; }

@media (max-width: 560px) {
    .kshm-name-fields { flex-direction: column; gap: 8px; }
}

/* ── Card grid (2×2) ───────────────────────────── */
.kshm-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kshm-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    border: 1.5px solid #DAEAF5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, transform 130ms ease, box-shadow 160ms ease;
    font-family: inherit;
    min-height: 80px;
}

.kshm-card:hover {
    border-color: #0063FA;
    background: #f0f6ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,99,250,0.12);
}

.kshm-card.selected {
    border-color: #162660;
    background: #162660;
    box-shadow: 0 4px 14px rgba(22,38,96,0.22);
}

.kshm-card.selected .kshm-card-label { color: #fff; }
.kshm-card.selected .kshm-card-delta { color: rgba(255,255,255,0.70); }

.kshm-card-icon  { font-size: 20px; line-height: 1; }
.kshm-card-label { font-size: 13px; font-weight: 600; color: #1A2A4F; line-height: 1.3; }
.kshm-card-delta { font-size: 11px; font-weight: 500; }
.kshm-card-delta.positive { color: #16a34a; }
.kshm-card-delta.negative { color: #e53e3e; }
.kshm-card-delta.neutral  { color: #8fa5b8; }

/* ── Feedback in-block ─────────────────────────── */
.kshm-ba-feedback {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f0f6ff;
    border-left: 3px solid #0063FA;
    font-size: 13px;
    color: #162660;
    font-weight: 500;
    animation: kshm-fadein 250ms ease;
}

@keyframes kshm-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── v2.0: Stima progressiva (ks-stima-block) — value card blu ──── */
.ks-stima-block {
    margin: 4px 0 10px;
    padding: 20px 22px 22px;
    background: #e3ebf7;
    border: 1px solid #d5e7ff;
    border: none;
    border-radius: 16px;
    /*box-shadow: 0 8px 26px rgba(21, 32, 87, 0.28);*/
}

.ks-stima-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #5a7290;
    text-transform: uppercase;
    margin: 0;
    padding-bottom: 0;
}

.ks-stima-range {
    font-size: 30px;
    font-weight: 800;
    color: #162660;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 10px;
    /* CSS transition per aggiornamenti senza JS RAF */
}

.ks-stima-sep   { color: rgba(255, 255, 255, 0.55); }
.ks-stima-grezza { color: rgba(255, 255, 255, 0.72); }

/* Barra di precisione su sfondo blu: track tenue + fill azzurro brillante */
.ks-stima-block .kshm-precision-bar-bg { background: #ffffff94 }
.ks-stima-block .kshm-precision-bar-fill {
    background: linear-gradient(90deg, #0063fa 0%, #0094fa 100%);;
}
.ks-stima-block .kshm-precision-text { color: #162660; }
.ks-stima-block .kshm-precision-text strong { color: #162660; }
.ks-stima-block #ks-precision-nudge { color: #1a73e8; }
.ks-stima-block .ks-inactivity-nudge { color: #5a7290; }

/* Stato sbloccato: range resta bianco (la chip comunica già lo sblocco) */
.ks-stima-block.ks-stima-unlocked .ks-stima-range { color: #162660; }

.ks-stima-sep {
    font-weight: 400;
    color: #8fa5b8;
    font-size: 22px;
}

/* Nota grezza iniziale */
.ks-stima-grezza {
    font-size: 12px;
    color: #8fa5b8;
    line-height: 1.45;
    margin: 0 0 12px;
    max-height: 100px;
    overflow: hidden;
    transition: opacity 300ms ease, max-height 400ms ease, margin 300ms ease;
    padding-bottom: 0px;
}

/* Dopo conferma A1: collassa */
.ks-stima-grezza.ks-stima-grezza-hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
}

/* Nudge inline di precisione */
#ks-precision-nudge {
    font-size: 11px;
    color: #8fa5b8;
    font-weight: 400;
}

/* Nudge inattività */
.ks-inactivity-nudge {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #8fa5b8;
    line-height: 1.4;
    animation: kshm-fadein 250ms ease;
}

/* ── Donut precisione + nudge (mostrati SOLO su mobile) — 2026-07-09 ──
   Su mobile la barra orizzontale è sostituita da un anello animato con la %
   dentro, a destra della forchetta. Su desktop restano nascosti. */
.ks-stima-nudge-m { display: none; }
.ks-stima-donut   { display: none; }

.ks-stima-donut svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* parte dall'alto */
}
.ks-donut-bg,
.ks-donut-fg {
    fill: none;
    stroke-width: 4;
}
.ks-donut-bg { stroke: #ffffff; }
.ks-donut-fg {
    stroke: #0063fa;
    stroke-linecap: round;
    stroke-dasharray: 119.38;   /* 2π·19 */
    stroke-dashoffset: 119.38;  /* vuoto all'inizio; il JS lo anima */
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.ks-stima-donut .ks-donut-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #162660;
}

.ks-inactivity-nudge[hidden] { display: none !important; }

.ks-nudge-btn {
    background: none;
    border: none;
    padding: 0;
    color: #0063FA;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ks-nudge-btn:hover { color: #0047c2; }

/* ── v2.0: Avviso sessione (dopo A3) ────────────── */
.ks-session-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 24px 0;
    font-size: 12px;
    color: #E07B00;
    line-height: 1.45;
    animation: kshm-fadein 300ms ease;
}

.ks-session-warning[hidden] { display: none !important; }

.ks-session-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #E07B00;
}

/* ── v2.0: stima sbloccata (dopo auth) ─────────── */
.ks-stima-block.ks-stima-unlocked .ks-stima-range {
    color: #162660;
}

/* Chip premiante: comunica lo sblocco ottenuto registrando la mail */
.ks-stima-block.ks-stima-unlocked::before {
    content: '🔓 Stima sbloccata — grazie!';
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #0063FA;
    background: #EAF1FF;
    padding: 4px 11px;
    border-radius: 999px;
    margin-bottom: 12px;
    animation: kshm-fadein 350ms ease;
}

/* ── v2.0: CTA valutazione ──────────────────────── */
.ks-valuation-cta {
    padding: 20px 24px;
    border-top: 1px solid rgba(218,234,245,0.80);
    animation: kshm-fadein 350ms ease;
}

.ks-valuation-cta[hidden] { display: none !important; }

.ks-valuation-headline {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #162660;
    letter-spacing: -0.01em;
}

.ks-valuation-body {
    margin: 0 0 16px;
    font-size: 13px;
    color: #5a7290;
    line-height: 1.5;
}

.ks-btn-valuation {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #162660 0%, #0063FA 100%);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 180ms ease, transform 130ms ease;
}

.ks-btn-valuation:hover  { opacity: 0.88; transform: translateY(-1px); }
.ks-btn-valuation:active { opacity: 1;    transform: translateY(0); }

/* ── Responsive mobile ─────────────────────────── */
@media (max-width: 768px) {
    .kshm-block-a { padding-top: 16px; }
    .kshm-cards-grid { gap: 8px; }
    .kshm-card { padding: 10px 12px; min-height: 70px; }
    .kshm-card-icon  { font-size: 18px; }
    .kshm-card-label { font-size: 12px; }
    .kshm-superficie-input { font-size: 28px; }
    .kshm-superficie-unit  { font-size: 16px; }
    .kshm-zone-toggle { padding: 10px 20px; }

    /* ── Stima one-liner + donut (2026-07-09, solo mobile) ──
       Donut fuori dal flusso (assoluto, centrato sull'intero blocco): l'altezza
       del div la detta solo la colonna testo, non i 56px del donut. */
    .ks-stima-block { position: relative; padding: 12px 18px; margin: 4px 0 8px; }
    .ks-stima-main  { display: block; padding-right: 62px; } /* spazio per il donut */
    .ks-stima-figures { min-width: 0; }
    /* Il pannello eredita line-height 26px che gonfia il blocco: qui lo comprimiamo */
    .ks-stima-block .ks-stima-label { line-height: 1.2; }
    .ks-stima-range   { font-size: 20px; line-height: 1; margin-bottom: 0; }
    /* .ks-stima-block scope: batte il padding-bottom:27px che il tema mette sui <p> */
    .ks-stima-block .ks-stima-nudge-m {
        display: block;
        margin: 3px 0 0;
        padding: 0;
        font-size: 12px;
        line-height: 1.3;
        white-space: nowrap;
        font-weight: 600;
        color: #1a73e8;
    }
    .ks-stima-donut {
        display: block;
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        width: 52px;
        height: 52px;
    }
    /* Elementi desktop nascosti su mobile (la % è nel donut, il nudge è sotto) */
    .ks-stima-grezza { display: none; }
    .ks-stima-block .kshm-precision-bar-bg,
    .ks-stima-block .kshm-precision-text { display: none; }

    /* 2026-07-09 — Eyebrow "5 risposte veloci…" nascosto su mobile (ridondante):
       la domanda sale subito sotto "Passo X di 5". */
    .kshm-step-eyebrow { display: none; }

    /* 2026-07-09 — Riga "impatto" nascosta su mobile (non interessa all'utente). */
    .kshm-field-impact { display: none; }

    /* 2026-07-09 — Gap "Passo X di 5" → domanda: lo step-indicator (un <p>) aveva
       il solito padding-bottom:27px del tema + 16px di margine. Azzero il padding e
       lascio un leggero stacco. (#id per battere la regola del tema). */
    #ks-step-indicator { padding-bottom: 0; margin: 0 0 12px; }
}

@media (min-width: 769px) {
    .kshm-zone-toggle { padding: 9px 20px; }
}

/* ── v2.0: Block A completato — nascosto quando Block B è attivo ── */
#kshm-block-a.ks-block-a-done {
    display: none;
}

/* ══════════════════════════════════════════════════
   v4.0: A2 descrizione card, A3 macro+sottotipo,
   A4 fascia anno, Gate motivo valutazione
   ══════════════════════════════════════════════════ */

/* ── Descrizione breve sotto il label nelle card ── */
.kshm-card-desc {
    font-size: 11px;
    color: #8fa5b8;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 2px;
}
.kshm-card.selected .kshm-card-desc { color: rgba(255,255,255,0.65); }

/* ── A3: Grid macro-tipo (4 card attive + 2 disabled) ── */
.kshm-macrotype-grid {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0;
}

/* ── A3: Sub-livello tipologia precisa ─────────── */
.kshm-tipologia-wrap {
    margin-top: 16px;
    animation: kshm-fadein 200ms ease;
}
.kshm-tipologia-wrap[hidden] { display: none !important; }

.kshm-tipologia-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.kshm-tipologia-divider::before,
.kshm-tipologia-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #DAEAF5;
}

.kshm-tipologia-divider-label {
    font-size: 11px;
    font-weight: 600;
    color: #8fa5b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.kshm-tipologia-grid {
    grid-template-columns: 1fr 1fr;
}

/* Card compatta per tipologia precisa */
.kshm-tipologia-card {
    min-height: 44px;
    padding: 10px 12px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
}

.kshm-tipologia-card .kshm-card-label {
    font-size: 12px;
}

/* ── A4: Grid fascia anno (max 3 colonne → 2 righe da 3) ──────── */
.kshm-anno-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.kshm-anno-grid .kshm-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 8px;
    min-height: 74px;
}

.kshm-anno-grid .kshm-card-label {
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
}

.kshm-anno-grid .kshm-card-delta {
    font-size: 12px;
    font-weight: 600;
}

/* ── A3 livello 3: Piano / Livelli (max 3 colonne) ──────────── */
.kshm-pl-wrap {
    margin-top: 14px;
    animation: kshm-fadein 280ms ease;
}

.kshm-pl-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.kshm-pl-grid[hidden] { display: none !important; }

.kshm-pl-grid .kshm-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 8px;
    min-height: 56px;
}

.kshm-pl-grid .kshm-card-label {
    font-size: 13px;
    text-align: center;
    line-height: 1.3;
}


/* ── Gate v4.0: motivo valutazione ─────────────── */
.ks-gate-motivo {
    margin-bottom: 16px;
}

.ks-gate-motivo-label {
    font-size: 12px;
    font-weight: 600;
    color: #8fa5b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

.ks-motivo-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.ks-motivo-card {
    padding: 9px 10px;
    border: 1.5px solid #DAEAF5;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #1A2A4F;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease;
    line-height: 1.3;
}

.ks-motivo-card:hover {
    border-color: #0063FA;
    background: #f0f6ff;
}

.ks-motivo-card.selected,
#ks-motivo-altro.selected {
    border-color: #162660;
    background: #162660;
    color: #fff;
}

.ks-motivo-altro {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 12px;
    color: #8fa5b8;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 150ms ease;
}
.ks-motivo-altro:hover { color: #5a7290; }

.ks-gate-separator {
    height: 1px;
    background: #DAEAF5;
    margin: 16px 0;
}

/* ── Bubble motivo valutazione (Blocco B1, post-registrazione) ── */
.ks-motivo-bubble {
    position: relative;
    margin-top: 18px;
    padding: 14px 16px 16px;
    background: #F4F8FE;
    border: 1.5px dashed #BFD8F0;
    border-radius: 14px;
    overflow: hidden;
    transition: max-height 420ms cubic-bezier(0.4,0,0.2,1),
                opacity 280ms ease, margin 320ms ease, padding 320ms ease;
    max-height: 420px;
    opacity: 1;
}

.ks-motivo-bubble.ks-motivo-bubble--closed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

.ks-motivo-bubble-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    line-height: 1;
    border: none;
    background: none;
    color: #9bb4d0;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: color 150ms ease, background 150ms ease;
}
.ks-motivo-bubble-close:hover { color: #5a7290; background: #e6eff9; }

.ks-motivo-bubble-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 24px;
}

.ks-motivo-bubble-icon { font-size: 17px; line-height: 1; }

.ks-motivo-bubble-q {
    font-size: 13.5px;
    font-weight: 700;
    color: #1A2A4F;
    line-height: 1.3;
}

.ks-motivo-bubble-hint {
    font-size: 11.5px;
    color: #7d96b5;
    margin: 4px 0 12px;
    line-height: 1.3;
}

.ks-motivo-bubble .ks-motivo-cards { margin-bottom: 10px; }

.ks-motivo-bubble-thanks {
    font-size: 12.5px;
    font-weight: 600;
    color: #16a34a;
    margin: 8px 0 0;
}

/* ── Responsive A4 fascia anno (mobile: 2+3) ──── */
@media (max-width: 480px) {
    .kshm-anno-grid {
        grid-template-columns: 1fr 1fr;
    }
    .kshm-macrotype-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ks-motivo-cards {
        grid-template-columns: 1fr;
    }
}
