/* ================= Polish: satu sistem kartu, tombol, jarak, dan tipe =================
 * Skala jarak 4/8/12/16/24/32. Satu gaya kartu (border tipis + bayangan lembut), baris dalam kartu tanpa border.
 * Dimuat paling akhir, menimpa gaya lama yang tebal. */
:root { --r-card: 20px; --line: #e3e8f3; --shadow-card: 0 0 0 1.5px var(--line), 0 10px 24px -16px rgba(29,42,91,.35); --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; }
body { background: var(--paper); }
.view.hub { background: url(../assets/ui/pola.webp) 0 0 / 420px repeat, var(--paper); }
.topbar { box-shadow: 0 1px 0 var(--line) !important; border-bottom: 0 !important; background: rgba(255,248,236,.94) !important; backdrop-filter: blur(6px); }

/* kartu */
.card-sec, .rsec, .flow-step, .hero-hub, .jl-stat, .jl-box, .cek-card, .topik-card, .tes-card {
  box-shadow: var(--shadow-card) !important; border-radius: var(--r-card) !important; border: 0 !important; }
.card-sec { padding: var(--s5) !important; margin: var(--s5) 0 !important; }
.rec, .doc, .rec-list > * { box-shadow: none !important; background: #f6f8fd !important; border-radius: 14px !important; }
.sec-head { flex-wrap: wrap; row-gap: var(--s2); margin-bottom: var(--s3) !important; }
.sec-head h2 { font-size: 20px !important; line-height: 1.25; }
.sec-head .pill { white-space: nowrap; }

/* tombol: tanpa garis bawah, satu tinggi, primer hijau, sekunder garis */
a.btn, a.btn:hover, .btn { text-decoration: none !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 14px; font-size: 17px; line-height: 1.1;
  background: #fff; color: var(--ink); box-shadow: 0 0 0 2px #cfd7ea, 0 4px 0 #cfd7ea; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 2px #cfd7ea, 0 1px 0 #cfd7ea; }
.btn-go { background: var(--green); color: #fff; text-shadow: none; box-shadow: 0 4px 0 #1f8f55; }
.btn-go:active { box-shadow: 0 1px 0 #1f8f55; }
.btn.big { min-height: 56px; font-size: 20px; padding: 12px 28px; }
.btn.ghost { background: #fff; }
.icon-btn { box-shadow: 0 0 0 2px #cfd7ea, 0 3px 0 #cfd7ea !important; border-radius: 14px; }

/* hero: teks + satu ilustrasi */
.hero-hub { grid-template-columns: 1fr 1.1fr !important; padding: 0 !important; gap: 0 !important; overflow: hidden; background: #fff !important; }
.hero-copy { padding: var(--s6) !important; justify-content: center; }
.hero-copy p { color: var(--ink-2); max-width: 42ch; }
.hero-cta { gap: var(--s3) !important; margin-top: var(--s3) !important; }
.hero-art { position: relative; aspect-ratio: auto !important; min-height: 300px; border-radius: 0 !important; box-shadow: none !important; }
.hero-art .island { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(29,42,91,.35)); }
.hero-duo2 { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 82%; display: flex; justify-content: center; align-items: flex-end; }
.hero-duo2 img { height: 100%; width: auto; filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)); }
.hero-duo2 img + img { margin-left: -5%; height: 95%; }
.hero-duo { display: none !important; }
@media (max-width: 760px) {
  .hero-hub { grid-template-columns: 1fr !important; }
  .hero-art { order: -1; min-height: 210px; }
  .hero-copy { padding: var(--s5) var(--s4) !important; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* alur 4 langkah: tinggi sama, baris sejajar, penanda aktif di dalam kartu */
.flow { gap: var(--s3) !important; margin: var(--s5) 0 !important; align-items: stretch !important; }
.flow-step { grid-template-rows: 96px auto 1fr auto; align-content: start; padding: var(--s4) var(--s3) !important; height: 100%; }
.flow-step:hover { transform: none !important; box-shadow: 0 0 0 2px var(--potentia), 0 10px 24px -16px rgba(29,42,91,.35) !important; }
.flow-step.now { background: #fff !important; box-shadow: inset 0 0 0 3px var(--orange), 0 10px 24px -16px rgba(248,144,72,.6) !important; }
.flow-step.done { background: #f2fbf6 !important; }
.flow-step em { align-self: end; }
.flow-arrow { align-self: center; color: #b9c3da; }
.flow-ring { justify-content: center; }
@media (max-width: 980px) { .flow { grid-template-columns: 1fr 1fr !important; } .flow-arrow { display: none !important; } }

/* identitas & laporan */
.ident { row-gap: var(--s3); }
.ident dd { overflow-wrap: anywhere; }

/* kurikulum: tabel jadi kartu bertumpuk di layar kecil */
@media (max-width: 640px) {
  .kur-tbl { overflow: visible !important; }
  .kur-tbl table { min-width: 0 !important; display: block; }
  .kur-tbl thead { display: none; }
  .kur-tbl tbody, .kur-tbl tr { display: block; }
  .kur-tbl tr { background: #fff; border-radius: 16px; padding: var(--s3) var(--s4); margin-bottom: var(--s3); box-shadow: var(--shadow-card); }
  .kur-tbl td { display: block; border: 0 !important; padding: 2px 0 !important; min-width: 0 !important; }
  .kur-tbl td:nth-child(1), .kur-tbl td:nth-child(2) { display: inline-block; margin-right: var(--s2); }
  .kur-tbl td:nth-child(n+4)::before { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-top: var(--s2); }
  .kur-tbl td:nth-child(4)::before { content: "Merdeka"; }
  .kur-tbl td:nth-child(5)::before { content: "Cambridge"; }
  .kur-tbl td:nth-child(6)::before { content: "Game pendukung"; }
  .kur-tbl td:nth-child(7)::before { content: "Output"; }
  .kur-tbl td:nth-child(8)::before { content: "Laporan"; }
  .kur-tbl td:nth-child(9)::before { content: "Status"; }
  .chips-row, .seg.wrap { flex-wrap: nowrap !important; overflow-x: auto; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chips-row > *, .seg.wrap > * { flex: 0 0 auto; }
}

/* navigasi bawah: konten tidak tertutup */
@media (max-width: 980px) {
  .hub-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .bottomnav { border-top: 0 !important; box-shadow: 0 -1px 0 var(--line), 0 -8px 20px -12px rgba(29,42,91,.25); }
  .bottomnav a { min-height: 48px; }
}

/* Dokumen & Riset */
.dok-sub { margin: 4px 0 0; }
.dok-group + .dok-group { margin-top: var(--s5); }
.dok-group h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 0 0 var(--s3); }
.dok-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.dok { display: grid; grid-template-rows: auto 1fr auto; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); }
.dok-cover { position: relative; aspect-ratio: 4 / 3; background: #eef2fb; overflow: hidden; }
.dok-cover img:first-child { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.dok:hover .dok-cover img:first-child { transform: scale(1.03); }
.dok-peek { position: absolute; right: 12px; bottom: -18px; width: 30%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 6px; transform: rotate(4deg); box-shadow: 0 8px 18px rgba(29,42,91,.35); background: #fff; }
.dok-info { padding: var(--s3) var(--s4) 0; display: grid; gap: 6px; align-content: start; }
.dok-chip { justify-self: start; font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--potentia); background: #eef2fb; padding: 3px 8px; border-radius: 999px; }
.dok-info b { font-family: var(--display); font-size: 17px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dok-info p { margin: 0; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dok-info small { font-size: 12px; font-weight: 700; color: #7a84a3; }
.dok-act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4) var(--s4); }
.dok-act .btn.small { min-height: 44px; }
.dok-lang { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--potentia); text-decoration: none; }
@media (max-width: 900px) { .dok-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .dok-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--s3); margin: 0 calc(-1 * var(--s5)); padding: 2px var(--s5) var(--s3); scrollbar-width: none; }
  .dok { flex: 0 0 78%; scroll-snap-align: start; }
}
.pdf-modal { padding: 16px; }
.pdf-card { width: min(980px, 100%); height: min(88vh, 1100px); background: #fff; border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.pdf-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pdf-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-card iframe { width: 100%; height: 100%; border: 0; }

/* masa voucher habis */
.locked-card { text-align: center; max-width: 760px; margin: var(--s5) auto !important; }
.locked-card > img { width: 84px; }
.locked-card h1 { font-family: var(--display); font-size: 28px; margin: var(--s2) 0; }
.locked-card p { color: var(--ink-2); max-width: 56ch; margin: 0 auto var(--s4); }
.locked-plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s4); text-align: left; }
.lp { display: grid; gap: 4px; padding: var(--s4); border-radius: 16px; background: #f6f8fd; text-decoration: none; color: var(--ink); }
.lp.best { background: #fff3e6; box-shadow: inset 0 0 0 2px var(--orange); }
.lp b { font-family: var(--display); font-size: 18px; }
.lp span { font-weight: 900; font-size: 20px; color: #1f8f55; }
.lp del { color: #98a0b8; font-weight: 700; font-size: 14px; margin-right: 6px; }
.lp small { color: var(--ink-2); }
.locked-card .hero-cta { justify-content: center; }
.banner a { font-weight: 800; color: inherit; }
@media (max-width: 560px) { .locked-plans { grid-template-columns: 1fr; } }

/* status jaringan */
#net-pill { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; box-shadow: 0 6px 18px rgba(29,42,91,.2); }
#net-pill.off { background: #1d2a5b; color: #fff; }
#net-pill.sync { background: #fff3cf; color: #7a5200; }

/* popup selalu muat di layar (audit: popup profil meluber di HP) */
.modal { padding: 16px; overflow-y: auto; }
.modal-card { min-width: 0; width: min(440px, 100%); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal .seg.wrap, .modal .chips-row { flex-wrap: wrap !important; -webkit-mask-image: none !important; mask-image: none !important; overflow: visible; }
.modal .row { flex-wrap: wrap; gap: 8px; }
.modal .row.col { display: grid; }
.modal .btn { min-height: 44px; }

/* lembar per topik di daftar */
.lt-group h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: var(--s4) 0 var(--s2); }
.lt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lt-btn { border: 0; background: #f6f8fd; border-radius: 12px; padding: 10px 12px; min-height: 44px; text-align: left; font: 700 14px var(--body); color: var(--ink); cursor: pointer; }
.lt-btn:hover { background: #eef2fb; }
/* audit: ikon garis di lembar lama menimpa angka -> jadi ikon kecil di kiri, tidak menumpuk */
.ws-items li { position: relative; }
.ws-ic { position: static !important; float: left; width: 20px !important; height: 20px !important; margin: 2px 8px 0 0; opacity: .45 !important; }
@media screen and (max-width: 820px) { .sheet-view .pages, .sheet-view .lt-pages { zoom: .5; } }

/* tabel di atas latar bermotif: isi tabel berlatar putih supaya teks terbaca */
.tbl { background: #fff; border: 0 !important; box-shadow: var(--shadow-card); border-radius: 16px !important; }
.tbl table { background: #fff; }
.tbl td { background: #fff; border-top: 1px solid #edf0f6 !important; padding: 12px 10px !important; }
.tbl tbody tr:nth-child(even) td { background: #fafbfe; }
.tbl tbody tr:hover td { background: #f3f6fd; }
.tbl th { padding: 12px 10px !important; }
.kur-tbl td ul { color: var(--ink-2); }
@media (max-width: 640px) { .kur-tbl tr { background: #fff; } .kur-tbl td, .kur-tbl tbody tr:nth-child(even) td { background: transparent; } }

/* pengamatan perilaku: legenda arti angka 1-5 */
.obs-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 8px; }
.obs-lg { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 8px 6px; border-radius: 12px; background: #f6f8fd; }
.obs-lg b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px var(--ink); font-size: 14px; }
.obs-lg span { font-weight: 800; font-size: 12.5px; line-height: 1.2; color: var(--ink); }
.obs-lg small { font-size: 11.5px; line-height: 1.25; color: var(--ink-2); }
.obs-lg.n3 { background: #fff7dc; }
.obs-lg.n1, .obs-lg.n2 { background: #eef3ff; } .obs-lg.n4, .obs-lg.n5 { background: #e9f8ef; }
.obs-row { row-gap: 2px; padding: 6px 0; border-top: 1px solid #efe7d6; }
.obs-arti { grid-column: 1 / -1; margin: 0; min-height: 0; font-size: 12.5px; font-weight: 700; color: var(--potentia); text-align: center; }
.obs-arti:empty { display: none; }
@media (max-width: 560px) { .obs-legend { grid-template-columns: 1fr; } .obs-lg { grid-template-columns: 30px 1fr; justify-items: start; text-align: left; align-items: center; column-gap: 8px; } .obs-lg small { grid-column: 2; } }

/* tombol menyerah (tes) & lewati penjelasan */
.stop-btn { min-height: 44px; border: 0; border-radius: 999px; padding: 0 14px; background: #fff; color: var(--ink-2); font: 800 14px var(--body); box-shadow: 0 0 0 2px #cfd7ea; cursor: pointer; white-space: nowrap; }
.stop-btn:hover { color: #b2401f; box-shadow: 0 0 0 2px #ffb59c; }
.skip-howto { display: block; margin: 12px auto 0; color: rgba(255,255,255,.9) !important; font-weight: 800; min-height: 44px; }
.note-stop { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: #fff6dc; color: #7a5200; font-size: 14px; }

/* kode kemampuan Potentia (GC, GF, GWM, ...) tetap terlihat sebagai chip kecil */
.kode { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #eef2fb; color: var(--potentia); font: 800 11px/1.5 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }

/* NPS orang tua di halaman Hasil (app.js npsCard) */
.nps-card { position: relative; margin: 0 0 18px; padding: 18px 18px 14px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--ink); }
.nps-card h2 { margin: 0 34px 12px 0; font-family: var(--display); font-size: 19px; line-height: 1.25; }
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.nps-scale button { min-height: 44px; border: 0; border-radius: 12px; background: #eef2fb; color: var(--ink); font: 700 17px/1 var(--display); box-shadow: inset 0 0 0 2px #d5ddf0; }
.nps-scale button[aria-checked="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.nps-ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.nps-why p { margin: 14px 0 8px; font-weight: 700; }
.nps-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nps-chips button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: 600 15px var(--body); box-shadow: inset 0 0 0 2px var(--ink); }
.nps-later { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; min-height: 32px; }
.nps-done { margin: 0; font-weight: 700; }
@media (max-width: 480px) { .nps-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
