:root{--bg: #fff;--panel: #fafafa;--line: #e5e5e5;--line-strong: #d4d4d4;--text: #0a0a0a;--muted: #737373;--soft: #a3a3a3;--hover: #e5e5e5;--press: #171717;--press-text: #fff;--stage: #e5e5e5;--sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;color-scheme:light}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #0a0a0a;--panel: #171717;--line: #262626;--line-strong: #404040;--text: #fafafa;--muted: #a3a3a3;--soft: #737373;--hover: #262626;--press: #fafafa;--press-text: #0a0a0a;--stage: #000;color-scheme:dark}}:root[data-theme=dark]{--bg: #0a0a0a;--panel: #171717;--line: #262626;--line-strong: #404040;--text: #fafafa;--muted: #a3a3a3;--soft: #737373;--hover: #262626;--press: #fafafa;--press-text: #0a0a0a;--stage: #000;color-scheme:dark}*,*:before,*:after{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font:14px/1.45 var(--sans);-webkit-font-smoothing:antialiased}h2,h3,p{margin:0}h2{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}h3{font-size:12px;font-weight:600;margin-bottom:8px}kbd{font:11px var(--mono);border:1px solid var(--line-strong);border-radius:2px;padding:0 4px;color:var(--muted)}.num,input[type=text].num,td.num,.kv dd{font-family:var(--mono);font-variant-numeric:tabular-nums}.muted{color:var(--muted)}.small{font-size:12px}.grow{flex:1}.app{display:grid;grid-template-columns:232px minmax(0,1fr) 320px;grid-template-rows:48px minmax(0,1fr);grid-template-areas:"top top top" "left center right";height:100%}.topbar{grid-area:top;display:flex;align-items:center;gap:8px;padding:0 16px;border-bottom:1px solid var(--line)}.wordmark{font-weight:650;letter-spacing:-.01em;font-size:15px}.mode{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:2px;padding:0 8px;line-height:22px}.spacer{flex:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.zone{overflow:auto;min-height:0}.zone>section,.right-scroll>section{padding:12px 16px;border-bottom:1px solid var(--line)}.zone.left,.zone.right{display:flex;flex-direction:column;overflow:hidden;background:var(--panel)}.zone.left{grid-area:left;border-right:1px solid var(--line)}.zone.right{grid-area:right;border-left:1px solid var(--line)}.zone.left>.left-scroll,.right-scroll{flex:1;min-height:0;overflow-y:auto}.zone.left>.left-scroll,.right-scroll>section:last-child{border-bottom:0}.zone.left>.keep-history{flex:none;border-top:1px solid var(--line);border-bottom:0;padding:8px 16px}.zone.right>.exports{flex:none;border-top:1px solid var(--line);border-bottom:0;background:var(--panel)}.zone.center{grid-area:center;padding:16px;display:flex;flex-direction:column;gap:16px}.zone.center.fit{overflow:hidden;gap:12px}.section-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:8px}.section-head h2{margin-bottom:0}.chips{display:flex;flex-wrap:wrap;gap:4px}.btn.chip{height:24px;padding:0 8px;font-size:12px;color:var(--muted)}.btn.chip:hover:not(:disabled){color:var(--text)}.btn.chip.danger,.btn.chip.danger:hover:not(:disabled){background:var(--press);color:var(--press-text);border-color:var(--press)}.btn.compact-only{display:none}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:32px;padding:0 12px;font:inherit;font-size:13px;color:var(--text);background:var(--bg);border:1px solid var(--line-strong);border-radius:4px;cursor:pointer;transition:opacity .12s;white-space:nowrap}.btn:hover:not(:disabled){background:var(--hover)}.btn:disabled{opacity:.4;cursor:default}.btn[aria-pressed=true],.btn[aria-pressed=true]:hover:not(:disabled),.btn.primary,.btn.primary:hover:not(:disabled){background:var(--press);color:var(--press-text);border-color:var(--press)}.btn.icon{width:32px;padding:0}.btn.ghost{border-color:transparent;background:transparent;justify-content:flex-start;padding:0 8px}.btn.ghost:hover{background:var(--hover)}.linklike{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-align:left;text-decoration:underline;text-decoration-color:var(--line-strong);text-underline-offset:2px}.seg{display:inline-flex}.seg .btn{border-radius:0}.seg .btn+.btn{margin-left:-1px}.seg .btn:first-child{border-radius:4px 0 0 4px}.seg .btn:last-child{border-radius:0 4px 4px 0}:focus-visible{outline:2px solid var(--text);outline-offset:1px}input[type=text],select{height:32px;font:inherit;font-size:13px;color:var(--text);background:var(--bg);border:1px solid var(--line-strong);border-radius:4px;padding:0 8px;min-width:0}select{width:100%}input[type=checkbox]{accent-color:var(--text);margin:0}input:disabled,select:disabled{opacity:.5}.field{display:flex;flex-direction:column;gap:4px;margin-bottom:8px;font-size:12px;color:var(--muted)}.field>label{color:var(--muted)}.stepper{display:grid;grid-template-columns:32px minmax(0,1fr) 32px;gap:4px}.stepper.solo{grid-template-columns:minmax(0,1fr)}.stepper input{text-align:right;width:100%}@media(min-width:1001px){.stepper{grid-template-columns:24px minmax(0,1fr) 24px;gap:3px}.stepper .btn.icon{width:24px}.stepper input{padding:0 4px}}.hint{font-size:11px;color:var(--muted)}.inline{display:inline-flex;align-items:center;gap:8px;font-size:12px}input.tiny{width:48px;text-align:right}.stack{display:flex;flex-direction:column;gap:8px;margin-top:8px}.stack .btn{justify-content:flex-start}.row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn-row{display:flex;flex-wrap:wrap;gap:8px}.label{font-size:12px;color:var(--muted);margin:8px 0 4px}.feedback{color:var(--muted)}.exports:focus:not(:focus-visible){outline:none}.exports .section-head{flex-wrap:nowrap}.exports .feedback{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.btn-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.btn-grid .btn{height:30px;padding:0 4px;font-size:12px;min-width:0}.title-field{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;margin-bottom:8px;font-size:12px;color:var(--muted)}.title-field input{height:30px;width:100%}.files{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.add-bar{display:flex;gap:8px;margin-bottom:16px}.add-bar .btn.grow{justify-content:flex-start}.file-item{display:flex;align-items:center;gap:4px;padding-left:8px;border-radius:4px}.file-item:hover{background:var(--hover)}.file-item.sel{background:var(--line)}.file-row{display:flex;align-items:center;gap:8px;flex:1;min-width:0;height:28px;padding:0 4px;font:inherit;font-size:12px;color:var(--text);background:transparent;border:0;border-radius:4px;cursor:pointer;text-align:left}.file-row .name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono)}.btn.icon.remove{width:24px;height:24px;flex:none;color:var(--muted);opacity:0}.file-item:hover .remove,.file-item.sel .remove,.btn.icon.remove:focus-visible{opacity:1}@media(hover:none){.btn.icon.remove{opacity:1}}.btn.icon.remove:hover{color:var(--text)}.dot{width:8px;height:8px;flex:none;border-radius:50%;border:1px solid var(--muted);display:inline-block}.dot.on{background:var(--text);border-color:var(--text)}.badge{display:flex;justify-content:space-between;gap:8px;border:1px solid var(--line-strong);border-radius:4px;padding:4px 8px;margin-bottom:8px;font-size:13px}.note{font-size:12px;color:var(--muted);margin-top:8px}.channels{display:grid;grid-template-columns:1fr 1fr;gap:8px}.channel{border:1px solid var(--line);border-radius:4px;padding:8px;margin:0;min-width:0}.channel legend{display:flex;align-items:center;gap:6px;padding:0 4px;max-width:100%}.channel legend input.ch-label{height:22px;width:72px;min-width:0;padding:0 4px;font-size:12px}.channel.off .field{opacity:.6}.channel .field:last-child{margin-bottom:0}.ch{font-weight:600;color:var(--text)}.table-wrap{overflow-x:auto}.grid-table{border-collapse:collapse;width:100%;font-size:12px}.grid-table th,.grid-table td{border-bottom:1px solid var(--line);padding:4px 8px;text-align:left;vertical-align:middle}.grid-table thead th{font-weight:600;color:var(--muted);border-bottom-color:var(--line-strong)}.grid-table tbody th{font-weight:400}.grid-table .r{text-align:right}.grid-table.compact th,.grid-table.compact td{padding:4px}.grid-table.values th,.grid-table.values td{padding:3px 6px}.grid-table.values th:first-child{padding-left:0}.grid-table td.num{white-space:nowrap}.block{margin-top:16px}.block p{margin-top:8px}.kv{margin:8px 0 0;display:flex;flex-direction:column;gap:4px}.kv>div{display:flex;justify-content:space-between;gap:8px}.kv dt{color:var(--muted)}.kv dd{margin:0;text-align:right}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.toolbar .ctl{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);min-width:0}.toolbar .ctl select{width:auto;min-width:0;max-width:160px}.seg.tabs .btn{padding:0 10px}.switcher{flex:none}.block-top{margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--line)}.block-top h3{margin-bottom:4px}.block-top .kv{margin-top:0}.block-top p{margin-top:6px}.channel.math{grid-column:1 / -1}.math-row{display:grid;grid-template-columns:minmax(0,1fr) 56px minmax(0,1fr);gap:6px;margin-bottom:8px}.math-row select.op{text-align:center}.btn-row.pair{display:grid;grid-template-columns:1fr 1fr;width:min(100%,400px)}.settings>summary{padding:12px 16px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);cursor:pointer;border-bottom:1px solid var(--line)}.settings>section{padding:12px 16px;border-bottom:1px solid var(--line)}.app.mode-empty{grid-template-columns:232px minmax(0,1fr);grid-template-areas:"top top" "left center"}.app.mode-empty .zone.right{display:none}.crop-bar{border:1px solid var(--line);border-radius:4px;padding:8px}.crop-bar>.crop-hint{flex:1 1 200px;min-width:min(200px,100%)}.capture{display:flex;flex-direction:column;gap:12px}.stage-wrap{background:var(--stage);border:1px solid var(--line);border-radius:4px;padding:14px}.viewport{display:flex;overflow:auto;container-type:inline-size}.canvas{flex:none;margin:auto;width:calc(100cqw * var(--z, 1));aspect-ratio:var(--ar, 5 / 3)}.canvas.plot svg{display:block;width:100%;height:100%}.stage{position:relative;line-height:0;user-select:none}.zoom{display:inline-flex;align-items:center;gap:8px}.zoom input[type=range]{width:120px;margin:0;accent-color:var(--text)}.btn.chip.zoom-value{min-width:52px;height:28px;padding:0 6px;font-family:var(--mono);font-variant-numeric:tabular-nums}.cursor-bar{display:flex;align-items:center;flex-wrap:wrap;gap:4px 14px;min-height:28px;font-size:12px;border:1px solid var(--line);border-radius:4px;padding:2px 10px}.cursor-bar select.cursor-ch{width:auto;height:24px;font-size:12px;padding:0 4px}.cursor-item{display:inline-flex;gap:6px;white-space:nowrap}.cursor-item .k{color:var(--muted)}.canvas.plot{position:relative}.plot-svg{width:100%;height:100%}.cursor-layer{position:absolute;inset:0;overflow:visible;pointer-events:none;touch-action:none}.cursor{cursor:ew-resize;outline:none;pointer-events:auto;touch-action:none}.cursor.hy{cursor:ns-resize}.cursor-hit{stroke:transparent;stroke-width:14;pointer-events:stroke;touch-action:none}.cursor-line{stroke:var(--text);stroke-width:1.25;pointer-events:none}.cursor text{fill:var(--text);font:11px var(--mono);pointer-events:none}.cursor:focus-visible .cursor-line,.cursor:hover .cursor-line{stroke-width:2.5}.banner{border:1px solid var(--text);border-radius:4px;padding:12px 16px;display:flex;flex-direction:column;gap:8px;animation:fade .12s ease-out}.banner-title{font-weight:600}.banner-list{margin:0;padding-left:16px;font-size:13px}.stage img{display:block;width:100%;height:100%}.stage.pixel img{image-rendering:pixelated}.fit .capture{flex:1;min-height:0}.fit .capture .viewport{flex:1;min-height:0;container-type:size}.fit .capture .canvas{width:calc(min(100cqw,100cqh * var(--ar, 5 / 3)) * var(--z, 1))}.overlay{position:absolute;inset:0;pointer-events:none}.overlay svg{display:block;width:100%;height:100%}.crop-box{position:absolute;border:1px solid #fff;outline:1px solid #000;cursor:move;touch-action:none;min-width:8px;min-height:8px}.crop-line{position:absolute;pointer-events:none;opacity:.7}.crop-line.v{top:0;bottom:0;border-left:1px dashed #fff}.crop-line.h{left:0;right:0;border-top:1px dashed #fff}.crop-box:focus-visible{outline:2px solid #000;outline-offset:0}.crop-handle{position:absolute;width:28px;height:28px;margin:-14px 0 0 -14px;touch-action:none;z-index:1}.crop-handle:before{content:"";position:absolute;left:8px;top:8px;width:12px;height:12px;background:#fff;border:1px solid #000}.crop-handle:focus{outline:none}.crop-handle:focus-visible:before{background:#000;border-color:#fff;box-shadow:0 0 0 1px #000}.crop-handle.tl{left:0;top:0;cursor:nwse-resize}.crop-handle.tr{left:100%;top:0;cursor:nesw-resize}.crop-handle.bl{left:0;top:100%;cursor:nesw-resize}.crop-handle.br{left:100%;top:100%;cursor:nwse-resize}.quad-box{position:absolute;inset:0}.quad-box svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;touch-action:none}.quad-box .crop-handle{cursor:move}.quad-area{fill:transparent;cursor:move;touch-action:none;pointer-events:auto}.quad-edge,.quad-line{fill:none;vector-effect:non-scaling-stroke;pointer-events:none}.quad-edge.outer{stroke:#fff;stroke-width:3}.quad-edge{stroke:#000;stroke-width:1}.quad-edge.bad{stroke-dasharray:4 3}.quad-line{stroke:#fff;stroke-width:1;stroke-dasharray:4 3;opacity:.75}.paper{background:var(--bg);border:1px solid var(--line);border-radius:4px;padding:8px}.plot-pending{margin:0;padding:48px 16px;text-align:center}.paper svg{display:block;width:100%;height:auto}.bode{display:flex;flex-direction:column;gap:16px}.bode-table input.cell{width:96px;height:28px;text-align:right}.bode-table td.file{font-family:var(--mono);white-space:nowrap}.bode-table tr{cursor:pointer}.bode-table tr.rej td{color:var(--muted)}.bode-table tr.sel td{background:var(--line)}.bode-table td.status{min-width:160px}.bode-table td.status .dot{margin-right:8px}.reason{display:block;font-size:11px;color:var(--muted)}.tag{margin-left:8px;font:11px var(--sans);color:var(--muted);border:1px solid var(--line-strong);border-radius:2px;padding:0 4px}.empty{margin:auto;max-width:560px;display:flex;flex-direction:column;align-items:center;gap:16px;text-align:center;padding:48px 32px;border:1px dashed var(--line-strong);border-radius:4px}.empty-lead{font-size:16px}.empty .btn-row{justify-content:center}.sample-link{margin-top:-8px;min-height:30px;padding:6px 8px;font-size:12px;color:var(--muted);text-align:center;text-decoration-color:transparent;border-radius:4px}.sample-link:hover:not(:disabled){color:var(--text);text-decoration-color:var(--line-strong)}.sample-link:focus-visible{color:var(--text);outline:1px solid var(--text);outline-offset:2px}.sample-link:disabled{cursor:default;opacity:.6}.empty-links{margin:-8px 0 0;display:flex;flex-wrap:wrap;justify-content:center;gap:4px 12px;max-width:100%}.empty-source{padding:4px 8px;font-size:12px;color:var(--muted);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;border-radius:4px}.empty-source:hover{color:var(--text);text-decoration-color:var(--line-strong)}.empty-source:focus-visible{color:var(--text);outline:1px solid var(--text);outline-offset:2px}.center-msg{margin:auto}.status{margin-top:auto}.error{border:1px solid var(--text);border-radius:4px;padding:8px;font-size:13px}.dropzone{position:fixed;inset:8px;border:1px dashed var(--text);border-radius:4px;background:var(--bg);opacity:.94;display:flex;align-items:center;justify-content:center;font-size:16px;pointer-events:none;z-index:10}.scrim{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:20;animation:fade .12s ease-out}.scrim:before{content:"";position:absolute;inset:0;background:#000;opacity:.4}.modal{position:relative;background:var(--bg);border:1px solid var(--line-strong);border-radius:4px;padding:16px;width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;box-shadow:0 8px 24px #00000029}.modal:focus{outline:none}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.modal-head h2{margin:0}.keys{margin:0;display:flex;flex-direction:column;gap:8px}.keys>div{display:grid;grid-template-columns:104px 1fr;align-items:center}.keys dd{margin:0}.modal-foot{display:flex;flex-wrap:wrap;gap:4px 16px;margin:16px 0 0;padding-top:12px;border-top:1px solid var(--line);font-size:12px}.modal-foot a{color:var(--muted);text-decoration:underline;text-underline-offset:2px}.modal-foot a:hover{color:var(--text)}@keyframes fade{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.scrim,.banner,.btn{animation:none;transition:none}}@media(max-width:1000px){.app{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr auto auto;grid-template-areas:"top" "center" "right" "left";height:auto;min-height:100%}.topbar{flex-wrap:nowrap;gap:6px;padding:8px 16px}.wordmark{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn.compact-only{display:inline-flex}.btn.wide-only,.app.mode-empty .zone.right,.app.no-history .zone.left{display:none}.zone,.zone.center.fit,.zone.left,.zone.right,.zone.left>.left-scroll,.right-scroll{overflow:visible}.zone.left,.zone.right{border:0;border-top:1px solid var(--line)}.fit .capture,.fit .capture .viewport{flex:none}.fit .capture .viewport{container-type:inline-size}.fit .capture .canvas{width:calc(100cqw * var(--z, 1))}.capture>.toolbar:not(.crop-bar)>.grow{display:none}.capture>.toolbar:not(.crop-bar)>.btn,.capture>.toolbar:not(.crop-bar)>.seg{flex:1 1 auto}.capture>.toolbar:not(.crop-bar)>.seg .btn{flex:1 1 0}.capture>.toolbar:not(.crop-bar)>.zoom{flex:1 1 200px}.capture>.toolbar:not(.crop-bar)>.zoom input[type=range]{flex:1;width:auto;min-width:80px}.app.mode-empty{grid-template-columns:minmax(0,1fr);grid-template-areas:"top" "center" "right" "left"}.capture>.toolbar:not(.crop-bar)>.seg.tabs{flex:1 1 100%}.capture>.toolbar:not(.crop-bar)>.seg.tabs .btn{flex:1 1 auto;min-width:0;padding:0 6px}.capture>.toolbar:not(.crop-bar)>.ctl{flex:1 1 auto}.capture>.toolbar:not(.crop-bar)>.ctl select{flex:1;max-width:none}.switcher{width:100%;order:-2}.zone.center>.status,.zone.center>.error{order:-1}.status{margin-top:0}.ch-chips .btn.chip{height:32px;min-width:44px;padding:0 10px}.channel legend{flex-wrap:wrap;row-gap:4px}.channel legend .inline{min-height:32px;padding-right:4px}.channel legend .inline input[type=checkbox]{width:18px;height:18px}.channel legend input.ch-label{height:32px;flex:1 1 96px;width:auto;max-width:100%}.math-row select{min-height:32px}}@media(max-width:540px){.mode{display:none}}
