:root {
  --bg: #0b1020;
  --panel: #141b31;
  --panel2: #0f1526;
  --line: #26304d;
  --text: #e7ecf7;
  --muted: #97a3c0;
  --accent: #6a96ff;
  --accent2: #9b7bff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #1a2450 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- header & tab ---------- */
header { text-align: center; padding: 28px 16px 10px; }
.logo { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); margin: 4px 0 0; }

.tabs {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 14px 16px; position: sticky; top: 0; z-index: 10;
  background: rgba(11, 16, 32, .88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tabs button {
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); padding: 8px 14px;
  border-radius: 999px; cursor: pointer; font-size: 14px; transition: all .15s;
}
.tabs button:hover { color: var(--text); border-color: var(--accent); }
.tabs button.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #0b1020; font-weight: 700; border-color: transparent;
}

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 22px 16px 60px; }
.tab-panel { display: none; animation: fade .3s ease; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.explain h2 { margin-top: 0; font-size: 22px; }
.explain p { color: var(--muted); }
.explain b, .explain i { color: var(--text); }
.hero p, .hero b { color: var(--muted); }
.hero b { color: var(--text); }

.formula {
  background: var(--panel2); border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 14px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 14px; color: #a9c1ff; margin: 12px 0;
}
.tip { font-size: 13.5px; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.note { color: var(--muted); font-size: 14px; }
.note b { color: var(--text); }

/* ---------- kontrol ---------- */
.lbl { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .6px; }
.lbl-inline { font-size: 14px; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.chk { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

textarea, input[type="text"], select {
  width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; outline: none;
}
textarea:focus, input[type="text"]:focus, select:focus { border-color: var(--accent); }
select { width: auto; }
input[type="range"] { flex: 1; accent-color: var(--accent); }

button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer; transition: all .15s;
}
button:hover { border-color: var(--accent); }
button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #0b1020; font-weight: 700; border: none;
}
button:disabled { opacity: .5; cursor: default; }

.head-btn { font-size: 13px; padding: 7px 12px; border-radius: 999px; }
.head-btn.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #0b1020; font-weight: 700; border-color: transparent;
}

/* ---------- chip token ---------- */
.chipbox {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; min-height: 56px; margin-top: 10px;
}
.chipbox.small { padding: 10px; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid; border-radius: 9px; padding: 4px 9px;
  font-family: ui-monospace, monospace; font-size: 14px;
}
.chip.sub .chip-t { font-style: italic; opacity: .9; }
.chip-id { font-size: 10.5px; opacity: .65; }
.chip.fresh { animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

.legend { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- bar probabilitas ---------- */
.bars { margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 52px; gap: 10px; align-items: center; padding: 3px 0; }
.bar-lab {
  font-family: ui-monospace, monospace; font-size: 13.5px; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track { background: var(--panel2); border-radius: 6px; height: 16px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 6px; transition: width .35s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.bar-pct { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.bar-row.picked .bar-lab { color: #9fe8b1; font-weight: 700; }
.bar-row.picked .bar-fill { background: linear-gradient(90deg, #3ecf8e, #9fe8b1); }

/* ---------- gauge entropi ---------- */
.gauge { flex: 1; height: 12px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.gauge-fill {
  height: 100%; width: 0; transition: width .3s;
  background: linear-gradient(90deg, #3ecf8e, #ffd166, #ff6b6b);
}

/* ---------- heatmap attention ---------- */
.heat { overflow-x: auto; margin-top: 8px; }
.heat-svg { width: 100%; height: auto; }
.hlab { fill: var(--muted); font-size: 12px; font-family: ui-monospace, monospace; }
.hlab.lrow { text-anchor: end; }
.hlab.hot { fill: var(--text); font-weight: 700; }
.haxis { fill: var(--muted); font-size: 11.5px; }
.cell { transition: opacity .15s; }
.cell.dim { opacity: .18; }
.cell.hot { stroke: #cdd9ff; stroke-width: 1; }

/* ---------- scatter embedding ---------- */
.scatter { margin-top: 6px; }
.scatter-svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.sframe { fill: var(--panel2); stroke: var(--line); }
.saxis { stroke: var(--line); stroke-dasharray: 4 4; }
.sdot { fill: var(--accent); stroke: #cdd9ff; stroke-width: 1; }
.slab { fill: var(--text); font-size: 11.5px; }

/* ---------- pipeline ikhtisar ---------- */
.pipeline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 20px 0; }
.node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 108px; padding: 14px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.node:hover { border-color: var(--accent); transform: translateY(-2px); }
.node-ico { font-size: 22px; }
.arrow { color: var(--accent); font-size: 20px; font-weight: 700; }
.arrow.loop { color: #3ecf8e; }

/* ---------- kartu statistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat { text-align: center; padding: 16px 8px; }
.stat-num {
  font-size: 24px; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-lbl { font-size: 12.5px; color: var(--muted); }

/* ---------- blok transformer ---------- */
.tf-lab { display: grid; grid-template-columns: 34px 1fr; gap: 6px 14px; align-items: stretch; }
.tf-stack { display: flex; flex-direction: column-reverse; gap: 2px; grid-row: 1 / 3; }
.tf-layer { flex: 1; min-height: 5px; border-radius: 3px; opacity: .85; }
.tf-block { display: flex; flex-direction: column; align-items: center; }
.tf-io { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; padding: 4px; }
.stage {
  width: 100%; max-width: 300px; text-align: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2); font-weight: 600; font-size: 14px; transition: all .25s;
}
.stage.active {
  border-color: var(--accent); background: #1b2a55;
  box-shadow: 0 0 18px rgba(106, 150, 255, .45); transform: scale(1.03);
}
.tf-arrow { color: var(--accent); line-height: 1; padding: 2px 0; }
#tf-caption { grid-column: 1 / -1; }

footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 20px; border-top: 1px solid var(--line);
}

/* ---------- responsif ---------- */
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

