/* The attempt tree: washi ground, ink branches and blossoms; one scrubber over the token curve; zoom in the corner. */
.attempt-figure{max-width:100%;margin:24px 0}
.tree-stage{--tree-rule:#ddd7ca;--tree-ink:#595857;background:#fffdf7;border:1px solid var(--tree-rule);border-radius:10px;padding:16px;min-width:0}
.tree-controls{display:grid;gap:12px;margin-bottom:18px;font-family:system-ui,sans-serif;font-size:var(--small)}
.tree-controls button,.tree-controls select{font:inherit;color:#595857;background:#fffefb;border:1px solid var(--tree-rule);border-radius:6px;padding:5px 9px;cursor:pointer}
.tree-controls button:hover{border-color:#898274}.tree-controls button:disabled{opacity:.35;cursor:default}
.tree-controls :focus-visible,.tree-stage:focus-visible,.tree-scroll:focus-visible{outline:2px solid #8e6d77;outline-offset:3px}
.tree-player{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tree-player label{display:inline-flex;align-items:center;gap:5px}.tree-player output{color:#77716a;margin-left:auto;font-variant-numeric:tabular-nums}
.tree-art{position:relative;display:grid;grid-template-columns:100px minmax(0,1fr);border:1px solid var(--tree-rule);border-radius:7px;overflow:hidden;background:linear-gradient(125deg,#fffdf7,#f5ecd7)}
.tree-lane-labels{padding-top:58px;border-right:1px solid #e3dac8;background:#fffdf7}
.tree-lane-label{height:53px;display:flex;align-items:center;gap:6px;padding:0 8px;color:#595857;font:12px/1.3 system-ui,sans-serif;white-space:nowrap}
.tree-lane-label i{display:inline-block;width:7px;height:7px;flex-shrink:0;border-radius:50%;opacity:.75}
.tree-round-caption{display:block;font-size:9px;line-height:1.5;color:#77716a;font-weight:400}
.tree-lane-label:disabled{cursor:default;color:#999}
.tree-phase-agents{display:flex;gap:8px;flex-wrap:wrap;font-size:11px}
.tree-lane-label{box-sizing:border-box;width:100%;border:0;background:none;text-align:left;cursor:pointer}
.tree-lane-label:hover,.tree-lane-label[aria-expanded="true"]{background:#eee6d8}
.tree-lane-label:focus-visible{outline:2px solid #8e6d77;outline-offset:-2px}
.tree-context-label{box-sizing:border-box;height:130px;padding:22px 8px;color:#77716a;font:11px/1.4 system-ui,sans-serif;border-top:1px solid #e8dfcd}
#attempt-svg .tree-edge.issue-edge{stroke-opacity:.4;stroke-width:1.3;pointer-events:stroke;cursor:pointer}
#attempt-svg .tree-edge.mistake,#attempt-svg .tree-edge.correction{stroke-opacity:.85;stroke-width:1.8}
#attempt-svg .tree-edge-label{cursor:pointer}
#attempt-svg .tree-edge-label text{font-size:10px}
#attempt-svg .tree-edge-label:focus-visible rect{stroke:#8e6d77}
#tree-issue-detail:empty{display:none}
#tree-issue-detail{margin:20px 0;padding:12px 16px;background:#fff6e8;border-radius:6px}
.tree-scroll{overflow-x:auto;overflow-y:hidden;min-width:0;cursor:grab;overscroll-behavior-x:contain;touch-action:pan-x pan-y}
.tree-scroll.dragging{cursor:grabbing;user-select:none}
.tree-scroll svg{max-width:none;display:block;overflow:hidden}
#attempt-svg .tree-node{cursor:pointer;outline:none}
#attempt-svg .blossom{fill-opacity:.84;stroke:none}
#attempt-svg .blossom-mist{fill-opacity:.11;pointer-events:none}
#attempt-svg .blossom-hit{fill:transparent}
#attempt-svg .tree-node:hover .blossom,#attempt-svg .tree-node:focus .blossom,#attempt-svg .tree-node.selected .blossom{stroke:#595857;stroke-width:1;fill-opacity:1}
#attempt-svg .tree-node:focus-visible .blossom-mist{stroke:#595857;stroke-width:1;stroke-dasharray:2 2;fill-opacity:.2}
#attempt-svg .tree-branch{fill:none;stroke:#595857;stroke-opacity:.24;stroke-width:1.5;stroke-linecap:round;pointer-events:none}
#attempt-svg .tree-edge{fill:none;stroke:#595857;stroke-width:1;stroke-opacity:.09;pointer-events:none}
#attempt-svg .tree-edge.active{stroke-opacity:.8;stroke-width:1.6}
#attempt-svg .tree-playhead{stroke:#595857;stroke-opacity:.6;stroke-dasharray:3 4;pointer-events:none}
#attempt-svg text{font:11px system-ui,sans-serif;fill:#77716a}
#attempt-svg .phase-label{fill:#595857;font-weight:500}
.tree-hint{font-size:var(--small);color:#77716a;margin:12px 0 0}
@media(max-width:600px){.tree-stage{padding:10px}.tree-art{grid-template-columns:83px minmax(0,1fr)}.tree-lane-label{font-size:11px;padding:0 5px;gap:4px}.tree-player{gap:6px}.tree-player output{margin-left:0;width:100%}.tree-controls{gap:10px}.tree-zoom-overlay{left:5px}.tree-zoom-overlay button{min-width:22px;padding:0 4px}}
#node-detail{border-top:1px solid #ddd;padding-top:14px;min-height:100px}
#node-detail .node-argument{border:1px solid #e6e6e6;border-radius:6px;padding:12px 16px}
#node-detail .node-meta{color:#666;font-size:var(--small)}
#node-detail .parent-links{display:flex;gap:8px;flex-wrap:wrap}
/* One bar for time and tokens: the range input lies over the cumulative token curve, shaded up to the playhead. */
.tree-scrubber{position:relative;height:30px;margin-top:-4px}
#tree-token-spark{position:absolute;left:4px;top:3px;width:calc(100% - 8px);height:24px;display:block;border-radius:3px;background:#f3eee2}
#tree-token-spark .spark-all{fill:#e3dccb}
#tree-token-spark .spark-used{fill:#8fb9a2}
#tree-time{position:absolute;inset:0;width:100%;height:100%;margin:0;background:none;-webkit-appearance:none;appearance:none;cursor:pointer}
#tree-time::-webkit-slider-runnable-track{height:30px;background:transparent;border:0}
#tree-time::-webkit-slider-thumb{-webkit-appearance:none;width:8px;height:30px;border-radius:3px;background:#8e6d77;box-shadow:0 0 0 2px #fffdf7}
#tree-time::-moz-range-track{height:30px;background:transparent;border:0}
#tree-time::-moz-range-thumb{width:8px;height:30px;border:0;border-radius:3px;background:#8e6d77;box-shadow:0 0 0 2px #fffdf7}
/* Zoom lives in the empty corner above the agent labels, not in a row of its own. */
.tree-zoom-overlay{position:absolute;top:14px;left:8px;z-index:2;display:flex;gap:4px;font:12px/1 system-ui,sans-serif}
.tree-zoom-overlay button{min-width:24px;height:24px;padding:0 6px;font:inherit;color:#595857;background:#fffefb;border:1px solid var(--tree-rule);border-radius:5px;cursor:pointer}
.tree-zoom-overlay button:hover{border-color:#898274}.tree-zoom-overlay button:disabled{opacity:.35;cursor:default}
.tree-zoom-overlay button:focus-visible{outline:2px solid #8e6d77;outline-offset:2px}
/* The band is wider than the reading column (beside a 250px sidebar); the run parameters follow the tree, closed. */
.tree-band{--band:min(1500px,calc(100vw - 250px - 56px));width:var(--band);margin:18px 0 18px calc((100% - var(--band))/2);display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.tree-band>*{min-width:0}
.tree-band .attempt-figure{margin:0}
@media(max-width:899px){.tree-band{--band:calc(100vw - 32px)}}
.tree-params>summary{color:var(--muted);padding:4px 0}
.tree-params[open]>summary{margin-bottom:4px}
