.layer-list{display:grid;gap:12px;margin-top:6px}
.layer{border:1px solid #e3e3e8;border-radius:14px;padding:12px;background:#fafafb;display:grid;gap:10px;transition:border-color .15s,box-shadow .15s}
.layer.active{border-color:#1d1d1f;box-shadow:0 0 0 3px #1d1d1f14;background:#fff}
.layer-head{display:flex;justify-content:space-between;align-items:center}
.layer-title{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#7d7d83;font-weight:600}
.layer-del{border:0;background:none;color:#a1a1a8;font-size:14px;border-radius:6px;padding:2px 6px}
.layer-del:hover{color:#c62828;background:#fdecec}
.layer-text{width:100%;border:1px solid #d9d9de;border-radius:10px;padding:9px 11px;font-size:15px;background:#fff}
.layer-text:focus{outline:2px solid #0071e3;outline-offset:1px}
.font-chips{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.font-chips button{border:1px solid #dcdce1;background:#fff;border-radius:9px;padding:8px 4px;font-size:15px;line-height:1.1;color:#1d1d1f}
.font-chips button[aria-pressed=true]{background:#1d1d1f;color:#fff;border-color:#1d1d1f}
.layer-side{display:grid;grid-template-columns:repeat(3,1fr)}
.layer-size{display:flex;align-items:center;gap:10px;font-size:12px;color:#6e6e73}
.layer-size input{flex:1}
.add-text{margin-top:10px;width:100%;border:1.5px dashed #b9b9c0;background:none;border-radius:12px;padding:10px;font-weight:600;color:#1d1d1f}
.add-text:hover:not(:disabled){border-color:#1d1d1f;background:#f5f5f7}
.add-text:disabled{opacity:.5;cursor:default}
.side-switch{display:flex;width:max-content;margin:14px auto 0}
.text-layer{position:absolute;white-space:nowrap;cursor:grab;touch-action:none;mix-blend-mode:multiply;line-height:1.1;padding:.05em 0;border-radius:4px;user-select:none;opacity:.92;z-index:2;text-shadow:0 1px 0 #ffffff66}
.text-layer.selected,.text-layer:focus-visible{outline:1.5px dashed #0071e3;outline-offset:2px}
.text-layer:active{cursor:grabbing}

.artwork .handle{position:absolute;width:12px;height:12px;min-width:12px;padding:0;background:#fff;border:1.5px solid #0071e3;border-radius:3px;opacity:0;transition:opacity .12s;touch-action:none;z-index:3}
.artwork:hover .handle,.artwork:focus .handle,.artwork.moving .handle,.artwork:hover .rot-stem,.artwork:focus .rot-stem,.artwork.moving .rot-stem{opacity:1}
.handle.nw{left:-6px;top:-6px;cursor:nwse-resize}.handle.se{right:-6px;bottom:-6px;cursor:nwse-resize}
.handle.ne{right:-6px;top:-6px;cursor:nesw-resize}.handle.sw{left:-6px;bottom:-6px;cursor:nesw-resize}
.handle.rot{left:calc(50% - 7px);top:-30px;width:14px;height:14px;min-width:14px;border-radius:50%;cursor:grab;background:#0071e3;border-color:#fff;box-shadow:0 0 0 1.5px #0071e3}
.rot-stem{position:absolute;left:50%;top:-18px;width:1.5px;height:18px;background:#0071e3;opacity:0;transform:translateX(-50%);pointer-events:none;transition:opacity .12s}
@media (hover:none){.artwork .handle,.rot-stem{opacity:1}}

.viewer3d{position:relative;width:min(100%,720px);aspect-ratio:1.55;border-radius:22px;background:#05060b;border:1px solid #1c2030;overflow:hidden;cursor:grab;touch-action:none}
.viewer3d[hidden]{display:none}
.viewer3d.dragging{cursor:grabbing}
.viewer-mount,.viewer-mount canvas{width:100%;height:100%;display:block}
.viewer-mount{position:relative;z-index:1}
.viewer-stars{position:absolute;left:0;top:0;width:100%;height:100%;z-index:0;pointer-events:none;filter:blur(.8px)}
.viewer-loading{position:absolute;inset:0;display:none;align-items:center;justify-content:center;font-size:13px;color:#9aa0b0;background:#05060b;z-index:3}
.viewer3d.loading .viewer-loading{display:flex}
.viewer-bar{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 14px;font-size:12px;color:#8b92a5;pointer-events:none;z-index:2}
.viewer-bar button{pointer-events:auto;border:1px solid #2a3040;background:#10131d;border-radius:999px;padding:5px 14px;font-size:12px;font-weight:600;color:#e8eaf0}
.viewer-bar button:hover{background:#171b28}

.layer:not(.active) .layer-more{display:none}
.layer-more{display:grid;gap:10px}
.layer-seg{display:grid;grid-template-columns:repeat(3,1fr)}
.layer-caps{display:flex;align-items:center;gap:8px;font-size:12px;color:#6e6e73}
.layer-head{cursor:pointer}
.back-art{position:absolute;left:5%;top:5%;width:90%;height:90%;mix-blend-mode:multiply;pointer-events:none;user-select:none;opacity:.92}
.back-art[hidden]{display:none}
.studio-top .text-button+.text-button{margin-left:6px}
.tpl-open{display:flex;align-items:center;gap:14px;width:100%;margin:0 0 18px;padding:14px 16px;border:1px solid #1d1d1f;background:#1d1d1f;color:#fff;border-radius:14px;text-align:left;font-weight:600;font-size:14px}
.tpl-open small{display:block;font-weight:400;font-size:12px;color:#c9c9ce;margin-top:2px}
.tpl-open:hover{background:#000}
.tpl-open-count{font-size:22px;font-weight:700;letter-spacing:-.02em;border-right:1px solid #ffffff40;padding-right:14px}
.tpl-dialog{width:min(1120px,94vw);max-height:90vh;border:0;border-radius:22px;padding:26px;background:#fff;color:#1d1d1f;box-shadow:0 30px 80px #00000055}
.tpl-dialog::backdrop{background:#0c0c0ea6}
.tpl-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.tpl-head h2{margin:0;font-size:24px}
.tpl-head .eyebrow{margin:0 0 4px}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:18px}
.tpl-card{display:grid;gap:5px;padding:10px 10px 14px;border:1px solid #e3e3e8;border-radius:16px;background:#fafafb;text-align:left;transition:border-color .15s,transform .15s,box-shadow .15s}
.tpl-card:hover,.tpl-card:focus-visible{border-color:#1d1d1f;transform:translateY(-2px);box-shadow:0 10px 24px #00000018;outline:none}
.tpl-card canvas{width:100%;height:auto;display:block;border-radius:10px;background:#e9e9ee;aspect-ratio:642/405}
.tpl-name{font-weight:700;font-size:15px;margin-top:6px}
.tpl-vibe{font-size:12.5px;color:#6e6e73;line-height:1.35}
