/* FORMA — дизайн-система. Тёмная тема по умолчанию следует системе; ручной выбор — data-theme на <html>. */
@font-face {
  font-family: "Onest";
  src: url("../assets/fonts/onest-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-xs: 8px; --r-sm: 12px; --r: 18px; --r-lg: 26px; --r-xl: 32px; --r-pill: 999px;
  --gap: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;

  --bg: #0a0b0d;
  --bg-2: #101215;
  --surface: #15171c;
  --surface-2: #1c1f26;
  --surface-3: #262a33;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f5f6f8;
  --text-2: #b9bdc7;
  --text-3: #858a96;
  --accent: #d4ff3f;
  --accent-ink: #d4ff3f;
  --accent-soft: rgba(212, 255, 63, .12);
  --on-accent: #0b0d05;
  --violet: #8e72ff;
  --violet-soft: rgba(142, 114, 255, .16);
  --coral: #ff6b4a;
  --coral-soft: rgba(255, 107, 74, .15);
  --aqua: #38e1c9;
  --aqua-soft: rgba(56, 225, 201, .14);
  --amber: #ffc53d;
  --amber-soft: rgba(255, 197, 61, .15);
  --danger: #ff5a5f;
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .14);
  --glass: rgba(16, 18, 22, .72);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --img-outline: rgba(255, 255, 255, .08);
  --glow-1: rgba(142, 114, 255, .22);
  --glow-2: rgba(212, 255, 63, .08);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3ee;
  --bg-2: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f1f2ec;
  --surface-3: #e5e7df;
  --line: rgba(18, 20, 14, .08);
  --line-2: rgba(18, 20, 14, .15);
  --text: #12140e;
  --text-2: #4a4f43;
  --text-3: #737a6b;
  --accent: #d0fb38;
  --accent-ink: #4b6b00;
  --accent-soft: rgba(150, 200, 0, .14);
  --on-accent: #0b0d05;
  --violet: #6a4cff;
  --violet-soft: rgba(106, 76, 255, .1);
  --coral: #ea4f2b;
  --coral-soft: rgba(234, 79, 43, .1);
  --aqua: #0b9e8b;
  --aqua-soft: rgba(11, 158, 139, .1);
  --amber: #b97c00;
  --amber-soft: rgba(232, 161, 0, .14);
  --danger: #d9363a;
  --ok: #0e9a62;
  --ok-soft: rgba(14, 154, 98, .1);
  --glass: rgba(250, 250, 247, .78);
  --shadow: 0 1px 2px rgba(18, 20, 14, .05), 0 8px 24px -14px rgba(18, 20, 14, .18);
  --shadow-lg: 0 24px 60px -24px rgba(18, 20, 14, .3);
  --img-outline: rgba(0, 0, 0, .08);
  --glow-1: rgba(106, 76, 255, .10);
  --glow-2: rgba(190, 240, 30, .18);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f3ee; --bg-2: #fafaf7; --surface: #ffffff; --surface-2: #f1f2ec; --surface-3: #e5e7df;
    --line: rgba(18, 20, 14, .08); --line-2: rgba(18, 20, 14, .15);
    --text: #12140e; --text-2: #4a4f43; --text-3: #737a6b;
    --accent: #d0fb38; --accent-ink: #4b6b00; --accent-soft: rgba(150, 200, 0, .14); --on-accent: #0b0d05;
    --violet: #6a4cff; --violet-soft: rgba(106, 76, 255, .1); --coral: #ea4f2b; --coral-soft: rgba(234, 79, 43, .1);
    --aqua: #0b9e8b; --aqua-soft: rgba(11, 158, 139, .1); --amber: #b97c00; --amber-soft: rgba(232, 161, 0, .14);
    --danger: #d9363a; --ok: #0e9a62; --ok-soft: rgba(14, 154, 98, .1); --glass: rgba(250, 250, 247, .78);
    --shadow: 0 1px 2px rgba(18, 20, 14, .05), 0 8px 24px -14px rgba(18, 20, 14, .18);
    --shadow-lg: 0 24px 60px -24px rgba(18, 20, 14, .3); --img-outline: rgba(0, 0, 0, .08);
    --glow-1: rgba(106, 76, 255, .10); --glow-2: rgba(190, 240, 30, .18);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed; inset: -20vh -20vw auto auto;
  width: 80vw; height: 70vh; max-width: 900px;
  background: radial-gradient(closest-side, var(--glow-1), transparent 70%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: auto auto -25vh -20vw;
  width: 70vw; height: 60vh; max-width: 800px;
  background: radial-gradient(closest-side, var(--glow-2), transparent 70%);
  pointer-events: none; z-index: 0;
}
img, video { max-width: 100%; display: block; }
svg[aria-hidden="true"] { width: 1.2em; height: 1.2em; flex: none; }
svg.chev { width: 18px; height: 18px; color: var(--text-3); }
.stack > *, .grid > *, .bento > *, .wk-body > *, .wk-ex > *, .sets > *, .fold-body > * { min-width: 0; }
/* одноколоночные сетки не должны раздуваться по содержимому */
.stack, .bld-block, .bld-item, .prog-day, .thread, .list, .legend, .sets, .wk-ex, .wk-body, .prog-card .body, .fold-body, .block-group, .onb { grid-template-columns: minmax(0, 1fr); }
.row.wrap > .btn.grow, .row > .btn.grow { flex: 1 1 150px; }
.btn-col { display: grid; gap: 8px; }
.btn.wrap { white-space: normal; text-align: left; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 750; letter-spacing: -.025em; text-wrap: balance; line-height: 1.12; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; letter-spacing: -.015em; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.accent { color: var(--accent-ink); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───── каркас ───── */
#root { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.app { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  min-height: 60px;
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar .crumb { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: #0b0c0f url("../icons/icon-192.png") center/cover; box-shadow: 0 0 0 1px var(--line-2); flex: none; }
.view { padding: 4px 16px 24px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 6px; }
.page-head > .grow { flex: 1 1 240px; }
h1, h2, h3 { overflow-wrap: break-word; }
.card-head { flex-wrap: wrap; row-gap: 8px; }
.card-head > h2, .card-head > h3 { min-width: min(100%, max-content); }
.card > h3, .card > h2, .stack > h3, .stack > h2 { display: flex; align-items: center; gap: 8px; }

.tabbar {
  position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b));
  height: var(--tabbar-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px; gap: 2px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lg);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent; color: var(--text-3);
  border-radius: 18px; font-size: 11px; font-weight: 600;
  transition-property: color, background-color; transition-duration: .18s;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--text); background: var(--surface-3); }
.tab.on svg { color: var(--accent-ink); }
.tab .dot { position: absolute; top: 7px; right: calc(50% - 18px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-2); }

@media (min-width: 1024px) {
  .app { grid-template-columns: 268px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 6px;
    position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
    background: color-mix(in srgb, var(--bg-2) 80%, transparent);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .side .brand { padding: 4px 10px 18px; }
  .side-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 14px; border: 0; background: transparent;
    color: var(--text-2); font-weight: 600; text-align: left; width: 100%;
    transition-property: background-color, color; transition-duration: .15s;
  }
  .side-link svg { width: 20px; height: 20px; flex: none; }
  .side-link:hover { background: var(--surface); color: var(--text); }
  .side-link.on { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
  .side-link.on svg { color: var(--accent-ink); }
  .side-link .count { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 1px 7px; }
  .side-foot { margin-top: auto; display: grid; gap: 8px; }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; }
  .topbar { padding: 16px 28px 8px; }
  .view { padding: 4px 28px 32px; }
  .hide-desktop { display: none !important; }
}
@media (max-width: 1023px) { .hide-mobile { display: none !important; } }

/* ───── поверхности ───── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  padding: 18px;
  min-width: 0;
}
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.accent { background: var(--accent); color: var(--on-accent); }
.card.accent .muted, .card.accent .faint { color: rgba(11, 13, 5, .66); }
.card.violet { background: linear-gradient(135deg, #6f53ff, #9c7bff 60%, #c78bff); color: #fff; box-shadow: none; }
.card.violet .muted { color: rgba(255, 255, 255, .78); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.link { color: var(--accent-ink); font-weight: 650; font-size: 14px; background: none; border: 0; padding: 6px 2px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.stack { display: grid; gap: var(--gap); }
.stack.s8 { gap: 8px; } .stack.s12 { gap: 12px; } .stack.s24 { gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.bento { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .bento { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .bento > .span-2 { grid-column: span 2; }
}
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ───── кнопки ───── */
.btn {
  --bh: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--bh); padding: 0 20px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text);
  font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  transition-property: transform, background-color, opacity, box-shadow; transition-duration: .16s; transition-timing-function: var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.dark { background: var(--text); color: var(--bg); }
.btn.violet { background: var(--violet); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--coral-soft); color: var(--danger); }
.btn.sm { --bh: 38px; padding: 0 14px; font-size: 14px; }
.btn.lg { --bh: 56px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.icon { width: var(--bh); padding: 0; flex: none; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn {
  position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 0; background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
  transition-property: transform, background-color; transition-duration: .15s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───── чипы, бейджи, сегменты ───── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-2);
  border: 0; box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 14px; font-weight: 600; white-space: nowrap; flex: none;
  transition-property: background-color, color, box-shadow, transform; transition-duration: .15s;
}
.chip:active { transform: scale(.97); }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.on.acc { background: var(--accent); color: var(--on-accent); }
.chip svg { width: 16px; height: 16px; }
.chip.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1.4;
}
.tag svg { width: 13px; height: 13px; }
.tag.acc { background: var(--accent-soft); color: var(--accent-ink); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }
.tag.coral { background: var(--coral-soft); color: var(--coral); }
.tag.aqua { background: var(--aqua-soft); color: var(--aqua); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.solid { background: var(--accent); color: var(--on-accent); }
.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); max-width: 100%;
}
.seg button { border: 0; background: transparent; color: var(--text-2); font-weight: 650; font-size: 14px; padding: 9px 14px; border-radius: var(--r-pill); white-space: nowrap; min-height: 38px; transition-property: background-color, color; transition-duration: .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.block { display: grid; width: 100%; }
.seg.block button { white-space: normal; line-height: 1.15; padding-inline: 8px; }
@media (max-width: 360px) { .seg button { font-size: 13px; padding-inline: 6px; } }

/* ───── формы ───── */
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea, textarea.input, select.input {
  width: 100%; min-height: 50px; padding: 12px 15px;
  border-radius: 15px; border: 0;
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px; /* без зума на iOS */
  transition-property: box-shadow, background-color; transition-duration: .15s;
  -webkit-appearance: none; appearance: none;
}
.field select, select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field textarea, textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--violet); background: var(--surface); }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.form-error { background: var(--coral-soft); color: var(--danger); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 15px; background: var(--surface-2); cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--violet); flex: none; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .22s var(--spring); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--violet); outline-offset: 2px; }

/* ───── списки ───── */
.list { display: grid; }
.li {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px; border: 0; background: transparent; text-align: left; width: 100%;
  border-bottom: 1px solid var(--line); color: inherit; min-width: 0;
}
.li:last-child { border-bottom: 0; }
.li.top { align-items: flex-start; }
button.li, a.li { cursor: pointer; border-radius: 0; transition: background-color .15s; }
button.li:hover, a.li:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.li .t { font-weight: 650; }
.li > .tag, .li > .mini-ring, .li > .avatar, .li > .li-ico { flex: none; } /* метки справа не сжимаются и не наезжают на текст */
.li .s { font-size: 13px; color: var(--text-2); }
.li .chev { color: var(--text-3); width: 18px; height: 18px; flex: none; }
.li-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.li-ico svg { width: 21px; height: 21px; }
.li-ico.acc { background: var(--accent); color: var(--on-accent); }
.li-ico.violet { background: var(--violet-soft); color: var(--violet); }
.li-ico.coral { background: var(--coral-soft); color: var(--coral); }
.li-ico.aqua { background: var(--aqua-soft); color: var(--aqua); }
.li-ico.amber { background: var(--amber-soft); color: var(--amber); }
.li-ico.ok { background: var(--ok-soft); color: var(--ok); }

/* ───── аватары ───── */
.avatar {
  --s: 40px; width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 750; font-size: calc(var(--s) * .38); color: #fff; letter-spacing: -.02em;
  background: var(--av, linear-gradient(135deg, #7b5cff, #ff6b9a));
  box-shadow: 0 0 0 1px var(--img-outline);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { --s: 64px; }
.avatar.xl { --s: 84px; }
.avatar.sm { --s: 30px; }
/* аватар-кнопка в профиле: нажать — выбрать фото */
.avatar-edit { position: relative; flex: none; border-radius: 50%; padding: 0; background: none; border: 0; cursor: pointer; align-self: flex-start; }
.avatar-edit .cam {
  position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 0 3px var(--surface);
}
.avatar-edit .cam svg { width: 16px; height: 16px; }
.avatar-edit:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.profile-name { overflow-wrap: anywhere; }
@media (max-width: 360px) { .avatar-edit .avatar.xl { --s: 64px; } .avatar-edit .cam { width: 28px; height: 28px; } }

/* ───── медиа ───── */
.media { position: relative; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--img-outline); }
.media video, .media img { width: 100%; height: 100%; object-fit: cover; }
.media.contain video { object-fit: contain; }
.video-wrap { position: relative; aspect-ratio: 16 / 10; }
.video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Водяной знак на обучающих роликах (public/js/video.js): поверх видео, не мешает технике — мелко, полупрозрачно,
   в углу, не перехватывает нажатия. Цвета — постоянные значения «текст на видео», как у .thumb .play. */
.wm { position: absolute; top: 8px; left: 10px; z-index: 2; pointer-events: none; user-select: none; -webkit-user-select: none;
  font-size: 11px; font-weight: 650; letter-spacing: .04em; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
/* Сообщение вместо ролика: защищённый показ не подключён / устройство без аппаратной защиты / нет доступа */
.video-gate { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px 20px; text-align: center;
  background: var(--surface-2); color: var(--text-2); }
.drm-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--img-outline); border: 0; padding: 0; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.thumb .x svg { width: 14px; height: 14px; }
.thumb.add { display: grid; place-items: center; color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--line-2); background: transparent; border: 0; }
.thumb.add svg { width: 26px; height: 26px; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); }

/* ───── герой-карточка тренировки ───── */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); min-height: 300px; padding: 22px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  color: #fff; background: #0b0c0f;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
}
.hero .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 30%; transform: scale(1.02); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 9, 12, .05) 0%, rgba(8, 9, 12, .55) 45%, rgba(8, 9, 12, .94) 100%); }
.hero::after { content: ""; position: absolute; z-index: -1; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, rgba(142, 114, 255, .55), transparent); }
.hero h2 { font-size: clamp(28px, 7vw, 38px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.hero .eyebrow + h2 { margin-top: 4px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); font-size: 13px; font-weight: 650; }
.hero .meta svg { width: 15px; height: 15px; }
.hero .top { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 8px; }
.hero .live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 13px; }
.hero .live i { width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); animation: pulse 1.4s ease-in-out infinite; }
.hero .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.hero .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
@keyframes pulse { 50% { opacity: .35; } }

/* ───── кольца и прогресс ───── */
.rings { position: relative; width: 148px; height: 148px; flex: none; }
.rings svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rings .track { fill: none; stroke: var(--surface-3); }
.rings .val { fill: none; stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); }
.rings .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rings .center b { font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.rings .center small { font-size: 11px; color: var(--text-3); font-weight: 650; margin-top: 3px; max-width: 64px; margin-inline: auto; line-height: 1.15; }
.legend { display: grid; gap: 12px; }
.legend .lg { display: flex; align-items: center; gap: 10px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend b { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.pbar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.pbar.violet i { background: var(--violet); }
.mini-ring { --p: 0; --c: var(--accent); width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); }
.mini-ring::before { content: ""; grid-area: 1 / 1; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); }
.mini-ring span { grid-area: 1 / 1; font-size: 11px; font-weight: 800; z-index: 1; }

/* ───── KPI ───── */
.kpi { padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 4px; min-width: 0; }
.kpi b { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi.acc { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.kpi.acc span { color: rgba(11, 13, 5, .7); }
.kpi.violet { background: var(--violet); color: #fff; box-shadow: none; }
.kpi.violet span { color: rgba(255, 255, 255, .8); }

/* ───── внимание ───── */
.attn { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); width: 100%; border: 0; text-align: left; transition-property: transform, box-shadow; transition-duration: .15s; color: inherit; }
.attn:active { transform: scale(.985); }
.attn:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.attn .t { font-weight: 700; }
.attn .s { font-size: 13px; color: var(--text-2); }

/* ───── пустые состояния ───── */
.empty { text-align: center; padding: 34px 18px; display: grid; justify-items: center; gap: 10px; color: var(--text-2); }
.empty .ico { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty .ico svg { width: 28px; height: 28px; }
.empty h3 { color: var(--text); }

/* ───── вкладки внутри страницы ───── */
.ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 2px 16px; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { flex: none; border: 0; background: transparent; padding: 9px 14px; border-radius: 999px; color: var(--text-2); font-weight: 650; font-size: 14px; position: relative; }
.ptabs button.on { background: var(--surface-3); color: var(--text); }
.ptabs button .count { margin-left: 6px; background: var(--coral); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 800; }

/* ───── диалоги (нижние листы на телефоне) ───── */
dialog.sheet {
  border: 0; padding: 0; margin: 0; color: var(--text); background: var(--surface);
  width: 100%; max-width: 100%; max-height: 92dvh;
  inset: auto 0 0 0; position: fixed;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
  overflow: hidden; display: flex; flex-direction: column;
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet[open] { animation: sheet-in .32s var(--ease); }
dialog.sheet.closing { animation: sheet-out .2s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(5, 6, 8, .55); backdrop-filter: blur(3px); animation: fade-in .25s ease; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 6px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 20px; }
.sheet-body { padding: 8px 18px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet-foot { padding: 12px 18px calc(14px + var(--safe-b)); display: flex; gap: 10px; flex: none; border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
@media (min-width: 720px) {
  dialog.sheet { inset: 0; margin: auto; width: min(620px, calc(100% - 40px)); max-height: min(86dvh, 860px); border-radius: 28px; }
  dialog.sheet.wide { width: min(880px, calc(100% - 40px)); }
  dialog.sheet[open] { animation: pop-in .26s var(--ease); }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 20px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(.96) translateY(8px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ───── тосты ───── */
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-t)); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 18px; background: var(--text); color: var(--bg); font-weight: 650; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .3s var(--spring); }
.toast svg { width: 19px; height: 19px; flex: none; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok svg { color: var(--ok); }
.toast.out { animation: toast-out .2s ease-in forwards; }
.toast .pbar { flex: 1; background: rgba(127, 127, 127, .3); }
@keyframes toast-in { from { transform: translateY(-14px) scale(.96); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-8px); opacity: 0; } }

/* ───── баннеры ───── */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.banner svg { width: 20px; height: 20px; flex: none; }
.banner.warn { background: var(--amber-soft); color: var(--amber); }
.banner.err { background: var(--coral-soft); color: var(--danger); }
.banner.info { background: var(--violet-soft); color: var(--violet); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.netbar { position: fixed; z-index: 90; top: 0; left: 0; right: 0; padding: calc(6px + var(--safe-t)) 12px 6px; text-align: center; font-size: 13px; font-weight: 700; background: var(--amber); color: #1a1300; }

/* ───── мини-плеер «тренировка идёт» ───── */
.live-pill {
  position: fixed; z-index: 29; left: 18px; right: 18px; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b));
  display: flex; align-items: center; gap: 4px; padding: 6px;
  border-radius: 22px; color: var(--on-accent);
  background: var(--accent); box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  animation: toast-in .35s var(--spring);
}
.live-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 4px 4px 10px; border: 0; background: transparent; color: inherit; text-align: left; }
.live-min { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: rgba(11, 13, 5, .1); color: var(--on-accent); display: grid; place-items: center; }
.live-min svg { width: 20px; height: 20px; }
.live-mini { position: fixed; z-index: 29; right: 16px; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)); display: grid; justify-items: center; gap: 6px; animation: toast-in .35s var(--spring); }
.live-fab { --p: 0; width: 60px; height: 60px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--accent) 30%, var(--surface-3)) 0); box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.live-fab span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--on-accent); color: var(--accent); }
.live-fab svg { width: 20px; height: 20px; }
.live-expand { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--line-2); display: grid; place-items: center; }
.live-expand svg { width: 16px; height: 16px; }
body.has-live .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 110px); }
body.has-live-mini .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
.live-pill .t { font-weight: 800; }
.live-pill .s { font-size: 12px; opacity: .72; font-weight: 600; }
.live-pill .go { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: var(--on-accent); color: var(--accent); display: grid; place-items: center; flex: none; }
.live-pill .go svg { width: 18px; height: 18px; }
.live-pill i.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--on-accent); animation: pulse 1.4s infinite; flex: none; }
@media (min-width: 1024px) {
  .live-pill { left: auto; right: 28px; bottom: 24px; width: 400px; }
  .live-mini { right: 28px; bottom: 24px; }
  body.has-live .main, body.has-live-mini .main { padding-bottom: 120px; }
}

/* ───── неделя/календарь ───── */
.daystrip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; scroll-snap-type: x proximity; }
.daystrip::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 56px; padding: 10px 0 8px; border-radius: 18px; border: 0;
  display: grid; justify-items: center; gap: 2px; background: var(--surface); color: var(--text-2);
  box-shadow: 0 0 0 1px var(--line); scroll-snap-align: center;
  transition-property: background-color, color, transform; transition-duration: .15s;
}
.day:active { transform: scale(.96); }
.day small { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.day b { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.day i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.day i.s-submitted { background: var(--violet); }
.day i.s-accepted { background: var(--ok); }
.day i.s-rework { background: var(--coral); }
.day i.s-draft { background: var(--text-3); }
.day.on { background: var(--text); color: var(--bg); box-shadow: none; }
.day.on b { color: var(--bg); }
.day.today:not(.on) { box-shadow: inset 0 0 0 2px var(--accent); }
.weekdots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekdots div { display: grid; justify-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: var(--text-3); }
.weekdots i { width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; }
.weekdots i svg { width: 16px; height: 16px; }
.weekdots i.full { background: var(--accent); color: var(--on-accent); }
.weekdots i.part { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber); }
.weekdots i.today { box-shadow: inset 0 0 0 2px var(--text); }

/* ───── событие расписания ───── */
.event { display: flex; gap: 14px; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.event .when { display: grid; justify-items: center; align-content: center; min-width: 56px; padding: 8px 6px; border-radius: 14px; background: var(--surface-2); }
.event .when b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.event .when small { font-size: 11px; color: var(--text-3); font-weight: 650; text-transform: uppercase; }
.event.cancelled { opacity: .55; }
.event.cancelled .t { text-decoration: line-through; }

/* ───── чат ───── */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.msg { max-width: min(78%, 520px); padding: 10px 14px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--violet); color: #fff; box-shadow: none; border-bottom-right-radius: 6px; }
.msg:not(.me) { border-bottom-left-radius: 6px; }
.msg .time { font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.msg .att { margin: -4px -8px 6px; border-radius: 14px; overflow: hidden; max-width: 260px; }
.chat-day { align-self: center; font-size: 12px; font-weight: 650; color: var(--text-3); padding: 10px 0 4px; }
.composer {
  position: sticky; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b));
  display: flex; align-items: flex-end; gap: 8px; padding: 8px; margin-top: 8px;
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: 26px; box-shadow: 0 0 0 1px var(--line-2), var(--shadow);
}
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; border: 0; background: transparent; resize: none; padding: 11px 8px; font-size: 16px; outline: none; }
@media (min-width: 1024px) { .composer { bottom: 16px; } }

/* ───── программа / строитель ───── */
.prog-day { display: grid; gap: 10px; }
.ex-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: var(--surface-2); min-width: 0; }
.ex-thumb { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex: none; background: var(--surface-3) center/cover; box-shadow: 0 0 0 1px var(--img-outline); position: relative; }
.ex-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.ex-thumb .ph svg { width: 22px; height: 22px; }
.ex-row .name { font-weight: 700; }
.ex-row .presc { font-size: 13px; color: var(--text-2); }
.block-group { position: relative; display: grid; gap: 6px; padding: 10px; border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--violet-soft); background: color-mix(in srgb, var(--violet-soft) 40%, transparent); }
.block-group > .lbl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; color: var(--violet); text-transform: uppercase; letter-spacing: .06em; padding: 2px 4px; }
.block-group.circuit { box-shadow: inset 0 0 0 1.5px var(--aqua-soft); background: color-mix(in srgb, var(--aqua-soft) 40%, transparent); }
.block-group.circuit > .lbl { color: var(--aqua); }
.block-group.dropset { box-shadow: inset 0 0 0 1.5px var(--coral-soft); background: color-mix(in srgb, var(--coral-soft) 40%, transparent); }
.block-group.dropset > .lbl { color: var(--coral); }

.bld-block { border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); padding: 14px; display: grid; gap: 12px; }
.bld-block.err { box-shadow: 0 0 0 2px var(--danger); }
.bld-item { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.bld-item .head { display: flex; align-items: center; gap: 10px; }
.bld-item .letter { width: 28px; height: 28px; border-radius: 9px; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.mini-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); align-items: end; }
.bld-block .seg { width: 100%; display: grid; }
.bld-block .seg button { padding: 9px 4px; font-size: 13px; }
.mini-grid .field input, .mini-grid .field select { min-height: 44px; padding: 9px 12px; }
.restchips { display: flex; flex-wrap: wrap; gap: 6px; }
.restchips button { border: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 650; }
.restchips button.on { background: var(--text); color: var(--bg); }
.savebar { position: sticky; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)); z-index: 15; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; margin-top: 16px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lg); }
@media (min-width: 1024px) { .savebar { bottom: 16px; } }

/* ───── каталог ───── */
.prog-card { position: relative; display: grid; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); text-align: left; border: 0; padding: 0; color: inherit; transition-property: transform, box-shadow; transition-duration: .18s; }
.prog-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lg); }
.prog-card .cover { aspect-ratio: 16 / 9; background: var(--surface-3) center/cover; position: relative; }
.prog-card .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .45)); }
.prog-card .cover .tag { position: absolute; z-index: 1; top: 12px; left: 12px; }
.prog-card .body { padding: 14px 16px 16px; display: grid; gap: 8px; }

/* ───── тренировка ───── */
.wk { min-height: 100dvh; padding-bottom: calc(110px + var(--safe-b)); }
.wk-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 1px 0 var(--line); }
.wk-top .ttl { font-weight: 800; letter-spacing: -.02em; font-size: 16px; }
.wk-top .sub { font-size: 12px; color: var(--text-3); font-weight: 600; }
.wk-progress { height: 4px; background: var(--surface-3); position: sticky; top: calc(62px + var(--safe-t)); z-index: 19; }
.wk-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--accent)); transition: width .4s var(--ease); }
.wk-body { max-width: 760px; margin: 0 auto; padding: 16px; display: grid; gap: 18px; }
.wk-block { border-radius: var(--r-xl); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); overflow: hidden; }
.wk-block.done { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.wk-block-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wk-block-head.superset { background: var(--violet-soft); color: var(--violet); }
.wk-block-head.circuit { background: var(--aqua-soft); color: var(--aqua); }
.wk-block-head.dropset { background: var(--coral-soft); color: var(--coral); }
.wk-block-head.normal { color: var(--text-3); padding-bottom: 0; }
.wk-ex { padding: 14px 16px 6px; display: grid; gap: 10px; }
.wk-ex + .wk-ex { border-top: 1px dashed var(--line-2); }
.wk-ex h3 { font-size: 20px; letter-spacing: -.025em; display: flex; gap: 10px; align-items: center; }
.wk-ex h3 .letter { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; background: var(--violet); color: #fff; flex: none; }
.presc-line { display: flex; flex-wrap: wrap; gap: 6px; }
.presc-line .tag { font-size: 13px; padding: 5px 10px; }
.wk-note { font-size: 14px; padding: 10px 12px; border-radius: 14px; background: var(--amber-soft); color: var(--text); }
.wk-note b { color: var(--amber); }
details.fold { border-radius: 16px; background: var(--surface-2); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 650; font-size: 14px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary svg { width: 18px; height: 18px; flex: none; }
details.fold > summary .chev { margin-left: auto; transition: transform .2s; color: var(--text-3); }
details.fold[open] > summary .chev { transform: rotate(180deg); }
details.fold .fold-body { padding: 0 14px 14px; font-size: 14px; color: var(--text-2); display: grid; gap: 8px; }
details.fold.hint > summary svg:first-child { color: var(--violet); }
.sets { padding: 6px 12px 14px; display: grid; gap: 8px; }
.round-lbl { font-size: 12px; font-weight: 750; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px 0; }
.set {
  display: grid; grid-template-columns: 34px 1fr 1fr 56px; align-items: center; gap: 8px;
  padding: 8px; border-radius: 18px; background: var(--surface-2);
  transition-property: background-color, box-shadow; transition-duration: .2s;
}
.set.has-label { grid-template-columns: 34px minmax(0, 1.1fr) 1fr 1fr 56px; }
.set .no { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-3); color: var(--text-2); }
.set .lbl { font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set label { position: relative; display: block; min-width: 0; }
.set label small { position: absolute; top: 5px; left: 11px; font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; pointer-events: none; }
.set input { width: 100%; height: 50px; border: 0; border-radius: 13px; background: var(--surface); padding: 14px 10px 0; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: left; box-shadow: inset 0 0 0 1px var(--line); -moz-appearance: textfield; }
.set input::-webkit-outer-spin-button, .set input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--violet); }
.set input:disabled { opacity: .6; }
.tick {
  width: 56px; height: 50px; border-radius: 15px; border: 0; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
  transition-property: background-color, color, transform; transition-duration: .18s; transition-timing-function: var(--spring);
}
.tick svg { width: 24px; height: 24px; }
.tick:active { transform: scale(.92); }
.set.done { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.set.done .tick { background: var(--accent); color: var(--on-accent); }
.set.done .no { background: var(--accent); color: var(--on-accent); }
.set .timer-btn { width: 56px; height: 50px; border-radius: 15px; border: 0; background: var(--violet); color: #fff; display: grid; place-items: center; }
.set .timer-btn svg { width: 22px; height: 22px; }
.drops { grid-column: 1 / -1; display: grid; gap: 6px; padding: 2px 0; }
.drop { display: grid; grid-template-columns: 34px 1fr 1fr 56px; gap: 8px; align-items: center; }
.drop .drop-no { background: var(--coral-soft); color: var(--coral); font-size: 12px; }
.drop input { height: 44px; font-size: 16px; padding-top: 13px; }
.drop .tick { width: 56px; height: 44px; border-radius: 13px; }
.drop.done .tick { background: var(--coral); color: #fff; }
.efforts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 16px 14px; }
.efforts .lbl { font-size: 12px; font-weight: 700; color: var(--text-3); margin-right: 4px; }
.vid-row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.vid-row .btn { border-color: var(--violet); color: var(--violet); box-shadow: inset 0 0 0 1.5px var(--violet); }
.wk-foot { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 -1px 0 var(--line); }
.wk-foot .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.wk-foot .btn { flex: 1; }
.rest {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(86px + var(--safe-b));
  max-width: 520px; margin: 0 auto; padding: 16px; border-radius: 28px;
  background: #0d0e12; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), var(--shadow-lg);
  display: flex; align-items: center; gap: 16px; animation: toast-in .35s var(--spring);
}
.rest .rring { width: 76px; height: 76px; flex: none; position: relative; }
.rest .rring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest .rring circle { fill: none; stroke-width: 7; }
.rest .rring .tr { stroke: rgba(255, 255, 255, .12); }
.rest .rring .vl { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.rest .rring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rest { flex-wrap: wrap; }
.rest .ctl { display: flex; gap: 8px; width: 100%; }
.rest .ctl button { flex: 1; border: 0; border-radius: 14px; min-height: 46px; padding: 0 12px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 15px; }
.rest .ctl button.skip { background: var(--accent); color: var(--on-accent); }
.rest .lbl { font-size: 12px; color: rgba(255, 255, 255, .6); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.rest .nx { font-weight: 700; font-size: 14px; }
.savestate { font-size: 12px; font-weight: 650; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.savestate.pending { color: var(--amber); }
.savestate svg { width: 14px; height: 14px; }

/* сводка */
.big-stat { display: grid; gap: 2px; }
.big-stat b { font-size: 34px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.big-stat span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.feel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel button { border: 0; border-radius: 16px; padding: 12px 4px; background: var(--surface-2); display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.feel button b { font-size: 20px; color: var(--text); }
.feel button.on { background: var(--violet); color: #fff; }
.feel button.on b { color: #fff; }

/* таблица подходов в отчёте */
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.cmp th { text-align: left; font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px; }
.cmp td { padding: 9px 6px; border-top: 1px solid var(--line); }
.cmp td.ok { color: var(--ok); font-weight: 700; }
.cmp td.miss { color: var(--text-3); }
.thread { display: grid; gap: 10px; }
.thread .it { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.thread .it.trainer, .thread .it.admin { background: var(--violet-soft); }
.thread .it .who { font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }

/* графики */
.chart { width: 100%; height: auto; max-height: 300px; display: block; overflow: visible; } /* на компьютере график не растягивается на весь экран */
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--violet); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .ar { fill: url(#chartFill); }
.chart .pt { fill: var(--surface); stroke: var(--violet); stroke-width: 4; }
.chart text { fill: var(--text-3); font-size: 20px; font-weight: 600; font-family: var(--font); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars div { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: center; height: 100%; align-content: end; font-size: 10px; color: var(--text-3); font-weight: 650; white-space: nowrap; }
.bars i { width: 100%; max-width: 36px; border-radius: 10px 10px 6px 6px; background: var(--accent); min-height: 4px; }
.bars i.zero { background: var(--surface-3); }

/* вход */
.login { min-height: 100dvh; display: grid; align-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.login-inner { width: 100%; max-width: 1080px; margin: 0 auto; display: grid; gap: 28px; }
@media (min-width: 900px) { .login-inner { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; } }
.login-hero { display: grid; gap: 18px; }
.login-hero h1 { font-size: clamp(40px, 9vw, 76px); line-height: .95; letter-spacing: -.05em; font-weight: 850; }
.login-hero h1 em { font-style: normal; color: var(--accent-ink); }
.login-hero .lead { font-size: 17px; color: var(--text-2); max-width: 480px; }
.login-visual { position: relative; height: 220px; border-radius: var(--r-xl); overflow: hidden; box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); background: #0b0c0f url("../assets/img/forma-athlete.webp") center 30%/cover; }
.login-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(10, 11, 13, .1), rgba(10, 11, 13, .1) 50%, rgba(142, 114, 255, .35)); }
.login-visual .stickers { position: absolute; z-index: 1; left: 14px; bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.login-visual .stickers span { padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 750; background: var(--accent); color: var(--on-accent); }
.login-visual .stickers span.v { background: var(--violet); color: #fff; }
.demo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.demo-btn { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: left; color: inherit; transition-property: transform, box-shadow; transition-duration: .15s; }
.demo-btn:hover { box-shadow: 0 0 0 1.5px var(--accent-ink); }
.demo-btn:active { transform: scale(.98); }
.demo-btn .t { font-weight: 750; }
.demo-btn .s { font-size: 12px; color: var(--text-2); }

/* онбординг */
.onb { max-width: 640px; margin: 0 auto; padding: calc(20px + var(--safe-t)) 16px calc(120px + var(--safe-b)); display: grid; gap: 22px; }
.onb-steps { display: flex; gap: 6px; }
.onb-steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-3); }
.onb-steps i.on { background: var(--accent); }
.opt-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.opt { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 20px; border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: left; color: inherit; font-weight: 650; min-height: 64px; transition-property: box-shadow, background-color, transform; transition-duration: .15s; }
.opt:active { transform: scale(.98); }
.opt.on { box-shadow: 0 0 0 2px var(--accent-ink); background: var(--accent-soft); }
.opt .emo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.opt .emo svg { width: 20px; height: 20px; }
.opt.on .emo { background: var(--accent); color: var(--on-accent); }
.onb-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 -1px 0 var(--line); }
.onb-foot .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.onb-foot .btn.primary { flex: 1; }

/* анимации входа экрана */
.enter > * { animation: rise .45s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .05s; }
.enter > *:nth-child(3) { animation-delay: .1s; }
.enter > *:nth-child(4) { animation-delay: .15s; }
.enter > *:nth-child(5) { animation-delay: .2s; }
.enter > *:nth-child(n+6) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.pop { animation: popcheck .35s var(--spring); }
@keyframes popcheck { 40% { transform: scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* заставка загрузки */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .brand-mark { width: 72px; height: 72px; border-radius: 22px; animation: pulse 1.3s ease-in-out infinite; }

/* документы и согласия */
.consent { display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.consent.done { opacity: .7; }
.consent .cbx { width: 24px; height: 24px; margin-top: 1px; accent-color: var(--violet); flex: none; }
.consent .btn { justify-self: start; }
.legal-text { display: grid; gap: 10px; font-size: 15px; line-height: 1.55; color: var(--text); }
.legal-text h2 { font-size: 22px; margin-top: 4px; }
.legal-text h3 { font-size: 17px; margin-top: 10px; }
.legal-text ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.legal-text p { color: var(--text-2); }
