/* ===== Gaya dasar ===== */
.custom-scrollbar::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
@keyframes pulse-flame {
  0%, 100% { transform: scale(1) rotate(-1deg); opacity: 0.95; }
  50% { transform: scale(1.08, 1.15) rotate(2deg); opacity: 1; }
}
.animate-flame {
  animation: pulse-flame 1.1s infinite ease-in-out;
  transform-origin: bottom center;
}

/* Standard IUPAC 18-column Periodic Table CSS Grid */
.standard-periodic-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(48px, 1fr));
  gap: 3px;
}

.element-card {
  transition: all 0.15s ease-in-out;
  user-select: none;
}
.element-card:hover {
  transform: translateY(-2px) scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ===== MOBILE UPGRADE LAYER (konten tidak diubah) ===== */
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }
* { -webkit-tap-highlight-color: transparent; }
button, a, select, input, label { touch-action: manipulation; }

/* Bottom navigation */
#bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid #d1fae5; box-shadow: 0 -4px 18px rgba(2,44,34,.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 2px 8px; min-height: 58px; color: #64748b;
  font-size: 10px; font-weight: 700; line-height: 1.1; position: relative; transition: color .15s;
}
#bottom-nav button i { font-size: 18px; transition: transform .15s; }
#bottom-nav button.active { color: #047857; }
#bottom-nav button.active i { transform: translateY(-2px) scale(1.1); }
#bottom-nav button.active::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  background: #059669; border-radius: 0 0 4px 4px;
}
@media (min-width: 1024px) { #bottom-nav { display: none; } }

@media (max-width: 1023px) {
  #mobile-menu-btn, #mobile-menu { display: none !important; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  header.sticky { padding-top: env(safe-area-inset-top, 0px); }
  footer { margin-top: 1.5rem !important; padding-bottom: 1.5rem; }
  #hubbi-chat-btn { --hubbi-size: 52px; right: calc(8px + env(safe-area-inset-right, 0px)); }
}

@media (max-width: 767px) {
  main { padding-left: 14px !important; padding-right: 14px !important; padding-top: 14px !important; }
  .text-xs { font-size: .8125rem !important; line-height: 1.3rem !important; }
  .text-\[11px\] { font-size: .75rem !important; }
  .text-\[10px\] { font-size: .6875rem !important; }
  p, li { overflow-wrap: anywhere; }
  .text-justify { text-align: left !important; }
  h1 { overflow-wrap: anywhere; }
  button, select, .mod-nav-btn { min-height: 40px; }
  input:not([type=range]):not([type=radio]):not([type=checkbox]), select, textarea {
    font-size: 16px !important; min-height: 44px;
  }
  input[type=radio], input[type=checkbox] { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
  input[type=range] { height: 28px; }
  label:has(input[type=radio]) { padding: .7rem .75rem; min-height: 46px; }

  /* Modul (mobile): hanya kartu menu chip yang menempel di bawah header.
     Kartu Slide Deck & Sintaks KBC dipindah ke BAWAH isi modul agar tidak menutupi materi. */
  #tab-modul > div { gap: .75rem !important; }
  #tab-modul > div > div:first-child { display: contents; }            /* bungkus sidebar dilepas, kartu jadi item flex */
  #tab-modul > div > div:first-child > div { margin: 0 !important; }
  #tab-modul > div > div:first-child > div:nth-child(1) {              /* menu chip (satu-satunya yang sticky) */
    order: 1; position: sticky; top: calc(64px + env(safe-area-inset-top,0px)); z-index: 30;
    padding: .6rem !important; border-radius: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.06);
  }
  #tab-modul > div > div:first-child h2 { display: none; }
  #tab-modul > div > #module-viewer { order: 2; }
  #tab-modul > div > div:first-child > div:nth-child(2) { order: 3; position: static; }  /* Slide Deck */
  #tab-modul > div > div:first-child > div:nth-child(3) { order: 4; position: static; }  /* Sintaks KBC */
  #tab-modul > div > div:first-child > div:nth-child(2) h2 { display: flex; }             /* judul Presentasi tetap tampil */
  #module-menu { display: flex !important; overflow-x: auto; gap: .4rem; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  #module-menu::-webkit-scrollbar { display: none; }
  #module-menu > button { flex: 0 0 auto; width: auto !important; white-space: nowrap; border-radius: 999px !important;
    padding: .55rem .9rem !important; margin: 0 !important; scroll-snap-align: start; border: 1px solid #e2e8f0; }
  #module-menu > button > i:last-child { display: none; }
  /* Menu Tokoh Kimia (sama seperti menu modul di HP) */
  #tokoh-side > div { position: sticky; top: calc(64px + env(safe-area-inset-top,0px)); z-index: 30; padding: .6rem !important;
    border-radius: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
  #tokoh-side h2 { display: none; }
  #tokoh-menu { display: flex !important; overflow-x: auto; gap: .4rem; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  #tokoh-menu::-webkit-scrollbar { display: none; }
  #tokoh-menu > button { flex: 0 0 auto; width: auto !important; white-space: nowrap; border-radius: 999px !important;
    padding: .55rem .9rem !important; margin: 0 !important; scroll-snap-align: start; border: 1px solid #e2e8f0; }
  #tokoh-menu > button > i:last-child, #tokoh-menu > button span span { display: none; }
  #tokoh-viewer { padding: 1rem !important; min-height: 0 !important; border-radius: 1.25rem !important; scroll-margin-top: 130px; }
  #module-viewer { padding: 1rem !important; min-height: 0 !important; border-radius: 1.25rem !important; scroll-margin-top: 130px; }

  /* Tabel periodik */
  #standard-spu-wrapper { min-width: var(--spu-w, 720px) !important; }
  .standard-periodic-grid { grid-template-columns: repeat(18, minmax(34px, 1fr)); gap: 2px; }
  .element-card { height: 46px !important; padding: 2px !important; }
  .element-card:active { transform: scale(.94); }
  .spu-zoom { display: flex !important; }

  /* Chat: layar penuh */
  #hubbi-chat-window { inset: 0 !important; width: 100% !important; height: 100dvh !important; max-height: 100dvh !important;
    border-radius: 0 !important; border: 0 !important; }
  #hubbi-chat-window > div:first-child { padding-top: calc(.875rem + env(safe-area-inset-top,0px)) !important; }
  #hubbi-chat-window > div:last-child { padding-bottom: calc(.75rem + env(safe-area-inset-bottom,0px)) !important; }
  #hubbi-chat-window button[onclick="toggleHubbiChat()"] { width: 40px !important; height: 40px !important; }
  #hubbi-input { font-size: 16px !important; }
  #hubbi-chat-window .max-w-\[85\%\] { max-width: 90% !important; font-size: .9rem; }

  /* Modal jadi bottom-sheet */
  #modal-element, #modal-k3, #modal-ppt, #modal-score { align-items: flex-end !important; padding: 0 !important; overscroll-behavior: contain; }
  #modal-element > div, #modal-k3 > div, #modal-ppt > div, #modal-score > div {
    max-width: 100% !important; width: 100% !important; max-height: 90dvh; overflow-y: auto;
    border-radius: 1.5rem 1.5rem 0 0 !important; padding: 1.25rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom,0px)) !important;
    animation: sheet-up .25s ease-out; overscroll-behavior: contain;
  }
  #modal-element > div::before, #modal-k3 > div::before, #modal-ppt > div::before, #modal-score > div::before {
    content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #cbd5e1; margin: -6px auto 10px;
  }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.spu-zoom { display: none; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem;
  font-size: 12px; color: #64748b; }
.spu-zoom div { display: flex; gap: .35rem; }
.spu-zoom button { width: 40px; height: 36px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff;
  font-weight: 800; color: #065f46; }
.spu-zoom button:active { background: #d1fae5; }

@media (hover: none) {
  .element-card:hover { transform: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }


/* ===== Tombol chatbot Hubbi: melayang, sisi kanan & tengah layar ===== */
#hubbi-chat-btn {
  --hubbi-size: 60px;
  width: var(--hubbi-size); height: var(--hubbi-size);
  top: calc(50% - var(--hubbi-size) / 2);          /* tengah vertikal, tanpa transform */
  right: calc(12px + env(safe-area-inset-right, 0px));
  padding: 0; border-radius: 50%; overflow: hidden;
  background: #fff; border: 3px solid #047857; color: #047857;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(4, 120, 87, .35);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  animation: hubbi-float 3s ease-in-out infinite;
  transition: scale .2s, box-shadow .2s;
}
#hubbi-chat-btn img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
#hubbi-chat-btn:hover { scale: 1.1; box-shadow: 0 10px 28px rgba(4, 120, 87, .5); }
#hubbi-chat-btn:active { scale: .94; }
@keyframes hubbi-float { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { #hubbi-chat-btn { animation: none; } }

/* Jendela chat di desktop/tablet: muncul di sebelah kiri tombol, tidak menutupinya */
@media (min-width: 768px) {
  #hubbi-chat-window { top: auto; bottom: 1.5rem; right: calc(12px + 60px + 16px); }
}

/* ===== Lebar konten modul: jangan melebar oleh elemen yang bisa digulir (mis. timeline modul 1) ===== */
#module-viewer, #module-viewer .module-content { min-width: 0; max-width: 100%; }
#module-viewer .overflow-x-auto { max-width: 100%; }


/* ===== Daftar modul panjang (26 modul): menu dapat digulir di desktop/tablet ===== */
@media (min-width: 768px) {
  #module-menu {
    max-height: 62vh; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 #f1f5f9;
  }
  #module-menu::-webkit-scrollbar { width: 6px; }
  #module-menu::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
  #module-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
}

/* ===== Modul 26 (Kimia Inti): notasi nuklida, widget animasi, soal ===== */
/* Lambang inti: A (nomor massa) superskrip di atas, Z (nomor atom) subskrip di bawah,
   keduanya rata kanan tepat di kiri simbol unsur. Tumpukan dinaikkan (vertical-align) supaya
   A sejajar tinggi huruf kapital dan Z berada di garis dasar simbol. Angka tidak ditebalkan. */
.nk { display: inline-flex; flex-direction: column; align-items: flex-end;
  font-size: .62em; line-height: 1; vertical-align: .75em; margin-right: .1em; white-space: nowrap; }
.nk b, .nk i { display: block; font-style: normal; font-weight: 400; }
.nk-bar { text-decoration: overline; text-decoration-thickness: 1px; }
.nk-eq { font-size: 1rem; line-height: 2.1; white-space: nowrap; }
td.nk-eq, li.nk-eq, div.nk-eq { overflow-x: auto; }
.nk-btn { padding: .4rem .75rem; border-radius: .6rem; font-size: .75rem; font-weight: 700;
  border: 1px solid #6ee7b7; background: #fff; color: #065f46; }
.nk-btn:hover { background: #ecfdf5; }
.nk-btn.on { background: #059669; color: #fff; border-color: #059669; }
.nk-in { border: 1px solid #cbd5e1; border-radius: .6rem; padding: .4rem .6rem; width: 100%; font-size: .875rem; }
#module-viewer svg, #module-viewer canvas { max-width: 100%; }
#module-viewer canvas { height: auto; }
#module-viewer details > summary { cursor: pointer; }
#module-viewer details[open] > summary { margin-bottom: .25rem; }
@media (max-width: 767px) {
  #module-viewer .nk-eq { font-size: .95rem; }
  .nk-btn { min-height: 40px; }
  #module-viewer [data-nk] .nk-btn { flex: 1 1 auto; }
}


/* ===== Lab Virtual Kimia Nuklir (labs/kimia-nuklir.js) ===== */
.nuk-lab canvas { max-width: 100%; height: auto; }
.nuk-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; }
.nuk-lab .nk-eq { line-height: 2.2; overflow-x: auto; white-space: nowrap; }
.nuk-lab .nk-eq sup { font-size: .65em; line-height: 0; }
.nuk-lab input[type=range] { accent-color: #059669; }
.nuk-lab [data-p] { min-width: 0; }
@media (max-width: 767px) {
  .nuk-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nuk-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .nuk-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .nuk-lab [data-r=modes] .nk-btn, .nuk-lab [data-r=pre] .nk-btn { flex: 1 1 auto; }
  .nuk-lab .nk-eq { font-size: .95rem; }
}


/* ===== Lab Virtual Turunan Hidrokarbon (labs/turunan-hidrokarbon.js) ===== */
.hc-lab { min-width: 0; }
.hc-lab select, .hc-lab input[type=range] { max-width: 100%; }
.hc-lab input[type=range] { accent-color: #059669; }
.hc-lab .hc-tube { width: 100%; height: auto; max-height: 140px; display: block; }
.hc-lab .hc-dark { background: #0f172a; color: #e2e8f0; border-radius: 1rem; padding: 1rem; }
.hc-lab .hc-mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #fcd34d;
  background: #1e293b; border-radius: .5rem; padding: .35rem .6rem; overflow-x: auto; }
.hc-lab .hc-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem;
  font-family: 'JetBrains Mono', monospace; font-size: .75rem; padding: .75rem; border-radius: 1rem;
  background: #f8fafc; border: 1px solid #e2e8f0; color: #1e293b; overflow-x: auto; }
.hc-lab .hc-chip { padding: .45rem .7rem; border-radius: .75rem; border: 1px solid; transition: opacity .5s; }
.hc-lab .hc-bar { height: 100%; transition: width .15s linear; }
.hc-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; }
.hc-lab table td, .hc-lab table th { vertical-align: top; }
@media (max-width: 767px) {
  .hc-lab [data-r=tabs], .hc-lab [data-r=m-tests] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hc-lab [data-r=tabs]::-webkit-scrollbar, .hc-lab [data-r=m-tests]::-webkit-scrollbar { display: none; }
  .hc-lab [data-r=tabs] .nk-btn, .hc-lab [data-r=m-tests] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .hc-lab .hc-eq { font-size: .6875rem; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .hc-lab .hc-chip, .hc-lab .hc-bar { transition: none; } }


/* ===== Lab Virtual Hidrolisis Garam (labs/hidrolisis-garam.js) ===== */
.hg-lab { min-width: 0; }
.hg-lab select, .hg-lab input[type=range] { max-width: 100%; }
.hg-lab input[type=range] { accent-color: #059669; }
.hg-lab [data-r=pane] { min-width: 0; }
.hg-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; }
.hg-lab .nk-eq { line-height: 2.2; overflow-x: auto; white-space: nowrap; }
.hg-lab .nk-eq sup, .hg-lab .nk-eq sub { line-height: 0; }
.hg-lab svg { max-width: 100%; height: auto; }
.hg-lab table td, .hg-lab table th { vertical-align: top; }
.hg-lab button[disabled] { cursor: default; }
@media (max-width: 767px) {
  .hg-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hg-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .hg-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .hg-lab .nk-eq { font-size: .95rem; }
}


/* ===== Menu Lab Virtual: tampilan SAMA dengan menu Modul & Tokoh Kimia (js/labs.js) ===== */
/* Desktop/tablet: daftar vertikal di panel kiri; menu dapat digulir bila labnya banyak */
@media (min-width: 768px) {
  #lab-side #sim-nav {
    max-height: 62vh; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 #f1f5f9;
  }
  #lab-side #sim-nav::-webkit-scrollbar { width: 6px; }
  #lab-side #sim-nav::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
  #lab-side #sim-nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
}
@media (max-width: 767px) {
  /* Bungkus panel dilepas supaya kartu menu bisa menempel (sticky) di bawah header, persis seperti menu Modul */
  #lab-side { display: contents; }
  #lab-side > div { margin: 0 !important; position: sticky; top: calc(64px + env(safe-area-inset-top,0px)); z-index: 30;
    padding: .6rem !important; border-radius: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
  #lab-side h2 { display: none; }
  #sim-nav { display: flex !important; overflow-x: auto; gap: .4rem; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  #sim-nav::-webkit-scrollbar { display: none; }
  #sim-nav > button { flex: 0 0 auto; width: auto !important; white-space: nowrap; border-radius: 999px !important;
    padding: .55rem .9rem !important; margin: 0 !important; scroll-snap-align: start; border: 1px solid #e2e8f0; }
  #sim-nav > button > i:last-child { display: none; }
  #lab-viewer { min-width: 0; }
  #lab-viewer .sim-box { scroll-margin-top: 130px; }
}


/* =====================================================================
   TEMA HUMANIS (v9): hijau daun, kapur, sedikit kunyit. Judul memakai Bricolage Grotesque,
   isi tetap Plus Jakarta Sans. Hanya mengubah tampilan, bukan isi modul.
   ===================================================================== */
:root { --daun: #1d6b4b; --daun-tua: #134733; --kapur: #f4f6f1; --kunyit: #d49a1a; --tinta: #25302a;
  --garis: #d8ddd3; --redup: #56635b; --font-head: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif; }
body.bg-slate-50 { background-color: var(--kapur); }
body.text-slate-800 { color: var(--tinta); }
:focus-visible { outline: 2px solid var(--kunyit); outline-offset: 2px; border-radius: 4px; }

/* Header: datar, tanpa blur dan bayangan */
header.sticky { background: var(--kapur) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  box-shadow: none !important; border-bottom: 1px solid var(--garis) !important; }
.hm-brand { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.hm-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 10px; background: var(--daun-tua); color: #f2b933; font: 800 1.35rem/1 var(--font-head); }
.hm-logo-sm { width: 32px; height: 32px; border-radius: 8px; font-size: 1.1rem; background: #0c2f22; }
.hm-name { font: 800 1.1rem/1.1 var(--font-head); letter-spacing: -.01em; color: var(--daun-tua); }
.hm-sub { margin: 1px 0 0; font-size: .7rem; color: var(--redup); }

/* Menu atas: teks dengan garis bawah (bukan pil berwarna), ikon disembunyikan */
header .nav-btn { border-radius: 0 !important; background: transparent !important; color: var(--redup);
  padding: .35rem .55rem; font-weight: 600; border-bottom: 2px solid transparent; }
header .nav-btn i { display: none; }
header .nav-btn:hover { color: var(--daun-tua); border-bottom-color: var(--garis); }
header .nav-btn.bg-emerald-50 { color: var(--daun-tua) !important; border-bottom-color: var(--kunyit); }

/* Judul di seluruh konten memakai huruf judul */
main h1, main h2, main h3 { font-family: var(--font-head); letter-spacing: -.005em; }

/* Kartu: sudut bertingkat (besar, sedang, kecil), garis halus, tanpa bayangan */
main .rounded-3xl { border-radius: 1.125rem; }
main .rounded-2xl { border-radius: .75rem; }
main .rounded-xl { border-radius: .5rem; }
main .shadow-sm { box-shadow: none !important; }
main .border-slate-200, main .border-slate-200\/80 { border-color: var(--garis); }

/* ----- Beranda ----- */
.hm-home { max-width: 100%; }
.hm-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.hm-main { max-width: 42rem; }
@media (min-width: 1024px) { .hm-top { grid-template-columns: minmax(0, 42rem) minmax(0, 1fr); gap: 4rem; }
  .hm-top .hm-ayat { margin-top: 4.5rem; } }
.hm-hello { display: flex; align-items: flex-end; gap: .85rem; margin-bottom: 1.5rem; }
.hm-avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; background: #fff;
  border: 2px solid var(--daun); flex: none; }
.hm-bubble { margin: 0; background: #fff; border: 1px solid var(--garis); border-radius: 16px 16px 16px 4px;
  padding: .7rem 1rem; font-size: .95rem; line-height: 1.45; }
.hm-bubble b { color: var(--daun-tua); }
.hm-h1 { font-family: var(--font-head); font-weight: 800; color: var(--daun-tua); letter-spacing: -.02em;
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; margin: 0 0 1rem; max-width: 40rem; }
.hm-lead { font-size: 1.02rem; line-height: 1.7; margin: 0 0 .8rem; max-width: 40rem; }
.hm-lead em { font-style: normal; font-weight: 600; color: var(--daun-tua); }
.hm-facts { font-size: .9rem; line-height: 1.7; color: var(--redup); margin: 0; max-width: 40rem; }
.hm-choices { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 0; }
.hm-btn { font: 700 .9rem/1.2 inherit; font-family: inherit; padding: .7rem 1.1rem; border-radius: 8px;
  border: 1.5px solid var(--daun); color: var(--daun-tua); background: transparent; cursor: pointer; }
.hm-btn:hover { background: #e4ede6; }
.hm-btn.main { background: var(--daun); color: #fff; }
.hm-btn.main:hover { background: var(--daun-tua); }
.hm-ayat { margin: 0; padding: 1.1rem 0; border-top: 1px solid var(--garis); border-bottom: 1px solid var(--garis);
  max-width: 30rem; }
.hm-ayat .ar { font-family: 'Amiri', serif; font-size: 2rem; line-height: 2; text-align: right; color: var(--daun-tua); margin: 0; }
.hm-ayat .tr { margin: .2rem 0 0; font-size: .9rem; line-height: 1.6; color: var(--redup); }

/* Panca Cinta: daftar teks, bukan kotak bernomor */
.hm-cinta { max-width: 64rem; margin-top: 1.5rem; }
.hm-cinta h2 { font-size: 1.45rem; font-weight: 800; color: var(--daun-tua); margin: 0 0 .35rem; line-height: 1.2; }
.hm-cinta .intro { color: var(--redup); font-size: .95rem; line-height: 1.6; margin: 0 0 1.1rem; max-width: 36rem; }
.hm-cinta dl { margin: 0; }
.hm-cinta .row { display: grid; grid-template-columns: 13.5rem 1fr; gap: .25rem 1.5rem; padding: .9rem 0;
  border-top: 1px solid var(--garis); }
.hm-cinta .row:last-child { border-bottom: 1px solid var(--garis); }
.hm-cinta dt { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; color: var(--daun-tua); }
.hm-cinta dd { margin: 0; font-size: .93rem; line-height: 1.6; }
@media (max-width: 640px) { .hm-cinta .row { grid-template-columns: 1fr; } .hm-avatar { width: 56px; height: 56px; }
  .hm-btn { flex: 1 1 auto; min-height: 44px; } }

/* Footer: kertas hangat + garis kunyit, lebih "buatan tangan" daripada hijau tua polos */
footer {
  position: relative;
  color: #3a4a40;
  border-top: 0;
  background-color: #ebe4d0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .15 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #efe9d7 0%, #e6dec8 100%);
  box-shadow: inset 0 2px 0 var(--kunyit);
}
.hm-foot-title { font: 700 .85rem/1.25 var(--font-head); color: var(--daun-tua); }
.hm-foot-sub { font-size: .7rem; line-height: 1.2; color: #5b6657; }
.hm-yt { color: var(--daun); text-decoration: underline; text-decoration-color: rgba(212,154,26,.7);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; font-weight: 600; font-size: .78rem; }
.hm-yt i { color: #b5472f; margin-right: .35rem; font-size: 1rem; vertical-align: -1px; }
.hm-yt:hover { color: var(--daun-tua); text-decoration-color: var(--kunyit); }
footer .hm-logo-img-sm { background: #fffdf6; border: 1px solid rgba(19,71,51,.18); }


/* ===== Lab Virtual Hidrokarbon (labs/hidrokarbon.js) ===== */
.hk-lab { min-width: 0; }
.hk-lab select, .hk-lab input[type=range] { max-width: 100%; }
.hk-lab input[type=range] { accent-color: #059669; }
.hk-lab .hk-tube { width: 100%; height: auto; max-height: 190px; display: block; }
.hk-lab .hk-dark { background: #0f172a; color: #e2e8f0; border-radius: 1rem; padding: 1rem; }
.hk-lab .hk-mono { display: inline-block; max-width: 100%; vertical-align: middle; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #fcd34d; background: #1e293b; border-radius: .5rem; padding: .35rem .6rem; overflow-x: auto; white-space: nowrap; }
.hk-lab .hk-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem;
  font-family: 'JetBrains Mono', monospace; font-size: .8125rem; line-height: 2; padding: .75rem; border-radius: 1rem;
  background: #f8fafc; border: 1px solid #e2e8f0; color: #1e293b; overflow-x: auto; }
.hk-lab .hk-eq sub, .hk-lab .hk-mono sub { line-height: 0; }
.hk-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.hk-lab table td, .hk-lab table th { vertical-align: middle; }
.hk-lab svg { max-width: 100%; }
@media (max-width: 767px) {
  .hk-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hk-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .hk-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .hk-lab [data-r=mode] .nk-btn { flex: 1 1 auto; }
  .hk-lab .hk-eq { font-size: .75rem; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .hk-lab svg * { transition: none !important; } }


/* ===== Lab Virtual Sifat Koligatif Larutan (labs/sifat-koligatif.js) ===== */
.kg-lab { min-width: 0; }
.kg-lab select, .kg-lab input[type=range] { max-width: 100%; }
.kg-lab input[type=range] { accent-color: #059669; }
.kg-lab canvas { display: block; width: 100%; height: auto; max-width: 100%; }
.kg-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.kg-lab sub { line-height: 0; }
.kg-lab details > summary { cursor: pointer; }
.kg-lab .nk-btn:disabled { opacity: .45; cursor: not-allowed; }
.kg-lab .nk-btn:disabled:hover { background: #fff; }
.kg-lab table td, .kg-lab table th { vertical-align: middle; }
.kg-lab .kg-card { padding: .55rem .7rem; border-radius: .85rem; background: #f8fafc; border: 1px solid #e2e8f0; min-width: 0; }
.kg-lab .kg-card.kg-hi { background: #ecfdf5; border-color: #6ee7b7; }
.kg-lab .kg-k { font-size: 10.5px; font-weight: 700; color: #64748b; line-height: 1.25; }
.kg-lab .kg-v { font-size: 1rem; font-weight: 800; color: #0f172a; margin-top: .15rem; overflow-wrap: anywhere; }
.kg-lab .kg-hi .kg-v { color: #047857; }
.kg-lab .kg-eq { padding: .7rem .85rem; border-radius: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; color: #1e293b;
  font-size: .8rem; line-height: 1.9; overflow-x: auto; }
.kg-lab .kg-eq > div { white-space: nowrap; }
.kg-lab .kg-bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.kg-lab .kg-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #059669); transition: width .25s ease; }
.kg-lab .kg-fb { padding: .85rem 1rem; border-radius: 1rem; font-size: .85rem; line-height: 1.6; border: 1px solid; }
.kg-lab .kg-ok { background: #ecfdf5; border-color: #6ee7b7; color: #064e3b; }
.kg-lab .kg-bad { background: #fff1f2; border-color: #fda4af; color: #881337; }
.kg-lab .kg-warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
@media (max-width: 767px) {
  .kg-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .kg-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .kg-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .kg-lab [data-r=modes] .nk-btn { flex: 1 1 auto; }
  .kg-lab [data-r=tm-btns] .nk-btn { flex: 1 1 auto; }
  .kg-lab .kg-eq { font-size: .72rem; }
  .kg-lab .kg-v { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) { .kg-lab .kg-bar > span { transition: none; } }

/* ===== Logo gambar (v10) ===== */
.hm-logo-img { width: 34px; height: 34px; flex: none; object-fit: contain; display: block; }
.hm-logo-img-sm { width: 28px; height: 28px; padding: 3px; border-radius: 8px; background: var(--kapur); }
@media (max-width: 640px) { .hm-logo-img { width: 32px; height: 32px; } }

/* ===== Beranda: ayat-ayat yang relevan dengan kimia (v10) ===== */
.hm-dalil { max-width: 64rem; margin-top: 1.5rem; }
.hm-dalil h2 { font-size: 1.45rem; font-weight: 800; color: var(--daun-tua); margin: 0 0 .35rem; line-height: 1.2; }
.hm-dalil .intro { color: var(--redup); font-size: .95rem; line-height: 1.6; margin: 0 0 1.1rem; max-width: 38rem; }
.hm-dalil-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2.5rem; border-top: 1px solid var(--garis); }
@media (min-width: 900px) { .hm-dalil-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hm-dalil-item { margin: 0; padding: 1.1rem 0 1.2rem; border-bottom: 1px solid var(--garis);
  display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.hm-dalil-item .tag { margin: 0; font: 700 .72rem/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: #8a5a00; }
.hm-dalil-item .ar { margin: 0; font-family: 'Amiri', serif; font-size: 1.65rem; line-height: 2; text-align: right; color: var(--daun-tua); }
.hm-dalil-item .tr { margin: 0; font-size: .9rem; line-height: 1.65; }
.hm-dalil-item .src { font-weight: 700; color: var(--daun-tua); white-space: nowrap; }
.hm-dalil-item .kait { margin: 0; font-size: .85rem; line-height: 1.6; color: var(--redup); }
.hm-dalil-item .go { display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; margin-top: .1rem; }
.hm-link { background: none; border: 0; padding: .3rem 0; font: 700 .82rem/1.3 inherit; font-family: inherit; color: var(--daun);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.hm-link:hover { color: var(--daun-tua); }
@media (max-width: 640px) { .hm-dalil-item .ar { font-size: 1.45rem; } .hm-link { min-height: 40px; } }

/* ===== Bubble chat Hubbi: teks panjang & baris baru tidak merusak tata letak ===== */
#hubbi-messages .max-w-\[85\%\] { overflow-wrap: anywhere; }
#hubbi-messages .bg-emerald-800 { white-space: pre-wrap; }  /* bubble siswa: pertahankan baris baru */

/* ===== Header & footer ramping (menimpa padding bawaan Tailwind di index.html) ===== */
/* Header: nolkan padding/tinggi bawaan di semua lapisan, lalu beri satu jarak di lapisan terluar.
   Dengan begitu tinggi header = isi + 2 x 0,45rem, berapa pun banyaknya pembungkus di index.html. */
header.sticky div, header.sticky nav { padding-top: 0 !important; padding-bottom: 0 !important;
  margin-top: 0 !important; margin-bottom: 0 !important; min-height: 0 !important; }
header.sticky > div:first-child, header.sticky > div:first-child > div { height: auto !important; }
header.sticky > div:first-child { padding-top: .45rem !important; padding-bottom: .45rem !important; }
footer { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 2rem !important; }
footer > div { padding-top: .7rem !important; padding-bottom: .7rem !important; min-height: 0 !important; }
@media (max-width: 1023px) {
  footer { margin-top: 1.25rem !important; padding-bottom: 0 !important; }
  header.sticky > div:first-child { padding-top: .35rem !important; padding-bottom: .35rem !important; }
}


/* ===== Lab Virtual Geometri Molekul (labs/geometri-molekul.js) ===== */
.gm-lab { min-width: 0; }
.gm-lab [data-p] { min-width: 0; }
.gm-lab select, .gm-lab input[type=range] { max-width: 100%; }
.gm-lab input[type=range] { accent-color: #059669; }
.gm-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.gm-lab .nk-btn:disabled { opacity: .4; cursor: not-allowed; }
.gm-lab .nk-btn:disabled:hover { background: #fff; }
.gm-lab .gm-panel { padding: 1rem; border-radius: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; }
.gm-lab .gm-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.gm-lab .gm-stage { background: #0f172a; border-radius: 1rem; padding: .25rem; }
.gm-lab .gm-svg { display: block; width: 100%; height: auto; max-height: 340px; }
.gm-lab .gm-ctl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .9rem; margin-top: .6rem; align-items: center; }
.gm-lab .gm-sl { display: flex; align-items: center; gap: .5rem; font-size: 11px; font-weight: 700; color: #64748b; }
.gm-lab .gm-sl input { flex: 1; min-width: 0; }
.gm-lab .gm-tg { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.gm-lab .gm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.gm-lab .gm-card { padding: .55rem .7rem; border-radius: .85rem; background: #f8fafc; border: 1px solid #e2e8f0; min-width: 0; }
.gm-lab .gm-card.gm-hi { background: #ecfdf5; border-color: #6ee7b7; }
.gm-lab .gm-k { font-size: 10.5px; font-weight: 700; color: #64748b; line-height: 1.25; }
.gm-lab .gm-v { font-size: .92rem; font-weight: 800; color: #0f172a; margin-top: .15rem; overflow-wrap: anywhere; }
.gm-lab .gm-hi .gm-v { color: #047857; }
.gm-lab .gm-why { padding: .8rem 1rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fcd34d; color: #78350f;
  font-size: .8rem; line-height: 1.65; }
.gm-lab .gm-hint { font-size: .8rem; color: #475569; }
.gm-lab .gm-hint summary { cursor: pointer; font-weight: 700; color: #065f46; }
.gm-lab .gm-fb { padding: .85rem 1rem; border-radius: 1rem; font-size: .85rem; line-height: 1.7; border: 1px solid; }
.gm-lab .gm-ok { background: #ecfdf5; border-color: #6ee7b7; color: #064e3b; }
.gm-lab .gm-bad { background: #fff1f2; border-color: #fda4af; color: #881337; }
.gm-lab .gm-warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.gm-lab .gm-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 640px; }
.gm-lab .gm-table th { text-align: left; padding: .5rem .6rem; background: #ecfdf5; color: #065f46; font-size: 11px; border-bottom: 1px solid #a7f3d0; }
.gm-lab .gm-table td { padding: .5rem .6rem; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
@media (min-width: 640px) { .gm-lab .gm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .gm-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .gm-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .gm-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .gm-lab [data-r=modes] .nk-btn { flex: 1 1 auto; }
  .gm-lab .gm-ctl { grid-template-columns: 1fr; }
  .gm-lab .gm-tg .nk-btn { flex: 1 1 auto; }
  .gm-lab .gm-v { font-size: .85rem; }
}


/* ===== Lab Virtual Polimerisasi (labs/polimerisasi.js) ===== */
.pl-lab { min-width: 0; }
.pl-lab [data-p] { min-width: 0; }
.pl-lab input[type=range] { accent-color: #059669; max-width: 100%; }
.pl-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.pl-lab .nk-btn:disabled { opacity: .4; cursor: not-allowed; }
.pl-lab .nk-btn:disabled:hover { background: #fff; }
.pl-lab .pl-panel { padding: 1rem; border-radius: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; }
.pl-lab .pl-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.pl-lab .pl-stage { background: #0f172a; border-radius: 1rem; padding: .5rem; overflow-x: auto; }
.pl-lab .pl-svg { display: block; width: 100%; height: auto; min-width: 460px; }
.pl-lab .pl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.pl-lab .pl-card { padding: .55rem .7rem; border-radius: .85rem; background: #f8fafc; border: 1px solid #e2e8f0; min-width: 0; }
.pl-lab .pl-card.pl-hi { background: #ecfdf5; border-color: #6ee7b7; }
.pl-lab .pl-k { font-size: 10.5px; font-weight: 700; color: #64748b; line-height: 1.25; }
.pl-lab .pl-v { font-size: .9rem; font-weight: 800; color: #0f172a; margin-top: .15rem; overflow-wrap: anywhere; line-height: 1.4; }
.pl-lab .pl-hi .pl-v { color: #047857; }
.pl-lab .pl-why { padding: .8rem 1rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fcd34d; color: #78350f;
  font-size: .8rem; line-height: 1.65; }
.pl-lab .pl-eq { padding: .7rem .9rem; border-radius: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; color: #1e293b;
  font-size: .85rem; line-height: 1.8; overflow-x: auto; }
.pl-lab .pl-eq sub, .pl-lab .pl-v sub, .pl-lab .pl-why sub { line-height: 0; }
.pl-lab .pl-legend { font-size: .75rem; color: #475569; line-height: 1.9; }
.pl-lab .pl-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: .3rem; border: 1px solid #1e293b; }
.pl-lab .pl-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 640px; }
.pl-lab .pl-table th { text-align: left; padding: .5rem .6rem; background: #ecfdf5; color: #065f46; font-size: 11px; border-bottom: 1px solid #a7f3d0; }
.pl-lab .pl-table td { padding: .5rem .6rem; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.pl-lab .pl-opt { display: block; width: 100%; text-align: left; padding: .65rem .85rem; border-radius: .75rem; border: 1px solid #cbd5e1;
  background: #fff; font-size: .85rem; font-weight: 600; color: #1e293b; cursor: pointer; }
.pl-lab .pl-opt:hover:not(:disabled) { background: #ecfdf5; border-color: #6ee7b7; }
.pl-lab .pl-opt.ok { background: #ecfdf5; border-color: #059669; color: #064e3b; }
.pl-lab .pl-opt.bad { background: #fff1f2; border-color: #fb7185; color: #881337; }
.pl-lab .pl-opt:disabled { cursor: default; }
.pl-lab .pl-fb { padding: .85rem 1rem; border-radius: 1rem; font-size: .85rem; line-height: 1.6; border: 1px solid; }
.pl-lab .pl-ok { background: #ecfdf5; border-color: #6ee7b7; color: #064e3b; }
.pl-lab .pl-bad { background: #fff1f2; border-color: #fda4af; color: #881337; }
@media (min-width: 640px) { .pl-lab .pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .pl-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pl-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .pl-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
  .pl-lab .pl-row .nk-btn { flex: 1 1 auto; }
  .pl-lab .pl-v { font-size: .85rem; }
}


/* ===== Lab Virtual Uji Makromolekul (labs/uji-makromolekul.js) ===== */
.mk-lab { min-width: 0; }
.mk-lab [data-p] { min-width: 0; }
.mk-lab select { max-width: 100%; }
.mk-lab .nk-btn { cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.mk-lab .nk-btn:disabled { opacity: .4; cursor: not-allowed; }
.mk-lab .nk-btn:disabled:hover { background: #fff; }
.mk-lab .mk-panel { padding: 1rem; border-radius: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; }
.mk-lab .mk-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.mk-lab .mk-stage { background: #0f172a; border-radius: 1rem; padding: .5rem; }
.mk-lab .mk-svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.mk-lab .mk-cap { font-size: .75rem; font-weight: 700; color: #475569; text-align: center; min-height: 1.1rem; }
.mk-lab .mk-k { font-size: 10.5px; font-weight: 700; color: #64748b; line-height: 1.25; }
.mk-lab .mk-why { padding: .8rem 1rem; border-radius: 1rem; background: #fffbeb; border: 1px solid #fcd34d; color: #78350f;
  font-size: .8rem; line-height: 1.7; }
.mk-lab .mk-hint { font-size: .8rem; color: #475569; }
.mk-lab .mk-hint summary { cursor: pointer; font-weight: 700; color: #065f46; }
.mk-lab .mk-fb { padding: .85rem 1rem; border-radius: 1rem; font-size: .85rem; line-height: 1.6; border: 1px solid; }
.mk-lab .mk-pos { background: #ecfdf5; border-color: #6ee7b7; color: #064e3b; }
.mk-lab .mk-neg { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
.mk-lab .mk-bad { background: #fff1f2; border-color: #fda4af; color: #881337; }
.mk-lab .mk-warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.mk-lab .mk-table { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 560px; }
.mk-lab .mk-table th { text-align: left; padding: .45rem .55rem; background: #ecfdf5; color: #065f46; font-size: 11px; border-bottom: 1px solid #a7f3d0; }
.mk-lab .mk-table td { padding: .45rem .55rem; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.mk-lab .mk-matrix { min-width: 820px; }
.mk-lab .mk-matrix th { font-size: 10px; }
.mk-lab .mk-opt { display: block; width: 100%; text-align: left; padding: .65rem .85rem; border-radius: .75rem; border: 1px solid #cbd5e1;
  background: #fff; font-size: .85rem; font-weight: 600; color: #1e293b; cursor: pointer; }
.mk-lab .mk-opt:hover:not(:disabled) { background: #ecfdf5; border-color: #6ee7b7; }
.mk-lab .mk-opt.ok { background: #ecfdf5; border-color: #059669; color: #064e3b; }
.mk-lab .mk-opt.bad { background: #fff1f2; border-color: #fb7185; color: #881337; }
.mk-lab .mk-opt:disabled { cursor: default; }
@media (max-width: 767px) {
  .mk-lab [data-r=tabs] { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mk-lab [data-r=tabs]::-webkit-scrollbar { display: none; }
  .mk-lab [data-r=tabs] .nk-btn { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
}

/* ===== Menu Kuis & Asesmen: tampilan SAMA dengan menu Modul & Tokoh Kimia ===== */
/* Desktop/tablet: daftar vertikal di panel kiri, dapat digulir bila materinya banyak */
@media (min-width: 768px) {
  #quiz-category-filters {
    max-height: 62vh; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 #f1f5f9;
  }
  #quiz-category-filters::-webkit-scrollbar { width: 6px; }
  #quiz-category-filters::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
  #quiz-category-filters::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
}
/* HP: deretan tombol yang menempel di bawah header (sama seperti menu Modul) */
@media (max-width: 767px) {
  #quiz-side > div { position: sticky; top: calc(64px + env(safe-area-inset-top,0px)); z-index: 30; padding: .6rem !important;
    border-radius: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
  #quiz-side h2 { display: none; }
  #quiz-category-filters { display: flex !important; overflow-x: auto; gap: .4rem; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  #quiz-category-filters::-webkit-scrollbar { display: none; }
  #quiz-category-filters > button { flex: 0 0 auto; width: auto !important; white-space: nowrap; border-radius: 999px !important;
    padding: .55rem .9rem !important; margin: 0 !important; scroll-snap-align: start; border: 1px solid #e2e8f0; }
  #quiz-viewer { padding: 1rem !important; min-height: 0 !important; border-radius: 1.25rem !important; scroll-margin-top: 130px; }
}

/* Hubbi Voice */
#hubbi-mic-btn.hubbi-listening{background:#e11d48;color:#fff;animation:hubbiPulse 1s ease-in-out infinite}
#hubbi-voice-toggle.hubbi-speaking{background:#fbbf24;color:#064e3b;animation:hubbiPulse 1.2s ease-in-out infinite}
@keyframes hubbiPulse{0%,100%{box-shadow:0 0 0 0 rgba(225,29,72,.45)}50%{box-shadow:0 0 0 7px rgba(225,29,72,0)}}
@media (prefers-reduced-motion:reduce){#hubbi-mic-btn.hubbi-listening,#hubbi-voice-toggle.hubbi-speaking{animation:none}}

/* Pembaca Suara Modul (js/modul-baca.js) */
.baca-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:0 0 1rem;padding:.5rem .625rem;border:1px solid #a7f3d0;background:#ecfdf5;border-radius:.875rem}
.baca-bar button{display:inline-flex;align-items:center;gap:.4rem;font-size:.75rem;font-weight:700;border-radius:.625rem;padding:.45rem .8rem;min-height:36px;cursor:pointer;transition:background .15s,transform .1s}
.baca-bar .baca-utama{background:#059669;color:#fff}
.baca-bar .baca-utama:hover{background:#047857}
.baca-bar.baca-bar-on .baca-utama{background:#fbbf24;color:#064e3b}
.baca-bar .baca-stop{background:#fff;color:#be123c;border:1px solid #fecdd3}
.baca-bar .baca-stop[hidden]{display:none}
.baca-bar button:active{transform:scale(.97)}
.baca-kec{display:inline-flex;align-items:center;gap:.4rem;font-size:.6875rem;font-weight:600;color:#065f46}
.baca-kec select{font-size:.75rem;border:1px solid #a7f3d0;border-radius:.5rem;background:#fff;color:#064e3b;padding:.3rem .4rem;min-height:32px}
.baca-suara{flex:1 1 100%;font-size:.6875rem;color:#047857}
.baca-suara:empty{display:none}
.baca-suara{font-weight:600}
.baca-sec{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;margin-left:.5rem;vertical-align:middle;border-radius:9999px;background:#d1fae5;color:#047857;font-size:.7rem;cursor:pointer;transition:background .15s}
.baca-sec:hover{background:#a7f3d0}
.baca-sec.baca-sec-on{background:#fbbf24;color:#064e3b}
.baca-aktif{background:rgba(251,191,36,.3);box-shadow:0 0 0 4px rgba(251,191,36,.3);border-radius:.375rem;transition:background .2s}
#baca-mini{position:fixed;left:50%;transform:translateX(-50%);bottom:1.25rem;z-index:55;display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem .4rem .875rem;background:#064e3b;color:#fff;border-radius:9999px;box-shadow:0 8px 24px rgba(0,0,0,.25);font-size:.75rem;font-weight:600}
#baca-mini[hidden]{display:none}
#baca-mini button{width:2.25rem;height:2.25rem;border-radius:9999px;background:#fbbf24;color:#064e3b;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
#baca-mini button[data-baca="mini-stop"]{background:#fff;color:#be123c}
#baca-mini .baca-mini-ikon{animation:hubbiPulse 1.2s ease-in-out infinite;border-radius:9999px}
#baca-pilih{position:fixed;z-index:56;display:inline-flex;align-items:center;gap:.4rem;padding:.5rem .85rem;background:#059669;color:#fff;border-radius:9999px;font-size:.75rem;font-weight:700;box-shadow:0 6px 18px rgba(0,0,0,.25);cursor:pointer}
#baca-pilih[hidden]{display:none}
#baca-info-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:4.75rem;z-index:55;max-width:min(92vw,28rem);padding:.5rem .875rem;background:#0f172a;color:#fff;border-radius:.75rem;font-size:.75rem;text-align:center}
#baca-info-toast[hidden]{display:none}
@media (max-width:1023px){#baca-mini{bottom:calc(76px + env(safe-area-inset-bottom,0px))}#baca-info-toast{bottom:calc(132px + env(safe-area-inset-bottom,0px))}}
@media (prefers-reduced-motion:reduce){#baca-mini .baca-mini-ikon{animation:none}.baca-aktif{transition:none}}
