/* LivooAI – area riservata e pagine di prenotazione
   Sistema visivo: inchiostro #0B0F19, indaco #6366F1, superfici fredde e luminose.
   Un solo carattere (Plus Jakarta Sans): la gerarchia la danno peso e dimensione. */

:root{
  --dark:#0B0F19; --dark-2:#161B2E;
  --indigo:#6366F1; --indigo-deep:#4F46E5; --indigo-ink:#3730A3;
  --indigo-soft:#EEF0FF; --indigo-line:#C7CAFB;
  --white:#FFFFFF; --ink:#0B0F19; --text:#2A3045; --muted:#5E6480; --muted-dark:#A6ABC3; --faint:#8C92AC;
  --canvas:#F5F6FA; --soft:#F0F2F8; --line:#E4E6EF; --line-strong:#CDD1DE;
  --ok:#0F7A55; --ok-soft:#E3F6EE; --warn:#A15C07; --warn-soft:#FDF2DC; --err:#B42318; --err-soft:#FDECEA;
  --radius-xl:24px; --radius-lg:18px; --radius:12px; --radius-sm:8px;
  --shadow-card:0 1px 2px rgba(16,20,40,.04), 0 8px 24px -12px rgba(16,20,40,.12);
  --shadow-pop:0 24px 64px -20px rgba(16,20,40,.35);
  --ring:0 0 0 4px rgba(99,102,241,.18);
  --ease:cubic-bezier(.2,.7,.2,1);
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0}
body{
  font-family:'Plus Jakarta Sans',system-ui,-apple-system,sans-serif;
  background:var(--canvas); color:var(--ink); line-height:1.55;
  -webkit-font-smoothing:antialiased; min-height:100vh; display:flex; flex-direction:column;
}
a{color:var(--indigo-deep); text-underline-offset:3px}
a:hover{color:var(--indigo-ink)}
.wrap{max-width:1040px; margin:0 auto; padding:0 24px; width:100%}
.wrap.wide{max-width:1260px}
:focus-visible{outline:none; box-shadow:var(--ring); border-radius:var(--radius-sm)}

/* ---------- intestazione ---------- */
.app-header{background:var(--dark); position:sticky; top:0; z-index:20; border-bottom:1px solid rgba(255,255,255,.06)}
.app-nav{display:flex; align-items:center; justify-content:space-between; height:64px; gap:16px}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none}
.wordmark{font-size:22px; font-weight:800; letter-spacing:-.04em; line-height:1}
.wordmark .a{color:var(--white)} .wordmark .b{color:var(--indigo)}
.user-box{display:flex; align-items:center; gap:14px; color:var(--muted-dark); font-size:14px; min-width:0}
.user-box .email{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.link-light{
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#EEF0F7;
  border-radius:999px; padding:0 16px; min-height:38px; font:inherit; font-weight:600; font-size:14px;
  cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; transition:background .15s, border-color .15s;
}
.link-light:hover{background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.3); color:var(--white)}

main{flex:1; padding:44px 0 80px}
h1{font-size:clamp(28px,3.2vw,38px); letter-spacing:-.035em; line-height:1.1; margin:0 0 10px; font-weight:800}
h2{font-size:21px; letter-spacing:-.02em; line-height:1.25; margin:0 0 6px; font-weight:750}
h3{font-size:16px; margin:0 0 4px; font-weight:700}
.sub{color:var(--muted); margin:0 0 28px; max-width:62ch}

/* ---------- superfici ---------- */
.card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-xl); padding:32px; box-shadow:var(--shadow-card)}
.card + .card{margin-top:20px}

/* ---------- moduli ---------- */
form{display:grid; gap:20px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:20px}
.grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:20px}
.field{display:grid; gap:8px; min-width:0; align-content:start}
label,.label{font-size:14px; font-weight:650; color:var(--ink)}
.opt{font-weight:500; color:var(--faint)}
.help{font-size:13px; color:var(--muted); line-height:1.5}

input[type=text],input[type=email],input[type=tel],input[type=password],input[type=number],
input[type=time],input[type=search],input[type=url],input[type=date],select,textarea{
  font-family:inherit; font-size:16px; color:var(--ink); width:100%;
  min-height:50px; padding:0 16px; background:var(--white);
  border:1px solid var(--line-strong); border-radius:var(--radius);
  transition:border-color .15s, box-shadow .15s;
  -webkit-appearance:none; appearance:none;
}
input::placeholder,textarea::placeholder{color:#A3A8BF}
input:hover,select:hover,textarea:hover{border-color:#B6BBCC}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--indigo); box-shadow:var(--ring)}
textarea{padding:14px 16px; min-height:150px; resize:vertical; line-height:1.55}
select{
  padding-right:44px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E6480' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 18px center;
}
input[type=number]{-moz-appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none; margin:0}

/* campo con prefisso o suffisso (€, notti) */
.affix{position:relative; display:flex; align-items:center}
.affix .pre{position:absolute; left:16px; color:var(--muted); font-weight:650; pointer-events:none}
.affix .pre + input{padding-left:40px}
.affix .post{position:absolute; right:16px; color:var(--faint); font-size:14px; pointer-events:none}
.affix input:has(+ .post){padding-right:72px}

/* contatore con − e + */
.stepper{display:flex; align-items:stretch; border:1px solid var(--line-strong); border-radius:var(--radius); overflow:hidden; background:var(--white); min-height:50px}
.stepper:focus-within{border-color:var(--indigo); box-shadow:var(--ring)}
.stepper input{border:0; border-radius:0; text-align:center; font-weight:700; min-height:48px; box-shadow:none !important}
.stepper button{width:52px; flex-shrink:0; border:0; background:var(--soft); color:var(--ink); font-size:20px; cursor:pointer; transition:background .15s, color .15s; font-family:inherit}
.stepper button:hover{background:var(--indigo-soft); color:var(--indigo-deep)}

.counter{font-size:13px; color:var(--faint); display:flex; align-items:center; justify-content:space-between; gap:12px}
.counter .bar{width:140px; height:4px; border-radius:4px; background:var(--line); overflow:hidden}
.counter .bar i{display:block; height:100%; width:0; background:var(--indigo); border-radius:4px; transition:width .2s var(--ease)}
.counter.low{color:var(--warn)}
.counter.ok{color:var(--ok)}
.counter.ok .bar i{background:var(--ok)}

/* scelte a pillola (servizi) */
.chips{display:flex; flex-wrap:wrap; gap:10px}
.chip{position:relative}
.chip input{position:absolute; opacity:0; width:1px; height:1px}
.chip span{
  display:inline-flex; align-items:center; gap:9px; min-height:42px; padding:0 16px 0 13px;
  border:1px solid var(--line-strong); border-radius:999px; font-size:14px; font-weight:600; color:var(--text);
  cursor:pointer; user-select:none; background:var(--white); transition:background .15s, border-color .15s, color .15s;
}
.chip span::before{
  content:''; width:17px; height:17px; border-radius:50%; border:1.5px solid var(--line-strong); flex-shrink:0;
  background:var(--white) center/11px no-repeat; transition:background-color .15s, border-color .15s;
}
.chip span:hover{border-color:var(--indigo-line); background:#FAFAFF}
.chip input:checked + span{background:var(--indigo-soft); border-color:var(--indigo); color:var(--indigo-ink)}
.chip input:checked + span::before{
  border-color:var(--indigo); background-color:var(--indigo);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.chip input:focus-visible + span{box-shadow:var(--ring)}

/* scelta a schede (tipo di struttura) */
.options{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
.option{position:relative}
.option input{position:absolute; opacity:0; width:1px; height:1px}
.option .box{
  display:flex; align-items:center; gap:10px; height:100%; min-height:52px; border:1px solid var(--line-strong); border-radius:var(--radius);
  padding:10px 14px; cursor:pointer; background:var(--white); transition:border-color .15s, background .15s, box-shadow .15s; font-size:14.5px; font-weight:650; color:var(--text);
}
.option .box svg{flex-shrink:0; color:var(--faint)}
.option .box strong{font-size:15px; display:block}
.option .box small{color:var(--muted); font-size:12.5px; line-height:1.4; display:block; font-weight:500}
.option .box:hover{border-color:var(--indigo-line)}
.option input:checked + .box{border-color:var(--indigo); box-shadow:inset 0 0 0 1px var(--indigo); background:var(--indigo-soft); color:var(--indigo-ink)}
.option input:checked + .box svg{color:var(--indigo)}
.option input:focus-visible + .box{box-shadow:var(--ring)}

/* ---------- pulsanti ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px; padding:0 22px;
  border-radius:999px; font-weight:700; font-size:15.5px; text-decoration:none; border:0; cursor:pointer;
  font-family:inherit; transition:background .15s, box-shadow .15s, transform .1s, border-color .15s; white-space:nowrap;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--indigo); color:var(--white); box-shadow:0 8px 18px -10px rgba(79,70,229,.8)}
.btn-primary:hover{background:var(--indigo-deep); color:var(--white)}
.btn-secondary{background:var(--white); color:var(--ink); border:1px solid var(--line-strong)}
.btn-secondary:hover{border-color:var(--ink); color:var(--ink)}
.btn-ghost{background:transparent; color:var(--muted); padding:0 14px}
.btn-ghost:hover{color:var(--ink); background:var(--soft)}
.btn:disabled{opacity:.55; cursor:default; transform:none}
.btn .spin{width:16px; height:16px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.actions{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-top:4px}
.actions .right{display:flex; gap:10px; margin-left:auto}

/* ---------- messaggi ---------- */
.msg{display:none; padding:13px 16px; border-radius:var(--radius); font-weight:600; font-size:14px; line-height:1.5}
.msg.show{display:block}
.msg.err{background:var(--err-soft); color:var(--err)}
.msg.ok{background:var(--ok-soft); color:var(--ok)}
.msg.info{background:var(--indigo-soft); color:var(--indigo-ink)}
.note{display:flex; gap:12px; align-items:flex-start; padding:16px 18px; border-radius:var(--radius); background:var(--indigo-soft); color:var(--indigo-ink); font-size:14px; line-height:1.55}
.note svg{flex-shrink:0; margin-top:1px}

/* ---------- badge e stati ---------- */
.badge{display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:700; padding:5px 12px; border-radius:999px; line-height:1.2}
.badge::before{content:''; width:7px; height:7px; border-radius:50%; background:currentColor}
.badge.ok{background:var(--ok-soft); color:var(--ok)}
.badge.warn{background:var(--warn-soft); color:var(--warn)}
.badge.err{background:var(--err-soft); color:var(--err)}

.checklist{list-style:none; margin:0; padding:0; display:grid; gap:10px}
.checklist li{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--white)}
.checklist .left{display:flex; gap:14px; align-items:flex-start}
.checklist .ico{flex-shrink:0; width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center}
.checklist .ico.ok{background:var(--ok-soft)}
.checklist .ico.todo{background:var(--warn-soft)}
.checklist strong{display:block; font-size:15px}
.checklist p{margin:2px 0 0; font-size:14px; color:var(--muted)}

.stats{display:grid; grid-template-columns:repeat(3,1fr); gap:16px}
.stat{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px 22px; box-shadow:var(--shadow-card)}
.stat .n{font-size:30px; font-weight:800; letter-spacing:-.035em; font-variant-numeric:tabular-nums}
.stat .l{font-size:14px; color:var(--muted)}
.hero-status{display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap}
dl.details{display:grid; grid-template-columns:auto 1fr; gap:10px 24px; margin:0; font-size:15px}
dl.details dt{color:var(--muted)}
dl.details dd{margin:0; font-weight:600; overflow-wrap:anywhere}

.loading{display:flex; align-items:center; justify-content:center; gap:12px; padding:96px 0; color:var(--muted)}
.loading::before{content:''; width:18px; height:18px; border:2px solid var(--line-strong); border-right-color:var(--indigo); border-radius:50%; animation:spin .8s linear infinite}
.app-footer{text-align:center; padding:28px 24px; font-size:13px; color:var(--faint)}
.app-footer a{color:var(--muted); margin:0 10px; text-decoration:none}
.app-footer a:hover{color:var(--ink); text-decoration:underline}

/* ---------- configurazione guidata ---------- */
.setup{display:grid; grid-template-columns:230px minmax(0,1fr) 300px; gap:28px; align-items:start}
.setup-head{margin-bottom:30px; display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap}
.setup-head .sub{margin:0}

.rail{position:sticky; top:96px}
.rail ol{list-style:none; margin:0; padding:0; display:grid; gap:4px; counter-reset:passo}
.rail li{counter-increment:passo}
.rail button{
  width:100%; display:grid; grid-template-columns:30px 1fr; gap:12px; align-items:center; text-align:left;
  padding:10px 12px; border:0; border-radius:var(--radius); background:transparent; cursor:pointer; font:inherit; color:var(--muted);
  transition:background .15s;
}
.rail button:hover{background:rgba(255,255,255,.7)}
.rail .dot{
  width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-size:13px; font-weight:750;
  border:1.5px solid var(--line-strong); color:var(--muted); background:var(--white); transition:background .2s, border-color .2s, color .2s;
}
.rail .dot::after{content:counter(passo)}
.rail .t{display:block; font-weight:650; font-size:14.5px; color:var(--text); line-height:1.3}
.rail .d{display:block; font-size:12.5px; color:var(--faint); line-height:1.35}
.rail li.current button{background:var(--white); box-shadow:var(--shadow-card)}
.rail li.current .dot{border-color:var(--indigo); background:var(--indigo); color:var(--white)}
.rail li.current .t{color:var(--ink)}
.rail li.done .dot{border-color:#9BD8BE; background:var(--ok-soft)}
.rail li.done .dot::after{content:''; width:12px; height:12px; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='%230F7A55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
.rail .progress{margin:20px 12px 0; font-size:13px; color:var(--muted)}
.rail .progress .bar{height:6px; background:var(--line); border-radius:6px; overflow:hidden; margin-top:8px}
.rail .progress .bar i{display:block; height:100%; background:var(--indigo); border-radius:6px; transition:width .35s var(--ease)}

.step-card{padding:0; overflow:clip}
.step-card .step-head{padding:30px 32px 0}
.step-card .step-head .sub{margin:0}
.step-card form{padding:26px 32px 0}
.step-card .actions{margin:6px -32px 0; padding:18px 32px; border-top:1px solid var(--line); background:#FBFBFD}
.step-panel{animation:entra .28s var(--ease)}
@keyframes entra{from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none}}
.cin-row{display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 16px; border-radius:var(--radius); background:var(--soft)}
.cin-row code{font-family:inherit; font-size:16px; font-weight:750; letter-spacing:.04em}

.sources{display:grid; gap:8px; margin:0; padding:0; list-style:none}
.sources li{display:grid; grid-template-columns:120px 1fr; gap:12px; font-size:13.5px; color:var(--muted); padding:10px 14px; border-radius:var(--radius-sm); background:var(--soft)}
.sources li strong{color:var(--ink); font-weight:650}
.url-row{display:flex; gap:10px}
.url-row input{flex:1}
.cal-status{display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:var(--radius); border:1px dashed var(--line-strong); color:var(--muted); font-size:14px}
.cal-status.ok{border-style:solid; border-color:#B7E4CF; background:var(--ok-soft); color:var(--ok); font-weight:600}
.cal-status.err{border-style:solid; border-color:#F5C2BD; background:var(--err-soft); color:var(--err); font-weight:600}

/* anteprima: come ti presentano le AI */
.preview{position:sticky; top:96px}
.preview .ph{font-size:13px; font-weight:650; color:var(--muted); margin:0 0 10px 4px; display:flex; align-items:center; gap:8px}
.preview .ph::before{content:''; width:8px; height:8px; border-radius:50%; background:#22C55E; box-shadow:0 0 0 4px rgba(34,197,94,.16)}
.chat{background:var(--dark); border-radius:var(--radius-xl); padding:16px; color:#E8EAF4; box-shadow:var(--shadow-pop)}
.chat .q{margin-left:auto; max-width:88%; width:fit-content; background:#262C45; border-radius:16px 16px 4px 16px; padding:10px 14px; font-size:13.5px; line-height:1.45}
.chat .a{margin:14px 2px 0; font-size:13.5px; line-height:1.5; color:#C9CDE0}
.chat .listing{margin-top:10px; background:var(--white); color:var(--ink); border-radius:16px; padding:14px 16px}
.chat .listing .top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.chat .listing .name{font-weight:750; font-size:15.5px; line-height:1.25; overflow-wrap:anywhere}
.chat .listing .where{font-size:12.5px; color:var(--muted); margin-top:2px}
.chat .listing .price{text-align:right; white-space:nowrap}
.chat .listing .price b{font-size:17px; font-weight:800; letter-spacing:-.02em; display:block}
.chat .listing .price span{font-size:11.5px; color:var(--muted)}
.chat .listing .desc{font-size:12.5px; color:var(--text); margin:10px 0 0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.chat .listing .tags{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}
.chat .listing .tags span{font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:999px; background:var(--soft); color:var(--text)}
.chat .listing .meta{display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:10px; font-size:12px; color:var(--muted)}
.chat .listing .cta{margin-top:12px; display:block; text-align:center; background:var(--indigo); color:var(--white); border-radius:999px; padding:9px; font-size:13px; font-weight:700}
.chat .vuoto{color:#A6ABC3}
.preview .pnote{font-size:12.5px; color:var(--muted); margin:12px 4px 0; line-height:1.5}

/* ---------- prenotazione: riepilogo ---------- */
.summary{background:var(--soft); border-radius:var(--radius); padding:16px 18px; display:grid; gap:8px; font-size:15px; font-variant-numeric:tabular-nums}
.summary .row{display:flex; justify-content:space-between; gap:12px}
.summary .tot{font-weight:800; font-size:18px; border-top:1px solid var(--line-strong); padding-top:10px; margin-top:2px}

/* ---------- schermi più piccoli ---------- */
@media (max-width:1180px){
  .setup{grid-template-columns:210px minmax(0,1fr)}
  .preview{position:static; grid-column:2}
}
@media (max-width:860px){
  .setup{grid-template-columns:1fr; gap:18px}
  .preview{grid-column:auto}
  .rail{position:static}
  .rail ol{grid-template-columns:repeat(4,1fr); gap:6px}
  .rail button{grid-template-columns:1fr; justify-items:center; text-align:center; padding:8px 4px; gap:6px}
  .rail .d,.rail .progress{display:none}
  .rail .t{font-size:12.5px}
}
@media (max-width:760px){
  .grid2,.grid3,.stats{grid-template-columns:1fr}
  .options{grid-template-columns:1fr 1fr}
  main{padding:28px 0 64px}
  .card{padding:22px; border-radius:var(--radius-lg)}
  .step-card{padding:0}
  .step-card .step-head{padding:22px 20px 0}
  .step-card form{padding:20px 20px 0}
  .step-card .actions{margin:6px -20px 0; padding:14px 20px}
  .user-box .email{display:none}
  .checklist li{flex-wrap:wrap}
  .sources li{grid-template-columns:1fr; gap:2px}
  .url-row{flex-direction:column}
  .rail .t{display:none}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important; transition:none !important}
}

/* ---------- interruttori (regole della casa) ---------- */
.switches{display:grid; gap:0; border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden}
.switch{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; background:var(--white); cursor:pointer}
.switch + .switch{border-top:1px solid var(--line)}
.switch .txt{display:grid; gap:2px}
.switch .txt b{font-size:15px; font-weight:650}
.switch .txt small{font-size:13px; color:var(--muted)}
.switch input{position:absolute; opacity:0; width:1px; height:1px}
.switch .track{flex-shrink:0; width:46px; height:28px; border-radius:999px; background:var(--line-strong); position:relative; transition:background .2s var(--ease)}
.switch .track::after{content:''; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:var(--white); box-shadow:0 1px 3px rgba(16,20,40,.25); transition:transform .2s var(--ease)}
.switch input:checked + .track{background:var(--indigo)}
.switch input:checked + .track::after{transform:translateX(18px)}
.switch input:focus-visible + .track{box-shadow:var(--ring)}

/* ---------- foto ---------- */
.drop{
  display:grid; place-items:center; gap:6px; text-align:center; padding:28px 20px; border:1.5px dashed var(--line-strong);
  border-radius:var(--radius-lg); background:#FBFBFE; cursor:pointer; transition:border-color .15s, background .15s; color:var(--muted); font-size:14px;
}
.drop:hover,.drop.over{border-color:var(--indigo); background:var(--indigo-soft); color:var(--indigo-ink)}
.drop b{font-size:15.5px; color:var(--ink)}
.drop input{position:absolute; opacity:0; width:1px; height:1px}
.drop .ico{width:48px; height:48px; border-radius:14px; background:var(--white); display:grid; place-items:center; box-shadow:var(--shadow-card); margin-bottom:6px; color:var(--indigo)}
.gallery{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px}
.ph-tile{position:relative; aspect-ratio:4/3; border-radius:var(--radius); overflow:hidden; background:var(--soft); border:1px solid var(--line)}
.ph-tile img{width:100%; height:100%; object-fit:cover; display:block}
.ph-tile.cover{grid-column:span 2; grid-row:span 2}
.ph-tile .tag{position:absolute; left:10px; top:10px; background:var(--white); color:var(--ink); font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; box-shadow:0 2px 8px rgba(16,20,40,.15)}
.ph-tile .tools{position:absolute; right:8px; bottom:8px; display:flex; gap:6px; opacity:0; transition:opacity .15s}
.ph-tile:hover .tools,.ph-tile:focus-within .tools{opacity:1}
.ph-tile .tools button{width:32px; height:32px; border-radius:50%; border:0; background:rgba(255,255,255,.95); color:var(--ink); cursor:pointer; display:grid; place-items:center; box-shadow:0 2px 8px rgba(16,20,40,.2); font-size:15px; font-family:inherit}
.ph-tile .tools button:hover{background:var(--white); color:var(--indigo-deep)}
.ph-tile .tools button.del:hover{color:var(--err)}
.ph-tile.loading{display:grid; place-items:center; color:var(--muted); font-size:13px}
.ph-tile.loading::before{content:''; width:22px; height:22px; border:2px solid var(--line-strong); border-right-color:var(--indigo); border-radius:50%; animation:spin .8s linear infinite}
.ph-count{display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; color:var(--muted)}
.ph-count b{color:var(--ink)}
.chat .listing .img{margin:-14px -16px 12px; aspect-ratio:16/9; background:var(--soft) center/cover no-repeat; border-radius:16px 16px 0 0}
.chat .listing .img.empty{display:grid; place-items:center; color:var(--faint); font-size:12px}
.groups{display:grid; gap:18px}
.groups h4{font-size:13.5px; font-weight:650; color:var(--muted); margin:0 0 10px}
@media (max-width:760px){
  .ph-tile.cover{grid-column:span 2; grid-row:auto}
  .ph-tile .tools{opacity:1}
}
.switch .txt small{font-weight:500}

/* ---------- schede (tabs) ---------- */
.tabs{display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; border-bottom:1px solid var(--line); margin:0 0 26px}
.tabs::-webkit-scrollbar{display:none}
.tabs a{flex-shrink:0; display:inline-flex; align-items:center; gap:8px; padding:12px 14px; font-weight:650; font-size:15px; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap}
.tabs a:hover{color:var(--ink)}
.tabs a[aria-current="page"]{color:var(--ink); border-bottom-color:var(--indigo)}
.tabs .conta{min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:var(--indigo); color:#fff; font-size:12px; font-weight:700; display:inline-flex; align-items:center; justify-content:center}

/* ---------- calendario ---------- */
.cal-wrap{display:grid; grid-template-columns:1fr 1fr; gap:28px}
.cal-mese h3{text-transform:capitalize; margin:0 0 10px; font-size:16px}
.cal-griglia{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px}
.cal-griglia .gs{font-size:12px; font-weight:700; color:var(--faint); text-align:center; padding:4px 0; text-transform:uppercase}
.cal-g{position:relative; min-height:64px; border:1px solid var(--line); border-radius:10px; padding:6px 7px; background:var(--white); cursor:pointer; text-align:left; font:inherit; color:var(--ink); display:flex; flex-direction:column; justify-content:space-between; transition:border-color .12s, box-shadow .12s}
.cal-g:hover{border-color:var(--indigo-line)}
.cal-g .n{font-size:13px; font-weight:700}
.cal-g .p{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden}
.cal-g .t{font-size:11px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.cal-g.vuoto{visibility:hidden}
.cal-g.passato{opacity:.4; cursor:default}
.cal-g.oggi{box-shadow:inset 0 0 0 2px var(--ink)}
.cal-g.livooai{background:var(--indigo-soft); border-color:var(--indigo-line)}
.cal-g.livooai .t{color:var(--indigo-ink)}
.cal-g.ical{background:repeating-linear-gradient(135deg,#F3F4F8 0 6px,#E9EBF2 6px 12px)}
.cal-g.ical .t{color:var(--muted)}
.cal-g.manuale{background:#E4E6EF}
.cal-g.manuale .t{color:var(--text)}
.cal-g.periodo .p{color:var(--indigo-deep); font-weight:700}
.cal-g.sel{background:var(--indigo); border-color:var(--indigo); color:#fff}
.cal-g.sel .p,.cal-g.sel .t{color:#E0E3FF}
.cal-legenda{display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:var(--muted); margin:14px 0 0}
.cal-legenda i{display:inline-block; width:14px; height:14px; border-radius:4px; vertical-align:-2px; margin-right:6px; border:1px solid var(--line)}
.barra-azioni{position:sticky; bottom:16px; z-index:5; margin-top:18px; background:var(--dark); color:#fff; border-radius:var(--radius-lg); padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; box-shadow:var(--shadow-pop)}
.barra-azioni .btn{min-height:40px; font-size:14px; padding:0 16px}
.barra-azioni input{width:110px !important; min-height:40px !important; padding:0 12px !important}

/* ---------- tabelle ---------- */
.tabella-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--white)}
table.dati{width:100%; border-collapse:collapse; font-size:14px}
table.dati th{text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--faint); font-weight:700; padding:12px 14px; border-bottom:1px solid var(--line); white-space:nowrap; background:#FAFBFD}
table.dati td{padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:top}
table.dati tr:last-child td{border-bottom:0}
table.dati tr.clic{cursor:pointer}
table.dati tr.clic:hover td{background:#FAFAFF}
table.dati .num{text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap}
table.dati .muto{color:var(--muted); font-size:13px}

/* ---------- grafici ---------- */
.grafico{width:100%; height:auto; display:block}
.grafico text{font-family:inherit; font-size:12px; fill:var(--faint)}
.grafico .barra{fill:var(--indigo)}
.grafico .barra2{fill:var(--indigo-line)}
.grafico .linea{fill:none; stroke:var(--indigo); stroke-width:2.5}
.grafico .area{fill:var(--indigo); opacity:.1}
.grafico .griglia{stroke:var(--line); stroke-width:1}

/* ---------- stelle ---------- */
.stelle{color:#F59E0B; letter-spacing:1px; white-space:nowrap}
.voti{display:grid; grid-template-columns:repeat(4,1fr); gap:12px}
.voti div{background:var(--soft); border-radius:var(--radius); padding:12px 14px}
.voti b{display:block; font-size:20px}
.voti span{font-size:13px; color:var(--muted)}
@media (max-width:860px){.cal-wrap{grid-template-columns:1fr}.voti{grid-template-columns:1fr 1fr}}
@media (max-width:560px){.cal-g{min-height:52px; padding:4px 5px}.cal-g .p{font-size:11px}}
@media (max-width:560px){
  dl.details{grid-template-columns:1fr; gap:2px 0}
  dl.details dd{margin-bottom:10px}
  .card{padding:20px}
  .wrap{padding:0 16px}
}
