.tab-shell {
  min-width: 0;
}

.tab-list {
  display: flex;
  max-width: 100%;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  color: var(--color-text-muted);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}

.tab-list [role='tab'] {
  min-width: max-content;
  min-height: 44px;
  border: 1px solid var(--color-transparent);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  color: inherit;
  background: var(--color-transparent);
  font-weight: 750;
}

.tab-list [role='tab']:hover {
  color: var(--color-code-key);
}

.tab-list [role='tab'][aria-selected='true'] {
  color: var(--color-text);
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark));
  box-shadow: 0 8px 22px var(--color-accent-a20);
}

[role='tabpanel'] {
  min-width: 0;
  padding-top: 28px;
}

[role='tabpanel'][hidden] {
  display: none;
}

.toc {
  position: relative;
  display: flex;
  max-width: 100%;
  gap: 8px;
  margin-bottom: 34px;
  padding: 9px;
  overflow-x: auto;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.toc a {
  min-width: max-content;
  padding: 8px 13px;
  color: var(--color-ink-muted);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.toc a:hover,
.toc a[aria-current='true'] {
  color: var(--color-code-key);
  background: var(--color-panel-raised);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.faq-item summary {
  position: relative;
  min-height: 58px;
  padding: 17px 52px 17px 20px;
  cursor: pointer;
  color: var(--color-ink);
  font-weight: 800;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--color-code-key);
  font-family: var(--font-mono);
  font-size: 23px;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--color-ink-muted);
}

.glossary-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.glossary-card::before {
  content: '';
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: -1px;
  width: 3px;
  background: linear-gradient(var(--color-accent), var(--color-cyan));
  border-radius: var(--radius-pill);
}

.glossary-term {
  display: inline-block;
  margin-bottom: 13px;
  color: var(--color-code-key);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.glossary-card p {
  margin-bottom: 0;
  color: var(--color-ink-muted);
}

.client-card {
  position: relative;
  min-width: 0;
  padding: 27px;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.client-card.is-featured {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft), 0 0 30px var(--color-accent-a10);
}

.client-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.client-title {
  min-width: 0;
}

.client-title h3 {
  margin-bottom: 4px;
}

.client-version {
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge,
.status-badge,
.tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.badge-featured {
  color: var(--color-night);
  background: var(--color-lime);
  border-color: var(--color-lime);
}

.badge-recommended {
  color: var(--color-text);
  background: var(--color-accent-dark);
  border-color: var(--color-code-key);
}

.badge-retired {
  color: var(--color-error);
  background: var(--color-surface-pure);
  border-color: var(--color-error);
}

.badge-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: currentColor;
  border-radius: 50%;
}

.article-card {
  display: grid;
  min-width: 0;
  gap: 15px;
  padding: 25px;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform var(--ease-standard), border-color var(--ease-standard), box-shadow var(--ease-standard);
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  box-shadow: 0 20px 48px var(--color-shadow-a18);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.article-card h3 {
  margin-bottom: 0;
}

.article-card p {
  margin-bottom: 0;
  color: var(--color-ink-muted);
}

.article-more {
  color: var(--color-code-key);
  font-weight: 800;
}

.callout {
  position: relative;
  min-width: 0;
  margin-block: 24px;
  padding: 20px 22px 20px 26px;
  color: var(--color-ink);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.callout::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

.callout strong {
  color: var(--color-code-key);
}

.callout-success::before {
  background: var(--color-success);
}

.callout-warning::before {
  background: var(--color-warning);
}

.callout-error::before {
  background: var(--color-error);
}

.dl-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: flex;
  width: min(310px, calc(100vw - 32px));
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-deep), var(--shadow-glow);
}

.dl-fab-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  color: var(--color-night);
  background: var(--color-cyan);
  border-radius: var(--radius-sm);
}

.dl-fab-icon svg {
  width: 19px;
  height: 19px;
}

.dl-fab-copy {
  min-width: 0;
}

.dl-fab-copy strong,
.dl-fab-copy span {
  display: block;
}

.dl-fab-copy strong {
  color: var(--color-text);
  font-size: 14px;
}

.dl-fab-copy span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.end-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  padding: 28px;
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-panel), var(--color-panel-raised));
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-deep);
}

.end-download-card h2,
.end-download-card h3 {
  color: var(--color-text);
}

.end-download-card p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.field-notes {
  display: grid;
  gap: 24px;
}

.field-note-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(60px, 1fr) minmax(0, 610px);
  align-items: center;
  gap: 20px;
}

.field-note-row:nth-child(even) {
  padding-left: 6%;
}

.field-key {
  justify-self: start;
  color: var(--color-code-key);
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-weight: 800;
}

.field-lead {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-cyan));
}

.field-lead::before,
.field-lead::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  background: var(--color-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-accent-a52);
}

.field-lead::before {
  left: 0;
}

.field-lead::after {
  right: 0;
}

.field-detail {
  min-width: 0;
  padding: 20px;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.field-note-row:hover .field-key {
  text-decoration: underline;
  text-decoration-color: var(--color-lime);
  text-decoration-thickness: 4px;
  text-underline-offset: 4px;
}

.preview-stage {
  position: relative;
  overflow-x: clip;
  overflow-y: hidden;
  color: var(--color-text);
  background:
    radial-gradient(880px 560px at 88% 4%, var(--color-accent-a20), var(--color-transparent) 62%),
    radial-gradient(1100px 720px at 72% 96%, var(--color-accent-dark-a34), var(--color-transparent) 64%),
    radial-gradient(760px 540px at 4% 100%, var(--color-accent-a20), var(--color-transparent) 60%),
    linear-gradient(32deg, var(--color-accent-dark-a20, var(--color-accent-a10)), var(--color-transparent) 46%, var(--color-accent-a10)),
    var(--color-night);
}

.preview-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--color-muted-a09) 1px, var(--color-transparent) 1.4px);
  background-size: 30px 30px;
  mask-image: radial-gradient(720px 560px at 74% 46%, var(--color-night), var(--color-transparent) 78%);
}

.preview-hero {
  position: relative;
  z-index: 2;
  padding-top: 52px;
  padding-bottom: 92px;
}

.preview-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 660px;
  gap: 52px;
  align-items: center;
}

.preview-hero-copy {
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 6px 14px;
  color: var(--color-text-muted);
  background: var(--color-panel-a50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success-a80);
}

.preview-hero h1 {
  color: var(--color-text);
}

.hero-accent {
  border-bottom: 4px solid var(--color-lime);
  padding-bottom: 2px;
}

.hero-description {
  max-width: 34em;
  margin-bottom: 30px;
  color: var(--color-text-muted);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-description strong {
  color: var(--color-text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 30px;
}

.hero-chip {
  padding: 6px 13px;
  color: var(--color-text-muted);
  background: var(--color-panel-raised-a35);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
}

.platform-strip {
  padding-top: 21px;
  border-top: 1px solid var(--color-border-a55);
}

.platform-caption {
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 12px;
  color: var(--color-text-muted);
  background: var(--color-panel-a40);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 650;
}

.platform-link svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.platform-link:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.hero-device {
  position: relative;
  width: 660px;
  height: 600px;
}

.code-window {
  position: absolute;
  top: 6px;
  left: 0;
  width: 540px;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-accent-dark), var(--color-accent) 46%, var(--color-cyan));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-deep), var(--shadow-glow);
}

.code-window::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -46px;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--color-accent-a20), var(--color-transparent) 74%);
  border-radius: var(--radius-pill);
}

.code-window-inner {
  overflow: hidden;
  background: linear-gradient(158deg, var(--color-panel), var(--color-night-a98) 68%);
  border-radius: 13px;
}

.code-window-bar {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
  background: var(--color-panel-raised-a35);
  border-bottom: 1px solid var(--color-border-a60);
}

.window-dot {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 50%;
}

.window-dot-error {
  background: var(--color-error);
}

.window-dot-warning {
  background: var(--color-warning);
}

.window-dot-success {
  background: var(--color-success);
}

.code-window-title,
.code-window-meta {
  font-family: var(--font-mono);
}

.code-window-title {
  margin-left: 10px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.code-window-meta {
  margin-left: auto;
  color: var(--color-code-punctuation);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.code-window-body {
  margin: 0;
  padding: 16px 20px;
  overflow: hidden;
  color: var(--color-code-punctuation);
  background: var(--color-transparent);
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 20px;
  white-space: pre;
}

.code-key {
  color: var(--color-code-key);
}

.code-string {
  color: var(--color-code-string);
}

.code-number {
  color: var(--color-cyan);
}

.code-highlight {
  padding-inline: 3px;
  color: var(--color-night);
  background: var(--color-lime);
  border-radius: 4px;
  box-shadow: 0 0 14px var(--color-lime-a38);
  font-weight: 800;
}

.code-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--color-cyan);
  animation: cursor-blink 1.1s steps(2, start) infinite;
}

.device-leads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.device-lead {
  fill: none;
  stroke: var(--color-cyan);
  stroke-width: 1.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 4px var(--color-accent-a52));
  animation: lead-draw 340ms ease-out forwards;
}

.device-lead-two {
  animation-delay: 220ms;
}

.device-lead-three {
  animation-delay: 440ms;
}

.device-lead-dot {
  fill: var(--color-cyan);
  filter: drop-shadow(0 0 5px var(--color-accent-a52));
}

.device-note {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  opacity: 0;
  color: var(--color-night);
  background: var(--color-lime);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 26px var(--color-shadow-a50), 0 0 22px var(--color-lime-a22);
  font-size: 13px;
  font-weight: 800;
  animation: note-in 380ms ease-out forwards;
}

.device-note-number {
  padding-right: 9px;
  border-right: 1px solid var(--color-ink-a28);
  font-family: var(--font-mono);
  font-size: 11px;
}

.device-note-one {
  top: 104px;
  left: 550px;
  animation-delay: 340ms;
}

.device-note-two {
  top: 214px;
  left: 518px;
  animation-delay: 560ms;
}

.device-note-three {
  top: 368px;
  left: 536px;
  animation-delay: 780ms;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.swatch {
  overflow: hidden;
  background: var(--color-surface-pure);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.swatch-color {
  height: 86px;
}

.swatch-night {
  background: var(--color-night);
}

.swatch-panel {
  background: var(--color-panel);
}

.swatch-panel-raised {
  background: var(--color-panel-raised);
}

.swatch-border {
  background: var(--color-border);
}

.swatch-accent {
  background: var(--color-accent);
}

.swatch-accent-dark {
  background: var(--color-accent-dark);
}

.swatch-cyan {
  background: var(--color-cyan);
}

.swatch-lime {
  background: var(--color-lime);
}

.swatch-text {
  background: var(--color-text);
}

.swatch-surface {
  background: var(--color-surface);
}

.swatch-label {
  padding: 11px;
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.type-sample-display {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 900;
}

.type-sample-body {
  max-width: 62em;
  color: var(--color-ink-muted);
}

.type-sample-mono {
  color: var(--color-code-key);
  font-family: var(--font-mono);
}

.button-showcase,
.badge-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-footer {
  margin-top: 0;
}

@keyframes cursor-blink {
  to {
    opacity: 0;
  }
}

@keyframes lead-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  .preview-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 58px;
  }

  .hero-device {
    margin-inline: auto;
    transform: scale(0.92);
    transform-origin: top center;
  }

  .swatches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero-device {
    display: none;
  }

  .preview-hero {
    padding-top: 42px;
    padding-bottom: 56px;
  }

  .field-note-row,
  .field-note-row:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-left: 0;
  }

  .field-lead {
    width: 1px;
    height: 26px;
    margin-left: 22px;
    background: linear-gradient(var(--color-accent), var(--color-cyan));
  }

  .field-lead::before {
    top: 0;
    left: -3px;
  }

  .field-lead::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: -3px;
  }

  .end-download-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tab-list [role='tab'] {
    padding-inline: 14px;
  }

  .dl-fab {
    right: 16px;
    bottom: 16px;
  }

  .hero-chips,
  .platform-list,
  .badge-showcase {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .swatches {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-lead {
    stroke-dashoffset: 0;
  }

  .device-note {
    opacity: 1;
  }

  .code-cursor {
    opacity: 1;
  }
}