.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 7px 15px 7px 13px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}
.badge__dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--r-circle);
  background: var(--accent);
  color: var(--on-accent);
}
.badge__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-circle);
  background: var(--accent);
  color: var(--on-accent);
}
.tag-label {
  display: inline-flex;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: var(--size-label);
  overflow-wrap: anywhere;
}
.fact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  margin: var(--space-5) 0 0;
  list-style: none;
}
.fact-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 6px var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--size-label);
  overflow-wrap: anywhere;
}
.fact-pill b { color: var(--text); font-weight: var(--weight-semibold); }
.fact-pill svg { width: 16px; height: 16px; flex-shrink: 0; }

.devices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.device {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.device:hover { color: var(--accent-dark); }
.device svg, .device-card__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.device svg .solid { fill: var(--text-muted); stroke: none; }
.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  font-size: var(--size-label);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.store-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
.appstore-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 64px;
  max-width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--r-strip);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-cta);
  text-decoration: none;
  line-height: 1.2;
}
.appstore-button:hover, .appstore-button.is-hover {
  background: var(--accent-dark);
  color: var(--on-accent);
}
.appstore-button svg { width: 26px; height: 26px; flex-shrink: 0; fill: currentColor; }
.appstore-button__text { min-width: 0; }
.appstore-button small { display: block; margin-bottom: var(--space-1); font-size: 12px; }
.appstore-button strong { display: block; font-size: 18px; }
.appstore-button.is-focus { outline: 3px solid var(--accent-dark); outline-offset: 4px; }
.appstore-button[aria-disabled="true"] {
  background: var(--bg-panel-2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}
.store-guide {
  padding: var(--space-6);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}
.store-guide h2, .store-guide h3 { margin-top: 0; }
.store-guide p { color: var(--text-muted); }

.frame {
  position: relative;
  min-width: 0;
  margin: 0;
  border-radius: var(--r-frame);
  overflow: hidden;
  background: radial-gradient(120% 90% at 14% 0%, var(--glow) 0%, var(--clear) 52%), linear-gradient(158deg, var(--frame-from), var(--frame-to));
  color: var(--text);
  box-shadow: var(--shadow-xl), inset 0 0 0 1px var(--veil-line);
}
.stage {
  position: relative;
  width: 635px;
  height: 590px;
  margin: 0 auto;
  zoom: var(--z);
}
.sheet { position: absolute; left: 44px; top: 84px; width: 384px; height: 322px; }
.sheet__under {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-paper);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transform: translate(14px, 12px) rotate(2.4deg);
}
.paper {
  position: absolute;
  inset: 0;
  padding-top: 27px;
  padding-bottom: 27px;
  border: 1px solid var(--border);
  border-radius: var(--r-paper);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-paper);
}
.code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-ligatures: none;
  color: var(--text);
}
.ln {
  display: grid;
  grid-template-columns: 28px auto;
  column-gap: 16px;
  align-items: center;
  height: 38px;
  padding-left: 19px;
  line-height: 38px;
  white-space: pre;
}
.ln__no { font-size: 12px; color: var(--text-muted); text-align: right; }
.ln .k { font-weight: var(--weight-bold); }
.ln .c { color: var(--text-muted); }
.ln .s { color: var(--text-muted); font-weight: var(--weight-semibold); }
.ln .p { color: var(--text-muted); }
.marks {
  position: absolute;
  inset: 0;
  width: 384px;
  height: 322px;
  overflow: visible;
  pointer-events: none;
}
.marks path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.marks .thin { stroke-width: 1.2; opacity: 0.55; }
.marks .lead { stroke-width: 1.6; }
.tag {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 14px 10px;
  border-radius: var(--r-tag);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-tag);
  white-space: nowrap;
}
.tag__key {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-bold);
  line-height: 14px;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
}
.tag__txt { font-size: 13px; font-weight: var(--weight-semibold); line-height: 18px; color: var(--text); }
.tag--1 { left: 300px; top: -18px; rotate: -1.2deg; }
.tag--2 { left: 292px; top: 214px; rotate: 0.8deg; }
.tag--3 { left: 236px; top: 312px; rotate: -0.6deg; }
.strip {
  position: absolute;
  left: 28px;
  right: 108px;
  bottom: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--veil-line);
  border-radius: var(--r-strip);
  background: var(--veil);
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}
.strip b { color: var(--text); font-weight: var(--weight-semibold); }
.strip a { color: var(--accent-dark); font-weight: var(--weight-semibold); text-decoration: none; }
.frame__go {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: var(--r-circle);
  background: var(--bg);
  color: var(--accent);
  box-shadow: var(--shadow-tag);
}
.frame__go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.tabs { min-width: 0; }
[role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
[role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-tag);
  background: var(--bg);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}
[role="tab"]:hover { color: var(--accent-dark); }
[role="tab"][aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
[role="tabpanel"] { min-width: 0; scroll-margin-top: var(--space-6); }
.feature-deck { position: relative; }
.feature-deck__top {
  display: grid;
  grid-template-columns: minmax(0, 60fr) minmax(0, 40fr);
  gap: var(--space-7);
  align-items: center;
}
.feature-deck__top > * { min-width: 0; }
.feature-deck__heading { max-width: 16em; margin: 0; font-size: var(--size-h2); }
.feature-deck__links { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: var(--space-6); }
.feature-deck__links a { font-weight: var(--weight-bold); text-decoration: none; }
.feature-deck__tiles[role="tablist"] {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  gap: var(--space-5);
  margin: 0 -72px var(--space-7) 0;
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.feature-deck__tiles [role="tab"] {
  flex-direction: column;
  width: 112px;
  min-height: 112px;
  padding: var(--space-3);
  border: 2px solid var(--bg);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-paper);
  font-size: 12px;
}
.feature-deck__tiles [role="tab"]:nth-child(3n + 2) { transform: translateY(56px); }
.feature-deck__tiles [role="tab"][aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.feature-deck__tiles svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
  margin-top: var(--space-7);
  padding: var(--space-6);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-paper);
}
.feature-detail > * { min-width: 0; }
.feature-detail h3 { margin-top: 0; }
.feature-detail p { margin-bottom: 0; color: var(--text-muted); }
.rule-note {
  position: relative;
  min-width: 0;
  padding: var(--space-5);
  border-radius: var(--r-paper);
  background: var(--bg-panel);
  color: var(--text);
}
.rule-note pre { margin: 0; padding: 0; }
.rule-note__caption { display: block; margin-top: var(--space-4); color: var(--accent-dark); font-size: var(--size-small); }
.annotation-circle {
  display: inline-block;
  padding-inline: var(--space-2);
  border: 2px solid var(--accent);
  border-radius: var(--r-circle);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  margin-bottom: var(--space-7);
  border-radius: var(--r-strip);
  background: var(--bg-panel);
  color: var(--text);
}
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-paper);
  color: var(--text-muted);
  text-decoration: none;
}
.toc a:hover, .toc a[aria-current] { background: var(--bg); color: var(--accent-dark); }
.toc--sticky { position: sticky; top: var(--space-4); z-index: 5; }
.faq-item {
  margin-bottom: var(--space-3);
  border-radius: var(--r-strip);
  background: var(--bg-panel);
  color: var(--text);
}
.faq-item summary {
  position: relative;
  padding: var(--space-5) 56px var(--space-5) var(--space-5);
  min-height: 48px;
  list-style: none;
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: var(--space-5); top: var(--space-5); color: var(--accent-dark); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { padding: 0 var(--space-5) var(--space-5); color: var(--text-muted); }
.faq-item__body > :last-child { margin-bottom: 0; }
.term-card {
  padding: var(--space-6);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}
.term-card h3, .term-card dt { margin: 0 0 var(--space-3); font-size: var(--size-h3); font-weight: var(--weight-bold); }
.term-card p, .term-card dd { margin: 0; color: var(--text-muted); }
.term-card code { color: var(--accent-dark); }
.official-shot {
  width: 100%;
  max-width: 280px;
  flex-shrink: 0;
  margin: 0 auto;
  padding: 0;
}
.official-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-paper);
  border: 1px solid var(--border);
}
.official-shot figcaption { margin-top: var(--space-3); color: var(--text-muted); font-size: var(--size-label); text-align: center; }
.shot-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 750 / 1334;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--r-paper);
  background: var(--bg-panel-2);
  color: var(--text-muted);
  text-align: center;
}
.device-card {
  display: block;
  min-width: 0;
  padding: var(--space-7);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}
.device-card:hover { color: var(--text); box-shadow: var(--shadow-paper); }
.device-card__icon { width: 48px; height: 48px; margin-bottom: var(--space-5); }
.device-card h3 { margin: 0 0 var(--space-3); }
.device-card p { color: var(--text-muted); }
.device-card__link { color: var(--accent-dark); font-weight: var(--weight-bold); }
.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-6);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}
.article-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; color: var(--text-muted); font-size: var(--size-label); }
.article-card h3 { margin: var(--space-5) 0 var(--space-4); }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { color: var(--text-muted); }
.article-card__more { margin-top: auto; font-weight: var(--weight-semibold); text-decoration: none; }
.callout {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-strip) var(--r-strip) 0;
  background: var(--accent-soft);
  color: var(--text);
}
.callout p:last-child { margin-bottom: 0; }
.table-scroll { 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-small); }
.data-table th, .data-table td, .prose table th, .prose table td {
  min-width: 7em;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-bold); }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
}
.prose table code, .data-table code { overflow-wrap: anywhere; }
.dl-fab {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--layer-fab);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  max-width: calc(100% - var(--space-6));
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-tag);
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.dl-fab svg { width: 15px; height: 15px; flex-shrink: 0; }
.dl-fab:hover { color: var(--accent-dark); }

.palette-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }
.swatch { min-width: 0; margin: 0; }
.swatch__sample { display: block; height: 72px; border: 1px solid var(--border); border-radius: var(--r-tag); }
.swatch figcaption { margin-top: var(--space-2); font: var(--size-label)/1.6 var(--font-mono); color: var(--text-muted); overflow-wrap: anywhere; }
.swatch--bg { background: var(--bg); color: var(--text); }
.swatch--panel { background: var(--bg-panel); color: var(--text); }
.swatch--panel2 { background: var(--bg-panel-2); color: var(--text); }
.swatch--border { background: var(--border); color: var(--text); }
.swatch--accent { background: var(--accent); color: var(--on-accent); }
.swatch--dark { background: var(--accent-dark); color: var(--on-accent); }
.swatch--soft { background: var(--accent-soft); color: var(--text); }
.swatch--text { background: var(--text); color: var(--bg); }
.swatch--muted { background: var(--text-muted); color: var(--bg); }
.swatch--faint { background: var(--text-faint); color: var(--text); }
.swatch--success { background: var(--success); color: var(--text); }
.swatch--warn { background: var(--warn); color: var(--text); }
.swatch--error { background: var(--error); color: var(--bg); }
.swatch--from { background: var(--frame-from); color: var(--text); }
.swatch--to { background: var(--frame-to); color: var(--text); }
.swatch--glow { background: var(--glow); color: var(--text); }
.swatch--clear { background: var(--clear); color: var(--text); }
.swatch--veil { background: var(--veil); color: var(--text); }
.swatch--veil-line { background: var(--veil-line); color: var(--text); }
.swatch--on { background: var(--on-accent); color: var(--text); }
.preview-type h1 { margin-top: 0; }
.preview-note { color: var(--text-muted); font-size: var(--size-small); }
.preview-footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.preview-footer-nav a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 1060px) {
  .feature-deck__top { grid-template-columns: minmax(0, 1fr); }
  .feature-deck__tiles[role="tablist"] { margin-right: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-deck__tiles [role="tab"] { width: 100%; }
  .feature-deck__tiles [role="tab"]:nth-child(3n + 2) { transform: none; }
}
@media (max-width: 740px) {
  .frame { border-radius: var(--r-card); }
  .dl-fab { right: var(--space-4); bottom: var(--space-4); }
}
@media (max-width: 640px) {
  .feature-detail { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); padding: var(--space-5); }
  .feature-deck__tiles[role="tablist"] { gap: var(--space-3); }
  .feature-deck__tiles [role="tab"] { min-height: 100px; padding: var(--space-2); }
  .device-card { padding: var(--space-6); }
  .official-shot { margin-inline: auto; }
  .fact-row { flex-direction: row; flex-wrap: wrap; }
  .tag--1, .tag--2, .tag--3 { rotate: none; }
  .sheet__under { transform: translate(10px, 10px); }
  .toc--sticky { position: static; }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}