.gallery{height:100%;display:flex;flex-direction:column;padding-top:var(--safe-top);background:var(--bg)}.gallery-title{flex:1;min-width:0;margin:0;font-size:1.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gallery-upload{flex-shrink:0;padding:0 14px;font-size:.9rem}.gallery-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;padding:0 16px 10px}.gallery-filter{display:inline-flex;padding:3px;border-radius:999px;background:var(--surface)}.gallery-filter button{min-height:38px;padding:0 14px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:.85rem;font-weight:600}.gallery-filter button[aria-pressed=true]{background:var(--surface-2);color:var(--text)}.gallery-summary{margin:0;font-size:.85rem;color:var(--muted)}.gallery-summary .is-wait{color:#ffc857}.gallery-scroll{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 16px calc(var(--safe-bottom) + 24px)}.gallery-group+.gallery-group{margin-top:20px}.gallery-group-title{position:sticky;top:0;z-index:1;margin:0;padding:8px 0;font-size:.95rem;font-weight:600;background:var(--bg)}.gallery-group-title span{color:var(--muted);font-weight:400}.gallery-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}.gallery-item{width:100%;display:flex;flex-direction:column;gap:6px;padding:6px;border:0;border-radius:var(--radius);background:var(--surface);text-align:left}.gallery-thumb{width:100%;max-height:220px;border-radius:10px;overflow:hidden;background:var(--surface-2)}.gallery-thumb img{width:100%;height:100%;display:block;object-fit:cover}.gallery-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;min-height:22px}.gallery-badge{max-width:100%;padding:2px 8px;border-radius:999px;font-size:.72rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gallery-badge.is-ok{background:#2ecc712e;color:#5be08f}.gallery-badge.is-wait{background:#ffc85729;color:#ffc857}.gallery-badge.is-err{background:#ff5a6a2e;color:var(--danger)}.gallery-print-count{font-size:.72rem;color:var(--muted)}.gallery-empty{display:flex;flex-direction:column;align-items:center;gap:12px;margin:15vh auto 0;max-width:320px;text-align:center;color:var(--muted);line-height:1.5}.gallery-empty p{margin:0}.gallery-detail-placeholder{background:var(--surface-2);max-height:58vh}.gallery-detail-info p{margin:0}.gallery-detail-name{font-weight:600;word-break:break-all}.gallery-detail-status{display:flex;align-items:center;gap:8px;margin-top:6px!important}.gallery-action-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.gallery-delete{color:var(--danger)}.gallery-confirm{display:flex;flex-direction:column;gap:12px;padding:14px;border-radius:12px;background:var(--surface-2)}.gallery-confirm p{margin:0;line-height:1.5}.gallery-confirm p.is-danger{color:#fff;font-weight:600;padding:10px 12px;border-radius:10px;background:#ff5a6a40;border:1px solid var(--danger)}.gallery-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.gallery-btn-danger{background:var(--danger);color:#fff}@media(max-width:380px){.gallery-upload{font-size:.8rem;padding:0 10px}}.gallery-share-btn{margin-left:auto;display:inline-flex;align-items:center;gap:6px}.share-sheet{max-width:420px;display:flex;flex-direction:column;gap:12px;text-align:center}.share-title{margin:0;font-size:1.15rem}.share-toggle{display:flex;align-items:center;gap:10px;text-align:left;padding:12px;border-radius:12px;background:#ffffff0f;border:1px solid rgba(255,255,255,.12);cursor:pointer}.share-toggle input{width:22px;height:22px;flex:none}.share-live{display:flex;flex-direction:column;gap:14px;align-items:center}.share-url{display:flex;gap:8px;width:100%}.share-url input{flex:1;min-width:0;padding:10px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.18);background:#00000040;color:inherit;font-size:.9rem}.share-qr{background:#fff;padding:10px;border-radius:14px;line-height:0;min-height:120px}.share-controls{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}.share-controls label{display:flex;flex-direction:column;gap:6px;font-size:.8rem;align-items:center}.share-controls select{padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,.18);background:#00000040;color:inherit}.share-controls input[type=color]{width:48px;height:36px;padding:0;border:none;border-radius:8px;background:none;cursor:pointer}:root{--bg: #0b1020;--surface: #151b30;--surface-2: #1f2742;--text: #f3f5fb;--muted: #9aa3bd;--primary: #4f7cff;--primary-press: #3a63e0;--danger: #ff5a6a;--radius: 14px;--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{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overscroll-behavior:none}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:3px solid var(--primary);outline-offset:2px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border:0;border-radius:999px;font-weight:600}.btn-lg{min-height:54px;font-size:1.05rem}.btn-block{width:100%}.btn-primary{background:var(--primary);color:#fff}.btn-primary:active:not(:disabled){background:var(--primary-press)}.btn-secondary{background:var(--surface-2)}.btn-ghost{background:transparent;color:var(--primary)}.icon-btn{position:relative;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:#ffffff14}.icon-btn.is-on{background:var(--text);color:var(--bg)}.icon-btn-lg{width:52px;height:52px}.timer-btn small{position:absolute;right:2px;bottom:0;font-size:.65rem;font-weight:700}.setup{max-width:680px;margin:0 auto;padding:calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 24px);display:flex;flex-direction:column;gap:16px}.setup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.setup-head h1{margin:0 0 4px;font-size:1.6rem}.setup-head p{margin:0;color:var(--muted)}.card{background:var(--surface);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:14px}.card h2{margin:0;font-size:1rem}details.card>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer}details.card>summary::-webkit-details-marker{display:none}.field{display:flex;flex-direction:column;gap:6px;font-size:.9rem;color:var(--muted)}.field input,.field select{min-height:48px;padding:0 14px;border-radius:12px;border:1px solid var(--surface-2);background:var(--bg);color:var(--text);font:inherit;font-size:1rem}.field-note{margin:0;font-size:.85rem;color:var(--muted);line-height:1.45}.field-note.ok{color:#4ade80}.field-note.bad{color:var(--danger)}.segmented{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;padding:4px;border-radius:12px;background:var(--bg)}.segmented button{min-height:42px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-weight:600}.segmented button.is-on{background:var(--primary);color:#fff}.toggle{display:flex;align-items:center;gap:10px;font-size:.9rem}.toggle input{width:22px;height:22px;accent-color:var(--primary)}.row-actions{display:flex;gap:8px}.setup-start{position:sticky;bottom:0;padding:12px 0 calc(var(--safe-bottom) + 4px);background:linear-gradient(transparent,var(--bg) 30%);display:flex;flex-direction:column;gap:6px;text-align:center}.upload-chip{font-size:.75rem;padding:4px 10px;border-radius:999px;background:#4ade8026;color:#4ade80;white-space:nowrap}.upload-chip.is-pending{background:#ffb70326;color:#ffb703}.template-tools{position:absolute;top:4px;right:4px;display:flex;gap:4px}.template-tools button{width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:50%;background:#000000a6}.loading-page{height:100%;display:grid;place-content:center;gap:12px;text-align:center;color:var(--muted)}.template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}.template-cell{position:relative}.template-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:8px;border:2px solid transparent;border-radius:var(--radius);background:var(--surface);text-align:center;font-size:.85rem}.template-card img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:10px;background:repeating-conic-gradient(#2a3150,#2a3150 25%,#222944 0%,#222944 50%) 0 0 / 16px 16px}.template-card.is-selected{border-color:var(--primary)}.template-add{align-items:center;justify-content:center;min-height:160px;color:var(--muted);border:2px dashed var(--surface-2)}.template-delete{position:absolute;top:4px;right:4px;width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:50%;background:#000000a6;color:var(--danger)}.home-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.camera,.editor{height:100%;display:flex;flex-direction:column;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);background:#000}.editor{background:var(--bg)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px}.topbar-group{display:flex;gap:8px}.topbar-title{font-weight:600}.stage{flex:1;min-height:0;display:grid;place-items:center;padding:0 8px}.frame{position:relative;overflow:hidden;border-radius:6px;background:#111;touch-action:none;user-select:none;-webkit-user-select:none}.frame video,.frame .overlay,.frame canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:block}.frame video{object-fit:cover}.frame video.mirror{transform:scaleX(-1)}.frame .overlay{pointer-events:none;object-fit:fill}.frame-edit{cursor:grab}.grid-lines{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;background:linear-gradient(to right,transparent calc(33.33% - .5px),rgba(255,255,255,.4) 0,transparent calc(33.33% + .5px)),linear-gradient(to right,transparent calc(66.66% - .5px),rgba(255,255,255,.4) 0,transparent calc(66.66% + .5px)),linear-gradient(to bottom,transparent calc(33.33% - .5px),rgba(255,255,255,.4) 0,transparent calc(33.33% + .5px)),linear-gradient(to bottom,transparent calc(66.66% - .5px),rgba(255,255,255,.4) 0,transparent calc(66.66% + .5px))}.countdown{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;font-size:7rem;font-weight:800;text-shadow:0 4px 24px rgba(0,0,0,.6)}.shutter-flash{position:absolute;top:0;right:0;bottom:0;left:0;background:#fff;animation:flash .25s ease-out forwards}@keyframes flash{to{opacity:0}}.stage-msg{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;text-align:center;color:var(--muted);background:#000000bf}.stage-error p{margin:0 0 16px;color:var(--text);line-height:1.5}.stage-error-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.zoom-slider{width:min(70%,320px);margin:12px auto 0;accent-color:#fff}.camera-controls{display:flex;align-items:center;justify-content:space-around;padding:16px 24px 20px}.shutter{width:76px;height:76px;border-radius:50%;border:5px solid #fff;background:#ffffffd9;box-shadow:inset 0 0 0 4px #000;transition:transform .1s}.shutter:active:not(:disabled){transform:scale(.92)}.hint{margin:8px 0 0;text-align:center;font-size:.8rem;color:var(--muted)}.editor-tools{display:flex;flex-direction:column;gap:10px;padding:12px 16px 16px;max-width:560px;width:100%;margin:0 auto}.slider{display:grid;grid-template-columns:52px 1fr;align-items:center;gap:8px;font-size:.85rem;color:var(--muted)}.slider input{width:100%;accent-color:var(--primary)}.tool-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.tool{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;border:0;border-radius:12px;background:var(--surface);font-size:.85rem}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10;display:flex;align-items:flex-end;justify-content:center;background:#000000b3}.sheet-body{position:relative;width:100%;max-width:560px;max-height:100%;overflow:auto;padding:20px 16px calc(var(--safe-bottom) + 16px);border-radius:20px 20px 0 0;background:var(--surface);display:flex;flex-direction:column;gap:12px}.sheet-close{position:absolute;top:10px;right:10px;z-index:1;background:#00000080}.result{width:100%;max-height:58vh;object-fit:contain;border-radius:10px;-webkit-touch-callout:default}.sheet-hint{margin:0;font-size:.85rem;color:var(--muted);line-height:1.45}.sheet-actions{display:grid;gap:10px}.toast{position:fixed;left:50%;bottom:calc(var(--safe-bottom) + 24px);z-index:20;transform:translate(-50%);max-width:calc(100% - 32px);padding:12px 18px;border-radius:12px;background:var(--surface-2);box-shadow:0 8px 24px #0006;font-size:.9rem}.toast-error{background:var(--danger);color:#fff}.booth{height:100%;display:flex;flex-direction:column;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);background:#000}.booth-title{display:flex;flex-direction:column;gap:4px;min-width:0}.booth-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.booth-title .upload-chip{align-self:flex-start}.booth-bottom{min-height:150px;display:grid;place-items:center;padding:12px 16px 16px}.start-btn{width:min(100%,420px);min-height:110px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;border-radius:24px;background:var(--primary);color:#fff;font-size:1.35rem;font-weight:800;box-shadow:0 0 0 6px #4f7cff40;animation:pulse 2.2s ease-in-out infinite}.start-btn small{font-size:.8rem;font-weight:500;opacity:.85}.start-btn:disabled{animation:none}@keyframes pulse{50%{box-shadow:0 0 0 14px #4f7cff14}}.booth-status{margin:0;font-size:1.1rem;font-weight:600;text-align:center}.review-actions{width:min(100%,520px);display:flex;flex-direction:column;gap:10px}.review-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.btn-danger{background:var(--danger);color:#fff}.btn-danger-text{color:var(--danger)}.slot-video{position:absolute;object-fit:cover}.slot-video.mirror{transform:scaleX(-1)}.frame canvas.overlay{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.frame>canvas:first-child{position:absolute;top:0;right:0;bottom:0;left:0}.slot-outline{position:absolute;pointer-events:none;border:3px solid #fff;box-shadow:0 0 0 2px #00000059;border-radius:4px}.countdown{position:absolute;inset:auto}.countdown span{animation:tick 1s ease-out}@keyframes tick{0%{transform:scale(1.6);opacity:.3}}.overlay-page{position:fixed;top:0;right:0;bottom:0;left:0;z-index:8;background:var(--bg)}.sheet-title{margin:0;font-weight:700;font-size:1.05rem}.topbar-spacer{width:44px}.booth{position:relative;overflow:hidden;padding:0}.booth .stage{position:absolute;top:0;right:0;bottom:0;left:0;padding:0;display:grid;place-items:center}.booth .stage>*{grid-area:1 / 1}.live-box{position:relative;overflow:hidden;background:#000}.live-box video{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover}.live-box video.mirror{transform:scaleX(-1)}.live-box .countdown{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;font-size:clamp(6rem,30vmin,18rem);font-weight:800;color:#fff;text-shadow:0 6px 32px rgba(0,0,0,.55)}.prev-shot{position:absolute;top:calc(var(--safe-top) + 76px);right:16px;width:min(24%,220px);display:flex;flex-direction:column;gap:4px;font-size:.8rem;font-weight:700;color:#fff;text-align:center}.prev-shot canvas{width:100%;height:auto;border:3px solid #fff;border-radius:8px;box-shadow:0 4px 16px #00000080}.booth-hud{position:absolute;top:0;left:0;right:0;z-index:3;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:calc(var(--safe-top) + 10px) 16px 24px;background:linear-gradient(rgba(0,0,0,.55),transparent);pointer-events:none}.booth-hud>*{pointer-events:auto}.booth-hud .icon-btn{background:#00000073}.booth .booth-bottom{position:absolute;left:0;right:0;bottom:0;z-index:3;min-height:0;padding:40px 16px calc(var(--safe-bottom) + 24px);background:linear-gradient(transparent,#0009)}.booth .booth-status{text-shadow:0 2px 8px rgba(0,0,0,.7)}.booth.phase-review .stage,.booth.phase-saving .stage{top:calc(var(--safe-top) + 72px);bottom:calc(var(--safe-bottom) + 230px);padding:0 12px}.booth.phase-review .booth-bottom,.booth.phase-saving .booth-bottom{height:calc(var(--safe-bottom) + 230px);padding-top:12px;background:#000}.review-frame{box-shadow:0 8px 40px #0009}@media(orientation:landscape){.start-btn{width:min(420px,50%);min-height:92px}.booth.phase-review .stage,.booth.phase-saving .stage{top:calc(var(--safe-top) + 72px);bottom:calc(var(--safe-bottom) + 16px);right:380px}.booth.phase-review .booth-bottom,.booth.phase-saving .booth-bottom{top:0;left:auto;width:380px;height:auto;padding:24px;display:grid;place-items:center}.booth.phase-review .review-actions{width:100%}}.booth .live-box{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.crop-window{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 0 0 100vmax #00000080;outline:2px solid rgba(255,255,255,.85)}.cam-info{padding:12px 14px;border-radius:12px;background:var(--bg);font-size:.85rem;line-height:1.5;color:var(--muted)}.cam-info p{margin:0}.cam-info strong{color:var(--text)}.cam-info .ok{color:#4ade80}.cam-info .warn{color:#ffb703}.cam-info .bad{color:var(--danger)}.probe{margin:8px 0;display:flex;flex-direction:column;gap:6px;align-items:flex-start}.probe ul{margin:0;padding-left:18px}
