.tab-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.tab-list [role="tab"] {
  position: relative;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}
.tab-list [role="tab"][aria-selected="true"] { color: var(--text); background: var(--bg-panel); }
.tab-list [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--grad-accent);
}
.tab-panel { min-width: 0; }
.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: visible;
  max-width: 100%;
  padding: 12px;
  margin-bottom: 40px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  scrollbar-width: thin;
}
.toc a { flex-shrink: 0; display: flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: var(--r-pill); font-size: var(--size-small); }
.toc a:hover, .toc a[aria-current] { background: var(--bg-panel); color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 24px 40px 24px 0; cursor: pointer; list-style: none; font-size: 18px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 6px; top: 22px; font-size: var(--size-h3); color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 28px; max-width: 760px; line-height: var(--leading-body); color: var(--text-muted); }
.faq-answer p + p { margin-top: 16px; }
.term-card, .client-card, .article-card { min-width: 0; padding: var(--space-card); background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-bubble); box-shadow: var(--shadow-card); }
.term-card dt { font-size: var(--size-h3); margin-bottom: 12px; }
.term-card dd { margin: 0; color: var(--text-muted); line-height: var(--leading-body); }
.term-card .term-category { display: block; margin-bottom: 16px; font-size: var(--size-caption); color: var(--text-muted); }
.client-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.client-head h3 { margin: 0; }
.client-version { font-family: var(--font-mono); font-size: var(--size-small); color: var(--text-muted); }
.client-card p { color: var(--text-muted); margin-bottom: 24px; }
.client-card .actions { margin-top: 24px; }
.client-card.is-primary { border-color: var(--accent); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text);
  font-size: var(--size-caption);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}
.badge-primary, .badge-recommended { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.badge-retired { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border); }
.badge-node { background: var(--cyan); color: var(--ink); border-color: var(--cyan); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--text-muted); font-size: var(--size-caption); }
.article-card h3 { font-size: 22px; line-height: 1.4; }
.article-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.article-card p { color: var(--text-muted); font-size: var(--size-small); line-height: var(--leading-body); }
.article-link { display: inline-block; margin-top: 24px; font-size: var(--size-small); text-decoration: underline; text-underline-offset: 4px; }
.callout {
  margin: 24px 0;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
  line-height: var(--leading-body);
}
.callout strong { display: block; margin-bottom: 8px; }
.callout-warning { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--size-small); text-align: left; }
.data-table th, .data-table td, .prose table th, .prose table td {
  min-width: 7em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-medium); }
.data-table td, .prose table td { background: var(--bg); color: var(--text); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: var(--size-small);
}
.dl-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 40px);
  padding: 14px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-card);
  font-size: var(--size-small);
}
.dl-fab svg { width: 20px; height: 20px; }
.dl-fab small { display: block; color: var(--text-muted); font-size: var(--size-caption); }
.article-download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg-panel);
  color: var(--text);
}
.article-download h2 { font-size: var(--size-h3); margin: 0 0 10px; }
.article-download p { margin: 0; color: var(--text-muted); }
.feature-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: start; }
.capability-map { position: relative; min-height: 540px; padding: 48px 32px; overflow: hidden; }
.map-caption { font-size: var(--size-small); margin: 0; color: var(--on-dark); }
.map-canvas { position: relative; height: 400px; margin-top: 28px; }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-lines path { stroke: var(--cyan); stroke-width: 1.5; fill: none; }
.map-lines .map-pink { stroke: var(--accent); }
.map-lines .map-lime { stroke: var(--lime); }
.map-lines circle { fill: var(--on-dark); }
.map-node {
  position: absolute;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--bg);
  color: var(--text);
  font-size: var(--size-small);
  box-shadow: var(--shadow-chip);
}
.map-node.is-active { border-color: var(--accent); outline: 1px solid var(--accent); }
.map-node .badge { position: absolute; right: -8px; top: -14px; }
.map-protocol { top: 20px; left: 2%; }
.map-xray { top: 40px; right: 2%; }
.map-subscription { top: 142px; left: 12%; }
.map-routing { top: 220px; right: 0; font-family: var(--font-mono); }
.map-proxy { top: 310px; left: 1%; }
.map-tun { top: 330px; right: 4%; }
.feature-tabs { border-top: 1px solid var(--border); }
.feature-tab { display: block; width: 100%; padding: 26px 36px 26px 0; position: relative; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); text-align: left; font-size: 22px; }
.feature-tab::after { content: "+"; position: absolute; right: 4px; }
.feature-tab[aria-selected="true"] { border-top: 1px solid var(--accent); }
.feature-tab[aria-selected="true"]::after { content: "−"; }
.feature-copy { padding: 0 0 28px; color: var(--text-muted); line-height: 1.8; }
.terminal { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--ink); color: var(--on-dark); box-shadow: var(--shadow-card); }
.terminal-bar { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 12px 20px; border-bottom: 1px solid var(--dot); font-size: var(--size-caption); font-family: var(--font-mono); }
.terminal-bar i { width: 8px; height: 8px; border-radius: var(--r-circle); background: var(--error); flex-shrink: 0; }
.terminal-bar i:nth-child(2) { background: var(--warn); }
.terminal-bar i:nth-child(3) { background: var(--success); }
.terminal-bar span { margin-left: 8px; }
.terminal pre { margin: 0; border-radius: 0; }
.preview-section { padding-top: 72px; padding-bottom: 72px; border-top: 1px solid var(--border); }
.preview-label { font-family: var(--font-mono); font-size: var(--size-caption); color: var(--text-muted); margin-bottom: 16px; }
.swatch-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.swatch { margin: 0; min-width: 0; }
.swatch figcaption { padding-top: 10px; font-family: var(--font-mono); font-size: var(--size-caption); overflow-wrap: anywhere; }
.swatch-color { height: 88px; border-radius: var(--r-field); border: 1px solid var(--border); }
.swatch-bg { background: var(--bg); color: var(--text); }
.swatch-panel { background: var(--bg-panel); color: var(--text); }
.swatch-panel2 { background: var(--bg-panel-2); color: var(--text); }
.swatch-border { background: var(--border); color: var(--text); }
.swatch-accent { background: var(--accent); color: var(--ink); }
.swatch-accent-dark { background: var(--accent-dark); color: var(--on-dark); }
.swatch-coral { background: var(--coral); color: var(--ink); }
.swatch-lime { background: var(--lime); color: var(--ink); }
.swatch-cyan { background: var(--cyan); color: var(--ink); }
.swatch-ink { background: var(--ink); color: var(--on-dark); }
.swatch-dot { background: var(--dot); color: var(--on-dark); }
.swatch-text { background: var(--text); color: var(--on-dark); }
.swatch-muted { background: var(--text-muted); color: var(--on-dark); }
.swatch-success { background: var(--success); color: var(--ink); }
.swatch-warn { background: var(--warn); color: var(--ink); }
.swatch-error { background: var(--error); color: var(--ink); }
.swatch-gradient { background: var(--grad-accent); color: var(--ink); }
.preview-stack { display: grid; gap: 24px; }
.preview-footer { margin-top: 72px; }
@media (max-width: 1100px) {
  .feature-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 640px) {
  .tab-list { gap: 4px; padding-inline: 0; }
  .tab-list [role="tab"] { padding-inline: 14px; font-size: var(--size-small); }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capability-map { padding: 28px 16px; min-height: 520px; }
  .map-node { padding: 12px 10px; font-size: var(--size-caption); }
  .map-protocol { left: 0; }
  .map-subscription { left: 2%; }
  .map-routing { right: 0; }
  .map-tun { right: 0; }
  .feature-tab { font-size: 20px; }
  .article-download { padding: 24px; }
  .dl-fab { right: 16px; bottom: 16px; padding: 12px 18px; }
  .callout { padding: 20px; }
}