/* Guide-only typography and layout; existing lesson styles stay independent. */
.study-guide {max-width:86rem;}
.study-guide > p,.study-guide .page-lede,.study-guide > section > p,.study-guide > section > ul,.study-guide > section > ol {max-width:72ch;}
.study-guide :is(h2,h3) {line-height:1.35;}
.study-guide h2 {margin-block:2rem .8rem;}
.study-guide p,.study-guide li {line-height:1.75;}
.study-guide > section {margin-block:2rem;}
.study-guide .study-contents {display:flex;flex-wrap:wrap;gap:.65rem 1.2rem;border-block:1px solid var(--line);padding-block:1rem;margin-block:1.5rem;}
.study-guide .study-subjects {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
.study-guide .study-subjects details {min-width:0;border:1px solid var(--line);border-radius:7px;padding:1rem;background:var(--surface);}
.study-guide .study-subjects summary {font-weight:600;cursor:pointer;line-height:1.6;}
.study-guide .study-subjects dl {margin-bottom:0;line-height:1.7;}
.study-guide .study-subjects dt {font-weight:600;margin-top:.8rem;}
.study-guide .study-subjects dd {margin:.3rem 0 0;overflow-wrap:anywhere;}
.study-guide .study-steps {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;padding:0;list-style:none;}
.study-guide .study-step,.study-guide .study-route {min-width:0;border:1px solid var(--line);border-radius:8px;padding:clamp(1rem,2cqi,1.6rem);background:var(--surface);}
.study-guide .study-step h2,.study-guide .study-step h3 {margin-top:0;}
.study-guide .study-note {border-left:3px solid var(--accent);background:var(--accent-soft);padding:1rem 1.2rem;margin-block:1.4rem;}
.study-guide .study-links {display:flex;flex-wrap:wrap;gap:.7rem 1.2rem;}
.study-guide .study-checklist {padding-left:1.4rem;}
.study-guide .study-checklist li {margin-block:.65rem;}
.study-guide .study-visualizer {border:1px solid var(--line);border-radius:9px;background:var(--surface);padding:clamp(1rem,2.4cqi,1.8rem);margin-block:2rem;min-width:0;}
.study-guide .study-visualizer > h2 {margin-top:.5rem;}
.study-guide .study-visualizer-inputs {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem;margin-block:1.5rem;}
.study-guide .study-visualizer label {display:flex;flex-direction:column;gap:.45rem;min-width:0;font-weight:600;line-height:1.5;}
.study-guide .study-visualizer label small {font-size:.83rem;font-weight:400;color:var(--muted);}
.study-guide .study-visualizer input {box-sizing:border-box;width:100%;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:5px;background:var(--surface-2);color:var(--ink);padding:.65rem .8rem;font:inherit;}
.study-guide .study-visualizer :is(input,button,summary,pre):focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
.study-guide .study-representations {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
.study-guide .study-representation {min-width:0;border-top:1px solid var(--line);padding-top:1rem;}
.study-guide .study-representation h3 {font-size:1.15rem;margin:0 0 .75rem;}
.study-guide .study-picture {grid-column:1/-1;}
.study-guide .study-arithmetic {font-size:1.1rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;}
.study-guide [data-study-predict-form] {display:flex;flex-wrap:wrap;gap:.75rem;align-items:end;}
.study-guide [data-study-predict-form] label {flex:1 1 12rem;}
.study-guide [data-study-result]:not(:empty) {display:block;background:var(--accent-soft);padding:.85rem 1rem;margin-top:1rem;border-radius:5px;line-height:1.65;}
.study-guide [data-study-error]:not(:empty) {border-left:3px solid var(--note);padding:.6rem 1rem;background:var(--note-soft);}
.study-guide [data-study-figure] {margin:0;}
.study-guide [data-study-chart] {max-width:42rem;margin-inline:auto;}
.study-guide [data-study-chart] svg {display:block;width:100%;height:auto;overflow:visible;}
.study-guide [data-study-chart] text {font:12px sans-serif;fill:var(--muted);}
.study-guide .study-gridline {stroke:var(--line);stroke-width:1;}
.study-guide .study-axis {stroke:var(--muted);fill:none;stroke-width:1;}
.study-guide .study-model-line {stroke:var(--accent);fill:none;stroke-width:2.5;}
.study-guide .study-selected-guides {stroke:var(--muted);fill:none;stroke-dasharray:4 4;}
.study-guide .study-selected-point {fill:var(--accent);stroke:var(--surface);stroke-width:2;}
.study-guide figcaption {font-size:.9rem;color:var(--muted);line-height:1.7;margin-top:.6rem;}
.study-guide [data-study-working] {border-top:1px solid var(--line);margin-top:1.25rem;padding-top:1rem;}
.study-guide [data-study-steps] {display:block;padding-left:1.4rem;}
.study-guide .study-python {margin-block:1.5rem;}
.study-guide .study-python summary {cursor:pointer;line-height:1.6;}
.study-guide .study-python pre {box-sizing:border-box;max-width:100%;overflow:auto;background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:1rem;font-size:.85rem;line-height:1.65;tab-size:4;}
.study-guide .study-workbench-footer {display:flex;align-items:center;flex-wrap:wrap;gap:.8rem 1.2rem;border-top:1px solid var(--line);padding-top:1rem;}
.study-guide .study-workbench-footer span {font-size:.85rem;line-height:1.6;color:var(--muted);flex:1 1 16rem;}
.study-guide .study-visualizer [hidden] {display:none!important;}
.study-entry {max-width:76ch;margin-block:1rem 1.5rem;padding:.8rem 1rem;border-left:3px solid var(--accent);background:var(--surface);font-size:.9rem;line-height:1.65;}
.study-entry p {margin:.35rem 0;}
@media(max-width:600px){.study-guide .study-subjects,.study-guide .study-steps,.study-guide .study-visualizer-inputs,.study-guide .study-representations {grid-template-columns:minmax(0,1fr);}.study-guide .study-picture {grid-column:auto;}.study-guide .study-visualizer {padding:1rem;}.study-guide .study-arithmetic {font-size:1rem;}}

.study-guide .study-outline {margin-block:1.5rem;border-block:1px solid var(--line);padding-block:1rem;}
.study-guide .study-outline > summary {cursor:pointer;font-weight:600;}
.study-guide .study-outline .study-contents {border:0;margin-bottom:0;padding-bottom:0;}
.study-guide [id^="study-"] {scroll-margin-top:5rem;}
.study-guide > section > dl {max-width:72ch;line-height:1.75;}
.study-guide > section > dl dt {margin-top:1rem;}
.study-guide > section > dl dd {margin:.35rem 0 1rem;}
@media(max-width:600px){.study-guide [data-study-chart] text {font-size:18px;}}
