:root{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:#17231f;background:#fbfaf7;font-synthesis:none;text-rendering:optimizeLegibility;--green:#11745d;--muted:#69736f;--line:#d8dfdb;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;min-height:100%;overscroll-behavior-x:none}body{background:#fbfaf7}button,input{font:inherit}button{cursor:pointer}.app-header{height:64px;padding:calc(10px + var(--safe-top)) 20px 10px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;background:#102820;color:#fff}.app-header strong{font-size:17px;font-weight:650}.back-button{justify-self:start;border:0;background:none;color:#fff;padding:8px 0;font-size:15px}.header-spacer{justify-self:end}.user-app{min-height:calc(100svh - 64px - var(--safe-top));max-width:980px;margin:0 auto;padding:clamp(16px,4vw,32px);display:flex;flex-direction:column}.user-stage{flex:1;min-height:0;display:flex;flex-direction:column}.stage-copy{margin:2px 0 20px}.stage-copy h1{margin:0 0 8px;font-size:clamp(22px,6vw,30px);line-height:1.2;letter-spacing:-.025em}.stage-copy p{margin:0;color:var(--muted);font-size:16px}.photo-preview{min-height:220px;flex:1;max-height:62svh;border-radius:16px;background:#eff1ee;display:grid;place-items:center;overflow:hidden;color:#75807a}.photo-preview img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.photo-preview.empty-preview{border:1px dashed #c7d0cb}.stage-actions{display:grid;gap:12px;margin-top:20px}.action-button{display:flex;align-items:center;justify-content:center;width:100%;min-height:54px;padding:14px 20px;border-radius:13px;border:1px solid #c8d1cc;font-size:17px;font-weight:650;text-decoration:none}.primary{color:#fff;background:var(--green);border-color:var(--green)}.secondary{color:#17231f;background:#fff}.action-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.user-status{min-height:22px;margin:12px 0 0;color:var(--muted);text-align:center;font-size:14px}.zone-stage{gap:12px}.zone-heading{display:flex;align-items:center;gap:12px;min-height:42px}.zone-heading p{margin:0;font-size:16px;font-weight:600;line-height:1.3}.text-button{border:0;background:none;color:var(--green);font-weight:600;padding:10px 4px;white-space:nowrap}.canvas-wrap.user-canvas{flex:1;min-height:240px;max-height:calc(100svh - 210px - var(--safe-top) - var(--safe-bottom));position:relative;overflow:hidden;background:#edece7;border-radius:14px;display:grid;place-items:center;touch-action:pan-y}.canvas-layer{position:relative;display:grid;place-items:center;max-width:100%;max-height:100%;transform-origin:center center;will-change:transform}.canvas-layer canvas{grid-area:1/1;max-width:100%;max-height:calc(100svh - 220px - var(--safe-top) - var(--safe-bottom));width:auto;height:auto;object-fit:contain}.canvas-layer #overlay,.canvas-layer #prompt{position:absolute;inset:0;width:100%;height:100%;margin:auto}.canvas-layer #prompt{pointer-events:none}.zone-stage[data-mode=select] .canvas-layer #prompt{pointer-events:auto;touch-action:pan-y}.zone-stage[data-mode=result] .user-canvas{touch-action:none}.processing-shade{position:absolute;inset:0;background:#12221c99;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;font-size:17px}.spinner{width:32px;height:32px;border:3px solid #ffffff66;border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.zone-footer{min-height:34px;display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:14px}.result-actions{margin-top:4px}.debug-tools{display:none}body.debug .debug-tools{display:grid;gap:18px;max-width:1320px;margin:0 auto;padding:22px}body.debug #userApp{min-height:640px}.debug-tools .panel{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}.debug-tools .compat,.debug-tools .preset-row,.debug-tools .engine-actions,.debug-tools .status-grid{display:flex;gap:8px;flex-wrap:wrap}.debug-tools button,.debug-tools select{min-height:42px;padding:9px 12px;border:1px solid #b8c4bf;border-radius:9px;background:#fff}.debug-tools .canvas-wrap{min-height:320px;position:relative;background:#18201e;display:grid;place-items:center;overflow:hidden}.debug-tools canvas{max-width:100%;max-height:70vh}.debug-tools #debugCanvasWrap{display:grid}.debug-tools table{border-collapse:collapse;min-width:850px;width:100%}.debug-tools td,.debug-tools th{text-align:left;padding:8px;border-bottom:1px solid var(--line)}.debug-tools .comparison-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.debug-tools img.test-asset,.debug-tools .test-assets{display:none}.debug-tools .file-button,.debug-tools label{display:inline-flex;align-items:center;padding:10px;border:1px solid var(--line);border-radius:8px}@media(min-width:700px){.user-app{padding-top:24px}.photo-stage{max-height:calc(100svh - 100px)}.photo-preview{max-height:68svh}.zone-heading{max-width:980px}.canvas-wrap.user-canvas{max-height:calc(100svh - 205px)}.canvas-layer canvas{max-height:calc(100svh - 220px)}}@media(max-width:430px){.app-header{height:58px;padding-left:16px;padding-right:16px}.app-header strong{font-size:16px}.user-app{min-height:calc(100svh - 58px - var(--safe-top));padding:16px;gap:12px}.stage-copy{margin-bottom:14px}.photo-preview{min-height:210px;max-height:57svh;border-radius:13px}.stage-actions{margin-top:16px}.zone-heading{align-items:flex-start;flex-direction:column;gap:2px}.zone-heading p{font-size:15px}.canvas-wrap.user-canvas{min-height:250px;max-height:calc(100svh - 235px - var(--safe-top) - var(--safe-bottom));border-radius:12px}.canvas-layer canvas{max-height:calc(100svh - 245px - var(--safe-top) - var(--safe-bottom))}.action-button{min-height:54px;font-size:16px}.user-status{margin-top:8px}}@media(max-width:340px){.user-app{padding:12px}.stage-copy h1{font-size:22px}.stage-copy p{font-size:14px}.canvas-wrap.user-canvas{max-height:calc(100svh - 220px - var(--safe-top) - var(--safe-bottom))}.zone-heading p,.back-button{font-size:14px}}
