/* Neural Network Visualizers: shared styles. Same dark lab look as the rest of OneLab. */
:root {
  --bg: #0b0d14; --bg-2: #11141e; --bg-3: #171b28; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --ink: #dfe3ee; --ink-2: #a7adc2; --ink-3: #6c7390;
  --mint: #86d4c3; --amber: #e0b27c; --pink: #dc97b8; --blue: #86a6dc; --red: #d98a8a;
  --a: #7fa7e0; --b: #e2ae74;            /* the two classes everywhere */
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
canvas { display: block; touch-action: none; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(11,13,20,.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.back { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 11px; font-family: var(--mono); font-size: 12.5px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.back:hover { color: var(--ink); border-color: var(--mint); }
.bar .brand { font-family: var(--mono); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .brand b { color: var(--mint); font-weight: 500; }
.bar .spacer { flex: 1; }
.stepnav { display: flex; gap: 6px; align-items: center; }
.stepnav a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 9px; text-decoration: none; color: var(--ink-2); }
.stepnav a:hover { color: var(--ink); border-color: var(--mint); }
.stepnav a[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.stepnav .pos { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding: 0 4px; }
.install { font-family: var(--mono); font-size: 12px; color: var(--mint); background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 11px; }
.install[hidden] { display: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }

/* intro */
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; padding: 40px 0 28px; align-items: start; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; color: var(--mint); margin: 0 0 12px; letter-spacing: .02em; }
.eyebrow span { color: var(--ink-3); }
h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; }
.lede { font-size: 17px; line-height: 1.65; color: var(--ink-2); margin: 0 0 14px; }
.lede b, .how b, .try b { color: var(--ink); font-weight: 600; }
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.how li { counter-increment: s; position: relative; padding: 14px 16px 14px 52px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.how li::before { content: counter(s); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); }
.how-h { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }

/* demo */
.demo-h { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 12px 0 18px; }
.demo-h h2 { font-size: 15px; margin: 0; }
.demo-h span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.demo { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stage { position: relative; background: #080a10; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stage canvas { width: 100%; height: auto; }
.cap { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
.ctl { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn { border: 1px solid var(--line-2); background: var(--bg-3); border-radius: 10px; padding: 8px 13px; font-size: 13.5px; color: var(--ink-2); }
.btn:hover { color: var(--ink); border-color: var(--ink-3); }
.btn.on { color: #0d2a25; background: var(--mint); border-color: var(--mint); font-weight: 600; }
.btn.go { color: #0d2a25; background: var(--mint); border-color: var(--mint); font-weight: 600; min-width: 92px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-3); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: color-mix(in srgb, var(--mint) 22%, transparent); color: var(--ink); }
label.sl { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
label.sl span { display: flex; justify-content: space-between; }
label.sl b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--mint); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.stat div { font-family: var(--mono); font-size: 15px; margin-top: 2px; }
.note { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); }
.note.warn { border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--ink); }
.note.good { border-color: color-mix(in srgb, var(--mint) 45%, transparent); color: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.overlay-hint { position: absolute; left: 12px; bottom: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); pointer-events: none; }
.bars { display: grid; gap: 4px; }
.bars .b { display: grid; grid-template-columns: 26px 1fr 46px; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.bars .b i { display: block; height: 12px; border-radius: 4px; background: var(--mint); min-width: 2px; transition: width .15s; }
.bars .b.top { color: var(--ink); }
.bars .b em { font-style: normal; text-align: right; color: var(--ink-3); }

.try { margin: 28px 0 0; padding: 18px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; }
.try h3 { margin: 0 0 10px; font-size: 15px; }
.try ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; line-height: 1.75; }
.deeper { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.deeper div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.deeper h4 { margin: 0 0 6px; color: var(--ink); font-size: 14px; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.pager a { display: block; text-decoration: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.pager a:hover { border-color: var(--line-2); }
.pager small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pager div { font-size: 16px; font-weight: 600; margin-top: 4px; }
.pager .nx { text-align: right; }
.pager .empty { visibility: hidden; }
footer.f { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .intro { grid-template-columns: 1fr; gap: 22px; padding-top: 26px; }
  .demo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { -webkit-user-select: none; user-select: none; }
  .bar .brand { flex: 1 1 0; min-width: 0; font-size: 14px; font-weight: 600; font-family: var(--sans); }
  .bar .spacer { display: none; }
  .stepnav .pos { display: none; }
  .back span { display: none; }
  .lede { font-size: 16px; }
  .pager { grid-template-columns: 1fr; }
  .card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* guided tour */
.tourbtn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); border-radius: 9px; padding: 5px 12px 5px 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.tourbtn:hover { color: var(--ink); border-color: var(--mint); }
.tq { width: 20px; height: 20px; border-radius: 50%; background: var(--mint); color: #0d2a25; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 560px) { .tourbtn { padding: 0; width: 34px; height: 34px; justify-content: center; } .tl { display: none; } }
.tour { position: fixed; inset: 0; z-index: 100; }
.tour[hidden] { display: none; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(4,6,12,.66), 0 0 0 2px rgba(134,212,195,.8) inset; pointer-events: none; transition: all .3s ease; }
.tour.centered .tour-hole { box-shadow: 0 0 0 9999px rgba(4,6,12,.66); }
.tour-card { position: fixed; width: 340px; max-width: calc(100vw - 24px); background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55); font-size: 14px; line-height: 1.55; transition: left .3s ease, top .3s ease; }
.tour.centered .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 400px; text-align: center; padding: 26px 26px 20px; }
.tour.centered .tour-title { font-size: 21px; }
.tour.centered .tour-actions, .tour.centered .tour-progress { justify-content: center; }
.tour-progress { display: flex; gap: 3px; margin-bottom: 10px; }
.tour-progress i { height: 4px; flex: 1; max-width: 18px; border-radius: 2px; background: var(--line-2); }
.tour-progress i.done { background: color-mix(in srgb, var(--mint) 45%, transparent); }
.tour-progress i.on { background: var(--mint); }
.tour-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.tour-text { color: var(--ink-2); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-skip { background: none; border: 0; color: var(--ink-3); font-size: 13px; padding: 6px 4px; margin-right: auto; cursor: pointer; font-family: inherit; }
.tour-count { font-size: 12px; color: var(--ink-3); margin-right: 4px; }
.tour-back { background: none; border: 1px solid var(--line-2); color: var(--ink); border-radius: 9px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.tour-next { background: var(--mint); border: 0; color: #0d2a25; border-radius: 9px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tour-back[hidden], .tour-skip[hidden] { display: none; }

/* ---- app feel on phones ---- */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 700px), (display-mode: standalone) and (max-width: 900px) {
  html, body { overscroll-behavior: none; }
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
  p, li, h1, h2, h3, h4, .lede, .note, .how, td, .txt, input { -webkit-user-select: text; user-select: text; }
  body.has-tabs { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  body.has-tabs [data-pane] { display: none; }
  body.has-tabs[data-pane="try"] [data-pane="try"], body.has-tabs[data-pane="learn"] [data-pane="learn"], body.has-tabs[data-pane="more"] [data-pane="more"],
  body.has-tabs[data-pane="explore"] [data-pane="explore"], body.has-tabs[data-pane="basics"] [data-pane="basics"], body.has-tabs[data-pane="story"] [data-pane="story"], body.has-tabs[data-pane="uses"] [data-pane="uses"] { display: revert; animation: pane-in .22s ease; }
  body.has-tabs .demo-h { display: none; }
  body.has-tabs[data-pane="try"] .wrap { padding-top: 14px; }
  body.has-tabs .demo { display: grid; }
  .pager { display: grid; }
  .f { display: none; }
  .btn, .seg button, .back, .stepnav a, .tourbtn { min-height: 40px; }
  .seg button { padding-top: 9px; padding-bottom: 9px; }
  .bar .brand { font-size: 13px; }
}
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tabs { display: none; }
@media (max-width: 700px), (display-mode: standalone) and (max-width: 900px) {
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(11,13,20,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--ink-3); font-size: 11px; font-weight: 500; padding: 7px 0 4px; border-radius: 12px; }
  .tabs button.on { color: var(--mint); }
  .tabs button.on svg { stroke: var(--mint); }
  .tabs button:active { background: rgba(255,255,255,.06); }
  .tour { z-index: 100; }
}

@media (max-width: 700px), (display-mode: standalone) and (max-width: 900px) {
  body.has-tabs .demo-h[data-pane] { display: none !important; }
  .bar .brand { flex: 1 1 0; min-width: 0; }
  .row.dock { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 15; background: rgba(17,20,30,.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--line-2); border-radius: 16px; padding: 10px; margin: 10px -4px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
  .row.dock .btn.go { min-width: 108px; }
  .row.dock .txt { flex: 1 1 100%; }
}
