/* UI mobile del sopralluogo: full-width, touch-friendly, barra superiore sticky. */
body { background: #f4f5f7; }

.survey-shell { max-width: 720px; margin: 0 auto; padding-bottom: 3rem; }

.survey-top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .6rem .8rem; background: #fff; border-bottom: 1px solid #e0e0e0;
}
.survey-top-title { line-height: 1.1; }

.survey-place { padding: .25rem .6rem; }
.survey-place-h {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
    color: #555; margin: .9rem 0 .4rem;
}

.survey-item { padding: .35rem 0; border-top: 1px solid #f0f0f0; }
.survey-item-point { font-size: .9rem; }

/* Pulsanti esito a tutta larghezza del gruppo, comodi da toccare */
.survey-item .btn-group { width: 100%; }
.survey-item .btn-group .btn { flex: 1; min-height: 38px; }

/* Foto per voce: miniature + pulsante camera */
.survey-photos { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.survey-thumb {
    position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden;
    background: #eee; display: flex; align-items: center; justify-content: center;
}
.survey-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.survey-thumb-x {
    position: absolute; top: 0; right: 0; border: 0; padding: 0;
    width: 20px; height: 20px; line-height: 18px; font-size: 14px;
    background: rgba(0,0,0,.55); color: #fff; border-radius: 0 0 0 6px;
}
.survey-thumb-loading { border: 1px dashed #ccc; background: transparent; }
.survey-photo-add {
    width: 64px; height: 64px; border: 1px dashed #aaa; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    cursor: pointer; color: #1976d2; margin: 0;
}

/* Banner offline */
.survey-offline-banner {
    background: #b71c1c; color: #fff; text-align: center; padding: .4rem .8rem; font-size: .85rem;
}

/* Elenco luoghi */
.survey-places { padding: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.survey-place-card {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: .8rem .9rem;
    margin-bottom: .5rem;
}
.survey-place-card-main { flex: 1; min-width: 0; line-height: 1.2; }
.survey-chev { color: #bbb; font-size: 1.3rem; line-height: 1; }

/* Icona semantica della riga (luogo, attività, trasversali, pericolo…) */
.survey-row-icon { flex: 0 0 auto; font-size: 1.15rem; line-height: 1; }

/* Risalita di un livello + briciole di pane */
.survey-up {
    flex: 0 0 auto; border: 0; background: transparent; color: #1976d2;
    font-size: 1.6rem; line-height: 1; padding: 0 .3rem 0 0; cursor: pointer;
}
.survey-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem; font-size: .95rem; }
.survey-crumb {
    border: 0; background: transparent; padding: 0; color: #1976d2;
    font-size: .95rem; line-height: 1.2; cursor: pointer; text-decoration: none;
}
.survey-crumb-sep { color: #bbb; }
.survey-crumb-cur { font-weight: 700; color: #212529; }

/* Filtro «Solo da fare» */
.survey-filter { padding: .45rem .6rem 0; }
.survey-filter-btn {
    border: 1px solid #ced4da; background: #fff; border-radius: 999px;
    padding: .25rem .7rem; font-size: .85rem; color: #444; cursor: pointer;
}
.survey-filter-btn.on { background: #1976d2; border-color: #1976d2; color: #fff; }

/* Contesto del pericolo (luogo/attività) dentro la card aperta */
.survey-risk-context {
    font-size: .8rem; color: #1976d2; background: #eef4fc; border-radius: 6px;
    padding: .25rem .45rem; margin-bottom: .35rem;
}

/* Pallino di stato della singola domanda (risposta / da fare) */
.survey-item-state { color: #999; margin-right: .25rem; }

/* Ambito senza pericoli (o svuotato dal filtro) */
.survey-empty { color: #777; font-size: .9rem; padding: 1.2rem .4rem; text-align: center; }

/* Requisiti Allegato IV: una riga di contesto sopra i capitoli */
.survey-a4-intro { color: #555; font-size: .85rem; padding: .5rem .2rem .2rem; }

/* Scorciatoia sempre a portata di pollice */
.survey-next-fab {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: .8rem; z-index: 20;
    border: 0; border-radius: 999px; background: #1976d2; color: #fff;
    padding: .6rem 1.1rem; font-size: .9rem; font-weight: 600;
    box-shadow: 0 3px 12px rgba(0,0,0,.28); cursor: pointer;
}

/* Dettaglio luogo + fisarmonica rischi */
.survey-place-body { padding: .25rem .6rem 2rem; }
.survey-group-h {
    position: sticky; top: 3.25rem; z-index: 5;   /* resta sotto la barra del luogo (sticky top:0) */
    background: #f4f5f7; border-bottom: 1px solid #e6e6e6;
    font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: #555; margin: 0 0 .4rem; padding: .6rem .2rem .35rem;
}
.survey-risk-head {
    display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
    background: transparent; border: 0; padding: .6rem .7rem;
}
.survey-risk-head-main { flex: 1; min-width: 0; }

/* Rilievo libero del luogo (osservazione + foto fuori dalle domande) */
.survey-free { padding: .2rem .1rem 1.5rem; }

/* Riga nota con pulsante "espandi" */
.survey-note-row { display: flex; align-items: stretch; gap: .3rem; }
.survey-note-row .form-control { flex: 1; }
.survey-note-expand {
    flex: 0 0 auto; border: 1px solid #ced4da; background: #fff; border-radius: .25rem;
    width: 34px; font-size: 1.1rem; line-height: 1; color: #1976d2; cursor: pointer;
}

/* Editor nota a schermo intero */
.survey-note-overlay {
    position: fixed; inset: 0; z-index: 1050; background: rgba(0,0,0,.45);
    display: flex; align-items: flex-end; justify-content: center;
}
.survey-note-sheet {
    background: #fff; width: 100%; max-width: 720px; border-radius: 14px 14px 0 0;
    padding: 1rem; box-shadow: 0 -4px 20px rgba(0,0,0,.25);
    display: flex; flex-direction: column; max-height: 92vh;
}
.survey-note-head { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; }
.survey-note-q { flex: 1; font-size: .95rem; }
/* Almeno ~5-6 righe garantite anche con la tastiera aperta (min in rem, non vh); cresce per riempire il foglio. */
.survey-note-area { flex: 1; min-height: 9rem; font-size: 1rem; line-height: 1.4; resize: vertical; }

/* Visore foto a schermo intero */
.survey-photo-overlay {
    position: fixed; inset: 0; z-index: 1060; background: rgba(0,0,0,.9);
    display: flex; align-items: center; justify-content: center; padding: .5rem;
}
.survey-photo-full { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Riepilogo pre-Termina */
.survey-summary-row {
    display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid #f0f0f0;
}
.survey-summary-places { margin: .3rem 0; padding: 0; font-size: .9rem; display: flex; flex-direction: column; gap: .3rem; }
/* Riga del residuo: tocca per andare direttamente in quell'ambito */
.survey-summary-jump {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
    text-align: left; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: .45rem .6rem; font-size: .88rem; cursor: pointer;
}
