/* ═══════════════════════════════════════════════════════════════════
   ARABIC QUANTUM — Course Player (gaya bersama)
   assets/css/course-player.css

   DIPAKAI DUA HALAMAN dengan tampilan yang SAMA persis:
     • akun/kursus.php   → tampilan siswa (login)
     • public/kursus.php → tampilan publik /kursus/{slug} (tanpa login)
   Semua nilai memakai token dari tokens.css / layout.css (+ --brand dari pengaturan admin).
   Jangan menulis warna/ukuran mentah di sini — tambahkan token kalau memang perlu.
   ═══════════════════════════════════════════════════════════════════ */
  /* Warna brand: --brand & --brand-rgb TIDAK ada di tokens.css — keduanya diisi dinamis dari pengaturan
     admin lewat aq_sidebar_theme_style() (includes/helpers.php) yang dicetak customer_layout.php.
     Fallback hijau #008060 hanya cadangan; ditulis SATU kali di sini, bukan di tiap aturan. */
  .kc-top, .kc-progress, .kc-wrap, .kc-dialog { --kc-brand: var(--brand); }
  .kc-wrap { display:grid; grid-template-columns: 1fr; gap:var(--space-5-5); align-items:start; }

  .kc-outline { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); overflow:hidden; }
  /* Daftar materi = drawer (lihat blok FOCUS MODE di bawah). Tanpa focus mode ia tampil sebagai kotak biasa. */
  .kc-outline-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-5) var(--space-5-5); border-bottom:1px solid var(--border); }
  .kc-link:focus-visible { outline:3px solid var(--kc-brand); outline-offset:-3px; }
  .kc-sec-title { padding:var(--space-4) var(--space-5-5) var(--space-2); font-size: var(--text-2xs); font-weight:var(--weight-bold); text-transform:uppercase; letter-spacing:var(--tracking-wide); color: var(--text-faint); }
  .kc-stage-title { padding:var(--space-5-5) var(--space-5-5) var(--space-1); font-size: var(--text-2xs); font-weight:var(--weight-extrabold); text-transform:uppercase; letter-spacing:var(--tracking-caps); color: var(--kc-brand); overflow-wrap:anywhere; }
  .kc-stage-title small { display:block; margin-top:2px; font-size: var(--text-xs); font-weight:var(--weight-bold); text-transform:none; letter-spacing:0; color: var(--text); }
  .kc-no { color: var(--text-faint); font-weight:var(--weight-semibold); margin-right:4px; }
  .kc-link { display:flex; align-items:flex-start; gap:var(--space-3); padding:var(--space-4) var(--space-5-5); font-size: var(--text-sm); color: var(--text); text-decoration:none; border-left:3px solid transparent; }
  .kc-link:hover { background: var(--surface-alt); }
  .kc-link.is-current { background: var(--surface-alt); border-left-color: var(--kc-brand); font-weight:var(--weight-semibold); }
  .kc-link .kc-ic { flex:0 0 auto; width:16px; height:16px; margin-top:2px; color: var(--text-faint); }
  .kc-link.is-done .kc-ic { color: var(--color-success); }
  .kc-link-text { min-width:0; }
  .kc-link.is-locked { opacity:var(--opacity-disabled); cursor:not-allowed; }
  .kc-link.is-locked:hover { background:transparent; }
  .kc-link-sub { display:block; font-size: var(--text-2xs); color: var(--text-faint); font-weight:var(--weight-regular); margin-top:1px; }

  .kc-progress { margin-bottom:14px; }
  .kc-progress-top { display:flex; justify-content:space-between; font-size: var(--text-xs); color: var(--text-muted); margin-bottom:6px; }

  .kc-done { display:flex; align-items:center; gap:var(--space-5); flex-wrap:wrap; padding:var(--space-5) var(--space-5-5); margin-bottom:14px; border:1px solid var(--color-success); background: var(--color-success-bg); border-radius: var(--radius-lg); color: var(--color-success); }
  .kc-done[hidden] { display:none; }
  .kc-done-text { flex:1; min-width:200px; font-size: var(--text-sm); color: var(--text); line-height:var(--lh-base); }
  .kc-done-text strong { display:block; color: var(--color-success); font-size: var(--text-base); }
  dialog.kc-dialog { border:0; padding:0; border-radius: var(--radius-xl); max-width:var(--w-dialog-sm); width:calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
  dialog.kc-dialog::backdrop { background: var(--backdrop); }
  .kc-dialog-body { padding:28px 22px 22px; text-align:center; }
  .kc-dialog-ic { width:72px; height:72px; margin:0 auto 14px; border-radius: var(--radius-pill); display:flex; align-items:center; justify-content:center; background: var(--color-brand-tint-bg); color: var(--kc-brand); }
  .kc-dialog-ic svg { width:40px; height:40px; }
  .kc-dialog h2 { margin:0 0 8px; font-size: var(--text-xl); font-weight:var(--weight-extrabold); color: var(--text); }
  .kc-dialog p { margin:0 0 18px; font-size: var(--text-sm); color: var(--text-muted); line-height:var(--lh-base); overflow-wrap:anywhere; }
  .kc-dialog-actions { display:flex; flex-direction:column; gap:var(--space-3); }
  .kc-dialog-actions a, .kc-dialog-actions button { display:flex; align-items:center; justify-content:center; text-align:center; }
  .kc-eyebrow { font-size: var(--text-xs); color: var(--text-faint); margin-bottom:4px; }
  .kc-title { font-size: var(--text-xl); font-weight:var(--weight-bold); color: var(--text); margin:0 0 14px; }
  .kc-video { position:relative; width:100%; aspect-ratio:16/9; border-radius: var(--radius-lg); overflow:hidden; background:#000; margin-bottom:16px; }
  .kc-video iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
  .kc-content { font-size: var(--text-base); line-height:var(--lh-loose); color: var(--text); overflow-wrap:anywhere; }
  .kc-content p { margin:0 0 1em; }
  .kc-content img, .kc-content iframe, .kc-content video { max-width:100%; height:auto; border-radius: var(--radius-md); }
  .kc-content h2, .kc-content h3, .kc-content h4 { margin:1.2em 0 .5em; font-weight:var(--weight-bold); }
  .kc-content ul, .kc-content ol { padding-left:1.4em; margin:0 0 1em; }
  .kc-content table { max-width:100%; display:block; overflow-x:auto; }
  .kc-content iframe.kc-fullhtml { display:block; width:100%; border:0; background:#fff; border-radius: var(--radius-md); }
  .kc-empty { color: var(--text-muted); font-size: var(--text-sm); }

  .kc-nav { display:flex; gap:var(--space-3); flex-wrap:wrap; align-items:center; margin-top:22px; padding-top:var(--space-6); border-top:1px solid var(--border); }
  .kc-nav .kc-spacer { flex:1; }
  .kc-msg { font-size: var(--text-sm); margin-top:12px; padding:var(--space-3) var(--space-5); border-radius: var(--radius-md); display:none; }
  .kc-msg.ok { display:block; background: var(--color-success-bg); color: var(--color-success); }
  .kc-msg.err { display:block; background: var(--color-danger-bg); color: var(--color-danger); }

  /* ── Kuis (Fase 2) ── */
  .kq-instr { padding:var(--space-4) var(--space-5-5); border-radius: var(--radius-md); background: var(--surface-alt); margin-bottom:12px; font-size: var(--text-sm); color: var(--text); line-height:var(--lh-base); }
  .kq-meta { font-size: var(--text-xs); color: var(--text-muted); margin-bottom:14px; display:flex; gap:var(--space-5-5); flex-wrap:wrap; }
  .kq-banner { font-size: var(--text-sm); padding:var(--space-3) var(--space-5); border-radius: var(--radius-md); margin-bottom:14px; }
  .kq-banner.ok { background: var(--color-success-bg); color: var(--color-success); }
  .kq-banner.err { background: var(--color-danger-bg); color: var(--color-danger); }
  .kq-q { border:1px solid var(--border); border-radius: var(--radius-lg); padding:var(--space-5-5); margin-bottom:12px; }
  .kq-q.is-ok { border-color: var(--color-success); }
  .kq-q.is-bad { border-color: var(--color-danger); }
  .kq-q.is-part { border-color: var(--color-warning); }
  .kq-qhead { display:flex; gap:var(--space-4); align-items:flex-start; margin-bottom:10px; }
  .kq-qtext { flex:1; min-width:0; font-size: var(--text-base); font-weight:var(--weight-semibold); line-height:var(--lh-base); color: var(--text); overflow-wrap:anywhere; }
  .kq-opt { display:flex; align-items:flex-start; gap:var(--space-4); padding:var(--space-4) var(--space-5); border:1px solid var(--border); border-radius: var(--radius-md); margin-bottom:8px; cursor:pointer; font-size: var(--text-sm); color: var(--text); line-height:var(--lh-base); }
  .kq-opt:hover { background: var(--surface-alt); }
  .kq-opt input { margin-top:3px; flex:0 0 auto; }
  .kq-opt span { min-width:0; overflow-wrap:anywhere; }
  .kq-opt.is-correct { border-color: var(--color-success); background: var(--color-success-bg); }
  .kq-opt.is-wrong { border-color: var(--color-danger); background: var(--color-danger-bg); }
  .kq-tf { display:flex; gap:var(--space-4); flex-wrap:wrap; }
  .kq-tf .kq-opt { flex:1; min-width:120px; margin-bottom:0; font-weight:var(--weight-semibold); }
  .kq-img { display:block; max-width:100%; max-height:280px; margin:0 auto 14px; object-fit:contain; border-radius: var(--radius-md); background: var(--surface-alt); }
  .kq-audio { margin:0 0 14px; }
  .kq-audio audio { width:100%; }
  .kq-fill { width:100%; box-sizing:border-box; padding:var(--space-5-5) var(--space-6); border:2px solid var(--border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text); font-size: var(--text-lg); font-family:inherit; line-height:var(--lh-base); }
  .kq-fill:focus { border-color: var(--kc-brand); outline:none; }
  .kq-fill:focus-visible { outline:3px solid var(--kc-brand); outline-offset:2px; }
  .kq-fill.is-correct { border-color: var(--color-success); }
  .kq-fill.is-wrong { border-color: var(--color-danger); }
  .kq-fill:disabled { opacity:1; }
  .kq-qtext:focus { outline:none; }
  .kq-resume { margin:0 0 12px; padding:var(--space-4) var(--space-5-5); border-radius: var(--radius-md); background: var(--color-info-soft-bg); border:1px solid var(--color-info-soft-border); font-size: var(--text-sm); color: var(--text); line-height:var(--lh-base); text-align:left; }
  .kq-restart { margin-top:10px; }
  .kq-fb { margin-top:10px; font-size: var(--text-sm); line-height:var(--lh-base); color: var(--text); }
  .kq-fb-title { font-weight:var(--weight-bold); }
  .kq-fb.ok .kq-fb-title { color: var(--color-success); }
  .kq-fb.bad .kq-fb-title { color: var(--color-danger); }
  .kq-fb.part .kq-fb-title { color: var(--color-warning); }
  .kq-fb-line { margin-top:3px; overflow-wrap:anywhere; }
  .kq-expl { margin-top:6px; color: var(--text-muted); white-space: pre-line; }
  .kq-result { text-align:center; padding:var(--space-6-5) var(--space-5-5); border-radius: var(--radius-lg); margin:0 0 16px; }
  .kq-result.ok { background: var(--color-success-bg); }
  .kq-result.bad { background: var(--color-danger-bg); }
  .kq-score { font-size: var(--text-3xl); font-weight:var(--weight-extrabold); line-height:var(--lh-none); color: var(--text); }
  .kq-verdict { font-size: var(--text-base); font-weight:var(--weight-bold); margin-top:4px; }
  .kq-result.ok .kq-verdict { color: var(--color-success); }
  .kq-result.bad .kq-verdict { color: var(--color-danger); }
  .kq-detail { font-size: var(--text-xs); color: var(--text-muted); margin-top:6px; }
  .kq-result .btn-secondary, .kq-result .btn-primary { margin-top:12px; }

  /* ── Mencocokkan: dua kolom kartu (ketuk 2 kartu / seret kartu ke kartu seberangnya) ── */
  .kq-mx { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--space-5); direction:ltr; }
  .kq-mx-col { display:flex; flex-direction:column; gap:var(--space-4); min-width:0; }
  .kq-mc { --pc: var(--kc-brand); position:relative; display:flex; align-items:center; justify-content:center; gap:var(--space-3); width:100%; min-height:60px; padding:var(--space-5) var(--space-5-5); box-sizing:border-box;
    border:2px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font:inherit; font-size: var(--text-base); font-weight:var(--weight-semibold); line-height:var(--lh-snug); text-align:center;
    cursor:pointer; box-shadow:0 2px 0 var(--border); overflow-wrap:anywhere;
    touch-action: pan-y; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent;
    transition: transform var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast); }
  .kq-mc-t { min-width:0; }
  .kq-mc:hover:not(:disabled) { background: var(--surface-alt); }
  .kq-mc:active:not(:disabled) { transform: translateY(2px); box-shadow:none; }
  .kq-mc:focus-visible { outline:3px solid var(--kc-brand); outline-offset:2px; }
  .kq-mc:disabled { opacity:1; cursor:default; transform:none; }
  .kq-mc.is-sel { border-color: var(--kc-brand); background: var(--color-success-bg); box-shadow:0 2px 0 var(--kc-brand), 0 0 0 4px rgba(var(--brand-rgb), .18); }
  .kq-mc-n { display:none; flex:0 0 auto; width:22px; height:22px; border-radius: var(--radius-pill); background: var(--pc); color:var(--color-on-solid); font-size: var(--text-2xs); font-weight:var(--weight-extrabold); align-items:center; justify-content:center; }
  .kq-mc[data-pn] { border-color: var(--pc); box-shadow:0 2px 0 var(--pc); }
  .kq-mc[data-pn] .kq-mc-n { display:inline-flex; }
  .kq-mc[data-c="2"] { --pc:#1c7ed6; } .kq-mc[data-c="3"] { --pc:#e8590c; } .kq-mc[data-c="4"] { --pc:#9c36b5; }
  .kq-mc[data-c="5"] { --pc:#d6336c; } .kq-mc[data-c="6"] { --pc:#0c8599; } .kq-mc[data-c="7"] { --pc:#5c940d; } .kq-mc[data-c="8"] { --pc:#c2255c; }
  @supports (background: color-mix(in srgb, red, blue)) {
    .kq-mc[data-pn] { background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }
    .kq-mc.is-sel { background: color-mix(in srgb, var(--kc-brand) 12%, var(--surface)); }
  }
  .kq-mc.is-dragging { opacity:var(--opacity-disabled); }
  .kq-mc.is-target { border-color: var(--kc-brand); transform: scale(1.03); box-shadow:0 0 0 4px rgba(var(--brand-rgb), .22); }
  .kq-mc-ghost { position:fixed; z-index:var(--z-drag); margin:0; pointer-events:none; opacity:.96; transform: translate(-50%, -50%) scale(1.04); box-shadow: var(--shadow-lg); background: var(--surface); border-color: var(--kc-brand); }
  .kq-mc.is-correct, .kq-mc[data-pn].is-correct { border-color: var(--color-success); background: var(--color-success-bg); box-shadow:0 2px 0 var(--color-success); }
  .kq-mc.is-wrong, .kq-mc[data-pn].is-wrong { border-color: var(--color-danger); background: var(--color-danger-bg); box-shadow:0 2px 0 var(--color-danger); }
  .kq-mc.is-correct .kq-mc-n { background: var(--color-success); }
  .kq-mc.is-wrong .kq-mc-n { background: var(--color-danger); }
  @media (max-width: 380px) { .kq-mx { gap:var(--space-3); } .kq-mc { padding:var(--space-4) var(--space-3); font-size: var(--text-sm); } }
  @media (prefers-reduced-motion: reduce) { .kq-mc { transition:none; } .kq-mc.is-target { transform:none; } }

  /* ── Mengurutkan kata (ketuk potongan) & kalimat (tombol naik/turun) ── */
  .kq-sort-hint { font-size: var(--text-sm); color: var(--text-muted); margin:0 0 10px; line-height:var(--lh-base); }
  .kq-sort-ans { display:flex; flex-wrap:wrap; gap:var(--space-3); align-content:flex-start; min-height:68px; padding:var(--space-4); margin-bottom:14px; border:2px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
  .kq-sort-ans:empty::before { content: attr(data-empty); align-self:center; color: var(--text-faint); font-size: var(--text-sm); }
  .kq-sort-ans.is-correct { border-style:solid; border-color: var(--color-success); }
  .kq-sort-ans.is-wrong { border-style:solid; border-color: var(--color-danger); }
  .kq-sort-bank { display:flex; flex-wrap:wrap; gap:var(--space-3); }
  .kq-chip { max-width:100%; padding:var(--space-4) var(--space-5-5); border:2px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); color: var(--text); font:inherit; font-size: var(--text-base); line-height:var(--lh-snug); cursor:pointer; box-shadow:0 2px 0 var(--border); overflow-wrap:anywhere; transition: transform var(--dur-fast), background var(--dur-fast); }
  .kq-chip:hover { background: var(--surface-alt); }
  .kq-chip:active { transform: translateY(2px); box-shadow:none; }
  .kq-chip:focus-visible { outline:3px solid var(--kc-brand); outline-offset:2px; }
  .kq-sort-ans .kq-chip { border-color: var(--kc-brand); }
  .kq-chip.is-ghost { visibility:hidden; pointer-events:none; }
  .kq-chip:disabled { cursor:default; opacity:1; transform:none; }
  .kq-slist { list-style:none; margin:0; padding:0; counter-reset: kqs; }
  .kq-sitem { counter-increment: kqs; display:flex; align-items:center; gap:var(--space-4); padding:var(--space-4) var(--space-5); margin-bottom:8px; border:2px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow:0 2px 0 var(--border); }
  .kq-sitem::before { content: counter(kqs); flex:0 0 auto; width:26px; height:26px; display:flex; align-items:center; justify-content:center; border-radius: var(--radius-pill); background: var(--surface-alt); color: var(--text-muted); font-size: var(--text-xs); font-weight:var(--weight-bold); }
  .kq-sitem.is-correct { border-color: var(--color-success); }
  .kq-sitem.is-wrong { border-color: var(--color-danger); }
  .kq-stext { flex:1; min-width:0; font-size: var(--text-base); line-height:var(--lh-base); color: var(--text); overflow-wrap:anywhere; }
  .kq-sbtns { flex:0 0 auto; display:flex; flex-direction:column; gap:var(--space-1); }
  @media (min-width: 560px) { .kq-sbtns { flex-direction:row; } }
  #kqForm:not(.is-step) .kq-sort-bank, #kqForm:not(.is-step) .kq-sort-hint, #kqForm:not(.is-step) .kq-sbtns { display:none; }
  @media (prefers-reduced-motion: reduce) { .kq-chip { transition:none; } }

  /* ── Kuis mode satu-soal-per-halaman (gaya Duolingo) ── */
  .kq-intro { text-align:center; padding:var(--space-3) 0 var(--space-1); }
  .kq-intro .kq-meta { justify-content:center; }
  .kq-intro .kq-instr { text-align:left; }
  .kq-start { min-width:220px; }
  .kq-top { display:flex; align-items:center; gap:var(--space-5); margin-bottom:18px; }
  .kq-top-bar { flex:1; }
  .kq-top-count { font-size: var(--text-xs); font-weight:var(--weight-bold); color: var(--text-muted); min-width:44px; text-align:right; }
  #kqForm.is-step .kq-q { display:none; border:0; padding:0; margin:0; animation: kqIn var(--dur-slow) ease; }
  #kqForm.is-step .kq-q.is-active { display:block; }
  #kqForm.is-step .kq-qhead { margin-bottom:18px; }
  #kqForm.is-step .aq-num { display:none; }
  #kqForm.is-step .kq-qtext { font-size: var(--text-xl); font-weight:var(--weight-bold); line-height:var(--lh-base); }
  #kqForm.is-step .kq-opt { padding:var(--space-5-5) var(--space-6); border-width:2px; border-radius: var(--radius-md); font-size: var(--text-base); margin-bottom:10px; box-shadow:0 2px 0 var(--border); transition: transform var(--dur-fast), background var(--dur-fast); }
  #kqForm.is-step .kq-opt:active { transform: translateY(2px); box-shadow:none; }
  /* Radio asli disembunyikan secara visual tapi TETAP bisa difokus keyboard & dibaca pembaca layar.
     Statusnya digambar ulang lewat .kq-opt::before (lingkaran) supaya pilihan tidak hanya dibedakan warna. */
  #kqForm.is-step .kq-opt input { position:absolute; opacity:0; width:1px; height:1px; margin:0; pointer-events:none; }
  #kqForm.is-step .kq-opt { position:relative; align-items:center; }
  #kqForm.is-step .kq-opt::before { content:''; flex:0 0 auto; width:20px; height:20px; box-sizing:border-box; border-radius: var(--radius-pill); border:2px solid var(--border-strong); background: var(--surface); transition: border-color var(--dur-fast), background var(--dur-fast); }
  #kqForm.is-step .kq-opt.is-picked::before { border-color: var(--kc-brand); background: var(--kc-brand); box-shadow: inset 0 0 0 3px var(--surface); }
  /* Cincin fokus HANYA untuk navigasi keyboard (focus-visible) — klik mouse/sentuh tidak memunculkannya. */
  #kqForm.is-step .kq-opt:has(input:focus-visible) { outline:3px solid var(--kc-brand); outline-offset:2px; }
  @supports not selector(:has(*)) { #kqForm.is-step .kq-opt:focus-within { outline:3px solid var(--kc-brand); outline-offset:2px; } }
  @media (forced-colors: active) {
    #kqForm.is-step .kq-opt:has(input:focus-visible) { outline:3px solid Highlight; }
    #kqForm.is-step .kq-opt.is-picked { border-color: Highlight; }
  }
  /* Pilihan ganda gaya Typeform: huruf a/b/c/d dalam kotak sudut membulat, menggantikan lingkaran radio.
     Hanya aktif di mode step; di luar itu radio asli tetap tampil. */
  .kq-letter { display:none; }
  #kqForm.is-step .kq-opt.kq-ltr::before { display:none; }
  #kqForm.is-step .kq-letter { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; width:32px; height:32px; box-sizing:border-box; margin:-2px 0; border:2px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-extrabold); line-height:1; text-transform:lowercase; transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast); }
  #kqForm.is-step .kq-opt.is-picked .kq-letter { border-color: var(--kc-brand); background: var(--kc-brand); color: var(--color-on-solid); }
  #kqForm.is-step .kq-opt.is-correct .kq-letter { border-color: var(--color-success); background: var(--color-success); color: var(--color-on-solid); }
  #kqForm.is-step .kq-opt.is-wrong .kq-letter { border-color: var(--color-danger); background: var(--color-danger); color: var(--color-on-solid); }
  #kqForm.is-step .kq-tf .kq-opt.kq-ltr { justify-content:flex-start; text-align:start; }
  @media (prefers-reduced-motion: reduce) { #kqForm.is-step .kq-letter { transition:none; } }
  .kq-hidenote { font-size: var(--text-sm); color: var(--text-muted); margin:10px 0 0; line-height:var(--lh-base); }
  #kqForm.is-step .kq-opt.is-picked { border-color: var(--kc-brand); background: var(--color-success-bg); box-shadow:0 2px 0 var(--kc-brand); font-weight:var(--weight-bold); }
  @supports (background: color-mix(in srgb, red, blue)) { #kqForm.is-step .kq-opt.is-picked { background: color-mix(in srgb, var(--kc-brand) 12%, var(--surface)); } }
  #kqForm.is-step .kq-tf .kq-opt { justify-content:center; text-align:center; }
  .kq-foot { display:none; position:sticky; bottom:0; margin:22px -16px -16px; padding:var(--space-5-5) var(--space-6); background: var(--surface); border-top:2px solid var(--border); gap:var(--space-4); align-items:center; }
  #kqForm.is-step .kq-foot { display:flex; }
  .kq-foot .kq-spacer { flex:1; }
  .kq-foot .btn-primary { min-width:140px; }
  #kqForm.is-step .kq-top { display:flex; } #kqForm:not(.is-step) .kq-top { display:none; }
  .kq-card-quizing .kc-nav { display:none; }
  @keyframes kqIn { from { opacity:0; transform: translateX(18px); } to { opacity:1; transform:none; } }
  @media (prefers-reduced-motion: reduce) { #kqForm.is-step .kq-q { animation:none; } #kqForm.is-step .kq-opt::before { transition:none; } }

  /* ═══════════════════════════════════════════════════════════════════
     FOCUS MODE (gaya Duolingo) — hanya aktif di bawah body.kc-focus.
     Sidebar/topbar/menu bawah disembunyikan; konten satu kolom ≤ 680px;
     bar atas (tombol silang + progres tebal + Daftar) & bar aksi bawah menempel (fixed).
     Susunan z-index: bar atas/aksi 40 · toast pesan 45 · drawer 54/55 ·
     modal konfirmasi 60 (layout.css) · bar pratinjau admin 60.
     ═══════════════════════════════════════════════════════════════════ */
  .kc-top, .kc-drawer-ov { display:none; }
  body.kc-focus { --kc-gutter: max(16px, calc((100vw - 648px) / 2)); background: var(--surface); }
  body.kc-focus #sidebar, body.kc-focus #sidebarOverlay, body.kc-focus #topbar,
  body.kc-focus #aqBottomNav, body.kc-focus .page-header { display:none !important; }
  body.kc-focus #main-wrapper { justify-content:center; }
  body.kc-focus #main-wrapper main { margin:0; width:100%; max-width:680px; flex:1 1 680px; box-sizing:border-box; transition:none;
    padding: calc(88px + env(safe-area-inset-top, 0px)) var(--space-6) calc(150px + env(safe-area-inset-bottom, 0px)); }
  body.kc-focus .kc-wrap { display:block; }

  /* Bar atas */
  body.kc-focus .kc-top { display:flex; position:fixed; top:0; left:0; right:0; z-index:var(--z-popover); align-items:center; gap:var(--space-4);
    height: calc(64px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--kc-gutter) 0; background: var(--surface); }
  .kc-x svg, .kc-menu svg { width:24px; height:24px; display:block; }
  .kc-top-prog { flex:1; min-width:0; }
  .kc-top .aq-progress { height:16px; }
  .kc-top .aq-progress > span { position:relative; min-width:0; }
  .kc-top .aq-progress > span::after { content:''; position:absolute; left:8px; right:8px; top:4px; height:4px; border-radius: var(--radius-pill); background: rgba(255,255,255,.35); }
  .kc-top-pct { flex:0 0 auto; min-width:42px; text-align:right; font-size: var(--text-xs); font-weight:var(--weight-extrabold); color: var(--text-muted); }

  /* Konten: tanpa kartu, huruf lebih lega */
  body.kc-focus #kcCard { background:transparent; border:0; box-shadow:none; }
  body.kc-focus #kcCard .aq-card-body { padding:0; }
  body.kc-focus .kc-eyebrow { text-transform:uppercase; letter-spacing:var(--tracking-caps); font-weight:var(--weight-extrabold); font-size: var(--text-xs); color: var(--kc-brand); margin-bottom:6px; }
  body.kc-focus .kc-title { font-size: clamp(1.4rem, 4.6vw, 1.85rem); font-weight:var(--weight-extrabold); line-height:var(--lh-tight); margin-bottom:20px; }
  body.kc-focus .kc-content { font-size:1.0625rem; line-height:var(--lh-loose); }
  body.kc-focus .kc-video { border-radius: var(--radius-xl); }
  body.kc-focus .kc-done { border-radius: var(--radius-xl); }
  body.kc-focus #kqForm { scroll-margin-top:80px; }
  body.kc-focus .kq-top { display:none !important; }   /* progres kuis pindah ke bar atas */
  /* Saat mengerjakan kuis: hanya soal — judul & banner disembunyikan (seperti Duolingo) */
  body.kc-quizzing .kc-eyebrow, body.kc-quizzing .kc-title, body.kc-quizzing .kc-done { display:none; }
  body.kc-focus .kq-intro { padding-top:var(--space-5); }
  body.kc-focus .kq-intro .kq-instr { border-radius: var(--radius-lg); }

  /* Bar aksi bawah (Sebelumnya / Selesai & Lanjut) & footer kuis (Kembali / Lanjut) */
  body.kc-focus .kc-nav, body.kc-focus .kq-foot { position:fixed; left:0; right:0; bottom:0; z-index:var(--z-popover); margin:0; flex-wrap:nowrap; gap:var(--space-4); align-items:center;
    padding: var(--space-5-5) var(--kc-gutter) calc(var(--space-5-5) + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top:2px solid var(--border); }
  body.kc-focus .kc-nav .kc-spacer, body.kc-focus .kq-foot .kq-spacer { display:none; }
  body.kc-focus .kc-nav .btn-primary, body.kc-focus .kc-nav #kcDoneBtn, body.kc-focus .kq-foot .btn-primary { flex:1 1 auto; min-width:0; }
  body.kc-focus .kc-nav .kc-prev, body.kc-focus .kq-foot .btn-secondary { flex:0 0 auto; }
  body.kc-focus #kcLockedNext { flex:1 1 auto; cursor:not-allowed; }
  body.kc-focus .kq-start { width:100%; max-width:360px; }
  body.kc-focus .kq-result .btn-primary, body.kc-focus .kq-result .btn-secondary { margin:12px 4px 4px; }
  body.kc-focus .kq-result { border-radius: var(--radius-xl); }
  @media (max-width: 420px) {
    .kc-btn-label { display:none; }
    /* Tombol Kembali (hanya ikon) menjadi lingkaran sempurna */
    body.kc-focus .kq-foot #kqPrev { width:52px; height:52px; min-height:52px; padding:0; border-radius:var(--radius-pill); flex:0 0 52px; }
  }

  /* Pesan singkat (tersimpan / gagal) & toast: mengambang di atas bar aksi */
  body.kc-focus .kc-msg { position:fixed; left:50%; transform:translateX(-50%); bottom: calc(108px + env(safe-area-inset-bottom, 0px)); z-index:var(--z-bottomnav);
    width:calc(100% - 32px); max-width:560px; margin:0; text-align:center; font-weight:var(--weight-bold); box-shadow: var(--shadow-lg); }
  body.kc-focus .aq-toast-host { bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
  /* Bar \"Pratinjau Admin\" pindah ke bawah bar atas (bawah layar sudah dipakai bar aksi) */
  body.kc-focus #aqImpersonateBar:not(.aq-preview-strip) { top: calc(68px + env(safe-area-inset-top, 0px)); bottom:auto; }

  /* Drawer Daftar Materi */
  body.kc-focus .kc-drawer-ov { display:block; position:fixed; inset:0; z-index:54; background: var(--backdrop); opacity:0; visibility:hidden; transition: opacity var(--dur-base), visibility var(--dur-base); }
  body.kc-focus .kc-drawer-ov.is-open { opacity:1; visibility:visible; }
  body.kc-focus .kc-outline { position:fixed; top:0; bottom:0; left:0; z-index:var(--z-backdrop); width:min(340px, 88vw); border:0; border-radius:0 var(--radius-xl) var(--radius-xl) 0;
    box-shadow: var(--shadow-lg); overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; outline:none;
    transform: translateX(-100%); visibility:hidden; transition: transform var(--dur-slow) var(--ease-sheet), visibility 0s linear var(--dur-slow); }
  body.kc-focus .kc-outline.is-open { transform:none; visibility:visible; transition-delay:0s; }
  body.kc-focus .kc-outline-head { position:sticky; top:0; z-index:1; background: var(--surface); padding-top: calc(var(--space-5) + env(safe-area-inset-top, 0px)); }
  .kc-outline-title { min-width:0; font-weight:var(--weight-extrabold); font-size: var(--text-base); color: var(--text); }
  .kc-outline-title small { display:block; font-size: var(--text-xs); font-weight:var(--weight-medium); color: var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.kc-focus .kc-link { padding:var(--space-5) var(--space-6); }
  @media (prefers-reduced-motion: reduce) {
    body.kc-focus .kc-outline, body.kc-focus .kc-drawer-ov { transition:none; }
    body.kc-focus .kc-nav .btn-primary, body.kc-focus .kc-nav .btn-secondary, body.kc-focus .kq-start { transition:none; }
  }

/* ── Ringkasan kursus (hero, tahap, section) ── */
  .ko-card { --ko-brand: var(--brand); margin-bottom:14px; }
  .ko-ring { flex:0 0 auto; width:84px; height:84px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:var(--weight-extrabold); font-size: var(--text-lg); color: var(--text);
    background: conic-gradient(var(--ko-brand) calc(var(--p) * 1%), var(--border) 0); position:relative; }
  .ko-ring::before { content:''; position:absolute; inset:8px; border-radius:50%; background: var(--surface); }
  .ko-ring span { position:relative; }
  .ko-prog-text { font-size: var(--text-sm); color: var(--text-muted); margin-bottom:10px; }
  .ko-cta { display:flex; flex-direction:column; align-items:stretch; gap:var(--space-2); }
  .ko-cta .btn-primary { width:100%; justify-content:center; padding:var(--space-5-5) var(--space-6-5); font-size: var(--text-base); font-weight:var(--weight-bold); }
  /* ── Hero kursus: pita gelap + kartu aksi (progres & CTA) ── */
  .kh { --ko-brand: var(--brand); display:grid; grid-template-columns:minmax(0,1fr); margin-bottom:14px; }
  .kh-hero { background:#1c1d24; color:var(--color-on-solid); border-radius: var(--radius-xl); padding:var(--space-5-5) var(--space-6-5) 40px; }
  [data-theme="dark"] .kh-hero { background:#0c0d11; }
  /* Dekorasi SVG di kartu gelap: cincin parsial (kanan atas) & cincin + titik (kiri bawah) */
  .kh-hero { position:relative; overflow:hidden; isolation:isolate; }
  .kh-hero::before, .kh-hero::after { content:''; position:absolute; pointer-events:none; z-index:0; background:no-repeat center / contain; }
  .kh-hero::before { top:-70px; right:-80px; width:260px; height:260px; background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><circle cx='100' cy='100' r='82' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='16'/><path d='M100 18 A82 82 0 0 1 182 100' fill='none' stroke='%238b93ff' stroke-opacity='.55' stroke-width='16' stroke-linecap='round'/><circle cx='100' cy='100' r='52' fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='10'/></svg>"); }
  .kh-hero::after { bottom:-44px; left:-36px; width:150px; height:150px; background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'><path d='M20 120 A60 60 0 0 1 120 30' fill='none' stroke='%23f59e0b' stroke-opacity='.5' stroke-width='12' stroke-linecap='round'/><circle cx='132' cy='132' r='6' fill='%23ffffff' fill-opacity='.18'/><circle cx='146' cy='112' r='3.5' fill='%23ffffff' fill-opacity='.14'/><circle cx='112' cy='146' r='3.5' fill='%23ffffff' fill-opacity='.14'/></svg>"); }
  .kh-hero > * { position:relative; z-index:1; }
  .kh-back { display:inline-flex; align-items:center; gap:var(--space-2); min-height:var(--ctl-h-lg); color:#c9ccf5; text-decoration:none; font-size: var(--text-sm); font-weight:var(--weight-semibold); }
  .kh-back:hover { color:var(--color-on-solid); }
  .kh-crumb { margin-top:4px; font-size: var(--text-sm); color:#aeb2d8; }
  .kh-lvl { display:inline-block; margin-top:10px; padding:var(--space-0) var(--space-4); border-radius: var(--radius-pill); background:#2b3270; color:#cfd6ff; font-size: var(--text-xs); font-weight:var(--weight-bold); }
  .kh-title { margin:8px 0 0; font-size: var(--text-2xl); line-height:var(--lh-tight); letter-spacing:var(--tracking-tight); font-weight:var(--weight-extrabold); overflow-wrap:anywhere; }
  .kh-desc { margin:10px 0 0; max-width:62ch; font-size: var(--text-md); line-height:var(--lh-base); color:#d6d8ec; overflow-wrap:anywhere; }
  .kh-meta { display:flex; flex-wrap:wrap; gap:var(--space-2) var(--space-6-5); margin-top:16px; font-size: var(--text-sm); color:#d6d8ec; }
  .kh-meta span { display:inline-flex; align-items:center; gap:var(--space-2); }
  .kh-meta .aq-icon { width:var(--icon-md); height:var(--icon-md); }
  .kh-card { position:relative; z-index:1; margin:-16px 12px 0; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding:var(--space-6); }
  .kh-prog { display:flex; align-items:center; gap:var(--space-5-5); }
  .kh-prog .ko-ring { width:64px; height:64px; font-size: var(--text-base); }
  .kh-prog .ko-ring::before { inset:7px; }
  .kh-prog .ko-prog-text { margin:0; font-size: var(--text-base); color: var(--text); }
  .kh-next { margin-top:2px; font-size: var(--text-sm); color: var(--text-muted); overflow-wrap:anywhere; }
  .kh-card .ko-cta { margin-top:14px; }
  .kh-card .ko-cta .btn-primary { gap:var(--space-3); }
  @media (min-width: 880px) {
    .kh-hero { grid-area:1 / 1; padding:var(--space-8) 28px 32px; padding-right:392px; }
    .kh-card { grid-area:1 / 1; justify-self:end; align-self:center; width:320px; margin:0 28px 0 0; }
  }
  .ko-sec { overflow:hidden; }
  .ko-stage { border-left:4px solid var(--ko-brand); margin-top:22px; }
  .ko-stg-top { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-3); margin-bottom:6px; }
  .ko-stg-no { font-size: var(--text-2xs); font-weight:var(--weight-extrabold); letter-spacing:var(--tracking-caps); text-transform:uppercase; color: var(--ko-brand); }
  .ko-lvl { font-size: var(--text-2xs); font-weight:var(--weight-extrabold); padding:var(--space-0) var(--space-4); border-radius: var(--radius-pill); background: var(--ko-brand); color:var(--color-on-solid); }
  .ko-stg-prog { margin-left:auto; font-size: var(--text-xs); color: var(--text-muted); white-space:nowrap; }
  .ko-stg-title { font-size: var(--text-lg); font-weight:var(--weight-extrabold); color: var(--text); overflow-wrap:anywhere; }
  .ko-stg-bar { height:6px; border-radius: var(--radius-pill); background: var(--border); overflow:hidden; margin-top:10px; }
  .ko-stg-bar span { display:block; height:100%; border-radius: var(--radius-pill); background: var(--ko-brand); }
  .ko-stg-obj { margin-top:12px; font-size: var(--text-sm); line-height:var(--lh-base); color: var(--text-muted); overflow-wrap:anywhere; }
  .ko-stg-obj strong { display:block; margin-bottom:2px; color: var(--text); }
  .ko-sec-name { display:flex; align-items:center; gap:var(--space-4); min-width:0; }
  .ko-sec-name > span:last-child { overflow-wrap:anywhere; }
  .ko-secno { flex:0 0 auto; min-width:26px; height:26px; padding:0 var(--space-3); box-sizing:border-box; border-radius: var(--radius-pill); display:grid; place-items:center; font-size: var(--text-xs); font-weight:var(--weight-extrabold); background: var(--surface-alt); color: var(--ko-brand); }
  .ko-sec-desc { padding:0 var(--space-6) var(--space-5); font-size: var(--text-sm); line-height:var(--lh-base); color: var(--text-muted); overflow-wrap:anywhere; }
  .ko-loose-h { margin:22px 2px 10px; font-size: var(--text-sm); font-weight:var(--weight-bold); color: var(--text-muted); }
  .ko-sec > summary { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); padding:var(--space-5-5) var(--space-6); font-weight:var(--weight-bold); color: var(--text); }
  .ko-sec > summary::-webkit-details-marker { display:none; }
  .ko-sec > summary:focus-visible { outline:3px solid var(--ko-brand); outline-offset:-3px; }
  .ko-sec-meta { font-size: var(--text-xs); font-weight:var(--weight-medium); color: var(--text-faint); white-space:nowrap; }
  .ko-sec-meta::after { content:'\25BE'; margin-left:8px; display:inline-block; transition: transform var(--dur-fast); }
  .ko-sec:not([open]) .ko-sec-meta::after { transform: rotate(-90deg); }
  .ko-item { display:flex; align-items:center; gap:var(--space-5); padding:var(--space-5) var(--space-6); border-top:1px solid var(--border); color: var(--text); text-decoration:none; font-size: var(--text-sm); }
  a.ko-item:hover { background: var(--surface-alt); }
  a.ko-item:focus-visible { outline:3px solid var(--ko-brand); outline-offset:-3px; }
  .ko-item.is-locked { opacity:var(--opacity-disabled); cursor:not-allowed; }
  .ko-ic { flex:0 0 auto; width:20px; height:20px; color: var(--text-faint); }
  .ko-item.is-done .ko-ic { color: var(--color-success); }
  .ko-item.is-next { background: var(--surface-alt); }
  .ko-item.is-next .ko-ic { color: var(--ko-brand); }
  .ko-item-text { flex:1; min-width:0; overflow-wrap:anywhere; font-weight:var(--weight-semibold); }
  .ko-item-sub { display:block; font-size: var(--text-xs); font-weight:var(--weight-regular); color: var(--text-faint); margin-top:2px; }
  .ko-badge { flex:0 0 auto; font-size: var(--text-2xs); font-weight:var(--weight-bold); padding:var(--space-1) var(--space-4); border-radius: var(--radius-pill); background: var(--ko-brand); color:var(--color-on-solid); }

/* ═══════════════════════════════════════════════════════════════════
   HALAMAN PUBLIK (public/kursus.php, body.kc-public) — pengunjung tanpa login.
   Tampilan = tampilan siswa; bedanya: tanpa menu bawah, diganti CTA menempel.
   ═══════════════════════════════════════════════════════════════════ */
.topbar-logout.is-neutral:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
html body.kc-public main { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

/* CTA menempel di bawah (pengganti menu bawah) — halaman ringkasan */
.kc-cta { position:fixed; left:0; right:0; bottom:0; z-index:var(--z-bottomnav); background: var(--surface); border-top:2px solid var(--border);
  padding: var(--space-5-5) var(--space-6) calc(var(--space-5-5) + env(safe-area-inset-bottom, 0px)); }
.kc-cta-in { max-width:960px; margin:0 auto; display:flex; align-items:center; gap:var(--space-5); }
.kc-cta-text { flex:1 1 auto; min-width:0; font-size: var(--text-xs); line-height:var(--lh-snug); color: var(--text-muted); }
.kc-cta-text strong { display:block; font-size: var(--text-sm); font-weight:var(--weight-bold); color: var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kc-cta .btn-primary { flex:0 0 auto; min-height:52px; padding:0 22px; border-radius: var(--radius-btn); border-width:2px; font-size: var(--text-sm); font-weight:var(--weight-extrabold);
  letter-spacing:var(--tracking-wide); text-transform:uppercase; display:inline-flex; align-items:center; justify-content:center; text-align:center; text-decoration:none; line-height:var(--lh-tight);
  box-shadow:0 4px 0 var(--brand-hover); margin-bottom:4px; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.kc-cta .btn-primary:active { transform: translateY(4px); box-shadow:none; }
@media (max-width: 420px) { .kc-cta-text .kc-cta-sub { display:none; } .kc-cta .btn-primary { padding:0 var(--space-5-5); letter-spacing:var(--tracking-wide); } }
@media (prefers-reduced-motion: reduce) { .kc-cta .btn-primary { transition:none; } }

/* Daftar materi: item terkunci tetap bisa diketuk (menuju checkout) */
.ko-item.is-gated { color: var(--text-muted); }
.ko-item.is-gated .ko-ic { color: var(--text-faint); }
.ko-badge.is-muted { background:transparent; color: var(--text-faint); border:1px solid var(--border); font-weight:var(--weight-semibold); }
a.kc-link.is-locked { cursor:pointer; }
a.kc-link.is-locked:hover { background: var(--surface-alt); }

/* Bar atas pemutar publik: judul kursus menggantikan progres kursus */
.kc-top-title { min-width:0; font-size: var(--text-sm); font-weight:var(--weight-bold); color: var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Bar aksi bawah pemutar publik: [Sebelumnya] [CTA] [Berikutnya] */
body.kc-focus .kc-nav .kc-next { flex:0 0 auto; }
.kh-card .ko-cta .btn-secondary { width:100%; justify-content:center; gap:var(--space-3); padding:var(--space-5-5) var(--space-6-5); font-size: var(--text-base); font-weight:var(--weight-bold); }

/* ═══════════════════════════════════════════════════════════════════
   DESKTOP (≥1024px): daftar materi tampil tetap di kolom kiri, materi di kanan.
   Di bawah 1024px tetap memakai drawer (lihat blok FOCUS MODE di atas).
   Saat menjawab soal (body.kc-quizzing) layout kembali satu kolom agar fokus pada soal.
   Lebar kolom kiri 300px + jarak 24px = 324px; bar bawah (aksi/footer kuis)
   dimulai dari kolom kanan supaya tidak menimpa daftar materi.
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  body.kc-focus:not(.kc-quizzing) { --kc-gutter: max(16px, calc((100vw - 1080px) / 2 + 24px)); }
  body.kc-focus:not(.kc-quizzing) #main-wrapper main { max-width:1080px; }
  body.kc-focus:not(.kc-quizzing) .kc-wrap { display:grid; grid-template-columns: 300px minmax(0,1fr); gap: var(--space-6); align-items:start; }
  body.kc-focus:not(.kc-quizzing) .kc-drawer-ov, body.kc-focus:not(.kc-quizzing) #kcMenuBtn, body.kc-focus:not(.kc-quizzing) #kcMenuClose { display:none; }
  body.kc-focus:not(.kc-quizzing) .kc-outline { position:sticky; top: calc(88px + env(safe-area-inset-top, 0px)); left:auto; right:auto; bottom:auto; z-index:auto;
    width:auto; max-height: calc(100vh - 112px); transform:none; visibility:visible; transition:none; box-shadow:none;
    border:1px solid var(--border); border-radius: var(--radius-lg); }
  body.kc-focus:not(.kc-quizzing) .kc-outline-head { padding-top: var(--space-5); }
  body.kc-focus:not(.kc-quizzing) .kc-nav, body.kc-focus:not(.kc-quizzing) .kq-foot { padding-left: calc(var(--kc-gutter) + 324px); }
}
