/* Help Center video manual player (public/js/crm-help-manual.js). Theme colours come from
   the app's --crm-* variables; the stage itself is always dark, like any video player. */

body.chm-lock { overflow: hidden !important; }

.chm-overlay {
    position: fixed; inset: 0; z-index: 20000; display: none;
    align-items: center; justify-content: center; padding: 16px;
    background: rgba(12, 4, 24, .72); backdrop-filter: blur(3px);
}
.chm-overlay.open { display: flex; }

.chm-card {
    width: min(1180px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
    background: var(--crm-surface, #fff); border-radius: 16px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.chm-head {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px;
    background: var(--crm-primary, #530383); color: var(--crm-on-primary, #fff);
}
.chm-head-text { min-width: 0; flex: 1; }
.chm-eyebrow { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.chm-title { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chm-close {
    flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: inherit; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.chm-close:hover { background: rgba(255, 255, 255, .26); }

.chm-main { display: flex; min-height: 0; flex: 1; }
.chm-stage {
    position: relative; flex: 1 1 auto; min-width: 0; background: #000; aspect-ratio: 16 / 9; align-self: flex-start;
    user-select: none; -webkit-user-select: none;
}
.chm-stage video { width: 100%; height: 100%; display: block; background: #000; }
.chm-stage:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; }
.chm-stage video::cue {
    font-family: Inter, 'Segoe UI', sans-serif; font-size: 1.05rem; line-height: 1.35;
    color: #fff; background: rgba(10, 4, 20, .78);
}

.chm-bigplay {
    position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
    border: 0; border-radius: 50%; cursor: pointer; font-size: 2rem;
    background: var(--crm-primary, #530383); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    display: flex; align-items: center; justify-content: center; transition: opacity .2s, transform .2s;
}
.chm-bigplay:hover { transform: scale(1.06); }
.chm-overlay.playing .chm-bigplay { opacity: 0; pointer-events: none; }

.chm-bar {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .78)); transition: opacity .25s;
}
.chm-overlay.playing:not(.awake) .chm-bar { opacity: 0; }
.chm-overlay.playing:not(.awake) .chm-stage { cursor: none; }

.chm-seek { position: relative; height: 16px; cursor: pointer; touch-action: none; }
.chm-seek::before, .chm-seek-buf, .chm-seek-fill {
    content: ''; position: absolute; left: 0; top: 6px; height: 4px; border-radius: 4px;
}
.chm-seek::before { right: 0; background: rgba(255, 255, 255, .25); }
.chm-seek-buf { background: rgba(255, 255, 255, .4); width: 0; }
.chm-seek-fill { background: var(--crm-primary-light, #7a12b8); width: 0; }
.chm-seek-knob {
    position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); left: 0;
}

.chm-ctrls { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 36px; color: #fff; }
.chm-btn {
    min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: #fff; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center;
}
.chm-btn:hover { background: rgba(255, 255, 255, .16); }
.chm-speed { font-size: .82rem; font-weight: 700; }
.chm-cc.on { color: var(--crm-on-primary, #fff); background: var(--crm-primary-light, #7a12b8); }
.chm-mute.off { color: #fca5a5; }
.chm-vol { width: 84px; min-width: 0; accent-color: var(--crm-primary-light, #7a12b8); cursor: pointer; }
@media (max-width: 520px) { .chm-vol { display: none; } }
.chm-time { font-size: .8rem; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }
.chm-grow { flex: 1; }

.chm-next {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    background: rgba(10, 4, 20, .62);
}
.chm-next.show { display: flex; }
.chm-next-in { text-align: center; color: #fff; padding: 16px; }
.chm-next-lbl { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.chm-next-t { font-size: 1.25rem; font-weight: 700; margin: 4px 0 14px; }
.chm-next-go {
    border: 0; border-radius: 999px; padding: 9px 20px; cursor: pointer; font-weight: 600; gap: 8px;
    display: inline-flex; align-items: center; background: var(--crm-primary, #530383); color: #fff;
}

.chm-list {
    flex: 0 0 300px; min-width: 0; overflow-y: auto; border-left: 1px solid var(--crm-border, #eef0f5);
    background: var(--crm-surface-2, #f9fafb); padding: 10px;
}
.chm-list-hd { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--crm-muted, #8e9bb1); padding: 4px 6px 8px; }
.chm-item {
    display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; cursor: pointer;
    border: 1px solid transparent; border-radius: 10px; padding: 9px 10px; margin-bottom: 6px;
    background: var(--crm-surface, #fff); color: var(--crm-heading, #1e1e2d);
}
.chm-item:hover { border-color: var(--crm-primary-light, #7a12b8); }
.chm-item.active { border-color: var(--crm-primary, #530383); box-shadow: 0 0 0 2px var(--crm-primary-soft, rgba(83,3,131, .12)); }
.chm-item-n {
    flex: 0 0 24px; height: 24px; border-radius: 50%; font-size: .75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    background: var(--crm-primary-soft, rgba(83,3,131, .12)); color: var(--crm-primary, #530383);
}
.chm-item.active .chm-item-n { background: var(--crm-primary, #530383); color: #fff; }
.chm-item-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chm-item-t { font-size: .82rem; font-weight: 700; }
.chm-item-s { font-size: .72rem; color: var(--crm-muted, #6b7280); line-height: 1.35; }
.chm-item-d { flex: 0 0 auto; font-size: .72rem; color: var(--crm-muted, #6b7280); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .chm-main { flex-direction: column; overflow-y: auto; }
    .chm-stage { align-self: stretch; }
    .chm-list { flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--crm-border, #eef0f5); }
    .chm-overlay { padding: 0; }
    .chm-card { max-height: 100vh; border-radius: 0; height: 100%; }
}

/* The Help panel's chapter cards (Videos tab). */
.chp-manual-hd { display: flex; align-items: center; gap: 8px; }
.chp-manual-card {
    display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer;
    border: 1px solid var(--crm-border, #eef0f5); border-radius: 12px; padding: 8px; margin-bottom: 8px;
    background: var(--crm-surface, #fff); transition: border-color .15s, box-shadow .15s;
}
.chp-manual-card:hover { border-color: var(--crm-primary, #530383); box-shadow: 0 4px 14px rgba(var(--crm-primary-rgb, 83,3,131), .12); }
.chp-manual-thumb {
    position: relative; flex: 0 0 96px; height: 54px; border-radius: 8px; overflow: hidden;
    background: var(--crm-primary, #530383) center / cover no-repeat;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.4rem;
}
.chp-manual-thumb i { position: relative; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.chp-manual-info { min-width: 0; flex: 1; }
.chp-manual-title { font-size: .8rem; font-weight: 700; color: var(--crm-heading, #1e1e2d); }
.chp-manual-sub { font-size: .7rem; color: var(--crm-muted, #8e9bb1); }
