/* ContactK9 — стили приложения и кабинета тренера */
:root {
  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --fg: #1A1E2B;
  --muted: #5D6375;
  --line: #D9DCE6;
  --accent: #2447D6;
  --accent-soft: #E2E7FB;
  --on-accent: #FFFFFF;
  --leaf: #9A600C;
  --leaf-soft: #F5E8D2;
  --danger: #B42318;
  --qr-bg: #FFFFFF;
  --logo-filter: none;
  --logo-blend: multiply;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141B; --surface: #1B1E28; --fg: #E9EBF2; --muted: #9AA0B3; --line: #2E3243;
    --accent: #7F98FF; --accent-soft: #232B4D; --on-accent: #0E1330;
    --leaf: #E2A64B; --leaf-soft: #3A2E1B; --danger: #FF8A7A;
    --logo-filter: invert(1); --logo-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12141B; --surface: #1B1E28; --fg: #E9EBF2; --muted: #9AA0B3; --line: #2E3243;
  --accent: #7F98FF; --accent-soft: #232B4D; --on-accent: #0E1330;
  --leaf: #E2A64B; --leaf-soft: #3A2E1B; --danger: #FF8A7A;
  --logo-filter: invert(1); --logo-blend: screen;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Бренд */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emblem { position: relative; display: block; flex: none; width: var(--es, 40px); aspect-ratio: 570 / 620; overflow: hidden; }
.emblem img { position: absolute; max-width: none; width: 169.8%; height: auto; left: -35.1%; top: -16.1%; filter: var(--logo-filter); mix-blend-mode: var(--logo-blend); }
.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-name { font: 700 15px/1 var(--font-display); letter-spacing: 0.01em; }
.brand-sub { font-size: 13px; line-height: 1.3; color: var(--muted); }

/* Общие */
.eyebrow { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow .today-tag { color: var(--accent); }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 1rem + 2.2vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
h3 { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 16px;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--fg);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  cursor: pointer; text-align: center;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn:disabled { opacity: 0.55; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.back { align-self: flex-start; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.error { margin: 0; color: var(--danger); font-weight: 600; font-size: 0.92rem; }
.muted { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 50; max-width: calc(100% - 32px); width: max-content;
  background: var(--fg); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- Клиент: шапка ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: end; }
.hero.has-photo { grid-template-columns: 148px minmax(0, 1fr); }
.portrait, .portrait-ph {
  width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 5;
  object-fit: cover; border-radius: 20px; display: block; background: var(--accent-soft);
}
.portrait-ph { display: grid; place-items: center; color: var(--accent); }
.portrait-ph svg { width: 42%; height: auto; }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.day-progress { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.count { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.count .num { font-family: var(--font-display); font-weight: 500; font-size: 2.1rem; line-height: 1; }
.count .of { color: var(--muted); font-size: 0.95rem; }
.segbar { display: flex; gap: 8px; }
.seg-group { display: grid; gap: 3px; min-width: 0; }
.seg { height: 8px; border-radius: 3px; background: var(--line); transition: background-color .2s ease; }
.seg.on { background: var(--accent); }
.segbar.full .seg.on { background: var(--leaf); }
.left { margin: 0; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.left.full { color: var(--leaf); font-weight: 600; }

.note-box { background: var(--accent-soft); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.note-box p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.trainer-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  border: 1.5px dashed var(--accent); border-radius: 14px; padding: 10px 14px; font-size: 0.9rem;
}

/* ---------- Клиент: неделя ---------- */
.streak { font-size: 0.85rem; font-weight: 600; color: var(--leaf); background: var(--leaf-soft); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 10px; background: transparent; border: 1.5px solid transparent; border-radius: 14px; cursor: pointer; }
.day:hover { background: var(--surface); }
.day[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); }
.dow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day.is-today .dow { color: var(--accent); }
.ring-wrap { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 40px; height: 40px; }
.ring .track { stroke: var(--line); }
.ring .val { stroke: var(--accent); }
.day.full .ring .val { stroke: var(--leaf); }
.dnum { position: relative; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.day.full .dnum { color: var(--leaf); }
.viewing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; background: var(--leaf-soft); border-radius: 12px; padding: 10px 14px; font-size: 0.92rem; }

/* ---------- Клиент: упражнения ---------- */
.list { display: flex; flex-direction: column; gap: 14px; }
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s ease; }
.ex.complete { border-color: var(--leaf); }
.ex-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; }
.ex-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.ex-title h3 { overflow-wrap: anywhere; }
.chip { font-size: 0.78rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.done { color: var(--leaf); border-color: var(--leaf); background: var(--leaf-soft); }
.dose { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hint { margin: 0; color: var(--muted); font-size: 0.93rem; max-width: 62ch; grid-column: 1 / -1; white-space: pre-wrap; overflow-wrap: anywhere; }
.sessions { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.sess {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 64px; padding: 10px 12px; text-align: left;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.sess:hover { border-color: var(--accent); }
.sess-name { font-weight: 600; font-size: 0.95rem; padding-right: 22px; }
.sess-reps { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.tick svg { width: 12px; height: 12px; opacity: 0; }
.tick path { stroke: var(--accent); }
.sess[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sess[aria-pressed="true"] .sess-reps { color: var(--on-accent); opacity: 0.8; }
.sess[aria-pressed="true"] .tick { background: var(--on-accent); border-color: var(--on-accent); }
.sess[aria-pressed="true"] .tick svg { opacity: 1; }

.report { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.report p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.rules ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rules li { border-top: 2px solid var(--line); padding-top: 10px; font-size: 0.93rem; color: var(--muted); }
.rules li b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.foot { font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.foot .warn { color: var(--leaf); font-weight: 600; }

/* ---------- Тренер: список ---------- */
.notice { margin: 0; border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px 14px; font-size: 0.92rem; color: var(--muted); }
.notice b { color: var(--fg); }
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font: 700 1.1rem/1 var(--font-display); }
.plan-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-name { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.plan-meta { font-size: 0.85rem; color: var(--muted); }
.plan-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--leaf-soft); border-radius: 12px; padding: 10px 12px; font-size: 0.92rem; }
.empty { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 16px; padding: 22px 18px; color: var(--muted); }
.empty p { margin: 0; max-width: 56ch; }
@media (min-width: 640px) {
  .plan { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .plan-actions { grid-column: auto; justify-content: flex-end; }
}

/* ---------- Тренер: форма ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.field-hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.input { font-size: 1rem; color: var(--fg); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 72px; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-prev { width: 88px; aspect-ratio: 4 / 5; height: auto; border-radius: 12px; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); flex: none; }
.photo-prev svg { width: 40%; height: auto; }
.ex-edits { display: flex; flex-direction: column; gap: 12px; }
.ex-edit { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.ex-edit .input { background: var(--surface); }
.ex-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-num { font: 500 0.95rem/1 var(--font-display); color: var(--accent); }
.icon-btns { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--fg); }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; }
.lib { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-add { border: 1.5px dashed var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 0.88rem; cursor: pointer; color: var(--fg); }
.chip-add:hover { border-color: var(--accent); color: var(--accent); }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 8px;
}

/* ---------- Тренер: ссылка ---------- */
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: start; }
.share-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.linkbox { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.86rem; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
.qr-wrap { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr { width: 184px; max-width: 100%; padding: 12px; border-radius: 14px; background: var(--qr-bg); }
.qr svg { display: block; width: 100%; height: auto; }
.qr-wrap figcaption { font-size: 0.82rem; color: var(--muted); text-align: center; max-width: 184px; }

@media (max-width: 620px) {
  .share { grid-template-columns: minmax(0, 1fr); }
  .qr-wrap { align-items: flex-start; }
}
@media (max-width: 560px) {
  .hero.has-photo { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
  .portrait, .portrait-ph { border-radius: 14px; }
  .count .num { font-size: 1.8rem; }
  .ex, .card, .report { padding: 14px; }
  .sess { padding: 9px 10px; min-height: 60px; }
  .tick { top: 8px; right: 8px; width: 18px; height: 18px; }
  .rules ul { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Приложение ---------- */
.topbar { flex-wrap: nowrap; align-items: flex-start; }
.topbar > .link-btn, .topbar > .btn { flex: none; margin-top: 4px; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }
body.has-nav .wrap { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
body.has-nav .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
div.day { cursor: default; }
div.day:hover { background: transparent; }

.appnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.appnav a {
  flex: 1 1 0; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 8px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font-size: 0.78rem; font-weight: 600; line-height: 1.2;
}
.appnav a svg { width: 24px; height: 24px; }
.appnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Вход */
.login { display: flex; flex-direction: column; gap: 22px; max-width: 460px; width: 100%; margin: 0 auto; }
.login-mark { width: 84px; height: 84px; border-radius: 24px; background: var(--accent); display: grid; place-items: center; overflow: hidden; }
.login-mark .emblem img { filter: invert(1); mix-blend-mode: screen; }
.login .card { gap: 14px; }
.login .btn.primary { min-height: 50px; font-size: 1rem; }
.small-print { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* Фото */
.portrait-box { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 0; }
button.portrait-ph { border: 1.5px dashed var(--accent); cursor: pointer; display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; font-weight: 600; font-size: 0.85rem; padding: 10px; }
button.portrait-ph svg { width: 36%; }
.portrait-box .link-btn { font-size: 0.85rem; align-self: center; }
.photo-step { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 18px; padding: 18px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
.photo-step .ph { width: 96px; aspect-ratio: 4 / 5; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.photo-step .ph svg { width: 44%; height: auto; }
.photo-step-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.photo-step-text p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* Баннеры */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border-radius: 14px; padding: 12px 14px; font-size: 0.95rem; }
.banner.update { background: var(--leaf-soft); }
.banner.update b { color: var(--leaf); }
.banner.offline { border: 1.5px dashed var(--line); color: var(--muted); }
.install { background: var(--accent-soft); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.install p { margin: 0; font-size: 0.93rem; }
.install .actions { gap: 8px 14px; }

/* Тропа: карточка на главной */
.trail-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; color: inherit; text-decoration: none; }
.trail-card:hover { border-color: var(--accent); }
.trail-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; }
.trail-ico svg { width: 28px; height: 28px; }
.trail-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trail-title { font-weight: 600; }
.trail-meta { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.trail-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.trail-bar span { display: block; height: 100%; background: var(--leaf); border-radius: 4px; }
.trail-go { color: var(--accent); font-weight: 600; font-size: 0.92rem; white-space: nowrap; }

/* Кабинет тренера */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .input { flex: 1 1 220px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.stat-table th, .stat-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.stat-table th { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.stat-table th.num { text-align: right; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 0 1 160px; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--leaf-soft); color: var(--leaf); }
.pill.blue { background: var(--accent-soft); color: var(--accent); }
.pill.green { background: color-mix(in srgb, #2E8752 16%, transparent); color: #2E8752; }
.pill.red { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.queue { border: 1.5px solid var(--leaf); }
.review-video video { display: block; width: 100%; max-height: 72vh; border-radius: 16px; background: #000; }
.step-details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.step-details[open] summary { margin-bottom: 10px; }
.step-details ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 0.93rem; }
.sub-hist h3 { font-size: 0.95rem; margin-bottom: 8px; }
.sub-hist p { margin: 0; }
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sub-list li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 3px; font-size: 0.93rem; }
.sub-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sub-meta { color: var(--muted); font-size: 0.85rem; }
.sub-meta a { color: var(--accent); }
.sub-comment { background: var(--bg); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.up-line { display: grid; gap: 6px; }
.up-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; font-weight: 600; }
.up-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }

.trail-stat { font-size: 0.82rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.trail-stat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.trail-stat.wait { color: var(--leaf); } .trail-stat.wait::before { background: var(--leaf); }
.trail-stat.back { color: var(--danger); } .trail-stat.back::before { background: var(--danger); }
.about-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px dashed var(--line); border-radius: 18px; padding: 12px 16px; color: inherit; text-decoration: none; }
.about-card:hover { border-color: var(--accent); }
.about-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.about-ico svg { width: 22px; height: 22px; }

/* Стартовая страница: видео, о тренере, как пользоваться, пакеты, связь */
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.6); }
.video-box video, .video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
#landingTop:empty, #landingMore:empty { display: none; }
.landing { display: flex; flex-direction: column; gap: 28px; }
.lp-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--leaf); }
.lp-about { gap: 10px; }
.lp-about h2 { font-weight: 700; font-size: 1.2rem; }
.lp-text p { margin: 0 0 10px; overflow-wrap: anywhere; }
.lp-text p:last-child { margin-bottom: 0; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: howto; }
.howto li { counter-increment: howto; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 0.95rem; }
.howto li::before { content: counter(howto); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 0.95rem/1 var(--font-display); }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.pkg { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pkg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.pkg-price { font: 700 1rem/1.2 var(--font-display); color: var(--accent); white-space: nowrap; }
.pkg-text { color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.pkg-text p { margin: 0 0 6px; }
.pkg-text p:last-child { margin-bottom: 0; }
.pkg-text ul { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.contact-btn { min-height: 52px; font-size: 1rem; width: 100%; text-decoration: none; }

@media (max-width: 560px) {
  .photo-step { grid-template-columns: 72px minmax(0, 1fr); padding: 14px; }
  .photo-step .ph { width: 72px; }
  .trail-card { grid-template-columns: 44px minmax(0, 1fr); }
  .trail-ico { width: 44px; height: 44px; }
  .trail-go { grid-column: 2; }
}
