/* ===== ML Lab — RSM-inspired design system ===== */
:root {
  --navy: #00153D;
  --cerulean: #009CDE;
  --cerulean-dark: #0077b8;
  --blue: #2f6fd6;
  --red: #d64550;
  --coral: #E8826A;
  --sage: #6BAF8D;
  --amber: #E2A94E;
  --snow: #F7F8FC;
  --mist: #E8ECF4;
  --ink: #1c2b45;
  --ink-soft: #5c6b85;
  --card: #ffffff;
  --border: #e3e8f2;
  --shadow: 0 1px 3px rgba(0, 21, 61, .06), 0 4px 16px rgba(0, 21, 61, .05);
  --radius: 14px;
  --topbar-height: 86px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--snow);
  color: var(--ink);
  font-size: 14px;
  min-height: 100vh;
}

code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .85em; background: var(--mist); padding: 1px 5px; border-radius: 4px; }

.hidden { display: none !important; }

/* ===== Top bar ===== */
.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px;
  padding: 14px 26px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--cerulean));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .5px;
}
.brand-title { font-weight: 800; font-size: 17px; color: var(--navy); }
.brand-sub { font-size: 11.5px; color: var(--ink-soft); }
.language-switch {
  display: inline-flex; align-items: center; gap: 2px;
  margin-left: 4px; padding: 3px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--snow);
}
.language-switch button {
  border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-soft); cursor: pointer;
  min-width: 34px; padding: 6px 8px;
  font: 800 10px/1 "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .7px; transition: background .18s, color .18s, box-shadow .18s;
}
.language-switch button:hover { color: var(--navy); }
.language-switch button:focus-visible { outline: 2px solid var(--cerulean); outline-offset: 2px; }
.language-switch button.active {
  background: var(--navy); color: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 61, .2);
}

.creator-tools {
  display: flex; align-items: stretch; justify-content: flex-end; gap: 8px;
  min-width: 0;
}
.creator-link,
.learned-counter {
  position: relative; display: flex; align-items: center;
  min-height: 50px; border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.creator-link {
  gap: 10px; min-width: 240px; padding: 8px 12px 8px 9px;
  color: var(--navy); text-decoration: none;
  background: linear-gradient(135deg, #fff 55%, #eef8ff);
  border: 1px solid #cfe7f6;
  box-shadow: 0 4px 16px rgba(0, 119, 184, .08);
}
.creator-link:hover {
  transform: translateY(-2px);
  border-color: #8bcdeb;
  box-shadow: 0 8px 22px rgba(0, 119, 184, .15);
}
.creator-link:focus-visible {
  outline: 3px solid rgba(0, 156, 222, .32); outline-offset: 2px;
}
.linkedin-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 9px;
  color: #fff; background: #0a66c2;
  font: 800 16px/1 Arial, sans-serif; letter-spacing: -.6px;
  box-shadow: 0 4px 10px rgba(10, 102, 194, .24);
}
.creator-copy { display: flex; flex-direction: column; line-height: 1.15; }
.creator-kicker {
  color: var(--ink-soft); font-size: 9px; font-weight: 800;
  letter-spacing: .9px; text-transform: uppercase;
}
.creator-copy strong { margin-top: 3px; color: var(--navy); font-size: 12px; white-space: nowrap; }
.creator-arrow {
  margin-left: auto; color: var(--cerulean-dark); font-size: 15px; font-weight: 800;
  transition: transform .18s ease;
}
.creator-link:hover .creator-arrow { transform: translate(2px, -2px); }

.learned-counter {
  gap: 10px; min-width: 170px; padding: 8px 13px;
  overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--navy), #064f87);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 7px 20px rgba(0, 21, 61, .2);
}
.learned-counter::after {
  content: ""; position: absolute; z-index: 0;
  width: 82px; height: 82px; right: -32px; top: -38px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 156, 222, .48), rgba(0, 156, 222, 0) 70%);
}
.learning-pulse {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 29px; height: 29px; border-radius: 10px;
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.2);
}
.learning-pulse::before {
  content: ""; position: absolute; width: 8px; height: 8px;
  left: 10px; top: 7px; border-radius: 50%; background: #65d4ff;
  box-shadow: -6px 10px 0 -2px #fff, 6px 10px 0 -2px #fff;
}
.learning-pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 13px;
  border: 1px solid rgba(101, 212, 255, .55);
  animation: learner-pulse 2.2s ease-out infinite;
}
@keyframes learner-pulse {
  0% { transform: scale(.76); opacity: 0; }
  38% { opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
.counter-copy { position: relative; z-index: 1; display: flex; flex-direction: column; line-height: 1.05; }
.counter-copy strong {
  color: #fff; font-size: 18px; font-weight: 800;
  letter-spacing: -.25px; font-variant-numeric: tabular-nums;
}
.counter-copy span {
  margin-top: 4px; color: #bdeaff; font-size: 9px; font-weight: 800;
  letter-spacing: .7px; text-transform: uppercase; white-space: nowrap;
}
.learned-counter.is-loading .counter-copy strong { opacity: .66; }
.learned-counter.is-ready { animation: counter-arrive .45s ease both; }
@keyframes counter-arrive {
  from { transform: translateY(3px); opacity: .75; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .learning-pulse::after, .learned-counter.is-ready { animation: none; }
  .creator-link, .creator-arrow { transition: none; }
}

.tabs { display: flex; gap: 6px; background: var(--mist); padding: 5px; border-radius: 12px; }
.tabs-grouped {
  grid-column: 1 / -1; justify-self: center;
  background: transparent; padding: 0; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.tab-group {
  background: var(--mist); border-radius: 12px; padding: 3px 5px 5px;
}
.tab-group-label {
  font-size: 8.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--ink-soft); text-align: center; margin: 2px 0 3px;
}
.tab-group-row { display: flex; gap: 4px; }
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 7px 12px; border-radius: 9px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  transition: all .18s; white-space: nowrap;
}
.tab:hover { color: var(--navy); }
.tab.active { background: var(--cerulean); color: #fff; box-shadow: 0 2px 8px rgba(0,156,222,.35); }

/* ===== Layout ===== */
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 18px 22px 30px;
  max-width: 1700px; margin: 0 auto;
  align-items: start;
}

.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px;
  position: sticky; top: calc(var(--topbar-height) + 12px);
  max-height: calc(100vh - var(--topbar-height) - 36px);
  overflow-y: auto;
}

.group { margin-bottom: 22px; }
.group:last-child { margin-bottom: 4px; }
.group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 10px;
}
.subgroup { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.subgroup-title { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }

/* ===== Controls ===== */
.select {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--snow); color: var(--navy);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c6b85' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.slider-row { margin-bottom: 12px; }
.slider-row label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.val {
  background: var(--snow); border: 1px solid var(--border);
  color: var(--cerulean-dark); font-weight: 700; font-size: 12px;
  padding: 2px 10px; border-radius: 20px; min-width: 40px; text-align: center;
}
input[type="range"] {
  width: 100%; height: 5px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--cerulean) var(--fill, 30%), var(--mist) var(--fill, 30%));
  border-radius: 4px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--cerulean); border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,21,61,.3); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cerulean); border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,21,61,.3); cursor: grab;
}

.pill-toggle {
  display: flex; background: var(--mist); border-radius: 10px; padding: 4px; margin-bottom: 10px;
}
.pill {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 8px 6px; border-radius: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  transition: all .15s;
}
.pill.active { background: var(--cerulean); color: #fff; box-shadow: 0 2px 6px rgba(0,156,222,.3); }

.btn-row { display: flex; gap: 8px; margin-bottom: 8px; }
.btn {
  flex: 1; border: none; cursor: pointer; border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 13px; font-weight: 700;
  transition: all .15s;
}
.btn-sm { padding: 8px 8px; font-size: 12px; }
.btn-primary { background: var(--cerulean); color: #fff; box-shadow: 0 2px 8px rgba(0,156,222,.35); }
.btn-primary:hover { background: var(--cerulean-dark); }
.btn-primary.training { background: var(--amber); }
.btn-ghost { background: var(--snow); color: var(--navy); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--mist); }
.btn-ghost.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.file-btn { display: flex; align-items: center; justify-content: center; text-align: center; }

.howto summary {
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--cerulean-dark);
  padding: 6px 0; list-style: none;
}
.howto summary::before { content: "▸ "; }
.howto[open] summary::before { content: "▾ "; }
.howto-body { font-size: 12px; line-height: 1.65; color: var(--ink-soft); padding: 4px 0 4px 12px; border-left: 3px solid var(--mist); }

.note { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }
.note-tiny { font-size: 11px; line-height: 1.55; color: var(--ink-soft); margin-top: 4px; }
.note b, .insight b { color: var(--navy); }

.insight {
  font-size: 12.5px; line-height: 1.65; color: var(--ink);
  background: var(--snow); border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: 10px; padding: 12px;
}

/* ===== Stage / canvas ===== */
.stage { min-width: 0; }
.canvas-wrap {
  position: relative; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - 130px);
  margin: 0 auto;
}
.canvas-wrap canvas#main-canvas, .canvas-wrap canvas#imb-canvas {
  width: 100%; height: 100%; display: block; cursor: crosshair;
}

.overlay-card {
  position: absolute; background: rgba(255,255,255,.94); backdrop-filter: blur(4px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 14px; font-size: 12px;
}
.overlay-info { top: 14px; left: 14px; line-height: 1.7; min-width: 190px; }
.overlay-info b { color: var(--navy); }
.overlay-nn { top: 14px; right: 14px; }
.overlay-cm { bottom: 14px; left: 14px; }
.overlay-legend { bottom: 14px; right: 14px; line-height: 1.8; }
.overlay-title { font-size: 11px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.cm-sub { font-weight: 600; color: var(--ink-soft); }

.cm-grid {
  display: grid; grid-template-columns: repeat(2, 64px); gap: 4px;
}
.cm-cell {
  border-radius: 8px; padding: 7px 4px; text-align: center; color: #fff;
}
.cm-cell .cm-label { font-size: 10px; font-weight: 700; opacity: .9; display: block; }
.cm-cell .cm-num { font-size: 17px; font-weight: 800; }
.cm-good { background: var(--sage); }
.cm-bad { background: var(--coral); }

.legend-item { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.dot-blue { background: var(--blue); }
.dot-red { background: var(--red); }
.dot-hollow { background: transparent; border: 2px solid var(--ink-soft); border-radius: 2px; width: 8px; height: 8px; }
.sq-hollow-blue { display:inline-block; width: 8px; height: 8px; border: 2px solid var(--blue); border-radius: 2px; }
.sq-hollow-red { display:inline-block; width: 8px; height: 8px; border: 2px solid var(--red); border-radius: 2px; }

.line-key { display: inline-block; width: 22px; height: 3px; border-radius: 2px; vertical-align: middle; }
.line-blue { background: var(--blue); }
.line-red { background: var(--red); }

/* ===== Right metrics panel ===== */
.metric-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px 8px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.metric-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.metric-name { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); }
.metric-value { font-size: 21px; font-weight: 800; color: var(--cerulean-dark); font-variant-numeric: tabular-nums; }
.metric-card.metric-loss .metric-value { color: var(--red); }
.metric-card canvas { width: 100%; height: 44px; display: block; }

/* ===== Sub-stage mini charts ===== */
.substage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.substage-tall { margin-top: 0; grid-template-columns: 1fr; }
.mini-chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.mini-chart-card canvas { width: 100%; display: block; }
.mini-title { font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.grow { min-width: 0; }

.chip { display: inline-block; padding: 1px 10px; border-radius: 12px; font-size: 10.5px; font-weight: 700; color: #fff; }
.chip-blue { background: var(--blue); }
.chip-amber { background: var(--amber); }

/* ===== Fold strip (CV) ===== */
.fold-strip { display: flex; flex-direction: column; gap: 5px; }
.fold-row { display: flex; gap: 4px; align-items: center; }
.fold-row .fold-label { width: 58px; font-size: 11px; font-weight: 700; color: var(--ink-soft); flex-shrink: 0; }
.fold-seg {
  flex: 1; height: 22px; border-radius: 6px; background: var(--blue); opacity: .8;
  transition: all .3s;
}
.fold-seg.val-seg { background: var(--amber); opacity: 1; }
.fold-row.fold-active .fold-seg { opacity: 1; box-shadow: 0 0 0 2px rgba(0,156,222,.3); }
.fold-row.fold-pending { opacity: .35; }
.fold-score { width: 52px; font-size: 12px; font-weight: 800; color: var(--navy); text-align: right; flex-shrink: 0; }

/* ===== Badge & cheat sheet ===== */
.badge-big {
  border-radius: 12px; padding: 16px 14px; text-align: center;
  font-weight: 800; font-size: 16px; color: #fff; margin-bottom: 14px;
  background: var(--sage); box-shadow: var(--shadow);
}
.badge-big small { display: block; font-size: 11px; font-weight: 600; opacity: .92; margin-top: 4px; }
.badge-under { background: var(--amber); }
.badge-over { background: var(--coral); }
.badge-good { background: var(--sage); }

.cheat { display: flex; flex-direction: column; gap: 10px; }
.cheat-item {
  background: var(--snow); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; line-height: 1.55;
}
.cheat-item b { display: block; color: var(--navy); margin-bottom: 2px; }
.cheat-item span { display: block; color: var(--ink-soft); }
.cheat-item .fix { color: var(--cerulean-dark); font-weight: 600; margin-top: 3px; }

.sticky-actions { position: sticky; bottom: 0; background: var(--card); padding-top: 8px; }

/* ===== Anatomi Prediksi ===== */
.step-log {
  list-style: none; max-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.step-log li {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 8px; background: var(--snow);
  border-left: 3px solid var(--border);
}
.step-log li.current {
  color: var(--ink); font-weight: 600;
  background: #eaf6fd; border-left-color: var(--cerulean);
}
.step-log li.step-hint { background: transparent; border-left-color: transparent; font-style: italic; }
.step-log li b, .step-log li code { color: var(--navy); }

.neighbor-list { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; min-height: 320px; }
.neighbor-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--snow); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px;
  animation: nb-in .35s ease;
}
.neighbor-card .nb-rank { font-weight: 800; color: var(--cerulean-dark); font-size: 15px; min-width: 30px; }
.neighbor-card .nb-feats { flex: 1; color: var(--ink-soft); line-height: 1.5; }
.neighbor-card .nb-y { font-weight: 800; color: var(--navy); white-space: nowrap; }
.neighbor-card .nb-dist { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.neighbor-card.nb-result { border: 2px solid var(--cerulean); background: #eaf6fd; }
.neighbor-card.nb-intro { justify-content: flex-start; color: var(--ink-soft); font-style: italic; }
@keyframes nb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.an-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 7px 10px; border-radius: 8px; margin-bottom: 4px;
  color: var(--ink-soft);
}
.an-row b { color: var(--navy); font-variant-numeric: tabular-nums; }
.an-row.sel { background: var(--mist); font-weight: 700; color: var(--navy); }

/* ===== 20 Konsep AI (master-detail) ===== */
.cn-layout {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px;
  max-width: 1560px; margin: 0 auto; padding: 18px 22px 30px; align-items: start;
}
.cn-side {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 12px;
  position: sticky; top: 86px; max-height: calc(100vh - 104px); overflow-y: auto;
}
.cn-side-head { font-size: 13px; font-weight: 800; color: var(--navy); margin: 2px 4px 12px; }
.cn-grp { margin-bottom: 14px; }
.cn-grp:last-child { margin-bottom: 0; }
.cn-grp-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 5px 6px; display: flex; align-items: center; gap: 6px;
}
.cn-grp-title .cn-grp-bar { width: 14px; height: 3px; border-radius: 2px; }
.cn-item {
  display: flex; align-items: center; gap: 9px; width: 100%; border: none;
  background: transparent; cursor: pointer; text-align: left; padding: 7px 9px;
  border-radius: 9px; font-family: inherit; transition: all .12s; margin-bottom: 1px;
}
.cn-item:hover { background: var(--snow); }
.cn-item.active { background: #eaf6fd; }
.cn-item .cn-emo { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.cn-item .cn-ttl { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.cn-item.active .cn-ttl { color: var(--navy); font-weight: 700; }
.cn-item .cn-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; opacity: 0; flex-shrink: 0; }
.cn-item.active .cn-dot { opacity: 1; }

.cn-detail { margin: 0; }
.cn-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cn-detail-head .cn-dnum {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), var(--cerulean));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.cn-detail-head h3 { font-size: 18px; color: var(--navy); font-weight: 800; }
.cn-detail-head .cn-deep {
  margin-left: auto; cursor: pointer; border-radius: 9px;
  background: var(--snow); color: var(--cerulean-dark); border: 1px solid var(--border);
  padding: 8px 14px; font-family: inherit; font-size: 12.5px; font-weight: 700;
}
.cn-detail-head .cn-deep:hover { background: var(--mist); }
#cn-canvas { width: 100%; display: block; background: #fbfcfe; border-radius: 10px; }
#cn-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; align-items: center; }
#cn-controls .btn { flex: 0 1 auto; }
.cn-text { font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.cn-text b { color: var(--navy); }
.cn-when { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

@media (max-width: 900px) {
  .cn-layout { grid-template-columns: 1fr; }
  .cn-side { position: static; max-height: none; }
}

/* ===== LLM Lab ===== */
textarea.select { height: auto; line-height: 1.55; font-weight: 500; background-image: none; }
.token-flow { display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 8px 0; }
.token-chip {
  display: inline-flex; flex-direction: column; align-items: center;
  border-radius: 8px; padding: 5px 9px 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(0,21,61,.14);
}
.token-chip .tok-id { font-size: 9.5px; font-weight: 700; opacity: .65; margin-top: 1px; font-family: Sora, sans-serif; }
.llm-out {
  background: var(--snow); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; font-size: 14.5px; line-height: 1.8; min-height: 88px;
  margin-bottom: 12px; color: var(--ink);
}
.llm-out .tok-new { background: #ffe9c2; border-radius: 4px; padding: 1px 3px; font-weight: 700; }
.llm-out .tok-cursor { display: inline-block; width: 9px; height: 17px; background: var(--cerulean); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.footer {
  text-align: center; font-size: 11.5px; color: var(--ink-soft);
  padding: 10px 20px 26px; max-width: 900px; margin: 0 auto; line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .panel-right { grid-column: 1 / -1; position: static; max-height: none;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
  .panel-right .group-title, .panel-right .pill-toggle { grid-column: 1 / -1; }
  .substage { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .topbar {
    grid-template-columns: minmax(0, 1fr); justify-content: stretch;
    position: relative; top: auto;
  }
  .brand { width: 100%; justify-content: center; flex-wrap: wrap; }
  .creator-tools { width: 100%; justify-content: center; }
  .creator-link { min-width: 0; flex: 1 1 56%; }
  .learned-counter { min-width: 0; flex: 1 1 44%; }
  .tabs-grouped {
    grid-column: 1;
    width: 100%; gap: 8px; flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .tab-group { width: auto; max-width: none; flex: 0 0 auto; }
  .tab-group-row { justify-content: center; flex-wrap: nowrap; }
  .tab { padding-inline: 9px; }
}
@media (max-width: 480px) {
  .topbar { padding-inline: 14px; }
  .creator-link { padding-right: 9px; }
  .creator-copy strong { font-size: 11px; }
  .creator-arrow { display: none; }
  .learned-counter { padding-inline: 10px; }
  .learning-pulse { width: 27px; height: 27px; }
  .learning-pulse::before { left: 9px; top: 6px; }
  .counter-copy strong { font-size: 16px; }
  .counter-copy span { font-size: 8px; letter-spacing: .45px; }
}
