/* Keas design system — light, airy UI; chips, bordered cards, monospace repo ids (§2.3). */
:root, [data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --bg-muted: #f1f3f6;
  --bg-hover: #f4f5f8;
  --surface: #ffffff;
  --border: #e5e7ec;
  --border-strong: #d2d6de;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #8a93a3;
  --accent: #5b4ff5;
  --accent-2: #14b8a6;
  --accent-soft: #eeecff;
  --primary-btn: #111827;
  --primary-btn-text: #ffffff;
  --chip-selected: #111827;
  --chip-selected-text: #ffffff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --bolt: #eab308;
  --heart: #e11d48;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 6px 24px rgba(17, 24, 39, .06);
  --shadow-lg: 0 12px 48px rgba(17, 24, 39, .18);
  --code-bg: #f6f8fa;
  --diff-add: #e6ffec;
  --diff-del: #ffebe9;
  --radius: 10px;
  --radius-sm: 7px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Fraunces, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-soft: #111723;
  --bg-muted: #161d2b;
  --bg-hover: #182033;
  --surface: #0f1420;
  --border: #232c3d;
  --border-strong: #2f3a50;
  --text: #e8ecf3;
  --text-2: #a8b2c3;
  --text-3: #6f7a8e;
  --accent: #8b80ff;
  --accent-2: #2dd4bf;
  --accent-soft: #221f4a;
  --primary-btn: #f3f4f6;
  --primary-btn-text: #0b0f17;
  --chip-selected: #f3f4f6;
  --chip-selected-text: #0b0f17;
  --ok: #4ade80;
  --ok-soft: #12321f;
  --warn: #fbbf24;
  --warn-soft: #3a2a0a;
  --danger: #f87171;
  --danger-soft: #3b1414;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .6);
  --code-bg: #0d1320;
  --diff-add: #0f2c1a;
  --diff-del: #3a1518;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
code, kbd, pre, .mono { font-family: var(--mono); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1, h2, .brand { font-family: var(--serif); letter-spacing: -.015em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.icon { width: 16px; height: 16px; fill: currentColor; flex: none; }
.icon-sm { width: 13px; height: 13px; }
.icon-lg { width: 20px; height: 20px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 680px; margin: 0 auto; padding: 32px 24px; }
.section { padding: 28px 0; }

/* ------------------------------------------------------------------ top nav */
.topnav { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 40; }
.topnav-inner { max-width: 1440px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 8px; }
.brand-sm { opacity: .8; }
.search { position: relative; flex: 0 1 380px; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft);
  padding: 0 34px 0 34px; color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg); }
.search-kbd { position: absolute; right: 10px; font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; line-height: 17px; }
.search-results {
  position: absolute; top: 42px; left: 0; width: min(520px, 90vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; max-height: 70vh; overflow: auto;
}
.search-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.search-item.active, .search-item:hover { background: var(--bg-hover); color: var(--text); }
.search-item .mono { font-size: 13px; }
.primary-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.primary-links > a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.primary-links > a:hover { color: var(--text); background: var(--bg-hover); }
.primary-links > a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav-user { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 500 13.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary-btn); color: var(--primary-btn-text); border-color: var(--primary-btn); }
.btn-primary:hover { background: var(--primary-btn); opacity: .88; color: var(--primary-btn-text); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent); opacity: .9; color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.input, .select { height: 36px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--danger); }
.input-sm { height: 30px; padding: 4px 9px; font-size: 13px; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.textarea.mono, .input.mono { font-family: var(--mono); font-size: 13px; }
label.label, .label { display: block; font-weight: 550; font-size: 13px; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field-hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.radio-card { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }

/* ------------------------------------------------------------------ chips, badges, avatars */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
a.chip:hover, button.chip:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text); }
.chip.selected { background: var(--chip-selected); color: var(--chip-selected-text); border-color: var(--chip-selected); }
.chip.selected:hover { background: var(--chip-selected); color: var(--chip-selected-text); opacity: .9; }
.chip.disabled { opacity: .4; pointer-events: none; }
.chip-sm { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.chip .x { margin-left: 2px; opacity: .8; }
.chip .count { color: var(--text-3); font-size: 11.5px; }
.chip.selected .count { color: inherit; opacity: .7; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px;
  font-weight: 550; border: 1px solid var(--border); color: var(--text-2); background: var(--bg-soft); line-height: 18px;
}
.badge-private { color: var(--text-2); }
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge-new { color: #fff; background: var(--accent); border-color: transparent; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.sha-chip { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--bg-muted); color: var(--text-2); }
.avatar { display: inline-block; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-muted); vertical-align: middle; }
.avatar.org { border-radius: 22%; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--bg); margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
kbd { font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--text-2); }

/* ------------------------------------------------------------------ cards, menus, modals, toasts */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card-pad { padding: 16px 18px; }
.card-hover { transition: background .12s, border-color .12s, box-shadow .12s; }
.card-hover:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.panel-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dropdown { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; max-height: 75vh; overflow: auto;
}
.menu.left { left: 0; right: auto; }
.menu a, .menu button.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border-radius: 6px; border: 0;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.menu a:hover, .menu button.menu-item:hover, .menu .menu-item.active { background: var(--bg-hover); color: var(--text); }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.menu-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-hint { font-size: 12px; color: var(--text-3); padding: 8px 10px 4px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 20, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 7vh 16px; overflow: auto; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-width: 100%; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; flex: 1; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: var(--primary-btn); color: var(--primary-btn-text); padding: 9px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.popover { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; width: 300px; }

/* ------------------------------------------------------------------ tabs, tables, alerts */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; font-size: 14px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab .badge { font-size: 11px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--bg-soft); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; border-radius: 6px; cursor: pointer; font: 500 12.5px var(--sans); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--text-2); font-weight: 600; font-size: 12px; background: var(--bg-soft); position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.alert { border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; padding: 10px 14px; background: var(--bg-soft); }
.alert-info { border-left-color: var(--accent); }
.alert-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.alert-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty h3 { color: var(--text); }

/* ------------------------------------------------------------------ skeletons */
.skeleton { background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-hover) 37%, var(--bg-muted) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
.skeleton-pill { display: inline-block; width: 90px; height: 30px; border-radius: 999px; background: var(--bg-muted); }
.skeleton-row { height: 62px; margin-bottom: 8px; border-radius: var(--radius); }
.skeleton-line { height: 12px; margin: 8px 0; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ model row card (§3.3) */
.model-list { display: flex; flex-direction: column; gap: 8px; }
.model-row { display: block; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: background .12s, border-color .12s, box-shadow .12s; }
.model-row:hover { background: var(--bg-soft); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow); }
.model-row .model-id { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 14px; font-weight: 500; }
.model-row .model-id .truncate { flex: 1; }
.model-row .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.model-row .meta .dot { opacity: .6; }
.model-row .meta .item { display: inline-flex; align-items: center; gap: 4px; }
.model-row .meta .task { color: var(--text-2); }
.model-row .meta .bolt { color: var(--bolt); }
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 26px 0 10px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; padding: 0 8px; color: var(--text-2); }
.pager a:hover { background: var(--bg-hover); color: var(--text); }
.pager .current { background: var(--bg-muted); color: var(--text); font-weight: 600; }
.pager .disabled { opacity: .35; pointer-events: none; }

/* ------------------------------------------------------------------ prose (rendered markdown) */
.prose { font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.prose h1 { font-size: 28px; margin: 1.1em 0 .5em; }
.prose h2 { font-size: 22px; margin: 1.4em 0 .5em; padding-bottom: .25em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 18px; margin: 1.3em 0 .4em; }
.prose h1:first-child, .prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote, .prose details { margin: 0 0 1em; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose code { background: var(--bg-muted); padding: .12em .38em; border-radius: 5px; font-size: .87em; }
.prose pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow: auto; font-size: 13px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 12px; }
.prose th { background: var(--bg-soft); }
.prose img { max-width: 100%; border-radius: 6px; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--bg-soft); margin-left: 0; padding: 8px 16px; border-radius: 0 8px 8px 0; color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote.callout { color: var(--text); }
.prose .callout-title { display: inline-block; margin-bottom: 2px; }
.prose .callout-note { border-left-color: #3b82f6; }
.prose .callout-note .callout-title { color: #3b82f6; }
.prose .callout-tip { border-left-color: var(--ok); }
.prose .callout-tip .callout-title { color: var(--ok); }
.prose .callout-important { border-left-color: var(--accent); }
.prose .callout-important .callout-title { color: var(--accent); }
.prose .callout-warning { border-left-color: var(--warn); }
.prose .callout-warning .callout-title { color: var(--warn); }
.prose .callout-caution { border-left-color: var(--danger); }
.prose .callout-caution .callout-title { color: var(--danger); }
.prose ul.contains-task-list { list-style: none; padding-left: 4px; }
.prose details { border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose hr { margin: 2em 0; }
.prose .math.block { overflow-x: auto; text-align: center; margin: 1em 0; }

/* ------------------------------------------------------------------ code viewer */
.code-view { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.code-view table { border-collapse: collapse; width: 100%; font: 12.8px/1.6 var(--mono); }
.code-view td.ln { width: 1%; min-width: 48px; padding: 0 12px; text-align: right; color: var(--text-3); user-select: none; vertical-align: top; border-right: 1px solid var(--border); background: var(--bg-soft); }
.code-view td.lc { padding: 0 14px; white-space: pre; }
.code-view tr:target td, .code-view tr.hl-line td { background: var(--accent-soft); }
.code-block { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font: 12.8px/1.6 var(--mono); overflow: auto; white-space: pre; margin: 0; }
.code-block .copy-btn { position: absolute; top: 6px; right: 6px; }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--border); margin-top: 48px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.theme-switch button { border: 0; background: transparent; padding: 3px 10px; border-radius: 6px; color: var(--text-2); cursor: pointer; font: 500 12.5px var(--sans); }
.theme-switch button[aria-checked="true"] { background: var(--bg-muted); color: var(--text); }

/* ------------------------------------------------------------------ layouts */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
.sidebar-left { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
.page-head { padding: 24px 0 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.stat-big { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.coming-soon { text-align: center; padding: 90px 20px; }
.coming-soon .glyph { font-size: 48px; }

@media (max-width: 1100px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .primary-links > a:not(.active) { display: none; }
}
@media (max-width: 760px) {
  .topnav-inner { gap: 10px; padding: 0 14px; }
  .brand span { display: none; }
  .container { padding: 0 14px; }
  .sidebar-left { grid-template-columns: minmax(0, 1fr); }
}
