/* Hidi · report. Tre momenti: chat in stile messaggistica, report HiDigital, nota riservata. */
:root{
  --wa-green:#008069;--wa-teal:#00a884;--wa-bg:#efeae2;--wa-in:#ffffff;--wa-out:#d9fdd3;--wa-text:#111b21;--wa-sub:#667781;--wa-line:#e9edef;--wa-tick:#53bdeb;
  --violet:#5638c8;--violet-d:#2a1a66;--violet-dd:#170d3d;--violet-l:#a99be6;--lime:#e2fb5f;--lime-d:#b9d42a;--ink:#16122b;--paper:#f6f4fb;--muted:#6d6889;--card:#ffffff;
  --ui:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;--inter:"Inter",var(--ui);--anton:"Anton","Impact","Arial Narrow",sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;background:#d1d7db;color:var(--wa-text);font-family:var(--ui);-webkit-text-size-adjust:100%}
button{font:inherit;cursor:pointer}
body.in-chat{overflow:hidden;height:100dvh}

/* ---------- icone ---------- */
.ic{display:inline-block;width:22px;height:22px;background:currentColor;-webkit-mask:var(--m) center/contain no-repeat;mask:var(--m) center/contain no-repeat}
.ic-dots{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='12' cy='19' r='2'/%3E%3C/svg%3E")}
.ic-chat{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v12H7l-3 3z'/%3E%3C/svg%3E")}
.ic-video{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h12v12H3zM16 10l5-3v10l-5-3z'/%3E%3C/svg%3E")}
.ic-phone{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E")}

/* ---------- 1 · chat ---------- */
.wa{display:flex;height:100vh;height:100dvh;max-width:1600px;margin:0 auto;background:var(--wa-bg)}
.wa-side{display:none}
.wa-main{flex:1;display:flex;flex-direction:column;min-width:0;height:100%}
.wa-head{display:flex;align-items:center;gap:10px;background:var(--wa-green);color:#fff;padding:calc(env(safe-area-inset-top,0px) + 8px) 12px 8px 6px;min-height:58px;flex-shrink:0}
.back{font-size:30px;line-height:1;padding:0 2px 4px 6px;opacity:.9}
.wa-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0}
.wa-who{display:flex;flex-direction:column;min-width:0;flex:1}
.wa-who b{font-weight:600;font-size:16.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wa-who span{font-size:13px;opacity:.85}
.head-icons{display:flex;gap:18px;opacity:.95}
.wa-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:10px 4% 14px;display:flex;flex-direction:column;gap:2px;-webkit-overflow-scrolling:touch;
  background-color:var(--wa-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23e0d8cb' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='24' cy='26' r='9'/%3E%3Cpath d='M70 18l6 12 13 2-9 9 2 13-12-6-12 6 2-13-9-9 13-2z'/%3E%3Cpath d='M120 22c8 0 14 6 14 14M126 22c5 0 8 3 8 8'/%3E%3Crect x='14' y='84' width='22' height='16' rx='3'/%3E%3Cpath d='M58 96c6-10 18-10 24 0M60 84h0M80 84h0'/%3E%3Cpath d='M112 84l18 18M130 84l-18 18'/%3E%3Cpath d='M20 138c8-8 16 8 24 0s16 8 24 0'/%3E%3Ccircle cx='108' cy='136' r='4'/%3E%3Ccircle cx='126' cy='136' r='4'/%3E%3Cpath d='M98 128h38'/%3E%3C/svg%3E");
  background-size:160px}
.chip{align-self:center;background:#fff;color:#54656f;font-size:12.5px;padding:5px 12px;border-radius:8px;margin:6px 0 8px;box-shadow:0 1px .5px rgba(11,20,26,.13);text-align:center}
.chip.note{background:#ffeecd;color:#54656f;max-width:88%;line-height:1.35}
.row{display:flex;flex-direction:column;max-width:82%;margin-top:6px}
.row+.row.same{margin-top:2px}
.row.in{align-self:flex-start}
.row.out{align-self:flex-end;align-items:flex-end}
.bubble{position:relative;padding:6px 8px 8px 9px;border-radius:8px;font-size:15.5px;line-height:1.38;box-shadow:0 1px .5px rgba(11,20,26,.13);white-space:pre-wrap;overflow-wrap:anywhere;animation:pop .18s ease-out}
.in .bubble{background:var(--wa-in);border-top-left-radius:0}
.out .bubble{background:var(--wa-out);border-top-right-radius:0}
.same .bubble{border-radius:8px}
.bubble b{font-weight:700}
.meta{float:right;margin:8px 0 -4px 10px;font-size:11px;color:var(--wa-sub);display:inline-flex;align-items:center;gap:3px;line-height:1}
.ticks{width:16px;height:11px;color:#8696a0;transition:color .3s}
.ticks.read{color:var(--wa-tick)}
@keyframes pop{from{opacity:0;transform:translateY(6px) scale(.98)}to{opacity:1;transform:none}}
.typing .bubble{padding:12px 14px;display:flex;gap:4px}
.typing i{width:7px;height:7px;border-radius:50%;background:#8696a0;animation:dot 1.1s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes dot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}
.btns{display:flex;flex-direction:column;gap:2px;margin-top:2px;width:100%;min-width:220px}
.btns button{background:#fff;border:0;border-radius:8px;color:#027eb5;font-weight:500;font-size:15px;padding:11px 10px;box-shadow:0 1px .5px rgba(11,20,26,.13);display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;animation:pop .2s ease-out;touch-action:manipulation}
.btns button::before{content:"↩";font-size:14px;opacity:.75}
.btns button:disabled{color:#8696a0;cursor:default}
.btns button.chosen{color:#027eb5;background:#f5f6f6}
.progress{min-width:250px}
.progress ul{list-style:none;margin:6px 0 2px;padding:0;font-size:14px;line-height:1.7}
.progress li{opacity:0;transition:opacity .25s;display:flex;justify-content:space-between;gap:12px}
.progress li.on{opacity:1}
.progress li .r{font-weight:600;white-space:nowrap}
.bar{height:6px;border-radius:3px;background:#e9edef;overflow:hidden;margin-top:6px}
.bar i{display:block;height:100%;width:0;background:var(--wa-teal);transition:width .4s ease}
.doc{display:flex;align-items:center;gap:10px;background:#f5f6f6;border-radius:6px;padding:10px;margin-bottom:6px;min-width:240px}
.doc .pdf{width:34px;height:42px;border-radius:4px;background:#e2412d;color:#fff;font-size:10px;font-weight:700;display:grid;place-items:end center;padding-bottom:5px;flex-shrink:0}
.doc b{display:block;font-size:14.5px;font-weight:600;line-height:1.3}
.doc span{font-size:12.5px;color:var(--wa-sub)}
.wa-input{display:flex;align-items:center;gap:8px;padding:6px 8px calc(env(safe-area-inset-bottom,0px) + 6px);background:#f0f2f5;flex-shrink:0}
.emoji{font-size:22px;color:#54656f;padding:0 4px}
.wa-input input{flex:1;min-width:0;border:0;border-radius:22px;padding:11px 16px;font-size:16px;background:#fff;color:var(--wa-text);outline:none}
.wa-input input:disabled{background:#f7f8fa;color:#8696a0}
.wa-input button{width:46px;height:46px;border-radius:50%;border:0;background:var(--wa-teal);color:#fff;display:grid;place-items:center;flex-shrink:0}
.wa-input button:disabled{background:#b6c3c9}

@media (min-width:900px){
  .wa{padding:19px 0;background:linear-gradient(#00a884 0 127px,#d1d7db 127px);height:100vh;height:100dvh}
  .wa-side,.wa-main{box-shadow:0 6px 18px rgba(11,20,26,.05)}
  .wa-side{display:flex;flex-direction:column;width:30%;max-width:420px;min-width:300px;background:#fff;border-right:1px solid var(--wa-line)}
  .side-head{display:flex;align-items:center;justify-content:space-between;background:#f0f2f5;padding:10px 16px;height:59px}
  .me{width:40px;height:40px;border-radius:50%;background:#dfe5e7;color:#54656f;display:grid;place-items:center;font-weight:600}
  .side-icons{display:flex;gap:22px;color:#54656f}
  .side-search{padding:8px 12px;border-bottom:1px solid var(--wa-line)}
  .side-search span{display:block;background:#f0f2f5;border-radius:8px;padding:8px 14px;color:#667781;font-size:14px}
  .side-list{list-style:none;margin:0;padding:0;overflow:auto}
  .side-list li{display:flex;align-items:center;gap:13px;padding:10px 14px;border-bottom:1px solid var(--wa-line)}
  .side-list li.on{background:#f0f2f5}
  .side-list img,.av{width:49px;height:49px;border-radius:50%;flex-shrink:0}
  .av{display:grid;place-items:center;color:#fff;font-weight:600;font-size:19px}
  .av2{background:#7f66ff}.av3{background:#25a45b}.av4{background:#e0a23a}
  .side-list div{flex:1;min-width:0;display:flex;flex-direction:column}
  .side-list b{font-weight:500;font-size:16.5px}
  .side-list div span{color:#667781;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-list time{font-size:12px;color:#667781;align-self:flex-start;margin-top:4px}
  .wa-head{background:#f0f2f5;color:var(--wa-text);padding:10px 16px;min-height:59px}
  .wa-who span{color:#667781;opacity:1}
  .head-icons{color:#54656f}
  .back{display:none}
  .wa-body{padding:14px 7% 18px}
  .row{max-width:65%}
}

/* ---------- 2 · report ---------- */
.report{min-height:100vh;background:var(--paper);color:var(--ink);font-family:var(--inter);padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
.r-top{background:var(--violet);color:#fff;padding:calc(env(safe-area-inset-top,0px) + 18px) 16px 34px;position:relative;overflow:hidden}
.r-top::after{content:"";position:absolute;right:-60px;bottom:-80px;width:220px;height:220px;border-radius:50%;background:var(--lime);opacity:.16}
.r-wrap{max-width:860px;margin:0 auto;padding:0 16px}
.r-top .r-wrap{padding:0}
.r-brand{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:28px}
.r-brand img{height:26px;width:auto;display:block}
.r-brand span{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.8}
.r-top h1{font-family:var(--anton);font-weight:400;font-size:clamp(40px,11vw,76px);line-height:.95;margin:0 0 14px;letter-spacing:.01em;text-transform:uppercase}
.r-top h1 em{font-style:normal;color:var(--lime)}
.r-meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:14px;opacity:.92}
.r-meta b{font-weight:600}
.r-sec{margin-top:26px}
.r-sec h2{font-family:var(--anton);font-weight:400;font-size:26px;text-transform:uppercase;letter-spacing:.02em;margin:0 0 12px;color:var(--violet-d)}
.r-sec h2 small{display:block;font-family:var(--inter);font-size:13px;text-transform:none;letter-spacing:0;color:var(--muted);font-weight:500;margin-top:2px}
.card{background:var(--card);border-radius:16px;padding:18px;box-shadow:0 1px 2px rgba(22,18,43,.06),0 8px 24px rgba(22,18,43,.05)}
.summary{font-size:17px;line-height:1.55;margin:0}
.kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.kpi{background:var(--card);border-radius:16px;padding:16px 14px;box-shadow:0 1px 2px rgba(22,18,43,.06);display:flex;flex-direction:column;gap:4px;border-top:4px solid var(--violet)}
.kpi:nth-child(3n+2){border-top-color:var(--lime-d)}
.kpi .n{font-family:var(--anton);font-size:44px;line-height:1;color:var(--violet);font-variant-numeric:tabular-nums}
.kpi .l{font-weight:600;font-size:14.5px;line-height:1.25}
.kpi .s{font-size:12.5px;color:var(--muted)}
.answers{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.answers li{display:flex;flex-direction:column;gap:3px;padding-bottom:10px;border-bottom:1px solid #ece9f5}
.answers li:last-child{border-bottom:0;padding-bottom:0}
.answers span{font-size:13px;color:var(--muted)}
.answers b{font-size:16px}
.chart{display:grid;gap:18px;align-items:center}
.donut{width:min(240px,70vw);height:auto;margin:0 auto;display:block}
.donut circle{fill:none;stroke-width:22;transition:stroke-dasharray 1.2s cubic-bezier(.2,.8,.2,1)}
.donut text{font-family:var(--anton);fill:var(--violet-d)}
.legend{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.legend li{display:flex;align-items:center;gap:10px;font-size:15px}
.legend i{width:14px;height:14px;border-radius:4px;flex-shrink:0}
.legend b{margin-left:auto;font-variant-numeric:tabular-nums}
.bars{display:grid;gap:16px}
.bars .m{font-weight:600;font-size:14.5px;margin-bottom:6px}
.bars .b{display:grid;grid-template-columns:78px 1fr 40px;align-items:center;gap:8px;font-size:13px;margin-top:4px}
.bars .t{height:12px;border-radius:6px;background:#ece9f5;overflow:hidden}
.bars .t i{display:block;height:100%;width:0;border-radius:6px;transition:width 1.1s cubic-bezier(.2,.8,.2,1)}
.bars .r i{background:var(--violet)}
.bars .a i{background:var(--lime-d)}
.bars .v{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted)}
.swot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sw{border-radius:16px;padding:14px;min-height:150px;display:flex;flex-direction:column;gap:6px}
.sw h3{margin:0;font-family:var(--anton);font-weight:400;font-size:20px;text-transform:uppercase;letter-spacing:.02em}
.sw p{margin:0;font-size:14.5px;line-height:1.4}
.sw.s{background:var(--violet);color:#fff}.sw.w{background:#ffe7d6}.sw.o{background:var(--lime)}.sw.t{background:#ece9f5}
.people{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.person{background:var(--card);border-radius:16px;padding:14px;box-shadow:0 1px 2px rgba(22,18,43,.06);display:flex;flex-direction:column;gap:6px}
.person .ini{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-weight:700;color:#fff;background:var(--violet)}
.person:nth-child(2) .ini{background:var(--lime-d);color:var(--ink)}.person:nth-child(3) .ini{background:var(--violet-l)}.person:nth-child(4) .ini{background:#e0a23a}
.person b{font-size:16px}
.person span{font-size:13.5px;color:var(--muted);line-height:1.35}
.recs{margin:0;padding-left:22px;display:grid;gap:8px;font-size:16px;line-height:1.4}
.recs li::marker{color:var(--violet);font-weight:700}
.lock{margin-top:28px;background:var(--violet-dd);color:#fff;border-radius:20px;padding:22px 18px;display:flex;flex-direction:column;gap:12px;position:relative;overflow:hidden}
.lock::before{content:"";position:absolute;inset:auto -40px -70px auto;width:180px;height:180px;border-radius:50%;background:var(--violet);opacity:.5}
.lock>*{position:relative}
.lock .tag{font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--lime)}
.lock h2{margin:0;font-family:var(--anton);font-weight:400;font-size:30px;text-transform:uppercase;line-height:1}
.lock p{margin:0;opacity:.85;font-size:15px;line-height:1.45}
.lock button{align-self:flex-start;background:var(--lime);color:var(--violet-dd);border:0;border-radius:999px;padding:14px 22px;font-weight:700;font-size:16px;min-height:48px}
.r-foot{margin-top:24px;font-size:12px;color:var(--muted);text-align:center}
.reveal{opacity:0;transform:translateY(14px);transition:opacity .6s ease,transform .6s ease}
.reveal.on{opacity:1;transform:none}
@media (min-width:700px){
  .kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .chart{grid-template-columns:260px 1fr}
  .people{grid-template-columns:repeat(4,minmax(0,1fr))}
  .r-top{padding-top:28px;padding-bottom:44px}
}

/* ---------- 3 · nota riservata ---------- */
.final{position:fixed;inset:0;z-index:20;background:radial-gradient(120% 90% at 50% 0%,#3a2a8a 0%,var(--violet-d) 45%,var(--violet-dd) 100%);color:#fff;font-family:var(--inter);overflow-y:auto;display:flex;flex-direction:column;animation:fadein .9s ease}
@keyframes fadein{from{opacity:0}to{opacity:1}}
.final-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:calc(env(safe-area-inset-top,0px) + 12px) 16px 0}
.final-tag{font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--lime);opacity:.9}
.sound{background:rgba(255,255,255,.1);color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:999px;padding:7px 12px;font-size:13px}
.final-inner{flex:1;width:100%;max-width:560px;margin:0 auto;padding:24px 16px calc(36px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;text-align:center}
.final-line{margin:0;font-size:clamp(21px,5.6vw,27px);line-height:1.45;font-weight:500;min-height:4.4em;display:flex;align-items:center;justify-content:center;text-wrap:balance;transition:opacity .45s ease}
.final-line.out{opacity:0}
.final-next{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4);border-radius:999px;padding:13px 26px;font-size:15px;letter-spacing:.06em;text-transform:uppercase;min-height:48px;min-width:170px;touch-action:manipulation}
.final-next:disabled{opacity:.35}
.final-photo{margin:0;width:100%;line-height:0;animation:fadein .8s ease}
.final-photo img{max-width:100%;max-height:44vh;max-height:44svh;border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.4);object-fit:contain}
.final-video{width:100%;line-height:0;animation:fadein .8s ease}
.final-video video{width:100%;max-height:68vh;max-height:68svh;border-radius:16px;background:#000;box-shadow:0 18px 50px rgba(0,0,0,.45);object-fit:contain}
.final-caption{margin:-6px 0 0;font-size:17px;opacity:.85;font-style:italic}
.final-q{margin:0;font-weight:800;font-size:clamp(30px,8.4vw,44px);line-height:1.12;letter-spacing:-.01em;text-wrap:balance;animation:fadein 1s ease}
.final-q:focus{outline:none}
.final-btns{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;animation:fadein 1s ease}
.yes{background:var(--lime);color:var(--violet-dd);border:0;border-radius:999px;padding:16px 30px;font-weight:800;font-size:18px;min-width:150px;min-height:54px;touch-action:manipulation}
.yes.alt{background:transparent;color:var(--lime);border:2px solid var(--lime)}
.yes:disabled{opacity:.6}
.final-after{margin:0;font-size:20px;line-height:1.5;font-weight:600;text-wrap:balance;animation:fadein 1s ease}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
