/* Практика Тишины — Mini App. Палитра из design/ref/DESIGN_sochi.md: шалфей, хвоя, крем; главная кнопка — синий логотипа
   Giving Team (--coral, решение 11.11.2026). Цвета фона и текста подставляет core.js из themeParams Telegram (--bg, --card, --text, --muted ...).
   Сетка отступов 4/8. Радиусы: --r-lg 28 (фото, лист, плитки, окна, меню), --r-card 20 (карточки), --r-md 16 (вложенное). */
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/manrope-cyrillic-wght-normal.woff2?v=1) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/manrope-latin-wght-normal.woff2?v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #E6E1F6; --card: rgba(255, 255, 255, .74); --text: #1D2433; --muted: #545E78; --line: rgba(40, 40, 90, .08);
  --pine: #223E54; --on-pine: #FFFFFF; --sage: #B9B0D8; --mist: rgba(233, 228, 247, .85); --tonal: rgba(226, 220, 245, .95); --on-tonal: #3E3A66;
  --coral: #223E54; --on-coral: #FFFFFF; --danger: #A3291A; --danger-bg: #FFF1EE; --ok: #2F6B3F; --ok-bg: #E4F1E6;
  --warn: #8A4B00; --warn-bg: #FFF2DE; --photo1: #E9E4F7; --photo2: #DDE8F4; --photo-text: #3E3A66;
  --bg-grad: linear-gradient(180deg, #E6E1F6 0%, #DDE9F7 340px, #F5E9E2 900px, #FBE4D8 100%); --bg-end: #FBE4D8;
  --sheet: linear-gradient(180deg, #E2E3F6 0px, rgba(226, 227, 246, 0) 220px); --bar-bg: rgba(255, 255, 255, .55);
  --r-lg: 28px; --r-card: 20px; --r-md: 16px; --r-pill: 9999px; --pad: 16px; --maxw: 560px;
  --safe-top: 0px; --safe-bottom: 0px; --bar-h: 96px;
  /* нижняя безопасная зона: Telegram (--tg-*), iOS (env), или то, что передал core.js */
  --sb: max(var(--safe-bottom), env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  /* Тени мягкие и прозрачные: работают и на кремовом, и на белом. */
  --shadow: 0 1px 2px rgba(62, 58, 102, .04), 0 4px 16px -4px rgba(62, 58, 102, .08);
  --shadow-lift: 0 2px 4px rgba(62, 58, 102, .05), 0 12px 32px -8px rgba(62, 58, 102, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
html.dark { color-scheme: dark; --shadow: none; --shadow-lift: 0 12px 32px -8px rgba(0, 0, 0, .5); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* В7: scroll-padding — фокус по Tab не прячется за закреплённые панели */
html { scroll-padding-bottom: calc(var(--bar-h) + 16px); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { background: var(--bg-end, var(--bg)); }
body {
  background: var(--bg-grad, var(--bg)); background-attachment: fixed; min-height: 100vh; color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--pine); }
html.dark a:not(.btn):not(.tile):not(.nav a):not(.sitem):not(.sitem-link):not(.plink):not(.ava):not(.chip) { color: var(--link); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0; text-wrap: pretty; }

/* ---------- Фон-фото (решение владельца 11.11.2026, вариант «Фото фоном»): размытое фото медитации у окна под всеми экранами,
   сверху вниз подкрашено палитрой; карточки — стекло, фон просвечивает. Слой фиксированный, не прокручивается. ---------- */
html { background: var(--bg-end, var(--bg)); }
body { background: transparent !important; }
#bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(240,236,250,.3), rgba(240,236,250,.45) 50%, rgba(251,228,216,.75)), url(img/bg_window.webp?v=1) 65% 15% / cover, var(--bg-grad); }
html.dark #bgfx { background: linear-gradient(180deg, rgba(21,19,41,.45), rgba(21,19,41,.75) 50%, rgba(42,31,44,.88)), url(img/bg_window.webp?v=1) 65% 15% / cover, var(--bg-grad); }
.card, .sitem, .cta-bar, .sheet { -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
/* Устаревшие WebView без backdrop-filter: карточки плотнее, чтобы текст читался. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .sitem, .cta-bar { background-color: rgba(255,255,255,.88) !important; }
  html.dark .card, html.dark .sitem, html.dark .cta-bar { background-color: rgba(30,28,56,.9) !important; }
}

/* ---------- Заставка ---------- */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center; background: var(--bg-grad, var(--bg)); z-index: 50; }
.splash .logo { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.logo-img { display: block; width: 160px; height: auto; border-radius: 8px; }
html.dark .logo-img { background: #FFFFFF; padding: 6px 10px; border-radius: 8px; }
.splash .name { font-size: 22px; font-weight: 700; color: var(--pine); }
html.dark .splash .name { color: var(--text); }
.splash .stage { color: var(--muted); font-size: 15px; min-height: 24px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--tonal); border-top-color: var(--pine);
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash .fail { display: none; max-width: 340px; }
.splash.failed .fail { display: block; }
.splash.failed .spinner, .splash.failed .stage { display: none; }
.splash .fail h2 { margin-bottom: 8px; }
.splash .fail p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Каркас ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: calc(16px + var(--safe-top)) var(--pad) calc(var(--bar-h) + 16px); }
.page.no-nav { padding-bottom: calc(var(--bar-h) + 16px); }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 8px; }
.topbar h1 { font-size: 22px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 16px 0 8px; margin-left: -8px;
  border: 0; background: transparent; color: var(--pine); font-weight: 650; font-size: 15px; border-radius: var(--r-pill); cursor: pointer;
  transition-property: transform, background-color; transition-duration: .15s; transition-timing-function: ease-out; }
.back:active { transform: scale(.96); }
html.dark .back { color: var(--link); }
.back svg { width: 20px; height: 20px; }
.section { margin-top: 32px; }
.section > h2, .section > h3 { margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.hidden { display: none !important; }

.card { background: var(--card); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.tint { background: var(--mist); box-shadow: none; }
.card h3 { margin-bottom: 4px; }

/* ---------- Кнопки ---------- */
/* Главная — заливка синим логотипа; вторичные — тихие: мягкий фон без обводки. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px;
  border-radius: var(--r-pill); border: 0; cursor: pointer; font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none;
  transition-property: transform, background-color, box-shadow; transition-duration: .15s; transition-timing-function: ease-out;
  user-select: none; text-align: center; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 1; cursor: default; background: var(--line); color: var(--muted); border: 2px dashed var(--muted); box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; }
.btn.sm { min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn-primary { background: var(--coral); color: var(--on-coral); box-shadow: 0 6px 16px -6px rgba(34, 62, 84, .4); }
html.dark .btn-primary { box-shadow: none; }
.btn-strong { background: var(--pine); color: var(--on-pine); }
.btn-tonal { background: var(--tonal); color: var(--on-tonal); }
.btn-soft, .btn-outline { background: var(--mist); color: var(--on-tonal); }
html.dark .btn-soft, html.dark .btn-outline { background: var(--tonal); color: var(--on-tonal); }
.btn-ghost { background: transparent; color: var(--on-tonal); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 2px solid var(--danger); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.btn-row.maps > .btn { flex: 1 1 150px; padding: 10px 12px; font-size: 15px; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--muted); font-weight: 600; text-decoration: underline;
  cursor: pointer; font-size: 15px; white-space: nowrap; }
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px var(--pad) calc(16px + var(--sb));
  background: var(--bar-bg, var(--bg)); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
.cta-bar .inner { max-width: var(--maxw); margin: 0 auto; }
.cta-bar .hint { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.cta-bar .consent-note { margin: 8px 0 0; text-align: center; line-height: 1.4; }

/* ---------- Нижнее меню ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 12px calc(12px + var(--sb)); pointer-events: none; }
.nav .dock { pointer-events: auto; max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-around; gap: 4px;
  padding: 4px; border-radius: var(--r-lg); background: var(--card); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 0 0 1px rgba(62, 58, 102, .06), 0 1px 2px rgba(62, 58, 102, .05), 0 8px 24px -8px rgba(62, 58, 102, .2); }
html.dark .nav .dock { box-shadow: 0 0 0 1px var(--line), 0 8px 24px -8px rgba(0, 0, 0, .5); }
.nav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
  border-radius: 24px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 650;
  transition-property: background-color, color; transition-duration: .15s; transition-timing-function: ease-out; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on, html.dark .nav a.on { color: var(--on-tonal); background: var(--tonal); }

/* ---------- Фото сверху во всю ширину + нижний лист ---------- */
.hero { position: relative; height: 280px; margin: calc(-16px - var(--safe-top)) calc(-1 * var(--pad)) 0; overflow: hidden; background: var(--photo1); }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hero.short { height: 200px; }
.hero.short img { object-position: center 38%; }
.hero .back { position: absolute; top: calc(12px + var(--safe-top)); left: 12px; margin: 0; z-index: 2;
  background: rgba(255, 255, 255, .92); color: #223E54; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
html.dark .hero .back { color: #223E54; }
.sheet { position: relative; margin: -28px calc(-1 * var(--pad)) 0; padding: 24px var(--pad) 0; background: var(--sheet, var(--bg)); border-radius: var(--r-lg) var(--r-lg) 0 0; }
@media (max-height: 600px) { .hero.short { height: 136px; } }
@media (min-width: 700px) {
  .hero { margin: 0; border-radius: var(--r-lg); height: 320px; }
  .hero.short { height: 240px; }
  .hero img { outline: 1px solid rgba(0, 0, 0, .06); outline-offset: -1px; border-radius: inherit; }
  .sheet { margin: 0; padding: 24px 0 0; border-radius: 0; background: transparent; }
}

/* ---------- Главная ---------- */
.hello { margin-top: 8px; }
.hello h1 { font-size: 32px; letter-spacing: -0.02em; }
.hello p { margin-top: 8px; color: var(--muted); font-size: 16px; }
/* Шапка главной: круглый аватар из Telegram + приветствие + статус-чип. */
.hello-row { display: flex; align-items: center; gap: 14px; }
.hello-row h1 { font-size: 28px; line-height: 1.15; }
.ava { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #b9b0d8, #a9c7e6 55%, #f3c9b4); color: #223e54; font-size: 22px; font-weight: 700; text-decoration: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 6px 18px rgba(80,70,140,.18); }
html.dark .ava { color: #223e54; box-shadow: 0 0 0 3px rgba(255,255,255,.14), 0 6px 18px rgba(0,0,0,.35); }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--mist); color: var(--on-tonal); text-decoration: none; max-width: 100%; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }
.chip-ok .dot { background: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-warn .dot { background: var(--warn); }
.lead-hello { margin-top: 14px; color: var(--muted); font-size: 16px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
/* Плитка: фото + затемнение снизу; белый текст поверх — контраст ≥ 4,5:1 (замер по пикселям под строкой). */
.tile { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 232px; padding: 16px;
  border-radius: var(--r-lg); overflow: hidden; background: #2A3A31; color: #FFFFFF; text-align: left; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow); transition-property: transform, box-shadow; transition-duration: .2s; transition-timing-function: var(--ease); }
.tile:active { transform: scale(.98); }
.tile-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16, 28, 22, 0) 0%, rgba(16, 28, 22, .12) 20%, rgba(16, 28, 22, .74) 40%, rgba(16, 28, 22, .88) 100%); }
.tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.tile.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--coral); }
.ph-text { display: block; }
.tile b { display: block; font-size: 18px; line-height: 1.25; font-weight: 750; letter-spacing: -0.01em; color: #FFFFFF; text-wrap: balance; }
.tile span.sub { display: block; font-size: 13px; line-height: 1.4; color: #FFFFFF; margin-top: 4px; text-wrap: pretty; }
.tile .go { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: #223E54; }
.tile .go svg { width: 18px; height: 18px; transform: rotate(-90deg); }

.slist { display: flex; flex-direction: column; gap: 8px; }
.sitem { display: flex; align-items: center; gap: 16px; padding: 12px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow);
  cursor: pointer; text-decoration: none; color: inherit; }
.sitem .date { flex: 0 0 56px; height: 60px; border-radius: var(--r-md); background: var(--mist); display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--on-tonal); font-variant-numeric: tabular-nums; }
.sitem .date b { font-size: 20px; line-height: 1; }
.sitem .date span { font-size: 12px; font-weight: 650; margin-top: 4px; }
.sitem .info { flex: 1 1 auto; min-width: 0; }
.sitem .info b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.sitem .info span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.sitem .btn { flex: 0 0 auto; margin-left: 4px; }
.sitem-link { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; min-height: 60px; }
a.sitem { min-height: 88px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  background: var(--card); color: var(--on-tonal); line-height: 1.3; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.soft { background: var(--tonal); color: var(--on-tonal); }
/* «Ближайшая запись» на главной */
.card.next { margin-top: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.next-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.next-row { display: flex; align-items: center; gap: 14px; }
.next-row .date { flex: 0 0 56px; height: 60px; border-radius: var(--r-md); background: var(--mist); display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--on-tonal); font-variant-numeric: tabular-nums; }
.next-row .date b { font-size: 20px; line-height: 1; }
.next-row .date span { font-size: 12px; font-weight: 650; margin-top: 4px; }
.next-row .info { flex: 1 1 auto; min-width: 0; }
.next-row .info b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.next-row .info span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.card.next .btn svg { width: 18px; height: 18px; }
/* «Мой путь»: ступени к «Основам» */
.path { display: flex; flex-direction: column; gap: 0; }
.pstep { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.pstep:last-child { padding-bottom: 0; }
.pstep .mark { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 14px;
  background: var(--mist); color: var(--on-tonal); position: relative; z-index: 1; }
.pstep:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.pstep.done .mark { background: var(--ok-bg); color: var(--ok); }
.pstep.done:not(:last-child)::before { background: var(--ok); opacity: .5; }
.pstep.now .mark { background: var(--pine); color: var(--on-pine); box-shadow: 0 0 0 4px var(--mist); }
.pstep .mark svg { width: 18px; height: 18px; }
.pstep .txt { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.pstep .txt b { display: block; }
.pstep .txt span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.pstep .txt .here { display: inline-block; margin: 0 0 0 6px; font-size: 12px; font-weight: 700; color: var(--on-tonal); background: var(--tonal); border-radius: 999px; padding: 1px 8px; vertical-align: 2px; line-height: 1.4; }
.pbar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; margin-top: 10px; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, #b9b0d8, #a9c7e6, #f3c9b4); border-radius: inherit; }
/* Отзыв: звёзды */
.stars { display: flex; gap: 6px; justify-content: center; margin: 4px 0 12px; }
.stars button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--mist); color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.stars button.on { background: #ffe9b8; color: #b07a00; }
html.dark .stars button.on { background: rgba(255,195,112,.25); color: #ffc370; }
.stars-ro { color: #b07a00; letter-spacing: 2px; }
/* Практика недели и анкета */
.card.week-card { margin-top: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.week-link { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  text-decoration: none; color: inherit; padding: 12px 14px; border-radius: var(--r-md); background: var(--mist); }
.week-link b { font-size: 18px; }
.week-link span { grid-column: 1; font-size: 14px; color: var(--muted); }
.week-link svg { grid-column: 2; grid-row: 1 / span 2; width: 20px; height: 20px; transform: rotate(-90deg); color: var(--on-tonal); }
html.dark .week-link { color: var(--text); }
.wk-head { margin-top: 4px; }
.wk-head h1 { font-size: 30px; margin-top: 4px; }
.wk-block h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-tonal); margin-bottom: 10px; }
.wk-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.wk-steps { margin: 0; padding: 0; list-style: none; counter-reset: wk; display: flex; flex-direction: column; gap: 14px; }
.wk-steps > li { counter-increment: wk; position: relative; padding-left: 40px; }
.wk-steps > li::before { content: counter(wk); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tonal); color: var(--on-tonal); font-weight: 750; font-size: 14px; }
.wk-steps > li > b { display: block; margin-bottom: 4px; }
.wk-steps .wk-list { margin-top: 6px; }
.wk-end { font-weight: 700; }
.wq-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.wq-opts .opt { flex: 1 1 auto; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 650; cursor: pointer; }
.wq-opts.scale .opt { flex: 1 1 0; }
.wq-opts .opt.on { border-color: var(--pine); background: var(--tonal); color: var(--on-tonal); }
html.dark .wq-opts .opt.on { border-color: var(--link); }
.tpl { padding: 12px; border-radius: var(--r-md); background: var(--mist); }
.tpl p { margin: 4px 0 8px; font-size: 15px; }
html.dark .stars-ro { color: #ffc370; }

/* ---------- Карточка занятия ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.fact { background: var(--mist); border-radius: var(--r-md); padding: 12px 16px; }
.fact span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.fact b { display: block; font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wblock { background: var(--card); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); }
.wblock b { display: block; font-size: 15px; margin-bottom: 4px; }
.wblock p { font-size: 14px; line-height: 1.45; color: var(--muted); }
.wblock .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--mist); display: grid; place-items: center; margin-bottom: 8px; color: var(--pine); }
html.dark .wblock .dot { color: var(--link); }
.wblock .dot svg { width: 18px; height: 18px; }
/* Цены — одна карточка со строками, а не стопка отдельных плашек. */
.prices { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 4px 20px; }
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.price:last-child { border-bottom: 0; }
.price b { white-space: nowrap; font-variant-numeric: tabular-nums; }
details.fold { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); }
details.fold summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 12px 20px;
  font-weight: 700; cursor: pointer; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary svg { width: 20px; height: 20px; transition: transform .2s var(--ease); flex: 0 0 auto; }
details.fold[open] summary svg { transform: rotate(180deg); }
details.fold .body { padding: 0 20px 16px; }
ul.rules { margin: 0; padding: 0 0 0 20px; }
ul.rules li { margin: 8px 0; font-size: 15px; line-height: 1.45; }

/* ---------- Вход (согласие): без тяжёлой плашки, крупный заголовок, фото сверху ---------- */
.consent-head { text-align: center; }
.consent-head .logo-sm { margin-bottom: 16px; }
.consent-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.consent-text { margin-top: 20px; }
.consent-text p { font-size: 15px; line-height: 1.6; }
.consent-text p + p { margin-top: 12px; }
.consent-revoke { margin-top: 16px; }

/* ---------- Формы ---------- */
.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--card); color: var(--text);
  font-size: 16px; outline: none; transition: border-color .15s ease-out; }
.input:focus { border-color: var(--pine); }
html.dark .input:focus { border-color: var(--link); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--muted); opacity: 1; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow);
  cursor: pointer; min-height: 56px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: 0 0 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); background: var(--card); display: grid; place-items: center; margin-top: 1px; }
.check .box svg { width: 16px; height: 16px; opacity: 0; color: var(--on-pine); }
.check input:checked + .box { background: var(--pine); border-color: var(--pine); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { outline: 3px solid var(--sage); outline-offset: 2px; }
.check .t { font-size: 15px; line-height: 1.45; }
.check .t em { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger); font-size: 14px; font-weight: 600; margin-top: 8px; }
.note { padding: 16px; border-radius: var(--r-md); background: var(--mist); font-size: 15px; line-height: 1.5; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 16px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: left; width: 100%;
  transition-property: border-color, background-color; transition-duration: .15s; transition-timing-function: ease-out; }
.opt.on { border-color: var(--pine); background: var(--mist); }
html.dark .opt.on { border-color: var(--link); }
.opt b { display: block; font-size: 16px; }
.opt span { display: block; font-size: 13px; color: var(--muted); }
.opt .sum { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Мои записи ---------- */
.steps { display: flex; gap: 4px; margin: 16px 0 8px; }
.steps i { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.done { background: var(--sage); }
.steps i.now { background: var(--pine); }
html.dark .steps i.now { background: var(--link); }
.steplabels { display: flex; gap: 4px; }
.steplabels span { flex: 1 1 0; min-width: 0; font-size: 12px; line-height: 1.25; color: var(--muted); font-weight: 600; overflow-wrap: normal; hyphens: none; }
.steplabels span.now { color: var(--text); font-weight: 800; }
.state { font-weight: 700; margin-top: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-variant-numeric: tabular-nums; }
.kv.col { flex-direction: column; gap: 4px; }
.kv.col b { text-align: left; }
.kv.col span { font-size: 14px; }
/* М10: длинное имя без пробелов не ломает вёрстку */
h1, .nm, .kv b { overflow-wrap: anywhere; }
.acc { font-size: 28px; font-weight: 800; letter-spacing: .04em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
/* К2: scroll-margin чтобы счёт ЕРИП не прятался за нижней панелью */
#pay-result { scroll-margin-bottom: calc(var(--bar-h) + 16px); }
/* В2: стек кнопок в нижнем окне */
.modal .box .sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.card.booking h3 { font-size: 16px; }
/* «Отменить запись» и соседи в одну строку; отмена — отдельной строкой. */
.booking .btn-row > .btn { white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.booking .btn-row > .btn-ghost { flex: 1 1 100%; }

/* ---------- О нас ---------- */
.links { display: flex; flex-direction: column; }
.links a { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
html.dark .links a { color: var(--text); }
.links a:last-child { border-bottom: 0; }
.links a .ic { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--mist); display: grid; place-items: center; color: var(--pine); }
html.dark .links a .ic { color: var(--link); }
.links a .ic svg { width: 20px; height: 20px; }
.links a b { display: block; font-size: 16px; }
.links a span { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Сотрудники ---------- */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--mist); margin-bottom: 16px; }
.seg button { flex: 1 1 0; min-height: 44px; border: 0; border-radius: var(--r-pill); background: transparent; font-weight: 700; cursor: pointer; color: var(--muted); white-space: nowrap;
  transition-property: background-color, color, box-shadow; transition-duration: .15s; transition-timing-function: ease-out; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(62, 58, 102, .08), 0 2px 8px -2px rgba(62, 58, 102, .1); }
.person { padding: 16px; }
.person .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.person .top > div:first-child { min-width: 0; }
.person .nm { font-size: 17px; font-weight: 750; }
.person .meta { font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.person .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.person .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.person .acts .btn { min-height: 52px; padding: 10px 12px; font-size: 15px; }
.person .acts .btn.wide { grid-column: 1 / -1; }
.phone-big { font-size: 24px; font-weight: 800; letter-spacing: .01em; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.outcomes .opt { min-height: 52px; justify-content: center; text-align: center; font-weight: 700; padding: 10px; }
.outcomes .opt.wide { grid-column: 1 / -1; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); }
.search .input { padding-left: 48px; border-radius: var(--r-pill); }
.msgprev { white-space: pre-wrap; background: var(--mist); border-radius: var(--r-md); padding: 16px; font-size: 15px; }
/* «Пришёл»: явная кнопка с обводкой; выключенная выглядит иначе (серая, пунктир). */
.btn-attend { background: var(--card); color: var(--pine); border: 2px solid var(--pine); }
html.dark .btn-attend { color: var(--text); border-color: var(--pine); }
a.plink { display: block; text-decoration: none; color: inherit; }

/* ---------- Модальное окно и тост ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(22, 20, 42, .45); }
.modal .box { width: 100%; max-width: var(--maxw); background: var(--bg-end, var(--bg)); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 24px var(--pad) calc(24px + var(--sb)); }
.modal .box h2 { margin-bottom: 8px; }
.modal .box p { color: var(--muted); margin-bottom: 20px; }
.modal .box .choice { margin-bottom: 16px; }
@media (min-width: 700px) { .modal { align-items: center; } .modal .box { border-radius: var(--r-lg); } }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--bar-h) + 12px); z-index: 70; width: max-content; max-width: calc(100% - 32px); margin: 0 auto;
  background: var(--pine); color: var(--on-pine); padding: 12px 20px; border-radius: var(--r-pill); font-weight: 650; font-size: 15px; box-shadow: var(--shadow-lift); pointer-events: none; }
html.dark .toast { background: var(--text); color: var(--bg); }
.toast.hidden { display: none; }
/* Логотип-переключатель ролей: только у тестовых аккаунтов */
.role-test { position: fixed; top: calc(10px + var(--safe-top)); right: 12px; z-index: 30; width: 44px; height: 44px; padding: 6px; margin: 0;
  border: 0; border-radius: 50%; background: #FFFFFF; box-shadow: var(--shadow-lift); display: grid; place-items: center; cursor: pointer; }
.role-test img { width: 100%; height: auto; display: block; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.loader { display: flex; justify-content: center; padding: 48px 0; }
.errbox { text-align: center; padding: 32px 8px; }
.errbox p { color: var(--muted); margin: 8px 0 16px; }

@media (max-width: 360px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 176px; }
  .tile::before { background: linear-gradient(180deg, rgba(16, 28, 22, 0) 0%, rgba(16, 28, 22, .1) 30%, rgba(16, 28, 22, .74) 56%, rgba(16, 28, 22, .88) 100%); }
  .blocks { grid-template-columns: 1fr; }
  .hello h1 { font-size: 28px; }
  .consent-head h1 { font-size: 26px; }
}

/* ---------- Служебные ---------- */
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb12 { margin-bottom: 12px; }
.section-sm { margin-top: 16px; }
.xs { font-size: 13px !important; }
.lead { font-size: 16px; line-height: 1.55; }
.logo-sm { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.logo-sm .logo-img { width: 120px; }
.hello-c { text-align: center; }
html.dark .logo-sm .logo-img { background: #FFFFFF; padding: 4px 8px; border-radius: 8px; }
.hello + .card { margin-top: 20px; }
.donebox { text-align: center; padding: 32px 4px 8px; }
.donebox h1, .donebox h2 { margin: 16px 0 8px; }
.donebox p { margin-top: 12px; }
.okmark { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto; }
.okmark svg { width: 36px; height: 36px; }
.stepbox { margin-top: 4px; }

/* Широкий экран (Telegram Desktop): короткая страница — панель действия и меню идут сразу за контентом, а не у края окна. */
@media (min-width: 700px) {
  .page, .page.no-nav { padding-bottom: 24px; }
  .cta-bar, .nav { position: sticky; }
  /* В4: вернуть фон панели, чтобы текст карточки не проходил сквозь кнопку */
  .cta-bar { box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; padding-top: 8px; padding-bottom: 8px; margin-top: 20px; }
  .cta-bar .inner { padding: 0 var(--pad); }
}
/* Снимок всей страницы: закреплённые панели — в поток, иначе они «висят» посреди картинки. */
html.shot-full .cta-bar, html.shot-full .nav { position: static; }
html.shot-full .page { padding-bottom: 16px; }
html.shot-full .cta-bar { margin-top: 20px; }

/* Появление экрана: короткое, без смещения закреплённых панелей. Нажатия без «пружины» для тех, кто просил меньше движения. */
@media (prefers-reduced-motion: no-preference) {
  .page > :not(.cta-bar):not(.loader) { animation: enter .28s var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) { .btn:active, .tile:active, .back:active { transform: none; } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
