/* ═══════════════════════════════════════════════════════════════
   Umweka Academy — Lesson Player CSS
═══════════════════════════════════════════════════════════════ */

/* ── Root ──────────────────────────────────────────────────────── */
.lp-body {
    background: var(--dark);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.lp-topbar {
    height: 56px;
    background: var(--dark-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 100;
}

.lp-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.lp-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.lp-sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.07); }

.lp-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.lp-topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.lp-course-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    transition: color 0.2s;
}
.lp-course-title:hover { color: #fff; }

.lp-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.lp-topbar-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lp-tp-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.lp-tp-bar {
    width: 100px;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    overflow: hidden;
}
.lp-tp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #6f42c1);
    border-radius: 100px;
    transition: width 0.5s ease;
}
.lp-tp-pct {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.lp-dash-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    white-space: nowrap;
}
.lp-dash-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }

/* ── Wrap ──────────────────────────────────────────────────────── */
.lp-wrap {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.lp-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--dark-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, transform 0.25s ease;
}
.lp-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.lp-sidebar-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.lp-sidebar-head-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}
.lp-sidebar-head-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.lp-lesson-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.lp-lesson-list::-webkit-scrollbar { width: 4px; }
.lp-lesson-list::-webkit-scrollbar-track { background: transparent; }
.lp-lesson-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.lp-lesson-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    border-left: 2px solid transparent;
    min-width: 0;
}
.lp-lesson-item:hover { background: rgba(255,255,255,0.04); }
.lp-lesson-item.active {
    background: rgba(13,110,253,0.1);
    border-left-color: var(--primary);
}
.lp-lesson-item.done .lp-li-check {
    background: rgba(74,222,128,0.12);
    border-color: rgba(74,222,128,0.3);
    color: #4ade80;
}

.lp-li-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s;
    background: rgba(255,255,255,0.03);
}
.lp-lesson-item.active .lp-li-check {
    border-color: rgba(13,110,253,0.5);
    background: rgba(13,110,253,0.15);
    color: #60a5fa;
}
.lp-li-num { font-size: 10px; font-weight: 700; color: var(--text-muted); }

.lp-li-info { flex: 1; min-width: 0; }
.lp-li-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 3px;
    transition: color 0.2s;
}
.lp-lesson-item:hover .lp-li-title,
.lp-lesson-item.active .lp-li-title { color: #fff; }
.lp-lesson-item.done .lp-li-title { color: rgba(255,255,255,0.6); }

.lp-li-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    gap: 4px;
}
.lp-li-type-icon { display: flex; align-items: center; color: rgba(255,255,255,0.4); }

/* ── Overlay ───────────────────────────────────────────────────── */
.lp-overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,0.6);
    z-index: 50;
}
.lp-overlay.visible { display: block; }

/* ── Main Content ──────────────────────────────────────────────── */
.lp-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: none;
}
.lp-main.expanded { /* sidebar collapsed */ }

/* ── Player Area ───────────────────────────────────────────────── */
.lp-player {
    background: #000;
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

/* Video player */
.lp-video-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    max-height: calc(100vh - 56px - 200px);
}
.lp-video-wrap iframe,
.lp-video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF viewer */
.lp-pdf-wrap {
    width: 100%;
    height: calc(100vh - 56px - 140px);
    min-height: 400px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lp-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: all; /* allow scroll but not download */
}
.lp-pdf-locked {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.lp-pdf-locked-icon { font-size: 48px; margin-bottom: 16px; }

/* Written lesson articles (content_body fallback, no uploaded file) */
.lp-article-wrap {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px 56px;
}
.lp-article-h {
    font-family: var(--font-heading);
    font-size: 20px;
    color: #fff;
    margin: 32px 0 14px;
}
.lp-article-wrap > .lp-article-h:first-child { margin-top: 0; }
.lp-article-p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0 0 16px;
}
.lp-article-list {
    margin: 0 0 16px;
    padding-left: 22px;
}
.lp-article-list li {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Audio player */
.lp-audio-wrap {
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, var(--dark-2), var(--dark));
}
.lp-audio-art {
    width: 160px; height: 160px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(13,110,253,0.2), rgba(111,66,193,0.2));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.lp-audio-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}
.lp-audio-player {
    width: 100%;
    max-width: 480px;
    accent-color: var(--primary);
}

/* Quiz placeholder */
.lp-quiz-wrap {
    padding: 48px 32px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}
.lp-quiz-header {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: #fff;
    margin-bottom: 8px;
}
.lp-quiz-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* Live placeholder */
.lp-live-wrap {
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
}
.lp-live-icon { font-size: 56px; margin-bottom: 16px; }

/* Generic lesson (no content type matched) */
.lp-content-placeholder {
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
    background: var(--dark-2);
}

/* ── Lesson Info Bar ───────────────────────────────────────────── */
.lp-info-bar {
    background: var(--dark);
    border-top: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.lp-info-left {}
.lp-lesson-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.lp-lesson-type-badge.video  { background: rgba(13,110,253,0.12); color: #60a5fa; }
.lp-lesson-type-badge.audio  { background: rgba(111,66,193,0.12); color: #c084fc; }
.lp-lesson-type-badge.pdf    { background: rgba(245,166,35,0.12);  color: var(--accent); }
.lp-lesson-type-badge.quiz   { background: rgba(74,222,128,0.1);   color: #4ade80; }
.lp-lesson-type-badge.live   { background: rgba(248,113,113,0.1);  color: #f87171; }

.lp-lesson-title-main {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.lp-lesson-duration-label {
    font-size: 12px;
    color: var(--text-muted);
}

.lp-info-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Complete toggle button */
.lp-complete-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.lp-complete-btn.mark {
    background: rgba(74,222,128,0.1);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.25);
}
.lp-complete-btn.mark:hover {
    background: rgba(74,222,128,0.18);
    border-color: rgba(74,222,128,0.4);
}
.lp-complete-btn.done {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
}
.lp-complete-btn.done:hover {
    background: rgba(248,113,113,0.1);
    color: #f87171;
    border-color: rgba(248,113,113,0.25);
}

/* Nav buttons */
.lp-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    transition: all 0.2s;
}
.lp-nav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }
.lp-nav-btn.next {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13,110,253,0.25);
}
.lp-nav-btn.next:hover { background: var(--primary-dark); }
.lp-nav-btn:disabled, .lp-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Lesson Notes / Description ────────────────────────────────── */
.lp-notes {
    padding: 24px 28px;
    border-top: 1px solid var(--border);
    background: var(--dark);
    flex-shrink: 0;
}
.lp-notes-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.lp-notes-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ── Completion Toast ──────────────────────────────────────────── */
.lp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark-3);
    border: 1px solid rgba(74,222,128,0.3);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #fff;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 360px;
}
.lp-toast.show { transform: translateY(0); opacity: 1; }
.lp-toast-icon { font-size: 22px; flex-shrink: 0; }
.lp-toast-title { font-weight: 700; color: #4ade80; margin-bottom: 2px; }
.lp-toast-sub   { font-size: 12px; color: var(--text-muted); }

/* Course complete celebration */
.lp-celebrate {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 998;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.lp-celebrate.show { display: flex; }
.lp-celebrate-box {
    background: var(--dark-3);
    border: 1px solid rgba(245,166,35,0.3);
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: pop-in 0.4s ease;
}
@keyframes pop-in {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.lp-celebrate-emoji { font-size: 64px; margin-bottom: 16px; }
.lp-celebrate-title {
    font-family: 'DM Serif Display', serif;
    font-size: 32px;
    color: #fff;
    margin-bottom: 10px;
}
.lp-celebrate-title em { color: var(--accent); font-style: italic; }
.lp-celebrate-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.7; }
.lp-celebrate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Progress bar (inline, within notes) ───────────────────────── */
.lp-course-progress-bar {
    background: rgba(255,255,255,0.07);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.lp-course-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #6f42c1);
    border-radius: 100px;
    transition: width 0.6s ease;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .lp-sidebar {
        position: fixed;
        top: 56px; bottom: 0; left: 0;
        z-index: 60;
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.25s ease;
    }
    .lp-sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    .lp-sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }
    .lp-main { margin-left: 0 !important; }
    .lp-course-title { display: none; }
    .lp-topbar-divider { display: none; }
    .lp-tp-bar { width: 60px; }
    .lp-info-bar { padding: 14px 16px; }
    .lp-notes { padding: 16px; }
    .lp-quiz-wrap { padding: 24px 16px; }
    .lp-audio-wrap { padding: 32px 16px; }
}

@media (max-width: 600px) {
    .lp-topbar-progress { display: none; }
    .lp-info-right { flex-wrap: wrap; }
    .lp-lesson-title-main { font-size: 15px; }
}

/* ── Stage 5 additions ──────────────────────────────────────── */

/* Progress header row */
.lp-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.lp-progress-label {
    font-size: 12px;
    color: var(--text-muted);
}
.lp-progress-label strong { color: #fff; }

/* About course block inside progress notes */
.lp-about-course {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.lp-about-course-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Umweka Academy — Lesson Notes Panel
   ═══════════════════════════════════════════════════════════════ */

/* ── Panel container (replaces .lp-notes) ── */
.lp-panel {
    border-top: 1px solid var(--border);
    background: var(--dark);
    flex-shrink: 0;
}

/* ── Tab bar ── */
.lp-panel-tabs {
    display: flex;
    gap: 2px;
    padding: 12px 20px 0;
    border-bottom: 1px solid var(--border);
}
.lp-panel-tab {
    position: relative;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 8px 14px 10px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.lp-panel-tab:hover { color: #fff; }
.lp-panel-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}
/* Dot indicator (note exists) */
.lp-tab-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Tab body ── */
.lp-panel-body {
    padding: 20px 24px 24px;
}

/* ── Toolbar row ── */
.lpn-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.lpn-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.lpn-dot { opacity: 0.4; }
#lpnSaved { color: rgba(255,255,255,0.35); }
.lpn-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.lpn-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    padding: 5px 12px;
    border-radius: 7px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    line-height: 1;
}
.lpn-btn-save {
    background: rgba(13,110,253,.15);
    border-color: rgba(13,110,253,.3);
    color: #60a5fa;
}
.lpn-btn-save:hover {
    background: rgba(13,110,253,.25);
    border-color: rgba(13,110,253,.5);
}
.lpn-btn-save:disabled {
    opacity: 0.5;
    cursor: default;
}
.lpn-btn-delete {
    background: rgba(248,113,113,.08);
    border-color: rgba(248,113,113,.2);
    color: #f87171;
}
.lpn-btn-delete:hover {
    background: rgba(248,113,113,.18);
    border-color: rgba(248,113,113,.4);
}
.lpn-btn-delete:disabled { opacity: 0.4; cursor: default; }

/* ── Textarea ── */
.lpn-textarea {
    width: 100%;
    min-height: 160px;
    max-height: 360px;
    resize: vertical;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.75;
    padding: 14px 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, background .2s;
}
.lpn-textarea:focus {
    border-color: rgba(13,110,253,.4);
    background: rgba(255,255,255,0.05);
}
.lpn-textarea::placeholder { color: rgba(255,255,255,0.2); line-height: 1.8; }

/* ── Hint line ── */
.lpn-hint {
    margin-top: 8px;
    font-size: 10px;
    color: rgba(255,255,255,0.18);
}
.lpn-hint kbd {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    color: rgba(255,255,255,0.4);
}

/* ── Progress tab stat chips ── */
.lpn-stat-chip {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    text-align: center;
    min-width: 80px;
}
.lpn-stat-num   { font-size: 22px; font-weight: 900; color: #fff; display: block; }
.lpn-stat-label { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

@media(max-width:600px) {
    .lp-panel-tabs { padding: 10px 12px 0; overflow-x: auto; }
    .lp-panel-body { padding: 16px; }
    .lpn-toolbar   { flex-direction: column; align-items: flex-start; }
    .lpn-textarea  { min-height: 120px; }
}

/* ═══════════════════════════════════════════════════════════════
   Umweka Academy — Lesson Resource Downloads (Player Panel)
   ═══════════════════════════════════════════════════════════════ */

/* Tab badge (resource count) */
.lp-tab-badge {
    background: rgba(13,110,253,.15);
    color: #60a5fa;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 100px;
    margin-left: 2px;
}

/* Resource list */
.lpr-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lpr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color .15s;
}
.lpr-item:hover { border-color: rgba(255,255,255,0.14); }
.lpr-icon  { font-size: 20px; flex-shrink: 0; line-height: 1; }
.lpr-info  { flex: 1; min-width: 0; }
.lpr-label { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lpr-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.lpr-preview-note { color: rgba(255,255,255,0.28); font-style: italic; }
.lpr-required-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251,191,36,.1);
    border: 1px solid rgba(251,191,36,.3);
    border-radius: 5px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: .3px;
}
.lpr-required-badge.lpr-required-done {
    color: #4ade80;
    background: rgba(74,222,128,.1);
    border-color: rgba(74,222,128,.3);
}
.lpr-viewed-badge {
    display: inline-block;
    color: #4ade80;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
    vertical-align: middle;
}

.lpr-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #60a5fa;
    background: rgba(13,110,253,0.1);
    border: 1px solid rgba(13,110,253,0.25);
    border-radius: 7px;
    padding: 6px 12px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all .15s;
    white-space: nowrap;
}
.lpr-download-btn:hover {
    background: rgba(13,110,253,0.2);
    border-color: rgba(13,110,253,0.45);
    color: #93c5fd;
}
.lpr-note {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    margin-top: 14px;
    line-height: 1.5;
}

.lpr-required-notice {
    background: rgba(251,191,36,.08);
    border: 1px solid rgba(251,191,36,.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: #fbbf24;
    line-height: 1.5;
    margin-bottom: 12px;
}

.lpr-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.lpr-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 7px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.lpr-view-btn:hover {
    background: rgba(34,197,94,0.2);
    border-color: rgba(34,197,94,0.5);
    color: #86efac;
}

/* ── Unified resource viewer modal ─────────────────────────── */
.lpr-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lpr-viewer-modal {
    background: var(--dark-2, #14161f);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lpr-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.lpr-viewer-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lpr-viewer-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 12px;
}
.lpr-viewer-close:hover { background: rgba(255,255,255,0.14); }

.lpr-viewer-body {
    position: relative;
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 200px;
}
.lpr-viewer-body.lpr-viewer-pdf { display: block; padding: 16px 0; background: #1a1a1a; }
.lpr-viewer-loading, .lpr-viewer-error {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    text-align: center;
    padding: 40px 20px;
}
.lpr-viewer-image {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    -webkit-user-select: none;
    user-select: none;
}
.lpr-viewer-video, .lpr-viewer-audio { width: 100%; }
.lpr-viewer-video { max-height: 75vh; border-radius: 8px; }

/* ── Word document viewer (mammoth.js output) ──────────────── */
.lpr-viewer-body.lpr-viewer-document {
    display: block;
    align-items: normal;
    justify-content: normal;
    background: #fff;
    padding: 0;
}
.lpr-doc-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 48px;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.7;
}
.lpr-doc-content h1, .lpr-doc-content h2, .lpr-doc-content h3 { color: #111; margin: 1.2em 0 .5em; }
.lpr-doc-content p { margin: 0 0 1em; }
.lpr-doc-content img { max-width: 100%; height: auto; }
.lpr-doc-content table { border-collapse: collapse; margin: 1em 0; }
.lpr-doc-content table td, .lpr-doc-content table th { border: 1px solid #ddd; padding: 6px 10px; }

/* ── Excel spreadsheet viewer (SheetJS output) ─────────────── */
.lpr-viewer-body.lpr-viewer-spreadsheet {
    display: block;
    align-items: normal;
    justify-content: normal;
    padding: 0;
}
.lpr-sheet-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow-x: auto;
    flex-shrink: 0;
}
.lpr-sheet-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.lpr-sheet-tab.active { background: rgba(255,255,255,0.08); color: #fff; }
.lpr-sheet-scroll { overflow: auto; max-height: 70vh; background: #fff; }
.lpr-sheet-scroll table {
    border-collapse: collapse;
    font-size: 12px;
    color: #1a1a1a;
    white-space: nowrap;
}
.lpr-sheet-scroll table td, .lpr-sheet-scroll table th {
    border: 1px solid #e0e0e0;
    padding: 5px 10px;
}
.lpr-sheet-scroll table th, .lpr-sheet-scroll table tr:first-child td {
    background: #f5f5f5;
    font-weight: 700;
}

/* ── Image Gallery viewer ───────────────────────────────────── */
.lpr-viewer-body.lpr-viewer-gallery {
    display: block;
    align-items: normal;
    justify-content: normal;
    padding: 20px;
    overflow-y: auto;
}
.lpr-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.lpr-gallery-figure {
    margin: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.lpr-gallery-figure img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    -webkit-user-select: none;
    user-select: none;
}
.lpr-gallery-figure figcaption {
    padding: 8px 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
}

@media(max-width:600px) {
    .lpr-viewer-overlay { padding: 0; }
    .lpr-viewer-modal { max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
    .lpr-viewer-image, .lpr-viewer-video { max-height: 65vh; }
    .lpr-doc-content { padding: 20px 16px; font-size: 13px; }
    .lpr-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .lpr-gallery-figure img { height: 100px; }
    .lpr-sheet-scroll { max-height: 60vh; }
}

@media(max-width:480px) {
    .lpr-item { flex-wrap: wrap; }
    .lpr-actions { width: 100%; }
    .lpr-view-btn, .lpr-download-btn { flex: 1; justify-content: center; }
}

