.tabs { min-width: 0; }
.tablist, [role="tablist"].tablist {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 24px;
  overscroll-behavior-x: contain;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.tab:hover { background: var(--bg-panel); color: var(--text); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabpanel { min-width: 0; }
.features-tabs { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.features-tabs .tablist { display: flex; flex-direction: column; align-items: stretch; overflow: visible; padding: 0; gap: 12px; margin-bottom: 0; }
.features-tabs .tab {
  position: relative;
  justify-content: flex-start;
  min-height: 52px;
  padding: 4px 4px 4px 24px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--weight-heavy);
  text-align: left;
}
.features-tabs .tab[aria-selected="true"] { background: var(--bg); color: var(--text); }
.features-tabs .tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: var(--r-round);
  background: var(--accent);
  color: var(--text);
}
.settings-path { margin: 0 0 24px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); overflow-wrap: anywhere; }
.field-row, .badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-chip {
  display: inline-block;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--ink-border);
  border-radius: var(--r-pill);
  background: var(--ink-raise);
  color: var(--ink-text);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.toc {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-x: contain;
}
.toc a { flex-shrink: 0; padding: 8px 12px; min-height: 44px; border-radius: var(--r-sm); color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.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 { padding: 0 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); }
.faq-item + .faq-item { margin-top: 12px; }
.faq-item summary { position: relative; min-height: 64px; padding: 20px 32px 20px 0; cursor: pointer; list-style: none; font-weight: var(--weight-bold); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: 18px; font-family: var(--font-mono); font-size: 20px; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 24px; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { border-top: 1px solid var(--border); padding-top: 24px; padding-bottom: 28px; }
.term-card h3 { margin: 12px 0; }
.term-card p { color: var(--text-muted); }
.term-card dt { font-family: var(--font-display); font-size: var(--size-h3); font-weight: var(--weight-bold); }
.term-card dd { margin: 12px 0 0; color: var(--text-muted); }
.client-card { position: relative; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); color: var(--text); }
.client-card--primary { border-color: var(--text); }
.client-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.client-head h3 { margin: 0; }
.client-meta { color: var(--text-muted); font-size: var(--size-small); }
.client-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.client-notes { margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.badge, .tag {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
  vertical-align: middle;
}
.badge--first, .badge--recommended { border-color: var(--accent); background: var(--accent); color: var(--text); }
.badge--retired { background: var(--bg-panel-2); color: var(--text-muted); }
.article-card { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; padding-bottom: 28px; border-top: 1px solid var(--border); }
.article-card h3 { margin: 0; font-size: var(--size-h3); }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }
.article-card p { margin: 0; color: var(--text-muted); }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.article-more { margin-top: auto; font-size: 14px; font-weight: var(--weight-bold); }
.callout {
  padding: 24px 28px;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
}
.callout strong { display: block; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout--note { border-left-color: var(--accent-dark); }
.callout--warning { border-left-color: var(--warn); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg); color: var(--text); }
.data-table :where(th, td), .prose table :where(th, td) {
  min-width: 7em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-semibold); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: var(--bg);
  color: var(--text);
}
.prose table code, .data-table code { overflow-wrap: anywhere; }
.download-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px;
  margin-top: 56px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg-panel);
  color: var(--text);
}
.download-guide h2 { margin: 0 0 12px; font-size: var(--size-h3); }
.download-guide p { margin: 0; color: var(--text-muted); }
.download-guide > * { min-width: 0; }
.download-guide .pill-btn { flex-shrink: 0; }
.dl-fab {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-float);
  font-size: var(--size-small);
  font-weight: var(--weight-bold);
  line-height: 20px;
  text-decoration: none;
  transition: background-color var(--ease);
}
.dl-fab svg { width: 15px; height: 15px; flex-shrink: 0; }
.dl-fab:hover { background: var(--bg-panel); color: var(--text); }
.cfg-win { position: relative; z-index: 1; margin: 0; text-align: left; background: var(--ink); color: var(--ink-text); border: 1px solid var(--ink-border); border-radius: var(--r-xl); box-shadow: inset 0 1px 0 var(--ink-hi); overflow: hidden; }
.cfg-bar { position: relative; display: flex; align-items: center; height: 38px; padding-left: 18px; border-bottom: 1px solid var(--ink-line); }
.cfg-lights { display: flex; gap: 7px; }
.cfg-lights i { display: block; width: 10px; height: 10px; flex-shrink: 0; border-radius: var(--r-round); background: var(--ink-dot); color: var(--ink-text); }
.cfg-title { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: 12.5px; line-height: 37px; color: var(--ink-muted); white-space: nowrap; }
.cfg-margin-label { display: flex; align-items: center; gap: 7px; margin-left: auto; width: var(--notes-w); padding-left: 22px; font-size: 12px; color: var(--ink-muted); }
.cfg-margin-label svg { width: 13px; height: 13px; }
.cfg-body { display: grid; grid-template-columns: var(--outline-w) minmax(0, 1fr); }
.cfg-outline { padding: 16px 12px 20px; border-right: 1px solid var(--ink-line); background: var(--ink-raise); color: var(--ink-muted); }
.cfg-outline-head { padding: 0 10px 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; }
.cfg-outline-list { margin: 0; padding: 0; list-style: none; }
.cfg-node { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
.cfg-node svg { width: 15px; height: 15px; flex-shrink: 0; }
.cfg-node-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-round); }
.cfg-node.is-current { background: var(--ink-row); color: var(--ink-text); }
.cfg-node.is-current .cfg-node-dot { background: var(--accent); color: var(--ink-text); }
.cfg-sub { margin: 2px 0 4px; padding-left: 49px; list-style: none; font-family: var(--font-mono); font-size: 12px; line-height: 24px; color: var(--ink-muted); }
.cfg-sub li { position: relative; }
.cfg-sub li::before { content: ""; position: absolute; left: -12px; top: 0; bottom: 0; border-left: 1px solid var(--ink-line); }
.cfg-editor { position: relative; min-width: 0; overflow: hidden; padding-top: 8px; padding-bottom: 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: var(--lh-code); }
.cfg-editor::after { content: ""; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: var(--notes-w); border-left: 1px solid var(--ink-line); background: var(--ink-raise); color: var(--ink-text); }
.ln { position: relative; z-index: 1; display: grid; grid-template-columns: var(--gut) auto minmax(0, 1fr) var(--notes-w); grid-template-rows: var(--lh-code); align-items: start; height: var(--lh-code); }
.ln-no { padding-right: 18px; text-align: right; font-size: 12px; color: var(--ink-muted); user-select: none; }
.ln-code { font: inherit; white-space: pre; overflow-wrap: normal; color: var(--ink-key); }
.ln.is-caret { background: var(--ink-row); color: var(--ink-text); }
.k { color: var(--ink-key); }
.cfg-editor .s, pre .s { color: var(--accent); }
.p { color: var(--ink-muted); }
.n { color: var(--ink-text); }
.caret { display: inline-block; width: 2px; height: 15px; margin-left: 2px; vertical-align: -3px; background: var(--ink-text); color: var(--ink); }
.ln-lead { align-self: start; height: 0; margin: 10px 0 0 16px; border-top: 1px dashed var(--ink-lead); }
.ln-note { display: flex; align-items: flex-start; padding-right: 20px; font-family: var(--font-body); }
.ln-note::before { content: ""; flex-shrink: 0; width: 16px; height: 0; margin-top: 10px; border-top: 1px dashed var(--ink-lead); }
.note-dot { flex-shrink: 0; width: 7px; height: 7px; margin: 6.5px 9px 0 6px; border-radius: var(--r-round); border: 1px solid var(--ink-muted); }
.note-dot--warn { border-color: var(--warn); background: var(--warn); color: var(--ink); }
.note-body { min-width: 0; }
.note-text { display: block; font-size: 12.5px; line-height: 20px; color: var(--ink-text); }
.note-ref { display: block; margin-top: 1px; font-family: var(--font-mono); font-size: 11px; line-height: 16px; color: var(--ink-muted); }
.cfg-card { display: none; }
.cfg-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; padding: 5px 20px; border-top: 1px solid var(--ink-line); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-muted); }
.preview-section { padding-top: 80px; padding-bottom: 80px; border-top: 1px solid var(--border); }
.preview-section > h2 { margin-top: 0; }
.palette-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { display: flex; align-items: flex-end; min-height: 108px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 11px; }
.swatch span { padding: 3px 6px; border-radius: var(--r-sm); background: var(--bg); color: var(--text); }
.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(--text); }
.swatch--accent-dark { background: var(--accent-dark); color: var(--bg); }
.swatch--mark { background: var(--accent-mark); color: var(--text); }
.swatch--text { background: var(--text); color: var(--bg); }
.swatch--muted { background: var(--text-muted); color: var(--bg); }
.swatch--success { background: var(--success); color: var(--text); }
.swatch--warn { background: var(--warn); color: var(--text); }
.swatch--error { background: var(--error); color: var(--text); }
.swatch--ink { background: var(--ink); color: var(--bg); }
.swatch--raise { background: var(--ink-raise); color: var(--bg); }
.swatch--ink-border { background: var(--ink-border); color: var(--bg); }
.swatch--line { background: var(--ink-line); color: var(--bg); }
.swatch--hi { background: linear-gradient(var(--ink-hi), var(--ink-hi)), var(--ink); color: var(--bg); }
.swatch--row { background: linear-gradient(var(--ink-row), var(--ink-row)), var(--ink); color: var(--bg); }
.swatch--lead { background: linear-gradient(var(--ink-lead), var(--ink-lead)), var(--ink); color: var(--bg); }
.swatch--ink-text { background: var(--ink-text); color: var(--text); }
.swatch--key { background: var(--ink-key); color: var(--text); }
.swatch--punct { background: var(--ink-punct); color: var(--bg); }
.swatch--num { background: var(--ink-num); color: var(--bg); }
.swatch--ink-muted { background: var(--ink-muted); color: var(--text); }
.swatch--dot { background: var(--ink-dot); color: var(--bg); }
.swatch--hover { background: var(--btn-hover); color: var(--bg); }
.swatch--mask { background: var(--mask); color: var(--bg); }
.swatch--clear { background: var(--clear); color: var(--text); }
.swatch--veil { background: var(--veil); color: var(--text); }
.type-display { margin-top: 0; font-size: var(--size-h1); font-weight: var(--weight-display); line-height: 1.15; }
.type-mono { font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
@media (max-width: 940px) {
  .features-tabs { gap: 32px; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); }
}
@media (max-width: 768px) {
  .features-tabs { display: block; }
  .features-tabs .tablist { flex-direction: row; overflow-x: auto; gap: 8px; padding: 4px; margin-bottom: 20px; }
  .features-tabs .tab { padding: 9px 16px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 15px; }
  .features-tabs .tab[aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
  .features-tabs .tab[aria-selected="true"]::before { position: static; width: 6px; height: 6px; flex-shrink: 0; }
  .cfg-win { border-radius: var(--r-lg); }
  .cfg-title { font-size: 11.5px; }
  .cfg-margin-label, .cfg-outline { display: none; }
  .cfg-body { grid-template-columns: minmax(0, 1fr); }
  .cfg-editor { overflow-x: auto; padding-right: 16px; }
  .cfg-editor::after { display: none; }
  .ln { grid-template-columns: var(--gut) auto; width: max-content; min-width: 100%; }
  .ln-no { padding-right: 12px; }
  .ln-lead, .ln-note { display: none; }
  .cfg-card { display: flex; align-items: flex-start; margin: 0 14px 14px; padding: 14px 16px 14px 10px; border: 1px solid var(--ink-line); border-radius: var(--r-md); background: var(--ink-raise); color: var(--ink-text); }
  .cfg-status { padding-inline: 16px; }
  .cfg-status-aside { display: none; }
  .palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .download-guide { align-items: flex-start; flex-direction: column; padding: 24px; gap: 20px; }
  .client-card { padding: 24px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-section { padding-top: 56px; padding-bottom: 56px; }
}