:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --subtle: #f8fafc;
  --hover: #f3f5f8;
  --border: #e6e8ec;
  --border-strong: #d4d8de;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --code-bg: #0b1020;
  --code-line: #1e263b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
h4 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small, small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.center { text-align: center; }
.spacer { flex: 1; }
.pre { white-space: pre-wrap; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.bad-text { color: var(--bad); display: inline-flex; align-items: center; gap: 6px; }
.icon { flex: none; }
kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .18); margin-left: 4px; }

/* ---------------------------------------------------------------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  font: inherit; font-weight: 550; font-size: 13.5px; color: var(--text); text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .04); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0 8px; }
.btn.dark { background: #1e293b; border-color: #334155; color: #e2e8f0; box-shadow: none; }
.btn.dark:hover { background: #273449; }
.btn.dark.ghost { background: transparent; border-color: transparent; color: #94a3b8; }
.btn.dark.ghost:hover { color: #e2e8f0; background: #1e293b; }
.link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; padding: 7px 10px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.field { display: block; margin: 14px 0 0; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field > small { display: block; color: var(--muted); margin-top: 6px; }
.field.compact { margin-top: 10px; }
.field.compact > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #eef0f3; border-radius: 8px; padding: 2px; gap: 2px; }
.segmented button { border: none; background: transparent; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.segmented button:disabled { opacity: .45; cursor: default; }
.segmented button.active:disabled { opacity: 1; }
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1; padding: 5px 10px; }
.task-hint { display: block; margin: 6px 0 8px; }
.callout.compact { margin-top: 8px; padding: 8px 10px; font-size: 12.5px; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 2px 8px 12px; color: var(--text); text-decoration: none; }
.brand.big { font-size: 20px; padding: 0 0 6px; }
.mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #6366f1, #0ea5e9); }
.switcher { position: relative; margin-bottom: 10px; }
.switcher-button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--subtle);
  border: 1px solid var(--border); border-radius: 10px; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.switcher-button:hover { border-color: var(--border-strong); }
.switcher-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent); background: var(--accent-soft); flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: none; background: none; font: inherit; color: var(--text); border-radius: 7px; cursor: pointer; text-align: left; }
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item .icon { margin-left: auto; color: var(--accent); }
.menu-foot { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.menu-foot .menu-item { color: var(--muted); text-decoration: none; }
.menu-foot .menu-item:hover { color: var(--text); }
.menu-foot .menu-item .icon { margin-left: 0; color: inherit; }
.nav.top { margin-bottom: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--faint); }
.nav a.active .count { color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 10px; }
.sidebar-foot a, .sidebar-foot button {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted);
  text-decoration: none; font: inherit; font-size: 13px; background: none; border: none; cursor: pointer; text-align: left;
}
.sidebar-foot a:hover, .sidebar-foot button:hover { background: var(--hover); color: var(--text); }
.sidebar-foot a.active { background: var(--accent-soft); color: var(--accent); }
.content { min-width: 0; padding: 28px 36px 72px; }
.content.flush { padding: 0; }
.page { max-width: 1280px; margin: 0 auto; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #e0e7ff, var(--bg)); }
.login { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); }
.login h2 { margin-bottom: 6px; }
.login .btn { margin-top: 18px; height: 38px; }
.login p.muted { margin: 4px 0 6px; }

/* ---------------------------------------------------------------- page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.titles { min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { margin: 0 7px; color: var(--faint); }
.subtitle { color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; background: var(--bad-soft); border-radius: 9px; padding: 4px 4px 4px 12px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 4px; }
.endpoint {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 6px 6px 6px 8px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.endpoint .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.endpoint-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.endpoint-bar .endpoint { margin-top: 0; min-width: 0; flex: 0 1 auto; }
.endpoint-ids { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.endpoint-ids > div { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.endpoint-ids dt { color: var(--muted); }
.endpoint-ids dd { margin: 0; display: flex; align-items: center; gap: 2px; }
.endpoint-ids .mono { font-size: 12px; }
.endpoint-actions { display: flex; gap: 6px; margin-left: auto; }
.method { font: 600 11px var(--mono); color: var(--ok); background: var(--ok-soft); padding: 3px 7px; border-radius: 6px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 3px 10px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.live-badge.ok { background: var(--ok-soft); color: var(--ok); }
.live-badge.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- lists */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-head, .list-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 16px; padding: 0 18px; }
.list-head { height: 38px; font-size: 12px; color: var(--muted); font-weight: 550; border-bottom: 1px solid var(--border); background: var(--subtle); }
.list-row { min-height: 62px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; cursor: pointer; transition: background .1s; }
.list-row.tall { min-height: 68px; }
button.list-row { width: 100%; border: none; border-bottom: 1px solid var(--border); background: none; font: inherit; text-align: left; }
.list-row:last-child, .list-group:last-child .list-row { border-bottom: none; }
.list-row:hover { background: var(--subtle); }
.list-row.selected { background: var(--accent-soft); }
.list.compact .list-row { min-height: 48px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-title > div { min-width: 0; }
.cell-title b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.cell-metric { display: flex; align-items: center; gap: 8px; }
.metric { font-weight: 650; font-variant-numeric: tabular-nums; }
.cell-metric small { color: var(--muted); }
.cell-spark { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.row-arrow { color: var(--faint); display: grid; place-items: center; transition: transform .15s; }
.row-arrow.open { transform: rotate(90deg); }
.list-row:hover .row-arrow { color: var(--muted); }
.list-detail { padding: 6px 18px 18px 64px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.detail-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 10px; }
.mini-table > div { display: grid; grid-template-columns: 60px 140px 100px 1fr; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 550;
  background: var(--hover); color: var(--text); text-decoration: none; border: 1px solid var(--border); white-space: nowrap;
}
a.chip:hover { border-color: var(--border-strong); }
.chip small { color: var(--muted); font-weight: 500; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: #c7d2fe; }
.version-tag { display: inline-block; font: 600 11.5px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--hover); color: var(--muted); border: 1px solid var(--border); }
.list-row.selected .version-tag { background: white; color: var(--accent); border-color: #c7d2fe; }
.model-link { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-weight: 550; }
.model-link:hover { color: var(--accent); }
.model-link i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.model-link .version-tag { margin-left: 2px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); position: relative; }
.dot.ok { background: #10b981; }
.dot.warn { background: #f59e0b; }
.dot.bad { background: var(--bad); }
.dot.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #10b981; opacity: 0; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- cards & stats */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
.span-2 { grid-column: 1 / -1; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stats .stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stats .stat-value { font-size: 18px; }
.stat-value.bad { color: var(--bad); }
.stat-hint { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.feature-grid > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.feature-grid small { color: var(--muted); }
.code-block { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--subtle); border: 1px solid var(--border); font: 12.5px/1.6 var(--mono); overflow: auto; max-height: 520px; white-space: pre; }
.code-block.dark { background: var(--code-bg); color: #e2e8f0; border-color: var(--code-line); }
.snippet .code-block { white-space: pre-wrap; word-break: break-all; max-height: 300px; }
.card-head .head-tools { display: flex; align-items: center; gap: 6px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.skeleton { background: linear-gradient(90deg, #eef0f3, #f6f7f9, #eef0f3); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
.skeleton.tall { height: 320px; }
.skeleton.line { display: inline-block; width: 110px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin: 6px 0 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: none; background: none;
  font: inherit; font-weight: 550; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- empty, callouts, spinner */
.empty { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 16px; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-title { font-size: 17px; font-weight: 650; }
.empty-text { color: var(--muted); max-width: 520px; margin: 8px auto 0; }
.empty-action { margin-top: 18px; }
ol.how { text-align: left; display: inline-block; margin: 14px 0 0; padding-left: 20px; }
ol.how li { margin: 6px 0; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin-top: 14px; font-size: 13px; background: var(--hover); color: var(--text); }
.callout .icon { margin-top: 2px; }
.callout ul { margin: 6px 0; padding-left: 18px; }
.callout .btn { margin-left: 8px; }
.callout.ok { background: var(--ok-soft); color: #065f46; }
.callout.bad { background: var(--bad-soft); color: #991b1b; }
.callout.warn { background: var(--warn-soft); color: #92400e; }
.callout.muted { color: var(--muted); align-items: center; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; opacity: .8; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- modal & toasts */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .4); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 24px; animation: fade .12s ease-out; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: rise .16s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-title { font-size: 17px; font-weight: 650; }
.modal-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 10px 22px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 10px; background: #0f172a; color: white; font-size: 13px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; max-width: 420px; }
.toast.ok .icon { color: #34d399; }
.toast.bad .icon { color: #f87171; }

/* ---------------------------------------------------------------- deploy dialog */
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer;
}
.choice .icon { color: var(--muted); margin-bottom: 4px; }
.choice span { font-size: 12.5px; color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .14); background: #fbfbff; }
.choice.selected .icon { color: var(--accent); }
.choice:disabled { opacity: .5; cursor: default; }
.radio-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.radio-row.selected { border-color: var(--accent); background: #fbfbff; }
.radio-row b { display: block; font-weight: 600; }
.radio-row small { color: var(--muted); }
ol.steps { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 12px; }
ol.steps li { display: flex; align-items: center; gap: 12px; color: var(--faint); }
ol.steps li.done { color: var(--text); }
ol.steps li.active { color: var(--text); font-weight: 600; }
ol.steps li.failed { color: var(--bad); font-weight: 600; }
.step-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border-strong); background: var(--surface); }
li.done .step-mark { background: var(--ok); border-color: var(--ok); color: white; }
li.active .step-mark { border-color: var(--accent); color: var(--accent); }
li.failed .step-mark { background: var(--bad); border-color: var(--bad); color: white; }
.success-mark { width: 52px; height: 52px; border-radius: 50%; margin: 8px auto 10px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }

/* ---------------------------------------------------------------- charts */
.chart { font-size: 11.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { width: 14px; height: 0; border-top: 2px dashed #0f172a; border-radius: 0; }
.chart-plot { display: flex; gap: 8px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; min-width: 34px; font-variant-numeric: tabular-nums; }
.chart-area { flex: 1; min-width: 0; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), #f1f3f6 calc(25% - 1px) 25%); }
.chart-area svg { display: block; width: 100%; }
.chart-x { display: flex; justify-content: space-between; margin: 6px 0 0 42px; }
.bucket .hit { fill: transparent; }
.bucket:hover .hit { fill: rgba(79, 70, 229, .07); }
.chart-empty { display: grid; place-items: center; text-align: center; min-height: 150px; color: var(--muted); font-size: 13px; background: var(--subtle); border-radius: 10px; padding: 16px; gap: 8px; }
svg.sparkbars rect.on { fill: #818cf8; }
svg.sparkbars rect.off { fill: #e2e8f0; }
.list-row:hover svg.sparkbars rect.on { fill: var(--accent); }
svg.trend path { fill: none; stroke: #a5b4fc; stroke-width: 1.5; }
svg.trend circle { fill: var(--accent); }
.psi { display: flex; align-items: center; gap: 10px; }
.psi .bar, .prob .bar { flex: 1; position: relative; height: 8px; border-radius: 99px; background: #eef0f3; overflow: visible; }
.psi .bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: #34d399; }
.psi .bar span.warn { background: #fbbf24; }
.psi .bar span.alert { background: #f87171; }
.psi .bar span.insufficient_data { background: var(--faint); }
.psi .bar i, .prob .bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #94a3b8; border-radius: 1px; }
.psi .mono { width: 46px; text-align: right; }
.psi-table { display: flex; flex-direction: column; }
.psi-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr) 110px; align-items: center; gap: 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.psi-row.strong { font-weight: 600; }
.drift-model + .drift-model { margin-top: 22px; }

/* ---------------------------------------------------------------- deployment detail */
.status-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.status-badge.ok { background: var(--ok-soft); color: var(--ok); }
.status-badge.warn { background: var(--warn-soft); color: var(--warn); }
.status-badge.alert, .status-badge.failed { background: var(--bad-soft); color: var(--bad); }
.status-text b { display: block; font-size: 15px; }
.settings { margin-top: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; }
.history { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.history button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: none; background: none; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.history button:hover { background: var(--hover); }
.history button.active { background: var(--accent-soft); }
.history small { margin-left: auto; }
.key-list { display: flex; flex-direction: column; }
.key-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.key-row:first-child { border-top: none; }
.key-row > .icon { color: var(--muted); }
.key-row b { display: block; font-weight: 600; }
.key-row small { color: var(--muted); }
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--code-bg); color: #e2e8f0; margin-top: 6px; }
.secret .mono { flex: 1; overflow-wrap: anywhere; }
.secret .btn { background: #1e293b; color: #cbd5e1; }
.request-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.request-line .mono { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.request-line input { flex: 1; padding: 5px 9px; }
.code-input { min-height: 320px; background: var(--subtle); line-height: 1.55; }
.response-line { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pred-table { display: flex; flex-direction: column; font-size: 13px; }
.pred-head, .pred-row { display: grid; grid-template-columns: 40px 110px minmax(160px, 1fr); align-items: center; gap: 12px; padding: 8px 0; }
.pred-table.passthrough .pred-head, .pred-table.passthrough .pred-row { grid-template-columns: 40px 110px minmax(160px, 1fr) minmax(80px, .8fr); }
.pred-head { font-size: 12px; color: var(--muted); font-weight: 550; border-bottom: 1px solid var(--border); }
.pred-row { border-bottom: 1px solid var(--border); }
.prob { display: flex; align-items: center; gap: 10px; }
.prob .bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: #cbd5e1; }
.prob .bar span.hit { background: #818cf8; }
.prob .mono { width: 52px; text-align: right; }
.prob .mono.value { width: auto; min-width: 80px; }
.pred-table.values .pred-head, .pred-table.values .pred-row { grid-template-columns: 40px minmax(200px, 1fr); }
.pred-table.values.passthrough .pred-head, .pred-table.values.passthrough .pred-row { grid-template-columns: 40px minmax(200px, 1fr) minmax(80px, .8fr); }
.job-list, .timeline { display: flex; flex-direction: column; }
.job-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.job-row:first-child { border-top: none; }
.job-row b { display: block; font-weight: 600; }
ol.timeline { list-style: none; margin: 0; padding: 0; }
ol.timeline li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
ol.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
li.failed .timeline-icon { background: var(--bad-soft); color: var(--bad); }
.timeline-body { padding-top: 4px; min-width: 0; }
.timeline-body small { display: block; margin-top: 2px; }
.dropzone {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 22px; border: 1.5px dashed var(--border-strong); border-radius: 12px;
  background: var(--subtle); color: var(--muted); cursor: pointer; font: inherit; text-align: left; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone.has-file { border-style: solid; color: var(--text); }
.dropzone b { display: block; color: var(--text); }
.dropzone small { display: block; }
.dropzone.small { padding: 14px; }

/* ---------------------------------------------------------------- code editor (CodeMirror theme) */
.code-editor .CodeMirror { height: var(--editor-height, 480px); border-radius: 0 0 12px 12px; }
.code-editor.fill { position: absolute; inset: 0; }
.code-editor.fill .CodeMirror { height: 100%; border-radius: 0; }
.cm-s-prophaic.CodeMirror { background: var(--code-bg); color: #e2e8f0; font: 13px/1.65 var(--mono); }
.cm-s-prophaic .CodeMirror-gutters { background: var(--code-bg); border-right: 1px solid var(--code-line); }
.cm-s-prophaic .CodeMirror-linenumber { color: #475569; padding: 0 10px 0 6px; }
.cm-s-prophaic .CodeMirror-cursor { border-left: 2px solid #a5b4fc; }
.cm-s-prophaic div.CodeMirror-selected { background: rgba(99, 102, 241, .28); }
.cm-s-prophaic.CodeMirror-focused div.CodeMirror-selected { background: rgba(99, 102, 241, .38); }
.cm-s-prophaic .CodeMirror-line::selection, .cm-s-prophaic .CodeMirror-line > span::selection, .cm-s-prophaic .CodeMirror-line > span > span::selection { background: rgba(99, 102, 241, .38); }
.cm-s-prophaic span.cm-keyword { color: #c4b5fd; }
.cm-s-prophaic span.cm-def { color: #7dd3fc; }
.cm-s-prophaic span.cm-variable, .cm-s-prophaic span.cm-variable-2 { color: #e2e8f0; }
.cm-s-prophaic span.cm-builtin { color: #5eead4; }
.cm-s-prophaic span.cm-string { color: #86efac; }
.cm-s-prophaic span.cm-number, .cm-s-prophaic span.cm-atom { color: #fda4af; }
.cm-s-prophaic span.cm-comment { color: #64748b; font-style: italic; }
.cm-s-prophaic span.cm-operator, .cm-s-prophaic span.cm-punctuation { color: #94a3b8; }
.cm-s-prophaic span.cm-property { color: #93c5fd; }
.cm-s-prophaic span.cm-meta { color: #fbbf24; }
.cm-s-prophaic .CodeMirror-matchingbracket { color: white !important; text-decoration: underline; }
.code-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--code-line); background: var(--code-bg); box-shadow: var(--shadow); }
.code-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #0f1629; border-bottom: 1px solid var(--code-line); color: #94a3b8; min-height: 44px; flex-wrap: wrap; }
.file-tab { display: inline-flex; align-items: center; gap: 7px; font: 12.5px var(--mono); color: #e2e8f0; padding: 4px 10px; background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 7px; }
.code-empty { padding: 24px; color: #94a3b8; }
.code-empty .code-block { margin-top: 12px; }
.draft-note { font-size: 12px; color: #fbbf24; }
.draft-note .link { color: #fde68a; }

/* ---------------------------------------------------------------- workbench */
.workbench { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
.workbench.loading { display: grid; place-items: center; }
.wb-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.wb-title .crumbs { margin-bottom: 2px; font-size: 12px; }
.wb-title h1 { font-size: 18px; }
.light { font-weight: 450; font-size: 15px; }
.title-input { font-size: 18px; font-weight: 650; border: 1px solid transparent; padding: 2px 8px; margin-left: -8px; width: 320px; background: transparent; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { background: var(--surface); }
.wb-side { overflow: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 4px 16px 24px; }
.wb-side section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.wb-side section > small { display: block; margin-top: 6px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.side-head .link { font-size: 12.5px; }
.column-list { display: flex; flex-direction: column; gap: 1px; max-height: 300px; overflow: auto; margin: 0 -6px; }
.column-list label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.column-list label:hover { background: var(--hover); }
.column-list label small { margin-left: auto; color: var(--faint); }
.column-list label.off .mono { color: var(--faint); text-decoration: line-through; }
.side-details { padding: 12px 0; border-bottom: 1px solid var(--border); }
.side-details summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.side-details summary::after { content: "+"; color: var(--muted); font-weight: 500; }
.side-details[open] summary::after { content: "–"; }
.side-details textarea { margin-top: 10px; }
.explain { font-size: 12.5px; color: var(--muted); }
.explain p { margin: 8px 0; }
.explain ol { margin: 6px 0; padding-left: 18px; }
.explain .mono { color: var(--text); font-size: 12px; }
.wb-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--code-bg); }
.wb-editor { flex: 1; min-height: 0; position: relative; }
.console { border-top: 1px solid var(--code-line); background: #0f1629; color: #cbd5e1; flex: none; }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 44px; font-size: 13px; cursor: pointer; flex-wrap: wrap; }
.console-bar .muted { color: #8492a6; }
.console .ok-text { color: #34d399; }
.console .bad-text { color: #f87171; }
.console-toggle { color: #64748b; display: grid; transition: transform .15s; transform: rotate(180deg); }
.console-toggle.open { transform: none; }
.step-chips { display: inline-flex; gap: 6px; }
.step-chips span { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: #1e293b; color: #64748b; }
.step-chips span.done { color: #34d399; }
.step-chips span.active { color: #c7d2fe; background: #312e81; }
.console-body { max-height: 38vh; overflow: auto; padding: 0 14px 14px; }
.metric-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.metric-chips span { display: inline-flex; flex-direction: column; padding: 6px 12px; border-radius: 9px; background: #1e293b; }
.metric-chips small { color: #8492a6; font-size: 11px; }
.metric-chips b { color: #f1f5f9; font-variant-numeric: tabular-nums; }
pre.output { margin: 0; padding: 12px 14px; border-radius: 9px; background: var(--code-bg); border: 1px solid var(--code-line); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; color: #cbd5e1; }
pre.output.bad { color: #fecaca; border-color: #7f1d1d; background: #1f0f14; }
pre.output.muted { color: #64748b; }

/* ---------------------------------------------------------------- documentation */
.docs { display: grid; grid-template-columns: 210px minmax(0, 780px); gap: 48px; max-width: 1080px; margin: 0 auto; }
.docs-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; font-size: 13.5px; }
.toc-title { font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.toc-group { margin-bottom: 14px; }
.toc-group-title { font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.docs-toc a { display: block; padding: 4px 10px; margin-left: -10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--text); background: var(--hover); }
.docs-toc a.active { color: var(--accent); background: var(--accent-soft); font-weight: 550; }
.docs-toc .toc-external { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); border-radius: 0; }
.docs-body { min-width: 0; font-size: 14.5px; line-height: 1.7; color: #1e293b; }
.doc-section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--border); scroll-margin-top: 20px; }
.doc-section:last-child { border-bottom: none; }
.doc-section h2 { font-size: 22px; margin: 0 0 12px; }
.doc-section h2 a { color: var(--text); text-decoration: none; }
.doc-section h2 a:hover::after { content: " #"; color: var(--faint); }
.doc-section h3 { font-size: 16px; margin: 26px 0 8px; }
.doc-section p { margin: 10px 0; }
.doc-lead { font-size: 16px; color: var(--muted); }
.docs-body code { font: 12.5px var(--mono); background: #eef0f4; color: #0f172a; padding: 1px 5px; border-radius: 5px; }
.doc-list, .doc-steps { padding-left: 22px; margin: 10px 0; }
.doc-list li, .doc-steps li { margin: 8px 0; }
.doc-steps.compact li { margin: 4px 0; }
.doc-steps .doc-code { margin: 10px 0 4px; }
.doc-code { margin: 14px 0; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--code-line); }
.doc-code.loading { height: 160px; }
.doc-code-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 5px 14px; background: #0f1629; border-bottom: 1px solid var(--code-line); color: #94a3b8; font: 12px var(--mono); }
.doc-code-head .btn { color: #94a3b8; }
.doc-code-head .btn:hover { background: #1e293b; color: #e2e8f0; }
.doc-code pre { margin: 0; padding: 14px 16px; overflow: auto; font: 12.5px/1.65 var(--mono); color: #e2e8f0; white-space: pre; }
.hl-k { color: #c4b5fd; }
.hl-s { color: #86efac; }
.hl-c { color: #64748b; font-style: italic; }
.hl-n { color: #fda4af; }
.hl-f { color: #7dd3fc; }
.hl-m { color: #fbbf24; }
.hl-v { color: #fca5a5; }
.hl-p { color: #93c5fd; }
.doc-table { margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; background: var(--surface); }
.doc-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.55; }
.doc-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--subtle); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.doc-table td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.doc-table tr:first-child td { border-top: none; }
.doc-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 14px 0; border-radius: 10px; background: var(--accent-soft); color: #312e81; font-size: 14px; }
.doc-note .icon { margin-top: 3px; flex: none; }
.doc-note.warn { background: var(--warn-soft); color: #78350f; }
.doc-flow { display: flex; align-items: stretch; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.flow-step { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.flow-step small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.flow-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.flow-arrow { align-self: center; color: var(--faint); font-size: 18px; }
.doc-pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.doc-pipeline > span { color: var(--faint); }
.pipe-step { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; background: #312e81; color: white; font-size: 12.5px; line-height: 1.4; }
.pipe-step b { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.pipe-step small { color: #c7d2fe; font-size: 11.5px; }
.pipe-step.muted { background: var(--hover); color: var(--text); border: 1px solid var(--border); }
.pipe-step.muted b { font-family: inherit; }
.pipe-step.muted small { color: var(--muted); }
.doc-faq { margin: 8px 0; }
.doc-faq > div { padding: 10px 0; border-top: 1px solid var(--border); }
.doc-faq > div:first-child { border-top: none; }
.doc-faq dt { margin-bottom: 2px; }
.doc-faq dd { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------- projects */

.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: white; }
.btn.danger-solid:hover:not(:disabled) { background: #b91c1c; }
.current-tag { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px; color: var(--accent); background: var(--accent-soft); }
.list-row.selected .current-tag { background: white; }
.cell-title small.faint { color: var(--faint); }
.endpoints { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.endpoints small { color: var(--muted); }
.row-delete { color: var(--faint); opacity: .6; }
.list-row:hover .row-delete, .row-delete:focus-visible { opacity: 1; }
.row-delete:hover { color: var(--bad); background: var(--bad-soft); }
ul.consequences { margin: 6px 0 4px; padding-left: 18px; }
ul.consequences li { margin: 7px 0; }

/* ---------------------------------------------------------------- system & jobs */

.nav .count.live { color: var(--accent); background: var(--accent-soft); padding: 0 7px; border-radius: 99px; font-weight: 600; }
.nav .count .dot { vertical-align: middle; }
.component-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.component { display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--border); }
.component.ok { border-top-color: #10b981; }
.component.warn { border-top-color: #f59e0b; }
.component.bad { border-top-color: var(--bad); }
.component-head { display: flex; align-items: flex-start; gap: 12px; }
.component-title { flex: 1; min-width: 0; }
.component-title b { display: block; font-size: 15px; }
.component-title small { display: block; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.component-summary { font-size: 13.5px; }
.component .stats { margin-top: 2px; }
.facts.compact { gap: 4px 14px; font-size: 12.5px; margin: 0; }
.facts.compact dt { font-size: 12.5px; }
.facts.compact dd .mono { font-size: 12px; }
.warn-text { color: var(--warn); }
.worker-list { display: flex; flex-direction: column; }
.worker-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.worker-row:first-child { border-top: none; }
.section-title { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.endpoints-table .cell-title small .model-link { font-weight: 500; }
.endpoints-table .cell-title small { white-space: normal; }
.slots { display: flex; flex-wrap: wrap; gap: 5px; font-size: 12.5px; }
.slots .chip { display: inline-flex; align-items: center; gap: 4px; }
.list-row[role="button"] { cursor: pointer; }
.job-detail .detail-head { margin: 4px 0 8px; }
.job-detail .callout.compact { margin: 6px 0 10px; }
.log-tail { margin-top: 10px; }
.log-tail pre.output { max-height: 300px; overflow: auto; margin-top: 4px; font-size: 12px; }
.cell-title small .icon { vertical-align: -1px; margin-right: 2px; }

/* ---------------------------------------------------------------- all deployments */

.treemap { position: relative; width: 100%; overflow: hidden; border-radius: 8px; }
.tm-project { position: absolute; border-radius: 8px; background: color-mix(in srgb, var(--project) 9%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--project) 22%, white); }
.tm-project-label { position: absolute; left: 8px; right: 8px; top: 3px; height: 17px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.tm-project-label i { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--project); }
.tm-project-label b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tm-project-label small { margin-left: auto; color: var(--muted); font-size: 11px; }
.tm-tile {
  position: absolute; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 1px;
  padding: 5px 7px; border: none; border-radius: 6px; font: inherit; text-align: left; cursor: pointer; overflow: hidden;
  color: #fff; transition: filter .1s, box-shadow .1s;
}
.tm-tile:hover, .tm-tile:focus-visible { filter: brightness(1.08); box-shadow: 0 0 0 2px var(--text); outline: none; z-index: 1; }
.tm-tile b { font-size: 12.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-tile small { font-size: 11px; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-tile.ok, .tm-swatch.ok { background: #10b981; }
.tm-tile.warn, .tm-swatch.warn { background: #f59e0b; }
.tm-tile.bad, .tm-swatch.bad { background: var(--bad); }
.tm-tile.idle, .tm-swatch.idle { background: #cbd5e1; color: var(--text); }
.tm-tile.off, .tm-swatch.off { background: repeating-linear-gradient(135deg, #e2e8f0 0 6px, #f1f5f9 6px 12px); color: var(--muted); }
.tm-legend { margin: 0; font-size: 12px; color: var(--muted); }
.tm-hint { margin: -4px 0 10px; }
.fleet-filters { margin-top: 18px; gap: 12px; flex-wrap: wrap; }
.fleet-filters .segmented small { color: var(--faint); font-weight: 500; margin-left: 2px; }
.search { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); width: 320px; max-width: 100%; flex: 0 1 320px; }
.search:focus { outline: none; border-color: #a5b4fc; box-shadow: 0 0 0 3px var(--accent-soft); }
.list-head .sort { display: inline-flex; align-items: center; gap: 3px; border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.list-head .sort.num { justify-self: end; }
.list-head .sort:hover, .list-head .sort.on { color: var(--text); }
.project-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-chip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fleet-table .version-tag { margin-left: 6px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid.two, .grid.side { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar .brand { padding: 0 8px 0 0; }
  .switcher { margin: 0; flex: 1; min-width: 180px; }
  .nav { flex-direction: row; width: 100%; }
  .sidebar-foot { display: none; }
  .content { padding: 20px 16px 48px; }
  .list { overflow-x: auto; }
  .list-head, .list-row { min-width: 760px; }
  .workbench { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(420px, 1fr); height: auto; min-height: 100vh; }
  .wb-side { border-right: none; border-bottom: 1px solid var(--border); }
  .choice-cards { grid-template-columns: 1fr; }
}
