/* =====================
   Custom Player
   ===================== */

.rehab-player-wrap {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    font-family: inherit;
}

.rp-screen {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.rp-iframe-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.rp-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Самостоятельный видеофайл (mp4/webm со своего хостинга) */
.rp-iframe-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* YouTube: crop the top title bar and the bottom logo / pause-overlay icons
   by overscaling the iframe vertically and clipping with the container.
   Adjust --rp-yt-crop if any chrome still peeks. */
.rehab-player-wrap[data-type="youtube"] {
    --rp-yt-crop: 56px;
}
.rehab-player-wrap[data-type="youtube"] .rp-iframe-wrap iframe {
    position: absolute;
    left: 0;
    top: calc(-1 * var(--rp-yt-crop));
    width: 100% !important;
    height: calc(100% + (var(--rp-yt-crop) * 2)) !important;
}

/* Transparent overlay sits above the iframe: blocks YouTube/Vimeo native
   links & logo, and click toggles play/pause (Tutor-style). */
.rp-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
}

/* ---- Controls bar ---- */
.rp-controls {
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 8px 12px 10px;
    position: relative;
    z-index: 3;
}

.rp-progress-wrap {
    margin-bottom: 6px;
}

.rp-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
}

.rp-progress-bar:hover { height: 6px; margin-top: -1px; }

.rp-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s linear;
}

.rp-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: left 0.3s linear;
}

.rp-progress-bar:hover .rp-progress-thumb { opacity: 1; }

.rp-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rp-left, .rp-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: background 0.15s;
}

.rp-btn:hover { background: rgba(255,255,255,0.15); }

.rp-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Toggle play/pause icons */
.rp-icon-pause { display: none; }
.rehab-player-wrap.rp-is-playing .rp-icon-play  { display: none; }
.rehab-player-wrap.rp-is-playing .rp-icon-pause { display: block; }

/* Toggle mute icons */
.rp-icon-muted { display: none; }
.rehab-player-wrap.rp-is-muted .rp-icon-vol   { display: none; }
.rehab-player-wrap.rp-is-muted .rp-icon-muted { display: block; }

/* Toggle fullscreen icons */
.rp-icon-fs-off { display: none; }
.rehab-player-wrap.rp-is-fullscreen .rp-icon-fs-on  { display: none; }
.rehab-player-wrap.rp-is-fullscreen .rp-icon-fs-off { display: block; }

/* Fullscreen mode: video fills the screen, controls pinned to bottom */
.rehab-player-wrap:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; }
.rehab-player-wrap:fullscreen          { width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; }
.rehab-player-wrap:-webkit-full-screen .rp-screen { flex: 1; height: auto; padding-bottom: 0; }
.rehab-player-wrap:fullscreen .rp-screen          { flex: 1; height: auto; padding-bottom: 0; }

.rp-time {
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}

.rp-volume {
    width: 70px;
    accent-color: #fff;
    cursor: pointer;
}


/* ============================================================
   ДИЗАЙН-СИСТЕМА «Здоровая спина 2.0»
   Onest / #2C2C2C / #767676 / #5488F0 / #EFF2FF
   ============================================================ */

.rehab-auth, .rehab-dashboard, .rehab-course-page, .rehab-course-wrap,
.rehab-auth *, .rehab-dashboard *, .rehab-course-page *, .rehab-course-wrap * {
    font-family: 'Onest', sans-serif;
}

/* ---- Кнопка (основная) ---- */
.rehab-btn {
    display: inline-block;
    width: 100%;
    background: #5488F0;
    color: #FFFFFF;
    font-family: 'Onest', sans-serif;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 1.8px;
    text-align: center;
    border: none;
    border-radius: 50px;
    padding: 15px 32px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-sizing: border-box;
}
.rehab-btn:hover { background: #3D6FDB; color: #fff; }
.rehab-btn:active { transform: scale(0.98); }

/* =====================
   Страница «Вход»
   ===================== */

.rehab-auth {
    display: flex;
    justify-content: center;
    padding: 64px 20px 96px;
}

.rehab-login-card {
    width: 100%;
    max-width: 480px;
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    padding: 48px 40px;
    box-sizing: border-box;
}

.rehab-auth-title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

.rehab-auth-sub {
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 150%;
    color: #767676;
}

.rehab-login-error {
    background: #fdecea;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 16px;
}

.rehab-notice-success {
    background: #e8f5e9;
    border: 1px solid #c3e6cb;
    color: #256029;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 16px;
}

.rehab-field { margin-bottom: 18px; }

.rehab-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    color: #2C2C2C;
}

.rehab-field input[type="email"],
.rehab-field input[type="password"],
.rehab-field input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(140, 140, 140, 0.5);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Onest', sans-serif;
    color: #2C2C2C;
    background: #FFFFFF;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rehab-field input:focus {
    outline: none;
    border-color: #5488F0;
    box-shadow: 0 0 0 3px rgba(84, 136, 240, 0.15);
}

.rehab-login-form .rehab-btn { margin-top: 6px; }

/* =====================
   Кабинет (Мои курсы)
   ===================== */

.rehab-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 42.5px 96px;
    box-sizing: border-box;
}

.rehab-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 36px;
}

.rehab-dashboard-title {
    margin: 0 0 6px;
    font-size: 42px;
    line-height: 46px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

.rehab-dashboard-welcome {
    margin: 0;
    font-size: 18px;
    line-height: 145%;
    color: #767676;
}

.rehab-logout {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2C2C2C;
    text-decoration: none;
    border: 1px solid rgba(140, 140, 140, 0.5);
    border-radius: 50px;
    padding: 12px 28px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.rehab-logout:hover { border-color: #5488F0; color: #5488F0; }

.rehab-no-courses {
    color: #767676;
    font-size: 18px;
    background: #FFFFFF;
    border: 1px dashed rgba(140, 140, 140, 0.5);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
}

/* Карточки курсов */
.rehab-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.rehab-course-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}

.rehab-course-card:hover {
    border-color: #5488F0;
    box-shadow: 0 12px 32px rgba(84, 136, 240, 0.18);
    transform: translateY(-4px);
}

.rehab-card-thumb img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.rehab-card-no-thumb {
    width: 100%;
    height: 190px;
    background: #EFF2FF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rehab-card-no-thumb .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #5488F0;
}

.rehab-card-body { padding: 22px 24px 24px; }

.rehab-card-body h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #2C2C2C;
}

.rehab-lesson-count {
    font-size: 16px;
    color: #767676;
}

/* Настройки аккаунта */
.rehab-account {
    margin-top: 56px;
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    padding: 36px 40px 40px;
    max-width: 520px;
    box-sizing: border-box;
}

.rehab-account h3 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

.rehab-account h4 {
    margin: 28px 0 14px;
    font-size: 18px;
    font-weight: 600;
    color: #2C2C2C;
}

.rehab-account-row {
    margin: 4px 0;
    font-size: 16px;
    line-height: 150%;
    color: #767676;
}
.rehab-account-row strong { color: #2C2C2C; }

.rehab-password-form .rehab-field label { font-size: 16px; }

/* =====================
   Страница курса (обучение)
   ===================== */

.rehab-course-page {
    background: #EFF2FF;
    padding: 48px 20px 96px;
    min-height: 70vh;
}

.rehab-course-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 22.5px;
}

.rehab-course-page-head { margin-bottom: 32px; }

.rehab-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #767676;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: color 0.2s;
}
.rehab-back-link:hover { color: #5488F0; }

.rehab-course-page-title {
    margin: 6px 0 0;
    font-size: 30px;
    line-height: 36px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

/* ---- Раскладка: сайдбар + контент ---- */
.rehab-course-wrap {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    width: 100%;
}

.rehab-course-sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
}

.rehab-course-topic { margin-bottom: 12px; }
.rehab-course-topic:last-child { margin-bottom: 0; }

.rehab-course-topic-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #2C2C2C;
    padding: 12px 14px;
    background: #EFF2FF;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
}
.rehab-course-topic-title .dashicons { font-size: 18px; color: #5488F0; transition: transform 0.15s; }
.rehab-course-topic.collapsed .rehab-course-topic-title .dashicons { transform: rotate(-90deg); }
.rehab-course-topic.collapsed .rehab-course-lessons { display: none; }

.rehab-course-lessons {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.rehab-course-lesson {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-size: 16px;
    line-height: 1.35;
    color: #2C2C2C;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s, color 0.15s;
}
.rehab-course-lesson .dashicons { font-size: 16px; color: #8C8C8C; flex-shrink: 0; }
.rehab-course-lesson:hover { background: #EFF2FF; }
.rehab-course-lesson.active { background: #5488F0; color: #FFFFFF; font-weight: 600; }
.rehab-course-lesson.active .dashicons { color: #FFFFFF; }

/* ---- Контент урока ---- */
.rehab-course-main {
    flex: 1;
    min-width: 0;
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    padding: 32px 36px 40px;
    box-sizing: border-box;
}

.rehab-lesson-panel { display: none; }
.rehab-lesson-panel.active { display: block; }

.rehab-lesson-heading {
    margin: 0 0 20px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 600;
    color: #2C2C2C;
}

.rehab-lesson-video { margin-bottom: 28px; }
.rehab-lesson-video .rehab-player-wrap { border-radius: 20px; }

.rehab-lesson-content {
    font-size: 18px;
    line-height: 150%;
    color: #2C2C2C;
}

.rehab-lesson-attachments { margin-top: 32px; }

.rehab-lesson-attachments h4 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #2C2C2C;
}

.rehab-lesson-attachments ul { list-style: none; margin: 0; padding: 0; }
.rehab-lesson-attachments li { margin-bottom: 8px; }

.rehab-lesson-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5488F0;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}
.rehab-lesson-attachments a:hover { text-decoration: underline; }

.rehab-lesson-empty { color: #767676; font-size: 16px; }

/* =====================
   Брейкпоинты
   ===================== */

@media (max-width: 1024px) {
    .rehab-dashboard { padding: 40px 24px 72px; }
    .rehab-course-sidebar { flex-basis: 280px; max-width: 280px; }
    .rehab-course-main { padding: 24px 24px 32px; }
}

@media (max-width: 782px) {
    .rehab-dashboard-title { font-size: 30px; line-height: 34px; }
    .rehab-course-page-title { font-size: 22px; line-height: 28px; }

    .rehab-dashboard { padding: 32px 16px 56px; }
    .rehab-dashboard-header { flex-direction: column; align-items: flex-start; }

    .rehab-course-wrap { flex-direction: column; }
    .rehab-course-sidebar { flex-basis: auto; max-width: none; width: 100%; }
    .rehab-course-inner { padding: 0; }
    .rehab-course-page { padding: 32px 16px 56px; }

    .rehab-login-card { padding: 32px 22px; }
    .rehab-auth { padding: 40px 16px 64px; }
    .rehab-auth-title { font-size: 26px; }

    .rehab-account { padding: 26px 22px 30px; }
}

/* =====================
   Каркас платформы (свой шаблон, без темы)
   ===================== */

body.rehab-platform {
    margin: 0;
    background: #EFF2FF;
    font-family: 'Onest', sans-serif;
    color: #2C2C2C;
    -webkit-font-smoothing: antialiased;
}

/* Шапка */
.rehab-topbar {
    background: #FFFFFF;
    border-bottom: 1px solid rgba(140, 140, 140, 0.25);
}

.rehab-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 42.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

.rehab-brand {
    font-family: 'Onest', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #2C2C2C;
    text-decoration: none;
    letter-spacing: 0.2px;
}
.rehab-brand:hover { color: #5488F0; }

.rehab-topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.rehab-topbar-nav a {
    font-family: 'Onest', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #2C2C2C;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
.rehab-topbar-nav a:hover { color: #5488F0; }

.rehab-topbar-logout {
    border: 1px solid rgba(140, 140, 140, 0.5);
    border-radius: 50px;
    padding: 9px 24px;
}
.rehab-topbar-logout:hover { border-color: #5488F0; }

/* Основная область */
.rehab-platform-main {
    min-height: calc(100vh - 200px);
}

/* Подвал */
.rehab-footer {
    background: #2C2C2C;
    color: #FFFFFF;
}

.rehab-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 42.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.rehab-footer-copy {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.rehab-footer-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.rehab-footer-links a {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.rehab-footer-links a:hover { opacity: 1; text-decoration: underline; }

/* =====================
   Кабинет: hero и секции
   ===================== */

.rehab-dashboard-welcome {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    line-height: 145%;
    color: #2C2C2C;
}

.rehab-dashboard-sub {
    margin: 0;
    max-width: 680px;
    font-size: 16px;
    line-height: 150%;
    color: #767676;
}

.rehab-dashboard-section {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

.rehab-no-courses a { color: #5488F0; font-weight: 600; }

/* Поддержка и сообщество */
.rehab-support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 56px;
}

.rehab-support-card {
    background: #FFFFFF;
    border: 1px solid rgba(140, 140, 140, 0.3);
    border-radius: 20px;
    padding: 34px 36px 38px;
    box-sizing: border-box;
}

.rehab-support-card h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: #2C2C2C;
}

.rehab-support-card p {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 150%;
    color: #767676;
}

.rehab-support-dark {
    background: #2C2C2C;
    border-color: #2C2C2C;
}
.rehab-support-dark h3 { color: #FFFFFF; }
.rehab-support-dark p { color: rgba(255, 255, 255, 0.7); }

.rehab-btn-inline {
    width: auto;
    display: inline-block;
    padding: 13px 36px;
    font-size: 16px;
    text-decoration: none;
}

/* Адаптив каркаса */
@media (max-width: 782px) {
    .rehab-topbar-inner { padding: 14px 16px; }
    .rehab-brand { font-size: 17px; }
    .rehab-topbar-nav { gap: 14px; }
    .rehab-topbar-logout { padding: 8px 18px; }

    .rehab-footer-inner {
        padding: 22px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .rehab-support-card { padding: 26px 22px 30px; }
    .rehab-dashboard-section { font-size: 20px; }
}

/* =====================
   Прогресс обучения
   ===================== */

.rehab-progress {
    height: 8px;
    background: #EFF2FF;
    border-radius: 8px;
    margin: 14px 0 8px;
    overflow: hidden;
}
.rehab-progress-fill {
    height: 100%;
    background: #5488F0;
    border-radius: 8px;
    transition: width .3s;
}
.rehab-progress-text {
    display: block;
    font-size: 14px;
    color: #767676;
}
.rehab-continue {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #5488F0;
}

.rehab-resume-note {
    background: #EFF2FF;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 150%;
    color: #2C2C2C;
}

.rehab-course-lesson-name { flex: 1; min-width: 0; }

.rehab-lesson-status.dashicons-yes-alt {
    color: #5488F0;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.rehab-course-lesson.active .rehab-lesson-status.dashicons-yes-alt { color: #FFFFFF; }

.rehab-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5488F0;
    flex-shrink: 0;
}
.rehab-course-lesson.active .rehab-status-dot { background: #FFFFFF; }

/* =====================
   Страница входа: без шапки/футера, на весь экран
   ===================== */

body.rehab-login-screen {
    background: linear-gradient(135deg, #EFF2FF 0%, #DCE7FC 100%);
}

.rehab-main-full {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rehab-main-full .rehab-auth {
    width: 100%;
    padding: 24px 16px;
}

.rehab-main-full .rehab-login-card {
    box-shadow: 0 20px 60px rgba(84, 136, 240, 0.12);
}

/* =====================
   Постер и экран окончания (полное скрытие интерфейса YouTube)
   ===================== */

/* Постер поверх iframe до первого запуска — скрывает заставку YouTube */
.rp-poster {
    position: absolute;
    inset: 0;
    z-index: 4;
    background-color: #14161c;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.rp-poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}
.rehab-player-wrap.rp-started .rp-poster { display: none; }

.rp-bigplay {
    position: relative;
    width: 84px;
    height: 84px;
    border: none;
    border-radius: 50%;
    background: #5488F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s, background 0.2s;
}
.rp-bigplay:hover { background: #3D6FDB; transform: scale(1.07); }
.rp-bigplay svg { width: 34px; height: 34px; fill: #fff; margin-left: 5px; }

/* Экран окончания — закрывает «похожие видео» YouTube */
.rp-endscreen {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(18, 20, 26, 0.97);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 20px;
}
.rehab-player-wrap.rp-is-ended .rp-endscreen { display: flex; }

.rp-end-title {
    color: #fff;
    font-family: 'Onest', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.rp-end-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.rp-end-btn {
    font-family: 'Onest', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    padding: 12px 26px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #fff;
    transition: border-color 0.2s, background 0.2s;
}
.rp-end-btn:hover { border-color: #fff; }

.rp-end-next { background: #5488F0; border-color: #5488F0; }
.rp-end-next:hover { background: #3D6FDB; border-color: #3D6FDB; }

@media (max-width: 600px) {
    .rp-bigplay { width: 64px; height: 64px; }
    .rp-bigplay svg { width: 26px; height: 26px; }
    .rp-end-title { font-size: 17px; }
}

/* =====================
   SVG-иконки платформы (замена dashicons)
   ===================== */

.rehab-ico {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
}
.rehab-ico svg { width: 100%; height: 100%; display: block; }

.rehab-course-topic-title .rehab-ico {
    color: #5488F0;
    width: 18px;
    height: 18px;
    transition: transform 0.15s;
}
.rehab-course-topic.collapsed .rehab-course-topic-title .rehab-ico { transform: rotate(-90deg); }

.rehab-course-lesson > .rehab-ico { color: #8C8C8C; width: 13px; height: 13px; }
.rehab-course-lesson.active > .rehab-ico { color: #FFFFFF; }

.rehab-lesson-status { display: inline-flex; flex-shrink: 0; }
.rehab-lesson-status .rehab-ico { color: #5488F0; }
.rehab-course-lesson.active .rehab-lesson-status .rehab-ico { color: #FFFFFF; }

.rehab-back-link .rehab-ico { width: 18px; height: 18px; }

.rehab-lesson-attachments .rehab-ico { color: #5488F0; }

/* ---- Мета в карточке курса ---- */
.rehab-card-metas { margin-top: 12px; }

.rehab-card-meta-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #767676;
    margin-bottom: 5px;
}
.rehab-card-meta-line .rehab-ico { width: 15px; height: 15px; color: #8C8C8C; }

.rehab-badge-open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #EFF2FF;
    color: #3D6FDB;
    font-size: 13px;
    font-weight: 600;
    border-radius: 50px;
    padding: 6px 14px;
    margin-bottom: 6px;
}
.rehab-badge-open .rehab-ico { width: 14px; height: 14px; }

/* =====================
   Страница 404
   ===================== */

.rehab-404 {
    max-width: 640px;
    margin: 0 auto;
    padding: 96px 20px 120px;
    text-align: center;
}

.rehab-404-code {
    font-family: 'Onest', sans-serif;
    font-size: 120px;
    line-height: 1;
    font-weight: 800;
    color: #5488F0;
    letter-spacing: 4px;
}

.rehab-404-title {
    margin: 18px 0 12px;
    font-size: 32px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2C2C2C;
}

.rehab-404-text {
    margin: 0 0 32px;
    font-size: 17px;
    line-height: 155%;
    color: #767676;
}

@media (max-width: 600px) {
    .rehab-404 { padding: 64px 16px 80px; }
    .rehab-404-code { font-size: 84px; }
    .rehab-404-title { font-size: 24px; }
}

/* =====================
   Кнопка «На сайт»
   ===================== */

.rehab-topbar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rehab-topbar-site { color: #767676 !important; }
.rehab-topbar-site:hover { color: #5488F0 !important; }
.rehab-topbar-site .rehab-ico { width: 15px; height: 15px; }

.rehab-auth-back {
    margin: 22px 0 0;
    text-align: center;
}
.rehab-auth-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #767676;
    text-decoration: none;
    transition: color 0.2s;
}
.rehab-auth-back a:hover { color: #5488F0; }
.rehab-auth-back .rehab-ico { width: 15px; height: 15px; }

@media (max-width: 782px) {
    .rehab-topbar-site span + span,
    .rehab-topbar-site { font-size: 14px; }
}

/* =====================
   Забыли пароль / новый пароль
   ===================== */

.rehab-forgot-link {
    margin: 14px 0 0;
    text-align: center;
}
.rehab-forgot-link a {
    font-size: 15px;
    font-weight: 600;
    color: #5488F0;
    text-decoration: none;
}
.rehab-forgot-link a:hover { text-decoration: underline; }

.rehab-reset-creds {
    background: #EFF2FF;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 22px;
}
.rehab-reset-creds p { margin: 6px 0; font-size: 16px; color: #2C2C2C; }
.rehab-reset-pass {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 4px 12px;
}

/* =====================
   Индикатор запуска видео
   ===================== */

.rp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #5488F0;
    border-radius: 50%;
    z-index: 6;
    display: none;
    pointer-events: none;
    animation: rp-spin 0.8s linear infinite;
}
.rehab-player-wrap.rp-loading .rp-spinner { display: block; }
.rehab-player-wrap.rp-loading .rp-bigplay { opacity: 0.25; }

@keyframes rp-spin { to { transform: rotate(360deg); } }

/* =====================
   Мобильный плеер: стабильность и ширина 100%
   ===================== */

/* Цифры таймера фиксированной ширины — панель не «дышит» каждую секунду */
.rp-time {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* На тач-устройствах «hover» прилипает после тапа и дёргал высоту прогресс-бара */
@media (hover: none) {
    .rp-progress-bar:hover { height: 4px; margin-top: 0; }
    .rp-progress-bar:hover .rp-progress-thumb { opacity: 0; }
}

@media (max-width: 782px) {
    .rehab-course-sidebar { padding: 14px; }
    .rehab-course-main { padding: 20px 16px 26px; }

    .rehab-lesson-heading { font-size: 20px; line-height: 1.25; margin-bottom: 14px; }

    /* Видео на всю ширину карточки урока */
    .rehab-lesson-video { margin-left: -16px; margin-right: -16px; }
    .rehab-lesson-video .rehab-player-wrap { border-radius: 0; }

    .rp-controls { padding: 6px 10px 8px; }
    .rp-time { font-size: 11px; }
}

@media (max-width: 600px) {
    /* Громкость на телефонах регулируется кнопками устройства */
    .rp-volume { display: none; }
}

/* =====================
   Мобильная навигация по урокам (видео → кнопки → список)
   ===================== */

.rehab-lesson-nav { display: none; }

.rehab-nav-btn {
    flex: 1;
    font-family: 'Onest', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 10px;
    border-radius: 50px;
    border: 1px solid rgba(140, 140, 140, 0.5);
    background: #FFFFFF;
    color: #2C2C2C;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}
.rehab-nav-primary {
    background: #5488F0;
    border-color: #5488F0;
    color: #FFFFFF;
}
.rehab-nav-btn:disabled { opacity: 0.35; pointer-events: none; }

@media (max-width: 782px) {
    /* Порядок на телефоне: видео (1) → кнопки (2) → список уроков (3) */
    .rehab-course-main    { order: 1; }
    .rehab-lesson-nav     { display: flex; order: 2; gap: 10px; margin-top: 14px; }
    .rehab-course-sidebar { order: 3; margin-top: 6px; }
}

/* =====================
   Фикс ширины на мобильных: в колонке блоки всегда 100%
   (десктопный align-items:flex-start в колонке сжимал их до содержимого)
   ===================== */

@media (max-width: 782px) {
    .rehab-course-wrap { align-items: stretch; }

    .rehab-course-main,
    .rehab-course-sidebar,
    .rehab-lesson-nav {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Кнопки навигации: шире, в одну строку, секция по центру */
    .rehab-lesson-nav { justify-content: center; }
    .rehab-nav-btn {
        white-space: nowrap;
        max-width: 250px;
        padding: 14px 12px;
    }
}

/* Автостарт заблокирован мобильным браузером — подсказываем повторный тап */
.rehab-player-wrap.rp-tap-again .rp-bigplay {
    animation: rp-pulse 0.85s ease-in-out 3;
}
@keyframes rp-pulse {
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 14px rgba(84, 136, 240, 0.25);
    }
}
