:root{--green: #2f6fe4;--green-dark: #1f5fd6;--bg: #0d1424;--panel: #151e30;--panel-2: #1f2a40;--line: #2a3650;--text: #f2f2f2;--muted: #9aa6ba;--accent: #4d8ef5;--danger: #ff5a52;--cyan: #2ee6ff;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);color-scheme:dark}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overscroll-behavior:none;-webkit-user-select:none;user-select:none}button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}input,textarea,select{font:inherit;color:var(--text);-webkit-user-select:text;user-select:text}.screen{height:100%;display:flex;flex-direction:column}.topbar{background:linear-gradient(135deg,#1f5fd6,#3d86f2);padding:calc(var(--safe-top) + 6px) 6px 6px;display:flex;align-items:center;gap:2px;min-height:calc(56px + var(--safe-top));box-shadow:0 2px 6px #00000059;z-index:5}.topbar h1{font-size:19px;font-weight:700;margin:0 0 0 8px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar .title-input{flex:1;background:#0003;border:0;border-radius:8px;padding:8px 10px;font-size:16px;margin-left:4px;min-width:0}.icon-btn{width:44px;height:44px;display:inline-grid;place-items:center;border-radius:50%;flex:none}.icon-btn:active{background:#ffffff26}.icon-btn:disabled{opacity:.35}.list{flex:1;overflow-y:auto;padding-bottom:96px}.row{display:flex;align-items:center;gap:14px;padding:8px 6px 8px 12px;border-bottom:1px solid #1b2538;width:100%;text-align:left}.row:active{background:#18223a}.thumb{width:64px;height:52px;border-radius:6px;object-fit:cover;background:#333;flex:none}.row .meta{flex:1;min-width:0}.row .name{font-weight:600;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row .sub{color:var(--muted);font-size:13px;margin-top:3px}.badge{display:inline-block;font-size:11px;padding:1px 7px;border-radius:999px;margin-left:6px;background:#2ee6ff26;color:var(--cyan)}.empty{text-align:center;color:var(--muted);padding:48px 28px;line-height:1.5}.empty strong{color:var(--text);display:block;font-size:18px;margin-bottom:8px}.search{padding:8px 12px;background:#111a2c}.search input{width:100%;border-radius:10px;border:1px solid var(--line);background:#0b1222;padding:10px 12px;font-size:16px}.bottombar{position:relative;display:flex;align-items:center;gap:6px;padding:8px 10px calc(8px + var(--safe-bottom));background:#111a2c;border-top:1px solid #1f2a40;z-index:5}.bottombar .spacer{flex:1}.tool-btn{min-width:48px;height:48px;border-radius:12px;display:inline-grid;place-items:center;padding:0 8px}.tool-btn.boxed{border:1.5px solid #666}.tool-btn.active{background:#ffffff24;border-color:#aaa}.tool-btn:active{background:#ffffff2e}.tool-btn:disabled{opacity:.3}.swatch{width:26px;height:26px;border-radius:5px;border:2px solid rgba(255,255,255,.8)}.big-actions{position:fixed;left:0;right:0;bottom:0;display:flex;gap:10px;padding:10px 14px calc(12px + var(--safe-bottom));background:linear-gradient(transparent,#070c17e6 40%)}.big-actions button{flex:1;height:54px;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:700;font-size:16px;background:var(--green);box-shadow:0 4px 14px #0006}.stage{flex:1;position:relative;overflow:hidden;touch-action:none;background:#070c17}.stage .world{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}.stage .world img{display:block;width:100%;height:100%;pointer-events:none}.stage .world svg{position:absolute;inset:0;overflow:visible;pointer-events:none}.zoom-ctrl{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;border-radius:12px;overflow:hidden;background:#282828bf;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:3}.zoom-ctrl button{width:46px;height:46px;display:grid;place-items:center}.zoom-ctrl button+button{border-top:1px solid rgba(255,255,255,.12)}.loupe{position:absolute;top:10px;width:130px;height:130px;border-radius:50%;overflow:hidden;border:3px solid #fff;box-shadow:0 6px 22px #0009;background:#000;z-index:4;pointer-events:none}.loupe .cross-h,.loupe .cross-v{position:absolute;background:#ffffffd9;mix-blend-mode:difference}.loupe .cross-h{left:0;right:0;top:50%;height:1px}.loupe .cross-v{top:0;bottom:0;left:50%;width:1px}.loupe .dot{position:absolute;left:50%;top:50%;width:6px;height:6px;margin:-3px 0 0 -3px;border-radius:50%;background:#ff3b30}.toast{position:absolute;left:12px;right:12px;bottom:12px;display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:#141414e6;font-size:14px;z-index:4}.toast span{flex:1}.chip{position:absolute;left:10px;top:10px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:600;background:#141414cc;color:var(--muted);z-index:3}.chip.ok{color:var(--cyan)}.calib-bar{display:flex;flex-direction:column;gap:8px;padding:10px 12px calc(10px + var(--safe-bottom));background:#111a2c;border-top:2px solid var(--cyan)}.calib-bar p{margin:0;font-size:14px;line-height:1.35;color:#ddd}.calib-bar .actions{display:flex;gap:8px}.backdrop{position:fixed;inset:0;background:#00000080;z-index:20;display:flex;flex-direction:column;justify-content:flex-end;animation:fade .15s ease}@keyframes fade{0%{opacity:0}}.sheet{background:var(--panel);border-radius:18px 18px 0 0;padding:6px 0 calc(10px + var(--safe-bottom));max-height:92%;overflow-y:auto;width:100%;max-width:620px;margin:0 auto;animation:up .18s ease}@keyframes up{0%{transform:translateY(30px)}}.sheet h2{font-size:17px;margin:10px 16px 6px}.sheet .grab{width:40px;height:4px;border-radius:2px;background:#555;margin:4px auto 2px}.menu-item{display:flex;align-items:center;gap:14px;width:100%;padding:13px 18px;text-align:left;font-size:16px}.menu-item:active{background:#1f2a40}.menu-item:disabled{opacity:.35}.menu-item.danger{color:var(--danger)}.menu-item small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}.section-title{color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:14px 18px 4px}.tabs{display:flex;border-bottom:1px solid var(--line);margin:0 4px}.tabs button{flex:1;padding:12px 4px;font-size:13px;font-weight:700;letter-spacing:.05em;color:var(--muted);border-bottom:3px solid transparent}.tabs button.on{color:var(--text);border-color:var(--accent)}.value-display{display:flex;align-items:center;gap:10px;margin:12px 16px 6px}.value-display .val{flex:1;font-size:28px;font-weight:700;padding:6px 4px;border-bottom:2px solid var(--accent);min-height:48px;font-variant-numeric:tabular-nums}.value-display .val.placeholder{color:#777}.hint{margin:4px 16px 6px;font-size:13px;color:var(--muted);line-height:1.4}.hint.cyan{color:var(--cyan)}.keypad{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:8px 12px 4px}.keypad button{height:54px;border-radius:10px;background:var(--panel-2);font-size:22px;font-weight:600;display:grid;place-items:center}.keypad button:active{background:#2a3858}.keypad button.unit{font-size:15px;font-weight:800;color:var(--muted)}.keypad button.unit.on{background:var(--accent);color:#fff}.sheet-actions{display:flex;gap:8px;padding:10px 12px 2px}.btn{flex:1;height:48px;border-radius:12px;font-weight:700;background:var(--panel-2);padding:0 12px}.btn.primary{background:var(--green)}.btn.cyan{background:#0f6c7a}.btn.danger{color:var(--danger)}.btn:disabled{opacity:.4}.colors{display:flex;flex-wrap:wrap;gap:10px;padding:8px 16px}.colors button{width:40px;height:40px;border-radius:50%;border:3px solid transparent;box-shadow:inset 0 0 0 2px #00000059}.colors button.on{border-color:#fff}.seg{display:flex;gap:6px;padding:6px 16px}.seg button{flex:1;height:44px;border-radius:10px;background:var(--panel-2);font-weight:600}.seg button.on{background:var(--accent);color:#fff}.field{padding:6px 16px}.field label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}.field input,.field textarea,.field select{width:100%;border-radius:10px;border:1px solid var(--line);background:#0b1222;padding:11px 12px;font-size:16px}.field textarea{min-height:96px;resize:vertical}.presets{display:flex;flex-wrap:wrap;gap:6px;padding:4px 16px}.presets button{padding:8px 12px;border-radius:999px;background:var(--panel-2);font-size:14px}.settings{flex:1;overflow-y:auto;padding-bottom:calc(24px + var(--safe-bottom))}.card{background:var(--panel);margin:10px 12px;border-radius:14px;padding:6px 0}.switch-row{display:flex;align-items:center;gap:12px;padding:12px 16px}.switch-row>span:first-child{flex:1}.switch-row small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}.switch{width:50px;height:30px;border-radius:15px;background:#555;position:relative;flex:none}.switch:after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:transform .15s}.switch.on{background:var(--green)}.switch.on:after{transform:translate(20px)}.ref-row{display:flex;align-items:center;gap:10px;padding:10px 8px 10px 16px}.ref-row .radio{width:22px;height:22px;border-radius:50%;border:2px solid #888;flex:none;display:grid;place-items:center}.ref-row .radio.on{border-color:var(--accent)}.ref-row .radio.on:after{content:"";width:11px;height:11px;border-radius:50%;background:var(--accent)}.ref-row .meta{flex:1;min-width:0}.ref-row .meta small{display:block;color:var(--muted);font-size:12.5px}.help{font-size:14px;line-height:1.5;color:#ccc;padding:4px 16px 10px}.help ol{padding-left:20px;margin:6px 0}.dialog{background:var(--panel);border-radius:16px;margin:auto 18px;padding:14px 0 8px;max-width:420px;align-self:center;width:calc(100% - 36px)}.dialog p{margin:4px 18px 10px;color:#ccc;line-height:1.4}@media(min-width:900px){.list{max-width:820px;width:100%;margin:0 auto}}.tool-btn{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:44px;padding:0 4px}.tool-btn .lbl{display:none;font-size:11px;font-weight:600;color:var(--muted)}.bottombar{gap:2px}.send-btn{height:44px;padding:0 14px;border-radius:12px;display:inline-flex;align-items:center;gap:6px;font-weight:700;background:linear-gradient(135deg,#1f5fd6,#3d86f2);box-shadow:0 4px 14px #2f6fe459}.send-btn:active{filter:brightness(1.15)}.menu-item.highlight{background:#4d8ef51f;border-left:3px solid var(--accent)}.big-actions button{background:linear-gradient(135deg,#1f5fd6,#3d86f2)}.big-actions button.secondary{background:#1f2a40}.chip.ok{color:var(--cyan);border:1px solid rgba(46,230,255,.35)}input[type=range]{accent-color:var(--accent);height:32px}@media(min-width:600px){.tool-btn{min-width:64px;height:54px}.tool-btn .lbl{display:block}.bottombar{gap:6px;padding-left:16px;padding-right:16px}.topbar h1{font-size:21px}.loupe{width:170px;height:170px}}@media(min-width:900px){body{-webkit-user-select:none}.stage{cursor:crosshair}.list{max-width:1200px;width:100%;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px;padding:18px 20px 110px;align-content:start}.list>.row{background:var(--panel);border-radius:14px;border:1px solid var(--line);overflow:hidden}.list>.empty{grid-column:1 / -1}.thumb{width:96px;height:72px}.big-actions{left:50%;right:auto;transform:translate(-50%);width:560px;background:none}.backdrop{justify-content:center;align-items:center}.sheet{border-radius:18px;max-width:560px;max-height:86vh;padding-bottom:12px}.sheet .grab{display:none}.settings{max-width:780px;width:100%;margin:0 auto}.search{max-width:1200px;margin:0 auto;width:100%}.toast{left:50%;right:auto;transform:translate(-50%);max-width:560px}.keypad button{height:50px}}.backdrop.clear{background:transparent}@media(min-width:900px){.backdrop.clear{justify-content:flex-end;align-items:flex-end;padding:0 16px 16px}.backdrop.clear .sheet{margin:0;max-width:440px}}.calib-step{margin:6px 12px 2px;padding:8px 12px;border-radius:10px;background:#2ee6ff1f;color:var(--cyan);font-weight:700;font-size:14px}.pager{display:flex;align-items:center;background:#0000002e;border-radius:999px;margin-left:4px}.pager .icon-btn{width:36px;height:40px;font-size:24px;font-weight:700}.pager-num{min-width:40px;font-weight:800;font-size:15px;font-variant-numeric:tabular-nums}.step-banner{position:absolute;left:10px;right:10px;top:10px;display:flex;align-items:center;gap:10px;padding:10px 10px 10px 12px;border-radius:14px;background:#0d1424eb;border:1px solid rgba(46,230,255,.4);font-size:14px;line-height:1.35;z-index:4}.step-banner>span:nth-child(2){flex:1}.step-dot{width:14px;height:14px;border-radius:50%;flex:none}.step-dot.w{background:#3b8bff}.step-dot.h{background:#ffd60a}.busy{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:#070c17b3;font-weight:600}.spinner{width:38px;height:38px;border-radius:50%;border:4px solid rgba(255,255,255,.2);border-top-color:var(--accent);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.page-row{display:flex;align-items:center;gap:10px;padding:8px 10px 8px 16px}.page-row.on{background:#4d8ef51f}.page-row img{width:72px;height:54px;object-fit:cover;border-radius:6px;background:#222}.page-row .meta{flex:1;text-align:left}.page-row .meta small{display:block;color:var(--muted);font-size:12.5px}.grid-overlay{position:absolute;inset:0;pointer-events:none;z-index:1}.live-stage{background:#000}.live-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.live-overlay{position:absolute;inset:0;pointer-events:none}.live .loupe canvas{display:block;width:100%;height:100%}.live-bar{padding:10px 12px calc(10px + var(--safe-bottom));background:#111a2c;border-top:1px solid #1f2a40}.live-bar.row{display:flex;align-items:center;gap:8px}.live-bar .spacer{flex:1}.live-refs{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}.chip-btn{flex:none;padding:10px 14px;border-radius:999px;background:#1f2a40;font-weight:600;font-size:14px;white-space:nowrap}.chip-btn.on{background:var(--accent);color:#fff}.ar-overlay{position:fixed;inset:0;z-index:50}.ar-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.ar-top{position:absolute;left:12px;right:12px;top:calc(12px + var(--safe-top));padding:10px 14px;border-radius:14px;background:#0d1424d9;font-weight:600;text-align:center}.ar-bottom{position:absolute;left:12px;right:12px;bottom:calc(16px + var(--safe-bottom));display:flex;gap:10px}.ar-bottom .btn{flex:none;height:56px;min-width:64px;display:grid;place-items:center;background:#1f2a40e6}.ar-bottom .ar-mark{flex:1;font-size:17px;background:linear-gradient(135deg,#1f5fd6,#3d86f2)}.ar-surface{color:var(--cyan)}.big-actions button{font-size:15px;gap:6px}.scale-chip{position:absolute;left:10px;bottom:10px;right:150px;padding:7px 10px;border-radius:10px;background:#0d1424cc;color:var(--cyan);font-size:12px;font-weight:600;z-index:3}.scale-chip.locked{color:#ffd60a}.mark-btn{flex:1;justify-content:center;height:52px;font-size:16px}.send-btn:disabled{opacity:.55;background:#33415c;box-shadow:none}.ar-note{display:block;margin-top:4px;color:var(--cyan);font-size:12px}.ar-chooser{position:absolute;left:12px;right:12px;bottom:calc(84px + var(--safe-bottom));display:flex;flex-wrap:wrap;gap:8px;padding:12px;border-radius:14px;background:#0d1424eb}.ar-chooser>span{width:100%;font-weight:700}
