/* Proposta A "Energica e sportiva" — solo tema chiaro (regola del proprietario).
   Token da design/proposta-A-energica/tokens.css. */
@import url('/css/fonts.css');

:root {
  color-scheme: light;
  --bg: #f1f2f4;
  --surface: #ffffff;
  --surface-2: #e8eaee;
  --line: #d9dce2;
  --ink: #0b0d12;
  --ink-2: #1c2029;
  --text: var(--ink);
  --muted: #4b5260;
  --on-ink: #ffffff;
  --on-ink-muted: #b9bfcb;
  --brand: #ff5a1f;
  --brand-text: #c2410c;
  --brand-soft: #ffe7dc;
  --brand-f1: #ffd2bf;
  --on-brand: var(--ink);
  --volt: #c6f432;
  --volt-soft: #f1fccb;
  --ok-text: #3f6212;
  --s-a: var(--brand); --on-s-a: var(--ink);
  --s-b: #2b59ff; --on-s-b: #ffffff; --s-b-soft: #dfe6ff; --s-b-text: #1d3fbf;
  --s-c: #7c3aed; --on-s-c: #ffffff;
  --warn: #b45309; --warn-soft: #fff1d6;
  --err: #c81e1e; --err-soft: #fde4e4;
  --info-soft: #e5ebff;
  --fig: var(--ink);
  --fig-far: #b4bac6;
  --fig-muscle: var(--brand);
  --fig-bg: #fff4ee;
  --prop: #4b5260;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-base: 1rem; --fs-lg: 1.125rem;
  --fs-xl: 1.5rem; --fs-2xl: 2rem; --fs-3xl: 2.75rem; --fs-num: 3.5rem;
  --tracking-caps: 0.06em;
  --gutter: 16px;
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(11 13 18 / .06), 0 1px 1px rgb(11 13 18 / .04);
  --shadow-2: 0 6px 18px -6px rgb(11 13 18 / .18);
  --shadow-cta: 0 8px 20px -6px rgb(255 90 31 / .55);
  --tap: 48px; --tap-lg: 56px; --nav-h: 68px;
  --t-fast: 140ms cubic-bezier(.2, .8, .2, 1);
  --t-pop: 260ms cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font-body); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
p { margin: 6px 0; }
a { color: var(--brand-text); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.big { font-size: var(--fs-lg); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.display { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: -.005em; }
.eyebrow { font: 700 var(--fs-xs)/1.2 var(--font-body); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); }
h2, .card-t { font: 800 var(--fs-xl)/1 var(--font-display); text-transform: uppercase; margin-bottom: 10px; }
h4 { font: 700 var(--fs-xs)/1 var(--font-body); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--muted); margin: 14px 0 8px; }

/* ---------- barra in alto e navigazione ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.brand { font: 800 italic 1.35rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.brand b { color: var(--brand); }
.sync { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--surface); }
.sync.ok { background: #65a30d; }
.sync.busy { background: var(--brand); animation: pulse 1s infinite; }
.sync.warn { background: #f59e0b; }
.sync.err { background: var(--err); }
@keyframes pulse { 50% { opacity: .3; } }

main { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); outline: none; }

nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 6px 6px env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font: 600 11px/1 var(--font-body); min-width: 0; min-height: var(--tap);
}
nav .ic { display: flex; padding: 3px 16px; border-radius: var(--r-pill); transition: background var(--t-fast); }
nav svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav a.on { color: var(--ink); }
nav a.on .ic { background: var(--brand); }

/* ---------- elementi base ---------- */
.card { background: var(--surface); border-radius: var(--r-md); padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow-1); }
.card.warn { background: var(--warn-soft); box-shadow: none; }
.card.info { background: var(--info-soft); box-shadow: none; }
.card.ok { background: var(--volt); box-shadow: none; }
.card.sospeso { opacity: .65; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.btn {
  appearance: none; border: 0; font: 700 var(--fs-base)/1 var(--font-body); min-height: var(--tap);
  padding: 0 18px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; color: var(--ink); background: var(--surface-2); transition: transform var(--t-fast);
}
.btn:active { transform: scale(.97); }
.btn.primary, .btn.cta {
  background: var(--brand); color: var(--on-brand); min-height: var(--tap-lg);
  font: 800 1.375rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  box-shadow: var(--shadow-cta); border-radius: 14px;
}
.btn.primary svg, .btn.cta svg { width: 22px; height: 22px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.ghost-ink { background: transparent; color: var(--on-ink); border: 1.5px solid rgb(255 255 255 / .28); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.btn.block { display: flex; width: 100%; margin: 10px 0; }
.btn:focus-visible, .chip:focus-visible, .xbtn:focus-visible, input:focus-visible, select:focus-visible,
.scale-btn:focus-visible, nav a:focus-visible, .tick:focus-visible {
  outline: 3px solid var(--s-b); outline-offset: 2px;
}

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px; min-height: var(--tap); width: 100%;
}
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.field > span { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.field.inline { flex: 1; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--r-sm); margin: 12px 0; padding: 8px 12px; }
legend { font-weight: 700; padding: 0 4px; }
.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; min-height: 40px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); }
.search { margin-bottom: 12px; }

.tag, .pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink); font: 700 var(--fs-sm)/1 var(--font-body); white-space: nowrap;
}
.pill.ink { background: var(--ink); color: var(--on-ink); }
.pill.accent, .pill.brand { background: var(--brand-soft); color: var(--brand-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tags { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }

.chip {
  appearance: none; white-space: nowrap; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
  font: 600 var(--fs-sm)/1 var(--font-body); display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.note { background: var(--warn-soft); border-radius: var(--r-sm); padding: 8px 10px; font-size: var(--fs-sm); margin: 8px 0; }
ol, ul { padding-left: 22px; margin: 4px 0; }

/* ---------- OGGI ---------- */
.hero { padding: 6px 2px 14px; }
.hero h1 { font: 800 var(--fs-2xl)/.95 var(--font-display); text-transform: uppercase; margin-top: 6px; }
.hero p { color: var(--muted); }
.phase-bar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 12px; align-items: center; }
.phase-bar i { height: 8px; border-radius: 2px; background: var(--surface-2); }
.phase-bar i.f1 { background: var(--brand-f1); }
.phase-bar i.on { background: var(--brand); }
.phase-bar i.now { background: var(--brand); height: 12px; }
.phase-legend { display: flex; justify-content: space-between; margin-top: 6px; font: 600 var(--fs-xs)/1 var(--font-body); color: var(--muted); }

.today-card {
  position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-lg); padding: 18px 16px 16px; margin-bottom: 12px;
}
.today-card.has-k::before {
  content: ""; position: absolute; right: -70px; top: -40px; width: 180px; height: 190px;
  background: var(--k-color, var(--brand)); transform: skewX(-18deg);
}
.today-card.has-k::after {
  content: attr(data-k); position: absolute; right: 18px; top: -4px;
  font: 800 italic 130px/1 var(--font-display); color: var(--ink); opacity: .92;
}
.today-card.k-B { --k-color: var(--s-b); }
.today-card.k-C { --k-color: var(--s-c); }
.today-card > * { position: relative; z-index: 1; }
.today-card .eyebrow { color: var(--brand); }
.today-card .t-big { font: 800 italic var(--fs-3xl)/.95 var(--font-display); text-transform: uppercase; margin: 8px 0 6px; max-width: 215px; }
.today-card .t-msg { font: 800 italic 1.9rem/1 var(--font-display); text-transform: uppercase; margin: 8px 0; }
.today-card .meta { color: var(--on-ink-muted); font-size: var(--fs-sm); margin: 0 0 14px; max-width: 190px; }
.today-card .avviso { color: #ffd2bf; font-size: var(--fs-sm); font-weight: 600; }
.chips-ink { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips-ink span { font: 600 var(--fs-xs)/1 var(--font-body); color: var(--on-ink); background: rgb(255 255 255 / .12); border-radius: var(--r-pill); padding: 7px 10px; }
.today-actions { display: grid; gap: 8px; }
.today-sub { display: flex; gap: 8px; }
.today-sub > * { flex: 1; }
.switch {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); justify-content: center; cursor: pointer;
  border-radius: var(--r-sm); border: 1.5px solid rgb(255 255 255 / .28); font: 600 var(--fs-sm)/1 var(--font-body);
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 36px; height: 22px; border-radius: 11px; background: rgb(255 255 255 / .25); position: relative; display: block; transition: background var(--t-fast); }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-fast); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 3px solid var(--s-b); outline-offset: 2px; }
.other-list { display: flex; gap: 8px; margin-top: 8px; }
.other-list[hidden] { display: none; }

.week { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; }
.ring { position: relative; width: 88px; height: 88px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .num b { font: 800 2rem/1 var(--font-display); }
.ring .num span { font: 600 10px/1.1 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 6px; }
.days div { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 11px/1 var(--font-body); color: var(--muted); }
.days i {
  width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 8px; background: var(--surface-2);
  display: grid; place-items: center; font: 800 13px/1 var(--font-display); font-style: normal; color: var(--muted);
}
.days i.done { background: var(--volt); color: var(--ink); }
.days i.bjj { background: transparent; border: 2px dashed var(--fig-far); font-size: 11px; }
.days i.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.days i.today:not(.done) { background: var(--brand); color: var(--ink); }
.days i.plan { background: var(--brand-soft); color: var(--brand-text); }
.streak { display: flex; align-items: center; gap: 10px; background: var(--volt-soft); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: var(--fs-sm); }
.streak svg { flex: none; width: 28px; height: 28px; }

.vbars { display: grid; gap: 10px; margin-top: 6px; }
.vbar { display: grid; grid-template-columns: 96px 1fr 28px; gap: 10px; align-items: center; font: 600 var(--fs-sm)/1 var(--font-body); text-transform: capitalize; }
.vbar .tr { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); }
.vbar .band { position: absolute; top: -3px; bottom: -3px; background: rgb(198 244 50 / .5); border-radius: 3px; }
.vbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--ink); }
.vbar.over .fill { background: var(--err); }
.vbar b { font: 800 1.1rem/1 var(--font-display); text-align: right; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font: 500 var(--fs-xs)/1.2 var(--font-body); color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.legend .l-band { background: rgb(198 244 50 / .6); }
.legend .l-fill { background: var(--ink); }

/* ---------- ALLENAMENTO ---------- */
.wk-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 8px; gap: 8px; }
.wk-head h1 { font: 800 italic var(--fs-2xl)/.95 var(--font-display); text-transform: uppercase; }
.timer-chip { font: 800 1.25rem/1 var(--font-display); background: var(--ink); color: var(--on-ink); border-radius: var(--r-pill); padding: 8px 12px; display: flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.timer-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: block; }
.ex-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 4px 0 6px; }
.ex-progress i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.ex-progress i.on { background: var(--brand); }
.ex-progress-l { font: 600 var(--fs-xs)/1 var(--font-body); color: var(--muted); margin-bottom: 12px; display: flex; justify-content: space-between; }

.card.ex { padding: 0; overflow: hidden; }
.ex-top { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 0; }
.ex-num { font: 800 italic 2rem/1 var(--font-display); color: var(--brand-text); min-width: 34px; padding-top: 8px; }
.ex-top .xname { flex: 1; min-width: 0; }
.ex-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 12px; }
.ex-body { padding: 0 14px 14px; }
.card.ex .xbody { margin: 0 -14px 0 -58px; }

/* nome esercizio espandibile */
.xbtn {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 6px 0; min-height: 52px;
}
.xtxt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.xtitle { font: 800 1.45rem/1 var(--font-display); text-transform: uppercase; }
.xtitle.t-h3 { font-size: 1.45rem; }
.xhint { font: 600 var(--fs-xs)/1 var(--font-body); color: var(--brand-text); }
.chev { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; flex: none; transition: transform var(--t-fast); }
.chev svg { width: 18px; height: 18px; stroke: var(--brand-text); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.xname.open .chev { transform: rotate(180deg); }
.xbody { margin: 6px 0 10px; }
.guide-item { border-bottom: 1px solid var(--line); }
.guide-item:last-child { border-bottom: 0; }
.guide-item .xtitle { font-size: 1.3rem; }

.guide { background: var(--fig-bg); border-top: 2px solid var(--brand); padding: 0 0 14px; border-radius: 0 0 var(--r-md) var(--r-md); }
.guide-what { padding: 12px 14px 0; font-weight: 500; }
.fig-box { position: relative; margin: 6px 0 0; }
.figure { display: block; width: 100%; max-width: 360px; margin: 0 auto; height: auto; }
.fig-tags { position: absolute; left: 12px; top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fig-tags span { font: 700 11px/1 var(--font-body); background: var(--brand); color: var(--ink); padding: 5px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.figure .bone { stroke: var(--fig); stroke-width: 7; stroke-linecap: round; }
.figure .limb-far .bone { stroke: var(--fig-far); }
.figure .torso { stroke-width: 8; }
.figure .foot { stroke-width: 5.5; }
.figure .head { fill: var(--fig); }
.figure .floor { stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.figure .ghost line { stroke: var(--fig-far); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 6; }
.figure .ghost circle { fill: none; stroke: var(--fig-far); stroke-width: 3; stroke-dasharray: 2 5; }
.figure .muscle { stroke: var(--fig-muscle); stroke-width: 18; stroke-linecap: round; opacity: .38; }
.figure .muscle-dot { fill: var(--fig-muscle); opacity: .38; }
.figure .prop { stroke: var(--prop); stroke-width: 3; stroke-linecap: round; }
.figure .prop-pad { stroke-width: 7; }
.figure .prop-handle { stroke-width: 3; }
.figure .prop-fill { fill: var(--prop); }
.figure .prop-plate { fill: none; stroke: var(--prop); stroke-width: 3; }
.figure .cable { stroke: var(--s-b); stroke-width: 2; stroke-dasharray: 4 3; }
.figure .band { stroke: var(--brand); stroke-width: 3.5; }
.figure .fig-text { fill: var(--muted); font: 600 10px var(--font-body); }
.guide h4 { padding: 0 14px; }
.steps { list-style: none; margin: 0; padding: 0 14px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: var(--fs-sm); line-height: 1.35; margin-bottom: 8px; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font: 800 .95rem/1 var(--font-display); }
.errs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.errs span { font: 600 var(--fs-xs)/1.2 var(--font-body); background: var(--err-soft); color: var(--err); padding: 7px 9px; border-radius: 8px; }
.errs span::before { content: '✕ '; }
.guide .note { margin: 10px 14px 0; }
.video { padding: 0 14px; }
.video-thumb { all: unset; cursor: pointer; position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--ink); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow-cta); }
.play svg { width: 26px; height: 26px; fill: currentColor; margin-left: 4px; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }
.video-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.video-links { display: flex; gap: 16px; margin: 10px 0; font-size: var(--fs-sm); font-weight: 600; }
.pin summary { color: var(--muted); font-size: var(--fs-sm); }
.pin-form { display: flex; gap: 8px; margin: 8px 0; }

.sugg { font-size: var(--fs-sm); background: var(--info-soft); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; }
.sugg.aumenta { background: var(--volt-soft); }
.sugg.stallo { background: var(--warn-soft); }
.alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.alts .chip { min-height: 40px; }

.sets { display: grid; gap: 6px; margin-top: 10px; }
.set-h, .set { display: grid; grid-template-columns: 40px 1fr 1fr 62px 56px; gap: 6px; align-items: center; }
.set-h { padding: 0 4px; font: 700 10px/1 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.set { min-height: var(--tap-lg); padding: 4px; border-radius: 12px; background: var(--surface-2); transition: background var(--t-fast); }
.set-n { font: 800 1.3rem/1 var(--font-display); text-align: center; }
.set-n small { display: block; font: 700 10px/1 var(--font-body); color: var(--muted); text-transform: uppercase; }
.set-f { position: relative; display: flex; align-items: center; min-width: 0; }
.set-f input {
  height: var(--tap); padding: 0 22px 0 6px; text-align: center; min-width: 0; border-radius: 10px;
  font: 800 1.45rem/1 var(--font-display); background: var(--surface);
}
.set-f > span { position: absolute; right: 6px; font: 600 10px/1 var(--font-body); color: var(--muted); pointer-events: none; }
.set-f.muted { font: 600 11px/1.1 var(--font-body); justify-content: center; text-align: center; }
.set select { height: var(--tap); padding: 0 4px; min-width: 0; font: 800 1.2rem/1 var(--font-display); text-align: center; border-radius: 10px; }
.tick {
  appearance: none; height: var(--tap); width: var(--tap-lg); border-radius: 10px; border: 2px solid var(--ink);
  background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.tick svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.set.done { background: var(--volt); }
.set.done .set-f input, .set.done select { background: rgb(255 255 255 / .55); border-color: transparent; }
.set.done .tick { background: var(--ink); color: var(--volt); }
.set.active { background: var(--surface); box-shadow: 0 0 0 2px var(--brand); }

.warmup summary { display: flex; align-items: center; justify-content: space-between; }
.warmup summary h2 { margin: 0; }
.warmup summary::after { content: '▾'; color: var(--muted); }
.warmup[open] summary { margin-bottom: 6px; }
.warm-item { display: flex; gap: 10px; align-items: flex-start; }
.warm-item > input { width: 24px; height: 24px; min-height: 0; margin-top: 16px; accent-color: var(--ink); flex: none; }
.warm-item .xname { flex: 1; min-width: 0; }
.warm-item .xtitle { font-size: 1.2rem; }
.warm-item .xbody, .guide-item .xbody, .card:not(.ex) .xbody { margin: 6px -16px 10px; }
.warm-item .xbody { margin-left: -50px; }

.rest {
  position: fixed; z-index: 6; left: 10px; right: 10px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  max-width: 620px; margin: 0 auto; background: var(--ink); color: var(--on-ink); border-radius: 18px;
  padding: 10px 10px 14px 16px; box-shadow: 0 14px 30px -10px rgb(11 13 18 / .6); overflow: hidden;
  display: flex; align-items: center; gap: 10px;
}
.rest .r-info { flex: 1; min-width: 0; }
.rest .r-l { font: 700 11px/1 var(--font-body); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.rest .r-t { font: 800 2.75rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.rest .r-s { font-size: var(--fs-xs); color: var(--on-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest .btn { min-height: var(--tap); min-width: var(--tap); padding: 0 12px; font-size: var(--fs-sm); }
.rest .btn.skip { background: var(--brand); color: var(--ink); }
.rest .btn.add { background: rgb(255 255 255 / .12); color: var(--on-ink); }
.rest .bar { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--brand); transition: width .5s linear; }
.rest.done { background: var(--volt); color: var(--ink); }
.rest.done .r-l, .rest.done .r-s { color: var(--ink); }
.finish { margin: 20px 0 40px; }

/* ---------- SONDAGGIO ---------- */
.win { position: relative; overflow: hidden; background: var(--volt); border-radius: var(--r-lg); padding: 14px; margin: 4px 0 12px; }
.win .eyebrow { color: var(--ink); }
.win .t-win { font: 800 italic 1.85rem/1 var(--font-display); text-transform: uppercase; margin: 6px 0 10px; max-width: 250px; }
.win-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.win-stats div { background: rgb(255 255 255 / .6); border-radius: 12px; padding: 7px 10px; }
.win-stats b { display: block; font: 800 1.45rem/1 var(--font-display); }
.win-stats span { font: 600 11px/1.2 var(--font-body); color: #2a3008; }
.win > * { position: relative; z-index: 1; }
.win .burst { position: absolute; z-index: 0; right: -22px; top: -26px; opacity: .28; width: 130px; height: 130px; fill: var(--ink); }
.q { margin-bottom: 14px; }
.q-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.q-h h3 { margin: 0; font: 800 1.35rem/1 var(--font-display); text-transform: uppercase; }
.q-h .val { font: 800 1.35rem/1 var(--font-display); color: var(--brand-text); }
.scale { display: grid; gap: 6px; grid-template-columns: repeat(5, 1fr); }
.scale-btn {
  appearance: none; border: 0; height: 52px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1);
  font: 800 1.5rem/1 var(--font-display); color: var(--ink); cursor: pointer; padding: 0; transition: transform var(--t-pop);
}
.scale.n11 { grid-template-columns: repeat(6, 1fr); }
.scale.n10 .scale-btn, .scale.n11 .scale-btn { height: var(--tap); font-size: 1.3rem; }
.scale-btn.on { background: var(--brand); color: var(--ink); box-shadow: var(--shadow-cta); transform: translateY(-2px); }
.scale-labels { display: flex; justify-content: space-between; font: 600 var(--fs-xs)/1 var(--font-body); color: var(--muted); margin-top: 6px; }
.pain-row { background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-top: 8px; box-shadow: var(--shadow-1); }
.pain-row > span { display: block; font-weight: 700; margin-bottom: 6px; text-transform: capitalize; }
.survey-card { background: transparent; box-shadow: none; padding: 0; }

/* ---------- PROGRESSI ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.stat { background: var(--surface); border-radius: 14px; padding: 10px; box-shadow: var(--shadow-1); }
.stat b { display: block; font: 800 1.9rem/1 var(--font-display); }
.stat span { font: 600 11px/1.2 var(--font-body); color: var(--muted); }
.stat.hot { background: var(--ink); color: var(--on-ink); }
.stat.hot b { color: var(--brand); }
.stat.hot span { color: var(--on-ink-muted); }
.pr { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.pr b { font: 800 1.6rem/1 var(--font-display); }
.pr .up { font: 700 var(--fs-sm)/1 var(--font-body); color: var(--ok-text); background: var(--volt); padding: 5px 8px; border-radius: var(--r-pill); }
.chart { width: 100%; height: auto; margin-top: 6px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 600 10px var(--font-body); }
.chart .area { fill: var(--brand); opacity: .15; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 10px; }
.tbl th, .tbl td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font: 700 10px/1 var(--font-body); color: var(--muted); padding-bottom: 2px; }
.cal-d { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font: 800 .85rem/1 var(--font-display); }
.cal-d.s-A { background: var(--s-a); color: var(--on-s-a); }
.cal-d.s-B { background: var(--s-b); color: var(--on-s-b); }
.cal-d.s-C { background: var(--s-c); color: var(--on-s-c); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-d.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -20px); z-index: 10;
  background: var(--ink); color: var(--on-ink); padding: 12px 16px; border-radius: 12px; max-width: calc(100% - 32px);
  opacity: 0; transition: all .25s; font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 370px) {
  .set-h, .set { grid-template-columns: 34px 1fr 1fr 54px 48px; gap: 4px; }
  .tick { width: 48px; }
  .vbar { grid-template-columns: 82px 1fr 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.cal-l { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.cal-l.s-A { background: var(--s-a); } .cal-l.s-B { background: var(--s-b); } .cal-l.s-C { background: var(--s-c); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.streak .flame { fill: var(--brand); stroke: var(--ink); stroke-width: 1.4; }
.onboard h2 { margin-bottom: 6px; }

/* Le barre fisse (testata, navigazione, timer) non devono coprire ciò che stai toccando. */
html { scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
html.resting { scroll-padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 130px); }
html.resting body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 130px); }
