/* Scoped styles: use the host course palette without changing practice UI. */
.ls-walkthrough { --ls-line: var(--line, #d8dee5); --ls-ink: var(--ink, #202b36); --ls-blue: var(--blue, #285ad4); --ls-muted: var(--muted, #596675); color: var(--ls-ink); background: #fff; border: 1px solid var(--ls-line); border-radius: 16px; margin: 22px 0; padding: 22px; min-width: 0; font: 16px/1.55 var(--body, "Segoe UI", Arial, sans-serif); }
.ls-walkthrough *, .ls-walkthrough *::before, .ls-walkthrough *::after { box-sizing: border-box; }
.ls-walkthrough [hidden] { display: none !important; }
.ls-walkthrough p { margin: 0 0 10px; }
.ls-walkthrough h3, .ls-walkthrough h4 { margin: 0 0 10px; color: inherit; line-height: 1.35; }
.ls-walkthrough .ls-title { font-size: 23px; letter-spacing: -.4px; }
.ls-label { display: block; color: var(--terracotta, #a64c32); font-size: 11px; font-weight: 750; letter-spacing: 1.2px; margin-bottom: 7px; }
.ls-introduction { max-width: 68ch; }
.ls-walkthrough .ls-help { color: var(--ls-muted); font-size: 14px; margin-bottom: 18px; }
.ls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; align-items: start; }
.ls-grid > *, .ls-state > * { min-width: 0; }
.ls-input { margin-bottom: 14px; border: 1px solid var(--ls-line); border-radius: 8px; padding: 10px; }
.ls-input-values { margin: 0; padding-left: 22px; font: 14px/1.6 var(--mono, Consolas, monospace); }
.ls-input-values li { margin: 0; padding: 2px 0; }
.ls-input-values span { font-family: var(--body, "Segoe UI", Arial, sans-serif); font-size: 12px; color: var(--ls-muted); }
.ls-input-read { background: #edf7f0; }
.ls-function-flow { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); gap: 7px; align-items: center; margin-bottom: 18px; }
.ls-function-node { display: grid; gap: 3px; align-content: start; min-height: 100%; padding: 12px; border: 1px solid var(--ls-line); border-radius: 9px; background: #f6f7fa; overflow-wrap: anywhere; }
.ls-function-node .ls-label { font-size: 9px; letter-spacing: .6px; margin-bottom: 5px; }
.ls-function-node > strong { font: 650 15px/1.5 var(--mono, Consolas, monospace); }
.ls-function-active { border: 2px solid #6382b4; background: #edf2ff; }
.ls-function-arrow { color: #486695; text-align: center; font-size: 23px; font-weight: 700; }
.ls-function-body { border-style: dashed; }
.ls-argument { font: 13px/1.5 var(--mono, Consolas, monospace); }
.ls-function-ready { grid-column: 1 / -1; display: grid; gap: 4px; padding: 12px 14px; border: 1px dashed #7c91bb; border-radius: 9px; background: #f5f7ff; }
.ls-function-ready span { font-size: 13px; color: var(--ls-muted); }
.ls-walkthrough .ls-panel-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.ls-code-scroll { overflow-x: auto; border: 1px solid var(--ls-line); border-radius: 9px; background: #f5f7fa; padding-block: 10px; }
.ls-code-line { display: grid; grid-template-columns: 20px 26px max-content; min-width: 100%; width: max-content; min-height: 28px; padding-inline: 7px 14px; align-items: baseline; border-left: 3px solid transparent; }
.ls-line-arrow { color: #7b4e05; font-weight: 800; }
.ls-line-number { color: var(--ls-muted); font: 12px/1.7 var(--mono, Consolas, monospace); }
.ls-walkthrough .ls-line-code { font: 14px/1.7 var(--mono, Consolas, monospace); white-space: pre; color: var(--ls-ink); background: none; border: 0; padding: 0; overflow-wrap: normal; }
.ls-current { background: #fff0c7; border-left-color: #a76700; }
.ls-scopes { display: grid; gap: 8px; }
.ls-scope { padding: 10px; border: 1px solid var(--ls-line); border-radius: 9px; background: #fafbfd; }
.ls-local-scope { border: 2px solid #7c91bb; background: #f5f7ff; }
.ls-walkthrough .ls-scope-title { font-size: 12px; font-weight: 750; margin: 0 0 7px; }
.ls-walkthrough .ls-scope-note { font-size: 12px; color: var(--ls-muted); }
.ls-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 7px; margin: 0; }
.ls-value { padding: 8px 10px; border-radius: 7px; border: 1px solid #c8d5e8; background: white; min-width: 0; }
.ls-value dt { font: 13px/1.5 var(--mono, Consolas, monospace); color: var(--ls-muted); overflow-wrap: anywhere; }
.ls-value dd { margin: 3px 0 0; font: 650 18px/1.5 var(--mono, Consolas, monospace); overflow-wrap: anywhere; }
.ls-changed { animation: ls-reveal .18s ease-out; border-color: #548767; background: #edf7f0; }
.ls-changed-label { display: block; margin-top: 4px; color: #256345; font-size: 10px; font-weight: 650; }
.ls-walkthrough .ls-empty { padding: 10px 0; color: var(--ls-muted); font-size: 14px; }
.ls-output-panel { margin-top: 14px; }
.ls-walkthrough .ls-output { margin: 0; padding: 12px; min-height: 51px; border: 1px solid #c8d5d0; border-radius: 8px; background: #f1f7f3; color: #1e4730; font: 14px/1.6 var(--mono, Consolas, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.ls-walkthrough .ls-empty-output { color: var(--ls-muted); font-family: inherit; font-size: 13px; }
.ls-return { padding: 12px; border: 1px dashed #6685bc; border-radius: 8px; margin-top: 10px; background: #edf2ff; }
.ls-return strong { font: 700 22px/1.4 var(--mono, Consolas, monospace); }
.ls-walkthrough .ls-return p { font-size: 12px; margin: 5px 0 0; }
.ls-note { background: #f4f6fa; border-left: 4px solid var(--ls-blue); border-radius: 0 9px 9px 0; padding: 14px 16px; margin-top: 18px; }
.ls-walkthrough .ls-note-title { font-size: 16px; }
.ls-walkthrough .ls-explanation { margin: 0; }
.ls-decision { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.ls-decision code { white-space: normal; overflow-wrap: anywhere; }
.ls-decision-result { color: #264c81; }
.ls-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 8px; z-index: 3; margin: 16px 0 18px; padding: 10px 0; border-bottom: 1px solid var(--ls-line); background: #fff; box-shadow: 0 7px 7px -7px rgb(28 42 60 / 18%); }
.ls-button { appearance: none; border: 1px solid #b8c3d0; border-radius: 8px; background: white; color: var(--ls-ink); min-height: 44px; padding: 9px 12px; font-family: inherit; font-size: 14px; font-weight: 650; line-height: 1.4; cursor: pointer; }
.ls-button:focus-visible, .ls-code-scroll:focus-visible, .ls-matrix-scroll:focus-visible { outline: 3px solid var(--ls-blue); outline-offset: 3px; }
.ls-next { background: var(--ls-blue); border-color: var(--ls-blue); color: white; }
.ls-button:disabled, .ls-button[aria-disabled="true"] { cursor: default; opacity: .55; }
.ls-counter { margin-left: auto; color: var(--ls-muted); font-size: 12px; white-space: nowrap; }
.ls-walkthrough .ls-completion { margin: 12px 0 0; font-size: 13px; color: #256345; }
.ls-collection { padding: 10px 0; }
.ls-walkthrough .ls-collection-title { font-size: 12px; font-weight: 750; }
.ls-tape { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.ls-walkthrough .ls-cell { list-style: none; flex: 0 1 auto; display: grid; min-width: 36px; margin: 0; padding: 4px 7px; text-align: center; border: 1px solid var(--ls-line); border-radius: 6px; background: white; }
.ls-index, .ls-negative-index { color: var(--ls-muted); font: 11px/1.5 var(--mono, Consolas, monospace); }
.ls-walkthrough .ls-index-note, .ls-walkthrough .ls-range-label { font-size: 11px; color: var(--ls-muted); margin: 5px 0; }
.ls-walkthrough .ls-stop-boundary { border-left: 3px dashed #a64c32; }
.ls-stop-label { color: #a64c32; font: 10px/1.4 var(--body, "Segoe UI", Arial, sans-serif); }
.ls-walkthrough .ls-end-boundary { display: grid; align-content: center; list-style: none; color: #a64c32; font-size: 10px; border-left: 3px dashed #a64c32; padding-left: 5px; margin: 0; }
.ls-cell-value { font: 650 17px/1.5 var(--mono, Consolas, monospace); overflow-wrap: anywhere; }
.ls-walkthrough .ls-selected { background: #fff0c7; border-color: #a76700; box-shadow: inset 0 0 0 1px #a76700; }
.ls-walkthrough .ls-collection-note { margin-top: 6px; margin-bottom: 0; color: var(--ls-muted); font-size: 12px; }
.ls-mapping { display: grid; gap: 5px; margin: 0; }
.ls-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 7px; border: 1px solid var(--ls-line); border-radius: 6px; }
.ls-pair dt, .ls-pair dd { font: 14px/1.5 var(--mono, Consolas, monospace); margin: 0; overflow-wrap: anywhere; }
.ls-matrix-scroll { overflow: auto; }
.ls-matrix { border-collapse: collapse; font: 13px/1.5 var(--mono, Consolas, monospace); margin: 0; width: auto; }
.ls-matrix th, .ls-matrix td { border: 1px solid var(--ls-line); padding: 7px 10px; text-align: center; }
.ls-matrix th { color: var(--ls-muted); font-weight: 600; font-size: 10px; }
@keyframes ls-reveal { from { transform: translateY(3px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 700px) {
  .ls-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ls-walkthrough { padding: 16px; }
  .ls-walkthrough .ls-title { font-size: 21px; }
  .ls-counter { width: 100%; margin: 3px 0 0; }
  .ls-function-flow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ls-function-arrow { transform: rotate(90deg); justify-self: center; line-height: 1.1; }
}
@media (max-width: 420px) {
  .ls-walkthrough { padding: 12px; font-size: 15px; }
  .ls-button { font-size: 12px; padding: 9px; }
  .ls-next { flex: 1 1 auto; }
  .ls-note { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-walkthrough *, .ls-walkthrough *::before, .ls-walkthrough *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .ls-controls { display: none; }
  .ls-walkthrough { break-inside: avoid; }
  .ls-code-scroll { overflow: visible; }
}
