/* Beranda APLIKASI (PWA, cara 2, 21 Nov 2026) — kelas nla-*. Hanya berlaku saat html.nls-app (/lib/nls-aplikasi.js).
   Website biasa: #nlsApp tidak tampil. Warna dari var(--nls-*) (Tema Akademik); hijau/merah/emas = makna jalur pos. */
#nlsApp { display: none; }
html.nls-app #nlsApp { display: block; }
html.nls-app body > nav[data-nls-header],
html.nls-app body > footer[data-nls-footer],
html.nls-app body > main { display: none !important; }
html.nls-app body { background: var(--nls-bg, #f4f5f7); min-height: 100dvh; }
html.nls-app.nlsmb-on body { padding-bottom: 0; }

.nla {
  --nla-hijau: #16a34a; --nla-merah: #dc2626; --nla-emas: #f2b01e; --nla-bayang: 0 12px 30px -18px rgba(16, 32, 52, .5);
  min-height: 100dvh; padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  font-family: var(--nls-font, "Plus Jakarta Sans", system-ui, sans-serif); color: var(--nls-text, #16202c);
}
.nla-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nla-tata { max-width: 620px; margin: 0 auto; }

/* ---------- pegunungan + jalur pos ---------- */
.nla-hero { position: relative; aspect-ratio: 10 / 9; max-height: 470px; width: 100%; overflow: hidden; border-radius: 0 0 28px 28px; background: #6fb0e8; isolation: isolate; }
.nla-hero-img, .nla-jalur, .nla-tirai { position: absolute; inset: 0; width: 100%; height: 100%; }
.nla-hero-img { object-fit: cover; object-position: 50% 50%; }
.nla-tirai { background: linear-gradient(180deg, rgba(10, 28, 52, .55) 0%, rgba(10, 28, 52, 0) 34%, rgba(10, 28, 52, 0) 72%, rgba(10, 28, 52, .28) 100%); }
.nla-jalur { overflow: visible; }
.nla-jalur-dasar { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 16; }
.nla-jalur[data-kosong] .nla-jalur-dasar { stroke: rgba(255, 255, 255, .55); }
.nla-jalur-tempuh { fill: none; stroke: var(--nla-hijau); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.nla-pos-bulat { stroke: #fff; stroke-width: 5; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.nla-pos-sudah .nla-pos-bulat { fill: var(--nla-hijau); }
.nla-pos-kini .nla-pos-bulat { fill: var(--nla-merah); }
.nla-pos-belum .nla-pos-bulat { fill: rgba(255, 255, 255, .92); }
.nla-pos-puncak .nla-pos-bulat { fill: var(--nla-emas); }
.nla-pos-tanda { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.nla-pos-puncak .nla-pos-tanda { fill: #7a4b00; stroke: #7a4b00; stroke-width: 3; }
.nla-pos-no { font: 800 24px var(--nls-font, "Plus Jakarta Sans", system-ui, sans-serif); text-anchor: middle; fill: var(--nls-primary, #1e3a5f); }
.nla-pos-kini .nla-pos-no { fill: #fff; }
.nla-denyut { fill: var(--nla-merah); opacity: .45; transform-box: fill-box; transform-origin: center; animation: nla-denyut 1.6s ease-out infinite; }
@keyframes nla-denyut { 0% { transform: scale(.7); opacity: .55; } 100% { transform: scale(1.6); opacity: 0; } }
.nla-atas { position: absolute; left: 16px; right: 16px; top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: #fff; }
.nla-sapa { min-width: 0; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.nla-sapa small { display: block; font-size: 13px; font-weight: 600; opacity: .92; }
.nla-sapa b { display: block; font-family: var(--nls-font-heading, "Fraunces", Georgia, serif); font-size: 26px; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nla-saldo { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 800; font-size: 13px;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nla-saldo[hidden] { display: none; }
.nla-saldo span { display: inline-flex; align-items: center; gap: 5px; }
.nla-koin i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe8a3, #f2b01e 55%, #b7790a); box-shadow: inset 0 0 0 1.5px rgba(122, 75, 0, .5); }
.nla-kristal svg { width: 15px; height: 15px; color: #c4b5fd; fill: rgba(167, 139, 250, .55); }

/* ---------- kartu ---------- */
.nla-kolom { position: relative; z-index: 1; margin-top: -34px; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.nla-kartu { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--nls-surface, #fff); border: 1px solid var(--nls-line, #d9dee5); border-radius: 18px; box-shadow: var(--nla-bayang); }
.nla-kartu[hidden], .nla-sek[hidden] { display: none; }
.nla-kartu-isi { flex: 1; min-width: 0; }
.nla-label { margin: 0 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--nls-muted, #5a6573); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nla-judul { display: block; font-family: var(--nls-font-heading, "Fraunces", Georgia, serif); font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--nls-primary, #1e3a5f); }
.nla-ket { margin: 3px 0 0; font-size: 13px; line-height: 1.4; color: var(--nls-muted, #5a6573); }
.nla-kecil { margin: 4px 0 0; font-size: 12px; color: var(--nls-muted, #5a6573); }
.nla-bilah { display: block; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--nls-soft, #e8edf3); overflow: hidden; }
.nla-bilah i { display: block; height: 100%; border-radius: inherit; background: var(--nla-hijau); }
.nla-aksi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nla-tombol { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--nls-primary, #1e3a5f);
  background: var(--nls-primary, #1e3a5f); color: var(--nls-on-primary, #fff); font: inherit; font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; cursor: pointer; }
.nla-tombol-garis { background: transparent; color: var(--nls-primary, #1e3a5f); }
.nla-tombol:focus-visible, .nla a:focus-visible, .nla button:focus-visible { outline: 2px solid var(--nls-accent, #a92b35); outline-offset: 2px; }
.nla-pos { align-items: center; }
html.nla-tamu .nla-pos { flex-direction: column; align-items: stretch; }
html.nla-tamu .nla-pos .nla-aksi { margin-top: 0; }
.nla-kosong { margin: 0; font-size: 13px; color: var(--nls-muted, #5a6573); line-height: 1.5; }
.nla-kosong a { color: var(--nls-primary, #1e3a5f); font-weight: 700; }

/* kerangka saat memuat */
.nla-kerangka { flex: 1; height: 62px; border-radius: 12px; background: linear-gradient(90deg, var(--nls-soft, #e8edf3) 25%, var(--nls-line, #d9dee5) 50%, var(--nls-soft, #e8edf3) 75%); background-size: 200% 100%; animation: nla-kilau 1.3s linear infinite; }
.nla-kerangka-sampul { flex: none; width: 148px; height: 190px; }
@keyframes nla-kilau { to { background-position: -200% 0; } }

/* pengingat TO bercincin */
.nla-to { align-items: flex-start; }
.nla-cincin { flex: none; width: 72px; height: 72px; }
.nla-cincin-alas { fill: none; stroke: var(--nls-soft, #e8edf3); stroke-width: 6; }
.nla-cincin-isi { fill: none; stroke: var(--nls-accent, #a92b35); stroke-width: 6; stroke-linecap: round; }
.nla-cincin-n { font: 800 18px var(--nls-font, "Plus Jakarta Sans", system-ui, sans-serif); text-anchor: middle; fill: var(--nls-primary, #1e3a5f); }
.nla-cincin-u { font: 700 9px var(--nls-font, "Plus Jakarta Sans", system-ui, sans-serif); text-anchor: middle; fill: var(--nls-muted, #5a6573); }

/* login beruntun: kalender pekan */
.nla-beruntun { flex-direction: column; align-items: stretch; gap: 10px; }
.nla-kepala-kartu { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nla-permata { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.nla-permata svg { width: 22px; height: 22px; }
.nla-pekan { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.nla-hari { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--nls-muted, #5a6573); }
.nla-hari i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 12px; font-weight: 800;
  background: var(--nls-soft, #e8edf3); color: var(--nls-muted, #5a6573); border: 2px solid transparent; }
.nla-hari i svg { width: 18px; height: 18px; }
.nla-hari.sudah i { background: var(--nla-hijau); color: #fff; }
.nla-hari.nanti i { background: transparent; border: 2px dashed var(--nls-line, #d9dee5); }
.nla-hari.ini span { color: var(--nls-accent, #a92b35); }
.nla-hari.ini i { border-color: var(--nls-accent, #a92b35); }
.nla-hari.bonus i { background: var(--nla-emas); color: #5c3a00; border: 2px solid #d99a0b; }
.nla-hari.bonus.sudah i { background: var(--nla-hijau); color: #fff; border-color: var(--nla-emas); }
.nla-besok { margin: 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--nla-emas) 16%, transparent); color: var(--nls-text, #16202c); font-size: 13px; font-weight: 700; text-align: center; }

/* bagian Lanjutkan & Program */
.nla-sek { margin-top: 4px; }
.nla-sek-judul { margin: 4px 2px 10px; font-family: var(--nls-font-heading, "Fraunces", Georgia, serif); font-size: 20px; font-weight: 700; color: var(--nls-primary, #1e3a5f); }
.nla-geser { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
.nla-geser::-webkit-scrollbar { display: none; }
.nla-lanjut { flex: none; width: 148px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 10px; border-radius: 16px; text-decoration: none; color: inherit;
  background: var(--nls-surface, #fff); border: 1px solid var(--nls-line, #d9dee5); box-shadow: var(--nla-bayang); }
.nla-sampul { position: relative; display: block; height: 104px; margin-bottom: 5px; border-radius: 10px; overflow: hidden; background: var(--nls-soft, #e8edf3); }
.nla-sampul img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nla-buku .nla-sampul img, .nla-potret .nla-sampul img { object-fit: contain; background: var(--nls-soft, #e8edf3); }
.nla-sampul-kosong { position: absolute; inset: 0; display: grid; place-items: center; color: var(--nls-primary, #1e3a5f); }
.nla-sampul-kosong svg { width: 30px; height: 30px; }
.nla-sampul em { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(16, 32, 52, .72); color: #fff; font-size: 10px; font-weight: 800; font-style: normal; }
.nla-lanjut b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.nla-lanjut small { font-size: 11px; color: var(--nls-muted, #5a6573); }
.nla-lanjut .nla-bilah { margin-top: 4px; height: 5px; }
.nla-lanjut .nla-persen { font-weight: 800; color: var(--nls-primary, #1e3a5f); }
.nla-program { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; padding: 14px 8px; border-radius: 18px; background: var(--nls-surface, #fff); border: 1px solid var(--nls-line, #d9dee5); box-shadow: var(--nla-bayang); }
.nla-prog { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--nls-text, #16202c); font-size: 12px; font-weight: 700; -webkit-tap-highlight-color: transparent; }
.nla-prog-ikon { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--nls-bg, #f4f5f7); border: 1px solid var(--nls-line, #d9dee5); }
.nla-logo { width: 32px; height: 32px; }
.nla-garis { width: 25px; height: 25px; color: var(--nls-primary, #1e3a5f); }
.nla-titik { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--nla-merah); box-shadow: 0 0 0 2px var(--nls-surface, #fff); }
.nla-titik[hidden] { display: none; }

/* kabar kecil */
.nla-kabar { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9985; width: max-content; max-width: calc(100% - 32px);
  margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--nls-primary, #1e3a5f); color: #fff; font-size: 13px; font-weight: 700; box-shadow: var(--nla-bayang); }
.nla-kabar[hidden] { display: none; }

/* menu bawah MELAYANG (mode aplikasi) */
@media (max-width: 1023px) {
  html.nls-app .nlsmb-bar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; padding: 7px 4px 8px;
    border: 1px solid var(--nls-line, #d9dee5); border-radius: 22px; box-shadow: 0 14px 34px -14px rgba(16, 32, 52, .55); }
  html.nls-app .nlsly-latar { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* menu samping: hanya tablet mendatar / layar lebar */
.nla-rel { display: none; }
@media (min-width: 1024px) {
  .nla { padding-bottom: 24px; }
  .nla-rel { position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 8px 16px; background: var(--nls-surface, #fff); border-right: 1px solid var(--nls-line, #d9dee5); }
  .nla-rel-logo { margin-bottom: 14px; }
  .nla-rel-logo img { display: block; width: 44px; height: 44px; border-radius: 12px; }
  .nla-rel-btn { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border: 0; border-radius: 14px; background: none; cursor: pointer;
    font: inherit; font-size: 11px; font-weight: 700; color: var(--nls-muted, #5a6573); text-decoration: none; }
  .nla-rel-btn svg { width: 22px; height: 22px; }
  .nla-rel-btn.on { color: var(--nls-accent, #a92b35); background: var(--nls-soft, #e8edf3); }
  .nla-tata { max-width: 1280px; margin: 0 0 0 92px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 24px; align-items: start; }
  .nla-hero { position: sticky; top: 24px; border-radius: 24px; max-height: calc(100dvh - 48px); }
  .nla-kolom { margin-top: 0; padding: 0; }
  .nla-geser { margin: 0; padding: 2px 0 10px; }
  .nla-kabar { bottom: 24px; }
  html.nls-app .nlsly-latar { justify-content: center; padding-bottom: 0; }
  html.nls-app .nlsly-lembar { max-width: 560px; }
}
@media (min-width: 1440px) { .nla-tata { margin-left: auto; margin-right: auto; padding-left: 116px; } }

/* tema gelap: gambar sama bernuansa senja */
html.dark .nla-hero { background: #2a1f3d; }
html.dark .nla-hero-img { filter: sepia(.4) saturate(1.3) hue-rotate(-22deg) brightness(.68) contrast(1.06); }
html.dark .nla-tirai { background: linear-gradient(180deg, rgba(38, 18, 64, .7) 0%, rgba(236, 110, 64, .22) 46%, rgba(30, 16, 48, .18) 70%, rgba(14, 10, 28, .5) 100%); }
html.dark .nla-kartu, html.dark .nla-lanjut, html.dark .nla-program { background: #161c24; border-color: #263140; }
html.dark .nla-judul, html.dark .nla-sek-judul, html.dark .nla-lanjut .nla-persen { color: #e9edf2; }
html.dark .nla-label, html.dark .nla-ket, html.dark .nla-kecil, html.dark .nla-lanjut small, html.dark .nla-hari { color: #9aa6b4; }
html.dark .nla-prog { color: #e9edf2; }
html.dark .nla-prog-ikon, html.dark .nla-hari:not(.sudah):not(.bonus) i, html.dark .nla-bilah, html.dark .nla-sampul { background: #1c2733; border-color: #263140; }
html.dark .nla-garis, html.dark .nla-cincin-n { color: #8fb3dd; fill: #8fb3dd; }
html.dark .nla-garis { fill: none; }
html.dark .nla-cincin-alas { stroke: #263140; }
html.dark .nla-tombol { background: #8fb3dd; border-color: #8fb3dd; color: #0f1720; }
html.dark .nla-tombol-garis { background: transparent; color: #8fb3dd; }
html.dark .nla-besok { color: #f4e3b5; }
html.dark .nla-titik { box-shadow: 0 0 0 2px #161c24; }
html.dark .nla-rel { background: #121821; border-color: #263140; }
html.dark .nla-rel-btn.on { background: #1c2733; }
html.dark body { background: #0f141b; }
html.dark.nls-app .nlsmb-bar { background: #161c24; border-color: #263140; }

@media (prefers-reduced-motion: reduce) {
  .nla-denyut, .nla-kerangka { animation: none; }
}

/* tablet tegak: desain sama, lebar maksimal, pegunungan membulat penuh */
@media (min-width: 640px) and (max-width: 1023px) {
  .nla-tata { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .nla-hero { border-radius: 28px; }
}
