/* CAT Teaching & Simulation Lab - tampilan versi web (sistem desain sama dengan Psychometrics Learning Lab) */
:root {
  --page:#f4f6f9; --surface:#ffffff; --surface-2:#f7f9fb; --surface-3:#eef2f6;
  --ink:#14212d; --ink-2:#3b4b5a; --muted:#677a8b; --line:#e1e7ed; --line-2:#cbd5df;
  --brand:#2F6690; --brand-2:#1D9A8A; --brand-ink:#ffffff; --brand-soft:#e9f1f8; --brand-line:#c9dcea;
  --ok:#1d6a54; --ok-soft:#e9f5f0; --ok-line:#c4e1d6;
  --warn:#80590c; --warn-soft:#fbf4e4; --warn-line:#ecdcb2;
  --bad:#9c3b2a; --bad-soft:#fbeeea; --bad-line:#efd1c8;
  --code-bg:#0f1c27; --code-ink:#dbe7f1;
  --shadow-sm:0 1px 2px rgba(20,33,45,.05), 0 2px 8px rgba(20,33,45,.04);
  --shadow-md:0 2px 6px rgba(20,33,45,.06), 0 12px 32px rgba(20,33,45,.08);
  --radius:14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* grafik */
  --chart-bg:#ffffff; --chart-fg:#14212d; --chart-text:#14212d; --chart-muted:#5b6d7d; --chart-grid:#e8edf2;
  --accent:#C8693E;
  --c1:#2F6690; --c2:#1D8A73; --c3:#C8693E; --c4:#7A5BA6; --c5:#A08A2E; --c6:#B0446A; --c7:#4E6577; --c8:#5C9BD1;
  --heat-lo:#eef4fb; --heat-hi:#0b3d78;
}
:root[data-theme="dark"] {
  --page:#0d151c; --surface:#141e27; --surface-2:#18242f; --surface-3:#1e2c38;
  --ink:#e4ebf1; --ink-2:#b9c6d1; --muted:#8a9bab; --line:#26333f; --line-2:#364553;
  --brand:#7fb0d6; --brand-2:#5fc6b5; --brand-ink:#0d151c; --brand-soft:#16293a; --brand-line:#28435a;
  --ok:#6cc3a6; --ok-soft:#132c25; --ok-line:#245043;
  --warn:#d9b56a; --warn-soft:#2a2416; --warn-line:#4a3d1e;
  --bad:#e1927e; --bad-soft:#2f1c17; --bad-line:#513027;
  --code-bg:#0a1117; --code-ink:#d6e2ec;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.25);
  --shadow-md:0 2px 6px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --chart-bg:#141e27; --chart-fg:#e4ebf1; --chart-text:#e4ebf1; --chart-muted:#a3b3c1; --chart-grid:#25323e;
  --accent:#f0a983;
  --c1:#7fb0d6; --c2:#64c7aa; --c3:#f0a983; --c4:#c2a7ee; --c5:#d9cf8a; --c6:#f3a6c2; --c7:#a9bccb; --c8:#9fd0ff;
  --heat-lo:#18222e; --heat-hi:#9fd0ff;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; background:var(--page); color:var(--ink); font-family:var(--font); font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased; }
a { color:var(--brand); }
h1, h2, h3, h4 { letter-spacing:-.015em; }
code { font-family:var(--mono); font-size:.9em; background:var(--surface-3); border-radius:5px; padding:1px 5px; }
.hidden { display:none !important; }
button { font-family:inherit; }

/* ---------------- navbar ---------------- */
.topbar { position:sticky; top:0; z-index:100; backdrop-filter:saturate(1.4) blur(12px); -webkit-backdrop-filter:saturate(1.4) blur(12px);
  background:color-mix(in srgb, var(--surface) 86%, transparent); border-bottom:1px solid var(--line); }
.topbar-inner { max-width:1600px; margin:0 auto; display:flex; align-items:center; gap:16px; padding:0 18px; height:62px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); white-space:nowrap; flex-shrink:0; }
.brand img { width:34px; height:34px; border-radius:9px; display:block; }
.brand-name { font-weight:800; font-size:15.5px; line-height:1.1; }
.brand-sub { font-size:11px; color:var(--muted); font-weight:600; letter-spacing:.02em; }
.nav { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; flex:1; padding:4px 0; }
.nav::-webkit-scrollbar { display:none; }
.nav button { border:0; background:none; color:var(--muted); font-weight:650; font-size:14px; padding:8px 13px; border-radius:999px;
  cursor:pointer; white-space:nowrap; transition:background .15s, color .15s; }
.nav button:hover { color:var(--ink); background:var(--surface-3); }
.nav button.active { color:var(--brand-ink); background:var(--brand); }
.icon-btn { width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:var(--surface); color:var(--ink);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.icon-btn:hover { background:var(--surface-3); }
.icon-btn svg { width:18px; height:18px; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap:wrap; height:auto; padding:8px 12px 6px; gap:8px; }
  .brand { flex:1; }
  .nav { order:3; flex-basis:100%; }
}

main { max-width:1600px; margin:0 auto; padding:0 18px 20px; }
.page { display:none; animation:fade .2s ease; }
.page.active { display:block; }
@keyframes fade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ---------------- beranda ---------------- */
.home-hero { position:relative; overflow:hidden; margin:22px 0 22px; border-radius:24px; padding:46px 44px 40px; color:#fff;
  background:radial-gradient(1200px 400px at 90% -20%, rgba(255,255,255,.14), transparent 60%), linear-gradient(125deg, #173d5c 0%, #2F6690 52%, #1D9A8A 100%); }
:root[data-theme="dark"] .home-hero { background:radial-gradient(1200px 400px at 90% -20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(125deg, #0f2a40 0%, #1f4a6b 55%, #146d63 100%); }
.home-hero svg.deco { position:absolute; right:-40px; bottom:-30px; width:520px; opacity:.18; pointer-events:none; }
.home-hero .eyebrow { display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  background:rgba(255,255,255,.14); padding:5px 11px; border-radius:999px; }
.home-hero h1 { font-size:clamp(28px, 4vw, 44px); line-height:1.08; margin:16px 0 12px; max-width:760px; }
.home-hero p { font-size:17px; line-height:1.6; max-width:720px; margin:0 0 22px; color:rgba(255,255,255,.88); }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn-hero { background:#fff; color:#173d5c; border:0; border-radius:12px; padding:11px 18px; font-weight:750; font-size:15px; cursor:pointer; text-decoration:none; }
.btn-hero.ghost { background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.35); }
.hero-stats { display:flex; gap:26px; flex-wrap:wrap; margin-top:28px; font-size:13.5px; color:rgba(255,255,255,.85); }
.hero-stats strong { display:block; font-size:22px; color:#fff; }
@media (max-width: 640px) { .home-hero { padding:30px 22px; border-radius:18px; } .home-hero svg.deco { width:320px; } }

.section-title { scroll-margin-top:90px; display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:30px 2px 12px; }
.section-title h2 { margin:0; font-size:21px; }
.section-title span { color:var(--muted); font-size:13.5px; text-align:right; }
@media (max-width: 640px) { .section-title span { display:none; } }
.module-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
a.module-card { text-decoration:none; color:inherit; }
.module-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:var(--shadow-sm);
  display:flex; flex-direction:column; gap:10px; cursor:pointer; transition:transform .15s, box-shadow .15s, border-color .15s; text-align:left; color:inherit; font:inherit; }
.module-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--brand-line); }
.module-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--brand-soft); color:var(--brand); }
.module-icon svg { width:24px; height:24px; }
.module-card h3 { margin:2px 0 0; font-size:17px; }
.module-card p { margin:0; color:var(--ink-2); font-size:14px; line-height:1.55; flex:1; }
.module-card .go { font-weight:700; color:var(--brand); font-size:14px; }
.module-card.external { background:linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.guide-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; }
.guide-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px 22px; box-shadow:var(--shadow-sm); }
.guide-card h3 { margin:0 0 10px; font-size:16.5px; }
.guide-card p, .guide-card li { color:var(--ink-2); font-size:14.2px; line-height:1.6; }
.guide-card ol, .guide-card ul { padding-left:20px; margin:6px 0 0; }
.guide-card li { margin-bottom:6px; }

/* ---------------- halaman modul ---------------- */
.module-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:24px 2px 16px; }
.module-head .t { display:flex; gap:14px; align-items:flex-start; }
.module-head .module-icon { width:48px; height:48px; flex-shrink:0; }
.module-head h1 { margin:0; font-size:26px; }
.module-head p { margin:4px 0 0; color:var(--ink-2); max-width:820px; font-size:15px; }
.head-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.layout { display:grid; grid-template-columns:330px minmax(0, 1fr); gap:20px; align-items:start; }
@media (max-width: 1020px) { .layout { grid-template-columns:minmax(0, 1fr); } }
.layout > * { min-width:0; }
.sidebar { position:sticky; top:78px; max-height:calc(100vh - 92px); overflow-y:auto; scrollbar-width:thin; padding-right:2px; overscroll-behavior:contain; }
@media (max-width: 1020px) { .sidebar { position:static; max-height:none; overflow:visible; } }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow-sm); margin-bottom:14px; }
.panel h3 { font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 12px; font-weight:800; }
.panel.accent { background:var(--brand-soft); border-color:var(--brand-line); }
.panel.accent h3 { color:var(--brand); }

details.help { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:14px; box-shadow:var(--shadow-sm); }
details.help summary { list-style:none; cursor:pointer; padding:13px 16px; font-weight:750; font-size:14px; display:flex; align-items:center; gap:9px; }
details.help summary::-webkit-details-marker { display:none; }
details.help summary::before { content:""; width:8px; height:8px; border-right:2px solid var(--brand); border-bottom:2px solid var(--brand); transform:rotate(-45deg); transition:transform .15s; margin-left:2px; }
details.help[open] summary::before { transform:rotate(45deg); }
details.help .body { padding:0 16px 14px; color:var(--ink-2); font-size:13.8px; line-height:1.62; }
details.help .body p { margin:0 0 9px; }

/* ---------------- kontrol ---------------- */
.field { margin-bottom:14px; }
.field:last-child { margin-bottom:0; }
.field label, .field .label { display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-weight:650; font-size:13.5px; margin-bottom:6px; color:var(--ink); }
.field .val { font-family:var(--mono); font-size:12.5px; font-weight:700; color:var(--brand); background:var(--brand-soft); padding:1px 8px; border-radius:999px; }
.field .hint { font-size:12px; color:var(--muted); margin-top:5px; line-height:1.45; }
select, input[type=number], input[type=text] { width:100%; font:inherit; font-size:14px; color:var(--ink); background:var(--surface);
  border:1px solid var(--line-2); border-radius:10px; padding:8px 10px; transition:border-color .15s, box-shadow .15s; }
select:focus, input[type=number]:focus, input[type=text]:focus { outline:0; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:22px; background:transparent; cursor:pointer; }
input[type=range]::-webkit-slider-runnable-track { height:6px; border-radius:999px; background:linear-gradient(to right, var(--brand) var(--pct, 50%), var(--surface-3) var(--pct, 50%)); }
input[type=range]::-moz-range-track { height:6px; border-radius:999px; background:var(--surface-3); }
input[type=range]::-moz-range-progress { height:6px; border-radius:999px; background:var(--brand); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; border-radius:50%; background:var(--surface); border:3px solid var(--brand); margin-top:-6px; box-shadow:0 1px 3px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width:13px; height:13px; border-radius:50%; background:var(--surface); border:3px solid var(--brand); }
.seg { display:flex; flex-direction:column; gap:6px; }
.seg label { display:flex; gap:9px; align-items:flex-start; font-weight:500; font-size:13.8px; cursor:pointer; padding:8px 10px; border:1px solid var(--line); border-radius:10px; margin:0; }
.seg label:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); }
.seg input { margin-top:3px; accent-color:var(--brand); }
.seed-row { display:flex; gap:8px; }
.seed-row input { flex:1; }
.item-card { border:1px solid var(--line); border-radius:12px; margin-bottom:8px; background:var(--surface-2); }
.item-card summary { list-style:none; cursor:pointer; padding:9px 12px; display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:13.5px; }
.item-card summary::-webkit-details-marker { display:none; }
.item-card summary strong { font-weight:750; }
.item-card summary span { font-family:var(--mono); font-size:11.5px; color:var(--muted); }
.item-card .inner { padding:4px 12px 12px; }
.item-card .field { margin-bottom:10px; }

.btn { font:inherit; font-weight:650; font-size:14px; border-radius:10px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink);
  padding:8px 14px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; text-decoration:none; transition:background .15s, border-color .15s; }
.btn:hover { background:var(--surface-3); }
.btn svg { width:16px; height:16px; }
.btn-primary { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); }
.btn-primary:hover { background:color-mix(in srgb, var(--brand) 86%, #000); }
.btn-sm { font-size:12.5px; padding:5px 10px; border-radius:8px; }
.btn-block { width:100%; }

/* ---------------- metrik ---------------- */
.metrics { display:grid; grid-template-columns:repeat(auto-fit, minmax(132px, 1fr)); gap:12px; margin-bottom:16px; }
.metric { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.metric::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); opacity:.85; }
.metric:nth-child(3n+2)::before { background:var(--brand-2); }
.metric:nth-child(3n)::before { background:var(--c3); }
.metric .k { font-size:11.5px; color:var(--muted); font-weight:750; text-transform:uppercase; letter-spacing:.05em; line-height:1.3; }
.metric .v { font-size:24px; font-weight:800; margin-top:4px; font-variant-numeric:tabular-nums; line-height:1.15; letter-spacing:-.02em; }
.metric .s { font-size:12px; color:var(--muted); margin-top:3px; line-height:1.4; }

/* ---------------- tab ---------------- */
.tabs { display:flex; gap:4px; padding:4px; background:var(--surface-3); border-radius:12px; margin-bottom:14px; overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs button { border:0; background:none; color:var(--muted); font-weight:650; font-size:13.8px; padding:8px 13px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.tabs button:hover { color:var(--ink); }
.tabs button.active { background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }
.tabpage { display:none; }
.tabpage.active { display:block; animation:fade .18s ease; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3 { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns:1fr 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns:1fr; } }

/* ---------------- kartu konten ---------------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow-sm); margin-bottom:14px; }
.card h4 { margin:0 0 8px; font-size:16px; }
.card p { margin:0 0 9px; color:var(--ink-2); line-height:1.65; }
.card p:last-child { margin-bottom:0; }
.insight { background:var(--warn-soft); border:1px solid var(--warn-line); border-radius:var(--radius); padding:14px 18px; color:var(--ink-2); line-height:1.6; margin-bottom:14px; }
.note { border:1px solid var(--line); border-left:4px solid var(--brand); background:var(--surface-2); border-radius:10px; padding:12px 14px; font-size:13.8px; line-height:1.62; color:var(--ink-2); margin:0 0 14px; }
.note strong { color:var(--ink); }
.note .formula { display:block; margin-top:7px; font-family:var(--mono); font-size:12px; color:var(--muted); }
.status { border-radius:10px; padding:11px 14px; font-size:13.8px; line-height:1.55; margin:0 0 12px; border:1px solid; }
.status.ok { background:var(--ok-soft); border-color:var(--ok-line); }
.status.warn { background:var(--warn-soft); border-color:var(--warn-line); }
.status.bad { background:var(--bad-soft); border-color:var(--bad-line); }
.dl-row { display:flex; gap:8px; flex-wrap:wrap; margin:2px 0 14px; }
.mini-table { width:100%; border-collapse:collapse; font-size:13.5px; margin:8px 0 10px; }
.mini-table th, .mini-table td { padding:7px 9px; border-bottom:1px solid var(--line); text-align:left; }
.mini-table th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }

/* ---------------- grafik & tabel ---------------- */
.chart-card { position:relative; background:var(--chart-bg); border:1px solid var(--line); border-radius:var(--radius); padding:8px 8px 4px; margin-bottom:14px; min-height:120px; box-shadow:var(--shadow-sm); }
.chart-card svg { display:block; width:100%; height:auto; }
.chart-tools { position:absolute; top:9px; right:10px; display:flex; gap:6px; opacity:0; transition:opacity .15s; }
.chart-card:hover .chart-tools, .chart-card:focus-within .chart-tools { opacity:1; }
@media (hover: none) { .chart-tools { opacity:1; } }
.chart-tools .btn { font-size:12px; padding:4px 9px; border-radius:8px; }
.chart-empty { display:flex; align-items:center; justify-content:center; color:var(--muted); min-height:180px; font-size:14px; text-align:center; padding:20px; }
.table-wrap { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:10px 12px 8px; margin-bottom:14px; box-shadow:var(--shadow-sm); }
.table-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; margin:2px 2px 8px; }
.table-head .title { font-weight:750; font-size:14.5px; }
.table-head .btn { font-size:12px; padding:4px 10px; border-radius:8px; }
.table-scroll { overflow-x:auto; }
table.dt { border-collapse:collapse; width:100%; font-size:13.5px; font-variant-numeric:tabular-nums; }
table.dt th, table.dt td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
table.dt th { font-weight:750; font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
table.dt th.sortable { cursor:pointer; }
table.dt td.num, table.dt th.num { text-align:right; }
table.dt tbody tr:hover { background:var(--surface-2); }
table.dt tbody tr.hl { background:var(--warn-soft); }
table.dt input.colfilter { width:100%; min-width:58px; font-size:12px; padding:4px 7px; border-radius:7px; }
.table-foot { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; font-size:12.5px; color:var(--muted); margin-top:8px; }
.pager { display:flex; gap:4px; align-items:center; }
.pager .btn { font-size:12px; padding:3px 9px; }
.small-note { color:var(--muted); font-size:12.5px; line-height:1.5; }

/* ---------------- syntax R ---------------- */
.code-wrap { border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); box-shadow:var(--shadow-sm); }
.code-head { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.code-head span { font-size:12px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-right:auto; }
pre.code { margin:0; background:var(--code-bg); color:var(--code-ink); padding:16px 18px; overflow:auto; max-height:620px; font-family:var(--mono); font-size:12.8px; line-height:1.62; }
pre.code .c { color:#7f9bb0; font-style:italic; }
pre.code .s { color:#9ad4a1; }
pre.code .n { color:#f2c37f; }
pre.code .k { color:#8ec5ff; }

/* ---------------- toast & footer ---------------- */
#toasts { position:fixed; right:16px; bottom:16px; z-index:4000; display:flex; flex-direction:column; gap:8px; max-width:min(420px, calc(100vw - 32px)); }
.toast { background:var(--surface); color:var(--ink); border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:12px; padding:11px 14px;
  box-shadow:var(--shadow-md); font-size:14px; animation:fade .18s ease; }
.toast.success { border-left-color:var(--ok); } .toast.warning { border-left-color:var(--warn); } .toast.error { border-left-color:var(--bad); }
.footer { max-width:1600px; margin:24px auto 0; padding:22px 18px 30px; color:var(--muted); font-size:13px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); }
.footer a { color:var(--muted); }

/* =====================================================================
   Komponen khusus CAT Lab
   ===================================================================== */
.main { min-width:0; }
.cols { display:grid; gap:14px; }
.cols-2 { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cols-2 { grid-template-columns:minmax(0, 1fr); } }
h3.sec { font-size:18px; margin:22px 2px 6px; }

/* sidebar: tombol aksi selalu terlihat di bawah panel */
.side-action { position:sticky; bottom:0; z-index:5; padding:16px 0 4px; margin-top:-6px;
  background:linear-gradient(to bottom, transparent, var(--page) 18px); }
.side-action .hint { text-align:center; margin-top:6px; }
.btn-lg { font-size:15.5px; padding:12px 16px; border-radius:12px; font-weight:750; box-shadow:0 6px 18px color-mix(in srgb, var(--brand) 28%, transparent); }
.link-btn { border:0; background:none; padding:0; margin-top:8px; color:var(--brand); font-weight:700; font-size:13px; cursor:pointer; }
.link-btn:hover { text-decoration:underline; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.field-row .field { margin-bottom:14px; }
input[type=file] { width:100%; font:inherit; font-size:13px; color:var(--ink-2); background:var(--surface-2); border:1px dashed var(--line-2); border-radius:10px; padding:9px; }
input[type=file]::file-selector-button { font:inherit; font-weight:650; font-size:13px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink); border-radius:8px; padding:5px 10px; margin-right:10px; cursor:pointer; }

/* kotak centang dan pilihan */
.check { display:flex; gap:9px; align-items:flex-start; cursor:pointer; font-size:13.8px; font-weight:600; margin:0 0 12px; }
.check input { margin-top:3px; accent-color:var(--brand); }
.check.switch { padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.check.switch:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); }
.radio-group.seg .check, .check-group .check { margin:0; }
.seg-2 { display:grid; grid-template-columns:1fr 1fr; }
.seg-2 label { justify-content:center; font-weight:650; }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chips label { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--line); border-radius:999px; font-size:13px; font-weight:600; background:var(--surface); }
.chips label:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); color:var(--brand); }
.chips input { margin:0; }

/* kartu item bank aktif */
.active-bank-card #active_bank_summary { font-size:13.5px; line-height:1.6; color:var(--ink-2); }
.active-bank-card #active_bank_summary strong { color:var(--brand); font-size:19px; letter-spacing:-.01em; }
.model-rule-card { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin:-4px 0 14px; font-size:13px; line-height:1.55; color:var(--ink-2); }
.model-rule-card p { margin:6px 0 0; }
.model-rule-card code { display:inline-block; margin-top:4px; }
.model-pill { display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.05em; padding:3px 8px; margin-right:6px; border-radius:999px; background:var(--brand); color:var(--brand-ink); }

/* metrik CAT Lab (id lama dipertahankan) */
.metrics { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); }
.metrics.m5 { grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); }
.metric-box { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px 13px 18px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden; min-width:0; }
.metric-box::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--muted); opacity:.55; }
.metric-blue::before { background:var(--brand); opacity:.9; }
.metric-teal::before { background:var(--brand-2); opacity:.9; }
.metric-amber::before { background:var(--c3); opacity:.9; }
.metric-green { background:var(--ok-soft); border-color:var(--ok-line); }
.metric-green::before { background:var(--ok); opacity:1; }
.metric-label { font-size:11.5px; color:var(--muted); font-weight:750; text-transform:uppercase; letter-spacing:.05em; line-height:1.3; }
.metric-value { font-size:25px; font-weight:800; margin-top:4px; font-variant-numeric:tabular-nums; line-height:1.15; letter-spacing:-.02em; overflow-wrap:anywhere; }
.metric-value.sm { font-size:18px; }
.metric-sub { font-size:12px; color:var(--muted); margin-top:3px; line-height:1.4; }
.metric-green .metric-value { color:var(--ok); }

/* panggung CAT Live: item aktif dan tombol respons */
.stage { background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-sm); padding:16px; margin-bottom:16px; scroll-margin-top:84px; }
.stage .current-item { border:0; padding:4px 4px 0; margin:0 0 12px; background:none; box-shadow:none; }
.stage .done-box { margin-bottom:12px; }
.current-item, .cycle-step { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; margin-bottom:12px; box-shadow:var(--shadow-sm); }
.current-item .grid4 { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }
.current-item .grid4 > div { border-left:3px solid var(--line); padding-left:12px; }
.current-item .grid4 > div:first-child { border-left-color:var(--brand); }
@media (max-width: 900px) { .current-item .grid4 { grid-template-columns:1fr 1fr; } }
.current-item h4 { margin:0 0 6px; font-size:15px; }
.current-item p { margin:3px 0; font-size:13.6px; color:var(--ink-2); }
.start-cta { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.start-cta h4 { font-size:17px !important; margin:0 0 4px !important; }
.start-cta p { max-width:620px; }
.response-btn { display:flex; flex-wrap:wrap; gap:10px; }
.stage .response-btn:empty { display:none; }
.response-btn .btn { font-size:16px; padding:11px 22px; border-radius:12px; font-weight:750; min-width:150px; }
.btn-success { background:#1f8a5b; border-color:#1f8a5b; color:#fff; }
.btn-success:hover { background:#18744c; }
.btn-danger { background:#c2503a; border-color:#c2503a; color:#fff; }
.btn-danger:hover { background:#a8432f; }
.btn-info { background:var(--brand-2); border-color:var(--brand-2); color:#fff; }
.btn-info:hover { background:color-mix(in srgb, var(--brand-2) 85%, #000); }
:root[data-theme="dark"] .btn-info { color:var(--brand-ink); }
.btn:disabled { opacity:.45; cursor:not-allowed; }

/* kotak pesan */
.box { border:1px solid; border-left-width:4px; padding:11px 14px; margin-bottom:12px; border-radius:10px; font-size:13.8px; line-height:1.55; color:var(--ink-2); }
.box p { margin:4px 0 0; }
.box ul { margin:6px 0 0; padding-left:20px; }
.box strong { color:var(--ink); }
.running-box { background:var(--ok-soft); border-color:var(--ok-line); border-left-color:var(--ok); }
.warning-box { background:var(--warn-soft); border-color:var(--warn-line); border-left-color:var(--warn); }
.error-box { background:var(--bad-soft); border-color:var(--bad-line); border-left-color:var(--bad); }
.info-box { background:var(--brand-soft); border-color:var(--brand-line); border-left-color:var(--brand); }
.done-box { background:var(--ok-soft); border:1px solid var(--ok-line); border-left:5px solid var(--ok); border-radius:var(--radius); padding:14px 16px; }
.done-box h4 { margin:0 0 4px; color:var(--ok); font-size:17px; }
.done-box .sub { color:var(--muted); font-size:13px; }
.done-box .note { margin:8px 0 0; background:var(--warn-soft); border-color:var(--warn-line); border-left-color:var(--warn); }

/* panel "apa yang dipelajari" */
.learning-panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow-sm); overflow:hidden; }
.learning-panel summary { list-style:none; cursor:pointer; padding:13px 16px; display:flex; align-items:center; gap:10px; user-select:none; }
.learning-panel summary::-webkit-details-marker { display:none; }
.learning-panel summary::before { content:""; width:8px; height:8px; border-right:2px solid var(--brand); border-bottom:2px solid var(--brand); transform:rotate(-45deg); transition:transform .15s; margin-left:2px; flex-shrink:0; }
.learning-panel[open] summary::before { transform:rotate(45deg); }
.learning-panel-title { font-weight:750; font-size:14.5px; }
.learning-panel-hint { margin-left:auto; font-size:12px; color:var(--muted); font-weight:600; }
@media (max-width: 640px) { .learning-panel-hint { display:none; } }
.learning-panel-body { padding:4px 22px 18px; border-top:1px solid var(--line); color:var(--ink-2); font-size:14.2px; line-height:1.65; }
.learning-panel-body h4 { color:var(--ink); font-size:16px; margin:14px 0 6px; }
.learning-panel-body h5 { color:var(--ink); font-size:14.5px; margin:16px 0 6px; }
.learning-panel-body ul, .learning-panel-body ol { padding-left:22px; margin:6px 0 10px; }
.learning-panel-body li { margin-bottom:5px; }
.learning-callout { margin-top:14px; padding:12px 15px; border-radius:12px; background:var(--warn-soft); border:1px solid var(--warn-line); }
.learning-steps { display:grid; grid-template-columns:repeat(5, minmax(110px, 1fr)); gap:8px; margin:12px 0 14px; }
@media (max-width: 760px) { .learning-steps { grid-template-columns:1fr 1fr; } }
.learning-step { padding:10px; text-align:center; border:1px solid var(--brand-line); border-radius:10px; background:var(--brand-soft); color:var(--brand); font-size:12.8px; font-weight:700; }

/* sub-tab (gaya segmented seperti Psychometrics Lab) */
.subtabs { display:flex; gap:4px; padding:4px; background:var(--surface-3); border-radius:12px; margin-bottom:14px; overflow-x:auto; scrollbar-width:none; }
.subtabs::-webkit-scrollbar { display:none; }
.subtabs button { border:0; background:none; color:var(--muted); font-weight:650; font-size:13.8px; padding:8px 13px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.subtabs button:hover { color:var(--ink); }
.subtabs button.active { background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }
.subpage { display:none; }
.subpage.active { display:block; animation:fade .18s ease; }
.controls-card { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-end; }
.controls-card .field { margin:0; min-width:160px; }
.controls-card #bh_summary { flex:1; min-width:260px; }
.controls-card #bh_summary .box { margin:0; }

/* tabel versi CAT Lab */
table.dt th.sortable:hover { color:var(--ink); }
table.dt tbody tr.dim { opacity:.55; }

/* bagikan */
[data-share-box]:empty { display:none; }
[data-share-box] { margin:-4px 0 14px; }
.share-box { border:1px solid var(--brand-line); border-radius:12px; background:var(--brand-soft); padding:10px 12px; }
.share-box input { font-family:var(--mono); font-size:12px; padding:7px 9px; }
.share-status { font-size:12.5px; margin-top:6px; color:var(--muted); }
.share-status.ok { color:var(--ok); font-weight:700; }

/* progress */
.progress { margin:0 0 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; box-shadow:var(--shadow-sm); }
.progress-bar { height:8px; background:var(--surface-3); border-radius:999px; overflow:hidden; }
.progress-fill { height:100%; width:0; background:linear-gradient(90deg, var(--brand), var(--brand-2)); transition:width .15s linear; }
.progress-row { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:8px; font-size:12.8px; color:var(--muted); }

/* skenario */
.scenario-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:16px; }
.scenario { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:18px 20px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:9px; transition:box-shadow .15s, transform .15s; }
.scenario:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.scenario .tag { align-self:flex-start; font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; padding:4px 9px; border-radius:999px; background:var(--brand-soft); color:var(--brand); }
.scenario h4 { margin:0; font-size:16.5px; }
.scenario p { margin:0; font-size:14px; color:var(--ink-2); line-height:1.6; }
.scenario .q { background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:13.6px; line-height:1.55; color:var(--ink-2); }
.scenario .actions { display:flex; gap:8px; margin-top:auto; padding-top:6px; flex-wrap:wrap; }

/* referensi */
.reference { background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-sm); padding:8px 34px 26px; max-width:1040px; line-height:1.7; color:var(--ink-2); }
.reference > h2:first-child { display:none; }
.reference h3 { color:var(--ink); font-size:19px; margin:28px 0 8px; padding-top:18px; border-top:1px solid var(--line); }
.reference h3:first-of-type { border-top:0; padding-top:0; }
.reference h4 { color:var(--ink); font-size:15.5px; margin:18px 0 6px; }
.reference li { margin-bottom:6px; }
.reference strong { color:var(--ink); }
@media (max-width: 640px) { .reference { padding:4px 18px 18px; } }

.hint { font-size:12px; color:var(--muted); line-height:1.5; }
.metric-label .nc, .metric .k .nc { text-transform:none; letter-spacing:0; font-size:12.5px; }
.field .seg label, .field .chips label, .seg label { justify-content:flex-start; }
.seg-2 label { justify-content:center !important; }
.field-row { align-items:end; }
.side-action::after { content:""; display:block; height:2px; }

/* alur: item bank lebih dulu */
.module-card { position:relative; }
.step-badge { position:absolute; top:18px; right:18px; font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; padding:4px 9px; border-radius:999px; background:var(--brand-soft); color:var(--brand); border:1px solid var(--brand-line); }
.metrics.m6 { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); }
.active-bank-card [data-bank-summary] { font-size:13.4px; line-height:1.55; color:var(--ink-2); }
.bank-sum-top { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.bank-sum-top strong { color:var(--ink); font-size:17px; letter-spacing:-.01em; }
.bank-sum-top .model-pill { font-size:11.5px; padding:4px 10px; margin:0; }
.bank-sum-src { font-weight:650; color:var(--ink); }
.bank-sum-par { color:var(--muted); font-size:12.8px; margin-top:2px; }
.bank-sum-f { display:block; margin-top:8px; font-size:11.8px; white-space:normal; }
#bank_preset option[value="__custom"] { font-weight:700; }
