.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 3px 12px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}
.badge:hover { border-color: var(--rule); }
.badge__dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: var(--r-circle);
  background: var(--success);
}
.badge__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--r-circle);
  border: 1px solid var(--success);
  opacity: .3;
}
.badge__text b { color: var(--text); }
.badge__arrow { width: 13px; height: 13px; color: var(--text-muted); }
.fact-pills, .protocols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.fact-pill, .protocol {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.protocol { font-family: var(--font-mono); }
.fact-pill strong { color: var(--text); }
.devices {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.devices__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.devices__link:hover { color: var(--text); background: var(--bg-panel); }
.devices__link svg { width: 16px; height: 16px; }
.devices__sep { width: 1px; height: 14px; margin: 0 8px; background: var(--border); }
.devices__store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}
.devices__store svg { width: 12px; height: 12px; }

.rig {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-rig);
}
.rig__tabs {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: nowrap;
}
.rig__tab {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--clear);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.rig__tab--on { background: var(--bg-panel); color: var(--text); border-color: var(--border); }
.rig__more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.rig__more svg { width: 13px; height: 13px; }
.rig__body { display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); height: 330px; }
.rig__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 24px;
  background-color: var(--bg-panel);
  color: var(--text);
  background-image: radial-gradient(circle, var(--dot) 1px, var(--clear) 1.3px);
  background-size: 14px 14px;
  background-position: 7px 7px;
}
.node {
  position: relative;
  width: min(392px, 100%);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.node__mark {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-xs);
}
.node__mark--round { border-radius: var(--r-circle); }
.node__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.node__kicker { font-size: 11px; color: var(--text-muted); }
.node__value { font-family: var(--font-mono); font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.node__tail { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.node--hit { min-height: 56px; border-color: var(--accent-edge); box-shadow: 0 1px 2px var(--shadow-hair); }
.node--hit::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: var(--r) 0 0 var(--r);
  background: var(--accent);
}
.node--hit .node__mark { border: 0; background: var(--accent); border-radius: var(--r-circle); }
.node--hit .node__kicker em { font-style: normal; color: var(--accent-dark); }
.tag-proxy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-xs);
  background: var(--accent-wash);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 11.5px;
  flex-shrink: 0;
}
.node--skip { opacity: .5; }
.node--end {
  width: auto;
  min-height: 34px;
  padding: 5px 16px;
  border-radius: var(--r-pill);
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.direct { display: inline-flex; align-items: center; gap: 6px; }
.direct::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-circle); background: var(--success); flex-shrink: 0; }
.node__note { font-family: var(--font-body); font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.wire { position: relative; width: 9px; height: 20px; flex-shrink: 0; }
.wire::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 2px; width: 1px; background: var(--rule); }
.wire::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transform: rotate(45deg);
}
.wire--idle::before { width: 0; background: none; border-left: 1px dashed var(--rule); }
.rig__src { display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0; }
.src__head {
  min-height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.src__head svg { width: 14px; height: 14px; color: var(--text-muted); }
.src__head small { margin-left: auto; font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }
.conf { padding-top: 12px; overflow-x: auto; max-width: 100%; }
.ln { display: flex; align-items: center; height: 28px; padding-right: 16px; font-family: var(--font-mono); font-size: 13px; white-space: pre; min-width: max-content; }
.ln__gut { width: 30px; flex-shrink: 0; display: flex; justify-content: center; }
.ln--hit { background: var(--bg-panel); color: var(--text); }
.ln--hit .ln__gut::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-circle); background: var(--accent); }
.kw { color: var(--accent-dark); }
.cm { color: var(--text-muted); }
.sec { font-weight: var(--weight-medium); }
.src__note { margin: 0; padding: 12px 16px 0 30px; font-size: 12.5px; line-height: 1.65; color: var(--text-muted); }
.src__note code { font-size: 12px; color: var(--text); }
.legend {
  margin: auto 0 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 16px 12px 30px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  list-style: none;
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-circle); flex-shrink: 0; }
.legend__hit::before { background: var(--accent); }
.legend__direct::before { background: var(--success); }
.legend__skip::before { border: 1.5px solid var(--rule); }

.matrix {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.matrix__toc {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 10px;
  list-style: none;
  border-right: 1px solid var(--border);
}
.matrix__tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--clear);
  border-radius: var(--r-xs);
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  color: var(--text-muted);
  background: var(--surface);
}
.matrix__tab:hover { background: var(--bg-panel); color: var(--text); }
.matrix__tab[aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
.slot { width: 18px; display: flex; justify-content: center; flex-shrink: 0; font-family: var(--font-mono); }
.slot::before { content: ""; width: 7px; height: 7px; border: 1.5px solid var(--rule); border-radius: var(--r-xs); }
[aria-selected="true"] .slot::before { border: 0; background: var(--accent); border-radius: var(--r-circle); }
.matrix__pane { padding: 28px 32px 32px; }
.matrix__pane h3 { margin: 0; }
.matrix__pane p { margin: 12px 0 0; max-width: 640px; color: var(--text-muted); line-height: 1.75; }
.matrix__demo { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--border); }
.demo-cell {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background-color: var(--bg-panel);
  color: var(--text);
  background-image: radial-gradient(circle, var(--dot) 1px, var(--clear) 1.3px);
  background-size: 14px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.tabs__list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.tabs__list [role="tab"] {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
}
.tabs__list [aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
[role="tabpanel"] { min-width: 0; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
}
.toc a { padding: 8px 12px; text-decoration: none; color: var(--text-muted); border-radius: var(--r-xs); }
.toc a:hover { background: var(--bg-panel); color: var(--text); }
.toc--sticky { position: sticky; top: 12px; z-index: 5; }
.toc--static { position: static; }
.faq-item { border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-item summary { position: relative; min-height: 56px; padding: 16px 40px 16px 16px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 16px; font-family: var(--font-mono); color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { padding: 0 16px 20px; color: var(--text-muted); }
.faq-item__body p { margin: 0; }
.term-card { border-top: 2px solid var(--rule); }
.term-card dt { font-family: var(--font-mono); font-size: 18px; margin-bottom: 12px; }
.term-card dd { margin: 0; color: var(--text-muted); line-height: 1.8; }
.term-card__category { display: block; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }

.store-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  max-width: 100%;
  padding: 10px 20px;
  border: 1px solid var(--clear);
  border-radius: var(--r);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  line-height: 1.3;
}
.store-button:hover { background: var(--accent-dark); color: var(--on-accent); }
.store-button svg { width: 26px; height: 26px; }
.store-button__copy { display: flex; flex-direction: column; text-align: left; }
.store-button__eyebrow { font-size: 12px; }
.store-button__title { font-size: 17px; font-weight: var(--weight-medium); }
.store-guide { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-panel); color: var(--text); padding: 24px; }
.store-guide h2 { font-size: 22px; margin-top: 0; }
.store-guide p { color: var(--text-muted); }
.store-guide .btn { margin-top: 8px; }

.shot-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); align-items: start; gap: 32px; }
.official-shot { width: 100%; max-width: 280px; margin: 0 auto; padding: 0; flex-shrink: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--r-shot); }
.official-shot { border: 1px solid var(--border); border-radius: var(--r-shot); background: var(--surface); color: var(--text); }
.official-shot figcaption { padding: 12px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.shot-placeholder {
  aspect-ratio: 750 / 1334;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-shot);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}
.device-card { position: relative; display: block; text-decoration: none; padding: 28px; }
.device-card__icon { width: 36px; height: 36px; margin-bottom: 20px; color: var(--text-muted); }
.device-card h3 { margin: 0; }
.device-card p { color: var(--text-muted); margin-bottom: 20px; }
.device-card__next { font-size: 13px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.device-card:hover { border-color: var(--rule); background: var(--bg-panel); color: var(--text); }
.article-card { display: flex; flex-direction: column; gap: 12px; }
.article-card h3 { margin: 0; font-size: 18px; }
.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-card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.article-card__more { margin-top: auto; padding-top: 12px; font-size: 13px; }
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--rule);
  border-radius: var(--r);
  background: var(--bg-panel);
  color: var(--text);
}
.callout p { margin: 0; }
.callout__title { display: block; margin-bottom: 8px; font-weight: var(--weight-medium); }
.callout--warning { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--error); }
.tag { display: inline-block; max-width: 100%; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--bg-panel); color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; color: var(--text); background: var(--surface); font-size: 14px; }
.data-table :where(th, td), .prose table :where(th, td) {
  min-width: 7em;
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--border);
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-medium); }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  overscroll-behavior-inline: contain;
}
.prose table code, .data-table code { overflow-wrap: anywhere; }

.dl-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  box-shadow: 0 1px 2px var(--shadow-hair);
}
.dl-fab svg { width: 20px; height: 20px; color: var(--text-muted); }
.dl-fab:hover { background: var(--bg-panel); color: var(--text); }
.has-dl-fab .site-footer { padding-bottom: 100px; }

.preview-section { margin-top: 32px; }
.preview-section h2 { margin-top: 0; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.swatch { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); overflow: hidden; }
.swatch__paint { height: 56px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 8px 12px; font-size: 12px; }
.swatch--bg .swatch__paint { background: var(--bg); }
.swatch--panel .swatch__paint { background: var(--bg-panel); }
.swatch--panel2 .swatch__paint { background: var(--bg-panel-2); }
.swatch--border .swatch__paint { background: var(--border); }
.swatch--accent .swatch__paint { background: var(--accent); }
.swatch--accent-dark .swatch__paint { background: var(--accent-dark); }
.swatch--text .swatch__paint { background: var(--text); }
.swatch--muted .swatch__paint { background: var(--text-muted); }
.swatch--success .swatch__paint { background: var(--success); }
.swatch--warn .swatch__paint { background: var(--warn); }
.swatch--error .swatch__paint { background: var(--error); }
.swatch--surface .swatch__paint { background: var(--surface); }
.swatch--on-accent .swatch__paint { background: var(--on-accent); }
.swatch--faint .swatch__paint { background: var(--text-faint); }
.swatch--rule .swatch__paint { background: var(--rule); }
.swatch--dot .swatch__paint { background: var(--dot); }
.swatch--wash .swatch__paint { background: var(--accent-wash); }
.swatch--edge .swatch__paint { background: var(--accent-edge); }
.swatch--mask .swatch__paint { background: var(--mask); }
.swatch--clear .swatch__paint { background: var(--clear); }
.swatch--hair .swatch__paint { background: var(--shadow-hair); }
.swatch--soft .swatch__paint { background: var(--shadow-soft); }
.swatch--veil .swatch__paint { background: var(--veil); }
.preview-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.type-sample { font-size: var(--size-h1); font-family: var(--font-display); font-weight: var(--weight-normal); line-height: 1.1; }
.preview-footer { margin-top: 0; }

@media (max-width: 960px) {
  .rig__body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .rig__src { border-left: 0; border-top: 1px solid var(--border); }
  .legend { margin-top: 14px; }
  .matrix { grid-template-columns: minmax(0, 1fr); }
  .matrix__toc { flex-direction: row; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .matrix__tab { width: auto; flex-shrink: 0; white-space: nowrap; border-radius: var(--r-pill); border-color: var(--border); }
}
@media (max-width: 720px) {
  .rig__field { padding: 20px 14px; }
  .node__tail, .rig__more { display: none; }
  .matrix__pane { padding: 22px 18px; }
  .shot-layout { grid-template-columns: minmax(0, 1fr); }
  .official-shot { justify-self: center; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .node { gap: 8px; padding-inline: 10px; }
  .node__value { font-size: 11px; }
  .node--hit { flex-wrap: wrap; }
  .node--hit .node__body { flex: 1; }
  .tag-proxy { padding-inline: 5px; font-size: 10px; }
  .fact-pills, .protocols { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .fact-pill { font-size: 11px; padding-inline: 8px; }
  .toc { flex-wrap: nowrap; overflow-x: auto; }
  .toc a { white-space: nowrap; flex-shrink: 0; }
  .type-sample { font-size: 30px; }
}