.tabs { min-width: 0; }
.tablist, [role="tablist"] {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 12px;
  overscroll-behavior-inline: contain;
}
[role="tab"] {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 15px;
  text-align: left;
}
[role="tab"]:hover { color: var(--accent); border-color: var(--accent); }
[role="tab"][aria-selected="true"] {
  background: var(--accent);
  color: var(--on-dark);
  border-color: var(--accent);
}
[role="tabpanel"] { min-width: 0; scroll-margin-top: 24px; }
.feature-gallery {
  display: grid;
  grid-template-columns: minmax(0, 38fr) minmax(0, 62fr);
  align-items: stretch;
  gap: 48px;
}
.feature-gallery [role="tablist"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  overflow: visible;
  padding-top: 24px;
  padding-bottom: 24px;
}
.feature-gallery [role="tab"] {
  position: relative;
  padding: 16px 24px;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 32px;
  font-weight: var(--weight-normal);
  line-height: 1.3;
  white-space: normal;
}
.feature-gallery [role="tab"][aria-selected="true"] { background: var(--bg); color: var(--text); }
.feature-gallery [role="tab"][aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--accent);
  color: var(--on-dark);
}
.feature-panel {
  padding: 48px;
  border-radius: var(--r-canvas);
  background: var(--bg-panel);
  color: var(--text);
}
.feature-panel h3 { margin-top: 24px; margin-bottom: 18px; font-size: 22px; }
.feature-panel p { color: var(--text-muted); line-height: 1.85; }
.feature-panel pre { margin-top: 24px; margin-bottom: 24px; }
.feature-geometry { display: block; width: 160px; height: 160px; }
.feature-link { text-decoration: none; }
.feature-link:hover { text-decoration: underline; }
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.toc a:hover, .toc a[aria-current="location"] { color: var(--accent); }
.toc-sticky { position: sticky; top: 0; z-index: 10; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  position: relative;
  min-height: 64px;
  padding: 20px 36px 20px 0;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 20px; color: var(--accent); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 24px; color: var(--text-muted); line-height: 1.85; }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card, .client-card, .article-card {
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
}
.term-card h3 { margin: 12px 0 18px; font-size: 24px; }
.term-card p { color: var(--text-muted); }
.term-card code { font-size: 12px; }
.term-category, .article-meta { color: var(--text-muted); font-size: 12px; }
.client-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.client-head > img { width: 56px; height: 56px; flex-shrink: 0; }
.client-head h3 { margin: 0 0 8px; font-family: var(--font-mono); font-size: 24px; }
.client-head p { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.client-card > p { color: var(--text-muted); }
.client-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.client-detail { margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge, .tag {
  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);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.badge-primary { border-color: var(--accent); background: var(--accent); color: var(--on-dark); }
.badge-recommended { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.badge-retired { background: var(--bg-panel-2); color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; border-radius: var(--r-circle); background: var(--success); color: var(--text); flex-shrink: 0; }
.status-dot.warn { background: var(--warn); color: var(--text); }
.status-dot.error { background: var(--error); color: var(--on-dark); }
.article-card { display: flex; flex-direction: column; gap: 18px; }
.article-card h3 { margin: 0; font-size: 22px; line-height: 1.45; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.85; }
.article-card .article-link { margin-top: auto; align-self: flex-start; font-size: 14px; text-decoration: none; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.callout {
  margin: 28px 0;
  padding: 24px 28px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  background: var(--bg-panel);
  color: var(--text);
  line-height: 1.85;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { margin-bottom: 8px; font-weight: var(--weight-medium); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.data-table caption { text-align: left; padding-bottom: 16px; color: var(--text-muted); }
.data-table :where(th, td), .prose table :where(th, td), .article-body table :where(th, td) {
  min-width: 7em;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th, .article-body table th {
  background: var(--bg-panel);
  color: var(--text);
  font-weight: var(--weight-medium);
}
.data-table td, .prose table td, .article-body table td { background: var(--bg); color: var(--text); }
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.prose table, .article-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
}
.download-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 28px 32px;
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}
.download-note h3 { margin: 0 0 10px; font-size: 22px; }
.download-note p { margin: 0; font-size: 14px; color: var(--text-muted); }
.download-note .button { flex-shrink: 0; }
.dl-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 40px);
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-dark);
  font-size: 14px;
  text-decoration: none;
}
.dl-fab:hover { background: var(--accent-dark); color: var(--on-dark); }
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.preview-fab { position: static; }
.preview-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.swatch { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-window); overflow: hidden; background: var(--bg); color: var(--text); }
.swatch-sample { height: 70px; background: var(--bg); color: var(--text); }
.swatch-label { display: block; padding: 12px; font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.sw-bg { background: var(--bg); color: var(--text); }
.sw-panel { background: var(--bg-panel); color: var(--text); }
.sw-panel-2 { background: var(--bg-panel-2); color: var(--text); }
.sw-border { background: var(--border); color: var(--text); }
.sw-accent { background: var(--accent); color: var(--on-dark); }
.sw-accent-dark { background: var(--accent-dark); color: var(--on-dark); }
.sw-text { background: var(--text); color: var(--on-dark); }
.sw-muted { background: var(--text-muted); color: var(--on-dark); }
.sw-success { background: var(--success); color: var(--text); }
.sw-warn { background: var(--warn); color: var(--text); }
.sw-error { background: var(--error); color: var(--on-dark); }
.sw-fog-base { background: var(--fog-base); color: var(--text); }
.sw-sand { background: var(--fog-sand-solid); color: var(--text); }
.sw-blue { background: var(--fog-blue-solid); color: var(--text); }
.sw-sage { background: var(--fog-sage-solid); color: var(--text); }
.sw-sand-alpha { background: var(--fog-sand); color: var(--text); }
.sw-blue-alpha { background: var(--fog-blue); color: var(--text); }
.sw-sage-alpha { background: var(--fog-sage); color: var(--text); }
.sw-haze { background: var(--fog-haze); color: var(--text); }
.sw-clear { background: var(--fog-clear); color: var(--text); }
.sw-veil { background: var(--veil); color: var(--text); }
.sw-ui-bg { background: var(--ui-bg); color: var(--ui-text); }
.sw-ui-line { background: var(--ui-line); color: var(--ui-text); }
.sw-ui-bar { background: var(--ui-bar); color: var(--ui-text); }
.sw-ui-field { background: var(--ui-field); color: var(--ui-text); }
.sw-ui-text { background: var(--ui-text); color: var(--text); }
.sw-ui-muted { background: var(--ui-muted); color: var(--text); }
.sw-ui-dim { background: var(--ui-dim); color: var(--on-dark); }
.sw-ui-off { background: var(--ui-off); color: var(--ui-text); }
.sw-ui-dot { background: var(--ui-dot); color: var(--ui-text); }
.preview-type > * { margin-top: 24px; margin-bottom: 24px; }
.preview-type .type-h1 { font-size: clamp(34px, 3.3vw, 48px); font-weight: var(--weight-normal); line-height: 1.1; }
.preview-state { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.preview-state small { color: var(--text-muted); }
.preview-section-intro { max-width: 680px; color: var(--text-muted); margin-bottom: 40px; }
@media (max-width: 900px) {
  .feature-gallery { gap: 24px; }
  .feature-panel { padding: 32px; }
  .feature-gallery [role="tab"] { font-size: 26px; }
}
@media (max-width: 768px) {
  .feature-gallery { grid-template-columns: minmax(0, 1fr); }
  .feature-gallery [role="tablist"] { flex-direction: row; overflow-x: auto; padding-top: 0; padding-bottom: 12px; gap: 12px; }
  .feature-gallery [role="tab"] { font-size: 18px; white-space: nowrap; padding: 12px 16px; }
  .feature-gallery [role="tab"][aria-selected="true"]::before { top: auto; bottom: 0; left: 16px; right: 16px; width: auto; height: 2px; }
  .preview-type .type-h1 { font-size: clamp(24px, 7.4vw, 30px); }
}
@media (max-width: 640px) {
  .term-card, .client-card, .article-card, .feature-panel { padding: 24px; }
  .preview-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-note { flex-direction: column; align-items: flex-start; padding: 24px; }
  .callout { padding: 20px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
}