:root {
  --bg: #0b1120;
  --bg2: #111a2e;
  --card: #16223c;
  --card2: #1c2b48;
  --line: #263351;
  --text: #e8eefb;
  --muted: #93a2c2;
  --teal: #2dd4bf;
  --teal-d: #0d9488;
  --accent: #5eead4;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --band: #fb923c;
}
:root[data-theme="light"] {
  --bg: #eef2f9;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #eef3fb;
  --line: #d9e1ee;
  --text: #101c33;
  --muted: #5c6b8a;
  --teal: #0d9488;
  --teal-d: #0f766e;
  --accent: #0b7d72;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #14233f 0%, var(--bg) 55%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
  transition: background .3s, color .3s;
}
:root[data-theme="light"] body {
  background: radial-gradient(1200px 600px at 80% -10%, #dbe6f7 0%, var(--bg) 55%);
}
.hidden { display: none !important; }
.view { min-height: 100vh; }

/* ---------- Home ---------- */
#home { max-width: none; margin: 0; padding: 22px clamp(16px, 3vw, 48px) 48px; }
.trackers-top { margin-bottom: 18px; }
.trackers-top .tracker-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- Раскладка главной ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 22px; align-items: start; }
.col-main { display: grid; gap: 18px; min-width: 0; }
.col-side {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 2px 20px 6px; min-width: 0;
}
.col-side .block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.col-side .block:last-child { border-bottom: none; }
.block-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.block-note { color: var(--line); font-weight: 400; }

/* Главное действие */
.today {
  background: linear-gradient(150deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px;
}
.today-tags { display: flex; gap: 8px; margin-bottom: 12px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
}
.tag-accent { color: var(--teal); background: rgba(45,212,191,.12); border-color: rgba(45,212,191,.32); }
.today h1 { font-size: 28px; line-height: 1.15; margin-bottom: 6px; text-wrap: balance; }
.today-meta { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.today-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-primary.btn-lg { padding: 15px 28px; font-size: 16px; }

/* Быстрые действия */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.quick-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; cursor: pointer; color: var(--text);
  transition: border-color .18s ease-out, transform .18s ease-out;
}
.quick-btn:hover { border-color: var(--teal); transform: translateY(-2px); }
.quick-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.q-ico { font-size: 22px; line-height: 1; }
.q-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.q-txt b { font-size: 14px; font-weight: 600; }
.q-txt small { font-size: 12px; color: var(--muted); }

/* Прогресс в сайдбаре */
.progress-row { display: flex; align-items: center; gap: 18px; }
.mini-stats { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; min-width: 0; }
.mini-stats div { min-width: 0; }
.mini-stats dt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.mini-stats dd { font-size: 19px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Ссылка на десктоп-версию */
.download-row {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 12px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 13.5px; text-decoration: none; transition: .18s ease-out;
}
.download-row:hover { border-color: var(--teal); color: var(--accent); }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .today h1 { font-size: 24px; }
}
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(160deg, var(--teal), var(--teal-d));
  box-shadow: 0 6px 18px rgba(45, 212, 191, .3);
  position: relative;
}
.logo::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.9) 2px, transparent 3px),
             radial-gradient(circle at 42% 55%, rgba(255,255,255,.85) 2px, transparent 3px),
             radial-gradient(circle at 58% 78%, rgba(255,255,255,.8) 2px, transparent 3px);
}
.brand-title { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.topstats { display: flex; align-items: center; gap: 18px; }
.stat { text-align: center; }
.stat-val { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--muted); }
.icon-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { background: var(--card2); border-color: var(--teal); }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #04201c;
  border: none; padding: 13px 24px; border-radius: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 8px 22px rgba(45,212,191,.28); transition: .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(45,212,191,.4); }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line);
  padding: 13px 20px; border-radius: 12px; font-size: 14px; cursor: pointer; transition: .15s;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--accent); }
.btn-danger { color: var(--danger); border-color: rgba(248,113,113,.4); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.done-today { color: var(--ok); font-weight: 600; font-size: 14px; }

/* progress ring */
.ring-wrap { position: relative; width: 150px; height: 150px; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: url(#g) var(--teal); stroke: var(--teal); stroke-width: 10;
  stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset .8s ease;
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-pct { font-size: 26px; font-weight: 700; color: var(--accent); }
.ring-lbl { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.3; margin-top: 2px; }


.calendar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cal-day {
  min-width: 0; aspect-ratio: 1; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted);
  position: relative; overflow: hidden;
}
.cal-day.done { background: linear-gradient(140deg, var(--teal), var(--teal-d)); color: #04201c; border-color: transparent; font-weight: 700; }
.cal-day.today { border-color: var(--teal); color: var(--accent); box-shadow: 0 0 0 2px rgba(45,212,191,.25); }
.cal-day.today.done { color: #04201c; }
.cal-day.missed { opacity: .5; }

.ex-list { display: grid; gap: 10px; }
.ex-item { display: flex; align-items: center; gap: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ex-item .mini-fig { width: 56px; height: 44px; flex-shrink: 0; }
.ex-item .mini-fig .fig { width: 100%; height: 100%; }
.ex-info { flex: 1; }
.ex-info b { font-size: 14px; }
.ex-info small { display: block; color: var(--muted); font-size: 12px; }
.ex-tag { font-size: 11px; color: var(--accent); background: rgba(94,234,212,.1); padding: 3px 9px; border-radius: 999px; }
.ex-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.disclaimer { color: var(--muted); font-size: 12px; line-height: 1.5; padding: 4px 6px; border-left: 3px solid var(--warn); padding-left: 12px; margin-top: 8px; }

/* ---------- Session ---------- */
.session { display: flex; flex-direction: column; height: 100vh; padding: 18px 24px 24px; }
.session-top { display: flex; align-items: center; gap: 16px; }
.session-progress { flex: 1; height: 8px; background: var(--card); border-radius: 999px; overflow: hidden; }
.session-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width .4s; }
.session-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.ex-group-tag { font-size: 12px; font-weight: 600; color: var(--teal); letter-spacing: 1px; text-transform: uppercase; }
.fig-stage { width: 300px; height: 215px; }
.fig-stage .fig { width: 100%; height: 100%; }
.muscle-chips { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; min-height: 22px; margin-top: 6px; }
.m-chip { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; opacity: .95; }
.ex-name { font-size: 26px; margin-top: 4px; }
.ex-side { color: var(--warn); font-weight: 600; font-size: 15px; min-height: 20px; }

.timer-wrap { position: relative; width: 160px; height: 160px; margin: 6px 0; }
.timer-ring { width: 160px; height: 160px; transform: rotate(-90deg); }
.tring-bg { fill: none; stroke: var(--card); stroke-width: 8; }
.tring-fill { fill: none; stroke: var(--teal); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 440; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.cues { list-style: none; max-width: 520px; display: grid; gap: 5px; margin-top: 4px; }
.cues li { color: var(--muted); font-size: 13.5px; line-height: 1.4; padding-left: 18px; position: relative; }
.cues li::before { content: "›"; position: absolute; left: 4px; color: var(--teal); font-weight: 700; }
.purpose { display: none; }

.session-controls { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 14px 0 6px; }
.ctrl { width: 54px; height: 54px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 20px; cursor: pointer; transition: .15s; }
.ctrl:hover { border-color: var(--teal); background: var(--card2); }
.ctrl-main { width: 68px; height: 68px; font-size: 26px; background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #04201c; border: none; box-shadow: 0 8px 20px rgba(45,212,191,.3); }
.next-up { text-align: center; color: var(--muted); font-size: 13px; min-height: 18px; }

/* ---------- Rest ---------- */
.rest { display: flex; align-items: center; justify-content: center; height: 100vh; }
.rest-inner { text-align: center; }
.rest-label { color: var(--teal); font-size: 15px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.rest-num { font-size: 96px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.rest-next { color: var(--muted); font-size: 16px; margin: 18px 0 24px; }
.rest-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rest-next span { color: var(--text); font-weight: 600; }

/* ---------- Done ---------- */
.done { display: flex; align-items: center; justify-content: center; height: 100vh; }
.done-inner { text-align: center; max-width: 420px; }
.done-emoji { font-size: 64px; margin-bottom: 10px; }
.done h1 { font-size: 30px; margin-bottom: 10px; }
.done-sub { color: var(--muted); margin-bottom: 26px; line-height: 1.5; }
.done-stats { display: flex; gap: 40px; justify-content: center; margin-bottom: 30px; }
.dstat { display: flex; flex-direction: column; }
.dstat-val { font-size: 34px; font-weight: 800; color: var(--accent); }
.dstat span:last-child { font-size: 13px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(4,10,22,.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: 420px; max-width: 92vw; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; font-size: 14px; }
.field-row { flex-direction: row; align-items: center; justify-content: space-between; }
.field input[type=time] { background: var(--bg2); border: 1px solid var(--line); color: var(--text); padding: 10px; border-radius: 10px; font-size: 15px; }
.field input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); }
.modal-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- Stats ---------- */
.week-chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; height: 104px; }
.wbar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.wbar-track { width: 100%; max-width: 48px; height: 62px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: flex-end; overflow: hidden; }
.wbar-fill { width: 100%; background: linear-gradient(180deg, var(--accent), var(--teal-d)); border-radius: 8px 8px 0 0; transition: height .6s ease; min-height: 3px; }
.wbar-lbl { font-size: 12px; color: var(--muted); }
.wbar-cnt { font-size: 13px; font-weight: 700; color: var(--text); }
.wbar.current .wbar-lbl { color: var(--accent); font-weight: 700; }

/* segmented control */
.seg { display: flex; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button { flex: 1; background: transparent; border: none; color: var(--muted); padding: 9px 6px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: .15s; }
.seg button.active { background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff; font-weight: 600; }

/* ---------- Трекеры отказа ---------- */
.tracker-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tr-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; cursor: pointer; transition: .15s; display: flex; align-items: center; gap: 16px;
}
.tr-card:hover { transform: translateY(-2px); border-color: currentColor; }
.tr-icon { font-size: 30px; line-height: 1; }
.tr-body { flex: 1; min-width: 0; }
.tr-name { font-size: 15px; font-weight: 700; color: var(--text); }
.tr-days { font-size: 30px; font-weight: 800; line-height: 1.1; }
.tr-days small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.tr-stage { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.tr-start { font-size: 13px; color: var(--muted); }

/* детальный экран */
.trackerdetail { max-width: 780px; margin: 0 auto; padding: 24px 26px 44px; }
.td-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.td-head h1 { font-size: 25px; }
.td-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.td-hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: linear-gradient(150deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; margin-bottom: 16px;
}
.td-days { font-size: 58px; font-weight: 800; line-height: 1; }
.td-days small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.td-meta { flex: 1; min-width: 180px; }
.td-best { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.td-next { font-size: 14px; color: var(--accent); }
.td-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 14px; }
.td-card h3 { font-size: 15px; margin-bottom: 12px; color: var(--accent); }
.td-card p { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.td-stage-title { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.td-tip p { font-size: 16px; line-height: 1.55; font-style: italic; }
.td-howto { list-style: none; display: grid; gap: 10px; }
.td-howto li { font-size: 14px; line-height: 1.55; color: var(--muted); padding-left: 26px; position: relative; }
.td-howto li::before { content: "✓"; position: absolute; left: 4px; color: var(--teal); font-weight: 700; }
.td-warn {
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.4);
  border-radius: 14px; padding: 15px 18px; font-size: 13.5px; line-height: 1.6;
  color: var(--text); margin-bottom: 20px;
}
.td-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 720px) { .tracker-cards { grid-template-columns: 1fr; } }

/* ---------- Banner ---------- */
.banner {
  background: linear-gradient(135deg, rgba(251,146,60,.15), rgba(45,212,191,.12));
  border: 1px solid rgba(251,146,60,.4); color: var(--text);
  border-radius: 14px; padding: 13px 18px; margin-bottom: 18px; font-size: 14px; line-height: 1.5;
}
.banner::before { content: "📣 "; }

/* ---------- Search ---------- */
.search-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 18px;
}
.search-input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 13px 16px; border-radius: 12px; font-size: 15px; outline: none; transition: .15s;
}
.search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.15); }
.search-results { display: grid; gap: 8px; margin-top: 14px; max-height: 420px; overflow-y: auto; }
.search-results:empty { margin-top: 0; }
.sr-item { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.sr-item .mini-fig { width: 52px; height: 40px; flex-shrink: 0; }
.sr-item .mini-fig .fig { width: 100%; height: 100%; }
.sr-info { flex: 1; min-width: 0; }
.sr-info b { font-size: 14px; display: block; }
.sr-info small { color: var(--muted); font-size: 12px; }
.sr-tag { font-size: 11px; color: var(--accent); background: rgba(94,234,212,.1); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.sr-tag.band { color: var(--band); background: rgba(251,146,60,.12); }
.sr-try { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; white-space: nowrap; transition: .15s; }
.sr-try:hover { border-color: var(--teal); color: var(--accent); }
.sr-empty { color: var(--muted); font-size: 14px; padding: 12px 4px; text-align: center; }

/* ---------- Подстраницы (профиль, программы) ---------- */
.subpage { padding: 24px clamp(16px, 3vw, 48px) 48px; }
.sub-inner { max-width: 1000px; margin: 0 auto; }
.sub-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.sub-head h1 { font-size: 25px; }
.sub-note { color: var(--muted); font-size: 13px; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 4px; }
.field select, .field input[type=number], .field input[type=text] {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 13px; border-radius: 10px; font-size: 15px; font-family: inherit;
}
.field select:focus, .field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.calc-result { margin: 22px 0; }
.calc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.calc-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.calc-tile b { display: block; font-size: 26px; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-tile span { font-size: 12px; color: var(--muted); }
.calc-tile.accent { border-color: rgba(45,212,191,.45); }
.calc-tile.accent b { color: var(--accent); }
.macros { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.macros div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.macros b { display: block; font-size: 19px; color: var(--accent); }
.macros span { font-size: 12px; color: var(--muted); }
.calc-warn { margin-top: 12px; font-size: 13px; color: var(--warn); line-height: 1.5; }

.weekdays { display: flex; gap: 8px; flex-wrap: wrap; }
.wd {
  min-width: 52px; padding: 10px 6px; border-radius: 10px; cursor: pointer; font-size: 13px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted); transition: .15s ease-out;
}
.wd:hover { border-color: var(--teal); }
.wd.active { background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #04201c; border-color: transparent; font-weight: 700; }

.active-prog {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(150deg, var(--card), var(--bg2));
  border: 1px solid rgba(45,212,191,.4); border-radius: 16px; padding: 18px 20px; margin-bottom: 22px;
}
.prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 26px; }
.prog-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.prog-card.current { border-color: var(--teal); }
.pc-top { display: flex; align-items: center; justify-content: space-between; }
.pc-ico { font-size: 26px; }
.pc-place { font-size: 11px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.pc-name { font-size: 16px; font-weight: 700; }
.pc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.pc-split { font-size: 12px; color: var(--accent); }
.pc-btn { margin-top: 6px; }
.fig .weight { stroke: var(--warn); stroke-width: 5; stroke-linecap: round; }
.fig .weight-bar { fill: var(--warn); }
.fig .bench { fill: rgba(148,163,184,.35); }
.btn-primary:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }

/* ---------- Бег и шаги ---------- */
.act-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
.act-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 12px; }
.act-card h2 { font-size: 16px; }
.act-status { font-size: 12.5px; color: var(--muted); text-align: right; }
.act-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.step-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.step-big { font-size: 46px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.step-big small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.step-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.step-meta div { min-width: 0; }
.step-meta b { display: block; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.step-meta span { font-size: 12px; color: var(--muted); }
.step-bar { height: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.step-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width .3s; }
#btnStepToggle { width: 100%; }

.run-map { height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; background: var(--bg2); }
.run-map.map-fallback { display: flex; align-items: center; justify-content: center; }
.run-map canvas { max-width: 100%; height: auto; }
.run-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; text-align: center; }
.run-stats div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; }
.run-stats b { display: block; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.run-stats span { font-size: 11.5px; color: var(--muted); }
.run-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.run-controls button { flex: 1; min-width: 130px; }
.run-history { display: grid; gap: 10px; }
.run-item { display: flex; align-items: center; gap: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.run-thumb { background: var(--bg); border-radius: 8px; flex-shrink: 0; }
.run-item-info b { display: block; font-size: 14px; }
.run-item-info span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .run-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Leaflet в тёмной теме — приглушаем яркие тайлы */
:root[data-theme="dark"] .leaflet-tile { filter: brightness(0.85) contrast(1.05); }
.leaflet-container { background: var(--bg2); font: inherit; }

/* ---------- Гайд ---------- */
.guide-actions { margin-bottom: 22px; }
.guide-body { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; }
.guide-body .g-head { border-bottom: 2px solid var(--teal); padding-bottom: 14px; margin-bottom: 22px; }
.guide-body .g-head h1 { font-size: 23px; margin-bottom: 6px; }
.guide-body .g-head p { font-size: 12.5px; color: var(--muted); }
.guide-body h2 { font-size: 17px; margin: 26px 0 12px; color: var(--accent); }
.guide-body h3 { font-size: 14.5px; margin: 18px 0 8px; }
.guide-body p { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.guide-body ul { margin: 0 0 10px 20px; }
.guide-body li { font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; }
.g-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13.5px; }
.g-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 12.5px; }
.g-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.g-table tr:last-child td { border-bottom: none; }

@media print {
  body { background: #fff !important; color: #111 !important; }
  .view { display: none !important; }
  #guide { display: block !important; padding: 0 !important; }
  .no-print, .topbar, .disclaimer { display: none !important; }
  .guide-body { background: #fff !important; border: none !important; padding: 0 !important; border-radius: 0 !important; }
  .guide-body h2 { color: #0d9488 !important; page-break-after: avoid; }
  .guide-body h3, .g-table { page-break-inside: avoid; }
  .g-table th, .g-table td { border-bottom: 1px solid #ddd !important; }
  .guide-body .g-head { border-bottom: 2px solid #0d9488 !important; }
  .guide-body .g-head p, .g-table th { color: #555 !important; }
}

/* ---------- Первый запуск ---------- */
.ob-inner { max-width: 660px; margin: 0 auto; padding-top: 12px; }
.ob-logo { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(160deg, var(--teal), var(--teal-d)); margin-bottom: 18px; }
.ob-inner h1 { font-size: 27px; line-height: 1.2; margin-bottom: 10px; text-wrap: balance; }
.ob-lead { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 26px; max-width: 60ch; }
.consent { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 22px 0; }
.consent-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.consent-row input { width: 20px; height: 20px; accent-color: var(--teal); flex-shrink: 0; margin-top: 1px; }
.consent-details { margin-top: 12px; }
.consent-details summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.consent-details ul { margin: 12px 0 0 18px; display: grid; gap: 8px; }
.consent-details li { font-size: 13px; color: var(--muted); line-height: 1.55; }
.ob-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ob-warn { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.55; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- Оценка нагрузки ---------- */
.load-fb { margin: 8px 0 26px; }
.load-fb h3 { font-size: 17px; margin-bottom: 4px; }
.load-fb-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.load-fb-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fb-btn {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; color: var(--text);
  font-size: 14px; font-weight: 600; transition: .15s ease-out;
}
.fb-btn small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.fb-btn:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.fb-btn:disabled { opacity: .45; cursor: default; }
.load-fb-result { margin-top: 12px; font-size: 14px; color: var(--ok); min-height: 20px; }

/* ---------- Питание ---------- */
.nutrition { margin-top: 30px; }
.meals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 26px; }
.meal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.meal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.meal-head b { font-size: 15px; }
.meal-head span { font-size: 11.5px; color: var(--muted); }
.meal-kcal { font-size: 13px; color: var(--accent); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.meal-foods { display: grid; gap: 5px; }
.meal-foods span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.meal-foods i { color: var(--text); font-style: normal; }
.norm-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 26px; }
.norm-box p { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.norm-box p:last-child { margin-bottom: 0; }
.norm-note { color: var(--muted); font-size: 13px !important; }

/* ---------- Band select ---------- */
.bandselect { max-width: 900px; margin: 0 auto; padding: 24px 26px 40px; }
.bandselect-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.bandselect-head h1 { font-size: 26px; }
.bandselect-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.band-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.band-card {
  background: linear-gradient(150deg, var(--card), var(--bg2)); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 18px; cursor: pointer; text-align: center; transition: .15s;
}
.band-card:hover { border-color: var(--band); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(251,146,60,.18); }
.band-card .bc-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.band-card .bc-name { font-size: 17px; font-weight: 700; }
.band-card .bc-meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.band-card .bc-ex { color: var(--band); font-size: 12px; margin-top: 8px; line-height: 1.4; }
#btnBand { border-color: rgba(251,146,60,.4); color: var(--band); }
#btnBand:hover { border-color: var(--band); color: var(--band); }
#btnDownload { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Figures ---------- */
.fig .band { stroke: var(--band); stroke-width: 5; stroke-linecap: round; fill: none; }
.fig .anchor { fill: var(--muted); }
.fig { color: var(--accent); display: block; }
.fig .limb { stroke: currentColor; stroke-width: 6.5; stroke-linecap: round; fill: none; }
.fig .back { stroke: currentColor; stroke-width: 7.5; stroke-linecap: round; fill: none; }
.fig .head { fill: currentColor; }
.fig .joint { fill: #04201c; }
.fig .ground { stroke: rgba(148,163,184,.3); stroke-width: 3; stroke-linecap: round; }
.fig .wall { stroke: rgba(148,163,184,.3); stroke-width: 4; stroke-linecap: round; }

.fig-anim .pose-a { animation: swapA 3.2s ease-in-out infinite; }
.fig-anim .pose-b { animation: swapB 3.2s ease-in-out infinite; }
@keyframes swapA { 0%, 38% { opacity: 1; } 50%, 88% { opacity: 0; } 100% { opacity: 1; } }
@keyframes swapB { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.fig-hold .pose-hold { animation: breathe 3.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .fig-anim .pose-a { opacity: 1; }
  .fig-anim .pose-b { opacity: 0; }
}

@media (max-width: 720px) {
  .band-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .mini-stats { width: 100%; }
}
