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

.tab-list {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  padding: 0 0 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab-list[aria-orientation="vertical"] {
  align-items: stretch;
  flex-direction: column;
  overflow: visible;
  border-right: 1px solid var(--color-border);
  border-bottom: 0;
  padding: 0 14px 0 0;
}

.tab-button,
[role="tab"] {
  min-width: max-content;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 8px 14px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.tab-button:hover,
[role="tab"]:hover {
  background: var(--color-panel);
  color: var(--color-text);
}

.tab-button.is-active,
.tab-button[aria-selected="true"],
[role="tab"].is-active,
[role="tab"][aria-selected="true"] {
  border-color: var(--color-border);
  background: var(--color-page);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

[role="tabpanel"] {
  min-width: 0;
}

[role="tabpanel"]:focus-visible {
  outline-offset: 5px;
}

.workflow-index {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px;
}

.workflow-panel {
  min-height: 390px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-page);
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow-soft);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
  border-top: 1px dashed var(--color-border-dark);
  padding-top: 18px;
}

.workflow-step {
  position: relative;
  min-width: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.workflow-step::before {
  content: "";
  position: absolute;
  top: -23px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid var(--color-page);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-border-dark);
}

.toc-tabs {
  position: sticky;
  z-index: 20;
  top: 10px;
  display: flex;
  max-width: 100%;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-page);
  padding: 7px;
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
}

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

.toc-tabs a:hover,
.toc-tabs a:focus-visible {
  background: var(--color-panel);
  color: var(--color-text);
}

.faq-list {
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
  min-height: 62px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 4px;
  color: var(--color-text);
  font-weight: 800;
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--color-panel);
}

.faq-answer {
  max-width: 820px;
  padding: 0 48px 22px 4px;
  color: var(--color-muted);
}

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

.term-card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-page);
  padding: 20px;
}

.term-card dt {
  margin-bottom: 7px;
  color: var(--color-text);
  font-size: 17px;
  font-weight: 850;
}

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

.term-code {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--color-panel-strong);
  padding: 4px 7px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 11px;
}

.download-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--color-page);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.download-card.is-featured {
  border-color: var(--color-accent);
  box-shadow:
    0 0 0 2px var(--color-panel-strong),
    var(--shadow-soft);
}

.download-card.is-archived {
  background: var(--color-panel);
}

.download-card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.download-card-title {
  min-width: 0;
}

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

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

.download-card-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.version-slot,
[data-cdnver] {
  display: none;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.version-slot.has-value,
[data-cdnver].has-value {
  display: inline;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  padding: 3px 9px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--color-border-dark);
}

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

.badge-primary::before {
  background: var(--color-accent);
}

.badge-recommended {
  color: var(--color-success);
}

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

.badge-archived {
  color: var(--color-error);
}

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

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

.post-card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  background: var(--color-page);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.post-card-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

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

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

.post-card-link {
  margin-top: auto;
  padding-top: 16px;
  color: var(--color-accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.callout {
  position: relative;
  min-width: 0;
  margin: 24px 0;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-panel);
  padding: 18px 20px;
  color: var(--color-muted);
}

.callout strong,
.callout-title {
  color: var(--color-text);
}

.callout-success {
  border-left-color: var(--color-success);
}

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

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

.article-download-card,
.end-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 54px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  padding: 26px;
}

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

.article-download-actions,
.end-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dl-fab {
  position: fixed;
  z-index: 70;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(16px, 3vw, 30px);
  max-width: calc(100vw - 32px);
}

.dl-fab a {
  min-height: 50px;
  border: 1px solid var(--color-accent-dark);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 10px 16px;
  box-shadow: var(--shadow-device);
  font-size: 14px;
  font-weight: 850;
}

.dl-fab svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

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

.preview-block {
  padding-top: 74px;
  padding-bottom: 74px;
}

.preview-label {
  margin-bottom: 26px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.swatch {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-page);
}

.swatch-color {
  height: 72px;
  border-bottom: 1px solid var(--color-border);
}

.swatch-info {
  padding: 10px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

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

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

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

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

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

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

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

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

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

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

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

.preview-hero {
  min-height: 830px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-page);
}

.preview-hero-copy {
  max-width: 1040px;
  margin-inline: auto;
  padding: 25px var(--gutter) 0;
  text-align: center;
}

.preview-hero-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(52px, 4.35vw, 66px);
  line-height: 1.1;
}

.preview-hero-copy .lead {
  margin: 0 auto;
  font-size: 16px;
}

.preview-hero-copy .button-row,
.preview-hero-copy .inline-list {
  justify-content: center;
}

.preview-hero-copy .button-row {
  margin-top: 16px;
}

.preview-facts {
  margin-top: 12px;
}

.platform-link-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
}

.platform-link {
  min-width: 112px;
  min-height: 33px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--color-page);
  color: var(--color-text);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 750;
}

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

.fleet-wrap {
  position: relative;
  width: min(var(--page-width), calc(100% - 64px));
  height: 388px;
  margin: 13px auto 0;
}

.fleet-stage {
  position: relative;
  height: 100%;
}

.device-baseline {
  position: absolute;
  top: 197px;
  right: 26px;
  left: 26px;
  height: 1px;
  background: var(--color-border-dark);
}

.device-baseline::before,
.device-baseline::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-pill);
  background: var(--color-page);
}

.device-baseline::before {
  left: -3px;
}

.device-baseline::after {
  right: -3px;
}

.device-grid,
.fleet-download-grid {
  display: grid;
  grid-template-columns: 1.22fr 1.22fr 1fr 0.72fr 0.72fr;
  gap: 10px;
}

.device-grid {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 14px;
  left: 14px;
  height: 198px;
  align-items: end;
}

.device-cell {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.fleet-board {
  position: absolute;
  top: 210px;
  right: 0;
  bottom: 6px;
  left: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  padding: 35px 14px 14px;
  box-shadow: var(--shadow-soft);
}

.fleet-caption {
  position: absolute;
  top: 10px;
  left: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.fleet-caption::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--color-accent);
}

.fleet-download-grid {
  height: 100%;
}

.fleet-card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 4px 8px;
  background: var(--color-page);
  padding: 10px 11px;
  box-shadow: var(--shadow-soft);
}

.fleet-card strong {
  min-width: 0;
  color: var(--color-text);
  font-size: 12px;
}

.fleet-card span {
  min-width: 0;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  overflow-wrap: anywhere;
}

.fleet-card a {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  background: var(--color-panel);
  color: var(--color-accent);
}

.fleet-card svg {
  width: 13px;
  height: 13px;
}

.device-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-page);
  padding: 9px;
}

.screen-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 6px;
}

.chrome-dots {
  display: flex;
  gap: 3px;
}

.chrome-dots i {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--color-border-dark);
}

.chrome-dots i:first-child {
  background: var(--color-error);
}

.chrome-dots i:nth-child(2) {
  background: var(--color-warn);
}

.chrome-dots i:last-child {
  background: var(--color-success);
}

.device-content {
  height: calc(100% - 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.screen-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
}

.screen-setting {
  color: var(--color-muted);
  font-size: 6px;
  font-weight: 700;
}

.screen-setting strong {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--color-text);
  font-size: 7px;
}

.screen-switch {
  width: 24px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  display: flex;
  justify-content: flex-end;
  background: var(--color-success);
  padding: 2px;
}

.screen-switch::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--color-white);
}

.monitor-device {
  width: 222px;
  height: 181px;
}

.monitor-frame {
  height: 143px;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  padding: 7px;
  box-shadow: var(--shadow-device);
}

.monitor-neck {
  width: 31px;
  height: 24px;
  margin-inline: auto;
  border-inline: 2px solid var(--color-text);
  background: var(--color-page);
}

.monitor-foot {
  width: 84px;
  height: 7px;
  margin-inline: auto;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-pill);
  background: var(--color-page);
}

.laptop-device {
  width: 225px;
  height: 163px;
}

.laptop-lid {
  width: 196px;
  height: 143px;
  margin-inline: auto;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-xs) var(--radius-xs);
  background: var(--color-white);
  padding: 6px;
  box-shadow: var(--shadow-device);
}

.laptop-base {
  width: 225px;
  height: 9px;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-xs) var(--radius-xs) var(--radius-pill) var(--radius-pill);
  background: var(--color-page);
}

.terminal-device {
  width: 188px;
  height: 164px;
  overflow: hidden;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-terminal);
  box-shadow: var(--shadow-device);
}

.terminal-bar {
  height: 23px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-panel);
  padding: 0 8px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 6px;
}

.terminal-content {
  padding: 11px;
  color: var(--color-terminal-text);
  font-family: var(--font-mono);
  font-size: 6px;
  line-height: 1.75;
}

.terminal-content img {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.terminal-value {
  color: var(--color-success);
}

.phone-device {
  width: 82px;
  height: 171px;
  position: relative;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  padding: 5px;
  box-shadow: var(--shadow-device);
}

.phone-device::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 50%;
  width: 25px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-text);
  transform: translateX(-50%);
}

.phone-device .device-screen {
  border-radius: var(--radius-md);
  padding: 13px 5px 6px;
}

.phone-device .screen-chrome {
  font-size: 4px;
}

.phone-device .device-content {
  flex-direction: column;
  gap: 6px;
}

.phone-device .screen-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.phone-device .screen-setting {
  text-align: center;
  font-size: 5px;
}

.phone-device .screen-setting strong {
  flex-direction: column;
  font-size: 5px;
}

@media (max-width: 960px) {
  .workflow-index {
    grid-template-columns: 190px minmax(0, 1fr);
  }

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

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

  .fleet-wrap {
    width: calc(100% - 32px);
    overflow-x: auto;
  }

  .fleet-stage {
    width: 1120px;
  }
}

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

  .tab-list[aria-orientation="vertical"] {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    padding: 0 0 8px;
  }

  .glossary-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .article-download-card,
  .end-download-card {
    grid-template-columns: 1fr;
  }

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

  .preview-hero {
    min-height: auto;
    padding-bottom: 34px;
  }

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

@media (max-width: 640px) {
  .toc-tabs {
    top: 6px;
  }

  .workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }

  .faq-answer {
    padding-right: 4px;
  }

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

  .platform-link-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-link {
    min-width: 0;
  }

  .fleet-wrap {
    width: 100%;
    padding-inline: var(--gutter);
  }

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

  .dl-fab a {
    width: 100%;
    justify-content: center;
  }
}