/* Core explanations, source records and routes stay at projection body size.
   All trace frames share fixed regions; secondary teaching notes live in the plan. */
.slide.algorithm-slide{padding:20px 4vw;justify-content:center}
.algorithm-slide .slide-head{margin-bottom:14px;gap:16px}
.algorithm-slide .slide-head h2{font-size:clamp(34px,3.2vw,50px);margin:0;line-height:1.25}
.algorithm-slide .activity-icon{width:52px;height:52px}
.algorithm-lesson{width:100%;max-width:1440px;align-self:center}
.alg-concepts{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:0;margin:0 0 14px}
.alg-concepts li{min-width:0}
.alg-concepts .alg-stage{height:100%;display:flex;align-items:center;padding:10px 12px;border:1px solid #bdcec0;border-radius:9px;background:#f8f6e9;margin:0!important}
.alg-concepts b{font-size:24px;line-height:1.35;color:#245f53;white-space:nowrap}
.alg-concepts li.active .alg-stage{background:#f3e6bb;border-color:#b79243;box-shadow:inset 0 -3px 0 #b79243}
.alg-board{display:grid;grid-template-columns:1fr 1.1fr;gap:24px;align-items:center;min-width:0}
.alg-map{min-width:0;margin:0}
.alg-map-svg{display:block;width:100%;height:340px}
.alg-map figcaption{font-size:14px;margin:5px 0 0;color:#4b6c60;line-height:1.5;white-space:nowrap}
.alg-map-svg [data-alg-edge].blocked{stroke-dasharray:5 6}
.alg-map-svg [data-alg-edge].route{stroke:#906498;stroke-width:8;stroke-dasharray:9 5}
.alg-map-svg [data-alg-edge].route.forward{stroke-dasharray:none}
.alg-map-svg [data-alg-edge].sailed{stroke:#b78628;stroke-width:8;stroke-dasharray:none}
.alg-map-node circle{transition:none}
.alg-map-node.waiting circle{fill:#d8e8ef;stroke:#427d94}
.alg-map-node.checked circle{fill:#c7d9cf;stroke:#658778}
.alg-map-node.new circle{stroke:#297858;stroke-width:4}
.alg-map-node.current circle{fill:#ffe0a0;stroke:#a57628;stroke-width:3}
.alg-map-node.route circle{fill:#eddef1;stroke:#855b91;stroke-width:3}
.alg-map-node.blocked circle{fill:#f2d7c6;stroke:#a3654f}
.alg-map-node.excluded circle{stroke:#ae472a;stroke-width:5}
.alg-state{min-width:0;background:#f7f6e9;border:1px solid #c8d7c6;border-radius:11px;padding:18px}
.alg-state h3{font-size:30px;line-height:1.35;margin:0 0 13px;height:41px;white-space:nowrap}
.alg-queue-row{display:flex;align-items:center;gap:18px;margin-bottom:13px;min-height:46px}
.alg-queue-row>b{font-size:26px;line-height:1.4;white-space:nowrap}
.alg-queue{display:flex;list-style:none;padding:0;margin:0;gap:8px;height:42px;align-items:center}
.alg-queue li{font-size:28px;font-weight:700;min-width:43px;text-align:center;padding:3px 10px;border:1px solid #6594a5;border-radius:7px;color:#285c73;background:#ddecf1;line-height:1.25}
.alg-queue li.new{box-shadow:0 0 0 2px #b18cc0;background:#eee0ef}
.alg-explain{font-size:28px;line-height:1.55;height:131px;margin:0 0 15px}
.alg-memory>b{display:block;font-size:26px;line-height:1.4;color:#426659;margin-bottom:8px}
.alg-parent-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;height:81px;grid-auto-rows:37px;align-content:start}
.alg-parent-list span{font-size:26px;color:#3b6558;background:#e8eddf;border-radius:5px;padding:3px 6px;line-height:1.2;white-space:nowrap}
.alg-parent-list span.active{background:#ecdaf0;color:#734485;box-shadow:inset 0 0 0 1px #c3a2ca}
.alg-route{font-size:27px;font-weight:600;color:#795083;line-height:1.5;margin:13px 0 0;height:41px;white-space:nowrap}
.alg-controls{display:flex;align-items:center;gap:10px;margin-top:14px;flex-wrap:nowrap}
.alg-controls button{font-size:20px;padding:9px 14px;white-space:nowrap;margin:0!important}
.alg-counter{font-size:17px;font-variant-numeric:tabular-nums;color:#5a7669;min-width:96px;text-align:center;margin-right:auto}
.alg-boat-state{font-size:24px;font-weight:600;color:#256154}
/* Reset announcement is assistive status, not persistent teacher instructions. */
.alg-navigation-note{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-height:780px) and (min-width:901px){
 .slide.algorithm-slide{padding:12px 4vw}.algorithm-slide .slide-head{margin-bottom:10px}.algorithm-slide .slide-head h2{font-size:34px}.algorithm-slide .activity-icon{width:43px;height:43px}
 .alg-concepts{margin-bottom:10px;gap:8px}.alg-concepts .alg-stage{padding:8px 10px}.alg-concepts b{font-size:23px;line-height:1.3}
 .alg-board{gap:18px}.alg-map-svg{height:300px}.alg-map figcaption{font-size:14px}
 .alg-state{padding:12px 14px}.alg-state h3{font-size:27px;height:37px;margin-bottom:9px}.alg-queue-row{gap:14px;margin-bottom:10px;min-height:36px}.alg-queue-row>b{font-size:24px}.alg-queue{height:35px}.alg-queue li{font-size:25px;padding:2px 9px}
 .alg-explain{font-size:24px;line-height:1.5;height:108px;margin-bottom:10px}.alg-memory>b{font-size:24px;margin-bottom:6px}.alg-parent-list{height:70px;grid-auto-rows:32px;gap:6px}.alg-parent-list span{font-size:24px;padding:2px 5px}.alg-route{font-size:24px;height:36px;margin-top:10px}
 .alg-controls{margin-top:10px;gap:8px}.alg-controls button{font-size:18px;padding:7px 12px}.alg-counter{font-size:16px}.alg-boat-state{font-size:23px}
}
@media(max-width:900px){
 .slide.algorithm-slide{padding:20px}.alg-concepts{grid-template-columns:1fr 1fr}.alg-concepts b{font-size:20px}.alg-board{grid-template-columns:1fr}.alg-controls{flex-wrap:wrap}.alg-controls button{font-size:17px}.alg-counter{margin-right:0}.alg-boat-state{font-size:22px}.alg-map-svg{height:auto}.alg-map figcaption{font-size:14px;white-space:normal}.alg-state h3{font-size:25px;height:auto;min-height:34px;white-space:normal}.alg-explain{font-size:24px;height:auto;min-height:108px}.alg-memory>b{font-size:23px}.alg-parent-list{grid-template-columns:repeat(3,minmax(0,1fr));height:114px}.alg-parent-list span{font-size:23px}.alg-route{font-size:24px;white-space:normal;height:auto;min-height:36px}
}
@media(prefers-reduced-motion:reduce){.algorithm-lesson *{transition:none!important;animation:none!important}}
