/* =============================================================
   Courses — learner player
   Namespaced cp-* so nothing here can leak into other features.
   Brand accent: var(--ButtonBackgroundColor) only.
   ============================================================= */

.warning-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 13px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid #eddfae;
    background: #fdf6e3;
    color: #8a6100;
}

.warning-message b { font-weight: 700; }

/* ---------- layout ---------- */
.cp-layout {
    display: block;
    align-items: flex-start;
}

.cp-rail-desktop { display: none; }
.cp-rail-mobile { display: block; margin-bottom: 12px; }

.cp-col-main {
    min-width: 0;
}

.cp-player-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--Outline, #e5e5e5);
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 3px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    /* Hug content — never stretch to the tall rail and leave a white void */
    height: auto;
    align-self: flex-start;
    width: 100%;
}

.cp-rail-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--Outline, #e5e5e5);
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 3px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    min-height: 0;
}

.cp-rail-card-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--CardHeaderBackground, #f3f4f6);
    border-bottom: 1px solid var(--Outline, #e5e5e5);
    font-size: 14px;
    font-weight: 700;
    color: var(--whitebgtext, #1c2430);
    flex: 0 0 auto;
}

.cp-rail-card-hd i {
    color: #5a6572;
    font-size: 13px;
}

@media (min-width: 1100px) {
    .cp-layout {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .cp-col-rail {
        flex: 0 0 clamp(260px, 26%, 300px);
        position: sticky;
        top: 14px;
        max-height: calc(100vh - 28px);
        display: flex;
        flex-direction: column;
        min-height: 0;
        align-self: flex-start;
    }

    .cp-col-main {
        flex: 1 1 auto;
        min-width: 0;
        align-self: flex-start;
    }

    .cp-rail-desktop {
        display: flex;
        flex-direction: column;
        min-height: 0;
        flex: 1 1 auto;
        max-height: calc(100vh - 28px);
    }

    .cp-rail-mobile { display: none; }
}

@media (min-width: 960px) {
    .wrapper.collapseSideBar .cp-layout {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .wrapper.collapseSideBar .cp-col-rail {
        flex: 0 0 clamp(260px, 26%, 300px);
        position: sticky;
        top: 14px;
        max-height: calc(100vh - 28px);
        display: flex;
        flex-direction: column;
        min-height: 0;
        align-self: flex-start;
    }

    .wrapper.collapseSideBar .cp-col-main {
        flex: 1 1 auto;
        min-width: 0;
        align-self: flex-start;
    }

    .wrapper.collapseSideBar .cp-rail-desktop {
        display: flex;
        flex-direction: column;
        min-height: 0;
        flex: 1 1 auto;
        max-height: calc(100vh - 28px);
    }

    .wrapper.collapseSideBar .cp-rail-mobile { display: none; }
}

/* ---------- rail ---------- */
/* Kill global .white-bg li { list-style: disc } — that was the double-bullet bug. */
.cp-rail-card ul,
.cp-rail-card li,
.cp-rail-mobile ul,
.cp-rail-mobile li,
.cp-sections,
.cp-sections > li,
.cp-items,
.cp-items > li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.cp-progress {
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--Outline, #e5e5e5);
    background: #fff;
    flex: 0 0 auto;
}

.cp-progress-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #5a6572;
    margin-bottom: 8px;
}

.cp-progress-top b {
    color: #1c2430;
    font-weight: 600;
}

.cp-progress .progress {
    height: 6px;
    border-radius: 999px;
    background: #eef1f4;
    overflow: hidden;
}

.cp-progress .progress-bar {
    border-radius: 999px;
}

.cp-rail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #c3ccd6 transparent;
}

.cp-rail-scroll::-webkit-scrollbar {
    width: 6px;
}

.cp-rail-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cp-rail-scroll::-webkit-scrollbar-thumb {
    background: #c3ccd6;
    border-radius: 999px;
}

.cp-section-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--CardHeaderBackground, #f6f8fa);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5a6572;
    border-top: 1px solid var(--Outline, #e5e5e5);
    border-bottom: 1px solid var(--Outline, #e5e5e5);
    position: sticky;
    top: 0;
    z-index: 1;
}

.cp-sections > li:first-child .cp-section-hd {
    border-top: 0;
}

.cp-sec-count {
    margin-left: auto;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #8a949e;
}

.cp-lesson {
    display: flex;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #eef1f4;
    border-left: 3px solid transparent;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
}

button.cp-lesson:hover {
    background: #f6f8fa;
}

.cp-items li:last-child .cp-lesson {
    border-bottom: 0;
}

.cp-lesson-ic {
    margin-top: 2px;
    line-height: 1;
    color: #b6bfc9;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cp-ico {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
}

.cp-ico-sm {
    width: 12px;
    height: 12px;
}

.cp-ico-lg {
    width: 28px;
    height: 28px;
}

.cp-lesson-b { min-width: 0; flex: 1; }
.cp-lesson-t {
    font-size: 13.5px;
    font-weight: 600;
    display: block;
    color: #1c2430;
    line-height: 1.35;
}
.cp-lesson-d {
    font-size: 12px;
    color: #5a6572;
    display: block;
    margin-top: 2px;
    line-height: 1.35;
}
.cp-lesson-m {
    font-size: 11.5px;
    color: #8a949e;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cp-sep { color: #ccd3da; }

.cp-lesson.is-done .cp-lesson-ic { color: var(--ButtonBackgroundColor); }
.cp-lesson.is-done .cp-lesson-t { font-weight: 500; color: #5a6572; }

.cp-lesson.is-current {
    border-left-color: var(--ButtonBackgroundColor);
    background: color-mix(in srgb, var(--ButtonBackgroundColor) 8%, #fff);
}
button.cp-lesson.is-current:hover {
    background: color-mix(in srgb, var(--ButtonBackgroundColor) 12%, #fff);
}
.cp-lesson.is-current .cp-lesson-ic { color: var(--ButtonBackgroundColor); }
.cp-lesson.is-current .cp-lesson-t { font-weight: 700; }

.cp-heretag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--ButtonBackgroundColor);
    padding: 2px 7px;
    border-radius: 999px;
}

.cp-lesson.is-locked { background: #f8f9fb; cursor: default; }
.cp-lesson.is-locked .cp-lesson-t { color: #5a6572; font-weight: 500; }
.cp-lesson.is-locked .cp-lesson-d { color: #8a949e; }

.cp-lock-why {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: 11.5px;
    padding: 5px 8px;
    border-radius: 6px;
}

.cp-lesson.is-seqlock .cp-lock-why { background: #eaeef2; color: #5a6572; }
.cp-lesson.is-driplock { border-left: 3px dashed #d8dde3; }
.cp-lesson.is-driplock .cp-lock-why { background: #fdf6e3; color: #8a6100; }

.cp-lock-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    color: var(--ButtonBackgroundColor);
    text-decoration: underline;
}

/* ---------- mobile disclosure ---------- */
.cp-disc > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}
.cp-disc > summary::-webkit-details-marker { display: none; }
.cp-sum-b { min-width: 0; flex: 1; }
.cp-sum-t {
    font-size: 13px;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-sum-s { font-size: 11px; color: #5a6572; }
.cp-disc .progress { height: 4px; margin-top: 6px; border-radius: 999px; overflow: hidden; background: #eef1f4; }
.cp-chev { margin-left: auto; color: #5a6572; transition: transform .15s; }
.cp-disc[open] > summary .cp-chev { transform: rotate(180deg); }
.cp-disc[open] > summary { border-bottom: 1px solid var(--Outline, #e5e5e5); }
.cp-disc .cp-rail-scroll { max-height: 58vh; }

/* ---------- lesson body ---------- */
.cp-lesson-hd {
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--Outline, #e5e5e5);
    background: #fff;
}
.cp-eyebrow {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8a949e;
}
.cp-lesson-h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0 0;
    color: #1c2430;
    line-height: 1.25;
}
.cp-lesson-sum {
    font-size: 14px;
    color: #5a6572;
    margin: 8px 0 0;
    max-width: 70ch;
    line-height: 1.45;
}
.cp-body { padding: 16px 20px; }

.cp-video {
    background: #1a222c;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5b1;
    font-size: 13px;
    margin: 0;
}
.cp-video iframe,
.cp-video video,
.cp-video > div { width: 100%; height: 100%; border: 0; }

.cp-video-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: #9aa5b1;
}
.cp-video-empty i {
    font-size: 28px;
    opacity: .7;
}
.cp-video-empty b {
    color: #d7dee6;
    font-size: 14px;
    font-weight: 600;
}

.cp-videobar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: #f6f8fa;
    border-top: 1px solid var(--Outline, #e5e5e5);
    font-size: 12.5px;
}
.cp-vb-act { margin-left: auto; display: flex; gap: 8px; }

.cp-prose {
    padding: 18px 20px;
    max-width: 72ch;
    font-size: 14.5px;
    line-height: 1.65;
}
.cp-prose h1, .cp-prose h2, .cp-prose h3 { font-size: 16px; margin: 16px 0 6px; }
.cp-prose h3:first-child { margin-top: 0; }
.cp-prose ul, .cp-prose ol { padding-left: 20px; margin: 8px 0; }
.cp-prose img { max-width: 100%; height: auto; }
.cp-prose blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 3px solid #e2e7ec;
    color: #5a6572;
}

.cp-doc {
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    background: #f6f8fa;
    border: 1px solid var(--Outline, #e5e5e5);
    border-radius: 8px;
    flex-wrap: wrap;
}
.cp-embed {
    height: 420px;
    background: #f0f2f5;
    border: 1px solid var(--Outline, #e5e5e5);
    border-radius: 8px;
    width: 100%;
}
.cp-drop {
    border: 1px dashed #c3ccd6;
    border-radius: 8px;
    background: #f6f8fa;
    padding: 20px;
    text-align: center;
}

.cp-cert {
    text-align: center;
    padding: 28px 20px;
    border: 1px solid var(--Outline, #e5e5e5);
    border-radius: 8px;
    background: #f6f8fa;
}
.cp-cert.is-ready {
    background: #fff;
    border-color: var(--ButtonBackgroundColor);
}
.cp-req {
    max-width: 400px;
    margin: 14px auto 0;
    text-align: left;
    font-size: 13px;
    padding: 0;
    list-style: none !important;
}
.cp-req li {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #eef1f4;
    list-style: none !important;
}

.cp-empty {
    text-align: center;
    padding: 56px 24px;
    color: #5a6572;
}
.cp-empty b {
    display: block;
    color: #1c2430;
    font-size: 16px;
    margin: 12px 0 6px;
}

.cp-attachments {
    padding: 0 20px 16px;
}
.cp-attachments .table-card-header {
    margin: 0 -20px 0;
    border-radius: 0;
}

/* ---------- notes + actions (tight footer — no void) ---------- */
.cp-footer {
    margin-top: 0;
    border-top: 1px solid var(--Outline, #e5e5e5);
    background: #fff;
}

.cp-notes {
    background: #fff;
}
.cp-notes-body {
    padding: 12px 16px 4px;
}
.cp-notes textarea {
    min-height: 44px;
    resize: vertical;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 8px;
    width: 100%;
}
.cp-notes textarea:placeholder-shown {
    min-height: 40px;
}
.cp-notes:focus-within textarea {
    min-height: 110px;
}
.cp-notes-foot {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 11.5px;
    color: #8a949e;
    flex-wrap: wrap;
}
.cp-notes:focus-within .cp-notes-foot { display: flex; }
.cp-actions .button,
.cp-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cp-donetag .cp-ico,
.cp-privacy .cp-ico,
.cp-lock-why .cp-ico,
.cp-video-empty .cp-ico,
.cp-empty .cp-ico {
    display: inline-block;
    vertical-align: -2px;
}

.cp-privacy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cp-rail-card-hd .cp-ico {
    color: #5a6572;
}

.cp-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px 14px;
    background: #fafbfc;
    border-top: 1px solid var(--Outline, #e5e5e5);
}
.cp-act-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.cp-nexthint { font-size: 11.5px; color: #8a949e; }
.cp-donetag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ButtonBackgroundColor);
}

@media (max-width: 1099px) {
    .cp-actions {
        position: sticky;
        bottom: 0;
        z-index: 5;
        box-shadow: 0 -3px 10px rgba(20, 30, 40, .08);
    }
    .cp-actions .button { flex: 1 1 auto; min-height: 40px; }
    .cp-act-right { width: 100%; margin-left: 0; gap: 8px; }
    .cp-lesson-h1 { font-size: 18px; }
    .cp-body, .cp-prose { padding: 14px 16px; }
    .cp-lesson-hd { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .cp-chev { transition: none; }
}
