.badge, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--size-xs);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.badge { min-height: 28px; margin: 0; box-shadow: var(--shadow-hairline); }
.badge__dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--success); color: var(--text); box-shadow: 0 0 0 3px var(--success-soft); }
.chip { background: var(--bg-panel); color: var(--text-muted); }
.chips, .fact-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.fact-pills { justify-content: center; margin: 20px 0 0; }
.fact-pills li { min-width: 0; max-width: 100%; }
.fact-pills .chip { background: var(--bg); color: var(--text-muted); }
.appstore-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 52px;
  max-width: 100%;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-btn);
  font-weight: var(--weight-medium);
  line-height: 1.25;
  transition: background-color var(--motion-fast) var(--ease);
}
.appstore-button:hover { background: var(--accent-dark); color: var(--on-accent); border-color: var(--accent-dark); }
.appstore-button svg { width: 25px; height: 28px; fill: currentColor; }
.appstore-button__copy { display: block; text-align: left; }
.appstore-button__eyebrow { display: block; font-size: var(--size-xs); font-weight: var(--weight-regular); }
.appstore-button__title { display: block; margin-top: 3px; font-size: var(--size-body); }
.appstore-button--hero { min-height: 46px; padding: 10px 22px; }
.appstore-button--hero svg { width: 17px; height: 19px; }
.store-guide-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.store-guide-card h2 { margin: 0 0 10px; font-size: var(--h3-size); }
.store-guide-card p { margin: 0; color: var(--text-muted); }
.store-guide-card .btn { flex-shrink: 0; }

.tabs { display: grid; grid-template-columns: minmax(190px, 0.29fr) minmax(0, 1fr); gap: 44px; }
.tabs [role="tablist"] { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.tabs [role="tab"] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-left: 2px solid var(--clear);
  border-radius: var(--r-none);
  background: var(--bg);
  color: var(--text-muted);
  text-align: left;
  font-size: var(--size-body);
}
.tabs [role="tab"]::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--border-strong); color: var(--text); }
.tabs [role="tab"]:hover { background: var(--bg-panel); color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { border-left-color: var(--accent); color: var(--text); }
.tabs [role="tab"][aria-selected="true"]::before { background: var(--accent); }
.tab-panel { position: relative; min-width: 0; padding: 30px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-float); }
.tab-panel__syntax { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--size-sm); overflow-wrap: anywhere; }
.tab-panel h3 { margin-top: 0; }
.tab-panel p { color: var(--text-muted); line-height: var(--line-prose); }
.tab-panel__link { display: table; margin-top: 28px; margin-left: auto; padding: 6px 10px; border: 1px dashed var(--border-strong); border-radius: var(--r-cell); color: var(--accent-dark); font-size: var(--size-xs); }
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
}
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--r-btn); font-size: var(--size-nav); color: var(--text-muted); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--accent-soft); color: var(--accent-dark); }
.toc--sticky { position: sticky; top: calc(var(--header-h) + 12px); z-index: 5; box-shadow: var(--shadow-hairline); }
.faq-list { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 22px 52px 22px 24px; list-style: none; font-weight: var(--weight-medium); cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 24px; top: 20px; color: var(--accent-dark); font-family: var(--font-mono); font-size: var(--size-subtitle); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__answer { padding: 0 24px 24px; color: var(--text-muted); line-height: var(--line-prose); }
.faq-item__answer p:last-child { margin: 0; }
.term-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.term-card__category { margin: 0 0 14px; color: var(--text-muted); font-size: var(--size-xs); }
.term-card h3 { margin: 0 0 12px; font-family: var(--font-mono); font-size: var(--size-subtitle); overflow-wrap: anywhere; }
.term-card p:last-child { margin-bottom: 0; color: var(--text-muted); }
.callout { margin: 24px 0; padding: 22px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-btn); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout--warn { background: var(--warn-soft); color: var(--warn-ink); border-left-color: var(--warn); }
.callout--success { background: var(--success-soft); color: var(--success-ink); border-left-color: var(--success); }
.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(--r-shot); }
.official-shot img { border: 1px solid var(--border); }
.official-shot figcaption { margin-top: 12px; font-size: var(--size-xs); line-height: 1.6; color: var(--text-muted); text-align: center; }
.shot-row { display: flex; justify-content: center; align-items: flex-start; gap: 32px; }
.shot-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 750 / 1334; border: 1px solid var(--border); border-radius: var(--r-shot); background: var(--bg-panel); color: var(--text-muted); text-align: center; padding: 24px; }
.device-card { display: block; padding: 30px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-hairline); transition: border-color var(--motion-fast) var(--ease); }
.device-card:hover { border-color: var(--accent); }
.device-card__icon { width: 40px; height: 48px; margin-bottom: 24px; fill: none; stroke: var(--text); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.device-card h3 { margin: 0 0 12px; }
.device-card p { margin-bottom: 22px; color: var(--text-muted); }
.device-card__link { color: var(--accent-dark); font-size: var(--size-nav); }
.article-card { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-hairline); }
.article-card__meta { margin-bottom: 20px; color: var(--text-muted); font-size: var(--size-xs); }
.article-card h3 { margin: 0 0 16px; font-size: var(--size-subtitle); line-height: 1.5; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { color: var(--text-muted); }
.article-card__link { margin-top: auto; padding-top: 12px; color: var(--accent-dark); font-size: var(--size-nav); }
.dl-fab { position: fixed; right: 24px; bottom: 24px; z-index: var(--layer-fab); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); min-height: 56px; padding: 12px 18px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-float); font-size: var(--size-nav); }
.dl-fab svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-dark); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dl-fab small { display: block; color: var(--text-muted); font-size: var(--size-xs); }
.dl-fab:hover { border-color: var(--accent); }
.table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; color: var(--text); font-size: var(--size-nav); text-align: left; }
.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);
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-medium); }
.prose table, .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; border-collapse: collapse; text-align: left; }
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.fact-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.fact-card { min-width: 0; padding: 44px 28px; border-radius: var(--r-card); background: var(--accent); color: var(--on-accent); overflow: hidden; }
.fact-card--dots { background-image: radial-gradient(var(--pattern-light) 1px, var(--clear) 1px); background-size: 18px 18px; }
.fact-card--lines { background-color: var(--fact-teal); background-image: repeating-linear-gradient(145deg, var(--clear) 0, var(--clear) 49px, var(--pattern-light) 50px, var(--clear) 51px), linear-gradient(125deg, var(--accent-dark), var(--fact-teal)); }
.fact-card--grid { background-color: var(--fact-deep); background-image: linear-gradient(var(--pattern-light) 1px, var(--clear) 1px), linear-gradient(90deg, var(--pattern-light) 1px, var(--clear) 1px); background-size: 44px 44px; }
.fact-card__value { display: block; margin-bottom: 14px; font-family: var(--font-display); font-size: clamp(26px, 3.3vw, 44px); font-weight: var(--weight-regular); letter-spacing: var(--track-display); overflow-wrap: anywhere; }
.fact-card p { margin: 0; }

.hero { position: relative; padding-top: 36px; padding-bottom: 56px; overflow-x: clip; }
.hero__rails {
  position: absolute;
  top: 300px;
  bottom: 0;
  left: 50%;
  width: var(--content);
  max-width: 100%;
  transform: translateX(-50%);
  background-image: linear-gradient(to right, var(--rail) 0, var(--rail) 1px, var(--clear) 1px);
  background-size: calc((100% - 1px) / 6) 100%;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(to bottom, var(--clear) 0, var(--text) 22%);
  mask-image: linear-gradient(to bottom, var(--clear) 0, var(--text) 22%);
  pointer-events: none;
}
.hero__rails::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 1px; background: var(--rail); }
.hero__copy { position: relative; z-index: 1; max-width: var(--content); margin-inline: auto; padding-inline: var(--gutter); text-align: center; }
.hero__title { margin: 20px 0 0; font-family: var(--font-display); font-size: var(--h1-size); font-weight: var(--weight-regular); line-height: 1.2; letter-spacing: var(--track-display); color: var(--text); }
.hero__title-accent { background-image: linear-gradient(90deg, var(--accent) 0%, var(--accent) 18%, var(--grad-end) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: var(--clear); color: var(--clear); white-space: nowrap; }
.hero__lede { max-width: 720px; margin: 14px auto 0; font-size: var(--size-lede); line-height: 1.65; color: var(--text-muted); }
.hero__lede strong { font-weight: var(--weight-medium); color: var(--text); }
.devices { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 22px; font-size: var(--size-sm); color: var(--text-muted); }
.devices__item { display: inline-flex; align-items: center; gap: 7px; }
.devices__item a { display: inline-flex; align-items: center; gap: 7px; }
.devices__item a:hover { color: var(--accent-dark); }
.devices__item svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.devices__sep { width: 1px; height: 14px; background: var(--border); }
.devices__pill { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text); font-size: var(--size-xs); }

.fig-wrap { position: relative; z-index: 1; width: min(var(--fig), calc(100% - 48px)); margin: 32px auto 0; }
.fig-wrap::before { content: ""; position: absolute; left: 28px; right: 28px; bottom: -8px; height: 24px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-hairline); }
.fig { position: relative; margin: 0; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-float); overflow: hidden; }
.fig__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 20px; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.fig__caption { display: inline-flex; align-items: center; gap: 8px; font-size: var(--size-sm); }
.fig__caption svg, .fig__order svg { width: 14px; height: 14px; fill: none; stroke: var(--text-faint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fig__order { display: inline-flex; align-items: center; gap: 6px; font-size: var(--size-xs); color: var(--text-muted); }
.fig__body { display: grid; grid-template-columns: 72fr 28fr; }
.fig__table { min-width: 0; padding: 12px 20px 16px; overflow-x: auto; }
.rules { width: 100%; min-width: 700px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.rules col.c-num { width: 40px; }
.rules col.c-pol { width: 82px; }
.rules th { height: 34px; padding: 0 8px; font-family: var(--font-mono); font-size: var(--size-xs); font-weight: var(--weight-medium); letter-spacing: var(--track-label); color: var(--text-muted); text-align: center; border-bottom: 1px solid var(--border); }
.rules th.th-rule { text-align: left; font-family: var(--font-body); letter-spacing: normal; }
.rules th.th-rule code { margin-left: 6px; color: var(--text-muted); }
.pol-head { display: inline-flex; align-items: center; gap: 6px; }
.pol-head::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-circle); background: currentColor; }
.pol-head--proxy { color: var(--accent-dark); }
.pol-head--direct { color: var(--success-ink); }
.pol-head--reject { color: var(--error-ink); }
.rules td { height: 38px; padding: 0 6px; border-bottom: 1px solid var(--bg-panel-2); vertical-align: middle; }
.rules tbody tr:last-child td { border-bottom: 0; }
.rules td.num { position: relative; padding: 0; text-align: center; }
.rules td.num::before { content: ""; position: absolute; left: 50%; top: 0; bottom: -1px; border-left: 1px dashed var(--border-strong); }
.rules tbody tr:first-child td.num::before { top: 50%; }
.rules tbody tr:last-child td.num::before { bottom: 50%; }
.rules td.num span { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--border); border-radius: var(--r-circle); background: var(--bg); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--size-xs); }
.rules td.rule { padding-left: 12px; white-space: nowrap; }
.rules td.rule code { font-family: var(--font-mono); font-size: var(--size-sm); letter-spacing: var(--track-small); white-space: nowrap; overflow-wrap: normal; }
.k { color: var(--text); font-weight: var(--weight-medium); }
.v, .s { color: var(--text-muted); }
.p--proxy { color: var(--accent-dark); }
.p--direct { color: var(--success-ink); }
.p--reject { color: var(--error-ink); }
.cell { display: block; height: 24px; border-radius: var(--r-cell); background: var(--bg-panel-2); color: var(--text); }
.cell--hit { display: flex; align-items: center; justify-content: center; border: 1px dashed; font-size: var(--size-xs); font-weight: var(--weight-medium); }
.cell--proxy { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.cell--direct { color: var(--success-ink); background: var(--success-soft); border-color: var(--success); }
.cell--reject { color: var(--error-ink); background: var(--error-soft); border-color: var(--error); }
.cell--final { border-style: solid; }
.fig__notes { padding: 16px 22px; background: var(--bg-panel); color: var(--text); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.notes__head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; font-size: var(--size-xs); color: var(--text-muted); }
.notes__head code { font-size: var(--size-xs); }
.notes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notes__item { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; }
.notes__n { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: var(--r-circle); background: var(--bg); color: var(--accent-dark); border: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--size-xs); }
.notes__title { display: block; font-size: var(--size-sm); font-weight: var(--weight-medium); line-height: 1.45; }
.notes__text { margin: 2px 0 0; font-size: var(--size-xs); line-height: 1.6; color: var(--text-muted); }
.notes__text code, .notes__foot code { color: var(--text); }
.notes__foot { margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: var(--size-xs); line-height: 1.6; color: var(--text-muted); }
.facts { position: relative; z-index: 1; margin-top: 34px; background: var(--bg-panel); color: var(--text); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts__list { max-width: var(--content); margin: 0 auto; padding-inline: var(--gutter); min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.facts__item { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 0; font-family: var(--font-mono); font-size: var(--size-xs); }
.facts__item dt { color: var(--text-muted); letter-spacing: var(--track-label); }
.facts__item dd { margin: 0; color: var(--text); }
.facts__div { width: 4px; height: 4px; border-radius: var(--r-circle); background: var(--border-strong); flex-shrink: 0; }

.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { margin: 0; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-btn); overflow: hidden; }
.swatch__paint { height: 64px; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.swatch figcaption { padding: 10px; font-family: var(--font-mono); font-size: var(--size-xs); overflow-wrap: anywhere; }
.paint-bg { background: var(--bg); }
.paint-panel { background: var(--bg-panel); }
.paint-panel2 { background: var(--bg-panel-2); }
.paint-border { background: var(--border); }
.paint-border-strong { background: var(--border-strong); }
.paint-accent { background: var(--accent); }
.paint-accent-dark { background: var(--accent-dark); }
.paint-grad { background: var(--grad-end); }
.paint-text { background: var(--text); }
.paint-muted { background: var(--text-muted); }
.paint-faint { background: var(--text-faint); }
.paint-success { background: var(--success); }
.paint-warn { background: var(--warn); }
.paint-error { background: var(--error); }
.paint-accent-soft { background: var(--accent-soft); }
.paint-success-soft { background: var(--success-soft); }
.paint-error-soft { background: var(--error-soft); }
.paint-warn-soft { background: var(--warn-soft); }
.paint-success-ink { background: var(--success-ink); }
.paint-warn-ink { background: var(--warn-ink); }
.paint-error-ink { background: var(--error-ink); }
.paint-deep { background: var(--fact-deep); }
.paint-teal { background: var(--fact-teal); }
.preview-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.type-display { font-family: var(--font-display); font-size: var(--h1-size); font-weight: var(--weight-regular); letter-spacing: var(--track-display); line-height: 1.2; }
.preview-note { color: var(--text-muted); font-size: var(--size-sm); }

@media (max-width: 1180px) {
  .facts__list { padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; justify-content: center; }
  .facts__div { display: none; }
}
@media (max-width: 980px) {
  .fig__body { grid-template-columns: minmax(0, 1fr); }
  .fig__notes { border-left: 0; border-top: 1px solid var(--border); }
  .notes__foot { margin-top: 12px; }
  .tabs { gap: 24px; grid-template-columns: minmax(170px, 0.3fr) minmax(0, 1fr); }
  .fact-cards { gap: 16px; }
}
@media (max-width: 640px) {
  .hero__lede { font-size: var(--size-body); }
  .devices { gap: 12px 16px; }
  .devices__sep { display: none; }
  .fig-wrap { width: calc(100% - var(--gutter) * 2); }
  .fig__bar { padding-inline: 14px; }
  .fig__order { display: none; }
  .fig__table { padding: 8px 10px 12px; }
  .rules td.rule code { font-size: var(--size-xs); }
  .tabs { grid-template-columns: minmax(0, 1fr); }
  .tabs [role="tablist"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .tabs [role="tab"] { padding: 10px; gap: 8px; font-size: var(--size-sm); }
  .tab-panel { padding: 22px; }
  .shot-row { flex-direction: column; align-items: center; }
  .fact-cards { grid-template-columns: minmax(0, 1fr); }
  .fact-card { padding: 32px 24px; }
  .store-guide-card { flex-direction: column; align-items: flex-start; padding: 22px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-pills { flex-direction: row; flex-wrap: wrap; gap: 6px; }
}