:root {
  --component-tab-height: 50px;
  --component-fab-offset: 20px;
  --component-icon-size: 48px;
}

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

[role="tablist"].tabs,
.tabs {
  max-width: 100%;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 6px;
  background: var(--color-panel);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tabs [role="tab"] {
  min-width: max-content;
  min-height: var(--component-tab-height);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-muted);
  font-weight: 720;
}

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

.tabs [role="tab"][aria-selected="true"],
.tabs [role="tab"].active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 7px 18px var(--color-accent-glow);
}

[role="tabpanel"] {
  min-width: 0;
  margin-top: 20px;
}

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

.workflow-browser {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 22px;
}

.workflow-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.workflow-tabs [role="tab"] {
  width: 100%;
  min-height: 76px;
  padding: 13px 15px 13px 18px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: transparent;
  color: var(--color-muted);
  text-align: left;
}

.workflow-tabs [role="tab"] strong,
.workflow-tabs [role="tab"] span {
  display: block;
}

.workflow-tabs [role="tab"] strong {
  color: var(--color-text);
  font-size: 15px;
}

.workflow-tabs [role="tab"] span {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.workflow-tabs [role="tab"][aria-selected="true"] {
  position: relative;
  border-left-color: var(--color-accent);
  background: var(--color-panel);
}

.workflow-tabs [role="tab"][aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  width: 11px;
  height: 11px;
  transform: translateY(-50%);
  border: 2px solid var(--color-bg);
  border-radius: var(--radius-pill);
  background: var(--color-warn);
}

.workflow-canvas {
  min-height: 430px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.toc-tabs {
  max-width: 100%;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 7px;
  background: var(--color-panel);
  position: sticky;
  top: calc(var(--nav-height) + 10px);
  z-index: 20;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.toc-tabs a {
  min-width: max-content;
  min-height: 42px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

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

.faq-item summary {
  min-height: 66px;
  padding: 18px 54px 18px 20px;
  cursor: pointer;
  position: relative;
  list-style: none;
  font-weight: 760;
}

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

.faq-item summary::before,
.faq-item summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 14px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.faq-item summary::after {
  transform: rotate(90deg);
  transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
  transform: rotate(0);
}

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

.term-card {
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.term-code {
  margin-bottom: 10px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

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

.term-card p {
  color: var(--color-muted);
  font-size: 14px;
}

.client-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  display: grid;
  gap: 18px;
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.client-card.is-featured {
  border-color: var(--color-accent);
  box-shadow: 0 14px 34px var(--color-accent-glow);
}

.client-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.client-icon {
  width: var(--component-icon-size);
  height: var(--component-icon-size);
  flex-shrink: 0;
}

.client-title {
  flex: 1;
}

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

.client-title p {
  color: var(--color-muted);
  font-size: 13px;
}

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

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

.badge,
.tag,
.chip {
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.2;
}

.badge {
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-muted);
}

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

.badge-featured {
  border-color: var(--color-warn);
  background: var(--color-warn-soft);
  color: var(--color-text);
}

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

.badge::before,
.chip-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.tag,
.chip {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-bg);
  color: var(--color-muted);
}

.blog-card {
  height: 100%;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.blog-card-meta {
  margin-bottom: 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.blog-card h3 {
  font-size: 22px;
  line-height: 1.35;
}

.blog-card p {
  color: var(--color-muted);
  font-size: 14px;
}

.blog-card-link {
  margin-top: auto;
  padding-top: 18px;
  color: var(--color-accent-dark);
  font-weight: 750;
}

.callout {
  margin: 24px 0;
  padding: 18px 20px 18px 22px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.callout-warn {
  border-left-color: var(--color-warn);
  background: var(--color-warn-soft);
}

.callout-error {
  border-left-color: var(--color-error);
  background: var(--color-error-soft);
}

.callout-title {
  margin-bottom: 6px;
  font-weight: 780;
}

.download-guide-card {
  margin-top: 56px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  box-shadow: var(--shadow-card);
}

.download-guide-card h2,
.download-guide-card h3 {
  margin-bottom: 10px;
}

.download-guide-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dl-fab {
  position: fixed;
  z-index: 80;
  right: max(var(--component-fab-offset), env(safe-area-inset-right));
  bottom: max(var(--component-fab-offset), env(safe-area-inset-bottom));
  max-width: min(320px, calc(100vw - 32px));
}

.dl-fab a {
  min-height: 58px;
  padding: 9px 18px 9px 10px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-float);
  font-weight: 760;
}

.dl-fab-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: var(--color-white);
  color: var(--color-accent-dark);
}

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

.data-table {
  width: 100%;
}

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

.hero-preview {
  min-height: 826px;
  position: relative;
  overflow: hidden;
  overflow-x: clip;
  background: var(--color-bg);
}

.hero-preview::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 1040px;
  height: 430px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 22% 55%, var(--color-error-glow), transparent 31%),
    radial-gradient(circle at 78% 65%, var(--color-accent-glow), transparent 31%);
  pointer-events: none;
}

.hero-preview::after {
  content: "";
  position: absolute;
  top: 320px;
  left: 50%;
  width: min(1160px, 96vw);
  height: 400px;
  transform: translateX(-50%) perspective(600px) rotateX(67deg);
  transform-origin: center top;
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, var(--color-text) 22%, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, var(--color-text) 22%, transparent 82%);
  pointer-events: none;
}

.hero-preview-copy {
  width: min(100%, calc(1080px + (var(--gutter) * 2)));
  margin-inline: auto;
  padding: 41px var(--gutter) 0;
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-preview h1 {
  max-width: 1020px;
  margin: 0 auto;
  font-size: clamp(52px, 5.35vw, 72px);
  line-height: 1.1;
  font-weight: 840;
}

.hero-description {
  margin: 15px auto 0;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.65;
}

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

.hero-actions {
  margin-top: 19px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.trust-row {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-chip {
  max-width: 100%;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
}

.trust-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.download-console {
  position: absolute;
  z-index: 3;
  top: 403px;
  left: 50%;
  width: min(calc(100% - 96px), var(--page-width));
  height: 382px;
  transform: translateX(-50%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-bg);
  box-shadow: var(--shadow-device);
}

.download-console::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 68px;
  left: 68px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--gradient-edge);
  opacity: 0.62;
}

.platform-tabs {
  height: 82px;
  padding: 13px 20px 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  border-bottom: 1px solid var(--color-border-soft);
}

.platform-tab {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-muted);
  background: var(--color-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  font-size: 14px;
  font-weight: 720;
}

.platform-tab svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.platform-tab.active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.platform-tab.active::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 34px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: var(--color-warn);
}

.console-body {
  height: 299px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1.2fr 0.82fr 0.78fr;
  gap: 16px;
  background: var(--color-panel);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.console-card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

.console-card-heading {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 780;
}

.console-status {
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
}

.console-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.release-file {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  display: flex;
  align-items: center;
  gap: 13px;
}

.file-symbol {
  width: 40px;
  height: 46px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-accent-dark);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.file-name {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  font-weight: 650;
}

.file-meta {
  margin-top: 4px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.download-line {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-download {
  min-height: 39px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 760;
}

.release-note {
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.45;
}

.architecture-list,
.install-methods {
  display: grid;
  gap: 9px;
}

.architecture {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
  background: var(--color-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.architecture.active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.architecture-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.architecture-note {
  color: var(--color-muted);
  font-size: 10px;
}

.architecture-check {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  color: var(--color-white);
  font-size: 10px;
}

.architecture.active .architecture-check {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.method-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 650;
}

.command {
  min-height: 55px;
  padding: 11px 12px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-code);
  color: var(--color-white);
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  white-space: nowrap;
}

.command-prompt {
  margin-right: 8px;
  color: var(--color-warn);
  font-weight: 800;
}

.setup-steps {
  padding-top: 4px;
  display: flex;
  align-items: center;
}

.setup-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  font-size: 10px;
}

.step-index {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
  color: var(--color-text);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

.step-line {
  width: 18px;
  flex-shrink: 0;
  margin: 0 6px;
  border-top: 1px dashed var(--color-border);
}

.preview-section {
  padding-top: 88px;
  padding-bottom: 88px;
}

.preview-title {
  max-width: 720px;
  margin-bottom: 34px;
}

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

.token-card {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.token-swatch {
  height: 72px;
  margin-bottom: 11px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
}

.swatch-bg { background: var(--color-bg); }
.swatch-panel { background: var(--color-panel); }
.swatch-panel-strong { background: var(--color-panel-strong); }
.swatch-border { background: var(--color-border); }
.swatch-accent { background: var(--color-accent); }
.swatch-accent-dark { background: var(--color-accent-dark); }
.swatch-text { background: var(--color-text); }
.swatch-muted { background: var(--color-muted); }
.swatch-success { background: var(--color-accent); }
.swatch-warn { background: var(--color-warn); }
.swatch-error { background: var(--color-error); }
.swatch-coral { background: var(--color-coral); }

.token-name {
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.type-sample {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.type-label {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

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

@media (max-width: 980px) {
  .workflow-browser {
    grid-template-columns: 1fr;
  }

  .workflow-tabs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 70vw);
    overflow-x: auto;
    padding-bottom: 6px;
  }

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

  .download-console {
    top: 420px;
    width: calc(100% - 48px);
  }
}

@media (max-width: 768px) {
  .hero-preview {
    min-height: 960px;
  }

  .hero-preview-copy {
    padding-top: 34px;
  }

  .hero-preview h1 {
    font-size: clamp(28px, 9vw, 40px);
  }

  .hero-description {
    font-size: 15px;
  }

  .download-console {
    top: 430px;
    height: auto;
  }

  .platform-tabs {
    height: auto;
    grid-template-columns: repeat(5, minmax(76px, 1fr));
    overflow-x: auto;
  }

  .platform-tab {
    min-height: 58px;
  }

  .console-body {
    height: auto;
    grid-template-columns: 1fr;
  }

  .console-card:nth-child(n+2) {
    display: none;
  }

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

@media (max-width: 640px) {
  .tabs [role="tab"] {
    min-height: 46px;
    padding-inline: 14px;
  }

  .toc-tabs {
    top: calc(var(--nav-height) + 6px);
  }

  .client-head {
    flex-wrap: wrap;
  }

  .client-actions .button {
    width: 100%;
  }

  .download-guide-actions .button {
    width: 100%;
  }

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

  .dl-fab a {
    min-height: 54px;
  }

  .hero-preview {
    min-height: 850px;
  }

  .hero-actions .button {
    width: min(100%, 290px);
  }

  .download-console {
    top: 445px;
    width: calc(100% - 32px);
    border-radius: var(--radius-lg);
  }

  .download-console::before {
    right: 28px;
    left: 28px;
  }

  .platform-tabs {
    padding-inline: 10px;
  }

  .platform-tab {
    gap: 6px;
    font-size: 11px;
  }

  .platform-tab svg {
    width: 18px;
    height: 18px;
  }

  .console-body {
    padding: 12px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .console-card {
    padding: 15px;
  }

  .download-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .token-grid {
    grid-template-columns: 1fr;
  }
}