/* Базовые стили, унаследованные от «Я качаю речь». Фирменные цвета Baby Shark
   задаются поверх в panel.css — здесь их не правим, чтобы форк оставался
   сравнимым с исходником. */

:root {
  --bg-top: #2a1550;
  --bg-bottom: #100819;
  --card: linear-gradient(160deg, rgba(124,84,196,0.22), rgba(58,34,104,0.30));
  --card-solid: #251441;
  --card-border: rgba(178,140,255,0.18);
  --text: #f4efff;
  --text-2: #c6b8e6;
  --text-3: #9a89bf;
  --accent: #a855f7;          /* фиолет */
  --accent-2: #c084fc;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #a855f7 55%, #c084fc 100%);
  --accent-soft: rgba(168,85,247,0.16);
  --glow: 0 0 24px rgba(168,85,247,0.45);
  --ok: #34d399;             /* «пройдено» */
  --line: rgba(255,255,255,0.08);
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 10px 34px rgba(0,0,0,0.45);
  --shadow-soft: 0 6px 20px rgba(0,0,0,0.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  background: radial-gradient(130% 90% at 50% -10%, var(--bg-top) 0%, #1b0f36 45%, var(--bg-bottom) 100%) no-repeat;
  background-attachment: fixed;
  background-color: var(--bg-bottom);
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 420px) { .wrap { padding: 0 16px; } }

.kicker { font-size: 12.5px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.12em; }
.muted { color: var(--text-2); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 600;
  padding: 15px 26px; color: var(--text); background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease, opacity .12s ease, box-shadow .2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-grad); color: #fff; border: none; box-shadow: var(--glow); }
.btn-accent { background: var(--accent-grad); color: #fff; border: none; box-shadow: var(--glow); }
.btn-ok { background: linear-gradient(135deg, #10b981, #34d399); color: #05261b; border: none; box-shadow: 0 0 22px rgba(52,211,153,0.4); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-ghost { background: none; color: var(--accent-2); font-weight: 600; border: none; }

/* ---------- поля ввода ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 7px 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  padding: 15px 16px; outline: none; transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--text-3); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--glow); }
input[type=date] { color-scheme: dark; }

/* ---------- экран входа (gate) ---------- */
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.gate-form { width: 100%; max-width: 380px; text-align: center; }
.gate .hero {
  width: 124px; height: 124px; border-radius: 28px; object-fit: cover; object-position: center 18%; margin: 0 auto 22px;
  box-shadow: 0 10px 28px rgba(36,23,64,0.18);
}
.logo { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: 0.01em; }
.logo em { font-style: normal; color: var(--accent-2); }
.gate-kicker { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: 0.16em; }
.gate-title { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 8px; }
.gate-sub { color: var(--text-2); font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
.gate .field { text-align: left; }
.gate .err { color: #ff8a80; font-size: 14px; min-height: 20px; margin: 2px 0 10px; }

/* ---------- светлый минималистичный вход (body.light — только login) ---------- */
body.light {
  color: #241740;
  background: linear-gradient(180deg, #efe9fb 0%, #f8f5fd 55%, #f0eafa 100%) no-repeat;
  background-attachment: fixed;
  background-color: #f4f0fc;
}
body.light .logo { color: #241740; }
body.light .logo em { color: #7c3aed; }
body.light .gate-kicker { color: #7c3aed; }
body.light .gate-sub { color: #6b5f8a; margin: 16px 0 26px; }
body.light .field label { color: #55487a; }
body.light input[type=email], body.light input[type=password] {
  background: #fff; color: #241740; border: 1px solid #ddd3f0;
  box-shadow: 0 1px 2px rgba(36,23,64,0.04);
}
body.light input::placeholder { color: #a99ac9; }
body.light input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
body.light .btn-primary { box-shadow: 0 8px 20px rgba(139,92,246,0.30); }
body.light .gate .err { color: #c62839; }

/* живой фон входа: два мягких фиолетовых пятна медленно плывут за формой */
body.light .gate { position: relative; z-index: 0; overflow: hidden; }
body.light .gate::before, body.light .gate::after {
  content: ''; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
  filter: blur(64px); will-change: transform;
}
body.light .gate::before {
  width: 360px; height: 360px; left: -120px; top: -80px;
  background: rgba(168,85,247,0.20); animation: blobA 18s ease-in-out infinite alternate;
}
body.light .gate::after {
  width: 320px; height: 320px; right: -110px; bottom: -60px;
  background: rgba(139,92,246,0.16); animation: blobB 22s ease-in-out infinite alternate;
}
@keyframes blobA { from { transform: translate(0,0) scale(1); } to { transform: translate(70px,50px) scale(1.15); } }
@keyframes blobB { from { transform: translate(0,0) scale(1.1); } to { transform: translate(-60px,-70px) scale(0.95); } }
.gate-form { animation: riseIn .55s ease both; }

/* ---------- мотивационный сплэш на время загрузки ---------- */
.splash {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 32px 30px calc(40px + env(safe-area-inset-bottom));
  background: radial-gradient(130% 90% at 50% -10%, var(--bg-top) 0%, #1b0f36 45%, var(--bg-bottom) 100%) var(--bg-bottom);
  color: var(--text); opacity: 1; transition: opacity .45s ease;
  touch-action: none; overscroll-behavior: contain;
}
body.splash-lock { overflow: hidden; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-mark { font-family: var(--font-display); font-size: 46px; line-height: 0.6; color: var(--accent-2); opacity: 0.9; }
.splash-quote {
  max-width: 340px; font-family: var(--font-display); font-size: 24px; font-weight: 700;
  letter-spacing: -0.015em; line-height: 1.38; margin: 18px 0 16px; animation: riseIn .6s ease both;
}
.splash-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.splash-dots { display: flex; gap: 7px; margin-top: 32px; }
.splash-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); opacity: 0.3; animation: dotPulse 1.2s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: 0.18s; }
.splash-dots span:nth-child(3) { animation-delay: 0.36s; }
.splash.light {
  background: linear-gradient(180deg, #efe9fb 0%, #f8f5fd 55%, #f0eafa 100%) #f4f0fc;
  color: #241740;
}
.splash.light .splash-mark, .splash.light .splash-kicker { color: #7c3aed; }
.splash.light .splash-dots span { background: #7c3aed; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dotPulse { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 45% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .gate-form, .splash-quote, body.light .gate::before, body.light .gate::after { animation: none; }
  .splash-dots span { animation: none; opacity: 0.6; }
}

/* ---------- верхняя панель ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(20,11,38,0.72);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; text-decoration: none; color: var(--text); letter-spacing: 0.01em; }
.brand em { font-style: normal; color: var(--accent-2); }
.topbar .logout { border: none; background: none; color: var(--accent-2); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; padding: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; color: var(--accent-2);
  font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; padding: 8px 6px 8px 0; text-decoration: none; }
.back svg { width: 11px; height: 18px; }

.page { padding-top: 18px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* ---------- шапка курса на дашборде ---------- */
.course-hero { display: flex; align-items: center; gap: 16px; padding: 14px 4px 22px; }
.course-hero img { width: 82px; height: 82px; border-radius: 26px; object-fit: cover; object-position: center 18%; flex: none;
  border: 2px solid rgba(192,132,252,0.4); box-shadow: 0 0 30px rgba(168,85,247,0.4); }
.course-hero .h-kicker { font-size: 12.5px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.1em; }
.course-hero h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; margin-top: 3px;
  background: linear-gradient(90deg, #fff, #d9c6ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.course-hero .h-sub { font-size: 14.5px; color: var(--text-2); margin-top: 5px; }

/* прогресс-полоса */
.progress-line { display: flex; align-items: center; gap: 12px; margin: 4px 4px 24px; }
.progress-track { flex: 1; height: 8px; border-radius: 5px; background: rgba(255,255,255,0.09); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 5px; background: var(--accent-grad); box-shadow: var(--glow); transition: width .5s ease; }
.progress-label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- список уроков (дни) ---------- */
.days { display: flex; flex-direction: column; gap: 12px; }
.day {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 16px 18px; cursor: pointer; font-family: inherit; color: var(--text);
  transition: transform .14s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.day:active { transform: scale(0.985); }
.day:not(.locked):hover { box-shadow: 0 8px 26px rgba(0,0,0,0.4), 0 0 0 1px rgba(168,85,247,0.25); }
.day.locked { cursor: default; opacity: 0.55; box-shadow: none; }
.day.locked:active { transform: none; }
.day-num {
  flex: none; width: 48px; height: 48px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
  font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 30% 25%, rgba(192,132,252,0.5), rgba(124,58,237,0.35));
  border: 1.5px solid rgba(192,132,252,0.6); box-shadow: 0 0 18px rgba(168,85,247,0.45);
}
.day.done .day-num { background: radial-gradient(circle at 30% 25%, rgba(52,211,153,0.5), rgba(16,185,129,0.3)); border-color: rgba(52,211,153,0.6); box-shadow: 0 0 18px rgba(52,211,153,0.4); }
.day.locked .day-num { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: var(--text-3); box-shadow: none; }
.day-body { flex: 1; min-width: 0; }
.day-kick { font-size: 11.5px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.07em; }
.day-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; line-height: 1.25; }
.day-meta { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.day-right { flex: none; display: flex; align-items: center; }
.day-check { width: 27px; height: 27px; border-radius: 50%; border: 1.6px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center; }
.day.done .day-check { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 14px rgba(52,211,153,0.5); }
.day.done .day-check svg { width: 13px; height: 13px; }
.day-check svg { opacity: 0; }
.day.done .day-check svg { opacity: 1; }
.day .chev { color: var(--accent-2); }
.day .chev svg { width: 9px; height: 16px; display: block; }
.day .lock svg { width: 15px; height: 18px; color: var(--text-3); display: block; }

/* ---------- страница урока ---------- */
.lesson-head { padding: 6px 4px 14px; }
.lesson-head .l-kick { font-size: 12px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.1em; }
.lesson-head h1 { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; margin-top: 5px; }

/* вертикальный плеер во весь экран (сторис/Reels) */
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow), 0 0 40px rgba(168,85,247,0.25);
  aspect-ratio: 9 / 16; max-height: 74vh; margin: 0 auto 22px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border); }
.player-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-processing { color: #cbb9ee; font-size: 14px; text-align: center; padding: 24px; }

/* тайм-коды (главы урока) */
.chapters { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; margin: 0 0 22px; }
.chapters-title { font-size: 12px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em; padding: 16px 18px 8px; }
.chapter { display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left; border: none; background: none;
  font-family: inherit; cursor: pointer; padding: 13px 18px; -webkit-tap-highlight-color: transparent; color: var(--text); }
.chapter + .chapter { border-top: 1px solid var(--line); }
.chapter:active { background: rgba(255,255,255,0.05); }
.chapter .ch-time { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; color: var(--accent-2); min-width: 46px; }
.chapter .ch-title { font-size: 15px; line-height: 1.4; }

.lesson-body { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 22px 22px 8px; }
.lesson-body p { font-size: 16px; line-height: 1.62; margin: 0 0 14px; color: var(--text); }
.lesson-body ul, .lesson-body ol { margin: 0 0 14px; padding-left: 22px; }
.lesson-body li { font-size: 16px; line-height: 1.55; margin: 5px 0; }
.lesson-body strong { font-weight: 650; color: #fff; }
.lesson-body .lesson-note { font-size: 14.5px; color: var(--text-2); background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); padding: 14px 16px; margin: 4px 0 18px; }

.lesson-task { background: var(--accent-soft); border: 1px solid rgba(168,85,247,0.3); border-radius: var(--radius-sm); padding: 16px 18px; margin: 4px 0 18px; }
.lesson-task-label { font-size: 12px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.lesson-task p, .lesson-task li { font-size: 15.5px; }
.lesson-task p:last-child, .lesson-task ul:last-child, .lesson-task ol:last-child { margin-bottom: 0; }

/* анкета после урока (своя, внутри платформы) */
.survey-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 20px 22px 22px; margin-top: 18px; }
.survey-kick { font-size: 12px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.survey-intro { font-size: 14px; color: var(--text-2); line-height: 1.55; margin: 0 0 18px; }
.survey-q { margin-bottom: 18px; }
.survey-q-title { font-size: 15.5px; font-weight: 600; line-height: 1.45; margin-bottom: 10px; }
.survey-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.survey-opt { font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: 999px; padding: 11px 18px;
  -webkit-tap-highlight-color: transparent; }
.survey-opt.on { background: var(--accent-soft); border-color: rgba(168,85,247,0.55); color: #fff; }
.survey-opt:active { opacity: 0.75; }
.survey-rate .survey-opt { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.survey-text { width: 100%; font-family: inherit; font-size: 15.5px; line-height: 1.5; color: var(--text); resize: vertical;
  background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 12px 14px; }
.survey-text:focus { outline: none; border-color: rgba(168,85,247,0.55); }
.survey-thanks { font-size: 15.5px; font-weight: 600; margin-bottom: 14px; }
.survey-done-q { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.survey-done-a { font-size: 15.5px; font-weight: 600; margin: 2px 0 12px; white-space: pre-wrap; }

.lesson-actions { margin-top: 22px; }
.lesson-nav { display: flex; gap: 12px; margin-top: 14px; }
.lesson-nav a { flex: 1; text-align: center; padding: 14px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft); text-decoration: none; color: var(--text); font-weight: 600; font-size: 14.5px; }
.lesson-nav a.disabled { opacity: 0.4; pointer-events: none; }
.lesson-nav .nav-dir { display: block; font-size: 11.5px; color: var(--accent-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }

/* ---------- admin ---------- */
.admin-section { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 20px; margin-bottom: 16px; }
.admin-section h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1; min-width: 150px; margin-bottom: 0; }
.stat-row { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 90px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em;
  background: linear-gradient(90deg,#fff,#c9b3ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .l { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.stu { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-top: 1px solid var(--line); }
.stu:first-of-type { border-top: none; }
.stu-main { flex: 1; min-width: 0; }
.stu-email { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stu-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.badge.wait { background: var(--accent-soft); color: var(--accent-2); }
.mini { font-size: 13px; padding: 9px 14px; }
.progress-mini { width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; flex: none; }
.progress-mini > i { display: block; height: 100%; background: var(--accent-grad); }

/* ---------- служебное ---------- */
.center { text-align: center; }
.spacer { height: 8px; }
.hint { font-size: 13px; color: var(--text-3); }
.code-box { font-family: Menlo, Consolas, monospace; background: rgba(0,0,0,0.35); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; word-break: break-all; margin-top: 8px; user-select: all; color: var(--accent-2); }
.skeleton { color: var(--text-3); text-align: center; padding: 40px 0; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: rgba(40,22,72,0.96); border: 1px solid var(--card-border); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  opacity: 0; transition: opacity .2s ease, transform .2s ease; z-index: 100; pointer-events: none; max-width: 88%; text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { text-align: center; font-size: 12.5px; color: var(--text-3); margin-top: 34px; }

/* ================= нижняя таб-панель ================= */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(18,10,34,0.82); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; text-decoration: none;
  color: var(--text-3); font-size: 10.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent-2); }
.tab.on svg { filter: drop-shadow(0 0 8px rgba(168,85,247,0.6)); }
.has-tabbar .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ================= домашняя шапка + стрик ================= */
.home-head { display: flex; align-items: center; gap: 14px; padding: 16px 4px 18px; }
.home-head img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: center 18%; flex: none;
  border: 2px solid rgba(192,132,252,0.45); box-shadow: 0 0 20px rgba(168,85,247,0.4); }
.home-head .hi-k { font-size: 12px; color: var(--accent-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.home-head .hi-n { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-top: 1px; }

.streak-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, rgba(234,149,85,0.22), rgba(168,85,247,0.16));
  border: 1px solid rgba(234,149,85,0.28); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-soft); }
.streak-flame { font-size: 34px; line-height: 1; filter: drop-shadow(0 0 12px rgba(234,149,85,0.6)); }
.streak-l { flex: 1; }
.streak-num { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.streak-num span { font-size: 15px; font-weight: 600; color: var(--text-2); }
.streak-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.streak-dots { display: flex; gap: 6px; margin-top: 10px; }
.streak-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.streak-dot.on { background: linear-gradient(135deg,#f0a35a,#ea9555); box-shadow: 0 0 8px rgba(234,149,85,0.6); }

/* календарь-сетка 30 дней (челлендж) */
.cal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 2px 4px; }
.cal-cell { aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-cell.done { background: radial-gradient(circle at 30% 25%, rgba(234,149,85,0.5), rgba(168,85,247,0.3)); border-color: rgba(234,149,85,0.5); color: #fff; }
.cal-cell.today { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* быстрые круглые кнопки (практики/дневники) */
.quick-row { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 8px; -webkit-overflow-scrolling: touch; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex: none; width: 82px; }
.quick-ic { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: radial-gradient(circle at 30% 25%, rgba(192,132,252,0.35), rgba(124,58,237,0.28)); border: 1.5px solid rgba(192,132,252,0.5);
  box-shadow: 0 0 18px rgba(168,85,247,0.35); }
.quick span { font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.2; }
.quick:active .quick-ic { transform: scale(0.94); transition: transform .12s; }

.section-title { font-size: 13px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.09em; margin: 20px 4px 12px; }

/* карточка блока (курса) */
.block-card { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 18px 20px; margin-bottom: 12px; position: relative; overflow: hidden; transition: transform .14s ease; }
.block-card:active { transform: scale(0.985); }
.block-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.block-card .b-sub { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.block-card .b-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.block-card .b-count { font-size: 12.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.block-card.locked { opacity: 0.85; }
.block-lock { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(168,85,247,0.35); border-radius: 999px; padding: 4px 10px; }

/* ================= практики (дыхание/артикуляция) ================= */
.practice-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px 18px; margin-bottom: 12px; cursor: pointer; color: var(--text); font-family: inherit;
  text-decoration: none; transition: transform .14s ease; }
.practice-item:active { transform: scale(0.985); }
.practice-ic { flex: none; width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: radial-gradient(circle at 30% 25%, rgba(192,132,252,0.4), rgba(124,58,237,0.3)); border: 1.5px solid rgba(192,132,252,0.5); }
.practice-item h3 { font-size: 16px; font-weight: 600; }
.practice-item .p-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* полноэкранный «дышащий» плеер */
.breath-stage { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; padding: 20px; }
.breath-orb { width: 210px; height: 210px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(192,132,252,0.55), rgba(124,58,237,0.35) 60%, rgba(124,58,237,0.12));
  box-shadow: 0 0 60px rgba(168,85,247,0.55), inset 0 0 40px rgba(255,255,255,0.08);
  transform: scale(0.6); transition: transform var(--pt, 4s) cubic-bezier(0.4,0,0.4,1); }
.breath-orb.in { transform: scale(1); }
.breath-orb.out { transform: scale(0.55); }
.breath-orb.hold { transition: transform 0.4s ease; }
.breath-phase { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.breath-count { font-size: 15px; color: var(--text-2); margin-top: 6px; }
.breath-orb .n { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: #fff; text-shadow: 0 0 20px rgba(0,0,0,0.3); }

/* артикуляция — шаги */
.artic-steps { counter-reset: st; }
.artic-step { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 14px 16px 14px 46px; position: relative; margin-bottom: 10px; font-size: 15.5px; line-height: 1.5; }
.artic-step::before { counter-increment: st; content: counter(st); position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ================= дневники ================= */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 3px; margin: 4px 0 18px; }
.seg button { border: none; background: none; border-radius: 10px; padding: 9px 6px; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--accent-grad); color: #fff; box-shadow: var(--glow); }
.mood-picker { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 14px; }
.mood { flex: 1; aspect-ratio: 1; border: 1.5px solid var(--card-border); background: rgba(255,255,255,0.04); border-radius: 16px; font-size: 26px; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.mood.on { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.08); box-shadow: var(--glow); }
textarea { width: 100%; font-family: inherit; font-size: 16px; color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 14px 16px; outline: none; resize: vertical; min-height: 90px; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.entry { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.entry-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.entry-day { font-size: 12px; color: var(--text-3); font-weight: 600; }
.entry-mood { font-size: 20px; }
.entry-text { font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.entry-del { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 4px; }

/* ================= подписка ================= */
.plan-card { display: block; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 12px; cursor: pointer; font-family: inherit; color: var(--text); position: relative; }
.plan-card.on { border-color: var(--accent); box-shadow: var(--glow); }
.plan-card .p-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.plan-card .p-price { font-size: 15px; color: var(--accent-2); font-weight: 700; margin-top: 2px; }
.plan-card .p-badge { position: absolute; top: 14px; right: 16px; font-size: 11px; font-weight: 700; color: #05261b; background: linear-gradient(135deg,#34d399,#10b981); padding: 3px 9px; border-radius: 999px; }
.paywall-feats { list-style: none; margin: 8px 0 18px; }
.paywall-feats li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.6; color: var(--text); }
.paywall-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.sub-status { background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(168,85,247,0.14)); border: 1px solid rgba(52,211,153,0.3);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.sub-status .s-t { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.sub-status .s-d { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.kaspi-wait { text-align: center; padding: 30px 0; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(168,85,247,0.25); border-top-color: var(--accent); margin: 0 auto 16px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= SPA-добавки (v4): hero-CTA, витрина блоков, шторка, профиль ================= */

/* hero-кнопка «Продолжить» на главной — самый заметный элемент экрана */
.continue-card { display: block; text-decoration: none; color: #fff; background: var(--accent-grad);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; position: relative; overflow: hidden;
  box-shadow: var(--glow), var(--shadow-soft); transition: transform .14s ease; -webkit-tap-highlight-color: transparent; }
.continue-card:active { transform: scale(0.985); }
.continue-card::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,0.18), transparent 55%); }
.continue-card .cc-kick { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.continue-card .cc-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-top: 4px; line-height: 1.3; }
.continue-card .cc-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.continue-card .progress-track { background: rgba(255,255,255,0.25); }
.continue-card .progress-fill { background: #fff; box-shadow: none; }
.continue-card .cc-count { font-size: 12.5px; font-weight: 700; opacity: 0.9; white-space: nowrap; }
/* приглушённое состояние: следующий день ещё закрыт / всё пройдено */
.continue-card.waiting { background: var(--card); color: var(--text); border: 1px solid var(--card-border); box-shadow: var(--shadow-soft); }
.continue-card.waiting::after { content: none; }
.continue-card.waiting .cc-kick { color: var(--accent-2); opacity: 1; }
.continue-card.waiting .progress-track { background: rgba(255,255,255,0.09); }
.continue-card.waiting .progress-fill { background: var(--accent-grad); }
.continue-card.waiting .cc-count { color: var(--text-2); }

/* витрина закрытых блоков — «доступ по запросу» (кнопка, а не ссылка) */
button.block-card { width: 100%; text-align: left; font-family: inherit; font-size: inherit; cursor: pointer; }
.block-card.locked { opacity: 0.62; filter: saturate(0.55); }
.block-card.locked h3 { color: var(--text-2); }

/* нижняя шторка (bottom-sheet) «напишите нам» */
.sheet-back { position: fixed; inset: 0; z-index: 80; background: rgba(10,5,20,0.55); opacity: 0; transition: opacity .25s ease; }
.sheet-back.open { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  background: var(--card-solid); border: 1px solid var(--card-border); border-bottom: none;
  border-radius: 24px 24px 0 0; padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(26px); transition: transform .28s ease; }
.sheet-back.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.2); margin: 0 auto 16px; }
.sheet h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.sheet p { font-size: 14.5px; line-height: 1.55; margin-bottom: 16px; }

/* полноэкранный режим практики: таббар прячем классом (сам <nav> статичен) */
.practice-run .tabbar { display: none; }
.tabbar[hidden] { display: none; }

/* ---------- профиль ---------- */
input[type=tel] { width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  padding: 15px 16px; outline: none; transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none; appearance: none; }
input[type=tel]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--glow); }
input[disabled] { opacity: 0.55; }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px 4px 20px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; text-transform: uppercase;
  background: var(--accent-grad); box-shadow: var(--glow); }
.profile-head .p-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.profile-head .p-mail { font-size: 13.5px; color: var(--text-3); margin-top: 1px; word-break: break-all; }

.err-inline { color: #ff8a80; font-size: 13px; min-height: 18px; margin: 6px 2px 0; }

.p-course { display: block; text-decoration: none; color: var(--text); padding: 12px 2px; border-top: 1px solid var(--line); }
.p-course:first-child { border-top: none; padding-top: 2px; }
.p-course-t { font-size: 15px; font-weight: 600; }
.p-course-bar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.p-course-n { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }

.p-streak-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.p-streak-big { font-family: var(--font-display); font-size: 36px; font-weight: 800; letter-spacing: -0.01em; line-height: 1; }
.p-streak-meta { font-size: 13.5px; color: var(--text-2); }
.p-streak-grid { display: grid; grid-template-columns: repeat(6, 14px); gap: 9px; justify-content: start; }
.p-streak-grid .streak-dot { width: 11px; height: 11px; }

.p-pass summary, .p-del summary { cursor: pointer; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  list-style: none; -webkit-tap-highlight-color: transparent; }
.p-pass summary::-webkit-details-marker, .p-del summary::-webkit-details-marker { display: none; }
.p-pass summary::after, .p-del summary::after { content: '›'; float: right; color: var(--accent-2); font-size: 20px; transform: rotate(90deg); transition: transform .15s ease; }
.p-pass[open] summary::after, .p-del[open] summary::after { transform: rotate(-90deg); }

/* удаление аккаунта — приглушённо-красное, чтобы не нажали случайно */
.p-del summary { color: #ff8a80; }
.p-del summary::after { color: #ff8a80; }
.p-del-btn { background: rgba(255,110,110,0.1); border: 1px solid rgba(255,138,128,0.35); color: #ff8a80; }
.p-del-btn:hover { background: rgba(255,110,110,0.16); }

.p-logout { background: rgba(255,110,110,0.08); border: 1px solid rgba(255,138,128,0.3); color: #ff8a80; margin-top: 4px; }

/* ---------- живые встречи ---------- */
.meetup-when { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); }
.meetup-place { color: var(--text-2); font-size: 15px; }
.meetup-dist { margin-top: 8px; display: inline-block; padding: 5px 12px; border-radius: 100px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 14px; font-weight: 600; }

/* ---------- карточка «включить уведомления» (только в приложении) ---------- */
/* Всплывает снизу над таббаром, показывается один раз за установку. */
.push-ask { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(120%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.push-ask.on { transform: none; }
.push-ask-in { max-width: 560px; margin: 0 auto; padding: 18px; border-radius: var(--radius);
  background: var(--card-solid); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.push-ask-in b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.push-ask-in p { margin: 6px 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.push-ask-row { display: flex; gap: 10px; }
.push-ask-row .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .push-ask { transition: none; } }
