.tutorial-page .guide-intro { max-width: 1280px; }
.tutorial-page .hero-intro { max-width: 44rem; }
.tutorial-page nav a[aria-current="location"] { color: var(--mint); text-decoration: underline; }
.tutorial-content { max-width: 960px; padding-bottom: 4rem; }
.tutorial-contents { padding-block: 1.5rem; gap: .35rem 1.5rem; border-bottom: 1px solid var(--line); }
.tutorial-contents a { color: var(--teal); }
.tutorial-step { padding-top: 3.5rem; }
.tutorial-step h2 { max-width: 46rem; margin-bottom: 1.5rem; font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.tutorial-step h3 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1.4rem; }
.tutorial-step > p { max-width: 49rem; margin-top: 1rem; }
.tutorial-page code { font-family: var(--mono); font-size: .92em; }
.tutorial-page p code, .tutorial-page li code { overflow-wrap: anywhere; }
.code-example { margin-top: 1.5rem; background: var(--night-deep); color: #effafa; border: 1px solid #34515b; }
.code-example figcaption { padding: .65rem 1.2rem; color: #b5cbd2; border-bottom: 1px solid #34515b; font: .76rem/1.6 var(--mono); }
.code-example pre { max-width: 100%; overflow-x: auto; margin: 0; padding: 1.2rem; font: .96rem/1.85 var(--mono); tab-size: 4; }
.code-example pre:focus-visible { outline: 3px solid #e6ac27; outline-offset: 3px; }
.code-example code { color: var(--mint); font-size: inherit; }
.wait-formula { padding: 1rem 1.2rem; border-left: 3px solid var(--teal); background: var(--wash); }
.tutorial-note { margin-top: 1.5rem; padding: 1.2rem; background: var(--wash); border-left: 3px solid var(--teal); }
.tutorial-note strong { display: block; margin-bottom: .4rem; }
.source-link { font-size: .88rem; color: var(--muted); }
.source-link a, .tutorial-source-list a { color: var(--teal); }
.tutorial-diagram { margin-top: 1.8rem; }
.tutorial-diagram > a { display: block; border: 1px solid var(--line); background: #f8fbfb; }
.tutorial-diagram figcaption { margin-top: .7rem; font-size: .88rem; color: var(--muted); }
.tutorial-diagram figcaption a { display: inline-block; color: var(--teal); }
.tutorial-table-wrap { overflow-x: auto; margin-top: 1.5rem; }
.tutorial-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tutorial-table caption { padding-bottom: .75rem; text-align: left; color: var(--muted); font-size: .9rem; }
.tutorial-table th, .tutorial-table td { text-align: left; padding: .8rem; border-bottom: 1px solid var(--line); }
.tutorial-table th { background: var(--wash); }
.tutorial-table code { white-space: nowrap; }
.variable-key { display: grid; gap: .8rem; margin: 1.5rem 0; }
.variable-key > div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; }
.variable-key dt { font-family: var(--mono); color: var(--teal); font-weight: 600; }
.variable-key dd { margin: 0; }
.tutorial-lessons { padding-left: 1.2rem; max-width: 49rem; }
.tutorial-lessons li { padding-left: .35rem; margin-block: 1rem; }
.tutorial-lessons li::marker { color: var(--teal); }
.tutorial-source-list { padding: 1.5rem; margin-top: 2rem; background: var(--wash); }
.tutorial-source-list h3 { margin-top: 0; }
.tutorial-source-list p { margin-top: 1rem; }
.tutorial-source-list ul { padding-left: 1.2rem; }
.tutorial-source-list li { margin-block: .6rem; }
.wait-demo { margin-top: 1.5rem; padding: clamp(1rem, 3vw, 2rem); background: var(--wash); border: 1px solid var(--line); }
.demo-mask { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; margin: 0; padding: 0; border: 0; }
.demo-mask legend { margin-bottom: .8rem; font-weight: 600; }
.demo-mask label { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.demo-mask input { width: 1.15rem; height: 1.15rem; accent-color: var(--teal); }
.demo-mask input:focus-visible { outline: 3px solid #e6ac27; outline-offset: 3px; }
.demo-signals { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.demo-signals > p { flex-basis: 100%; margin-bottom: .1rem; font-weight: 600; }
.wait-demo button { padding: .65rem 1rem; min-height: 44px; border: 1px solid var(--teal); background: white; color: var(--teal); font: 600 .94rem/1.5 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.wait-demo button:hover { background: #d9efed; }
.demo-registers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1.5rem 0; border: 1px solid var(--line); background: white; }
.demo-registers > div { padding: 1rem; border-right: 1px solid var(--line); }
.demo-registers > div:last-child { border-right: 0; }
.demo-registers dt { font-size: .8rem; color: var(--muted); }
.demo-registers dd { margin: .5rem 0 0; font: 600 clamp(1rem, 2vw, 1.4rem)/1.6 var(--mono); }
.demo-registers dd span { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.demo-result { padding: 1.2rem; background: var(--night-deep); color: #dce8eb; border-left: 4px solid #78969f; }
.demo-result[data-ready="true"] { border-left-color: var(--mint); }
.demo-result strong { display: block; margin-block: .6rem; font-size: 1.4rem; color: var(--mint); }
.demo-result p:first-child { font: .95rem/1.6 var(--mono); }
.demo-result p:last-child { font-size: .9rem; }
.demo-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.demo-actions button:first-child { background: var(--teal); color: white; }
.demo-actions button:first-child:hover { background: #005c58; }
.demo-caption { margin-top: 1rem; font-size: .84rem; color: var(--muted); }
@media (max-width: 600px) {
  .tutorial-step { padding-top: 2.5rem; }
  .demo-registers { grid-template-columns: 1fr; }
  .demo-registers > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-registers > div:last-child { border-bottom: 0; }
  .demo-registers dd { display: flex; gap: 1rem; align-items: baseline; }
  .variable-key > div { grid-template-columns: 4.8rem 1fr; gap: .6rem; }
}
