:root {
  --component-outline: rgba(33, 69, 232, 0.18);
  --component-success-bg: rgba(18, 161, 80, 0.10);
  --component-warning-bg: rgba(232, 147, 12, 0.12);
  --component-error-bg: rgba(220, 59, 59, 0.10);
  --component-accent-bg: rgba(33, 69, 232, 0.08);
  --component-fab-shadow: rgba(16, 22, 43, 0.30);
}

.tabs {
  min-width: 0;
}

.tab-list {
  display: flex;
  max-width: 100%;
  margin: 0 0 28px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  gap: 4px;
  background: var(--color-panel);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab-list [role="tab"] {
  display: inline-flex;
  min-width: max-content;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 650;
  cursor: pointer;
}

.tab-list [role="tab"]:hover {
  color: var(--color-text);
}

.tab-list [role="tab"][aria-selected="true"],
.tab-list [role="tab"].is-active {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-near);
}

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

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

.toc-tabs {
  position: sticky;
  z-index: 30;
  top: calc(var(--header-height) + 12px);
  display: flex;
  max-width: 100%;
  margin-bottom: 42px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  gap: 5px;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-near);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.toc-tabs a {
  display: inline-flex;
  min-width: max-content;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  align-items: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.toc-tabs a:hover {
  background: var(--color-panel);
  color: var(--color-accent-dark);
}

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

.faq-item {
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-near);
}

.faq-item summary {
  position: relative;
  display: flex;
  min-height: 64px;
  padding: 17px 54px 17px 20px;
  align-items: center;
  color: var(--color-text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary::after {
  position: absolute;
  right: 20px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-accent-dark);
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 24px;
  text-align: center;
}

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

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

.faq-item__answer > :last-child {
  margin-bottom: 0;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.term-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-panel);
  color: var(--color-text);
}

.term-card::before {
  display: block;
  width: 40px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient-display);
  content: "";
}

.term-card h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

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

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.download-card {
  position: relative;
  display: flex;
  min-height: 100%;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.download-card--featured {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--component-outline), var(--shadow-card);
}

.download-card__head {
  display: flex;
  margin-bottom: 16px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.download-card__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.download-card__identity img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.download-card h3 {
  margin-bottom: 4px;
  font-size: 21px;
}

.download-card p {
  color: var(--color-text-muted);
}

.download-card__meta {
  display: flex;
  margin: auto 0 18px;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.download-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.version-slot:empty {
  display: none;
}

.badge,
.chip,
.tag-label {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 11px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  align-items: center;
  gap: 6px;
  background: var(--color-panel);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

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

.badge--primary,
.badge--recommended {
  border-color: var(--color-accent);
  background: var(--component-accent-bg);
  color: var(--color-accent-dark);
}

.badge--success {
  border-color: var(--color-success);
  background: var(--component-success-bg);
  color: var(--color-success);
}

.badge--warning {
  border-color: var(--color-warning);
  background: var(--component-warning-bg);
  color: var(--color-text);
}

.badge--retired {
  border-color: var(--color-error);
  background: var(--component-error-bg);
  color: var(--color-error);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.post-card {
  display: flex;
  min-height: 100%;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-near);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}

.post-card__meta {
  display: flex;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.post-card h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.35;
}

.post-card p {
  margin-bottom: 22px;
  color: var(--color-text-muted);
}

.post-card__link {
  display: inline-flex;
  min-height: 40px;
  margin-top: auto;
  align-items: center;
  color: var(--color-accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.callout {
  position: relative;
  margin: 28px 0;
  padding: 22px 24px 22px 28px;
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text);
}

.callout::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--gradient-frame);
  content: "";
}

.callout--success {
  background: var(--component-success-bg);
  color: var(--color-text);
}

.callout--warning {
  background: var(--component-warning-bg);
  color: var(--color-text);
}

.callout--danger {
  background: var(--component-error-bg);
  color: var(--color-text);
}

.callout h3,
.callout h4 {
  margin-bottom: 8px;
}

.callout > :last-child {
  margin-bottom: 0;
}

.feature-row {
  display: grid;
  padding-top: clamp(58px, 8vw, 96px);
  padding-bottom: clamp(58px, 8vw, 96px);
  border-bottom: 1px solid var(--color-border);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(42px, 7vw, 90px);
}

.feature-row:nth-child(even) .feature-row__visual {
  order: 2;
}

.feature-row__copy p {
  color: var(--color-text-muted);
  font-size: 17px;
}

.feature-link {
  display: inline-flex;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  align-items: center;
  color: var(--color-accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.feature-canvas {
  position: relative;
  min-height: 390px;
  overflow: clip;
  border-radius: var(--radius-frame);
}

.feature-canvas::before {
  position: absolute;
  inset: 8% 2% 4% 12%;
  padding: 1px;
  border-radius: var(--radius-frame);
  background: var(--gradient-frame);
  content: "";
  opacity: 0.25;
  -webkit-mask: linear-gradient(var(--color-black) 0 0) content-box, linear-gradient(var(--color-black) 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(var(--color-black) 0 0) content-box, linear-gradient(var(--color-black) 0 0);
  mask-composite: exclude;
}

.feature-window {
  position: absolute;
  inset: 40px 28px 26px 10px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-near), var(--shadow-far);
}

.feature-window__chrome {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  gap: 6px;
}

.feature-window__chrome i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.feature-window__chrome i:nth-child(1) {
  background: var(--color-error);
}

.feature-window__chrome i:nth-child(2) {
  background: var(--color-warning);
}

.feature-window__chrome i:nth-child(3) {
  background: var(--color-success);
}

.prose {
  color: var(--color-text);
}

.prose h2 {
  margin-top: 2.2em;
  scroll-margin-top: calc(var(--header-height) + 30px);
}

.prose h3 {
  margin-top: 1.8em;
  scroll-margin-top: calc(var(--header-height) + 30px);
}

.prose p,
.prose li {
  color: var(--color-text-muted);
}

.prose a {
  overflow-wrap: anywhere;
}

.prose > .data-table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-download-card {
  display: flex;
  margin-top: 48px;
  padding: 26px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-panel);
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: var(--component-accent-bg);
  color: var(--color-text);
}

.article-download-card h2,
.article-download-card h3 {
  margin-bottom: 6px;
  font-size: 22px;
}

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

.dl-fab {
  position: fixed;
  z-index: 60;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  max-width: min(330px, calc(100vw - 36px));
  min-height: 58px;
  padding: 9px 18px 9px 10px;
  border-radius: var(--radius-pill);
  align-items: center;
  gap: 11px;
  background: var(--color-black);
  color: var(--color-white);
  box-shadow: 0 18px 46px -16px var(--component-fab-shadow);
  font-weight: 700;
  text-decoration: none;
}

.dl-fab:hover {
  background: var(--color-accent-dark);
  color: var(--color-white);
}

.dl-fab__icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  background: var(--color-accent);
  color: var(--color-white);
}

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

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-row {
    grid-template-columns: 1fr;
  }

  .feature-row:nth-child(even) .feature-row__visual {
    order: 0;
  }
}

@media (max-width: 700px) {
  .glossary-grid,
  .download-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .toc-tabs {
    top: calc(var(--header-height) + 6px);
    border-radius: var(--radius-card);
  }

  .article-download-card {
    align-items: stretch;
    flex-direction: column;
  }

  .article-download-card .button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .feature-canvas {
    min-height: 330px;
  }

  .feature-window {
    inset: 24px 8px 18px;
    padding: 18px;
  }

  .download-card,
  .post-card,
  .term-card {
    padding: 20px;
  }

  .dl-fab {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}