/* Verifica Mail — sistema visivo comune alle app GI (modello PWD Manager):
   token su variabili CSS, tema chiaro di default e scuro commutabile, vetro solo sulle superfici grandi. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --c-ink: 15 37 71; --c-mist: 88 99 116; --c-panel: 255 255 255; --c-panel2: 246 247 249;
  --c-edge: 221 226 233; --c-bone: 236 239 243; --c-brand: 23 57 108; --c-brand-dim: 47 91 156;
  --c-mint: 0 124 102; --c-mint-dim: 0 101 79; --c-onmint: 255 255 255;
  --c-danger: 191 28 57; --c-warn: 176 104 0; --c-shadow: 15 37 71;
  --glass-alpha: .72; --glass-blur: 18px;
  --f-display: "Archivo", system-ui, sans-serif;
  --f-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
.dark {
  --c-ink: 232 237 244; --c-mist: 152 165 182; --c-panel: 24 33 50; --c-panel2: 13 20 33;
  --c-edge: 46 60 84; --c-bone: 32 43 63; --c-brand: 120 163 224; --c-brand-dim: 86 128 190;
  --c-mint: 46 191 160; --c-mint-dim: 30 150 125; --c-onmint: 8 30 26;
  --c-danger: 240 110 134; --c-warn: 240 176 72; --c-shadow: 0 0 0;
  --glass-alpha: .6; --glass-blur: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: rgb(var(--c-panel2)); color: rgb(var(--c-ink));
  font: 15px/1.5 var(--f-sans);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgb(var(--c-brand) / .14), transparent 60%),
    radial-gradient(48rem 34rem at 92% 6%, rgb(var(--c-mint) / .12), transparent 62%),
    radial-gradient(52rem 38rem at 68% 104%, rgb(var(--c-brand-dim) / .10), transparent 60%);
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgb(var(--c-mint)); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: .86em; }
.muted { color: rgb(var(--c-mist)); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Superfici ---------------------------------------------------------- */
.glass {
  position: relative; background: rgb(var(--c-panel) / var(--glass-alpha));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%); backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid rgb(var(--c-edge));
  box-shadow: 0 1px 2px rgb(var(--c-shadow) / .06), 0 18px 40px -24px rgb(var(--c-shadow) / .45);
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to bottom, rgb(255 255 255 / .5), rgb(255 255 255 / 0) 42%); mix-blend-mode: soft-light;
}
@supports not (backdrop-filter: blur(1px)) { .glass { background: rgb(var(--c-panel)); } }
.veil { background: rgb(var(--c-panel) / .55); }

/* ---- Pulsanti e campi ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px;
  padding: 9px 15px; font-weight: 650; font-size: 14px; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: rgb(var(--c-brand)); color: #fff; }
.btn-primary:hover:not(:disabled) { background: rgb(var(--c-brand-dim)); }
.dark .btn-primary { color: rgb(var(--c-panel2)); }
.btn-accent { background: rgb(var(--c-mint)); color: rgb(var(--c-onmint)); }
.btn-accent:hover:not(:disabled) { background: rgb(var(--c-mint-dim)); }
.btn-danger { background: rgb(var(--c-danger)); color: #fff; }
.dark .btn-danger { color: rgb(var(--c-panel2)); }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-ghost { background: rgb(var(--c-panel) / .6); border-color: rgb(var(--c-edge)); }
.btn-ghost:hover:not(:disabled) { background: rgb(var(--c-bone)); }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { padding: 8px; }
.field {
  width: 100%; border-radius: 10px; border: 1px solid rgb(var(--c-edge)); background: rgb(var(--c-panel) / .7);
  padding: 9px 12px; font-size: 14px; transition: border-color .15s;
}
.field::placeholder { color: rgb(var(--c-mist) / .8); }
.field:focus { outline: none; border-color: rgb(var(--c-mint)); }
textarea.field { resize: vertical; min-height: 84px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgb(var(--c-bone)); gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 650; color: rgb(var(--c-mist)); }
.seg button[aria-pressed="true"] { background: rgb(var(--c-panel)); color: rgb(var(--c-ink)); box-shadow: 0 1px 2px rgb(var(--c-shadow) / .12); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.alto { color: rgb(var(--c-danger)); background: rgb(var(--c-danger) / .11); }
.pill.medio { color: rgb(var(--c-warn)); background: rgb(var(--c-warn) / .13); }
.pill.basso { color: rgb(var(--c-mint)); background: rgb(var(--c-mint) / .12); }
.tag { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: rgb(var(--c-bone)); color: rgb(var(--c-mist)); }

/* ---- Struttura: menu laterale ------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; border-width: 0 1px 0 0; border-radius: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand .mark { width: 36px; height: 36px; flex: none; }
.brand b { display: block; font: 700 16px/1.15 var(--f-display); }
.brand span { font-size: 12px; color: rgb(var(--c-mist)); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: rgb(var(--c-mist));
  text-decoration: none; font-weight: 650; font-size: 14px; transition: background-color .15s, color .15s;
}
.nav a:hover { background: rgb(var(--c-bone) / .8); color: rgb(var(--c-ink)); }
.nav a[aria-current="page"] { background: rgb(var(--c-brand)); color: #fff; box-shadow: 0 6px 18px -10px rgb(var(--c-brand) / .9); }
.dark .nav a[aria-current="page"] { color: rgb(var(--c-panel2)); }
.nav .count { margin-left: auto; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 99px; background: rgb(var(--c-danger)); color: #fff; }
.nav-sep { margin: 14px 11px 6px; font-size: 12px; font-weight: 700; color: rgb(var(--c-mist) / .85); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgb(var(--c-edge)); }
.who { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgb(var(--c-mint) / .16); color: rgb(var(--c-mint)); font: 700 13px var(--f-display);
}
.who div { min-width: 0; }
.who div b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who div span { display: block; font-size: 12px; color: rgb(var(--c-mist)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; }
.ver { font: 11px var(--f-mono); color: rgb(var(--c-mist) / .8); padding: 0 6px; }

.main { min-width: 0; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 4px 0 0; color: rgb(var(--c-mist)); max-width: 62ch; }

/* ---- Verifica: elenco + esito -------------------------------------------- */
.work { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.mailbox { border-radius: var(--r-lg); overflow: hidden; position: sticky; top: 20px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.mailbox-tools { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid rgb(var(--c-edge)); }
.tools-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: rgb(var(--c-mist)); width: 16px; height: 16px; }
.search .field { padding-left: 34px; }
.mail-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.mail {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 12px 16px;
  border: 0; border-top: 1px solid rgb(var(--c-edge) / .7); background: rgb(var(--c-panel) / .45); transition: background-color .12s;
}
.mail-list li:first-child .mail { border-top: 0; }
.mail:hover { background: rgb(var(--c-bone) / .9); }
.mail[aria-selected="true"] { background: rgb(var(--c-brand) / .09); box-shadow: inset 3px 0 0 rgb(var(--c-brand)); }
.mail .from { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail.unread .from::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c-brand)); margin: 0 7px 1px 0; }
.mail time { font-size: 12px; color: rgb(var(--c-mist)); align-self: center; }
.mail .subj { grid-column: 1 / -1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .prev { grid-column: 1 / -1; font-size: 12.5px; color: rgb(var(--c-mist)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.mail .prev svg { width: 14px; height: 14px; }
.list-note { padding: 28px 18px; text-align: center; color: rgb(var(--c-mist)); font-size: 14px; }
.skel { height: 64px; margin: 1px 0; background: linear-gradient(90deg, rgb(var(--c-bone) / .5), rgb(var(--c-bone)), rgb(var(--c-bone) / .5)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.pane { border-radius: var(--r-lg); padding: 28px; min-height: 420px; }
.back { display: none; margin-bottom: 14px; }

/* Stato vuoto: i tre passaggi sono davvero una sequenza */
.howto { max-width: 560px; margin: 22px auto; text-align: center; }
.howto h2 { font-size: 22px; margin-bottom: 6px; }
.howto > p { color: rgb(var(--c-mist)); margin: 0 0 26px; }
.steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; text-align: left; }
.steps li { counter-increment: s; padding: 16px; border-radius: var(--r-md); border: 1px solid rgb(var(--c-edge)); background: rgb(var(--c-panel) / .5); font-size: 14px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-bottom: 10px; background: rgb(var(--c-brand) / .1); color: rgb(var(--c-brand)); font: 700 13px var(--f-display); }
.steps b { display: block; margin-bottom: 2px; }
.steps span { color: rgb(var(--c-mist)); font-size: 13px; }
.drop { border: 1.5px dashed rgb(var(--c-edge)); border-radius: var(--r-md); padding: 18px; color: rgb(var(--c-mist)); font-size: 14px; transition: border-color .15s, background-color .15s; }
.drop.over { border-color: rgb(var(--c-mint)); background: rgb(var(--c-mint) / .06); color: rgb(var(--c-ink)); }
.drop button { border: 0; background: none; color: rgb(var(--c-brand)); font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.rule-note { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: rgb(var(--c-danger) / .07); font-size: 13.5px; }
.rule-note svg { color: rgb(var(--c-danger)); margin-top: 1px; }

/* Anteprima prima della verifica */
.preview { display: grid; gap: 18px; max-width: 640px; }
.preview .label { font-size: 12px; font-weight: 700; color: rgb(var(--c-mist)); margin-bottom: 2px; }
.preview h2 { font-size: 21px; overflow-wrap: anywhere; }
.preview .addr { overflow-wrap: anywhere; }
.preview-text { padding: 14px 16px; border-radius: var(--r-md); background: rgb(var(--c-bone) / .6); color: rgb(var(--c-mist)); font-size: 14px; overflow-wrap: anywhere; }
.preview-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Analisi in corso */
.working { max-width: 420px; margin: 40px auto; }
.working h2 { font-size: 20px; margin-bottom: 18px; }
.work-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.work-steps li { display: flex; gap: 12px; align-items: center; color: rgb(var(--c-mist)); font-size: 14.5px; transition: color .2s; }
.work-steps li .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgb(var(--c-edge)); flex: none; display: grid; place-items: center; }
.work-steps li.now { color: rgb(var(--c-ink)); font-weight: 650; }
.work-steps li.now .dot { border-color: rgb(var(--c-mint)); border-top-color: transparent; animation: spin .8s linear infinite; }
.work-steps li.done { color: rgb(var(--c-ink)); }
.work-steps li.done .dot { border-color: rgb(var(--c-mint)); background: rgb(var(--c-mint)); }
.work-steps li.done .dot svg { width: 13px; height: 13px; stroke: rgb(var(--c-onmint)); stroke-width: 3; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Esito: il semaforo è l'elemento che si ricorda ---------------------- */
.verdict {
  --lvl: var(--c-mint);
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  padding: 22px 24px; border-radius: var(--r-lg); margin: -6px -6px 22px;
  background: linear-gradient(135deg, rgb(var(--lvl) / .13), rgb(var(--lvl) / .04) 70%);
  border: 1px solid rgb(var(--lvl) / .28);
}
.verdict.medio { --lvl: var(--c-warn); }
.verdict.alto { --lvl: var(--c-danger); }
.lamp { display: grid; gap: 7px; padding: 9px; border-radius: 16px; background: rgb(var(--c-ink) / .9); }
.dark .lamp { background: rgb(0 0 0 / .55); border: 1px solid rgb(var(--c-edge)); }
.lamp i { width: 22px; height: 22px; border-radius: 50%; display: block; opacity: .2; }
.lamp i:nth-child(1) { background: #ff4d6a; } .lamp i:nth-child(2) { background: #ffb02e; } .lamp i:nth-child(3) { background: #2ee6b6; }
.verdict.alto .lamp i:nth-child(1), .verdict.medio .lamp i:nth-child(2), .verdict.basso .lamp i:nth-child(3) {
  opacity: 1; box-shadow: 0 0 16px 2px currentColor; animation: lampOn .7s var(--ease) both;
}
.verdict.alto .lamp i:nth-child(1) { color: #ff4d6a; } .verdict.medio .lamp i:nth-child(2) { color: #ffb02e; } .verdict.basso .lamp i:nth-child(3) { color: #2ee6b6; }
@keyframes lampOn { 0% { opacity: .2; transform: scale(.7); } 60% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
.verdict h2 { font-size: clamp(24px, 3.2vw, 32px); color: rgb(var(--lvl)); font-weight: 750; }
.verdict .about { margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.verdict .about b { font-weight: 650; }

.block { margin-bottom: 22px; }
.block h3 { font-size: 15px; margin-bottom: 10px; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.todo li svg { margin-top: 2px; color: rgb(var(--c-brand)); }
.todo li.pay { padding: 10px 12px; border-radius: 10px; background: rgb(var(--c-warn) / .12); }
.todo li.pay svg { color: rgb(var(--c-warn)); }
.reasons { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 15px; }
.reasons li::marker { color: rgb(var(--c-mist)); }

.checks { border: 1px solid rgb(var(--c-edge)); border-radius: var(--r-md); overflow: hidden; }
.check + .check { border-top: 1px solid rgb(var(--c-edge)); }
.check > button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; background: rgb(var(--c-panel) / .4);
  text-align: left; font-weight: 650; font-size: 14.5px;
}
.check > button:hover { background: rgb(var(--c-bone) / .7); }
.check .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check .st svg { width: 15px; height: 15px; stroke-width: 2.6; }
.check .st.ok, .check .st.info { background: rgb(var(--c-mint) / .14); color: rgb(var(--c-mint)); }
.check .st.warn { background: rgb(var(--c-warn) / .16); color: rgb(var(--c-warn)); }
.check .st.bad { background: rgb(var(--c-danger) / .13); color: rgb(var(--c-danger)); }
.check .sum { margin-left: auto; white-space: nowrap; font-weight: 500; font-size: 13px; color: rgb(var(--c-mist)); }
.check .chev { transition: transform .2s var(--ease); color: rgb(var(--c-mist)); width: 16px; height: 16px; }
.check[data-open="true"] .chev { transform: rotate(180deg); }
.check .body { display: none; padding: 4px 16px 16px 54px; }
.check[data-open="true"] .body { display: block; animation: rise .25s var(--ease) both; }
.find { padding: 8px 0; border-top: 1px dashed rgb(var(--c-edge)); font-size: 14px; }
.find:first-child { border-top: 0; }
.find .t { display: flex; gap: 8px; align-items: baseline; }
.find .t::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); background: rgb(var(--c-mint)); }
.find.alto .t::before { background: rgb(var(--c-danger)); } .find.medio .t::before { background: rgb(var(--c-warn)); } .find.info .t::before { background: rgb(var(--c-mist)); }
.find .d { margin: 3px 0 0 15px; font: 12px/1.45 var(--f-mono); color: rgb(var(--c-mist)); overflow-wrap: anywhere; }

.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv td { padding: 7px 0; border-top: 1px solid rgb(var(--c-edge) / .7); vertical-align: top; }
.kv tr:first-child td { border-top: 0; }
.kv td:first-child { color: rgb(var(--c-mist)); width: 34%; padding-right: 12px; }
.kv td { overflow-wrap: anywhere; }
.find.plain .t::before { display: none; }
.find.plain .t { font-weight: 650; font-size: 13px; color: rgb(var(--c-mist)); margin: 6px 0 2px; }
.flags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.flags .tag { background: rgb(var(--c-danger) / .1); color: rgb(var(--c-danger)); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 20px; border-top: 1px solid rgb(var(--c-edge)); }
.foot-note { margin-top: 16px; font-size: 12.5px; color: rgb(var(--c-mist)); }

/* ---- Tabelle (storico, segnalazioni) ------------------------------------- */
.table-card { border-radius: var(--r-lg); overflow: hidden; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; width: 100%;
  padding: 13px 18px; border: 0; border-top: 1px solid rgb(var(--c-edge) / .7); text-align: left; transition: background-color .12s;
}
.rows li:first-child .row { border-top: 0; }
.row:hover { background: rgb(var(--c-bone)); }
.row .s { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .f { font-size: 13px; color: rgb(var(--c-mist)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; font-size: 12.5px; color: rgb(var(--c-mist)); display: grid; gap: 4px; justify-items: end; }
.empty { padding: 48px 20px; text-align: center; color: rgb(var(--c-mist)); }
.empty b { display: block; color: rgb(var(--c-ink)); font: 650 17px var(--f-display); margin-bottom: 4px; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { border-radius: var(--r-md); padding: 16px 18px; }
.stat b { display: block; font: 700 28px var(--f-display); }
.stat span { font-size: 13px; color: rgb(var(--c-mist)); }
.stat.alto b { color: rgb(var(--c-danger)); } .stat.medio b { color: rgb(var(--c-warn)); } .stat.basso b { color: rgb(var(--c-mint)); }
.svc { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid rgb(var(--c-edge) / .7); }
.svc:first-child { border-top: 0; }
.svc .st { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.svc .st.ok { background: rgb(var(--c-mint) / .14); color: rgb(var(--c-mint)); }
.svc .st.ko { background: rgb(var(--c-danger) / .12); color: rgb(var(--c-danger)); }
.svc .st.opt { background: rgb(var(--c-bone)); color: rgb(var(--c-mist)); }
.svc .st svg { width: 15px; height: 15px; stroke-width: 2.6; }
.svc b { display: block; font-size: 14.5px; }
.svc span { font-size: 13px; color: rgb(var(--c-mist)); overflow-wrap: anywhere; }

.engine-test { margin-top: 20px; }
.engine-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid rgb(var(--c-edge)); flex-wrap: wrap; }
.engine-head h2 { font-size: 17px; margin-bottom: 2px; }
.engine-head p { margin: 0; font-size: 13.5px; color: rgb(var(--c-mist)); max-width: 60ch; }
.engine-rows:empty { display: none; }
.tag.role { margin-left: 8px; font-size: 11px; vertical-align: 1px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(var(--c-mint)); border-top-color: transparent; animation: spin .8s linear infinite; }

/* ---- Finestra di dialogo, avvisi ---------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(var(--c-ink) / .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .15s both; }
.dialog { width: min(480px, 100%); border-radius: var(--r-lg); padding: 24px; animation: rise .3s var(--ease) both; }
.dialog h2 { font-size: 19px; margin-bottom: 6px; }
.dialog p { margin: 0 0 14px; color: rgb(var(--c-mist)); font-size: 14px; }
.dialog .row-btn { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60; opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 12px; background: rgb(var(--c-ink)); color: rgb(var(--c-panel)); font-weight: 650; font-size: 14px;
  transition: opacity .2s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: rgb(var(--c-danger)); color: #fff; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: rgb(var(--c-danger) / .09); color: rgb(var(--c-ink)); font-size: 14px; margin-bottom: 16px; }
.alert svg { color: rgb(var(--c-danger)); margin-top: 1px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.rise { animation: rise .45s var(--ease) both; }

/* ---- Schermata di accesso (modello PWD Manager) --------------------------- */
.auth { position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(52rem 38rem at -6% -10%, rgb(var(--c-mint) / .2), transparent 62%), radial-gradient(60rem 42rem at 104% 106%, rgb(var(--c-danger) / .12), transparent 60%); }
.auth-bg svg { position: absolute; right: 0; top: 0; height: 70vh; width: 46vw; min-width: 420px; opacity: .6; }
.dark .auth-bg svg { opacity: .3; }
.auth-theme { position: fixed; top: 22px; right: 22px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.auth .mark { width: 54px; height: 54px; margin-bottom: 18px; }
.auth-card { width: min(420px, 100%); border-radius: 22px; padding: 32px 30px; text-align: center; }
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card p { margin: 0 0 24px; color: rgb(var(--c-mist)); }
.auth-card .btn { width: 100%; }
.ms { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms i { display: block; } .ms i:nth-child(1) { background: #f25022; } .ms i:nth-child(2) { background: #7fba00; } .ms i:nth-child(3) { background: #00a4ef; } .ms i:nth-child(4) { background: #ffb900; }
.auth-line { margin-top: 18px; font: 12px var(--f-mono); color: rgb(var(--c-mist)); }

/* ---- Schermi stretti ------------------------------------------------------ */
@media (max-width: 1080px) { .work { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); } .main { padding: 24px 20px 40px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); border-width: 0 0 1px 0; gap: 4px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; } .brand div, .nav-sep, .who, .ver, .nav a span.lbl { display: none; }
  .nav { display: flex; gap: 2px; } .nav a { padding: 9px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; } .side-actions .btn span { display: none; }
  .work { grid-template-columns: 1fr; }
  .mailbox { position: static; max-height: none; }
  .work.has-sel .mailbox { display: none; } .work:not(.has-sel) .pane.idle { display: none; }
  .back { display: inline-flex; }
  .pane { padding: 20px; }
  .steps { grid-template-columns: 1fr; }
  .verdict { grid-template-columns: 1fr; gap: 14px; } .lamp { grid-auto-flow: column; justify-self: start; }
  .row { grid-template-columns: 1fr auto; } .row .pill { grid-column: 1 / -1; justify-self: start; }
  .status-grid { grid-template-columns: 1fr; }
  .check .body { padding-left: 16px; }
  .kv tr, .kv td { display: block; width: auto !important; }
  .kv td:first-child { border-top: 1px solid rgb(var(--c-edge) / .7); padding-bottom: 0; }
  .kv td:last-child { border-top: 0; padding-top: 2px; }
  .kv tr:first-child td:first-child { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
