.tool-device-mockup .grid{grid-template-columns:minmax(0,360px) minmax(0,1fr)}
.tool-device-mockup .dm-in,.tool-device-mockup .dm-out{padding:16px;min-width:0}
.tool-device-mockup .drop{min-height:120px;padding:18px 12px}
.tool-device-mockup .drop svg{color:var(--accent)}
.tool-device-mockup fieldset{border:0;padding:0;margin:14px 0 0;min-width:0}
.tool-device-mockup .seg{margin-bottom:10px}
.tool-device-mockup .dm-files{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.tool-device-mockup .dm-files:empty{display:none}
.tool-device-mockup .dm-file{position:relative;width:64px}
.tool-device-mockup .dm-file canvas{width:64px;height:64px;border-radius:8px;border:1px solid var(--line);display:block;background:var(--surface-2)}
.tool-device-mockup .dm-file .kind{position:absolute;left:4px;bottom:4px;font-size:.62rem;font-weight:700;background:rgba(0,0,0,.65);color:#fff;border-radius:4px;padding:0 4px}
.tool-device-mockup .dm-file .rm{position:absolute;top:-6px;right:-6px;width:22px;height:22px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:.8rem;line-height:1;cursor:pointer;padding:0}
.tool-device-mockup .dm-swatches{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.tool-device-mockup .dm-sw{width:36px;height:36px;border-radius:10px;border:2px solid var(--line);cursor:pointer;padding:0}
.tool-device-mockup .dm-sw[aria-checked=true]{border-color:var(--accent);box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.tool-device-mockup .dm-sw.none{background:repeating-conic-gradient(var(--line) 0 25%,var(--surface) 0 50%) 0 0/10px 10px}
.tool-device-mockup .dm-sw.solid{background:conic-gradient(#f87171,#fbbf24,#34d399,#60a5fa,#a78bfa,#f87171)}
.tool-device-mockup .dm-slots{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.tool-device-mockup .dm-slots:empty{display:none}
.tool-device-mockup .dm-colour{max-width:180px}
.tool-device-mockup .dm-colour input{height:38px;padding:3px}
.tool-device-mockup .dm-out-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:end}
.tool-device-mockup .dm-out-row .seg{margin:0 0 4px}
/* The stage is always the size of the first-visit preview (a portrait phone, at most 640 px tall), so nothing moves
   when the preview draws (DM-1). Every preview fits inside it: canvases are capped at 640 px tall and the stage width.
   The width is set (not auto) so max-height can't shrink the width through the aspect ratio. */
.tool-device-mockup .dm-stage{box-sizing:content-box;width:calc(100% - 24px);aspect-ratio:703/1280;max-height:640px;display:flex;align-items:center;justify-content:center;border-radius:12px;background:repeating-conic-gradient(var(--line) 0 25%,transparent 0 50%) 0 0/16px 16px;padding:12px}
.tool-device-mockup .dm-stage canvas{max-width:100%;max-height:640px;height:auto;width:auto;display:block}
.tool-device-mockup .dm-play{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px}
.tool-device-mockup .dm-summary{margin:12px 0 0;font-weight:600;min-height:1.5em}
.tool-device-mockup .dm-progress{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:8px 0}
.tool-device-mockup .dm-progress progress{flex:1;min-width:160px;height:10px;accent-color:var(--accent)}
.tool-device-mockup .dm-result{margin-top:12px;padding:12px;border-radius:12px;background:var(--surface-2)}
.tool-device-mockup .dm-result video{max-width:100%;max-height:420px;display:block;border-radius:8px;margin-bottom:10px;background:#000}
@media (max-width:960px){.tool-device-mockup .grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:420px){.tool-device-mockup .dm-out-row{grid-template-columns:minmax(0,1fr)}}
