/* Training screens (phase 3, P3-F1). Styles for static/training.js only; shared styles live in app.css.
   Uses the theme tokens from app.css. Every tap target is at least 44 px. */

#tab-training h2:first-of-type { margin-top: 20px; }
.tr-loading { margin-top: 24px; }

/* header with back button */
.tr-head { justify-content: flex-start; gap: 8px; }
.tr-head-text { min-width: 0; }
.tr-head h1 { overflow-wrap: anywhere; }
.tr-back {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card);
  color: var(--text); font-size: 28px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0 0 4px;
}

/* cards used as buttons */
button.card {
  width: 100%; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  min-height: 56px; margin-bottom: 8px; gap: 4px;
}
button.card:active { transform: scale(0.99); }
.tr-wide { width: 100%; margin-top: 12px; min-height: 44px; }
a.tr-wide { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.tr-line { font-size: 14px; }
.tr-note p { margin: 0; color: var(--muted); font-size: 14px; }
.tr-note .btn { min-height: 44px; }
.chip.tr-tag { margin-left: 0; display: inline-block; font-size: 12px; padding: 3px 9px; }
.chip.tr-status.done, .chip.tr-status.partial { background: var(--good-bg); color: var(--good); }
.chip.tr-status.missed { background: var(--bad-bg); color: var(--bad); }

/* home */
.tr-next { gap: 6px; }
.tr-next b { font-size: 18px; }
.tr-next .btn { margin-top: 6px; min-height: 44px; }
.tr-program b { font-size: 17px; }
.tr-program .tr-more { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 4px; }
.tr-stats { grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.tr-stats b { display: block; font-size: 22px; }
.tr-stats small { color: var(--muted); font-size: 12px; }

/* program */
.tr-prog-card { gap: 6px; margin-bottom: 8px; }
.tr-prog-card > b { font-size: 17px; }
.tr-rule { font-size: 14px; color: var(--muted); }
.tr-rule b { color: var(--text); margin-right: 4px; }
.tr-sess .chip { vertical-align: 1px; }
.tr-other summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0 4px; }

/* session and exercise cards */
.tr-warm { font-size: 14px; color: var(--muted); margin-bottom: 8px; display: block; }
.tr-warm b { color: var(--text); margin-right: 4px; }
.tr-group { margin-bottom: 10px; gap: 0; padding: 4px 14px; }
.tr-group.superset { border-left: 3px solid var(--accent); }
.tr-ss-head { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.tr-ex { padding: 12px 0; display: grid; gap: 6px; }
.tr-ex + .tr-ex { border-top: 1px solid var(--line); }
.tr-ex-name {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 44px;
  background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 700; font-size: 17px; text-align: left; cursor: pointer;
}
.tr-ex-name span:last-child { color: var(--muted); font-size: 22px; flex: none; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-tempo { font-size: 13px; color: var(--muted); }
.tr-suggest { background: var(--adj-bg); border: 1px solid var(--adj-line); color: var(--accent); border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 600; }
.tr-suggest.below_window, .tr-suggest.drop_step { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.tr-lastline { font-size: 13px; color: var(--muted); }

/* progress */
.tr-progress { margin-bottom: 8px; }
.tr-progress-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tr-track { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.tr-track div { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }

/* set rows */
.tr-sets { display: grid; gap: 6px; margin-top: 2px; }
.tr-set { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.tr-set-no { flex: none; width: 32px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.tr-in { position: relative; flex: none; width: 76px; display: block; }
.tr-in input { padding: 10px 6px 10px 8px; padding-right: 30px; height: 44px; font-size: 16px; text-align: right; }
.tr-in input::placeholder { color: var(--muted); opacity: 0.7; }
.tr-in small { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; pointer-events: none; }
.tr-in:nth-of-type(2) { width: 72px; }
.tr-last { flex: 1; min-width: 0; font-size: 11px; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; }
.tr-set-val { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-check {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: transparent;
  color: var(--muted); font-size: 18px; font-weight: 700; display: grid; place-items: center; cursor: pointer; margin-left: auto;
}
.tr-check.on { background: var(--good); border-color: var(--good); color: var(--accent-ink); }
.tr-set.done { opacity: 0.9; }
.tr-same { width: 100%; min-height: 44px; font-size: 14px; background: var(--card2); color: var(--accent); }
.tr-foot { font-size: 13px; text-align: center; margin: 16px 8px 80px; }

/* rest timer: fixed above the bottom bar. While it shows, the toast moves up above it. */
.tr-rest {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 76px); z-index: 6; max-width: 528px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 8px 8px 8px 16px; box-shadow: 0 6px 20px var(--shadow);
}
.tr-rest-text { display: flex; align-items: baseline; gap: 10px; }
.tr-rest small { font-size: 13px; font-weight: 600; }
.tr-rest b { font-size: 24px; font-variant-numeric: tabular-nums; }
.tr-rest .btn { min-height: 44px; background: var(--soft); color: var(--accent-ink); }
body:has(.tr-rest:not(.hidden)) .toast { bottom: calc(var(--safe-b) + 148px); }

/* history */
.tr-hist-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tr-hist .muted { font-size: 14px; }

/* exercise sheet */
.tr-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--card2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tr-seg button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tr-seg button.active { background: var(--card); color: var(--text); }
.tr-sheet-body { display: grid; gap: 10px; }
.tr-notes b { font-size: 14px; }
.tr-notes p { margin: 4px 0 0; font-size: 15px; white-space: pre-wrap; }
.tr-best { background: var(--card2); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.tr-best b { font-size: 20px; }
.tr-hday { border-top: 1px solid var(--line); padding-top: 8px; }
.tr-hset { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 3px 0; }
.tr-hset span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

/* setup: training schedule */
.tr-week { display: grid; gap: 6px; }
.tr-day { display: flex; align-items: center; gap: 10px; }
.tr-day span { flex: none; width: 40px; color: var(--muted); font-size: 14px; font-weight: 600; }
.tr-day select { min-height: 44px; }
#trSetup { display: grid; gap: 10px; }
#trSetup .btn { min-height: 44px; }
.tr-err-text { color: var(--bad); font-size: 14px; }

/* home stats list and steps card (P5-F3) */
.tr-statlist { gap: 0; padding: 4px 14px; }
.tr-stat-row { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }
.tr-stat-row:last-child { border-bottom: 0; }
.tr-stat-row b { font-size: 18px; }
.tr-steps { text-align: left; font: inherit; color: var(--text); border: 0; width: 100%; min-height: 44px; cursor: pointer; margin-bottom: 8px; }
.tr-steps b { font-size: 22px; }
.tr-steps b .muted { font-size: 14px; font-weight: 400; }
.tr-steps-top { display: flex; justify-content: space-between; align-items: center; }
.tr-steps .tr-more { color: var(--accent); font-size: 14px; font-weight: 600; }
.tr-track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }
span.tr-track { display: block; }

/* history charts */
.tr-seg.two { margin-top: 14px; margin-bottom: 4px; }
.tr-pager { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.tr-pg { width: 44px; height: 44px; border: 0; border-radius: 99px; background: var(--card); color: var(--text); font: inherit; font-size: 22px; cursor: pointer; }
.tr-pg:disabled { opacity: 0.35; }
.tr-chart { margin-bottom: 8px; }
.tr-chart-top { display: flex; justify-content: space-between; align-items: baseline; }
.tr-sheet-body .tr-chart { margin: 10px 0; }

.tr-cday { display: flex; flex-direction: column; gap: 2px; min-height: 44px; }

/* cardio log (P9-F2) */
.tr-cardio-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.tr-cardio-btns .btn { min-height: 44px; }
.tr-centry { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.tr-cdel { min-height: 44px; min-width: 44px; }
.tr-cmsg { min-height: 20px; margin: 4px 0; color: var(--bad); font-size: 14px; }
