/* Tambahan khusus situs Materi SD — di atas styles.css milik TKA SD. */
a.nav-item, .mobile-nav a { text-decoration: none; }
a.brand { text-decoration: none; }
.as-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.secondary-btn.small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: .8rem; }
.icon-btn.small { width: 36px; height: 36px; border-radius: 10px; font-size: 1.2rem; }
.section-block.tight { margin-top: 22px; }
.text-btn.danger { color: #a03c31; }

/* Sidebar: pintasan kelas */
.side-kelas p { margin: 0 0 9px 4px; color: #E3A8C4; font-size: .68rem; font-weight: 800; letter-spacing: .14em; }
#sideKelas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
#sideKelas a { display: grid; place-items: center; height: 40px; border-radius: 12px; color: #F6DCE9; background: rgba(255,255,255,.06); font: 800 1rem "Plus Jakarta Sans", sans-serif; text-decoration: none; }
#sideKelas a:hover { background: rgba(255,255,255,.12); }
#sideKelas a.active { color: var(--navy); background: var(--lime); }

/* Mobile nav: 4 menu */
.materi-mobile-nav a { display: grid; justify-items: center; gap: 3px; padding: 5px; color: inherit; font-size: .67rem; text-decoration: none; }
.materi-mobile-nav a span { font-size: 1.05rem; }
.materi-mobile-nav a.active { color: var(--lime); }

/* Warna mapel */
.tone-coral .subject-icon, .history-subject .tone-coral { background: #ffebe8; color: #b63d2f; }
.tone-orange .subject-icon, .history-subject .tone-orange { background: #fff0e7; color: #b95228; }
.tone-violet .subject-icon, .history-subject .tone-violet { background: #e8e4ff; color: #5e4bd0; }
.tone-green .subject-icon, .history-subject .tone-green { background: #ddf8f0; color: #16795c; }
.tone-pink .subject-icon, .history-subject .tone-pink { background: #FBE3EF; color: #B0175E; }
.tone-cyan .subject-icon, .history-subject .tone-cyan { background: #e3f6fb; color: #18778b; }
.tone-teal .subject-icon, .history-subject .tone-teal { background: #e0f5ec; color: #1b6b4a; }
.tone-blue .subject-icon, .history-subject .tone-blue { background: #e6f0ff; color: #1e4fa3; }

/* Kartu mapel */
.subject-card { text-decoration: none; color: inherit; align-items: start; }
.subject-card > .subject-icon { align-self: center; }
.subject-card > b { align-self: center; }
.subject-card small { line-height: 1.45; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.chip { padding: 3px 8px; border-radius: 999px; color: #8a5a00; background: #fff4cf; font-size: .62rem; font-style: normal; font-weight: 800; letter-spacing: .04em; }
.chip.soft { color: var(--muted); background: #FBEEF4; }
.score-badge { align-self: center; display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 6px; border-radius: 13px; color: #a03c31; background: #ffebe8; font: 800 .95rem "Plus Jakarta Sans", sans-serif; font-style: normal; }
.score-badge.ok { color: #1d6a4c; background: #e2f7ed; }

/* Kartu kelas */
.kelas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kelas-card { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; color: inherit; background: #fff; text-decoration: none; transition: transform .18s, box-shadow .18s; }
.kelas-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kelas-num { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--navy), #E0257F); font: 800 1.9rem "Plus Jakarta Sans", sans-serif; }
.tone-k2 .kelas-num { background: linear-gradient(135deg, #7868e6, #a08ff5); }
.tone-k3 .kelas-num { background: linear-gradient(135deg, #16795c, #2fbf8f); }
.tone-k4 .kelas-num { background: linear-gradient(135deg, #b95228, #ff8a5c); }
.tone-k5 .kelas-num { background: linear-gradient(135deg, #18778b, #3cc0d8); }
.tone-k6 .kelas-num { background: linear-gradient(135deg, #7D0F46, #B0175E); box-shadow: inset 0 0 0 3px var(--lime); }
.kelas-body strong, .kelas-body small { display: block; }
.kelas-body strong { font: 800 1.08rem "Plus Jakarta Sans", sans-serif; }
.kelas-body small { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.kelas-card > b { color: #B98AA4; }
.mini-meter { display: block; height: 6px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #F6E6EE; }
.mini-meter i { display: block; height: 100%; border-radius: inherit; background: var(--cyan); }

/* Breadcrumb, tab segmen */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: .82rem; }
.crumbs a { color: #A3195F; font-weight: 700; text-decoration: none; }
.crumbs b { color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.seg a { padding: 10px 16px; border-radius: 12px; color: var(--muted); font-size: .88rem; font-weight: 700; text-decoration: none; }
.seg a:hover { color: var(--ink); background: #FBEEF4; }
.seg a.active { color: #fff; background: var(--navy); }

/* Kepala halaman mapel */
.mapel-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.subject-icon.big { flex: 0 0 66px; width: 66px; height: 66px; border-radius: 19px; font-size: 1.6rem; display: grid; place-items: center; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; }
.mapel-desc { margin: 7px 0 0; color: var(--muted); line-height: 1.5; }

/* Penampil PDF */
.pdf-wrap { margin-top: 20px; }
.pdf-toolbar { position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(120,10,60,.07); backdrop-filter: blur(8px); color: var(--muted); font-size: .84rem; font-weight: 700; }
.pdf-tools { display: flex; align-items: center; gap: 8px; }
.pdf-tools > span { min-width: 46px; color: var(--ink); text-align: center; }
.pdf-pages { --pdf-zoom: 1; display: grid; justify-items: center; gap: 16px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }
.pdf-page { position: relative; display: grid; place-items: center; width: calc(min(860px, 100%) * var(--pdf-zoom)); max-width: none; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 10px 34px rgba(120,10,60,.1); }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-loading { color: #c4a3b5; font-size: .82rem; font-weight: 700; }
.pdf-after { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 22px 24px; border-radius: 20px; color: #fff; background: linear-gradient(100deg, var(--navy), #E0257F); }
.pdf-after p { margin: 0; font-weight: 700; }

/* Intro latihan */
.practice-intro { margin-top: 20px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 42px rgba(120,10,60,.06); }
.practice-intro > div > p { max-width: 620px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.intro-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 10px; margin: 22px 0; padding: 0; list-style: none; }
.intro-facts li { display: grid; gap: 3px; padding: 14px 16px; border-radius: 15px; background: #FBEEF4; }
.intro-facts b { font: 800 1.45rem "Plus Jakarta Sans", sans-serif; }
.intro-facts span { color: var(--muted); font-size: .74rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Unduhan & info */
.download-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 26px 28px; border: 1px dashed #E0A8C4; border-radius: 22px; background: #fff; }
.download-card p:last-child { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.download-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.info-strip { display: flex; gap: 14px; padding: 18px 20px; border-radius: 18px; color: #5c4a55; background: #fff7dc; line-height: 1.6; font-size: .9rem; }
.info-strip > span { font-size: 1.2rem; color: #b07a00; }
.info-strip p { margin: 0; }
.info-strip a { color: #A3195F; font-weight: 700; text-decoration: underline; }
.info-strip.soft { background: #eef8fb; }
.info-strip.soft > span { color: #347e8d; }

/* Panduan */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.guide-grid h2 { margin: 12px 0 8px; font-size: 1.15rem; }
.guide-grid p { margin: 0; color: var(--muted); line-height: 1.6; }
.step { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--navy); background: var(--lime); font: 800 1rem "Plus Jakarta Sans", sans-serif; }

/* Riwayat & hasil */
.history-row { color: inherit; text-decoration: none; }
.history-row:hover { border-color: #E0A8C4; }
.history-score strong.pass { color: #1d6a4c; }
.review-options li div { min-width: 0; }
.result-topbar a.brand { color: var(--ink); }
.empty-state h2 { margin: 10px 0 6px; }
.empty-state .primary-btn { margin-top: 10px; }
.question-card h1 { white-space: normal; }
.quiz-mode .mobile-nav, .result-mode .mobile-nav { display: none; }
.result-actions a { justify-content: center; }

@media (max-width: 1020px) {
  .side-kelas p { text-align: center; margin-left: 0; }
  #sideKelas { grid-template-columns: 1fr; }
  .kelas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .kelas-grid, .guide-grid { grid-template-columns: 1fr; }
  .kelas-card { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 15px; }
  .kelas-num { width: 52px; height: 52px; font-size: 1.55rem; border-radius: 15px; }
  .seg { display: flex; width: 100%; }
  .seg a { flex: 1; padding: 10px 8px; text-align: center; font-size: .8rem; }
  .mapel-head { align-items: flex-start; gap: 14px; }
  .subject-icon.big { flex-basis: 52px; width: 52px; height: 52px; font-size: 1.3rem; }
  .pdf-toolbar { top: 6px; padding: 8px 8px 8px 12px; font-size: .78rem; }
  .pdf-tools { gap: 5px; }
  .pdf-tools .secondary-btn { padding: 0 9px; }
  .pdf-pages { margin-inline: -10px; gap: 10px; }
  .pdf-after, .download-card { flex-direction: column; align-items: stretch; text-align: left; }
  .pdf-after .primary-btn, .download-actions a { justify-content: center; }
  .download-actions { justify-content: stretch; display: grid; }
  .practice-intro { padding: 22px; }
  .intro-facts { grid-template-columns: repeat(3, 1fr); }
  .intro-actions { display: grid; }
  .intro-actions a { justify-content: center; }
  .chip-row { margin-top: 7px; }
}

@media (max-width: 430px) {
  .pdf-toolbar #pdfInfo { display: none; }
  .pdf-tools { width: 100%; justify-content: space-between; }
}
