/* Pannello — serie SOLO: turchese #4FCFBB e antracite #0D1016. Ogni altro colore ha la stessa tinta e saturazione
   di uno dei due e cambia solo la luminosità. Un problema si riconosce perché la sua scheda si «accende»: chiara su
   fondo scuro, con il simbolo e il motivo scritto. */
:root {
  --a: 220 26%;           /* antracite: tinta e saturazione */
  --t: 171 58%;           /* turchese: tinta e saturazione */
  --fondo: hsl(var(--a) 7%);
  --fondo-2: hsl(var(--a) 10%);
  --carta: hsl(var(--a) 13%);
  --carta-2: hsl(var(--a) 17%);
  --linea: hsl(var(--a) 22%);
  --testo: hsl(var(--a) 94%);
  --testo-2: hsl(var(--a) 74%);
  --testo-3: hsl(var(--a) 56%);
  --turchese: hsl(var(--t) 56%);
  --turchese-chiaro: hsl(var(--t) 80%);
  --turchese-scuro: hsl(var(--t) 24%);
  --turchese-fondo: hsl(var(--t) 11%);
  --raggio: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--fondo); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(120% 60% at 50% -10%, var(--turchese-fondo), var(--fondo) 60%); color: var(--testo); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
.sprite { position: absolute; width: 0; height: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--turchese); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* barra in alto e schede in basso */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; background: hsl(var(--a) 7% / .82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.marchio { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.marchio img { border-radius: 9px; }
main { max-width: 980px; margin: 0 auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 110px); outline: none; }
.schede { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(env(safe-area-inset-bottom) + 8px); background: hsl(var(--a) 9% / .9); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--linea); }
.schede a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; color: var(--testo-3); text-decoration: none; font-size: .8rem; font-weight: 650; border-radius: 12px; }
.schede a[aria-current="page"] { color: var(--turchese); }
.schede .contatore { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--turchese); color: var(--fondo); font-size: .72rem; line-height: 20px; text-align: center; }
@media (min-width: 900px) { .schede { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; width: 560px; border: 1px solid var(--linea); border-radius: 22px; padding-bottom: 8px; } }

/* intestazioni */
.testa { margin: 12px 0 20px; }
.occhiello { margin: 0 0 6px; color: var(--turchese); font-size: .8rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.9rem, 6vw, 2.5rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.sotto { margin: 8px 0 0; color: var(--testo-2); font-size: 1.05rem; }
h2 { margin: 28px 0 12px; font-size: 1.3rem; letter-spacing: -.02em; }
.meta { color: var(--testo-3); font-size: .92rem; }

/* comandi */
.bottone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--carta-2); color: var(--testo); font-weight: 650; cursor: pointer; text-decoration: none; }
.bottone.primario { background: var(--turchese); color: var(--fondo); }
.bottone.tondo { width: 44px; padding: 0; }
.bottone:active { transform: scale(.97); }
.bottone[disabled] { opacity: .5; }
.riga { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tendina { position: relative; display: inline-flex; align-items: center; }
.tendina select { -webkit-appearance: none; appearance: none; height: 44px; padding: 0 42px 0 16px; border: 1px solid var(--linea); border-radius: 999px; background: var(--carta); color: var(--testo); font: inherit; font-weight: 650; }
.tendina .ic { position: absolute; right: 14px; width: 18px; height: 18px; pointer-events: none; }

/* riepilogo e schede delle app */
.riepilogo { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--raggio); background: var(--turchese-fondo); border: 1px solid var(--turchese-scuro); }
.riepilogo .ic { width: 34px; height: 34px; color: var(--turchese); }
.riepilogo strong { display: block; font-size: 1.2rem; }
.riepilogo.male { background: var(--testo); color: var(--fondo); border-color: var(--testo); }
.riepilogo.male .ic { color: var(--fondo); }
.riepilogo.male .meta { color: hsl(var(--a) 30%); }
.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.carta { position: relative; display: grid; gap: 10px; padding: 18px; border-radius: var(--raggio); background: var(--carta); border: 1px solid var(--linea); }
.carta h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.punto { width: 12px; height: 12px; border-radius: 50%; background: var(--turchese); box-shadow: 0 0 0 5px var(--turchese-fondo); flex: none; }
.punto.spenta { background: var(--testo-3); box-shadow: none; }
.carta.male { background: var(--testo); color: var(--fondo); border-color: var(--testo); }
.carta.male .punto { background: var(--fondo); box-shadow: 0 0 0 5px hsl(var(--a) 80%); }
.carta.male .meta, .carta.male .valore small { color: hsl(var(--a) 32%); }
.carta.male .problema { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.carta.spenta { opacity: .6; }
.valori { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.valore { display: grid; }
.valore b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.valore small { color: var(--testo-3); font-size: .8rem; }
.pillole { display: flex; flex-wrap: wrap; gap: 6px; }
.pillola { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--carta-2); font-size: .85rem; font-weight: 600; color: var(--testo-2); text-decoration: none; }
.pillola .ic { width: 15px; height: 15px; }
.pillola.ok { color: var(--turchese); }
.pillola.no { background: var(--testo); color: var(--fondo); }
.carta.male .pillola { background: hsl(var(--a) 85%); color: var(--fondo); }

/* accessi */
.barre { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
.barre i { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--turchese); opacity: .85; }
.barre i.vuota { background: var(--linea); }
.tabella { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabella th, .tabella td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--linea); }
.tabella th:first-child, .tabella td:first-child { text-align: left; }
.tabella th { color: var(--testo-3); font-size: .85rem; font-weight: 650; }

/* posta */
.elenco { display: grid; gap: 2px; border-radius: var(--raggio); overflow: hidden; border: 1px solid var(--linea); }
.messaggio { display: grid; gap: 2px; width: 100%; padding: 14px 16px; border: 0; background: var(--carta); text-align: left; cursor: pointer; }
.messaggio .prima { display: flex; justify-content: space-between; gap: 10px; }
.messaggio .chi { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messaggio .oggetto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messaggio .anteprima { color: var(--testo-3); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messaggio.nuova { background: var(--carta-2); }
.messaggio.nuova .chi::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--turchese); vertical-align: 1px; }
.etichetta { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--turchese-fondo); color: var(--turchese-chiaro); font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.testo-email { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.6; padding: 16px; border-radius: 14px; background: var(--fondo-2); }

/* foglio (dettagli) */
.foglio { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; background: hsl(var(--a) 4% / .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.foglio-corpo { max-height: 92dvh; overflow: auto; padding: 20px 20px calc(env(safe-area-inset-bottom) + 24px); border-radius: 24px 24px 0 0; background: var(--fondo-2); border-top: 1px solid var(--linea); width: 100%; max-width: 760px; margin: 0 auto; }
.foglio-testa { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.foglio-testa h2 { margin: 0; }
@media (min-width: 900px) { .foglio { align-items: center; } .foglio-corpo { border-radius: 24px; border: 1px solid var(--linea); } }

/* moduli */
.campo { display: grid; gap: 6px; margin-bottom: 12px; }
.campo span { color: var(--testo-2); font-size: .9rem; font-weight: 600; }
.campo input { height: 46px; padding: 0 14px; border: 1px solid var(--linea); border-radius: 12px; background: var(--carta); color: var(--testo); font: inherit; }
.campo input:focus { outline: 2px solid var(--turchese); outline-offset: 1px; }
.spunta { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; font-weight: 600; }
.spunta input { width: 22px; height: 22px; accent-color: var(--turchese); }

/* registro */
.evento { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.evento .ic { width: 20px; height: 20px; color: var(--turchese); margin-top: 3px; }
.evento.problema .ic, .evento.actions .ic, .evento.errore .ic { color: var(--testo); }
.vuoto { padding: 28px 20px; border-radius: var(--raggio); background: var(--carta); border: 1px dashed var(--linea); color: var(--testo-2); }
.vuoto strong { display: block; color: var(--testo); font-size: 1.1rem; margin-bottom: 4px; }
.avviso { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); z-index: 30; padding: 12px 18px; border-radius: 14px; background: var(--testo); color: var(--fondo); font-weight: 650; box-shadow: 0 10px 30px hsl(var(--a) 2% / .6); max-width: calc(100% - 32px); }
.gira { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
