/* Дополнения: тренировка (подходы), питание, сканер, прогресс, тренер, чат, запись. */

/* ---------- тренировка ---------- */
.ex-head { align-items: flex-start; }
.ex-title { flex: 1; min-width: 0; cursor: pointer; }
.ex-head .name { font-size: 18px; }
.ex-title .ex-goal { margin: 4px 0 0; line-height: 1.45; }
.ex-title .ex-goal b { color: var(--accent-ink); font-weight: 600; }
.ex-head .cnt { align-self: center; }
.ex-body { margin-top: 12px; }
.ex-tip { border-left: 3px solid var(--lime-300); padding: 2px 0 2px 12px; margin: 0 0 12px; font-size: 15px; line-height: 1.4; }
.ex-coach { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); margin: 0 0 10px; }
.ex-coach b { color: var(--ok-ink); font-weight: 600; }
.link { color: var(--accent-ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.ex-coach .link { color: var(--text-2); font-weight: 500; }
.lastbox { display: flex; gap: 22px; width: 100%; text-align: left; background: var(--surface-2); border-radius: var(--r-lg); padding: 10px 14px; margin-bottom: 12px; overflow: hidden; }
.lastbox > div { min-width: 0; }
.lastbox span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.lastbox b { font-size: 16px; font-weight: 600; white-space: pre; font-variant-numeric: tabular-nums; }
.lastbox > div:last-child { overflow-x: auto; scrollbar-width: none; }

.sets2 { display: grid; grid-template-columns: 30px 1fr 1fr 48px; column-gap: 10px; align-items: center; margin: 0 -14px; }
.sets2.one { grid-template-columns: 30px 1fr 48px; }
.sets2 > .hd { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); text-align: center; padding: 0 0 6px; }
.sets2 > .hd:first-child { padding-left: 14px; }
.sets2 > .hd:last-of-type { padding-right: 14px; }
.sets2 > .hd .circle-check { width: 28px; height: 28px; color: var(--text-3); border-radius: 9px; }
.sets2 > .hd .circle-check.on { color: #fff; background: var(--ok); border-color: var(--ok); }
.sets2 .set { display: grid; grid-column: 1 / -1; grid-template-columns: 30px 1fr 1fr 48px; column-gap: 10px; align-items: center; padding: 6px 14px; }
.sets2.one .set { grid-template-columns: 30px 1fr 48px; }
@supports (grid-template-columns: subgrid) { .sets2 .set, .sets2.one .set { grid-template-columns: subgrid; } }
.sets2 .set .n { text-align: center; font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sets2 .set .num-input { min-height: 46px; font-size: 20px; color: var(--text-2); font-weight: 600; }
.sets2 .set.active .num-input, .sets2 .set.done .num-input { color: var(--text); font-weight: 700; }
.sets2 .set.done { background: var(--ok-soft); }
.sets2 .set.done .n { color: var(--ok-ink); font-weight: 700; }
.sets2 .set .orm { grid-column: 2 / -1; font-size: 12px; color: var(--text-3); padding-top: 4px; }
.sets2 .set .orm b { color: var(--copper); }
.sets2 .check { width: 44px; height: 44px; border-radius: 13px; justify-self: end; color: var(--text-3); background: var(--surface-2); border-color: var(--border); }
.sets2 .check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.sets2 .check.next { border-color: var(--border-strong); box-shadow: none; }
.ex-card.done { border-color: rgba(18,160,106,.35); }
.ex-foot { margin-top: 12px; }

/* ---------- заметки-карточки ---------- */
.note-card { display: flex; gap: 12px; align-items: flex-start; }
.note-card > div { min-width: 0; flex: 1; }
.note-card .eyebrow { margin-bottom: 2px; }
.nc-ico { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--on-accent); background: linear-gradient(140deg, var(--lime-300), var(--lime-600)); }
.nc-ico.sky { background: linear-gradient(140deg, var(--sky-400), var(--sky-600)); color: #fff; }
.nc-ico.lime { background: linear-gradient(140deg, var(--lime-300), var(--lime-600)); }

/* ---------- питание ---------- */
.meal-title { display: flex; align-items: center; gap: 8px; margin: 20px 2px 8px; }
.meal-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.meal-title .dot.off { background: var(--border-strong); }
.meal-title .mt-r { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--text-2); text-transform: uppercase; }
.meal-title .mt-r b { margin-left: 6px; color: var(--text); }
.meal.pad-0 .food-row { padding: 12px 14px; border-top: 0; border-bottom: 1px solid var(--border); }
.meal.pad-0 .food-row .k { font-weight: 500; color: var(--text-2); }
.meal.pad-0 .food-row .del { background: var(--surface-2); border-radius: 10px; width: 38px; height: 38px; }
.meal.pad-0 .meal-actions { margin: 0; padding: 12px 14px; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .search { flex: 1; }
.search-row .icon-btn { width: 48px; height: 48px; border-radius: var(--r-md); }

/* ---------- сканер ---------- */
.scan { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff3b30; box-shadow: 0 0 12px #ff3b30; opacity: .85; }
.scan-msg { position: absolute; inset: auto 0 12px; text-align: center; color: #fff; font-size: 14px; padding: 0 16px; text-shadow: 0 1px 4px #000; }

/* ---------- прогресс ---------- */
.wk7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk7 > div { border-radius: 12px; background: var(--surface-2); padding: 8px 0 6px; text-align: center; color: var(--text-3); }
.wk7 > div span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.wk7 > div b { display: block; font-size: 16px; line-height: 1.2; }
.wk7 > div.on { background: linear-gradient(160deg, var(--lime-300), var(--lime-500)); color: var(--on-accent); }
.wk7 > div.today:not(.on) { box-shadow: inset 0 0 0 1.5px var(--border-strong); }

/* ---------- профиль ---------- */
.acct-line { display: block; width: 100%; text-align: center; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.acct-line b { color: var(--accent-ink); }
.tr-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.tr-head .thumb { background: var(--surface); border: 1px solid var(--border); color: var(--accent-ink); font-size: 18px; }
.tr-head .main { flex: 1; min-width: 0; }
.tr-head .t { font-weight: 700; font-size: 17px; line-height: 1.25; }
.tr-head .d { font-size: 13.5px; color: var(--text-2); font-weight: 400; }
.tr-head > .ic { color: var(--text-3); }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kv-box { border: 1px solid var(--border); border-radius: var(--r-lg); margin-top: 14px; }
.kv-box > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 15px; }
.kv-box > div + div { border-top: 1px solid var(--border); }
.kv-box span { color: var(--text); }
.kv-box b { font-weight: 500; color: var(--text-2); text-align: right; }
.row-link.tall { padding: 14px; }
.row-link > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.card.pad-0 .row-link + .row-link { border-top: 1px solid var(--border); }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 14px; }
.heat i { aspect-ratio: 1; border-radius: 50%; background: var(--surface-2); }
.heat i.out { background: transparent; }
.heat i.on { background: var(--sky-600); }
.heat i.pr { background: var(--copper); }
.heat-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 6px; padding-right: 12%; }
.ach .a { background: var(--surface); border: 1px solid var(--border); opacity: 1; padding: 14px 6px; color: var(--text-3); }
.ach .a.on { background: var(--surface); color: var(--text); }
.ach .a .ico { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 0; background: var(--surface-2); color: var(--text-3); }
.ach .a.on .ico { color: var(--on-accent); box-shadow: 0 6px 14px -6px rgba(0,0,0,.35); }
.ach .a.on .ico.lime { background: linear-gradient(150deg, var(--lime-300), var(--lime-600)); }
.ach .a.on .ico.mint { background: linear-gradient(150deg, var(--mint-500), var(--mint-600)); }
.ach .a.on .ico.sky { background: linear-gradient(150deg, var(--sky-400), var(--sky-600)); }
.ach .a.on .ico.copper { background: var(--copper-soft); color: var(--copper); box-shadow: none; }

/* ---------- главная ---------- */
.auth-cta { position: relative; }
.auth-cta > .icon-btn { position: absolute; right: 10px; top: 10px; background: transparent; }
.appt-when { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; margin: 6px 0 2px; }
.appt-when::first-letter { text-transform: uppercase; }
.mini-stats { display: flex; gap: 14px; }
.mini-stats > div { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-stats b { display: block; font-size: 19px; font-weight: 800; line-height: 1.1; }
.mini-stats small { font-size: 12px; color: var(--text-2); }
.ms-ico { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ms-ico.copper { background: var(--copper-soft); color: var(--copper); }
.ms-ico.mint { background: rgba(12,194,136,.14); color: var(--mint-ink); }
.ms-ico.sky { background: rgba(9,147,193,.12); color: var(--sky-ink); }

/* ---------- вкладки ---------- */
.tabbar a { position: relative; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- чат ---------- */
.view.chat-view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 110px); }
.chat { display: flex; flex-direction: column; gap: 6px; }
.chat-day { align-self: center; font-size: 12px; font-weight: 600; color: var(--text-3); margin: 10px 0 4px; }
.chat-sys { align-self: center; max-width: 88%; text-align: center; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 6px 12px; }
.msg { align-self: flex-start; max-width: 82%; background: var(--surface); border: 1px solid var(--border); border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; }
.msg.me { align-self: flex-end; background: var(--lime-200); border-color: transparent; color: #12170a; border-radius: 18px 18px 6px 18px; }
.msg.pending { opacity: .6; }
.msg .tx { white-space: pre-wrap; font-size: 15.5px; line-height: 1.4; }
.msg .tm { font-size: 11px; opacity: .55; text-align: right; margin-top: 2px; }
.composer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px); width: calc(100% - 32px); max-width: calc(var(--content-w) - 32px); z-index: 24; display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 26px; background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); border: 1px solid var(--border); }
.composer .input { min-height: 40px; border: 0; background: transparent; resize: none; padding: 9px 12px; box-shadow: none; line-height: 1.35; }
.composer .icon-btn { width: 40px; height: 40px; }

/* ---------- запись ---------- */
.cal .day:disabled { color: var(--text-3); opacity: .45; }
.cal .day.free:not(.sel) { background: var(--accent-soft); }
.slots .eyebrow { margin: 12px 0 8px; font-size: 11px; color: var(--text-3); }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { min-width: 78px; min-height: 42px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- формы и мелочи ---------- */
.form-err { color: var(--danger); font-size: 14px; min-height: 20px; margin: -2px 0 8px; }
.steps { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; line-height: 1.5; }
.steps li { margin-bottom: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--r-md); overflow-x: auto; white-space: nowrap; font-size: 13px; scrollbar-width: none; }
.plain { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.5; }
.plain li { margin-bottom: 6px; }
.input.tm { width: 108px; min-height: 42px; padding: 6px 8px; flex: none; text-align: center; }
.setting-row { gap: 8px; }
.btn.primary.danger, .sheet-foot .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.session-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.list-row > .ic { color: var(--text-3); }
