/* ============================================================
   ELITE PERFORMANCE COACH v15 — DESIGN SYSTEM
   Palette brand: verde profondo + oro. Nessun font esterno:
   l'app deve restare identica anche completamente offline.
   ============================================================ */

:root {
  /* superfici */
  --bg: #04100a;
  --bg-2: #071a10;
  --s1: #0a2216;
  --s2: #0e2c1d;
  --s3: #133824;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);

  /* brand */
  --g-light: #52d68a;
  --g-mid: #2d8a5c;
  --g-dark: #16523a;
  --g-deep: #103322;
  --gold: #d9a94c;
  --gold-lt: #f0c976;
  --gold-dp: #6d5320;

  /* testo */
  --tx: #edf6ef;
  --tx-2: #8fb79e;
  --tx-3: #4d7460;

  /* semantici */
  --red: #e05a52;
  --yellow: #e8b640;
  --green: #52d68a;
  --blue: #5c9fe0;

  /* misure */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --pad: 20px;
  --nav-h: 66px;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(120% 60% at 50% 0%, rgba(45, 138, 92, .18), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(217, 169, 76, .07), transparent 70%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--g-light); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- TIPOGRAFIA ---------- */
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.h1 { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.h2 { font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.h3 { font-size: 16px; font-weight: 700; margin: 0; }
.body { font-size: 15px; color: var(--tx-2); margin: 0; }
.small { font-size: 13px; color: var(--tx-3); margin: 0; }
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.gold { color: var(--gold); }
.grad {
  background: linear-gradient(96deg, var(--g-light), var(--gold-lt));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- LAYOUT ---------- */
.app { max-width: 560px; margin: 0 auto; }
.screen { display: none; padding: calc(var(--top) + 18px) var(--pad) calc(var(--nav-h) + var(--bot) + 30px); }
.screen.on { display: block; animation: fade .28s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.row { display: flex; align-items: center; gap: 12px; }
.row-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.sp8 { height: 8px; } .sp16 { height: 16px; } .sp24 { height: 24px; } .sp32 { height: 32px; }

/* ---------- MARCHIO ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--g-dark), var(--g-deep));
  border: 1px solid rgba(217, 169, 76, .45);
  font-weight: 900; font-size: 18px; color: var(--gold-lt);
}
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.brand-sub { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--tx-3); }

/* ---------- CARD ---------- */
.card {
  background: linear-gradient(170deg, var(--s1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 18px;
}
.card-tight { padding: 14px; }
.card-gold { border-color: rgba(217, 169, 76, .34); background: linear-gradient(170deg, #1b1607, #0b1a10); }

/* ---------- BOTTONI ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 0 20px;
  border-radius: 14px; font-weight: 800; font-size: 16px;
  transition: transform .14s var(--ease), filter .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(100deg, var(--g-mid), var(--g-light)); color: #04180d; }
.btn-gold { background: linear-gradient(100deg, var(--gold-dp), var(--gold)); color: #1a1204; }
.btn-ghost { background: var(--s2); border: 1px solid var(--line-2); color: var(--tx); }
.btn-quiet { background: transparent; border: 1px solid var(--line); color: var(--tx-2); min-height: 46px; font-size: 14px; }
.btn-danger { background: transparent; border: 1px solid rgba(224, 90, 82, .4); color: var(--red); min-height: 46px; font-size: 14px; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 0 14px; width: auto; border-radius: 11px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--tx-3); font-size: 14px; font-weight: 600;
  padding: 8px 12px 8px 0; margin-bottom: 6px;
}

/* ---------- FORM ---------- */
.label { display: block; font-size: 13px; font-weight: 700; color: var(--tx-2); margin: 0 0 8px; }
.field {
  width: 100%; min-height: 52px; padding: 0 15px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: 13px; color: var(--tx); font-size: 16px;
}
textarea.field { min-height: 96px; padding: 14px 15px; line-height: 1.5; resize: vertical; }
.field:focus { border-color: var(--g-mid); outline: none; }
select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb79e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
  padding-right: 42px;
}

/* chip a griglia */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 14px; border-radius: 11px;
  background: var(--s1); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--tx-2);
  transition: all .16s var(--ease);
}
.chip[aria-pressed="true"], .chip.on {
  background: linear-gradient(120deg, var(--g-deep), var(--g-dark));
  border-color: var(--g-light); color: var(--tx);
}
.chip:active { transform: scale(.96); }

/* ---------- BADGE / PILL ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--s2); border: 1px solid var(--line-2); color: var(--tx-2);
}
.pill-green { background: rgba(82, 214, 138, .12); border-color: rgba(82, 214, 138, .4); color: var(--g-light); }
.pill-gold { background: rgba(217, 169, 76, .13); border-color: rgba(217, 169, 76, .42); color: var(--gold-lt); }
.pill-red { background: rgba(224, 90, 82, .13); border-color: rgba(224, 90, 82, .4); color: var(--red); }
.pill-yellow { background: rgba(232, 182, 64, .13); border-color: rgba(232, 182, 64, .4); color: var(--yellow); }

/* ---------- STATISTICHE ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 12px; text-align: center; }
.stat-v { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat-l { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); margin-top: 7px; }

/* ---------- GRAFICO SETTIMANE ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 92px; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-bar {
  border-radius: 5px 5px 2px 2px; min-height: 4px;
  background: linear-gradient(180deg, var(--g-light), var(--g-dark));
  transition: height .5s var(--ease);
}
.chart-bar.empty { background: var(--s2); }
.chart-lb { font-size: 9px; text-align: center; color: var(--tx-3); }

/* ============================================================
   SIGNATURE — SEMAFORO CARICO (banda match-day)
   ============================================================ */
.md-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-m); padding: 16px 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(100deg, var(--s2), var(--bg-2));
}
.md-band::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--md-color, var(--g-light));
}
.md-tag {
  font-size: 26px; font-weight: 900; letter-spacing: -.03em; line-height: 1;
  color: var(--md-color, var(--g-light));
}
.md-meter { display: flex; gap: 4px; margin-top: 12px; }
.md-seg { height: 5px; flex: 1; border-radius: 3px; background: var(--s3); }
.md-seg.fill { background: var(--md-color, var(--g-light)); }
.md-txt { font-size: 13px; color: var(--tx-2); margin-top: 10px; }

/* ---------- BLOCCHI SEDUTA ---------- */
.block { margin-top: 22px; }
.block-hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.block-id {
  font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.04em;
  color: var(--gold); opacity: .85; min-width: 30px;
}
.block-min { margin-left: auto; font-size: 12px; color: var(--tx-3); font-weight: 700; }

.exercise {
  background: var(--s1); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px; margin-bottom: 10px;
  transition: border-color .2s, opacity .2s;
}
.exercise.done { opacity: .5; border-color: var(--g-mid); }
.exercise-top { display: flex; align-items: flex-start; gap: 12px; }
.exercise-name { font-size: 15.5px; font-weight: 700; flex: 1; }
.exercise-cue { font-size: 13px; color: var(--tx-2); margin-top: 8px; line-height: 1.45; }
.prescr { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.prescr span {
  font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px;
  background: var(--s3); color: var(--tx-2);
}
.prescr span b { color: var(--tx); font-weight: 800; }

.check {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px;
  border: 2px solid var(--line-2); display: grid; place-items: center;
  color: transparent; font-size: 15px; font-weight: 900; transition: all .18s var(--ease);
}
.exercise.done .check { background: var(--g-mid); border-color: var(--g-mid); color: #04180d; }

/* ---------- AVVISI ---------- */
.warn {
  display: flex; gap: 11px; align-items: flex-start;
  border-radius: 13px; padding: 13px 14px; font-size: 13.5px; line-height: 1.45;
  background: rgba(232, 182, 64, .09); border: 1px solid rgba(232, 182, 64, .3); color: #f3dfae;
}
.warn-red { background: rgba(224, 90, 82, .09); border-color: rgba(224, 90, 82, .32); color: #f6cfcc; }
.warn-ico { font-size: 15px; line-height: 1.3; }

/* ---------- NAVIGAZIONE ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; justify-content: space-around;
  padding: 8px 6px calc(6px + var(--bot));
  background: rgba(5, 18, 11, .92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav.on { display: flex; }
.nav-inner { display: flex; justify-content: space-around; width: 100%; max-width: 560px; margin: 0 auto; }
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; color: var(--tx-3); font-size: 10px; font-weight: 700;
  letter-spacing: .04em; transition: color .2s;
}
.nav-btn svg { width: 22px; height: 22px; stroke-width: 1.9; }
.nav-btn.on { color: var(--g-light); }

/* ---------- TOAST / MODAL ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--bot) + 18px);
  transform: translate(-50%, 22px); z-index: 200;
  background: var(--s3); border: 1px solid var(--line-2);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .28s var(--ease);
  box-shadow: var(--shadow); max-width: 88vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(2, 8, 5, .78); backdrop-filter: blur(6px);
}
.modal.on { display: flex; }
.modal-box {
  width: 100%; max-width: 560px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 22px var(--pad) calc(22px + var(--bot));
  max-height: 88dvh; overflow-y: auto;
  animation: rise .3s var(--ease);
}
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- BANNER OFFLINE / UPDATE ---------- */
.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  display: none; align-items: center; justify-content: center; gap: 10px;
  padding: calc(var(--top) + 9px) 16px 9px;
  font-size: 13px; font-weight: 700; text-align: center;
}
.banner.on { display: flex; }
#offlineBanner { background: #5a2320; color: #ffd9d5; }
#updateBanner { background: var(--g-dark); color: var(--tx); }

/* ---------- SPLASH ---------- */
.splash {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; background: var(--bg);
  transition: opacity .45s var(--ease);
}
.splash.gone { opacity: 0; pointer-events: none; }
.splash-mark {
  width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--g-dark), var(--g-deep));
  border: 1.5px solid rgba(217, 169, 76, .5);
  font-size: 34px; font-weight: 900; color: var(--gold-lt);
  animation: pulse 1.9s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.94); opacity: .72; } }

/* ---------- LISTE ---------- */
.list-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: 13px; padding: 14px 15px; width: 100%; text-align: left;
}
.list-item + .list-item { margin-top: 9px; }
.list-item .arrow { margin-left: auto; color: var(--tx-3); }
.date-box {
  flex: 0 0 46px; text-align: center; border-radius: 10px;
  background: var(--s3); padding: 6px 0;
}
.date-d { font-size: 17px; font-weight: 800; line-height: 1; }
.date-m { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); margin-top: 3px; }

/* ---------- INDICI TEST ---------- */
.index-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.index-row:last-child { border-bottom: 0; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.dot.green { background: var(--green); box-shadow: 0 0 12px rgba(82, 214, 138, .5); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 12px rgba(232, 182, 64, .45); }
.dot.red { background: var(--red); box-shadow: 0 0 12px rgba(224, 90, 82, .45); }
.index-name { font-size: 14px; font-weight: 600; flex: 1; }
.index-val { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- SEGMENTED ---------- */
.seg { display: flex; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--tx-3); }
.seg button.on { background: var(--s3); color: var(--tx); }

/* ---------- UTILITY ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.empty { text-align: center; padding: 44px 20px; color: var(--tx-3); font-size: 14.5px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (min-width: 620px) {
  .screen { padding-left: 28px; padding-right: 28px; }
}

/* ============================================================
   v16 — CRONOMETRO, SERIE, CARICHI, PIANO
   ============================================================ */

/* ---------- cronometro di recupero ---------- */
.timer-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--bot));
  z-index: 70; display: none; overflow: hidden;
  background: var(--s3); border-top: 1px solid var(--line-2);
}
.timer-bar.on { display: block; }
.timer-fill {
  position: absolute; inset: 0 auto 0 0; width: 100%;
  background: linear-gradient(90deg, var(--g-deep), var(--g-mid));
  transition: width 1s linear;
}
.timer-inner {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; max-width: 560px; margin: 0 auto;
}
.timer-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-2); }
.timer-count { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.timer-skip {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tx-2);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 12px;
}
.timer-bar.ending .timer-count { color: var(--gold-lt); }

/* ---------- serie e carico ---------- */
.set-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.set-pill {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--s3); border: 1px solid var(--line);
  font-size: 14px; font-weight: 800; color: var(--tx-3);
  transition: all .16s var(--ease);
}
.set-pill.on { background: var(--g-mid); border-color: var(--g-light); color: #04180d; }
.set-pill:active { transform: scale(.92); }

.kg-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.kg-input {
  width: 74px; height: 38px; text-align: center; border-radius: 11px;
  background: var(--s1); border: 1px solid var(--line); color: var(--tx);
  font-size: 16px; font-weight: 700;
}
.kg-input::placeholder { color: var(--tx-3); font-weight: 500; }
.kg-unit { font-size: 12px; font-weight: 700; color: var(--tx-3); }
.load-hint { font-size: 11.5px; color: var(--tx-3); margin-top: 7px; }
.load-hint b { color: var(--gold); font-weight: 800; }

/* ---------- piano ---------- */
.plan-week {
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: linear-gradient(170deg, var(--s1), var(--bg-2));
  padding: 15px; margin-bottom: 11px;
}
.plan-week.deload { border-color: rgba(217, 169, 76, .34); }
.plan-week.past { opacity: .5; }
.plan-week-hd { display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px; }
.plan-week-n {
  font-size: 24px; font-weight: 900; line-height: 1; letter-spacing: -.04em;
  color: var(--gold); opacity: .85;
}
.plan-day {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 11px; background: var(--s2);
  border: 1px solid transparent;
}
.plan-day + .plan-day { margin-top: 7px; }
.plan-day.today { border-color: var(--g-light); }
.plan-day.done { opacity: .5; }
.plan-day-date { font-size: 12px; font-weight: 800; color: var(--tx-3); min-width: 42px; }
.plan-day-goal { font-size: 14px; font-weight: 700; }
.plan-day .arrow { margin-left: auto; color: var(--tx-3); }

.countdown {
  display: flex; align-items: baseline; gap: 10px;
  padding: 16px 18px; border-radius: var(--r-m);
  background: linear-gradient(100deg, var(--s2), var(--bg-2));
  border: 1px solid rgba(217, 169, 76, .3);
}
.countdown-n { font-size: 38px; font-weight: 900; line-height: 1; letter-spacing: -.04em; color: var(--gold-lt); }

/* ---------- andamento test ---------- */
.trend { display: flex; align-items: flex-end; gap: 5px; height: 54px; margin-top: 8px; }
.trend-bar { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--g-light), var(--g-dark)); min-height: 4px; }
.trend-row + .trend-row { margin-top: 16px; }

/* ============================================================
   v17 — LINGUAGGIO SEMPLICE
   ============================================================ */
.exercise-tech { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.exercise-tempo { font-size: 13px; color: var(--gold-lt); margin: 9px 0 0; font-weight: 600; }

.how-btn {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  border: 1.5px solid var(--line-2); color: var(--tx-2);
  font-size: 14px; font-weight: 800; display: grid; place-items: center;
  margin-right: 2px;
}
.how-btn:active { transform: scale(.9); }

.eff-pill { font-weight: 800 !important; }
.eff-easy { color: var(--tx-2) !important; }
.eff-med { color: var(--g-light) !important; background: rgba(82,214,138,.1) !important; }
.eff-hard { color: var(--gold-lt) !important; background: rgba(217,169,76,.12) !important; }
.eff-max { color: var(--red) !important; background: rgba(224,90,82,.12) !important; }

.how-steps { margin: 10px 0 0; padding: 0 0 0 4px; list-style: none; counter-reset: step; }
.how-steps li {
  counter-increment: step; position: relative;
  padding: 0 0 0 40px; margin-bottom: 13px;
  font-size: 14.5px; line-height: 1.5; color: var(--tx);
}
.how-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 27px; height: 27px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--g-deep); border: 1px solid var(--g-mid);
  color: var(--g-light); font-size: 13px; font-weight: 800;
}
.how-err {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(224, 90, 82, .08); border: 1px solid rgba(224, 90, 82, .28);
  border-radius: 13px; padding: 13px 14px; margin-top: 14px;
}
.how-err-x {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(224, 90, 82, .16); color: var(--red);
  font-size: 13px; font-weight: 900;
}

/* ============================================================
   v16.1 — LINGUAGGIO SEMPLICE
   ============================================================ */
.exercise-tech { font-size: 11.5px; color: var(--tx-3); margin-top: 3px; font-weight: 500; }
.exercise-plain { font-size: 13px; color: var(--tx-2); margin: 9px 0 0; line-height: 1.45; }

.ex-info {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  border: 1.5px solid var(--line-2); color: var(--tx-2);
  font-size: 14px; font-weight: 800; display: grid; place-items: center;
  margin-right: 2px;
}
.ex-info:active { transform: scale(.9); }

.ef {
  font-weight: 800 !important;
}
.ef-l { color: var(--blue) !important; background: rgba(92, 159, 224, .13) !important; }
.ef-m { color: var(--green) !important; background: rgba(82, 214, 138, .13) !important; }
.ef-h { color: var(--yellow) !important; background: rgba(232, 182, 64, .14) !important; }
.ef-x { color: var(--red) !important; background: rgba(224, 90, 82, .14) !important; }

.steps { margin: 10px 0 0; padding: 0 0 0 6px; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 0 38px; margin-bottom: 12px;
  font-size: 14.5px; line-height: 1.45; color: var(--tx);
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--g-deep); border: 1px solid var(--g-mid);
  color: var(--g-light); font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}

/* ============================================================
   v18 — MODALITA' E FLUIDITA' MOBILE
   ============================================================ */
.mode-grid { display: grid; gap: 9px; }
.mode-card {
  display: grid; gap: 3px; text-align: left;
  padding: 14px 16px; border-radius: 14px;
  background: var(--s1); border: 1px solid var(--line);
  transition: transform .14s var(--ease), border-color .2s, background .2s;
}
.mode-card .mode-t { font-size: 16px; font-weight: 800; }
.mode-card .mode-d { font-size: 12.5px; color: var(--tx-3); line-height: 1.35; }
.mode-card.on {
  background: linear-gradient(120deg, var(--g-deep), var(--s2));
  border-color: var(--g-light);
}
.mode-card.on .mode-d { color: var(--tx-2); }
.mode-card:active { transform: scale(.985); }

/* ---------- fluidità su mobile ---------- */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-overflow-scrolling: touch; touch-action: manipulation; }
.screen { content-visibility: auto; contain-intrinsic-size: 1px 1200px; }
.field, .btn, .chip, .set-pill, .mode-card, .nav-btn, .list-item, .how-btn, .plan-day {
  -webkit-user-select: none; user-select: none;
}
.field, input, textarea, select { -webkit-user-select: text; user-select: text; }
/* area di tocco minima 44px anche su elementi visivamente piccoli */
.how-btn, .check, .set-pill { position: relative; }
.how-btn::after, .check::after {
  content: ""; position: absolute; inset: -10px;
}
/* niente zoom automatico su iOS: i campi restano a 16px */
input, select, textarea { font-size: 16px; }
/* scroll più stabile quando una modale è aperta */
body.modal-open { overflow: hidden; }

/* nessun campo sotto i 16px: sotto quella soglia iOS zooma da solo */
input, select, textarea, .kg-input { font-size: 16px !important; }

/* ============================================================
   v19 — COACH E TRAGUARDI
   ============================================================ */
.screen-chat.on {
  display: flex; flex-direction: column;
  height: 100dvh;
  padding: calc(var(--top) + 12px) var(--pad) 0;
}
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.chat-head .brand-mark { width: 34px; height: 34px; flex: 0 0 34px; font-size: 15px; }
.chat-head .btn { margin-left: auto; width: auto; }

.chat-log {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 0;
}
.chat-intro { text-align: center; padding: 34px 10px; }
.chat-lock { text-align: center; padding: 40px 14px; }
.chat-lock .brand-mark { margin: 0 auto; width: 54px; height: 54px; font-size: 24px; }

.msg {
  max-width: 85%; padding: 12px 15px; border-radius: 17px;
  font-size: 15px; line-height: 1.5; word-wrap: break-word;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-me {
  align-self: flex-end; background: linear-gradient(120deg, var(--g-dark), var(--g-mid));
  color: var(--tx); border-bottom-right-radius: 5px;
}
.msg-coach {
  align-self: flex-start; background: var(--s1);
  border: 1px solid var(--line); border-bottom-left-radius: 5px;
}
.msg.typing { display: flex; gap: 5px; align-items: center; padding: 16px 17px; }
.msg.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tx-3);
  animation: blink 1.3s infinite;
}
.msg.typing span:nth-child(2) { animation-delay: .18s; }
.msg.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.prog-card {
  align-self: flex-start; max-width: 92%;
  background: linear-gradient(170deg, #1b1607, #0b1a10);
  border: 1px solid rgba(217, 169, 76, .34);
  border-radius: 15px; padding: 15px;
}
.prog-card .btn { min-height: 46px; font-size: 15px; }

.chat-quick { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick .chip { white-space: nowrap; flex: 0 0 auto; }

.chat-bar {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 10px 0 calc(12px + var(--nav-h) + var(--bot));
  background: var(--bg);
}
.chat-input {
  flex: 1; min-height: 48px; max-height: 130px; resize: none;
  padding: 13px 15px; border-radius: 15px;
  background: var(--s1); border: 1px solid var(--line); color: var(--tx);
  line-height: 1.4;
}
.chat-input:focus { border-color: var(--g-mid); outline: none; }
.chat-send {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 15px;
  background: linear-gradient(100deg, var(--g-mid), var(--g-light));
  color: #04180d; font-size: 21px; font-weight: 900;
  display: grid; place-items: center;
}
.chat-send:active { transform: scale(.93); }
.chat-send:disabled { opacity: .4; }
.list-coach .date-box { background: linear-gradient(140deg, var(--g-dark), var(--g-deep)); color: var(--gold-lt); }

/* ---------- traguardi ---------- */
.badges { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.badges::-webkit-scrollbar { display: none; }
.badge {
  flex: 0 0 auto; display: grid; justify-items: center; gap: 6px;
  min-width: 92px; padding: 13px 10px; border-radius: 14px;
  background: var(--s1); border: 1px solid var(--line); opacity: .45;
}
.badge.on {
  opacity: 1; border-color: rgba(217, 169, 76, .4);
  background: linear-gradient(170deg, #1b1607, var(--bg-2));
}
.badge-ico { font-size: 20px; color: var(--tx-3); }
.badge.on .badge-ico { color: var(--gold); }
.badge-n { font-size: 10.5px; text-align: center; line-height: 1.25; color: var(--tx-2); }

/* ============================================================
   v20 — CLASSIFICHE
   ============================================================ */
.rank-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 13px;
  background: var(--s1); border: 1px solid var(--line);
}
.rank-row + .rank-row { margin-top: 7px; }
.rank-row.top { border-color: rgba(217, 169, 76, .3); }
.rank-row.me {
  background: linear-gradient(120deg, var(--g-deep), var(--s2));
  border-color: var(--g-light);
}
.rank-n {
  flex: 0 0 30px; text-align: center;
  font-size: 16px; font-weight: 800; color: var(--tx-3);
}
.rank-row.top .rank-n { color: var(--gold); font-size: 19px; }
.rank-name { flex: 1; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-p { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.rank-row.me .rank-p { color: var(--g-light); }

/* ============================================================
   CONCORSI
   ============================================================ */
.cx-data { margin-top: 10px; }
.cx-actions { display: grid; gap: 9px; }
.cx-actions-3 { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.cx-actions-3 .btn { width: 100%; padding: 0 6px; font-size: 13px; }

.cx-forces { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.cx-force {
  display: grid; gap: 3px; text-align: left; min-height: 64px;
  padding: 13px 14px; border-radius: 14px;
  background: var(--s1); border: 1px solid var(--line);
  transition: transform .14s var(--ease), border-color .2s, background .2s;
}
.cx-force:active { transform: scale(.98); }
.cx-force.on { background: linear-gradient(120deg, var(--g-deep), var(--s2)); border-color: var(--g-light); }
.cx-force.soon { opacity: .55; }
.cx-force-n { font-size: 15px; font-weight: 800; }
.cx-force-s { font-size: 12px; color: var(--tx-3); }

.cx-facts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cx-fact { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-s); padding: 11px 13px; }
.cx-fact .stat-l { margin-top: 0; }
.cx-fact-v { font-size: 14px; font-weight: 700; margin-top: 4px; }

.cx-dl { background: var(--s1); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.cx-dl + .cx-dl { margin-top: 8px; }
.cx-dl b { font-size: 14px; }

.cx-ol, .cx-ul, .cx-check { margin: 0; padding-left: 20px; color: var(--tx-2); font-size: 14px; }
.cx-ol li, .cx-ul li, .cx-check li { margin: 5px 0; }
.cx-check { list-style: none; padding-left: 0; }
.cx-check li { position: relative; padding-left: 26px; }
.cx-check li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--g-light); font-weight: 900;
}

.cx-tl { border-left: 2px solid var(--line-2); padding-left: 14px; display: grid; gap: 12px; }
.cx-tl-i { position: relative; }
.cx-tl-i::before {
  content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--gold);
}

.cx-prova { background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 10px; }
.cx-prova .h3 { font-size: 15px; }
.cx-thr { display: flex; gap: 10px; align-items: flex-start; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.cx-thr-l {
  flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); padding-top: 2px; min-width: 62px;
}
.cx-thr .small { color: var(--tx-2); }
.cx-thr b { color: var(--tx); font-weight: 700; }

.cx-det { margin-top: 10px; }
.cx-det summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--g-light);
  list-style: none; padding: 6px 0; min-height: 32px;
}
.cx-det summary::-webkit-details-marker { display: none; }
.cx-det summary::before { content: "+ "; }
.cx-det[open] summary::before { content: "− "; }
.cx-det .how-err { margin-top: 8px; }
.cx-det .warn { margin-top: 8px; }

.cx-grid2 { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13.5px; color: var(--tx-2); margin-top: 8px; }
.cx-grid2 b { color: var(--tx); text-align: right; }

.cx-in .label { font-size: 13.5px; }
.cx-in .row-b { margin-bottom: 8px; align-items: baseline; }
.cx-time { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; color: var(--tx-3); font-weight: 800; }

.cx-ev .h3 { font-size: 16px; }
.cx-total { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 4px; }
.cx-total-v { font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1; color: var(--gold-lt); }
.cx-rows { margin-top: 10px; }
.cx-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.cx-row .dot { align-self: flex-start; margin-top: 5px; }
.cx-row-main { flex: 1; min-width: 0; }
.cx-row-n { font-size: 14px; font-weight: 700; }
.cx-row-v { font-size: 14px; font-weight: 800; white-space: nowrap; }
.cx-row-p { font-size: 12.5px; color: var(--tx-3); min-width: 52px; text-align: right; white-space: nowrap; }
.cx-also { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); }
.dot:not(.green):not(.yellow):not(.red) { background: var(--s3); border: 1px solid var(--line-2); }

.plan-day.cx-special { border-color: rgba(217, 169, 76, .45); }
.plan-day.cx-special .plan-day-goal { color: var(--gold-lt); }

.cx-simnav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cx-simnav::-webkit-scrollbar { display: none; }
.cx-simnav .chip { white-space: nowrap; flex: 0 0 auto; }
.cx-chip-done { border-color: var(--g-mid); }
.cx-simcard .h2 { font-size: 19px; }
.cx-clock {
  font-size: 64px; font-weight: 900; letter-spacing: -.04em; line-height: 1;
  text-align: center; margin: 22px 0 18px; color: var(--tx);
}
.cx-tap {
  width: 100%; min-height: 150px; border-radius: 20px;
  display: grid; place-items: center; align-content: center; gap: 4px;
  background: linear-gradient(150deg, var(--g-dark), var(--g-deep));
  border: 1.5px solid var(--g-light); color: var(--tx);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.cx-tap:active { transform: scale(.985); filter: brightness(1.15); }
.cx-tap-n { font-size: 58px; font-weight: 900; line-height: 1; }
.cx-tap-l { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-2); }
.cx-ctrl { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.cx-ctrl .btn { padding: 0 8px; }
.cx-laps { display: grid; gap: 6px; margin-top: 4px; }
.cx-lap { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }

.cx-home .countdown-n { font-size: 34px; }
.cx-home-n { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 4px; }

@media (min-width: 420px) {
  .cx-facts { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- MARCHIO ASTICELLA ---------- */
.brand-mark .mark { width: 26px; height: 26px; display: block; }
.splash-mark .mark { width: 48px; height: 48px; display: block; }
.chat-lock .brand-mark { width: 56px; height: 56px; flex-basis: 56px; border-radius: 16px; }
.chat-lock .brand-mark .mark { width: 36px; height: 36px; }
.splash-name { font-size: 30px; font-weight: 900; letter-spacing: -.03em; margin-top: 18px; color: var(--tx); }
.splash-mark { margin: 0 auto; }

/* consenso all'accesso immediato (pagamento) */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: 0 0 22px; margin: 1px 0 0; accent-color: var(--gold, #F4A261); }
.consent.consent-need { border-color: var(--gold, #F4A261); box-shadow: 0 0 0 2px rgba(244,162,97,.25); }

.card-adapt { border-color: rgba(46, 230, 197, .34); }

.ex-anim { border-radius: 16px; overflow: hidden; background: #0b1210; aspect-ratio: 1 / 1; }
.ex-anim video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* versione gratuita: piano visibile, settimane oltre i 7 giorni bloccate */
.plan-week.locked { filter: blur(3px); opacity: .45; pointer-events: none; user-select: none; }
.cx-unlock .h3 { font-size: 19px; }
.cx-free { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(217, 169, 76, .22); }
.cx-free .btn { margin-top: 8px; }
.cx-pw-n { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 4px; }
a.btn { text-decoration: none; }
.chart-col { min-width: 0; }
