/*
 * Новый интерфейс (ui_v2): экраны «Сегодня» и «Программа».
 * Подключается только при включённом флаге; все правила действуют строго внутри .v2,
 * поэтому классические экраны не затрагиваются.
 * Палитра и компоненты перенесены из climb-app (тёмная и светлая темы, один лаймовый акцент).
 */

.v2 {
    /* Светлая тема */
    --c-bg: #edefec;
    --c-surface: #ffffff;
    --c-surface-2: #f2f4f1;
    --c-line: rgba(20, 23, 28, 0.09);
    --c-line-strong: rgba(20, 23, 28, 0.12);
    --c-text: #14171c;
    --c-text-dim: #5b636d;
    --c-text-faint: #8a929c;
    --c-accent: #d8fb50;
    --c-accent-ink: #12160a;
    --c-accent-text: #3f6300;
    --c-accent-soft: rgba(216, 251, 80, 0.3);
    --c-tag-bg: #ffe7d6;
    --c-tag-text: #b4470a;
    --c-flame: #ff6b4a;
    --c-track: #e5e8e3;
    --shadow-card: 0 1px 2px rgba(20, 23, 28, 0.05), 0 8px 24px -14px rgba(20, 23, 28, 0.18);
    --font-display: 'Manrope', system-ui, sans-serif;
    --font-sans: 'Inter', system-ui, sans-serif;

    /* Общие компоненты (видео) берут цвета из токенов ui-*: переключаем их на палитру v2 */
    --ui-accent: var(--c-accent);
    --ui-accent-soft: var(--c-surface-2);
    --ui-accent-border: var(--c-line-strong);
    --ui-heading: var(--c-text);
    --ui-muted: var(--c-text-dim);
    --ui-surface-alt: var(--c-surface-2);
    --ui-border: var(--c-line-strong);
    --ui-info: var(--c-accent-text);
    --ui-danger: var(--c-flame);

    box-sizing: border-box;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 28px;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.45;
}

/* Тёмная тема */
html[data-ui-theme='dark'] .v2 {
    --c-bg: #0a0b0d;
    --c-surface: #14171c;
    --c-surface-2: #1b1f27;
    --c-line: rgba(255, 255, 255, 0.07);
    --c-line-strong: rgba(255, 255, 255, 0.12);
    --c-text: #f5f7fa;
    --c-text-dim: #9aa3af;
    --c-text-faint: #666d78;
    --c-accent-text: #d8fb50;
    --c-accent-soft: rgba(216, 251, 80, 0.12);
    --c-tag-bg: rgba(255, 138, 61, 0.16);
    --c-tag-text: #ff9f5e;
    --c-track: #232833;
    --shadow-card: none;
}

.v2 *,
.v2 *::before,
.v2 *::after {
    box-sizing: border-box;
}

.v2 button {
    font-family: inherit;
}

.v2 :focus-visible {
    outline: 2px solid var(--c-accent-text);
    outline-offset: 2px;
}

.v2-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Шапка */
.v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v2-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-link-btn {
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    background: none;
    color: var(--c-text-secondary);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.v2-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

/* Логотип: светлая и тёмная версии переключаются темой */
.v2-brand-logo {
    display: block;
    line-height: 0;
}

.v2-logo {
    display: block;
    width: auto;
    max-width: 100%;
}

.v2-logo-dark {
    display: none;
}

html[data-ui-theme='dark'] .v2 .v2-logo-light {
    display: none;
}

html[data-ui-theme='dark'] .v2 .v2-logo-dark {
    display: block;
}

.v2-brand-sub {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.v2-h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.v2-sub {
    margin-top: 4px;
    color: var(--c-text-dim);
    font-size: 15px;
}

/* Карточки */
.v2-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--c-line);
    border-radius: 24px;
    background: var(--c-surface);
    box-shadow: var(--shadow-card);
}

.v2-hero {
    padding: 18px;
}

.v2-hero::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -50px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: var(--c-accent-soft);
    pointer-events: none;
}

.v2-hero > * {
    position: relative;
    z-index: 1;
}

.v2-row-between {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v2-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
    font-size: 13px;
    font-weight: 700;
}

.v2-chip::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.v2-count {
    color: var(--c-accent-text);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-hero-time {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.v2-hero-meta {
    margin-top: 6px;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.v2-btn {
    flex: 1 1 0;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--c-line-strong);
    border-radius: 16px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.v2-btn-primary {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Секции */
.v2-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v2-label {
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.v2-label-accent {
    color: var(--c-accent-text);
    font-size: 14px;
    font-weight: 700;
}

.v2-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v2-block-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.v2-block-meta {
    flex-shrink: 0;
    color: var(--c-text-faint);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
}

.v2-block-desc {
    margin-top: 4px;
    color: var(--c-text-dim);
    font-size: 14px;
    white-space: pre-wrap;
}

.v2-videos {
    margin-top: 6px;
}

.v2-videos:empty {
    display: none;
}

/* Карточка-ссылка на другой экран */
.v2-link-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    text-align: left;
    color: var(--c-text);
    font: inherit;
    cursor: pointer;
}

.v2-link-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-link-sub {
    color: var(--c-text-dim);
    font-size: 13px;
}

/* Пустые состояния, ошибки, загрузка */
.v2-empty {
    text-align: center;
}

.v2-empty-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
}

.v2-empty-text {
    margin: 6px 0 16px;
    color: var(--c-text-dim);
}

.v2-error {
    color: var(--c-flame);
}

.v2-skeleton {
    height: 120px;
    border-radius: 24px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    animation: v2-pulse 1.4s ease-in-out infinite;
}

@keyframes v2-pulse {
    50% {
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .v2-skeleton {
        animation: none;
    }
}

/* Программа */
.v2-cycle {
    display: flex;
    align-items: center;
    gap: 16px;
}

.v2-ring {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
}

.v2-ring-track {
    stroke: var(--c-track);
}

.v2-ring-value {
    stroke: var(--c-accent);
}

.v2-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
}

.v2-cycle-title {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.v2-cycle-sub {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-stats {
    display: flex;
    gap: 10px;
}

.v2-stat {
    flex: 1 1 0;
    padding: 14px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-stat-label {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-stat-value {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
}

.v2-list {
    padding: 4px 16px;
}

.v2-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-line);
}

.v2-row:last-child {
    border-bottom: 0;
}

.v2-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-line);
    color: var(--c-text-dim);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
}

.v2-row-icon.is-accent {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.v2-row-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
}

.v2-row-sub {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 600;
}

.v2-badge.is-high {
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
}

.v2-banner {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--c-accent-soft);
    color: var(--c-text);
    font-size: 14px;
}

.v2-hint {
    color: var(--c-text-dim);
    font-size: 13px;
    text-align: center;
}

.v2-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-size: 12px;
    font-weight: 700;
}

/* Дневник */
.v2-week {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.v2-day-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.v2-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--c-line);
    border-radius: 50%;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
}

.v2-day.is-done {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-day.is-today {
    border: 2px solid var(--c-accent-text);
}

.v2-day-name {
    color: var(--c-text-dim);
    font-size: 12px;
    text-transform: capitalize;
}

.v2-field-label {
    display: block;
    margin: 14px 0 6px;
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 600;
}

.v2-mood-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-mood {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--c-line-strong);
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.v2-mood[aria-pressed='true'] {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-weight: 800;
}

.v2-mood-emoji {
    font-size: 18px;
}

.v2-textarea {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--c-line-strong);
    border-radius: 16px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font: inherit;
    resize: vertical;
}

.v2-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-accent-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.v2-date-badge {
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
}

.v2-date-month {
    color: var(--c-text-dim);
    font-size: 10px;
    font-weight: 600;
}

/* ---- Видео: плеер, строки, окна управления (как в макете) ---- */
html[data-ui='v2'] {
    --ui-surface: var(--c-surface);
    --ui-surface-alt: var(--c-surface-2);
    --ui-page: var(--c-bg);
    --ui-text: var(--c-text);
    --ui-heading: var(--c-text);
    --ui-muted: var(--c-text-secondary);
    --ui-border: var(--c-border);
    --ui-border-soft: var(--c-border);
    --ui-accent: var(--v2-accent-text);
    --ui-accent-soft: var(--c-primary-light);
    --ui-accent-border: var(--c-border);
}

html[data-ui='v2'] .wv-row {
    gap: 12px !important;
    padding: 8px !important;
    margin-top: 8px !important;
    border-radius: 16px !important;
    border: 1px solid var(--c-border);
    background: var(--c-surface-2) !important;
}

html[data-ui='v2'] .wv-thumb {
    position: relative;
    width: 104px !important;
    height: 62px !important;
    min-width: 44px;
    border-radius: 12px !important;
    background-color: #1f3a5f;
    background-image: linear-gradient(135deg, #1f3a5f, #3e7bc4);
    font-size: 20px !important;
}

html[data-ui='v2'] .wv-dur {
    display: block !important;
    position: absolute;
    right: 6px;
    bottom: 4px;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

html[data-ui='v2'] .wv-title {
    font-family: var(--v2-heading);
    font-weight: 800 !important;
    line-height: 1.25;
    white-space: normal;
}

html[data-ui='v2'] .wv-meta {
    margin-top: 2px;
    font-size: 12px;
}

html[data-ui='v2'] .wv-player {
    margin-top: 8px;
    border-radius: 16px !important;
}

html[data-ui='v2'] .wv-overlay {
    background: rgba(8, 10, 12, 0.6) !important;
}

html[data-ui='v2'] .wv-overlay > * {
    background: var(--c-surface) !important;
    color: var(--c-text);
    border-radius: 20px !important;
    border: 1px solid var(--c-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
}

html[data-ui='v2'] .wv-meta-dur,
html[data-ui='v2'] .wv-overlay .wv-scope {
    display: none !important;
}

html[data-ui='v2'] .wv-scope {
    display: inline !important;
}

html[data-ui='v2'] .wv-overlay .wv-scope {
    display: none !important;
}

/* ---- Экран «Тренировки» ---- */
.v2-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.v2-add-btn {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.v2-seg {
    display: flex;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    background: var(--c-surface-2);
}

.v2-seg-btn {
    flex: 1 1 0;
    min-height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--c-text-dim);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.v2-seg-btn.is-active {
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
}

.v2-input::placeholder {
    color: var(--c-text-faint);
}

.v2-filter-row {
    display: flex;
    gap: 8px;
}

.v2-filter-row .v2-input:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.v2-filter-row select.v2-input {
    flex: 0 1 45%;
}

.v2-filter-actions {
    display: flex;
    gap: 8px;
}

.v2-btn-sm {
    min-height: 44px;
    font-size: 14px;
}

.v2-sortbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.v2-sortbar .v2-input {
    flex: 1 1 120px;
    width: auto;
}

.v2-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-group-label {
    margin-top: 6px;
}

.v2-group-count {
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
    color: var(--c-text-faint);
}

.v2-tr-date {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-tr-title {
    margin-top: 6px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-tr-loc {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-chip.is-done {
    background: var(--c-accent-soft);
    color: var(--c-accent-text);
}

.v2-block-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.v2-block-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 600;
}

.v2-tr-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.v2-tr-actions .v2-icon-btn {
    flex: none;
    width: 52px;
    height: 52px;
    box-shadow: none;
}

.v2-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.v2-page-btn {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface);
    color: var(--c-text);
    font-family: var(--font-display);
    font-weight: 800;
    cursor: pointer;
}

.v2-page-btn.is-active {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-add-btn {
    flex: none;
    white-space: nowrap;
}

.v2-filter-row select.v2-input {
    flex: 0 0 38%;
    padding: 0 8px;
}

.v2-filter-actions .v2-btn {
    flex: 0 1 auto;
    min-width: 120px;
}

/* ---- Профиль ---- */
.v2-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.v2-avatar {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
}

.v2-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.v2-avatar-edit {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--c-surface);
    border-radius: 50%;
    background: var(--c-text);
    color: var(--c-surface);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.v2-profile-id {
    min-width: 0;
}

.v2-profile-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.v2-profile-handle {
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-chip.is-plain {
    background: var(--c-surface-2);
    color: var(--c-text-dim);
}

.v2-chip.is-plain::before {
    display: none;
}

.v2-profile .v2-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.v2-profile .v2-stat {
    min-width: 0;
    padding: 12px;
}

.v2-profile .v2-stat-value {
    font-size: 20px;
}

/* Карточка «Ближайшее занятие» на вкладке «Обзор»: первым экраном, с лаймовой кнопкой действия */
.v2-profile-next {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-next-head {
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 600;
}

.v2-next-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.v2-next-meta {
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-next-cta {
    min-height: 48px;
    margin-top: 4px;
}

/* Тесты и рекорды (вкладка «Прогресс»): сетка 2×2 с мини-графиком */
.v2-profile-tests {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 12px;
}

.v2-tests-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-tests-empty {
    margin: 0;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-tests-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v2-test-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-test-label {
    color: var(--c-text-dim);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.v2-test-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
}

.v2-test-unit {
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 600;
}

.v2-test-spark {
    display: block;
    width: 100%;
    height: 30px;
}

.v2-test-foot {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: var(--c-text-dim);
}

/* Нагрузка по неделям (вкладка «Прогресс») */
.v2-profile-load {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-load-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.v2-load-unit {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-load-switch {
    display: flex;
    gap: 6px;
}

.v2-load-switch .v2-ptab {
    min-height: 44px;
}

.v2-load-summary {
    color: var(--c-text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}

.v2-load-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
}

.v2-load-col {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.v2-load-bar {
    display: block;
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    background: var(--c-surface-2);
}

.v2-load-bar.is-current {
    background: var(--c-accent);
}

/* Вкладка «Данные»: просмотр параметров и поля формы редактирования в теме v2 */
.v2-body-sub {
    margin: 16px 0 4px;
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 600;
}

.v2-body-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-top: 1px solid var(--c-surface-2);
    font-size: 15px;
}

.v2-body-row:first-child {
    border-top: 0;
}

.v2-body-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
}

.profile-data-section.v2 input,
.profile-data-section.v2 textarea {
    min-height: 44px;
    border: 1px solid var(--c-surface-2);
    background: var(--c-surface-2);
    color: var(--c-text);
    font: inherit;
}

.profile-data-section.v2 label {
    color: var(--c-text-dim);
    font-size: 13px;
}

/* Снаряжение и команда поддержки (вкладка «Данные») */
.v2-remind-tag.is-ok {
    background: var(--c-surface-2);
    color: var(--c-text-dim);
}

.v2-remind-tag.is-warn {
    background: #ff9f5e;
    color: #12160a;
}

.v2-remind-tag.is-bad {
    background: #ff6b6b;
    color: #12160a;
}

.v2-team-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--c-surface-2);
}

.v2-team-card:first-child {
    border-top: 0;
}

.v2-team-card .v2-btn {
    min-height: 44px;
}

/* История измерений (вкладка «Данные») */
.v2-history-entry + .v2-history-entry {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--c-surface-2);
}

.v2-history-date {
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 700;
}

/* Напоминания и события на вкладке «Обзор» используют строки списка активностей */
.v2-remind-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 0;
    border-top: 1px solid var(--c-surface-2);
}

.v2-remind-row:first-child {
    border-top: 0;
}

.v2-remind-row .v2-recent-text {
    flex: 1 1 auto;
}

.v2-remind-tag {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 700;
}

.v2-remind-tag.is-high {
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

/* Тепловая карта активности (вкладка «Обзор»): уровни от лаймового акцента */
.v2-profile-heat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-heat-grid {
    display: flex;
    justify-content: space-between;
    gap: 3px;
}

.v2-heat-col {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.v2-heat-cell {
    display: block;
    aspect-ratio: 1;
    border-radius: 4px;
}

.v2-heat-col .v2-heat-cell {
    width: 100%;
}

.v2-heat-cell.is-empty-slot {
    background: transparent;
}

.v2-heat-0 {
    background: var(--c-surface-2);
}

.v2-heat-1 {
    background: #4d5a1f;
    background: color-mix(in srgb, var(--c-accent) 35%, var(--c-surface-2));
}

.v2-heat-2 {
    background: #93b136;
    background: color-mix(in srgb, var(--c-accent) 65%, var(--c-surface-2));
}

.v2-heat-3 {
    background: var(--c-accent);
}

.v2-heat-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-heat-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--c-text-dim);
    font-size: 11px;
}

.v2-heat-legend .v2-heat-cell {
    width: 12px;
    height: 12px;
}

/* Последние активности (вкладка «Обзор») */
.v2-profile-recent {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.v2-recent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 0;
    border-top: 1px solid var(--c-surface-2);
}

.v2-recent-row:first-child {
    border-top: 0;
}

.v2-recent-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-accent);
}

.v2-recent-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.v2-recent-text strong {
    overflow-wrap: anywhere;
    font-size: 15px;
}

.v2-recent-meta {
    color: var(--c-text-dim);
    font-size: 13px;
}

/* Плитки статистики на вкладке «Обзор» */
.v2-profile-tiles {
    margin: 0 0 12px;
}

.v2-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v2-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 44px;
    padding: 14px;
    border: 0;
    border-radius: 20px;
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
    text-align: left;
}

.v2-tile.is-link {
    cursor: pointer;
}

.v2-tile-label {
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-tile-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
}

.v2-stat-change {
    font-family: var(--font-body, inherit);
    font-size: 13px;
    font-weight: 700;
}

.v2-stat-change.is-up {
    color: var(--c-accent);
}

.v2-stat-change.is-down {
    color: #ff9f5e;
}

/* Сравнение с прошлым периодом (вкладка «Прогресс») */
.v2-profile-compare {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-compare-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.v2-compare-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.v2-compare-label {
    flex: 1 1 auto;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-compare-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-compare-delta {
    min-width: 40px;
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.v2-compare-delta.is-up {
    color: var(--c-accent);
}

.v2-compare-delta.is-down {
    color: #ff9f5e;
}

.v2-compare-prev {
    color: var(--c-text-dim);
    font-size: 12px;
}

/* Карточка уровня (вкладка «Награды») */
.v2-profile-level {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-level-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
}

.v2-level-title {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
}

.v2-level-xp {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-level-bar {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--c-surface-2);
}

.v2-level-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--c-accent);
}

/* Награды: серия за 7 дней и сетка достижений */
.v2-profile-streak,
.v2-profile-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--c-surface);
}

.v2-streak-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.v2-streak-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ff9f5e;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
}

.v2-streak-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.v2-streak-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--c-text-dim);
    font-size: 11px;
}

.v2-streak-day.is-today {
    color: var(--c-text);
    font-weight: 700;
}

.v2-streak-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1.2;
    border-radius: 12px;
    background: var(--c-surface-2);
    color: var(--c-accent-ink);
}

.v2-streak-dot.is-on {
    background: var(--c-accent);
}

.v2-streak-hint {
    margin: 0;
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-badges-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.v2-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 12px 8px;
    border-radius: 18px;
    background: var(--c-surface-2);
    text-align: center;
}

.v2-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-badge-title {
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.v2-badge-date {
    color: var(--c-text-dim);
    font-size: 11px;
}

/* Вход в редактирование профиля из шапки: «Редактировать» и «О себе» (раньше форма пряталась во вкладке «Настройки») */
.v2-profile-edit {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.v2-profile-bio {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* Кольцо уровня вокруг аватара (макет профиля): лаймовая дуга прогресса и номер уровня на нижнем крае */
.v2-avatar-face {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
}

.v2-avatar.has-level {
    width: 96px;
    height: 96px;
    background: transparent;
}

.v2-avatar.has-level .v2-avatar-face {
    position: absolute;
    inset: 12px;
    width: auto;
    height: auto;
    background: var(--c-accent);
}

.v2-avatar-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.v2-avatar-ring-track {
    stroke: var(--c-surface-2);
}

.v2-avatar-ring-fill {
    stroke: var(--c-accent);
}

.v2-avatar-level {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.v2-avatar-edit {
    right: -8px !important;
    bottom: -8px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
}

/* ---- Абонементы ---- */
.v2 .v2-seg .v2-seg-btn {
    flex: 1 1 0;
    min-height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--c-text-dim);
    box-shadow: none;
}

.v2 .v2-seg .v2-seg-btn.is-active,
.v2 .v2-seg .v2-seg-btn.active {
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-bar {
    height: 10px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--c-track);
}

.v2-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--c-accent-text);
}

.v2-membership {
    cursor: pointer;
}

.v2-membership-left {
    margin-top: 12px;
    font-family: var(--font-display);
    font-weight: 800;
}

/* ---- Тренеры и запись на слоты ---- */
.v2-company-line {
    margin-top: 8px;
}

.v2-debug {
    display: none;
}

.v2-trainer-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.v2-trainer-avatar {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--c-line);
    border-radius: 18px;
    background: var(--c-surface-2);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-trainer-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-trainer-id {
    flex: 1 1 auto;
    min-width: 0;
}

.v2-trainer-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.v2-trainers-pager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.v2-pager-count {
    font-family: var(--font-display);
    font-weight: 800;
}

.v2-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.v2 .v2-slots {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--c-line);
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2 .v2-slots ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.v2 .v2-slots li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-text);
}

.v2 .v2-slots li:last-child {
    border-bottom: 0;
}

.v2 .v2-slots .btn {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-display);
    font-weight: 800;
    box-shadow: none;
    cursor: pointer;
}

.v2-slots-panel .v2-filter-actions .v2-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
}

.v2-trainer-head .v2-chip {
    flex: none;
    white-space: nowrap;
}

.v2-slots-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-filter-row .v2-input[type='date'] {
    min-width: 0;
}

/* ---- AI-тренер: контекст, чат, ввод ---- */
.v2-ai .ai-chat-context {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-ai .ai-chat {
    margin-top: 0;
}

.v2-ai .chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    box-shadow: var(--shadow-card);
}

.v2-ai .message {
    max-width: 88%;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.45;
}

.v2-ai .ai-message {
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    background: var(--c-surface-2);
    color: var(--c-text);
}

.v2-ai .user-message {
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    text-align: left;
}

.v2-ai .error-message {
    align-self: flex-start;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
}

.v2-ai .ai-disclaimer {
    align-self: stretch;
    max-width: 100%;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
    font-size: 13px;
}

.v2-ai .ai-example {
    align-self: stretch;
    max-width: 100%;
    background: var(--c-accent-soft);
    color: var(--c-text);
    font-size: 13px;
}

.v2-ai .ai-message-content {
    color: inherit;
}

.v2-ai .ai-tool-btn {
    min-height: 32px;
    border: 1px solid var(--c-line-strong);
    border-radius: 10px;
    background: var(--c-surface);
    color: var(--c-text-dim);
}

.v2-ai .ai-feedback {
    border-top-color: var(--c-line);
}

.v2-ai .ai-feedback-label {
    color: var(--c-text-dim);
}

.v2-ai .chat-input {
    flex-direction: column;
    gap: 10px;
}

.v2-ai .chat-input textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 88px;
    padding: 12px 14px;
    border: 1px solid var(--c-line-strong);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
}

.v2-ai .chat-input .btn {
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

/* ---- Бронирования ---- */
.v2-bookings .membership-summary-banner .banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    box-shadow: var(--shadow-card);
}

.v2-bookings .banner-has-membership {
    border-color: transparent;
    background: var(--c-accent-soft);
}

.v2-bookings .banner-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
}

.v2-bookings .banner-text {
    margin-top: 2px;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-bookings .btn {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-family: var(--font-display);
    font-weight: 800;
    box-shadow: none;
    cursor: pointer;
}

.v2-bookings .btn-primary {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-bookings .btn-danger {
    border-color: transparent;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
}

.v2-bookings .btn-success {
    border-color: transparent;
    background: var(--c-accent-soft);
    color: var(--c-accent-text);
}

.v2-bookings .booking-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.v2-bookings .booking-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.v2-bookings .booking-section-header h3 {
    margin: 0;
    color: var(--c-text-dim);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.v2-bookings .count-badge {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 700;
}

.v2-bookings .booking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-bookings .booking-card {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    box-shadow: var(--shadow-card);
}

.v2-bookings .booking-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.v2-bookings .booking-date {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
}

.v2-bookings .booking-item {
    margin: 4px 0 0;
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-bookings .booking-item strong {
    color: var(--c-text);
    font-weight: 700;
}

.v2-bookings .booking-notes {
    margin: 8px 0 0;
    color: var(--c-text-dim);
    font-size: 13px;
}

.v2-bookings .booking-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.v2-bookings .booking-card-actions .btn {
    flex: 1 1 0;
}

.v2-bookings .status-badge {
    flex: none;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.v2-bookings .status-confirmed,
.v2-bookings .status-completed {
    background: var(--c-accent-soft);
    color: var(--c-accent-text);
}

.v2-bookings .status-pending {
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
}

.v2-bookings .status-cancelled {
    background: var(--c-surface-2);
    color: var(--c-text-faint);
}

.v2-bookings .booking-empty,
.v2-bookings .booking-empty-state {
    padding: 20px;
    border: 1px dashed var(--c-line-strong);
    border-radius: 20px;
    background: transparent !important;
    color: var(--c-text-dim);
    text-align: center;
}

.v2-bookings .info-card.warning-card {
    padding: 20px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-card);
}

/* ---- Детали абонемента ---- */
.v2-memberships .membership-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: none;
    padding: 0;
}

.v2-memberships .membership-details > .btn {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-family: var(--font-display);
    font-weight: 800;
    cursor: pointer;
}

.v2-memberships .membership-details-header {
    margin: 0;
    padding: 0;
    border: 0;
    gap: 10px;
}

.v2-memberships .membership-details-header h1 {
    color: var(--c-text);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
}

.v2-memberships .membership-info-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}

.v2-memberships .info-card,
.v2-memberships .usage-history {
    padding: 16px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-card);
}

.v2-memberships .info-card h3,
.v2-memberships .usage-history h2 {
    margin: 0 0 10px;
    color: var(--c-text-dim);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.v2-memberships .info-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-line);
}

.v2-memberships .info-item .label {
    color: var(--c-text-dim);
}

.v2-memberships .info-item .value {
    color: var(--c-text);
    font-family: var(--font-display);
    font-weight: 800;
}

.v2-memberships .info-card .btn {
    min-height: 48px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-family: var(--font-display);
    font-weight: 800;
    cursor: pointer;
}

.v2-memberships .info-card .btn-primary {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-memberships .info-card .btn-danger {
    border-color: transparent;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
}

.v2-memberships .info-text {
    color: var(--c-text-dim);
    font-size: 14px;
}

.v2-memberships .qr-wrapper {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.v2-memberships .qr-wrapper img {
    padding: 10px;
    border-radius: 16px;
    background: #fff;
}

.v2-memberships .qr-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--c-text-dim);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.v2-memberships .usage-history {
    overflow-x: auto;
}

.v2-memberships .usage-table thead {
    background: transparent;
}

.v2-memberships .usage-table th {
    padding: 8px;
    color: var(--c-text-faint);
    font-size: 12px;
}

.v2-memberships .usage-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-text);
}

.v2-memberships .usage-table tbody tr:hover {
    background: transparent;
}

.v2-memberships .badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.v2-memberships .badge-success {
    background: var(--c-accent-soft);
    color: var(--c-accent-text);
}

.v2-memberships .badge-cancelled {
    background: var(--c-surface-2);
    color: var(--c-text-faint);
}

.v2-memberships .status-badge {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 800;
}

.v2-memberships .status-active {
    background: var(--c-accent-soft);
    color: var(--c-accent-text);
}

/* ---- Календарь тренировок (FullCalendar) ---- */
.v2.v2-cal {
    max-width: 960px;
}

.v2-cal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-cal-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--c-line-strong);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.v2-cal-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.v2-cal-chip .v2-cal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--chip);
}

.v2-cal-chip:has(input:not(:checked)) {
    background: transparent;
    color: var(--c-text-faint);
}

.v2-cal-chip:has(input:not(:checked)) .v2-cal-dot {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--chip);
}

.v2-cal-chip:has(input:focus-visible) {
    outline: 3px solid var(--c-accent-text);
    outline-offset: 2px;
}

.v2-cal-host {
    padding: 12px;
}

.v2 .fc {
    --fc-border-color: var(--c-line);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--c-surface-2);
    --fc-today-bg-color: var(--c-accent-soft);
    --fc-now-indicator-color: var(--c-flame);
    color: var(--c-text);
    font-family: var(--font-sans);
}

.v2 .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
}

.v2 .fc .fc-toolbar-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2 .fc .fc-button {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--c-line-strong);
    border-radius: 12px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    text-transform: none;
    box-shadow: none;
}

.v2 .fc .fc-button:hover {
    background: var(--c-surface-2);
    border-color: var(--c-line-strong);
}

.v2 .fc .fc-button-primary:not(:disabled).fc-button-active,
.v2 .fc .fc-button-primary:not(:disabled):active {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2 .fc .fc-button:disabled {
    opacity: 0.45;
}

.v2 .fc .fc-col-header-cell-cushion,
.v2 .fc .fc-daygrid-day-number {
    color: var(--c-text-dim);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.v2 .fc .fc-day-today .fc-daygrid-day-number {
    color: var(--c-accent-text);
    font-weight: 800;
}

.v2 .fc .fc-event {
    border-width: 0 0 0 4px !important;
    border-style: solid !important;
    border-radius: 8px;
    background: var(--c-surface-2) !important;
    color: var(--c-text) !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.v2 .fc .fc-event .fc-event-main,
.v2 .fc .fc-event-title,
.v2 .fc .fc-event-time {
    color: var(--c-text) !important;
}

.v2 .fc .fc-daygrid-more-link {
    color: var(--c-accent-text);
    font-weight: 700;
}

.v2 .fc .fc-popover {
    border: 1px solid var(--c-line-strong);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-text);
}

.v2 .fc .fc-popover-header {
    background: var(--c-surface-2);
    color: var(--c-text);
}

.v2-cal-host {
    overflow: hidden;
}

.v2 .fc .fc-scrollgrid,
.v2 .fc table {
    width: 100%;
    table-layout: fixed;
}

.v2 .fc .fc-daygrid-day-frame {
    min-width: 0;
}

.v2 .fc .fc-daygrid-dot-event {
    border: 0 !important;
    border-radius: 8px;
    background: transparent !important;
}

.v2 .fc .fc-daygrid-dot-event .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2 .fc .fc-toolbar-chunk {
    display: flex;
    gap: 6px;
}

.v2 .fc .fc-daygrid-body,
.v2 .fc .fc-scrollgrid-sync-table,
.v2 .fc .fc-col-header {
    width: 100% !important;
}

.v2 .fc .fc-daygrid-day-top {
    justify-content: center;
}

.v2-memberships .info-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.v2-memberships .info-card .btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

/* Нижняя панель на 5 вкладок: стили вынесены в ui-v2-tabbar.css (их же использует /travels) */

/* Пока открыт нижний лист или push-экран старой оболочки, панель прячем: иначе она (z-index 10000) перекрывает их кнопки */
body:has(.bottom-sheet-overlay.show) .v2-tabbar,
body:has(.push-screen.show) .v2-tabbar,
body:has(.v2-adv-overlay) .v2-tabbar,
body:has(.v2-adv-timer) .v2-tabbar,
/* классические диалоги — нижний лист на z-index 400; постоянный #modal-overlay прячется через style="display: none" */
body:has(.modal-overlay:not([style*="display: none"])) .v2-tabbar {
    display: none;
}

/* Старые нижние панели и «меню-гамбургер» под новым видом не нужны: их закрывает панель из макета */
html[data-ui='v2'] .bottom-tab-bar,
html[data-ui='v2'] #mobile-tab-bar,
html[data-ui='v2'] .mobile-tab-bar {
    display: none !important;
}

/* Разделы, которых нет во вкладках */
.v2-more-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.v2-more-link {
    min-height: 52px;
    padding: 0 12px;
    border: 1px solid var(--c-line-strong);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-text);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

/* Верхняя панель старой оболочки (#app-bar) под новым видом не нужна: шапка есть на самих экранах, как в макете. */
html[data-ui='v2'] {
    --app-bar-height: 0px;
}

html[data-ui='v2'] #app-bar,
html[data-ui='v2'] .app-bar {
    display: none !important;
}

/* ---- Фильтры списка: кнопка и нижняя шторка ---- */
.v2-filter-btn {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--c-line-strong);
    border-radius: 14px;
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
}

.v2-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-size: 12px;
    font-weight: 800;
}

.v2.v2-sheet-host {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: rgba(20, 23, 28, 0.52);
}

.v2-sheet {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    background: var(--c-surface);
    color: var(--c-text);
}

.v2-sheet:focus {
    outline: none;
}

.v2-sheet-handle {
    align-self: center;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: var(--c-line-strong);
}

.v2-sheet-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
}

.v2-sheet-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-sheet-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-sheet-opt {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--c-line-strong);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.v2-sheet-opt.is-on {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-weight: 800;
}

.v2-sheet-opt:focus-visible,
.v2-filter-btn:focus-visible {
    outline: 3px solid var(--c-accent-text);
    outline-offset: 2px;
}

.v2-sheet .v2-actions {
    margin-top: 0;
}

/* ---- Календарь «месяц» по макету: точки в клетках, выбранный день, список дня ---- */
.v2-cal-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px 2px;
}

.v2-cal-chip {
    flex: none;
}

.v2 .fc .fc-daygrid-day {
    cursor: pointer;
}

.v2 .fc .fc-daygrid-day-top {
    justify-content: center;
}

.v2 .fc .fc-daygrid-day-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 2px 0;
    padding: 0;
    border-radius: 50%;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 700;
}

.v2 .fc .fc-day-other .fc-daygrid-day-number {
    color: var(--c-text-dim);
    opacity: 0.7;
}

.v2 .fc .fc-day-today {
    background: transparent;
}

.v2 .fc .fc-day-today .fc-daygrid-day-number {
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-weight: 800;
}

.v2 .fc .v2-day-selected .fc-daygrid-day-frame {
    box-shadow: inset 0 0 0 2px var(--c-text);
    border-radius: 14px;
}

.v2 .fc .fc-daygrid-day-events {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    min-height: 10px;
    margin: 0;
    padding: 0 2px 4px;
}

.v2 .fc .fc-daygrid-event-harness {
    margin: 0 !important;
}

.v2 .fc .fc-daygrid-dot-event {
    padding: 0;
}

.v2 .fc .fc-daygrid-event-dot {
    margin: 0;
    border-width: 4px;
}

.v2 .fc .fc-daygrid-more-link {
    font-size: 11px;
}

@media (max-width: 640px) {
    .v2 .fc .fc-daygrid-dot-event .fc-event-title,
    .v2 .fc .fc-daygrid-dot-event .fc-event-time {
        display: none;
    }

    .v2 .fc .fc-daygrid-day-frame {
        min-height: 54px;
    }
}

@media (min-width: 641px) {
    .v2 .fc .fc-daygrid-day-events {
        flex-direction: column;
        align-items: stretch;
        gap: 1px;
    }

    .v2 .fc .fc-daygrid-dot-event {
        font-size: 11px;
    }

    .v2 .fc .fc-daygrid-day-frame {
        min-height: 84px;
    }
}

.v2-agenda {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v2-agenda-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-agenda-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v2-agenda-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
}

.v2-agenda-time {
    flex: none;
    min-width: 56px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
}

.v2-agenda-body {
    flex: 1 1 auto;
    min-width: 0;
}

.v2-agenda-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
}

.v2-agenda-open {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    cursor: pointer;
}

.v2-agenda .v2-btn {
    flex: none;
}

.v2-cal-export {
    align-self: center;
}

/* ---- Вкладка «Неделя» ---- */
.v2.v2-week,
.v2.v2-cal {
    padding-top: 0;
}

.v2.v2-trainings {
    padding-bottom: 12px;
}

.v2-wk-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v2-wk-range {
    min-width: 0;
    text-align: center;
}

.v2-wk-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.v2-wk-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.v2-wk-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 68px;
    padding: 8px 0;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
}

.v2-wk-day.is-past {
    opacity: 0.75;
}

.v2-wk-day.is-today:not(.is-selected) {
    box-shadow: inset 0 0 0 2px var(--c-accent-text);
}

.v2-wk-day.is-selected {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    opacity: 1;
}

.v2-wk-short {
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    opacity: 0.8;
}

.v2-wk-num {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
}

.v2-wk-dots {
    display: flex;
    gap: 3px;
    min-height: 6px;
}

.v2-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chip);
}

.v2-wk-panel[hidden] {
    display: none;
}

.v2-wk-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v2-wk-card {
    display: flex;
    gap: 14px;
    padding: 14px;
}

.v2-wk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.v2-wk-actions .v2-btn {
    flex: 1 1 auto;
}

.v2-wk-act {
    flex: none;
    box-shadow: none;
}

/* Быстрое создание */
.v2-sheet > .v2-btn {
    flex: none;
}

.v2-q-error {
    color: var(--c-tag-text);
    font-weight: 700;
}

.v2-q-error[hidden] {
    display: none;
}

.v2-sheet .v2-filter-row .v2-input {
    flex: 1 1 0;
    min-width: 0;
}

/* ---- Каталог «Программы» ---- */
.v2-back {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--c-text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.v2-catalog-item {
    display: block;
}

.v2-catalog-name {
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--c-text);
}

.v2-catalog-sub {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--c-text-secondary);
}

.v2-catalog-bar {
    height: 8px;
    margin-top: 12px;
    border-radius: 999px;
    background: var(--v2-track, #e5e8e3);
    overflow: hidden;
}

.v2-catalog-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--c-primary);
}

.v2-catalog-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.v2-catalog-clamp {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---- Профиль: ширина и переполнение на телефоне ---- */
/* Страница уже имеет отступ от #content: второй такой же у контейнера профиля и ещё 20px у .v2 сужали шапку до ~290px из 390 */
.profile-container--v2.mobile-content-area {
    padding-right: 0;
    padding-left: 0;
}

.profile-container--v2 > .v2.v2-profile {
    padding-right: 0;
    padding-left: 0;
    background: transparent;
}

.v2-profile .v2-stat-label {
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* Три кнопки в ряд не помещались («Язык и выход» уезжала за экран): сетка переносит лишнюю на следующую строку */
.v2-profile .v2-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.v2-profile .v2-btn {
    min-width: 0;
    padding: 0 12px;
}

/* «Мои пролазы» в профиле: слот только даёт переменные темы (.v2), рамки и фона у него нет */
.v2.v2-profile-videos-slot {
    max-width: none;
    margin: 0 0 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.v2-profile-videos-slot:empty {
    display: none;
}

.v2-profile .v2-actions > .v2-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* ---- Вкладки профиля ---- */
.v2.v2-profile-tabs {
    position: sticky;
    top: 0;
    z-index: 4;
    max-width: none;
    margin: 0 -16px 12px;
    padding: 8px 16px;
    border-radius: 0;
    background: var(--c-bg);
}

.v2-ptabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.v2-ptabs::-webkit-scrollbar {
    display: none;
}

.v2-ptab {
    flex: none;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    color: var(--c-text-dim);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.v2-ptab.is-active {
    border-color: transparent;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.v2-ptab:focus-visible {
    outline: 3px solid var(--c-text);
    outline-offset: 2px;
}

.profile-tab-panel[hidden] {
    display: none !important;
}

/*
 * Профиль, вкладка «Обзор»: единый вид секций.
 * Разметка секций собирается в renderProfileFull.ts со встроенными стилями (белый фон,
 * серые цвета), поэтому здесь они переопределяются через !important и палитру v2.
 */
.profile-container--v2 {
    --c-surface: #ffffff;
    --c-surface-2: #f2f4f1;
    --c-line: rgba(20, 23, 28, 0.09);
    --c-text: #14171c;
    --c-text-dim: #5b636d;
    --c-track: #e5e8e3;
    --c-accent-soft: rgba(216, 251, 80, 0.3);
    --shadow-card: 0 1px 2px rgba(20, 23, 28, 0.05), 0 8px 24px -14px rgba(20, 23, 28, 0.18);
}

html[data-ui-theme='dark'] .profile-container--v2 {
    --c-surface: #14171c;
    --c-surface-2: #1b1f27;
    --c-line: rgba(255, 255, 255, 0.07);
    --c-text: #f5f7fa;
    --c-text-dim: #9aa3af;
    --c-track: #232833;
    --c-accent-soft: rgba(216, 251, 80, 0.12);
    --shadow-card: none;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) {
    margin: 0 0 12px !important;
    padding: 16px !important;
    border: 1px solid var(--c-line);
    border-radius: 20px !important;
    background: var(--c-surface) !important;
    box-shadow: var(--shadow-card);
    color: var(--c-text);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) h2 {
    margin: 0 0 12px !important;
    font-family: var(--font-display);
    font-size: 17px !important;
    font-weight: 800;
    color: var(--c-text);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #666'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #6b7280'] {
    color: var(--c-text-dim) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #1f2937'] {
    color: var(--c-text) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: #e5e7eb'] {
    background: var(--c-track) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] .profile-soft-stat-grid {
    gap: 10px;
    margin-bottom: 12px;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] .profile-soft-stat-card {
    padding: 14px;
    border: 1px solid var(--c-line);
    border-radius: 20px;
    background: var(--c-surface);
    box-shadow: var(--shadow-card);
    color: var(--c-text);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] .profile-soft-stat-label {
    color: var(--c-text-dim);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] .profile-soft-stat-value {
    color: var(--c-text);
    font-family: var(--font-display);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='linear-gradient(135deg, #f'] {
    border: 1px solid var(--c-line);
    border-radius: 14px !important;
    background: var(--c-surface-2) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='font-size: 48px'] {
    font-size: 36px !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='font-size: 28px'] {
    font-size: 22px !important;
    line-height: 1.15;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='font-size: 24px'] {
    font-size: 18px !important;
    white-space: nowrap;
}

/* Вложенные блоки со встроенными светлыми фонами и серым текстом (вкладки «Прогресс», «Данные») */
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: white'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: #f9fafb'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: #f9f9f9'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: rgba(74,144,226,0.1)'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: rgba(255,119,0,0.1)'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: rgba(0,0,0,0.05)'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: linear-gradient(135deg, rgba('],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: linear-gradient(135deg, #e'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='background: linear-gradient(135deg, #fe'] {
    border: 1px solid var(--c-line);
    background: var(--c-surface-2) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #333'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #374151'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #111827'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #1f2937'] {
    color: var(--c-text) !important;
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #4b5563'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #9ca3af'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #888'],
.profile-container--v2 .profile-tab-panel[data-profile-panel] :is(.stat-card, .profile-data-section) [style*='color: #999'] {
    color: var(--c-text-dim) !important;
}

/* Переключатели уведомлений: фон задаётся встроенно и меняется при наведении через JS */
.profile-container--v2 .profile-tab-panel[data-profile-panel] .stat-card label[style*='background'] {
    border: 1px solid var(--c-line);
    background: var(--c-surface-2) !important;
}

/* Диаграмма типов: на узком экране график и легенда друг под другом */
@media (max-width: 520px) {
    .profile-container--v2 .profile-tab-panel[data-profile-panel='progress'] .stat-card [style*='grid-template-columns: 1fr 1fr'] {
        grid-template-columns: 1fr !important;
    }
}

/* Тепловая карта: пустые клетки берут цвет трека темы, легенда переносится */
.v2,
.profile-container--v2 {
    --heat-empty: var(--c-track);
}

.profile-container--v2 .profile-tab-panel[data-profile-panel] .stat-card > div[style*='justify-content: space-between'][style*='margin-bottom: 15px'] {
    flex-wrap: wrap;
    gap: 8px 15px;
}
