/* «Трекер тела» — раздел «Тренировки». Токены и базовые компоненты
   (.glass, .btn, .iconbtn, .sheet, .sec-h, .toast) — общие с «Едой». */

/* Цвета групп мышц: мягкая подложка иконки снаряда */
:root { --wk-css: 1; }   /* метка «стили раздела загружены» — её проверяет workouts.js */

[data-section="workouts"] {
  --g-core: #E4F4A8; --g-arms: #E3DEFF; --g-back: #D3E8FF; --g-chest: #FFE1CC;
  --g-shoulders: #CFF3E6; --g-legs: #FFEDB8; --g-other: #ECEEF0;
  --up: #3E8E1F; --down: #D9534F;
}

.w-top { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.w-top h1 { font: 700 30px/1.1 var(--font-display); letter-spacing: -.02em; margin: 0; flex: 1; }
.w-top .ttl { flex: 1; min-width: 0; }
.w-top .ttl b { display: block; font: 700 22px/1.15 var(--font-display); letter-spacing: -.01em; }
.w-top .ttl span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.w-top .ttl button { color: var(--ink-2); font-weight: 600; font-size: 13px; text-decoration: underline dotted; text-underline-offset: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow); font-weight: 600; font-size: 14px; white-space: nowrap;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ── Иконка снаряда ── */
.eq { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center;
      background: var(--g-other); color: rgba(20,24,15,.78); }
.eq svg { width: 20px; height: 20px; stroke-width: 1.7; }
.eq.core { background: var(--g-core); } .eq.arms { background: var(--g-arms); }
.eq.back { background: var(--g-back); } .eq.chest { background: var(--g-chest); }
.eq.shoulders { background: var(--g-shoulders); } .eq.legs { background: var(--g-legs); }

/* ── Главная: следующая тренировка ── */
.nextc { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.nextc .lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.nextc h2 { margin: 0; font: 700 26px/1.1 var(--font-display); letter-spacing: -.02em; }
.nextc .mus { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.days::-webkit-scrollbar { display: none; }
.days .chip { box-shadow: none; background: rgba(20,24,15,.05); border-color: transparent; }
.days .chip.on { background: var(--ink); color: #fff; }
.days .chip i { font-style: normal; color: var(--accent-text); font-weight: 800; }
.days .chip.on i { color: var(--accent); }
.plist { display: flex; flex-direction: column; gap: 2px; }
.pli { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.pli .eq { width: 30px; height: 30px; border-radius: 10px; }
.pli .eq svg { width: 17px; height: 17px; }
.pli .n { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.pli .n small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.pli .lb { width: 24px; flex: none; font-size: 12px; color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px 8px; }
.weekstrip div { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px;
                 color: var(--ink-3); font-weight: 600; }
.weekstrip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
               font: 700 14px var(--font-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.weekstrip .done b { background: var(--accent); color: var(--accent-ink); }
.weekstrip .today b { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }

.wlist { padding: 2px 0; overflow: hidden; }
.wlist > button, .wlist > div.wi { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; text-align: left; }
.wlist > * + * { border-top: 1px solid var(--line); }
.wlist .n { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.wlist .n small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.wlist .m { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-align: left; width: 100%; }
.notice b { display: block; font-size: 15px; }
.notice span { font-size: 13px; color: var(--ink-2); }
.notice .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none;
               box-shadow: 0 0 0 4px var(--accent-soft); }

/* ── Экран тренировки: список дня ── */
.day { display: flex; flex-direction: column; gap: 8px; }
.ex { border-radius: 22px; overflow: hidden; }
.ex-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; }
.ex-row .n { flex: 1; min-width: 0; }
.ex-row .t { font-size: 15px; font-weight: 650; line-height: 1.22; overflow-wrap: anywhere; }
.ex-row .t em { font-style: normal; color: var(--ink-3); font-weight: 700; font-size: 12.5px; margin-right: 4px; }
.ex-row .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.ex-row .r { flex: none; text-align: right; font-size: 13px; }
.ex.done:not(.open) { background: rgba(255,255,255,.5); }
.ex.done:not(.open) .t { color: var(--ink-2); }
.ex.skip:not(.open) { opacity: .6; }
.ck { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
      display: inline-grid; place-items: center; }
.ck svg { width: 14px; height: 14px; stroke-width: 2.6; }
.badge { display: inline-block; padding: 2px 7px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
         font-variant-numeric: tabular-nums; background: rgba(20,24,15,.06); color: var(--ink-2); }
.badge.up { background: var(--accent-soft); color: var(--up); }
.badge.down { background: #FDE8E7; color: var(--down); }
.tag { font-size: 12px; font-weight: 700; color: var(--ink-3); }

/* Раскрытое упражнение */
.ex.open { background: var(--glass-strong); box-shadow: var(--glass-hi), var(--shadow-lift); }
.ex-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 9px; }
.ex.open .ex-row .t { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meta .pill { height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(20,24,15,.06);
              display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.meta a.pill { color: var(--accent-ink); background: var(--accent-soft); text-decoration: none; }
.meta a.pill svg { width: 14px; height: 14px; }
.last { font-size: 14px; line-height: 1.3; padding: 7px 6px 7px 12px; border-radius: 14px; background: rgba(20,24,15,.04);
        display: flex; align-items: center; gap: 2px; }
.last .lt { flex: 1; min-width: 0; }
.last span { color: var(--ink-3); font-weight: 600; font-size: 12px; display: block; }
.last .cm { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.lk { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.lk:active { background: var(--accent-soft); }
.lk svg { width: 19px; height: 19px; }
a.lk { color: var(--accent-text); }
.last b { font-variant-numeric: tabular-nums; }
.sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set { height: 34px; padding: 0 11px; border-radius: 12px; background: var(--ink); color: #fff;
       font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.set small { font-weight: 600; opacity: .6; font-size: 12px; }
.set.drop { background: #4A4F45; }

.wctl { display: flex; align-items: center; gap: 8px; }
.wctl .pm { width: 46px; height: 44px; border-radius: 16px; background: rgba(20,24,15,.06); font-size: 24px; font-weight: 500;
            display: grid; place-items: center; flex: none; }
.wctl .pm:active { background: var(--accent-soft); }
.wv { flex: 1; height: 44px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center;
      gap: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.wv input { width: 5ch; border: 0; outline: 0; background: transparent; text-align: center; font: 700 26px var(--font-display);
            font-variant-numeric: tabular-nums; letter-spacing: -.02em; padding: 0; }
.wv span { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.wv:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.hint { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hint:empty { display: none; }
.hint .up { color: var(--up); }
.qw { height: 26px; padding: 0 9px; border-radius: var(--r-pill); background: rgba(20,24,15,.06); font-size: 12.5px; font-weight: 700; }

.reps-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.reps-h .lr { height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(20,24,15,.06); color: var(--ink-2); }
.reps-h .lr.on { background: var(--ink); color: #fff; }
.reps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 2px;
        scroll-snap-type: x proximity; }
.reps::-webkit-scrollbar { display: none; }
.rp { flex: none; width: 48px; height: 50px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
      font: 700 21px var(--font-display); font-variant-numeric: tabular-nums; position: relative; scroll-snap-align: center; }
.rp:active { transform: scale(.94); background: var(--accent); }
.rp.tgt { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.rp.top { box-shadow: inset 0 0 0 2px var(--accent); }
.rp i { position: absolute; left: 0; right: 0; bottom: 4px; font: 700 9px var(--font); color: var(--ink-3); font-style: normal; }
.rp.tgt i { color: var(--accent-ink); opacity: .7; }
.side2 { font-size: 13px; color: var(--accent-text); font-weight: 700; }

.acts { display: flex; gap: 8px; }
.acts .btn { height: 42px; font-size: 15px; padding: 0 14px; }
.acts .btn.ghost { flex: none; }
.acts .btn.primary { flex: 1; }
.acts .btn.soft { flex: 1; background: rgba(20,24,15,.06); }
.note-in { width: 100%; height: 40px; border: 0; outline: 0; border-radius: 12px; background: rgba(20,24,15,.05); padding: 0 12px; font-size: 16px; }
.addex { width: 100%; height: 48px; border-radius: var(--r-pill); border: 1.5px dashed rgba(20,24,15,.18); font-weight: 600; color: var(--ink-2); }
.timer { font-variant-numeric: tabular-nums; }

/* ── Упражнение: история ── */
.chart { width: 100%; height: 120px; display: block; }
.chart .ln { fill: none; stroke: var(--accent-text); stroke-width: 2.2; }
.chart .ar { fill: var(--accent-soft); stroke: none; }
.chart circle { fill: #fff; stroke: var(--accent-text); stroke-width: 2; }
.chart text { font: 600 10px var(--font); fill: var(--ink-3); }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.hrow { display: flex; gap: 10px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hrow .d { width: 74px; flex: none; color: var(--ink-3); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hrow .x { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hrow .x small { display: block; color: var(--ink-3); font-size: 12px; }
.sheet-in.tall { height: 85dvh; }
.sheet-in h3 { margin: 0; font: 700 21px/1.2 var(--font-display); letter-spacing: -.01em; }
.sheet-in .sub { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.gopt { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.gopt .rd { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(20,24,15,.2); flex: none; }
.gopt.on .rd { box-shadow: inset 0 0 0 7px var(--accent-text); }
.gopt .n { flex: 1; } .gopt .n b { display: block; font-size: 15.5px; } .gopt .n small { color: var(--ink-3); font-size: 12.5px; }
.form { display: flex; gap: 8px; margin-top: 12px; }
.form input { flex: 1; height: 44px; border-radius: var(--r-pill); border: 0; outline: 0; background: rgba(20,24,15,.06); padding: 0 16px; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.fld input { height: 46px; border-radius: 14px; border: 0; outline: 0; background: rgba(20,24,15,.06); padding: 0 12px;
             font: 700 20px var(--font-display); font-variant-numeric: tabular-nums; }

/* Сомнительные пары */
.pair { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pair .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .two > div { background: rgba(20,24,15,.04); border-radius: 14px; padding: 9px 10px; font-size: 13px; color: var(--ink-2); }
.pair .two b { display: block; color: var(--ink); font-size: 14.5px; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; }
.pair .acts .btn { height: 40px; }
.nextc > .btn, .nextc .acts .btn { flex: 1 0 auto; }
.nextc > .btn { width: 100%; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-weight: 600; padding: 2px 4px 0; }

/* Подходы чипами: перенос только между чипами */
.res { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; align-items: center; }
.sg { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 8px;
      background: rgba(20,24,15,.07); color: var(--ink); font-weight: 600; }
.sg b { font-weight: 800; }
.sg.mu { background: rgba(20,24,15,.04); color: var(--ink-2); }
.res .was { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.last .res { margin-top: 3px; }
.hrow .x .res { margin-top: 0; }

/* Шапка тренировки: непрозрачная, закреплена сверху — ничто не наезжает и не размывает */
.w-top.stick { position: sticky; top: 0; z-index: 15; margin: calc(-1 * var(--app-pt)) calc(-1 * var(--pad)) 0;
               padding: calc(var(--app-pt) + 2px) var(--pad) 10px; background: var(--bg);
               box-shadow: 0 1px 0 var(--line); }
.ex { scroll-margin-top: calc(max(env(safe-area-inset-top), 12px) + 76px); }

/* Группы похожих названий */
.cl { display: flex; flex-direction: column; gap: 6px; }
.cl-i { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 9px 10px; border-radius: 14px; background: rgba(20,24,15,.04); }
.cl-i .cb { width: 22px; height: 22px; flex: none; border-radius: 7px; box-shadow: inset 0 0 0 2px rgba(20,24,15,.2); display: grid; place-items: center; color: transparent; margin-top: 1px; }
.cl-i .cb svg { width: 14px; height: 14px; stroke-width: 2.6; }
.cl-i.on { background: var(--accent-soft); }
.cl-i.on .cb { background: var(--accent-text); box-shadow: none; color: #fff; }
.cl-i .n { flex: 1; min-width: 0; }
.cl-i .n > b { display: block; font-size: 14.5px; line-height: 1.25; overflow-wrap: anywhere; }
.cl-i .n small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.cl-i .mus { color: var(--accent-text); font-weight: 700; }
/* iOS Safari растеризует текст рядом со стеклом (backdrop-filter) в низком
   разрешении — заголовок «двоится». В шапке тренировки стекла нет совсем. */
.w-top.stick .iconbtn, .w-top.stick .chip { -webkit-backdrop-filter: none; backdrop-filter: none;
  background: #fff; box-shadow: 0 0 0 1px var(--line); }
.w-top.stick .chip.on { background: var(--accent); box-shadow: none; }
.w-top.stick .ttl b { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ── Тренировка таблицей ── */
.w-top.stick { flex-wrap: wrap; row-gap: 8px; }
.jumps { flex-basis: 100%; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.jumps::-webkit-scrollbar { display: none; }
.jn { flex: none; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 9px; background: rgba(20,24,15,.06);
      font: 700 13px var(--font); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.jn.ok { background: var(--accent); color: var(--accent-ink); }
.day { gap: 8px; }
.xb { border-radius: 20px; padding: 8px 10px 6px; scroll-margin-top: calc(max(env(safe-area-inset-top), 12px) + 104px); }
.xb.done { background: rgba(255,255,255,.55); }
.xb.skip { opacity: .55; }
.xb-h { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; padding: 2px 0 6px; }
.xb-h .eq { width: 30px; height: 30px; border-radius: 10px; }
.xb-h .eq svg { width: 17px; height: 17px; }
.xb-h .n { flex: 1; min-width: 0; display: block; }
.xb-h .t { display: block; font-size: 15px; font-weight: 700; line-height: 1.22; overflow-wrap: anywhere; }
.xb-h .t em { font-style: normal; color: var(--ink-3); font-size: 12.5px; margin-right: 4px; }
.xb-h .s { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.xb-h .r { flex: none; }
.xt { display: grid; gap: 3px 4px; align-items: center; }
.hh { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; white-space: nowrap; line-height: 1.15;
      font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; }
.hh i { display: block; font-style: normal; font-weight: 600; font-size: 10.5px; color: var(--ink-3); }
.hh.today { color: var(--accent-text); }
.hn { font-size: 11px; font-weight: 700; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.hc { height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(20,24,15,.035);
      font: 650 14px var(--font); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.hc small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; margin-right: 1px; }
.hc.mu { color: var(--ink-3); background: transparent; }
.ci { width: 100%; height: 34px; border: 0; outline: 0; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
      text-align: center; font: 700 16px var(--font); font-variant-numeric: tabular-nums; padding: 0 2px; color: var(--ink); }
.ci::placeholder { color: rgba(20,24,15,.30); font-weight: 600; }
.ci.up::placeholder { color: var(--up); opacity: .8; }
.ci:focus { box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }
.xf { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; padding-top: 3px; }
.xh { font-size: 11.5px; color: var(--ink-3); font-weight: 600; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.xh .up { color: var(--up); }
.addset { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 4px 2px; flex: none; }
.sheet-list .item.on .nm { color: var(--accent-text); }

/* Шторки раздела: верх с ручкой и ✕, не выше 85 % экрана */
#wsheet .sheet-in { max-height: 85dvh; touch-action: pan-y; }
.sheet-top { position: relative; height: 26px; margin: -8px -16px 6px; padding-top: 8px; touch-action: none; flex: none; }
.sheet-top .sheet-grab { margin: 2px auto 0; }
.sx { position: absolute; right: 10px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: rgba(20,24,15,.07);
      font-size: 15px; font-weight: 700; color: var(--ink-2); display: grid; place-items: center; }
.sx:active { background: var(--accent-soft); }

/* ── Ячейки «вес над повторами»: история тихая и узкая, сегодня — главное ── */
.xt { gap: 4px 4px; }
.hh { font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding-bottom: 1px; }
.hh.today { font-size: 12px; font-weight: 800; color: var(--accent-text); text-align: left; padding-left: 10px; }
.hc { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
      border-radius: 10px; background: rgba(20,24,15,.03); font: 600 14px var(--font); color: var(--ink-3); line-height: 1.05; }
.hc small { display: block; font-size: 10px; font-weight: 600; color: rgba(20,24,15,.32); margin: 0; }
.hc small.dr { color: var(--ink-2); font-weight: 800; }
.hc.mu { background: transparent; }
.tc { height: 52px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 10px; border-radius: 14px; background: #fff;
      box-shadow: inset 0 0 0 1.5px rgba(195,229,90,.75); cursor: text; }
.tc.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tc:focus-within { box-shadow: inset 0 0 0 2.5px var(--accent-text); background: #fff; }
.tw { display: flex; align-items: baseline; gap: 2px; flex: 0 0 auto; }
.tw i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.ci { box-shadow: none !important; background: transparent !important; padding: 0; }
.ci.w { width: 3.6ch; height: 30px; text-align: right; font: 700 15px var(--font); color: var(--ink-2); }
.ci.r { flex: 1; min-width: 0; height: 44px; text-align: center; font: 800 24px var(--font-display); letter-spacing: -.01em; }
.tc .ci.r { border-left: 1px solid var(--line); border-radius: 0; }

/* ══ Экран тренировки — зеркало листа таблицы ══ */
.wtab { --wn: 136px; --wp: 82px; --wt: 178px; overflow-x: auto; border-radius: 18px; padding: 0;
        -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.wgrid { display: grid; width: max-content; }
.wc { min-height: 70px; padding: 7px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column;
      justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; }
.wc.hd { min-height: 0; padding: 7px 8px 5px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: none; }
.wn { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; align-items: flex-start;
      border-right: 1px solid var(--line); box-shadow: 4px 0 8px -6px rgba(20,24,15,.18); }
.wn.hd { background: #fff; }
.wn .eq { width: 24px; height: 24px; border-radius: 8px; margin-bottom: 2px; }
.wn .eq svg { width: 14px; height: 14px; }
.wn .t { font-size: 13.5px; font-weight: 700; line-height: 1.18; overflow-wrap: anywhere; }
.wn .t em { font-style: normal; color: var(--ink-3); font-size: 11.5px; margin-right: 3px; }
.wn .s { font-size: 11px; color: var(--ink-3); font-weight: 600; line-height: 1.25; }
.wn.ok .t::after { content: " ✓"; color: var(--accent-text); }
.wp { align-items: center; text-align: center; color: var(--ink-3); background: rgba(20,24,15,.015); }
.wp i { font-style: normal; font-size: 10.5px; font-weight: 600; }
.wp b { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.wp span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.2; overflow-wrap: anywhere; }
.wp .badge { font-size: 10.5px; padding: 1px 5px; margin-top: 1px; }
.wt { background: #fff; box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); padding: 6px 10px; gap: 4px; }
.wt.hd { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent), inset 0 2px 0 var(--accent);
         color: var(--accent-text); font-size: 12px; font-weight: 800; border-radius: 0; }
.wgrid > .wt:last-child { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent), inset 0 -2px 0 var(--accent); }
.wt.on { background: #F6FBE6; }
.wt.sk { opacity: .6; }
.wt .tw { display: flex; align-items: baseline; gap: 3px; border-radius: 8px; padding: 0 6px; align-self: flex-start;
          background: rgba(20,24,15,.05); }
.wt .tw.up { background: #CFEFB0; }   /* как зелёная подсветка в таблице: пора повышать вес */
.wt .tw i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.wt .ci.w { width: 4.2ch; height: 26px; text-align: left; font: 700 15px var(--font); color: var(--ink); }
.wt .ci.r { width: 100%; height: 30px; text-align: left; font: 800 19px var(--font-display); letter-spacing: -.01em;
            border-bottom: 1.5px solid var(--line); border-radius: 0; padding: 0 2px; }
.wt .ci.r:focus { border-bottom-color: var(--accent-text); }
.wt .ci::placeholder { color: rgba(20,24,15,.28); font-weight: 600; }
.wt .tp:empty { display: none; }
.wt .tp .badge { font-size: 11.5px; }

/* Панель над клавиатурой */
#wkbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 6px; padding: 6px 8px;
         background: #EEF0EC; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
#wkbar::-webkit-scrollbar { display: none; }
#wkbar button { flex: none; min-width: 44px; height: 38px; padding: 0 12px; border-radius: 10px; background: #fff;
                font: 700 18px var(--font); box-shadow: 0 1px 0 rgba(20,24,15,.15); }
#wkbar .fill { font-size: 14px; color: var(--ink-2); }
#wkbar .ok { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 15px; }
/* Главная «Тренировок»: шапка тоже закреплена и непрозрачна — системное размытие iOS у кромки её не задевает */
.w-top.stick.home { padding-bottom: 12px; }

/* Аккордеон: свёрнутые строки — компактные и тихие, раскрыта одна */
.wn.cl { min-height: 52px; padding: 6px 8px; gap: 1px; }
.wn.cl .t { font-size: 13px; font-weight: 650; }
.wn.cl .s { font-size: 10.5px; }
.ws { min-height: 52px; flex-direction: row; align-items: center; justify-content: flex-end; gap: 6px; text-align: right;
      padding: 6px 12px; background: transparent; font-size: 12.5px; }
.ws .was { color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.ws .okt { color: var(--accent-text); font-weight: 800; white-space: nowrap; }
.ws .badge { font-size: 11px; }
.wn.op, .wp.op, .wt { min-height: 78px; }
.wn.op { background: #FBFDF4; }

/* ══ Таблица недель программы: строки кг / повт. / % выровнены через все колонки ══ */
.wtab { --wn: 116px; --wl: 34px; --wp: 74px; --wt: 116px; }
.wgrid .wc { min-height: 0; padding: 3px 6px; border-bottom: 0; box-shadow: none; justify-content: center;
             font: 600 14px var(--font); color: var(--ink); gap: 0; line-height: 1.2; }
.wgrid .wc.hd { padding: 8px 6px 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center;
                align-items: center; border-bottom: 1px solid var(--line); }
.wgrid .wn { grid-row: span 3; position: sticky; left: 0; z-index: 3; background: #fff; align-items: flex-start;
             padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
.wgrid .wn.hd { grid-row: auto; }
.wgrid .wn .t { font-size: 13px; font-weight: 700; line-height: 1.18; }
.wgrid .wn .s { font-size: 10.5px; margin-top: 2px; }
.wgrid .wn.ok .t::after { content: " ✓"; color: var(--accent-text); }
.wgrid .wl { position: sticky; left: var(--wn); z-index: 3; background: #fff; font-size: 10.5px; font-weight: 700;
             color: var(--ink-3); align-items: flex-start; padding: 0 4px; border-right: 1px solid var(--line);
             box-shadow: 4px 0 8px -6px rgba(20,24,15,.18); }
.wgrid .wp { align-items: center; text-align: center; background: transparent; color: var(--ink-2); white-space: normal;
             word-break: keep-all; overflow-wrap: normal; }
.wgrid .wp.hd, .wgrid .wl.hd { background: #fff; }
.wgrid .r1 { padding-top: 7px; }
.wgrid .r3 { padding-bottom: 7px; border-bottom: 1px solid var(--line); min-height: 26px; }
.wgrid .wp .badge, .wgrid .wt .badge { font-size: 12px; padding: 1px 6px; margin: 0; }
/* «Сегодня»: тот же шрифт, акцент рамкой и фоном */
.wgrid .wt { background: #FBFDF5; box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); align-items: stretch; }
.wgrid .wt.hd { color: var(--accent-text); font-size: 12px; font-weight: 800; box-shadow: inset 2px 0 0 var(--accent),
                inset -2px 0 0 var(--accent), inset 0 2px 0 var(--accent); }
.wgrid .wt.hd small { display: block; font-size: 10px; font-weight: 600; color: var(--ink-3); }
.wgrid .wt.on { background: #F1F9DC; }
.wgrid .wt.r1.up { background: #D7F0BC; }       /* как зелёная подсветка в таблице: пора повышать вес */
.wgrid .wt.sk { opacity: .55; }
.wgrid .wt.r3 { align-items: flex-start; }
.wgrid .wt .ci { width: 100%; height: 24px; padding: 0 4px; text-align: left; font: 600 14px var(--font); color: var(--ink);
                 border-radius: 6px; background: rgba(255,255,255,.85) !important; box-shadow: inset 0 0 0 1px var(--line) !important;
                 letter-spacing: 0; border: 0; }
.wgrid .wt .ci:focus { box-shadow: inset 0 0 0 2px var(--accent-text) !important; }
.wgrid .wt .ci::placeholder { color: rgba(20,24,15,.3); font-weight: 600; }
.wgrid > .wt:last-child { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent), inset 0 -2px 0 var(--accent); }
.wgrid { min-width: 100%; }
.wgrid .wn .t { overflow-wrap: normal; word-break: normal; -webkit-hyphens: auto; hyphens: auto; }
.wtab { --wn: 124px; }
.wgrid .wt .ci { min-width: 0; }
.wgrid .wn .s + .s { margin-top: 0; }

/* Главная в один экран: компактный список дня */
.w-top.stick.home h1 { font-size: 28px; }
.w-top.stick.home .chip { height: 32px; padding: 0 10px; font-size: 13.5px; }
.nextc { gap: 8px; padding: 14px 14px 12px; }
.pli { padding: 3px 0; }
.pli .n { font-size: 14px; }
/* История */
.hlist { padding: 0; overflow: hidden; }
.hi { position: relative; overflow: hidden; }
.hi + .hi { border-top: 1px solid var(--line); }
.hin { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; text-align: left;
       background: #fff; transition: transform .2s ease; touch-action: pan-y; }
.hin .n { flex: 1; min-width: 0; font-weight: 650; font-size: 15px; }
.hin .n small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.hin .m { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hdel { position: absolute; right: 0; top: 0; bottom: 0; width: 96px; background: var(--danger); color: #fff; font-weight: 700; font-size: 14px; }
.tst { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(20,24,15,.07); color: var(--ink-2); }
.btn.primary.del { background: var(--danger); color: #fff; }
/* панель над клавиатурой: крупные кнопки, плотный фон, над системной панелью iOS */
#wkbar { padding: 8px 10px; gap: 8px; background: rgba(238,240,236,.98); border-top: 1px solid var(--line);
         border-radius: 16px 16px 0 0; box-shadow: 0 -6px 18px rgba(20,24,15,.10); }
#wkbar button { min-width: 52px; height: 44px; font-size: 22px; }
#wkbar .fill { font-size: 15px; }

/* История: строки в одну линию */
.hin .n.one { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.hin .n.one b { font-weight: 700; flex: none; }
.hin .n.one small { display: inline; margin: 0; overflow: hidden; text-overflow: ellipsis; }
.hin .n b + .tst, .hin .n .tst { flex: none; }
/* Таблица программы: заголовок блока «Тренировка N» */
.wgrid .pday { background: var(--accent-soft); padding: 6px 8px; font: 800 13px var(--font); color: var(--accent-ink);
               border-bottom: 1px solid var(--line); }
.wgrid .pday span { position: sticky; left: 8px; }
.wgrid .wp.tap { cursor: pointer; }
.wgrid .wp.tap:active { background: var(--accent-soft); }
.wgrid .badge { white-space: nowrap; }
.wgrid .wp .badge { font-size: 11px; padding: 1px 4px; }
/* Шапка главной: заголовок, под ним одна строка — зал слева, «История» справа */
.w-top.stick.home { flex-wrap: wrap; row-gap: 6px; padding-bottom: 10px; }
.w-top.stick.home h1 { flex-basis: 100%; font-size: 26px; }
.w-top.stick.home .hrow2 { flex-basis: 100%; display: flex; gap: 8px; align-items: center; }
.w-top.stick.home .hrow2 .chip { height: 32px; font-size: 13.5px; padding: 0 12px; }
.w-top.stick.home .hrow2 .chip:first-child { min-width: 0; flex: 0 1 auto; }
.w-top.stick.home .hrow2 .chip:first-child span { overflow: hidden; text-overflow: ellipsis; }
.w-top.stick.home .hrow2 .chip:last-child { margin-left: auto; flex: none; }
