/* App Silvercom · stile Apple col marchio dello Studio (prova, 02/10/2026).
   Lo inserisce silvercom_vestito.apple() dal middleware, solo con il cookie
   silv_apple=1 (hub: utenti in settings.silvercom_stile_apple_utenti).
   Ridefinisce la tavolozza dell'app (--fondo, --carta, --oro…) e quella della
   stanza (--st-*) e delle schede (--vs-*): le pagine restano com'erano. */

html[data-stile="apple"]{
  --ap-sans:-apple-system,BlinkMacSystemFont,'SF Pro Text','Helvetica Neue',system-ui,sans-serif;
  /* chiaro */
  --fondo:#f3f1ee;--carta:#ffffff;--carta2:rgba(118,118,128,.12);--bordo:rgba(60,60,67,.14);
  --testo:#1d1d1f;--muto:#6e6e73;--oro:#a8653d;--oro-ch:#8a4f2c;--verde:#248a3d;--rosso:#d0342c;
  --su-oro:#ffffff;--giallo:#a35200;--ap-zebra:rgba(60,60,67,.035);--ap-oro-tenue:rgba(168,101,61,.10);--ap-ombra:0 1px 3px rgba(40,30,20,.07),0 0 0 .5px rgba(40,30,20,.05);
  --st-vetro:#ffffff;--st-filo:rgba(60,60,67,.12);--st-filo2:rgba(60,60,67,.22);--st-riga:rgba(60,60,67,.08);
  --st-mono:var(--ap-sans);--st-serif:var(--ap-sans);--st-oro-v:rgba(168,101,61,.10);
  --vs-vetro:#ffffff;--vs-filo:rgba(60,60,67,.12);--vs-filo2:rgba(60,60,67,.22);--vs-riga:rgba(60,60,67,.08);
  --vs-mono:var(--ap-sans);--vs-serif:var(--ap-sans);--ap-barra:rgba(60,60,67,.30);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  html[data-stile="apple"]:not([data-aspetto="chiaro"]){
    --fondo:#151517;--carta:#232326;--carta2:rgba(118,118,128,.24);--bordo:rgba(255,255,255,.10);
    --testo:#f5f5f7;--muto:#a1a1a6;--oro:#dba27a;--oro-ch:#e9bd98;--verde:#30d158;--rosso:#ff6961;
    --su-oro:#1c1c1e;--giallo:#ffd60a;--ap-zebra:rgba(255,255,255,.03);--ap-oro-tenue:rgba(219,162,122,.12);--ap-ombra:0 0 0 .5px rgba(255,255,255,.06);
    --st-vetro:#232326;--st-filo:rgba(255,255,255,.08);--st-filo2:rgba(255,255,255,.16);--st-riga:rgba(255,255,255,.07);
    --st-oro-v:rgba(219,162,122,.12);
    --vs-vetro:#232326;--vs-filo:rgba(255,255,255,.08);--vs-filo2:rgba(255,255,255,.16);--vs-riga:rgba(255,255,255,.07);--ap-barra:rgba(235,235,245,.30);
    color-scheme:dark;
  }
}
html[data-stile="apple"][data-aspetto="scuro"]{
  --fondo:#151517;--carta:#232326;--carta2:rgba(118,118,128,.24);--bordo:rgba(255,255,255,.10);
  --testo:#f5f5f7;--muto:#a1a1a6;--oro:#dba27a;--oro-ch:#e9bd98;--verde:#30d158;--rosso:#ff6961;
  --su-oro:#1c1c1e;--giallo:#ffd60a;--ap-zebra:rgba(255,255,255,.03);--ap-oro-tenue:rgba(219,162,122,.12);--ap-ombra:0 0 0 .5px rgba(255,255,255,.06);
  --st-vetro:#232326;--st-filo:rgba(255,255,255,.08);--st-filo2:rgba(255,255,255,.16);--st-riga:rgba(255,255,255,.07);
  --st-oro-v:rgba(219,162,122,.12);
  --vs-vetro:#232326;--vs-filo:rgba(255,255,255,.08);--vs-filo2:rgba(255,255,255,.16);--vs-riga:rgba(255,255,255,.07);--ap-barra:rgba(235,235,245,.30);
  color-scheme:dark;
}

/* fondo e caratteri */
html[data-stile="apple"] body{background:var(--fondo)!important;color:var(--testo);font-family:var(--ap-sans)!important;
  -webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums;letter-spacing:-.003em}
html[data-stile="apple"] h1{font-family:var(--ap-sans)!important;font-weight:700!important;letter-spacing:-.025em!important}
html[data-stile="apple"] .eyebrow,html[data-stile="apple"] .st-ey{font-family:var(--ap-sans)!important;letter-spacing:0!important;
  text-transform:none!important;font-size:13px!important;font-weight:600!important;color:var(--muto)!important}

/* carte e tabelle: superfici piene con ombra leggera, niente vetro */
html[data-stile="apple"] .card,html[data-stile="apple"] .form,html[data-stile="apple"] .tile,html[data-stile="apple"] table,
html[data-stile="apple"] .tot>div{box-shadow:var(--ap-ombra);border-color:transparent!important}
html[data-stile="apple"] th{font-family:var(--ap-sans)!important;letter-spacing:0!important;text-transform:none!important;color:var(--muto)}

/* bottoni e selettori a capsula: l'attivo in rame pieno */
html[data-stile="apple"] .btn{border-radius:999px!important;border:0!important;background:var(--carta2)!important;color:var(--testo)!important}
html[data-stile="apple"] .btn:hover{background:var(--st-filo2)!important}
html[data-stile="apple"] .btn.on,html[data-stile="apple"] .vs-seg .btn.on,html[data-stile="apple"] .st .st-azp.on{
  background:var(--oro)!important;color:var(--su-oro)!important;border-color:transparent!important}
html[data-stile="apple"] .st-azp{border:0!important;background:var(--carta2)!important;color:var(--testo)!important}
html[data-stile="apple"] .vs-seg{background:var(--carta2)!important;border:0!important}
html[data-stile="apple"] input,html[data-stile="apple"] select,html[data-stile="apple"] textarea{
  background:var(--carta2)!important;border:0!important;color:var(--testo)!important;border-radius:10px}

/* anello dei progressi: la traccia si vede anche sul chiaro */
html[data-stile="apple"] .st-ring{background:conic-gradient(var(--c) calc(var(--p)*1%),var(--st-filo2) 0)!important}
html[data-stile="apple"] .st-ring span{font-family:var(--ap-sans)!important}
html[data-stile="apple"] ::selection{background:color-mix(in srgb,var(--oro) 30%,transparent)}

/* scritte bianche fissate a mano nelle schede: sul chiaro tornano antracite */
html[data-stile="apple"][data-tono="chiaro"] [style*="color:#fff"]:not([style*="background"]):not(.btn),
html[data-stile="apple"][data-tono="chiaro"] [style*="color:white"]:not([style*="background"]):not(.btn),
html[data-stile="apple"][data-tono="chiaro"] [style*="color:#e8eaee"]:not([style*="background"]){color:var(--testo)!important}

/* il logo Silvercom ha la scritta bianca: sul chiaro si inverte (il bianco diventa nero, il rosso resta rosso) */
html[data-stile="apple"][data-tono="chiaro"] img[src*="/silvercom/logo"]{filter:invert(1) hue-rotate(180deg)}

/* tasto Aspetto: Automatico / Chiaro / Scuro (02/10/2026) */
html[data-stile="apple"] .ap-aspetto{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0 13px;border-radius:999px;border:0;
  background:var(--carta2);color:var(--testo);font:500 12.5px var(--ap-sans);cursor:pointer}
html[data-stile="apple"] .ap-aspetto i{width:13px;height:13px;border-radius:50%;border:1.5px solid var(--oro);
  background:linear-gradient(90deg,transparent 50%,var(--oro) 50%)}
html[data-stile="apple"] .ap-aspetto--fluttua{position:fixed;left:max(14px,env(safe-area-inset-left));bottom:max(14px,env(safe-area-inset-bottom));z-index:60;
  min-height:44px;background:var(--carta);box-shadow:0 6px 20px -6px rgba(0,0,0,.35),0 0 0 .5px var(--bordo)}

html[data-stile="apple"] body:has(.ap-aspetto--fluttua){padding-bottom:84px!important}

/* pannelli che galleggiano (menu «Altro», storico del tecnico, scheda della Resa,
   barra delle modifiche, fumetti): vetro spesso CON sfocatura, come i menu di macOS.
   Qui --carta2 è un riempimento trasparente al 12 %: da solo lasciava leggere quel che sta
   sotto (Roberto 02/10/2026: «la parte dietro dovrebbe sfuocarsi altrimenti non si legge») */
html[data-stile="apple"] .vs-menu>div,html[data-stile="apple"] #storico,html[data-stile="apple"] #stq,
html[data-stile="apple"] #modbar,html[data-stile="apple"] .comp .mot .cg[data-t]:hover::after,
html[data-stile="apple"] .comp .mot .cg[data-t]:focus-within::after{
  background:var(--carta)!important;background:color-mix(in srgb,var(--carta) 84%,transparent)!important;
  -webkit-backdrop-filter:saturate(180%) blur(30px)!important;backdrop-filter:saturate(180%) blur(30px)!important;
  border:.5px solid var(--bordo)!important;
  box-shadow:0 24px 56px -18px rgba(0,0,0,.42),0 2px 8px rgba(0,0,0,.08)!important}
html[data-stile="apple"] .vs-menu>div,html[data-stile="apple"] #storico,html[data-stile="apple"] #stq{border-radius:18px!important}
html[data-stile="apple"] .vs-menu>div .btn{background:transparent!important;border-radius:10px!important;min-height:36px}
html[data-stile="apple"] .vs-menu>div .btn:hover{background:var(--carta2)!important}
/* dentro lo storico: tabella senza scatola propria, etichette del grafico che non si accavallano */
html[data-stile="apple"] #storico table{box-shadow:none!important;background:transparent!important}
html[data-stile="apple"] #storico svg text{font-size:7px}

/* righe d'intestazione che restano ferme scorrendo: fondo pieno, non trasparente */
html[data-stile="apple"] #filepan tr.testa td{background:var(--carta)!important}

/* veli dietro le finestre: più leggeri sul chiaro, e quel che sta sotto si sfoca */
html[data-stile="apple"] .pop,html[data-stile="apple"] .bn-vela,html[data-stile="apple"] #inv-velo{
  -webkit-backdrop-filter:blur(10px) saturate(140%);backdrop-filter:blur(10px) saturate(140%)}
html[data-stile="apple"][data-tono="chiaro"] .pop,html[data-stile="apple"][data-tono="chiaro"] .bn-vela,
html[data-stile="apple"][data-tono="chiaro"] #inv-velo{background:rgba(40,32,26,.30)!important}
