:root{color-scheme:light;--border: #d0d5dd;--bg-panel: #f8f9fb;--bg-page: #ffffff;--bg-elevated: #ffffff;--text: #1a1a1a;--muted: #666666;--accent: #2563eb;--accent-soft: #dbeafe;--danger: #b91c1c;--unsaved: #d97706;--stage-a: #eeeeee;--stage-b: #fafafa;--hotspot-bg: #fde047;--hotspot-border: #a16207;--hotspot-row-match-bg: #f97316;--row-match-soft: #ffedd5;--hotspot-pending-bg: #fecaca;--hotspot-pending-border: #b91c1c;--hotspot-pending-text: #1a1a1a;font-family:system-ui,-apple-system,Segoe UI,sans-serif}:root[data-theme=dark]{color-scheme:dark;--border: #3a3f4b;--bg-panel: #1c1f26;--bg-page: #14161b;--bg-elevated: #22252d;--text: #e5e7eb;--muted: #9aa1ac;--accent: #60a5fa;--accent-soft: #1e3a5f;--danger: #f87171;--unsaved: #fbbf24;--stage-a: #1a1c22;--stage-b: #202329;--hotspot-bg: #eab308;--hotspot-border: #fde68a;--hotspot-row-match-bg: #fb923c;--row-match-soft: #7c2d12;--hotspot-pending-bg: #7f1d1d;--hotspot-pending-border: #fca5a5;--hotspot-pending-text: #fecaca}.unsaved-dot{color:var(--unsaved)}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:var(--bg-page);color:var(--text)}#app{display:grid;grid-template-columns:var(--images-w, 220px) 6px 1fr 6px var(--inspector-w, 320px);grid-template-rows:auto 1fr;grid-template-areas:"toolbar   toolbar   toolbar toolbar   toolbar" "images    divider-l stage   divider-r inspector";height:100vh}.panel-divider{position:relative;cursor:col-resize;touch-action:none}#divider-images{grid-area:divider-l}#divider-inspector{grid-area:divider-r}.panel-divider:after{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;background:var(--border)}.panel-divider:hover:after,.panel-divider.dragging:after{left:0;width:100%;background:var(--accent)}.toolbar{grid-area:toolbar;position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;padding:.5rem 1rem;border-bottom:1px solid var(--border);background:var(--bg-panel)}.toolbar h1{font-size:1rem;margin:0 1rem 0 0;white-space:nowrap;flex-shrink:0}.toolbar .spacer{flex:1}.panel-images{grid-area:images;overflow-y:auto;padding:.5rem;background:var(--bg-page)}.panel-images ul{list-style:none;margin:0;padding:0}.panel-images li{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.4rem .5rem;border-radius:4px;cursor:pointer;font-size:.85rem}.image-list-name{word-break:break-word}.panel-images li.active{background:var(--accent);color:#fff}.image-list-delete{flex-shrink:0;border:none;background:none;padding:0 .3rem;border-radius:3px;font-size:1rem;line-height:1.4;color:#b91c1c;cursor:pointer}.image-list-delete:hover:not(:disabled){background:#b91c1c26}.image-list-delete:disabled{cursor:not-allowed;opacity:.4}.panel-images li.active .image-list-delete{color:#fecaca}.panel-images li.active .image-list-delete:hover:not(:disabled){background:#fff3}.image-folder{margin-top:.5rem}.image-folder-name{padding:.3rem .5rem;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}.image-folder .image-list li{padding-left:1.25rem}.mobile-tabs{display:none;grid-area:tabs;gap:.25rem;padding:.4rem;border-bottom:1px solid var(--border);background:var(--bg-panel)}.mobile-tab-btn{flex:1}.mobile-tab-btn.active,.mobile-tab-btn.active:hover,.mobile-tab-btn.active:focus-visible{background:var(--accent);color:#fff;border-color:var(--accent)}.stage{grid-area:stage;position:relative;overflow:hidden}.stage-scroll{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;background:repeating-conic-gradient(var(--stage-a) 0% 25%,var(--stage-b) 0% 50%) 50% / 20px 20px;display:flex;align-items:flex-start}.stage-sizer{position:relative;flex:none;margin:0 auto}.stage-inner{position:absolute;top:0;left:0;transform-origin:top left}.zoom-controls{position:absolute;right:12px;bottom:12px;z-index:10;display:flex;align-items:center;gap:.25rem;background:var(--bg-elevated);border:1px solid var(--border);border-radius:6px;padding:.25rem;box-shadow:0 2px 6px #00000026}.zoom-controls button{padding:.2rem .5rem}.zoom-controls .zoom-pct{font-size:.75rem;min-width:3.2em;text-align:center;color:var(--muted)}.instance-nav{position:absolute;left:12px;bottom:12px;z-index:10;display:flex;align-items:center;gap:.4rem;background:var(--bg-elevated);border:1px solid var(--border);border-radius:6px;padding:.25rem .4rem;box-shadow:0 2px 6px #00000026;font-size:.8rem}.instance-nav button{padding:.2rem .6rem;line-height:1;font-size:1rem}.instance-nav span{min-width:5em;text-align:center;color:var(--muted)}.stage-inner img{display:block;max-width:none;cursor:none;touch-action:none}.stage-scroll.panning,.stage-scroll.panning *{cursor:grabbing!important}.crosshair-h,.crosshair-v,.crosshair-box{display:none;position:absolute;pointer-events:none}.crosshair-h{left:0;right:0;height:0;border-top:1px solid #ff3b30;z-index:6}.crosshair-v{top:0;bottom:0;width:0;border-left:1px solid #ff3b30;z-index:6}.crosshair-box{border:1px dashed #ff3b30;border-radius:3px;box-sizing:border-box;z-index:5}.hotspot{position:absolute;transform:translate(-50%,-50%);background:var(--hotspot-bg);border:1px solid var(--hotspot-border);color:#1a1a1a;border-radius:3px;padding:1px 5px;cursor:move;white-space:nowrap;touch-action:none;box-shadow:0 1px 2px #0000004d;-webkit-user-select:none;user-select:none}.hotspot.dragging{opacity:.75;box-shadow:0 2px 6px #0006}.hotspot.pending{cursor:default;background:var(--hotspot-pending-bg);border-color:var(--hotspot-pending-border);color:var(--hotspot-pending-text)}.hotspot.editing{outline:2px solid var(--accent);outline-offset:1px}.hotspot.row-match{background:var(--hotspot-row-match-bg);color:#1a1a1a}.editing-balloon{position:absolute;transform:translate(-50%,-100%);color:#fff;font-size:.7rem;font-weight:600;line-height:1;white-space:nowrap;padding:2px 6px;border-radius:3px;opacity:.85;box-shadow:0 1px 3px #00000059;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:6}tr.clickable-row{cursor:pointer}tr.clickable-row:hover{background:var(--bg-panel)}tr.clickable-row.editing{background:var(--accent-soft)}tr.clickable-row.row-match{background:var(--row-match-soft)}.inspector{grid-area:inspector;overflow-y:auto;padding:.75rem;display:flex;flex-direction:column;gap:1rem;background:var(--bg-page)}.inspector section h2{font-size:.85rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);margin:0 0 .5rem}.field{display:flex;flex-direction:column;gap:.2rem;margin-bottom:.5rem}.field label{font-size:.75rem;color:var(--muted)}.field input,.field textarea,.field select{padding:.35rem .5rem;border:1px solid var(--border);border-radius:4px;font:inherit;background:var(--bg-elevated);color:var(--text)}.radio-option{display:flex;align-items:center;gap:.4rem;font-size:.85rem;color:var(--text);cursor:pointer}.radio-option input{cursor:pointer}.cart-recipe{margin:.75rem 0;border:1px solid var(--border);border-radius:4px;padding:.5rem .75rem}.cart-recipe summary{cursor:pointer;font-size:.8rem;color:var(--muted)}.cart-recipe[open] summary{margin-bottom:.5rem}.cart-recipe .field{width:auto}.extra-pairs{display:flex;flex-direction:column;gap:.3rem}.extra-pair{display:flex;gap:.3rem}.extra-pair .extra-key{flex:0 0 40%;min-width:0}.extra-pair .extra-value{flex:1 1 auto;min-width:0}.btn-remove-pair{flex:0 0 auto;padding:.35rem .5rem;line-height:1;color:#b91c1c;border-color:#b91c1c}.extra-field-actions{display:flex;gap:.5rem;margin-top:.35rem}.extra-field-actions button{font-size:.8rem;padding:.25rem .5rem}button{padding:.35rem .75rem;border:1px solid var(--border);border-radius:4px;background:var(--bg-elevated);color:var(--text);cursor:pointer;font:inherit;white-space:nowrap;flex-shrink:0;transition:background-color .1s ease,border-color .1s ease}button:hover:not(:disabled),button:focus-visible:not(:disabled){background:var(--bg-panel);border-color:var(--accent)}button:focus-visible:not(:disabled){outline:none}button:disabled{opacity:.5;cursor:not-allowed}table{width:100%;border-collapse:collapse;font-size:.8rem}th,td{border-bottom:1px solid var(--border);padding:.3rem .4rem;text-align:left}th{position:relative}td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.col-resize-handle{position:absolute;top:0;right:-4px;width:8px;height:100%;cursor:col-resize;z-index:1;touch-action:none}.col-resize-handle:hover,.col-resize-handle.dragging{background:var(--accent);opacity:.5}.table-scroll{max-height:18rem;overflow:auto}.table-scroll thead th{position:sticky;top:0;background:var(--bg-page)}td.extra-cell{position:relative}.extra-cell .cell-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(hover:hover){td.extra-cell:hover{overflow:visible}td.extra-cell:hover .cell-text{position:absolute;top:-1px;right:-1px;z-index:20;display:block;width:max-content;max-width:18rem;white-space:normal;background:#fef9c3;color:#1a1a1a;border:1px solid #eab308;border-radius:4px;padding:.3rem .5rem;box-shadow:0 4px 12px #00000059}}.hint{font-size:.75rem;color:var(--muted)}.notice{margin:0 0 .75rem;padding:.5rem .75rem;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:4px;font-size:.8rem;line-height:1.4}.collab-status{font-size:.8rem;white-space:nowrap}.collab-presence{display:flex;align-items:center;gap:.25rem}.presence-avatar{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:50%;color:#fff;font-size:.7rem;font-weight:600;line-height:1;box-shadow:0 0 0 2px var(--bg-panel);-webkit-user-select:none;user-select:none}.presence-avatar-me{box-shadow:0 0 0 2px var(--accent)}.error{color:var(--danger);font-size:.8rem}.search-panel{position:absolute;top:100%;right:12px;z-index:50;background:var(--bg-page);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px #00000040;padding:.75rem;width:26rem;max-width:calc(100vw - 2rem);max-height:70vh;display:flex;flex-direction:column;gap:.5rem}.search-controls{display:flex;gap:.4rem;flex-shrink:0}.search-controls input{flex:1;min-width:0;padding:.35rem .5rem;border:1px solid var(--border);border-radius:4px;font:inherit;background:var(--bg-elevated);color:var(--text)}#lang-select,.search-controls select{padding:.35rem .5rem;border:1px solid var(--border);border-radius:4px;font:inherit;background:var(--bg-elevated);color:var(--text);max-width:10rem}.search-results{overflow-y:auto}.search-results ul{list-style:none;margin:0;padding:0}.search-results li{padding:.4rem .5rem;border-radius:4px;cursor:pointer;font-size:.85rem;line-height:1.4}.search-results li:hover{background:var(--bg-panel)}.confirm-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:1000;overflow-y:auto;padding:2rem 1rem;display:flex;justify-content:center}.confirm-box{background:var(--bg-page);border-radius:8px;padding:1.25rem;max-width:min(26rem,calc(100vw - 2rem));margin:auto 0;box-shadow:0 8px 24px #00000040}.confirm-box p{margin:0 0 1rem;white-space:pre-line;font-size:.9rem}.confirm-box h2{font-size:1rem;margin:0 0 .75rem}.confirm-box .field{width:22rem;max-width:100%}.confirm-actions{display:flex;align-items:center;justify-content:flex-end;gap:.5rem}.settings-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin:0 0 .75rem}.settings-tabs button,.settings-tabs button:hover:not(:disabled),.settings-tabs button:focus-visible:not(:disabled){border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);padding:.35rem .75rem;margin-bottom:-1px}.settings-tabs button:hover:not(:disabled){color:var(--text)}.settings-tabs button.on,.settings-tabs button.on:hover:not(:disabled){color:var(--text);border-bottom-color:var(--accent);font-weight:600}.wtb-intro{margin:0 0 .75rem;max-width:22rem}.wtb-site-list{list-style:none;margin:.2rem 0 .4rem;padding:0;border:1px solid var(--border);border-radius:4px}.wtb-site-row{display:flex;align-items:center;gap:.45rem;padding:.35rem .45rem;border-top:1px solid var(--border)}.wtb-site-row:first-child{border-top:0}.wtb-site-row.off .wtb-site-text{opacity:.45}.wtb-swatch{flex:none;width:.75rem;height:.75rem;border-radius:3px}.wtb-site-text{flex:1;min-width:0;display:flex;flex-direction:column}.wtb-site-name{font-size:.85rem;color:var(--text)}.wtb-site-url{font-size:.7rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wtb-site-btns{flex:none;display:flex;gap:.2rem}.wtb-site-btns button{padding:.1rem .4rem;font-size:.75rem}.wtb-site-edit{padding:.5rem .6rem .6rem;border-top:1px dashed var(--border);background:var(--bg-elevated)}.confirm-box .wtb-site-edit .field{width:auto}.wtb-site-edit input[type=color]{width:3rem;height:1.8rem;padding:.1rem}.wtb-list-actions{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:.3rem}.wtb-hint-warn{color:#b45309}:root[data-theme=dark] .wtb-hint-warn{color:#fbbf24}.wtb-try-list{list-style:none;margin:.3rem 0 0;padding:0;font-size:.72rem;color:var(--muted);max-width:22rem}.wtb-try-list li{padding:.15rem 0;overflow-wrap:anywhere}.wtb-try-list b{color:var(--text);font-weight:600}.collab-share-box{max-width:min(22rem,calc(100vw - 2rem))}.collab-share-qr{width:12rem;max-width:100%;margin:0 auto 1rem}.collab-share-qr svg{display:block;width:100%;height:auto;border-radius:4px}.collab-share-box .field textarea{font-size:.8rem;font-family:monospace;overflow-wrap:anywhere;resize:none}.collab-share-copy-feedback{margin-right:auto;min-height:1em}@media(max-width:860px){#app{grid-template-columns:1fr;grid-template-rows:auto auto 1fr;grid-template-areas:"toolbar" "tabs" "content"}.mobile-tabs{display:flex}.panel-divider{display:none}.panel-images,.stage,.inspector{grid-area:content;width:100%;min-width:0;display:none}#app[data-mobile-tab=images] .panel-images,#app[data-mobile-tab=stage] .stage,#app[data-mobile-tab=inspector] .inspector{display:block}.inspector section{overflow-x:auto}}.protect-box{width:24rem}.protect-box .hint{font-size:.75rem}.protect-cover-preview{display:block;max-width:100%;max-height:10rem;object-fit:contain;margin:.25rem 0;border:1px solid var(--border);border-radius:4px;background:var(--bg-panel)}.protect-strength-weak{color:var(--danger)}.protect-strength-strong{color:#15803d}.callout-mark{color:var(--accent);font-weight:600}.callout-add .hint{margin:.25rem 0 0}#btn-tour{min-width:2rem;font-weight:600}.tour-blocker{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1100}.tour-hole{position:fixed;z-index:1101;border-radius:8px;box-shadow:0 0 0 9999px #0000008c;outline:2px solid var(--accent);pointer-events:none;transition:left .15s,top .15s,width .15s,height .15s}.tour-card,.tour-offer{position:fixed;z-index:1102;box-sizing:border-box;max-height:calc(100vh - 24px);overflow-y:auto;padding:14px;background:var(--bg-elevated);color:var(--text);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 36px #00000059}.tour-offer{right:16px;bottom:16px;width:min(320px,calc(100vw - 32px));z-index:40}.tour-text{margin:0 0 12px;line-height:1.45}.tour-sign-delete{color:var(--danger);font-weight:600}.tour-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;color:var(--muted);font-size:12px}.tour-skip{border:0;background:none;padding:2px 4px;color:var(--muted);text-decoration:underline}.tour-skip:hover:not(:disabled){background:none;color:var(--text)}.tour-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.tour-next{background:var(--accent);border-color:var(--accent);color:#fff}.tour-next:hover:not(:disabled),.tour-next:focus-visible:not(:disabled){background:var(--accent);filter:brightness(1.1)}:root[data-theme=dark] .tour-next{color:#0b1220}.tour-figure{margin:0 0 12px}.tf{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.tf-frame{margin:0;padding:8px;display:flex;flex-direction:column;gap:8px;border:1px solid var(--border);border-radius:8px;background:var(--bg-panel)}.tf-frame figcaption{font-size:.8rem;line-height:1.35}.tf-n{display:inline-grid;place-items:center;width:1.3em;height:1.3em;margin-right:.35em;border-radius:50%;background:var(--accent);color:#fff;font-size:.75rem;font-weight:700}:root[data-theme=dark] .tf-n{color:#0b1220}.tf-picture{position:relative;height:56px;border-radius:4px;background:repeating-conic-gradient(var(--stage-a) 0 25%,var(--stage-b) 0 50%) 0 0 / 12px 12px}.tf-picture svg{position:absolute;top:4px;right:4px;bottom:4px;left:4px;width:calc(100% - 8px);height:calc(100% - 8px);fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round}.tf-marker{position:absolute;transform:translate(-50%,-50%);padding:0 5px;border:1px solid var(--hotspot-border);border-radius:3px;background:var(--hotspot-bg);color:#1a1a1a;font-size:.7rem;line-height:1.4;box-shadow:0 1px 2px #0000004d}.tf-marker.lit{background:var(--hotspot-row-match-bg);outline:2px solid var(--accent)}.tf-table{font-size:.7rem;background:var(--bg-page)}.tf-table th,.tf-table td{padding:2px 4px;border-bottom:1px solid var(--border);text-align:left;white-space:nowrap}.tf-table th{color:var(--muted);font-weight:500}.tf-table tr.editing{background:var(--accent-soft)}.tf-table tr.row-match{background:var(--row-match-soft)}.tf-form{display:flex;flex-direction:column;gap:6px;padding:6px;border-radius:4px;background:var(--bg-page)}.tf-form>span:not(.tf-button){height:8px;border-radius:3px;background:var(--border)}.tf-form>span:last-child{width:55%}.tf-button{position:relative;align-self:flex-start;padding:3px 8px;border:1px solid var(--accent);border-radius:4px;background:var(--bg-elevated);font-size:.75rem;white-space:nowrap;box-shadow:0 0 0 3px var(--accent-soft)}.tf-cursor{position:absolute;right:-6px;bottom:-14px;width:14px;height:18px;fill:var(--text);stroke:var(--bg-page);stroke-width:1.2}.tf-caret{display:inline-block;width:1px;height:.9em;margin-left:1px;vertical-align:-.1em;background:var(--text);animation:tf-blink 1s steps(1) infinite}@keyframes tf-blink{50%{opacity:0}}@media(prefers-reduced-motion:reduce){.tf-caret{animation:none}.tour-hole{transition:none}}.tf-note{margin:10px 0 0;color:var(--muted);font-size:.8rem;line-height:1.4}.ecm-tip{position:fixed;z-index:1200;max-width:min(340px,calc(100vw - 16px));padding:5px 9px;border:1px solid var(--border);border-radius:6px;background:var(--bg-elevated);color:var(--text);box-shadow:0 6px 18px #0000002e;font-size:.8rem;line-height:1.35;white-space:pre-line;pointer-events:none}
