/* ============================================================
   KatyaFit · Личный кабинет — компоненты (ФАЗА 0)
   Подход: MOBILE-FIRST. Базовые стили = телефон, @media (min-width)
   добавляют десктоп. Основная аудитория — мобильные.
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg-milk);
    color: var(--text-main);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100svh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.16; letter-spacing: -0.01em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.hidden, [hidden] { display: none !important; }

/* Скелет-заглушка, пока грузятся данные участницы (убирает мигание «Гостья»).
   initTopbar() снимает .is-skel и проставляет имя, когда профиль загружен. */
.is-skel {
    display: inline-block; min-width: 5em; height: 0.92em; vertical-align: -0.08em;
    border-radius: 7px; color: transparent !important;
    background: linear-gradient(100deg, var(--gold-soft) 28%, rgba(255,255,255,0.35) 50%, var(--gold-soft) 72%);
    background-size: 220% 100%; animation: kf-shimmer 1.25s ease-in-out infinite;
}
@keyframes kf-shimmer { 0% { background-position: 220% 0; } 100% { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .is-skel { animation: none; } }

/* Строка-ошибка внутри шторок (например, не удалось сохранить замеры). */
.sheet-err {
    color: var(--danger); background: var(--danger-soft);
    border: 1px solid rgba(178,59,47,0.22); border-radius: 12px;
    font-size: 0.9rem; line-height: 1.45; padding: 0.7rem 0.9rem; margin-bottom: 0.9rem;
}

/* ─── Кнопки (тап-таргет ≥ 48px) ─────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font-ui); font-weight: 600; font-size: 1rem; min-height: 50px;
    padding: 0.7rem 1.5rem; border: none; border-radius: 999px;
    cursor: pointer; transition: var(--transition); white-space: nowrap; line-height: 1.2;
}
.btn--gold { background: var(--gold); color: #1a1f1c; box-shadow: var(--shadow-gold); }
.btn--gold:active { transform: scale(0.98); }
.btn--ghost { background: var(--bg-pure); color: var(--text-main); border: 1.5px solid var(--border-color); }
.btn--ghost:active { transform: scale(0.98); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
@media (hover: hover) {
    .btn--gold:hover { background: var(--gold-hover); transform: translateY(-2px); }
    .btn--ghost:hover { border-color: var(--gold); color: var(--gold-hover); }
}

/* ─── Топбар ─────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(22, 26, 23, 0.94);
    backdrop-filter: blur(24px) saturate(1.1);
    -webkit-backdrop-filter: blur(24px) saturate(1.1);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0.7rem 0; padding-top: calc(0.7rem + env(safe-area-inset-top));
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.brand { display: flex; align-items: baseline; gap: 0.5rem; color: var(--text-on-dark); }
.brand__logo { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.brand__logo b { color: var(--gold); }
.brand__sub { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-on-dark-muted); }
.topbar__user { display: flex; align-items: center; gap: 0.7rem; color: var(--text-on-dark); font-size: 0.9rem; }
.topbar__user .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gold-soft); color: var(--gold);
    display: grid; place-items: center; font-weight: 700; border: 1px solid var(--gold-soft);
}
.topbar__user [data-user-name] { display: none; }
.topbar__logout { color: var(--text-on-dark-muted); font-size: 0.85rem; }
@media (min-width: 560px) { .topbar__user [data-user-name] { display: inline; } }
@media (hover: hover) { .topbar__logout:hover { color: var(--gold); } }

/* ─── Экран входа ────────────────────────────────────────── */
.auth-wrap {
    min-height: 100svh; display: grid; place-items: center; padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: radial-gradient(120% 80% at 50% -10%, rgba(201,169,110,0.12), transparent 60%), var(--bg-deep);
}
.auth-card {
    width: 100%; max-width: 420px; background: var(--bg-pure); border-radius: 22px;
    padding: 2.4rem 1.6rem; box-shadow: var(--shadow-hover); text-align: center;
}
.auth-card .brand { justify-content: center; color: var(--text-main); }
.auth-card .brand__logo { font-size: 1.6rem; }
.auth-card .brand__sub { color: var(--text-muted); margin-top: 0.2rem; }
.auth-title { font-size: 1.8rem; margin: 1.2rem 0 0.4rem; }
.auth-sub { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.8rem; }
.field { text-align: left; margin-bottom: 1rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.field input {
    width: 100%; padding: 0.9rem 1rem; font-size: 1rem; font-family: inherit; min-height: 52px;
    border: 1.5px solid var(--border-color); border-radius: 14px; background: var(--bg-milk); transition: var(--transition);
}
.field input:focus { outline: none; border-color: var(--gold); background: var(--bg-pure); box-shadow: 0 0 0 4px var(--gold-soft); }
.auth-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 1.3rem; line-height: 1.5; }
.auth-msg { font-size: 0.9rem; color: var(--sage-medium); background: var(--sage-soft); border-radius: 14px; padding: 0.9rem 1rem; margin-top: 1.2rem; line-height: 1.5; }
.auth-msg b { color: var(--text-main); }
.auth-msg.is-error { color: var(--danger); background: var(--danger-soft); }
/* Ввод кода из письма (вход по 6-значному коду) */
.field input.code-input {
    text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.5em;
    padding-left: 0.5em; font-family: var(--font-ui);
}
.field input.code-input::placeholder { letter-spacing: 0.4em; font-weight: 400; }
.auth-actions { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.1rem; }
.auth-link {
    background: none; border: none; cursor: pointer; padding: 0.3rem;
    font-family: var(--font-ui); font-size: 0.86rem; color: var(--sage-medium);
    text-decoration: underline; text-underline-offset: 3px;
}
.auth-link:disabled { opacity: 0.45; cursor: default; text-decoration: none; }
@media (hover: hover) { .auth-link:not(:disabled):hover { color: var(--gold-hover); } }

/* ─── Дашборд ────────────────────────────────────────────── */
.dash { padding: 1.4rem 0 3rem; }
.dash-hero { background: var(--bg-pure); border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow-card); margin-bottom: 1.2rem; }
.dash-hero__greet h1 { font-size: 1.9rem; margin-bottom: 0.2rem; }
.dash-hero__greet p { color: var(--text-muted); font-size: 0.92rem; }
.dash-hero__greet .accent { color: var(--gold-hover); }
.progress-block { margin-top: 1.4rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.progress-meta b { color: var(--text-main); }
.progress-bar { height: 12px; background: var(--sage-soft); border-radius: 999px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: linear-gradient(90deg, var(--sage), var(--gold)); border-radius: 999px; transition: width 0.8s var(--ease-out); }
.progress-stats { display: flex; gap: 1.6rem; margin-top: 1rem; }
.progress-stats .stat { font-size: 0.82rem; color: var(--text-muted); }
.progress-stats .stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--text-main); line-height: 1; margin-bottom: 0.15rem; }
@media (min-width: 720px) {
    .dash { padding: 2.2rem 0 4rem; }
    .dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2rem; }
    .progress-block { margin-top: 0; min-width: 300px; flex: 1; }
    .dash-hero__greet h1 { font-size: 2.2rem; }
}

/* ─── Карточка «Продолжить / Сегодня» ────────────────────── */
.today-card {
    display: block; background: linear-gradient(135deg, var(--sage-deep), var(--bg-elevated));
    color: var(--text-on-dark); border-radius: 20px; padding: 1.5rem; margin-bottom: 1.8rem;
    box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.today-card::before {
    content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
    background: radial-gradient(circle, var(--gold-glow), transparent 70%); pointer-events: none;
}
.today-card__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.4rem; }
.today-card__title { font-size: 1.5rem; margin-bottom: 0.3rem; position: relative; }
.today-card__meta { color: var(--text-on-dark-muted); font-size: 0.9rem; margin-bottom: 1.2rem; }
.today-card .btn { width: 100%; }
@media (min-width: 560px) {
    .today-card { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1.8rem 2rem; }
    .today-card .btn { width: auto; }
    .today-card__meta { margin-bottom: 0; }
}

/* ─── Календарь: карусель недель ─────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin: 0 0 1rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.4rem; }
.section-head .hint { font-size: 0.8rem; color: var(--text-muted); }

/* Табы-селектор недель */
.cal-tabs {
    display: flex; gap: 0.5rem; overflow-x: auto; margin-bottom: 0.9rem;
    padding-bottom: 0.3rem; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cal-tabs::-webkit-scrollbar { display: none; }
.cal-tab {
    flex: 0 0 auto; display: flex; align-items: center; gap: 0.45rem; white-space: nowrap;
    border: 1.5px solid var(--border-color); background: var(--bg-pure); border-radius: 999px;
    padding: 0.5rem 0.9rem; cursor: pointer; transition: var(--transition);
    font-family: var(--font-ui); font-weight: 600; font-size: 0.85rem; color: var(--text-muted);
}
.cal-tab__count {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; min-width: 1.55rem; min-height: 1.05rem;
    padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--bg-milk); color: var(--text-muted);
}
.cal-tab__count svg { width: 11px; height: 11px; }
.cal-tab.is-active { border-color: var(--gold); background: var(--gold-soft); color: var(--text-main); box-shadow: var(--shadow-soft); }
.cal-tab.is-active .cal-tab__count { background: var(--gold); color: #fff; }
.cal-tab.is-done .cal-tab__count { background: var(--state-done); color: #fff; }

/* Трек-карусель: одна неделя в видимой области, листается свайпом */
.cal-track {
    display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
    padding: 4px 2px 22px; scrollbar-width: none;
}
.cal-track::-webkit-scrollbar { display: none; }

.cal-week {
    flex: 0 0 100%; scroll-snap-align: center; box-sizing: border-box;
    background: var(--bg-pure); border: 1.5px solid var(--border-color);
    border-radius: var(--radius); padding: 1.1rem 1rem 1.2rem; box-shadow: var(--shadow-soft);
}
.cal-week__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.cal-week__title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.cal-week__progress { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.cal-week__sub { font-size: 0.76rem; color: var(--text-muted); margin: 0.35rem 0 0.95rem; }

/* Сетка дней внутри недели — крупные стильные квадраты */
.days-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }

.day-cell {
    position: relative; aspect-ratio: 1 / 1; border-radius: 16px;
    background: var(--bg-milk); border: 1.5px solid var(--border-color);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    cursor: pointer; transition: var(--transition); text-align: center; padding: 0.4rem; overflow: hidden;
}
.day-cell__num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.day-cell__icon { display: flex; line-height: 0; color: var(--text-muted); }
.day-cell__icon svg { width: 21px; height: 21px; }
.day-cell__icon--workout { color: var(--gold-hover); }
.day-cell__icon--recovery { color: var(--sage); }
.day-cell__icon--rest { color: var(--text-muted); }
.day-cell__tag { font-size: 0.56rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }

/* Статус-чип в углу */
.day-cell .badge-ic {
    position: absolute; top: 6px; right: 6px; width: 19px; height: 19px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.day-cell .badge-ic svg { width: 11px; height: 11px; }

/* Пройден */
.day-cell--done { background: var(--sage-soft); border-color: var(--state-done); }
.day-cell--done .day-cell__num { color: var(--sage-medium); }
.day-cell--done .badge-ic { background: var(--state-done); color: #fff; }

/* Текущий — мягко «дышит» золотым свечением */
.day-cell--today {
    background: linear-gradient(160deg, var(--bg-pure), var(--gold-soft));
    border-color: var(--state-today); animation: todayGlow 2.6s var(--ease-out) infinite;
}
.day-cell--today .day-cell__num { color: var(--gold-hover); }
@keyframes todayGlow {
    0%, 100% { box-shadow: 0 5px 16px rgba(201, 169, 110, 0.20); }
    50%      { box-shadow: 0 9px 28px rgba(201, 169, 110, 0.42); }
}

/* Закрыт */
.day-cell--locked { cursor: default; background: var(--bg-milk); }
.day-cell--locked .day-cell__num { color: var(--state-locked); }
.day-cell--locked .day-cell__icon { color: var(--state-locked); }
.day-cell--locked .day-cell__tag { opacity: 0.55; }
.day-cell--locked .badge-ic { background: rgba(26, 31, 28, 0.06); color: var(--text-muted); }

@media (hover: hover) {
    .day-cell:not(.day-cell--locked):hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--gold); }
}
@media (prefers-reduced-motion: reduce) {
    .cal-track { scroll-behavior: auto; }
    .day-cell--today { animation: none; box-shadow: var(--shadow-gold); }
}
@media (min-width: 560px) {
    .cal-week { padding: 1.4rem 1.3rem 1.5rem; }
    .days-grid { grid-template-columns: repeat(7, 1fr); gap: 0.7rem; }
    .day-cell__num { font-size: 1.55rem; }
}

/* ─── Финал программы ────────────────────────────────────── */
.finish-banner {
    background: linear-gradient(135deg, var(--gold), var(--gold-hover)); color: #1a1f1c;
    border-radius: 20px; padding: 1.8rem 1.5rem; text-align: center; margin-bottom: 1.8rem; box-shadow: var(--shadow-gold);
}
.finish-banner .emo { font-size: 2.4rem; }
.finish-banner h2 { font-size: 1.6rem; margin: 0.4rem 0 0.3rem; }
.finish-banner p { font-size: 0.95rem; opacity: 0.85; }

/* ─── Страница дня ───────────────────────────────────────── */
.day-page { padding: 1.2rem 0 3rem; }
.day-page.has-cta { padding-bottom: 110px; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1rem; min-height: 32px; }
@media (hover: hover) { .back-link:hover { color: var(--gold-hover); } }
.day-header { margin-bottom: 1.4rem; }
.day-header__eyebrow { font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-hover); margin-bottom: 0.5rem; font-weight: 700; }
.day-header h1 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.day-header p { color: var(--text-muted); font-size: 0.95rem; }
.done-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--sage-soft); color: var(--sage-medium); font-size: 0.8rem; font-weight: 700; padding: 0.4rem 0.9rem; border-radius: 999px; margin-top: 0.8rem; }
@media (min-width: 720px) { .day-header h1 { font-size: 2.3rem; } }

.day-block { background: var(--bg-pure); border-radius: 18px; box-shadow: var(--shadow-card); padding: 1.3rem; margin-bottom: 1.1rem; }
@media (min-width: 720px) { .day-block { padding: 1.8rem; } }
.day-block__head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; }
.day-block__head .ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--gold-soft); color: var(--gold-hover); display: grid; place-items: center; }
.day-block__head .ic svg { width: 21px; height: 21px; }
.day-block__head h2 { font-size: 1.25rem; }
.day-block__head .sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Экран закрытого дня */
.day-locked { text-align: center; padding: 2.6rem 1.3rem; }
.day-locked__icon { margin-bottom: 0.6rem; color: var(--state-locked); }
.day-locked h2 { margin-bottom: 0.5rem; }
.day-locked p { color: var(--text-muted); margin-bottom: 1.4rem; }

.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--bg-deep); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* План питания */
.meals { display: grid; gap: 0.7rem; }
.meal { display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem 0.9rem; align-items: start; padding: 0.9rem; border: 1px solid var(--border-color); border-radius: 13px; background: var(--bg-milk); }
.meal__when { font-weight: 700; font-size: 0.8rem; color: var(--sage-medium); padding-top: 0.1rem; }
.meal__body { grid-column: 2; }
.meal__body h4 { font-size: 0.96rem; margin-bottom: 0.15rem; }
.meal__body p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.45; }
.meal__kcal { grid-column: 3; grid-row: 1; font-size: 0.78rem; font-weight: 700; color: var(--gold-hover); white-space: nowrap; }
.meals__total { text-align: right; margin-top: 0.8rem; font-size: 0.9rem; color: var(--text-muted); }
.meals__total b { color: var(--text-main); }

/* Привычки */
.habits { display: grid; gap: 0.55rem; }
.habit { display: flex; align-items: center; gap: 0.8rem; padding: 0.95rem 1rem; min-height: 56px; border: 1px solid var(--border-color); border-radius: 13px; cursor: pointer; transition: var(--transition); user-select: none; }
.habit:active { background: var(--bg-milk); }
.habit input { display: none; }
.habit .box { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; border: 2px solid var(--border-color); display: grid; place-items: center; color: #fff; transition: var(--transition); }
.habit input:checked + .box { background: var(--sage); border-color: var(--sage); }
.habit input:checked + .box::after { content: '✓'; font-size: 0.9rem; font-weight: 700; }
.habit .label { font-size: 0.96rem; }
.habit input:checked ~ .label { color: var(--text-muted); text-decoration: line-through; }
@media (hover: hover) { .habit:hover { border-color: var(--gold); } }

/* Навигация по дням */
.day-nav { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 1.4rem; }
.day-nav .btn { flex: 1; }

/* ─── Залипающая кнопка «Завершить день» ─────────────────── */
.day-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 0.8rem 16px; padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg-milk) 78%, rgba(247,245,240,0));
}
.day-cta .container { max-width: var(--container); padding: 0; }
.day-cta .btn { width: 100%; box-shadow: 0 -2px 20px rgba(201,169,110,0.25), var(--shadow-gold); }
@media (min-width: 720px) {
    .day-cta { background: rgba(247,245,240,0.9); backdrop-filter: blur(12px); border-top: 1px solid var(--border-color); padding: 0.9rem 24px; padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
    .day-cta .container { padding: 0 24px; }
}

/* ─── Шторка / модалка (bottom sheet) ────────────────────── */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(20,24,21,0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
    width: 100%; max-width: 520px; background: var(--bg-pure);
    border-radius: 24px 24px 0 0; box-shadow: 0 -12px 44px rgba(0,0,0,0.22);
    padding: 1.2rem 1.3rem; padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
    transform: translateY(101%); transition: transform 0.38s var(--ease-spring);
    max-height: 92svh; overflow-y: auto;
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet__grab { width: 42px; height: 4px; border-radius: 2px; background: var(--border-color); margin: 0 auto 1rem; }
.sheet__close { position: absolute; top: 1rem; right: 1.1rem; width: 34px; height: 34px; border: none; background: var(--bg-milk); border-radius: 50%; font-size: 1.1rem; color: var(--text-muted); cursor: pointer; }
.sheet h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.sheet > p, .sheet .sheet-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.4rem; }
.sheet-step { animation: sheetFade 0.3s ease; }
@keyframes sheetFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-width: 560px) {
    .sheet-overlay { align-items: center; }
    .sheet { border-radius: 24px; padding: 1.8rem; max-height: 88svh; }
    .sheet__grab { display: none; }
}

/* Выбор настроения */
.mood-opts { display: grid; gap: 0.7rem; margin-top: 1.2rem; }
.mood-opt {
    display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left;
    padding: 1rem; min-height: 64px; border: 1.5px solid var(--border-color); border-radius: 15px;
    background: var(--bg-pure); font-weight: 600; font-size: 1rem; color: var(--text-main); cursor: pointer; transition: var(--transition);
}
.mood-opt .emo { font-size: 1.6rem; }
.mood-opt.sel { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
@media (hover: hover) { .mood-opt:hover { border-color: var(--gold); } }

/* Загрузка фото */
.photo-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 180px; margin-top: 1.1rem; border: 2px dashed var(--border-focus); border-radius: 16px;
    background: var(--bg-milk); cursor: pointer; text-align: center; padding: 1.2rem; color: var(--text-muted); overflow: hidden;
}
.photo-drop .ph-ic { font-size: 2.2rem; }
.photo-drop .ph-hint { font-size: 0.85rem; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop.has-photo .ph-ic, .photo-drop.has-photo .ph-hint { display: none; }
.photo-drop .ph-change { position: absolute; bottom: 8px; right: 8px; background: rgba(26,31,28,0.78); color: #fff; font-size: 0.74rem; font-weight: 600; padding: 0.35rem 0.7rem; border-radius: 999px; display: none; }
.photo-drop.has-photo .ph-change { display: block; }
.sheet-actions { margin-top: 1.3rem; display: grid; gap: 0.6rem; }
.sheet-skip { text-align: center; font-size: 0.85rem; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 0.5rem; }

/* Поздравление */
.sheet-done { text-align: center; padding: 1rem 0 0.5rem; }
.sheet-done .emo { font-size: 3rem; animation: pop 0.5s var(--ease-spring); }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.sheet-done h2 { margin: 0.6rem 0 0.4rem; }
.sheet-done p { color: var(--text-muted); margin-bottom: 1.4rem; }

/* Сводка привычек в шторке */
.habit-summary { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; padding: 0.8rem 1rem; background: var(--bg-milk); border-radius: 12px; font-size: 0.88rem; color: var(--text-muted); }
.habit-summary svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--sage); }
.habit-summary b { color: var(--sage-medium); }

/* Окно «продолжить / заново» */
.resume-card { text-align: center; }
.resume-card .emo { font-size: 2.4rem; }
.resume-card h2 { margin: 0.5rem 0 0.5rem; }
.resume-card p { color: var(--text-muted); margin-bottom: 1.4rem; }
.resume-card .btn { margin-bottom: 0.6rem; }

/* ─── Замеры перед стартом (опционально) ─────────────────── */
.measure-card {
    background: var(--bg-pure); border: 1.5px solid var(--border-color);
    border-radius: 20px; padding: 1.3rem; margin-bottom: 1.2rem; box-shadow: var(--shadow-soft);
}
.measure-card__head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.measure-card__ic {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
    background: var(--gold-soft); color: var(--gold-hover); display: grid; place-items: center;
}
.measure-card__ic svg { width: 22px; height: 22px; }
.measure-card h3 { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.measure-card > p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }
.measure-card__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.measure-card__actions .btn { flex: 1; min-width: 140px; }

/* Карточка-сводка после записи замеров */
.measure-card--done .measure-card__head { margin-bottom: 0.5rem; }
.measure-card--done .measure-card__head p { font-size: 0.84rem; color: var(--text-muted); }
.measure-vals { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0.9rem; }
.measure-val {
    background: var(--bg-milk); border: 1px solid var(--border-color); border-radius: 999px;
    padding: 0.35rem 0.8rem; font-size: 0.82rem; color: var(--text-muted);
}
.measure-val b { color: var(--text-main); font-weight: 700; }
.measure-edit { background: none; border: none; color: var(--gold-hover); font-weight: 600; font-size: 0.85rem; cursor: pointer; padding: 0.4rem 0; }
@media (hover: hover) { .measure-edit:hover { color: var(--gold); } }

/* Тонкая ссылка «добавить замеры», если предложение отложено */
.measure-mini { text-align: center; margin-bottom: 1.2rem; }
.measure-mini button { background: none; border: none; color: var(--gold-hover); font-family: var(--font-ui); font-weight: 600; font-size: 0.88rem; cursor: pointer; padding: 0.5rem 0.8rem; min-height: 44px; }
@media (hover: hover) { .measure-mini button:hover { color: var(--gold); } }

/* Большая «убедительная» карточка-приглашение к замерам */
.measure-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(155deg, #fffdf7, var(--bg-pure) 55%);
    border: 1.5px solid var(--border-focus); border-radius: 22px;
    padding: 1.5rem 1.35rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-card);
}
.measure-hero::before {
    content: ''; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px;
    background: radial-gradient(circle, var(--gold-glow), transparent 70%); pointer-events: none;
}
.measure-hero > * { position: relative; }
.measure-hero__badge {
    display: inline-block; font-family: var(--font-ui); font-size: 0.66rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-hover);
    background: var(--gold-soft); padding: 0.32rem 0.7rem; border-radius: 999px; margin-bottom: 0.9rem;
}
.measure-hero__top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.measure-hero__ic {
    width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px;
    background: var(--gold-soft); color: var(--gold-hover); display: grid; place-items: center;
}
.measure-hero__ic svg { width: 24px; height: 24px; }
.measure-hero h3 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.measure-hero__lead { font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 1rem; }
.measure-hero__list { list-style: none; margin: 0 0 1.3rem; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.measure-hero__list li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; line-height: 1.4; }
.measure-hero__list svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--sage); margin-top: 1px; }
.measure-hero .btn { margin-bottom: 0.3rem; }
.measure-hero__later {
    display: block; width: 100%; background: none; border: none; color: var(--text-muted);
    font-family: var(--font-ui); font-size: 0.85rem; cursor: pointer; padding: 0.55rem; min-height: 44px;
}
@media (hover: hover) { .measure-hero__later:hover { color: var(--gold-hover); } }

/* Сравнение «до и после» — экран результата */
.measure-compare {
    background: linear-gradient(155deg, var(--champagne), var(--bg-pure) 60%);
    border: 1.5px solid var(--border-focus); border-radius: 22px;
    padding: 1.45rem 1.35rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-card);
}
.measure-compare__head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.measure-compare__emo { font-size: 1.9rem; line-height: 1; }
.measure-compare__head h3 { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.1; }
.measure-compare__head p { font-size: 0.84rem; color: var(--text-muted); margin-top: 0.1rem; }
.mc-headline { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mc-big {
    flex: 1; min-width: 128px; background: var(--bg-pure); border: 1px solid var(--border-color);
    border-radius: 15px; padding: 0.8rem 0.95rem;
}
.mc-big span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.25rem; }
.mc-big b { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--sage-medium); line-height: 1; }
.mc-rows { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.9rem; }
.mc-row {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg-pure); border: 1px solid var(--border-color); border-radius: 14px; padding: 0.7rem 0.9rem;
}
.mc-row__label { font-weight: 600; font-size: 0.9rem; min-width: 58px; }
.mc-row__nums { flex: 1; display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.mc-row__nums b { color: var(--text-main); font-weight: 700; }
.mc-row__nums svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--gold-hover); }
.mc-delta { font-family: var(--font-ui); font-weight: 700; font-size: 0.8rem; padding: 0.28rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.mc-delta--is-down { color: var(--sage-medium); background: var(--sage-soft); }
.mc-delta--is-up { color: var(--gold-hover); background: var(--gold-soft); }
.mc-delta--is-same { color: var(--text-muted); background: var(--bg-milk); }

/* Форма замеров в шторке */
.measure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-top: 1.1rem; }
.measure-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.3rem; }
.measure-field .inp-wrap { position: relative; }
.measure-field input {
    width: 100%; padding: 0.8rem 2.7rem 0.8rem 0.9rem; min-height: 52px; font-size: 1rem; font-family: inherit;
    border: 1.5px solid var(--border-color); border-radius: 13px; background: var(--bg-milk); transition: var(--transition);
}
.measure-field input:focus { outline: none; border-color: var(--gold); background: var(--bg-pure); box-shadow: 0 0 0 4px var(--gold-soft); }
.measure-field .unit { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); font-size: 0.82rem; color: var(--text-muted); pointer-events: none; }

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