:root{--bg:#eef0f3;--panel:#fff;--panel-alt:#f7f8fa;--border:#d9dde3;--text:#1f2933;--muted:#6b7482;--accent:#2563eb;--accent-weak:#e3ebfd;--accent-strong:#1d4ed8;--on-accent:#fff;--danger:#c62828;--good:#0f7a34;--good-bg:#e6f4ea;--warn-bg:#fff6e0;--warn-text:#7a5200;--error-bg:#fdecec;--topbar:#1e293b;--grid-major:#9aa4b2;--grid-minor:#d3d8df;--input-bg:#fff;--border-strong:#c9ced6;--seg-active:#fff;--chart-bg:#fcfcfd;--teal:#0f766e;--brush:#ea580c;--brush-weak:#ea580c24;--sel:#2563eb1a;--sel-strong:#2563eb38;--cell-border:#e6e9ee;--header-bg:#f2f4f7;--shadow:0 8px 24px #0f172a29;--radius:6px;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}:root[data-theme=dark]{--bg:#0b1120;--panel:#111827;--panel-alt:#182131;--border:#283344;--text:#e5e7eb;--muted:#94a3b8;--accent:#60a5fa;--accent-weak:#1c3354;--accent-strong:#93c5fd;--on-accent:#0b1120;--danger:#f87171;--good:#4ade80;--good-bg:#13301f;--warn-bg:#33290f;--warn-text:#fcd34d;--error-bg:#3a1b1d;--topbar:#060a13;--grid-major:#4b5563;--grid-minor:#253041;--input-bg:#0d1422;--border-strong:#1f2937;--seg-active:#243044;--chart-bg:#0d1422;--teal:#2dd4bf;--brush:#fb923c;--brush-weak:#fb923c2e;--sel:#60a5fa1f;--sel-strong:#60a5fa42;--cell-border:#1e293b;--header-bg:#152033;--shadow:0 10px 30px #00000080;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--bg);font-size:13px;overflow:hidden}button,input,select,textarea{font:inherit;color:inherit}input,select{border:1px solid var(--border);background:var(--input-bg);border-radius:4px;min-width:0;height:28px;padding:0 8px}textarea{border:1px solid var(--border);background:var(--input-bg);resize:vertical;border-radius:4px;padding:8px}input:focus,select:focus,textarea:focus{outline:2px solid var(--accent-weak);border-color:var(--accent)}input[type=checkbox],input[type=radio]{height:auto;accent-color:var(--accent)}input[type=range]{height:18px;accent-color:var(--accent);background:0 0;border:0;padding:0}input[type=color]{width:32px;padding:2px}h2,h3,h4{margin:0}.muted{color:var(--muted);margin:0;line-height:1.45}.small{font-size:12px}.num{font-variant-numeric:tabular-nums}kbd{border:1px solid var(--border);color:var(--muted);border-bottom-width:2px;border-radius:3px;padding:0 4px;font:11px ui-monospace,SFMono-Regular,Menlo,monospace}.app{flex-direction:column;height:100vh;display:flex}.workspace{flex:1;min-height:0;display:flex}.main-area{background:var(--panel);flex-direction:column;flex:1;min-width:0;display:flex;position:relative}.resizer{cursor:row-resize;background:var(--border);border-block:1px solid var(--border-strong);touch-action:none;flex:none;height:6px}.resizer:hover{background:var(--accent-weak)}.lower{background:var(--panel);flex-direction:column;flex:none;min-height:0;display:flex}.panel-title{letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-size:11px;font-weight:600}.topbar{background:var(--topbar);color:#e5e9f0;flex:none;align-items:center;gap:14px;height:48px;padding:0 14px;display:flex}.brand{color:#fff;white-space:nowrap;align-items:center;gap:8px;font-size:15px;font-weight:700;display:flex}.brand svg{color:#60a5fa}.project-name{color:#fff;background:#ffffff14;border-color:#0000;width:170px}.project-name:focus{background:#ffffff24;border-color:#60a5fa;outline:none}.toolbar{align-items:center;gap:2px;min-width:0;display:flex}.toolbar>button,.toolbar .menu>button,.modes button{color:#e5e9f0;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:4px;height:30px;padding:0 10px}.toolbar>button:hover,.toolbar .menu>button:hover,.toolbar .menu>button[aria-expanded=true],.modes button:hover{background:#ffffff1a}.toolbar>button:disabled{opacity:.35;cursor:default;background:0 0}.toolbar-sep{background:#fff3;width:1px;height:20px;margin:0 6px}.modes{background:#00000040;border-radius:6px;gap:2px;margin-left:auto;padding:3px;display:flex}.modes button.active{color:var(--topbar);background:#fff;font-weight:600}.local-status{color:#aab4c3;white-space:nowrap;align-items:center;gap:6px;font-size:12px;display:flex}.local-status .dot{background:#22c55e;border-radius:50%;width:8px;height:8px}@media (max-width:1280px){.local-status span:last-child{display:none}}.view-toggles{gap:2px;display:flex}.view-toggles button{color:#e5e9f0;cursor:pointer;background:0 0;border:0;border-radius:4px;place-items:center;width:32px;height:30px;padding:0;display:grid}.view-toggles button:hover{background:#ffffff1a}.view-toggles svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;stroke-linejoin:round;width:18px;height:18px}.menu{position:relative}.menu-list{z-index:30;border:1px solid var(--border);border-radius:var(--radius);background:var(--panel);min-width:240px;max-height:calc(100vh - 70px);color:var(--text);box-shadow:var(--shadow);padding:4px;position:absolute;top:calc(100% + 6px);left:0;overflow-y:auto}.menu-list.wide{width:max-content;min-width:320px;max-width:min(440px,100vw - 16px)}.menu-item{width:100%;min-height:30px;color:var(--text);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:10px;padding:5px 10px;display:flex}.menu-item:hover,.menu-item:focus-visible,.menu-item.open{background:var(--accent-weak);outline:none}.menu-item:disabled{opacity:.45;cursor:default;background:0 0}.menu-item .label{flex:1;min-width:0}.menu-item .hint,.menu-item .chev{color:var(--muted);white-space:nowrap;font-size:11px}.menu-item .icon{width:18px;height:18px;color:var(--muted);flex:none}.menu-item.rich{flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px}.menu-item.rich span{color:var(--muted);font-size:12px}.menu-sep{background:var(--border);height:1px;margin:4px 6px}.menu-heading{letter-spacing:.05em;text-transform:uppercase;color:var(--muted);padding:6px 10px 2px;font-size:11px;font-weight:600}.submenu{position:relative}.submenu>.menu-list{top:-5px;left:calc(100% + 2px)}.context-menu{position:fixed;top:0;left:0}.btn{border:1px solid var(--border);background:var(--input-bg);cursor:pointer;white-space:nowrap;border-radius:4px;justify-content:center;align-items:center;gap:6px;height:28px;padding:0 12px;display:inline-flex}.btn:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}.btn:disabled{opacity:.5;cursor:default}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.btn.primary:hover:not(:disabled){background:var(--accent-strong);color:var(--on-accent)}.btn.danger:hover:not(:disabled){border-color:var(--danger);color:var(--danger)}.btn.small{height:24px;padding:0 8px;font-size:12px}.btn svg,.icon-btn svg{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;stroke-linejoin:round;width:15px;height:15px}.link-btn{color:var(--accent);cursor:pointer;background:0 0;border:0;padding:0 2px;font-size:12px}.link-btn:hover{text-decoration:underline}.icon-btn{width:28px;height:28px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:4px;place-items:center;padding:0;font-size:18px;line-height:1;display:inline-grid}.icon-btn:hover{background:var(--panel-alt);color:var(--text)}.icon-btn.active{background:var(--accent-weak);color:var(--accent)}.button-row{flex-wrap:wrap;gap:6px;display:flex}.button-row.end{justify-content:flex-end}.field{flex-direction:column;gap:3px;min-width:0;display:flex}.field>label,.field>.label{color:var(--muted);font-size:12px}.field select,.field>input,.field textarea{width:100%}.hint{color:var(--muted);font-size:11px}.field-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.field-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.field-grid.single{grid-template-columns:minmax(0,1fr)}.num-input{font-variant-numeric:tabular-nums}.num-input.invalid{border-color:var(--danger);background:var(--error-bg)}.check{cursor:pointer;align-items:center;gap:6px;display:flex}.check input{margin:0}.check-with-input{align-items:center;gap:8px;display:flex}.check-with-input .num-input{width:80px}.alert{border-radius:var(--radius);padding:8px 10px;font-size:12px;line-height:1.4}.alert.error{background:var(--error-bg);color:var(--danger)}.alert.warn{background:var(--warn-bg);color:var(--warn-text)}.alert.info{background:var(--accent-weak);color:var(--text)}.segmented{background:var(--panel-alt);border:1px solid var(--border);border-radius:6px;padding:2px;display:flex}.segmented button{cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:4px;flex:1;height:26px;padding:0 8px}.segmented button.active{background:var(--seg-active);color:var(--accent);font-weight:600;box-shadow:0 1px 2px #0000001f}.segmented.compact button{height:22px;padding:0 8px;font-size:12px}.side{border-left:1px solid var(--border);background:var(--panel);flex-direction:column;flex:none;width:320px;display:flex;overflow-y:auto}.side-head{z-index:2;background:var(--panel);justify-content:space-between;align-items:center;gap:8px;padding:12px 14px 8px;display:flex;position:sticky;top:0}.side-section{border-top:1px solid var(--border);flex-direction:column;gap:8px;padding:10px 14px 12px;display:flex}.side-section h3{justify-content:space-between;align-items:center;gap:8px;font-size:12px;display:flex}.side-section h3 .hint{font-weight:400}.status{color:var(--muted);font-size:11px}.status.error{color:var(--danger);font-weight:600}.readout{font-variant-numeric:tabular-nums;grid-template-columns:minmax(80px,auto) 1fr;gap:3px 10px;margin:0;font-size:12px;display:grid}.readout dt{color:var(--muted)}.readout dd{text-align:right;margin:0}.gallery-group+.gallery-group{margin-top:6px}.gallery-group-title{color:var(--muted);margin:0 0 4px;font-size:11px}.gallery{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;display:grid}.gallery button{min-width:0;color:var(--text);text-align:center;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;flex-direction:column;align-items:center;gap:2px;padding:6px 2px 4px;font-size:10.5px;line-height:1.15;display:flex}.gallery button:hover{border-color:var(--border);background:var(--panel-alt)}.gallery button.active{border-color:var(--accent);background:var(--accent-weak);color:var(--accent-strong);font-weight:600}.gallery button.unavailable{opacity:.45}.modal-backdrop{z-index:40;color:var(--text);background:#0f172a73;place-items:center;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border-radius:10px;flex-direction:column;width:min(720px,100vw - 32px);max-height:calc(100vh - 48px);display:flex;box-shadow:0 20px 50px #0000004d}.modal.wide{width:min(1180px,100vw - 32px)}.modal.narrow{width:min(480px,100vw - 32px)}.modal-head{justify-content:space-between;align-items:center;gap:12px;padding:14px 18px 10px;display:flex}.modal-head h2{font-size:16px}.modal-head p{margin:2px 0 0}.modal-body{flex-direction:column;gap:12px;min-height:0;padding:4px 18px 14px;display:flex;overflow-y:auto}.modal-foot{border-top:1px solid var(--border);align-items:center;gap:8px;padding:12px 18px;display:flex}.modal-foot .spacer{flex:1}.toast{z-index:60;border-radius:var(--radius);color:#fff;cursor:pointer;background:#1f2937;max-width:440px;padding:10px 14px;line-height:1.45;position:fixed;bottom:16px;right:16px;box-shadow:0 6px 20px #0003}.toast.error{background:var(--danger)}.figure-wrap{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.figure-toolbar{flex:none;align-items:center;gap:8px;min-height:40px;padding:6px 10px 2px 14px;display:flex}.figure-toolbar .title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;font-weight:600;overflow:hidden}.figure-toolbar .tools{align-items:center;gap:2px;display:flex}.figure-body{flex:1;min-height:0;position:relative}.figure-body>svg{-webkit-user-select:none;user-select:none;width:100%;height:100%;display:block;position:absolute;inset:0}.figure-body.tool-zoom>svg,.figure-body.tool-brush>svg{cursor:crosshair}.figure-body.tool-pan>svg{cursor:grab}.figure-empty{color:var(--muted);text-align:center;place-items:center;padding:24px;line-height:1.6;display:grid;position:absolute;inset:0}.figure-empty strong{color:var(--text)}.figure-empty .big{font-size:15px}.drop-overlay{z-index:50;border:2px dashed var(--accent);background:color-mix(in srgb, var(--accent-weak) 85%, transparent);color:var(--accent-strong);pointer-events:none;border-radius:12px;place-items:center;font-size:16px;font-weight:600;display:grid;position:absolute;inset:8px}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}input.invalid,textarea.invalid{border-color:var(--danger);background:var(--error-bg)}code.mono{background:var(--panel-alt);word-break:break-all;border-radius:3px;padding:0 3px}.side-section.collapsible>h3{margin:-2px 0 0}.section-toggle{cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:0;font-size:12px;font-weight:600;display:flex}.section-toggle .chev{width:10px;color:var(--muted);font-size:10px;transition:transform .15s;display:inline-block}.collapsible.open .section-toggle .chev{transform:rotate(90deg)}.slider-label{justify-content:space-between;gap:8px;display:flex}.slider-label .num{color:var(--text)}.check-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.button-row .btn{text-decoration:none}.side-section p.hint,.side-section p.muted{margin:0}.type-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.type-gallery svg{width:22px;height:22px;margin-bottom:2px}.type-gallery button{padding:7px 2px 6px;font-size:11.5px}.input-with-button{align-items:center;gap:4px;display:flex}.input-with-button input{flex:1}.token-buttons{flex-wrap:wrap;gap:4px;margin-top:2px;display:flex}.token{border:1px solid var(--border);background:var(--panel-alt);height:22px;color:var(--accent-strong);cursor:pointer;border-radius:11px;padding:0 7px;font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.token:hover{border-color:var(--accent);background:var(--accent-weak)}.token.custom{color:var(--teal)}.var-group{border:1px solid var(--border);border-radius:var(--radius);background:var(--panel-alt);flex-direction:column;gap:6px;padding:8px 10px;display:flex}.var-head{align-items:baseline;gap:6px;font-size:12px;display:flex}.var-head strong{color:var(--accent-strong);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11.5px}.var-value{color:var(--muted);margin-left:auto}.in-use{background:var(--good-bg);color:var(--good);border-radius:8px;padding:0 5px;font-size:10px;font-weight:600}.custom-field{grid-template-columns:84px minmax(0,1fr) 28px;align-items:center;gap:4px;display:grid}.swatches{flex-wrap:wrap;gap:6px;display:flex}.swatch{border:1px solid var(--border-strong);cursor:pointer;border-radius:6px;place-items:center;width:28px;height:28px;padding:0;display:grid}.swatch span{background:currentColor;border-radius:2px;width:14px;height:14px}.swatch.active{outline:2px solid var(--accent);outline-offset:1px}.color-field{gap:4px;display:flex}.color-field input[type=color]{cursor:pointer;flex:none;width:34px;height:28px}.color-field input:not([type=color]){flex:1;width:100%}.segmented button svg{margin:0 auto;display:block}.drop-zone{border:1.5px dashed var(--border-strong);background:var(--panel-alt);color:var(--muted);text-align:left;cursor:pointer;border-radius:8px;align-items:center;gap:12px;padding:12px;font-size:12px;line-height:1.45;display:flex}.drop-zone svg{color:var(--accent);flex:none}.drop-zone strong{color:var(--text)}.drop-zone:hover{border-color:var(--accent)}.logo-row{align-items:center;gap:10px;display:flex}.logo-thumb{object-fit:contain;border:1px solid var(--border);background:repeating-conic-gradient(#e5e7eb 0% 25%,#fff 0% 50%) 50%/12px 12px;border-radius:6px;flex:none;width:48px;height:48px}.logo-meta{flex-direction:column;gap:2px;min-width:0;display:flex}.logo-meta strong{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.size-row{align-items:center;gap:6px;display:flex}.size-row input{width:110px}.size-presets{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.chip-btn{border:1px solid var(--border);background:var(--input-bg);font-variant-numeric:tabular-nums;cursor:pointer;border-radius:11px;height:22px;padding:0 8px;font-size:11px}.chip-btn:hover{border-color:var(--accent)}.chip-btn.active{border-color:var(--accent);background:var(--accent-weak);color:var(--accent-strong);font-weight:600}.preview-body{box-sizing:border-box;background:var(--chart-bg);flex:1;place-items:center;min-height:0;padding:16px;display:grid;position:relative;overflow:hidden}.qr-stage{border-radius:6px;box-shadow:0 1px 2px #0f172a1f,0 8px 24px #0f172a1a}.qr-stage svg{border-radius:inherit;width:100%;height:100%;display:block}.qr-stage.checker,.label-paper.checker{background:repeating-conic-gradient(#e5e7eb 0% 25%,#fff 0% 50%) 50%/16px 16px}.info-bar{border-top:1px solid var(--border);background:var(--panel);flex:none;grid-template-columns:minmax(0,1fr) minmax(260px,340px);gap:14px;max-height:42%;padding:12px 14px;display:grid;overflow-y:auto}.encoded{flex-direction:column;gap:4px;min-width:0;display:flex}.encoded-head{justify-content:space-between;align-items:center;display:flex}.encoded-text{border:1px solid var(--border);border-radius:var(--radius);background:var(--panel-alt);white-space:pre-wrap;word-break:break-all;max-height:120px;margin:0;padding:8px 10px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:auto}.facts{flex-direction:column;gap:8px;display:flex}.facts .readout dd{text-align:left}.capacity{background:var(--panel-alt);border:1px solid var(--border);border-radius:2px;height:4px;overflow:hidden}.capacity span{background:var(--accent);height:100%;display:block}.scan-badge{border-radius:var(--radius);background:var(--panel-alt);color:var(--muted);align-items:center;gap:6px;padding:6px 10px;font-size:12px;line-height:1.4;display:flex}.scan-badge svg{flex:none;width:16px;height:16px}.scan-badge.ok{background:var(--good-bg);color:var(--good);font-weight:600}.scan-badge.fail{background:var(--error-bg);color:var(--danger)}.label-stage{background:var(--chart-bg);border-bottom:1px solid var(--border);flex-direction:column;flex:none;align-items:center;gap:8px;padding:20px 16px;display:flex}.label-paper{background:#fff;border-radius:4px;overflow:hidden;box-shadow:0 0 0 1px #0f172a1f,0 8px 24px #0f172a24}.label-paper svg{width:100%;height:100%;display:block}.label-stage .alert{width:min(100%,560px)}.run-table-wrap{flex:1;min-height:0;overflow:auto}.run-table{border-collapse:collapse;width:100%;font-size:12px}.run-table th{z-index:1;border-bottom:1px solid var(--border);background:var(--header-bg);color:var(--muted);text-align:left;white-space:nowrap;padding:6px 10px;font-weight:600;position:sticky;top:0}.run-table td{border-bottom:1px solid var(--cell-border);white-space:nowrap;padding:4px 10px}.run-table tr{cursor:pointer}.run-table tbody tr:hover{background:var(--sel)}.run-table tr.current{background:var(--sel-strong)}.run-table .qr-cell{text-overflow:ellipsis;max-width:340px;overflow:hidden}.table-more{padding:8px 10px}.line-row{grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:4px;margin-bottom:4px;display:grid}.scan-stage{background:var(--chart-bg);flex:1;place-items:center;min-height:0;padding:16px;display:grid;position:relative;overflow:hidden}.scan-image{object-fit:contain;max-width:100%;max-height:100%;box-shadow:var(--shadow);border-radius:6px}.camera{max-width:100%;max-height:100%;position:relative}.camera video{background:#000;border-radius:8px;max-width:100%;max-height:calc(100vh - 160px);display:block}.camera-frame{pointer-events:none;border:3px solid #ffffffd9;border-radius:12px;position:absolute;inset:18% 22%;box-shadow:0 0 0 9999px #00000040}.camera-status{color:#fff;text-align:center;text-shadow:0 1px 3px #000000b3;margin:0;position:absolute;bottom:10px;left:0;right:0}.scan-result .readout dd{word-break:break-all}@media (max-width:1000px){.side{width:290px}.topbar .project-name{display:none}.info-bar{grid-template-columns:minmax(0,1fr)}}@media (max-width:760px){body{overflow:auto}.app{height:auto;min-height:100vh}.topbar{z-index:20;flex-wrap:wrap;gap:4px 6px;height:auto;padding:6px 8px;position:sticky;top:0}.view-toggles{order:1;margin-left:auto}.modes{order:2;width:100%;margin-left:0}.modes button{flex:1;padding:0 6px}.toolbar{flex-wrap:wrap;order:3;width:100%}.toolbar>button,.toolbar .menu>button{padding:0 8px}.toolbar-sep,.local-status,.topbar .project-name{display:none}.menu{position:static}.menu-list,.menu-list.wide{width:auto;min-width:0;max-width:none;max-height:70vh;left:8px;right:8px}.submenu>.menu-list{box-shadow:none;background:0 0;border:0;max-height:none;margin:2px 0 4px 12px;padding:0;position:static}.workspace{flex-direction:column;flex:none}.main-area{flex:none}.preview-body{flex:none;height:80vw;min-height:260px}.run-table-wrap{max-height:50vh}.scan-stage{min-height:60vh}.side{border-left:0;border-top:1px solid var(--border);width:auto;overflow:visible}.info-bar{max-height:none}}@media (prefers-reduced-motion:reduce){.section-toggle .chev{transition:none}}
