:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f4f7fb;--blue:#2563eb;--blue2:#1d4ed8;--muted:#667085;--line:#dfe6ef;--green:#159447;--red:#dc2626;--slate:#607d8b;--card:#fff}*{box-sizing:border-box}body{margin:0;background:#f4f7fb;color:#172033}button,input,select,textarea{font:inherit}button{cursor:pointer}.boot{padding:40px;text-align:center}.shell{max-width:840px;margin:0 auto;min-height:100vh;background:#f4f7fb}.hero{background:linear-gradient(135deg,#2d65d8,#568ceb);color:#fff;padding:24px 18px 20px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.eyebrow{font-weight:800;font-size:.72rem;letter-spacing:.12em;opacity:.9}.hero h1{font-size:1.75rem;line-height:1.05;margin:5px 0}.hero p{margin:0;opacity:.88}.userPill{border:1px solid rgba(255,255,255,.5);background:rgba(255,255,255,.12);color:#fff;border-radius:999px;padding:8px 10px;font-weight:700}.nav{display:grid;grid-template-columns:repeat(3,1fr);background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}.nav button{border:0;background:#fff;padding:14px 6px;font-weight:750;color:#64748b;border-bottom:3px solid transparent}.nav button.active{color:var(--blue);border-bottom-color:var(--blue)}.view{padding:16px}.stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}.stat{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:0 2px 8px rgba(30,50,90,.04)}.stat strong{display:block;font-size:1.7rem;color:var(--blue)}.stat span{font-size:.85rem;color:var(--muted)}h2{font-size:1.15rem;margin:18px 0 10px}.siteCard,.historyCard,.issueCard,.infoPanel,.accountCard,.generalCard{background:#fff;border:1px solid var(--line);border-radius:16px}.siteCard{width:100%;display:flex;align-items:center;gap:14px;padding:16px;margin:9px 0;text-align:left;box-shadow:0 2px 8px rgba(30,50,90,.04)}.siteIcon{width:42px;height:42px;border-radius:12px;background:#eaf1ff;color:var(--blue);display:grid;place-items:center;font-size:1.25rem}.siteCard strong{display:block}.siteCard small{display:block;color:var(--muted);margin-top:4px}.siteCard b{margin-left:auto;font-size:1.6rem;color:#94a3b8}.infoPanel{padding:15px;margin-top:16px;color:#475569}.infoPanel p{margin:6px 0 0;font-size:.9rem}.loginWrap{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(160deg,#eaf2ff,#f8fafc 48%,#eef4ff)}.loginCard{width:min(420px,100%);background:#fff;border:1px solid var(--line);border-radius:22px;padding:26px;box-shadow:0 20px 60px rgba(31,65,120,.15)}.brand{display:flex;align-items:center;gap:14px;margin-bottom:20px}.brandIcon{width:52px;height:52px;border-radius:16px;background:var(--blue);color:#fff;display:grid;place-items:center;font-size:1.6rem;font-weight:900}.loginCard h1{margin:0;font-size:1.45rem}.loginCard p{margin:4px 0 0;color:var(--muted)}label.field{display:block;margin:12px 0;color:#344054;font-weight:650}.field input,.field select,.field textarea,.issueEdit input,.issueEdit select,.issueEdit textarea{width:100%;border:1px solid #cfd8e6;border-radius:11px;padding:11px;background:#fff;color:#172033;margin-top:6px}.field textarea,.issueEdit textarea{min-height:88px;resize:vertical}.primary,.secondary,.danger,.ghost{border:0;border-radius:11px;padding:11px 14px;font-weight:750}.primary{background:var(--blue);color:#fff}.primary:hover{background:var(--blue2)}.secondary{background:#eaf1ff;color:#1747a6}.ghost{background:#fff;border:1px solid var(--line);color:#344054}.danger{background:#fee2e2;color:#991b1b}.full{width:100%}.error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b;padding:10px;border-radius:10px;margin:10px 0}.topbar{background:#fff;border-bottom:1px solid var(--line);padding:11px 14px;display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:20}.topbar h1{font-size:1.05rem;margin:0;flex:1}.back{border:0;background:#eef3fa;width:38px;height:38px;border-radius:12px;font-size:1.15rem}.metaGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:#fff;border-bottom:1px solid var(--line);padding:12px 14px}.metaGrid .wide{grid-column:1/-1}.metaGrid label{font-size:.78rem;font-weight:750;color:#475569}.metaGrid input,.metaGrid select{width:100%;padding:9px;border:1px solid #d6deea;border-radius:9px;margin-top:4px}.progressBox{padding:11px 14px;background:#fff;border-bottom:1px solid var(--line)}.progressLine{height:8px;background:#e7edf6;border-radius:999px;overflow:hidden}.progressLine i{display:block;height:100%;background:var(--blue)}.progressText{display:flex;justify-content:space-between;font-size:.8rem;color:#64748b;margin-top:6px}.sectionTitle{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:#2470b8;margin:20px 4px 8px;font-weight:850}.checkCard{background:#fff;border:1px solid var(--line);border-radius:16px;margin:10px 0;overflow:hidden}.checkHead{padding:14px 14px 10px}.checkHead h3{margin:0;font-size:1rem}.checkHead p{margin:5px 0 0;color:#667085;font-size:.84rem}.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding:0 12px 12px}.choice{border:1px solid #d5dce7;background:#fff;border-radius:11px;padding:9px 5px;font-weight:750;font-size:.82rem;color:#344054}.choice:before{display:block;margin:auto auto 4px;width:22px;height:22px;border-radius:50%;color:#fff;line-height:22px;text-align:center;font-size:.78rem}.choice.ok:before{content:"✓";background:var(--green)}.choice.bad:before{content:"×";background:var(--red)}.choice.nd:before{content:"–";background:var(--slate)}.choice.selected{outline:3px solid rgba(37,99,235,.15);border-color:#7ca4f6;background:#f6f9ff}.detailsToggle{display:flex;gap:6px;flex-wrap:wrap;padding:0 12px 12px}.mini{border:0;background:#fff;color:#475569;padding:6px 7px;font-size:.8rem}.details{border-top:1px solid #edf1f6;padding:12px;background:#fbfcfe}.details .field{margin:8px 0}.evidence{max-width:100%;max-height:260px;border-radius:12px;border:1px solid var(--line);margin-top:8px}.audio{width:100%;margin-top:8px}.sticky{position:sticky;bottom:0;background:rgba(244,247,251,.94);backdrop-filter:blur(10px);padding:10px 14px calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1.4fr;gap:8px;border-top:1px solid var(--line)}.generalCard{padding:14px;margin-top:16px}.summary{display:flex;justify-content:space-between;align-items:center;margin:12px 0;padding:14px;border-radius:14px;background:#fff0f0;border:1px solid #fecaca}.summary strong{font-size:1.5rem;color:#b91c1c}.historyCard{padding:14px;margin:9px 0;display:flex;align-items:center;gap:12px}.historyCard>div:first-child{flex:1}.historyCard strong,.historyCard span,.historyCard small{display:block}.historyCard span{font-size:.85rem;color:#475569;margin-top:3px}.historyCard small{font-size:.78rem;color:#7a8699;margin-top:3px}.buttons{display:flex;gap:6px;flex-wrap:wrap}.buttons button{padding:8px 10px}.filterBar{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 14px}.filterBar select{padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}.issueCard{padding:14px;margin:10px 0}.issueTop{display:flex;justify-content:space-between;gap:10px}.issueTop strong{display:block}.issueTop small{color:#667085}.status{font-size:.74rem;font-weight:800;border-radius:999px;padding:5px 8px;white-space:nowrap;height:max-content}.status.open{background:#fee2e2;color:#991b1b}.status.in_progress{background:#fef3c7;color:#92400e}.status.resolved{background:#dbeafe;color:#1e40af}.status.verified{background:#dcfce7;color:#166534}.issueCard p{margin:9px 0;color:#475569}.issueEdit{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.issueEdit .wide{grid-column:1/-1}.accountCard{padding:16px;margin:10px 0}.accountCard h3{margin-top:0}.toast{position:fixed;bottom:82px;left:50%;transform:translateX(-50%);background:#172033;color:#fff;padding:10px 14px;border-radius:10px;z-index:99;max-width:90%;box-shadow:0 8px 30px rgba(0,0,0,.2)}.empty{text-align:center;color:#7a8699;padding:34px 12px}.rec{background:#fee2e2!important;color:#991b1b!important}.muted{color:#667085;font-size:.86rem}@media(max-width:560px){.hero{padding-top:18px}.hero h1{font-size:1.45rem}.hero p{font-size:.86rem}.userPill{font-size:.75rem}.view{padding:12px}.historyCard{align-items:flex-start;flex-direction:column}.historyCard .buttons{width:100%}.historyCard .buttons button{flex:1}.issueEdit{grid-template-columns:1fr}.issueEdit .wide{grid-column:auto}.metaGrid{grid-template-columns:1fr}.metaGrid .wide{grid-column:auto}}

.issueRef{display:inline-block;margin-top:7px;padding:4px 7px;border-radius:7px;background:#eef3fa;color:#334155;font-size:.68rem;font-weight:800;letter-spacing:.02em}.issueEvidence{margin:12px 0;padding:10px;border:1px solid #d9e5f6;background:#f8fbff;border-radius:12px}.evidenceTitle{font-size:.82rem;color:#334155;margin-bottom:8px}.issuePhotos{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.issuePhotos a{display:block;text-decoration:none;color:#475569;font-size:.72rem;text-align:center}.issuePhotos img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:9px;border:1px solid #d6deea;background:#fff;display:block;margin-bottom:4px}.noEvidence{margin:10px 0;padding:9px 10px;border-radius:10px;background:#f8fafc;color:#7a8699;font-size:.8rem;border:1px dashed #d6deea}@media(max-width:560px){.issuePhotos{grid-template-columns:repeat(3,minmax(0,1fr))}}
.scopeBox{background:#fff;border-bottom:1px solid var(--line);padding:12px 14px}.scopeHead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.scopeHead strong{display:block;color:#27364f}.scopeHead small{display:block;color:#667085;font-size:.78rem;margin-top:3px;line-height:1.35}.compact{padding:8px 10px;white-space:nowrap}.scopeTags{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.scopeTags span{background:#eef4ff;color:#2457ad;border:1px solid #d8e5ff;border-radius:999px;padding:5px 8px;font-size:.72rem;font-weight:750}.scopeEmpty{margin-top:10px;padding:10px;border:1px dashed #cfd8e6;border-radius:10px;color:#667085;font-size:.82rem;background:#f8fafc}.scopeEditor{margin-top:12px;border-top:1px solid #edf1f6;padding-top:12px}.scopeActions{display:flex;gap:7px;margin-bottom:10px}.scopeActions button{padding:7px 9px;font-size:.78rem}.scopeSection{padding:9px 0;border-top:1px solid #f0f3f8}.scopeSection:first-of-type{border-top:0}.scopeSection>b{display:block;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:#2470b8;margin-bottom:6px}.scopeItem{display:flex;align-items:flex-start;gap:9px;padding:7px 2px;font-size:.85rem;color:#344054}.scopeItem input{width:18px;height:18px;margin-top:1px;accent-color:var(--blue)}.scopeItem span{line-height:1.3}@media(max-width:560px){.scopeHead{align-items:center}.scopeHead small{max-width:220px}.compact{font-size:.78rem}}

.dangerZone{margin-top:18px;background:#fff;border:1px solid #fecaca;border-radius:16px;padding:14px}.dangerZoneHead{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.dangerZoneHead strong{display:block;color:#7f1d1d}.dangerZoneHead p{margin:4px 0 0;color:#667085;font-size:.82rem;line-height:1.4}.dangerZoneHead>span{background:#fee2e2;color:#991b1b;border-radius:999px;padding:5px 8px;font-size:.72rem;font-weight:800}.resetGrid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}.resetCard{border:1px solid #f1d1d1;background:#fffafa;border-radius:12px;padding:11px;display:flex;align-items:center;gap:10px;justify-content:space-between}.resetCard b,.resetCard small{display:block}.resetCard small{color:#7a8699;font-size:.76rem;margin-top:3px}.resetCard .danger{white-space:nowrap}.resetNote{margin:10px 0 0;color:#7a8699;font-size:.76rem;line-height:1.4}@media(max-width:560px){.resetGrid{grid-template-columns:1fr}.resetCard{align-items:flex-start;flex-direction:column}.resetCard .danger{width:100%}}

.issueAudios{display:grid;gap:9px}.issueAudio{border:1px solid #d6deea;background:#fff;border-radius:11px;padding:10px}.audioMeta{display:grid;gap:3px;margin-bottom:7px}.audioMeta strong{font-size:.84rem;color:#27364f}.audioMeta code{width:max-content;max-width:100%;overflow-wrap:anywhere;background:#eef3fa;color:#334155;padding:3px 6px;border-radius:6px;font-size:.67rem;font-weight:800}.audioMeta small{color:#7a8699;font-size:.72rem}.issueAudio audio{width:100%;height:42px}.audioOpen{display:inline-block;margin-top:6px;color:#2457ad;font-size:.74rem;font-weight:750;text-decoration:none}.audioOpen:hover{text-decoration:underline}.audioEvidence{background:#fbfcff}
.dangerSub{margin:16px 0 8px;color:#7f1d1d;font-size:.88rem}.resetLevels{display:grid;gap:9px}.resetLevel{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #f1d1d1;background:#fffafa;border-radius:12px;padding:11px}.resetLevel>div{min-width:0}.resetLevel b,.resetLevel small{display:block}.resetLevel small{color:#667085;font-size:.76rem;line-height:1.4;margin-top:3px}.levelBadge{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:.72rem;font-weight:900;margin-right:6px}.resetLevel.critical{border-color:#fca5a5;background:#fff1f2}.dangerSoft,.dangerStrong{border:0;border-radius:11px;padding:10px 12px;font-weight:800;white-space:nowrap}.dangerSoft{background:#fff1f2;color:#9f1239;border:1px solid #fecdd3}.dangerStrong{background:#b91c1c;color:#fff}.dangerStrong:hover{background:#991b1b}.resetNote code{background:#f1f5f9;padding:2px 5px;border-radius:5px}@media(max-width:560px){.resetLevel{align-items:flex-start;flex-direction:column}.resetLevel button{width:100%}}

/* v1.7 — correzioni responsive mobile (in particolare Gestione criticità) */
html,body,#app{width:100%;max-width:100%;overflow-x:hidden}
.shell{width:100%;max-width:840px;overflow-x:hidden}
.hero>*,.nav>*,.view,.issueCard,.issueTop,.issueTop>div,.issueEdit,.issueEdit>*{min-width:0;max-width:100%}
.userPill{max-width:48%;white-space:normal;line-height:1.2;text-align:center}
.nav{width:100%;min-width:0}
.nav button{min-width:0;overflow:hidden;text-overflow:ellipsis}
.filterBar{width:100%;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.filterBar select{width:100%;min-width:0;max-width:100%;text-overflow:ellipsis}
.issueCard{overflow:hidden}
.issueTop strong,.issueTop small,.issueRef,.issueCard p{overflow-wrap:anywhere;word-break:break-word}
.issueEvidence,.issueAudio,.issueAudios{min-width:0;max-width:100%;overflow:hidden}
.issueAudio audio{width:100%;max-width:100%}
.issueEdit label{min-width:0;max-width:100%}
.issueEdit input,.issueEdit select,.issueEdit textarea{min-width:0;max-width:100%}
@media(max-width:560px){
  .filterBar{grid-template-columns:1fr;gap:9px}
  .filterBar select{font-size:1rem;padding:11px 12px}
  .issueTop{align-items:flex-start}
  .status{flex:0 0 auto}
  .issueCard{padding:12px}
  .issueEvidence{padding:9px}
}
@media(max-width:380px){
  .hero{gap:9px;padding-left:14px;padding-right:14px}
  .hero h1{font-size:1.28rem}
  .hero p{font-size:.8rem}
  .userPill{font-size:.7rem;padding:7px 8px;max-width:44%}
  .nav button{font-size:.9rem;padding-left:3px;padding-right:3px}
}

/* v1.8 — mobile robusto anche se Chrome conserva uno zoom pagina diverso da 100% */
.touch-device body,.touch-device #app{width:100%;max-width:none;overflow-x:hidden}
.touch-device .shell{width:100%;max-width:none;margin:0;overflow-x:hidden}
.touch-device .filterBar{grid-template-columns:1fr;gap:9px}
.touch-device .filterBar select{width:100%;min-width:0;max-width:100%;font-size:1rem;padding:11px 12px}
.touch-device .issueEdit{grid-template-columns:1fr}
.touch-device .issueEdit .wide{grid-column:auto}
.touch-device .issueTop{align-items:flex-start}
.touch-device .issueCard{width:100%;max-width:100%;padding:12px;overflow:hidden}
.touch-device .issueEvidence{padding:9px}
.touch-device .issuePhotos{grid-template-columns:repeat(3,minmax(0,1fr))}
.touch-device .historyCard{align-items:flex-start;flex-direction:column}
.touch-device .historyCard .buttons{width:100%}
.touch-device .historyCard .buttons button{flex:1}

@media (hover:none) and (pointer:coarse){
  .shell{width:100%;max-width:none;margin:0}
  .filterBar{grid-template-columns:1fr;gap:9px}
  .issueEdit{grid-template-columns:1fr}
  .issueEdit .wide{grid-column:auto}
}

/* v1.9 — gestione utenti e privilegi */
.dynamicNav{grid-template-columns:repeat(3,1fr)}
.permissionEmpty{background:#fff;border:1px solid var(--line);border-radius:14px;margin-top:8px}
.permissionInfo{margin:0 0 12px}
.accountTitleRow{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.accountTitleRow h3{margin:0}
.accountTitleRow p{margin:5px 0 0;line-height:1.4}
.newUserBox{margin:14px 0;padding:14px;border:1px solid #cfe0ff;background:#f8fbff;border-radius:14px}
.newUserBox[hidden]{display:none}
.userAdminCard{border:1px solid var(--line);background:#fbfcfe;border-radius:14px;padding:13px;margin:11px 0}
.userAdminCard.locked{background:#f8fafc}
.userAdminHead{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}
.userAdminHead strong,.userAdminHead small{display:block}
.userAdminHead small{color:#667085;margin-top:3px;font-size:.78rem}
.userState{font-size:.7rem;font-weight:850;border-radius:999px;padding:5px 8px;white-space:nowrap}
.userState.on{background:#dcfce7;color:#166534}.userState.off{background:#fee2e2;color:#991b1b}
.userAdminFields{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.userAdminFields .wide{grid-column:1/-1}
.userAdminFields label{font-size:.78rem;font-weight:750;color:#475569;min-width:0}
.userAdminFields input,.userAdminFields select{width:100%;min-width:0;margin-top:5px;border:1px solid #cfd8e6;border-radius:10px;padding:10px;background:#fff;color:#172033}
.activeToggle{display:flex!important;align-items:center;gap:8px;margin-top:3px}
.activeToggle input{width:18px!important;height:18px;margin:0!important;accent-color:var(--blue)}
.permGrid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:8px 0 12px}
.permCheck{display:flex;align-items:flex-start;gap:8px;border:1px solid #e1e8f2;background:#fff;border-radius:10px;padding:9px;font-size:.78rem;color:#344054;font-weight:650}
.permCheck input{width:18px;height:18px;margin:0;flex:0 0 auto;accent-color:var(--blue)}
.userAdminCard h4,.newUserBox h4{margin:13px 0 6px;font-size:.86rem;color:#334155}
.userAdminActions{margin-top:9px}
.issueReadOnly{border-top:1px solid #edf1f6;margin-top:10px;padding-top:8px}
.issueReadOnly p{margin:6px 0;font-size:.84rem}
@media(max-width:560px){
  .accountTitleRow{flex-direction:column}.accountTitleRow button{width:100%}
  .userAdminFields{grid-template-columns:1fr}.userAdminFields .wide{grid-column:auto}
  .permGrid{grid-template-columns:1fr}
  .userAdminActions{display:grid;grid-template-columns:1fr}.userAdminActions button{width:100%}
}

/* v1.12 — guida rapida ai tipi di sopralluogo */
.typeGuide{margin:14px 18px 0;display:grid;gap:10px;min-width:0}
.typeGuideCurrent{background:#eef4ff;border:1px solid #cbd9ff;border-radius:16px;padding:14px 16px;color:#18233a;min-width:0}
.typeGuideCurrent strong{display:block;font-size:.86rem;color:#3157b7;margin:0 0 3px}
.typeGuideCurrent p{margin:0 0 10px;line-height:1.42;overflow-wrap:anywhere}
.typeGuideCurrent p:last-child{margin-bottom:0}
.typeGuideAll{background:#fff;border:1px solid #dce3ef;border-radius:14px;overflow:hidden;min-width:0}
.typeGuideAll summary{cursor:pointer;padding:13px 15px;font-weight:800;color:#294b9e;list-style-position:inside}
.typeGuideList{display:grid;gap:8px;padding:0 12px 12px;min-width:0}
.typeGuideItem{display:grid;gap:5px;padding:11px 12px;border:1px solid #e0e5ef;border-radius:12px;background:#fafbfe;min-width:0}
.typeGuideItem.current{border-color:#8eabf4;background:#f0f5ff}
.typeGuideItem b{font-size:.94rem;overflow-wrap:anywhere}
.typeGuideItem small{display:block;line-height:1.4;color:#5d6678;overflow-wrap:anywhere}
.typeGuideItem small strong{color:#273650}
@media(max-width:640px){
  .typeGuide{margin:12px 14px 0}
  .typeGuideCurrent{padding:13px 14px;border-radius:14px}
  .typeGuideAll summary{padding:12px 13px}
  .typeGuideList{padding:0 10px 10px}
}

/* v1.13 — composizione report PDF con fotografie per voce */
.reportShell{padding-bottom:92px}.reportTopTitle{min-width:0;flex:1}.reportTopTitle h1{margin:0;font-size:1.05rem}.reportTopTitle small{display:block;color:#667085;margin-top:2px;overflow-wrap:anywhere}.reportIntro,.reportSummaryCard{background:#fff;border-bottom:1px solid var(--line);padding:14px}.reportIntro h2{margin:0 0 6px}.reportIntro p{margin:0;color:#667085;line-height:1.45;font-size:.88rem}.reportActions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px}.reportActions span{margin-left:auto;color:#475569;font-size:.8rem;font-weight:800}.reportSummaryCard{margin-top:10px;border:1px solid var(--line);border-radius:15px}.reportSummaryCard .field{margin:0}.reportSummaryCard textarea{min-height:120px}.formulaBtn{margin-top:8px}.reportItems{padding:8px 14px 18px}.reportItem{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;margin:10px 0;overflow:hidden}.reportItemHead{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reportItemHead>div{min-width:0}.reportItemHead strong,.reportItemHead small{display:block}.reportItemHead strong{overflow-wrap:anywhere}.reportItemHead small{font-size:.75rem;color:#667085;margin-top:4px}.reportOutcome{font-size:.72rem;font-weight:850;border-radius:999px;background:#e8f7ee;color:#166534;padding:5px 8px;white-space:nowrap}.reportOutcome.problem{background:#fee2e2;color:#991b1b}.reportItem>p{color:#475569;font-size:.84rem;margin:9px 0;overflow-wrap:anywhere}.reportPhotos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}.reportPhoto{border:1px solid #dbe3ef;border-radius:13px;padding:9px;background:#fafcff;min-width:0}.reportPhoto.selected{border-color:#7ca4f6;background:#f2f6ff;box-shadow:0 0 0 2px rgba(37,99,235,.08)}.reportPhotoPick{display:flex;align-items:center;gap:6px;font-size:.74rem;font-weight:800;color:#334155;margin-bottom:7px}.reportPhotoPick input{width:18px;height:18px;accent-color:var(--blue);flex:0 0 auto}.reportPhoto a{display:block}.reportPhoto img{display:block;width:100%;height:180px;object-fit:cover;border-radius:10px;border:1px solid #d6deea;background:#fff}.reportCaption{display:block;font-size:.72rem;font-weight:750;color:#475569;margin-top:8px}.reportCaption input{width:100%;min-width:0;border:1px solid #cfd8e6;border-radius:9px;padding:8px;margin-top:4px;background:#fff}.reportPhoto small{display:block;color:#7a8699;font-size:.68rem;margin-top:6px}.reportAddPhoto{display:inline-block;margin-top:3px;cursor:pointer}.reportSticky{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(840px,100%);display:grid;grid-template-columns:1fr 1.4fr;gap:8px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:rgba(244,247,251,.96);backdrop-filter:blur(10px);border-top:1px solid var(--line);z-index:30}.reportSticky button{width:100%}
@media(max-width:560px){.reportPhotos{grid-template-columns:1fr}.reportPhoto img{height:auto;max-height:320px;object-fit:contain}.reportActions span{width:100%;margin-left:0}.reportSticky{grid-template-columns:1fr 1.25fr}.reportSticky button{padding:11px 8px;font-size:.83rem}.reportAddPhoto{width:100%;text-align:center}}

/* v1.14 — campi contestuali, controlli documentali e competenza presunta */
#app,.shell,.view,.checkCard,.reportItem,.issueCard,.scopeBox,.metaGrid{min-width:0;max-width:100%}
.shell{max-width:840px}
.checkHead h3,.checkHead p,.sectionTitle,.checkSummary,.issueClassification,.issueTop>div,.reportItemHead>div{overflow-wrap:anywhere;min-width:0}
.docMarker{display:inline-block;color:#475569;font-size:.73rem;font-weight:700;margin:0 0 6px}
.details .field input,.details .field select,.details .field textarea{display:block;width:100%;max-width:100%;min-width:0;margin-top:5px;border:1px solid #cfd8e6;border-radius:10px;background:#fff;color:#172033;padding:11px 12px}
.fieldHint{display:block;margin-top:6px;font-size:.75rem;font-weight:400;line-height:1.4;color:#667085}
.checkSummary{display:flex;flex-wrap:wrap;gap:5px 10px;padding:0 12px 11px;color:#475569;font-size:.76rem;line-height:1.4}
.checkSummary span{max-width:100%;overflow-wrap:anywhere}
.issueClassification{display:grid;gap:3px;margin:10px 0 7px;font-size:.85rem;color:#344054}
.issueClassification span{font-weight:750}.issueClassification small{color:#667085}
.issueEditor{border-top:1px solid #e1e8f2;margin-top:12px}.issueEditor summary{cursor:pointer;padding:12px 0 6px;color:#1d4ed8;font-weight:750;min-height:44px}.issueEditor .issueEdit{margin-top:6px}
.filterBar{grid-template-columns:repeat(3,minmax(0,1fr))}.filterBar select,.metaGrid select{min-width:0;max-width:100%;width:100%}
.reportOutcome:not(.problem){white-space:normal;flex-shrink:0;max-width:42%;text-align:center}
.choices{grid-template-columns:repeat(3,minmax(0,1fr))}.choice{min-width:0;min-height:52px;overflow-wrap:normal;line-height:1.2}.detailsToggle{flex-wrap:wrap}.detailsToggle .mini{min-height:40px}
@media(max-width:640px){
  .shell,.touch-device .shell{width:100%;max-width:100%}.view{padding:12px}.metaGrid{grid-template-columns:minmax(0,1fr)}.metaGrid .wide{grid-column:auto}
  .typeGuide{margin:10px 12px 0}.typeGuideCurrent{padding:12px}.typeGuideCurrent p{font-size:.86rem}.typeGuideAll summary{font-size:.85rem}
  .filterBar,.issueEdit,.touch-device .filterBar,.touch-device .issueEdit{grid-template-columns:minmax(0,1fr)}.issueEdit .wide{grid-column:auto}
  .metaGrid select,.details .field input,.details .field select,.details .field textarea,.issueEdit select,.issueEdit input,.issueEdit textarea,.filterBar select{font-size:16px}
  .checkHead h3{font-size:1rem}.choice{font-size:.82rem;padding:10px 3px}.scopeHead{flex-wrap:wrap}.scopeHead>div{min-width:0}.scopeTags span{max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .reportSticky{width:100%;max-width:100%}.sticky button,.reportSticky button{min-width:0;white-space:normal}
}
@media(max-width:360px){.choice{font-size:.73rem}.choices{gap:5px;padding-left:9px;padding-right:9px}.checkHead{padding-left:10px;padding-right:10px}.detailsToggle{gap:5px}}
/* Compact report groups: controls without evidence are closed until tapped. */
.reportItem{padding:0}.reportItemSummary{cursor:pointer;list-style:none;padding:13px 14px;display:flex;align-items:flex-start;gap:9px;min-height:48px}.reportItemSummary::-webkit-details-marker{display:none}.reportItemSummary::before{content:'›';font-size:1.15rem;line-height:1.3;color:#64748b;flex-shrink:0}.reportItem[open]>.reportItemSummary::before{content:'⌄'}.reportItemHead{flex:1;min-width:0}.reportItemBody{padding:0 14px 14px}.reportItemBody>p{color:#475569;font-size:.84rem;margin:9px 0;overflow-wrap:anywhere}.reportItem[open]>.reportItemSummary{border-bottom:1px solid #edf1f6}.reportItemHead strong{font-size:.9rem}.reportOutcome{flex-shrink:0;max-width:44%;white-space:normal;text-align:center}
@media(max-width:400px){.detailsToggle{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:0 10px 10px}.detailsToggle .mini{display:flex;justify-content:center;align-items:center;min-width:0;text-align:center;padding:5px 2px;font-size:.72rem}.reportItemSummary{padding:12px 10px}.reportItemBody{padding:0 10px 12px}}

/* v1.15 — categorie combinabili e dettaglio facoltativo */
.scopeHeading{margin:0 0 5px;font-size:1rem;color:#27364f}.scopeHint{margin:0 0 10px;color:var(--muted);font-size:.82rem;line-height:1.45}.scopeCategories{display:grid;gap:8px;margin-bottom:12px}.scopeCategory{display:flex;align-items:center;gap:12px;min-width:0;min-height:60px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer}.scopeCategory.isSelected{background:#eef4ff;border-color:#8eaff5}.scopeCategory.isPartial{border-color:#b2c7ea;background:#f8faff}.scopeCategory input{flex:0 0 21px;width:21px;height:21px;margin:0;accent-color:var(--blue)}.scopeCategoryText{display:block;min-width:0;overflow-wrap:anywhere}.scopeCategoryText strong{display:block;font-size:.88rem;line-height:1.35;color:#27364f}.scopeCategoryText small{display:block;margin-top:4px;color:#667085;font-size:.75rem}.scopeCategory:focus-within{outline:2px solid #7ca4f6;outline-offset:2px}.scopeActions{flex-wrap:wrap}.scopeActions button{min-height:40px}.scopeSingles{margin-top:8px;border:1px solid var(--line);border-radius:12px;padding:0 12px;background:#fff;min-width:0}.scopeSingles summary{cursor:pointer;padding:13px 0;color:#2457ad;font-size:.86rem;font-weight:750;line-height:1.4}.scopeSingles summary small{display:block;font-size:.72rem;font-weight:500;color:var(--muted);margin:3px 0 0 15px}.scopeSingles[open] summary{margin-bottom:9px;border-bottom:1px solid var(--line)}.scopeItem input{flex:0 0 18px}.scopeItem span{min-width:0;overflow-wrap:anywhere}.scopeDone{width:100%;margin-top:12px;min-height:44px}.scopeBox{scroll-margin-top:66px}@media(max-width:400px){.scopeCategory{padding:10px;gap:10px}.scopeSingles{padding:0 9px}.scopeCategoryText strong{font-size:.85rem}}

/* v1.16 — azioni allineate e rilievi multipli */
.evidenceActions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0 12px 8px;align-items:stretch}
.evidenceActions .mini{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:44px;text-align:center;font-size:.78rem;line-height:1.25;border:1px solid #e1e8f2;border-radius:10px;padding:7px 4px;background:#f8fafc;color:#344054;font-weight:650;white-space:normal}
.evidenceActions .mini span{flex:0 0 auto;font-size:.9rem;line-height:1}
.evidenceSummary{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:10px 12px;border:0;border-top:1px solid #edf1f6;background:#fff;color:#2457ad;text-align:left;font-size:.82rem;font-weight:700;min-width:0}
.evidenceSummary small{font-size:.74rem;color:#667085;font-weight:500;text-align:right;overflow-wrap:anywhere}
.noteEntry,.mediaEditor,.reportNote,.reportAddBox{border:1px solid #dce5f0;border-radius:12px;background:#fff;padding:10px;margin:9px 0;min-width:0;max-width:100%;overflow-wrap:anywhere}
.noteEntry summary{cursor:pointer;min-height:36px;line-height:1.4;color:#2457ad;padding:4px 0}
.noteEntry summary span{display:inline-block;vertical-align:top;max-width:90%;min-width:0}
.noteEntry summary small{display:block;color:#667085;font-size:.76rem;font-weight:500}
.noteEntry[open] summary{border-bottom:1px solid #e6edf6;margin-bottom:8px;padding-bottom:8px}
.noteBody{min-width:0}.noteMediaActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:9px 0}.noteMediaActions button{min-height:40px;min-width:0}.noteRemove{color:#991b1b;min-height:38px}.noteRemove:disabled{opacity:.5}
.evidenceHead{display:flex;justify-content:space-between;align-items:center;gap:8px}.mediaEditor{background:#f2f6ff;border-color:#b9cdf0}.mediaEditor .primary,.mediaEditor .danger{margin-top:10px;min-height:44px}.mediaEditor button:disabled{opacity:.6}
.evidenceList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:9px}.evidenceEntry{border:1px solid #e1e8f2;background:#fff;padding:8px;border-radius:10px;min-width:0;overflow:hidden}.evidenceMeta{display:grid;gap:3px;margin-bottom:7px;min-width:0;overflow-wrap:anywhere;font-size:.8rem}.evidenceMeta small{font-size:.72rem;color:#667085}.evidenceMeta .mediaFileName{font-size:.65rem;color:#667085}.evidenceEntry img{width:100%;display:block;max-height:240px;object-fit:contain;border-radius:7px;background:#f4f7fb}.evidenceEntry audio{width:100%;min-width:0;max-width:100%}.reportNote b{font-size:.84rem}.reportNote p{font-size:.82rem;margin:5px 0;color:#475569;white-space:pre-wrap;overflow-wrap:anywhere}.reportAddBox summary{cursor:pointer}.issuePhotos a span{white-space:normal;overflow-wrap:anywhere}.reportPhoto small{overflow-wrap:anywhere}
@media(max-width:560px){.evidenceList{grid-template-columns:minmax(0,1fr)}.evidenceActions{padding:0 9px 8px;gap:4px}.evidenceActions .mini{font-size:.72rem;min-height:44px;padding:6px 3px;flex-direction:column;gap:2px}.evidenceSummary{font-size:.78rem;padding:10px}.evidenceSummary small{font-size:.7rem}.noteEntry,.mediaEditor{padding:9px}.reportAddBox .field input,.reportAddBox .field select{font-size:16px}}
.mediaEditor #cameraMedia{margin-top:7px;min-height:44px}
