.host-course {
  --host-line: color-mix(in srgb, currentColor 23%, transparent);
  --host-tint: color-mix(in srgb, currentColor 4%, transparent);
  --host-ink: #1c2a28;
  color: inherit;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.host-toolbar, .host-choices, .host-bottom {
  display: flex;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
}

.host-toolbar { scroll-margin-top: 5.75rem; }
.host-toolbar button, .host-choices button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--host-line);
  border-radius: 4px;
  padding: .42rem .75rem;
  min-height: 42px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.host-toolbar button:hover, .host-choices button:hover { background: var(--host-tint); border-color: currentColor; }
.host-toolbar [aria-current], .host-choices [aria-pressed="true"] {
  background: var(--host-ink);
  color: white;
  border-color: var(--host-ink);
}
.host-toolbar [aria-current]:hover, .host-choices [aria-pressed="true"]:hover { background: #344641; }
.host-intro { margin: clamp(1.6rem, 3.8vw, 3rem) 0 clamp(1.4rem, 2.6vw, 2.4rem); }
.host-intro h3 { margin: .35rem 0 .65rem; font-size: clamp(1.6rem, 2.7vw, 2.5rem); line-height: 1.2; letter-spacing: -.035em; }
.host-intro > p:last-child { max-width: 58rem; margin: 0; }
.host-course h4 { margin: 0 0 .6rem; font-size: 1.1rem; line-height: 1.5; }
.host-body { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); gap: clamp(1.35rem, 3vw, 3rem); align-items: start; margin-bottom: 1.5rem; }
.host-procedure > h4 { margin-bottom: .9rem; }
.host-procedure ol { counter-reset: host-step; padding: 0; margin: 0; list-style: none; }
.host-procedure li { counter-increment: host-step; display: grid; grid-template-columns: 1.65rem minmax(0, 1fr); gap: .45rem; border-top: 1px solid var(--host-line); padding: .8rem 0; }
.host-procedure li::before {
  content: counter(host-step, decimal-leading-zero);
  font: 500 .72rem/1.6 var(--font-mono, monospace);
  padding-top: .15rem;
}
.host-procedure p, .host-exercise > p, .host-details p, .host-code p { margin: .25rem 0 .65rem; }
.host-procedure li p { margin-bottom: 0; }
.host-check { border-left: 3px solid var(--host-ink); background: var(--host-tint); padding: .7rem .95rem; margin-top: .7rem; }
.host-check strong { font-size: .84rem; }
.host-check p { margin-bottom: 0; }
.host-visuals { display: grid; gap: 1rem; min-width: 0; }
.host-image, .host-exercise, .host-code { margin: 0; border: 1px solid var(--host-line); border-radius: 6px; overflow: hidden; }
.host-image-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem .85rem; font-size: .78rem; font-weight: 650; color: inherit; background: var(--host-tint); }
.host-image-head a { color: inherit; padding-block: .35rem; text-underline-offset: .18em; }
.host-zoom, .host-zoom img, .host-details video { display: block; width: 100%; height: auto; }
.host-zoom { cursor: zoom-in; background: #1b2027; }
.host-exercise, .host-code { padding: clamp(1rem, 2vw, 1.5rem); }
.host-exercise > .lesson-kicker { margin: 0 0 .5rem; font-size: .72rem; }
.host-choices, .host-exercise > .lesson-button { margin-top: .8rem; }
.host-exercise > .host-readout { margin: 1rem 0 0; border-top: 1px solid var(--host-line); padding-top: .7rem; font-size: .91rem; }
.host-readout strong { margin-left: .5em; }
.host-details { border-top: 1px solid var(--host-line); border-bottom: 1px solid var(--host-line); font-size: .94rem; }
.host-details summary { padding: .7rem 0; cursor: pointer; font-weight: 650; }
.host-details[open] { padding-bottom: .9rem; }
.host-details video { margin-top: .85rem; background: #192322; border-radius: 4px; }
.host-course pre { max-width: 100%; overflow: auto; margin: .5rem 0 0; padding: .9rem; border-radius: 4px; background: #192322; color: #f3f3ed; line-height: 1.7; font-size: .82rem; }
.host-slider { display: grid; grid-template-columns: 1fr auto; align-items: center; font-size: .9rem; margin-top: .8rem; font-weight: 650; }
.host-slider output { font-family: var(--font-mono, monospace); }
.host-slider input { width: 100%; margin: .1rem 0 0; min-height: 36px; grid-column: span 2; accent-color: var(--host-ink); }
.host-bottom { justify-content: space-between; gap: .8rem; margin: 1rem 0; }
.host-bottom .lesson-refs { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin: 0; }
.host-bottom .lesson-refs a { font-size: .87rem; }

@media (max-width: 820px) {
  .host-body { grid-template-columns: minmax(0, 1fr); }
  .host-procedure, .host-visuals { min-width: 0; }
}

@media (max-width: 520px) {
  .host-toolbar { gap: .35rem; }
  .host-toolbar button, .host-choices button { min-height: 44px; }
  .host-toolbar button { padding: .35rem .55rem; }
  .host-bottom { align-items: flex-start; flex-direction: column; }
}
