/* Indexed capability stage; mobile uses buttons beside each revealed panel. */
.capability-tabs { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 48px; min-width: 0; }
.capability-tabs__index { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.capability-tabs [role="tab"] {
  position: relative;
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 16px 20px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--bg);
  color: var(--text-muted);
  text-align: left;
}
.capability-tabs [role="tab"]::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 0; width: 3px; border-radius: var(--r-line); background: var(--accent); opacity: 0; }
.capability-tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.capability-tabs [role="tab"][aria-selected="true"]::before { opacity: 1; }
.tab-field { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-code-lg); }
.tab-description { display: block; font-size: var(--fs-nav); }
.capability-tabs__panels { min-width: 0; }
.capability-tabs [role="tabpanel"] {
  min-width: 0;
  padding: 48px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-panel), var(--accent-dark));
  color: var(--white);
}
.capability-tabs [role="tabpanel"] h3 { margin-bottom: 20px; }
.capability-tabs [role="tabpanel"] p { max-width: 640px; line-height: 1.9; }
.snippet {
  max-width: 100%;
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--font-mono);
}
.snippet code { color: var(--paper-ink); }
.accordion-trigger { display: none; }
.tab-strip { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); }
.tab-strip [role="tab"] { min-height: 48px; padding: 12px 20px; border: 0; border-bottom: 3px solid var(--clear); background: var(--clear); color: var(--text-muted); }
.tab-strip [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-content { min-width: 0; padding-top: 32px; }

/* Long-page navigation is in normal flow by default. */
.page-toc { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 16px; margin-bottom: 40px; }
.page-toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text); font-size: var(--fs-small); }
.page-toc a:hover, .page-toc a[aria-current="location"] { border-color: var(--accent); }
.page-toc--sticky { position: sticky; top: 0; z-index: 5; background: var(--bg); color: var(--text); }
.page-toc--static { position: static; }

/* Native disclosure stays operable with scripts disabled. */
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 24px 44px 24px 0; min-height: 64px; cursor: pointer; list-style: none; font-size: var(--fs-brand); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 24px; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__answer { padding-bottom: 24px; max-width: 760px; color: var(--text-muted); line-height: 1.9; }
.faq-item__answer p:last-child { margin-bottom: 0; }
.term-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); }
.term-card__name { margin-bottom: 12px; font-family: var(--font-mono); font-size: var(--fs-subtitle); overflow-wrap: anywhere; }
.term-card__category { display: block; margin-bottom: 16px; color: var(--text-muted); font-size: var(--fs-code); }
.term-card p { color: var(--text-muted); margin-bottom: 0; }

.app-store {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  max-width: 100%;
  padding: 10px 24px;
  border: 1px solid var(--clear);
  border-radius: var(--r-pill);
  background: var(--accent-dark);
  color: var(--white);
  text-align: left;
  transition: background-color var(--speed), border-color var(--speed);
}
.app-store:hover, .app-store.is-hover { background: var(--header-ink); color: var(--white); border-color: var(--accent); }
.app-store svg { width: 26px; height: 28px; flex-shrink: 0; }
.app-store__copy { display: block; min-width: 0; }
.app-store__overline { display: block; font-size: var(--fs-xs); line-height: 1.3; }
.app-store__title { display: block; font-size: var(--fs-brand); font-weight: var(--weight-medium); line-height: 1.5; }
.app-store--hero { min-height: 48px; padding: 10px 26px; background: var(--accent); color: var(--white); }
.app-store--hero svg { width: 17px; height: 17px; }
.fact-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fact-pill { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; max-width: 100%; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text); font-size: var(--fs-code); overflow-wrap: anywhere; }
.fact-pill__key { color: var(--text-muted); }
.badge { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; max-width: 100%; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--bg-panel); color: var(--text); font-size: var(--fs-code); overflow-wrap: anywhere; }
.badge--warn { border-color: var(--warn); color: var(--warn); }
.badge__dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--accent); }

/* Official source images remain whole, with no simulated device frame. */
.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 figcaption { margin-top: 12px; color: var(--text-muted); font-size: var(--fs-code); line-height: 1.7; }
.shot-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; min-width: 0; }
.shot-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 750 / 1334;
  padding: 24px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-shot);
  background: var(--paper);
  color: var(--paper-ink-2);
  text-align: center;
  font-size: var(--fs-small);
}
.device-card { position: relative; display: flex; align-items: flex-start; gap: 24px; min-width: 0; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); transition: border-color var(--speed); }
.device-card:hover { border-color: var(--accent); }
.device-card__icon { width: 40px; height: 48px; flex-shrink: 0; color: var(--text-muted); }
.device-card__body { min-width: 0; }
.device-card h3 { margin-bottom: 12px; }
.device-card p { margin-bottom: 20px; color: var(--text-muted); }
.device-card__link { font-size: var(--fs-small); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.article-card { display: block; padding: 32px; border-top: 1px solid var(--border); color: var(--text); }
.article-card:hover { background: var(--bg-panel); color: var(--text); }
.article-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-code); }
.article-card h3 { margin-bottom: 16px; }
.article-card p { margin: 0; max-width: 760px; color: var(--text-muted); }
.callout { margin: 32px 0; padding: 24px 28px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); }
.callout--warn { border-left-color: var(--warn); }
.callout__title { display: block; margin-bottom: 8px; font-weight: var(--weight-medium); }
.callout p:last-child { margin-bottom: 0; }
.grouped-list { padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); list-style: none; overflow: hidden; }
.grouped-list li + li { border-top: 1px solid var(--border); }
.grouped-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 16px 24px; }
.grouped-list a::after { content: "›"; color: var(--text-muted); }
.grouped-list a:hover { background: var(--bg-panel-2); color: var(--text); }

.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--fs-nav); }
.data-table th, .data-table td, .prose th, .prose td, .article-body th, .article-body td {
  min-width: 7em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
.data-table th, .prose th, .article-body th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-medium); }
.data-table td, .prose td, .article-body td { background: var(--bg); color: var(--text-muted); }
.prose table, .article-body table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.store-endcap { margin-top: 64px; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); }
.store-endcap h2 { font-size: var(--fs-h3); margin-bottom: 12px; }
.store-endcap p { color: var(--text-muted); }
.dl-fab {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--layer-fab);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - var(--gutter) * 2);
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-pill);
  background: var(--accent-dark);
  color: var(--white);
  font-size: var(--fs-small);
}
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-fab:hover { border-color: var(--accent); }
body.has-article-fab { padding-bottom: 88px; }

/* Preview-only specimens, kept here so the preview has no embedded CSS. */
.preview-section { padding-top: var(--section-gap); padding-bottom: 0; }
.preview-section:last-child { padding-bottom: var(--section-gap); }
.specimen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.specimen-grid > *, .swatches > * { min-width: 0; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.swatch { margin: 0; }
.swatch__sample { min-height: 64px; border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); }
.swatch figcaption { margin-top: 8px; font-family: var(--font-mono); font-size: var(--fs-code); color: var(--text-muted); overflow-wrap: anywhere; }
.swatch--bg { background: var(--bg); color: var(--text); }
.swatch--bg-panel { background: var(--bg-panel); color: var(--text); }
.swatch--bg-panel-2 { background: var(--bg-panel-2); color: var(--text); }
.swatch--border { background: var(--border); color: var(--text); }
.swatch--line-strong { background: var(--line-strong); color: var(--white); }
.swatch--accent { background: var(--accent); color: var(--white); }
.swatch--accent-dark { background: var(--accent-dark); color: var(--white); }
.swatch--accent-ring { background: var(--accent-ring); color: var(--text); }
.swatch--accent-glow { background: var(--accent-glow); color: var(--text); }
.swatch--accent-edge { background: var(--accent-edge); color: var(--text); }
.swatch--text { background: var(--text); color: var(--header-ink); }
.swatch--text-muted { background: var(--text-muted); color: var(--header-ink); }
.swatch--success { background: var(--success); color: var(--header-ink); }
.swatch--warn { background: var(--warn); color: var(--bar-ink); }
.swatch--error { background: var(--error); color: var(--header-ink); }
.swatch--white { background: var(--white); color: var(--header-ink); }
.swatch--bar-ink { background: var(--bar-ink); color: var(--white); }
.swatch--header-ink { background: var(--header-ink); color: var(--white); }
.swatch--header-ink-muted { background: var(--header-ink-muted); color: var(--white); }
.swatch--header-line { background: var(--header-line); color: var(--header-ink); }
.swatch--paper { background: var(--paper); color: var(--paper-ink); }
.swatch--paper-side { background: var(--paper-side); color: var(--paper-ink); }
.swatch--paper-line { background: var(--paper-line); color: var(--paper-ink); }
.swatch--paper-edge { background: var(--paper-edge); color: var(--paper-ink); }
.swatch--paper-ink { background: var(--paper-ink); color: var(--white); }
.swatch--paper-ink-2 { background: var(--paper-ink-2); color: var(--white); }
.swatch--paper-ink-3 { background: var(--paper-ink-3); color: var(--paper-ink); }
.swatch--note-bg { background: var(--note-bg); color: var(--text); }
.swatch--veil { background: var(--veil); color: var(--text); }
.swatch--clear { background: var(--clear); color: var(--text); }
.specimen-label { margin-top: 20px; color: var(--text-muted); font-size: var(--fs-code); font-family: var(--font-mono); }
.button-states { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.preview-fab { position: static; width: fit-content; margin-top: 24px; }

@media (max-width: 768px) {
  .capability-tabs { display: block; }
  .capability-tabs__index { display: none; }
  .capability-tabs [role="tabpanel"] { padding: 28px 20px; border-radius: 0 0 var(--r-lg) var(--r-lg); margin-bottom: 12px; }
  .accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 64px;
    gap: 16px;
    margin-top: 12px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-panel);
    color: var(--text);
    text-align: left;
  }
  .accordion-trigger::after { content: "+"; color: var(--text-muted); flex-shrink: 0; }
  .accordion-trigger[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-left: 3px solid var(--accent); }
  .accordion-trigger[aria-expanded="true"]::after { content: "−"; }
  .snippet { padding: 20px; font-size: var(--fs-code); }
  .specimen-grid { grid-template-columns: minmax(0, 1fr); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-card { padding: 24px; gap: 20px; }
  .article-card { padding: 24px 0; }
  .store-endcap { padding: 24px; }
  .shot-row { flex-direction: column; align-items: center; }
}
@media (max-width: 640px) {
  .fact-pills { flex-direction: row; justify-content: center; gap: 8px; }
  .fact-pill { padding: 6px 10px; }
  .callout { padding: 20px; }
  .data-table { min-width: 560px; }
  .dl-fab { font-size: var(--fs-code); }
}