.http-protocol-demo {
  --http-blue: #075de8;
  --http-cyan: #07a5c8;
  --http-green: #0d8a65;
  --http-amber: #c87505;
  --http-ink: #10213f;
  --http-muted: #697991;
  --http-line: #cdd9e8;
  --http-surface: #ffffff;
  --http-soft: #eef5ff;
  display: grid;
  width: min(100%, 440px);
  gap: 8px;
  color: var(--http-ink);
  font: 600 11px/1.35 "DM Sans", sans-serif;
}

.http-demo-toolbar {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.http-demo-toolbar > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--http-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.http-demo-toolbar > span i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--http-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--http-green) 14%, transparent);
}

.http-demo-toolbar button {
  border: 1px solid var(--http-line);
  border-radius: 7px;
  background: var(--http-surface);
  color: var(--http-blue);
  font: inherit;
  font-weight: 800;
  padding: 5px 8px;
  cursor: pointer;
}

.http-demo-toolbar button:focus-visible {
  outline: 2px solid var(--http-blue);
  outline-offset: 2px;
}

.http-demo-stage {
  position: relative;
  display: grid;
  min-height: 142px;
  grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--http-line);
  border-radius: 11px;
  background:
    radial-gradient(circle at 18% 15%, color-mix(in srgb, var(--http-blue) 10%, transparent), transparent 34%),
    linear-gradient(145deg, var(--http-soft), var(--http-surface));
  padding: 22px 12px 12px;
}

.http-demo-caption {
  position: absolute;
  top: 8px;
  left: 11px;
  color: var(--http-blue);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.http-node {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--http-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--http-surface) 94%, transparent);
  box-shadow: 0 8px 22px rgba(20, 45, 85, .08);
  padding: 9px;
  transition: border-color 220ms, box-shadow 220ms, transform 220ms;
}

.http-node::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--http-line);
}

.http-node small {
  color: var(--http-muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}

.http-node strong,
.http-node code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.http-node strong {
  color: var(--http-ink);
  font-size: 10px;
}

.http-node code {
  color: var(--http-muted);
  font: 500 7.5px/1.4 "IBM Plex Mono", monospace;
}

.http-wire {
  position: relative;
  display: grid;
  height: 54px;
  place-items: center;
}

.http-wire i {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--http-line);
}

.http-wire i::before {
  content: "";
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--http-blue), var(--http-cyan));
  transition: width 420ms ease;
}

.http-wire span {
  position: absolute;
  top: 2px;
  color: var(--http-muted);
  font: 700 7px "IBM Plex Mono", monospace;
}

.http-wire b {
  position: absolute;
  right: -1px;
  color: var(--http-blue);
  font-size: 16px;
  line-height: 1;
}

.http-protocol-demo > small {
  min-height: 15px;
  color: var(--http-muted);
  font-size: 9px;
}

.http-protocol-demo.is-active .http-wire i::before {
  width: 100%;
}

.http-protocol-demo.is-active .http-node-client {
  border-color: color-mix(in srgb, var(--http-blue) 65%, var(--http-line));
  transform: translateX(2px);
}

.http-protocol-demo.is-active .http-node-server {
  border-color: color-mix(in srgb, var(--http-green) 65%, var(--http-line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--http-green) 14%, transparent);
  transform: translateX(-2px);
}

.http-protocol-demo.is-active .http-node-server::before {
  background: var(--http-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--http-green) 15%, transparent);
}

.http-protocol-demo-method .http-node-client strong,
.http-protocol-demo-range .http-node-server strong,
.http-protocol-demo-conditional .http-node-server strong {
  color: var(--http-blue);
}

.http-protocol-demo-header .http-node code,
.http-protocol-demo-body .http-node code,
.http-protocol-demo-transfer .http-node code {
  color: color-mix(in srgb, var(--http-cyan) 75%, var(--http-ink));
}

.http-protocol-demo-connection .http-wire i::before {
  background: linear-gradient(90deg, var(--http-amber), var(--http-green));
}

.concept-card[data-card-id^="http-"] .concept-card-header h4 {
  overflow-wrap: anywhere;
}

.concept-card-preview .http-protocol-demo {
  font-size: 7px;
}

.concept-card-preview .http-demo-stage {
  min-height: 108px;
  grid-template-columns: minmax(0, 1fr) 39px minmax(0, 1fr);
  gap: 4px;
  padding: 18px 7px 7px;
}

.concept-card-preview .http-demo-toolbar > span {
  max-width: 64px;
  font-size: 6.5px;
}

.concept-card-preview .http-demo-toolbar button {
  max-width: 78px;
  min-height: 24px;
  font-size: 7px;
  line-height: 1.15;
  padding: 3px 5px;
}

.concept-card-preview .http-node {
  min-height: 64px;
  gap: 3px;
  padding: 6px;
}

.concept-card-preview .http-node strong {
  font-size: 7px;
}

.concept-card-preview .http-node code,
.concept-card-preview .http-wire span,
.concept-card-preview .http-node small {
  font-size: 5.5px;
}

[data-theme="dark"] .http-protocol-demo {
  --http-ink: #e7eefb;
  --http-muted: #9eafc7;
  --http-line: #35465e;
  --http-surface: #111f34;
  --http-soft: #152a47;
  --http-blue: #65a2ff;
  --http-cyan: #53d8e7;
  --http-green: #54d3a7;
  --http-amber: #f0b35b;
}

@media (max-width: 480px) {
  .http-protocol-demo {
    font-size: 10px;
  }

  .http-demo-stage {
    min-height: 132px;
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
    padding-inline: 8px;
  }

  .http-demo-toolbar > span {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .http-protocol-demo *,
  .http-protocol-demo *::before,
  .http-protocol-demo *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (forced-colors: active) {
  .http-demo-stage,
  .http-node,
  .http-demo-toolbar button {
    border: 1px solid CanvasText;
  }

  .http-wire i::before,
  .http-demo-toolbar > span i,
  .http-node::before {
    forced-color-adjust: none;
    background: Highlight;
  }
}
