.interactive-guide {
  --guide-surface: #fff;
  --guide-border: #dce3ee;
  --guide-text: #18233d;
  --guide-muted: #4d5e78;
  --guide-accent: #3647a1;
  --guide-tint: #eef1ff;
  --guide-fill: #4053bc;
  --guide-focus: #4053bc;
  --guide-mono: var(--md-code-font-family, monospace);
  max-width: 55rem;
  margin: 0 auto;
  color: var(--guide-text);
}

[data-md-color-scheme="slate"] .interactive-guide {
  --guide-surface: #191f33;
  --guide-border: #38415a;
  --guide-text: #eef1ff;
  --guide-muted: #b1bdd6;
  --guide-accent: #bac5ff;
  --guide-tint: #252e52;
  --guide-fill: #9eafff;
  --guide-focus: #9eafff;
}

.interactive-guide *:focus-visible {
  outline: 2px solid var(--guide-focus);
  outline-offset: 3px;
}

.interactive-guide__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: clamp(1.1rem, 3.5vw, 2rem);
  border: 1px solid var(--guide-border);
  border-radius: 1rem;
  background: radial-gradient(ellipse at 95% 5%, var(--guide-tint), transparent 72%), var(--guide-surface);
}

.interactive-guide__intro-copy {
  flex: 1 1 19rem;
}

.interactive-guide .interactive-guide__project {
  margin: 0 0 0.45rem;
  color: var(--guide-accent);
  font: 600 0.68rem/1.4 var(--guide-mono);
  letter-spacing: 0.06em;
}

.interactive-guide h1 {
  margin: 0;
  color: var(--guide-text);
  font-size: clamp(1.65rem, 4vw, 2.65rem);
  font-weight: 750;
  line-height: 1.18;
}

.interactive-guide__intro-copy p:last-child {
  margin: 0.65rem 0 0;
  color: var(--guide-muted);
}

.interactive-guide a.interactive-guide__docs {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.2rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  background: var(--guide-surface);
  color: var(--guide-accent);
  font-size: 0.7rem;
  font-weight: 600;
}

.interactive-guide a.interactive-guide__docs:hover {
  border-color: var(--guide-accent);
}

.interactive-guide__body:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(0, 2.6fr);
  gap: 0.85rem;
  align-items: start;
  margin-block: 0.85rem;
}

.interactive-guide__navigation,
.interactive-guide__panel {
  min-width: 0;
  border: 1px solid var(--guide-border);
  border-radius: 0.85rem;
  background: var(--guide-surface);
}

.interactive-guide__navigation {
  padding: 0.8rem;
}

.interactive-guide__progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  color: var(--guide-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.interactive-guide__progress-label span {
  color: var(--guide-accent);
  font-family: var(--guide-mono);
}

.interactive-guide progress {
  display: block;
  width: 100%;
  height: 0.24rem;
  margin-block: 0.45rem 0.7rem;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 1rem;
  background: var(--guide-tint);
  accent-color: var(--guide-fill);
}

.interactive-guide progress::-webkit-progress-bar {
  background: var(--guide-tint);
}

.interactive-guide progress::-webkit-progress-value {
  border-radius: 1rem;
  background: var(--guide-fill);
}

.interactive-guide progress::-moz-progress-bar {
  border-radius: 1rem;
  background: var(--guide-fill);
}

.interactive-guide .interactive-guide__navigation ol {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.interactive-guide .interactive-guide__navigation ol li {
  position: relative;
  min-width: 0;
  margin: 0;
}

.interactive-guide__navigation li:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  inset-block-start: 1.9rem;
  inset-inline-start: 1.15rem;
  width: 1px;
  height: 0.5rem;
  background: var(--guide-border);
  content: "";
  pointer-events: none;
}

.interactive-guide button {
  cursor: pointer;
}

.interactive-guide__navigation button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: var(--guide-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: start;
}

.interactive-guide__navigation button:hover,
.interactive-guide__navigation button[aria-current="step"] {
  border-color: var(--guide-border);
  background: var(--guide-tint);
}

.interactive-guide__navigation button[aria-current="step"] {
  color: var(--guide-accent);
  font-weight: 700;
}

.interactive-guide__step-number {
  display: grid;
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 1px solid var(--guide-border);
  border-radius: 50%;
  background: var(--guide-surface);
  font: 600 0.57rem/1 var(--guide-mono);
}

.interactive-guide button[aria-current="step"] .interactive-guide__step-number {
  border-color: var(--guide-accent);
  background: var(--guide-accent);
  color: var(--guide-surface);
}

.interactive-guide__panel {
  padding: clamp(0.85rem, 2.8vw, 1.45rem);
}

.interactive-guide__detail h2 {
  margin: 0;
  color: var(--guide-text);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  scroll-margin-top: 4rem;
}

.interactive-guide__detail p {
  margin: 0.45rem 0 0;
  color: var(--guide-muted);
}

.interactive-guide [data-guide-description],
.interactive-guide [data-guide-explanation] {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.interactive-guide__code {
  margin-top: 1rem;
  border: 1px solid #303c57;
  border-radius: 0.65rem;
  background: #10182a;
  color: #edf1ff;
  --guide-focus: #b0c2ff;
}

.interactive-guide__code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem 0.65rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid #303c57;
  border-radius: 0.65rem 0.65rem 0 0;
  background: #1b263d;
  color: #cbd5ed;
  font: 0.62rem/1.4 var(--guide-mono);
  overflow-wrap: anywhere;
}

.interactive-guide__code-header span {
  min-width: 0;
}

.interactive-guide__code-header button {
  flex: 0 0 auto;
  min-height: 1.7rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid #546580;
  border-radius: 0.35rem;
  color: #edf1ff;
}

.interactive-guide__code-header button:hover {
  background: #303c57;
}

.interactive-guide__code pre {
  max-height: 19rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  overflow: auto;
  border-radius: 0 0 0.65rem 0.65rem;
  background: transparent;
  color: inherit;
  font-size: 0.7rem;
  line-height: 1.65;
  tab-size: 4;
}

.interactive-guide__code pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.interactive-guide__code-line {
  display: grid;
  grid-template-columns: 2.5ch max-content;
  column-gap: 1.25ch;
  min-width: 100%;
  min-height: 1.65em;
  white-space: pre;
}

.interactive-guide__code-line::before {
  color: #75839b;
  content: attr(data-line);
  text-align: end;
  user-select: none;
}

.interactive-guide__code-line--highlight {
  background: #e6ffec;
  box-shadow: inset 2px 0 #2da44e;
  color: #1f2328;
}

[data-md-color-scheme="slate"] .interactive-guide__code-line--highlight {
  background: #0d2818;
  box-shadow: inset 2px 0 #3fb950;
  color: #aff5b4;
}

.interactive-guide p.interactive-guide__explanation {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.7rem;
  border-inline-start: 3px solid var(--guide-fill);
  border-radius: 0 0.4rem 0.4rem 0;
  background: var(--guide-tint);
  color: var(--guide-text);
  font-size: 0.72rem;
}

.interactive-guide__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--guide-border);
}

.interactive-guide__controls button {
  min-height: 2.2rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  color: var(--guide-accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.interactive-guide__controls button:disabled {
  color: var(--guide-muted);
  cursor: default;
  opacity: 0.65;
}

.interactive-guide__controls button:not(:disabled):hover {
  border-color: var(--guide-accent);
}

.interactive-guide__controls button[data-guide-next] {
  border-color: var(--guide-accent);
  background: var(--guide-accent);
  color: var(--guide-surface);
}

.interactive-guide__controls button[data-guide-next]:hover {
  background: color-mix(in srgb, var(--guide-accent) 88%, var(--guide-surface));
}

.interactive-guide__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 40rem) {
  .interactive-guide__body:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }

  .interactive-guide .interactive-guide__navigation ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .interactive-guide__navigation li:not(:last-child)::after {
    display: none;
  }

  .interactive-guide__navigation button {
    gap: 0.35rem;
  }
}
