/*
 * Новый интерфейс (ui_v2): экраны «Запись», «Дневник» и «Тренировка в процессе» (макеты Booking / Diary / Workout).
 * Правила действуют внутри .v2-book / .v2-diary2 / .v2-workout и берут цвета из токенов ui-v2.css.
 */

/* ------------------------------------------------------------ запись -----*/
.v2-book .v2-stack { gap: 14px; }
.v2-book-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v2-book-mine {
    min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--c-text-dim);
    font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; text-decoration: underline;
}
.v2-book-gym {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; text-align: left;
    border: 0; border-radius: 20px; background: var(--c-surface); color: var(--c-text); font: inherit; cursor: pointer;
    box-shadow: var(--shadow-card);
}
.v2-book-gym:disabled { cursor: default; }
.v2-book-gym-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; background: #171717; color: #dff86b; display: flex; align-items: center; justify-content: center; }
.v2-book-gym-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v2-book-gym-label { font-size: 12px; font-weight: 700; color: var(--c-text-dim); }
.v2-book-gym-name { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.v2-book-gym-change { flex-shrink: 0; font-size: 14px; font-weight: 800; }

.v2-book-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.v2-book-day {
    min-height: 64px; padding: 0; border: 0; border-radius: 16px; background: var(--c-surface); color: var(--c-text-dim);
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.v2-book-day::first-letter { text-transform: uppercase; }
.v2-book-daynum { font-size: 17px; font-weight: 800; color: var(--c-text); }
.v2-book-day.is-on { background: #171717; color: #dff86b; }
.v2-book-day.is-on .v2-book-daynum { color: #fff; }
html[data-ui-theme='dark'] .v2-book-day.is-on { background: var(--c-accent); color: #12160a; }
html[data-ui-theme='dark'] .v2-book-day.is-on .v2-book-daynum { color: #12160a; }

.v2-book-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.v2-book-filters:empty { display: none; }
.v2-book-chip {
    flex-shrink: 0; min-height: 44px; padding: 0 16px; border: 1px solid var(--c-line-strong); border-radius: 22px;
    background: var(--c-surface); color: var(--c-text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.v2-book-chip.is-on { border-color: transparent; background: var(--c-accent); color: #12160a; font-weight: 800; }

.v2-book-list { display: flex; flex-direction: column; gap: 14px; }
.v2-book-part { display: flex; flex-direction: column; gap: 8px; }
.v2-book-part-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-dim); }
.v2-book-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 20px; background: var(--c-surface); box-shadow: var(--shadow-card); }
.v2-book-time { flex-shrink: 0; min-width: 52px; font-size: 20px; font-weight: 800; }
.v2-book-info { flex: 1; min-width: 0; }
.v2-book-name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.v2-book-meta { font-size: 13px; color: var(--c-text-dim); }
.v2-book-few { font-size: 13px; font-weight: 700; color: var(--c-tag-text); }
.v2-book-cta {
    flex-shrink: 0; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--c-accent);
    color: #12160a; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.v2-book-plaque { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: #171717; color: #fff; }
.v2-book-plaque-text { flex: 1; min-width: 0; }
.v2-book-plaque-label { font-size: 13px; color: #d4d6d0; }
.v2-book-plaque-main { font-size: 16px; font-weight: 800; }

/* ----------------------------------------------------------- дневник -----*/
.v2-diary2 .v2-stack { gap: 14px; }
.v2-d2-summary { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 24px; background: #171717; color: #fff; }
.v2-d2-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v2-d2-summary-title { font-size: 17px; font-weight: 800; }
.v2-d2-range { font-size: 13px; color: #d4d6d0; }
.v2-d2-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.v2-d2-tile-value { font-size: 26px; font-weight: 800; color: #dff86b; }
.v2-d2-tile-label { font-size: 12px; color: #d4d6d0; }
.v2-d2-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 56px; }
.v2-d2-bar { border-radius: 6px; background: #3a3a3a; }
.v2-d2-bar.is-on { background: #dff86b; }
.v2-d2-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; font-size: 11px; font-weight: 700; color: #d4d6d0; text-align: center; }
.v2-d2-days span::first-letter { text-transform: uppercase; }
.v2-d2-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.v2-d2-tab { min-height: 44px; border: 0; border-radius: 14px; background: var(--c-surface); color: var(--c-text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.v2-d2-tab.is-on { background: #171717; color: #dff86b; font-weight: 800; }
html[data-ui-theme='dark'] .v2-d2-tab.is-on { background: var(--c-accent); color: #12160a; }
.v2-d2-list { display: flex; flex-direction: column; gap: 14px; }
.v2-d2-entry { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 24px; background: var(--c-surface); box-shadow: var(--shadow-card); }
.v2-d2-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v2-d2-entry-main { min-width: 0; }
.v2-d2-entry-date { font-size: 12px; font-weight: 700; color: var(--c-text-dim); }
.v2-d2-entry-date::first-letter { text-transform: uppercase; }
.v2-d2-entry-title { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.v2-d2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-d2-chip { flex-shrink: 0; padding: 5px 12px; border-radius: 12px; background: var(--c-surface-2); color: var(--c-text); font-size: 13px; font-weight: 800; }
.v2-d2-chip.is-good { background: var(--c-accent); color: #12160a; }
.v2-d2-chip.is-hard { background: var(--c-tag-bg); color: var(--c-tag-text); }
.v2-d2-entry-text { font-size: 14px; line-height: 1.45; color: var(--c-text-dim); overflow-wrap: anywhere; }
.v2-d2-trainer { padding: 12px 14px; border-radius: 16px; background: var(--c-accent-soft); border: 1px solid var(--c-line-strong); }
.v2-d2-trainer-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-accent-text); }
.v2-d2-trainer-text { margin-top: 4px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.v2-d2-fab {
    position: fixed; right: 20px; bottom: 104px; z-index: 20; width: 60px; height: 60px; border: 0; border-radius: 50%;
    background: var(--c-accent); color: #12160a; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* --------------------------------------------- тренировка в процессе -----*/
body.v2-workout-open { overflow: hidden; }
body.v2-workout-open .v2-tabbar { display: none; }
.v2-workout {
    position: fixed; inset: 0; z-index: 10002; box-sizing: border-box; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); background: #171717; color: #fff; font-family: 'Manrope', system-ui, sans-serif;
}
.v2-workout > * { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.v2-wo-head { display: flex; align-items: center; gap: 12px; }
.v2-wo-round {
    flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #2a2a2a; color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.v2-wo-title { flex: 1; min-width: 0; }
.v2-wo-sub { font-size: 13px; color: #d4d6d0; }
.v2-workout .v2-wo-h1 { margin: 0; color: #fff !important; font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.v2-wo-ghost {
    flex-shrink: 0; min-height: 44px; padding: 0 14px; border: 1px solid #4a4a4a; border-radius: 22px; background: none; color: #fff;
    font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.v2-wo-timer { text-align: center; padding-top: 8px; }
.v2-wo-timer-label { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #d4d6d0; }
.v2-wo-clock { font-size: 64px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: #dff86b; font-variant-numeric: tabular-nums; }
.v2-wo-strip { display: flex; gap: 4px; }
.v2-wo-seg { flex: 1; height: 6px; border-radius: 3px; background: #3a3a3a; }
.v2-wo-seg.is-done { background: #dff86b; }
.v2-wo-seg.is-now { background: #fff; }
.v2-wo-seg.is-skipped { background: #5b5b5b; opacity: 0.5; }
.v2-wo-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 28px; background: #fff; color: #171717; }
.v2-wo-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #5b6068; }
.v2-wo-ex { font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.v2-wo-detail { font-size: 14px; color: #5b6068; overflow-wrap: anywhere; }
.v2-wo-sets { display: flex; gap: 10px; }
.v2-wo-set { flex: 1; min-height: 44px; border-radius: 14px; background: #e3e4e0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.v2-wo-set.is-done { background: #171717; color: #dff86b; }
.v2-wo-set.is-now { border: 3px solid #171717; background: #dff86b; }
.v2-wo-main {
    min-height: 60px; border: 0; border-radius: 20px; background: #dff86b; color: #171717; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
}
.v2-wo-skip {
    min-height: 48px; border: 1px solid #cfd0cb; border-radius: 16px; background: none; color: #171717; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
.v2-wo-rest { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 24px; background: #2a2a2a; flex-wrap: wrap; }
.v2-wo-ring { flex-shrink: 0; width: 64px; height: 64px; }
.v2-wo-rest-text { flex: 1; min-width: 80px; }
.v2-wo-rest-label { font-size: 13px; color: #d4d6d0; }
.v2-wo-rest-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.v2-wo-next { display: flex; flex-direction: column; gap: 8px; }
.v2-wo-next-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #d4d6d0; }
.v2-wo-next-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #2a2a2a; font-size: 15px; font-weight: 700; }
.v2-wo-next-detail { flex-shrink: 0; color: #d4d6d0; }
.v2-wo-note {
    box-sizing: border-box; width: 100%; padding: 12px 14px; border: 1px solid #4a4a4a; border-radius: 16px; background: #2a2a2a; color: #fff; font: inherit; font-size: 15px; resize: vertical;
}
.v2-wo-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.v2-wo-side {
    min-height: 52px; border: 0; border-radius: 18px; background: #2a2a2a; color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
