.status-badge, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 14px 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text);
  font-size: var(--size-small);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.status-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--radius-round); background: var(--success); box-shadow: 0 0 0 3px var(--success-ring); }
.badge--accent { color: var(--accent); }
.fact-pills { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.fact-pills li { min-width: 0; max-width: 100%; }
.fact-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); font-size: var(--size-caption); overflow-wrap: anywhere; }
.mark { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; background: var(--accent); }
.mark--quarter { border-radius: var(--radius-quarter); }
.mark--dot { border-radius: var(--radius-round); }
.mark--square { border-radius: var(--radius-small); }
.device-row { margin: 22px auto 0; padding: 0; list-style: none; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 24px; }
.device-row li { display: flex; align-items: center; }
.device { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-muted); text-decoration: none; }
.device svg, .device-card svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
a.device { color: var(--text); }
a.device:hover { text-decoration: underline; }
.device-divider { width: 1px; height: 16px; background: var(--border-strong); }
.store-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--text); }
.store-pill svg { width: 11px; height: 11px; margin-top: -1px; }
.rule-index { margin: 44px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; text-align: left; }
.rule-index > li { min-width: 0; }
.rule-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 134px;
  padding: 20px 20px 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius-cell);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}
.rule-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tone-warn .rule-icon { color: var(--warn); }
.tone-info .rule-icon { color: var(--info); }
.tone-success .rule-icon { color: var(--success); }
.tone-accent .rule-icon { color: var(--accent); }
.rule-go { position: absolute; top: 21px; right: 19px; width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rule-key { margin-top: auto; padding-top: 12px; font-family: var(--font-mono); font-size: 16px; font-weight: var(--weight-medium); letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.rule-desc { margin-top: 5px; font-size: 15px; line-height: 1.45; color: var(--text-muted); }
.rule-cell--lead { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent), inset 0 1px 0 var(--on-accent-line); }
.rule-cell--lead .rule-desc { color: var(--on-accent-muted); }
.rule-cell--lead .rule-go { stroke: var(--on-accent); }
.rule-cell:hover { border-color: var(--border-strong); }
.rule-cell--lead:hover { background: var(--accent-dark); color: var(--on-accent); border-color: var(--accent-dark); }
.fact-band { margin: 18px 0 0; display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: left; }
.fact { display: flex; align-items: center; gap: 10px; padding: 12px 18px; font-family: var(--font-mono); font-size: var(--size-caption); line-height: 1.4; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--border); }
.fact dt { color: var(--text-muted); flex-shrink: 0; }
.fact dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.protocol-row { margin: 16px 0 0; padding: 0; list-style: none; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.protocol-label { margin-right: 6px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.protocol-chip { display: inline-flex; align-items: center; min-height: 28px; max-width: 100%; padding: 3px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); font-family: var(--font-mono); font-size: var(--size-caption); overflow-wrap: anywhere; }
.capability-panel { padding: 56px 72px 72px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-card); }
.capability-panel h2 { margin: 14px 0 0; font-size: 36px; line-height: 1.15; }
.capability-panel p { color: var(--text-muted); }
.capability-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; margin-top: 36px; }
.capability-layout > * { min-width: 0; }
.tabs-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
[role="tab"] { display: inline-flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text-muted); font-size: 15px; text-align: left; }
[role="tab"]:hover { color: var(--text); border-color: var(--border-strong); }
[role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); border-color: var(--bg-panel-2); }
.capability-tabs { flex-direction: column; align-items: stretch; gap: 4px; }
.capability-tabs [role="tab"] { border-color: var(--clear); background: var(--clear); color: var(--text-muted); padding-left: 0; }
.capability-tabs [role="tab"][aria-selected="true"] { color: var(--text); }
[role="tabpanel"] { min-width: 0; }
.detail-stack { position: relative; padding-top: 34px; padding-right: 24px; isolation: isolate; }
.detail-card { position: relative; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-lift); }
.detail-card--back { position: absolute; inset: 0 0 auto 30px; min-height: 160px; z-index: -1; box-shadow: var(--shadow-card); }
.detail-card--back p { margin: 0; font-family: var(--font-mono); font-size: var(--size-small); }
.detail-card h3 { margin-top: 0; }
.setting-list { margin: 20px 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-panel); color: var(--text); }
.setting-list li { position: relative; padding: 14px 30px 14px 16px; font-size: var(--size-small); }
.setting-list li + li { border-top: 1px solid var(--border); }
.setting-list li::after { content: "›"; position: absolute; top: 12px; right: 14px; color: var(--text-muted); }
.toc { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-pill); text-decoration: none; font-size: 14px; }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel-2); color: var(--text); }
.toc--sticky { position: sticky; top: 12px; z-index: 5; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 22px 36px 22px 0; cursor: pointer; list-style: none; font-size: 17px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 20px; font-family: var(--font-mono); color: var(--accent); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 22px; max-width: var(--reading-width); color: var(--text-muted); }
.faq-answer p { margin-top: 0; }
.term-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-soft); }
.term-card h3 { margin: 12px 0; font-family: var(--font-mono); font-size: 20px; overflow-wrap: anywhere; }
.term-card p { margin-bottom: 0; color: var(--text-muted); }
.official-shot { width: 100%; max-width: 280px; min-width: 0; margin: 0 auto; padding: 0; flex-shrink: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-shot); }
.official-shot figcaption { padding-top: 12px; color: var(--text-muted); font-size: var(--size-small); line-height: 1.6; }
.shot-media { border: 1px solid var(--border); border-radius: var(--radius-shot); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-soft); }
.shot-row { display: flex; justify-content: center; align-items: flex-start; gap: 36px; }
.device-card { display: block; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-card); text-decoration: none; }
.device-card > svg { width: 36px; height: 36px; }
.device-card h3 { margin: 18px 0 12px; }
.device-card p { color: var(--text-muted); }
.device-card .device-card-link { text-decoration: underline; text-underline-offset: 5px; font-size: 14px; }
.device-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
.article-card { display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-card); }
.article-card h3 { margin: 18px 0 12px; font-size: var(--size-h3); }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }
.article-card p { margin-top: 0; color: var(--text-muted); }
.article-card .article-meta { margin-top: auto; padding-top: 16px; color: var(--text-muted); font-size: var(--size-caption); }
.callout { margin: 28px 0; padding: 22px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-btn); background: var(--bg-panel); color: var(--text); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout--info { border-left-color: var(--info); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-btn); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); color: var(--text); text-align: left; font-size: 14px; }
.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;
  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-2); color: var(--text); font-weight: var(--weight-medium); }
.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; background: var(--bg-panel); color: var(--text); }
.dl-fab { position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: var(--layer-fab); display: inline-flex; align-items: center; gap: 12px; max-width: calc(100% - 40px); min-height: 52px; padding: 12px 18px; border: 1px solid var(--text); border-radius: var(--radius-btn); background: var(--text); color: var(--on-dark); box-shadow: var(--shadow-lift); text-decoration: none; font-size: 14px; }
.dl-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dl-fab:hover { background: var(--ink-hover); color: var(--on-dark); }
.article-store-card { margin-top: 48px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-card); }
.article-store-card h2 { margin-top: 0; font-size: 24px; }
.article-store-card p { color: var(--text-muted); }
.preview-section { margin-top: var(--section-gap); }
.preview-title { margin: 14px 0 32px; }
.preview-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-panel); color: var(--text); }
.swatch::before { content: ""; display: block; height: 64px; border-radius: var(--radius-btn) var(--radius-btn) 0 0; background: var(--sample); }
.swatch figcaption { padding: 12px; font-family: var(--font-mono); font-size: var(--size-caption); overflow-wrap: anywhere; }
.swatch--bg { --sample: var(--bg); }
.swatch--panel { --sample: var(--bg-panel); }
.swatch--panel2 { --sample: var(--bg-panel-2); }
.swatch--border { --sample: var(--border); }
.swatch--border-strong { --sample: var(--border-strong); }
.swatch--accent { --sample: var(--accent); }
.swatch--accent-dark { --sample: var(--accent-dark); }
.swatch--text { --sample: var(--text); }
.swatch--muted { --sample: var(--text-muted); }
.swatch--hover { --sample: var(--ink-hover); }
.swatch--success { --sample: var(--success); }
.swatch--ring { --sample: var(--success-ring); }
.swatch--warn { --sample: var(--warn); }
.swatch--info { --sample: var(--info); }
.swatch--error { --sample: var(--error); }
.swatch--on-accent { --sample: var(--on-accent); }
.swatch--on-accent-muted { --sample: var(--on-accent-muted); }
.swatch--on-accent-line { --sample: var(--on-accent-line); }
.swatch--on-dark { --sample: var(--on-dark); }
.swatch--on-dark-muted { --sample: var(--on-dark-muted); }
.swatch--veil { --sample: var(--veil); }
.swatch--clear { --sample: var(--clear); }
.preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.preview-shot-placeholder { display: grid; place-content: center; gap: 12px; width: 100%; aspect-ratio: 750 / 1334; border: 1px solid var(--border); border-radius: var(--radius-shot); background: var(--bg-panel-2); color: var(--text-muted); text-align: center; font-family: var(--font-mono); font-size: var(--size-small); }
.preview-shot-placeholder span { display: block; }
.preview-display { font-size: var(--size-display); font-weight: var(--weight-normal); line-height: 1.1; }
.preview-subtitle { color: var(--text-muted); font-size: 20px; }
.preview-mobile-menu { display: none; margin-left: auto; }
.preview-mobile-menu > summary { min-height: 44px; padding: 10px; cursor: pointer; list-style: none; }
.preview-mobile-menu nav { position: absolute; top: 100%; inset-inline: var(--gutter); max-height: 70dvh; overflow-y: auto; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-cell); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-lift); z-index: var(--layer-popup); }
.preview-mobile-menu nav a { display: block; min-height: 44px; padding: 10px 14px; text-decoration: none; }
.preview-header { position: relative; z-index: var(--layer-header); }
@media (max-width: 1280px) {
  .preview-mobile-menu { display: block; }
  .preview-header .header-tools { margin-left: 0; }
}
@media (max-width: 1180px) {
  .fact-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 980px) {
  .rule-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .capability-panel { padding: 40px; }
  .capability-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .capability-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  .capability-tabs [role="tab"] { flex-shrink: 0; padding-inline: 16px; border-color: var(--border); }
  .capability-tabs [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); }
  .detail-card--back { display: none; }
  .detail-stack { padding: 0; }
}
@media (max-width: 767px) {
  .device-row { gap: 12px 18px; }
  .device-divider { display: none; }
  .rule-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rule-index li:first-child { grid-column: 1 / -1; }
  .rule-cell { min-height: 118px; }
  .fact-band { grid-template-columns: minmax(0, 1fr); }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--border); }
  .capability-panel { padding: 36px 24px 44px; border-radius: var(--radius-panel-mobile); }
  .capability-panel h2 { font-size: 26px; }
  .shot-row { flex-direction: column; align-items: center; }
  .preview-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-card { padding: 22px; }
}
@media (max-width: 640px) {
  .dl-fab { right: 20px; }
  .device-card { padding: 24px; }
  .fact-pills { flex-direction: row; flex-wrap: wrap; }
  .fact-pill { padding: 6px 10px; font-size: 11.5px; }
}