:root {
  --lms-nav-from: #0b2a5b; --lms-nav-to: #0d6efd; --lms-nav-text: #ffffff;
  --lms-bg: #f4f6fb; --lms-text: #212529;
  --lms-hero-from: #0b2a5b; --lms-hero-to: #0d6efd;
  --lms-card-bg: #ffffff;
  --lms-primary: #0d6efd; --lms-primary-rgb: 13,110,253; --lms-primary-dark: #0a58ca; --lms-primary-text: #ffffff;
  --lms-footer-bg: #f4f6fb; --lms-footer-text: #6c757d;
  --lms-brand: var(--lms-primary);
  --bs-primary: var(--lms-primary); --bs-primary-rgb: var(--lms-primary-rgb);
  --bs-link-color: var(--lms-primary); --bs-link-color-rgb: var(--lms-primary-rgb); --bs-link-hover-color: var(--lms-primary-dark);
}
.lms-body { background: var(--lms-bg); color: var(--lms-text); }
.lms-nav { background: linear-gradient(90deg, var(--lms-nav-from), var(--lms-nav-to)); }
.lms-nav .navbar-brand, .lms-nav .nav-link { color: var(--lms-nav-text); }
.lms-nav .nav-link { opacity: .88; }
.lms-nav .nav-link:hover, .lms-nav .nav-link:focus { color: var(--lms-nav-text); opacity: 1; }
.lms-nav .nav-link.active { font-weight: 600; background: rgba(255,255,255,.18); border-radius: .5rem; opacity: 1; color: var(--lms-nav-text); }
.card { border: 0; border-radius: .9rem; background-color: var(--lms-card-bg); color: var(--lms-text); }
.btn-primary { --bs-btn-bg: var(--lms-primary); --bs-btn-border-color: var(--lms-primary); --bs-btn-color: var(--lms-primary-text);
  --bs-btn-hover-bg: var(--lms-primary-dark); --bs-btn-hover-border-color: var(--lms-primary-dark); --bs-btn-hover-color: var(--lms-primary-text);
  --bs-btn-active-bg: var(--lms-primary-dark); --bs-btn-active-border-color: var(--lms-primary-dark); --bs-btn-active-color: var(--lms-primary-text);
  --bs-btn-disabled-bg: var(--lms-primary); --bs-btn-disabled-border-color: var(--lms-primary); --bs-btn-disabled-color: var(--lms-primary-text); }
.btn-outline-primary { --bs-btn-color: var(--lms-primary); --bs-btn-border-color: var(--lms-primary); --bs-btn-hover-bg: var(--lms-primary); --bs-btn-hover-border-color: var(--lms-primary);
  --bs-btn-hover-color: var(--lms-primary-text); --bs-btn-active-bg: var(--lms-primary); --bs-btn-active-border-color: var(--lms-primary); --bs-btn-active-color: var(--lms-primary-text);
  --bs-btn-disabled-color: var(--lms-primary); --bs-btn-disabled-border-color: var(--lms-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--lms-primary); --bs-nav-pills-link-active-color: var(--lms-primary-text); }
.progress { --bs-progress-bar-bg: var(--lms-primary); }
.form-control:focus, .form-select:focus { border-color: var(--lms-primary); box-shadow: 0 0 0 .2rem rgba(var(--lms-primary-rgb), .2); }
.lms-footer { background: var(--lms-footer-bg); color: var(--lms-footer-text); }
.lms-footer a { color: inherit; }
.lms-hero { background: linear-gradient(135deg, var(--lms-hero-from), var(--lms-hero-to)); color: #fff; }
.lms-card-link { color: inherit; text-decoration: none; }
.lms-card-link:hover .card { box-shadow: 0 .5rem 1.2rem rgba(13,110,253,.18) !important; transform: translateY(-2px); }
.lms-card-link .card { transition: all .15s ease; }
.lms-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .9rem .9rem 0 0; background: #e9ecef; }
.lms-cover-ph { width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #fff; border-radius: .9rem .9rem 0 0; background: linear-gradient(135deg, #6ea8fe, #0d6efd); }
.lms-cover-ph.pdf { background: linear-gradient(135deg, #f1aeb5, #dc3545); }
.lms-cover-ph.quiz { background: linear-gradient(135deg, #ffda6a, #fd7e14); }
.lms-body-text { line-height: 1.75; font-size: 1.02rem; }
.lms-comment { border-left: 3px solid #dee2e6; padding-left: .85rem; }
.lms-reply { margin-left: 2.5rem; }
.lms-points { font-variant-numeric: tabular-nums; }

/* Pembaca PDF (tanpa tombol unduh) */
.pdf-shell { position: relative; background: #3a3f47; border-radius: .9rem; padding: .75rem; user-select: none; -webkit-user-select: none; }
.pdf-pages canvas { display: block; margin: 0 auto .75rem; max-width: 100%; height: auto !important; box-shadow: 0 .25rem .75rem rgba(0,0,0,.35); background: #fff; pointer-events: none; }
.pdf-watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.pdf-watermark span { position: absolute; white-space: nowrap; color: rgba(0,0,0,.14); font-weight: 700; font-size: 1.1rem; transform: rotate(-30deg); }
@media print { .pdf-shell, .pdf-pages { display: none !important; } body::before { content: "Pencetakan dinonaktifkan."; } }

/* Kuis */
.quiz-opt { cursor: pointer; border: 2px solid #dee2e6; border-radius: .75rem; padding: .8rem 1rem; background: #fff; transition: all .12s ease; width: 100%; text-align: left; }
.quiz-opt:hover { border-color: var(--lms-brand); background: #f1f6ff; }
.quiz-opt:disabled { opacity: .6; cursor: default; }
.quiz-timer { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700; }
.quiz-timer.low { color: #dc3545; animation: lms-blink 1s steps(2, start) infinite; }
@keyframes lms-blink { to { visibility: hidden; } }

/* Logo, bilah progres navigasi */
.lms-logo { height: 30px; width: auto; max-width: 120px; object-fit: contain; border-radius: .25rem; }
#lmsBar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: #ffc107; z-index: 3000; opacity: 0; transition: width .25s ease, opacity .25s ease; }
.lms-footer a { color: inherit; }

/* Emoji */
.lms-emoji-pop { display: flex; flex-wrap: wrap; gap: 2px; margin-top: .4rem; padding: .4rem; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; max-width: 420px; }
.lms-emoji-item { border: 0; background: transparent; font-size: 1.25rem; line-height: 1; padding: .2rem .3rem; border-radius: .4rem; cursor: pointer; }
.lms-emoji-item:hover { background: #e9f1ff; }

/* Pemotong gambar */
.lms-crop-wrap { max-height: 60vh; overflow: hidden; background: #212529; border-radius: .5rem; }
.lms-crop-wrap img { display: block; max-width: 100%; }

/* Pemutar Spotify (dapat diperkecil, musik tetap berjalan) */
.sp-widget { position: fixed; right: 14px; bottom: 14px; width: 330px; max-width: calc(100vw - 28px); z-index: 1080; background: #121212; color: #fff; border-radius: .9rem; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.35); overflow: hidden; }
.sp-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; cursor: pointer; background: #1db954; color: #04210f; font-weight: 700; }
.sp-hint { font-size: .68rem; font-weight: 500; opacity: .8; display: none; }
.sp-widget:not(.sp-min) .sp-hint { display: inline; }
.sp-btn { margin-left: auto; border: 0; background: rgba(0,0,0,.15); color: #04210f; width: 28px; height: 28px; border-radius: 50%; line-height: 1; }
.sp-body { height: 352px; transition: height .2s ease; }
.sp-body iframe { display: block; border: 0; }
.sp-widget.sp-min { width: 190px; border-radius: 2rem; }
.sp-widget.sp-min .sp-body { height: 0; overflow: hidden; }   /* hanya disembunyikan: iframe tetap hidup sehingga musik terus berjalan */
.sp-widget.sp-min .sp-head { border-radius: 2rem; }
@media print { .sp-widget { display: none; } }

/* Progress bar upload */
.lms-up { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }
.lms-up.d-none { display: none !important; }
.lms-up-card { width: min(92vw, 380px); background: #fff; border-radius: .9rem; padding: 1.1rem 1.2rem; box-shadow: 0 .75rem 2rem rgba(0,0,0,.3); }

/* Pop up pengumuman */
.lms-popup-close { position: absolute; top: -12px; right: -12px; z-index: 5; background-color: #fff; border-radius: 50%; padding: .6rem; opacity: 1; box-shadow: 0 .25rem .75rem rgba(0,0,0,.4); }
.lms-popup-img { width: 100%; height: auto; border-radius: .9rem; display: block; box-shadow: 0 1rem 2.5rem rgba(0,0,0,.45); }

/* My Album: carousel dengan bingkai persegi */
.lms-album { position: relative; width: 100%; max-width: 440px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: .9rem; overflow: hidden; background: #111; box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.2); }
.lms-album .carousel-inner, .lms-album .carousel-item { height: 100%; }
.lms-album-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lms-album-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .9rem .9rem; color: #fff; font-size: .9rem; background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0)); }
.lms-album .carousel-indicators { margin-bottom: .35rem; z-index: 6; }
.lms-album .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 50%; border: 0; }
.lms-album-del { position: absolute; top: .6rem; right: .6rem; z-index: 7; }
.lms-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.lms-album-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: .7rem; overflow: hidden; background: #e9ecef; }
.lms-album-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lms-album-thumb form { position: absolute; top: .35rem; right: .35rem; }
.lms-album-thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem .5rem .35rem; font-size: .75rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0)); }

/* Beranda: kartu menu & statistik */
.lms-tile .card-body { display: flex; align-items: center; gap: .75rem; }
.lms-tile-ic { width: 46px; height: 46px; flex: 0 0 46px; border-radius: .85rem; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; box-shadow: 0 .25rem .6rem rgba(0,0,0,.18); transition: transform .15s ease; }
.lms-tile:hover .lms-tile-ic { transform: scale(1.1) rotate(-4deg); }
.lms-stat { transition: transform .15s ease; }
.lms-stat:hover { transform: translateY(-2px); }
.lms-hero .progress-bar { transition: width .8s ease; }

/* Pemutar video khusus */
.vp { background: #111; border-radius: .9rem; padding: .6rem; color: #fff; user-select: none; -webkit-user-select: none; }
.vp .text-muted { color: #adb5bd !important; }
.vp-stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: .6rem; overflow: hidden; }
.vp-stage video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.vp-wm { position: absolute; inset: 0; pointer-events: none; overflow: hidden; animation: vp-drift 18s linear infinite alternate; }
.vp-wm span { position: absolute; white-space: nowrap; color: rgba(255,255,255,.16); font-weight: 700; font-size: .95rem; transform: rotate(-24deg); }
@keyframes vp-drift { from { transform: translate(-3%, -2%); } to { transform: translate(3%, 3%); } }
.vp-bar-wrap { height: 6px; background: #343a40; border-radius: 3px; margin-top: .5rem; overflow: hidden; pointer-events: none; }
.vp-bar { height: 100%; width: 0; background: var(--lms-primary); }

/* Pesan */
.msg-list { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; background: rgba(0,0,0,.02); }
.msg-row { display: flex; }
.msg-mine { justify-content: flex-end; }
.msg-bubble { max-width: 78%; padding: .5rem .75rem; border-radius: 1rem; word-break: break-word; }
.msg-mine .msg-bubble { background: var(--lms-primary); color: var(--lms-primary-text); border-bottom-right-radius: .25rem; }
.msg-theirs .msg-bubble { background: #e9ecef; color: #212529; border-bottom-left-radius: .25rem; }
.msg-mine .msg-bubble a { color: inherit; text-decoration: underline; }
.msg-meta { font-size: .7rem; opacity: .75; text-align: right; margin-top: .15rem; }
.msg-img { max-width: 100%; max-height: 260px; border-radius: .6rem; display: block; margin-bottom: .25rem; }

/* Navbar rapi (tidak bertumpuk di desktop) */
.lms-brand-text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lms-user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.lms-nav .dropdown-item.active { background: var(--lms-primary); color: var(--lms-primary-text); }
@media (min-width: 992px) {
  .lms-nav .navbar-collapse { flex-wrap: nowrap; }
  .lms-nav .navbar-nav { flex-wrap: nowrap; align-items: center; }
  .lms-nav .nav-link { white-space: nowrap; padding: .5rem .6rem; }
  .lms-nav .lms-nav-main { gap: .1rem; }
  .lms-nav .lms-nav-right { gap: .25rem; }
}
/* lebar desktop sempit: hanya ikon (nama muncul sebagai tooltip) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .lms-nav .nl, .lms-user-name { display: none; }
  .lms-nav .nav-link i { font-size: 1.15rem; }
  .lms-brand-text { max-width: 150px; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) { .lms-brand-text { max-width: 170px; } }

/* Isi teks kaya */
.lms-rich { line-height: 1.7; overflow-wrap: anywhere; }
.lms-rich table { border-collapse: collapse; max-width: 100%; margin: .75rem 0; }
.lms-rich table td, .lms-rich table th { border: 1px solid #ced4da; padding: .4rem .65rem; vertical-align: top; }
.lms-rich table th { background: rgba(0,0,0,.05); }
.lms-rich img { max-width: 100%; height: auto; border-radius: .5rem; }
.lms-rich ul, .lms-rich ol { padding-left: 1.6rem; }
.lms-rich blockquote { border-left: 4px solid #ced4da; padding: .25rem 1rem; color: #6c757d; margin: .75rem 0; }
.lms-rich pre { background: #f1f3f5; padding: .75rem; border-radius: .5rem; overflow: auto; }
.jodit-container { border-radius: .6rem !important; }

/* Forum */
.forum-hero { position: relative; overflow: hidden; }
.forum-hero::after { content: "\F4A5"; font-family: "bootstrap-icons"; position: absolute; right: -10px; bottom: -40px; font-size: 11rem; opacity: .08; pointer-events: none; }
.forum-stat { background: rgba(255,255,255,.16); border-radius: .8rem; padding: .5rem .25rem; backdrop-filter: blur(2px); }
.forum-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.forum-chip { --cc: var(--lms-primary); display: inline-flex; align-items: center; gap: .15rem; padding: .3rem .75rem; border-radius: 2rem; border: 1px solid var(--cc); color: var(--cc); text-decoration: none; background: var(--lms-card-bg); font-size: .88rem; transition: all .15s ease; }
.forum-chip span { background: rgba(0,0,0,.07); border-radius: 1rem; padding: 0 .45rem; font-size: .75rem; margin-left: .25rem; }
.forum-chip:hover { background: var(--cc); color: #fff; transform: translateY(-1px); }
.forum-chip.on { background: var(--cc); color: #fff; box-shadow: 0 .25rem .6rem rgba(0,0,0,.18); }
.forum-card { transition: transform .15s ease, box-shadow .15s ease; }
.lms-card-link:hover .forum-card { transform: translateY(-2px); box-shadow: 0 .6rem 1.4rem rgba(0,0,0,.12) !important; }
.lms-card-link:hover .forum-title { color: var(--lms-primary); }
.forum-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-metric { white-space: nowrap; }
.min-w-0 { min-width: 0; }
@media (min-width: 992px) { .forum-side { position: sticky; top: 76px; } }

/* ---- My Album: grid ala profil Instagram + penampil foto besar (v1.17) */
.lms-ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; max-width: 480px; margin: 0 auto; }
@media (min-width: 992px) { .lms-ig-grid { grid-template-columns: repeat(4, 1fr); max-width: 560px; } }
.lms-ig-item { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #e9ecef; border-radius: 3px; }
.lms-ig-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.lms-ig-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .9rem; color: #fff; font-weight: 600; font-size: .85rem; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .2s; }
.lms-ig-item:hover .lms-ig-hover, .lms-ig-item:focus-visible .lms-ig-hover { opacity: 1; }
.lms-ig-item:hover img { transform: scale(1.04); }
@media (hover: none) { .lms-ig-hover { display: none; } }
.lms-lightbox .modal-content { overflow: hidden; border: 0; border-radius: .75rem; }
.lms-lb-stage { position: relative; background: #000; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.lms-lb-stage img { max-width: 100%; max-height: 75vh; object-fit: contain; display: block; }
.lms-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: #212529; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.lms-lb-nav.prev { left: .6rem; } .lms-lb-nav.next { right: .6rem; }
.lms-lb-close { position: absolute; top: .7rem; right: .7rem; z-index: 2; }
.lms-lb-count { position: absolute; left: .7rem; top: .6rem; color: #fff; font-size: .8rem; background: rgba(0,0,0,.45); padding: .1rem .5rem; border-radius: 1rem; }
@media (max-width: 575.98px) { .lms-lightbox .modal-dialog { margin: .5rem; } .lms-lb-stage img { max-height: 65vh; } }
