:root {
  --component-blue-soft: rgba(46, 111, 242, 0.10);
  --component-green-soft: rgba(29, 181, 108, 0.12);
  --component-orange-soft: rgba(245, 163, 0, 0.14);
  --component-red-soft: rgba(229, 72, 77, 0.11);
  --component-pink-soft: rgba(240, 98, 146, 0.11);
  --component-yellow-soft: rgba(255, 210, 63, 0.32);
  --component-window-line: rgba(22, 24, 29, 0.08);
  --component-fab-shadow: rgba(22, 24, 29, 0.16);
  --component-tile-shadow: rgba(22, 24, 29, 0.08);
  --component-faq-open: #F7F9FC;
}

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

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

.tab-list [role="tab"] {
  min-height: 44px;
  flex: 1 0 auto;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-ink-muted);
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.tab-list [role="tab"][aria-selected="true"] {
  background: var(--color-page);
  color: var(--color-brand-deep);
  box-shadow: 0 5px 16px var(--color-shadow-soft);
}

.tab-list [role="tab"]:focus-visible {
  outline: 3px solid var(--color-brand-glow);
  outline-offset: 1px;
}

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

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

.toc {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  max-width: 100%;
  margin-bottom: 36px;
  padding: 8px;
  gap: 5px;
  overflow-x: auto;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-ink);
  box-shadow: 0 8px 28px var(--color-shadow-soft);
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.toc a {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  color: var(--color-ink-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.toc a:hover,
.toc a[aria-current="true"] {
  background: var(--color-page);
  color: var(--color-brand-deep);
}

.toc.is-static {
  position: static;
}

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

.faq-item {
  overflow: clip;
  border-radius: var(--radius-large);
  background: var(--color-panel);
  color: var(--color-ink);
}

.faq-item summary {
  position: relative;
  display: flex;
  min-height: 64px;
  padding: 18px 56px 18px 22px;
  align-items: center;
  color: var(--color-ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 22px;
  display: grid;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  place-items: center;
  border-radius: 50%;
  background: var(--color-page);
  color: var(--color-brand-deep);
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1;
}

.faq-item[open] {
  background: var(--component-faq-open);
  color: var(--color-ink);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

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

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

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

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

.term-card {
  position: relative;
  overflow: clip;
  min-height: 210px;
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--color-page);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

.term-card::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--component-blue-soft);
}

.term-card dt {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 850;
}

.term-card dd {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--color-ink-muted);
}

.download-grid {
  display: grid;
  gap: 22px;
}

.client-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.3fr);
  gap: 28px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-card);
  background: var(--color-page);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

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

.client-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.client-card h3 {
  margin-bottom: 6px;
}

.client-version {
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

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

.client-download {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
  border-radius: var(--radius-medium);
  background: var(--color-panel);
  color: var(--color-ink);
  font-weight: 750;
  text-decoration: none;
}

.client-download:hover {
  background: var(--color-panel-strong);
  color: var(--color-brand-deep);
}

.client-download svg,
.client-download-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.badge-row,
.fact-row,
.tag-row,
.platform-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.badge,
.tag,
.fact-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.badge {
  background: var(--component-blue-soft);
  color: var(--color-brand-deep);
}

.badge-recommended {
  background: var(--component-blue-soft);
  color: var(--color-brand-deep);
}

.badge-featured {
  background: var(--component-green-soft);
  color: var(--color-green-ink);
}

.badge-retired {
  background: var(--component-red-soft);
  color: var(--color-negative);
}

.badge-warning {
  background: var(--component-orange-soft);
  color: var(--color-orange-ink);
}

.tag {
  background: var(--color-panel);
  color: var(--color-ink-muted);
}

.fact-pill {
  background: var(--color-panel);
  color: var(--color-ink-muted);
  font-family: var(--font-mono);
  font-weight: 550;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-positive);
}

.status-dot.blue {
  background: var(--color-brand);
}

.status-dot.orange {
  background: var(--color-caution);
}

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

.article-card {
  display: flex;
  min-height: 300px;
  padding: 28px;
  flex-direction: column;
  border-radius: var(--radius-card);
  background: var(--color-page);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

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

.article-card h3 {
  font-size: clamp(21px, 2.5vw, 26px);
}

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

.article-card-link {
  display: inline-flex;
  margin-top: auto;
  align-items: center;
  gap: 7px;
  color: var(--color-brand-deep);
  font-weight: 750;
  text-decoration: none;
}

.callout {
  position: relative;
  margin-block: 26px;
  padding: 22px 24px 22px 28px;
  overflow: clip;
  border-radius: var(--radius-medium);
  background: var(--component-blue-soft);
  color: var(--color-ink);
}

.callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--color-brand);
}

.callout-title {
  display: block;
  margin-bottom: 5px;
  color: var(--color-ink);
  font-weight: 850;
}

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

.callout.success {
  background: var(--component-green-soft);
  color: var(--color-ink);
}

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

.callout.warning {
  background: var(--component-orange-soft);
  color: var(--color-ink);
}

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

.download-note-card {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-top: 48px;
  padding: clamp(24px, 4vw, 38px);
  align-items: center;
  gap: 24px;
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-ink);
}

.download-note-card h2,
.download-note-card h3 {
  margin-bottom: 8px;
}

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

.dl-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  max-width: min(330px, calc(100vw - 32px));
  min-height: 68px;
  align-items: center;
  gap: 13px;
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: var(--color-white);
  box-shadow: 0 16px 42px var(--component-fab-shadow);
  text-decoration: none;
}

.dl-fab:hover {
  background: var(--color-brand-deep);
  color: var(--color-white);
}

.dl-fab-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-brand-deep);
}

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

.dl-fab-copy {
  display: grid;
  line-height: 1.25;
}

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

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

.ui-fragment {
  padding: 18px;
  border-radius: var(--radius-large);
  background: var(--color-page);
  color: var(--color-ink);
  box-shadow: var(--shadow-float);
}

.ui-chrome {
  display: flex;
  padding-bottom: 13px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--component-window-line);
}

.ui-chrome i {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
}

.ui-chrome i:nth-child(1) {
  background: var(--color-negative);
}

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

.ui-chrome i:nth-child(3) {
  background: var(--color-positive);
}

.setting-list {
  display: grid;
  margin-top: 14px;
  gap: 10px;
}

.setting-row {
  display: flex;
  min-height: 48px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius-small);
  background: var(--color-panel);
  color: var(--color-ink);
}

.setting-row small {
  color: var(--color-ink-muted);
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
}

.switch.on {
  background: var(--color-positive);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-page);
  box-shadow: 0 2px 6px var(--color-shadow-medium);
}

.switch.on::after {
  left: 21px;
}

.preview-hero {
  position: relative;
  min-height: 620px;
  height: calc(100vh - 150px);
  max-height: 800px;
  overflow: visible;
  overflow-x: clip;
}

.preview-hero::before {
  content: "";
  position: absolute;
  top: -90px;
  left: 50%;
  z-index: 0;
  width: 820px;
  height: 560px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--color-brand-halo-core), var(--color-brand-halo-mid) 55%, var(--color-brand-halo-clear) 80%);
  pointer-events: none;
}

.preview-hero-core {
  position: relative;
  z-index: 5;
  display: flex;
  max-width: 780px;
  margin-inline: auto;
  padding: 46px 24px 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.preview-hero-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  filter: drop-shadow(0 10px 20px var(--color-brand-glow));
}

.preview-title {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.preview-title-brand {
  display: block;
  font-size: clamp(38px, 4.2vw, 48px);
}

.preview-title-mark {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 16px 4px;
  transform: rotate(-2deg);
  border-radius: 14px;
  background: var(--color-brand);
  color: var(--color-white);
  box-shadow: 0 10px 24px -8px var(--color-brand-glow);
}

.preview-title-sub {
  display: block;
  margin-top: 8px;
  color: var(--color-ink);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.005em;
}

.preview-lead {
  max-width: 620px;
  margin-top: 14px;
  margin-bottom: 0;
  color: var(--color-ink-muted);
  font-size: 17px;
  line-height: 1.7;
}

.preview-actions {
  display: flex;
  margin-top: 22px;
  align-items: center;
  gap: 14px;
}

.preview-platforms {
  display: flex;
  margin: 22px 0 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  list-style: none;
}

.preview-platforms li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-ink-muted);
  font-size: 14px;
  font-weight: 650;
}

.preview-platforms svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

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

.protocol-tiles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.protocol-tile {
  position: absolute;
  display: flex;
  align-items: flex-end;
  padding: 14px 17px;
  border: 1px solid var(--tile-ring);
  border-radius: 30px;
  background: linear-gradient(160deg, var(--tile-high), var(--tile-low));
  color: var(--tile-ink);
  box-shadow: 0 1px 2px var(--component-tile-shadow), 0 14px 26px -12px var(--tile-glow);
  font-family: var(--font-mono);
  font-weight: 650;
  letter-spacing: -0.02em;
  animation: protocol-float var(--float-time, 8s) ease-in-out var(--float-delay, 0s) infinite;
}

.protocol-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px var(--color-tile-inner);
}

.protocol-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--color-tile-sheen), var(--color-transparent) 46%);
}

.protocol-tile span {
  position: relative;
  z-index: 1;
}

.protocol-tile.blue {
  --tile-high: var(--color-blue-high);
  --tile-low: var(--color-blue-low);
  --tile-ring: var(--color-blue-ring);
  --tile-glow: var(--color-blue-glow);
  --tile-ink: var(--color-blue-ink);
}

.protocol-tile.green {
  --tile-high: var(--color-green-high);
  --tile-low: var(--color-green-low);
  --tile-ring: var(--color-green-ring);
  --tile-glow: var(--color-green-glow);
  --tile-ink: var(--color-green-ink);
}

.protocol-tile.orange {
  --tile-high: var(--color-orange-high);
  --tile-low: var(--color-orange-low);
  --tile-ring: var(--color-orange-ring);
  --tile-glow: var(--color-orange-glow);
  --tile-ink: var(--color-orange-ink);
}

.protocol-tile.pink {
  --tile-high: var(--color-pink-high);
  --tile-low: var(--color-pink-low);
  --tile-ring: var(--color-pink-ring);
  --tile-glow: var(--color-pink-glow);
  --tile-ink: var(--color-pink-ink);
}

.protocol-tile.one {
  top: 52px;
  left: 68px;
  width: 200px;
  height: 200px;
  font-size: 18px;
  --tile-tilt: -5deg;
  --tile-rise: -14px;
  --float-time: 9s;
}

.protocol-tile.two {
  top: 296px;
  left: -28px;
  width: 150px;
  height: 150px;
  border-radius: 24px;
  font-size: 13px;
  --tile-tilt: 4deg;
  --tile-rise: -11px;
  --float-time: 7.4s;
  --float-delay: -2.2s;
}

.protocol-tile.three {
  top: 424px;
  left: 92px;
  width: 118px;
  height: 118px;
  border-radius: 20px;
  font-size: 13px;
  --tile-tilt: -3deg;
  --tile-rise: -9px;
  --float-time: 8.2s;
  --float-delay: -4.6s;
}

.protocol-tile.four {
  top: 588px;
  left: 26px;
  width: 86px;
  height: 86px;
  border-radius: 16px;
  font-size: 11px;
  --tile-tilt: 6deg;
  --tile-rise: -8px;
  --float-time: 6.8s;
  --float-delay: -1.4s;
}

.protocol-tile.five {
  top: 60px;
  right: 76px;
  width: 192px;
  height: 192px;
  font-size: 17px;
  --tile-tilt: 5deg;
  --tile-rise: -14px;
  --float-time: 9.6s;
  --float-delay: -3.1s;
}

.protocol-tile.six {
  top: 306px;
  right: -24px;
  width: 152px;
  height: 152px;
  border-radius: 24px;
  font-size: 14px;
  --tile-tilt: -4deg;
  --tile-rise: -11px;
  --float-time: 7.8s;
  --float-delay: -5.3s;
}

.protocol-tile.seven {
  top: 436px;
  right: 104px;
  width: 122px;
  height: 122px;
  border-radius: 20px;
  font-size: 13px;
  --tile-tilt: 3deg;
  --tile-rise: -9px;
  --float-time: 8.8s;
  --float-delay: -0.9s;
}

.protocol-tile.eight {
  top: 600px;
  right: 40px;
  width: 82px;
  height: 82px;
  border-radius: 16px;
  font-size: 11px;
  --tile-tilt: -6deg;
  --tile-rise: -8px;
  --float-time: 7s;
  --float-delay: -3.8s;
}

@keyframes protocol-float {
  0%,
  100% {
    transform: rotate(var(--tile-tilt, 0deg)) translateY(0);
  }

  50% {
    transform: rotate(var(--tile-tilt, 0deg)) translateY(var(--tile-rise, -12px));
  }
}

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

.swatch {
  overflow: clip;
  border-radius: var(--radius-medium);
  background: var(--color-page);
  color: var(--color-ink);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.swatch-color {
  height: 92px;
}

.swatch-copy {
  padding: 14px;
}

.swatch-copy strong,
.swatch-copy code {
  display: block;
}

.swatch-copy code {
  margin-top: 4px;
  color: var(--color-ink-muted);
  font-size: 11px;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

.preview-stack {
  display: grid;
  gap: 26px;
}

@media (max-width: 1180px) {
  .protocol-tile.two,
  .protocol-tile.four,
  .protocol-tile.six,
  .protocol-tile.eight {
    display: none;
  }

  .protocol-tile.one {
    left: 16px;
    width: 150px;
    height: 150px;
    font-size: 14px;
  }

  .protocol-tile.five {
    right: 20px;
    width: 146px;
    height: 146px;
    font-size: 14px;
  }

  .protocol-tile.three {
    left: 36px;
  }

  .protocol-tile.seven {
    right: 48px;
  }
}

@media (max-width: 860px) {
  .preview-hero {
    height: auto;
    max-height: none;
    padding-bottom: 34px;
  }

  .preview-hero-core {
    padding-top: 36px;
  }

  .preview-title-brand {
    font-size: clamp(26px, 8vw, 30px);
  }

  .preview-title-sub {
    font-size: 20px;
  }

  .protocol-tile.three,
  .protocol-tile.seven {
    display: none;
  }

  .protocol-tile.one {
    top: 36px;
    left: -30px;
  }

  .protocol-tile.five {
    top: 48px;
    right: -32px;
  }
}

@media (max-width: 760px) {
  .glossary-grid,
  .article-grid,
  .client-card,
  .download-note-card {
    grid-template-columns: 1fr;
  }

  .client-actions {
    grid-template-columns: 1fr;
  }

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

  .toc {
    top: 8px;
  }
}

@media (max-width: 640px) {
  .preview-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .preview-actions .button {
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
  }

  .preview-platforms,
  .preview-facts,
  .badge-row,
  .fact-row,
  .tag-row,
  .platform-row {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .protocol-tile {
    animation: none;
  }

  .faq-item summary {
    padding-left: 18px;
  }

  .dl-fab {
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .palette-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .protocol-tile {
    animation: none;
  }
}