.core-tools{display:grid;gap:16px;padding:4px 0;color:var(--ink)}.core-tools p,.core-note{font-size:12px;line-height:1.6;color:var(--muted);margin:0}.core-tools label{font-size:12px;font-weight:650;display:flex;align-items:center;justify-content:space-between;gap:10px}.core-tools input[type=color]{width:48px;height:36px;border:1px solid var(--line);border-radius:8px;background:white;padding:3px}.core-tabs{display:flex;gap:6px;flex-wrap:wrap}.core-tools button{font:inherit;cursor:pointer;border:1px solid var(--line);border-radius:10px;background:white;color:var(--ink);padding:11px 12px;min-height:42px;font-size:12px}.core-tools button:hover,.core-tools button:focus-visible{border-color:var(--violet);background:#f7f3ff}.core-tabs button[aria-pressed=true]{background:#ede6ff;border-color:var(--violet);color:#6238bd}.core-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.core-grid button{display:flex;flex-direction:column;align-items:center;gap:10px}.core-grid button>span{height:44px;display:grid;place-items:center;font-size:32px;color:#7549db}.core-tools .core-primary{background:var(--violet);color:white}.core-tools fieldset{margin:0;padding:12px;border:1px solid var(--line);border-radius:12px}.core-tools legend{font-size:12px;font-weight:700}.core-colours{display:flex;gap:12px;margin-bottom:12px}.core-colours label{flex-direction:column}.frame-preview{width:44px;border:4px solid #b39ae8;background:#eee8fa}.frame-preview.circle{border-radius:50%}.frame-preview.polaroid{border-bottom-width:12px}.frame-preview.phone{width:26px;border-radius:8px}.frame-preview.collage{box-shadow:8px 0 0 #d4c5ef}.creative-photo-frame{display:flex;align-items:center;justify-content:center;box-sizing:border-box;overflow:hidden}.creative-photo-frame img{width:100%;height:100%;object-fit:cover;pointer-events:none;min-height:0}.creative-photo-frame .frame-hint{font:14px Arial,sans-serif;color:#74619b;pointer-events:none}.property-body :disabled{opacity:.5;cursor:not-allowed}.format-buttons button:focus-visible,.effect-grid button:focus-visible{outline:2px solid var(--violet);outline-offset:2px}@media(max-width:1050px){.cs-app.property-sheet .properties-panel{display:block;position:fixed;right:16px;bottom:120px;width:min(340px,calc(100% - 32px));max-height:65vh;overflow:auto;z-index:125;border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 70px #14203b38}}@media(max-width:760px){.mobile-tool-nav{justify-content:flex-start;overflow-x:auto}.mobile-tool-nav button{flex-shrink:0;min-width:65px}.cs-app.property-sheet .properties-panel{left:12px;right:12px;bottom:120px;width:auto}.core-grid button{min-height:94px}}

.canvas-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}

.selection-box{z-index:20;transform-origin:center}.selection-box .handle{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;width:24px;height:24px;padding:0;border:0;background:transparent;position:absolute}.selection-box .handle:after{content:"";position:absolute;inset:7px;border:2px solid #7040e8;border-radius:50%;background:white}.selection-box .handle.nw{left:-13px;top:-13px;cursor:nwse-resize}.selection-box .handle.ne{right:-13px;top:-13px;cursor:nesw-resize}.selection-box .handle.sw{left:-13px;bottom:-13px;cursor:nesw-resize}.selection-box .handle.se{right:-13px;bottom:-13px;cursor:nwse-resize}.selection-box .handle:focus-visible{outline:2px solid #7040e8;outline-offset:2px}.selection-box .handle:disabled{pointer-events:none;opacity:.4}.layer-size-fields{margin:12px 0 8px}.property-body .size-ratio{display:flex;align-items:center;gap:8px;font-size:11px}.size-ratio input{accent-color:var(--violet)}.size-help{font-size:11px;line-height:1.5;color:var(--muted)}

[data-apply-layer-size]{border:1px solid var(--line);border-radius:8px;background:#f5f0ff;color:#633bc1;font:inherit;font-size:11px;font-weight:700;padding:8px 12px;cursor:pointer}

.selection-box .handle{width:var(--resize-handle-size,40px);height:var(--resize-handle-size,40px)}.selection-box .handle:after{inset:calc((var(--resize-handle-size,40px) - var(--resize-dot-size,10px))/2)}.selection-box .handle.nw{left:calc(var(--resize-handle-size,40px)/-2 - 1px);top:calc(var(--resize-handle-size,40px)/-2 - 1px)}.selection-box .handle.ne{right:calc(var(--resize-handle-size,40px)/-2 - 1px);top:calc(var(--resize-handle-size,40px)/-2 - 1px)}.selection-box .handle.sw{left:calc(var(--resize-handle-size,40px)/-2 - 1px);bottom:calc(var(--resize-handle-size,40px)/-2 - 1px)}.selection-box .handle.se{right:calc(var(--resize-handle-size,40px)/-2 - 1px);bottom:calc(var(--resize-handle-size,40px)/-2 - 1px)}

.creative-photo-frame .frame-hint{pointer-events:auto;cursor:pointer;border:1px solid #b49de7;border-radius:10px;background:#ffffffed;color:#603cad;padding:10px 14px;font:600 14px Arial,sans-serif;max-width:100%;min-height:40px;touch-action:manipulation}.creative-photo-frame .frame-hint:focus-visible{outline:3px solid #9671ed;outline-offset:3px}
.real-template-library{display:grid;gap:12px}.real-template-library label{display:grid;gap:6px;font-size:12px;font-weight:650}.real-template-library input,.real-template-library select{width:100%;min-height:40px;border:1px solid var(--line);border-radius:9px;padding:9px 10px;background:white;color:var(--ink);font:inherit}.template-library-note{font-size:11px;line-height:1.5;color:var(--muted);margin:0}.real-template-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}.real-template-card{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;padding:0;background:white;color:var(--ink);text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s}.real-template-card:hover,.real-template-card:focus-visible{border-color:var(--violet);box-shadow:0 5px 15px #7549db18;outline:2px solid transparent}.real-template-preview{display:block;position:relative;container-type:inline-size;overflow:hidden;width:100%;pointer-events:none}.real-template-preview .canvas-bg-shape{position:absolute;opacity:1}.real-template-preview img{display:block;pointer-events:none}.real-template-info{display:grid;gap:4px;padding:10px}.real-template-info b{font-size:12px;line-height:1.35}.real-template-info small{font-size:10px;color:var(--muted)}.template-photo-placeholder{display:grid;text-align:center;gap:3px;place-content:center;color:#887c6d;font-size:7cqw}.template-photo-placeholder small{font-size:4cqw;font-weight:400}.cs-template-grid .real-template-info{padding:14px}.cs-template-grid .real-template-info b{font-size:15px}.cs-template-grid .real-template-info small{font-size:12px}.creative-photo-frame .frame-replace{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);white-space:nowrap;display:none}.creative-photo-frame.selected .frame-replace,.creative-photo-frame:hover .frame-replace,.creative-photo-frame:focus-within .frame-replace{display:block}.real-template-library [data-template-status]{font-size:12px;color:var(--muted);margin:0}@media(max-width:760px){.real-template-grid{gap:10px}.real-template-info{padding:9px}.real-template-info b{font-size:12px}.cs-template-grid .real-template-info b{font-size:13px}}

.real-template-library{padding:0 12px 16px}
.text-template-library{display:grid;gap:14px;padding:0 12px 18px}.text-basic-actions{display:grid;gap:8px}.text-basic-actions button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:12px;text-align:left;font:700 13px Arial,sans-serif;color:var(--ink);cursor:pointer}.text-template-library>label{display:grid;gap:6px;font-size:12px;font-weight:700}.text-template-library select{min-height:40px;padding:9px;border:1px solid var(--line);border-radius:9px;font:inherit;background:#fff;color:var(--ink)}.text-template-library>p{font-size:11px;color:var(--muted);line-height:1.5;margin:0}.text-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.text-style-card{border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden;cursor:pointer;padding:0;text-align:left;min-width:0;color:var(--ink)}.text-style-card:hover,.text-style-card:focus-visible{border-color:var(--violet);box-shadow:0 4px 14px #7549db18}.text-style-preview{height:114px;padding:9px;display:flex;align-items:center;justify-content:center;container-type:inline-size;background:#f7f6fa;pointer-events:none}.text-style-preview>span{display:block;white-space:pre-line;max-width:100%;box-sizing:border-box}.text-style-name{display:block;font:600 11px/1.4 Arial,sans-serif;padding:9px 10px}.text-basic-actions button:focus-visible,.text-style-card:focus-visible{outline:2px solid var(--violet);outline-offset:2px}@media(max-width:760px){.text-style-preview{height:128px}.text-style-name{font-size:12px}}

/* Canvas order is the single source of truth for screen and export stacking. */
.design-canvas > :not(.selection-box){z-index:0!important}.layer-actions button:disabled{opacity:.4;cursor:not-allowed}

.frame-preview.landscape{width:56px;height:42px}.frame-preview.portrait{width:32px;height:44px}.frame-preview.panoramic{width:62px;height:35px}.frame-preview.rounded{border-radius:14px}.frame-preview.oval{width:32px;border-radius:50%}.frame-preview.capsule{width:62px;height:32px;border-radius:50%}

.core-grid button>span svg{width:44px;height:44px;display:block}
.photo-edit-actions{border-top:1px solid var(--line);padding:16px}.photo-edit-actions h3{font-size:12px;margin:0 0 10px}.photo-edit-actions p{font-size:11px;line-height:1.5;color:var(--muted)}.photo-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}.photo-action-grid button,.photo-dialog-actions button{border:1px solid #ded9eb;background:#fff;color:#392c55;border-radius:10px;padding:11px;font:600 12px Arial;cursor:pointer;min-height:42px}.photo-action-grid button:hover{border-color:#7947d6;background:#f5f0ff}.photo-action-grid button:disabled{opacity:.4;cursor:not-allowed}.align-actions{grid-template-columns:repeat(3,1fr)}.photo-edit-dialog{width:min(700px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;border:1px solid #e3ddef;border-radius:20px;padding:20px;color:#242238;background:#fff;box-shadow:0 20px 100px #10102055}.photo-edit-dialog::backdrop{background:#17152588}.photo-edit-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.photo-edit-dialog h2{font:700 22px Arial;margin:0}.photo-edit-dialog header button{border:0;background:#f3f0f8;border-radius:50%;width:38px;height:38px;font-size:24px;color:#655b78;cursor:pointer}.photo-preview-wrap{background-color:#fff;background-image:linear-gradient(45deg,#eceaf1 25%,transparent 25%),linear-gradient(-45deg,#eceaf1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eceaf1 75%),linear-gradient(-45deg,transparent 75%,#eceaf1 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;border:1px solid #e7e1ef;border-radius:12px;overflow:hidden;display:grid;place-items:center;min-height:120px}.photo-preview-wrap canvas{max-width:100%;height:auto;max-height:44dvh;object-fit:contain}.photo-edit-dialog [data-photo-options]{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.photo-edit-dialog label{display:grid;gap:6px;flex:1;min-width:100px;font:600 12px Arial}.photo-edit-dialog input,.photo-edit-dialog select{width:100%;box-sizing:border-box;border:1px solid #ded9eb;border-radius:8px;padding:9px;font:14px Arial}.photo-edit-dialog [role=status]{font:13px/1.5 Arial;color:#6e657e;min-height:40px}.photo-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.photo-dialog-actions [data-photo-apply]{background:#7549d5;color:white;border-color:#7549d5}.photo-dialog-actions :disabled{opacity:.45;cursor:not-allowed}
.photo-source-dialog{width:min(360px,calc(100vw - 32px));box-sizing:border-box;border:1px solid #e2dced;border-radius:18px;padding:24px;background:white;color:#262339;box-shadow:0 20px 80px #17122d55}.photo-source-dialog::backdrop{background:#17152588}.photo-source-dialog h2{font:700 22px Arial;margin:0 0 10px}.photo-source-dialog p{font:14px/1.5 Arial;color:#756d85;margin-bottom:20px}.photo-source-dialog button{display:block;width:100%;margin-top:10px;padding:13px;border:1px solid #ded7ec;border-radius:10px;background:#f6f2fc;font:600 14px Arial;color:#623bb2;cursor:pointer}.photo-source-dialog [data-source-camera]{background:#7549d5;color:white}.tool-upload [data-panel-camera]{margin-top:8px}
/* Filled photo placeholders must not add colour behind transparent PNGs. */
.creative-photo-frame:has(> img):not([data-frame="phone"]):not([data-frame="polaroid"]){background:transparent!important}

.property-heading-actions{display:flex;align-items:center;gap:6px}.property-heading-actions button{border:0;background:none;color:#77839a;cursor:pointer;font-size:21px}.property-heading-actions [data-expand-properties]{display:none}
@media(max-width:760px){
 .cs-app.property-sheet .properties-panel[data-selection-kind="text"]{left:0;right:0;bottom:calc(66px + env(safe-area-inset-bottom));width:100%;height:min(270px,42dvh);max-height:none;border-radius:16px 16px 0 0;box-shadow:0 -8px 24px #14203b18;overflow:auto}
 .properties-panel[data-selection-kind="text"] .panel-heading{min-height:48px;padding:2px 12px;align-items:center;position:sticky;top:0;background:#fff;z-index:2}
 .properties-panel[data-selection-kind="text"] .panel-eyebrow{display:none}.properties-panel[data-selection-kind="text"] .panel-heading h2{font-size:14px;margin:0}
 .properties-panel[data-selection-kind="text"] .property-heading-actions button{min-width:44px;min-height:44px}.properties-panel[data-selection-kind="text"] [data-expand-properties]{display:block;font-size:12px;color:var(--violet);font-weight:700}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;padding:6px 12px 10px}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body>label:first-child,.properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body>.property-grid{grid-column:1/-1}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body label{font-size:10px;margin:0}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body textarea{height:52px;margin-top:3px;padding:6px 8px;font-size:16px;line-height:1.2}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-grid label{display:flex;align-items:center;gap:6px}.properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-grid select,.properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-grid input{min-width:0;margin:0;font-size:16px;height:44px;padding:6px}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .format-buttons{margin:0;gap:4px;align-items:center}.properties-panel[data-selection-kind="text"]:not(.is-expanded) .format-buttons button{min-width:40px;min-height:44px;width:40px;padding:0}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body>label:nth-of-type(2){font-size:0}.properties-panel[data-selection-kind="text"]:not(.is-expanded) .color-field{border:0;margin:0;padding:0}.properties-panel[data-selection-kind="text"]:not(.is-expanded) .color-field span{display:none}.properties-panel[data-selection-kind="text"]:not(.is-expanded) .color-field input{width:44px;height:44px;min-height:44px}
 .properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body>label:nth-of-type(3),.properties-panel[data-selection-kind="text"]:not(.is-expanded) .property-body>details,.properties-panel[data-selection-kind="text"]:not(.is-expanded) .danger-actions,.properties-panel[data-selection-kind="text"]:not(.is-expanded) .photo-edit-actions{display:none}
 .cs-app.property-sheet:has(.properties-panel[data-selection-kind="text"]) .mobile-context-actions{display:none}
 .cs-app.property-sheet:has(.properties-panel[data-selection-kind="text"]:not(.is-expanded)) .canvas-area{height:calc(100% - min(270px,42dvh) + 46px)}
 .cs-app.property-sheet .properties-panel[data-selection-kind="text"].is-expanded{height:58dvh;max-height:calc(100dvh - 124px)}
}

.core-tools .frame-category-label{display:grid;gap:7px}.frame-category-label select{width:100%;min-height:42px;border:1px solid var(--line);border-radius:9px;background:white;color:var(--ink);padding:8px;font:inherit}.core-grid .frame-preview.custom-outline{width:62px;height:54px;border:0;background:transparent}.frame-preview.custom-outline svg{width:100%;height:100%;overflow:visible}.frame-preview.custom-outline polygon{fill:#e5daf7;stroke:#9872d7;stroke-width:2;stroke-linejoin:round}

.core-tools .library-search{display:grid;gap:7px}.library-search input,.text-template-library input[type=search]{min-height:42px;width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--line);border-radius:9px;background:white;color:var(--ink);font:inherit}.core-grid button>span svg{width:52px;height:44px}

.creative-photo-frame[style*="clip-path"] .frame-replace{top:50%;bottom:auto;transform:translate(-50%,-50%)}
