:root {
  --navy: #14254A; --giallo: #FFD83A; --crema: #FFFAF0; --blu: #2F6FD6; --rosso: #E2402F;
  --petrolio: #1691A8; --verde: #1F9A74; --viola: #7A4FD0; --postit: #FFF3A6;
  --ombra: 0 3px 0 rgba(20, 37, 74, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--crema); color: var(--navy); font-family: 'Nunito', system-ui, sans-serif; font-size: 16px; }
h1, h2, h3, .num, .tab b, button { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.brand { flex: 1; } .brand b { display: block; font-family: Fredoka, sans-serif; font-size: 18px; }
.brand small { color: var(--giallo); font-size: 12px; }
.instalar { background: var(--giallo); color: var(--navy); border: 0; border-radius: 20px; padding: 7px 14px; font-weight: 600; }
main { max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }
.abas { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 2px solid #14254A1a; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tab { flex: 1; border: 0; background: none; padding: 8px 2px 10px; color: #14254A99; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 20px; }
.tab b { font-size: 12px; font-weight: 500; }
.tab[aria-current="page"] { color: var(--navy); } .tab[aria-current="page"] b { background: var(--giallo); border-radius: 10px; padding: 0 8px; }
h1 { font-size: 24px; margin: 4px 0 12px; } h2 { font-size: 19px; margin: 18px 0 8px; }
.card { background: #fff; border: 2px solid #14254A22; border-radius: 16px; padding: 14px; margin: 10px 0; box-shadow: var(--ombra); }
.hero { background: var(--navy); color: #fff; border-radius: 18px; padding: 16px; text-align: center; }
.hero .num { font-size: 46px; color: var(--giallo); line-height: 1; }
.hero p { margin: 6px 0 0; }
.postit { background: var(--postit); border: 2px dashed #E2B800; border-radius: 14px; padding: 12px; margin: 10px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 12px 16px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: var(--ombra); }
.btn.pri { background: var(--giallo); color: var(--navy); } .btn.sec { background: #fff; color: var(--navy); border: 2px solid #14254A33; }
.btn.ok { background: var(--verde); color: #fff; } .btn.ko { background: var(--rosso); color: #fff; }
.btn.full { width: 100%; } .riga { display: flex; gap: 10px; } .riga > * { flex: 1; }
label.campo { display: block; font-weight: 700; margin: 8px 0 4px; }
input[type=date], select { width: 100%; font: inherit; padding: 10px; border-radius: 12px; border: 2px solid #14254A33; background: #fff; color: var(--navy); }
.mappa { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #14254A14; }
.mappa:last-child { border-bottom: 0; }
.mappa .n { font-family: Fredoka, sans-serif; background: var(--navy); color: var(--giallo); border-radius: 10px; padding: 3px 8px; font-size: 13px; }
.mappa .t { flex: 1; } .mappa .t small { display: block; color: #14254A99; }
.check { width: 30px; height: 30px; border-radius: 9px; border: 2px solid #14254A55; background: #fff; font-size: 18px; color: #fff; }
.check.on { background: var(--verde); border-color: var(--verde); }
.pill { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 10px; padding: 2px 8px; color: #fff; }
.flash { min-height: 230px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.flash .lbl { font-family: Fredoka, sans-serif; font-size: 13px; letter-spacing: .5px; }
.flash .front { font-size: 20px; font-weight: 800; margin: 10px 0; }
.flash .back { background: #EAF6F1; border-radius: 12px; padding: 12px; font-size: 18px; font-weight: 700; color: var(--verde); }
.flash .mp { font-size: 13px; color: #14254A99; margin-top: 8px; }
.timer { font-family: Fredoka, sans-serif; font-size: 22px; text-align: center; }
.timer.basso { color: var(--rosso); }
.barra { height: 10px; background: #14254A14; border-radius: 6px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); }
.opz { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 12px 14px; border-radius: 14px; border: 2px solid #14254A33; background: #fff; font: inherit; color: var(--navy); cursor: pointer; }
.opz b { font-family: Fredoka, sans-serif; margin-right: 6px; }
.opz.giusta { border-color: var(--verde); background: #EAF6F1; } .opz.sbagliata { border-color: var(--rosso); background: #FDECEA; }
.opz:disabled { cursor: default; }
.perche { border-left: 4px solid var(--giallo); padding: 8px 12px; background: #fff; border-radius: 8px; margin-top: 8px; }
.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat .card { margin: 0; text-align: center; } .stat .num { font-size: 30px; }
.area { margin: 10px 0; } .area div:first-child { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 4px; }
.muted { color: #14254A99; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; max-width: 90vw; }
.toast.on { opacity: 1; }
.conf { border: 2px solid var(--rosso); background: #FDECEA; border-radius: 14px; padding: 12px; }
