/* Routerfish console. Tokens first; components are written against roles. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #fafaf9;
  --panel: #fcfcfb;
  --well: #f3f3f1;
  --well-gutter: #ebebe8;
  --line: #e7e6e1;
  --line-strong: #d6d5cf;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #86847e;
  --active: #ebebe9;
  --hover: #f3f3f1;
  --ring: #7c9cf2;
  --primary: #111111;
  --primary-ink: #ffffff;
  --good-bg: #d6ecc9; --good-ink: #1f5b1f; --good: #0ca30c;
  --warn-bg: #fbeecb; --warn-ink: #6f4d00;
  --bad-bg: #fadcdb; --bad-ink: #8c1d1d; --bad: #d03b3b;
  --info-bg: #e3edfc; --info-ink: #1c4f95;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --de-emphasis: #c9c8c1;
  --grid: #eeede8;
  --axis: #c3c2b7;
  --chart-surface: #ffffff;
  --shadow: 0 10px 34px rgba(15, 15, 15, .10), 0 1px 3px rgba(15, 15, 15, .06);
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 288px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111110; --sidebar: #161615; --panel: #181817; --well: #1e1e1c; --well-gutter: #242422;
    --line: #2a2a28; --line-strong: #3a3a37; --ink: #f4f4f1; --ink-2: #c3c2b7; --muted: #8f8d86;
    --active: #242422; --hover: #1d1d1b; --ring: #5d83e0; --primary: #f4f4f1; --primary-ink: #111110;
    --good-bg: #16361a; --good-ink: #9fdc9f; --warn-bg: #3a2d0a; --warn-ink: #f3cf73;
    --bad-bg: #3d1616; --bad-ink: #f2a3a3; --info-bg: #15294a; --info-ink: #a9c7f7;
    --series-1: #3987e5; --series-2: #d95926; --de-emphasis: #4a4a46;
    --grid: #262624; --axis: #383835; --chart-surface: #161615;
    --shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --sidebar: #161615; --panel: #181817; --well: #1e1e1c; --well-gutter: #242422;
  --line: #2a2a28; --line-strong: #3a3a37; --ink: #f4f4f1; --ink-2: #c3c2b7; --muted: #8f8d86;
  --active: #242422; --hover: #1d1d1b; --ring: #5d83e0; --primary: #f4f4f1; --primary-ink: #111110;
  --good-bg: #16361a; --good-ink: #9fdc9f; --warn-bg: #3a2d0a; --warn-ink: #f3cf73;
  --bad-bg: #3d1616; --bad-ink: #f2a3a3; --info-bg: #15294a; --info-ink: #a9c7f7;
  --series-1: #3987e5; --series-2: #d95926; --de-emphasis: #4a4a46;
  --grid: #262624; --axis: #383835; --chart-surface: #161615;
  --shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: .86em; }
::selection { background: color-mix(in srgb, var(--series-1) 25%, transparent); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.icon { display: inline-flex; width: 16px; height: 16px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; }
.shell.collapsed { --sidebar-w: 68px; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0; padding: 14px 10px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand .logo { width: 26px; height: 26px; color: var(--ink); }
.brand .wordmark { font-weight: 700; letter-spacing: .06em; font-size: 14px; }
.brand .collapse { margin-left: auto; }
.collapsed .brand .wordmark, .collapsed .nav-label, .collapsed .who-text, .collapsed .nav .ext { display: none; }
.collapsed .brand { flex-direction: column; gap: 14px; }
.collapsed .brand .collapse { margin: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 7px; text-decoration: none;
  color: var(--ink); font-size: 15.5px; border: 1.5px solid transparent;
}
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--active); border-color: var(--ring); }
.nav a .icon { width: 18px; height: 18px; color: var(--ink-2); }
.nav a .ext { margin-left: auto; color: var(--muted); }
.nav .section { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.collapsed .nav .section { visibility: hidden; height: 4px; margin: 6px 0; }
.sidebar-foot { margin-top: auto; position: relative; }
.who {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none;
  border-radius: 8px; cursor: pointer; text-align: left;
}
.who:hover { background: var(--hover); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none;
}
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-text strong { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { color: var(--muted); font-size: 13px; }
.who .chev { margin-left: auto; color: var(--ink-2); }
.main { min-width: 0; min-height: 0; overflow: auto; background: var(--bg); }
.page { padding: 28px 40px 48px; max-width: 1360px; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.2; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--ink-2); margin: 6px 0 0; max-width: 760px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 16px; }
.crumb .icon { width: 18px; height: 18px; }
.mobile-bar { display: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; font-size: 14.5px;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13.5px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-pressed="true"] { background: var(--active); color: var(--ink); }
.icon-btn .icon { width: 18px; height: 18px; }
.input, .select, .textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg);
  width: 100%; outline: none;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 500; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; }
.select-inline {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 6px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.select-inline:hover { background: var(--hover); color: var(--ink); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; background: var(--line-strong); transition: background .15s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.toggle-row .text { display: flex; flex-direction: column; }
.toggle-row .text span { color: var(--muted); font-size: 13px; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 3px; font-size: 13px;
  background: var(--well); color: var(--ink-2); white-space: nowrap; line-height: 1.6;
}
.badge.good { background: var(--good-bg); color: var(--good-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.info { background: var(--info-bg); color: var(--info-ink); }
.badge.black { background: var(--primary); color: var(--primary-ink); border-radius: 0; font-size: 13.5px; padding: 1px 9px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; background: var(--well);
  font-family: var(--mono); font-size: 12.5px; color: var(--ink); white-space: nowrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; font-size: 14px; white-space: nowrap;
}
.pill[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- tables ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font-weight: 500; font-size: 14px; color: var(--ink-2); padding: 12px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--panel); }
.table td.right, .table th.right { text-align: right; }
.table .sort { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-weight: 500; }
.table .sort .icon { width: 13px; height: 13px; color: var(--muted); }
.table .muted-cell { color: var(--ink-2); }
.table.dense th, .table.dense td { padding-left: 10px; padding-right: 10px; }
.table.dense td { padding-top: 12px; padding-bottom: 12px; }
.table .truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; font-weight: 600; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.card-pad { padding: 20px 22px; }
.card h2, .section-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.caps { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.grid { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .label { color: var(--ink-2); font-size: 14px; }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.stat .foot { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- menus, modals, drawers, toasts ---------- */
.menu {
  position: fixed; z-index: 50; min-width: 220px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto;
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; text-align: left; cursor: pointer; font-size: 14.5px; text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu button[disabled] { opacity: .45; cursor: default; }
.menu .check { width: 16px; margin-left: auto; font-weight: 700; }
.menu .group { padding: 8px 10px 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .sub { display: block; color: var(--muted); font-size: 12.5px; }
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 10, .32); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal header { display: flex; align-items: center; padding: 20px 22px 6px; }
.modal header h2 { margin: 0; font-size: 19px; font-weight: 600; }
.modal header .icon-btn { margin-left: auto; }
.modal .body { padding: 10px 22px 6px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.secret-box {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--well); border-radius: 6px;
  font-family: var(--mono); font-size: 13px; word-break: break-all;
}
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.callout.info { background: var(--info-bg); color: var(--info-ink); }
.callout .icon { margin-top: 2px; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(10, 10, 10, .22); z-index: 55; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 56;
  box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 18px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer header .icon-btn { margin-left: auto; }
.drawer .content { overflow: auto; padding: 18px 22px 40px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }
.toast.error { background: var(--bad); color: #fff; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- code ---------- */
.codeblock { position: relative; background: var(--well); border-radius: 8px; overflow: hidden; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow: auto; font-size: 13px; line-height: 1.6; }
.codeblock .copy { position: absolute; top: 6px; right: 6px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button {
  background: none; border: 0; padding: 8px 0; cursor: pointer; color: var(--ink-2); font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.json { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; margin: 0; }

/* ---------- editor (Playground) ---------- */
.editor { display: grid; grid-template-columns: 40px minmax(0, 1fr); background: var(--well); border-radius: 2px; }
.editor .gutter {
  background: var(--well-gutter); color: var(--muted); font-family: var(--mono); font-size: 13.5px; line-height: 22px;
  text-align: center; padding: 8px 0; user-select: none;
}
.editor textarea {
  border: 0; outline: none; background: transparent; resize: none; padding: 8px 12px; width: 100%;
  font-family: var(--mono); font-size: 14px; line-height: 22px; min-height: 38px; overflow: hidden; color: var(--ink);
}
.editor textarea::placeholder { color: var(--muted); }

/* ---------- playground ---------- */
.pg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 100vh; }
.pg.stacked { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
.pg.solo { grid-template-columns: minmax(0, 1fr); }
.pg-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.pg.stacked .pg-left { border-right: 0; border-bottom: 1px solid var(--line); }
.pg-top { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.pg-top .crumb { margin-right: auto; }
.pg-scroll { flex: 1; overflow: auto; min-height: 0; }
.pg-section { border-bottom: 1px solid var(--line); }
.pg-section > .head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; }
.pg-section > .head h3 { margin: 0; font-weight: 400; font-size: 16px; color: var(--ink-2); margin-right: auto; }
.pg-section > .body { padding: 0 16px 16px; }
.msg { margin-bottom: 10px; }
.msg .role { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.msg .role button.rolebtn { border: 0; background: none; padding: 2px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--ink-2); text-transform: capitalize; }
.msg .role button.rolebtn:hover { background: var(--hover); }
.msg .role .icon-btn { width: 26px; height: 26px; margin-left: auto; }
.pg-bottom { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); }
.pg-bottom > .icon-btn, .pg-bottom > .run-btn { flex-shrink: 0; }
.model-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 4px;
  background: var(--well); border: 0; cursor: pointer; font-size: 14.5px; min-width: 0; max-width: 320px;
}
.model-chip span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-btn { margin-left: auto; height: 38px; min-width: 96px; justify-content: center; }
.pg-right { overflow: auto; min-height: 0; background: var(--bg); position: relative; }
.pg-right .close { position: absolute; top: 18px; right: 18px; }
.learn { padding: 40px 0 40px; }
.learn .caps { padding: 0 28px; }
.learn h2.title { font-size: 52px; line-height: 1.05; font-weight: 600; margin: 8px 28px 28px; letter-spacing: -.02em; }
.learn .band { border-top: 1px solid var(--line); padding: 26px 0 0; }
.learn .band .caps { display: block; margin-bottom: 14px; }
.lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lesson {
  position: relative; border: 0; border-right: 1px solid var(--line); background: var(--bg); cursor: pointer; padding: 44px 14px 22px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.lesson:last-child { border-right: 0; }
.lesson:hover { background: var(--panel); }
.lesson .badge.black { position: absolute; top: 0; right: 0; }
.lesson .art { width: 150px; height: 118px; margin-bottom: 18px; }
.lesson strong { font-weight: 500; font-size: 16px; }
.lesson span { color: var(--ink-2); font-size: 15px; }
.usecases { border-top: 1px solid var(--line); }
.usecase {
  display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 18px 28px; border: 0;
  border-bottom: 1px solid var(--line); background: var(--bg); cursor: pointer; text-align: left; font-size: 16px;
}
.usecase:hover { background: var(--panel); }
.usecase strong { font-weight: 500; white-space: nowrap; }
.usecase span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usecase .undeployed { margin-left: auto; }
.response { padding: 22px 28px 40px; }
.response .caps { display: block; margin-bottom: 10px; }
.answer { font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; min-height: 24px; }
.answer.streaming::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--muted); }
@keyframes blink { 50% { opacity: 0; } }
.answer.done { white-space: normal; }
.md .md-p { margin: 0 0 12px; }
.md .md-h { font-weight: 600; margin: 16px 0 8px; }
.md .md-code { background: var(--well); padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: 13px; line-height: 1.55; margin: 0 0 12px; white-space: pre; }
.md .md-inline { background: var(--well); padding: 1px 5px; border-radius: 4px; font-size: .86em; }
.md .md-list { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.reasoning { margin: 0 0 14px; border-left: 2px solid var(--line-strong); padding: 2px 0 2px 12px; color: var(--ink-2); font-size: 14px; white-space: pre-wrap; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; color: var(--ink-2); font-size: 13.5px; align-items: center; }
.meta-row .sep { color: var(--line-strong); }
.feedback { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.route-card { margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.route-card .top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolcall { margin-top: 12px; }

/* ---------- charts ---------- */
.charts-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; }
.charts-main { padding-right: 36px; min-width: 0; }
.charts-side { border-left: 1px dashed var(--line-strong); padding-left: 36px; min-width: 0; }
.chart-block { margin-bottom: 34px; }
.chart-block .chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.chart-block .chart-head h3 { margin: 0; font-size: 20px; font-weight: 500; }
.chart-block .chart-head .total { font-size: 24px; font-weight: 400; }
.chart { position: relative; width: 100%; transition: opacity .15s; }
.chart.loading { opacity: .45; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; cursor: default; }
.chart .band-hover { fill: var(--hover); }
.chart .empty-note { fill: var(--muted); font-size: 13px; paint-order: stroke; stroke: var(--chart-surface); stroke-width: 8px; stroke-linejoin: round; }
.chart:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 4px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin: 2px 0 4px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 2px; }
.tooltip {
  position: fixed; z-index: 70; pointer-events: none; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; min-width: 150px;
}
.tooltip .t-head { color: var(--ink-2); margin-bottom: 6px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .t-row span { color: var(--ink-2); }
.tooltip .t-key { width: 12px; height: 2px; border-radius: 1px; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; }
.hbar .lab { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar .bar { height: 30px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
/* A benchmark score with its 95% interval: the band is the interval, the tick the score. */
.bench-table td { vertical-align: top; }
.bench-table .num { white-space: nowrap; }
@media (max-width: 600px) { .bench-table .bar-cell { display: none; } }
.bench-bar { position: relative; height: 10px; min-width: 96px; margin-top: 6px; background: var(--grid); border-radius: 5px; }
.bench-bar .ci { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--series-1) 32%, transparent); border-radius: 5px; }
.bench-bar .mark { position: absolute; top: -3px; width: 2px; height: 16px; margin-left: -1px; background: var(--series-1); border-radius: 1px; }
.hbar .bar.de { background: var(--de-emphasis); }
.hbar .val { color: var(--ink-2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbars.compact .hbar { grid-template-columns: 110px minmax(0, 1fr); }
.hbars.compact .bar { height: 14px; }
.filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.side-tabs { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.side-tabs button { background: none; border: 0; padding: 8px 0; cursor: pointer; font-size: 16px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.side-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--series-1); }
.side-tabs .select-inline { margin-left: auto; }

/* ---------- garden ---------- */
.garden-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.model-card {
  position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg); cursor: pointer; text-align: left; border-top: 0; border-left: 0;
}
.model-card:hover { background: var(--panel); }
.model-card .badge.black { position: absolute; top: 0; right: 0; }
.model-card .art { width: 64px; height: 50px; }
.model-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.model-card .by { color: var(--muted); font-size: 13.5px; margin-top: -6px; }
.model-card p { margin: 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.model-card .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.model-card .price { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.auto-card { display: flex; gap: 22px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 22px; }
.auto-card .art { width: 110px; height: 86px; flex: none; }
.auto-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.auto-card p { margin: 0; color: var(--ink-2); }
.auto-card .actions { margin-left: auto; display: flex; gap: 8px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-row .search { width: 260px; margin-left: auto; }
.status-live { color: var(--good-ink); display: inline-flex; align-items: center; gap: 6px; }
.status-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.status-off { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status-off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }

/* ---------- training ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 26px; }
.stage { padding: 16px 16px 18px; border-right: 1px solid var(--line); }
.stage:last-child { border-right: 0; }
.stage .n { color: var(--muted); font-size: 12px; }
.stage strong { display: block; font-weight: 600; margin: 2px 0 6px; }
.stage p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
.usecase-card { margin-bottom: 18px; }
.usecase-card .uc-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.usecase-card .uc-head h2 { margin: 0; font-size: 17px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.uc-runs { border-top: 1px solid var(--line); }
.uc-runs h3 { margin: 0; padding: 14px 20px 4px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.uc-runs > p { margin: 0; padding: 4px 20px 16px; font-size: 13.5px; }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.docs nav { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.docs nav a:hover { background: var(--hover); color: var(--ink); }
.docs article { max-width: 780px; }
.docs article h2 { font-size: 22px; margin: 36px 0 10px; font-weight: 600; scroll-margin-top: 20px; }
.docs article h2:first-child { margin-top: 0; }
.docs article p, .docs article li { color: var(--ink-2); line-height: 1.7; }
.docs article strong { color: var(--ink); font-weight: 600; }
.docs article .codeblock { margin: 12px 0 18px; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; background: var(--sidebar); }
.signin [hidden] { display: none !important; }
.signin .card { width: min(520px, 100%); min-width: 0; padding: 34px 32px; background: var(--bg); }
.signin .logo { display: block; width: 34px; height: 34px; }
.signin .logo svg { display: block; width: 100%; height: 100%; }
.signin h1 { font-size: 26px; margin: 18px 0 8px; font-weight: 600; }
.signin p { color: var(--ink-2); }

.home-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .charts-layout { grid-template-columns: minmax(0, 1fr); }
  .charts-side { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line-strong); padding-top: 26px; }
  .charts-main { padding-right: 0; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage:nth-child(3) { border-right: 0; }
  .stage:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 980px) {
  .pg { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pg-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .learn h2.title { font-size: 40px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100vh; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 65; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.menu-open .sidebar { transform: none; }
  .shell.collapsed { --sidebar-w: 0; }
  .brand .collapse { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .mobile-bar .logo { width: 22px; height: 22px; }
  .main { overflow: visible; }
  .page { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 24px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .lessons { grid-template-columns: minmax(0, 1fr); }
  .lesson { border-right: 0; border-bottom: 1px solid var(--line); }
  .learn h2.title { font-size: 34px; margin: 8px 16px 22px; }
  .learn .caps, .usecase, .response { padding-left: 16px; padding-right: 16px; }
  .usecase { flex-wrap: wrap; }
  .usecase span { white-space: normal; }
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .auto-card { flex-direction: column; align-items: flex-start; }
  .auto-card .actions { margin-left: 0; }
  .filter-row .search { width: 100%; margin-left: 0; }
  .hbar { grid-template-columns: 90px minmax(0, 1fr); }
  .pg-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
