/* Pagina «Storico» di una scheda palestra (js/tpl-history.js): riassunto, progressi per esercizio, modifiche alla scheda,
   le sedute una per una. Stile come le Statistiche (stats.css); solo token di colore: chiaro e scuro vanno da soli. */

/* riassunto: «3 sedute fatte · dal 3 ott al 24 ott · prossima: lun 3 nov» */
.th-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.th-lead b { font: 700 22px/1.1 var(--f-display); color: var(--ink); }
.th-lead span::before { content: "· "; }
.th-owner { margin: 4px 0 0 2px; font-size: 12.5px; }
.th-none { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.th-up { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.th-down { color: color-mix(in srgb, var(--missed) 80%, var(--ink)); }
.th-same { color: var(--muted); }

/* progressi per esercizio: una riga per esercizio (nome e prima → ultima | Δ kg | freccia), come .sx-exr in stats.css */
.th-prog { max-width: 560px; margin: 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.th-prog li + li { border-top: 1px solid var(--line); }
.th-pr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; width: 100%; min-height: 50px;
  padding: 7px 10px 7px 12px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left;
}
.th-pr.is-flat { grid-template-columns: minmax(0, 1fr) auto; padding-right: 12px; }
button.th-pr { cursor: pointer; }
button.th-pr:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.th-prn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-prn b { font-size: 14.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.th-prn small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.th-prd { font: 700 17px/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-prd small { font: 500 11.5px var(--f-body); color: var(--muted); }
.th-ch { display: flex; color: var(--muted); }
.th-ch svg { width: 16px; height: 16px; }

/* modifiche alla scheda: una voce per versione, con la data e le differenze (+ aggiunto, − tolto, prima → dopo) */
.th-hist { max-width: 560px; margin: 0; padding: 0; list-style: none; }
.th-v { padding: 8px 0; border-top: 1px solid var(--line); }
.th-v:first-child { padding-top: 0; border-top: 0; }
.th-vd { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.th-dl { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.th-dl li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; overflow-wrap: anywhere; }
.th-dl b { font-weight: 600; }
.th-dl i { flex: none; width: 12px; font-style: normal; font-weight: 700; text-align: center; }
.th-add i { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.th-rm i { color: color-mix(in srgb, var(--missed) 80%, var(--ink)); }
.th-rm b { color: var(--muted); text-decoration: line-through; }
.th-was { color: var(--muted); }

/* sedute: «Solo le fatte | Tutte», poi una tendina per seduta */
.seg.th-flt { display: flex; width: 100%; max-width: 420px; margin-bottom: 6px; }
.th-flt button { flex: 1 1 0; padding-inline: 4px; }
.th-list { max-width: 560px; }
.th-s + .th-s { border-top: 1px solid var(--line); }
.th-s summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 6px 0; cursor: pointer; list-style: none; font-size: 13px; }
.th-s summary::-webkit-details-marker { display: none; }
.th-s summary::before { content: ""; flex: none; width: 6px; height: 6px; margin-right: 2px; border: solid var(--muted); border-width: 0 2px 2px 0; rotate: -45deg; transition: rotate .15s; }
.th-s[open] summary::before { rotate: 45deg; }
.th-sd { font-weight: 700; }
.th-sm { color: var(--muted); font-variant-numeric: tabular-nums; }
.th-warn { color: var(--partial); }
.th-sb { padding: 0 0 12px 16px; }
.th-swap { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.th-swap b { color: var(--ink); }
/* ogni esercizio: nome (con «al posto di…» o «in più»), la serie migliore a destra, sotto le serie fatte che vanno a capo */
.th-ex { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.th-eh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.th-eh > b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.th-badge {
  padding: 1px 6px; border-radius: 99px; white-space: nowrap; font-size: 11px; font-weight: 600;
  color: color-mix(in srgb, var(--accent) 80%, var(--ink)); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.th-etop { margin-left: auto; font: 700 15px/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-etop i { font-style: normal; font-size: 12px; }
.th-sets { margin-top: 2px; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.th-set { white-space: nowrap; }
.th-set small { font-size: 13px; }
.th-set .is-plan { color: var(--muted); font-weight: 500; }
.th-sep { color: var(--muted); }
.th-sets.muted span { font-weight: 500; }
.th-note { margin: 2px 0 0; font-size: 12.5px; }
.th-open { margin-top: 10px; }

@media (max-width: 820px) {
  .th-sb { padding-left: 14px; }
}
