/* omnifit: il sondaggio sulle maglie (js/sondaggio.js). Una finestra al centro, solo colori del tema. */
#surveyDlg {
  width: min(calc(100vw - 24px), 440px); max-height: calc(100dvh - 24px); box-sizing: border-box;
  border: 0; border-radius: 22px; padding: 0; overflow: auto;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgb(0 0 0 / .35);
}
#surveyDlg::backdrop { background: rgb(12 10 8 / .58); }
.sv { padding: 20px 18px 12px; font-family: var(--f-body); }
.sv-k { margin: 0 0 6px; font: 700 12px/1 var(--f-display); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.sv-h { margin: 0 0 6px; font: 700 22px/1.2 var(--f-body); letter-spacing: -.01em; }
.sv-p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* Davanti | Dietro */
.sv-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sv-seg button { min-height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 14px/1 var(--f-body); cursor: pointer; }
.sv-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* le due maglie */
.sv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.sv-o { display: grid; gap: 8px; padding: 6px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface-2); color: var(--ink); cursor: pointer; text-align: left; }
.sv-o[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.sv-img { display: block; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: #E8E4DF; }
.sv-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 2px; font-size: 15px; }
.sv-ck { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); color: transparent; }
.sv-ck svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sv-o[aria-pressed="true"] .sv-ck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* la lente sopra la foto: apre la foto grande */
.sv-cell { position: relative; display: grid; }
.sv-zoom { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgb(20 18 16 / .6); color: #fff; cursor: pointer; }
.sv-zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* la foto grande, a tutto schermo */
#surveyBig {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; box-sizing: border-box;
  background: var(--surface); color: var(--ink); overflow: hidden;
}
#surveyBig::backdrop { background: rgb(12 10 8 / .7); }
.svb {
  display: flex; flex-direction: column; gap: 10px; height: 100%; box-sizing: border-box; font-family: var(--f-body);
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.svb-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.svb-back { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.svb-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.svb .sv-seg { margin: 0; }
/* niente centratura qui (place-items vale anche nei blocchi): la foto ingrandita andrebbe fuori a sinistra, irraggiungibile */
.svb-view { flex: 1; min-height: 0; display: block; overflow: hidden; border-radius: 16px; background: #E6E3DE; }
.svb-view img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.svb-view.is-zoom { overflow: auto; overscroll-behavior: contain; }
.svb-view.is-zoom img { height: auto; max-width: none; cursor: zoom-out; }
.svb-bot { display: grid; gap: 10px; width: 100%; max-width: 440px; margin: 0 auto; }

/* commenti e pulsanti */
.sv-c { display: grid; gap: 6px; margin: 0 0 14px; }
.sv-c span { font-size: 13px; font-weight: 700; }
.sv-c small { font-weight: 500; color: var(--muted); }
.sv-c textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: 500 15px/1.4 var(--f-body); }
.sv-c textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.sv-send { width: 100%; min-height: 50px; justify-content: center; border-radius: 25px; font-size: 16px; }
.sv-send:disabled { opacity: .45; cursor: default; }
.sv-skip { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; color: var(--muted); font: 600 14.5px/1 var(--f-body); cursor: pointer; }
.sv-note { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* le risposte in «KPI e suggerimenti» (js/kpi.js → surveyHTML): una riga per persona, la scelta col colore della maglia */
.kp-sv { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kp-sv li { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.kp-sv-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.kp-sv-h b { font-weight: 600; overflow-wrap: anywhere; }
.kp-sv-h time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kp-sv-c {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--sv, var(--muted)) 16%, var(--surface)); color: var(--ink);
}
.kp-sv-c::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sv, var(--muted)); }
.kp-sv p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.kp-sv-0 { margin: 0; font-size: 13.5px; color: var(--muted); }

/* grazie */
.sv-done { text-align: center; padding-top: 26px; }
.sv-done-ic { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 10px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.sv-done-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sv-done .sv-p { margin-bottom: 18px; }

/* KPI: i filtri «Tutti · Arancione · Alloro · Ignorato» sopra l'elenco di chi ha votato */
.seg.kp-svf { display: flex; flex-wrap: wrap; width: 100%; max-width: 520px; margin-bottom: 10px; }
.kp-svf button { flex: 1 1 0; min-width: max-content; padding-inline: 8px; }
.kp-svs { scroll-margin-top: 120px; }
