.algo-lab{border:2px solid var(--border);border-radius:24px;padding:22px;margin:22px 0;background:var(--surface)}
.algo-lab>p,.algo-lab>small{color:var(--muted);line-height:1.6}.algo-lab>small{display:block;margin-top:12px}.algo-lab h3{margin:12px 0 8px}
.algo-variant,.algo-scrubber{display:grid;grid-template-columns:1fr auto;gap:10px;font-weight:800;margin:18px 0;color:var(--ink)}
.algo-variant input,.algo-scrubber input{grid-column:1/-1;width:100%;accent-color:#58a700;min-height:36px}.algo-stage{background:var(--surface-alt);border:1px solid var(--border);padding:18px;border-radius:18px}.algo-stage h4{margin:0 0 16px;line-height:1.5}.algo-insight{line-height:1.7;margin-bottom:0;min-height:3.4em}
.algo-array{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}.algo-cell{display:grid;gap:6px;min-width:65px;padding:12px;border:2px solid var(--border);border-radius:14px;box-shadow:0 4px 0 var(--border);background:var(--surface);text-align:center;animation:algo-arrive .25s ease-out}.algo-cell small,.algo-cell span{font-size:11px;color:var(--muted)}.algo-cell strong{font-size:24px;color:var(--ink)}.algo-active{border-color:#58a700!important;box-shadow:0 4px 0 #58a700!important;background:color-mix(in srgb,#58cc02 12%,var(--surface))!important}.algo-discarded{opacity:.45}
.algo-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;border-radius:12px}.algo-table-scroll table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}.algo-table-scroll th,.algo-table-scroll td{padding:12px;border-bottom:1px solid var(--border);line-height:1.5;white-space:normal;min-width:74px}.algo-table-scroll th{color:var(--muted);font-size:12px}.algo-table-scroll tbody tr:last-child{background:color-mix(in srgb,#58cc02 8%,var(--surface))}
.algo-flow{list-style:none;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.algo-flow li{display:grid;gap:8px;border:2px solid var(--border);border-radius:14px;padding:16px}.algo-flow small{color:var(--muted);font-weight:800;font-size:11px}
.algo-bars{display:grid;gap:16px}.algo-bars>div{display:grid;grid-template-columns:80px 1fr 48px;align-items:center;gap:8px}.algo-bars>div>div{background:var(--border);border-radius:8px;height:16px;overflow:hidden}.algo-bars i{display:block;width:var(--algo-width);height:100%;background:#58a700;border-radius:8px;animation:algo-grow .45s ease-out}.algo-bars strong{text-align:right;font-variant-numeric:tabular-nums}.algo-bars span{font-size:12px;font-weight:800}.algo-bars+small{display:block;color:var(--muted);margin-top:12px}
.algo-network,.algo-points{display:block;width:100%;max-height:300px;overflow:visible}.algo-network path{stroke:var(--border);stroke-width:3;fill:none}.algo-network circle{fill:var(--surface);stroke:var(--muted);stroke-width:2;transition:fill .3s,stroke .3s}.algo-network text,.algo-points text{fill:var(--ink);font-weight:800;font-size:16px}.algo-network .algo-node-state{font-size:11px;font-weight:600}.algo-network .visited circle{fill:color-mix(in srgb,#58cc02 18%,var(--surface));stroke:#58a700}.algo-network .finished circle{fill:#58a700;stroke:#58a700}.algo-network .finished text:not(.algo-node-state){fill:#fff}.algo-network .algo-current circle{stroke:#e9a000;stroke-width:5}.algo-stack{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}.algo-stack span{font-size:11px;font-weight:800;color:var(--muted)}.algo-stack b{padding:8px 12px;border:1px solid var(--border);border-radius:10px}
.algo-points circle{fill:#58a700}.algo-points text{font-size:12px}.algo-points .algo-axis{stroke:var(--muted);fill:none;stroke-width:1.5}.algo-strip{fill:color-mix(in srgb,#58cc02 18%,transparent)}.algo-split{stroke:#e9a000;stroke-width:2;stroke-dasharray:5 5}.algo-active-point circle{fill:#e9a000;stroke:var(--ink);stroke-width:2}
.algo-playback{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:18px}.algo-playback button{min-height:44px}.algo-playback .btn{flex:1;min-width:90px}.algo-given{margin:18px 0;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.algo-given figcaption{font-size:11px;font-weight:900;color:var(--muted);margin-bottom:10px;letter-spacing:.06em}.algo-given>small{display:block;line-height:1.6;color:var(--muted);margin-top:10px}
@keyframes algo-arrive{from{transform:translateY(5px);opacity:.5}to{transform:translateY(0);opacity:1}}@keyframes algo-grow{from{width:0}to{width:var(--algo-width)}}
@media(max-width:480px){.algo-lab{padding:14px;border-radius:18px}.algo-stage{padding:12px}.algo-cell{min-width:58px;padding:10px}.algo-flow li{padding:12px}.algo-table-scroll th,.algo-table-scroll td{padding:9px;font-size:12px}.algo-bars>div{grid-template-columns:62px 1fr 42px}.algo-playback{gap:8px}.algo-playback .text-button{flex:1}.algo-given{padding:12px}}
@media(prefers-reduced-motion:reduce){.algo-cell,.algo-bars i{animation:none}.algo-network circle{transition:none}}
html[data-motion="reduced"] .algo-cell,html[data-motion="reduced"] .algo-bars i{animation:none}
.algo-variant[hidden]{display:none}html[data-motion="reduced"] .algo-network circle{transition:none}
.algo-network .algo-arrowhead{fill:var(--muted);stroke:none}.algo-network .algo-edge-selected>path{stroke:#58a700;stroke-width:4}.algo-network .algo-edge-weight{font-size:12px;paint-order:stroke;stroke:var(--surface-alt);stroke-width:5;stroke-linejoin:round}.algo-network .algo-node-badge{font-size:9px;font-weight:700}.algo-network .finished .algo-node-badge{fill:#fff}
.algo-network .algo-current circle{transform-box:fill-box;transform-origin:center;animation:algo-node-focus .4s ease-out}
@keyframes algo-node-focus{from{transform:scale(.86)}to{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.algo-network .algo-current circle{animation:none}}
html[data-motion="reduced"] .algo-network .algo-current circle{animation:none}
.algo-graph-summary{margin:10px 0 16px}.algo-graph-summary>span{display:block;font-size:12px;color:var(--muted);font-weight:800;margin-bottom:8px}.algo-graph-summary>div{display:flex;flex-wrap:wrap;gap:6px}.algo-graph-summary>div>div{display:grid;gap:5px;flex:1 0 45px;text-align:center;min-width:0;border:1px solid var(--border);border-radius:10px;padding:8px 4px;background:var(--surface)}.algo-graph-summary b{font-size:14px}.algo-graph-summary span{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.algo-dp-grid table{font-variant-numeric:tabular-nums}.algo-dp-grid td,.algo-dp-grid th{min-width:42px;text-align:center}.algo-dp-grid .algo-dp-active{background:var(--green-light);color:var(--green-dark);box-shadow:inset 0 0 0 2px #58a700;font-weight:900}.algo-scroll-hint{display:block;margin-top:12px;line-height:1.6;color:var(--muted)}.algo-coding-tree{display:block;width:100%;max-height:320px}.algo-coding-tree path{stroke:var(--border);stroke-width:2;fill:none}.algo-coding-tree circle{fill:var(--surface);stroke:#58a700;stroke-width:2}.algo-coding-tree text{fill:var(--ink);font-size:14px;font-weight:800}.algo-schedule{display:grid;gap:14px}.algo-schedule>div{display:grid;grid-template-columns:22px 1fr 45px;align-items:center;gap:8px}.algo-schedule>div>div{position:relative;background:var(--border);height:23px;border-radius:6px}.algo-schedule i{position:absolute;height:100%;background:var(--muted);border-radius:6px}.algo-schedule .algo-chosen-interval{background:#58a700}.algo-schedule span{font-size:12px;font-variant-numeric:tabular-nums}.algo-current-interval>div{outline:2px solid #e9a000;outline-offset:3px}
.algo-dp-grid .algo-dp-source{background:color-mix(in srgb,#ffbf00 15%,var(--surface));box-shadow:inset 0 0 0 1px #e9a000}
