/* Manual directory tabs */
.tabs { min-width: 0; }
.tabs [role="tablist"] { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; padding: 0 6px 8px 0; }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 12px;
  min-height: 48px; max-width: 100%; padding: 10px 18px;
  font-weight: var(--weight-bold); text-align: left;
  background: var(--clear); color: var(--text);
  border: var(--stroke) solid var(--clear); border-radius: var(--radius-ctl);
}
.tabs [role="tab"] svg { width: 20px; height: 20px; flex-shrink: 0; }
.tabs [role="tab"]:hover { background: var(--bg-status); color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-hard-sm); }
.tabs [role="tabpanel"] { min-width: 0; }
.feature-tabs { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 48px; align-items: stretch; margin-top: 40px; }
.feature-tabs [role="tablist"] { flex-direction: column; flex-wrap: nowrap; margin: 0; align-self: stretch; }
.feature-panel { display: flex; flex-direction: column; min-height: 360px; padding: 32px; background: var(--bg-panel); color: var(--text); border: var(--stroke) solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-hard-md); }
.feature-panel h3 { margin: 0 0 16px; font-weight: var(--weight-display); }
.feature-panel p { line-height: 1.85; color: var(--text-muted); }
.feature-panel pre { margin-top: auto; }
.chapter-link { font-weight: var(--weight-bold); text-underline-offset: 5px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; margin-block: 24px; background: var(--bg-panel-2); color: var(--text); border: var(--stroke-mid) solid var(--border); border-radius: var(--radius-card); }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-semibold); border-radius: var(--radius-ctl); }
.toc a:hover, .toc a[aria-current] { background: var(--bg-panel); color: var(--text); }
.toc-sticky { position: sticky; top: 12px; z-index: 10; }
.faq-item { background: var(--bg-panel); color: var(--text); border: var(--stroke-mid) solid var(--border); border-radius: var(--radius-card); margin-bottom: 14px; }
.faq-item summary { position: relative; list-style: none; padding: 20px 58px 20px 22px; font-weight: var(--weight-bold); min-height: 64px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; top: 17px; right: 22px; font-family: var(--font-mono); font-size: 22px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] { box-shadow: var(--shadow-hard-xs); }
.faq-answer { padding: 0 22px 22px; }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card { padding: 24px; background: var(--bg-panel); color: var(--text); border: var(--stroke) solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-hard-sm); }
.term-card h3 { margin: 12px 0; }
.term-alias { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.term-card p { margin-bottom: 16px; }
.badge, .tag {
  display: inline-block; max-width: 100%; padding: 3px 9px;
  background: var(--bg-panel-2); color: var(--text);
  border: var(--stroke-mid) solid var(--border); border-radius: var(--radius-ctl);
  font-size: var(--text-xs); line-height: 1.5; font-weight: var(--weight-bold);
  overflow-wrap: anywhere;
}
.badge-top { background: var(--border); color: var(--text-inverse); }
.badge-recommended { background: var(--bg-panel-2); color: var(--text); }
.badge-retired { background: var(--bg-status); color: var(--text-muted); border-style: dashed; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.client-card { background: var(--bg-panel); color: var(--text); border: var(--stroke) solid var(--border); border-radius: var(--radius-card); padding: 28px; box-shadow: var(--shadow-hard-md); }
.client-head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.client-head h3 { margin: 0; }
.client-icon { width: 56px; height: 56px; flex-shrink: 0; }
.client-meta { color: var(--text-muted); font-size: var(--text-sm); }
.client-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 20px; }
.client-secondary { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: var(--text-sm); }
.article-card { display: flex; flex-direction: column; padding: 28px; background: var(--bg-panel); color: var(--text); border: var(--stroke) solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-hard-md); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: var(--text-xs); color: var(--text-muted); }
.article-meta time { font-family: var(--font-mono); }
.article-card h3 { margin: 20px 0 14px; font-size: 22px; line-height: 1.4; }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }
.article-card p { color: var(--text-muted); }
.article-card .chapter-link { margin-top: auto; }
.callout { margin: 28px 0; padding: 22px 24px; background: var(--bg-panel-2); color: var(--text); border: var(--stroke-mid) solid var(--border); border-left-width: 6px; border-radius: var(--radius-ctl); }
.callout strong { display: block; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { background: var(--bg); color: var(--text); border-left-color: var(--warn); }
.callout-error { background: var(--bg-panel); color: var(--text); border-left-color: var(--error); }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; border: var(--stroke-mid) solid var(--border); border-radius: var(--radius-ctl); margin-block: 24px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); color: var(--text); text-align: left; }
.data-table th, .data-table td, .prose table th, .prose table td, .article-body table th, .article-body table td {
  min-width: 7em; padding: 14px 18px; vertical-align: top;
  overflow-wrap: normal; word-break: normal; border-bottom: var(--stroke-hair) solid var(--line-soft);
}
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel-2); color: var(--text); font-weight: var(--weight-bold); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; min-width: 0; border-collapse: collapse; margin-block: 24px;
  background: var(--bg-panel); color: var(--text);
}
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; }
.dl-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 25;
  display: inline-flex; align-items: center; gap: 12px;
  max-width: calc(100% - 48px); padding: 12px 18px;
  background: var(--border); color: var(--text-inverse);
  border: var(--stroke) solid var(--border); border-radius: var(--radius-ctl);
  box-shadow: var(--shadow-action); text-decoration: none; font-weight: var(--weight-bold);
}
.dl-fab svg { width: 22px; height: 22px; flex-shrink: 0; }
.dl-fab small { display: block; font-size: var(--text-xs); font-weight: var(--weight-normal); }
.article-download { margin-top: 56px; padding: 28px; background: var(--bg); color: var(--text); border: var(--stroke) solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-hard-md); }
.article-download h2 { margin-top: 0; font-size: 24px; }
.article-download .btn { margin-top: 8px; }

/* Static design catalogue */
.spec-stack { display: grid; gap: 32px; margin-top: 32px; }
.spec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.swatch { border: var(--stroke-mid) solid var(--border); border-radius: var(--radius-ctl); background: var(--bg-panel); color: var(--text); overflow: hidden; }
.swatch-color { min-height: 90px; border-bottom: var(--stroke-mid) solid var(--border); }
.swatch code { display: block; padding: 12px; font-size: 12px; }
.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-status { background: var(--bg-status); color: var(--text); }
.swatch-border { background: var(--border); color: var(--text-inverse); }
.swatch-line { background: var(--line-soft); color: var(--text); }
.swatch-accent { background: var(--accent); color: var(--text); }
.swatch-accent-dark { background: var(--accent-dark); color: var(--text-inverse); }
.swatch-text { background: var(--text); color: var(--text-inverse); }
.swatch-muted { background: var(--text-muted); color: var(--text-inverse); }
.swatch-inverse { background: var(--text-inverse); color: var(--text); }
.swatch-success { background: var(--success); color: var(--text-inverse); }
.swatch-warn { background: var(--warn); color: var(--text); }
.swatch-error { background: var(--error); color: var(--text-inverse); }
.swatch-veil { background: var(--veil); color: var(--text); }
.swatch-clear { background: var(--clear); color: var(--text); }
.preview-static-menu { display: none; }
@media (max-width: 900px) {
  .feature-tabs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .feature-tabs [role="tablist"] { flex-direction: row; overflow-x: auto; padding-bottom: 12px; }
  .feature-tabs [role="tab"] { flex-shrink: 0; border-radius: var(--radius-round); }
}
@media (max-width: 640px) {
  .feature-panel, .client-card, .article-card { padding: 20px; }
  .tabs:not(.feature-tabs) [role="tablist"] { flex-wrap: nowrap; overflow-x: auto; }
  .tabs [role="tab"] { flex-shrink: 0; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-fab { right: 16px; bottom: 16px; max-width: calc(100% - 32px); padding: 10px 14px; }
  .article-download { padding: 20px; }
}
@media (max-width: 1000px) {
  .preview-static-menu { display: block; }
  .preview-static-menu > summary { display: flex; }
  .preview-static-menu[open] .mobile-drawer { display: block; }
}