:root {
  --fondo: #0d0f12;
  --carta: #171a1f;
  --carta-2: #1f232a;
  --linea: #2a2f37;
  --testo: #f2f4f7;
  --tenue: #9aa3ae;
  --lime: #c8ff2e;
  --lime-scuro: #1c2406;
  --arancio: #ff8a3d;
  --azzurro: #4fc3ff;
  --rosso: #ff5c5c;
  --numeri: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--testo);
  font: 16px/1.5 'Inter', system-ui, sans-serif;
}
main { max-width: 480px; margin: 0 auto; padding: 12px 16px 48px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--tenue); text-transform: uppercase; letter-spacing: .08em; }

.testata { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 4px; }
.freccia { width: 44px; height: 44px; border-radius: 50%; background: var(--carta); font-size: 26px; line-height: 1; }
.titolo-giorno { text-align: center; display: flex; flex-direction: column; }
.marchio { font-family: var(--numeri); font-weight: 800; letter-spacing: .2em; color: var(--lime); font-size: 14px; }
#data { font-weight: 600; font-size: 17px; }

.eroe { text-align: center; padding: 8px 0 4px; }
.anello { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.anello svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anello circle { fill: none; stroke-width: 10; }
.anello-fondo { stroke: var(--carta-2); }
.anello-pieno { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(200,255,46,.45)); }
.anello-testo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grande { font-family: var(--numeri); font-weight: 800; font-size: 76px; line-height: .9; }
.unita { color: var(--tenue); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; }
.obiettivo { color: var(--tenue); font-size: 14px; margin: 6px 0 0; min-height: 21px; }
.obiettivo b { color: var(--lime); font-weight: 600; }

.macro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 24px; }
.tessera { background: var(--carta); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.etichetta { color: var(--tenue); font-size: 12px; }
.valore { font-family: var(--numeri); font-weight: 700; font-size: 32px; line-height: 1.1; }
.valore::after { content: ' g'; font-size: 16px; color: var(--tenue); }
.sotto { color: var(--tenue); font-size: 11px; line-height: 1.35; }

.aggiungi { background: var(--carta); border-radius: 20px; padding: 16px; margin-bottom: 24px; }
.primario { width: 100%; background: var(--lime); color: #111; font-weight: 700; font-size: 17px; padding: 14px; border-radius: 14px; margin-bottom: 12px; }
.primario:active, .gettone:active, .invia:active { transform: scale(.97); }
.gettoni { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.gettoni:empty { display: none; }
.gettone { background: var(--carta-2); border: 1px solid var(--linea); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.gettone.pasto { border-color: var(--lime); color: var(--lime); }
.scrivi { display: flex; gap: 8px; align-items: flex-end; }
textarea { flex: 1; resize: none; background: var(--fondo); color: var(--testo); border: 1px solid var(--linea); border-radius: 14px; padding: 12px; font: inherit; font-size: 16px; }
textarea:focus { outline: none; border-color: var(--lime); }
.invia { width: 52px; height: 52px; border-radius: 14px; background: var(--lime); color: #111; font-size: 30px; font-weight: 700; flex: none; }

#dubbi:empty { display: none; }
.dubbio { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--carta-2); border: 1px solid var(--arancio); }
.dubbio p { margin: 0 0 8px; font-size: 14px; }
.dubbio .gettoni { margin: 0; }
.dubbio .cerca { width: 100%; margin-top: 8px; background: var(--fondo); color: var(--testo); border: 1px solid var(--linea); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 15px; }

.lista { margin-bottom: 16px; }
.riga-titolo { display: flex; justify-content: space-between; align-items: baseline; }
.testo-btn { color: var(--lime); font-size: 14px; font-weight: 500; padding: 4px 0; }
#voci { list-style: none; margin: 0; padding: 0; }
.voce { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--linea); animation: entra .3s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
.voce-nome { flex: 1 1 100%; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.voce-nome b { font-weight: 500; }
.voce-prot { margin-left: auto; }
.voce-nome small { color: var(--tenue); font-size: 12px; }
.voce-grammi { display: flex; align-items: center; background: var(--carta); border-radius: 10px; }
.voce-grammi button { width: 32px; height: 36px; font-size: 18px; color: var(--tenue); }
.voce-grammi input { width: 52px; background: none; border: 0; color: var(--testo); text-align: center; font: 600 16px var(--numeri); font-size: 19px; -moz-appearance: textfield; }
.voce-grammi input::-webkit-outer-spin-button, .voce-grammi input::-webkit-inner-spin-button { -webkit-appearance: none; }
.voce-grammi span { color: var(--tenue); font-size: 12px; padding-right: 6px; }
.voce-prot { text-align: right; font-family: var(--numeri); font-weight: 700; font-size: 19px; color: var(--lime); }
.voce-prot::after { content: ' g prot'; font: 12px 'Inter', sans-serif; color: var(--tenue); }
.voce-togli { color: var(--tenue); font-size: 20px; width: 28px; }
.vuoto { color: var(--tenue); font-size: 14px; }

.dettagli { background: var(--carta); border-radius: 16px; padding: 4px 16px; margin-bottom: 12px; }
.dettagli summary { padding: 12px 0; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.dettagli summary::-webkit-details-marker { display: none; }
.dettagli summary::after { content: '⌄'; color: var(--tenue); }
.dettagli[open] summary::after { content: '⌃'; }
.vit { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 6px 0; border-top: 1px solid var(--linea); font-size: 14px; }
.vit .barra { grid-column: 1 / -1; height: 4px; background: var(--carta-2); border-radius: 2px; overflow: hidden; }
.vit .barra i { display: block; height: 100%; background: var(--azzurro); border-radius: 2px; }
.vit .barra i.pieno { background: var(--lime); }
.vit span:nth-child(2) { color: var(--tenue); font-size: 13px; }
.vit-gruppo { color: var(--tenue); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 4px; }

.calorie { display: flex; justify-content: space-between; color: var(--tenue); padding: 8px 4px 16px; font-size: 14px; }
.peso { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.peso input { width: 90px; background: var(--fondo); color: var(--testo); border: 1px solid var(--linea); border-radius: 10px; padding: 8px 10px; font: 600 18px var(--numeri); }
.nota { color: var(--tenue); font-size: 13px; }
footer { color: #5d6570; font-size: 12px; text-align: center; margin-top: 24px; }

.avviso { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--lime); color: #111; font-weight: 600; padding: 10px 18px; border-radius: 999px; transition: transform .3s; max-width: 90vw; text-align: center; }
.avviso.su { transform: translate(-50%, 0); }
.marchio { color: var(--testo); }
.marchio b { color: var(--lime); font-weight: 800; }
.invia { display: flex; align-items: center; justify-content: center; position: relative; }
.invia svg { width: 26px; height: 26px; fill: none; stroke: #111; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.invia .ico-ok { display: none; }
.invia.pronto .ico-mic { display: none; }
.invia.pronto .ico-ok { display: block; }
.invia.ascolta { background: var(--rosso); animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,92,.55); } 50% { box-shadow: 0 0 0 10px rgba(255,92,92,0); } }
.suggerimento { color: var(--tenue); font-size: 13px; margin: 8px 0 0; text-align: center; }
