:root{font-family:Segoe UI,system-ui,-apple-system,sans-serif;line-height:1.5;font-weight:400;color:#2b2f33;background:#eef1f4;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input{font:inherit}.app{height:100vh;display:flex;flex-direction:column;overflow:hidden}.app-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid #dde2e8}.brand{display:flex;flex-direction:column;gap:.15rem}.brand-mark{font-size:1.35rem;font-weight:700;letter-spacing:.22em}.brand-sub{font-size:.85rem;color:#6b7280}.header-actions{display:flex;align-items:center;gap:.75rem}.header-actions .header-revert-btn,.header-actions .header-upload-btn{padding:.45rem .85rem;font-size:.9rem;white-space:nowrap}.credit-chip{background:rgba(201,162,39,.12);border:1px solid rgba(201,162,39,.35);border-radius:999px;color:#8a6d1a}.credit-chip,.user-chip{display:inline-flex;align-items:center;padding:.45rem .9rem;font-size:.85rem;font-weight:600;white-space:nowrap}.user-chip{gap:.5rem;background:#f4f6f8;border:1px solid #dde2e8;border-radius:999px;color:#374151;max-width:240px;overflow:hidden;text-overflow:ellipsis}.logout-btn{border:1px solid #cfd6de;background:#fff;color:#4b5563;padding:.55rem 1rem;border-radius:999px;cursor:pointer;font-weight:600}.logout-btn:hover{border-color:#c9a227;color:#8a6f1a}.export-btn{border:none;background:#c9a227;color:#fff;padding:.65rem 1.1rem;border-radius:999px;cursor:pointer;font-weight:600}.export-btn:disabled{opacity:.6;cursor:not-allowed}.export-menu{position:relative}.export-menu-dropdown{position:absolute;top:calc(100% + .35rem);right:0;min-width:100%;background:#fff;border:1px solid #dde2e8;border-radius:.75rem;box-shadow:0 8px 24px rgba(15,23,42,.12);overflow:hidden;z-index:20}.export-menu-item{display:block;width:100%;border:none;background:transparent;color:#1a1a1a;padding:.65rem 1rem;text-align:left;font-weight:600;cursor:pointer}.export-menu-item:hover{background:#f4f6f8}.export-menu-item+.export-menu-item{border-top:1px solid #eef1f4}.app-main{flex:1 1;flex-direction:row;gap:1rem;padding:1rem 1.5rem 1.5rem;align-items:stretch}.app-main,.app-sidebar{display:flex;min-height:0;overflow:hidden}.app-sidebar{width:420px;flex-shrink:0;flex-direction:column;gap:.75rem}.app-sidebar-slot{display:flex;flex-direction:column;flex:1 1;min-height:0}.app-sidebar-slot.is-hidden{display:none}.sidebar-project-card{background:rgba(201,162,39,.08);border:1px solid rgba(201,162,39,.35);border-left:4px solid #c9a227;border-radius:12px;box-shadow:0 1px 2px rgba(43,47,51,.05);padding:.55rem .75rem;display:flex;flex-direction:column;align-items:stretch;gap:.35rem;flex-shrink:0;min-width:0}.sidebar-project-card-row{display:flex;align-items:center;justify-content:space-between;gap:.6rem;min-width:0}.sidebar-project-back-btn{padding:.35rem .65rem;font-size:.85rem;flex-shrink:0;background:#fff}.sidebar-project-card-info{flex:1 1;min-width:0}.sidebar-project-card-actions{justify-content:flex-start}.sidebar-project-card .render-history-open-btn{display:inline-flex;align-items:center;gap:.35rem;flex-shrink:0;font-size:.78rem;padding:.25rem .65rem;font-weight:600;border-radius:999px}.render-history-icon{flex-shrink:0;opacity:.75}.sidebar-project-card-name{display:block;width:100%;border:none;background:none;padding:.2rem .25rem;margin:0;text-align:left;cursor:pointer;font:inherit;font-size:.9rem;font-weight:600;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-project-card-name:hover:not(:disabled){color:#8a6f1a}.sidebar-project-card-name:disabled{opacity:.7;cursor:wait}.sidebar-project-card-name-static{cursor:default}.sidebar-project-card-name-static:hover{color:#1f2937}.sidebar-project-card-name-input{width:100%;box-sizing:border-box;border:1px solid #cfd6de;border-radius:8px;padding:.2rem .45rem;font:inherit;font-size:.9rem;font-weight:600;color:#1f2937;background:#fff;min-height:1.65rem;text-align:left}.sidebar-project-card-name-input:focus{outline:none;border-color:#c9a227;box-shadow:0 0 0 2px rgba(201,162,39,.2)}.sidebar-project-card .project-save-status{flex-shrink:0}.config-panel{background:#fff;border-radius:12px;border:1px solid #dde2e8;flex:1 1;min-height:0;overflow:hidden}.config-grid,.config-panel{display:flex;flex-direction:column}.config-grid{gap:.85rem;padding:1rem;flex:1 1;overflow-y:auto}.config-grid>*{flex-shrink:0}.config-accordion{border:1px solid #eef1f4;border-radius:8px;overflow:hidden}.config-accordion-summary{display:flex;justify-content:space-between;align-items:center;padding:.55rem .75rem;cursor:pointer;font-size:.88rem;font-weight:700;color:#374151;background:#fafbfc;list-style:none}.config-accordion-summary::-webkit-details-marker{display:none}.config-accordion-summary:after{content:"▾";font-size:.75rem;color:#9aa3ad;transition:transform .15s ease}.config-accordion[open]>.config-accordion-summary:after{transform:rotate(180deg)}.config-accordion-body{padding:.65rem .75rem .75rem;border-top:1px solid #eef1f4}.photo-stage-section{flex:1 1;display:flex;flex-direction:column;min-width:0;min-height:0}.stage-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem 0;margin-bottom:.75rem}.toolbar-group{display:inline-flex;align-items:center;gap:.5rem;padding:.35rem .85rem;border-left:1px solid #e2e8f0}.toolbar-group:first-child{border-left:none;padding-left:0}.toolbar-group--grow{flex:1 1;min-width:0}.toolbar-group-label{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#9ca3af;white-space:nowrap;flex-shrink:0}.toolbar-group-controls{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.45rem}.stage-statusbar{flex-basis:100%;min-width:0;margin-top:.35rem;padding:.35rem .65rem;border-radius:6px;background:#f8fafc;border:1px solid #e8edf2;color:#6b7280;font-size:.85rem;line-height:1.4}.stage-statusbar:before{content:"ℹ";margin-right:.4rem;color:#9ca3af;font-size:.78rem}.stage-view-overlay{position:absolute;top:12px;right:12px;z-index:10;display:flex;flex-direction:column;align-items:stretch;gap:.4rem;background:rgba(255,255,255,.92);border-radius:10px;padding:.35rem;box-shadow:0 2px 8px rgba(0,0,0,.12);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:auto}.stage-view-overlay .reset-btn,.stage-view-overlay .zoom-btn{padding:.4rem .65rem;font-size:.85rem}.stage-view-overlay .pan-mode-btn{justify-content:center}.stage-view-overlay .zoom-100-btn{justify-content:center;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;font-weight:600}.reset-btn,.upload-btn{display:inline-flex;align-items:center;padding:.55rem 1rem;background:#fff;border:1px solid #cfd6de;border-radius:8px;cursor:pointer;font-weight:600}.reset-btn{color:#4b5563}.reset-btn.active{border-color:#c9a227;color:#8a6f1a;background:#fff9e6}.stage-hint{color:#6b7280;font-size:.92rem}.reset-btn:disabled{opacity:.5;cursor:not-allowed}.photo-stage.manual-mode{cursor:default}.photo-stage.manual-mode[data-zoom=true]{overflow:hidden}.photo-stage.manual-mode[data-zoom=true][data-pan-mode=true]{cursor:-webkit-grab;cursor:grab}.photo-stage.manual-mode[data-zoom=true][data-pan-mode=true]:active{cursor:-webkit-grabbing;cursor:grabbing}.photo-stage-transform{position:absolute;inset:0;transform-origin:center center;will-change:transform}.quad-warning{margin:0 0 .5rem;padding:.55rem .85rem;background:#fef3c7;border:1px solid #f59e0b;border-radius:8px;color:#92400e;font-size:.88rem;font-weight:600}.corner-handle.snapped{background:#22c55e;border-color:#fff;box-shadow:0 0 0 3px rgba(34,197,94,.35)}.precision-magnifier{position:absolute;width:80px;height:80px;border-radius:50%;border:3px solid #c9a227;box-shadow:0 4px 16px rgba(0,0,0,.25);pointer-events:none;z-index:10;background:#fff}.config-group.fine-tune label{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.5rem;font-size:.85rem}.config-group.fine-tune input[type=range]{width:100%;accent-color:#c9a227}.perspective-presets{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.85rem}.preset-btn{padding:.3rem .6rem;border:1px solid #cfd6de;border-radius:6px;background:#fff;font-size:.78rem;font-weight:600;color:#4b5563;cursor:pointer}.preset-btn:hover{border-color:#c9a227;color:#8a6f1a}.corner-sliders{padding:.65rem 0;border-top:1px solid #eef1f4}.corner-sliders:first-of-type{border-top:none;padding-top:0}.corner-slider-label{font-size:.82rem;font-weight:700;color:#374151}.corner-role,.corner-slider-label{display:block;margin-bottom:.35rem}.corner-role{font-size:.72rem;font-weight:500;font-style:normal;color:#8a6f1a}.product-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:.65rem;gap:.65rem}.product-card{display:flex;flex-direction:column;gap:.2rem;padding:.5rem .65rem;border:1px solid #dde2e8;border-radius:10px;background:#fff;cursor:pointer;text-align:left}.product-card.selected{border-color:#c9a227;box-shadow:inset 0 0 0 1px #c9a227;background:#fff9e6}.product-card-title{font-size:.88rem;font-weight:700;color:#2b2f33}.product-card-desc{font-size:.75rem;color:#6b7280}.corner-accordion{border:1px solid #eef1f4;border-radius:8px;margin-bottom:.5rem;overflow:hidden}.corner-accordion-summary{display:flex;justify-content:space-between;align-items:center;padding:.55rem .75rem;cursor:pointer;font-size:.82rem;font-weight:700;color:#374151;background:#fafbfc;list-style:none}.corner-accordion-summary::-webkit-details-marker{display:none}.corner-coords{font-size:.72rem;font-weight:500;color:#6b7280}.corner-accordion-body{padding:.5rem .75rem .75rem;border-top:1px solid #eef1f4}.zoom-controls{display:flex;flex-direction:column;align-items:stretch;border:1px solid #cfd6de;border-radius:8px;overflow:hidden}.zoom-controls .zoom-btn{border-radius:0;padding:.55rem .65rem;border:none;border-bottom:1px solid #cfd6de;justify-content:center}.zoom-controls .zoom-btn:last-child{border-bottom:none}.zoom-controls .zoom-reset{font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.config-group.fine-tune label.locked{opacity:.55}.config-group.fine-tune label.locked input[type=range]{accent-color:#9aa3ad}.stage-hint.loading{color:#8a6f1a;font-weight:600}.photo-stage.detect-mode{cursor:crosshair}.detection-overlay{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;background:rgba(15,23,42,.45);color:#fff;font-size:.95rem;font-weight:600;text-align:center;padding:1rem}.detection-spinner{width:36px;height:36px;border:3px solid rgba(255,255,255,.25);border-top-color:#c9a227;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(1turn)}}.config-group.detection-info label{display:flex;flex-direction:column;gap:.35rem;margin-top:.75rem;font-size:.92rem}.config-group.detection-info input[type=range]{width:100%;accent-color:#c9a227}.readonly-value{margin:0;font-size:.95rem;color:#374151}.field-hint{margin:.5rem 0 0;font-size:.82rem;color:#6b7280;line-height:1.4}.photo-stage-viewport{position:relative;flex:1 1;min-height:0;background:#e4e8ec;border-radius:12px;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}.photo-dropzone,.photo-stage-viewport{display:flex;align-items:center;justify-content:center}.photo-dropzone{flex-direction:column;gap:.5rem;width:min(520px,calc(100% - 3rem));min-height:280px;padding:2.5rem 2rem;border:2px dashed #b8c0ca;border-radius:16px;background:#fff;color:#374151;cursor:pointer;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;text-align:center}.photo-dropzone.drag-over,.photo-dropzone:hover{border-color:#c9a227;background:#fffdf5;box-shadow:0 8px 32px rgba(201,162,39,.12)}.photo-dropzone:focus-visible{outline:2px solid #c9a227;outline-offset:3px}.photo-dropzone-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:#fff9e6;color:#8a6f1a;font-size:1.75rem;font-weight:700;line-height:1;margin-bottom:.25rem}.photo-dropzone-title{font-size:1.15rem;font-weight:700;color:#1f2937}.photo-dropzone-hint{font-size:.95rem;color:#6b7280;max-width:28rem;line-height:1.45}.photo-dropzone-formats{font-size:.82rem;color:#9ca3af;margin-top:.25rem}.photo-stage{position:relative;overflow:visible;box-shadow:0 4px 24px rgba(0,0,0,.12)}.stage-photo{width:100%;height:100%;object-fit:fill;display:block;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:8px}.corner-overlay{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}@keyframes guide-focus-pulse{0%,to{box-shadow:0 0 0 0 rgba(201,162,39,.55)}50%{box-shadow:0 0 0 6px rgba(201,162,39,0)}}.guide-focus{animation:guide-focus-pulse 1.8s ease-in-out infinite;border-color:#c9a227!important;position:relative;z-index:5}@media (prefers-reduced-motion:reduce){.guide-focus{animation:none;box-shadow:0 0 0 2px rgba(201,162,39,.55)}}.photo-stage.guide-focus-stage{animation:guide-focus-stage-pulse 1.8s ease-in-out infinite}@keyframes guide-focus-stage-pulse{0%,to{box-shadow:inset 0 0 0 2px rgba(201,162,39,.45)}50%{box-shadow:inset 0 0 0 4px rgba(201,162,39,.15)}}@media (prefers-reduced-motion:reduce){.photo-stage.guide-focus-stage{animation:none;box-shadow:inset 0 0 0 2px rgba(201,162,39,.55)}}.photo-stage.placement-mode{cursor:crosshair}.placement-handle{pointer-events:none;cursor:crosshair}.placement-panel-hint{margin:0 0 .75rem;padding:.65rem .75rem;border-radius:8px;background:rgba(201,162,39,.12);border:1px solid rgba(201,162,39,.35);color:#3d3420;font-size:.88rem;line-height:1.45}.corner-handle{position:absolute;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;border:2px solid #fff;background:#c9a227;box-shadow:0 2px 8px rgba(0,0,0,.25);cursor:-webkit-grab;cursor:grab;z-index:3;padding:0;display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:700;color:#fff;line-height:1}.corner-handle.active{cursor:-webkit-grabbing;cursor:grabbing;transform:scale(1.15)}.corner-handle.out-of-bounds,.section-move-handle.out-of-bounds{opacity:.85;border-style:dashed}.section-move-handle{width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;border:2px solid #c9a227;background:#fff;cursor:move;display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:700;color:#c9a227;line-height:1}.section-move-handle,.vp-handle{position:absolute;box-shadow:0 2px 8px rgba(0,0,0,.25);z-index:3;padding:0}.vp-handle{width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:2px;border:2px solid #fff;background:#c9a227;cursor:-webkit-grab;cursor:grab;transform:rotate(45deg)}.vp-handle.active{cursor:-webkit-grabbing;cursor:grabbing}.photo-stage.manual-mode.guide-line-mode,.photo-stage.manual-mode.guide-line-mode[data-zoom=true],.photo-stage.manual-mode.reference-mode,.photo-stage.manual-mode.reference-mode[data-zoom=true]{cursor:crosshair}.photo-stage.manual-mode.eraser-mode[data-zoom=true][data-pan-mode=true],.photo-stage.manual-mode.guide-line-mode[data-zoom=true][data-pan-mode=true],.photo-stage.manual-mode.reference-mode[data-zoom=true][data-pan-mode=true]{cursor:-webkit-grab;cursor:grab}.photo-stage.manual-mode.eraser-mode[data-zoom=true][data-pan-mode=true]:active,.photo-stage.manual-mode.guide-line-mode[data-zoom=true][data-pan-mode=true]:active,.photo-stage.manual-mode.reference-mode[data-zoom=true][data-pan-mode=true]:active{cursor:-webkit-grabbing;cursor:grabbing}.photo-stage.eraser-mode[data-zoom=true][data-pan-mode=true] .eraser-brush-layer{pointer-events:none}.stage-view-overlay .pan-mode-btn{padding:.4rem .5rem}.stage-view-overlay .pan-mode-btn svg{display:block}.stage-view-overlay .history-controls{display:flex;gap:.35rem}.stage-view-overlay .history-btn{justify-content:center;padding:.4rem .5rem}.stage-view-overlay .history-btn svg{display:block}.stage-view-overlay .history-btn:disabled{opacity:.45;cursor:not-allowed}.placement-toolbar{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.placement-step-guide{position:absolute;top:12px;left:12px;z-index:12;display:flex;align-items:center;gap:.65rem;padding:.5rem .65rem;background:rgba(255,255,255,.92);border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.12);pointer-events:none}.placement-step-indicator{display:flex;flex-direction:column;gap:.35rem}.placement-step-indicator span{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:999px;font-size:.75rem;font-weight:700;color:#6b7280;background:#f3f4f6;border:1px solid #e5e7eb}.placement-step-indicator span.active{color:#fff;background:#c9a227;border-color:#c9a227}.placement-step-indicator span.done{color:#8a6f1a;background:#fff9e6;border-color:#c9a227}.stage-view-overlay .pan-mode-btn.active{background:#c9a227;border-color:#c9a227;color:#fff}.reference-toolbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.reference-help-btn{width:1.6rem;min-width:1.6rem;padding:.25rem 0;justify-content:center;text-align:center;font-weight:700}.reference-help-popover{position:absolute;top:.75rem;left:50%;transform:translateX(-50%);z-index:30;max-width:320px;padding:.85rem 1rem;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px rgba(15,23,42,.12);pointer-events:auto}.reference-help-title{margin:0 0 .5rem;font-size:.9rem;font-weight:700;color:#1e293b}.reference-help-steps{margin:0;padding-left:1.2rem;font-size:.82rem;line-height:1.45;color:#334155}.reference-help-steps li+li{margin-top:.35rem}.reference-help-dismiss{display:block;margin-top:.65rem;margin-left:auto}.reference-height-label{display:flex;align-items:center;gap:.35rem;font-size:.85rem}.reference-height-label input{width:5.5rem;padding:.25rem .4rem}.field-message-calibrated{color:#558b2f}.guide-line-toolbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.guide-color-swatches{display:flex;align-items:center;gap:.35rem}.guide-color-swatch{width:20px;height:20px;border-radius:50%;border:2px solid rgba(0,0,0,.15);padding:0;cursor:pointer;flex-shrink:0}.guide-color-swatch.selected{border-color:#1f2937;box-shadow:0 0 0 2px #fff,0 0 0 4px #c9a227}.guide-edit-handle{position:absolute;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;border:2px solid #1f2937;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.25);cursor:-webkit-grab;cursor:grab;z-index:4;padding:0}.guide-edit-handle.rotate{border-radius:4px;transform:rotate(45deg)}.guide-edit-handle.active{cursor:-webkit-grabbing;cursor:grabbing;transform:scale(1.12)}.guide-edit-handle.rotate.active{transform:rotate(45deg) scale(1.12)}.section-move-handle.active{cursor:-webkit-grabbing;cursor:grabbing;transform:scale(1.15)}.warp-layer{position:absolute;inset:0;pointer-events:none;z-index:2}.warp-layer canvas,.warp-layer>div{width:100%!important;height:100%!important}.eraser-enter-btn{border-color:#e57373;color:#c62828}.eraser-enter-btn:hover:not(:disabled){background:#fff5f5}.eraser-toolbar{flex-wrap:wrap;gap:.5rem;padding:.35rem .65rem;background:#fff5f5;border:1px solid #ffcdd2;border-radius:8px}.eraser-brush-label,.eraser-toolbar{display:inline-flex;align-items:center}.eraser-brush-label{gap:.45rem;font-size:.85rem;font-weight:600;color:#4b5563;min-width:140px}.eraser-brush-label input[type=range]{flex:1 1;min-width:80px;accent-color:#e57373}.eraser-hint-input{min-width:220px;max-width:320px;padding:.35rem .55rem;border:1px solid #ffcdd2;border-radius:6px;font-size:.85rem;color:#374151;background:#fff}.eraser-hint-input:disabled{opacity:.6;cursor:not-allowed}.eraser-hint-input::placeholder{color:#9aa3ad}.eraser-apply-btn{border-color:#e57373;color:#c62828;background:#fff}.eraser-apply-btn:hover:not(:disabled){background:#ffebee}.photo-stage.eraser-mode{cursor:crosshair;overflow:hidden}.eraser-brush-layer{position:absolute;inset:0;width:100%;height:100%;z-index:4;touch-action:none;cursor:crosshair}.eraser-brush-cursor{position:absolute;transform:translate(-50%,-50%);border:1.5px solid rgba(255,60,60,.9);background:rgba(255,60,60,.15);border-radius:50%;pointer-events:none;z-index:5}.eraser-busy-overlay{position:absolute;z-index:10;flex-direction:column;gap:.75rem;background:rgba(20,23,30,.55);color:#fff;font-weight:600;pointer-events:none}.eraser-busy-overlay,.export-busy-overlay{inset:0;display:flex;align-items:center;justify-content:center}.export-busy-overlay{position:fixed;z-index:100;background:rgba(0,0,0,.45)}.export-busy-card{display:flex;flex-direction:column;align-items:center;gap:.85rem;padding:1.5rem 2rem;background:#fff;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.2);font-weight:600;color:#1f2937;min-width:220px;text-align:center}.preview-overlay{position:fixed;inset:0;z-index:110;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);padding:1.5rem}.preview-card{display:flex;flex-direction:column;align-items:stretch;gap:1rem;max-width:min(960px,96vw);max-height:92vh;padding:1.25rem;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.25)}.preview-title{margin:0;font-size:1.1rem;font-weight:700;color:#1f2937;text-align:center}.preview-image-wrap{flex:1 1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}.preview-image{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.12)}.preview-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.preview-actions .export-btn,.preview-actions .logout-btn{min-width:140px}.render-history-open-btn{font-weight:600}.render-history-drawer{display:flex;flex-direction:column;flex:1 1;min-height:0;padding:1rem 1rem 1.25rem;background:#fff;border:1px solid #dde2e8;border-radius:12px;box-shadow:0 1px 2px rgba(43,47,51,.05);overflow:hidden}.render-history-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:1rem;flex-shrink:0}.render-history-title{margin:0;font-size:1.05rem;font-weight:700;color:#1f2937}.render-history-close{flex-shrink:0}.render-history-empty{margin:0;font-size:.9rem;line-height:1.5;color:#6b7280}.render-history-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:.6rem;gap:.6rem;align-content:start;overflow-y:auto;flex:1 1;min-height:0}.render-history-card{display:flex;flex-direction:column;gap:.3rem;min-width:0}.render-history-thumb-wrap{position:relative;width:100%;aspect-ratio:4/3;border-radius:8px;overflow:hidden;background:#e5e7eb;border:1px solid #e5e7eb}.render-history-thumb{object-fit:cover;display:block}.render-history-thumb,.render-history-thumb-placeholder{width:100%;height:100%}.render-history-badge{position:absolute;top:.3rem;right:.3rem;padding:.1rem .35rem;font-size:.58rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-radius:4px;background:rgba(255,255,255,.92);color:#374151;pointer-events:none}.render-history-badge.is-ai{color:#92400e;box-shadow:inset 0 0 0 1px rgba(201,162,39,.45)}.render-history-meta{margin:0;font-size:.72rem;font-weight:600;color:#374151}.render-history-date,.render-history-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.render-history-date{font-size:.65rem;color:#9ca3af}.render-history-card-delete{position:absolute;top:.3rem;left:.3rem;z-index:2;display:flex;align-items:center;justify-content:center;width:1.65rem;height:1.65rem;padding:0;margin:0;border:none;border-radius:999px;background:rgba(15,23,42,.55);color:#fff;cursor:pointer;opacity:0;transition:opacity .15s ease,background .15s ease}.render-history-card-delete:hover{background:rgba(185,28,28,.9)}.render-history-card-delete:focus-visible{opacity:1;outline:2px solid #c9a227;outline-offset:2px}.render-history-card:focus-within .render-history-card-delete,.render-history-card:hover .render-history-card-delete{opacity:1}@media (hover:none){.render-history-card-delete{opacity:1}}.render-history-thumb-btn{display:block;width:100%;height:100%;padding:0;margin:0;border:none;background:transparent;cursor:zoom-in;border-radius:8px}.render-history-thumb-btn:focus-visible{outline:2px solid #c9a227;outline-offset:2px}.render-history-thumb-btn .render-history-thumb{width:100%;height:100%;object-fit:cover}.render-history-zoom-overlay{position:fixed;inset:0;z-index:115;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);padding:1.5rem}.render-history-zoom-card{display:flex;flex-direction:column;gap:.75rem;max-width:min(960px,96vw);max-height:92vh;padding:1.25rem;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.25)}.render-history-zoom-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.render-history-zoom-title{margin:0;font-size:1.1rem;font-weight:700;color:#1f2937}.render-history-zoom-image-wrap{flex:1 1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}.render-history-zoom-image{display:block;max-width:100%;max-height:82vh;width:auto;height:auto;object-fit:contain;border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.12)}.render-history-zoom-meta{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.5rem;font-size:.85rem;color:#6b7280}.render-history-zoom-meta .render-history-badge{position:static}.render-history-zoom-specs{display:flex;flex-direction:column;gap:.75rem;max-height:28vh;overflow-y:auto;padding:.25rem 0}.render-history-zoom-spec-block{border-top:1px solid #eef1f4;padding-top:.65rem}.render-history-zoom-spec-block:first-child{border-top:none;padding-top:0}.render-history-zoom-spec-heading{margin:0 0 .4rem;font-size:.82rem;font-weight:700;color:#374151}.render-history-zoom-spec-dl{margin:0}.render-history-zoom-spec-row{display:grid;grid-template-columns:minmax(0,38%) minmax(0,1fr);grid-gap:.35rem .75rem;gap:.35rem .75rem;font-size:.78rem;padding:.15rem 0}.render-history-zoom-spec-row dt{margin:0;color:#6b7280;font-weight:600}.render-history-zoom-spec-row dd{margin:0;color:#1f2937;font-weight:500;text-align:right}.render-history-zoom-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.export-spinner{width:36px;height:36px;border:3px solid rgba(201,162,39,.25);border-top-color:#c9a227;border-radius:50%;animation:spin .8s linear infinite}.config-tabs{display:flex;gap:1.25rem;padding:.85rem 1.25rem;border-bottom:1px solid #eef1f4;background:#fafbfc}.config-tab{font-size:.78rem;font-weight:700;letter-spacing:.08em;color:#9aa3ad}.config-tab.active{color:#2b2f33;box-shadow:inset 0 -3px 0 #c9a227;padding-bottom:.2rem}.config-group h3{margin:0 0 .75rem;font-size:.95rem}.option-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:.5rem;gap:.5rem}.option-cards.compact{grid-template-columns:repeat(2,minmax(0,1fr))}.option-card{display:flex;align-items:center;gap:.5rem;padding:.45rem .6rem;border:1px solid #dde2e8;border-radius:10px;background:#fff;cursor:pointer;text-align:left;font-size:.85rem}.option-card.selected{border-color:#c9a227;box-shadow:inset 0 0 0 1px #c9a227}.swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(0,0,0,.08);flex-shrink:0}.config-group.sliders label{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.85rem;font-size:.92rem}.config-group.sliders input[type=range]{width:100%;accent-color:#c9a227}.config-group.dimensions .dimension-field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.85rem;font-size:.92rem}.config-group.dimensions input[type=number]{width:100%;padding:.4rem .6rem;border:1px solid #cfd6de;border-radius:6px;font-size:.88rem}.config-group.dimensions .field-hint{font-size:.78rem;color:#6b7280}.config-group.dimensions .field-message{font-size:.78rem;color:#8a6f1a}.config-group.dimensions .field-message-error{color:#b45309}.config-group.dimensions .field-distribution{font-size:.85rem;font-weight:600;color:#374151}.panel-count-picker{display:flex;flex-direction:column;gap:.4rem}.panel-count-label{font-size:.85rem;font-weight:600;color:#374151}.panel-count-chips{display:flex;flex-wrap:wrap;gap:.4rem}.panel-count-chip{min-width:2rem;padding:.25rem .55rem;border:1px solid #cfd6de;border-radius:999px;background:#fff;font-size:.78rem;font-weight:600;color:#4b5563;cursor:pointer}.panel-count-chip.selected{background:#fdf6e3}.panel-count-chip.selected,.panel-count-chip:hover{border-color:#c9a227;color:#8a6f1a}.section-picker-row,.section-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}.section-toolbar-label{font-size:.78rem;font-weight:600;color:#6b7280}.section-toolbar-chips{display:flex;flex-wrap:wrap;gap:.35rem}.section-toolbar-chip{min-width:2rem;padding:.25rem .55rem;border:1px solid #cfd6de;border-radius:999px;background:#fff;font-size:.78rem;font-weight:600;color:#4b5563;cursor:pointer}.section-toolbar-chip.selected{background:#fdf6e3}.section-toolbar-chip.selected,.section-toolbar-chip:hover{border-color:#c9a227;color:#8a6f1a}.section-add-btn,.section-remove-btn{font-size:.78rem}.inactive-section-polygon{cursor:pointer;pointer-events:all}.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem;background:radial-gradient(1200px 600px at 80% -10%,rgba(201,162,39,.14),transparent 60%),#eef1f4}.auth-card{width:min(420px,100%);background:#fff;border:1px solid #dde2e8;border-radius:16px;box-shadow:0 12px 40px rgba(15,23,42,.08);padding:2.25rem 2rem}.auth-brand{display:flex;flex-direction:column;gap:.2rem;margin-bottom:1.75rem;text-align:center}.auth-brand-mark{font-size:1.5rem;font-weight:700;letter-spacing:.22em}.auth-brand-sub{font-size:.85rem;color:#6b7280}.auth-title{margin:0 0 1.25rem;font-size:1.15rem;font-weight:700;color:#1f2937;text-align:center}.auth-form{gap:.9rem}.auth-field,.auth-form{display:flex;flex-direction:column}.auth-field{gap:.3rem;font-size:.88rem;font-weight:600;color:#374151}.auth-field input{padding:.65rem .8rem;border:1px solid #cfd6de;border-radius:8px;font-size:.95rem;font-weight:400;color:#1f2937;background:#fff}.auth-field input:focus{outline:2px solid rgba(201,162,39,.55);outline-offset:1px;border-color:#c9a227}.auth-submit{margin-top:.35rem;border:none;background:#c9a227;color:#fff;padding:.7rem 1rem;border-radius:8px;cursor:pointer;font-weight:700;font-size:.95rem}.auth-submit:disabled{opacity:.6;cursor:not-allowed}.auth-error{margin:0;padding:.6rem .8rem;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;color:#b91c1c;font-size:.85rem;font-weight:600}.auth-switch{margin:1.25rem 0 0;font-size:.88rem;color:#6b7280;text-align:center}.auth-switch a{color:#8a6f1a;font-weight:700;text-decoration:none}.auth-switch a:hover{text-decoration:underline}.auth-lang{display:flex;justify-content:flex-end;margin-bottom:1rem}.lang-selector select{padding:.4rem .6rem;border:1px solid #cfd6de;border-radius:8px;background:#fff;color:#374151;font-size:.85rem;font-weight:600;cursor:pointer}.lang-selector select:focus-visible{outline:2px solid rgba(201,162,39,.55);outline-offset:1px;border-color:#c9a227}.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}@media (max-width:960px){.app-main{flex-direction:column}.app-sidebar{width:100%}.photo-stage-viewport{min-height:320px}.user-chip{display:none}}.app-main-gallery{display:block;overflow:auto}.projects-back-btn{border:1px solid #cfd6de;background:#fff;color:#374151;padding:.45rem .85rem;border-radius:999px;cursor:pointer;font-weight:600;white-space:nowrap}.projects-back-btn:hover{border-color:#c9a227;color:#8a6f1a}.project-save-status{font-size:.85rem;font-weight:600;white-space:nowrap}.project-save-status.is-saving{color:#6b7280}.project-save-status.is-saved{color:#15803d}.project-gallery{max-width:1200px;margin:0 auto;width:100%}.project-gallery-header{margin-bottom:1.25rem}.project-gallery-title{margin:0;font-size:1.5rem;font-weight:700;color:#1f2937}.project-gallery-empty{margin:.5rem 0 0;color:#6b7280;max-width:42rem}.project-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));grid-gap:1rem;gap:1rem}.project-card{position:relative;background:#fff;border:1px solid #dde2e8;border-radius:14px;overflow:hidden;min-height:220px}.project-card-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;border-style:dashed;border-color:#c9a227;background:rgba(201,162,39,.06);cursor:pointer;font:inherit;color:#8a6f1a;transition:background .15s ease,border-color .15s ease}.project-card-new:hover{background:rgba(201,162,39,.12);border-color:#b8921f}.project-card-new-icon{display:inline-flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:999px;background:rgba(201,162,39,.15);font-size:2rem;line-height:1}.project-card-new-label{font-weight:700}.project-card-open{display:block;width:100%;border:none;background:transparent;padding:0;text-align:left;cursor:pointer;font:inherit;color:inherit}.project-card-open:disabled{opacity:.7;cursor:wait}.project-card-thumb-wrap{aspect-ratio:4/3;background:#eef1f4;overflow:hidden}.project-card-thumb{width:100%;height:100%;object-fit:cover;display:block}.project-card-thumb-placeholder{width:100%;height:100%;background:linear-gradient(135deg,#eef1f4,#dde2e8)}.project-card-body{padding:.85rem .95rem 1rem}.project-card-name-btn{display:block;width:100%;border:none;background:none;padding:0;text-align:left;cursor:pointer;font:inherit;color:inherit}.project-card-name-btn:disabled{opacity:.7;cursor:wait}.project-card-name{margin:0;font-size:.98rem;font-weight:700;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-card-date{display:block;margin-top:.35rem;font-size:.82rem;color:#6b7280}.project-card-rename-input{width:100%;border:1px solid #cfd6de;border-radius:8px;padding:.35rem .5rem;font:inherit}.project-card-menu{position:absolute;top:.5rem;right:.5rem}.project-card-menu-btn{width:2rem;height:2rem;border:none;border-radius:999px;background:rgba(255,255,255,.92);box-shadow:0 2px 8px rgba(15,23,42,.12);cursor:pointer;font-weight:700;line-height:1}.project-card-menu-dropdown{position:absolute;top:calc(100% + .35rem);right:0;min-width:9rem;background:#fff;border:1px solid #dde2e8;border-radius:.75rem;box-shadow:0 8px 24px rgba(15,23,42,.12);overflow:hidden;z-index:5}.project-card-menu-item{display:block;width:100%;border:none;background:transparent;color:#1a1a1a;padding:.65rem .85rem;text-align:left;font-weight:600;cursor:pointer}.project-card-menu-item:hover{background:#f4f6f8}.project-card-menu-item-danger{color:#b91c1c}.skeleton-block{background:linear-gradient(90deg,#eef1f4 25%,#f8fafc 50%,#eef1f4 75%);background-size:200% 100%;animation:skeleton-shimmer 1.2s linear infinite;border-radius:12px}.app-main-loading{flex:1 1;display:flex;flex-direction:row;gap:1rem;padding:1rem 1.5rem 1.5rem;min-height:0;align-items:stretch;overflow:hidden}.skeleton-sidebar,.skeleton-stage{flex:1 1;min-height:0}.project-card-skeleton{background:linear-gradient(90deg,#eef1f4 25%,#f8fafc 50%,#eef1f4 75%);background-size:200% 100%;animation:skeleton-shimmer 1.2s linear infinite}@keyframes skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.confirm-overlay{position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);padding:1.5rem}.confirm-card{width:min(420px,100%);padding:1.25rem 1.35rem 1.35rem;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.25)}.confirm-title{margin:0;font-size:1.1rem;font-weight:700;color:#1f2937}.confirm-message{margin:.75rem 0 0;color:#4b5563;line-height:1.5}.confirm-actions{display:flex;justify-content:flex-end;gap:.65rem;margin-top:1.25rem}.confirm-cancel-btn{padding:.55rem 1rem}.confirm-danger-btn{border:none;background:#b91c1c;color:#fff;padding:.55rem 1rem;border-radius:999px;cursor:pointer;font-weight:600}.confirm-danger-btn:hover:not(:disabled){background:#991b1b}.confirm-cancel-btn:disabled,.confirm-danger-btn:disabled{opacity:.6;cursor:not-allowed}.toast-container{position:fixed;bottom:1.25rem;right:1.25rem;z-index:200;display:flex;flex-direction:column;gap:.65rem;max-width:min(360px,calc(100vw - 2rem));pointer-events:none}.toast{display:flex;align-items:flex-start;gap:.75rem;padding:.85rem .95rem;background:#fff;border-radius:10px;box-shadow:0 8px 24px rgba(15,23,42,.16);border-left:4px solid #15803d;pointer-events:auto;animation:toast-in .22s ease-out}.toast-error{border-left-color:#b91c1c}.toast-message{flex:1 1;font-size:.92rem;font-weight:600;color:#1f2937;line-height:1.4}.toast-close{border:none;background:transparent;color:#6b7280;font-size:1.2rem;line-height:1;cursor:pointer;padding:0}.toast-close:hover{color:#374151}@keyframes toast-in{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}.tip-anchor{display:inline-flex}.tip-anchor>*{flex:1 1 auto}.tip-anchor>:disabled{pointer-events:none}.tip-anchor:has(>:disabled){cursor:not-allowed}.tip-bubble{position:fixed;z-index:400;max-width:240px;padding:.4rem .6rem;background:#1f2937;color:#f9fafb;border-radius:6px;box-shadow:0 4px 14px rgba(15,23,42,.18);font-size:.78rem;font-weight:500;line-height:1.4;pointer-events:none;animation:tip-in .12s ease-out}@keyframes tip-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){.tip-bubble{animation:none}}.help-menu-btn{gap:.4rem;white-space:nowrap}.help-menu-btn,.help-menu-icon{display:inline-flex;align-items:center}.help-menu-icon{justify-content:center;width:1.15rem;height:1.15rem;border-radius:999px;background:rgba(201,162,39,.15);color:#8a6f1a;font-size:.75rem;font-weight:700}.help-menu-dropdown{min-width:12rem;left:0;right:auto}a.export-menu-item{text-decoration:none}.tour-root{position:fixed;inset:0;z-index:300}.tour-backdrop,.tour-blocker{position:absolute;inset:0}.tour-backdrop{background:rgba(15,23,42,.55);pointer-events:none}.tour-spotlight{position:fixed;border-radius:10px;box-shadow:0 0 0 3px #c9a227,0 0 0 9999px rgba(15,23,42,.55);pointer-events:none;transition:top .2s ease,left .2s ease,width .2s ease,height .2s ease}.tour-card{position:fixed;width:min(340px,calc(100vw - 24px));padding:1rem 1.15rem 1.05rem;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(15,23,42,.28)}.tour-progress{font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#8a6f1a}.tour-title{margin:.3rem 0 0;font-size:1.05rem;font-weight:700;color:#1f2937}.tour-body{margin:.5rem 0 0;font-size:.9rem;line-height:1.5;color:#4b5563}.tour-actions{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:1rem}.tour-nav{display:flex;gap:.5rem;margin-left:auto}.tour-skip-btn{border:none;background:none;padding:0;color:#6b7280;font-weight:600;font-size:.85rem;cursor:pointer}.tour-skip-btn:hover{color:#374151;text-decoration:underline}@media (prefers-reduced-motion:reduce){.tour-spotlight{transition:none}}.help-page{min-height:100vh}.help-header{position:-webkit-sticky;position:sticky;top:0;z-index:10}.help-back-link{text-decoration:none;white-space:nowrap}.help-layout{display:grid;grid-template-columns:240px minmax(0,1fr);grid-gap:2rem;gap:2rem;max-width:1100px;margin:0 auto;padding:2rem 1.5rem 4rem}.help-toc{position:-webkit-sticky;position:sticky;top:6rem;align-self:start;padding:1rem 1.1rem;background:#fff;border:1px solid #dde2e8;border-radius:12px}.help-toc-title{margin:0 0 .5rem;font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#6b7280}.help-toc ol{margin:0;padding-left:1.2rem;font-size:.9rem}.help-toc li+li{margin-top:.35rem}.help-toc a{color:#374151;text-decoration:none}.help-toc a:hover{color:#8a6f1a;text-decoration:underline}.help-content{padding:1.75rem 2rem 2rem;background:#fff;border:1px solid #dde2e8;border-radius:14px;color:#374151}.help-title{margin:0;font-size:1.75rem;color:#1f2937}.help-intro{margin:.6rem 0 0;font-size:1.02rem;color:#4b5563}.help-section{margin-top:2.25rem;scroll-margin-top:6rem}.help-section h2{margin:0 0 .6rem;padding-bottom:.4rem;font-size:1.25rem;color:#1f2937;border-bottom:1px solid #eef1f4}.help-subheading{margin:1.2rem 0 .35rem;font-size:1rem;color:#1f2937}.help-section p{margin:.5rem 0}.help-list,.help-steps{margin:.5rem 0;padding-left:1.4rem}.help-list li+li,.help-steps li+li{margin-top:.3rem}.help-tip{padding:.7rem .9rem;background:rgba(201,162,39,.08);border-left:3px solid #c9a227;border-radius:6px}.help-faq-item{border:1px solid #dde2e8;border-radius:10px;padding:.65rem .9rem}.help-faq-item+.help-faq-item{margin-top:.5rem}.help-faq-item summary{font-weight:600;color:#1f2937;cursor:pointer}.help-faq-item p{margin:.5rem 0 0}@media (max-width:860px){.help-layout{grid-template-columns:1fr;padding:1rem}.help-toc{position:static}.help-content{padding:1.25rem}}