/* FitMe · stile. Minimale, numeri condensati, un solo colore d'accento (arancio "disco 25 kg"). */

:root {
  --bg: #0c0d0e;
  --surface: #161719;
  --surface-2: #1f2124;
  --surface-3: #2b2e32;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f1ec;
  --text-2: #b8b5ae;
  --muted: #7f7c76;
  --accent: #fc4e0b;
  --on-accent: #1f0c02;
  --accent-soft: rgba(252, 78, 11, 0.14);
  --danger: #ff5a52;
  --up: #4fd48a;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  --grain: 0.05;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f2f0eb;
    --surface: #ffffff;
    --surface-2: #ebe8e1;
    --surface-3: #dcd8cf;
    --line: rgba(20, 18, 15, 0.08);
    --line-2: rgba(20, 18, 15, 0.16);
    --text: #141310;
    --text-2: #4a4741;
    --muted: #84807a;
    --accent: #ec4a0b;
    --on-accent: #1f0c02;
    --accent-soft: rgba(236, 74, 11, 0.12);
    --danger: #e03b33;
    --up: #1f9d5a;
    --shadow: 0 14px 40px rgba(30, 25, 15, 0.18);
    --grain: 0.035;
    color-scheme: light;
  }
}

:root[data-theme='light'] {
  --bg: #f2f0eb;
  --surface: #ffffff;
  --surface-2: #ebe8e1;
  --surface-3: #dcd8cf;
  --line: rgba(20, 18, 15, 0.08);
  --line-2: rgba(20, 18, 15, 0.16);
  --text: #141310;
  --text-2: #4a4741;
  --muted: #84807a;
  --accent: #ec4a0b;
  --on-accent: #1f0c02;
  --accent-soft: rgba(236, 74, 11, 0.12);
  --danger: #e03b33;
  --up: #1f9d5a;
  --shadow: 0 14px 40px rgba(30, 25, 15, 0.18);
  --grain: 0.035;
  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Grana leggera, come la gomma dei pavimenti in palestra */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

body.locked {
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 1;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
}
button:disabled {
  opacity: 0.38;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
p,
ol {
  margin: 0;
}
b {
  font-weight: 700;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ic {
  flex: none;
  display: block;
}
.num {
  font-variant-numeric: tabular-nums;
  font-stretch: 80%;
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.danger {
  color: var(--danger) !important;
}

/* ---------- Layout ---------- */

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 18px) 16px calc(var(--tab-h) + var(--safe-b) + 36px);
}
.view > * + * {
  margin-top: 16px;
}
.has-mini .view {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 112px);
}
.view.bare {
  padding-top: 0;
  padding-bottom: calc(var(--safe-b) + 150px);
}

.view.enter > * {
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.view.enter > :nth-child(2) { animation-delay: 0.03s; }
.view.enter > :nth-child(3) { animation-delay: 0.06s; }
.view.enter > :nth-child(4) { animation-delay: 0.09s; }
.view.enter > :nth-child(5) { animation-delay: 0.12s; }
.view.enter > :nth-child(n + 6) { animation-delay: 0.15s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------- Intestazioni ---------- */

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 6px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-stretch: 112%;
  color: var(--muted);
  margin-bottom: 8px;
}
.title {
  font-size: clamp(38px, 11vw, 48px);
  line-height: 0.9;
  font-weight: 850;
  font-stretch: 122%;
  letter-spacing: -0.04em;
}
.title-md {
  font-size: clamp(28px, 8vw, 34px);
  line-height: 1;
  font-weight: 820;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.tags + .title-md {
  margin-top: 14px;
}

.bar {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.bar.sticky {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: 0 -16px 4px;
  padding: calc(var(--safe-t) + 8px) 12px 8px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.bar > :last-child {
  justify-self: end;
}
.bar-mid {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.bar-title {
  max-width: 100%;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 14px;
  color: var(--text-2);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.8s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.12s ease, opacity 0.2s;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  height: 40px;
  padding: 0 16px;
  border-radius: 13px;
  font-size: 15px;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.lg {
  height: 58px;
  font-size: 17px;
  margin-top: 12px;
}
.btn-dashed {
  margin-top: 12px;
  background: transparent;
  border: 1.5px dashed var(--line-2);
  color: var(--text-2);
}
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-2);
}
.btn-text.center {
  display: flex;
  justify-content: center;
  margin: 6px auto 0;
}
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.icon-btn.sm {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.icon-btn.plain {
  background: transparent;
  border: 0;
}
.icon-btn.accent {
  background: var(--accent);
  border: 0;
  color: var(--on-accent);
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 650;
}
.chip-btn.ghost {
  background: transparent;
  color: var(--muted);
}

/* ---------- Card e liste ---------- */

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.pad {
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 17px;
  font-weight: 780;
  font-stretch: 106%;
  letter-spacing: -0.01em;
}
.card-aside {
  font-size: 13px;
  color: var(--muted);
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 30px 2px 12px;
}
.sec-head h2 {
  font-size: 21px;
  font-weight: 820;
  font-stretch: 114%;
  letter-spacing: -0.025em;
}

.list {
  overflow: hidden;
}
.list > .row + .row {
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 13px 16px;
  text-align: left;
  transition: background 0.15s;
}
a.row:active,
button.row:active {
  background: var(--surface-2);
}
.row > .ic:first-child {
  color: var(--text-2);
}
.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row-title {
  font-size: 16px;
  font-weight: 620;
  line-height: 1.25;
}
.row-sub {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
}
.row-sub em {
  font-style: normal;
  color: var(--accent);
}
.row-val {
  font-size: 16px;
  color: var(--text-2);
  white-space: nowrap;
}
.row-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.row-chev {
  color: var(--muted);
  opacity: 0.7;
}
.list-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 4px 10px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.list-label span {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.view > section > .list-label:first-child {
  margin-top: 22px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--muted));
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.fine {
  margin: 12px 6px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.fine.center {
  text-align: center;
  margin-top: 28px;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ic {
  margin: 0 auto;
  color: var(--text-2);
  opacity: 0.6;
}
.empty h3 {
  margin: 14px 0 6px;
  font-size: 19px;
  font-weight: 780;
  color: var(--text);
}
.empty p {
  max-width: 300px;
  margin: 0 auto;
  font-size: 15px;
}
.empty .btn {
  margin-top: 20px;
}
.empty-sm {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- Profilo ---------- */

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.02em;
  object-fit: cover;
}
.avatar.blank {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.avatar-btn {
  flex: none;
  border-radius: 50%;
  transition: transform 0.15s;
}
.avatar-btn:active {
  transform: scale(0.94);
}
.top-main {
  min-width: 0;
}
.title-name {
  overflow-wrap: anywhere;
}

.goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
}
.goal-pill b {
  font-size: 14px;
  color: var(--text);
}
.goal-pill.done {
  background: var(--accent-soft);
  color: var(--accent);
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0 4px;
  text-align: center;
}
.profile-hero .title-md {
  margin-top: 6px;
}
.profile-hero .tags {
  justify-content: center;
}
.profile-hero .btn {
  margin-top: 6px;
}
.profile-meta {
  font-size: 15px;
  color: var(--text-2);
}

.welcome {
  padding-top: calc(var(--safe-t) + 36px);
}
.welcome-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border-radius: 16px;
}
.welcome-sub {
  margin-top: 12px;
  max-width: 340px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-2);
}

.pform {
  padding: 20px 18px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.pform > * + * {
  margin-top: 20px;
}
.pform .field-grid {
  margin-top: 20px;
}
.pform .chip:not(.on) {
  background: var(--surface-2);
  border-color: transparent;
}
.field-k em {
  margin-left: 4px;
  font-style: normal;
  font-weight: 550;
  color: var(--muted);
}
.photo-pick {
  display: flex;
  align-items: center;
  gap: 18px;
}
.photo-btns {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.photo-btns .btn {
  cursor: pointer;
}
.photo-btns .hint em {
  font-style: normal;
}
.row-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.welcome-login {
  margin-top: 20px;
}

/* ---------- Account e salvataggio online ---------- */

.acc-hero {
  margin: 4px 2px 22px;
}
.acc-ic {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}
.acc-ic.ok {
  background: color-mix(in srgb, var(--up) 15%, transparent);
  color: var(--up);
}
.acc-ic.danger {
  background: color-mix(in srgb, var(--danger) 13%, transparent);
}
.acc-sub {
  margin-top: 10px;
  max-width: 380px;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.acc-hero + .notice {
  margin-bottom: 16px;
}
.acc-seg {
  margin-bottom: 12px;
}
.form-msg {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  background: var(--surface-2);
  color: var(--text-2);
}
.form-msg.ok {
  background: color-mix(in srgb, var(--up) 13%, transparent);
  color: var(--text);
}
.form-msg.danger {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.row-sub.ok {
  color: var(--up);
}
.row-sub.warn {
  color: var(--accent);
}
.row-title.mail {
  overflow-wrap: anywhere;
}
.notice-link {
  margin-top: 8px;
  font-size: 14px;
}

/* ---------- Home ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 196px;
  padding: 22px 20px 20px;
  overflow: hidden;
  border-radius: 28px;
  background: var(--accent);
  color: var(--on-accent);
  text-align: left;
  isolation: isolate;
  transition: transform 0.15s;
}
.hero:active {
  transform: scale(0.985);
}
.hero-plate {
  position: absolute;
  z-index: -1;
  right: -58px;
  top: -52px;
  width: 230px;
  height: 230px;
  opacity: 0.17;
  animation: spin 60s linear infinite;
}
.hero-plate text {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: 3px;
  fill: currentColor;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.hero-k {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.72;
}
.hero-title {
  margin-top: auto;
  padding-top: 30px;
  font-size: 36px;
  line-height: 0.92;
  font-weight: 860;
  font-stretch: 122%;
  letter-spacing: -0.04em;
}
.hero-sub {
  margin-top: 10px;
  max-width: 70%;
  font-size: 14.5px;
  font-weight: 550;
  opacity: 0.75;
}
.hero-go {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent);
}

.live-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px;
  border-radius: 28px;
  background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  text-align: left;
}
.live-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.live-top .num {
  margin-left: auto;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--text);
}
.live-name {
  margin-top: 14px;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 820;
  font-stretch: 112%;
  letter-spacing: -0.03em;
}
.live-meta {
  margin: 6px 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 12px 14px;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 8px 14px 14px;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
}
.notice > .ic {
  margin-top: 1px;
  color: var(--accent);
}
.notice b {
  font-size: 15px;
}
.notice small {
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.notice.danger {
  padding-right: 14px;
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.notice.danger > .ic {
  color: var(--danger);
}
.install-ic {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.install b {
  font-size: 15px;
}
.install small {
  font-size: 13px;
  color: var(--muted);
}
.install small .ic {
  display: inline;
  vertical-align: -2px;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.wd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}
.wd i {
  width: 100%;
  max-width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-2);
}
.wd.future i {
  background: transparent;
  border: 1px dashed var(--line-2);
}
.wd.on i {
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
}
.wd.today span {
  color: var(--text);
}
.wd.today:not(.on) i {
  box-shadow: inset 0 0 0 1.5px var(--text-2);
}

.stats3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat {
  min-width: 0;
}
.stat + .stat {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.stat-v {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  font-stretch: 78%;
}
.stat-v small,
.tile-v small {
  margin-left: 3px;
  font-size: 14px;
  font-weight: 650;
  font-stretch: 100%;
  color: var(--muted);
}
.stat-k {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.routine {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.routine + .routine {
  margin-top: 10px;
}
.routine-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 16px 18px;
}
.routine-name {
  font-size: 18px;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: -0.015em;
}
.routine-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.routine-meta .dot {
  width: 7px;
  height: 7px;
}
.routine-meta .dot:last-of-type {
  margin-right: 4px;
}
.routine-ex {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.routine-play {
  width: 70px;
  flex: none;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--accent);
}
.routine-play span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  transition: transform 0.15s;
}
.routine-play:active span {
  transform: scale(0.9);
}

.empty-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  text-align: left;
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}
.empty-card b {
  font-size: 16px;
}
.empty-card small {
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.empty-ic {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
}

.steps {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.steps li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
}
.steps li b {
  color: var(--text);
}
.steps li::before {
  counter-increment: s;
  content: counter(s);
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.inline-ic {
  display: inline;
  vertical-align: -3px;
  color: var(--accent);
}

/* ---------- Allenamento (editor serie) ---------- */

.editor > * + * {
  margin-top: 12px;
}
.entry {
  padding: 14px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: border-color 0.3s;
}
.entry.complete {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.entry-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 0 0 8px;
}
.entry-head .dot {
  margin-top: 7px;
}
.entry-titles {
  flex: 1;
  min-width: 0;
}
.entry-name {
  font-size: 17px;
  font-weight: 760;
  line-height: 1.25;
}
.entry-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.entry-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 10px 8px 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
  text-align: left;
}
.entry-note .ic {
  margin-top: 1px;
  color: var(--accent);
}

.sets {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}
.set-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 70px 58px 46px;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 14px;
  transition: background 0.2s;
}
.t-tempo .set-row {
  grid-template-columns: 26px minmax(0, 1fr) 100px 46px;
}
.t-cardio .set-row {
  grid-template-columns: 26px minmax(0, 1fr) 62px 62px 46px;
}
.set-row.head {
  padding-bottom: 0;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.set-row.head span:first-child,
.set-row.head span:nth-child(n + 3) {
  text-align: center;
}
.set-n {
  text-align: center;
  font-size: 15px;
  color: var(--text-2);
}
.set-prev {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.set-in {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 4px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  font-size: 19px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.set-in::placeholder {
  color: var(--muted);
  opacity: 0.55;
  font-weight: 600;
}
.set-in:focus {
  border-color: var(--accent);
  background: var(--bg);
}
.set-check,
.set-x {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--muted);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.set-x {
  background: transparent;
}
.set-check:active {
  transform: scale(0.9);
}
.set-row.done {
  background: var(--accent-soft);
}
.set-row.done .set-in {
  background: transparent;
}
.set-row.done .set-n {
  color: var(--accent);
}
.set-row.done .set-check {
  background: var(--accent);
  color: var(--on-accent);
  animation: pop 0.35s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes pop {
  from { transform: scale(0.75); }
}
.shake {
  animation: shake 0.35s;
}
@keyframes shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.entry-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 0 2px;
}
.entry-foot .push {
  margin-left: auto;
}

/* Barra del recupero */
.restbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0 12px calc(var(--safe-b) + 12px);
  transform: translateY(130%);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.restbar.on {
  transform: none;
  pointer-events: auto;
}
.restbar-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 536px;
  margin: 0 auto;
  padding: 10px 10px 13px 18px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.restbar-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.restbar-k {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.restbar-t {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  font-stretch: 75%;
}
.rb {
  height: 46px;
  min-width: 50px;
  padding: 0 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  font-size: 15px;
  font-weight: 750;
}
.rb-main {
  min-width: 64px;
  background: var(--accent);
  color: var(--on-accent);
}
.restbar-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: color-mix(in srgb, var(--bg) 12%, transparent);
}
.restbar-fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.25s linear;
}

/* Pillola "allenamento in corso" */
.mini {
  position: fixed;
  z-index: 19;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 536px;
  margin: 0 auto;
  padding: 10px 10px 10px 16px;
  border-radius: 20px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  text-align: left;
  animation: rise 0.35s both;
}
.mini.still {
  animation: none;
}
.mini-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mini-k {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  opacity: 0.7;
}
.mini-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 750;
}
.mini-rest {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
}
.mini-go {
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 750;
}

/* ---------- Barra di navigazione ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding-bottom: var(--safe-b);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tabbar-in {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 560px;
  height: var(--tab-h);
  margin: 0 auto;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}
.tab-ic {
  width: 56px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  transition: background 0.2s, color 0.2s;
}
.tab.on {
  color: var(--text);
}
.tab.on .tab-ic {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Ricerca e filtri ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 0.15s;
}
.search:focus-within {
  border-color: var(--line-2);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 16px;
  color: var(--text);
}
.search input::-webkit-search-cancel-button {
  filter: grayscale(1);
}

.filters > * + * {
  margin-top: 8px;
}
.filter-k {
  margin: 4px 2px -2px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters .filter-k + .chips {
  margin-top: 8px;
}
.filters .chips + .filter-k {
  margin-top: 14px;
}
.chips {
  display: flex;
  gap: 8px;
}
.chips.scroll {
  margin: 0 -16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding: 0 16px;
  /* sfumatura a destra: fa capire che si può scorrere */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}
.chips.scroll::-webkit-scrollbar {
  display: none;
}
.chips.wrap {
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 620;
  white-space: nowrap;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.chip.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.chips.sub .chip {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.chips.wrap .chip {
  padding: 0 12px;
}

/* ---------- Fogli dal basso ---------- */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.28s;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  max-height: calc(100% - var(--safe-t) - 28px);
  margin: 0 auto;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: var(--safe-b);
}
.sheet.tall {
  height: calc(100% - var(--safe-t) - 28px);
}
.open .sheet {
  transform: none;
}
.open .sheet-backdrop {
  opacity: 1;
}
.sheet-grip {
  display: grid;
  place-items: center;
  height: 22px;
  flex: none;
  cursor: pointer;
}
.sheet-grip span {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-2);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
}
.sheet-body > * {
  flex-shrink: 0;
}
.sheet-body > * + * {
  margin-top: 14px;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.sheet-head h3 {
  flex: 1;
  font-size: 21px;
  font-weight: 800;
  font-stretch: 110%;
  letter-spacing: -0.02em;
}
.sheet-p {
  font-size: 14.5px;
  color: var(--text-2);
}
.sheet-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto !important;
  padding: 18px 0 8px;
  background: linear-gradient(to bottom, transparent, var(--surface) 22px);
}
.stack-sm > * + * {
  margin-top: 10px;
}
.sheet .search,
.sheet .chip {
  background: var(--surface-2);
}
.sheet .chip.on {
  background: var(--text);
}
.sheet .chips.scroll {
  flex: none;
}
.sheet .list-label {
  margin: 20px 4px 4px;
}
#picker-list {
  margin-top: 6px;
}

.pick {
  min-height: 58px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.pick-box {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  color: transparent;
  transition: all 0.15s;
}
.pick.on .pick-box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pick.on .row-title {
  color: var(--accent);
}
.row-new {
  padding: 12px 6px;
  color: var(--accent);
}
.row-new > .ic {
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent) !important;
}
.row-new .row-title {
  color: var(--text);
}

.menu {
  display: grid;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.menu-item:active:not(:disabled) {
  background: var(--surface-2);
}
.menu-item .ic {
  color: var(--text-2);
}
.menu-item.danger .ic {
  color: var(--danger);
}

.rest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rest-opt {
  height: 54px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 18px;
}
.rest-opt.on {
  background: var(--accent);
  color: var(--on-accent);
}

/* Riepilogo di fine allenamento */
.summary {
  padding-top: 6px;
  text-align: center;
}
.summary-badge {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  animation: pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.summary h2 {
  font-size: 30px;
  line-height: 1;
  font-weight: 840;
  font-stretch: 116%;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.summary .stats3 {
  margin: 26px 0 6px;
  text-align: center;
}
.summary .stat + .stat {
  padding-left: 0;
}
.summary-p {
  margin-top: 18px;
  color: var(--text-2);
}
.pr-box {
  margin-top: 22px;
  padding: 16px;
  border-radius: 20px;
  background: var(--accent-soft);
  text-align: left;
}
.pr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 800;
  color: var(--accent);
}
.pr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-weight: 650;
}
.pr-row:first-of-type {
  border-top: 0;
}
.pr-row small {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.pr-row b {
  font-size: 20px;
  white-space: nowrap;
}

/* ---------- Dialoghi e toast ---------- */

.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}
.dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 22px 20px 16px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.open .dialog {
  opacity: 1;
  transform: none;
}
.open .dialog-backdrop {
  opacity: 1;
}
.dialog h3 {
  font-size: 20px;
  font-weight: 800;
  font-stretch: 106%;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.dialog p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}
.dialog-field {
  margin-top: 16px;
}
.dialog-btns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}
.dialog-btns .btn {
  padding: 0 12px;
  white-space: normal;
  line-height: 1.15;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: calc(var(--safe-t) + 12px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.has-act {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  white-space: nowrap;
}
.toast.has-act.show {
  pointer-events: auto;
}
.toast-act {
  padding: 8px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: 14.5px;
  font-weight: 800;
}

/* ---------- Moduli ---------- */

.form > * + * {
  margin-top: 20px;
}
.field {
  display: block;
  min-width: 0;
}
.field-k {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 680;
  color: var(--text-2);
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}
.field-grid .field:last-child {
  grid-column: 1 / -1;
}
.input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus {
  border-color: var(--accent);
}
.input.sm {
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 17px;
}
.input.select {
  text-align: left;
  font-size: 15px;
}
textarea.input {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: none;
}
.title-input {
  width: 100%;
  padding: 4px 0;
  border: 0;
  border-bottom: 1.5px solid var(--line-2);
  border-radius: 0;
  background: none;
  outline: none;
  font-size: 26px;
  font-weight: 820;
  font-stretch: 104%;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  color: var(--text);
}
.title-input:focus {
  border-bottom-color: var(--accent);
}
.routine-edit > * + * {
  margin-top: 12px;
}

.radio-list {
  display: grid;
  gap: 8px;
}
.radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  text-align: left;
}
.radio.on {
  border-color: var(--accent);
}
.radio-dot {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  transition: border 0.15s;
}
.radio.on .radio-dot {
  border: 6px solid var(--accent);
}
.radio b {
  display: block;
  font-weight: 680;
}
.radio small {
  font-size: 13px;
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.stepper button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
}
.stepper button:active {
  background: var(--surface-3);
}
.stepper b {
  min-width: 42px;
  text-align: center;
  font-size: 18px;
}

.seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: var(--surface-2);
}
.seg button {
  height: 40px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  color: var(--text-2);
}
.seg button.on {
  background: var(--text);
  color: var(--bg);
}
.seg.sm {
  margin-bottom: 16px;
}
.seg.sm button {
  height: 34px;
  font-size: 13px;
}
.view > section > .seg {
  background: var(--surface);
  border: 1px solid var(--line);
}

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  border-radius: 15px;
  background: var(--surface-3);
  transition: background 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(20px);
}

/* Schede: esercizio con serie e ripetizioni */
.ritem {
  padding: 14px;
}
.ritem-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ritem-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
}
.ritem-tools {
  display: flex;
  margin-right: -8px;
}
.ritem-tools .icon-btn.sm {
  width: 34px;
}
.ritem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-top: 12px;
}
.mini-field {
  display: block;
  min-width: 0;
}
.mini-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 680;
  color: var(--muted);
}
.mini-field .stepper {
  justify-content: space-between;
}

/* ---------- Esercizio: dettaglio ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 620;
  color: var(--text-2);
}
.note-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}
.note-card > .ic:first-child {
  color: var(--accent);
}
.note-card .row-title {
  font-size: 15px;
  font-weight: 560;
}
.empty-note {
  border-style: dashed;
  background: transparent;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tiles.three {
  grid-template-columns: repeat(3, 1fr);
}
.tile {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.tile-k {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--muted);
}
.tile-v {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  font-stretch: 76%;
  white-space: nowrap;
}
.tiles.three .tile {
  padding: 12px 14px;
}
.tiles.three .tile-v {
  font-size: 26px;
}
.tile.hl {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.tile.hl .tile-k,
.tile.hl .tile-v small {
  color: inherit;
  opacity: 0.72;
}

.chart-wrap {
  position: relative;
}
.readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 38px;
}
.readout-v {
  font-size: 30px;
  font-weight: 800;
  font-stretch: 78%;
}
.readout-k {
  font-size: 13.5px;
  color: var(--muted);
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
  overflow: visible;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .glabel {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--muted);
}
.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .pt {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}
.chart .pt.last {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2.5;
}
.chart .cursor-l {
  stroke: var(--text-2);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chart .cursor-c {
  fill: var(--accent);
  stroke: var(--text);
  stroke-width: 2;
}
.bars .bar-r {
  fill: var(--surface-3);
}
.bars .bar-r.zero {
  fill: var(--line-2);
}
.bars .bar-r.cur {
  fill: var(--accent);
}
.bars .bar-v {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-2);
  text-anchor: middle;
}
.chart-x {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.spark {
  flex: none;
}
.spark polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.delta {
  font-size: 12.5px;
  font-weight: 700;
}
.delta.up {
  color: var(--up);
}
.delta.down {
  color: var(--muted);
}

.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.rep {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}
.rep-n {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.rep b {
  font-size: 20px;
}
.rep small {
  font-size: 11.5px;
  color: var(--muted);
}

.hist {
  align-items: flex-start;
}
.hist-date {
  width: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.hist-date b {
  font-size: 15px;
}
.hist-date small {
  font-size: 12px;
  color: var(--muted);
}
.hist-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.set-chip {
  padding: 4px 9px;
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}

/* ---------- Storico ---------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -6px 12px;
}
.cal-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cal-title b {
  font-size: 16px;
  font-weight: 760;
}
.cal-title small {
  font-size: 12.5px;
  color: var(--muted);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 2px;
  text-align: center;
}
.cal-dow {
  padding-bottom: 4px;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
}
.cal-d {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 40px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.cal-d.on {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}
.cal-d.today {
  box-shadow: inset 0 0 0 1.5px var(--text);
}
.cal-d.future {
  opacity: 0.32;
}

.wrow {
  align-items: flex-start;
}
.top-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Selezione di più allenamenti nello storico */
.pick-box {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pick.on {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.pick.on .pick-box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.sel-bar {
  position: fixed;
  z-index: 21;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 536px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.view:has(.sel-bar) {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 112px);
}
.wrow-date {
  width: 40px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wrow-date b {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}
.wrow-date span {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.wrow-ex {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.wrow-ex .x {
  color: var(--muted);
}
.pr-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 26px;
  padding: 0 9px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}
.pr-ic {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.wd-entry {
  overflow: hidden;
}
.wd-entry + .wd-entry {
  margin-top: 10px;
}
.wd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 10px 16px;
}
.wd-sets {
  display: grid;
  padding: 0 16px 12px;
}
.wd-set {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
}
.wd-set .set-n {
  text-align: left;
}
.wd-1rm {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Muscoli ---------- */

.hbar {
  display: grid;
  grid-template-columns: 78px 1fr 30px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.hbar + .hbar {
  margin-top: 10px;
}
.hbar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-2);
}
.hbar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--c);
}
.hbar b {
  text-align: right;
  font-size: 16px;
}

/* ---------- Schermi larghi ---------- */

@media (min-width: 600px) {
  .view {
    padding-top: calc(var(--safe-t) + 32px);
  }
}

@media (hover: hover) {
  a.row:hover,
  button.row:hover,
  .menu-item:hover:not(:disabled) {
    background: var(--surface-2);
  }
  .chip:hover:not(.on) {
    border-color: var(--line-2);
  }
}

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