:root {
  --bg: #101217;
  --surface: #191c23;
  --surface-2: #222631;
  --line: #2d3240;
  --text: #f1f3f7;
  --muted: #8d94a5;
  --accent: #d4ff3a;
  --accent-ink: #12150a;
  --up: #3fd68a;
  --keep: #ffb547;
  --down: #ff5d73;
  --water: #4cb8ff;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", var(--font);
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, #171b25 0, var(--bg) 320px) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0.4rem 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font: 700 1.3rem/1 var(--font-num); letter-spacing: 0.02em; text-transform: uppercase; }

.view {
  max-width: 640px; margin: 0 auto;
  padding: 16px 16px calc(96px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 8px; }
.row.gap { gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { color: var(--accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.loading, .empty { padding: 48px 0; text-align: center; color: var(--muted); display: grid; gap: 14px; justify-items: center; }

/* Карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.card.grid-2 { display: grid; }
details.card > summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #262c3b 0%, var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: var(--accent); opacity: 0.08; filter: blur(8px);
}
.hero-title { font: 700 1.9rem/1.1 var(--font-num); }
.section-title { margin-top: 6px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Кнопки */
.btn {
  min-height: var(--tap); padding: 0 18px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; transition: transform 120ms var(--ease), background 150ms;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.wide { width: 100%; }
.btn.finish { background: transparent; border: 2px solid var(--accent); color: var(--accent); min-height: 56px; }
.btn.danger-text { background: transparent; border-color: transparent; color: var(--down); }
.hero-btn { min-height: 64px; font-size: 1.2rem; margin-top: 6px; box-shadow: 0 10px 30px -10px var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--surface-2); cursor: pointer; flex-shrink: 0;
}
.icon-btn:disabled { opacity: 0.3; }
.chip {
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 0.9rem;
}
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

/* Формы */
.form { gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.field em { font-style: normal; font-weight: 600; }
.field em.pos { color: var(--up); }
.field em.neg { color: var(--down); }
.input {
  min-height: var(--tap); width: 100%; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
textarea.input { padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; }
.hint { font-size: 0.82rem; color: var(--muted); margin: -6px 0 0; }

.auth { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.auth-logo { font-size: 64px; text-align: center; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: var(--radius); padding: 4px; border: 1px solid var(--line); }
.segmented button { min-height: 42px; border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented button.active { background: var(--surface-2); color: var(--text); }

/* Тренировка */
.workout-bar {
  position: sticky; top: 62px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.clock { font: 700 1.35rem/1 var(--font-num); color: var(--accent); font-variant-numeric: tabular-nums; }
.exercise { transition: opacity 200ms; }
.exercise.done { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.exercise.done .set-input { opacity: 0.75; }
.ex-head { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.ex-title { flex: 1; min-width: 0; }
.ex-target { font-family: var(--font-num); font-size: 1.1rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ex-target strong { font-size: 1.35rem; color: var(--accent); }
.info-dot { color: var(--muted); font-size: 1.2rem; }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.thumb.placeholder { display: grid; place-items: center; font-size: 26px; }
.reason { font-size: 0.88rem; color: var(--muted); margin: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 600 0.75rem/1.4 var(--font); margin-left: 6px; }
.badge.up { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.badge.keep { background: color-mix(in srgb, var(--keep) 18%, transparent); color: var(--keep); }
.badge.down { background: color-mix(in srgb, var(--down) 18%, transparent); color: var(--down); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip {
  min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); font: 600 0.95rem var(--font-num); cursor: pointer; color: var(--keep);
}
.set-chip.hit { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.set-input { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.add-set { grid-column: span 2; min-height: 54px; font-size: 1.05rem; }
.stepper { display: flex; flex-direction: column; gap: 4px; }
.stepper-label { font-size: 0.75rem; color: var(--muted); }
.stepper-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step-btn { height: 52px; border: 0; background: var(--surface-2); font-size: 1.5rem; cursor: pointer; }
.step-btn:active { background: var(--line); }
.stepper-value {
  height: 52px; width: 100%; min-width: 0; border: 0; background: transparent; text-align: center;
  font: 700 1.5rem var(--font-num); font-variant-numeric: tabular-nums;
}
.feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.feel > span { grid-column: 1 / -1; }
.feel .chip { padding: 0 6px; }
.plan-list { margin: 0; padding-left: 22px; display: grid; gap: 4px; color: var(--muted); }
.plan-list li::marker { color: var(--accent); font-family: var(--font-num); }

/* Таймер отдыха */
.rest {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--safe-bottom)); z-index: 20;
  max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.7);
  animation: rise 250ms var(--ease);
}
.rest[hidden] { display: none; }
.rest .chip { background: rgb(0 0 0 / 0.12); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.rest-label { font-weight: 600; }
.rest-time { font: 700 1.8rem/1 var(--font-num); flex: 1; font-variant-numeric: tabular-nums; }
.rest-go { flex: 1; font-weight: 700; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Сводка */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.stats.card { display: grid; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font: 700 1.7rem/1.1 var(--font-num); }
.stat span { color: var(--muted); font-size: 0.8rem; }
.stat .badge { margin: 4px 0 0; align-self: flex-start; }
.tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.next { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.next strong { font-family: var(--font-num); font-size: 1.05rem; }
.next.increase strong { color: var(--up); }
.next.keep strong { color: var(--keep); }
.next.decrease strong { color: var(--down); }
.next.start strong { color: var(--text); }

/* Вода */
.water-hero { align-items: center; }
.ring { position: relative; width: 190px; height: 190px; }
.ring svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--water); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font: 700 2.1rem/1 var(--font-num); }
.ring-text span { color: var(--muted); font-size: 0.85rem; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.water-btn { padding: 0; color: var(--water); font-family: var(--font-num); font-size: 1.1rem; }
.water-hero form { width: 100%; }
.water-hero form .input { flex: 1; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 130px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track { flex: 1; width: 100%; max-width: 28px; display: flex; align-items: flex-end; background: var(--bg); border-radius: 8px; overflow: hidden; }
.bar { width: 100%; background: color-mix(in srgb, var(--water) 55%, transparent); border-radius: 8px 8px 0 0; transition: height 400ms var(--ease); }
.bar.met { background: var(--water); }
.bar-label { font-size: 0.72rem; color: var(--muted); }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.entries li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.entries li:last-child { border-bottom: 0; }

/* Графики */
.line-chart svg { width: 100%; height: auto; display: block; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--accent); }
.line-chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.line-chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.line-chart .axis.end { text-anchor: end; }
.big-num { font: 700 1.6rem/1 var(--font-num); color: var(--accent); }

/* История */
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history-item {
  width: 100%; min-height: 58px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left;
}
.history-item strong { font-family: var(--font-num); font-size: 1.15rem; }
.h-date { font-weight: 600; text-transform: capitalize; }

/* Тренажёры */
.machine-tile { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.tile-main { flex: 1; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left; cursor: pointer; min-width: 0; padding: 0; }
.tile-main img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.tile-main > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.order { display: flex; flex-direction: column; gap: 4px; }
.order .icon-btn { width: 34px; height: 30px; border-radius: 8px; font-size: 0.7rem; }
.machine-photo { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.machine-photo.placeholder { display: grid; place-content: center; text-align: center; font-size: 42px; color: var(--muted); gap: 4px; }
.technique { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; font-size: 0.93rem; border-left: 3px solid var(--accent); }

/* Нижнее меню */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 0.68rem; border-radius: var(--radius-sm);
}
.tabs a span { font-size: 1.3rem; filter: grayscale(1); opacity: 0.7; transition: transform 150ms var(--ease); }
.tabs a.active { color: var(--accent); }
.tabs a.active span { filter: none; opacity: 1; transform: translateY(-2px); }

/* Всплывающие окна */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0.6); display: flex; align-items: flex-end; justify-content: center; animation: fade 200ms; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px 16px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px;
  animation: rise 250ms var(--ease);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 40;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: var(--radius);
  max-width: calc(100% - 32px); transition: opacity 200ms, transform 250ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--down); color: var(--down); }
.toast.ok { border-color: var(--up); color: var(--up); }

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

/* ---------- Схемы тренажёров ---------- */
.schematic { display: block; width: 100%; height: auto; background: var(--bg); border-radius: var(--radius); }
.schematic .sx-floor { stroke: var(--line); stroke-width: 2; }
.schematic .sx-frame, .schematic .sx-rod { stroke: #6f7789; stroke-width: 3; fill: none; stroke-linecap: round; }
.schematic .sx-rod { stroke-width: 1.2; }
.schematic .sx-frame-box { fill: none; stroke: #6f7789; stroke-width: 2.5; }
.schematic circle.sx-frame { fill: var(--bg); stroke-width: 2; }
.schematic .sx-pad { fill: #2c3240; stroke: #9aa2b4; stroke-width: 1.5; }
.schematic .sx-move { stroke: var(--accent); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.schematic rect.sx-move { fill: color-mix(in srgb, var(--accent) 25%, transparent); stroke-width: 2; }
.schematic .sx-grip { fill: var(--accent); }
.schematic .sx-stack { fill: color-mix(in srgb, var(--accent) 35%, transparent); stroke: var(--accent); stroke-width: 1; }
.schematic .sx-weight { fill: var(--accent); }
.schematic .sx-plate { fill: color-mix(in srgb, var(--accent) 20%, transparent); stroke: var(--accent); stroke-width: 3; }
.schematic .sx-cable { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.schematic .sx-motion { fill: none; stroke: var(--water); stroke-width: 1.6; stroke-dasharray: 4 3; stroke-linecap: round; }
.visual { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--bg); }
.visual.thumb { width: 64px; height: 48px; flex-shrink: 0; border-radius: 10px; }
.visual.big { max-height: 360px; }
.machine-name { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Каталог и программа ---------- */
.section-switch { margin-bottom: 2px; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex-shrink: 0; }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.machine-grid.compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.machine-card {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  transition: border-color 150ms, transform 150ms var(--ease);
}
.machine-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.machine-card:active { transform: scale(0.98); }
.machine-card.current { border-color: var(--accent); }
.machine-card strong { font-size: 0.92rem; line-height: 1.25; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.ok { color: var(--up); background: color-mix(in srgb, var(--up) 15%, transparent); white-space: nowrap; }
.tile-grid { display: grid; gap: 10px; }
.tile-main .visual.thumb { width: 64px; height: 48px; }
.detail-grid { display: grid; gap: 14px; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photo-strip figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.photo-strip figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--muted); }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ex-list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ex-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.ex-list p { margin: 2px 0 0; }
.small-btn { min-height: 38px; padding: 0 12px; font-size: 0.85rem; flex-shrink: 0; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row.gap > select.input { flex: 1; min-width: 150px; }
.cols-2 { display: grid; gap: 14px; align-items: start; }
.cols-2 > .stack { gap: 14px; }

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
  .view { max-width: 960px; padding-left: 24px; padding-right: 24px; }
  .machine-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .tile-grid, .history-list { grid-template-columns: 1fr 1fr; display: grid; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rest { max-width: 560px; }
  .sheet { border-radius: var(--radius-lg); margin-bottom: 24px; max-width: 720px; }
  .overlay { align-items: center; }
  .auth { max-width: 440px; margin: 0 auto; width: 100%; }
}
@media (min-width: 820px) {
  .workout-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (min-width: 900px) {
  .cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1600px) {
  .workout-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Компьютер: меню слева, контент на всю ширину ---------- */
@media (min-width: 1100px) {
  :root { --sidebar: 232px; }
  .topbar { padding-left: calc(var(--sidebar) + 40px); padding-right: 40px; }
  .view { max-width: 1320px; margin: 0 0 0 var(--sidebar); padding: 28px 40px 48px; }
  .tabs {
    top: 0; right: auto; width: var(--sidebar); z-index: 20;
    display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
    border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
  }
  .tabs::before { content: "ЗАЛ"; font: 700 1.4rem/1 var(--font-num); letter-spacing: 0.04em; padding: 6px 12px 24px; color: var(--accent); }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; font-size: 0.95rem; }
  .tabs a:hover { background: var(--surface-2); color: var(--text); }
  .tabs a.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .tabs a span { font-size: 1.15rem; }
  .tabs a.active span { transform: none; }
  .topbar h1 { font-size: 1.5rem; }
  .tile-grid, .history-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .machine-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .rest { left: var(--sidebar); right: 0; bottom: 24px; }
  .workout-bar { top: 74px; }
  .hero { padding: 28px; }
  .view > .hero, .view > .card:not(.exercise) { max-width: none; }
}
