/* Tema Didaflow: i valori stanno solo qui, come variabili. Il marchio non si tocca; si lavora su impaginazione, spaziatura e dimensioni. */
:root {
  --ground: #fbf8f6; --surface: #ffffff; --ink: #1a1411; --muted: #5e534d; --line: #e6ddd8; --border-strong: #8c7d75;
  --accent: #d96d60; --on-accent: #1a1411; --accent-strong: #b5471e; --ok: #4a6a2a; --warn: #9a6414; --error: #b3121e;
  --font-titoli: "Satoshi", "Inter", system-ui, sans-serif; --font-testo: "Inter", system-ui, sans-serif;
  --r-1: 6px; --r-2: 10px; --r-3: 16px; --r-pillola: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-12: 48px;
  --bersaglio: 44px;
  color-scheme: light;
}
:root[data-tema="scuro"] {
  --ground: #14110f; --surface: #1d1916; --ink: #f4eeea; --muted: #b3a69f; --line: #342c27; --border-strong: #7d6f68;
  --accent-strong: #ffa987; --ok: #a8c878; --warn: #e3b04b; --error: #ff5c6c; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] {
    --ground: #14110f; --surface: #1d1916; --ink: #f4eeea; --muted: #b3a69f; --line: #342c27; --border-strong: #7d6f68;
    --accent-strong: #ffa987; --ok: #a8c878; --warn: #e3b04b; --error: #ff5c6c; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font-testo); min-height: 100vh;
  overflow-wrap: anywhere; padding-bottom: calc(var(--bersaglio) + var(--s-8) + env(safe-area-inset-bottom, 0px));
}
main { max-width: 40rem; margin: 0 auto; padding: var(--s-6) var(--s-4); }
h1, h2, .marchio { font-family: var(--font-titoli); font-weight: 600; line-height: 1.2; margin: 0 0 var(--s-4); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.125rem; margin-top: var(--s-8); }
.marchio { font-weight: 300; font-size: 2.5rem; text-transform: lowercase; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s-3); } .muted { color: var(--muted); } .piccolo { font-size: 0.875rem; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: var(--r-1); }
.salta { position: absolute; left: var(--s-2); top: -100px; background: var(--surface); padding: var(--s-2) var(--s-3); z-index: 10; }
.salta:focus { top: var(--s-2); }
/* elenchi: righe senza linee, separate dallo spazio */
.elenco { list-style: none; margin: 0; padding: 0; }
.elenco > li { margin: 0; }
.riga {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--bersaglio);
  padding: var(--s-3) 0; color: var(--ink); text-decoration: none;
}
.riga .testa { flex: 1 1 auto; min-width: 0; } .riga .titolo { display: block; } .riga .sotto { display: block; color: var(--muted); font-size: 0.875rem; }
.riga .valore { flex: 0 0 auto; font-family: var(--font-titoli); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.riga .valore.nascosto { font-family: var(--font-testo); font-size: 0.875rem; color: var(--muted); max-width: 9rem; text-align: right; }
a.riga:hover .titolo { text-decoration: underline; }
/* controlli */
.pulsante, button, input[type="text"], input[type="password"], input[type="search"], select {
  font: inherit; color: var(--ink); min-height: var(--bersaglio); border-radius: var(--r-2); border: 1px solid var(--border-strong); background: var(--surface);
  padding: 0 var(--s-4); max-width: 100%;
}
.pulsante, button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pieno { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.campo { display: block; width: 100%; margin-bottom: var(--s-4); }
label { display: block; margin-bottom: var(--s-2); font-weight: 600; }
.errore { color: var(--error); font-weight: 600; }
/* la pagina di accesso */
.accesso { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.accesso .marchio { font-size: 3.5rem; }
.piede { margin-top: var(--s-12); color: var(--muted); font-size: 0.875rem; }
/* la home */
.testata { display: flex; align-items: center; justify-content: space-between; }
.testata .marchio { margin: 0; }
.comandi { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); background: var(--ground); }
.tondo { width: var(--bersaglio); min-width: var(--bersaglio); padding: 0; border-radius: var(--r-pillola); }
.pillola { border-radius: var(--r-pillola); padding: 0 var(--s-6); }
/* le schede in basso */
.schede { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.schede a { flex: 1 1 0; min-height: calc(var(--bersaglio) + var(--s-2)); display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-weight: 600; }
.schede a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent-strong); }
.selezione { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.selezione select { flex: 1 1 10rem; }
.nota { color: var(--muted); font-size: 0.875rem; margin-top: var(--s-8); }
dl { margin: 0; } dt { font-weight: 600; margin-top: var(--s-4); } dd { margin: var(--s-1) 0 0; }
.sottotitolo { font-size: 1rem; font-weight: 400; color: var(--muted); margin: 0 0 var(--s-4); }
.etichetta-riga { flex-basis: 100%; margin: 0; }
.distanza { margin-top: var(--s-8); }
