/* Gaya fitur baru Mudzakarah AI: Simulasi Ujian, Soal Sulit, Statistik. */
/* ===== Simulasi Ujian ===== */
#exam [hidden] { display: none !important; }
.exam-field { display: block; margin-top: 14px; }
.exam-field label { display: block; font-weight: bold; font-size: 14px; margin-bottom: 6px; }
.exam-field select,
.exam-field input[type="number"] {
  width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px;
  font: inherit; background: white;
}
.exam-hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.exam-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; line-height: 1.5; }
.exam-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.exam-msg { text-align: center; font-size: 14px; color: #a33a2c; min-height: 1em; }
.exam-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--green); color: white; border-radius: 14px;
  padding: 10px 14px; margin-bottom: 14px;
}
.exam-bar small { display: block; opacity: .75; font-size: 11px; }
.exam-timer { font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.exam-timer.warn { color: var(--gold); }
.exam-qtext { font-size: 17px; line-height: 1.7; margin: 8px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.exam-options { display: flex; flex-direction: column; gap: 10px; }
.exam-option {
  display: flex; gap: 12px; align-items: flex-start; text-align: start;
  width: 100%; padding: 12px; background: white; color: var(--text);
  border: 1.5px solid #dcdcd2; border-radius: 12px; line-height: 1.6;
}
.exam-option .exam-letter {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #eef1ec; font-weight: bold; font-size: 14px;
}
.exam-option .exam-otext { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 16px; }
.exam-option.chosen { border-color: var(--green); background: #e9f3ee; }
.exam-option.chosen .exam-letter { background: var(--green); color: white; }
.exam-row { display: flex; gap: 10px; margin-top: 16px; }
.exam-row > button { flex: 1; margin-top: 0; }
.exam-secondary {
  background: white; color: var(--green); border: 1.5px solid var(--green);
  padding: 11px 16px; border-radius: 11px;
}
.exam-secondary:disabled { opacity: .4; }
.exam-link { background: none; border: none; color: #a33a2c; padding: 6px 0; margin-top: 10px; font-size: 13px; }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.exam-grid button {
  height: 44px; border-radius: 10px; border: 1.5px solid #dcdcd2;
  background: white; color: var(--text); font-weight: bold; font-variant-numeric: tabular-nums;
}
.exam-grid button.answered { background: var(--green); border-color: var(--green); color: white; }
.exam-grid button.current { outline: 3px solid var(--gold); outline-offset: 1px; }
.exam-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.exam-legend span::before {
  content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -2px; margin-right: 5px; border: 1.5px solid #dcdcd2; background: white;
}
.exam-legend .lg-answered::before { background: var(--green); border-color: var(--green); }
.exam-legend .lg-current::before { outline: 2px solid var(--gold); }
.exam-legend .lg-flagged::before { box-shadow: inset 0 -5px 0 var(--gold); }
.exam-grid button.flagged { box-shadow: inset 0 -6px 0 var(--gold); }
.exam-confirm { border: 1.5px solid var(--gold); background: #fffaf0; }
.exam-score { text-align: center; }
.exam-score .big { font-size: 54px; font-weight: bold; color: var(--green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.exam-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.exam-stats div { background: #f3f4ef; border-radius: 12px; padding: 10px 4px; text-align: center; }
.exam-stats strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.exam-stats small { font-size: 12px; color: var(--muted); }
.exam-stats .ok strong { color: #287a59; }
.exam-stats .bad strong { color: #c0392b; }
.exam-review details { border-top: 1px solid #ecece5; padding: 12px 0; }
.exam-review details:first-child { border-top: none; }
.exam-review summary { cursor: pointer; line-height: 1.5; overflow-wrap: anywhere; }
.exam-chip { display: inline-block; font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 20px; margin-right: 6px; }
.exam-chip.ok { background: #e3f3ea; color: #1e6a4b; }
.exam-chip.bad { background: #fbe7e4; color: #a33a2c; }
.exam-chip.none { background: #eeeeea; color: #5c665f; }
.exam-review p { margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.exam-history .exam-hrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #ecece5; }
.exam-history .exam-hrow:first-child { border-top: none; padding-top: 0; }
.exam-history .exam-hrow:last-child { padding-bottom: 0; }
.exam-history .exam-hscore { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #e9f3ee; color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: bold; font-variant-numeric: tabular-nums; }
.exam-history .exam-hinfo { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }
.exam-history .exam-hinfo small { color: var(--muted); display: block; }

/* ===== Soal Sulit, Statistik, ringkasan Beranda ===== */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.home-stats button { background: #f3f4ef; border: none; border-radius: 12px; padding: 10px 4px; color: var(--text); }
.home-stats strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.home-stats small { font-size: 12px; color: var(--muted); }
.study-mark { background: white; color: #856324; border: 1.5px solid #e2cf9f; border-radius: 20px; padding: 7px 14px; font-size: 13px; margin-top: 10px; }
.study-mark.on { background: #faf2df; border-color: var(--gold); font-weight: bold; }
.study-mark:disabled { opacity: .5; }
.study-options { padding-left: 24px; margin: 10px 0 0; line-height: 1.7; }
.study-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.study-tiles div { background: #f3f4ef; border-radius: 12px; padding: 12px 4px; text-align: center; }
.study-tiles strong { display: block; font-size: 22px; color: var(--green); font-variant-numeric: tabular-nums; }
.study-tiles small { font-size: 12px; color: var(--muted); }
.study-trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.study-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.study-col span { font-size: 12px; font-weight: bold; font-variant-numeric: tabular-nums; }
.study-col i { display: block; width: 100%; max-width: 34px; background: var(--green2); border-radius: 6px 6px 0 0; }
.study-col small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.study-weak { border-top: 1px solid #ecece5; padding: 12px 0; }
.study-weak:first-child { border-top: none; padding-top: 0; }
.study-weak:last-child { padding-bottom: 0; }
.study-weak p { line-height: 1.6; overflow-wrap: anywhere; }
.study-detail { padding-top: 10px; }

/* ===== Bank Soal: tab, kategori, paket ===== */
.bank-tabs { display: flex; gap: 6px; background: #edf0e9; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.bank-tabs button { flex: 1; border: none; background: transparent; padding: 10px 6px; border-radius: 9px; color: var(--muted); font-weight: bold; font-size: 14px; }
.bank-tabs button.active { background: white; color: var(--green); box-shadow: 0 1px 4px #193d3020; }
.catalog-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid #ecece5; }
.catalog-row:first-child { border-top: none; padding-top: 0; }
.catalog-row.child { padding-left: 18px; border-top-style: dashed; }
.catalog-name { min-width: 0; flex: 1 1 160px; }
.catalog-name strong { display: block; overflow-wrap: anywhere; }
.catalog-name small { color: var(--muted); font-size: 12px; }
.catalog-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.catalog-actions .exam-link { margin-top: 0; }
.catalog-package { border-top: 1px solid #ecece5; padding: 12px 0; }
.catalog-package:first-child { border-top: none; padding-top: 0; }
.catalog-package summary { cursor: pointer; line-height: 1.5; overflow-wrap: anywhere; }
.catalog-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; cursor: pointer; }
.catalog-pick input { width: 18px; height: 18px; }
.catalog-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.catalog-tags .tag { font-size: 12px; }
.catalog-bulk { position: sticky; top: 8px; z-index: 6; margin-bottom: 12px; border: 1.5px solid var(--green2); padding: 12px 14px; }
.catalog-bulk-row { display: flex; gap: 8px; margin-top: 8px; }
.catalog-bulk-row select { flex: 1; min-width: 0; padding: 10px; border: 1px solid #ccc; border-radius: 8px; background: white; font: inherit; }
.catalog-bulk-row .primary { margin-top: 0; padding: 10px 14px; }
.catalog-bulk .exam-hint:empty { display: none; }
.catalog-stat { padding: 8px 0; }
.catalog-stat-head { display: flex; justify-content: space-between; gap: 10px; }
.catalog-stat-head span { min-width: 0; overflow-wrap: anywhere; }
.exam-field input[type="text"] { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; font: inherit; }
#examStartBtn:disabled { opacity: .45; }
