/* BatechX — shadcn/ui style docs site
 * Brand color: #059669 (emerald 600, deep green)
 * Design language: shadcn — neutral monochrome surface + emerald accent,
 *   borders not shadows, medium radius (8px), system sans, dense typography,
 *   3-col article layout (left tree sidebar / center prose 720px / right TOC sticky),
 *   numbered step badges in code-like blocks, plain table rows separated by hairlines.
 * Prefix: tx- (everything scoped, do not collide with peak/vox/x).
 */

/* ============================================================
   1. Tokens (light + dark) — shadcn neutrals + emerald accent
   ============================================================ */
:root {
  /* Brand */
  --tx-brand: #059669;
  --tx-brand-2: #047857;
  --tx-brand-3: #065F46;
  --tx-brand-tint: #ECFDF5;
  --tx-brand-line: #A7F3D0;
  --tx-brand-soft: rgba(5,150,105,0.08);

  /* Neutral surface */
  --tx-bg: #FFFFFF;
  --tx-bg-1: #FAFAFA;
  --tx-bg-2: #F4F4F5;
  --tx-bg-3: #E4E4E7;
  --tx-bg-code: #F6F6F7;
  --tx-bg-pre: #FAFAFA;
  --tx-bg-callout: #F8FAFB;

  /* Foreground */
  --tx-fg: #09090B;
  --tx-fg-1: #18181B;
  --tx-fg-2: #3F3F46;
  --tx-fg-3: #52525B;
  --tx-fg-mut: #71717A;
  --tx-fg-soft: #A1A1AA;
  --tx-fg-faint: #D4D4D8;

  /* Borders / hairlines */
  --tx-line: #E4E4E7;
  --tx-line-2: #D4D4D8;
  --tx-line-soft: #F0F0F2;

  /* Links */
  --tx-link: #18181B;
  --tx-link-hover: #059669;
  --tx-link-underline: rgba(5,150,105,0.4);

  /* Status colors */
  --tx-info: #2563EB;
  --tx-warn: #D97706;
  --tx-danger: #DC2626;
  --tx-success: #059669;

  /* Geometry */
  --tx-radius-sm: 4px;
  --tx-radius: 8px;
  --tx-radius-lg: 12px;
  --tx-radius-pill: 999px;

  /* Type */
  --tx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --tx-mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  /* Layout */
  --tx-header-h: 56px;
  --tx-sidebar-w: 232px;
  --tx-toc-w: 220px;
  --tx-content-max: 760px;
  --tx-shell-max: 1400px;

  --tx-shadow-sm: 0 1px 0 rgba(0,0,0,0.02);
  --tx-shadow-pop: 0 8px 24px -8px rgba(9,9,11,0.16), 0 2px 6px -2px rgba(9,9,11,0.06);
}

[data-theme="dark"] {
  --tx-bg: #09090B;
  --tx-bg-1: #0E0E10;
  --tx-bg-2: #18181B;
  --tx-bg-3: #27272A;
  --tx-bg-code: #18181B;
  --tx-bg-pre: #0E0E10;
  --tx-bg-callout: #131316;

  --tx-fg: #FAFAFA;
  --tx-fg-1: #F4F4F5;
  --tx-fg-2: #D4D4D8;
  --tx-fg-3: #A1A1AA;
  --tx-fg-mut: #71717A;
  --tx-fg-soft: #52525B;
  --tx-fg-faint: #3F3F46;

  --tx-line: #27272A;
  --tx-line-2: #3F3F46;
  --tx-line-soft: #1A1A1D;

  --tx-link: #FAFAFA;
  --tx-link-hover: #34D399;
  --tx-link-underline: rgba(52,211,153,0.4);

  --tx-brand-tint: rgba(5,150,105,0.16);
  --tx-brand-line: rgba(167,243,208,0.28);
  --tx-brand-soft: rgba(5,150,105,0.14);
}

/* ============================================================
   2. Reset + base
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body.tx-body {
  font-family: var(--tx-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--tx-fg-1);
  background: var(--tx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.tx-nav-open { overflow: hidden; }

a { color: var(--tx-link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--tx-link-hover); }
img, svg { max-width: 100%; vertical-align: middle; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--tx-brand-soft); color: var(--tx-fg); }

.tx-mobile-only { display: none; }
.tx-desktop-only { display: inline-flex; }

/* ============================================================
   3. Header
   ============================================================ */
.tx-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--tx-line);
}
[data-theme="dark"] .tx-header {
  background: rgba(9,9,11,0.86);
}
.tx-header__inner {
  max-width: var(--tx-shell-max);
  margin: 0 auto;
  height: var(--tx-header-h);
  padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
}

.tx-iconbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--tx-radius);
  color: var(--tx-fg-2);
  transition: background .15s, border-color .15s, color .15s;
}
.tx-iconbtn:hover { background: var(--tx-bg-2); color: var(--tx-fg); }

.tx-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--tx-fg-1);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
.tx-brand:hover { color: var(--tx-fg-1); }
.tx-brand__mark { display: inline-flex; }

.tx-topnav {
  display: flex; align-items: center; gap: 4px;
  margin-left: 18px;
}
.tx-topnav__item {
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--tx-fg-3);
  border-radius: var(--tx-radius-sm);
  font-weight: 500;
  transition: color .15s, background .15s;
}
.tx-topnav__item:hover { color: var(--tx-fg-1); background: var(--tx-bg-2); }
.tx-topnav__item.is-active { color: var(--tx-fg-1); }

.tx-search {
  position: relative;
  display: inline-flex; align-items: center;
  margin-left: auto;
  width: 320px;
  max-width: 36vw;
}
.tx-search__icon {
  position: absolute; left: 10px;
  display: inline-flex;
  color: var(--tx-fg-mut);
  pointer-events: none;
}
.tx-search__input {
  width: 100%;
  height: 34px;
  padding: 0 60px 0 32px;
  font: inherit;
  font-size: 13px;
  background: var(--tx-bg-1);
  color: var(--tx-fg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  outline: none;
  transition: border-color .15s, background .15s;
}
.tx-search__input::placeholder { color: var(--tx-fg-mut); }
.tx-search__input:focus { border-color: var(--tx-brand); background: var(--tx-bg); }
.tx-search__kbd {
  position: absolute; right: 8px;
  font-family: var(--tx-mono);
  font-size: 11px;
  color: var(--tx-fg-mut);
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

.tx-header__right {
  display: flex; align-items: center; gap: 6px;
}

.tx-lang { position: relative; }
.tx-lang__btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px;
  font-size: 12.5px;
  color: var(--tx-fg-2);
  background: transparent;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  transition: border-color .15s, background .15s;
}
.tx-lang__btn:hover { background: var(--tx-bg-2); }
.tx-lang__cur { letter-spacing: 0.01em; }
.tx-lang__menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 160px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  box-shadow: var(--tx-shadow-pop);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 60;
}
.tx-lang:hover .tx-lang__menu,
.tx-lang:focus-within .tx-lang__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.tx-lang__menu li { margin: 0; padding: 0; }
.tx-lang__menu a {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--tx-fg-2);
  border-radius: var(--tx-radius-sm);
}
.tx-lang__menu a:hover { background: var(--tx-bg-2); color: var(--tx-fg); }
.tx-lang__menu a.is-current { color: var(--tx-brand); font-weight: 600; }

.tx-theme-toggle .tx-theme-light,
.tx-theme-toggle .tx-theme-dark { display: none; }
[data-theme="light"] .tx-theme-toggle .tx-theme-light { display: inline-flex; }
[data-theme="dark"] .tx-theme-toggle .tx-theme-dark { display: inline-flex; }

.tx-newbtn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px; font-weight: 600;
  color: #FFFFFF;
  background: var(--tx-fg-1);
  border-radius: var(--tx-radius);
  border: 1px solid var(--tx-fg-1);
  transition: background .15s;
}
.tx-newbtn:hover { background: var(--tx-fg-2); color: #FFFFFF; }
.tx-newbtn__plus { display: inline-flex; }

/* ============================================================
   4. Shell layout (3-col docs)
   ============================================================ */
.tx-shell {
  max-width: var(--tx-shell-max);
  margin: 0 auto;
  padding: 0 24px;
}
.tx-shell--three-col {
  display: grid;
  grid-template-columns: var(--tx-sidebar-w) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.tx-shell--two-col {
  display: grid;
  grid-template-columns: var(--tx-sidebar-w) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.tx-shell--full { padding-top: 0; padding-bottom: 0; }

.tx-main { min-width: 0; padding: 28px 0 60px; }
.tx-main--full { padding: 0 0 60px; }

/* ============================================================
   5. Sidebar (doc tree, shadcn dense, no card chrome)
   ============================================================ */
.tx-sidebar {
  position: sticky; top: var(--tx-header-h);
  align-self: start;
  height: calc(100vh - var(--tx-header-h));
  overflow-y: auto;
  padding: 24px 0 40px;
  border-right: none;
  scrollbar-width: thin;
  scrollbar-color: var(--tx-fg-faint) transparent;
}
.tx-sidebar::-webkit-scrollbar { width: 6px; }
.tx-sidebar::-webkit-scrollbar-track { background: transparent; }
.tx-sidebar::-webkit-scrollbar-thumb {
  background: var(--tx-fg-faint);
  border-radius: 3px;
}
.tx-sidebar__inner { padding-right: 12px; }

.tx-sidebar__group { margin-bottom: 14px; }
.tx-sidebar__heading {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx-fg-mut);
  margin-bottom: 4px;
  user-select: none;
}
.tx-sidebar__heading--clickable { cursor: pointer; }
.tx-sidebar__heading--clickable:hover { color: var(--tx-fg-1); }
.tx-sidebar__heading-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sidebar__chev { display: inline-flex; transition: transform .15s; color: var(--tx-fg-mut); }
.tx-sidebar__group.is-collapsed .tx-sidebar__chev { transform: rotate(-90deg); }
.tx-sidebar__group.is-collapsed .tx-sidebar__list--inner { display: none; }
.tx-sidebar__dot {
  width: 6px; height: 6px;
  background: var(--tx-brand);
  border-radius: 999px;
  display: inline-block;
}

.tx-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tx-sidebar__list li { margin: 0; }
.tx-sidebar__link {
  display: block;
  padding: 5px 8px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--tx-fg-2);
  border-radius: var(--tx-radius-sm);
  transition: color .12s, background .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-sidebar__link:hover { color: var(--tx-fg-1); background: var(--tx-bg-2); }
.tx-sidebar__link.is-active {
  color: var(--tx-fg);
  background: var(--tx-bg-2);
  font-weight: 600;
}
.tx-sidebar__link--cat { color: var(--tx-fg-mut); font-size: 12.5px; }

/* ============================================================
   6. Article (post / page common)
   ============================================================ */
.tx-article {
  max-width: 100%;
  padding: 0;
}
.tx-article--page { max-width: var(--tx-content-max); }

/* Breadcrumb */
.tx-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--tx-fg-mut);
  margin-bottom: 18px;
}
.tx-crumb__item { color: var(--tx-fg-mut); }
.tx-crumb__item:hover { color: var(--tx-fg-1); }
.tx-crumb__sep { color: var(--tx-fg-soft); user-select: none; }
.tx-crumb__current { color: var(--tx-fg-1); font-weight: 500; }

/* Article head */
.tx-article__head { margin-bottom: 28px; }
.tx-article__h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tx-fg);
  margin: 0 0 10px;
}
.tx-article__lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--tx-fg-3);
  margin: 0 0 14px;
  max-width: 680px;
}
.tx-article__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px;
  color: var(--tx-fg-mut);
}
.tx-article__meta-item { display: inline-flex; align-items: center; gap: 4px; }
.tx-article__meta-sep { color: var(--tx-fg-soft); }
.tx-article__meta-spacer { flex: 1; min-width: 16px; }
.tx-article__copy {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--tx-fg-2);
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tx-article__copy:hover { background: var(--tx-bg-2); }
.tx-article__copy-ic { display: inline-flex; }

.tx-chip {
  display: inline-flex; align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--tx-bg-2);
  color: var(--tx-fg-2);
  border-radius: var(--tx-radius-pill);
  border: 1px solid var(--tx-line);
}
.tx-chip:hover { color: var(--tx-fg); border-color: var(--tx-line-2); }

/* Article body — 3 col */
.tx-article__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--tx-toc-w);
  gap: 56px;
  align-items: start;
}
.tx-article--page .tx-article__body,
.tx-article--home { display: block; }

/* ============================================================
   7. Prose (markdown body)
   ============================================================ */
.tx-prose {
  max-width: var(--tx-content-max);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--tx-fg-1);
  word-break: break-word;
}
.tx-prose > :first-child { margin-top: 0; }
.tx-prose > :last-child { margin-bottom: 0; }

.tx-prose p { margin: 0 0 18px; }
.tx-prose strong { color: var(--tx-fg); font-weight: 600; }
.tx-prose em { font-style: italic; color: var(--tx-fg-2); }

.tx-prose a {
  color: var(--tx-fg-1);
  text-decoration: underline;
  text-decoration-color: var(--tx-link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.tx-prose a:hover {
  color: var(--tx-brand);
  text-decoration-color: var(--tx-brand);
}

.tx-prose h2,
.tx-prose h3,
.tx-prose h4 {
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--tx-fg);
  scroll-margin-top: 80px;
}
.tx-prose h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 40px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tx-line);
}
.tx-prose h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 32px 0 12px;
}
.tx-prose h4 {
  font-size: 16px;
  margin: 24px 0 10px;
}
.tx-prose h2 a, .tx-prose h3 a, .tx-prose h4 a {
  color: inherit; text-decoration: none;
}

.tx-prose ul, .tx-prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.tx-prose li { margin: 6px 0; }
.tx-prose li > ul, .tx-prose li > ol { margin: 6px 0; }
.tx-prose ul li::marker { color: var(--tx-fg-mut); }
.tx-prose ol li::marker { color: var(--tx-fg-mut); font-weight: 600; }

/* Inline code */
.tx-prose :not(pre) > code {
  font-family: var(--tx-mono);
  font-size: 0.86em;
  padding: 2px 5px;
  background: var(--tx-bg-code);
  color: var(--tx-fg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
}

/* Code block */
.tx-prose pre {
  position: relative;
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--tx-bg-pre);
  color: var(--tx-fg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  overflow-x: auto;
  font-family: var(--tx-mono);
  font-size: 13px;
  line-height: 1.65;
}
.tx-prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
[data-theme="dark"] .tx-prose pre {
  background: var(--tx-bg-2);
  border-color: var(--tx-line);
}

.tx-copy {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 9px;
  font-family: var(--tx-font);
  font-size: 11px;
  color: var(--tx-fg-mut);
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}
.tx-prose pre:hover .tx-copy { opacity: 1; }
.tx-copy:hover { color: var(--tx-fg-1); background: var(--tx-bg-2); }

/* Tables */
.tx-prose table {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  overflow: hidden;
}
.tx-prose thead { background: var(--tx-bg-1); }
.tx-prose th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--tx-fg);
  border-bottom: 1px solid var(--tx-line);
  font-size: 13px;
}
.tx-prose td {
  padding: 10px 14px;
  color: var(--tx-fg-2);
  border-bottom: 1px solid var(--tx-line-soft);
  vertical-align: top;
}
.tx-prose tr:last-child td { border-bottom: none; }
.tx-prose tbody tr:hover { background: var(--tx-bg-1); }

/* Blockquote */
.tx-prose blockquote {
  margin: 22px 0;
  padding: 12px 16px;
  background: var(--tx-bg-callout);
  border-left: 2px solid var(--tx-brand);
  color: var(--tx-fg-2);
  font-style: normal;
  border-radius: 0 var(--tx-radius) var(--tx-radius) 0;
}
.tx-prose blockquote p:last-child { margin-bottom: 0; }
.tx-prose blockquote strong { color: var(--tx-fg); }

.tx-prose hr {
  border: none;
  border-top: 1px solid var(--tx-line);
  margin: 32px 0;
}

/* ============================================================
   8. TOC (right column)
   ============================================================ */
.tx-toc {
  position: sticky; top: calc(var(--tx-header-h) + 24px);
  align-self: start;
  font-size: 13px;
}
.tx-toc__inner { padding: 0 0 0 4px; }
.tx-toc__head {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx-fg-mut);
  margin-bottom: 10px;
}
.tx-toc__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  border-left: 1px solid var(--tx-line);
}
.tx-toc__item { margin: 0; }
.tx-toc__item--lv2 a { padding-left: 12px; }
.tx-toc__item--lv3 a { padding-left: 24px; }
.tx-toc__item a {
  display: block;
  margin-left: -1px;
  padding: 5px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--tx-fg-mut);
  border-left: 1px solid transparent;
  transition: color .12s, border-color .12s;
}
.tx-toc__item a:hover { color: var(--tx-fg-1); }
.tx-toc__item a.is-active {
  color: var(--tx-brand);
  border-left-color: var(--tx-brand);
  font-weight: 500;
}

.tx-toc__cta {
  margin-top: 18px;
  padding: 14px;
  background: var(--tx-bg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}
.tx-toc__cta-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-fg);
  margin-bottom: 8px;
  line-height: 1.3;
}
.tx-toc__cta-text {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--tx-fg-mut);
}
.tx-toc__cta-btn {
  display: inline-flex; align-items: center;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--tx-fg-1);
  border-radius: var(--tx-radius);
  transition: background .15s;
}
.tx-toc__cta-btn:hover { background: var(--tx-fg-2); color: #FFFFFF; }

/* ============================================================
   9. Prev / Next nav
   ============================================================ */
.tx-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--tx-line);
}
.tx-prevnext__item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  color: var(--tx-fg-2);
  transition: border-color .15s, background .15s;
}
.tx-prevnext__item:hover {
  background: var(--tx-bg-1);
  border-color: var(--tx-line-2);
  color: var(--tx-fg);
}
.tx-prevnext__item--ph {
  background: transparent; border-color: transparent;
  cursor: default;
}
.tx-prevnext__next { text-align: right; align-items: flex-end; }
.tx-prevnext__lab {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  color: var(--tx-fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tx-prevnext__t {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx-fg);
  line-height: 1.4;
}

/* Related links block (post tail) */
.tx-related {
  margin-top: 32px;
  padding: 16px 18px;
  background: var(--tx-bg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}
.tx-related__head {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx-fg-mut);
  margin-bottom: 10px;
}
.tx-related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.tx-related__list li { margin: 0; }
.tx-related__list a {
  font-size: 13px;
  color: var(--tx-fg-2);
}
.tx-related__list a:hover { color: var(--tx-brand); }

/* ============================================================
   10. Home — Hero + sections
   ============================================================ */
.tx-article--home { padding: 0; max-width: 100%; }

.tx-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--tx-line);
}
.tx-hero__inner {
  max-width: var(--tx-content-max);
}
.tx-hero__eyebrow {
  display: inline-flex; align-items: center;
  height: 24px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tx-brand);
  background: var(--tx-brand-tint);
  border: 1px solid var(--tx-brand-line);
  border-radius: var(--tx-radius-pill);
  margin-bottom: 18px;
}
.tx-hero__title {
  margin: 0 0 14px;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tx-fg);
}
.tx-hero__lede {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--tx-fg-3);
  max-width: 640px;
}
.tx-hero__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px;
  color: var(--tx-fg-mut);
  margin-bottom: 24px;
}
.tx-hero__meta-sep { color: var(--tx-fg-soft); }

.tx-hero-search {
  position: relative;
  display: flex; align-items: center;
  max-width: 560px;
  margin-bottom: 18px;
}
.tx-hero-search__icon {
  position: absolute; left: 14px;
  display: inline-flex;
  color: var(--tx-fg-mut);
  pointer-events: none;
}
.tx-hero-search__input {
  width: 100%;
  height: 44px;
  padding: 0 70px 0 40px;
  font: inherit;
  font-size: 14px;
  background: var(--tx-bg);
  color: var(--tx-fg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  outline: none;
  transition: border-color .15s;
}
.tx-hero-search__input:focus { border-color: var(--tx-fg-2); }
.tx-hero-search__input::placeholder { color: var(--tx-fg-mut); }
.tx-hero-search__kbd {
  position: absolute; right: 12px;
  font-family: var(--tx-mono);
  font-size: 11px;
  color: var(--tx-fg-mut);
  background: var(--tx-bg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  padding: 1px 6px;
}

.tx-hero__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.tx-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--tx-radius);
  transition: background .15s, border-color .15s, color .15s;
}
.tx-btn--primary {
  background: var(--tx-fg-1);
  color: #FFFFFF;
  border: 1px solid var(--tx-fg-1);
}
.tx-btn--primary:hover { background: var(--tx-fg-2); color: #FFFFFF; }
.tx-btn--ghost {
  background: transparent;
  color: var(--tx-fg-1);
  border: 1px solid var(--tx-line-2);
}
.tx-btn--ghost:hover { background: var(--tx-bg-1); border-color: var(--tx-fg-2); color: var(--tx-fg); }

/* Sections */
.tx-section {
  max-width: var(--tx-content-max);
  margin: 0 auto;
  padding: 56px 0 12px;
}
.tx-section__head { margin-bottom: 28px; }
.tx-section__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--tx-fg);
}
.tx-section__sub {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--tx-fg-3);
  max-width: 600px;
}

/* Card grid */
.tx-cardgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tx-cardgrid--cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tx-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  color: var(--tx-fg-1);
  transition: border-color .15s, background .15s, transform .15s;
  position: relative;
}
.tx-card:hover {
  border-color: var(--tx-line-2);
  background: var(--tx-bg-1);
  color: var(--tx-fg);
}
.tx-card__head {
  display: flex; align-items: baseline; gap: 10px;
}
.tx-card__num {
  font-family: var(--tx-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--tx-brand);
  letter-spacing: 0.04em;
}
.tx-card__title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--tx-fg);
  letter-spacing: -0.005em;
}
.tx-card__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tx-fg-3);
}
.tx-card__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--tx-fg-mut);
}
.tx-card__list li {
  display: flex; gap: 6px; align-items: baseline;
  padding: 3px 0;
  border-top: 1px dashed var(--tx-line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-card__list li:first-child { border-top: 1px dashed var(--tx-line-soft); margin-top: 4px; padding-top: 6px; }
.tx-card__bullet { color: var(--tx-brand); font-weight: 600; }
.tx-card__more {
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx-brand);
  letter-spacing: 0.01em;
}
.tx-card__count {
  font-size: 11.5px;
  color: var(--tx-fg-mut);
  font-family: var(--tx-mono);
  letter-spacing: 0.02em;
}

/* Pill grid (more categories) */
.tx-pillgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tx-pill {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  color: var(--tx-fg-1);
  transition: border-color .15s, background .15s;
}
.tx-pill:hover { border-color: var(--tx-line-2); background: var(--tx-bg-1); color: var(--tx-fg); }
.tx-pill__title { font-size: 14px; font-weight: 600; color: var(--tx-fg); }
.tx-pill__desc { font-size: 12.5px; color: var(--tx-fg-mut); line-height: 1.5; }

/* Post list */
.tx-postlist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--tx-line);
}
.tx-postlist__item {
  padding: 16px 0;
  border-bottom: 1px solid var(--tx-line);
}
.tx-postlist__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tx-fg);
  margin-bottom: 6px;
}
.tx-postlist__title:hover { color: var(--tx-brand); }
.tx-postlist__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--tx-fg-mut);
}
.tx-postlist__date { font-family: var(--tx-mono); }
.tx-postlist__chip {
  display: inline-flex; align-items: center;
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--tx-fg-2);
  background: var(--tx-bg-2);
  border-radius: var(--tx-radius-pill);
}
.tx-postlist__desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tx-fg-3);
}

.tx-viewall {
  margin: 24px 0 0;
}
.tx-viewall__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tx-fg-1);
  text-decoration: none;
}
.tx-viewall__link:hover { color: var(--tx-brand); }

/* FAQ */
.tx-faq {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--tx-line);
}
.tx-faq__item {
  border-bottom: 1px solid var(--tx-line);
}
.tx-faq__q {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--tx-fg-1);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.tx-faq__q::-webkit-details-marker { display: none; }
.tx-faq__q-text { flex: 1; }
.tx-faq__q-icon {
  display: inline-flex;
  color: var(--tx-fg-mut);
  transition: transform .15s;
}
.tx-faq__item[open] .tx-faq__q-icon { transform: rotate(180deg); }
.tx-faq__a {
  padding: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--tx-fg-3);
}
.tx-faq__a p { margin: 0; }

/* ============================================================
   11. Pager
   ============================================================ */
.tx-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  margin: 36px 0 0;
}
.tx-pager__btn,
.tx-pager__num {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tx-fg-2);
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  transition: background .15s, border-color .15s, color .15s;
}
.tx-pager__btn:hover,
.tx-pager__num:hover {
  background: var(--tx-bg-2);
  border-color: var(--tx-line-2);
  color: var(--tx-fg);
}
.tx-pager__num.is-current {
  background: var(--tx-fg-1);
  color: #FFFFFF;
  border-color: var(--tx-fg-1);
}
.tx-pager__btn.is-disabled {
  color: var(--tx-fg-soft);
  background: transparent;
  cursor: not-allowed;
  border-color: var(--tx-line-soft);
}

/* ============================================================
   12. 404
   ============================================================ */
.tx-404 {
  max-width: 480px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}
.tx-404__code {
  font-family: var(--tx-mono);
  font-size: 56px;
  font-weight: 700;
  color: var(--tx-brand);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.tx-404__title {
  font-size: 24px;
  margin: 0 0 12px;
  color: var(--tx-fg);
}
.tx-404__body {
  font-size: 14px;
  color: var(--tx-fg-3);
  margin: 0 0 20px;
}
.tx-404__btns {
  display: inline-flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   13. Footer
   ============================================================ */
.tx-footer {
  margin-top: 80px;
  background: var(--tx-bg);
  border-top: 1px solid var(--tx-line);
}
.tx-footer__inner {
  max-width: var(--tx-shell-max);
  margin: 0 auto;
  padding: 48px 24px 28px;
}
.tx-footer__top {
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 48px;
  padding-bottom: 32px;
}
.tx-footer__brand { max-width: 280px; }
.tx-footer__logo {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--tx-fg);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}
.tx-footer__mark { display: inline-flex; }
.tx-footer__tag {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tx-fg-3);
}
.tx-footer__build {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--tx-fg-mut);
  font-family: var(--tx-mono);
}
.tx-footer__build-dot {
  width: 6px; height: 6px;
  background: var(--tx-brand);
  border-radius: 999px;
  display: inline-block;
}

.tx-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.tx-footer__col {}
.tx-footer__h {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx-fg-mut);
  margin-bottom: 12px;
}
.tx-footer__col ul { list-style: none; padding: 0; margin: 0; }
.tx-footer__col li { margin: 6px 0; }
.tx-footer__col a {
  font-size: 13px;
  color: var(--tx-fg-2);
}
.tx-footer__col a:hover { color: var(--tx-fg); }
.tx-footer__lang { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tx-footer__lang li { margin: 0; }
.tx-footer__lang a {
  font-size: 12px;
  color: var(--tx-fg-mut);
}
.tx-footer__lang a.is-current { color: var(--tx-brand); font-weight: 600; }

.tx-footer__bottom {
  padding-top: 24px;
  border-top: 1px solid var(--tx-line);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start;
  font-size: 11.5px;
  color: var(--tx-fg-mut);
  line-height: 1.55;
}
.tx-footer__rights { font-family: var(--tx-mono); letter-spacing: 0.01em; }
.tx-footer__risk { max-width: 700px; }

/* ============================================================
   14. Heading anchors (markdown auto-link)
   ============================================================ */
.tx-prose .heading-anchor {
  margin-left: 6px;
  color: var(--tx-fg-soft);
  font-weight: 400;
  opacity: 0;
  transition: opacity .15s, color .15s;
  text-decoration: none;
}
.tx-prose h2:hover .heading-anchor,
.tx-prose h3:hover .heading-anchor,
.tx-prose h4:hover .heading-anchor { opacity: 1; }
.tx-prose .heading-anchor:hover { color: var(--tx-brand); }

/* ============================================================
   15. Steps / callouts (used in download page + markdown)
   ============================================================ */
.tx-prose .tx-callout,
.tx-prose blockquote.tx-callout--info,
.tx-prose blockquote.tx-callout--warn,
.tx-prose blockquote.tx-callout--note { /* placeholders for callouts via blockquote */
}

/* Numbered step block */
.tx-prose ol.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}
.tx-prose ol.steps > li {
  position: relative;
  counter-increment: step;
  padding: 6px 0 6px 36px;
  margin: 14px 0;
}
.tx-prose ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 6px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tx-bg-2);
  color: var(--tx-fg-1);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  font-family: var(--tx-mono);
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   16. Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .tx-article__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .tx-toc { display: none; }
}

@media (max-width: 1024px) {
  .tx-cardgrid,
  .tx-cardgrid--cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tx-pillgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tx-footer__top { grid-template-columns: 1fr; gap: 32px; }
  .tx-footer__cols { grid-template-columns: repeat(2, 1fr); }
  .tx-newbtn { display: none; }
  .tx-search { width: 240px; }
}

@media (max-width: 860px) {
  .tx-mobile-only { display: inline-flex; }
  .tx-desktop-only { display: none; }
  .tx-topnav { display: none; }
  .tx-header__inner { padding: 0 16px; gap: 8px; }
  .tx-search { width: auto; flex: 1; max-width: none; margin-left: 0; }
  .tx-search__kbd { display: none; }

  .tx-shell { padding: 0 16px; }
  .tx-shell--three-col,
  .tx-shell--two-col { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .tx-sidebar {
    position: fixed; left: 0; top: var(--tx-header-h);
    width: 280px; height: calc(100vh - var(--tx-header-h));
    background: var(--tx-bg);
    border-right: 1px solid var(--tx-line);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    padding: 16px;
  }
  .tx-sidebar.is-open { transform: translateX(0); box-shadow: var(--tx-shadow-pop); }
  .tx-sidebar__inner { padding-right: 0; }

  .tx-main { padding: 24px 0 60px; }
  .tx-article__h1 { font-size: 26px; }
  .tx-hero { padding: 40px 0 32px; }
  .tx-hero__title { font-size: 32px; }
  .tx-hero__lede { font-size: 15px; }
  .tx-section { padding: 40px 0 4px; }
  .tx-section__title { font-size: 22px; }

  .tx-prevnext { grid-template-columns: 1fr; }
  .tx-prevnext__next { text-align: left; align-items: flex-start; }
}

@media (max-width: 540px) {
  .tx-cardgrid,
  .tx-cardgrid--cats,
  .tx-pillgrid { grid-template-columns: 1fr; }
  .tx-footer__cols { grid-template-columns: 1fr 1fr; }
  .tx-hero__title { font-size: 26px; }
  .tx-prose { font-size: 15px; }
  .tx-prose h2 { font-size: 20px; }
  .tx-prose h3 { font-size: 17px; }
  .tx-article__h1 { font-size: 24px; }
}

/* ============================================================
   17. Misc utility
   ============================================================ */
.tx-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tx-brand);
  outline-offset: 2px;
  border-radius: var(--tx-radius-sm);
}

/* End */
