:root {
  /* Dark surface, white ink: neutral greys only, one quiet accent. */
  --bg: #0a0a0b;
  --bg-soft: #121214;
  --bg-elev: #17171a;
  --border: #2a2a2e;
  --border-soft: #1e1e22;
  --text: #f5f5f6;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;

  --tok-comment: #77777f;
  --tok-keyword: #f0f0f2;
  --tok-string: #a7d9a7;
  --tok-number: #f2c07a;
  --tok-native: #a8c7ff;
  --tok-builtin: #e6cf8b;
  --tok-func: #cfe3ff;
  --tok-op: #a8a8b0;
  --tok-command: #f0b09a;
  --tok-callback: #e3d3a0;
  --tok-meta: #9a9aa2;

  --sidebar-w: 260px;
  --toc-w: 208px;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: #0a0a0b;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 20px;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}

.brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 700; letter-spacing: 0.2px; font-size: 17px; }
.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.search-btn:hover { border-color: var(--accent); color: var(--text); }
kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--muted);
}
.gh-link { color: var(--muted); font-size: 13.5px; }
.gh-link:hover { color: var(--text); }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 58px;
  align-self: start;
  height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 22px 14px 40px 20px;
  border-right: 1px solid var(--border-soft);
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.nav-section { margin-bottom: 22px; }
.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--muted-2);
  font-weight: 700;
  margin: 0 0 8px 8px;
}
.nav-section ul { list-style: none; margin: 0; padding: 0; }
.nav-section li { margin: 1px 0; }
.nav-section a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
}
.nav-section a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-section a.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

.content {
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 860px;
}

/* ---------- typography ---------- */
.content h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
}
.content h2 {
  font-size: 23px;
  margin: 44px 0 12px;
  padding-top: 10px;
  letter-spacing: -0.2px;
  scroll-margin-top: 80px;
}
.content h3 { font-size: 18px; margin: 28px 0 8px; scroll-margin-top: 80px; }
.content p { margin: 12px 0; color: #d3d8e0; }
.content ul, .content ol { margin: 12px 0; padding-left: 22px; color: #d3d8e0; }
.content li { margin: 5px 0; }
.content strong { color: #fff; }
.content > p:first-of-type { font-size: 17px; color: var(--muted); }

.inline {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: #cfe3ff;
  white-space: nowrap;
}

/* ---------- code blocks ---------- */
.code-block {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d1017;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #10141c;
  border-bottom: 1px solid var(--border-soft);
}
.code-lang {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted-2);
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 9px;
  font-size: 11.5px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--mono);
  font-size: 13.2px;
  line-height: 1.65;
  color: #c9d1d9;
  white-space: pre;
  tab-size: 4;
}
.code-block pre::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-keyword { color: var(--tok-keyword); }
.tok-string { color: var(--tok-string); }
.tok-number { color: var(--tok-number); }
.tok-native { color: var(--tok-native); }
.tok-builtin { color: var(--tok-builtin); }
.tok-func { color: var(--tok-func); }
.tok-op { color: var(--tok-op); }
.tok-command { color: var(--tok-command); font-weight: 600; }
.tok-callback { color: var(--tok-callback); font-weight: 600; }
.tok-meta { color: var(--tok-meta); }

/* ---------- notes ---------- */
.note {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 14.5px;
}
.note-label {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 999px;
}
.note-info { border-color: rgba(110, 168, 254, 0.4); background: rgba(110, 168, 254, 0.07); }
.note-info .note-label { background: var(--accent-soft); color: var(--text); }
.note-tip { border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.07); }
.note-tip .note-label { background: rgba(63, 185, 80, 0.18); color: var(--green); }
.note-warn { border-color: rgba(210, 153, 34, 0.45); background: rgba(210, 153, 34, 0.08); }
.note-warn .note-label { background: rgba(210, 153, 34, 0.2); color: var(--yellow); }

/* ---------- tables ---------- */
.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  text-align: left;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
tr:last-child td { border-bottom: none; }
td .inline { white-space: nowrap; }

/* ---------- TOC ---------- */
.toc {
  position: sticky;
  top: 58px;
  align-self: start;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 42px 20px 40px 8px;
  font-size: 13px;
}
.toc-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 8px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 3px 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); text-decoration: none; }

.page-footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-size: 13px;
  display: flex;
  gap: 8px;
}

/* ---------- search ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.search-modal[hidden] { display: none; }
.search-box {
  width: min(620px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
#searchInput {
  width: 100%;
  box-sizing: border-box;
  padding: 15px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
#searchResults { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
#searchResults li a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
}
#searchResults li a:hover, #searchResults li a.sel {
  background: var(--accent-soft);
  text-decoration: none;
}
#searchResults .res-section { color: var(--muted-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- landing ---------- */
.hero {
  padding: 72px 0 28px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 46px;
  letter-spacing: -1px;
  margin: 0 0 12px;
  background: linear-gradient(120deg, #fff, #9db8ff 60%, #b79cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid var(--border);
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
  border-color: transparent;
}
.btn-ghost { color: var(--text); background: var(--bg-soft); }
.btn-ghost:hover { border-color: var(--accent); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.card h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .card-icon { font-size: 20px; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1024px) {
  .content { max-width: 100%; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .content { max-width: 100%; padding: 20px 16px 72px; }
  .content p, .content li { font-size: 15px; }
  .menu-btn { display: inline-grid; place-items: center; }
  .sidebar {
    position: fixed;
    inset: 58px auto 0 0;
    width: 82vw;
    max-width: 320px;
    background: var(--bg);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    border-right: 1px solid var(--border);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 24px 18px 64px; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { padding: 6px 10px; }
  .sidebar-close { display: inline-grid; place-items: center; }
  .hero h1 { font-size: 34px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-tag { display: none; }
  .gh-link { display: none; }
  .lang-switch { display: inline-flex; }
  .lang-opt { padding: 5px 9px; }
  .content h1 { font-size: 27px; }
  .content h2 { font-size: 21px; margin-top: 34px; }
  .code-block code { font-size: 12.4px; }
  .code-block pre { padding: 12px; }
  .pager { flex-direction: column; }
  .pager a { min-width: 0; }
  .pager-next { margin-left: 0; text-align: left; }
  .table-wrap { margin-left: -2px; margin-right: -2px; }
}

@media (max-width: 420px) {
  .topbar { height: 52px; padding: 0 10px; }
  .brand-name { font-size: 15px; }
  .search-btn { padding: 6px 8px; }
  .topbar-right { gap: 6px; }
  .content { padding: 16px 13px 64px; }
  .content h1 { font-size: 24px; }
  .content h2 { font-size: 19px; }
  .content h3 { font-size: 16px; }
  .code-block code { font-size: 11.6px; }
  .pager a { padding: 10px 12px; }
}

/* ---------- pager ---------- */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  min-width: 180px;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a span { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-2); }
.pager-next { text-align: right; margin-left: auto; }
.lede { font-size: 17px; color: var(--muted) !important; margin-top: 0 !important; }

/* ---------- language switch ---------- */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.lang-opt {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.lang-opt:hover { color: var(--text); text-decoration: none; }
.lang-opt.active { background: var(--accent); color: #0a0a0b; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 58px 0 0 0;
  background: rgba(3, 5, 9, 0.6);
  z-index: 45;
}
.sidebar-overlay.show { display: block; }
.sidebar-close {
  display: none;
  margin: 0 0 8px 8px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

body.no-scroll { overflow: hidden; }

/* ---------- API catalog ---------- */
.api-table td { font-size: 13.5px; }
.api-table td:first-child { white-space: nowrap; }
.api-catalog h3 { margin-top: 30px; }
.count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- Landing ----------------------------------------------------------- */
/*
 * Dark ground, white ink, one hairline grid. Scoped to body.hx so the docs UI
 * and the plugin hub keep their own layout.
 */
body.hx {
  --hx-ink: #fafafa;
  --hx-dim: #a1a1aa;
  --hx-line: #26262a;
  --hx-panel: #111113;
  display: block;
  margin: 0;
  background: #0a0a0b;
  color: var(--hx-ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.hx * { box-sizing: border-box; }
body.hx ::selection { background: var(--hx-ink); color: #0a0a0b; }

.hx-wordmark { font-weight: 800; letter-spacing: -0.02em; font-size: 1.15rem; }

.hx-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--hx-line);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
}
.hx-brand { display: flex; align-items: baseline; gap: 0.5rem; color: inherit; text-decoration: none; }
.hx-brand-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--hx-dim);
}
.hx-nav { display: flex; gap: 1.4rem; flex: 1; }
.hx-nav a, .hx-foot-links a {
  color: var(--hx-dim);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.hx-nav a:hover, .hx-foot-links a:hover { color: var(--hx-ink); }
.hx-top-right { display: flex; align-items: center; gap: 0.75rem; }
.hx-lang { display: flex; gap: 0.25rem; font-family: var(--mono); font-size: 0.68rem; }
.hx-lang a { color: var(--hx-dim); text-decoration: none; padding: 0.2rem 0.4rem; border: 1px solid transparent; border-radius: 4px; }
.hx-lang a.is-on { background: var(--hx-ink); color: #0a0a0b; }
.hx-cta-sm {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--hx-ink);
  border-radius: 6px;
  color: var(--hx-ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.hx-cta-sm:hover { background: var(--hx-ink); color: #0a0a0b; }

/* hero */
.hx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--hx-line);
}
.hx-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hx-dim);
  margin: 0 0 1rem;
}
.hx-hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.hx-hero h1 span { display: block; }
.hx-hero h1 span:nth-child(2) {
  color: transparent;
  -webkit-text-stroke: 1px var(--hx-ink);
}
.hx-sub {
  max-width: 54ch;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.65;
  color: var(--hx-dim);
  margin: 0 0 1.75rem;
}
.hx-ctas { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1.15rem;
  border: 1px solid var(--hx-line);
  border-radius: 7px;
  color: var(--hx-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hx-btn:hover { border-color: var(--hx-ink); }
.hx-btn-solid { background: var(--hx-ink); color: #0a0a0b; border-color: transparent; }
.hx-btn-solid:hover { background: #d4d4d8; }
.hx-btn-ghost { color: var(--hx-dim); }

.hx-hero-code {
  border: 1px solid var(--hx-line);
  border-radius: 10px;
  background: var(--hx-panel);
  overflow: hidden;
  min-width: 0;
}
.hx-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--hx-line);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--hx-dim);
}
.hx-dots { display: flex; gap: 0.3rem; }
.hx-dots i { width: 6px; height: 6px; border-radius: 50%; background: #3f3f46; }
.hx-hero-code pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.65;
  color: #e4e4e7;
}

/* install */
.hx-install, .hx-features, .hx-faqs {
  padding: clamp(2rem, 5vw, 3.75rem) clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--hx-line);
}
.hx-install h2, .hx-sec-head h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hx-term {
  border: 1px solid var(--hx-line);
  border-radius: 10px;
  background: var(--hx-panel);
  max-width: 860px;
  overflow: hidden;
}
.hx-term-tabs { display: flex; border-bottom: 1px solid var(--hx-line); }
.hx-term-tabs span {
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--hx-dim);
  border-right: 1px solid var(--hx-line);
}
.hx-term-tabs span.is-on { background: var(--hx-ink); color: #0a0a0b; font-weight: 700; }
.hx-term-body {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  overflow-x: auto;
  white-space: nowrap;
}
.hx-term-body + .hx-term-body { border-top: 1px solid var(--hx-line); }
.hx-term-sub { color: var(--hx-dim); }
.hx-term-sub em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hx-prompt { color: #4ade80; }
.hx-note {
  max-width: 70ch;
  margin: 0.9rem 0 0;
  color: var(--hx-dim);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* features */
.hx-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hx-sec-head a {
  color: var(--hx-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--hx-line);
  border-left: 1px solid var(--hx-line);
}
.hx-feature {
  padding: 1.35rem 1.25rem 1.5rem;
  border-right: 1px solid var(--hx-line);
  border-bottom: 1px solid var(--hx-line);
}
.hx-feature-n {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hx-dim);
  margin-bottom: 0.55rem;
}
.hx-feature h3 { margin: 0 0 0.4rem; font-size: 1.08rem; letter-spacing: -0.01em; }
.hx-feature p { margin: 0; color: var(--hx-dim); font-size: 0.86rem; line-height: 1.6; }

/* faq */
.hx-faq-list { border-top: 1px solid var(--hx-line); }
.hx-faq { border-bottom: 1px solid var(--hx-line); }
.hx-faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.hx-faq summary::-webkit-details-marker { display: none; }
.hx-faq summary::after { content: "+"; font-family: var(--mono); color: var(--hx-dim); }
.hx-faq[open] summary::after { content: "–"; }
.hx-faq p { margin: 0 0 1rem; max-width: 80ch; color: var(--hx-dim); font-size: 0.88rem; line-height: 1.7; }

/* footer */
.hx-foot {
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--hx-dim);
}
.hx-foot-main { display: flex; align-items: baseline; gap: 0.65rem; color: var(--hx-ink); }
.hx-foot-main span:last-child { color: var(--hx-dim); }
.hx-foot-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }

/* responsive */
@media (max-width: 960px) {
  .hx-hero { grid-template-columns: 1fr; }
  .hx-hero-code { order: 2; }
  .hx-nav { display: none; }
}
@media (max-width: 620px) {
  .hx-top { gap: 0.75rem; padding: 0.65rem 0.9rem; }
  .hx-brand-tag, .hx-cta-sm { display: none; }
  .hx-top-right { margin-left: auto; }
  .hx-ctas { display: grid; grid-template-columns: 1fr; }
  .hx-btn { width: 100%; }
  .hx-term-tabs span { flex: 1; text-align: center; }
  .hx-term-body { font-size: 0.7rem; }
  .hx-term-sub em { display: none; }
  .hx-sec-head { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .hx-foot { flex-direction: column; align-items: flex-start; }
}

/* ---- Plugin hub: grid + detail ---------------------------------------- */
.hub-head { margin-bottom: 1.5rem; }
.hub-head h1 { margin-bottom: 0.4rem; }
.hub-search { margin-top: 1.1rem; max-width: 560px; }
.hub-search input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
}
.hub-search input::placeholder { color: var(--muted-2); }
.hub-search input:focus { border-color: var(--accent); }

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin: 1.25rem 0 1rem;
}
.pc {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.pc:hover {
  border-color: var(--accent);
  background: var(--bg-elev);
  text-decoration: none;
  transform: translateY(-1px);
}
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.pc-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}
.pc-kind {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  white-space: nowrap;
}
.pc-name { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.pc-sum { font-size: 0.83rem; line-height: 1.5; color: var(--muted); flex: 1; }
.pc-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.72rem;
  color: var(--muted-2);
  font-family: var(--mono);
}
.pc-go { color: var(--text); }
.hub-empty { color: var(--muted); font-size: 0.9rem; }

/* detail */
.hub-back {
  display: inline-block;
  margin-bottom: 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.hub-back:hover { color: var(--text); text-decoration: none; }
.hub-detail-head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1.4rem; }
.hub-detail-head h1 { margin: 0 0 0.25rem; }
.hub-detail-head .lede { margin: 0; }
.hub-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 1.4rem 0 1.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}
.hub-facts > div { background: var(--bg-soft); padding: 0.75rem 0.9rem; }
.hub-facts dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-bottom: 0.3rem;
}
.hub-facts dd { margin: 0; font-size: 0.86rem; line-height: 1.8; }
.hub-h2 { margin-top: 1.9rem; }
.hub-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 1.1rem 0 0.5rem;
  font-size: 0.82rem;
}
.hub-file-head .count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted-2);
}

/* ---- docs polish ------------------------------------------------------- */
.content { max-width: 820px; padding: clamp(24px, 4vw, 40px) clamp(18px, 4vw, 48px) 80px; }
.content h1 { letter-spacing: -0.02em; }
.content h2 { letter-spacing: -0.015em; }
.lede { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  margin: 1.1rem 0;
}
.table-wrap table { border-collapse: collapse; width: 100%; margin: 0; }
.table-wrap th, .table-wrap td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}
.table-wrap th {
  background: var(--bg-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.code-block { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.code-block pre { overflow-x: auto; }

@media (max-width: 860px) {
  .hub-detail-head { flex-direction: column; gap: 0.5rem; }
  .hub-facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .plugin-grid { grid-template-columns: 1fr; }
  .hub-search input { font-size: 16px; } /* avoid iOS zoom-on-focus */
  .table-wrap th, .table-wrap td { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
}

/* ---- TextDraw editor --------------------------------------------------- */
/* The editor needs room: on wide screens it breaks out of the reading column. */
.tde {
  --tde-bg: var(--bg-soft);
  --tde-line: var(--border);
  display: block;
  margin: 1.4rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
}
.tde-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.tde-tabs { display: flex; gap: 0.25rem; }
.tde-tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.tde-tab.is-on { background: var(--accent); color: #0a0a0b; }
.tde-zoom { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.tde-zoom-val {
  min-width: 3.2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.tde-ico {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.tde-ico:hover, .tde-btn:hover { border-color: var(--accent); }
.tde-btn {
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.tde-primary { background: var(--accent); color: #0a0a0b; border-color: transparent; }
.tde-danger { color: var(--red); }
.tde-hint {
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.76rem;
  line-height: 1.5;
}
.tde-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
  min-height: 0;
}
.tde-body[hidden] { display: none; }
.tde-stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
}
.tde-stage {
  position: relative;
  overflow: hidden;
  background: #08090b;
  background-image: radial-gradient(#1a1a1f 1px, transparent 1px);
  background-size: 16px 16px;
  touch-action: none;
  cursor: grab;
  outline: none;
}
.tde-stage:active { cursor: grabbing; }
.tde-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.tde-canvas {
  position: absolute;
  transform-origin: 0 0;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.tde-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.tde-grid { position: absolute; inset: 0; pointer-events: none; }
.tde-layer { position: absolute; inset: 0; }
.tde-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: inherit;
  padding: 0;
  line-height: 1.05;
  white-space: pre;
  cursor: move;
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
}
.tde-item.is-selected {
  outline: 1px dashed rgba(255, 255, 255, 0.55);
  outline-offset: 1px;
  /* handles sit on the corners, so they must not be clipped */
  overflow: visible;
}
/* Corner handles: visible on the selected draw, draggable with mouse or touch. */
.tde-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px #000;
  pointer-events: auto;
  touch-action: none;
  z-index: 3;
}
.tde-handle[data-corner="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.tde-handle[data-corner="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.tde-handle[data-corner="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.tde-handle[data-corner="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
@media (pointer: coarse) {
  .tde-handle { width: 20px; height: 20px; }
  .tde-handle[data-corner="nw"] { left: -10px; top: -10px; }
  .tde-handle[data-corner="ne"] { right: -10px; top: -10px; }
  .tde-handle[data-corner="sw"] { left: -10px; bottom: -10px; }
  .tde-handle[data-corner="se"] { right: -10px; bottom: -10px; }
}
.tde-preview {
  display: grid;
  place-items: center;
  font-family: var(--mono);
}
.tde-preview-model { font-size: 0.9rem; color: #cfe3ff; }
.tde-preview-label {
  position: absolute;
  bottom: 2px;
  font-size: 8px;
  color: #8f9bb3;
}
.tde-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.tde-stage-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-left: auto; }
.tde-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 620px;
  overflow-y: auto;
}
.tde-block { padding: 0.85rem; border-bottom: 1px solid var(--border); }
.tde-block h3 {
  margin: 0 0 0.6rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.tde-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tde-li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 7px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.84rem;
}
.tde-li:hover { background: var(--bg-elev); }
.tde-li.is-on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.tde-li-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tde-li-meta { font-family: var(--mono); font-size: 0.68rem; color: var(--muted-2); flex: 0 0 auto; }
.tde-empty { color: var(--muted-2); font-size: 0.82rem; margin: 0; }
.tde-field { display: flex; flex-direction: column; gap: 0.28rem; margin-bottom: 0.6rem; }
.tde-field > span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
}
.tde-field input[type="text"],
.tde-field input[type="number"],
.tde-field select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
}
.tde-field input:focus, .tde-field select:focus { outline: none; border-color: var(--accent); }
.tde-inline { flex: 1 1 160px; margin: 0; }
.tde-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tde-checks { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 0.6rem; }
.tde-check { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.tde-color { display: flex; gap: 0.4rem; align-items: center; }
.tde-color input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.tde-color input[type="number"] { width: 64px; }
.tde-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.tde-code { width: 100%; }
.tde-code-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.82rem;
}
.tde-code-head code { font-family: var(--mono); color: var(--muted); }
.tde-code-actions { display: flex; gap: 0.4rem; }
.tde-code pre {
  margin: 0;
  padding: 1rem;
  max-height: 520px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.6;
}
.tde-saved { margin: 0; padding: 0.6rem 0.9rem; color: var(--muted-2); font-size: 0.74rem; }

@media (max-width: 900px) {
  .tde-body { grid-template-columns: 1fr; }
  .tde-stage-wrap { border-right: 0; border-bottom: 1px solid var(--border); }
  .tde-side { max-height: none; }
  .tde-stage-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .tde-bar { flex-wrap: wrap; gap: 0.5rem; }
  .tde-zoom { margin-left: 0; }
  .tde-stage-bar { padding: 0.6rem; }
  .tde-btn { padding: 0.45rem 0.7rem; }
  .tde-row { grid-template-columns: 1fr; }
  .tde-code pre { max-height: 360px; font-size: 0.72rem; }
}

/* ---- Standalone TextDraw editor page ---------------------------------- */
body.ed {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
.ed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem clamp(0.75rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}
.ed-brand { display: flex; align-items: baseline; gap: 0.55rem; color: var(--text); text-decoration: none; }
.ed-wordmark { font-weight: 800; letter-spacing: -0.02em; }
.ed-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-2);
}
.ed-nav { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; }
.ed-nav a { color: var(--muted); text-decoration: none; }
.ed-nav a:hover { color: var(--text); }
.ed-cta {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text) !important;
}
.ed-cta:hover { border-color: var(--accent); }
.ed-lang { display: flex; gap: 0.2rem; font-family: var(--mono); font-size: 0.68rem; }
.ed-lang a { color: var(--muted-2); padding: 0.15rem 0.3rem; border-radius: 4px; }
.ed-lang a.is-on { background: var(--accent); color: #0a0a0b; }

.ed-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
  min-height: 0;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}
.ed-head h1 { margin: 0 0 0.25rem; font-size: clamp(1.15rem, 2.6vw, 1.6rem); letter-spacing: -0.02em; }
.ed-head p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.ed .tde { margin: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ed .tde-body { flex: 1; }
.ed .tde-stage-wrap { min-height: 0; }
.ed .tde-stage { flex: 1 1 auto; height: min(62vh, 680px); min-height: 300px; }
.ed .tde-side { max-height: none; }
.ed-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem clamp(0.75rem, 3vw, 1.5rem) 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.76rem;
}
.ed-foot a { color: var(--muted-2); }

@media (max-width: 700px) {
  .ed-tag, .ed-nav a:not(.ed-cta) { display: none; }
  .ed-nav { gap: 0.6rem; }
  .ed-main { padding: 0.6rem; gap: 0.6rem; }
  .ed-head p { font-size: 0.82rem; }
}
