:root {
  --bg: #0F1112;
  --bg-deep: #0A0B0C;
  --surface: #181B1D;
  --surface-hi: #1B1F21;
  --field: #0F1112;
  --line: #23272A;
  --line-hi: #2A2F33;
  --chip: #262A2D;
  --seg: #15181A;
  --seg-on: #2A2F33;
  --text: #F2F0EA;
  --text-2: #C9CDCF;
  --muted: #9AA0A3;
  --faint: #7C8387;
  --accent: #C8F25A;
  --accent-ink: #0F1112;
  --protein: #6FC3FF;
  --fat: #FFB547;
  --carbs: #C59BFF;
  --over: #FF7A6B;
  --danger: #FF7A6B;
  --radius-card: 22px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Unbounded", "Onest", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }

/* ---------- Каркас ---------- */
.view {
  padding: 20px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 8px calc(8px + var(--safe-b));
  background: #121416; border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; text-decoration: none; color: var(--faint); font-size: 12px; min-height: 44px;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }

.title { font-size: 24px; font-weight: 700; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-family: var(--font-num); font-weight: 700; letter-spacing: -0.5px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px;
}
.card.accent { background: var(--surface-hi); border: 1.5px solid var(--accent); }

/* ---------- Кнопки ---------- */
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; border: 1px solid var(--chip);
  background: #15181A; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn:disabled { color: #4A5054; cursor: default; }
.icon-btn svg, .btn svg, .add-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.add-btn {
  width: 36px; height: 36px; border-radius: 18px; border: none; background: var(--chip);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
}
.add-btn svg { width: 18px; height: 18px; }
.btn {
  height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid var(--line-hi);
  background: var(--field); font-weight: 500; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border: none; font-weight: 600; font-size: 16px; height: 54px; border-radius: 27px; }
.btn.primary:disabled { opacity: 0.45; }
.btn.ghost { background: transparent; border: none; color: var(--accent); }
.btn.danger { color: var(--danger); border-color: #3A2A28; background: transparent; }
.btn.small { height: 36px; font-size: 14px; padding: 0 14px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn.dashed { border-style: dashed; border-color: #3A3F43; background: transparent; color: var(--accent); }

/* ---------- Сегменты и чипы ---------- */
.seg {
  display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px;
  padding: 4px; background: var(--seg); border-radius: 22px;
}
.seg button {
  height: 36px; border: none; border-radius: 18px; background: transparent; color: var(--muted); font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--text); font-weight: 600; }
.seg.compact { border-radius: 14px; padding: 3px; background: var(--field); }
.seg.compact button { height: 38px; border-radius: 11px; }

.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chip {
  height: 36px; border-radius: 18px; border: 1px solid var(--line-hi); background: transparent; color: var(--text-2); font-size: 14px;
}
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); font-weight: 600; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.input, .select {
  height: 46px; width: 100%; padding: 0 14px; border-radius: 14px; background: var(--field);
  border: 1px solid var(--line-hi); outline: none; font-size: 16px;
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.search {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--line-hi);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ---------- Сегодня ---------- */
.day-head { display: flex; align-items: center; justify-content: space-between; }
.day-head .center { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.day-head .center b { font-size: 17px; font-weight: 600; }
.ring-row { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.ring .inside .num { font-size: 32px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 600; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.macro { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; }

.meal { padding: 14px 14px 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meal-head h2 { font-size: 16px; font-weight: 600; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.meal-head h2 span { font-size: 13px; color: var(--muted); font-weight: 400; }
.meal-macros { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: -4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.meal-macros b { font-weight: 600; }
.p { color: var(--protein); } .f { color: var(--fat); } .c { color: var(--carbs); }
.entry {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px;
  background: none; border: none; padding: 6px 0; text-align: left; width: 100%; min-height: 32px;
}
.entry .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .qty { color: var(--muted); white-space: nowrap; }
.meal.empty { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 14px 14px 16px; }
.meal.empty .btn { height: 36px; }

/* ---------- Списки ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-height: 60px;
}
.item[aria-pressed="true"] { background: var(--surface-hi); border: 1.5px solid var(--accent); }
.item .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item .t b { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.item .t small { font-size: 12px; color: var(--muted); }
.item .k { font-size: 15px; font-weight: 600; white-space: nowrap; }
.item .k small { font-size: 12px; color: var(--muted); font-weight: 400; }
.empty-note { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 8px; }

/* ---------- Нижние листы ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); animation: fade 0.18s ease; }
.sheet {
  position: relative; max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-top: 1px solid var(--line-hi); border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px;
  max-width: 560px; width: 100%; margin: 0 auto; animation: up 0.22s cubic-bezier(.2,.8,.2,1);
}
.sheet > * { flex-shrink: 0; }
.sheet.full { height: 100vh; max-height: 100vh; border-radius: 0; border-top: none; padding-top: 20px; }
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: #3A3F43; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sheet-head .sub { font-size: 13px; color: var(--muted); }
.pick-panel { background: var(--surface); border: 1px solid var(--line-hi); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.stepper { display: flex; align-items: center; justify-content: space-between; }
.stepper .icon-btn { width: 52px; height: 52px; border-radius: 26px; background: var(--field); border-color: var(--line-hi); }
.stepper .val { display: flex; align-items: baseline; gap: 6px; }
.stepper input {
  width: 140px; text-align: center; background: transparent; border: none; outline: none;
  font-family: var(--font-num); font-weight: 700; font-size: 38px; letter-spacing: -1px; padding: 0;
}
.preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; border-radius: 18px; background: var(--field); text-align: center; }
.preview div { display: flex; flex-direction: column; gap: 2px; }
.preview b { font-size: 17px; font-weight: 600; }
.preview span { font-size: 12px; color: var(--muted); }

@keyframes up { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- История ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart text { font-family: var(--font); }

/* ---------- Тост и загрузка ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%) translateY(20px);
  background: #2A2F33; color: var(--text); padding: 12px 16px; border-radius: 16px; font-size: 14px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: #3A2422; color: #FFD3CD; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, #1F2325 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-card); }
@keyframes shimmer { to { background-position: -200% 0; } }
.center-screen { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.center-screen h1 { font-size: 20px; margin: 0; }
.center-screen .muted { max-width: 320px; line-height: 1.4; }
.id-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0;
  padding: 14px 24px; border-radius: 20px; background: var(--surface); border: 1px dashed var(--line-hi);
  -webkit-user-select: text; user-select: text;
}
.id-chip .num { font-size: 28px; }
.id-chip:active { border-color: var(--accent); }
.no-access-actions { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* =====================================================================================
   Тренировки
   ===================================================================================== */
.col { display: flex; flex-direction: column; gap: 12px; }
.col.tight { gap: 2px; }
.row.tight { gap: 6px; }
.row.baseline { align-items: baseline; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.h2 { font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.eyebrow.accent, .accent { color: var(--accent); }
.ok { color: var(--accent); }
.warn { color: var(--fat); }
.num.big { font-size: 28px; }
.num.mid { font-size: 20px; }
.hint { color: var(--faint); font-size: 12px; }
.input.area { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tabbar[hidden] { display: none; }
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }

.avatar {
  width: 44px; height: 44px; border-radius: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--chip); color: var(--text); font-weight: 600; font-size: 14px;
}
.avatar.accent { background: #2C3311; color: var(--accent); }

.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; background: var(--chip); color: var(--muted); }
.st-done, .st-record { background: #2C3311; color: var(--accent); }
.st-progress { background: #1C2A3A; color: var(--protein); }
.st-missed { background: #3A1D1A; color: var(--over); }
.st-warn { background: #3A2A14; color: var(--fat); }
.st-record { background: #3A2A14; color: var(--fat); }

.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); text-align: left; min-width: 0;
}
.tile b { font-size: 17px; }
button.tile { cursor: pointer; }
.m-tile[aria-pressed="true"] { border: 1.5px solid var(--accent); background: var(--surface-hi); }

/* Неделя */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wd {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px;
  background: transparent; border: none; min-height: 64px;
}
.wd .wd-name { font-size: 11px; color: var(--muted); }
.wd b { font-size: 15px; }
.wd.today { background: var(--accent); color: var(--accent-ink); }
.wd.today .wd-name { color: var(--accent-ink); }
.dot { width: 6px; height: 6px; border-radius: 3px; display: block; }
.dot.planned { border: 1.5px solid var(--accent); }
.dot.done { background: var(--accent); }
.dot.missed { background: var(--over); }
.wd.today .dot.planned { border-color: var(--accent-ink); }
.wd.today .dot.done { background: var(--accent-ink); }

/* Карточка тренировки на сегодня */
.hero { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.hero-title { display: flex; flex-direction: column; gap: 4px; background: none; border: none; padding: 0; text-align: left; }
.hero-title .h2 { font-family: var(--font-num); font-size: 19px; }
.hero.done { border-color: #3A4A1A; }

/* Списки тренировок */
.item.static { cursor: default; }
a.item { text-decoration: none; color: inherit; }
.date-box { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.date-box span { font-size: 11px; color: var(--muted); }
.date-box b { font-size: 18px; }
.ss-label { font-size: 12px; font-weight: 600; color: var(--protein); margin: 4px 0 -2px 4px; }
.in-ss { border-left: 3px solid var(--protein) !important; }
.ex-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.ex-card .t, .item .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-card .t b { font-size: 15px; font-weight: 600; }
.ex-card small, .item small { font-size: 12px; color: var(--muted); }
.ex-card small.ok { color: var(--accent); } .ex-card small.warn { color: var(--fat); }
.thumb {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; background: var(--chip); color: var(--faint);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.thumb.big { width: 100%; height: 200px; border-radius: 20px; }
.thumb.big img { object-fit: contain; background: #fff; }
.pic-wrap { display: flex; flex-direction: column; gap: 10px; }
.wk-head { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.fb { display: flex; flex-direction: column; gap: 8px; }
.fb-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.sheet-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sheet-head .btn { flex-shrink: 0; }
.tag { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: var(--chip); color: var(--text); }
.tag.accent { background: #2C3311; color: var(--accent); font-weight: 600; }
.desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.day-nav { display: flex; align-items: center; justify-content: space-between; }
.meal { display: flex; flex-direction: column; gap: 6px; }

/* Чипы в одну строку с прокруткой */
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.chip-row .chip { flex-shrink: 0; padding: 0 14px; }

/* Выполнение */
.session-sheet { padding-bottom: 0; }
.session-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.session-head .center { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.session-head .center .muted { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elapsed { font-size: 18px; font-variant-numeric: tabular-nums; }
.session { display: flex; flex-direction: column; gap: 12px; padding-bottom: 140px; }
.progress-dots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.progress-dots i { height: 4px; border-radius: 2px; background: var(--chip); display: block; }
.progress-dots i.half { background: #5C6A1F; }
.progress-dots i.on { background: var(--accent); }
.run-item { display: flex; flex-direction: column; gap: 10px; }
.run-item .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.run-item .t b { font-size: 16px; }
.run-item small { font-size: 12px; }
.set-grid { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 6px 8px; align-items: center; }
.set-grid.retro { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 36px; margin-top: 8px; }
.set-grid .hd { font-size: 11px; color: var(--faint); }
.set-grid .input { height: 44px; padding: 0 10px; font-size: 17px; font-weight: 600; }
.set-grid .cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-hint { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl { font-weight: 700; text-align: center; color: var(--text-2); }
.lbl.warm { color: var(--fat); font-size: 13px; }
.lbl.drop { color: var(--protein); }
.done-val { font-size: 15px; font-weight: 600; padding-left: 4px; }
.done-mark { display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--accent); }
.done-mark > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.check-btn {
  width: 48px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-hi); background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 0;
}
.check-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.check-btn.current { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.input.current { border-color: #4A5A20; }
.mini-btn {
  width: 32px; height: 32px; border-radius: 10px; border: none; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
}
.mini-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pending { font-size: 14px; }
.chk { width: 26px; height: 26px; accent-color: var(--accent); -webkit-appearance: checkbox; appearance: auto; }

.rest {
  position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(12px + var(--safe-b));
  background: #1A2010; border-top: 1px solid #3A4A1A; display: flex; flex-direction: column; gap: 10px; z-index: 2;
}
.rest-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rest-text { display: flex; flex-direction: column; }
.rest-text .num { font-size: 30px; font-variant-numeric: tabular-nums; color: var(--accent); }
.rest-btns { display: flex; gap: 6px; }
.rest-bar > i { background: var(--accent); transition: width 0.25s linear; }

/* Опросник */
.center-col { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-top: 8px; }
.big-check { width: 60px; height: 60px; border-radius: 30px; background: #2C3311; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.big-check svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.q { display: flex; flex-direction: column; gap: 8px; }
.rpe { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.rpe button { height: 42px; border-radius: 10px; border: none; background: var(--surface); color: var(--muted); font-weight: 700; padding: 0; }
.rpe button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Конструктор */
.b-item { display: flex; flex-direction: column; gap: 10px; }
.b-item .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.link-row { background: none; border: none; padding: 0; min-width: 0; flex: 1; }
.b-sets { display: flex; flex-direction: column; gap: 6px; }
.b-set { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.b-set.drop { margin-left: 26px; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) 32px; }
.b-set .input { height: 42px; padding: 0 10px; }
.pair { display: flex; gap: 4px; min-width: 0; }
.pair .input { min-width: 0; }
.unit-btn {
  height: 42px; min-width: 40px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line-hi); background: var(--seg);
  color: var(--text-2); font-size: 13px; flex-shrink: 0;
}
.unit-btn.on { border-color: var(--accent); color: var(--accent); }
.mini-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-field span { font-size: 11px; color: var(--faint); }
.drops { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.link-btn { background: none; border: none; color: var(--protein); font-size: 13px; padding: 4px 0 0 32px; text-align: left; }

/* Добавление подопечного */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.step-n { width: 26px; height: 26px; border-radius: 13px; background: #2C3311; color: var(--accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.t > small { font-size: 12px; color: var(--muted); }
a.icon-btn { color: inherit; text-decoration: none; }
textarea { font: inherit; color: inherit; }
.item > svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
