.top-links{display:flex;gap:7px 16px;flex-wrap:wrap;padding-bottom:16px;font-weight:800}
.mode-switch,.chapters,.transport-buttons,.node-list{display:flex;gap:7px;flex-wrap:wrap}
.mode-switch{margin-bottom:10px}.mode-switch button[aria-pressed=true],.chapters button[aria-current=step],.node-list button[aria-current=true]{background:var(--phase);color:#142c1d;border-color:#548568;font-weight:800}
.chapters{padding:8px 0 12px}.chapters button{min-height:32px;padding:4px 10px;font-size:13px}
.lesson-grid{display:grid;grid-template-columns:minmax(0,2.16fr) minmax(305px,1fr);align-items:start;gap:14px}
.visual{min-width:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel)}
.scope{display:flex;gap:9px;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.scope strong{background:var(--phase);color:#142c1d;padding:3px 8px;border-radius:5px}
.viewport{position:relative;width:100%;aspect-ratio:8/5;overflow:hidden;background:#edf5f8}
[data-theme=night] .viewport{background:#0e1716}
.viewport canvas,.viewport img,.hotspots{position:absolute;inset:0;width:100%;height:100%}
.viewport canvas:first-child{touch-action:none;cursor:grab}
.viewport canvas:first-child:active{cursor:grabbing}
.viewport img{object-fit:fill}
.overlay,.hotspots{pointer-events:none}
.viewport .overlay{z-index:1}
.viewport .hotspots{z-index:2}
.hotspot{position:absolute;transform:translate(-50%,-50%);min-width:28px;min-height:28px;width:28px;height:28px;padding:0;text-align:center;pointer-events:auto;border:2px solid var(--panel);border-radius:100%;background:var(--green);color:#0b1a11;font-weight:900;font-size:12px}
.hotspot:active{transform:translate(-50%,-50%)}
.hotspot:hover,.hotspot[aria-current=true]{background:#ff946d;color:#271209;border-color:var(--panel)}
.figure-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-top:1px solid var(--line)}
.figure-tools button{min-height:32px;padding:4px 8px;font-size:12px}
.figure-tools label{display:flex;gap:4px;align-items:center;font-size:12px}
.figure-tools input{margin:0}
.flow-legend{margin:0;display:flex;gap:6px 10px;flex-wrap:wrap;list-style:none;padding:8px 12px;border-top:1px solid var(--line);font-size:12px;color:var(--fg)}
.flow-legend i{display:inline-block;width:17px;margin-right:5px;vertical-align:middle;border-top:3px solid var(--flow)}
.flow-legend li[data-kind=bleed] i,.flow-legend li[data-kind=intake] i{border-top-style:dashed}
.guide{padding:18px}
.guide h2{font-size:clamp(22px,2vw,31px);margin:7px 0 9px}
.guide p{margin:9px 0 12px}
.step-count,.stage-message{font-size:13px;font-weight:800;color:var(--muted)}
.transport-buttons{margin-top:12px}
.transport-buttons button{font-size:13px;min-height:34px;padding:4px 9px}
#step-progress{width:100%;height:10px;margin-top:12px;accent-color:var(--green)}
.stage-message{min-height:1.5em;margin:0!important}
.detail-link{font-weight:800}
.engine-detail{margin-top:6px;font-size:13px;color:var(--muted)}
.engine-detail summary{cursor:pointer;font-weight:800}
.engine-detail img{display:block;width:100%;height:auto;margin-top:7px;border:1px solid var(--line);border-radius:6px}
.node-list{padding-bottom:8px}.node-list button{min-height:34px;padding:4px 9px;font-size:13px}
#node-description{padding-top:6px;border-top:1px solid var(--line)}
.sources{margin-top:13px}
.sources p{font-size:14px}
.sources a{margin-right:10px}
@media(max-width:900px){.lesson-grid{grid-template-columns:minmax(0,1fr)}.intro{display:block}.top-links{padding-bottom:11px}}
@media(max-width:500px){.guide{padding:13px}.scope,.figure-tools,.flow-legend{padding-inline:8px}.scope{font-size:11px}.chapters,.mode-switch{gap:5px}.chapters button{font-size:12px}.hotspot{width:23px;height:23px;min-width:23px;min-height:23px}}
@media print{
  .top-links,.mode-switch,.chapters,.transport-buttons,.figure-tools,.node-list,#step-progress,.hotspots,.stage-message{display:none!important}
  .lesson-grid{display:block}.visual,.guide{break-inside:avoid}.scope,.visual,.guide{color:#171612;background:white}
  .viewport{max-width:140mm}
}
