/* Plot page (plot.html, tools/plot/index.js). Page classes carry the plot- prefix (docs/LAYOUT.md); shared shell
   classes are only adjusted under the page root body.tool-plot. Colours: theme.css tokens only. */
.tool-plot .ws{grid-template-columns:clamp(208px,12vw,232px) minmax(0,1fr) clamp(284px,17vw,324px)}      /* 2w: a little narrower than 240 / 340 so the stage gets the width (the contents still do not wrap) */
.tool-plot #sampleBtn{display:none}                                     /* the rail carries its own sample button */
.plot-stage{position:relative;flex:1;min-height:260px;overflow:hidden;background:var(--bg)}      /* 2i: overflow:scroll while zoomed (tools/plot/index.js) */
.plot-stage canvas{position:absolute;top:0;left:0;display:block;cursor:crosshair}
.plot-spc{position:absolute;top:0;left:0;width:1px;height:1px;pointer-events:none;visibility:hidden}      /* 2s: gives the zoomed page its scroll size (the canvas is only a tile of it) */
.plot-paper{position:absolute;inset:14px;width:calc(100% - 28px);height:calc(100% - 28px);object-fit:contain;filter:drop-shadow(0 1px 6px color-mix(in srgb, var(--shade) 35%, transparent))}
.plot-empty{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:10px;padding:24px max(24px,8%);color:var(--muted);font-size:14px;line-height:1.55;overflow-y:auto}
.plot-empty[hidden]{display:none}
.plot-h{font-size:20px;letter-spacing:-.02em;font-weight:600;color:var(--ink);margin:0}
.plot-empty p{margin:0;max-width:62ch}
.plot-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.plot-dim{font-size:12.5px;color:var(--muted);font-family:"JetBrains Mono",monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1 1 3em}      /* 2q: shares the toolbar row with the new buttons (Fit format to size, Wide stage) instead of wrapping to a row of its own */
.plot-rail{display:flex;flex-direction:column;gap:6px;min-width:0}
.plot-add{display:flex;gap:6px}.plot-add .btn{flex:1;min-width:0}
.plot-proj{display:flex;gap:6px;margin-bottom:8px}.plot-proj .btn{flex:1;min-width:0}.plot-pname{font-weight:400;text-transform:none;letter-spacing:0;color:var(--muted);margin-left:6px;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom}
.plot-fmts{margin:0;font-size:11.5px;color:var(--dim);line-height:1.4;overflow-wrap:anywhere}
.plot-rail .grp{padding:10px 2px 2px}
.plot-rail>.btn.full{white-space:normal;height:auto;min-height:26px;padding:3px 8px;line-height:1.3;text-align:center}      /* 2x: "Add from a file on this computer…" wraps instead of pushing the rail sideways at 208 px */
.plot-grp-a{margin-left:auto;text-transform:none;letter-spacing:0;font-weight:500}
.plot-list{display:flex;flex-direction:column;gap:2px;min-width:0}
.plot-row{display:flex;align-items:center;gap:2px;border-radius:7px;border:1px solid transparent}
.plot-row.on{background:var(--panel2);border-color:var(--line)}
.plot-pick{flex:1;min-width:0;display:flex;align-items:center;gap:7px;padding:5px 6px;text-align:left;color:var(--ink2);font-size:13px}
.plot-pick b{font-family:"JetBrains Mono",monospace;color:var(--accent);font-weight:600;width:1.6em;flex:none}
.plot-nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plot-cnt{font-family:"JetBrains Mono",monospace;font-size:12px;color:var(--dim);flex:none}
.plot-ic{width:22px;height:22px;flex:none;border-radius:5px;color:var(--muted);font-size:13px;line-height:1;display:inline-grid;place-items:center}
.plot-ic:hover:not(:disabled){background:var(--panel3);color:var(--ink)}
.plot-ic:disabled{opacity:.3}
.plot-tag{font-size:11px;color:var(--muted);border:1px solid var(--line2);border-radius:4px;padding:0 4px;flex:none}
/* data browser: workbook > table (tick box) > column (role) */
.plot-wb{border:1px solid var(--line);border-radius:7px;padding:2px 4px 4px 6px;min-width:0}
.plot-wbh{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--ink2);padding:3px 0;min-width:0}
.plot-tb{display:flex;align-items:center;gap:4px;font-size:12.5px;color:var(--ink2);border-radius:5px;min-width:0}
.plot-tb.on{background:color-mix(in srgb, var(--accent) 10%, transparent)}
.plot-tw{width:18px;font-size:11px}
.plot-tick{width:14px;height:14px;margin:0 2px;flex:none;accent-color:var(--accent)}
.plot-tbx{width:18px;flex:none}
.plot-cols{display:flex;flex-direction:column;gap:1px;padding:0 0 4px 22px;min-width:0}      /* 2x: a shallower indent than 40 px (the tick box already marks a column) so the rows fit the 208 px rail */
.plot-crow{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;font-size:12px;color:var(--muted);min-width:0}      /* 2x: the selects wrap under the name when the row is too narrow for them */
.plot-crow .plot-nm{flex:1 1 44px}      /* under 44 px of name the selects drop to a line of their own and the name takes the row */
.plot-cctl{display:inline-flex;align-items:center;gap:4px;flex:none;max-width:100%;margin-left:auto}
.plot-role{flex:none;width:60px;max-width:100%;height:22px;font-size:11.5px;padding:0 2px;border:1px solid var(--line2);border-radius:4px;background:var(--bg2);color:var(--ink2)}
.plot-role[data-r="x"],.plot-role[data-r="y"]{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 45%, transparent)}
.plot-role[data-r="none"]{color:var(--dim)}
.plot-cols .plot-rm{align-self:flex-start;margin-left:0}
.plot-cnote{margin:2px 0;font-size:11.5px;line-height:1.4}
.plot-src{margin:0;overflow-wrap:anywhere}
/* "Pick columns…": a spreadsheet of the first 50 rows; wide tables scroll sideways inside the box */
.tool-plot .modal .box:has(.plot-sheetw){width:min(960px,94vw)}
.plot-sheetw{max-height:min(52vh,460px);overflow:auto;border:1px solid var(--line);border-radius:7px;margin:4px 0 6px}
.plot-sheet{border-collapse:collapse;font:12px/1.35 "JetBrains Mono",monospace;color:var(--ink2);min-width:100%}
.plot-sheet th{position:sticky;top:0;background:var(--panel2);text-align:left;padding:5px 6px;border-bottom:1px solid var(--line2);vertical-align:top;font-weight:500}
.plot-sheet td{padding:2px 6px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:right}
.plot-sheet td.plot-tx{text-align:left;color:var(--muted)}
.plot-shn{display:block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:3px;font-family:inherit}
.plot-sheet .plot-role{width:78px}
.plot-dim2{color:var(--dim);font-style:normal;font-size:11.5px}
.plot-rm{font-size:12px;margin:4px 0 0 6px}
.plot-full{grid-column:1/-1}
.plot-pp{padding:12px 14px 0}.plot-pp label{display:grid;gap:3px;font-size:13px;color:var(--muted)}
.plot-none{padding:16px 14px;color:var(--muted);font-size:13.5px;margin:0}
.plot-hint{font-size:12.5px;color:var(--dim);margin:6px 0 0;line-height:1.45}
.plot-rx{padding:0 2px}
.plot-sw{display:flex;align-items:center;flex-wrap:wrap;gap:4px;grid-column:1/-1}
.plot-sw i{width:14px;height:14px;border-radius:3px;border:1px solid var(--line2)}
.plot-sw .small{margin-left:4px;color:var(--dim)}
.plot-card{border:1px solid var(--line);border-radius:8px;padding:8px 10px 10px;margin:0 0 8px;background:var(--panel);min-width:0}
.plot-ch{display:flex;align-items:center;gap:4px;margin-bottom:6px;min-width:0}
.plot-ch .plot-nm{font-size:13px;color:var(--ink)}
.plot-dot{width:11px;height:11px;border-radius:99px;flex:none;border:1px solid var(--line2)}
.plot-col{display:flex;align-items:center;gap:6px;height:26px}
.plot-col input[type=color]{width:38px;height:24px;padding:0 2px;border:1px solid var(--line2);border-radius:5px;background:var(--bg2)}
.plot-col input[type=color]:disabled{opacity:.4}
.plot-addann{display:flex;flex-wrap:wrap;gap:6px}
.plot-placing{font-size:13px;color:var(--ink);background:color-mix(in srgb, var(--accent) 12%, transparent);border:1px solid color-mix(in srgb, var(--accent) 40%, transparent);border-radius:7px;padding:6px 9px;margin:8px 0 10px}
.plot-ta{width:100%;min-height:150px;border:1px solid var(--line2);border-radius:7px;background:var(--bg2);color:var(--ink);font:13px/1.45 "JetBrains Mono",monospace;padding:8px;resize:vertical;margin:4px 0 4px}
.plot-ta:focus{outline:none;border-color:var(--accent)}
/* 2b: inspector, rich-text toolbar, in-place text editor, undo / redo (docs/PLOT.md "Selection and inspector") */
.plot-ur{display:inline-flex;gap:4px;flex:none}
.plot-zoom{flex:none}.plot-zoom button{min-width:26px;padding:0 6px}.plot-zi{width:116px;height:22px;padding:0 4px;border:0;border-right:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);text-align:center;font-family:"JetBrains Mono",monospace;font-size:12px}.plot-zi:focus{outline:2px solid var(--accent);outline-offset:-2px;background:var(--bg)}
#plotFocus[aria-pressed="true"]{background:var(--accent2);color:var(--on-accent);border-color:transparent}
.plot-ur .btn{width:auto;padding:0 8px;font-size:13px;white-space:nowrap}      /* 2k: "↶ Undo" / "↷ Redo" in words */
.plot-ur .btn:disabled{opacity:.4;cursor:default}
.plot-ih{margin:0;padding:12px 14px 0;font-size:13px;color:var(--muted);line-height:1.45;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.plot-ih b{color:var(--ink);font-weight:600}
.plot-ih .lnk{margin-left:auto}
.plot-fa{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
/* the Figure tab's template block (2f, docs/PLOT.md "Templates") */
.plot-tpl{margin:0;font-size:13px;color:var(--muted);line-height:1.45}
.plot-tpl b{color:var(--ink);font-weight:600}
.plot-tpln{margin-top:2px}
.plot-fa.plot-full{margin-top:4px}
.plot-fl{display:grid;gap:3px;font-size:13px;color:var(--muted);min-width:0}
.plot-cc{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
.plot-sw1{width:18px;height:18px;border-radius:4px;border:1px solid var(--line2);flex:none;padding:0}
.plot-sw1.on{outline:2px solid var(--accent);outline-offset:1px}
.plot-cc input[type=color]{width:34px;height:22px;padding:0 2px;border:1px solid var(--line2);border-radius:5px;background:var(--bg2);flex:none}
.plot-cc .lnk{font-size:12px}
.plot-lord{display:flex;flex-direction:column;gap:2px;min-width:0}
.plot-lord .plot-row{padding:1px 2px;font-size:12.5px;color:var(--ink2)}
.plot-rt{position:relative;display:flex;flex-wrap:wrap;gap:3px;min-width:0}
.plot-rt .btn.sm{height:22px;min-width:26px;padding:0 5px;font-size:12px}
.plot-pop{position:absolute;top:26px;left:0;z-index:30;display:grid;grid-template-columns:repeat(8,26px);gap:3px;padding:6px;background:var(--panel);border:1px solid var(--line2);border-radius:8px;box-shadow:0 6px 18px color-mix(in srgb, var(--shade) 30%, transparent)}
.plot-pop .btn.sm{height:24px;min-width:0;padding:0;font-size:13px}
.plot-edw{position:absolute;z-index:20;display:flex;flex-direction:column;gap:4px;width:250px;padding:5px;background:var(--panel);border:1px solid var(--line2);border-radius:8px;box-shadow:0 6px 18px color-mix(in srgb, var(--shade) 30%, transparent)}
input[type=text].plot-edit{font-family:"JetBrains Mono",monospace;font-size:12.5px}
input[type=text].plot-rich{font-family:"JetBrains Mono",monospace;font-size:12.5px}
/* 2c: "Plot as" under a table row, the plot-type gallery (docs/PLOT.md "Plot types"); thumbnails draw in currentColor = a chart token */
.plot-as{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--dim);padding:0 2px 2px 22px;min-width:0}      /* 2x: same indent as the column rows */
.plot-as span{flex:none}
.plot-as select{flex:1;min-width:0;height:22px;font-size:11.5px;padding:0 2px;border:1px solid var(--line2);border-radius:4px;background:var(--bg2);color:var(--ink2)}
.tool-plot .modal .box:has(#plotGallery){width:min(940px,94vw);max-height:90vh;overflow-y:auto;overflow-x:hidden}
.plot-ggrp{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:12px 0 6px}
.plot-gcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:8px;min-width:0}
.plot-gcard{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:3px;padding:6px 6px 7px;border:1px solid var(--line);border-radius:8px;background:var(--panel);text-align:left;color:var(--ink2);min-width:0;cursor:pointer}
.plot-gcard:hover:not(.off),.plot-gcard:focus-visible{border-color:var(--accent)}
.plot-gcard.on{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 10%, var(--panel))}
.plot-gcard.off{opacity:.42;cursor:not-allowed}
.plot-gthumb{display:block;color:var(--chart-tick);background:var(--chart-bg);border-radius:5px;overflow:hidden}
.plot-gsvg{display:block;width:100%;height:auto}
.plot-gt{font-size:12.5px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.plot-groles{font:11px/1.3 "JetBrains Mono",monospace;color:var(--dim)}
.plot-gbadge{position:absolute;top:9px;right:9px;font-size:10.5px;border:1px solid var(--line2);border-radius:4px;padding:0 4px;color:var(--muted);background:var(--panel)}
@media (max-width:480px){.plot-gcards{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* 2e: the toolbar's layout control, "Add…" figure objects and the align bar (docs/PLOT.md "Page and free layout") */
.plot-tbe{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;flex:0 0 auto;max-width:100%}
.plot-addobj{height:26px;width:auto;flex:none;font-size:13px;padding:0 6px;border:1px solid var(--line2);border-radius:7px;background:var(--panel);color:var(--ink2)}
.plot-algn{display:inline-flex;flex-wrap:wrap;gap:3px;min-width:0;max-width:100%}
.plot-algn[hidden]{display:none}
.plot-algn .btn.sm{height:24px;min-width:26px;padding:0 5px;font-size:12px}
/* compose: the rail's Data / Compose tabs, the From Origin steps, the graph list with thumbnails, Unify and Axes (docs/PLOT.md "Compose") */
.plot-rtabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin:0 0 8px;min-width:0}
.plot-rtab{flex:1;min-width:0;padding:6px 4px 7px;font-size:13px;font-weight:500;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;text-align:center}
.plot-rtab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.plot-rtab .n{font-size:11px;color:var(--dim);margin-left:2px}
.plot-rcmp{min-width:0}
.plot-rcmp[hidden],.plot-rail[hidden]{display:none}
.plot-cmp{display:flex;flex-direction:column;gap:6px;min-width:0}
.plot-cmp .grp{padding:10px 2px 2px}
.plot-vempty{margin:0;font-size:12.5px;line-height:1.5;color:var(--muted)}
.plot-vempty .lnk{font-size:inherit;padding:0}
.plot-orig{border:1px solid var(--line);border-radius:7px;padding:4px 8px;background:var(--panel);min-width:0}
.plot-orig summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--ink2);padding:3px 0}
.plot-osteps{margin:4px 0 4px;padding-left:18px;display:flex;flex-direction:column;gap:8px;font-size:12.5px;color:var(--muted);line-height:1.45;min-width:0}
.plot-osteps li{display:flex;flex-direction:column;gap:4px;min-width:0}
.plot-opath{width:100%;min-width:0;font:12.5px "JetBrains Mono",monospace;height:26px}
.plot-oscript{width:100%;min-width:0;box-sizing:border-box;font:11.5px/1.4 "JetBrains Mono",monospace;white-space:pre;overflow:auto;resize:vertical;border:1px solid var(--line2);border-radius:6px;background:var(--bg2);color:var(--ink2);padding:6px}
.plot-osteps .btn{align-self:flex-start}
.plot-vrow{display:flex;flex-direction:column;gap:3px;border:1px solid var(--line);border-radius:7px;padding:3px 4px 5px;background:var(--panel);min-width:0;position:relative}
.plot-vrow.on{border-color:color-mix(in srgb, var(--accent) 40%, var(--line))}
.plot-vrow.sel{background:color-mix(in srgb, var(--accent) 12%, var(--panel))}
.plot-vrow.drag{opacity:.45}
.plot-vrow.over-a{box-shadow:0 -2px 0 var(--accent)}
.plot-vrow.over-b{box-shadow:0 2px 0 var(--accent)}
.plot-vrh{display:flex;align-items:center;gap:2px;min-width:0}
.plot-vgrip{flex:none;width:14px;color:var(--dim);font-size:11px;cursor:grab;letter-spacing:-2px;text-align:center}
.plot-vtick{width:14px;height:14px;margin:0 2px;flex:none;accent-color:var(--accent)}
.plot-vnm{padding:3px 4px}
.plot-vthumb{display:block;margin-left:20px;border-radius:4px;border:1px solid var(--line);max-width:calc(100% - 20px)}
.plot-vrow:not(.on) .plot-vthumb{opacity:.45}
.plot-vgen{position:absolute;right:6px;bottom:6px}
.plot-vsel{display:flex;flex-direction:column;gap:6px;min-width:0}
.plot-vsn{margin:0}
.plot-vu input{width:100%;min-width:0}
.plot-vax{display:flex;flex-wrap:wrap;gap:6px 12px}
.plot-vnotes{margin:4px 14px 0;padding-left:16px;font-size:12.5px;color:var(--muted);line-height:1.45}
@media (max-width:1100px){.tool-plot .ws{grid-template-columns:210px minmax(0,1fr) 300px}}
/* below a laptop width the three columns stack: figure first, then data, then the style tabs; the page scrolls */
@media (max-width:900px){
  .tool-plot .ws{grid-template-columns:minmax(0,1fr);height:auto}
  .tool-plot .main{order:-1;min-height:0;overflow:visible}
  .tool-plot .side,.tool-plot .insp{border:0;border-top:1px solid var(--line);overflow:visible}
  .tool-plot .pane{overflow:visible}
  .plot-stage{flex:none;min-height:0;height:clamp(300px,72vw,560px)}
}
/* 2g: the font-metrics loading line on the stage, the preset check under the preset list, the style-set block */
.plot-load{position:absolute;inset:0;margin:0;display:grid;place-items:center;color:var(--muted);font-size:13px}
.plot-load[hidden]{display:none}
.plot-pst{color:var(--warn);overflow-wrap:anywhere}
.plot-pst[hidden]{display:none}
.plot-pst .lnk{background:none;border:0;padding:0;cursor:pointer}
.plot-ss .plot-fa .btn{min-width:0}
/* 2h: the format bar above the figure (tools/plot/format-bar.js), inherited values, column tick boxes, Rows ↔ columns, the inspector's sections */
.plot-fmt{position:absolute;top:0;left:0;right:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:5px 10px;border-bottom:1px solid var(--line);background:color-mix(in srgb, var(--panel) 94%, transparent);font-size:12.5px;color:var(--muted);min-width:0;z-index:6;box-shadow:0 2px 8px color-mix(in srgb, var(--shade) 18%, transparent)}      /* floats over the top of the stage: showing it never moves the figure (the stage keeps a band free for it) */
.plot-fmt[hidden]{display:none}
.plot-fnm{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px;min-width:0}
.plot-fi{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%;white-space:nowrap}
.plot-fi>span:first-child{color:var(--dim)}
.plot-fi select,.plot-fi input[type=number],.plot-fi input[type=text]{height:24px;font-size:12px;padding:0 4px;border:1px solid var(--line2);border-radius:5px;background:var(--bg2);color:var(--ink2);min-width:0}
.plot-fi select{max-width:150px}
.plot-fi input[type=number]{width:58px}
.plot-fi input.plot-fwide{width:110px}
.plot-fi input.plot-ftx{width:150px}
.plot-fck input{accent-color:var(--accent)}
.btn.sm.plot-fb{height:24px;min-width:24px;padding:0 6px;font-size:12px}
.plot-fb[aria-pressed="true"]{border-color:var(--accent);color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, transparent)}
.plot-fcol{flex-wrap:wrap;white-space:normal}
.plot-fcol input[type=color]{width:30px;height:22px;padding:0 2px;border:1px solid var(--line2);border-radius:5px;background:var(--bg2);flex:none}
.plot-fgk{position:relative}
.plot-fgk .plot-pop{top:28px;left:0}
.plot-fnone{color:var(--dim)}
.plot-fbi{display:flex;flex-wrap:wrap;gap:6px 10px;padding:4px 0;min-width:0}
.plot-fbi .plot-fnm{display:none}
input.plot-inh{color:var(--dim);font-style:italic}
.plot-ctick{width:13px;height:13px;margin:0 1px;flex:none;accent-color:var(--accent)}
.plot-cacts{display:flex;flex-wrap:wrap;gap:0 10px}
.plot-shn .plot-ctick{vertical-align:-2px;margin-right:4px}
.plot-sec{color:var(--ink2)}
/* 2j: the panel map (rail): the page in miniature, a cell per panel (insets inside their parent), boundaries to drag */
.plot-map{display:flex;justify-content:center;padding:2px 0;min-width:0;flex:none}
.plot-mapb{position:relative;flex:none;max-width:100%;max-height:170px;overflow:hidden;box-sizing:border-box;background:var(--bg);border:1px solid var(--line);border-radius:4px;touch-action:none;user-select:none}      /* 2k: its own height from the page's aspect (tools/plot/index.js mapHtml), nothing outside it */
.plot-mx{position:absolute;z-index:3;width:14px;height:14px;padding:0;display:grid;place-items:center;border:1px solid var(--line2);border-radius:3px;background:var(--panel);color:var(--ink2);font:600 11px/1 system-ui,sans-serif;cursor:pointer;opacity:0}
.plot-mc:hover + .plot-mx,.plot-mc:focus-visible + .plot-mx,.plot-mx:hover,.plot-mx:focus-visible{opacity:1}
.plot-mx:hover{border-color:var(--danger);color:var(--danger)}
.plot-mc{position:absolute;display:grid;place-items:center;border:1px solid var(--line2);border-radius:3px;background:var(--panel2);color:var(--ink2);font:600 12px/1 "JetBrains Mono",monospace;cursor:grab;padding:0;overflow:hidden;min-width:0}
.plot-mc:hover{border-color:var(--accent);color:var(--ink)}
.plot-mc.on{background:color-mix(in srgb, var(--accent) 18%, var(--panel2));border-color:var(--accent);color:var(--accent)}
.plot-mc.on.msel{border-style:dashed;background:color-mix(in srgb, var(--accent) 12%, var(--panel2))}
.plot-mc.ins{background:var(--panel3);font-size:10px;z-index:1}
.plot-mc.drag{opacity:.55;cursor:grabbing}
.plot-mc.drop{outline:2px dashed var(--accent);outline-offset:-3px}
.plot-mc:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.plot-mb{position:absolute;z-index:2}
.plot-mb.v{width:8px;margin-left:-4px;cursor:col-resize}
.plot-mb.h{height:8px;margin-top:-4px;cursor:row-resize}
.plot-mb:hover,.plot-mb.on{background:color-mix(in srgb, var(--accent) 45%, transparent);border-radius:3px}
.plot-mapa{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11.5px;min-width:0}
/* 2j: the data of the selected panel(s), then the other tables */
.plot-pbox{border:1px solid var(--accent);border-radius:8px;padding:3px 5px 5px;display:flex;flex-direction:column;gap:3px;min-width:0}
.plot-pboxh{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--ink);min-width:0}
.plot-pboxh b{font-family:"JetBrains Mono",monospace;color:var(--accent);font-weight:600;flex:none}
.plot-pempty{margin:2px 2px 3px;font-size:12px;color:var(--muted);line-height:1.4}
.plot-other{display:flex;flex-direction:column;gap:3px;margin-top:4px;min-width:0}
.plot-oth{align-self:flex-start;font-size:12.5px;color:var(--ink2);padding:3px 2px}
.plot-oth .n{color:var(--dim);font-family:"JetBrains Mono",monospace;font-size:12px}
.plot-othb{display:flex;flex-direction:column;gap:2px;min-width:0}
.plot-othb[hidden]{display:none}
/* 2k: hidden curves in a panel's box (a click shows one again) */
.plot-hid{display:flex;flex-wrap:wrap;gap:3px 6px;margin:0 2px;min-width:0}
.plot-hidt{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:1px 2px;border:0;background:none;color:var(--muted);font-size:12px;cursor:pointer;min-width:0}
.plot-hidt:hover{color:var(--ink2)}
/* 2k: the menus (tick popover, the stage's context menu): a transparent cover takes the next click elsewhere */
.plot-ctxbg{position:fixed;inset:0;z-index:80;background:transparent}
.plot-ctx{position:fixed;z-index:81;min-width:180px;max-width:min(300px,calc(100vw - 12px));max-height:calc(100vh - 12px);overflow:auto;display:flex;flex-direction:column;padding:4px;background:var(--panel);border:1px solid var(--line2);border-radius:8px;box-shadow:var(--shadow-menu)}
.plot-ctx button{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:5px 9px;border:0;border-radius:5px;background:none;color:var(--ink);font-size:13px;text-align:left;cursor:pointer}
.plot-ctx button:hover,.plot-ctx button:focus-visible{background:var(--panel2);outline:none}
.plot-ctx button.on{color:var(--accent);font-weight:600}
.plot-ctx button[disabled]{color:var(--dim);cursor:default;background:none}
.plot-ctxh{padding:4px 9px 3px;font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plot-ctxr{border:0;border-top:1px solid var(--line);margin:3px 2px}
.plot-ctxs{display:flex;flex-direction:column;padding-left:10px}
.plot-ctxs[hidden]{display:none}
.plot-ctxa{color:var(--muted)}
/* 2k: "Arrange panels…": the page's content area on a snap grid; a cell per top-level panel with edge and corner handles */
.tool-plot .modal .box:has(.plot-arr){width:min(720px,94vw)}
.plot-arrw{display:flex;justify-content:center;margin:6px 0 8px;max-width:100%;overflow:auto}
.plot-arr{position:relative;flex:none;box-sizing:border-box;border:1px solid var(--line2);border-radius:4px;background-color:var(--bg);background-image:linear-gradient(to right,var(--line) 1px,transparent 1px),linear-gradient(to bottom,var(--line) 1px,transparent 1px);touch-action:none;user-select:none}
.plot-ac{position:absolute;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:2px;border:2px solid var(--bg);border-radius:6px;box-shadow:inset 0 0 0 1px var(--accent);background:color-mix(in srgb, var(--accent) 14%, var(--panel2));background-clip:padding-box;color:var(--ink);cursor:move;overflow:hidden;min-width:0}
.plot-ac b{font:600 14px/1 "JetBrains Mono",monospace;color:var(--accent)}
.plot-acn{max-width:100%;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plot-ac.bad{box-shadow:inset 0 0 0 1px var(--danger);background:color-mix(in srgb, var(--danger) 16%, var(--panel2));background-clip:padding-box}
.plot-ai{position:absolute;box-sizing:border-box;border:1px dashed var(--line2);border-radius:2px;pointer-events:none}
.plot-ah{position:absolute;z-index:2}
.plot-ah[data-h="n"],.plot-ah[data-h="s"]{left:8px;right:8px;height:8px;cursor:ns-resize}
.plot-ah[data-h="n"]{top:-1px}.plot-ah[data-h="s"]{bottom:-1px}
.plot-ah[data-h="e"],.plot-ah[data-h="w"]{top:8px;bottom:8px;width:8px;cursor:ew-resize}
.plot-ah[data-h="e"]{right:-1px}.plot-ah[data-h="w"]{left:-1px}
.plot-ah.c{width:10px;height:10px;z-index:3}
.plot-ah[data-h="nw"]{top:-1px;left:-1px;cursor:nwse-resize}.plot-ah[data-h="se"]{bottom:-1px;right:-1px;cursor:nwse-resize}
.plot-ah[data-h="ne"]{top:-1px;right:-1px;cursor:nesw-resize}.plot-ah[data-h="sw"]{bottom:-1px;left:-1px;cursor:nesw-resize}
.plot-ac:hover .plot-ah{background:color-mix(in srgb, var(--accent) 30%, transparent)}
/* 2l (docs/PLOT.md "Step 2l"): the workspace fills the viewport; the right-hand tabs (larger, the active one highlighted, sticky section heads); the
   data box's Y / Y2 / not drawn switch; Clear all; the stage grid controls; a hidden panel in the map; the menu's options; the Arrange density */
.plot-arrl{margin:0 0 4px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 14px}
.plot-arrd{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.plot-arrd select{height:26px;font-size:12.5px;padding:0 4px;border:1px solid var(--line2);border-radius:5px;background:var(--panel);color:var(--ink2)}
@media (min-width:901px){.tool-plot .ws{height:calc(100dvh - var(--nav-h,50px))}}      /* the visible viewport (mobile browser bars); stacked below 901 px as before */
.tool-plot .insp .tabs{flex-wrap:wrap;padding:4px 4px 0}
.tool-plot .insp .tab{flex:1 0 auto;height:40px;padding:0 12px;font-size:13.5px;border-radius:6px 6px 0 0;border-bottom-width:3px}
.tool-plot .insp .tab[aria-selected="true"]{background:color-mix(in srgb, var(--accent) 14%, var(--bg2));color:var(--ink);font-weight:600;border-bottom-color:var(--accent)}
.tool-plot .insp .pane .pf .grp{position:sticky;top:0;z-index:2;margin:0 -14px;padding:7px 14px 6px;background:var(--panel2);border-bottom:1px solid var(--line)}
.tool-plot .insp .pane .pf .grp:first-child{padding-top:7px}
.plot-fprobe{visibility:hidden;pointer-events:none;z-index:-1}      /* the format bar's tallest form, laid out to size the band above the figure (tools/plot/index.js fmtBand) */
@media (max-width:900px){.plot-fprobe{display:none}}
.plot-cm{flex:none;width:56px;max-width:100%;height:22px;font-size:11.5px;padding:0 2px;border:1px solid var(--line2);border-radius:4px;background:var(--bg2);color:var(--ink2)}
.plot-grp-c{margin-left:8px;text-transform:none;letter-spacing:0;font-weight:500;color:var(--muted)}
.plot-grid{display:inline-flex;align-items:center;gap:3px;flex:none}
.plot-grid select{min-width:62px;height:24px;font-size:12px;padding:0 3px;border:1px solid var(--line2);border-radius:5px;background:var(--panel);color:var(--ink2)}
#plotGrid[aria-pressed="true"]{background:var(--accent2);color:var(--on-accent);border-color:transparent}
.plot-mc.hid{opacity:.45;background:repeating-linear-gradient(135deg,var(--panel2) 0 4px,var(--panel3) 4px 8px);color:var(--dim)}
.plot-ctxc{display:flex;align-items:flex-start;gap:7px;padding:5px 9px;font-size:12.5px;color:var(--ink2);line-height:1.4;cursor:pointer;max-width:280px}
.plot-ctxc input{margin-top:2px;flex:none;accent-color:var(--accent)}
@media (max-width:900px){.plot-fmt{position:static;box-shadow:none;background:var(--panel)}}      /* stacked columns (the page scrolls): the bar sits above the figure */
@media (max-width:480px){.plot-fmt{padding:5px 8px;gap:4px 8px}.plot-fi input.plot-ftx{width:120px}}
/* 2o: "Add from this site…" */
.plot-site{max-height:60vh;overflow:auto;min-width:min(420px,80vw)}
.plot-sh{margin:10px 0 4px;font-size:12px;letter-spacing:.02em;color:var(--muted);font-weight:600}
.plot-sitem{display:flex;align-items:center;gap:10px;padding:6px 2px;border-bottom:1px solid var(--line)}
.plot-sit{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.plot-sit b{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* 2q: Wide stage (W): the rail and the inspector column are hidden, the stage takes the full width (screen only) */
.tool-plot.plot-wide .ws{grid-template-columns:minmax(0,1fr)}
.tool-plot.plot-wide .side,.tool-plot.plot-wide .insp{display:none}
.tool-plot .modal .box:has(.plot-cf){width:min(720px,94vw)}
.plot-cfr{display:flex;flex-direction:column;gap:4px;margin:6px 0 2px;font-size:12.5px;color:var(--muted)}.plot-cfr select{height:30px;padding:0 8px;border:1px solid var(--line2);border-radius:7px;background:var(--panel);color:var(--ink);font:inherit;font-size:13px}
.plot-cf{display:grid;grid-template-columns:1fr 1.4fr;gap:12px;margin:8px 0 4px}
.plot-cfc{border:1px solid var(--line);border-radius:8px;padding:6px 10px 8px;min-width:0;display:flex;flex-direction:column;gap:4px}
.plot-cfc legend{font-size:12px;color:var(--dim);padding:0 4px}
.plot-cfc .tog{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 6px;font-size:13px}
.plot-cfc small{display:block;flex-basis:100%;margin-left:22px;color:var(--dim);font-size:11.5px}
@media (max-width:560px){.plot-cf{grid-template-columns:1fr}}
.plot-fitp{min-width:250px}
/* 2w (docs/PLOT.md "Step 2w"): the stage fills the middle column. One toolbar row (the seldom-used tools in the "…" menu), the step bar and its hint fold into a hover
   strip once there is data, the status bar is slimmer; only on the three-column layout (stacked below 901 px as before) */
@media (min-width:901px){
  .tool-plot .tb{position:relative;min-height:0;padding:2px 10px;gap:3px 6px}
  .tool-plot .tb .btn.sm,.tool-plot .tb .plot-addobj{height:24px}
  .tool-plot .tb .seg button,.tool-plot .tb .seg.small button,.tool-plot .tb .plot-zi{height:22px}
  .tool-plot .tb .plot-zi{width:104px}
  .tool-plot .sb{height:22px}
  .tool-plot .prog{height:0;overflow:visible;position:relative;z-index:3}.tool-plot .prog i{position:absolute;left:0;right:0;top:-2px;height:2px}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden]))){position:relative;height:0;border:0;z-index:35}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden])))::before{content:"";position:absolute;left:0;right:0;top:0;height:5px;background:linear-gradient(var(--line2),transparent);opacity:.7}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden])))>*{display:none}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden]))):hover>.flowtop,body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden]))):hover>.flowmsg:not([hidden]){display:flex;position:absolute;left:0;right:0;background:var(--bg2);box-shadow:0 6px 16px color-mix(in srgb, var(--shade) 25%, transparent)}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden]))):hover>.flowtop{top:0}
  body.tool-plot.plot-has #flow:not(:has(.flowmsg.error:not([hidden]))):hover>.flowmsg:not([hidden]){top:38px}
}
.tool-plot .sb .plot-dim{flex:none;margin-left:12px;max-width:45%}
