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

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

.tab-list [role="tab"] {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 700;
}

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

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

.tab-panel {
  min-width: 0;
  padding-top: 28px;
}

.tab-panel[hidden] {
  display: none;
}

.toc-tabs {
  position: sticky;
  z-index: 20;
  top: 14px;
  display: flex;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
}

.toc-tabs a {
  min-width: max-content;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

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

.faq-item {
  min-width: 0;
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

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

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

.faq-item summary::after {
  content: "+";
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 19px;
  line-height: 27px;
  text-align: center;
}

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

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

.faq-answer p:last-child {
  margin-bottom: 0;
}

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

.glossary-card::before {
  content: "";
  position: absolute;
  top: 25px;
  left: 0;
  width: 4px;
  height: 30px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--color-violet);
}

.glossary-card dt {
  margin-bottom: 7px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}

.glossary-card dd {
  margin: 0;
  color: var(--color-text-muted);
}

.download-card {
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.download-card.is-featured {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}

.download-card.is-archived {
  background: var(--color-code-bg);
  color: var(--color-text);
}

.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: 5px;
}

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

.download-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.app-icon {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

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

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

.badge-top {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.badge-archived {
  background: var(--color-code-bg);
  color: var(--color-text-muted);
}

.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-card:hover {
  transform: translateY(-3px);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.article-card h3 {
  margin-bottom: 12px;
}

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

.article-card-more {
  margin-top: auto;
  color: var(--color-accent-dark);
  font-weight: 750;
}

.callout {
  position: relative;
  min-width: 0;
  margin-block: 26px;
  padding: 19px 20px 19px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel-alt);
  color: var(--color-text);
}

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

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

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

.callout-error {
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: inset 0 0 0 2px var(--color-error);
}

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

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

.dl-fab {
  position: fixed;
  z-index: 80;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  max-width: min(310px, calc(100vw - 36px));
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

.dl-fab:hover {
  color: var(--color-accent-dark);
  transform: translateY(-2px);
}

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

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

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

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

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

.end-download-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  margin-top: 44px;
  padding: 25px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel-alt);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

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

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

.preview-hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  overflow-x: clip;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 112px 24px 70px;
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-top) 22%, var(--sky-mid) 57%, var(--sky-low) 100%);
  color: var(--color-white);
}

.preview-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at -6% -10%, var(--blue-veil), var(--blue-zero) 68%),
    radial-gradient(900px 420px at 106% -10%, var(--blue-veil), var(--blue-zero) 68%),
    radial-gradient(680px 420px at 68% 6%, var(--sun-glow), var(--sun-zero) 70%),
    radial-gradient(1100px 240px at 50% 102%, var(--sky-warm), var(--white-zero) 74%);
  pointer-events: none;
}

.hero-clouds {
  position: absolute;
  z-index: 1;
  inset: -40px;
  background:
    radial-gradient(320px 116px at 14% 56%, var(--white-95), var(--white-zero) 70%),
    radial-gradient(220px 60px at 18% 65%, var(--cloud-warm), var(--white-zero) 74%),
    radial-gradient(380px 132px at 84% 34%, var(--white-95), var(--white-zero) 70%),
    radial-gradient(250px 66px at 82% 44%, var(--cloud-warm), var(--white-zero) 74%);
  pointer-events: none;
}

.hero-city {
  position: absolute;
  z-index: 2;
  bottom: 0;
  width: 250px;
  height: 62%;
  pointer-events: none;
}

.hero-city-left {
  left: 0;
}

.hero-city-right {
  right: 0;
  transform: scaleX(-1);
}

.city-far {
  fill: var(--city-far);
}

.city-far-alt {
  fill: var(--city-far-alt);
}

.city-mid {
  fill: var(--city-mid);
}

.city-mid-dark {
  fill: var(--city-mid-dark);
}

.city-near {
  fill: var(--city-near);
}

.city-near-dark {
  fill: var(--city-near-dark);
}

.city-light {
  fill: var(--city-light);
}

.city-window {
  fill: var(--city-window-warm);
}

.city-leaf-one {
  fill: var(--leaf-one);
}

.city-leaf-two {
  fill: var(--leaf-two);
}

.city-leaf-three {
  fill: var(--leaf-three);
}

.hero-stage {
  position: relative;
  z-index: 4;
  width: min(920px, 100%);
  text-align: center;
}

.hero-stage h1 {
  margin-bottom: 16px;
  color: var(--color-white);
  text-shadow: 0 2px 24px rgba(19, 80, 146, 0.38);
}

.hero-title-soft {
  color: var(--sky-soft-text);
}

.hero-lede {
  max-width: 680px;
  margin: 0 auto 25px;
  color: var(--white-95);
  font-size: 16.5px;
}

.hero-stage .actions {
  justify-content: center;
  margin-bottom: 22px;
}

.hero-stage .button-primary {
  border-color: var(--white-80);
  background: var(--color-panel);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-button);
}

.hero-stage .button-primary:hover {
  background: var(--color-panel);
  color: var(--color-text);
}

.hero-stage .button-secondary {
  border-color: var(--glass-chip-border);
  background: var(--glass-chip);
  color: var(--color-white);
}

.hero-stage .button-secondary:hover {
  background: var(--glass-hover);
  color: var(--color-white);
}

.hero-chip-row {
  display: flex;
  max-width: 760px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 0;
  list-style: none;
}

.hero-chip-row li,
.hero-chip-row a {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--glass-chip-border);
  border-radius: var(--radius-pill);
  background: var(--glass-chip);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.hero-chip-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hero-flags svg {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
}

.flag-red {
  fill: var(--flag-red);
}

.flag-blue {
  fill: var(--flag-blue);
}

.flag-navy {
  fill: var(--flag-navy);
}

.flag-white {
  fill: var(--flag-white);
}

.flag-black {
  fill: var(--flag-black);
}

.hero-device {
  position: relative;
  width: min(560px, 100%);
  margin: 29px auto 0;
  perspective: 1400px;
}

.hero-device::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(20px, 15px) rotate(1.6deg);
  border-radius: var(--radius-xl);
  background: var(--white-45);
  box-shadow: 0 22px 60px rgba(13, 60, 116, 0.22);
}

.import-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-device);
  text-align: left;
  transform: rotateX(3deg) rotateY(-3deg) rotate(-0.6deg);
  transform-origin: 50% 100%;
}

.import-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

.import-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.import-title::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.import-close {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-code-bg);
  color: var(--color-text-muted);
}

.import-body {
  padding: 18px 20px 20px;
}

.mock-label {
  margin-bottom: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.mock-input,
.mock-select,
.mock-toggle {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel);
  color: var(--color-text);
}

.mock-url {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font: 500 12px/1.4 var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-paste {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.mock-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.mock-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-panel);
}

.mock-modes {
  display: flex;
  gap: 9px;
  margin-top: 8px;
}

.mock-mode {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.mock-mode::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
}

.mock-mode.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.mock-mode.is-selected::before {
  border: 4px solid var(--color-accent);
}

.mock-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--color-border-strong);
}

.mock-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.mock-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--color-success);
}

.mock-save {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--color-accent-dark);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 800;
}

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

.preview-swatch {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  color: var(--color-text);
}

.preview-swatch-color {
  height: 82px;
}

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

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

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

.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-text-muted);
}

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

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

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

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

.preview-swatch code {
  display: block;
  padding: 11px;
  border: 0;
  border-radius: 0;
}

.preview-type-scale > * {
  margin-bottom: 18px;
}

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

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

@media (max-width: 700px) {
  .end-download-card {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .mock-modes {
    flex-wrap: wrap;
  }

  .mock-mode {
    flex-basis: calc(50% - 5px);
  }
}

@media (max-width: 640px) {
  .preview-hero {
    min-height: auto;
    padding: 104px var(--gutter) 68px;
  }

  .hero-chip-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-device::before,
  .import-window {
    transform: none;
  }

  .import-body {
    padding: 16px;
  }

  .mock-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .mock-save {
    text-align: center;
  }

  .dl-fab-copy span {
    display: none;
  }

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