/* Hallmark v2.0.0 | shape: app screen | theme: locked iKawn | signature: live product try-on | scope: app */
/* Critique: reuse photo playground controls and give live output the larger region. */
.live-playground{max-width:1440px;margin-inline:auto;min-width:0}
.lp-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px;flex-wrap:wrap;color:var(--color-muted)}
.lp-heading p{margin:0}.lp-balance{font-size:14px;white-space:nowrap}.lp-balance strong{color:var(--color-ink);font-variant-numeric:tabular-nums}
.lp-layout{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.5fr);gap:24px;align-items:start}
.lp-controls{display:grid;gap:12px;min-width:0;background:var(--color-paper-2);padding:20px;border-radius:var(--radius-panel)}
.lp-controls label{display:grid;gap:8px;font-size:14px}.lp-reference{height:112px;display:grid;place-items:center;background:var(--color-paper);border-radius:var(--radius-control);overflow:clip;color:var(--color-muted);font-size:14px}
.lp-reference img{width:100%;height:112px;object-fit:contain}.lp-reference [hidden]{display:none}
.lp-upload input{font-size:12px;min-width:0;width:100%}
.lp-products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:220px;overflow-y:auto;padding:4px}
.lp-products button{padding:4px;border:1px solid var(--color-rule);border-radius:var(--radius-control);background:var(--color-paper);color:var(--color-ink);cursor:pointer;min-width:0;font:inherit}
.lp-products img{width:100%;height:52px;object-fit:contain}.lp-products span{display:block;font-size:11px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}
.lp-products button[aria-pressed=true]{border-color:var(--color-accent);box-shadow:0 0 0 1px var(--color-accent)}
.live-playground :focus-visible{outline:2px solid var(--color-accent);outline-offset:3px}
.lp-charge{margin:0;line-height:1.5}.lp-actions{display:flex;gap:8px}.lp-actions .btn:first-child{flex:1}.lp-actions .btn{min-width:0}
.lp-output{min-width:0}.lp-stage{position:relative;min-height:380px;height:min(59dvh,680px);background:var(--color-paper-2);border-radius:var(--radius-panel);overflow:clip;display:grid;place-items:center}
.lp-stage [data-output]{width:100%;height:100%;object-fit:contain;position:absolute;inset:0}.lp-stage [hidden]{display:none}
.lp-stage [data-camera]{position:absolute;bottom:14px;right:14px;width:23%;height:28%;object-fit:contain;border:1px solid var(--color-rule);background:var(--color-paper);border-radius:var(--radius-control);transform:scaleX(-1)}
.lp-empty{display:grid;justify-items:center;gap:12px;text-align:center;padding:24px;color:var(--color-muted)}.lp-empty .icon{width:36px;height:36px;color:var(--color-accent)}.lp-empty h2{font-size:20px;text-wrap:balance;margin:0;color:var(--color-ink);overflow-wrap:break-word;min-width:0}.lp-empty p{margin:0;font-size:14px}
.lp-status-row{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:60px}.lp-status-row p{font-size:14px;margin:12px 0}.lp-metrics{display:flex;gap:28px;padding-block:16px;margin:0;border-top:1px solid var(--color-rule);flex-wrap:wrap}.lp-metrics dt{font-size:12px;color:var(--color-muted)}.lp-metrics dd{margin:4px 0 0;font-size:18px;font-variant-numeric:tabular-nums}.lp-loading{display:grid;place-items:center;min-height:280px}
@media(max-width:1050px){.lp-layout{grid-template-columns:minmax(230px,.8fr) minmax(0,1fr);gap:16px}.lp-controls{padding:16px}.lp-stage{min-height:320px}}
@media(max-width:740px){.lp-layout{grid-template-columns:minmax(0,1fr)}.lp-output{grid-row:1}.lp-stage{height:40dvh;min-height:260px}.lp-products{grid-template-columns:repeat(4,minmax(0,1fr))}.lp-reference{height:120px}.lp-reference img{height:120px}.lp-controls{padding:16px}}
@media(prefers-reduced-motion:reduce){.live-playground *{scroll-behavior:auto}}

.content:has(.live-playground){padding-top:20px}.lp-controls{gap:8px;padding:16px}.lp-controls textarea{min-height:64px;height:64px}.lp-controls [data-apply][hidden]{display:none}.lp-products button:hover{background:var(--color-control-hover)}.lp-products button:active{transform:translateY(1px)}

/* Preview controls share the demo's in-frame placement; gallery reveals the next row. */
:root{--lp-overlay-bg:#171a18;--lp-overlay-ink:#f9faf8;--lp-overlay-border:#ffffff38;--lp-overlay-shadow:0 2px 10px #00000026}
.lp-products{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:82px;max-height:229px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;align-content:start}
.lp-products button{height:82px}.lp-products img{height:52px}
.lp-preview-controls{position:absolute;top:12px;right:12px;z-index:3}
.lp-disconnect.btn{background:var(--lp-overlay-bg);color:var(--lp-overlay-ink);border:1px solid var(--lp-overlay-border);box-shadow:var(--lp-overlay-shadow);min-height:40px;padding:8px 12px;font-size:13px}
.lp-disconnect.btn:hover{background:var(--color-error)}
.lp-preview-status{position:absolute;left:16px;bottom:16px;max-width:calc(74% - 32px);margin:0;padding:8px 12px;border-radius:var(--radius-control);background:var(--lp-overlay-bg);color:var(--lp-overlay-ink);box-shadow:var(--lp-overlay-shadow);font-size:13px;z-index:2;line-height:1.4}
.lp-stage [data-fullscreen]{position:absolute;top:12px;left:12px;z-index:3;background:var(--lp-overlay-bg);color:var(--lp-overlay-ink);box-shadow:var(--lp-overlay-shadow)}
.lp-stage [data-fullscreen]:disabled{display:none}.lp-empty [data-stage-spinner]{width:32px;height:32px}.lp-empty [data-stage-spinner][hidden]{display:none}
.lp-stage[data-state=starting] .lp-empty,.lp-stage[data-state=queued] .lp-empty{position:absolute;inset:0;align-content:center;background:var(--color-paper-2);z-index:1}
.lp-stage [data-camera]{z-index:2}.lp-metrics{margin-top:16px}
@media(max-width:740px){.lp-products{grid-template-columns:repeat(3,minmax(0,1fr))}.lp-preview-status{font-size:12px;left:12px;bottom:12px;padding:8px}}

/* Primary action stays above the preview at every viewport size. */
.lp-heading-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.lp-heading-actions .btn{white-space:nowrap}
.lp-heading-actions [hidden]{display:none}.lp-reference,.lp-reference img{height:88px}
@media(max-width:740px){.lp-heading{gap:8px}.lp-heading-actions{width:100%;justify-content:space-between}.lp-heading-actions .btn{margin-left:auto}}

/* One product slot handles catalogue previews and file selection. */
.lp-reference{position:relative;height:144px;background:var(--color-paper);border:1px dashed var(--color-rule);overflow:clip}
.lp-reference-select{width:100%;height:100%;padding:0;border:0;border-radius:inherit;background:transparent;color:var(--color-ink);cursor:pointer;font:inherit}
.lp-reference-select img{width:100%;height:100%;object-fit:contain}.lp-reference-select [data-reference-empty]{display:grid;justify-items:center;gap:4px;padding:12px;font-size:13px}.lp-reference-select [data-reference-empty][hidden]{display:none}
.lp-reference-select small{font-size:11px;color:var(--color-muted)}.lp-reference-select .icon{width:24px;height:24px;margin-bottom:4px;color:var(--color-accent)}
.lp-reference-select:hover{background:var(--color-control-hover)}.lp-reference-select:disabled{cursor:not-allowed;opacity:.6;background:var(--color-paper-2);color:var(--color-muted)}.lp-reference.is-dragging{border:2px solid var(--color-accent);background:var(--color-paper-2)}
.lp-remove-reference.btn{position:absolute;top:8px;right:8px;min-height:32px;width:32px;padding:4px;background:var(--lp-overlay-bg);color:var(--lp-overlay-ink);box-shadow:var(--lp-overlay-shadow);border:1px solid var(--lp-overlay-border)}
.lp-reference-select:focus-visible{outline-offset:-3px}

.lp-heading-actions [data-start]:disabled{opacity:1;background:var(--color-paper-2);color:var(--color-muted);cursor:not-allowed;box-shadow:none}

/* Keep the primary action with its inputs and fit the entire reference image. */
.lp-reference-select{position:absolute;inset:0;display:grid;place-items:center;min-width:0;min-height:0;width:100%;height:100%;overflow:clip}
.lp-reference-select img{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center}
.lp-actions .btn{width:100%}.lp-actions [hidden]{display:none}
.lp-actions [data-start]:disabled{opacity:1;background:var(--color-paper-2);color:var(--color-muted);cursor:not-allowed;box-shadow:none}
.lp-products button[aria-pressed=true]{border:1px solid var(--color-accent);padding:4px;box-shadow:none;outline:2px solid var(--color-accent);outline-offset:-2px}
.lp-products button:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px;box-shadow:none}
@media(min-width:741px) and (max-height:850px){
 .content:has(.live-playground){padding-top:16px}.lp-heading{margin-bottom:12px}
 .lp-controls{padding:12px;gap:4px}.lp-reference{height:104px}
 .lp-products{grid-auto-rows:64px;max-height:184px}.lp-products button{height:64px}.lp-products img{height:36px}
 .lp-controls label{gap:4px}.lp-controls textarea{height:48px;min-height:48px}
}

/* Fit the empty upload hint within the same compact product slot. */
.lp-reference-select [data-reference-empty]{gap:2px;padding:8px;font-size:12px;line-height:1.2}
.lp-reference-select [data-reference-empty] .icon{width:20px;height:20px;margin-bottom:2px}

/* Stop the remote preview immediately, keeping the local camera available. */
.lp-stage.camera-preview [data-camera]{inset:0;width:100%;height:100%;border:0;border-radius:0;background:var(--color-paper-2);z-index:0}
.lp-preview-controls{display:flex;gap:8px}.lp-download.btn{background:var(--lp-overlay-bg);color:var(--lp-overlay-ink);border:1px solid var(--lp-overlay-border);box-shadow:var(--lp-overlay-shadow);font-size:13px;min-height:40px}
.lp-stage.camera-preview [data-output]{display:none}.lp-preview-controls [hidden]{display:none}

/* Match the website demo: readable changing stages over a blurred camera. */
.lp-stage[data-state=starting] [data-camera],.lp-stage[data-state=queued] [data-camera]{inset:0;width:100%;height:100%;object-fit:cover;border:0;border-radius:0;z-index:0}
.lp-stage[data-state=starting] .lp-empty,.lp-stage[data-state=queued] .lp-empty{background:color-mix(in srgb,var(--color-paper-2) 80%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);min-width:0}
.lp-empty h2{font-size:clamp(20px,2.4vw,32px);max-width:20ch;line-height:1.2}.lp-empty p{max-width:42ch;text-wrap:pretty}

.lp-empty [data-stage-spinner]{display:block;border:2px solid var(--color-rule);border-top-color:var(--color-accent);border-radius:50%;animation:lp-spin .8s linear infinite}
@keyframes lp-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.lp-empty [data-stage-spinner]{animation:none}}
