/* Simulator Ujian CA — tampilan (SPEC 3): teks 16px, target sentuh >= 44px,
   kontras WCAG AA, mode gelap mengikuti sistem, dua warna aksen (biru, oranye). */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1b1f24;
  --muted: #555e6b;
  --border: #c9d0da;
  --accent: #1d4ed8;          /* aksen 1: aksi utama */
  --accent-text: #ffffff;
  --accent-soft: #dbe6ff;
  --warn: #b45309;            /* aksen 2: peringatan, tanda */
  --warn-soft: #fdecd3;
  --danger: #b91c1c;
  --ok: #166534;
  --radius: 10px;
  --tap: 44px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1f26;
    --surface-2: #232a33;
    --text: #e8ebef;
    --muted: #a9b2bf;
    --border: #3a4350;
    --accent: #7aa2ff;
    --accent-text: #0b1020;
    --accent-soft: #23314f;
    --warn: #f0a24a;
    --warn-soft: #3a2a14;
    --danger: #ff8a8a;
    --ok: #6fd68f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
/* Atribut hidden selalu menang atas display komponen (mis. .menu { display: grid }). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
h4 { font-size: 1rem; margin: .8rem 0 .3rem; }
p { margin: .4rem 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.screen { max-width: 960px; margin: 0 auto; padding: 16px 16px 48px; }
.app-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.app-header h1 { flex: 1; margin: 0; font-size: 1.3rem; }
.hint { color: var(--muted); font-size: .9rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.stem { font-weight: 500; margin-bottom: .75rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin: 12px 0;
}
.notice { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 6px; margin: 12px 0; }
.notice-info { border-left-color: var(--accent); background: var(--accent-soft); }
.error-list { color: var(--danger); margin: .5rem 0; padding-left: 1.2rem; }
.disclaimer { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 24px; }

/* Tombol */
.btn {
  min-height: var(--tap); min-width: var(--tap); padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-big { width: 100%; font-size: 1.15rem; min-height: 56px; letter-spacing: .03em; }
.btn-link { border: 0; background: none; color: var(--accent); padding: 8px 4px; }
.btn-icon { padding: 8px 12px; font-size: 1.2rem; line-height: 1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Menu sekunder */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); padding: 6px; display: grid;
}
.menu button { text-align: left; border: 0; background: none; min-height: var(--tap); padding: 8px 12px; font: inherit; color: var(--text); border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }

/* Beranda */
.package-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 12px 0 16px; }
.package-card {
  display: flex; flex-direction: column; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px; min-height: 120px;
}
.package-card:hover, .package-card:focus-within { border-color: var(--accent); }
.package-card .name { font-weight: 700; font-size: 1.05rem; display: block; margin: 0 0 6px; }
.package-card .package-start { margin-top: auto; width: 100%; letter-spacing: .03em; }
.package-card .meta:last-of-type { margin-bottom: 12px; }
.package-card .meta { color: var(--muted); font-size: .92rem; display: block; }
.resume-card { border-color: var(--warn); }
select, input[type=number], input[type=text], input[type=search] {
  font: inherit; min-height: var(--tap); padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Formulir kustom */
.form-grid { display: grid; gap: 10px 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.field { display: grid; gap: 4px; }
.form-grid > .field { min-width: 0; }
.form-grid select { width: 100%; }
.field label, .field .label { font-weight: 600; }
.section-table { width: 100%; border-collapse: collapse; }
.section-table th, .section-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.section-table input { width: 100%; max-width: 110px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); margin-right: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; }

/* Ruang ujian */
.exam { min-height: 100vh; display: flex; flex-direction: column; }
.exam-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.exam-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; padding: 0 6px; }
.timer.low { color: var(--warn); }
.exam-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.q-head .q-no { font-weight: 700; }
.q-head .q-meta { color: var(--muted); font-size: .92rem; flex: 1; }
.btn-flag[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn); color: var(--text); }
.exam-nav { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 18px; }
.saved { color: var(--muted); font-size: .88rem; text-align: center; flex: 1; }

.options { display: grid; gap: 8px; margin: 10px 0; }
.option {
  display: flex; gap: 12px; align-items: flex-start; min-height: var(--tap);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); cursor: pointer;
}
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.option-letter { font-weight: 700; min-width: 1.2em; }
.option-text { flex: 1; white-space: pre-wrap; }
.answer-text {
  width: 100%; font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); resize: vertical; min-height: 180px;
}
.numeric-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.input-number { max-width: 220px; }
.unit { color: var(--muted); }

.case-tabs { display: flex; gap: 0; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.case-tabs button { flex: 1; min-height: var(--tap); border: 0; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.case-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.q-case[data-tab="case"] .answer-pane, .q-case[data-tab="answer"] .case-pane { display: none; }
.sub-question { margin-bottom: 14px; }
.sub-prompt { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
.data-table { border-collapse: collapse; min-width: 100%; font-size: .95rem; }
.data-table caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 6px 8px; }
.data-table th { background: var(--surface-2); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (min-width: 900px) and (orientation: landscape) {
  .case-tabs { display: none; }
  .q-case .case-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .q-case[data-tab] .case-pane, .q-case[data-tab] .answer-pane { display: block; }
  .q-case .case-pane { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
  .exam-main:has(.q-case) { max-width: 1400px; }
}

/* Daftar soal: panel bawah di ponsel, panel samping di layar lebar */
.panel-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
.panel {
  position: fixed; z-index: 31; background: var(--surface); padding: 16px;
  left: 0; right: 0; bottom: 0; max-height: 70vh; overflow: auto;
  border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
}
@media (min-width: 900px) {
  .panel { left: auto; top: 0; width: 360px; max-height: none; border-radius: 0; }
}
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin: 12px 0; }
.q-grid button {
  min-height: var(--tap); border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer; position: relative;
}
.q-grid button.answered { background: var(--accent-soft); border-color: var(--accent); }
.q-grid button.flagged::after { content: "⚑"; position: absolute; top: 1px; right: 4px; font-size: .75rem; color: var(--warn); }
.q-grid button.current { outline: 3px solid var(--text); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .88rem; color: var(--muted); }

.overlay {
  position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; padding: 24px; text-align: center;
}

/* Dialog */
.dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); max-width: min(520px, 92vw); padding: 20px; }
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog h2 { margin-top: 0; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.summary-grid div { background: var(--surface-2); border-radius: 8px; padding: 8px; }
.summary-grid strong { display: block; font-size: 1.4rem; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; max-width: 92vw;
  transition: transform .2s ease;
}
.toast.show { transform: translate(-50%, 0); }

/* Hasil */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .9rem; background: var(--surface-2); }
.badge-wait { background: var(--warn-soft); color: var(--text); }
.badge-pass { background: var(--ok); color: #fff; }
.badge-fail { background: var(--danger); color: #fff; }
.score-table { width: 100%; border-collapse: collapse; }
.score-table th, .score-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; }
.score-table td.num, .score-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.share-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.big-score { font-size: 2.2rem; font-weight: 800; }
.history-list { display: grid; gap: 8px; }
.history-item { width: 100%; text-align: left; display: grid; gap: 2px; }

/* Self-test */
.selftest-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.selftest-table td { border-bottom: 1px solid var(--border); padding: 4px 6px; vertical-align: top; }
.pass { color: var(--ok); font-weight: 700; }
.fail { color: var(--danger); font-weight: 700; }
.skip { color: var(--muted); }

@media (max-width: 480px) {
  .exam-bar .btn { padding: 6px 10px; }
  .exam-bar .label-long { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* Hasil dan laporan (A2) */
.small { font-size: .88rem; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: .92rem; }
.report-section > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 700; font-size: 1.1rem; }
.report-section > summary .summary-title { flex: 1; }
.section-body { margin-top: 8px; }
.section-body h3 { margin-top: 1.4rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.prose-list { margin: .3rem 0 .8rem; padding-left: 1.3rem; white-space: pre-wrap; }
.report-table { min-width: 0; width: 100%; }
.report-table td, .report-table th { white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; text-align: left; }
.fill-dcf2e3 { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.fill-fdecd3 { background: var(--warn-soft); }
.grade-status { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.grade-status li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); padding: 4px 0; }
.grading-steps { margin: 4px 0 8px; padding-left: 1.3rem; }
.grading-steps li { margin: 2px 0; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.mail-info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.mail-info dt { font-weight: 600; }
.mail-info dd { margin: 0; overflow-wrap: anywhere; }
.paste-area { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.import-errors .error-list { overflow-wrap: anywhere; }
details > summary { cursor: pointer; }
dialog .field { margin: 10px 0; }
dialog select, dialog input[type=text] { width: 100%; }

/* Grafik tren (Riwayat) */
.trend-chart { width: 100%; height: auto; display: block; }
.trend-grid { stroke: var(--border); stroke-width: 1; }
.trend-pass { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.trend-axis { fill: var(--muted); font-size: 12px; }
.trend-value { fill: var(--text); font-size: 13px; font-weight: 700; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-hit { fill: transparent; }
.trend-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.trend-dot-fail { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.trend-point { cursor: pointer; outline: none; }
.trend-point:focus-visible .trend-hit, .trend-point:hover .trend-hit { fill: var(--accent-soft); }

/* Pengelola Bank Soal (A3) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border); margin: 12px 0; }
.tab { min-height: var(--tap); padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.tab.active { background: var(--surface); border-color: var(--border); font-weight: 700; margin-bottom: -2px; border-bottom: 2px solid var(--surface); }
.bank-table td { vertical-align: middle; }
.bank-table input[type=checkbox] { width: 22px; height: 22px; }
/* Daftar Soal ringkas (D-122): kontrol lebih kecil agar tabel cepat terlihat. */
.bank-controls { font-size: .88rem; }
.bank-controls .field { gap: 2px; }
.bank-controls .field label { font-size: .8rem; }
.bank-controls select, .bank-controls input[type=search], .bank-controls .btn { min-height: 34px; padding: 4px 10px; font-size: .88rem; }
.bank-controls .btn-icon, .pager .btn-icon { min-height: 34px; min-width: 34px; padding: 4px 10px; font-size: 1.05rem; }
.bank-table { font-size: .88rem; }
.bank-table th, .bank-table td { padding: 3px 8px; }
.bank-table .btn-link { padding: 2px 0; white-space: nowrap; }
.bank-table .badge { padding: 2px 8px; font-size: .8rem; }
.bank-table input[type=checkbox] { width: 18px; height: 18px; }
.bank-controls .btn-link { padding: 4px; }
.bank-controls .hint { font-size: .82rem; }
.bank-filters { display: grid; gap: 6px 10px; align-items: end; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.bank-filters select, .bank-filters input[type=search] { width: 100%; min-width: 0; }
.bank-filters .search-field { grid-column: span 2; }
@media (min-width: 900px) {
  .bank-filters { grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(100px, 1fr)) auto; }
  .bank-filters .search-field { grid-column: auto; }
}
.bank-filters > .btn { justify-self: start; }
.bank-actions { gap: 6px; margin: 8px 0 4px; }
.pager { gap: 6px; margin: 4px 0 6px; justify-content: flex-end; }
.pager-summary { margin-right: auto; }
.pager-nav { flex-wrap: nowrap; gap: 6px; }
@media (pointer: coarse) {
  .bank-controls select, .bank-controls input[type=search], .bank-controls .btn { min-height: 40px; }
  .bank-controls .btn-icon, .pager .btn-icon { min-height: 40px; min-width: 40px; }
  .bank-table input[type=checkbox] { width: 22px; height: 22px; }
}
.selected-row { background: var(--accent-soft); }
.warn-row td { background: var(--warn-soft); }
.status-live { background: var(--ok); color: #fff; }
.status-approved, .status-ai_reviewed { background: var(--accent-soft); color: var(--text); }
.status-needs_revision, .status-calibration { background: var(--warn-soft); color: var(--text); }
.status-rejected, .status-retired { background: var(--surface-2); color: var(--muted); }
.preview-view { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; margin: 10px 0; background: var(--bg); }
.pending-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.pending-list li { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.log-list { padding-left: 1.2rem; font-size: .92rem; }
.pin-card { max-width: 420px; }

/* PWA, iOS, SEB (A4): safe-area untuk notch/home indicator, mode fokus, spanduk pembaruan */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.screen { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom))); }
.exam-bar { padding-top: max(6px, env(safe-area-inset-top)); }
.exam-main { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.panel { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
.exam { min-height: 100vh; min-height: 100dvh; }
.exam.focus-mode .exam-title, .exam.focus-mode .q-meta, .exam.focus-mode .badge-seb { display: none; }
.exam.focus-mode .exam-main { max-width: none; padding-top: 8px; }
html.exam-focus, html.exam-focus body { overscroll-behavior: none; }
.update-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 45;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text); border: 2px solid var(--accent); border-radius: 12px;
  padding: 10px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: calc(100vw - 24px);
}
.install-card { border-color: var(--accent); }
.badge-seb { background: var(--ok); color: #fff; white-space: nowrap; }
@media print { .update-banner { display: none !important; } }

/* ---------- Kalkulator mengambang ---------- */
.calc-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px;
  border-radius: 26px; border: 0; z-index: 900; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); cursor: pointer;
}
.calc-fab-icon { font-size: 1.4rem; line-height: 1; }
.calc-panel {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: min(300px, calc(100vw - 32px)); z-index: 901; padding: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.calc-panel { cursor: grab; touch-action: none; user-select: none; }
.calc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calc-title { font-weight: 600; flex: 1; }
.calc-title { white-space: nowrap; }
.calc-title small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.calc-side {
  min-width: var(--tap); min-height: var(--tap); border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 1.2rem; cursor: pointer;
}
.calc-side:hover { background: var(--surface-2); }
.calc-close {
  min-width: var(--tap); min-height: var(--tap); border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.calc-close:hover { background: var(--surface-2); }
.calc-screen {
  background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  text-align: right; overflow: hidden;
}
.calc-expr { min-height: 1.5em; color: var(--muted); font-size: .95rem; overflow-x: auto; white-space: nowrap; }
.calc-result { min-height: 1.6em; font-size: 1.5rem; font-weight: 600; overflow-x: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-result.error { font-size: 1rem; color: var(--danger); }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-key {
  cursor: pointer;
  min-height: var(--tap); border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 1.15rem; cursor: pointer;
}
.calc-key:hover { background: var(--surface-2); }
.calc-key.fn { background: var(--surface-2); }
.calc-key.op { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.calc-key.eq { grid-column: 1 / -1; background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
@media print { .calc-fab, .calc-panel { display: none !important; } }

/* Halaman awal (D-103, desain baru D-123): kepala hijau tua dan amber, lebar penuh.
   Warna tetap (tidak ikut mode gelap) agar sesuai desain. Font dari sistem karena
   aplikasi tanpa CDN; Plus Jakarta Sans dipakai bila terpasang di perangkat. */
.lp {
  --lp-ink: #0F2A24; --lp-ink-line: #3B5A51; --lp-amber: #E8B04B; --lp-amber-dark: #C98A14; --lp-amber-text: #9A6608;
  --lp-paper: #F4F5F1; --lp-paper-2: #ECEFEA; --lp-white: #FFFFFF; --lp-text: #12201C; --lp-muted: #4A5A55;
  --lp-on-ink: #F4F5F1; --lp-on-ink-muted: #C8D3CE; --lp-on-ink-soft: #9FB2AA; --lp-line: #DDE3DF;
  --lp-green: #0F5C4A; --lp-green-bg: #EAF3EF; --lp-ok: #1E7A55; --lp-ok-bg: #E3F2EA; --lp-bad: #B3412E; --lp-bad-bg: #FBE9E6;
  --lp-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, Menlo, monospace;
  max-width: none; padding: 0 !important; margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--lp-text); background: var(--lp-paper); line-height: 1.5; color-scheme: light;
}
body:has(.lp) { background: var(--lp-paper, #F4F5F1); }
.lp a { color: var(--lp-green); }
.lp h1, .lp h2, .lp h3 { margin: 0; letter-spacing: -.02em; color: inherit; }
.lp h2 { font-size: clamp(28px, 3.5vw, 40px); line-height: 1.15; font-weight: 800; }
.lp-wrap { max-width: 1200px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.lp-eyebrow { font-family: var(--lp-mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--lp-green); text-transform: uppercase; }
.lp-lead { margin: 0; font-size: 17px; line-height: 1.6; color: var(--lp-muted); }
.lp-meta { font-family: var(--lp-mono); font-size: 13px; color: var(--lp-muted); }
.lp-section-head { display: flex; flex-direction: column; gap: 12px; max-width: 44rem; }

.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 12px 20px;
  border-radius: 12px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 0; text-align: left;
}
.lp-btn-lg { font-size: 17px; padding: 16px 26px; }
.lp-btn-amber { background: var(--lp-amber); color: var(--lp-ink); }
.lp-btn-amber:hover { background: #F0BE60; }
.lp-btn-ink { background: var(--lp-ink); color: var(--lp-white); }
.lp-btn-ink:hover { background: #18392F; }
.lp-btn-ghost { background: transparent; color: var(--lp-on-ink); border: 1px solid var(--lp-ink-line); }
.lp-btn-ghost:hover { color: var(--lp-white); border-color: #5C7F74; }
.lp-btn:focus-visible, .lp-navlink:focus-visible, .lp-tab:focus-visible, .lp-opt:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; }

/* Kepala dan hero */
.lp-top { background: var(--lp-ink); color: var(--lp-on-ink); padding-top: env(safe-area-inset-top); }
.lp-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.lp-brand { display: flex; align-items: center; gap: 12px; color: var(--lp-on-ink); }
.lp-logo { flex: none; }
.lp-brand-text { display: flex; flex-direction: column; gap: 3px; }
.lp-brand-name { font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -.02em; }
.lp-brand-name span { color: var(--lp-amber); }
.lp-brand-tag { font-weight: 600; font-size: 11.5px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--lp-on-ink-muted); }
.lp-navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 15px; }
.lp-navlink { font: inherit; background: none; border: 0; padding: 8px 0; min-height: 44px; color: #D5DED9; cursor: pointer; }
.lp-navlink:hover { color: var(--lp-white); }
.lp-navlinks .btn-icon { background: transparent; color: var(--lp-on-ink); border-color: var(--lp-ink-line); }
.lp-navlinks .menu { color: var(--text); }
.lp-hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 48px; padding-bottom: 96px; }
.lp-hero-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.lp-pill { align-self: flex-start; font-family: var(--lp-mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--lp-amber); border: 1px solid var(--lp-ink-line); padding: 8px 12px; border-radius: 999px; }
.lp-hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.lp-hero p { margin: 0; font-size: 19px; line-height: 1.6; color: var(--lp-on-ink-muted); max-width: 34rem; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-hero .lp-actions { margin-top: 8px; }
.lp-hero small { font-size: 14px; color: var(--lp-on-ink-soft); }
.lp-preview { flex: 1 1 420px; min-width: 0; margin: 0; }
.lp-preview-card { background: var(--lp-white); color: var(--lp-text); border-radius: 18px; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.lp-preview-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid #E3E8E5; font-weight: 700; font-size: 15px; }
.lp-timer { font-family: var(--lp-mono); font-weight: 600; background: #FFF4DC; color: #7A4D00; padding: 6px 10px; border-radius: 8px; }
.lp-preview-body { padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.lp-hero .lp-preview-body p { color: var(--lp-text); font-size: 17px; max-width: none; }
.lp-preview-opt { border: 1px solid #D5DDD9; border-radius: 10px; padding: 12px 14px; font-size: 15px; display: flex; gap: 12px; }
.lp-preview-opt.lp-sel { border: 2px solid var(--lp-green); background: var(--lp-green-bg); padding: 11px 13px; }
.lp-preview-nav { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.lp-preview-nav b { color: var(--lp-white); background: var(--lp-ink); padding: 10px 16px; border-radius: 8px; }

/* Bagian dan kartu */
.lp-block { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 32px; }
.lp-first { padding-top: 96px; }
.lp-last { padding-bottom: 96px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.lp-card { background: var(--lp-white); border: 1px solid var(--lp-line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.lp-card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--lp-muted); }
.lp-card .lp-btn { align-self: flex-start; margin-top: auto; }
.lp-card-title { font-size: 23px; font-weight: 800; }
.lp-level-on { border: 2px solid var(--lp-green); }
.lp-level-off { background: var(--lp-paper-2); border: 1px dashed #A9B8B1; }
.lp-level-off h3 { color: #33443F; }
.lp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lp-card-head h3 { font-size: 26px; font-weight: 800; }
.lp-badge { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.lp-badge-on { color: var(--lp-white); background: var(--lp-green); }
.lp-badge-dev { color: #7A4D00; background: #FFE9B8; }
.lp-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.lp-checks li { display: flex; gap: 10px; align-items: flex-start; }
.lp-checks svg { flex: none; margin-top: 2px; }

/* Contoh soal */
.lp-quiz { background: var(--lp-white); border: 1px solid var(--lp-line); border-radius: 20px; padding: clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 24px; }
.lp-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-tab { font: inherit; font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 999px; min-height: 44px; cursor: pointer; border: 1px solid #C5D0CB; background: var(--lp-white); color: var(--lp-text); }
.lp-tab[aria-pressed="true"] { background: var(--lp-ink); border-color: var(--lp-ink); color: var(--lp-white); }
.lp-quiz-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 15px; color: var(--lp-muted); }
.lp-quiz-status b { color: var(--lp-text); }
.lp-quiz-status span { font-family: var(--lp-mono); }
.lp-qlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; }
.lp-q { border: 1px solid var(--lp-line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: var(--lp-paper); }
.lp-q-text { margin: 0; font-size: 17px; line-height: 1.55; font-weight: 500; }
.lp-opts { display: flex; flex-direction: column; gap: 10px; }
.lp-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; min-height: 44px; padding: 12px 14px; border-radius: 10px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--lp-text); cursor: pointer; border: 2px solid #D5DDD9; background: var(--lp-white); }
.lp-opt b { flex: none; color: var(--lp-muted); }
.lp-opt[aria-pressed="true"] { border-color: var(--lp-green); background: var(--lp-green-bg); }
.lp-opt[aria-pressed="true"] b { color: var(--lp-green); }
.lp-opt.lp-correct { border-color: var(--lp-ok); background: var(--lp-ok-bg); }
.lp-opt.lp-correct b { color: var(--lp-ok); }
.lp-opt.lp-wrong { border-color: var(--lp-bad); background: var(--lp-bad-bg); }
.lp-opt.lp-wrong b { color: var(--lp-bad); }
.lp-opt:disabled { cursor: default; opacity: 1; }
.lp-explain { background: var(--lp-white); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55; color: #33443F; }
.lp-v-ok { color: var(--lp-ok); }
.lp-v-bad { color: var(--lp-bad); }
.lp-check { align-self: flex-start; font-weight: 800; }
.lp-result { background: var(--lp-ink); color: var(--lp-on-ink); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.lp-score { font-family: var(--lp-mono); font-size: 24px; font-weight: 600; color: var(--lp-amber); }
.lp-result p { margin: 0; color: var(--lp-on-ink-muted); }
.lp-note { margin: 0; font-size: 14px; color: var(--lp-muted); }

/* Cara kerja */
.lp-steps { margin: 0; padding: 0; list-style: none; }
.lp-step-num { font-family: var(--lp-mono); font-size: 32px; font-weight: 600; color: var(--lp-amber-dark); }
.lp-steps h3 { font-size: 21px; font-weight: 700; }

/* Sebelum mulai */
.lp-ready { background: var(--lp-ink); color: var(--lp-on-ink); border-radius: 24px; padding: clamp(28px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.lp-ready-copy { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.lp-ready-copy .lp-eyebrow { color: var(--lp-amber); }
.lp-ready-copy p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--lp-on-ink-muted); }
.lp-facts { margin: 8px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lp-facts div { border: 1px solid var(--lp-ink-line); border-radius: 14px; padding: 16px; }
.lp-facts dt { font-size: 13px; color: var(--lp-on-ink-soft); }
.lp-facts dd { margin: 6px 0 0; font-size: 18px; font-weight: 600; }
.lp-facts dd.lp-num { font-family: var(--lp-mono); font-size: 20px; }
.lp-facts dd.lp-free { color: var(--lp-amber); }
.lp-checklist { flex: 1 1 360px; min-width: 0; background: var(--lp-paper); color: var(--lp-text); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.lp-checklist h3 { font-size: 20px; font-weight: 700; }
.lp-checklist ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; font-size: 16px; }
.lp-checklist li { display: flex; gap: 12px; }
.lp-checklist svg { flex: none; }
.lp-start { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lp-start p { margin: 0; }
.lp-start-label { font-weight: 800; font-size: 18px; }
.lp-btn-start { width: 100%; justify-content: space-between; font-size: 17px; font-weight: 800; padding: 16px 22px; }

/* FAQ */
.lp-faq { max-width: 860px; margin: 0 auto; padding: 0 24px 96px; display: flex; flex-direction: column; gap: 28px; }
.lp-faq-list { display: flex; flex-direction: column; gap: 12px; }
.lp-faq details { background: var(--lp-white); border: 1px solid var(--lp-line); border-radius: 14px; padding: 20px 24px; }
.lp-faq summary { font-weight: 700; font-size: 18px; cursor: pointer; }
.lp-faq details p { margin: 12px 0 0; font-size: 16px; line-height: 1.6; color: var(--lp-muted); }

/* Kaki dan kartu lanjutkan ujian */
.lp-footer { border-top: 1px solid var(--lp-line); background: var(--lp-paper-2); padding-bottom: env(safe-area-inset-bottom); }
.lp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 32px; padding-bottom: 32px; font-size: 14px; color: var(--lp-muted); }
.lp-foot .lp-brand { color: var(--lp-text); align-self: flex-start; }
.lp-foot .lp-brand-name { font-size: 21px; }
.lp-foot .lp-brand-name span { color: var(--lp-amber-text); }
.lp-foot .lp-brand-tag { font-size: 10.5px; color: var(--lp-muted); }
.lp-foot-text { max-width: 40rem; display: flex; flex-direction: column; gap: 8px; }
.lp-foot p { margin: 0; line-height: 1.6; }
.lp-foot .disclaimer { color: var(--lp-muted); font-size: 13px; border: 0; padding: 0; background: none; }
.lp-resume { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 20px; border-radius: 14px; background: #FFF4DC; border: 1px solid #F0D59A; }
.lp-resume p { margin: 0; font-weight: 600; }

@media (max-width: 640px) {
  .lp-navlinks { gap: 4px 16px; }
  .lp-hero { padding-top: 24px; padding-bottom: 64px; gap: 40px; }
  .lp-first { padding-top: 64px; }
  .lp-facts { grid-template-columns: 1fr; }
  .lp-brand-name { font-size: 24px; }
}
/* Kalkulator mengambang tidak diperlukan di halaman awal. */
body:has(.landing) .calc-fab { display: none; }
/* Pesan bantuan bila aplikasi gagal atau terlalu lama terbuka (D-105). */
.boot-help { border-left: 4px solid var(--warn); }
.boot-help h2 { margin-top: 0; }
.boot-help ol { padding-left: 1.3rem; }
.boot-info { overflow-wrap: anywhere; font-size: .8rem; }
