/* Pannelli laterali: dettaglio, editor, atleta, libreria, dati. Sul telefono a tutto schermo. */
dialog.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(760px, 100%); height: 100%; max-height: 100%; max-width: 100%;
  padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); border: 0; border-left: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  box-shadow: var(--shadow);
}
dialog.sheet[open] { animation: sheet-in .18s ease-out; }
/* messa da parte per tornarci con «indietro» (js/panels.js R.leaveSheets): aperta ma nascosta, com'era */
dialog.sheet.is-parked { display: none !important; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
dialog.sheet::backdrop { background: rgb(8 12 16 / .45); }

.sh-head {
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
  background: color-mix(in srgb, var(--c) 11%, var(--surface));
  border-bottom: 3px solid var(--c);
  display: flex; flex-direction: column; gap: 8px;
}
.sh-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sh-sport { display: inline-flex; align-items: center; gap: 6px; flex: none; font: 600 14px/1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.sh-sport .c-ico { width: 24px; height: 24px; }
.sh-sport .c-ico svg { width: 16px; height: 16px; }
.sh-date { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-close { margin-left: auto; }
.sh-back, .sh-save { display: none; }
.sh-top h2 { min-width: 0; }
.sh-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.sh-head h2 { margin: 0; font: 700 28px/1.05 var(--f-display); letter-spacing: .01em; text-wrap: balance; }
.sh-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-left: -8px; }
.sh-body { padding: 0 20px 24px; }
.sec { padding-top: 14px; }
.sec h3 { margin: 0 0 8px; font: 600 13px/1 var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hint { margin: 5px 0 0; font-size: 12px; color: var(--muted); max-width: 68ch; }
.desc { margin: 0; max-width: 68ch; line-height: 1.5; }

/* ---------- tabelle ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.steps, table.pvc { width: 100%; border-collapse: collapse; }
.steps th, .pvc thead th {
  text-align: left; padding: 6px 9px; background: var(--surface-2);
  font: 600 11.5px/1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.steps td { padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.steps tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.steps td.num small { display: block; font-size: 11px; color: var(--muted); }
.zname { color: var(--muted); font-size: 12px; margin-left: 6px; }
.zchip {
  display: inline-block; min-width: 26px; padding: 1px 5px; border-radius: 4px; text-align: center;
  font: 700 12px/1.25 var(--f-mono); background: var(--zc); color: #10161B;
}
.ph { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 1px; background: var(--c); }
.ph-warmup, .ph-cooldown { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.ph-recovery { background: var(--z1); }
.ph-rest { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.rep-badge { display: inline-flex; align-items: center; margin-right: 8px; font: 700 19px/1 var(--f-display); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.zones td:first-child { white-space: nowrap; }
.zones .zchip { margin-right: 8px; }
.zones .zname { margin-left: 0; color: inherit; font-size: inherit; }
.zones th .z-h { display: none; }
.zones td.num .z-u { display: inline; margin: 0; font-size: inherit; color: inherit; }

.pvc { max-width: 440px; border: 1px solid var(--line); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.pvc tbody th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 9px; border-top: 1px solid var(--line); }
.pvc td { padding: 6px 9px; border-top: 1px solid var(--line); font-weight: 600; }
.pvc td:last-child { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }

/* ---------- «Cosa fare»: un passo per riga, quantità e obiettivo in grande ---------- */
.do-list, .do-in { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.do {
  --phc: var(--c);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 8px 12px 9px;
  border-radius: 8px; background: var(--surface-2); border-left: 4px solid var(--phc);
}
.do.t-warmup, .do.t-cooldown { --phc: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.do.t-recovery { --phc: var(--z1); }
.do.t-rest { --phc: var(--line); }
.do-ph { display: flex; align-items: baseline; gap: 8px; font: 600 12px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.do-ph .ph { display: none; }
.do-ph em { font: 500 12px/1.2 var(--f-body); text-transform: none; letter-spacing: 0; font-style: normal; }
.do-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.do-amt { font: 700 24px/1.15 var(--f-display); letter-spacing: .01em; }
.do-tgt { font-size: 15px; color: var(--muted); }
.do-tgt b { font: 700 22px/1.15 var(--f-display); color: color-mix(in srgb, var(--c) 72%, var(--ink)); letter-spacing: .01em; }
.do.t-rest .do-tgt, .do.t-recovery .do-tgt b { color: var(--muted); }
.do-note { font-size: 13px; color: var(--muted); font-style: italic; }
.do-rep { border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); border-radius: 10px; padding: 8px; background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.do-rep-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.do-rep-h b { font: 700 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.do-rep-h span { font-size: 12px; color: var(--muted); }
.do.is-hl, .do-rep.is-hl { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }

/* ---------- grafico profilo ---------- */
.prof-wrap { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px 2px; background: var(--surface); }
.prof { width: 100%; height: auto; }
.prof .grid { stroke: var(--line); stroke-width: 1; }
.prof .thr { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.prof .base, .prof .tick { stroke: var(--muted); stroke-width: 1; }
.prof .ax { fill: var(--muted); font: 500 11px var(--f-mono); }
.prof .seg-rest { fill: var(--line); }
.prof .seg { transition: opacity .12s; }
.prof:has(.seg.is-hl) .seg:not(.is-hl) { opacity: .3; }

/* scelta a segmenti (schede, unità, aspetto) */
.seg { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }

/* account */
.acc-row { display: flex; gap: 6px; }
.acc-row input { flex: 1; min-width: 0; }
#accInvite { text-transform: uppercase; letter-spacing: .12em; }

/* ---------- moduli ---------- */
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > span:not(.pw-box):not(.dur-in), .fs legend {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.fld input, .fld select, .fld textarea, .sheet textarea, .ed-step input, .ed-step select, .lib-add input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); min-width: 0;
}
.sheet textarea { resize: vertical; line-height: 1.45; }
.fld input:focus, .fld select:focus, .sheet textarea:focus, .ed-step input:focus, .ed-step select:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
input.is-bad { border-color: var(--missed) !important; background: color-mix(in srgb, var(--missed) 7%, var(--surface)) !important; }
/* durata in tre caselle (R.durHTML, js/data.js): [ 1 ] h [ 05 ] min [ 30 ] s, come gli altri campi; la tastiera dei
   numeri del telefono non ha i due punti. Nella griglia del modulo prende due colonne: sul telefono resta su una riga */
.dur-in { display: flex; align-items: center; gap: 4px; min-width: 0; }
span.dur-in > input[data-dur-part] {
  flex: none; width: 2.6em; min-width: 0; padding: 7px 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  text-align: center; font-variant-numeric: tabular-nums;
}
span.dur-in > input[data-dur-part]:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.dur-u { margin-right: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dur-u:last-child { margin-right: 0; }
.f-grid > .fld:has(> .dur-in) { grid-column: span 2; }
.fs { border: 0; padding: 0; margin: 12px 0 0; }
.fs legend { padding: 0; margin-bottom: 5px; }
.done-form .fld + .fld, .done-form .fs + .fld { margin-top: 12px; }
.f-err { margin: 8px 0 0; color: var(--missed); font-weight: 600; }
.f-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.f-actions.left { justify-content: flex-start; margin-top: 0; }

.rpe { display: flex; gap: 4px; flex-wrap: wrap; }
.rpe-opt, .chip-opt, .sp-opt { position: relative; }
.rpe-opt input, .chip-opt input, .sp-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.rpe-opt span {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); font-weight: 700;
}
.rpe-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-opt span { display: inline-block; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 13px; }
.chip-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.rpe-opt input:focus-visible + span, .chip-opt input:focus-visible + span, .sp-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.done-sum blockquote { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); font-style: italic; max-width: 68ch; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { padding: 3px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }

/* ---------- editor ---------- */
.ed-row1 { display: flex; gap: 10px; flex-wrap: wrap; }
.ed-row1 .grow { flex: 1 1 240px; }
.ed-row1 .fld:not(.grow) { flex: 0 1 160px; }
.sport-pick { display: flex; gap: 5px; flex-wrap: wrap; }
.sp-opt { flex: none; }
.sp-opt span {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; cursor: pointer;
  border-radius: 99px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); background: var(--surface);
  font-weight: 600; font-size: 12.5px; white-space: nowrap;
}
.sp-opt span svg { width: 19px; height: 19px; padding: 2px; border-radius: 4px; color: var(--c); }
.sp-opt input:checked + span { background: var(--c); border-color: var(--c); color: var(--surface); }
.sp-opt input:checked + span svg { color: var(--surface); }

code { font-family: var(--f-mono); font-size: .92em; padding: 1px 4px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }

.ed-preview { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ed-tot { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; }
.ed-tot dt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ed-tot dd { margin: 0; font: 700 22px/1.1 var(--f-display); }

.ed-steps { display: flex; flex-direction: column; gap: 6px; }
.ed-steps:empty { display: none; }
/* un blocco: [tipo ▾]  ·  [1] [km ▾]  a [6:10] – [   ] /km  ·  stima e nota */
.ed-step {
  --phc: var(--c);
  display: flex; flex-direction: column; gap: 6px; padding: 7px 8px 8px 10px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--phc);
}
.ed-step.t-warmup, .ed-step.t-cooldown { --phc: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.ed-step.t-recovery { --phc: var(--z1); }
.ed-step.t-rest { --phc: var(--line); }
.es-top { display: flex; align-items: center; gap: 6px; }
.es-top .ph { display: none; }
.ed-step .es-top select { width: auto; flex: 0 1 190px; padding: 6px 8px; font-weight: 700; }
.es-main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.es-qty, .es-tgt { display: inline-flex; align-items: center; gap: 5px; }
.ed-step .es-qty input { width: 72px; padding: 6px; text-align: right; font: 700 18px/1.1 var(--f-body); font-variant-numeric: tabular-nums; }
.ed-step .es-qty select { width: 70px; padding: 6px; font-weight: 600; }
.ed-step .es-tgt input { width: 70px; padding: 6px 4px; text-align: center; font: 700 18px/1.1 var(--f-body); font-variant-numeric: tabular-nums; }
.ed-step .es-tgt [data-f="t2"] { width: 62px; }
.ed-step .es-tgt [data-f="t2"]:placeholder-shown { border-style: dashed; background: transparent; }
.es-a, .es-dash, .es-u { color: var(--muted); font-weight: 600; }
.es-rest { color: var(--muted); font-weight: 700; }
.es-foot { display: flex; align-items: center; gap: 8px; }
.es-est { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); }
.ed-step .es-foot input { width: auto; flex: 0 1 200px; padding: 5px 8px; }
.ed-tools { display: inline-flex; margin-left: auto; }
.ed-tools .icon-btn { width: 28px; height: 28px; }
.ed-tools .icon-btn svg { width: 16px; height: 16px; }
.ed-rep { border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); border-radius: var(--r); padding: 6px; background: color-mix(in srgb, var(--c) 5%, var(--surface)); display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.ed-rep-head { display: flex; align-items: center; gap: 8px; width: 100%; }
.ed-rep-head .rep-badge { margin: 0; }
.ed-rep-head .rep-badge input { width: 52px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 700 20px/1 var(--f-display); text-align: center; color: inherit; }
.ed-rep-label { font: 600 13px/1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ed-rep-body { display: flex; flex-direction: column; gap: 5px; width: 100%; padding-left: 8px; border-left: 3px solid var(--c); }
.ed-empty { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); text-align: center; list-style: none; }
.ed-add { display: flex; gap: 6px; margin-top: 8px; }
.ed-add4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ed-add4 .btn { justify-content: center; }
.ed-steps:empty + .ed-add4 { margin-top: 0; }
.ed-foot {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line);
}
.ed-foot .f-err { margin: 0 auto 0 0; }
/* pulsanti Salva/Annulla sempre in fondo allo schermo, anche quando il modulo è corto */
#edForm, .sh-form { min-height: 100%; display: flex; flex-direction: column; }
#edForm > .ed-foot, .sh-form > .ed-foot { margin-top: auto; }
/* salvando un allenamento con dei gemelli in programma: «Solo questo o tutti?», ferma in fondo anche sul telefono */
.ed-ask {
  position: sticky; bottom: 70px; z-index: 3; /* sopra «Annulla / Salva» (anche sul telefono, dove il piè di pagina è un po' più basso) */ display: flex; flex-direction: column; gap: 10px; margin: auto 12px 12px; padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; background: var(--surface);
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--ink) 45%, transparent);
}
.ed-ask[hidden] { display: none; }
.ed-ask p { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 15px; line-height: 1.35; }
.ed-ask small { font-size: 13px; color: var(--muted); }
.ed-ask-b { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-ask-b .btn { flex: 1 1 auto; justify-content: center; }
.ed-ask:not([hidden]) + .ed-foot { margin-top: 0 !important; }
/* dettaglio (js/detail.js): i tasti Cambia, Copia… Elimina ci sono due volte, in cima (.sh-head) e in fondo (.sh-foot).
   Sul PC contano quelli in cima e il contenitore in fondo non esiste per la pagina (display: contents): così il recupero
   della palestra (.rest), che sta lì dentro, resta incollato in fondo come prima. Sul telefono è il contrario (più sotto) */
.sh-foot { display: contents; }
.sh-foot > .sh-actions { display: none; }

/* ---------- scheda palestra: un riquadro per esercizio, una riga per serie ---------- */
.vd { font-style: normal; font-weight: 700; }
.vd-alza { --vd: var(--ok); } .vd-ancora { --vd: var(--muted); } .vd-cala { --vd: var(--off); }
i.vd { color: var(--vd); }
.gl-top { display: flex; align-items: center; gap: 8px; }
.gl-prog { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 12.5px; }
.gl-prog svg { width: 14px; height: 14px; }
.gl-prog.is-done { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); border-color: var(--ok); color: color-mix(in srgb, var(--ok) 75%, var(--ink)); }
.gl-key { margin: 6px 0 10px; font-size: 12px; color: var(--muted); }
.gl-key i.vd { margin-left: 6px; }
.gcs { display: flex; flex-direction: column; gap: 10px; }
.gc { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--surface); }
.gc.is-done { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 5%, var(--surface)); }
.gc-head { display: flex; align-items: flex-start; gap: 8px; }
.gc-n { flex: none; min-width: 18px; font: 700 20px/1.1 var(--f-display); color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.gc.is-done .gc-n { color: var(--ok); }
.gc-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc-title b { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
/* il nome: un tocco per correggerlo (js/gym.js renHTML) */
.gc-title .gc-name { display: inline; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gc-nm-e { white-space: nowrap; }
.gc-title .gc-name svg { display: inline-block; width: 13px; height: 13px; margin-left: 6px; vertical-align: -1px; color: var(--muted); }
.gc-name[aria-expanded="true"] svg { color: var(--accent); }
.gc-sw.gc-ren input { flex-basis: 100%; } /* tutto il nome in vista, i tasti sotto */
.gc-title small { font-size: 12px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.gc-flag { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); font-weight: 700; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gc-flag svg { width: 14px; height: 14px; }
.gc-flag.is-part { color: var(--ink); }
.gc-flag.is-done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.gc-tips summary { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 700; color: var(--c); }
.gc-tips summary::-webkit-details-marker { display: none; }
.gc-tips summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: -45deg; transition: rotate .15s; }
.gc-tips[open] summary::before { rotate: 45deg; }
.gc-tips p { margin: 2px 0 0; padding: 8px 10px; max-width: 68ch; border-left: 3px solid var(--c); border-radius: 0 6px 6px 0; background: var(--surface-2); font-size: 13px; line-height: 1.45; }

/* le serie: numero, com'è andata l'ultima volta, kg, ripetizioni, esito */
.gs { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; max-width: 520px; }
.gs-h, .gs-row, .gs-dsub { display: grid; grid-template-columns: 34px 70px minmax(0, 1fr) minmax(0, 1fr) 52px; align-items: stretch; }
/* drop set: le drop sono righe sotto la serie, sempre in vista, con le stesse colonne («3a», «3b») */
.gs-drs { grid-column: 1 / -1; display: flex; flex-direction: column; border-top: 1px dashed color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 5%, var(--surface)); }
.gs-dsub + .gs-dsub { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.gs-row .gs-dsub input { height: 40px; font-size: 16px; }
.gs-dn { display: flex; align-items: center; justify-content: center; font: 700 13px/1 var(--f-display); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gs-doff { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.gs-dadd {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 34px; margin: 6px 8px 8px; padding: 0 12px;
  border: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); border-radius: 99px; background: transparent; color: var(--muted);
  font: 700 12.5px/1 var(--f-body); cursor: pointer;
}
.gs-dadd svg { width: 14px; height: 14px; }
.gs-row.is-done .gs-drs { background: transparent; }
/* rest-pause: i kg sono quelli della serie (non si scrivono) */
.gs-rpkg { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line); font: 600 15px/1 var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; }
/* editor: «Dopo la serie, quanti rest-pause?» */
.gx-rpq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gx-rpq-t { font-size: 13px; font-weight: 700; }
.gx-rpq .chip { min-width: 40px; justify-content: center; }
.gx-rpq-say { flex: 1 1 100%; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.gs-h { background: var(--surface-2); font: 600 10.5px/1 var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.gs-h > span { padding: 7px 2px; text-align: center; }
.gs-row { border-top: 1px solid var(--line); background: var(--surface); }
.gs-row.is-done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.gs-n { display: grid; place-items: center; font: 700 16px/1 var(--f-display); color: var(--muted); }
.gs-row.is-done .gs-n { color: var(--ok); }
.gs-prev { display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; padding: 0 2px; border-left: 1px solid var(--line); font-size: 12px; line-height: 1.2; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.gs-prev > span { white-space: nowrap; } /* «105» e «×11,5▲» vanno a capo insieme, se serve */
.gs-row input {
  min-width: 0; width: 100%; height: 46px; padding: 0 4px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent;
  text-align: center; font: 700 17px/1 var(--f-body); font-variant-numeric: tabular-nums; color: var(--ink);
}
.gs-row input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); font-weight: 500; }
.gs-row input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.gs-v {
  margin: 5px; border: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); border-radius: 7px; background: transparent;
  color: var(--muted); font: 700 18px/1 var(--f-body); cursor: pointer; -webkit-user-select: none; user-select: none;
}
.gs-v[class*="vd-"] { border: 1px solid var(--vd); background: var(--vd); color: var(--surface); }
.gs-v:active { transform: scale(.92); }
.gc-note { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); resize: none; overflow: hidden; line-height: 1.4; }
.gt-tot { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.gt-tot b { color: var(--ink); }
.gc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.gc-rest {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--ink); font: 700 12.5px/1 var(--f-body); font-variant-numeric: tabular-nums; cursor: pointer;
}
.gc-rest svg { width: 15px; height: 15px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-rest:active { transform: scale(.95); }
.gs-row.is-next { box-shadow: inset 4px 0 0 var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.gs-row.is-next .gs-n { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }

/* storico dell'esercizio: l'ultima volta (con la nota) e, aprendo, le volte prima */
.gh { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); max-width: 520px; }
.gh summary { display: flex; flex-direction: column; gap: 4px; padding: 7px 10px; cursor: pointer; list-style: none; }
.gh summary::-webkit-details-marker { display: none; }
.gh-head { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.gh-head svg { flex: none; width: 15px; height: 15px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gh-head b { color: var(--ink); }
.gh-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-head::after { content: ""; flex: none; margin: 0 2px 0 auto; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .15s; }
.gh[open] .gh-head::after { rotate: -135deg; translate: 0 2px; }
.gh q { quotes: "«" "»"; font-size: 13.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.gh-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gh[open] .gh-note { display: none; } /* aperto, la nota si legge per intero nell'elenco */
.gh-list { margin: 0; padding: 0 10px 2px; list-style: none; }
.gh-list li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.gh-d { padding-top: 3px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gh-sets { display: flex; flex-wrap: wrap; gap: 4px; }
.gh-set { display: inline-flex; align-items: baseline; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font: 700 12.5px/1.25 var(--f-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gh-set small { font-size: 12px; font-weight: 600; }
.gh-set small.is-plan { color: var(--muted); font-weight: 500; }
.gh-set i.vd { margin-left: 3px; }
.gh-list q { grid-column: 2; font-size: 13px; }
.gh-trend { margin: 0; padding: 7px 10px 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.gh-trend b { color: var(--ink); }
.gx-pnote { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); quotes: "«" "»"; overflow-wrap: anywhere; }

/* recupero: riquadro incollato in fondo al dettaglio finché conta */
#detailDlg:has(.rest:not([hidden])) { scroll-padding-bottom: 96px; }
.rest {
  position: sticky; bottom: 0; z-index: 3; display: flex; flex-direction: column; gap: 4px;
  padding: 0 20px 10px; background: var(--ink); color: var(--surface); box-shadow: 0 -6px 18px rgb(8 12 16 / .18);
}
.rt-line { height: 4px; margin: 0 -20px 4px; background: color-mix(in srgb, var(--surface) 18%, transparent); }
.rt-line i { display: block; height: 100%; background: var(--c); transform-origin: left; transition: transform .25s linear; }
.rest.is-over { padding-top: 10px; background: var(--ok); color: var(--surface); animation: rt-flash .5s ease-out 3; }
@keyframes rt-flash { 50% { background: color-mix(in srgb, var(--ok) 60%, var(--surface)); } }
.rt-row { display: flex; align-items: center; gap: 10px; }
.rt-t { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.rt-time { font: 700 34px/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.rest.is-soon .rt-time { color: color-mix(in srgb, var(--partial) 55%, var(--surface)); } /* leggibile sulla barra chiara (tema scuro) e su quella scura */
.rt-k { font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.rt-btns { flex: none; display: flex; gap: 6px; }
.rt-btns button {
  min-width: 44px; height: 40px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--surface) 35%, transparent); border-radius: 8px;
  background: transparent; color: inherit; font: 700 16px/1 var(--f-display); font-variant-numeric: tabular-nums; cursor: pointer;
}
.rt-btns button:active { transform: scale(.94); }
.rt-btns .rt-ico { display: grid; place-items: center; min-width: 40px; padding: 0; }
.rt-btns svg { width: 20px; height: 20px; }
.rt-btns [aria-pressed="false"] { opacity: .6; }
.rt-btns .rt-ok { min-width: 64px; background: var(--surface); color: var(--ink); border-color: var(--surface); }
.rt-next {
  display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left;
  font-size: 13px; line-height: 1.3; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.rt-next b { font-weight: 700; }
body.is-typing .rt-next { display: none; }
body:has(#detailDlg[open] .rest:not([hidden])) .toast { translate: 0 -78px; }

/* Oggi: gli allenamenti del giorno, più grandi che sul calendario */
.td-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.td-list { display: flex; flex-direction: column; gap: 10px; }
.td-list .card { padding: 12px; column-gap: 10px; row-gap: 4px; grid-template-columns: 34px minmax(0, 1fr); }
@media (max-width: 820px) { .td-list .card { grid-template-columns: 34px minmax(0, 1fr) auto; } }
.td-list .c-ico { width: 34px; height: 34px; border-radius: 8px; }
.td-list .c-ico svg { width: 21px; height: 21px; }
.td-list .c-title { font-size: 16px; -webkit-line-clamp: 3; }
.td-list .c-big { font-size: 19px; }
.td-list .c-sub { font-size: 13px; }
.td-list .c-desc { font-size: 13px; -webkit-line-clamp: 3; }
.td-empty { margin: 0 0 4px; font-size: 15px; color: var(--muted); }
.f-actions.td-add { margin-top: 14px; }

/* ---------- Corpo: peso ---------- */
.bw-warn { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--partial); border-radius: var(--r); background: color-mix(in srgb, var(--partial) 12%, var(--surface)); font-size: 13px; line-height: 1.45; }
/* quantità di un cibo: numero grande con l'unità dentro il campo */
.fd-g span { font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fd-g input {
  width: 100%; padding: 6px 40px 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 700 30px/1.15 var(--f-display); font-variant-numeric: tabular-nums;
}
.fd-g i { position: absolute; right: 13px; bottom: 12px; font-style: normal; font-weight: 600; color: var(--muted); }
.bw-chart { display: block; width: 100%; max-width: 560px; height: auto; margin-top: 8px; }
.bw-grid { stroke: var(--line); stroke-width: 1; }
.bw-yl, .bw-xl { font: 600 9.5px var(--f-body); fill: var(--muted); }
.bw-yl { text-anchor: end; }
.bw-dot { fill: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.bw-avg { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.bw-none { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.bw-key { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.bw-k-dot { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.bw-k-line { width: 16px; height: 3px; margin-left: 8px; border-radius: 2px; background: var(--accent); }
.bw-hist, .fd-goals { margin-top: 12px; }
.bw-hist summary, .fd-goals summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; color: var(--accent); }
.bw-hist summary::-webkit-details-marker, .fd-goals summary::-webkit-details-marker { display: none; }
.bw-hist summary::before, .fd-goals summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: -45deg; transition: rotate .15s; }
.bw-hist[open] summary::before, .fd-goals[open] summary::before { rotate: 45deg; }
.bw-hist ol { margin: 4px 0 0; padding: 0; list-style: none; max-width: 420px; }
.bw-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 2px 0 2px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.bw-hist li b { font-variant-numeric: tabular-nums; }

/* ---------- Corpo: alimentazione ---------- */
.fd-sum { display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.fd-kcal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.fd-kcal b { font: 700 32px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-kcal span { color: var(--muted); font-weight: 600; }
.fd-kcal em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); }
.fd-kcal em.is-over { color: var(--missed); font-weight: 700; }
.fd-bar { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.fd-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.fd-bar.is-over > i { background: var(--missed); }
.fd-bar-k { height: 9px; }
.fd-ms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fd-m-k { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.fd-m-k span { font: 600 10.5px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fd-m-k b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-m-k small { color: var(--muted); font-weight: 500; }
.fd-meals { display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin-top: 12px; }
.fd-meal { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.fd-meal-h { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 12px; }
.fd-meal-h b { font-size: 14.5px; }
.fd-meal-h span { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-meal-h .fd-add { color: var(--accent); }
.fd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.fd-item > span { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.fd-item b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.fd-item small { font-size: 12px; color: var(--muted); }
.fd-item em { font-style: normal; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-item em::after { content: " kcal"; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.fw { margin-top: 16px; max-width: 520px; }
.fw-k { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.fw-k b { color: var(--ink); }
.fw-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 72px; max-width: 360px; }
.fw-d { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; }
.fw-col { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 56px; }
.fw-col i { display: block; width: 70%; max-width: 28px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.fw-col i.is-over { background: var(--missed); }
.fw-d small { height: 14px; font-size: 10.5px; line-height: 14px; color: var(--muted); }
.fw-d.is-today small { color: var(--ink); font-weight: 700; }
.fw-goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink); opacity: .4; pointer-events: none; }
.fd-g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; max-width: 420px; margin-top: 6px; }
.fd-g-calc { min-height: 1.2em; margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- aggiungi cibo ---------- */
.fd-find, .fd-prod, .fd-man { display: flex; flex-direction: column; gap: 12px; }
/* aria sotto il titolo (due classi: sul telefono .sh-body azzera il padding in alto) */
.sh-body.fd-find { padding-top: 20px; }
/* il codice a barre: una riga intera, nel colore dell'app */
.fd-scan { justify-content: center; gap: 10px; width: 100%; max-width: 520px; min-height: 48px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); font-weight: 600; }
.fd-scan svg { width: 22px; height: 22px; }
.fd-cam { position: relative; overflow: hidden; aspect-ratio: 4 / 3; max-width: 520px; max-height: 52vh; border-radius: var(--r); background: #000; }
.fd-cam video { display: block; width: 100%; height: 100%; object-fit: cover; }
.fd-aim { position: absolute; inset: 30% 7%; border: 2px solid rgb(255 255 255 / .9); border-radius: 10px; box-shadow: 0 0 0 999px rgb(0 0 0 / .35); }
.fd-cam-msg { position: absolute; top: 10px; left: 0; right: 0; margin: 0; padding: 0 12px; color: #fff; font-size: 13px; font-weight: 600; text-align: center; text-shadow: 0 1px 3px rgb(0 0 0 / .8); }
.fd-cam-x { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }
.fd-q { display: flex; gap: 8px; max-width: 520px; }
.fd-q input { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
#fdLists { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.fd-h { margin: 8px 0 0; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fd-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; text-align: left; cursor: pointer; }
.fd-row > span { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.fd-row b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.fd-row small { font-size: 12px; color: var(--muted); }
.fd-row svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.fd-msg { margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; line-height: 1.45; }
.fd-more { justify-content: center; white-space: normal; }
.fd-per { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.fd-per b { color: var(--ink); }
.fd-g { display: flex; flex-direction: column; gap: 4px; position: relative; max-width: 220px; }
.fd-chips, .fd-meals-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-tot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; max-width: 520px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.fd-tot b { grid-column: 1 / -1; font: 700 30px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-tot b small { font-size: 15px; color: var(--muted); }
.fd-tot span { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.fd-tot span small { font: 600 10.5px/1.3 var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fd-foot { justify-content: space-between; }
.linkish { padding: 2px 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* «Quante fette?» */
.fd-n { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fd-n-k { flex: 1 0 100%; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fd-step { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.fd-step .icon-btn { width: 50px; height: 54px; border-radius: 0; font: 600 26px/1 var(--f-body); color: var(--accent); }
.fd-step input { width: 76px; border: 0; border-inline: 1px solid var(--line); background: transparent; text-align: center; font: 700 30px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-n-g { font-size: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-unit { margin: 0; font-size: 13px; color: var(--muted); }
.fd-ue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 14px; }
.fd-ue select, .fd-ue input { min-height: 38px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.fd-ue input { width: 76px; text-align: center; }
/* piatto scritto a parole */
.fd-mealcard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 1px solid var(--accent); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: inherit; text-align: left; cursor: pointer; }
.fd-mealcard > span { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.fd-mealcard small { font: 600 10.5px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.fd-mealcard b { font-size: 14px; overflow-wrap: anywhere; }
.fd-mealcard em { font-style: normal; font-size: 12px; color: var(--muted); }
.fd-mealcard strong { flex: none; font: 700 20px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-mealcard strong small { font: 600 12px var(--f-body); text-transform: none; letter-spacing: 0; color: var(--muted); }
.fd-mix { display: flex; flex-direction: column; max-width: 520px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.fd-mix-r { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px 34px; align-items: center; gap: 8px; padding: 8px 4px 8px 12px; border-top: 1px solid var(--line); }
.fd-mix-r:first-child { border-top: 0; }
.fd-mix-name { display: flex; flex-direction: column; min-width: 0; }
.fd-mix-name b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.fd-mix-name small { font-size: 11.5px; color: var(--muted); }
.fd-mix-q { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.fd-mix-q input { width: 56px; min-height: 36px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-mix-r em { font-style: normal; font-weight: 700; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.fd-mix-r .icon-btn { width: 32px; height: 32px; }
.fd-man-k { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

/* editor: una scheda per esercizio, una riga per serie */
.gx { display: flex; flex-direction: column; gap: 8px; }
.gx-ex { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--surface-2); }
.gx-top { display: flex; align-items: center; gap: 6px; }
.gx-num { flex: none; width: 20px; text-align: center; font: 700 19px/1 var(--f-display); color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.gx-name { flex: 1 1 auto; min-width: 0; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-weight: 700; }
.gx-name:focus, .gx-rest input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.gx-tools { display: inline-flex; flex: none; }
.gx-tools .icon-btn { width: 32px; height: 32px; }
.gx-tools .icon-btn svg { width: 16px; height: 16px; }
.gx-sets { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); max-width: 460px; }
.gx-sh, .gx-set { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 40px; align-items: center; }
.gx-sh { background: var(--surface-2); font: 600 10.5px/1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gx-sh > span { padding: 7px 4px; text-align: center; }
.gx-set { border-top: 1px solid var(--line); }
/* sopra la colonna del carico: «Kg | %» (in % del massimale) */
.gx-sh > .gx-uh { padding: 3px 4px; }
.gx-u { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.gx-u button {
  min-width: 34px; min-height: 26px; padding: 0 9px; border: 0; border-radius: 99px; background: transparent; color: var(--muted);
  font: 700 11.5px/1 var(--f-display); letter-spacing: .04em; cursor: pointer;
}
.gx-u button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.gx-u button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* in %: il massimale da cui vengono i kg, da scrivere sul posto */
.gx-1rm {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 460px; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--strength) 35%, var(--line)); border-radius: 8px;
  background: color-mix(in srgb, var(--strength) 6%, var(--surface));
}
.gx-1rm-t { display: flex; flex: 1 1 110px; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.gx-1rm-t b { margin-right: 4px; font: 700 12px/1.2 var(--f-display); letter-spacing: .06em; color: color-mix(in srgb, var(--strength) 80%, var(--ink)); }
.gx-1rm-t small { font-size: 11.5px; color: var(--muted); }
.gx-1rm-in { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.gx-1rm-in:focus-within { border-color: var(--accent); }
.gx-1rm-in input { width: 4em; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 700 16px/1.2 var(--f-body); font-variant-numeric: tabular-nums; text-align: right; }
.gx-1rm-in input.is-bad { color: var(--missed); }
.gx-1rm-in em { font-style: normal; font-size: 12px; color: var(--muted); }
.gx-n { text-align: center; font: 700 16px/1 var(--f-display); color: var(--muted); }
.gx-set input {
  min-width: 0; width: 100%; height: 40px; padding: 0 6px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent;
  text-align: center; font: 700 16px/1 var(--f-body); font-variant-numeric: tabular-nums;
}
.gx-set input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.gx-set .icon-btn { justify-self: center; width: 34px; height: 34px; }
.gx-set .icon-btn svg { width: 14px; height: 14px; }
.gx-set .icon-btn:disabled { opacity: .25; cursor: default; }
.gx-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 460px; }
.gx-rest { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gx-rest input { width: 78px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: center; font: 700 15px/1.1 var(--f-body); letter-spacing: 0; color: var(--ink); }
.gx-more { border-top: 1px dashed var(--line); }
.gx-more summary { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; list-style: none; font-weight: 700; font-size: 13px; }
.gx-more summary::-webkit-details-marker { display: none; }
.gx-more summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 4px; border: solid var(--muted); border-width: 0 2px 2px 0; rotate: -45deg; transition: rotate .15s; }
.gx-more[open] summary::before { rotate: 45deg; }
.gx-more summary em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.gx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.gx-prev { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.gx-use { min-height: 30px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 99px; background: transparent; color: var(--accent); font-weight: 700; font-size: 12px; cursor: pointer; }
.gx + .ed-add { margin-top: 8px; }
.gx-adds { flex-wrap: wrap; }
.gx-adds [aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.gx-pick { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.gx-pick .hint { margin: 0 0 6px; }
.gx-pick ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 0; padding: 0; }
.gx-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 7px 10px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; }
.gx-pick button:hover { border-color: var(--accent); }
.gx-pick b { font-size: 14px; overflow-wrap: anywhere; }
.gx-pick span { font-size: 12px; color: var(--muted); }
.gx-set input.is-auto { color: var(--accent); }
.gx-vs i.vd { margin-right: 1px; }

/* ---------- copia in più giorni: i mesi uno sotto l'altro ---------- */
#copyDlg[open], #importDlg[open] { display: flex; flex-direction: column; }
#copyDlg .sh-body, #importDlg .sh-body { flex: 1 0 auto; }
#cpFoot, #xiFoot { display: contents; } /* il riepilogo resta incollato in fondo allo schermo */
.cp-src { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-size: 13px; color: var(--muted); }
.cp-src b { color: var(--ink); font-size: 14px; }
.cp-src .c-ico { width: 22px; height: 22px; }
.cp-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.cp-k { flex-basis: 100%; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chip { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; }
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .45; cursor: default; }
.chip.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.chip:active, .cp-day:active, .xi-day:active { transform: scale(.95); }
.cp-month h3 { margin: 18px 0 6px; font: 700 19px/1 var(--f-display); letter-spacing: .02em; text-transform: none; color: var(--ink); }
.cp-month h3::first-letter { text-transform: uppercase; }
.cp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; max-width: 520px; }
.cp-dow { padding: 2px 0 4px; text-align: center; font: 600 11px/1 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cp-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 46px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.cp-day b { font: 600 15px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.cp-day.is-past { background: var(--surface-2); color: var(--muted); }
.cp-day.is-today b { color: var(--accent); font-weight: 800; }
.cp-day.is-src { border: 2px solid var(--c); }
.cp-day.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cp-day.is-on.is-today b { color: var(--accent-ink); }
.cp-dots { display: flex; gap: 2px; height: 5px; }
.cp-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cp-day.is-on .cp-dots i { box-shadow: 0 0 0 1px var(--accent-ink); }
/* settimane intere: la riga scelta diventa una fascia */
.cp-months.is-week .cp-grid { column-gap: 0; }
.cp-months.is-week .cp-day { border-radius: 0; border-left-width: 0; }
.cp-months.is-week .cp-grid > :nth-child(7n+1) { border-left-width: 1px; border-radius: 8px 0 0 8px; }
.cp-months.is-week .cp-grid > :nth-child(7n), .cp-months.is-week .cp-day:last-child { border-radius: 0 8px 8px 0; }
.cp-months.is-week .cp-pad + .cp-day { border-left-width: 1px; border-radius: 8px 0 0 8px; }
.cp-months.is-week .cp-day.is-src { border-width: 2px 0; }
.cp-more { display: flex; justify-content: center; margin-top: 16px; }
.cp-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.cp-sum { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; margin: 0; font-size: 12.5px; line-height: 1.4; }
.cp-foot .btn { flex: none; padding: 10px 14px; font-size: 14px; }
.cp-foot .btn:disabled { opacity: .5; cursor: default; }

/* ---------- importazione da Excel ---------- */
.xi-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; }
.xi { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--surface-2); }
.xi-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.xi-head input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.xi-l { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--c); color: var(--surface); font: 700 15px/1 var(--f-display); font-style: normal; }
.xi-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xi-t b { font: 700 17px/1.15 var(--f-display); overflow-wrap: anywhere; }
.xi-t em { font-style: normal; font-size: 12px; color: var(--muted); }
.xi-more summary { padding: 0 10px 8px 74px; font-size: 12.5px; font-weight: 700; color: var(--c); cursor: pointer; }
.xi-ex { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0 10px 10px 74px; font-size: 13px; }
.xi-ex li { overflow-wrap: anywhere; }
.xi-ex small { display: block; font-size: 12px; color: var(--muted); }
.xi:has(input:not(:checked)) { opacity: .5; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.xi-n .chip { min-width: 44px; }
.xi-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 460px; margin-top: 8px; }
.xi-day { height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 700 14px/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.xi-day.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.xi-start { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xi-start input { flex: 0 1 170px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.xi-prev { list-style: none; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; }
.xi-prev li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }
.xi-wk { flex: 0 0 52px; font: 600 12px/1 var(--f-display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.xi-it { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.xi-it .xi-l { width: 20px; height: 20px; font-size: 13px; }
.xi-lib { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; cursor: pointer; }
.xi-lib input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.xi-foot { justify-content: flex-end; }


/* ---------- libreria ---------- */
.lib { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lib-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 140px; gap: 4px 10px; align-items: start;
  padding: 8px 10px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  background: color-mix(in srgb, var(--c) 6%, var(--surface));
}
.lib-item > .c-ico { grid-area: auto; width: 24px; height: 24px; }
.lib-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lib-code { display: block; margin-top: 3px; font-size: 11.5px; white-space: normal; overflow-wrap: anywhere; background: transparent; border: 0; padding: 0; color: var(--muted); }
.lib-prof { color: var(--c); align-self: center; }
.lib-add { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lib-tools .btn { cursor: pointer; }
.lib-tools:has(.vh:focus-visible) .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-add input { width: auto; padding: 4px 8px; }
.sec > h3 + .lib { margin-top: 0; } /* Libreria divisa (miei, dal coach, dagli atleti): l'elenco subito sotto il titolo */

/* ---------- palestra: rest-pause, regolazioni della macchina, esercizio cambiato ---------- */
/* @gym-css */
/* numero della serie: è anche il pulsante del rest-pause («RP» sotto il numero) */
.gs-n { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; align-content: center; gap: 3px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.gs-n small, .gl-rp b { padding: 2px 3px; border-radius: 4px; background: var(--c); color: var(--surface); font: 700 9.5px/1 var(--f-body); letter-spacing: .03em; }
.gs-row.is-rp:not(.is-done) .gs-n { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gs-row.is-done .gs-n small { background: var(--ok); }
.gs-row.is-rp [data-gsr] { cursor: default; }
.gs-row.is-rp [data-gsr]:focus { outline: 0; background: transparent; }
.gl-rp { display: inline-block; margin-left: 10px; }
.gl-rp b { margin-right: 4px; }
/* le mini-serie del rest-pause, sotto la riga della serie */
.gs-rpx { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 8px 8px; border-top: 1px dashed var(--line); }
.gs-rpm, .gs-rpr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.gs-row .gs-rpm input { width: 48px; height: 40px; padding: 0 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 16px; }
.gs-rpp { min-width: 22px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.gs-rpadd { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.gs-rpadd svg { width: 16px; height: 16px; }
.gs-rpr > span { margin-right: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gs-rpr button { min-width: 42px; height: 36px; padding: 0 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font: 700 12.5px/1 var(--f-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.gs-rpr button[aria-pressed="true"] { border-color: var(--c); background: var(--c); color: var(--surface); }
/* meno ripetizioni del minimo previsto: fatta, ma in rosso */
.gs-row.is-under [data-gsr] { color: var(--missed); }
.gs-row.is-done.is-under { background: color-mix(in srgb, var(--missed) 11%, var(--surface)); }
.gs-row.is-done.is-under .gs-n { color: var(--missed); }
.gs-row.is-done.is-under .gs-n small { background: var(--missed); }
.gh-set small.is-under, .gs-prev .is-under { color: var(--missed); }
.gs-prev > span.is-rp { white-space: normal; }
/* regolazioni della macchina: sempre in vista sotto il titolo */
.gc-su { display: flex; align-items: flex-start; gap: 6px; max-width: 520px; }
.gc-su > svg { flex: none; width: 17px; height: 17px; margin-top: 10px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-su-btn {
  display: flex; align-items: flex-start; gap: 7px; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line));
  border-radius: 6px; background: color-mix(in srgb, var(--c) 7%, var(--surface)); color: var(--ink); font: 500 13.5px/1.35 var(--f-body); text-align: left; cursor: pointer;
}
.gc-su-btn svg { flex: none; width: 17px; height: 17px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-su-btn span { min-width: 0; overflow-wrap: anywhere; }
.gc-su-btn b { margin-right: 3px; }
.gc-su-add { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px 0 8px; border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 99px; background: transparent; color: var(--muted); font: 700 12.5px/1 var(--f-body); cursor: pointer; }
.gc-su-add svg { width: 14px; height: 14px; }
.gc-su textarea { flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--c); border-radius: 6px; background: var(--surface); color: var(--ink); resize: none; overflow: hidden; line-height: 1.4; }
.gc-su .btn { flex: none; min-height: 38px; }
/* esercizio cambiato: pulsante accanto al recupero, campo per l'altro esercizio, «Al posto di…» e la domanda della volta dopo */
.gc-tools { display: inline-flex; align-items: center; gap: 5px; }
.gc-tools .gc-rest { min-height: 36px; }
.gc-swap { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: color-mix(in srgb, var(--c) 80%, var(--ink)); cursor: pointer; }
.gc-swap svg { width: 16px; height: 16px; }
.gc-swap[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.gc-swap:active { transform: scale(.95); }
.gc-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 520px; }
.gc-sw input { flex: 1 1 170px; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 700; }
.gc-sw-b, .gc-was-b { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-sw-say { flex: 1 1 100%; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.gc-sw-say b { color: var(--ink); }
.gc-was { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 520px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 13px; line-height: 1.35; }
.gc-was > svg { flex: none; width: 16px; height: 16px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-was > span:not(.gc-was-b) { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.gc-was .btn { max-width: 100%; white-space: normal; text-align: left; }
.gc-was.is-ask { border-color: color-mix(in srgb, var(--partial) 55%, var(--line)); background: color-mix(in srgb, var(--partial) 10%, var(--surface)); }
.gc-was.is-ask .gc-was-b { flex: 1 1 100%; padding-left: 26px; }
/* editor: sotto l'esercizio anche regolazioni ed esercizio cambiato */
.gx-prev > .gx-pnote, .gx-prev > .gx-line { flex: 1 1 100%; }
.gx-line { display: flex; align-items: flex-start; gap: 5px; min-width: 0; line-height: 1.35; }
.gx-line > span { min-width: 0; overflow-wrap: anywhere; }
.gx-line svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.gx-line b { color: var(--ink); }
@media (max-width: 820px) {
  .gc-sw input { font-size: 16px; } /* niente zoom automatico di iPhone */
  .gc-was.is-ask .gc-was-b { padding-left: 0; }
}

/* ---------- calendario: allenamento spostato tenendo premuto col dito ---------- */
/* @drag-css */
/* copia della scheda che segue il dito (R.bindCalendar): sta sopra le barre e non intercetta il dito */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; will-change: transform; }
.drag-ghost .card { margin: 0; transform: scale(1.04); box-shadow: var(--shadow), var(--shadow); animation: drag-lift .15s ease-out; }
@keyframes drag-lift { from { transform: scale(1); box-shadow: none; } }
.drag-to {
  position: absolute; left: 0; bottom: calc(100% + 6px);
  padding: 5px 10px; border-radius: 99px; white-space: nowrap;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700; line-height: 1.2;
}
.drag-ghost.is-low .drag-to { bottom: auto; top: calc(100% + 6px); }
body.is-touchdrag { -webkit-user-select: none; user-select: none; }
/* bordo dello schermo: la barretta si riempie in 0,7 s (EDGE_MS in calendar.js), poi arriva la settimana accanto */
.drag-edge { display: none; position: fixed; z-index: 69; width: 36px; place-items: center; pointer-events: none; color: var(--accent); }
.drag-edge.is-on { display: grid; }
.drag-edge.is-l { left: 0; background: linear-gradient(to right, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
.drag-edge.is-r { right: 0; background: linear-gradient(to left, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
.drag-edge svg { width: 26px; height: 26px; }
.drag-edge::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: var(--accent); transform-origin: top; animation: drag-edge-fill .7s linear; }
.drag-edge.is-l::after { left: 0; }
.drag-edge.is-r::after { right: 0; }
@keyframes drag-edge-fill { from { transform: scaleY(0); } }
/* tablet col dito: tenendo premuto non si seleziona il testo e non si apre il menu */
@media (pointer: coarse) {
  #calendar .card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
@media (max-width: 820px) {
  .wsd.is-drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); outline: 2px dashed var(--accent); outline-offset: 1px; }
}

/* ---------- sonno e obiettivi ---------- */
/* @sleep-css */
/* riga del sonno: luna, ore, qualità e barra verso l'obiettivo (calendario, Oggi, scheda del Riposo) */
.slp {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 26px; padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--rest) 30%, var(--line)); border-radius: 6px;
  background: color-mix(in srgb, var(--rest) 8%, var(--surface)); color: var(--ink); font: inherit; text-align: left;
}
button.slp { cursor: pointer; }
.slp-ico { flex: none; display: grid; place-items: center; color: color-mix(in srgb, var(--rest) 75%, var(--ink)); }
.slp-ico svg { width: 14px; height: 14px; }
.slp b { flex: none; font: 600 14px/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slp em { flex: none; font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.slp-bar { flex: 1 1 24px; min-width: 18px; max-width: 120px; height: 5px; margin-left: auto; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.slp-bar > i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--rest) 80%, var(--ink)); }
.slp-bar.is-low > i { background: var(--partial); }
.c-sleep { grid-area: met; min-width: 0; margin-top: 3px; }
.c-sleep .slp { padding: 0; border: 0; background: transparent; min-height: 20px; }
.td-sleep { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; max-width: 520px; }
.td-sleep > .btn { align-self: flex-start; }
.kcl { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.kcl-k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 13px; color: var(--muted); }
.kcl-k b { font: 700 19px/1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.kcl-k em { margin-left: auto; font-style: normal; font-weight: 600; color: var(--ink); }
.kcl-k em.is-over { color: var(--missed); }
.kcl .fd-meter { height: 14px; }
.kcl .fd-meter > span { font-size: 10.5px; }
.td-sleep .slp { min-height: 40px; padding: 6px 10px; }
.td-sleep .slp b { font-size: 17px; }
.sl-bars { grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; max-width: 420px; margin-top: 14px; }
.fw-col i.sl-b { width: 76%; background: color-mix(in srgb, var(--rest) 75%, var(--surface)); }
.fw-col i.sl-b.is-low { background: var(--partial); }
.sl-k { width: 8px; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--rest) 75%, var(--surface)); }
.bw-k-line.sl-k-goal { height: 0; border-top: 1.5px dashed var(--ink); background: none; opacity: .5; }

/* alimentazione: barra delle calorie, quanto manca */
.fd-kcal em.fd-left { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.fd-kcal em.fd-left b { font: 700 18px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-kcal em.fd-left.is-over { color: var(--missed); }
.fd-meter { position: relative; height: 22px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.fd-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.fd-meter.is-over > i { background: var(--missed); }
.fd-meter > span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12.5px/1 var(--f-body); font-variant-numeric: tabular-nums; color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 6px var(--surface); }
.fd-m-left { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fd-m-left.is-over { color: var(--missed); font-weight: 600; }
.fd-src { margin: 0; font-size: 12px; color: var(--muted); }
.fw-col { position: relative; }
.fw-gt { position: absolute; left: 6%; right: 6%; border-top: 2px solid var(--ink); opacity: .45; pointer-events: none; }

/* Profilo: obiettivi per i giorni di allenamento e di riposo */
.gsets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; max-width: 760px; }
.gset { min-width: 0; margin: 0; padding: 4px 12px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.gset legend { padding: 0 4px; margin-left: -4px; }
.gset.is-off .fd-g-grid, .gset.is-off .fd-g-calc { opacity: .45; }
.gset-off { display: none; margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.gset.is-off .gset-off { display: block; }
.sw { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sw i { position: relative; flex: none; width: 40px; height: 24px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 22%, transparent); transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw b { font-size: 14px; }
.pg-list li { grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; }
.pg-list li b { font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
@media (min-width: 821px) {
  /* colonne strette dei giorni: la barra va sotto */
  .d-items .slp, .c-sleep .slp { flex-wrap: wrap; row-gap: 3px; padding-block: 4px; }
  .d-items .slp-bar, .c-sleep .slp-bar { flex-basis: 100%; max-width: none; margin-left: 0; }
}
@media (max-width: 820px) {
  .slp b { font-size: 15px; }
  .gsets { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- telefono ---------- */
@media (max-width: 820px) {
  dialog.sheet { width: 100%; border-left: 0; box-shadow: none; }
  /* schermate dell'app: coprono il calendario ma non la barra in basso, che resta sempre visibile */
  dialog.sheet:not(:modal) {
    inset: 0 0 calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)) 0;
    width: 100%; height: auto; max-height: none; z-index: 25; /* base: panels.js dà a ogni pagina 25 + il suo posto nella pila */
  }
  body.is-typing dialog.sheet:not(:modal) { bottom: 0; }
  .sh-close { display: none; }
  dialog.sheet:modal .sh-close { display: inline-grid; }
  .ed-tools .icon-btn, .gx-tools .icon-btn { width: 36px; height: 36px; }
  .chip-opt span { padding: 8px 12px; }
  .sh-back { display: inline-grid; margin-left: -10px; width: 40px; height: 40px; color: var(--ink); }
  .sh-back svg { width: 24px; height: 24px; }
  .sh-save { display: inline-flex; margin-left: auto; padding: 7px 13px; font-size: 14px; }
  /* nei moduli con Annulla e Salva fermi in fondo (.ed-foot, più sotto) il «Salva» in alto sarebbe doppio: resta solo
     nelle pagine senza piè di pagina (es. «Fine» di js/health.js) */
  #edForm:has(> .ed-foot) .sh-save, .sh-form:has(> .ed-foot) .sh-save { display: none; }
  .ed-ask { margin-inline: 10px; }
  dialog.sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } }
  /* schede della barra: appaiono; pagine aperte da un'altra: entrano da destra */
  dialog.sheet[open][data-anim="tab"] { animation: screen-tab .16s ease-out; }
  dialog.sheet[open][data-anim="push"] { animation: screen-push .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes screen-tab { from { opacity: 0; } }
  @keyframes screen-push { from { transform: translateX(40px); opacity: .3; } }
  .sh-head { padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px; gap: 6px; border-bottom-width: 2px; }
  .sh-head h2 { font-size: 23px; }
  /* azioni in una griglia fissa: niente file che scorrono di lato */
  .sh-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 0; }
  .sh-actions .btn { flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11.5px; white-space: normal; text-align: center; }
  .sh-actions .btn svg { width: 18px; height: 18px; }
  .sh-body { padding: 0 14px 20px; }
  .sec { padding-top: 12px; }
  /* Annulla (a sinistra) e Salva (a destra) fermi in fondo allo schermo anche sul telefono, come .cp-foot: sotto c'è la
     barra, che copre già l'area dell'indicatore di iPhone; con la tastiera aperta la barra sparisce e la pagina arriva
     in fondo (body.is-typing), quindi lo spazio in più torna. Dentro «Nuova password» il tasto a sinistra è «Più tardi» */
  .ed-foot { justify-content: space-between; padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)); }
  dialog.sheet:not(:modal) .ed-foot { padding-bottom: 8px; }
  body.is-typing dialog.sheet:not(:modal) .ed-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  /* il toast («Modifiche non salvate · Esci senza salvare») sopra il piè fisso, non sopra Annulla/Salva */
  body:has(dialog.sheet[open]:not(.is-parked) > form > .ed-foot) .toast { translate: 0 -60px; }
  /* stessa cosa per il piè del dettaglio e le fasce «Salva esecuzione» / «Manda il check» */
  body.is-typing dialog.sheet:not(:modal) .sh-foot > .sh-actions { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  body.is-typing dialog.sheet:not(:modal) .f-actions.stick { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .ed-foot .btn { padding: 9px 14px; font-size: 14px; }
  .ed-foot .btn.primary { flex: 1 1 auto; max-width: 220px; justify-content: center; }
  /* dettaglio: i tasti in un piè di pagina fermo in fondo, invece che in cima: si arriva a Elimina senza tornare su.
     Elimina per primo (a sinistra), in rosso (.btn.danger); il recupero della palestra (.rest) sta sopra i tasti, nello
     stesso piè di pagina. La pagina è una colonna, così il piè resta in fondo anche con poco contenuto */
  #detailDlg[open] { display: flex; flex-direction: column; }
  #detailDlg > .sh-body { flex: 1 0 auto; }
  #detailDlg .sh-head .sh-actions { display: none; }
  .sh-foot { display: block; position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--line); }
  .sh-foot .rest { position: static; }
  .sh-foot > .sh-actions { display: grid; position: relative; padding: 6px 10px; }
  .sh-foot .btn.danger { order: -1; }
  /* armato («Conferma eliminazione», R.confirmButton): copre tutta la riga, così la scritta ci sta e si tocca bene */
  .sh-foot .btn.is-armed { position: absolute; inset: 6px 10px; z-index: 1; font-size: 14px; }
  /* un campo o una riga portati in vista (tastiera, scrollIntoView) restano sopra il piè di pagina (nel dettaglio: sopra
     il piè dei tasti, alto --sh-foot-h, più la riga «Salva esecuzione» ferma lì sopra) */
  dialog.sheet:has(> form > .ed-foot) { scroll-padding-bottom: 64px; }
  #detailDlg { scroll-padding-bottom: calc(var(--sh-foot-h, 64px) + 56px); }
  /* «Salva esecuzione», «Rimuovi esecuzione», «Manda il check», «Salva per oggi»: la riga dei tasti resta in fondo allo
     schermo finché il suo riquadro non è tutto in vista (come .cp-foot) */
  .f-actions.stick { position: sticky; bottom: 0; z-index: 3; margin: 12px -14px 0; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--line); }
  .sh-body > .f-actions.stick:last-child { margin-bottom: -20px; } /* in fondo alla pagina: attaccata al bordo */
  /* nel dettaglio sta ferma SOPRA il piè dei tasti (.sh-foot), non a cavallo (icone mozzate): --sh-foot-h è la sua
     altezza, misurata da js/detail.js perché cambia col recupero della palestra acceso o no e coi tasti (R.detailActsSync) */
  #detailDlg .f-actions.stick { bottom: var(--sh-foot-h, 0px); }
  .pvc { max-width: none; }
  .hint { font-size: 11.5px; }

  /* niente zoom automatico di iPhone sui campi */
  .fld input, .fld select, .fld textarea, .sheet textarea, .ed-step input, .ed-step select, .lib-add input { font-size: 16px; }
  span.dur-in > input[data-dur-part] { font-size: 16px; }

  .lib-item { grid-template-columns: auto minmax(0, 1fr); }
  .lib-prof { display: none; }
  .lib-add { grid-column: 1 / -1; }
  .lib-add input { flex: 1 1 150px; width: 100%; min-width: 0; }
  .cp-foot { padding-inline: 14px; }
  .rest { padding-inline: 14px; }
  #fdQ, .fd-mix-q input, .fd-ue input, .fd-ue select { font-size: 16px; } /* niente zoom automatico di iPhone */
  .rt-line { margin-inline: -14px; }
  .gx-name, .gx-rest input { font-size: 16px; }
  .zones { font-size: 12px; }
  .zones th, .zones td { padding: 5px 6px; }
  .zones .zchip { margin-right: 0; }
  .zones .zname, .zones td.num .z-u { display: none; }
  .zones th .z-h { display: inline; font: inherit; text-transform: none; letter-spacing: 0; }
}

@media (max-width: 360px) {
  .rpe { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* telefoni stretti: tabella zone più fitta, unità sotto l'intestazione */
@media (max-width: 400px) {
  .gs-h, .gs-row, .gs-dsub { grid-template-columns: 28px 62px minmax(0, 1fr) minmax(0, 1fr) 46px; }
  .gc { padding-inline: 8px; }
  .gs-prev { font-size: 11.5px; }
  .rt-time { font-size: 30px; }
  .rt-btns { gap: 5px; }
  .rt-btns button { min-width: 40px; padding: 0 5px; font-size: 15px; }
  .rt-btns .rt-ico { min-width: 36px; }
  .gx-grid { grid-template-columns: 1fr; gap: 6px; }
  .zones { font-size: 11px; }
  .zones th, .zones td { padding: 5px 3px; }
  .zones th { white-space: normal; vertical-align: bottom; }
  .zones th .z-h { display: block; }
}

@media (max-width: 600px) {
  .f-grid { grid-template-columns: 1fr 1fr; }
  .rpe { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
  .rpe-opt span { width: auto; height: 36px; }

  /* editor */
  .ed-row1 { flex-wrap: nowrap; gap: 8px; }
  .ed-row1 .grow { flex: 1 1 auto; }
  .ed-row1 .fld:not(.grow) { flex: 0 0 148px; }
  /* sport: 9 caselle su due righe, tutte visibili */
  .sport-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .sp-opt span { flex-direction: column; justify-content: center; gap: 1px; width: 100%; padding: 4px 2px 3px; border-radius: 8px; font-size: 11px; }
  .sp-opt span svg { width: 20px; height: 20px; }
  #edPlanSec .f-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ed-step .es-qty input { width: 60px; }
  .ed-step .es-qty select { width: 64px; }
  .ed-step .es-tgt input { width: 62px; }
  .ed-step .es-tgt [data-f="t2"] { width: 54px; }
  .es-main { gap: 6px 10px; }
  .es-foot { flex-wrap: wrap; }
  .ed-step .es-foot input { flex: 1 1 140px; }
  .ed-add4 { grid-template-columns: 1fr 1fr; }
  /* dentro le ripetute c'è meno spazio: campi più stretti, così quantità e ritmo restano su una riga */
  .ed-rep { padding: 6px 4px 6px 6px; }
  .ed-rep-body .ed-step { padding-left: 8px; }
  .ed-rep-body .es-main { gap: 6px 8px; }
  .ed-rep-body .ed-step .es-qty input { width: 56px; padding-inline: 3px; font-size: 16px; }
  .ed-rep-body .ed-step .es-qty select { width: 58px; padding-inline: 3px; font-size: 15px; }
  .ed-rep-body .ed-step .es-tgt input { width: 56px; padding-inline: 2px; font-size: 16px; }
  .ed-rep-body .ed-step .es-tgt [data-f="t2"] { width: 52px; }
  .ed-rep-body .es-qty, .ed-rep-body .es-tgt { gap: 4px; }
  .ed-rep-body { padding-left: 6px; }
  .ed-tools .icon-btn { width: 36px; height: 36px; }
  .ed-tot { gap: 14px; }
  .ed-tot dd { font-size: 19px; }
}

/* ---------- riquadri con un numero (peso, sonno, soglie, obiettivi) ---------- */
/* @qtile-css */
.qt {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px 12px 7px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s;
}
.qt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.qt-in { display: flex; flex-direction: column; gap: 1px; min-width: 0; cursor: text; }
.qt-k { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; font: 600 11px/1.25 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.qt-k > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qt-k em { flex: none; font: 500 12px/1.25 var(--f-body); font-style: normal; text-transform: none; letter-spacing: 0; }
.qt input {
  width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: 700 28px/1.15 var(--f-display); font-variant-numeric: tabular-nums;
}
.qt input:focus, .qt input:focus-visible { outline: none; }
.qt input::placeholder { color: color-mix(in srgb, var(--muted) 50%, transparent); }
.qt-s { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 16px; overflow: hidden; font-size: 11.5px; line-height: 16px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.qt-s .slp-bar { flex: 0 1 44px; min-width: 24px; margin: 0; }
.qt-s > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* ✓ per salvare: compare quando il numero è cambiato */
.qt-ok {
  position: absolute; right: 7px; top: 20px; display: none; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.qt-ok svg { width: 18px; height: 18px; }
.qt.is-dirty .qt-ok { display: grid; }
/* ore di sonno con − e + ai lati (R.qtileHTML step): il numero al centro, il ✓ in fila dopo il + */
.qt-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qt-row .qt-in { flex: 1 1 auto; align-items: center; text-align: center; }
.qt-step .qt-k { justify-content: center; }
.qt-step input { text-align: center; }
.qt-step.is-dirty input { padding-right: 0; }
.qt-step .qt-ok { position: static; flex: none; }
.qt-st {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink); font: 500 24px/1 var(--f-body); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.qt-st:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.qt-st:active { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.qt.is-dirty input { padding-right: 40px; }
.qt.is-flash { animation: qt-flash 1.2s ease-out; }
@keyframes qt-flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); } }
.qts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.qts-1 { grid-template-columns: minmax(0, 200px); }

/* ---------- Corpo: giorno, peso e sonno ---------- */
.dn { display: flex; align-items: center; gap: 4px; max-width: 520px; margin: 0 -6px; }
.dn .icon-btn { width: 38px; height: 38px; color: var(--ink); }
.dn .icon-btn svg { width: 20px; height: 20px; }
.dn .icon-btn:disabled { opacity: .28; cursor: default; }
.dn .icon-btn:disabled:hover { background: transparent; }
.dn-k { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; min-width: 0; padding: 1px 6px 2px; border-radius: 8px; cursor: pointer; }
.dn-k:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dn-k b { font: 700 19px/1.1 var(--f-display); letter-spacing: .01em; }
.dn-k span { max-width: 100%; overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.dn-k input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
.dn-today { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
.bq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.bq .sl-form { display: contents; }
.bq .sl-q { grid-column: 1 / -1; }
.sl-form { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.sl-q { min-width: 0; margin: 0; padding: 0; border: 0; }
.sl-q legend { margin-bottom: 4px; padding: 0; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sl-q .rpe { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.sl-q .rpe-opt span { width: 100%; height: 34px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.sl-q .rpe-opt input:checked + span { background: var(--accent); }

/* andamento: peso oppure sonno */
.tr-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 520px; margin-bottom: 10px; }
.tr-h h3 { margin: 0; }
.sts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.st { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 11px; }
.st + .st { border-left: 1px solid var(--line); }
.st span { overflow: hidden; font: 600 10.5px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.st b { font: 700 19px/1.15 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st b small { font: 500 11.5px var(--f-body); color: var(--muted); }
.st.is-low b { color: color-mix(in srgb, var(--partial) 80%, var(--ink)); }
.seg.tr-rg { display: flex; width: 100%; max-width: 520px; margin-top: 10px; }
.tr-rg button { flex: 1 1 0; padding-inline: 4px; }
.tr .bw-chart { margin-top: 10px; }
.tr .sl-bars { margin-top: 12px; }
.tr .fw { margin-top: 0; }

/* pasti in un solo riquadro, una riga per pasto */
.fd-sum { border-radius: 12px; }
.fd-meals { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-meal { border: 0; border-radius: 0; }
.fd-meal + .fd-meal { border-top: 1px solid var(--line); }
.fd-meal-h { min-height: 44px; }

/* ---------- Profilo: chi sei, poi elenchi a righe ---------- */
.pr-hero {
  display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin-top: 14px; padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 16px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 15%, var(--surface)), var(--surface-2) 75%);
}
.pr-me { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pr-av { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 23px/1 var(--f-display); letter-spacing: .03em; }
.pr-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pr-id b { font: 700 23px/1.1 var(--f-display); overflow-wrap: anywhere; }
.pr-id small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pr-code { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.pr-code span { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); }
.pr-code b { font-size: 19px; letter-spacing: .16em; }
.pr-coach { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.pr-coach svg { flex: none; width: 16px; height: 16px; }
.pr-coach b { color: var(--ink); font-weight: 600; }
.pr-gh { margin: 20px 0 7px 4px; font: 600 13px/1 var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pr-g { display: flex; flex-direction: column; max-width: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pr-g > * { position: relative; }
.pr-g > * + *::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.pr-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 12px;
  border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; list-style: none;
}
.pr-row::-webkit-details-marker { display: none; }
button.pr-row:hover, summary.pr-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
button.pr-row:active, summary.pr-row:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.pr-st { flex-wrap: wrap; cursor: default; }
.pr-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--ic) 17%, var(--surface)); color: var(--ic); }
.pr-ic svg { width: 18px; height: 18px; }
.pr-t { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.pr-t b { font-size: 15px; font-weight: 600; }
.pr-t small { overflow: hidden; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.pr-ch { flex: none; display: grid; color: var(--muted); }
.pr-ch svg { width: 18px; height: 18px; transition: rotate .15s; }
.pr-x[open] .pr-ch svg { rotate: 90deg; }
.pr-row.is-danger .pr-t b { color: var(--missed); }
.pr-row.is-armed { justify-content: center; background: color-mix(in srgb, var(--missed) 14%, transparent); color: var(--missed); font-weight: 700; }
.pr-xb { padding: 0 12px 12px 56px; }
.pr-xb .acc-row input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pr-xb .acc-row input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.pr-note { margin: 0; padding: 0 12px 12px 56px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
/* iPhone: i passi per mettere omnifit sulla schermata Home (js/panels.js) */
.hm-steps { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 2px 0 0 18px; font-size: 13.5px; line-height: 1.45; }
.hm-steps li::marker { font-weight: 700; color: var(--accent); }
.pr-xb .hm-note { padding: 8px 0 0; }
.pr #accErr { max-width: 560px; }
/* colore e aspetto: si vedono subito */
.th-colors { display: flex; gap: 8px; margin-left: auto; }
.th-col { --sw: var(--sw-l); --sw-ink: #fff; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .th-col { --sw: var(--sw-d); --sw-ink: #15120f; } }
:root[data-theme="dark"] .th-col { --sw: var(--sw-d); --sw-ink: #15120f; }
.th-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); color: transparent; }
.th-dot svg { width: 16px; height: 16px; }
.th-col[aria-checked="true"] { box-shadow: 0 0 0 2px var(--sw); }
.th-col[aria-checked="true"] .th-dot { color: var(--sw-ink); }
.th-looks { margin-left: auto; }
.th-looks button { padding-inline: 10px; }

/* Obiettivi: due riquadri (allenamento, riposo) con calorie e macro */
.gl-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; max-width: 760px; }
.gl-h h3 { margin: 0; }
.gl-from { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.gl-from input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.gset { padding: 2px 12px 12px; border-radius: 14px; }
.gset-h { display: flex; justify-content: space-between; width: 100%; min-height: 46px; }
.gset-h b { font-size: 15px; }
.gl-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gl-f .qt { padding: 6px 10px; background: var(--surface); }
.gl-f .qt-kc { grid-column: 1 / -1; }
.gl-f .qt input { font-size: 22px; }
.gset.is-off .gl-f { opacity: .45; }

@media (max-width: 820px) {
  .gl-from input { font-size: 16px; }
  .pr-xb .acc-row input { font-size: 16px; }
}
@media (max-width: 360px) {
  .qt input { font-size: 25px; }
  .qts .qt-k { gap: 3px; }
  .qts .qt-k em { font-size: 11px; }
  .qts .qt { padding-inline: 9px; }
  .th-colors { gap: 5px; }
}

/* ---------- spazio: tutto un po' più fitto (14/10) ---------- */
/* Corpo: il giorno nella riga del titolo */
#bodyDlg .sh-top { flex-wrap: wrap; row-gap: 2px; }
.sh-top .dn { flex: 1 1 200px; max-width: 280px; margin: -4px -8px -4px auto; }
.sh-top .dn-k b { font-size: 18px; }
.sh-top .dn-k span { font-size: 11.5px; }
.sh-top .dn .icon-btn { width: 34px; height: 34px; }
.sh-top .dn-today { min-height: 26px; padding: 0 9px; font-size: 12px; }
/* qualità del sonno: nome e tasti sulla stessa riga (sotto se lo schermo è stretto) */
.sl-q { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sl-qk { flex: none; font: 600 11px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sl-q .rpe { flex: 1 1 250px; min-width: 0; gap: 3px; }
.sl-q .rpe-opt span { height: 32px; font-size: 13.5px; }
/* riquadro delle calorie */
.fd-sum { gap: 8px; padding: 10px 12px; }
.fd-kcal b { font-size: 30px; }
.fd-meter { height: 18px; }
.fd-meter > span { font-size: 11.5px; }
.fd-m-k { margin-bottom: 3px; }
.fd-m-b { display: flex; align-items: center; gap: 5px; min-width: 0; }
.fd-m-b .fd-bar { flex: 1 1 auto; min-width: 20px; }
.fd-m-b .fd-m-left { flex: none; margin: 0; font-size: 11px; }
.fd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.fd-seg button { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.fd-src { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 0 0 0 auto; font-size: 12px; color: var(--muted); }
.fd-meals { margin-top: 8px; }
.fd-meal-h { min-height: 40px; }
.fd-item { padding: 6px 12px; }
.sts .st { padding: 6px 10px; }
.seg.tr-rg { margin-top: 8px; }
/* Profilo più compatto */
.pr-hero { gap: 10px; margin-top: 12px; padding: 12px; }
.pr-av { width: 46px; height: 46px; font-size: 20px; }
.pr-id b { font-size: 21px; }
.pr-code { padding: 3px 3px 3px 12px; }
.pr-code .icon-btn { width: 36px; height: 36px; color: var(--ink); }
.pr-gh { margin: 16px 0 6px 4px; }
.pr-row { gap: 11px; min-height: 50px; padding: 6px 12px; }
.pr-ic { width: 30px; height: 30px; border-radius: 8px; }
.pr-ic svg { width: 17px; height: 17px; }
.pr-g > * + *::before { left: 53px; }
.pr-xb, .pr-note { padding-left: 53px; }
/* riga con un valore a destra (nome, ore di sonno) */
.ir { display: flex; align-items: center; gap: 8px; max-width: 520px; min-height: 48px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: text; }
.ir:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ir b { flex: none; font-size: 15px; font-weight: 600; }
.ir span { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); }
.ir input { width: 4.2em; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: right; font: 700 22px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.ir input.ir-text { flex: 1 1 auto; width: auto; font: 600 16px/1.3 var(--f-body); }
.ir input:focus, .ir input:focus-visible { outline: none; }
.ir em { flex: none; font-style: normal; font-size: 12.5px; color: var(--muted); }
/* obiettivi: calorie e macro in una fila */
.gset { padding: 0 12px 10px; }
.gset-h { min-height: 42px; }
.gl-f { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gl-f .qt-kc { grid-column: auto; }
.gl-f .qt { padding: 5px 8px; }
.gl-f .qt input { font-size: 21px; }
.gsets .fd-g-calc { margin-top: 5px; }
.gsets { margin-top: 10px; }
@media (max-width: 360px) {
  .gl-f .qt { padding-inline: 6px; }
  .gl-f .qt-k { letter-spacing: .04em; }
}
/* il numero scelto resta leggibile anche col «passaggio del dito» che sul telefono resta acceso dopo il tocco */
.chip.is-on:hover:not(:disabled), .chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* pasti fissi */
.fd-meal-h .fd-rep { color: var(--muted); }
.fd-meal-h .fd-rep.is-on { color: var(--accent); }
.fd-meal-h .fd-rep svg { width: 18px; height: 18px; }
.fd-plan { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-top: 1px dashed var(--line); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.fd-plan-t { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 2px 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.fd-plan-t > span { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.fd-plan-t b { font: 600 10.5px/1.3 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.fd-plan-t small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12.5px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.fd-plan-ok { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; }
.fd-plan-ok svg { width: 15px; height: 15px; }
/* pasto fisso: in cima che cosa e per quanto, in colore (cambia a ogni tocco); sotto tre parti col loro nome */
.rt-sum { margin-top: 2px; font-weight: 600; color: color-mix(in srgb, var(--accent) 82%, var(--ink)); }
.rt-sum.is-new { animation: rt-sum .32s ease-out; }
@keyframes rt-sum { from { opacity: .3; transform: translateY(3px); } }
.fd-prod.rt-body { gap: 20px; padding-top: 18px; }
/* i due modi: copiato in un giorno o ripetuto, larghi quanto la pagina */
.seg.rt-mode { display: flex; width: 100%; max-width: 520px; }
.seg.rt-mode button { flex: 1 1 0; min-height: 38px; }
/* i sette giorni dopo: il giorno della settimana piccolo sopra il numero */
.rt-dates .chip { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 48px; line-height: 1.1; }
.rt-dates .chip small { font-size: 10.5px; font-weight: 600; opacity: .75; }
.rt-dates .chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.rt-one { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rt-one .rt-days { align-self: stretch; }
.rt-sec { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.rt-k { margin: 0; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rt-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; max-width: 520px; }
.rt-days .chip { min-width: 0; padding: 0; }
.rt-days .chip[aria-pressed="true"], .rt-days .chip[aria-pressed="true"]:hover:not(:disabled),
.rt-dur .chip[aria-pressed="true"], .rt-dur .chip[aria-pressed="true"]:hover:not(:disabled), .rt-until.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
/* per quanto: le pastiglie vanno a capo; «Fino al…» apre il calendario del telefono (il campo invisibile sopra) */
.rt-dur { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-until { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rt-until input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
@media (prefers-reduced-motion: reduce) { .rt-sum.is-new { animation: none; } }
.fd-plan-ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
/* sul telefono il «passaggio del dito» resta acceso dopo il tocco: un giorno appena spento non deve sembrare acceso */
@media (hover: none) {
  .rt-days .chip[aria-pressed="false"]:hover:not(:disabled), .rt-dur .chip[aria-pressed="false"]:hover:not(:disabled), .fd-cd[aria-pressed="false"]:hover:not(:disabled) { border-color: var(--line); color: inherit; }
}
/* giorni dopo oggi: «In programma» sopra l'obiettivo, e la copia del piano su altri giorni */
.bs-pl { font: 600 10.5px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.fd-copy { max-width: 520px; margin: 8px 0 0; }
.fd-copy .btn svg { width: 15px; height: 15px; }
.fd-copy [data-fd-copy] { color: var(--accent); }
.fd-copy.is-open { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-copy-k { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.fd-cdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.fd-cd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 46px; padding: 3px 0; border-radius: 10px; }
.fd-cd small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.fd-cd b { font: 700 16px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fd-cd[aria-pressed="true"] small { color: inherit; }
.fd-copy-f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.fd-copy-f [data-fd-copy] { color: var(--muted); }
.fd-copy-f .btn:disabled { opacity: .5; cursor: default; }
.fd-copy-f .btn.primary:disabled:hover { background: var(--accent); }

/* ---------- salute del giorno: risvegli, ore volute, stress, infortuni ---------- */
.bq .st-q, .bq .sl-x, .bq .hu-line { grid-column: 1 / -1; }
.sl-x { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.sl-wk { display: flex; align-items: center; gap: 4px; }
.sl-wk .sl-qk { margin-right: 4px; }
.sl-wk .icon-btn { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); font: 600 18px/1 var(--f-body); color: var(--accent); }
.sl-wk b { min-width: 24px; text-align: center; font: 700 17px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.sl-w { display: flex; align-items: center; gap: 6px; margin-left: auto; cursor: text; }
.sl-w input { width: 4.8em; height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); text-align: center; font: 700 16px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.sl-w input:focus { border-color: var(--accent); outline: none; }
.sl-w em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.st-q { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.st-q .rpe { display: grid; flex: 1 1 250px; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; min-width: 0; }
.st-q .rpe-opt span { width: 100%; height: 32px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.st-q .st-lo input:checked + span { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.st-q .st-mid input:checked + span { background: var(--partial); border-color: var(--partial); color: #1b1300; }
.st-q .st-hi input:checked + span { background: var(--missed); border-color: var(--missed); color: var(--surface); }
.hu-line { display: flex; align-items: flex-start; gap: 8px; }
.hu-line > .sl-qk { padding-top: 10px; }
.hu-cs { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.hu-c, .hu-add { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.hu-c svg, .hu-add svg { flex: none; width: 15px; height: 15px; }
.hu-c span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hu-c { border-color: color-mix(in srgb, var(--missed) 40%, var(--line)); background: color-mix(in srgb, var(--missed) 9%, var(--surface)); }
.hu-c svg { color: var(--missed); }
.hu-c.sev-1 { border-color: color-mix(in srgb, var(--off) 40%, var(--line)); background: color-mix(in srgb, var(--off) 9%, var(--surface)); }
.hu-c.sev-1 svg { color: var(--off); }
.hu-add { border-style: dashed; background: transparent; color: var(--accent); }
.hu-w { margin-bottom: 10px; }
.btn.hurt-btn { border-color: color-mix(in srgb, var(--missed) 40%, var(--line)); color: var(--missed); }
.btn.hurt-btn svg { color: var(--missed); }
.dn-top { display: flex; margin-bottom: 12px; }
.st-d .st-q, .hu-d .hu-cs { max-width: 520px; }
.hu-d .hurt-btn { margin-top: 2px; }

/* calendario: infortuni del giorno e segni sulle schede */
.hu-day { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 28px; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--missed) 35%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--missed) 8%, var(--surface)); color: var(--ink); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.hu-day svg { flex: none; width: 14px; height: 14px; color: var(--missed); }
.hu-day span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hu-day em { margin-left: auto; font-style: normal; color: var(--muted); }
.hu-day.sev-1 { border-color: color-mix(in srgb, var(--off) 35%, var(--line)); background: color-mix(in srgb, var(--off) 8%, var(--surface)); }
.hu-day.sev-1 svg { color: var(--off); }
.c-warn, .c-hurt, .c-swap { display: inline-flex; flex: none; align-items: center; }
.c-warn svg, .c-hurt svg, .c-swap svg { width: 15px; height: 15px; }
.c-warn { color: var(--off); }
.c-hurt { color: var(--missed); }
.c-swap { color: var(--muted); }
.wsd-bars i.wsd-hurt { align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--missed); }

/* pagina dell'allenamento: allenamento cambiato, avviso della settimana dopo */
.sw-warn, .sw-was { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 620px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; }
.sw-warn { border: 1px solid color-mix(in srgb, var(--off) 50%, var(--line)); background: color-mix(in srgb, var(--off) 12%, var(--surface)); }
.sw-warn > svg { flex: none; width: 20px; height: 20px; color: var(--off); }
.sw-warn > span:not(.sw-b) { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.sw-b { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 6px; padding-left: 30px; }
.sw-b .btn { max-width: 100%; white-space: normal; text-align: left; }
.sw-warn.is-ex { border-color: color-mix(in srgb, var(--partial) 50%, var(--line)); background: color-mix(in srgb, var(--partial) 12%, var(--surface)); }
.sw-warn.is-ex > svg { color: var(--partial); }
.sw-was { border: 1px solid var(--line); background: var(--surface-2); }
.sw-was > svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.sw-was > span { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.gc-was.is-ask > svg { color: var(--off); }
@media (max-width: 420px) { .sw-b { padding-left: 0; } }

/* Nuovo: tre gruppi di riquadri */
.nw { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.nw-day { position: relative; display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); font-size: 14px; cursor: pointer; }
.nw-day span { color: var(--muted); }
.nw-day svg { width: 14px; height: 14px; color: var(--muted); }
.nw-day input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
.nw-g h3 { margin: 0 0 8px; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.nw-t { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 80px; padding: 10px 4px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nw-t:active { transform: scale(.97); }
.nw-i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: var(--surface); }
.nw-i svg { width: 22px; height: 22px; }
.nw-l { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-stress { --c: var(--partial); }
.s-hurt { --c: var(--missed); }
.s-weight { --c: var(--accent); } /* come la linea del peso in Health */
.s-steps { --c: var(--ok); }
.nw-more { display: flex; justify-content: center; }

/* infortunio */
.hu-f .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hu-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.hu-row input { flex: 1 1 160px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 16px; }
.hu-seg, .hu-f .seg { flex: none; }
.hu-stop { margin-top: 10px; }
.hu-f textarea { width: 100%; max-width: 560px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px; resize: vertical; }

/* Cambia e Promemoria */
.chg-k { margin: -2px 0 8px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.chg-k svg { width: 13px; height: 13px; vertical-align: -2px; }
.chg .sw-was { margin-bottom: 4px; }
.sw-row { cursor: pointer; }
.sw-row .sw { margin-left: auto; min-height: 0; }
.rm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 620px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--partial) 40%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--partial) 8%, var(--surface)); }
.rm-k { display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; font: 600 11px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-k svg { width: 15px; height: 15px; color: var(--partial); }
.rm-c { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; max-width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.rm-c svg { flex: none; width: 15px; height: 15px; color: var(--accent); }
.rm-c span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bottombar .bb.has-dot { position: relative; }
.bottombar .bb.has-dot::after { content: ""; position: absolute; top: 6px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--missed); box-shadow: 0 0 0 2px var(--surface); }

/* cibo: cosa mangiare per arrivare all'obiettivo, allergeni, dove si arriva */
.fd-sug { max-width: 520px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-sug > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; cursor: pointer; list-style: none; }
.fd-sug > summary::-webkit-details-marker { display: none; }
.fd-sug > summary svg { flex: none; width: 18px; height: 18px; color: var(--accent); }
.fd-sug > summary span { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.fd-sug > summary em { flex: none; font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-sug[open] > summary { border-bottom: 1px solid var(--line); }
.sg-meals { display: flex; margin: 10px 12px 0; }
.sg-meals button { flex: 1 1 auto; padding-inline: 6px; }
.sg-t { margin: 8px 12px 0; font-size: 12.5px; color: var(--muted); }
.sg-t b { color: var(--ink); }
.sg-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 4px; }
/* nel piano dei pasti (js/diet.js planHTML) elenco e riga del totale sono già dentro il riquadro: senza rientro (lì c'è ancora lo stesso in linea) */
#planDlg .sg-list { padding-inline: 0; }
#planDlg .sg-t { margin-inline: 0; }
.sg-o { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.sg-it { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 13.5px; }
.sg-it b { font-variant-numeric: tabular-nums; }
.sg-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sg-m { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-m b { color: var(--ink); }
.sg-f .btn { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.sg-f .btn svg { width: 14px; height: 14px; }
.sg-foot { margin: 4px 12px 10px; font-size: 12.5px; color: var(--muted); }
.sg-none { margin: 0; font-size: 13px; color: var(--muted); }
.sg-over { display: flex; align-items: center; gap: 8px; max-width: 520px; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--missed) 10%, var(--surface)); font-size: 13px; }
.sg-over svg { flex: none; width: 18px; height: 18px; color: var(--missed); }
.fd-al { display: flex; align-items: flex-start; gap: 8px; max-width: 520px; margin: 0; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--missed) 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--missed) 10%, var(--surface)); font-size: 13.5px; line-height: 1.4; }
.fd-al svg { flex: none; width: 18px; height: 18px; color: var(--missed); }
.fd-al.is-maybe { border-color: color-mix(in srgb, var(--partial) 45%, var(--line)); background: color-mix(in srgb, var(--partial) 10%, var(--surface)); }
.fd-al.is-maybe svg { color: var(--partial); }
.fd-al-mk { display: inline-flex; margin-right: 4px; vertical-align: -2px; color: var(--missed); }
.fd-al-mk.is-maybe { color: var(--partial); }
.fd-al-mk svg { width: 14px; height: 14px; }
.fd-after { display: flex; grid-column: 1 / -1; align-items: center; gap: 6px; margin: 2px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.fd-after b { color: var(--ink); }
.fd-after.is-over, .fd-after.is-over b { color: var(--missed); }
.fd-after svg { flex: none; width: 16px; height: 16px; }

/* allergie e preferenze */
.dt .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-st { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
.dt .fd-h { margin: 12px 0 6px; }
.dt-f { display: inline-flex; align-items: center; gap: 4px; }
.dt-f svg { width: 13px; height: 13px; }
.dt-f.is-like { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.dt-f.is-no { border-color: color-mix(in srgb, var(--missed) 45%, var(--line)); color: var(--missed); text-decoration: line-through; }
.dt-f.is-off { opacity: .4; }
.dt .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* dopo la revisione: pulsanti che vanno a capo, toccabili, lampeggio, promemoria con la × */
.sw-was .btn { max-width: 100%; white-space: normal; text-align: left; }
.sg-foot .linkish { display: inline-flex; align-items: center; min-height: 36px; }
.hu-day { min-height: 32px; }
.st-q.is-flash, .fd-meals.is-flash { animation: qt-flash 1.2s ease-out; }
.st-d .sl-qk { display: none; }
.rm-i { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.rm-i .rm-c { border: 0; background: transparent; padding-right: 4px; }
.rm-x { display: grid; place-items: center; width: 32px; border: 0; border-left: 1px solid var(--line); border-radius: 0 99px 99px 0; background: transparent; color: var(--muted); cursor: pointer; }
.rm-x svg { width: 13px; height: 13px; }
#remDlg .sh-body { padding-top: 12px; }

/* risvegli scritti; «Ho dovuto fermarmi» su una riga sua */
.sl-x .sl-wk { margin-left: 0; }
.sl-x .sl-wk input { width: 3em; }
.hu-stop { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 420px; min-height: 48px; margin-top: 12px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.hu-stop .sw { min-height: 0; }

/* ricette, equivalenze, dove mangi */
.fd-mix-r.rt-r { grid-template-columns: minmax(0, 1fr) auto 44px 32px 32px; }
.fd-mix-r .icon-btn.is-on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.rt-eq { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 10px; }
.rt-eq .chip b, .fd-eq .chip b { font-variant-numeric: tabular-nums; }
.fd-eq { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.fd-mix-add { align-self: flex-start; }
.fd-por { display: flex; flex-direction: column; gap: 6px; }
.fd-por .fd-chips { align-items: center; }
.fd-recsave { max-width: 520px; margin-top: 0; }
.sg-modes { display: flex; margin: 8px 12px 0; }
.sg-modes button { flex: 1 1 auto; padding-inline: 6px; }
.sg-tip { margin: -2px 0 0; font-size: 12px; font-style: italic; color: var(--muted); }

.fd-por-g { display: inline-flex; flex: none; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.fd-por-g input { width: 4.2em; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: right; font: 600 16px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.fd-por-g input:focus { outline: none; }
.fd-por-g:focus-within { border-color: var(--accent); }
.fd-por-g i { font-style: normal; font-size: 13px; color: var(--muted); }
/* «Con questo arrivi a…» dentro il riquadro dei totali: il grassetto resta piccolo */
.fd-tot .fd-after b { grid-column: auto; font: 700 12.5px/1.3 var(--f-body); }
.fd-tot .fd-after span { display: inline; font: 400 12.5px/1.35 var(--f-body); color: inherit; }
.fd-tot .fd-after b { display: inline; }

/* Nuovo su misura: riquadri grandi, nascosti, e i tasti per cambiarli */
.nw-c { position: relative; display: flex; min-width: 0; }
.nw-c > .nw-t { flex: 1 1 auto; }
.nw-c.is-big { grid-column: span 2; }
.nw-c.is-big .nw-t { flex-direction: row; justify-content: flex-start; gap: 12px; padding-inline: 14px; font-size: 14.5px; }
.nw-c.is-big .nw-i { width: 46px; height: 46px; }
.nw-t { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.nw.is-edit .nw-t { animation: nw-wiggle .32s ease-in-out infinite alternate; }
.nw.is-edit .nw-c:nth-child(2n) .nw-t { animation-delay: -.16s; }
@keyframes nw-wiggle { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .nw.is-edit .nw-t { animation: none; } }
.nw-c.is-hidden .nw-t { opacity: .38; }
.nw-x, .nw-z { position: absolute; top: -7px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid var(--bg); border-radius: 50%; background: var(--ink); color: var(--bg); cursor: pointer; }
.nw-x { left: -7px; }
.nw-z { right: -7px; }
.nw-x b { font: 700 17px/1 var(--f-body); margin-top: -2px; }
.nw-x svg, .nw-z svg { width: 13px; height: 13px; }
.nw-c.is-hidden .nw-x { background: var(--accent); color: var(--accent-ink); }
.nw-z[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.nw.is-edit .nw-grid { padding-top: 6px; }
.ed-fixed { display: flex; align-items: center; gap: 8px; }
.ed-fixed .c-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c); color: var(--surface); }
.ed-fixed .c-ico svg { width: 18px; height: 18px; }
.nw.is-edit .nw-grid { gap: 14px 16px; }

.fd-cooked { margin: 2px 0 4px; }
.fd-cooked span { font-size: 12.5px; color: var(--muted); }
.nw-c.is-big .nw-i { flex: none; }

/* tapis roulant e cyclette */
/* editor: stessa scelta a segmenti, fatta con i radio */
.wh-seg .wh-opt { position: relative; display: flex; }
.wh-seg .wh-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.wh-seg .wh-opt span { padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.wh-seg .wh-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 14%, transparent); }
.wh-seg .wh-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.wh-seg button { white-space: nowrap; }
/* dettaglio: la scelta in cima e il riquadro con pendenza e convertitori */
#whSec { display: flex; flex-direction: column; gap: 8px; }
.wh-p { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.wh-row { display: flex; align-items: center; gap: 8px 10px; }
.wh-k { font: 600 12px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.wh-step { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.wh-step .icon-btn { width: 38px; height: 38px; border-radius: 0; font: 600 22px/1 var(--f-body); color: var(--accent); }
.wh-step .icon-btn:disabled { opacity: .35; cursor: default; }
.wh-step b { display: grid; place-items: center; min-width: 52px; border-inline: 1px solid var(--line); font: 700 20px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.wh-u { margin-left: auto; flex: none; }
.wh-u button { padding: 6px 9px; font-size: 12.5px; }
.wh-note { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.wh-note b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-conv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; }
.wh-conv span { color: var(--muted); }
.wh-g { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.wh-conv input { width: 60px; min-height: 36px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); text-align: center; font: 700 15px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.wh-conv input.wh-sm { width: 46px; }
.wh-conv input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.wh-conv b { font: 700 18px/1.2 var(--f-display); color: color-mix(in srgb, var(--c) 72%, var(--ink)); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* «Cosa fare»: il passo piccolo dopo la velocità, cadenza e fatica sotto i watt */
.do-tgt .wh-pace { margin-left: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-cad { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* palestra: esercizio in più */
.ga { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.ga-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 14px;
  border: 1px dashed color-mix(in srgb, var(--c) 55%, var(--line)); border-radius: var(--r); background: transparent;
  color: color-mix(in srgb, var(--c) 80%, var(--ink)); font: 700 13.5px/1 var(--f-body); cursor: pointer;
}
.ga-open svg { width: 16px; height: 16px; }
.ga-open:active { transform: scale(.98); }
.ga.is-open { padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--surface-2); }
.ga-last { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ga-last > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ga-last .chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; text-align: left; }
.ga-last .chip small { font-weight: 600; color: var(--muted); white-space: nowrap; }
.ga-name { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 700; }
.ga-name:focus, .ga-reps input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.ga-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ga-set, .ga-reps { display: inline-flex; align-items: center; gap: 8px; }
.ga-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ga-step { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.ga-step .icon-btn { width: 40px; height: 40px; border-radius: 0; font: 600 21px/1 var(--f-body); color: var(--accent); }
.ga-step .icon-btn:disabled { opacity: .3; pointer-events: none; }
.ga-step output { display: grid; place-items: center; min-width: 34px; border-inline: 1px solid var(--line); font: 700 17px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.ga-reps input { width: 72px; min-height: 42px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: center; font: 700 16px/1.1 var(--f-body); }
.ga-b { display: flex; flex-wrap: wrap; gap: 6px; }
/* «In più» accanto al nome (scheda e editor), cestino al posto del cambio, serie in più o in meno */
.gc-x {
  display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 99px; vertical-align: 2px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--ink));
  font: 700 10.5px/1.2 var(--f-body); text-transform: uppercase; letter-spacing: .05em;
}
.gx-ex > .gc-x { align-self: flex-start; margin-left: 0; }
.gc-rm { color: var(--muted); }
.gc-xs { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-xs .btn:disabled { opacity: .4; pointer-events: none; }
@media (max-width: 820px) {
  .ga-name { font-size: 16px; } /* niente zoom automatico di iPhone */
}

/* tapis roulant e cyclette sul telefono */
@media (max-width: 820px) {
  .wh-conv input { font-size: 16px; } /* niente zoom automatico di iPhone */
}
/* cyclette: velocità e pendenza affiancate, i watt sotto */
.wh-cy { gap: 8px 18px; }
.wh-f { display: flex; flex-direction: column; gap: 4px; }
.wh-cy #whCyOut { flex-basis: 100%; }
/* telefono stretto: in cima solo lo sport, così la data resta intera (dove si fa è nella scelta sotto) */
@media (max-width: 560px) {
  .sh-wh { display: none; }
}

/* Corpo: riepilogo in alto, riquadri e pasti a scomparsa */
.bq.bs { display: block; max-width: 520px; }
.bs-card { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
/* calorie: anello con le mangiate al centro, accanto l'obiettivo e quanto manca */
.bs-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bs-ring { position: relative; flex: none; width: 88px; height: 88px; }
.bs-ring svg { display: block; width: 100%; height: 100%; }
.bs-ring circle { fill: none; stroke-width: 8; }
.bs-ring-bg { stroke: color-mix(in srgb, var(--ink) 9%, transparent); }
.bs-ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .3s ease; }
.bs-ring.is-over .bs-ring-fg { stroke: var(--missed); }
.bs-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bs-ring-c b { font: 700 22px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.bs-ring-c small { margin-top: 2px; font-size: 11px; line-height: 1; color: var(--muted); }
.bs-kc { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bs-of { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.bs-left { font-style: normal; font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.bs-left b { font: 700 22px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.bs-left.is-over { color: var(--missed); }
.bs-top .fd-kcal b { font-size: 30px; }
/* quattro riquadri piccoli: peso, sonno, stress, infortuni */
.bs-ts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bs-t {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-width: 0; min-height: 54px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.bs-k { max-width: 100%; overflow: hidden; font: 600 10.5px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.bs-v { max-width: 100%; overflow: hidden; font: 700 19px/1.1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.bs-v small { font: 500 11.5px var(--f-body); color: var(--muted); }
/* niente segnato quel giorno: bordo tratteggiato e valore spento */
.bs-t.is-empty { border-style: dashed; background: transparent; }
.bs-t.is-empty .bs-v { font-size: 16px; font-weight: 500; color: var(--muted); }
.bs-t[aria-expanded="true"] { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.bs-t[aria-expanded="true"] .bs-k { color: var(--accent); }
.bs-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* il modulo del riquadro aperto, sotto i quattro */
.bs-p { min-width: 0; }
.bs-p[hidden] { display: none; }
.bq.bs .sl-form { display: flex; max-width: none; }
#bsPt .sl-qk, #bsPh .hu-line > .sl-qk { display: none; } /* il nome è già sul riquadro */
/* qualità del sonno: il nome sopra, così i dieci tasti hanno tutta la larghezza (come lo stress) */
.bq.bs .sl-q .rpe { flex-basis: 100%; }
/* in fondo: che giorno è e da dove viene l'obiettivo, in piccolo */
.bs-card .fd-foot { padding-top: 8px; border-top: 1px solid var(--line); }
.bs-card .fd-seg button { min-height: 26px; padding: 2px 9px; font-size: 12px; }
.bs-card .fd-src { font-size: 11.5px; }
/* al telefono tipo di giorno e collegamenti restano facili da toccare */
@media (max-width: 820px) {
  .bs-card .fd-seg button { min-height: 36px; }
  .bs-card .fd-src .linkish { display: inline-flex; align-items: center; min-height: 36px; }
}
/* telefono: riquadri un po' più fitti, così «7h10 · 10» o «100,5 kg» stanno interi */
@media (max-width: 400px) {
  .bs-ts { gap: 5px; }
  .bs-t { padding-inline: 6px; }
  .bs-v { font-size: 17px; }
  .bs-v small { font-size: 10.5px; }
}
@media (max-width: 340px) {
  .bs-ts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* pasti: una riga ciascuno (nome, calorie, ›), i cibi si aprono con un tocco; i previsti restano sempre in vista */
.fd-meal-h { gap: 6px; padding-left: 0; } /* il › lontano da ⇄ e + */
.fd-meal-h .fd-meal-t {
  display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; min-height: 44px; margin: 0; padding: 5px 10px 5px 12px;
  border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; text-align: left;
}
.fd-meal-h button.fd-meal-t { cursor: pointer; }
.fd-meal-h .fd-meal-n { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; margin: 0; font-size: inherit; color: var(--ink); }
.fd-meal-s { overflow: hidden; font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.fd-meal.is-open .fd-meal-s { display: none; }
.fd-meal-h .fd-meal-k { flex: none; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* sotto le calorie del pasto, piccoli, i suoi macro (js/body.js: lì c'è ancora lo stesso stile in linea, MACRO_CSS) */
.fd-meal-m { display: block; margin-top: 1px; font-size: 11px; font-weight: 500; line-height: 1.2; color: var(--muted); text-align: right; }
.fd-meal-c { display: grid; flex: none; place-items: center; color: var(--muted); }
.fd-meal-c svg { width: 16px; height: 16px; transition: transform .15s; }
.fd-meal.is-open .fd-meal-c svg { transform: rotate(90deg); }
.fd-meal-t:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fd-meal-l[hidden] { display: none; }
@media (hover: hover) {
  .fd-meal-h button.fd-meal-t:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
}

/* alimentazione: righe più leggibili, scambi, pasti salvati */
/* Corpo: un riquadro per pasto, staccati tra loro; aperto, i suoi cibi stanno dentro, legati al nome da una riga a sinistra */
.fd-meals { gap: 8px; overflow: visible; border: 0; border-radius: 0; background: none; }
.fd-meal { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-meal + .fd-meal { border-top: 1px solid var(--line); }
.fd-meal.is-open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.fd-meals.is-flash { animation: none; }
.fd-meals.is-flash .fd-meal { animation: qt-flash 1.2s ease-out; }
.fd-meal-h, .fd-meal-h .fd-meal-t { min-height: 54px; }
.fd-meal-h .fd-meal-t { padding: 8px 10px 8px 14px; }
.fd-meal-n > b { font-size: 15.5px; font-weight: 700; }
.fd-meal-h .fd-meal-k { font-size: 14px; font-weight: 700; }
.fd-meal-s { font-size: 12.5px; }
.fd-plan { padding: 10px 8px 10px 14px; }
.fd-meal-l { padding: 4px 0 10px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 2.5%, var(--surface)); }
.fd-it { position: relative; display: flex; align-items: center; gap: 2px; padding: 0 4px 0 12px; border-left: 2px solid color-mix(in srgb, var(--accent) 28%, var(--line)); }
.fd-it + .fd-it::before, .fd-swl + .fd-it::before { content: ""; position: absolute; top: 0; left: 12px; right: 0; border-top: 1px solid var(--line); }
.fd-it .fd-item { flex: 1 1 auto; width: auto; min-width: 0; min-height: 58px; padding: 10px 6px 10px 0; border: 0; }
.fd-it .fd-item b { font-size: 14.5px; line-height: 1.3; }
.fd-it .fd-item small { margin-top: 2px; font-size: 12.5px; line-height: 1.35; }
.fd-it .fd-item em { flex: none; min-width: 4.6em; font-size: 14px; font-weight: 600; text-align: right; }
.fd-it.is-sw { border-left-color: var(--accent); }
.fd-sw-no { flex: none; width: 30px; }
.fd-sw.is-on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.fd-swl { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 12px 12px; border-left: 2px solid var(--accent); }
.fd-swl-k { font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fd-swl .chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding-block: 4px; white-space: normal; text-align: left; }
.fd-swl .chip b { font-variant-numeric: tabular-nums; }
.fd-swl .chip small { font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-msave { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px 0 5px; } /* il ♡ sotto i nomi dei cibi */
.fd-msave-f { padding-left: 14px; }
.fd-msave .btn svg { width: 15px; height: 15px; }
.fd-msave [data-fd-msave] { color: var(--accent); }
.fd-msave-f input, .fd-sm-ed input {
  flex: 1 1 180px; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: 600 16px/1.3 var(--f-body);
}
.fd-msave-f input:focus, .fd-sm-ed input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
@media (max-width: 820px) {
  .fd-sw-no { width: 38px; } /* come ⇄ sul telefono: le calorie restano in colonna */
}
/* «Aggiungi»: un riquadro per gruppo sotto il suo titolo, righe più alte, le calorie in colonna a destra */
#fdLists { gap: 16px; }
.fd-grp { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#fdLists .fd-h { margin: 0 0 0 2px; }
.fd-rows { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fd-rows > * + * { border-top: 1px solid var(--line); }
.fd-rows .fd-row { min-height: 58px; padding: 10px 10px 10px 14px; border: 0; border-radius: 0; background: transparent; }
.fd-rows .fd-row b { line-height: 1.3; }
.fd-rows .fd-row > span > small { margin-top: 2px; font-size: 12.5px; line-height: 1.35; }
.fd-kc { display: flex; flex: none; flex-direction: column; align-items: flex-end; min-width: 4.4em; font-style: normal; font-weight: 700; font-size: 14.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fd-row .fd-kc small { font-size: 10.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.fd-grp-more { align-self: flex-start; display: inline-flex; align-items: center; min-height: 36px; font-size: 13px; }
.fd-sm { display: flex; align-items: center; padding-right: 4px; }
.fd-sm .fd-row { flex: 1 1 auto; min-width: 0; }
.fd-sm .fd-row > span > small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fd-sm-ed { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.fd-sm-ed input { flex-basis: 100%; }
.fd-sm-ed .btn svg { width: 15px; height: 15px; }
/* ingredienti di una ricetta e cibi di un pasto fisso: righe più alte */
.fd-mix-r { min-height: 58px; padding-block: 10px; }
.fd-mix-name b { font-size: 14px; line-height: 1.3; }
.fd-mix-name small { margin-top: 2px; font-size: 12px; }
@media (hover: hover) {
  .fd-rows .fd-row:hover, .fd-it .fd-item:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
}

/* palestra: massimali, numeri liberi, rest-pause in programma */
/* regolazioni e massimale (1RM) sulla stessa riga sotto il titolo; le regolazioni scritte la prendono tutta */
.gc-meta { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; max-width: 520px; }
.gc-meta > .gc-su { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.gc-meta > .gc-su.has-t, .gc-meta > .gc-su.is-edit { flex: 1 1 100%; }
.gc-pr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.gc-pr-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); border-radius: 99px;
  background: color-mix(in srgb, var(--c) 7%, var(--surface)); color: var(--ink); font: 700 12.5px/1 var(--f-body); font-variant-numeric: tabular-nums; cursor: pointer;
}
.gc-pr-btn b { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-pr-btn small { font-size: 11px; font-weight: 500; color: var(--muted); }
.gc-pr-btn.is-add { padding: 0 12px 0 8px; border-style: dashed; border-color: color-mix(in srgb, var(--muted) 55%, transparent); background: transparent; color: var(--muted); }
.gc-pr-btn svg { width: 14px; height: 14px; }
.gc-pr-btn:active { transform: scale(.97); }
.gc-pr label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.gc-pr label > span:first-child { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-pr input {
  width: 76px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--c); border-radius: 6px; background: var(--surface); color: var(--ink);
  text-align: center; font: 700 16px/1.1 var(--f-body); font-variant-numeric: tabular-nums;
}
.gc-pr .btn { min-height: 38px; }
/* kg della serie: sotto, in piccolo, la % del massimale (prevista o fatta) */
.gs-kg { position: relative; display: block; align-self: start; min-width: 0; }
.gs-pct { position: absolute; inset: auto 0 4px; text-align: center; font: 600 10px/1 var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.gs-pct:empty { display: none; }
.gs-kg.has-pct input { padding-bottom: 12px; }
/* editor: il numero della serie è il tasto del rest-pause («RP» spento finché non si tocca) */
.gx-set .gx-n {
  display: grid; place-items: center; align-content: center; gap: 3px; width: 100%; height: 40px; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; cursor: pointer; -webkit-user-select: none; user-select: none;
}
.gx-n small { padding: 1px 3px; border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 4px; color: color-mix(in srgb, var(--muted) 75%, transparent); font: 700 8.5px/1 var(--f-body); letter-spacing: .03em; }
.gx-n[aria-pressed="true"] { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gx-n[aria-pressed="true"] small { border-color: var(--c); background: var(--c); color: var(--surface); }
.gx-n:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* editor: sotto «75%», in piccolo, i kg dal massimale */
.gx-kg { position: relative; display: block; min-width: 0; }
.gx-pk { position: absolute; inset: auto 0 3px; text-align: center; font: 600 10px/1 var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.gx-pk:empty { display: none; }
.gx-kg.has-pct input { padding-bottom: 11px; }
/* sostituisci esercizio nei prossimi */
.gx-rpl { margin: 2px 0 8px; }
.gx-rpl .btn svg { width: 15px; height: 15px; }
.gx-rpl.is-open { display: flex; flex-direction: column; gap: 6px; max-width: 460px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.gx-rpl input { font-weight: 700; }
.gx-rpl-say { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.gx-rpl-say:empty { display: none; }
.gx-rpl-say b { color: var(--ink); }
.gx-rpl-b { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-rpl-b .btn:disabled { opacity: .45; cursor: default; }
/* tipi di serie */
/* ---------- palestra: tipo della serie (il numero), superserie, lavoro a tempo, recupero automatico ---------- */
/* il numero della serie porta la sigla del tipo («RP», «DS», «CL», «MY», «T», «EMOM»); aperto, la scelta è sotto la riga */
.gs-n[aria-expanded="true"], .gx-set .gx-n[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.gs-n small.is-long, .gx-n small.is-long { padding-inline: 2px; font-size: 7.5px; letter-spacing: 0; }
.gs-row.is-ty:not(.is-done) .gs-n { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
/* righe sotto la serie: scelta del tipo, drop, a tempo */
.gs-x { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 8px 8px; border-top: 1px dashed var(--line); }
.gs-ty { gap: 5px; background: var(--surface-2); }
.gs-ty .chip, .gx-ty .chip { min-height: 34px; padding: 0 10px; font-size: 12.5px; }
.gs-row .gs-x input {
  width: 58px; height: 40px; padding: 0 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  font-size: 16px;
}
.gs-drop { display: inline-flex; align-items: center; gap: 5px; }
.gs-drop > b { color: color-mix(in srgb, var(--c) 80%, var(--ink)); font-size: 15px; }
.gs-drop > span { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gs-dr .gs-rpadd, .gs-rpx .gs-go { flex: none; }
.gs-go { display: inline-flex; align-items: center; gap: 6px; }
.gs-go .btn { min-height: 40px; padding-inline: 14px; }
.gs-go .btn svg { width: 14px; height: 14px; }
.gs-rdy {
  min-height: 36px; padding: 0 10px; border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 99px; background: transparent;
  color: var(--muted); font: 700 12px/1 var(--f-body); cursor: pointer; white-space: nowrap;
}
.gs-rdy[aria-pressed="true"] { border-style: solid; border-color: color-mix(in srgb, var(--c) 50%, var(--line)); background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--ink); }
.gs-dur { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gs-em { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
/* drop fatte in «Prec.» e nello storico */
.gs-prev > span.is-dr, .gh-dr { color: var(--muted); font-size: 11px; white-space: nowrap; }
.gh-dr { margin-left: 3px; }
/* «Recupero automatico» in cima alla scheda: acceso o spento su questo dispositivo */
.gl-top { flex-wrap: wrap; }
.gl-auto {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 99px; background: transparent; color: var(--muted); font: 700 12px/1 var(--f-body); cursor: pointer; white-space: nowrap;
}
.gl-auto svg { width: 15px; height: 15px; }
.gl-auto[aria-pressed="true"] { border-style: solid; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--surface); color: var(--ink); }
.gl-auto[aria-pressed="true"] svg { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
/* recupero scelto col ±15 su questo dispositivo */
.gc-rest.is-mine { border-style: dashed; border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
/* superserie, triserie, circuito: «A1», «A2», stessa barra di colore, riquadri vicini */
.gc.is-ss:not(.is-done) { border-left-color: var(--accent); }
.gc.is-ss:not(.ss-last) { margin-bottom: -6px; }
.gc.is-ss:not(.is-done) .gc-n { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.gc-ss {
  display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 99px; vertical-align: 2px; white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  font: 700 10.5px/1.2 var(--f-body); text-transform: uppercase; letter-spacing: .05em;
}
/* barra in fondo: lavoro e «Pronti» nel colore dello sport, superserie senza conto */
.rest.is-work { background: color-mix(in srgb, var(--c) 82%, var(--ink)); }
.rest.is-work .rt-line i { background: var(--surface); }
.rest.is-go { padding-top: 10px; }
.rt-mine {
  align-self: flex-start; padding: 2px 0; border: 0; background: transparent; color: inherit; font-size: 12.5px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; opacity: .85; cursor: pointer;
}
/* ---------- editor: tipo di serie, recupero della serie, piramidale, superserie ---------- */
.gx-n small { border-color: var(--c); background: var(--c); color: var(--surface); }
.gx-set.is-ty .gx-n { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gx-ty { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-top: 1px dashed var(--line); background: var(--surface-2); }
.ty-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gx-pars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.gx-tf { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gx-tf input, .gx-drop input {
  width: 68px; min-width: 0; height: 36px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
  text-align: center; font: 700 16px/1.1 var(--f-body); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums;
}
.gx-tf input:focus, .gx-drop input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.gx-tf-w { flex: 1 1 100%; }
.gx-tf-w input { flex: 1 1 auto; width: auto; text-align: left; }
.gx-drops { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.gx-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gx-drop input[data-gs="dr"] { width: 58px; }
.gx-tk { min-width: 26px; font-weight: 700; font-size: 13px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); white-space: nowrap; }
.gx-tx { font-weight: 700; color: var(--muted); }
.gx-dkg, .gx-from { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-dkg:empty { display: none; }
.gx-drop .icon-btn { width: 32px; height: 32px; }
.gx-drop .icon-btn svg { width: 14px; height: 14px; }
.gx-drop .icon-btn:disabled { opacity: .25; cursor: default; }
.gx-pyr { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
/* superserie: tra un esercizio e il successivo, «Collega al successivo» o il gruppo con il cambio */
.gx-ex.is-ss { border-left-color: var(--accent); }
.gx-bar { flex-wrap: wrap; } /* «Recupero dopo il giro» va sotto se non c'è posto */
.gx-ex.is-ss .gx-num { width: auto; min-width: 20px; color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.gx-link { display: flex; justify-content: center; margin: -4px 0; }
.gx-lk {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 12px; border: 1px dashed color-mix(in srgb, var(--muted) 50%, transparent);
  border-radius: 99px; background: var(--surface); color: var(--muted); font: 700 12px/1 var(--f-body); cursor: pointer;
}
.gx-lk svg, .gx-lk-t svg { width: 14px; height: 14px; flex: none; }
.gx-lk:hover { border-color: var(--accent); color: var(--accent); }
.gx-link.is-on {
  justify-content: flex-start; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 8px;
  border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.gx-lk-t { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.gx-link .gx-tf input { width: 60px; height: 32px; }
@media (max-width: 400px) {
  .gs-n small.is-long, .gx-n small.is-long { font-size: 7px; padding-inline: 1px; }
  .gs-row .gs-x input { width: 52px; }
  .gx-tf input { width: 60px; }
}
/* serie a scomparsa */
/* rest-pause, myo-reps, cluster, EMOM, drop set, a tempo: chiuse in una riga come le altre; al posto delle ripetizioni le
   mini-serie come si scrivono («10+10», «4×2», «8 ↓80×6»), mai la somma; un tocco apre i dettagli sotto la riga */
.gs-sum {
  display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 1px 4px;
  min-width: 0; width: 100%; min-height: 46px; margin: 0; padding: 4px 3px; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); font: 700 17px/1.15 var(--f-body); font-variant-numeric: tabular-nums; text-align: center;
  overflow-wrap: anywhere; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.gs-sum.is-long { font-size: 14px; }
.gs-sum > b { font-weight: 700; }
.gs-sum .is-plan { color: color-mix(in srgb, var(--muted) 65%, transparent); font-weight: 500; }
.gs-sum .is-dr { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.gs-sum .is-dr.is-plan { font-weight: 500; color: color-mix(in srgb, var(--muted) 65%, transparent); }
/* la freccina: chiusa giù, aperta su */
.gs-sum::after {
  content: ""; flex: none; width: 5px; height: 5px; margin-left: 1px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  rotate: 45deg; translate: 0 -2px; opacity: .35; transition: rotate .15s;
}
.gs-sum[aria-expanded="true"]::after { rotate: -135deg; translate: 0 1px; }
.gs-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gs-sum:active { background: color-mix(in srgb, var(--c) 7%, transparent); }
@media (hover: hover) { .gs-sum:hover { background: color-mix(in srgb, var(--c) 6%, transparent); } }
.gs-row.is-open > .gs-sum { background: color-mix(in srgb, var(--c) 10%, transparent); }
.gs-row.is-fold > .gs-prev { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gs-row.is-under .gs-sum > b { color: var(--missed); }
/* i dettagli sotto la riga: caselle e pause, drop, «Via» */
.gs-more { grid-column: 1 / -1; min-width: 0; }
.gs-main { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 400px) {
  .gs-sum { font-size: 16px; padding-inline: 2px; }
  .gs-sum.is-long { font-size: 13px; }
}

/* editor: «Quando» di un allenamento nuovo (una volta, giorni fissi, alternati), sotto titolo e data.
   Stessi pezzi della pagina di import (.seg, .xi-day, .chip, .wh-step), un po' più bassi per stare nell'intestazione */
.rp { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rp-k { margin-bottom: -4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rp-seg { display: flex; align-self: stretch; width: 100%; max-width: 460px; }
.rp-seg button { flex: 1 1 0; min-width: 0; min-height: 34px; padding-inline: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-days { margin-top: 0; }
.rp-days .xi-day { height: 40px; }
.rp-alt, .rp-wk { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; font-weight: 600; }
.rp-step .icon-btn { width: 36px; height: 36px; font-size: 20px; }
.rp-step b { min-width: 32px; font-size: 18px; }
.rp-wk .chip { min-width: 42px; min-height: 34px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.rp-prev { margin: 0; font-size: 13px; color: var(--muted); }
.rp-prev b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Health: «Sonno e riposo» (riquadro e «Giorno di riposo» sotto il sonno) e il fondo di Nuovo */
#bsTs .bs-k { white-space: normal; } /* va a capo invece dei puntini */
.bs-ts .bs-t { justify-content: space-between; } /* un nome su due righe: nomi in alto e valori in basso restano allineati */
.bs-v svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--rest); } /* la luna: Riposo senza la notte segnata */
.hl-rest { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 10px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.hl-rest > span:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.hl-rest > span:first-child svg { flex: none; width: 18px; height: 18px; color: var(--c); }
.hl-rest .sw { min-height: 0; }
.hl-l { white-space: normal; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.is-big .hl-l { text-align: left; }
.hl-more { flex-wrap: wrap; gap: 8px; }

/* Parametri (js/panels.js): le righe tolte dal Profilo, staccate dall'intestazione come lì */
.pa-g { margin-top: 14px; }

/* Profilo → Colore: sei pallini (col rosa) stanno accanto alla scritta anche sul telefono */
@media (max-width: 480px) {
  .th-colors { gap: 4px; }
  .th-col { width: 30px; height: 30px; }
  .th-dot { width: 24px; height: 24px; }
}

/* Profilo → Notifiche Sì / No: il testo si accorcia con «…» invece di mandare a capo icona e tasti */
[data-push-block] .pr-st .pr-t { flex: 1 1 0; }

/* Health → Andamento → Peso: il pallino scelto (js/body.js pickWeight), sopra il grafico giorno e peso */
.bw-read { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-height: 24px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.bw-read b { font: 700 20px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.bw-chart { touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.tr .bw-read + .bw-chart { margin-top: 4px; }
.bw-sel line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.bw-sel circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }

/* Health: cinque riquadri (Peso, Sonno e riposo, Stress, Passi, Infortuni) su una riga; sotto i 360 px su tre colonne */
.bs-ts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 400px) {
  .bs-ts { gap: 4px; }
  .bs-t { padding-inline: 5px; }
  .bs-k { letter-spacing: .02em; }
  .bs-v { font-size: 16px; }
}
@media (max-width: 359px) { .bs-ts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* scheda: editor */
/* la riga della serie: numero e tastino della tecnica d'intensità nella prima colonna (64 px: sta anche a 375 px) */
.gx-sh, .gx-set { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 40px; }
.gx-nt { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; height: 40px; }
.gx-set .gx-nt .gx-n { width: auto; min-width: 24px; padding: 0 2px; }
.gx-tech {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted);
  font: 700 9.5px/1 var(--f-body); letter-spacing: .02em; cursor: pointer; touch-action: manipulation;
}
.gx-tech.is-sym { font-size: 13px; } /* ⚡ e ⏱ a 9.5px erano un puntino */
.gx-tech.is-on { border-color: var(--c); background: var(--c); color: var(--surface); }
.gx-tech[aria-expanded="true"], .gx-tech:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* il menu della tecnica, sotto il tastino (la tabella delle serie smette di tagliare finché è aperto) */
.gx-sets:has(.gx-tmenu) { overflow: visible; }
.gx-tmenu {
  position: absolute; z-index: 6; top: calc(100% - 2px); left: 0; display: flex; flex-direction: column; gap: 2px; min-width: 168px; padding: 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
}
.gx-tmenu button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink); font-weight: 600; font-size: 13.5px; text-align: left; white-space: nowrap; cursor: pointer; touch-action: manipulation;
}
.gx-tmenu button i {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font: 700 9.5px/1 var(--f-body); font-style: normal;
}
.gx-tmenu button:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.gx-tmenu button[aria-checked="true"] { background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gx-tmenu button[aria-checked="true"] i { border-color: var(--c); background: var(--c); color: var(--surface); }
/* regolazioni della macchina nei dettagli dell'esercizio */
.gx-more .gx-su { margin-bottom: 8px; }
/* nomi degli esercizi suggeriti mentre si scrive (R.suggestNames, js/gym.js): elenco sotto il campo, dentro la pagina */
.gx-sug {
  position: absolute; z-index: 30; display: flex; flex-direction: column; gap: 1px; box-sizing: border-box; min-width: 180px; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.gx-sug[hidden] { display: none; }
.gx-sug.is-gone { opacity: 0; }
.gx-sug-r {
  display: block; width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink);
  text-align: left; font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation;
}
.gx-sug-r.is-on, .gx-sug-r:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }

/* scheda: libreria e modello */
/* carta di una scheda palestra mia (js/panels.js libItemHTML, .is-mine): sul PC i tasti restano in fila come sempre; sul
   telefono prima riga data, Aggiungi, Condividi (solo l'icona: il nome è nell'aria-label) e cestino, seconda riga
   «In calendario», «Modifica» e «Storico» a colonne uguali */
.lib-more { display: contents; }
.nw-hint { margin-top: 8px; max-width: 560px; } /* pagina «Nuovo», sotto il riquadro Scheda (js/health.js) */
/* nel dettaglio di un allenamento, sotto «Scheda palestra»: le versioni della scheda (js/detail.js) */
.tpl-hist { display: inline-block; margin: -4px 0 8px; padding: 0; border: 0; background: transparent; color: var(--muted); font: 600 12.5px/1.3 var(--f-body); cursor: pointer; }
.tpl-hist:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 820px) {
  .lib-item.is-mine .lib-more { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; flex: 1 0 100%; order: 9; }
  .lib-item.is-mine .lib-more .btn { justify-content: center; min-width: 0; padding-inline: 4px; }
  .lib-item.is-mine .lib-more .btn svg { display: none; }
  .lib-item.is-mine [data-lib="share"] { padding-inline: 9px; }
  .lib-item.is-mine [data-lib="share"] span { display: none; }
}

/* gym: powerlifting e calistenia */
/* editor: la colonna dell'RPE obiettivo (powerlifting, o se una serie ce l'ha) tra le ripetizioni e il cestino */
.gx-sh.has-rpe, .gx-set.has-rpe { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 46px 40px; }
.gx-set input[data-gs="rpe"] { padding: 0 3px; font-size: 15px; }
/* a tentativi: quanti, al posto delle ripetizioni («tent.» sotto, come i kg dal massimale) */
.gx-sk { position: relative; display: block; min-width: 0; }
.gx-sk input { padding-bottom: 11px; }
.gx-sk small { position: absolute; inset: auto 0 3px; text-align: center; font: 600 10px/1 var(--f-body); color: var(--muted); pointer-events: none; }
/* il ruolo della serie sotto il numero («TOP», «B-O», «LAV», «RISC»): bordato, per distinguerlo dalla sigla del tipo */
.gs-n small.is-role, .gx-n small.is-role { border: 1px solid color-mix(in srgb, var(--c) 60%, var(--line)); background: transparent; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gs-row.is-done .gs-n small.is-role { border-color: var(--ok); background: transparent; color: var(--ok); }
.gs-row.is-done.is-under .gs-n small.is-role { border-color: var(--missed); color: var(--missed); }
/* nel menu della tecnica: la sezione «Ruolo» e, per i back-off, il −% dal top */
.gx-tm-h { margin-top: 4px; padding: 7px 10px 3px; border-top: 1px solid var(--line); font: 700 10.5px/1 var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.gx-tmenu .gx-tm-off { margin: 2px 8px 4px; white-space: nowrap; }
.gx-tmenu .gx-tm-off input { width: 56px; height: 34px; }
/* nei dettagli: i campi dello sport (fermo, tempo, alzata di riferimento; variante, attrezzo), col loro titolo */
.gx-sp { margin-bottom: 6px; }
.gx-sp-h { margin: 0 0 6px; font: 700 10.5px/1 var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.gx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.gx-chips > span:first-child { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gx-chips .chip { min-height: 32px; padding: 0 11px; font-size: 12.5px; }
/* in palestra: sotto la serie le chip dell'RPE percepito, con l'obiettivo del coach e l'e1RM della serie */
.gs-rpe { gap: 4px; padding: 6px 8px; }
.gs-rpe-t { display: flex; flex-direction: column; gap: 2px; min-width: 32px; margin-right: 2px; font: 700 11px/1.1 var(--f-display); letter-spacing: .06em; color: var(--muted); }
.gs-rpe-t small { font: 600 9.5px/1.1 var(--f-body); letter-spacing: 0; white-space: nowrap; }
.gs-rpe button[data-grpe] {
  min-width: 34px; height: 34px; padding: 0 5px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink);
  font: 700 13px/1 var(--f-body); font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.gs-rpe button[data-grpe][aria-pressed="true"] { border-color: var(--c); background: var(--c); color: var(--surface); }
.gs-rpe button[data-grpe]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gs-e1 { margin-left: auto; font: 600 11px/1 var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-e1:empty { display: none; }
/* calistenia: il cronometro della tenuta (js/wod.js) prende tutta la riga; a tentativi riusciti su fatti e i due tasti */
.gs-hold { flex: 1 1 100%; min-width: 0; }
/* CrossFit: il ⏱ dell'esercizio sotto il nome e il «Cronometro seduta» in cima (una riga, js/wod.js .sw-compact); il tempo
   fatto nella riga sotto il nome e nello storico; «Da benchmark» nell'editor come «Da scheda salvata» */
.gc-sw, .gl-sess { max-width: 520px; }
.gl-sess { margin-bottom: 10px; }
.gc-time, .gh-dur { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gc-time svg, .gh-dur svg { width: 13px; height: 13px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.gc-time { font-weight: 700; color: var(--ink); }
.gx-bench ul { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gs-sk { gap: 6px 8px; }
.gs-sk-c { display: flex; flex-direction: column; gap: 1px; min-width: 56px; margin-right: 2px; }
.gs-sk-c b { font: 700 18px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.gs-sk-c small { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.gs-sk .btn { min-height: 36px; }
/* storico: l'RPE percepito e la miglior tenuta in piccolo, la variante di quel giorno */
.gh-rpe { margin-left: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.gh-set.gh-var { border-style: dashed; color: var(--muted); font-weight: 600; }
/* Massimali (js/zones.js): il riquadro Powerlifting con le tre alzate, il totale e i punti DOTS */
.mx-pl { margin-top: 12px; }
.mx-pl[hidden] { display: none; }
.mx-pl-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; max-width: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.mx-pl-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; background: var(--surface); }
.mx-pl-t span { overflow: hidden; font: 600 11px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.mx-pl-t b { font: 700 22px/1.1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.mx-pl-t b small { margin-left: 3px; font: 500 12px/1 var(--f-body); color: var(--muted); }
.mx-pl-t em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.mx-pl-sum { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.mx-pl-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 400px) {
  .gx-sh.has-rpe, .gx-set.has-rpe { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) 42px 36px; }
  .gs-rpe button[data-grpe] { min-width: 31px; padding: 0 3px; font-size: 12.5px; }
  .mx-pl-t b { font-size: 19px; }
}
