.feature-pair { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: stretch; }
.feature-card { padding: 0; }
.feature-card-head { padding: 24px 28px; border-bottom: 1px solid var(--border); }
.feature-card-head h3 { margin: 0 0 6px; }
.feature-card-head p { margin: 0; color: var(--text-muted); }
.feature-body { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(0, 3fr); }
.tablist, [role="tablist"].tablist { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-right: 1px solid var(--border); }
.tablist [role="tab"] {
  position: relative;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  text-align: left;
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  background: var(--bg);
  color: var(--text-muted);
  border: 0;
}
.tablist [role="tab"]::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 3px; background: var(--clear); }
.tablist [role="tab"][aria-selected="true"] { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-bold); }
.tablist [role="tab"][aria-selected="true"]::before { background: var(--accent); }
.tablist [role="tab"]:hover { background: var(--bg-panel); color: var(--text); }
.tab-detail { min-width: 0; padding: 24px; }
.tab-detail h3 { margin-top: 0; font-size: 18px; }
.tab-detail p { margin-bottom: 0; line-height: 1.85; }
.rule-sample { min-width: 0; padding: 28px; }
.rule-sample h3 { margin-top: 0; }
.rule-sample pre { padding: 18px 0; background: var(--bg); color: var(--text); border: 0; border-radius: var(--r-small); font-size: var(--size-label); }
.code-comment { color: var(--accent-dark); }
.rule-sample .pol { vertical-align: middle; }
.rule-sample .sample-note { color: var(--text-muted); font-size: var(--size-small); margin-top: 22px; }
.tab-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-strip [role="tab"] { min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); }
.tab-strip [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--text); border-color: var(--accent); }

.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); font-size: var(--size-small); font-weight: var(--weight-medium); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--accent); color: var(--text); border-color: var(--accent); }
.toc-sticky { position: sticky; top: 16px; z-index: 10; }
.toc-flow { position: static; }
.faq-stack { display: grid; gap: 12px; }
.faq-item { min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.faq-item summary { position: relative; min-height: 56px; padding: 18px 52px 18px 22px; font-weight: var(--weight-bold); list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 17px; font-family: var(--font-mono); font-size: 20px; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-answer { padding: 20px 22px; line-height: var(--leading-body); }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card { padding: 24px; border-top: 3px solid var(--accent); }
.term-card dt { font-family: var(--font-mono); font-size: 18px; font-weight: var(--weight-bold); margin-bottom: 12px; }
.term-card dd { margin: 0; color: var(--text-muted); line-height: var(--leading-body); }
.term-category { display: inline-block; margin-bottom: 12px; font-size: var(--size-label); color: var(--accent-dark); font-weight: var(--weight-bold); }

.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 22px;
  max-width: 100%;
  border: 1px solid var(--text);
  border-radius: var(--r-card);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.store-button svg { width: 26px; height: 28px; }
.store-button small { display: block; font-size: 11px; font-weight: var(--weight-medium); line-height: 1.4; }
.store-button strong { display: block; font-size: 17px; font-weight: var(--weight-bold); line-height: 1.5; }
.store-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-block); }
.store-button:active { transform: translateY(1px); }
.store-button-accent { background: var(--accent); color: var(--text); border-color: var(--accent); box-shadow: var(--glow-accent); }
.store-button-major { min-height: 72px; padding: 14px 30px; }
.store-button-major strong { font-size: 20px; }
.fact-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0; margin: 20px 0; list-style: none; }
.fact-pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text);
  font-size: var(--size-label);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}
.fact-pill svg { width: 14px; height: 14px; }
.tag-accent { background: var(--accent); color: var(--text); border-color: var(--accent); }
.tag-outline { background: var(--bg); color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-round); background: var(--success); }
.badge-light { background: var(--bg-panel); color: var(--text); border-color: var(--border); }
.badge-light .badge-dot { box-shadow: none; }

.shot-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px; }
.official-shot { width: 100%; max-width: 280px; min-width: 0; flex-shrink: 0; margin: 0; padding: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: 10px; }
.official-shot { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.official-shot figcaption { margin: 0; padding: 12px 0 0; color: var(--text-muted); font-size: var(--size-small); line-height: 1.6; }
.device-entry { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 18px; align-items: start; }
.device-entry > svg { width: 48px; height: 60px; color: var(--text); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.device-entry h3 { margin: 0 0 10px; }
.device-entry p { margin-bottom: 18px; color: var(--text-muted); }
.device-entry .text-link { font-weight: var(--weight-bold); }
.article-card { display: flex; flex-direction: column; gap: 16px; }
.article-card h3 { margin: 0; font-size: 20px; line-height: 1.5; }
.article-card p { margin: 0; color: var(--text-muted); }
.article-card .article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text-muted); font-size: var(--size-label); }
.article-card .article-link { align-self: flex-start; margin-top: auto; }
.article-card:hover { border-color: var(--text-muted); }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-control); background: var(--bg-panel); color: var(--text); line-height: var(--leading-body); }
.callout > :last-child { margin-bottom: 0; }
.callout strong { font-weight: var(--weight-bold); }
.callout-warn { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.callout-success { border-left-color: var(--success); }
.group-list { padding: 0; margin: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); }
.group-list li + li { border-top: 1px solid var(--border); }
.group-list a { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 16px 20px; }
.group-list a::after { content: "›"; font-size: 22px; color: var(--text-muted); }
.group-list a:hover { background: var(--bg-panel); color: var(--text); }
.group-list li:first-child a { border-radius: var(--r-card) var(--r-card) 0 0; }
.group-list li:last-child a { border-radius: 0 0 var(--r-card) var(--r-card); }
.dl-fab {
  position: fixed;
  z-index: 30;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 40px);
  min-height: 56px;
  padding: 12px 18px;
  border: 1px solid var(--line-ink-2);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-block);
  font-weight: var(--weight-bold);
  font-size: 14px;
}
.dl-fab svg { width: 22px; height: 22px; color: var(--accent); }
.dl-fab:hover { transform: translateY(-2px); }
.article-store-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-top: 48px; padding: 28px; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.article-store-card h2 { margin: 0 0 8px; font-size: 22px; }
.article-store-card p { margin: 0; color: var(--text-muted); }

.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-card); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg); color: var(--text); 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;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  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-bold); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: var(--bg);
  color: var(--text);
}
.prose table code, .article-body table code { overflow-wrap: anywhere; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 24px; color: var(--text-muted); font-size: var(--size-small); }

.preview-block { margin-top: 40px; }
.preview-block h3 { margin-top: 0; }
.preview-dark { padding: 28px; background: var(--ink-block); color: var(--on-ink); border-radius: var(--r-card); }
.preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.preview-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.swatch { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.swatch-color { display: block; height: 64px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--r-chip); }
.swatch code { display: block; font-size: 11px; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--bg-panel); }
.sw-ink { background: var(--ink-block); }
.sw-card { background: var(--ink-card); }
.sw-card-2 { background: var(--ink-card-2); }
.sw-chip { background: var(--ink-chip); }
.sw-border { background: var(--border); }
.sw-accent { background: var(--accent); }
.sw-accent-dark { background: var(--accent-dark); }
.sw-text { background: var(--text); }
.sw-muted { background: var(--text-muted); }
.sw-success { background: var(--success); }
.sw-warn { background: var(--warn); }
.sw-error { background: var(--error); }
.sw-on-ink { background: var(--on-ink); }
.sw-on-ink-2 { background: var(--on-ink-2); }
.sw-on-ink-3 { background: var(--on-ink-3); }
.sw-on-ink-4 { background: var(--on-ink-4); }
.sw-line { background: var(--line-ink); }
.sw-line-10 { background: var(--line-ink-10); }
.sw-line-2 { background: var(--line-ink-2); }
.sw-line-3 { background: var(--line-ink-3); }
.sw-line-ghost { background: var(--line-ink-ghost); }
.sw-dot { background: var(--dot-ink); }
.sw-cell { background: var(--cell-faint); }
.sw-sheen { background: var(--sheen); }
.sw-wash { background: var(--accent-wash); }
.sw-dim { background: var(--accent-dim); }
.sw-ring { background: var(--accent-ring); }
.sw-veil { background: var(--veil); }
.sw-clear { background: var(--clear); }
.swatch-dark .swatch-color { background-color: var(--ink-block); background-image: linear-gradient(var(--swatch-layer), var(--swatch-layer)); }
.swatch-dark .sw-on-ink-2 { --swatch-layer: var(--on-ink-2); }
.swatch-dark .sw-on-ink-3 { --swatch-layer: var(--on-ink-3); }
.swatch-dark .sw-on-ink-4 { --swatch-layer: var(--on-ink-4); }
.swatch-dark .sw-line { --swatch-layer: var(--line-ink); }
.swatch-dark .sw-line-10 { --swatch-layer: var(--line-ink-10); }
.swatch-dark .sw-line-2 { --swatch-layer: var(--line-ink-2); }
.swatch-dark .sw-line-3 { --swatch-layer: var(--line-ink-3); }
.swatch-dark .sw-line-ghost { --swatch-layer: var(--line-ink-ghost); }
.swatch-dark .sw-dot { --swatch-layer: var(--dot-ink); }
.swatch-dark .sw-cell { --swatch-layer: var(--cell-faint); }
.swatch-dark .sw-sheen { --swatch-layer: var(--sheen); }
.preview-shot-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 750 / 1334; padding: 20px; background: var(--bg-panel); color: var(--text-muted); border-radius: var(--r-card); text-align: center; }
.preview-shot-placeholder span { max-width: 12em; font-size: var(--size-small); }
.preview-type-display { margin: 0 0 18px; font-size: var(--size-h1); font-family: var(--font-display); font-weight: var(--weight-display); line-height: var(--leading-title); }
.preview-footer { margin-top: 100px; }
.preview-mobile { display: none; }

@media (max-width: 960px) {
  .feature-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .feature-body { grid-template-columns: minmax(0, 1fr); }
  .tablist, [role="tablist"].tablist { flex-direction: row; gap: 8px; padding: 14px; overflow-x: auto; max-width: 100%; border-right: 0; border-bottom: 1px solid var(--border); overscroll-behavior-x: contain; }
  .tablist [role="tab"] { width: auto; flex: 0 0 auto; min-height: 44px; padding: 10px 14px; white-space: nowrap; border: 1px solid var(--border); border-radius: var(--r-pill); }
  .tablist [role="tab"][aria-selected="true"] { border-color: var(--accent); }
  .tablist [role="tab"]::before { display: none; }
  .feature-card-head, .rule-sample { padding: 22px; }
  .tab-detail { padding: 22px; }
  .fact-pills { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .fact-pill { padding: 5px 9px; font-size: 11px; }
  .shot-row { flex-direction: column; align-items: center; }
  .official-shot { margin-inline: auto; }
  .article-store-card { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .article-store-card .btn { justify-self: start; }
  .device-entry { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
  .device-entry > svg { width: 34px; height: 48px; }
  .toc { flex-wrap: nowrap; overflow-x: auto; }
  .toc a { flex-shrink: 0; white-space: nowrap; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); min-height: 52px; font-size: var(--size-small); }
  .preview-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .preview-desktop { display: none; }
  .preview-mobile { display: block; }
  .preview-mobile summary { min-height: 44px; padding: 10px; cursor: pointer; }
  .preview-mobile nav { position: absolute; right: 0; left: 0; top: 100%; z-index: 60; max-height: calc(100dvh - var(--header-height)); overflow-y: auto; padding: 16px var(--gutter); background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); border-bottom: 1px solid var(--border); }
  .preview-mobile nav a { display: block; width: 100%; min-height: 44px; padding: 12px; }
}