/* Design tokens (shadcn/Tailwind-like, light) */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --fg: #090b0c;
  --muted: #f1f3f3;          /* subtle bg: nav pill, hover */
  --muted-fg: #67787c;       /* secondary text */
  --border: #e3e7e8;
  --primary: #1447e6;
  --primary-fg: #eff6ff;
  --primary-hover: #1039c4;
  --danger: #e7000b;
  --green: #009966; --green-bg: rgba(0,188,128,.15); --green-dot: #00bc80;
  --amber: #b45309; --amber-bg: rgba(217,119,6,.15); --amber-dot: #d97706;
  --gray: #67787c;  --gray-bg: rgba(103,120,124,.13);
  --red-bg: rgba(231,0,11,.12);
  --radius: 4px;
  --ring: 0 0 0 1px rgba(9,11,12,.1);
  --shadow: 0 10px 15px -3px rgba(0,0,0,.05), 0 4px 6px -4px rgba(0,0,0,.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
code, pre, .mono { font-family: var(--mono); }

/* Top navigation – full-bleed, blurred, content aligned to the page container */
.topnav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.7);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 40px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; }
.brand .logo {
  width: 24px; height: 24px; border-radius: var(--radius); background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  font-family: var(--mono);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.navlink {
  color: var(--muted-fg); font-size: 12px; padding: 4px 10px;
  transition: background .12s, color .12s;
}
.navlink:hover { color: var(--fg); background: var(--muted); text-decoration: none; }
.navlink.active { color: var(--fg); background: var(--muted); }
.topnav .spacer { flex: 1; }

/* User menu (avatar + email + chevron dropdown) */
.usermenu { position: relative; }
.usermenu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 4px; border-radius: var(--radius); font-size: 12px; color: var(--fg);
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--muted); color: var(--muted-fg);
  font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--border);
  text-transform: uppercase;
}
.usermenu .email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu .chev { width: 12px; height: 12px; color: var(--muted-fg); flex-shrink: 0; }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--ring), var(--shadow); padding: 4px; z-index: 40;
}
.usermenu .menu form { margin: 0; }
.usermenu .menu button, .usermenu .menu a {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 7px 10px; font-size: 13px; color: var(--fg); cursor: pointer; border-radius: 3px;
  font-family: inherit;
}
.usermenu .menu button:hover, .usermenu .menu a:hover { background: var(--muted); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius); font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  cursor: pointer; transition: .12s; text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--muted); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--muted); }
.btn.sm { padding: 4px 9px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* Centered content container (no sidebar) */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
/* Uniform vertical rhythm between top-level blocks (24px, like the reference
   `space-y-6`). Pages that wrap content in a single .stack are unaffected. */
.container > * + * { margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > * { margin: 0; }

/* Page title */
.page-title, .page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-head { display: flex; align-items: center; gap: 16px; }
.page-head .spacer { flex: 1; }
.subtle { color: var(--muted-fg); }

/* Sub navigation (admin tabs) */
.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.subnav a {
  padding: 8px 12px; color: var(--muted-fg); font-weight: 500; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--fg); text-decoration: none; }
.subnav a.active { color: var(--fg); border-bottom-color: var(--primary); font-weight: 600; }

/* Section: small bold heading + card */
.section { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 14px; font-weight: 700; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--ring), var(--shadow); overflow: hidden; padding: 16px;
}
.card.flush { padding: 0; }        /* header + table fill the card edge-to-edge */
.card h2 { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.card-body { padding: 16px; }
.card-body > :first-child { margin-top: 0; }
.card-body h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg); font-weight: 600; margin: 20px 0 8px; }
.card-body p { margin: 0 0 8px; }

/* API reference method badges */
.api-method { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; letter-spacing: .03em; }
.api-method.get  { background: var(--green-bg); color: var(--green); }
.api-method.post { background: rgba(20,71,230,.12); color: var(--primary); }
.api-path { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.req-badge { font-size: 11px; font-weight: 600; color: var(--danger); }
.opt-badge { font-size: 11px; color: var(--muted-fg); }
table.data td code, table.data td .mono { font-family: var(--mono); font-size: 12px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head .subtle { flex: 1; font-size: 12px; }
.card-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px;
}
.card-foot .spacer { flex: 1; }
.head-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.head-form input { width: 160px; padding: 5px 10px; font-size: 12px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--ring), var(--shadow); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat .label { color: var(--muted-fg); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.stat .sub { color: var(--muted-fg); font-size: 12px; }
.stat .sub a { font-size: 12px; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: 1fr; } }

/* Tables – header underline only, no row dividers */
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th {
  text-align: left; color: var(--fg); font-weight: 500; font-size: 12px;
  height: 40px; padding: 0 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 8px; vertical-align: middle; color: var(--fg); }
table.data tbody tr:hover td { background: #fafbfb; }
table.data th:first-child, table.data td:first-child { padding-left: 16px; }
table.data th:last-child, table.data td:last-child { padding-right: 16px; }
.table-wrap { overflow-x: auto; }

/* Status pills – squared, square dot */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  font-size: 12px; font-weight: 500;
}
.pill::before { content: ""; width: 6px; height: 6px; background: currentColor; flex-shrink: 0; }
.status-queued    { background: var(--gray-bg);  color: var(--gray); }
.status-running   { background: var(--amber-bg); color: var(--amber); }
.status-succeeded { background: var(--green-bg); color: var(--green); }
.status-failed    { background: var(--red-bg);   color: var(--danger); }
.status-cancelled { background: var(--gray-bg);  color: var(--gray); }
.status-succeeded::before { color: var(--green-dot); }
.status-running::before   { color: var(--amber-dot); }
.online  { background: var(--green-bg); color: var(--green); }
.offline { background: var(--gray-bg);  color: var(--gray); }

/* Outline badge (e.g. key "Active") */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 12px; font-weight: 500; color: var(--fg);
}

/* Modal dialog */
dialog.modal {
  border: none; padding: 0; border-radius: 8px; color: var(--fg); background: var(--card);
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 0 0 1px rgba(9,11,12,.1), 0 20px 40px -8px rgba(0,0,0,.25);
}
dialog.modal::backdrop { background: rgba(9,11,12,.4); }
.modal-head { padding: 15px 18px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-foot { padding: 14px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }

/* Forms */
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.limit-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.limit-form input { width: 92px; }
.field label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; background: #fff; color: var(--fg);
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,71,230,.12); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; }

/* Auth pages */
.auth-wrap { max-width: 400px; margin: 60px auto; padding: 0 20px; }
.auth-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--ring), var(--shadow); padding: 32px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert.error   { background: var(--red-bg);   color: var(--danger); box-shadow: inset 0 0 0 1px rgba(231,0,11,.25); }
.alert.success { background: var(--green-bg); color: var(--green);  box-shadow: inset 0 0 0 1px rgba(0,188,128,.3); }
.alert.info    { background: rgba(20,71,230,.08); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(20,71,230,.2); }

/* Copy button – copy icon transitions to a check on success, then back */
.copy-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--muted-fg); cursor: pointer;
  transition: background .12s, color .12s, border-color .18s;
}
.copy-btn:hover { background: var(--muted); color: var(--fg); }
.copy-btn svg { grid-area: 1 / 1; width: 15px; height: 15px; transition: opacity .18s ease, transform .22s cubic-bezier(.2,.9,.3,1.3); }
.copy-btn .ic-copy  { opacity: 1; transform: scale(1); }
.copy-btn .ic-check { opacity: 0; transform: scale(.5); color: var(--green); }
.copy-btn.copied { border-color: rgba(0,188,128,.5); color: var(--green); }
.copy-btn.copied .ic-copy  { opacity: 0; transform: scale(.5); }
.copy-btn.copied .ic-check { opacity: 1; transform: scale(1); }

/* Copy button overlaid on a dark code block */
.code-block { position: relative; }
.code-block .copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); color: #cbd5e1;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.code-block .copy-btn.copied { border-color: rgba(0,188,128,.6); color: var(--green-dot); }
.code-block pre.code { margin: 0; }

/* Code blocks */
pre.code { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-size: 13px; line-height: 1.6; }
pre.logs { background: #0f172a; color: #cbd5e1; padding: 16px; border-radius: var(--radius); overflow: auto; max-height: 480px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; font-family: var(--mono); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 13px; }
.kv .k { color: var(--muted-fg); }
.kv .v { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox code { flex: 1; background: var(--muted); padding: 9px 12px; border-radius: var(--radius); font-size: 12px; overflow-x: auto; }
.muted-empty { text-align: center; color: var(--muted-fg); padding: 32px; font-size: 13px; }
.pager { display: flex; gap: 10px; margin-top: 16px; align-items: center; }

/* Landing */
.hero { max-width: 900px; margin: 0 auto; padding: 72px 24px 48px; text-align: center; }
.hero h1 { font-size: 46px; letter-spacing: -.02em; margin: 0 0 16px; }
.hero p.lede { font-size: 19px; color: var(--muted-fg); max-width: 620px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { max-width: 980px; margin: 0 auto; padding: 20px 24px 60px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 18px; }
.feature { background: var(--card); border-radius: var(--radius); box-shadow: var(--ring), var(--shadow); padding: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted-fg); font-size: 13px; }
.endpoints { max-width: 720px; margin: 0 auto 60px; padding: 0 24px; }
.ep { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--ring); background: var(--card); margin-bottom: 8px; font-family: var(--mono); font-size: 12px; }
.ep .verb { font-weight: 700; width: 52px; }
.ep .verb.get { color: var(--green); }
.ep .verb.post { color: var(--primary); }
.ep .desc { margin-left: auto; color: var(--muted-fg); font-family: var(--sans); font-size: 13px; }

/* ===================== llm-api additions ===================== */
:root { --violet: #6d28d9; --violet-bg: rgba(109,40,217,.12); }
.brand { gap: 8px; }
.brand-name { font-weight: 700; font-size: 13px; color: var(--fg); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.container.wide { max-width: 1400px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stat-grid.four { grid-template-columns: repeat(2, 1fr); } }
.stat .value .of { color: var(--muted-fg); font-size: 15px; font-weight: 500; }
.ok-text { color: var(--green); }
.err-row td { padding-top: 0 !important; font-size: 11px; color: var(--danger) !important; }
.legend { font-size: 12px; margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sel-sm { font-size: 12px; padding: 4px 6px; width: auto; }
.empty-hero { text-align: center; padding: 40px; }
.empty-hero h2 { font-size: 16px; }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c7cdcf; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.dot.ok { background: var(--green-dot); box-shadow: 0 0 0 3px var(--green-bg); }
.dot.warn { background: var(--amber-dot); box-shadow: 0 0 0 3px var(--amber-bg); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green-dot); margin-left: 6px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

/* Pills for model state */
.status-loaded { background: var(--violet-bg); color: var(--violet); }
.status-loaded::before { animation: pulse 1.6s ease-in-out infinite; }

/* Bars */
.bar { display: inline-block; position: relative; height: 6px; background: var(--muted); border-radius: 3px; overflow: hidden; width: 100%; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 3px; transition: width .6s ease; }
.bar.gpu i { background: var(--green-dot); }
.bar.req i { background: var(--violet); }
.dl { display: inline-flex; align-items: center; gap: 6px; min-width: 110px; font-size: 11px; }
.dl .bar { width: 70px; }
.dl .bar i { background: linear-gradient(90deg, var(--primary), #4f7bff); animation: shimmer 1.2s linear infinite; background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* Accelerator tags */
.accel { font-size: 11px; font-weight: 700; padding: 2px 7px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono); }
.accel-cuda { background: rgba(118,185,0,.15); color: #4d7c0f; }
.accel-metal { background: rgba(15,23,42,.08); color: #334155; }
.accel-cpu { background: var(--gray-bg); color: var(--gray); }
.accel-vulkan { background: rgba(185,28,28,.1); color: #b91c1c; }

/* Node cards */
.node-card { overflow: visible; }
.node-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.node-title { display: flex; align-items: center; gap: 8px; }
.node-title .mono { font-size: 11px; }
.node-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.node-head .spacer { flex: 1; }
.node-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 16px; }
@media (max-width: 860px) { .node-body { grid-template-columns: 1fr; } }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; margin-bottom: 5px; gap: 8px; }
.meter-label span:last-child { font-family: var(--mono); color: var(--muted-fg); font-weight: 400; font-size: 11px; white-space: nowrap; }
.meter-sub { font-size: 11px; color: var(--muted-fg); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-models { display: flex; flex-direction: column; gap: 6px; }
.nm { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; padding: 5px 8px; background: #fafbfb; box-shadow: inset 0 0 0 1px var(--border); }

/* Deployment matrix */
table.matrix th.node-col { min-width: 140px; vertical-align: bottom; padding-top: 8px; padding-bottom: 8px; height: auto; }
table.matrix td { border-top: 1px solid var(--border); }
table.matrix .model-cell { min-width: 240px; max-width: 320px; }
.model-name { font-weight: 600; font-size: 13px; }
.model-src { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.model-meta { font-size: 11px; }
table.matrix td.cell { white-space: nowrap; }
.cell-state { display: inline-flex; align-items: center; gap: 4px; }
.x-form { display: inline; margin: 0; }
.x { border: none; background: none; color: var(--muted-fg); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 3px; opacity: 0; transition: opacity .12s; }
tr:hover .x { opacity: 1; }
.x:hover { background: var(--red-bg); color: var(--danger); }
.btn.deploy { color: var(--muted-fg); }
.btn.deploy:hover { color: var(--fg); }
.fit { font-size: 10px; font-weight: 700; padding: 1px 5px; text-transform: uppercase; font-family: var(--mono); }
.fit-gpu { background: var(--green-bg); color: var(--green); }
.fit-cpu { background: var(--amber-bg); color: var(--amber); }
td.actions { white-space: nowrap; text-align: right; }
td.actions > form, td.actions > details { display: inline-block; vertical-align: middle; }
.menu-details { position: relative; }
.menu-details > summary { list-style: none; }
.menu-details > summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; text-align: left; background: var(--card); padding: 14px; border-radius: var(--radius); box-shadow: var(--ring), var(--shadow); white-space: normal; }

/* Recommended grid */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rec { background: var(--card); box-shadow: var(--ring), var(--shadow); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.rec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rec-id { font-weight: 700; font-size: 13px; }
.target { font-size: 10px; font-weight: 700; text-transform: uppercase; font-family: var(--mono); color: var(--primary); background: rgba(20,71,230,.08); padding: 2px 6px; white-space: nowrap; }
.rec-note { font-size: 13px; flex: 1; }
.rec-meta { font-size: 11px; }
.rec-in { font-size: 12px; }
.rec form .btn { width: 100%; }
.discovered { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Live panel */
.live-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } }
.ln { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; }
.ln:last-child { border-bottom: none; }
.ln.off { opacity: .45; }
.ln-name { font-weight: 600; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ln-m { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; color: var(--muted-fg); font-size: 11px; }
.ln-m .bar { grid-column: 1 / -1; grid-row: 2; }
.ln-m .mono { text-align: right; color: var(--fg); }
.inf { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; }
.inf .spacer { flex: 1; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--violet-bg); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; flex-direction: column; gap: 0; }
.tab-bar { display: flex; gap: 2px; }
.tab { border: none; background: var(--muted); color: var(--muted-fg); padding: 7px 12px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; border-radius: var(--radius) var(--radius) 0 0; }
.tab.active { background: #0f172a; color: #e2e8f0; }
.tabs pre.code { border-top-left-radius: 0; margin: 0; }

/* Playground */
.pg { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 40px); }
@media (max-width: 800px) { .pg { grid-template-columns: 1fr; height: auto; } }
.pg-side { border-right: 1px solid var(--border); padding: 20px; overflow-y: auto; background: #fafbfb; }
.pg-side textarea, .pg-input textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 13px; resize: vertical; background: #fff; }
.pg-side input[type=range] { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 14px; cursor: pointer; }
.pg-main { display: flex; flex-direction: column; min-height: 0; }
.pg-cols { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; }
.pg-cols.two { grid-template-columns: 1fr 1fr; }
.pg-cols.two .pg-col + .pg-col { border-left: 1px solid var(--border); }
.pg-col { display: flex; flex-direction: column; min-height: 0; }
.pg-col-head { display: flex; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.pg-col-head .stats { font-weight: 400; font-family: var(--mono); font-size: 11px; }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.pg-empty { margin: auto; text-align: center; font-size: 13px; max-width: 320px; }
.msg { max-width: 820px; font-size: 14px; line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-fg); padding: 9px 14px; border-radius: 14px 14px 3px 14px; max-width: 75%; }
.msg.assistant { align-self: stretch; }
.msg .answer code { background: var(--muted); padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.msg .answer pre.code { margin: 8px 0; }
.msg .meta { font-size: 11px; margin-top: 6px; font-family: var(--mono); }
.msg .err { color: var(--danger); }
.think { margin-bottom: 8px; font-size: 12.5px; color: var(--muted-fg); border-left: 2px solid var(--border); padding-left: 10px; }
.think summary { cursor: pointer; font-weight: 500; }
.think-body { white-space: pre-wrap; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--fg); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pg-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); align-items: flex-end; margin: 0; background: #fff; }
.pg-input textarea { resize: none; min-height: 40px; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,71,230,.12); }
.fitnode { display: inline-flex; gap: 4px; align-items: center; margin: 0 8px 2px 0; font-size: 12px; white-space: nowrap; }
.kind-tag { font-family: var(--sans); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--violet); background: var(--violet-bg); padding: 1px 6px; vertical-align: middle; }
/* An open settings menu must not be cut off by its scrolling table. */
.card:has(.menu-details[open]), .table-wrap:has(.menu-details[open]) { overflow: visible; }
.engine-card { display: flex; align-items: center; gap: 16px; }
.engine-card > div:first-child { flex: 1; }
.engine-title { font-weight: 600; margin-bottom: 2px; }
.popover.wide { width: 360px; }
.hint { font-size: 12px; color: var(--muted-fg); margin-top: 4px; line-height: 1.4; }
.keep-form { margin: 4px 0 0; }
.keep { font: inherit; font-size: 11px; border: 0; background: none; padding: 0; color: var(--muted-fg); cursor: pointer; text-decoration: underline dotted; }
.keep.on { color: var(--violet); font-weight: 600; text-decoration: none; }
