/* =========================================================
   KODING.CSS — tampilan koding.html (v6, antarmuka terang + editor gelap)
   Butuh base.css dimuat lebih dulu.
   Susunan: header tipis, kiri: misi & instruksi, kanan: editor, hasil, tombol.
   ========================================================= */

:root { --header-h: 60px; }
html, body { height: 100%; overflow: hidden; }

/* ---------- Header ---------- */
.bk-header {
  height: var(--header-h); background: var(--bg-panel); border-bottom: 1px solid var(--line);
  padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative;
}
/* Penggaris tipis di tepi bawah: ciri khas "bengkel" */
.bk-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; pointer-events: none;
  background:
    linear-gradient(90deg, var(--line-strong) 1px, transparent 1px) 0 100% / 40px 7px repeat-x,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 100% / 8px 3px repeat-x;
}
.bk-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.bk-brand-mark { font-family: var(--font-brand); font-weight: 500; font-size: 21px; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); }
.bk-brand-mark span { font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--ok)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bk-brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.bk-student-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.bk-student-badge #bkStudentName { flex-shrink: 0; max-width: 180px; font-family: var(--font-code); font-size: 12.5px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-help-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; font-size: 12.5px; padding: 5px 11px; cursor: pointer; font-family: var(--font-ui); transition: color .15s, border-color .15s, background .15s; white-space: nowrap; }
.bk-help-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.bk-header-right { display: flex; align-items: center; gap: 16px; }

/* Penanda tiga tahap */
.bk-steps { display: flex; align-items: center; gap: 8px; }
.bk-step { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bk-step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-code); font-size: 12px; font-weight: 500; border: 1.5px solid var(--line-strong); background: var(--bg-panel); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.bk-step-t { white-space: nowrap; }
.bk-step--current { color: var(--text); font-weight: 600; }
.bk-step--current .bk-step-n { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.bk-step--done { color: var(--muted); }
.bk-step--done .bk-step-n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.bk-step-bar { width: 20px; height: 2px; border-radius: 2px; background: var(--line); transition: background .2s ease; }
.bk-step-bar--done { background: var(--accent); }
.bk-step--link { cursor: pointer; }
.bk-step--link:hover .bk-step-n, .bk-step--link:focus-visible .bk-step-n { box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-step--link:focus-visible { outline: none; }

/* Status kirim data */
.bk-sync[hidden] { display: none; }
.bk-sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-page); white-space: nowrap; }
.bk-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.bk-sync--ok { color: var(--ok); border-color: rgba(111,191,115,.4); } .bk-sync--ok .bk-sync-dot { background: var(--ok); }
.bk-sync--idle .bk-sync-dot { background: var(--accent); }
.bk-sync--sending { color: var(--accent); } .bk-sync--sending .bk-sync-dot { background: var(--accent); animation: bk-sync-blink 1s ease-in-out infinite; }
.bk-sync--offline, .bk-sync--retry { color: var(--help); border-color: var(--help-fill); background: var(--help-soft); } .bk-sync--offline .bk-sync-dot, .bk-sync--retry .bk-sync-dot { background: var(--help-fill); animation: bk-sync-blink 1.4s ease-in-out infinite; }
@keyframes bk-sync-blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .bk-sync-dot { animation: none !important; } }

@media (max-width: 1360px) {
  .bk-brand-sub { display: none; }
  .bk-step:not(.bk-step--current) .bk-step-t { display: none; }
}

/* ---------- Susunan utama ---------- */
.bk-main { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); align-items: stretch; }
@media (max-width: 900px) {
  .bk-header { height: auto; min-height: var(--header-h); flex-wrap: wrap; padding: 10px 16px 14px; row-gap: 10px; }
  .bk-header-right { width: 100%; justify-content: space-between; }
  .bk-main { grid-template-columns: 1fr; height: auto; }
  html, body { height: auto; overflow: visible; }
  .bk-briefing, .bk-console { overflow-y: visible; }
  .bk-briefing { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .bk-step-t { display: none; }
  .bk-step--current .bk-step-t { display: inline; }
}

/* ---------- Panel kiri: misi & instruksi ---------- */
.bk-briefing { overflow-y: auto; background: var(--bg-panel); color: var(--text); padding: 28px; border-right: 1px solid var(--line); }
.bk-scaffold-tag {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500;
  padding: 4px 11px; border-radius: 999px; margin-bottom: 16px;
  background: var(--bg-raised); color: var(--muted); border: 1px solid var(--line);
}
.bk-scaffold-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bk-scaffold-tag--amati { color: var(--ok); border-color: rgba(111,191,115,.35); background: var(--ok-soft); }
.bk-scaffold-tag--sedang { color: var(--accent); border-color: rgba(108,180,242,.35); background: var(--accent-soft); }
.bk-scaffold-tag--mandiri { color: var(--accent-2); border-color: rgba(169,180,200,.35); background: var(--accent-2-soft); }

.bk-eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bk-title { font-family: var(--font-brand); font-weight: 700; font-size: 28px; line-height: 1.2; margin: 0 0 20px; letter-spacing: -0.005em; color: var(--text); }

.bk-section { margin-bottom: 20px; }
.bk-section-label { font-family: var(--font-brand); font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 6px; }
.bk-task-box { background: var(--accent-soft); border: 1px solid rgba(108,180,242,.22); border-radius: var(--radius-m); padding: 14px 16px 15px; }
.bk-task { font-size: 15px; line-height: 1.65; margin: 0; color: var(--text); max-width: 38em; }

.bk-hint-toggle {
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--bg-panel); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; margin-bottom: 10px; transition: color .15s, border-color .15s, background .15s;
}
.bk-hint-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bk-hint-box {
  display: none; font-size: 14.5px; line-height: 1.65; background: var(--help-soft); color: var(--text);
  border: 1px solid var(--help-fill); padding: 12px 14px; border-radius: var(--radius-m);
}
.bk-hint-box--open { display: block; animation: bk-rise 0.25s ease-out both; }
/* Isi petunjuk: judul, langkah bernomor dengan garis penghubung, dan kotak "Uji" */
.bk-hint-box { padding: 14px 15px 13px; }
.bk-hint-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: var(--font-brand); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--help); }
.bk-hint-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--help); }
.bk-hint-steps { list-style: none; margin: 0; padding: 0; counter-reset: hs; display: grid; gap: 12px; }
.bk-hint-steps li { counter-increment: hs; position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 11px; align-items: start; }
.bk-hint-steps li::before { content: counter(hs); width: 26px; height: 26px; border-radius: 50%; background: var(--help-fill); color: var(--on-help); font: 700 13px/26px var(--font-brand); text-align: center; }
.bk-hint-steps li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: -10px; width: 2px; background: rgba(217,161,59,.35); }
.bk-hint-steps b { display: block; margin-bottom: 2px; font-size: 14.5px; color: var(--text); }
.bk-hint-steps li > div { font-size: 14px; line-height: 1.6; color: var(--text); }
.bk-hint-try { margin-top: 14px; padding: 9px 12px; border: 1px solid rgba(217,161,59,.55); border-radius: 8px; background: rgba(255,255,255,.65); font-size: 13.5px; line-height: 1.55; color: var(--text); }
.bk-hint-try b { color: var(--help); }
.bk-hint-box code { font-family: var(--font-code); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: rgba(31,41,51,.08); color: var(--accent-strong); }
@keyframes bk-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Panel kanan: area kerja ---------- */
.bk-console { overflow-y: auto; background: var(--bg-page); padding: 20px 26px 22px; display: flex; flex-direction: column; min-width: 0; }
.bk-editor-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 0; flex-shrink: 0; }
.bk-filename {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-code); font-size: 13px; color: var(--code-text);
  background: var(--code-bg); padding: 8px 16px; border-radius: 8px 8px 0 0;
}
.bk-filename::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--run); }
.bk-run-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px; line-height: 1.2;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: 8px;
  padding: 9px 18px; cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.bk-run-btn:hover { background: var(--accent-strong); }
.bk-run-btn:active { transform: translateY(1px); }
.bk-run-btn:disabled { cursor: progress; opacity: .85; transform: none; }
.bk-run-ico { flex-shrink: 0; }
.bk-run-kbd {
  font-family: var(--font-code); font-size: 11px; font-weight: 500; line-height: 1;
  padding: 3px 6px; border-radius: 4px; background: rgba(0,0,0,0.18); color: var(--on-accent);
  border: 1px solid rgba(255,255,255,0.3);
}
@media (hover: none), (max-width: 640px) { .bk-run-kbd { display: none; } }

/* Editor CodeMirror: tema "bengkel" (dipasang lewat opsi theme di koding.js) */
.CodeMirror {
  height: clamp(230px, 36vh, 380px); border-radius: 0 var(--radius-m) 0 0; border: 1px solid var(--code-line); border-bottom: none;
  font-family: var(--font-code); font-size: 13px; line-height: 1.55; background: var(--code-bg); color: var(--code-text);
  flex-shrink: 0; transition: border-color .15s ease, box-shadow .15s ease;
}
.CodeMirror-focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.CodeMirror-cursor { border-left: 2px solid var(--run) !important; }
.CodeMirror-gutters { background: var(--code-bg); border-right: 1px solid var(--code-line); }
.CodeMirror-linenumber { color: var(--code-muted); opacity: .75; }
.CodeMirror-selected { background: rgba(108,180,242,.18) !important; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: rgba(108,180,242,.22); }
.bk-error-line { background: rgba(229,101,95,.2) !important; }

.cm-s-bengkel .cm-keyword { color: var(--syn-keyword); }
.cm-s-bengkel .cm-atom, .cm-s-bengkel .cm-number { color: var(--syn-num); }
.cm-s-bengkel .cm-def, .cm-s-bengkel .cm-variable, .cm-s-bengkel .cm-variable-2, .cm-s-bengkel .cm-variable-3 { color: var(--syn-var); }
.cm-s-bengkel .cm-property { color: var(--syn-fn); }
.cm-s-bengkel .cm-operator { color: var(--syn-keyword); }
.cm-s-bengkel .cm-string, .cm-s-bengkel .cm-string-2 { color: var(--syn-str); }
.cm-s-bengkel .cm-comment { color: var(--syn-comment); font-style: italic; }
.cm-s-bengkel .cm-builtin { color: var(--syn-fn); }
.cm-s-bengkel .cm-meta, .cm-s-bengkel .cm-bracket, .cm-s-bengkel .cm-punctuation { color: var(--code-text); }
.cm-s-bengkel .cm-error { color: #fca5a5; }

/* Baris status di bawah editor */
.bk-statusbar {
  display: flex; justify-content: space-between; gap: 12px; flex-shrink: 0;
  font-family: var(--font-code); font-size: 12px; padding: 6px 14px;
  background: var(--accent); color: var(--on-accent); border-radius: 0 0 var(--radius-m) var(--radius-m);
}

/* Petunjuk di dalam editor */
.bk-editor-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(108,180,242,.16); color: #bfe0fb; border-radius: 6px;
  padding: 5px 10px; margin: 3px 8px; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
}
.bk-editor-hint-ok {
  font-family: var(--font-ui); font-weight: 600; font-size: 12px;
  background: var(--accent); color: var(--on-accent); border: none; border-radius: 5px;
  padding: 3px 10px; cursor: pointer; flex-shrink: 0;
}

/* ---------- Kotak umpan balik ---------- */
.bk-feedback {
  font-size: 14px; padding: 12px 14px; border-radius: var(--radius-m); margin: 12px 0;
  color: var(--muted); background: var(--bg-panel); border: 1px solid var(--line); line-height: 1.6;
  animation: bk-feedback-in .18s ease-out;
}
@keyframes bk-feedback-in { from { opacity: .3; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.bk-feedback--pass { color: var(--text); background: var(--ok-soft); border-color: rgba(111,191,115,.45); }
.bk-feedback--fail { color: var(--text); background: var(--err-soft); border-color: rgba(229,101,95,.4); }
.bk-feedback code { font-family: var(--font-code); font-size: .92em; background: rgba(229,101,95,.1); color: var(--err); padding: 1px 6px; border-radius: 4px; }
.bk-fb { display: flex; gap: 12px; align-items: flex-start; }
.bk-fb-ico { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--font-code); background: var(--err); color: var(--on-err); }
.bk-feedback--pass .bk-fb-ico { background: var(--ok); }
.bk-feedback--syntax { background: var(--help-soft); border-color: var(--help-fill); }
.bk-feedback--syntax .bk-fb-ico { background: var(--help-fill); color: var(--on-help); }
.bk-feedback--syntax code { background: rgba(217,161,59,.14); color: var(--help); }
.bk-fb-main { min-width: 0; flex: 1; }
.bk-fb-title { display: block; font-size: 14.5px; margin-bottom: 2px; color: var(--text); }
.bk-feedback--pass .bk-fb-title { color: var(--ok); }
.bk-fb-body { color: var(--text); }
.bk-fb-note { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.bk-fb-raw { display: block; margin-top: 6px; font-family: var(--font-code); font-size: 12px; color: var(--muted); word-break: break-word; }
.bk-output-compare { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.bk-output-compare th { text-align: left; padding: 4px 8px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line-strong); }
.bk-output-compare td { padding: 5px 8px; border-bottom: 1px solid var(--line); font-family: var(--font-code); }
.bk-output-compare code { color: var(--muted); background: transparent; padding: 0; }
.bk-output-got { color: var(--err); }
.bk-output-want { color: var(--ok); }
.bk-solution-code { font-family: var(--font-code); font-size: 13px; background: var(--code-bg); color: var(--code-text); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; margin: 8px 0; }

/* ---------- Soal prediksi output (Tahap 1) ---------- */
.bk-prediction-box { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin: 12px 0; flex-shrink: 0; animation: bk-rise .3s ease-out both; }
.bk-prediction-q { font-size: 15px; color: var(--text); margin: 0 0 14px; font-weight: 600; line-height: 1.55; }
.bk-prediction-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bk-prediction-option {
  font-family: var(--font-code); font-size: 14px; background: var(--bg-panel); border: 1.5px solid var(--line-strong);
  border-radius: 8px; padding: 9px 16px; cursor: pointer; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.bk-prediction-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.bk-prediction-option--selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.bk-prediction-feedback { font-size: 14px; margin: 12px 0 0; min-height: 18px; }
.bk-prediction-feedback--success { color: var(--ok); font-weight: 500; }
.bk-prediction-feedback--error { color: var(--err); font-weight: 500; }

/* ---------- Pratinjau & Console ---------- */
.bk-output { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; flex-shrink: 0; }
@media (max-width: 640px) { .bk-output { grid-template-columns: 1fr; } }
.bk-pane { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.bk-pane-label { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg-raised); }
.bk-pane-body { padding: 10px 14px; font-size: 13px; color: var(--text); min-height: 48px; font-family: var(--font-code); line-height: 1.55; }
.bk-pane:nth-child(2) { background: var(--code-bg); border-color: var(--code-line); }
.bk-pane:nth-child(2) .bk-pane-label { background: var(--code-bg-2); border-bottom-color: var(--code-line); color: var(--code-muted); }
.bk-pane:nth-child(2) .bk-pane-body { color: var(--code-text); }
.bk-empty { color: var(--muted); font-size: 13.5px; margin: 0; font-family: var(--font-ui); }
.bk-pane:nth-child(2) .bk-empty { color: var(--code-muted); }
.bk-log-line { padding: 1px 0; animation: bk-line-in .2s ease-out both; }
@keyframes bk-line-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.bk-log-line { border-left: 2px solid var(--code-line); padding-left: 10px; }
.bk-log-line--err { color: #fca5a5; }
.bk-log-line--err { border-left-color: var(--err); }

/* Loading saat kode dijalankan */
.bk-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: bk-spin .7s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-skel { display: grid; gap: 8px; padding: 4px 0; }
.bk-skel i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(128,150,160,.15) 25%, rgba(128,150,160,.32) 50%, rgba(128,150,160,.15) 75%); background-size: 200% 100%; animation: bk-shimmer 1.1s linear infinite; }
.bk-skel i:nth-child(1) { width: 70%; } .bk-skel i:nth-child(2) { width: 45%; } .bk-skel i:nth-child(3) { width: 58%; }
@keyframes bk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Tombol bantuan & aksi ---------- */
.bk-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; flex-shrink: 0; padding-top: 6px; }
#bkLanjutBtn:not(:disabled) { animation: bk-ready 2.2s ease-in-out infinite; }
@keyframes bk-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(108,180,242,.35); } 50% { box-shadow: 0 0 0 6px rgba(108,180,242,0); } }

.bk-pattern-panel { display: none; margin-bottom: 12px; }
.bk-pattern-panel--open { display: block; animation: bk-rise .25s ease-out both; }
.bk-pattern-label { font-size: 13px; font-weight: 600; color: var(--help); margin-bottom: 6px; }
.bk-pattern-code {
  font-family: var(--font-code); font-size: 13px; line-height: 1.6; color: var(--code-text);
  background: var(--code-bg); border: 1.5px dashed var(--help-fill); border-radius: var(--radius-m);
  padding: 14px 16px; margin: 0; white-space: pre-wrap; user-select: none; -webkit-user-select: none;
}
.bk-pattern-note { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* Fokus keyboard */
.bk-run-btn:focus-visible, .btn:focus-visible, .bk-prediction-option:focus-visible, .bk-help-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Transisi antar tahap */
.bk-main--enter .bk-console { animation: bk-stage-in .4s ease-out both; }
@keyframes bk-stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .bk-spin { animation: none; border-top-color: transparent; }
  .bk-skel i { animation: none; }
  .bk-main--enter .bk-console { animation: none; }
}
@media (hover: none), (max-width: 520px) { .bk-sb-keys { display: none; } }

/* ---------- Jendela masuk ---------- */
.bk-field-label { display: block; text-align: left; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.bk-conflict { margin-top: 14px; text-align: left; padding: 12px 14px; border-radius: var(--radius-m); background: var(--help-soft); border: 1px solid var(--help-fill); color: var(--text); font-size: 14px; line-height: 1.55; }
.bk-conflict[hidden] { display: none; }
.bk-conflict p { margin: 0 0 10px; }
.bk-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-conflict-actions .btn { padding: 8px 14px; font-size: 13px; }
.bk-conflict + .modal-actions { margin-top: 16px; }
.bk-login-error { margin: 10px 0 0; text-align: left; padding: 10px 12px; border-radius: var(--radius-m); background: var(--err-soft); border: 1px solid rgba(229,101,95,.4); color: var(--text); font-size: 14px; line-height: 1.55; }
.bk-login-error[hidden] { display: none; }
.bk-login-error + .modal-actions { margin-top: 16px; }

/* ---------- Panduan awal (tur kartu, dengan sorotan ke elemen asli) ---------- */
.bk-tour { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; }
.bk-tour--show { display: flex; }
.bk-tour--nospot { background: rgba(10,11,14,.62); backdrop-filter: blur(2px); }
.bk-tour--show.bk-tour--nospot { animation: bk-tour-fade .3s ease both; }
@keyframes bk-tour-fade { from { opacity: 0; } to { opacity: 1; } }
.bk-tour-spot { position: fixed; border-radius: 12px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 9999px rgba(10,11,14,.62), 0 0 0 3px #fff;
  transition: left .4s cubic-bezier(.2,.8,.2,1), top .4s cubic-bezier(.2,.8,.2,1), width .4s cubic-bezier(.2,.8,.2,1), height .4s cubic-bezier(.2,.8,.2,1), opacity .3s; animation: bk-tour-spot 1.8s ease-in-out infinite; }
@keyframes bk-tour-spot { 50% { box-shadow: 0 0 0 9999px rgba(10,11,14,.62), 0 0 0 5px #fff; } }

.bk-tour-card { --tone-c: var(--accent); --tone-soft: var(--accent-soft);
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 28px); overflow-y: auto; text-align: center;
  background: var(--bg-panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 24px 28px 18px; box-shadow: var(--shadow-deep);
  animation: bk-tour-card-in .35s ease-out both; }
@keyframes bk-tour-card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.bk-tour-card[data-tone="violet"] { --tone-c: var(--accent-2); --tone-soft: var(--accent-2-soft); }
.bk-tour-card[data-tone="lime"]   { --tone-c: var(--ok); --tone-soft: var(--ok-soft); }
.bk-tour-card[data-tone="amber"]  { --tone-c: var(--help); --tone-soft: var(--help-soft); }
.bk-tour-card[data-pos="top"] { align-self: flex-start; margin-top: 4vh; }
.bk-tour-card[data-pos="center"] { align-self: center; }

.bk-tour-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.bk-tour-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .3s ease, background .3s; }
.bk-tour-dots span.past { background: var(--tone-c); opacity: .5; }
.bk-tour-dots span.on { width: 26px; background: var(--tone-c); }
.bk-tour-counter { position: absolute; top: 16px; right: 20px; font: 12px var(--font-code); color: var(--muted); }

.bk-tour-body { margin: 10px 0 18px; }
.bk-tour-slide { display: none; flex-direction: column; align-items: center; }
.bk-tour-slide--on { display: flex; animation: bk-tour-in .35s ease-out both; }
.bk-tour-slide--on.bk-tour-slide--back { animation-name: bk-tour-in-back; }
@keyframes bk-tour-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes bk-tour-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.bk-tour-slide--on > *, .bk-tour-slide--on .bk-tour-bars > *, .bk-tour-slide--on .bk-tour-help > * {
  animation: bk-tour-pop .4s ease-out both; animation-delay: calc(var(--i, 0) * 0.1s + 0.05s); }
@keyframes bk-tour-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bk-tour-tile { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; margin: 4px 0 14px; color: var(--accent); background: var(--accent-soft); }
.bk-tour-tile .bk-logo { width: 34px; height: 34px; }

.bk-tour-title { margin: 0 0 8px; font-family: var(--font-brand); font-weight: 700; font-size: 26px; line-height: 1.2; letter-spacing: -.005em; }
.bk-tour-title span { font-weight: 700; }
.bk-tour-title code, .bk-tour-text code { font-family: var(--font-code); color: var(--tone-c); background: var(--tone-soft); padding: 1px 8px; border-radius: 6px; font-size: .88em; }
.bk-tour-text { margin: 0 0 14px; max-width: 440px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.bk-tour-text b { color: var(--text); font-weight: 600; }
.bk-tour-text .hl { color: var(--tone-c); }
.bk-tour-text--sm { font-size: 13.5px; margin: 8px 0 0; }
.bk-tour-text kbd { font: 12px var(--font-code); padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-raised); color: var(--text); }

.bk-tour-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bk-tour-chips span { font-size: 13px; font-weight: 500; padding: 6px 13px; border-radius: 999px; background: var(--tone-soft); color: var(--text); }

/* alur bercabang: dua jalur menyala bergantian */
.bk-tour-flow { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bk-tour-flow-q { padding: 9px 24px; border-radius: 8px; font-weight: 600; background: var(--tone-soft); border: 1.5px solid var(--tone-c); color: var(--tone-c); }
.bk-tour-flow-branches { position: relative; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bk-tour-flow-branches::before { content: ""; position: absolute; left: 25%; right: 25%; top: -12px; height: 12px; border: 1.5px solid var(--line-strong); border-bottom: none; border-radius: 10px 10px 0 0; }
.bk-tour-flow-a, .bk-tour-flow-b { padding: 10px 8px; border-radius: var(--radius-m); background: var(--bg-panel); border: 1.5px solid var(--line); animation: bk-tour-pick 4s ease-in-out infinite; }
.bk-tour-flow-b { animation-delay: 2s; }
.bk-tour-flow-a small, .bk-tour-flow-b small { display: block; font: 12px var(--font-code); color: var(--muted); }
.bk-tour-flow-a b, .bk-tour-flow-b b { font-size: 14px; }
@keyframes bk-tour-pick { 0%, 45% { border-color: var(--tone-c); background: var(--tone-soft); } 55%, 100% { border-color: var(--line); background: var(--bg-panel); } }

/* contoh kode: baris muncul berurutan, baris yang dijalankan menyala */
.bk-tour-code { width: 100%; max-width: 400px; text-align: left; padding: 14px 18px; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-m); font: 14px/1.75 var(--font-code); }
.bk-tour-code .k { color: var(--syn-keyword); } .bk-tour-code .n { color: var(--syn-num); } .bk-tour-code .s { color: var(--syn-str); }
.bk-tour-slide--on .bk-tour-code .l, .bk-tour-slide--on .bk-tour-code .out { opacity: 0; animation: bk-tour-line .35s ease forwards; animation-delay: calc(var(--k) * 0.22s + 0.5s); }
@keyframes bk-tour-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.bk-tour-code .hit { margin: 0 -18px; padding: 0 18px; }
.bk-tour-slide--on .bk-tour-code .hit { animation: bk-tour-line .35s ease forwards, bk-tour-hit .8s ease forwards 2.3s; animation-delay: calc(var(--k) * 0.22s + 0.5s), 2.3s; }
@keyframes bk-tour-hit { to { background: rgba(108,180,242,.16); box-shadow: inset 3px 0 0 var(--run); } }
.bk-tour-code .out { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--code-line); color: var(--run); }
.bk-tour-code .out em { font-style: normal; color: var(--code-muted); font-size: 12.5px; margin-left: 8px; }
.bk-tour-slide--on .bk-tour-code .out { animation-delay: 2.4s; }

/* tiga tahap: bar terisi */
.bk-tour-bars { width: 100%; display: grid; gap: 10px; text-align: left; margin-top: 2px; }
.bk-tour-bar { padding: 11px 14px 12px; border-radius: var(--radius-m); background: var(--bg-page); border: 1px solid var(--line); }
.bk-tour-bar .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bk-tour-bar b { font-size: 14px; } .bk-tour-bar em { font: 12px var(--font-code); font-style: normal; color: var(--muted); }
.bk-tour-bar small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.bk-tour-bar .trk { height: 7px; margin-top: 8px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.bk-tour-bar .trk i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.bk-tour-slide--on .bk-tour-bar .trk i { animation: bk-tour-fill .9s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i) * 0.1s + 0.4s); }
@keyframes bk-tour-fill { to { width: var(--w); } }

.bk-tour-demo { width: 100%; max-width: 360px; text-align: left; padding: 12px 16px; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-m); font: 14px/1.7 var(--font-code); }
.bk-tour-demo .k { color: var(--syn-keyword); } .bk-tour-demo .s { color: var(--syn-str); }
.bk-tour-demo .o { color: var(--run); opacity: 0; }
.bk-tour-slide--on .bk-tour-demo .o { animation: bk-tour-line .35s ease forwards 1s; }

.bk-tour-help { width: 100%; display: grid; gap: 9px; text-align: left; margin-top: 2px; }
.bk-tour-hc { padding: 11px 14px; border-radius: var(--radius-m); background: var(--help-soft); border: 1px solid var(--help-fill); }
.bk-tour-hc b { display: block; font-size: 14.5px; color: var(--help); }
.bk-tour-hc small { font-size: 13px; color: var(--text); line-height: 1.5; }
.bk-tour-hc--rose { background: var(--err-soft); border-color: rgba(229,101,95,.4); } .bk-tour-hc--rose b { color: var(--err); }

.bk-tour-actions { display: flex; justify-content: center; gap: 10px; }
.bk-tour-actions .btn { min-width: 128px; }
#bkTourBack[style*="hidden"] { display: none; }
.bk-tour-skip { display: block; margin: 12px auto 0; background: none; border: none; color: var(--muted); font: 13px var(--font-ui); text-decoration: underline; cursor: pointer; }
.bk-tour-skip:hover { color: var(--text); }
.bk-confetti { z-index: 90; }
@media (max-width: 520px) {
  .bk-tour-card { padding: 20px 16px 14px; } .bk-tour-title { font-size: 22px; } .bk-tour-text { font-size: 14px; }
  .bk-tour-actions .btn { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-tour *, .bk-tour *::after, .bk-tour-card { animation: none !important; }
  .bk-tour-slide--on .bk-tour-code .l, .bk-tour-slide--on .bk-tour-code .out, .bk-tour-slide--on .bk-tour-demo .o { opacity: 1; }
  .bk-tour-slide--on .bk-tour-bar .trk i { width: var(--w); }
}

/* ---------- Layar hasil ---------- */
html.bk-scroll, html.bk-scroll body { height: auto; overflow-y: auto; }
html.bk-scroll .bk-header { z-index: 5; }
.bk-aurora, .bk-aurora i { display: none; }  /* latar warna-warni tidak dipakai lagi */

.bk-core-done { display: none; max-width: 640px; margin: 40px auto 24px; text-align: left; padding: 0 20px; }
.bk-core-done--show { display: block; position: relative; z-index: 1; animation: bk-res-rise .5s ease-out both; }
.bk-core-done .bk-eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; }
.bk-core-done h1 { font-family: var(--font-brand); font-weight: 700; color: var(--text); font-size: 34px; line-height: 1.15; margin: 0 0 8px; }
.bk-core-done p { color: var(--muted); line-height: 1.6; }
.bk-result-lead { margin: 0; font-size: 15.5px; }
@keyframes bk-res-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.bk-result-card { --tone: var(--accent); --tone-soft: var(--accent-soft); margin-top: 22px; text-align: left; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; box-shadow: 0 16px 40px -18px rgba(30,33,38,.25); }
.bk-result-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 22px 26px; border-bottom: 1px solid var(--line); text-align: center; background: linear-gradient(180deg, var(--tone-soft), transparent 80%); }
.bk-result-stars { display: none; }
.bk-result-trophy { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); color: #04201c; animation: bk-res-rise .5s ease-out .2s both; }
.bk-result-trophy svg { width: 26px; height: 26px; }
.bk-core-done .bk-result-headline { margin: 0; font-family: var(--font-brand); font-weight: 700; font-size: 22px; color: var(--text); }
.bk-result-ring { width: 164px; height: 164px; border-radius: 50%; padding: 10px; background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--bg-raised) 0); display: grid; place-items: center; }
.bk-result-ring-in { width: 100%; height: 100%; border-radius: 50%; background: var(--bg-panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bk-result-hero-score { font-family: var(--font-brand); font-weight: 700; font-size: 54px; line-height: 1; color: var(--tone); font-variant-numeric: tabular-nums; }
.bk-result-hero-label { font-size: 12.5px; color: var(--muted); }
.bk-core-done .bk-result-msg { margin: 0; max-width: 400px; font-size: 14px; }

.bk-core-done .bk-result-sub { margin: 0; padding: 20px 24px 4px; font-family: var(--font-brand); font-weight: 700; font-size: 17px; color: var(--text); }
.bk-result-rows { list-style: none; margin: 0; padding: 4px 24px 10px; }
.bk-result-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); animation: bk-res-rise .45s ease-out both; animation-delay: var(--d); }
.bk-result-row:first-child { border-top: none; }
.bk-result-step { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--font-code); color: var(--accent); background: var(--accent-soft); }
.bk-result-row-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.bk-result-stage { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.bk-result-title { font-size: 15px; font-weight: 600; color: var(--text); }
.bk-result-nobadge { font-size: 12.5px; color: var(--muted); }
.bk-result-bar { flex-basis: 100%; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.bk-result-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); animation: bk-res-fill 1s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--d) + .2s); }
@keyframes bk-res-fill { to { width: var(--w); } }
.bk-result-row-score { text-align: right; flex-shrink: 0; min-width: 96px; }
.bk-result-row-score b { display: block; font-family: var(--font-brand); font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.bk-result-row-score small { color: var(--muted); font-size: 12px; }
.bk-core-done .bk-result-note { margin: 0; padding: 14px 24px 18px; font-size: 13px; line-height: 1.55; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg-page); }
.bk-summary-badge { font-family: var(--font-ui); font-weight: 500; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--bg-raised); color: var(--muted); }
.bk-summary-badge--adaptive { background: var(--accent-soft); color: var(--accent); }
.bk-summary-badge--autonomous { background: var(--ok-soft); color: var(--ok); }
.bk-summary-badge--dependent { background: var(--help-soft); color: var(--help); }
.bk-summary-badge--struggling { background: var(--err-soft); color: var(--err); }
@media (max-width: 520px) { .bk-result-row { flex-wrap: wrap; } .bk-result-row-main { flex-basis: calc(100% - 50px); } .bk-result-row-score { text-align: left; min-width: 0; margin-left: 48px; } .bk-core-done h1 { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) {
  .bk-core-done *, .bk-result-card { animation: none !important; }
  .bk-result-bar i { width: var(--w); }
}

/* ---------- Penutup: tombol Keluar + kartu "Semua tahap selesai" ---------- */
.bk-logout-dock { position: relative; z-index: 1; scroll-margin-bottom: 32px; margin: 6px auto 56px; width: min(600px, calc(100% - 40px)); display: none; flex-direction: column; }
.bk-logout-dock--show { display: flex; animation: bk-res-rise .5s ease-out .6s both; }
.bk-logout-btn { width: 100%; padding: 14px 18px; font-size: 15.5px; }
.bk-logout-dock .bk-coach-host { margin: 0 0 14px; padding: 0; }

.bk-finish-overlay { position: fixed; inset: 0; z-index: 75; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10,11,14,.55); backdrop-filter: blur(2px); }
.bk-finish-overlay--show { display: flex; animation: bk-tour-fade .3s ease both; }
.bk-finish-card { position: relative; width: 100%; max-width: 400px; text-align: left; padding: 28px 28px 22px; border-radius: var(--radius-l); background: var(--bg-panel); border: 1px solid var(--line); box-shadow: var(--shadow-deep); animation: bk-modal-in .3s ease-out both; }
.bk-finish-flag { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.bk-finish-flag svg { width: 26px; height: 26px; }
.bk-finish-card h2 { margin: 0 0 8px; padding-right: 76px; font-family: var(--font-brand); font-weight: 700; font-size: 26px; color: var(--text); }
.bk-finish-card p { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.bk-finish-card p b { color: var(--text); }
.bk-finish-card .bk-finish-ask { margin: 10px 0 18px; color: var(--text); font-weight: 600; }
.bk-finish-card .btn { width: 100%; padding: 13px 18px; font-size: 15px; }
.bk-finish-link { display: block; margin: 14px auto 0; background: none; border: none; color: var(--muted); font: 14px var(--font-ui); text-decoration: underline; cursor: pointer; }
.bk-finish-link:hover { color: var(--text); }
.bk-finish-x { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font: 500 13px/1 var(--font-ui); white-space: nowrap; }
.bk-finish-x:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Lihat lagi tahap yang sudah selesai ---------- */
.bk-review-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(10,11,14,.55); }
.bk-review { width: min(680px, 100%); max-height: 88vh; overflow: auto; background: var(--bg-panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow-deep); }
.bk-review-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.bk-review-title { margin: 2px 0 0; font-family: var(--font-brand); font-weight: 700; font-size: 20px; }
.bk-review-close { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-panel); color: var(--text); font: 600 13px var(--font-ui); padding: 7px 14px; cursor: pointer; }
.bk-review-close:hover { border-color: var(--accent); color: var(--accent); }
.bk-review-code { margin: 6px 0 10px; padding: 14px; border-radius: 10px; font-family: var(--font-code); font-size: 13.5px; line-height: 1.55; overflow: auto; white-space: pre; background: var(--code-bg); color: var(--code-text); }
.bk-review-note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* Tanpa ikon/gambar: elemen ikon yang dibuat JS disembunyikan */
.bk-fb-ico, .bk-result-trophy, .bk-coach-badge { display: none !important; }


/* ---------- Mengulang tes (Paket B): panel di bawah kartu hasil ---------- */

/* Desktop: editor mengisi sisa tinggi layar, bagian lain dipadatkan supaya tidak perlu scroll */
@media (min-width: 901px) {
  .bk-main { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
  .bk-console { padding: 12px 22px 14px; }
  .bk-briefing .bk-pattern-panel { margin: 18px 0 0; }
  .CodeMirror { flex: 1 1 220px; height: auto; min-height: 200px; }
  .bk-feedback { flex-shrink: 0; margin: 10px 0; padding: 9px 14px; font-size: 13.5px; line-height: 1.55; }
  .bk-prediction-box { padding: 14px 16px; margin: 10px 0; }
  .bk-output { margin-bottom: 10px; gap: 10px; }
  .bk-pane-body { min-height: 32px; max-height: 64px; overflow-y: auto; }
  .bk-editor-toolbar .bk-run-btn { padding: 6px 14px; margin-bottom: 6px; font-size: 13.5px; }
  .bk-filename { padding: 6px 14px; }
  .bk-statusbar { padding: 4px 14px; }
  .bk-pane-label { padding: 6px 12px; }
  .bk-feedback--idle { display: none; }
  /* kartu petunjuk dipadatkan: judul, teks, dan tombol dalam satu baris */
  .bk-console .bk-coach { padding: 7px 12px; align-items: center; }
  .bk-console .bk-coach-body { display: flex; align-items: center; gap: 12px; width: 100%; }
  .bk-console .bk-coach-label { margin: 0; white-space: nowrap; }
  .bk-console .bk-coach-text { flex: 1 1 auto; }
  .bk-console .bk-coach-ok { margin: 0 0 0 auto; white-space: nowrap; }
  .bk-console .bk-coach-host { padding-top: 0; }
}

/* Desktop: kotak pertanyaan prediksi dipadatkan */
@media (min-width: 901px) {
  .bk-prediction-box { padding: 10px 14px 12px; margin: 8px 0; }
  .bk-prediction-q { font-size: 14px; margin: 0 0 8px; line-height: 1.45; }
  .bk-prediction-options { margin-bottom: 8px; gap: 6px; }
  .bk-prediction-feedback { margin: 6px 0 0; min-height: 0; font-size: 13.5px; }
  .bk-prediction-feedback:empty { display: none; }
  .bk-console { padding-bottom: 12px; }
  .bk-actions { padding-top: 2px; }
}

/* Garis pemisah editor (hanya desktop): tarik untuk mengatur tinggi editor */
.bk-splitter { display: none; }
body.bk-resizing { user-select: none; cursor: row-resize; }
@media (min-width: 901px) {
  .bk-splitter { display: flex; flex: none; align-items: center; justify-content: center; height: 14px; margin-top: 2px; cursor: row-resize; touch-action: none; outline: none; }
  .bk-splitter::before { content: ""; width: 48px; height: 4px; border-radius: 4px; background: var(--line-strong); transition: background-color .15s, width .15s; }
  .bk-splitter:hover::before, .bk-splitter:focus-visible::before, .bk-splitter.is-dragging::before { background: var(--accent); width: 72px; }
  .bk-console.is-manual-h .CodeMirror { flex: none; height: var(--editor-h); min-height: 120px; }
}

/* Ilustrasi (dekoratif): gate, panduan, pop-up selesai, dan kolom kiri per tahap */
.bk-art-gate { display: block; width: 100%; max-width: 300px; height: auto; margin: -2px auto 12px; user-select: none; }
.bk-art-medal { display: block; width: 104px; height: auto; margin: -4px auto 6px; user-select: none; }
.bk-tour-art { display: block; width: 100%; max-width: 230px; height: auto; margin: -2px auto 10px; user-select: none; }
.bk-tour-art--wide { max-width: 300px; }
.bk-briefing { display: flex; flex-direction: column; }
.bk-briefing > * { flex: none; }
.bk-briefing > .bk-stage-art { flex: 1 1 0; min-height: 0; max-height: 190px; width: 100%; margin-top: 18px; object-fit: contain; object-position: center bottom; user-select: none; pointer-events: none; }
.bk-briefing:has(.bk-pattern-panel--open) > .bk-stage-art { display: none; }
@media (max-width: 900px) { .bk-briefing > .bk-stage-art { display: none; } }

/* Layar masuk: ikon loading berputar selama menunggu sinkron ke Sheets */
.bk-spin--dark { width: 18px; height: 18px; border-width: 3px; border-color: rgba(4,32,28,.25); border-top-color: var(--on-accent); }
#bkStudentStartBtn.is-busy { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
#bkStudentStartBtn.is-busy:disabled { opacity: 1; cursor: progress; }
.bk-login-wait { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }
.bk-login-wait[hidden] { display: none; }

/* =========================================================
   v9: Kotak Instruksi terstruktur (studi kasus, batas nilai, tugas, aturan) + Petunjuk dengan alur
   Instruksi = APA yang harus dikerjakan. Petunjuk = BAGAIMANA memikirkannya.
   ========================================================= */
.bk-ins { padding: 16px 16px 14px; }
.bk-ins .bk-section-label { margin-bottom: 12px; font-size: 16px; }
.bk-ins-block + .bk-ins-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.bk-ins-tag { display: inline-block; margin-bottom: 7px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); background: rgba(12,13,16,.55); border: 1px solid rgba(108,180,242,.3); }
.bk-ins-text { margin: 0; font-size: 15px; line-height: 1.65; color: var(--text); max-width: 38em; }
.bk-ins code, .bk-ins-note code { font-family: var(--font-code); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: rgba(12,13,16,.65); color: var(--accent-strong); }

.bk-ins-scroll { max-width: 100%; overflow-x: auto; }
.bk-ins-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(12,13,16,.4); font-size: 14px; }
.bk-ins-table th { padding: 6px 10px; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: rgba(12,13,16,.5); border-bottom: 1px solid var(--line-strong); }
.bk-ins-table td { padding: 8px 9px; border-top: 1px solid var(--line); vertical-align: middle; }
.bk-ins-table tbody tr:first-child td { border-top: none; }
.bk-ins-range { font-weight: 600; color: var(--text); white-space: nowrap; }
.bk-ins-out { white-space: normal; overflow-wrap: anywhere; color: var(--ok) !important; background: var(--ok-soft) !important; padding: 2px 8px !important; font-weight: 500; }
.bk-ins-row--isi td { background: var(--accent-soft); }
.bk-ins-row--isi .bk-ins-range { box-shadow: inset 3px 0 0 var(--accent); }
.bk-ins-state { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; line-height: 1.3; color: var(--muted); }
.bk-ins-state--isi { color: var(--accent-strong); font-weight: 600; }
.bk-ins-row--ada .bk-ins-range, .bk-ins-row--ada .bk-ins-out { opacity: .75; }

.bk-ins-steps { margin: 0; padding: 0; list-style: none; counter-reset: ins; display: grid; gap: 8px; }
.bk-ins-steps li { counter-increment: ins; display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.bk-ins-steps li::before { content: counter(ins); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 12.5px/24px var(--font-brand); text-align: center; }

.bk-ins-note { margin: 14px 0 0; padding: 8px 11px; border-radius: 8px; border-left: 3px solid var(--ok); background: rgba(12,13,16,.45); font-size: 13.5px; line-height: 1.55; color: #d3dde4; }
.bk-ins-note b { display: block; margin-bottom: 1px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.bk-ins-note--info { border-left-color: var(--accent); }
.bk-ins-note--info b { color: var(--accent-strong); }
.bk-ins-block + .bk-ins-note { margin-top: 14px; }
.bk-ins-note + .bk-ins-note { margin-top: 8px; }


/* ---------- Status pengiriman data: catatan di modal, modal logout, toast ---------- */
.bk-kirim-note { margin: -8px 0 18px; padding: 10px 12px; border-radius: var(--radius-m); font-size: 13.5px; line-height: 1.55; border: 1px solid var(--line); background: var(--bg-raised); color: var(--muted); }
.bk-kirim-note[hidden] { display: none; }
.bk-kirim-note--warn { color: var(--help); border-color: var(--help-fill); background: var(--help-soft); }
.bk-kirim-note--ok { color: var(--ok); border-color: rgba(111,191,115,.4); background: var(--ok-soft); }
.bk-logout-modal { z-index: 80; background: rgba(12,13,16,.88); }
.bk-toast { position: fixed; top: 16px; left: 50%; z-index: 95; max-width: min(520px, calc(100% - 32px)); transform: translate(-50%, -12px); padding: 11px 18px; border-radius: var(--radius-m); font-size: 14px; line-height: 1.5; text-align: center; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.bk-toast--show { opacity: 1; transform: translate(-50%, 0); }
.bk-toast--warn { color: var(--help); border-color: var(--help-fill); background: #2a2208; }
.bk-toast--ok { color: var(--ok); border-color: rgba(111,191,115,.5); background: #14210a; }
@media (prefers-reduced-motion: reduce) { .bk-toast { transition: none; } }
.bk-logout-modal .modal-lead { margin-bottom: 20px; }

/* Penyederhanaan tampilan: label biasa, catatan berbingkai penuh, merek satu warna */
.bk-brand-mark span { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent); }
.bk-ins-tag { padding: 0; border: 0; border-radius: 0; background: none; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; }
.bk-ins-table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.bk-ins-note { border: 1px solid var(--line-strong); border-left-width: 1px; }
.bk-ins-note b { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ===== Panel kiri (teks instruksi) terang; sisi kanan (editor, console, tombol) tetap gelap ===== */
.bk-briefing {
  --bg-panel:#e8edf3; --bg-editor:#dfe6ee; --bg-raised:#dde4ec;
  --line:#cdd6e0; --line-strong:#b4c0ce; --text:#1f2933; --muted:#56616c;
  --accent:#2a65a5; --accent-strong:#21548c; --accent-soft:rgba(42,101,165,.10);
  --accent-2:#56616c; --accent-2-soft:rgba(86,97,108,.14);
  --ok:#2c7a37; --ok-soft:rgba(44,122,55,.12); --on-ok:#fff;
  --help:#8a5a0b; --help-fill:#d9a13b; --help-soft:rgba(217,161,59,.22); --on-help:#2a1d03;
  --err:#b83227; --err-soft:rgba(184,50,39,.10); --on-accent:#fff; --on-err:#fff;
  --block-bg:#d6e5f6; --block-border:#8fb0dd;
}
.bk-briefing .bk-ins-block + .bk-ins-block { border-top-color: var(--line-strong); }
.bk-briefing .bk-ins code, .bk-briefing .bk-ins-note code { background: rgba(31,41,51,.08); color: var(--accent-strong); }
.bk-briefing .bk-ins-table { background: #f5f7fa; }
.bk-briefing .bk-ins-table th { background: #e1e7ee; color: var(--muted); }
.bk-briefing .bk-ins-note { background: #fff; color: #33404b; border-color: var(--line-strong); }
.bk-briefing .bk-ins-out { color: #2c6a35 !important; }
.bk-briefing .bk-task-box { background: #f5f7fa; border-color: var(--line-strong); }

/* Tabel batas nilai: gaya tabel buku, tanpa lencana dan tanpa warna ganda */
.bk-briefing .bk-ins-table { border-radius: 4px; border-color: var(--line-strong); background: #f5f7fa; }
.bk-briefing .bk-ins-table th { background: transparent; color: var(--text); font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.bk-briefing .bk-ins-out { background: none !important; padding: 0 !important; border-radius: 0; color: var(--text) !important; font-weight: 500; }
.bk-briefing .bk-ins-row--ada .bk-ins-range, .bk-briefing .bk-ins-row--ada .bk-ins-out { opacity: 1; }
.bk-briefing .bk-ins-row--isi td { background: #e4edf8; }
.bk-briefing .bk-ins-row--isi .bk-ins-range { box-shadow: none; }
.bk-briefing .bk-ins-state { font-size: 13.5px; font-weight: 400; color: var(--muted); }
.bk-briefing .bk-ins-state--isi { color: var(--accent-strong); font-weight: 500; }

/* Catatan dan Aturan output: paragraf biasa dengan label tebal, tanpa kartu */
.bk-briefing .bk-ins-note { padding: 0; border: 0; border-radius: 0; background: none; font-size: 14px; line-height: 1.6; color: var(--text); }
.bk-briefing .bk-ins-note b { display: inline; margin: 0; font-size: inherit; font-weight: 700; color: var(--text); }
.bk-briefing .bk-ins-note b::after { content: ": "; }
.bk-briefing .bk-ins-note--info b, .bk-briefing .bk-ins-note b { color: var(--text); }

/* ===== Petunjuk di panel terang: kontras teks yang jelas ===== */
.bk-briefing .bk-hint-box { background: #f6ead0; border-color: #d9a13b; color: var(--text); }
.bk-briefing .bk-hint-head { color: #7a4f08; }
.bk-briefing .bk-hint-head::before { background: #b9781a; }
.bk-briefing .bk-hint-steps li::before { background: #d9a13b; color: #2a1d03; }
.bk-briefing .bk-hint-steps li:not(:last-child)::after { background: rgba(138,90,11,.35); }
.bk-briefing .bk-hint-steps b { color: #1f2933; }
.bk-briefing .bk-hint-steps li > div { color: #33404b; }
.bk-briefing .bk-hint-try { background: #fffaf0; border-color: rgba(138,90,11,.4); color: #33404b; }
.bk-briefing .bk-hint-try b { color: #7a4f08; }

.bk-hint-intro { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: #33404b; }
.bk-hint-intro b { color: #1f2933; }

/* Label tahap di atas judul: satu warna (biru) untuk ketiga tahap, tidak lagi hijau/biru/abu */
.bk-scaffold-tag--amati, .bk-scaffold-tag--sedang, .bk-scaffold-tag--mandiri { color: var(--accent); border-color: rgba(42,101,165,.35); background: var(--accent-soft); }
.bk-briefing .bk-ins-table .bk-ins-out { font-size: 13.5px; }

/* ===== Sisi kanan: gelap yang lebih lembut (abu kebiruan), editor kode tetap gelap ===== */
.bk-console {
  --bg-panel: #2b313b; --bg-raised: #343b47;
  --line: #424a57; --line-strong: #515a68; --muted: #a3abb6;
  background: #242933;
}
.bk-briefing { box-shadow: inset -10px 0 14px -14px rgba(31,41,51,.25); }

/* Pratinjau tidak dipakai (isinya hanya penunjuk ke Console): disembunyikan lewat tampilan saja,
   elemennya tetap ada supaya kode yang menulis ke sana tidak terganggu. */
.bk-output { grid-template-columns: 1fr; }
.bk-output > .bk-pane:first-child { display: none; }
