/* ======= Schermata iniziale: creazione del programma ======= */
.onb { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; }
.onb.hidden { display: none; }
.onb-bar { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid var(--border); background: var(--surface-1); }
.onb-skip { margin-left: auto; background: transparent; border: none; color: var(--muted); font-size: 0.74rem; text-decoration: underline; cursor: pointer; flex-shrink: 0; }
.onb-progress { height: 3px; background: var(--surface-2); }
.onb-progress span { display: block; height: 100%; background: var(--primary); width: 0; transition: width .3s ease; }
.onb-body { flex: 1; overflow-y: auto; padding: var(--sp-5) var(--sp-4) var(--sp-6); max-width: 480px; width: 100%; margin: 0 auto; }
.onb-footer { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface-1); }
.onb-footer .btn-start-workout { max-width: 480px; margin: 0 auto; display: block; }
.onb-q { font-size: 1.2rem; font-weight: 900; line-height: var(--lh-loose); margin: 0 0 var(--sp-2) 0; }
.onb-why { font-size: 0.8rem; color: var(--muted); line-height: var(--lh-base); margin: 0 0 var(--sp-5) 0; }
.onb-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 12px; margin-bottom: 8px; cursor: pointer; color: var(--text);
}
.onb-opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: 0 0 0 1px var(--primary) inset; }
.onb-opt-emoji { font-size: 1.5rem; flex-shrink: 0; }
.onb-opt-main { flex: 1; min-width: 0; }
.onb-opt-name { font-weight: 800; font-size: 0.92rem; }
.onb-opt-desc { font-size: 0.75rem; line-height: var(--lh-tight); color: var(--muted); margin-top: var(--sp-1); }
.onb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.onb-field span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; font-weight: 800; display: block; margin-bottom: 3px; }
.onb-note { font-size: 0.72rem; color: var(--muted); background: var(--surface-1); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px; margin-top: 14px; line-height: 1.45; }

/* lettore BIA */
.bia-drop { display: block; background: var(--surface-2); border: 1.5px dashed var(--border); color: var(--muted); text-align: center; padding: 22px 14px; border-radius: 12px; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.bia-drop:hover { border-color: var(--primary); color: var(--text); }
.bia-status { font-size: 0.76rem; margin-top: 10px; min-height: 1.2em; }
.bia-status.ok { color: var(--success); }
.bia-status.warn { color: var(--accent); }
.bia-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bia-val { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.bia-val span { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; font-weight: 800; display: block; margin-bottom: 4px; }
.bia-val input { padding: 8px 4px; text-align: center; font-size: 0.9rem; font-weight: 800; }

/* esito */
.res-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: var(--sp-4); margin-bottom: var(--sp-3); }
.res-title { font-size: 0.72rem; font-weight: 900; line-height: var(--lh-tight); text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin: 0 0 var(--sp-3) 0; }
.res-big { font-size: 1.05rem; font-weight: 900; }
.res-line { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 0.82rem; line-height: var(--lh-tight); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.res-line:last-child { border-bottom: none; }
.res-line b { font-weight: 800; }
.res-tag { display: inline-block; font-size: 0.64rem; font-weight: 900; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; margin-top: 6px; }
.res-tag.good { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success-ink); border: 1px solid var(--success); }
.res-tag.mid { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning-ink); border: 1px solid var(--warning); }
.res-tag.att { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--accent-ink); border: 1px solid var(--accent); }

/* ======= Righe proposta: si tocca tutta la riga, l icona si illumina ======= */
.pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 6px; cursor: pointer; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.pick-row:active { transform: scale(0.995); }
.pick-row.on { border-color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.pick-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  filter: grayscale(100%) opacity(0.5);
  transition: filter .18s ease, box-shadow .18s ease, background .18s ease;
}
.pick-row.on .pick-icon {
  filter: none;
  background: color-mix(in srgb, var(--success) 18%, transparent);
  border-color: var(--success);
  box-shadow: 0 0 10px color-mix(in srgb, var(--success) 55%, transparent);
}
.pick-main { flex: 1; min-width: 0; }
.pick-name { font-weight: 700; font-size: 0.87rem; }
.pick-meta { font-size: 0.74rem; line-height: var(--lh-tight); color: var(--muted); margin-top: var(--sp-1); }
.pick-check { flex-shrink: 0; font-size: 1.1rem; font-weight: 900; color: var(--text-dim); }
.pick-row.on .pick-check { color: var(--success-ink); }
.onb-opt.on .pick-check { color: var(--primary-ink); }

/* tenda scorrevole per il resto degli esercizi */
.drawer-btn {
  width: 100%; margin-top: 8px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px; border-radius: 8px; font-size: 0.76rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.drawer-btn .caret { transition: transform .18s ease; }
.drawer-btn.open .caret { transform: rotate(180deg); }
.drawer-body { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.drawer-body.open { max-height: 1400px; overflow-y: auto; }
.onb-note:empty { display: none; }   /* il messaggio dell eta e vuoto finche l eta e valida */
.onb-manca { max-width: 480px; margin: 0 auto 8px; font-size: 0.8rem; font-weight: 700; color: var(--text); }
.onb-manca:empty { display: none; }
#onb-next.onb-next-off { opacity: 0.45; box-shadow: none; }
/* Schermate del primo avvio (consenso, informativa aggiornata e suo testo intero, archiviazione, questionario): titoli, pulsanti e
   intestazioni con la sola iniziale maiuscola, come nell uso italiano; il resto dell app resta com e */
#consent .btn-start-workout, #consent .btn-archive, #consent .res-title,
#consent-text-sheet .sheet-title,
#inf-agg .sheet-title, #inf-agg .btn-start-workout, #inf-agg .btn-archive,
#arch-sheet .sheet-title, #arch-sheet .btn-start-workout, #arch-sheet .btn-archive,
#onb .sheet-title, #onb .btn-start-workout, #onb .btn-archive, #onb .aw-sec, #onb .res-title { text-transform: none; }
