:root {
  --accento: #C8102E;
  --accento-scuro: #9E0B23;
  --accento-testo: #ffffff;
  --accento-tinta: rgba(200, 16, 46, 0.09);
  --sfondo: #F5F4F1;
  --carta: #ffffff;
  --carta-2: #ECEAE5;
  --testo: #141414;
  --testo-2: #5F5F66;
  --bordo: #DCDAD4;
  --nero: #151517;
  --nero-testo: #ffffff;
  --avviso-sfondo: #FFF1C9;
  --avviso-testo: #5A3D00;
  --ok: #167A3C;
  --ok-tinta: rgba(22, 122, 60, 0.12);
  --giu: #B3261E;
  --ombra: 0 1px 2px rgba(0,0,0,0.06), 0 6px 20px rgba(0,0,0,0.06);
  --ombra-forte: 0 10px 30px rgba(200, 16, 46, 0.28);
  --raggio: 20px;
  --raggio-s: 14px;
  --tocco: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accento: #E8233F;
    --accento-scuro: #C8102E;
    --accento-tinta: rgba(232, 35, 63, 0.16);
    --sfondo: #0B0B0D;
    --carta: #18181B;
    --carta-2: #232327;
    --testo: #F7F7F8;
    --testo-2: #A3A3AB;
    --bordo: #2E2E34;
    --nero: #1F1F23;
    --avviso-sfondo: #3B2D06;
    --avviso-testo: #FFD979;
    --ok: #4CD37A;
    --ok-tinta: rgba(76, 211, 122, 0.14);
    --giu: #FF6B61;
    --ombra: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.45);
    --ombra-forte: 0 10px 30px rgba(232, 35, 63, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--sfondo);
  color: var(--testo);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }

.vista {
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}
.vista.piena { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

h1 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 8px;
}
h2 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 800;
  margin: 28px 0 12px;
}
h3 { font-size: 18px; font-weight: 700; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--accento); }
.sotto { color: var(--testo-2); }
.piccolo { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
.centrato { text-align: center; }
.caricamento { padding: 60px 0; text-align: center; color: var(--testo-2); }

.sopratitolo {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  color: var(--testo-2);
  margin: 0 0 6px;
}

.carta {
  background: var(--carta);
  border-radius: var(--raggio);
  padding: 18px;
  margin: 0 0 14px;
  box-shadow: var(--ombra);
}
.carta-accento { border-left: 6px solid var(--accento); }
.carta-piatta { box-shadow: none; background: var(--carta-2); }

.avviso {
  background: var(--avviso-sfondo);
  color: var(--avviso-testo);
  border-radius: var(--raggio-s);
  padding: 12px 14px;
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.avviso::before { content: "!"; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--avviso-testo); color: var(--avviso-sfondo); font-weight: 900; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }

.etichetta {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accento);
  color: var(--accento-testo);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.etichetta-grigia { background: var(--carta-2); color: var(--testo); }
.etichetta-chiara { background: rgba(255,255,255,0.14); color: #fff; }

/* Carta eroe della schermata Oggi */
.eroe {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #1C1C20 0%, #0E0E10 70%);
  color: #fff;
  border-radius: 26px;
  padding: 22px 20px 20px;
  margin: 10px 0 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}
.eroe::after {
  content: "";
  position: absolute;
  right: -70px; top: -70px;
  width: 230px; height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,16,46,0.75) 0%, rgba(200,16,46,0) 70%);
  pointer-events: none;
}
.eroe-riga { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: relative; z-index: 1; }
.eroe .sopratitolo { color: rgba(255,255,255,0.6); }
.eroe-settimana {
  font-size: 64px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.eroe-settimana small { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.6); letter-spacing: 0; margin-left: 4px; }
.eroe-fase { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.eroe-divisore { height: 1px; background: rgba(255,255,255,0.12); margin: 18px 0 14px; }
.eroe-prossimo { position: relative; z-index: 1; }
.eroe-prossimo .nome { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 2px 0 4px; }
.eroe-prossimo .codice { font-size: 14px; font-weight: 800; letter-spacing: 0.1em; color: var(--accento); text-transform: uppercase; }
.eroe-prossimo .dett { color: rgba(255,255,255,0.68); font-size: 15px; margin: 0; }

.tessere { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
.tessera {
  background: var(--carta);
  border-radius: var(--raggio-s);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--ombra);
}
.tessera .val { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tessera .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--testo-2); margin-top: 4px; }

/* Manubrio disegnato */
.manubrio-svg { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.manubrio-didascalia { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.manubrio-didascalia .peso { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }

/* Bottoni */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tocco);
  padding: 14px 18px;
  border: 2px solid var(--bordo);
  border-radius: var(--raggio-s);
  background: var(--carta);
  color: var(--testo);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin: 0 0 12px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease, filter 0.08s ease;
}
.btn:active { transform: scale(0.98); filter: brightness(0.92); }
.btn-primario {
  background: linear-gradient(180deg, var(--accento) 0%, var(--accento-scuro) 100%);
  border-color: transparent;
  color: var(--accento-testo);
  min-height: 76px;
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--ombra-forte);
}
.btn-primario .freccia-btn { font-size: 26px; line-height: 1; }
.btn-secondario { background: transparent; }
.btn-piccolo { min-height: 54px; font-size: 17px; font-weight: 700; }
.btn-attivo { border-color: var(--accento); color: var(--accento); background: var(--accento-tinta); }
.btn-riga { display: flex; gap: 10px; margin-bottom: 12px; }
.btn-riga .btn { margin: 0; flex: 1; }
.btn-testo {
  background: none;
  border: none;
  color: var(--accento);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 10px 4px;
  cursor: pointer;
}

/* Scelta allenamento */
.griglia-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.griglia-2 .btn { margin: 0; flex-direction: column; gap: 2px; padding: 12px; line-height: 1.2; }
.griglia-2 .btn .cod { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accento); }
.griglia-2 .btn .sotto { font-size: 15px; font-weight: 600; }

/* Barra in basso */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  background: color-mix(in srgb, var(--carta) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--bordo);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
}
.nav[hidden] { display: none; }
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--testo-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 54px;
}
.nav a svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a.attiva { color: var(--accento); }

/* Allenamento in corso */
.barra-alto {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.barra-alto .btn-testo { padding: 8px 0; }
.progresso {
  height: 6px;
  background: var(--carta-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progresso > div { height: 100%; background: var(--accento); border-radius: 3px; }

.figura-vuota {
  background: var(--carta);
  border-radius: var(--raggio);
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--testo-2);
  font-size: 15px;
  box-shadow: var(--ombra);
}

.es-intestazione { margin-bottom: 10px; }
.es-intestazione h1 { font-size: 28px; }
.es-dati { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.es-dati span {
  background: var(--carta);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--ombra);
  font-variant-numeric: tabular-nums;
}
.es-dati span b { color: var(--accento); }

details {
  margin-bottom: 12px;
  background: var(--carta);
  border-radius: var(--raggio-s);
  padding: 4px 16px;
  box-shadow: var(--ombra);
}
details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accento);
  padding: 10px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-size: 22px; font-weight: 400; }
details[open] summary::after { content: "−"; }
details p:last-child { padding-bottom: 8px; }

.serie-lista { margin: 10px 0 14px; }
.serie-riga {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--raggio-s);
  background: var(--carta-2);
  margin-bottom: 8px;
  color: var(--testo-2);
}
.serie-riga.fatta { background: var(--ok-tinta); color: var(--testo); }
.serie-riga .serie-num { font-weight: 700; min-width: 86px; }
.serie-riga.fatta .serie-num { color: var(--ok); }
.serie-riga .serie-val { font-size: 24px; font-weight: 800; }
.serie-riga .serie-scorsa { font-size: 15px; }

.serie-corrente {
  border-radius: var(--raggio);
  padding: 16px;
  margin: 12px 0;
  background: var(--carta);
  box-shadow: var(--ombra);
  border: 2px solid var(--accento);
}
.serie-corrente .serie-titolo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 800;
  font-size: 19px;
  margin-bottom: 8px;
}
.serie-corrente .scorsa-grande {
  font-size: 15px;
  color: var(--testo-2);
  font-weight: 700;
  background: var(--carta-2);
  padding: 4px 10px;
  border-radius: 999px;
}
.contatore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 16px;
}
.contatore button {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: none;
  background: var(--carta-2);
  color: var(--testo);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease, filter 0.08s ease;
}
.contatore button:active { transform: scale(0.94); filter: brightness(0.9); }
.contatore .valore {
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  text-align: center;
  flex: 1;
  color: var(--testo);
}
.contatore .unita { display: block; font-size: 13px; color: var(--testo-2); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 8px; }

.oltranza {
  background: var(--nero);
  color: var(--nero-testo);
  border-left: 6px solid var(--accento);
  border-radius: var(--raggio-s);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 16px;
}

/* Timer a tutto schermo */
.timer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--nero);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
}
.timer[hidden] { display: none; }
.timer-titolo { font-size: 15px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.timer-anello {
  position: relative;
  width: min(78vw, 340px);
  height: min(78vw, 340px);
  margin: 4px 0 10px;
}
.timer-anello svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-anello .traccia { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 12; }
.timer-anello .arco { fill: none; stroke: var(--accento); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.timer-cifre {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(24vw, 108px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.timer-cifre.fine { color: var(--accento); }
.timer-sotto { font-size: 18px; color: rgba(255,255,255,0.72); max-width: 420px; }
.timer-anteprima { width: 100%; max-width: 480px; margin: 8px 0 18px; }
.timer-anteprima .carta { background: rgba(255,255,255,0.08); box-shadow: none; color: #fff; }
.timer-anteprima .carta .sotto { color: rgba(255,255,255,0.65); }
.timer-bottoni { width: 100%; max-width: 480px; display: flex; gap: 12px; }
.timer-bottoni .btn { margin: 0; flex: 1; min-height: 76px; }
.timer-bottoni .btn-secondario { color: #fff; border-color: rgba(255,255,255,0.3); }

/* Riepilogo fine allenamento */
.riep {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bordo);
}
.riep:last-child { border-bottom: none; }
.riep .riep-nome { flex: 1; font-weight: 700; font-size: 16px; line-height: 1.25; }
.riep .riep-num { font-size: 19px; font-weight: 800; white-space: nowrap; }
.riep .freccia { font-size: 22px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.freccia-su { color: var(--ok); background: var(--ok-tinta); }
.freccia-giu { color: var(--giu); background: rgba(179, 38, 30, 0.12); }
.freccia-pari { color: var(--testo-2); background: var(--carta-2); }
.progressione {
  background: var(--ok-tinta);
  border-left: 6px solid var(--ok);
  border-radius: var(--raggio-s);
  padding: 12px 14px;
  margin: 0 0 12px;
}
.progressione strong { color: var(--ok); }

textarea.note {
  width: 100%;
  min-height: 90px;
  font: inherit;
  padding: 12px;
  border-radius: var(--raggio-s);
  border: 2px solid var(--bordo);
  background: var(--carta);
  color: var(--testo);
  margin-bottom: 12px;
}

ul.pulita, ol.pulita { padding-left: 22px; margin: 0 0 10px; }
ul.pulita li, ol.pulita li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Disegni degli esercizi */
.figura {
  background: var(--carta);
  border-radius: var(--raggio);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: var(--ombra);
}
.disegno-esercizio { width: 100%; height: auto; display: block; }
.disegno-esercizio .pannello { fill: var(--carta-2); }
.disegno-esercizio .pavimento { stroke: var(--bordo); stroke-width: 2; stroke-linecap: round; }
.disegno-esercizio .arto, .disegno-esercizio .torso {
  fill: none;
  stroke: var(--testo);
  stroke-width: 6.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.disegno-esercizio .arto-dietro { stroke: var(--testo-2); opacity: 0.55; }
.disegno-esercizio .testa { fill: var(--testo); }
.disegno-esercizio .manubrio rect { fill: var(--accento); }
.disegno-esercizio .oggetto { fill: var(--bordo); }
.disegno-esercizio .numero-sfondo { fill: var(--accento); }
.disegno-esercizio .numero { fill: #fff; font-size: 13px; font-weight: 800; font-family: inherit; }
.disegno-esercizio .didascalia { fill: var(--testo-2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-family: inherit; }

/* Mappa dei muscoli */
.mappa {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--carta);
  border-radius: var(--raggio);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--ombra);
}
.mappa-corpi { display: flex; gap: 4px; flex: none; }
.mappa-svg { width: 62px; height: auto; display: block; }
.mappa-svg .sagoma * { fill: var(--carta-2); stroke: var(--bordo); stroke-width: 1; stroke-linejoin: round; }
.mappa-svg .muscolo * { fill: transparent; }
.mappa-svg .muscolo.primario * { fill: var(--accento); }
.mappa-svg .muscolo.secondario * { fill: var(--accento); opacity: 0.38; }
.mappa-svg .mappa-titolo { fill: var(--testo-2); font-size: 13px; font-weight: 700; font-family: inherit; }
.mappa-legenda { list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mappa-legenda li { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.mappa-legenda li::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--accento); flex: none; }
.mappa-legenda li.secondario { color: var(--testo-2); font-weight: 500; }
.mappa-legenda li.secondario::before { opacity: 0.38; }
.mappa-grande .mappa-svg { width: 110px; }

/* Galleria di controllo */
.galleria .figura { margin-bottom: 6px; }

/* Foto degli esercizi */
.figura.foto { padding: 0; position: relative; overflow: hidden; }
.figura.foto img { display: block; width: 100%; height: auto; background: var(--carta-2); }
.figura.foto .pos {
  position: absolute;
  bottom: 10px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(21, 21, 23, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.figura.foto .pos b { width: 20px; height: 20px; border-radius: 50%; background: var(--accento); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.figura.foto .pos1 { left: 10px; }
.figura.foto .pos2 { left: calc(50% + 10px); }
.figura.foto.senza-foto .pos { display: none; }
.figura.foto.senza-foto .figura-riserva { padding: 10px; }

/* Grafici */
.grafico { width: 100%; height: auto; display: block; }
.grafico .griglia { stroke: var(--bordo); stroke-width: 1; }
.grafico .base { stroke: var(--testo-2); stroke-width: 1; }
.grafico .asse { fill: var(--testo-2); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.grafico .valore { fill: var(--testo); font-size: 12px; font-weight: 800; font-family: inherit; font-variant-numeric: tabular-nums; }
.grafico .barra { fill: var(--accento); opacity: 0.55; }
.grafico .barra.ultima { opacity: 1; }
.grafico .barra.record { opacity: 0.85; }
.grafico .colpo { fill: transparent; }
.grafico .punto.attivo .barra { opacity: 1; stroke: var(--testo); stroke-width: 1.5; }
.grafico .linea { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico .marcatore { fill: var(--accento); stroke: var(--carta); stroke-width: 2; }
.grafico .punto.attivo .marcatore { r: 6; stroke: var(--testo); }
.grafico .fascia { fill: var(--ok); opacity: 0.12; }
.grafico .fascia-testo { fill: var(--ok); font-weight: 700; }
.grafico-didascalia { margin: 8px 0 0; min-height: 1.3em; }
.selettore select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: var(--raggio-s);
  border: 2px solid var(--bordo);
  background: var(--carta);
  color: var(--testo);
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
}

/* Calendario settimane */
.legenda-cal { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 10px; font-size: 14px; color: var(--testo-2); }
.legenda-cal span { display: inline-flex; align-items: center; gap: 6px; }
.legenda-cal i { font-style: normal; width: 22px; height: 22px; font-size: 10px; }
.calendario { display: flex; flex-direction: column; gap: 6px; }
.settimana-riga {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--carta);
  box-shadow: var(--ombra);
  border: 2px solid transparent;
}
.settimana-riga.scarico { background: var(--carta-2); box-shadow: none; }
.settimana-riga.corrente { border-color: var(--accento); }
.settimana-riga.ciclo2 { border-top: 3px solid var(--nero); margin-top: 6px; }
.settimana-num { font-weight: 900; font-size: 18px; }
.settimana-fase { font-size: 13px; color: var(--testo-2); }
.settimana-celle { display: flex; gap: 5px; }
.cella {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 11px; font-weight: 800;
  border: 2px solid var(--bordo); color: var(--testo-2); background: transparent;
}
.cella.fatto { background: var(--accento); border-color: var(--accento); color: #fff; }
.cella.saltato { border-style: dashed; border-color: var(--giu); color: var(--giu); }
.cella.da-fare { border-color: var(--testo-2); color: var(--testo); }
.cella.prima { opacity: 0.4; }
.cella.futuro { opacity: 0.35; }

/* Misure */
.data-scelta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.data-scelta label { font-weight: 700; }
.data-scelta input {
  font: inherit; font-size: 17px; font-weight: 700;
  padding: 10px 12px; border-radius: 12px; border: 2px solid var(--bordo);
  background: var(--sfondo); color: var(--testo);
}
.step {
  display: grid;
  grid-template-columns: 84px 60px 1fr 60px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bordo);
}
.step:last-of-type { border-bottom: none; }
.step-nome { font-weight: 700; }
.step-btn {
  height: 56px; border-radius: 14px; border: none;
  background: var(--carta-2); color: var(--testo);
  font-size: 30px; font-weight: 600; line-height: 1;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.step-btn:active { filter: brightness(0.88); transform: scale(0.96); }
.step-val { text-align: center; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.step-val small { font-size: 13px; font-weight: 700; color: var(--testo-2); margin-left: 3px; }
.tabella-misure { padding: 10px 14px; }
.riga-misura {
  display: grid; grid-template-columns: 1.3fr 0.8fr 0.9fr 0.7fr 36px;
  align-items: center; gap: 6px; padding: 9px 0;
  border-bottom: 1px solid var(--bordo); font-size: 16px;
}
.riga-misura:last-child { border-bottom: none; }
.riga-misura.intestazione { color: var(--testo-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.riga-misura .elimina { padding: 6px; color: var(--testo-2); }
