
:root{
  --bg:#f4f5fb;--surface:#f8f9fd;--surface2:#eef0f8;--ink:#292a35;--muted:#797d91;
  --line:#dfe2ed;--violet:#7a6ee6;--violet2:#a99ff6;--mint:#dff4e9;--peach:#f9e6dc;
  --sky:#e2edfb;--rose:#f7e2ea;--shadow1:#d8dae3;--shadow2:#ffffff;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,Segoe UI,Arial,sans-serif}
button,input,select{font:inherit} button,a,label{touch-action:manipulation}
.app-shell{max-width:1540px;margin:auto;padding:26px 28px 60px}
.topbar{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:22px}
.brand{display:flex;align-items:center;gap:16px}.brand-mark{width:52px;height:52px;border-radius:18px;display:grid;place-items:center;font-weight:800;background:linear-gradient(135deg,#cfc9ff,#efeaff);box-shadow:7px 7px 16px var(--shadow1),-7px -7px 16px var(--shadow2)}
h1{font-size:30px;margin:2px 0 4px}h2{font-size:22px;margin:3px 0 5px}h3{margin:0 0 6px}.eyebrow,.kicker{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--violet)}
p{margin:0}.muted,.hint,small{color:var(--muted)}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}
.steps{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:0 0 26px}
.steps button{border:0;background:transparent;color:var(--muted);padding:12px;border-radius:16px;display:flex;gap:9px;align-items:center;justify-content:center;cursor:pointer}
.steps button b{width:26px;height:26px;border-radius:9px;display:grid;place-items:center;background:#e6e8f1}
.steps button.active{background:var(--surface);color:var(--ink);box-shadow:5px 5px 13px var(--shadow1),-5px -5px 13px var(--shadow2)}
.steps button.active b{background:var(--violet);color:white}.step{display:none}.step.active{display:block}.section-head{margin-bottom:18px}
.upload-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:18px}
.file-tile,.action-card,.library-card,.simple-card,.tool-panel,.design-stage,.bottom-actions{background:var(--surface);border:1px solid rgba(255,255,255,.65);box-shadow:8px 8px 20px var(--shadow1),-8px -8px 20px var(--shadow2)}
.file-tile{min-height:150px;border-radius:24px;padding:22px;display:grid;grid-template-columns:auto 1fr;gap:15px;align-content:center;cursor:pointer;position:relative;overflow:hidden}
.file-tile.peach{background:linear-gradient(145deg,var(--surface),var(--peach))}.file-tile.mint{background:linear-gradient(145deg,var(--surface),var(--mint))}.file-tile.sky{background:linear-gradient(145deg,var(--surface),var(--sky))}
.file-tile input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}.photo-tile input[type=file]{position:absolute;inset:auto;opacity:0;pointer-events:none}
.tile-icon{width:46px;height:46px;border-radius:15px;background:rgba(255,255,255,.65);display:grid;place-items:center;font-size:24px}
.tile-copy{display:flex;flex-direction:column;gap:5px}.tile-copy strong{font-size:18px}.mini-file{position:relative;z-index:2;display:inline-flex;width:max-content;padding:8px 11px;border-radius:11px;background:rgba(255,255,255,.75);font-size:12px;font-weight:700;margin-right:6px;cursor:pointer}.mini-file input{position:absolute!important;inset:0!important;opacity:0!important;pointer-events:auto!important}
.action-card,.library-card,.simple-card{border-radius:26px;padding:22px;margin-bottom:20px}.action-card{display:flex;align-items:center;justify-content:space-between;gap:24px;background:linear-gradient(145deg,#f8f9fd,#f0effd)}
.primary,.ghost,.tool-action,.download{border:0;border-radius:14px;padding:12px 16px;font-weight:750;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.primary{background:linear-gradient(135deg,var(--violet),#8e81ef);color:#fff;box-shadow:5px 5px 12px #d0d1dc,-4px -4px 10px #fff}
.primary:hover{filter:brightness(1.03)}.primary:disabled{opacity:.55;cursor:wait}.primary.is-loading{animation:pulse 1.1s infinite}
.ghost{background:var(--surface2);color:var(--ink);box-shadow:inset 1px 1px 0 #fff,4px 4px 10px #d8dae4,-3px -3px 8px #fff}.danger{color:#a54b68}.full{width:100%}
.hero-action{min-width:210px;min-height:64px;flex-direction:column}.hero-action small{color:rgba(255,255,255,.78);font-weight:500}
.status{min-height:22px;margin-top:10px;color:#54596e;font-size:13px}.library-top,.template-editor{display:flex;justify-content:space-between;gap:18px;align-items:flex-end}.template-editor{margin:18px 0;align-items:end}.template-editor label{flex:1}.template-buttons{display:flex;gap:8px}
.saved-template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}.saved-template-card{border-radius:18px;background:#f2f3f8;padding:15px;border:1px solid #e4e5ed}.saved-template-card h3{font-size:16px}
label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:700;color:#62677b}input,select{width:100%;border:1px solid #e0e2ec;background:#f2f3f8;color:#282a35;border-radius:12px;padding:11px 12px;outline:none}input:focus,select:focus{border-color:#b8b1f5;box-shadow:0 0 0 3px rgba(122,110,230,.10)}
.designer-shell{display:grid;grid-template-columns:250px minmax(0,1fr) 285px;gap:18px;align-items:start}.tool-panel,.design-stage{border-radius:24px;padding:18px}.tool-panel{display:flex;flex-direction:column;gap:12px}.panel-title{display:flex;gap:10px;align-items:center}.panel-title>span{width:30px;height:30px;border-radius:10px;background:#e9e7fb;color:var(--violet);display:grid;place-items:center;font-weight:800}.panel-title div{display:flex;flex-direction:column}.panel-title small{font-size:10px;font-weight:500}.divider{height:1px;background:var(--line);margin:7px 0}.two{display:grid;grid-template-columns:1fr 1fr;gap:9px}.tool-action{background:linear-gradient(135deg,#e8e5ff,#d8d4fb);color:#554ca9}.tool-action.alt{background:linear-gradient(135deg,#e3f4ec,#d2ebde);color:#3d7c5e}
.placement-status{font-size:12px;padding:10px;border-radius:12px;background:#eceef6;color:#686d82}.design-stage{min-width:0}.stage-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.stage-toolbar>div{display:flex;gap:12px;align-items:baseline}.stage-toolbar span{font-size:12px;color:var(--muted)}
.canvas-frame{display:flex;justify-content:center;align-items:flex-start;padding:18px;border-radius:20px;background:#e9ebf2;overflow:auto;max-height:78vh}.card-canvas{position:relative;width:min(100%,760px);background:#fff;overflow:hidden;box-shadow:0 10px 24px rgba(55,58,78,.18)}.card-canvas img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;display:none}.no-preview{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:20px;color:var(--muted);background:#f0f1f6}.stage-note{font-size:11px;color:var(--muted);margin-top:10px;text-align:center}
#placeholderLayer,#refineLayer{position:absolute;inset:0}.ph{position:absolute;border:1px dashed rgba(92,81,195,.75);cursor:move;display:flex;align-items:center;min-width:4px;min-height:4px;background:transparent!important}.ph.selected{border:2px solid var(--violet);box-shadow:0 0 0 2px rgba(122,110,230,.10)}.ph .tag{width:100%;height:100%;display:flex;align-items:center;padding:0 3px;background:transparent!important;color:#12131a;overflow:hidden;white-space:nowrap}.ph.photo .tag{justify-content:center;color:#6c6f7f;font-size:10px}.ph.circle{border-radius:50%}.resize-handle{position:absolute;right:-4px;bottom:-4px;width:9px;height:9px;border-radius:50%;background:var(--violet);cursor:nwse-resize}.empty-state{padding:16px;border-radius:15px;background:#edeef4;color:var(--muted);text-align:center}.check{flex-direction:row;align-items:center;font-weight:600}.check input{width:auto}.bottom-actions{margin-top:18px;border-radius:20px;padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.file-button{position:relative;overflow:hidden}.file-button input{position:absolute;inset:0;opacity:0;cursor:pointer}.refine-grid{display:grid;grid-template-columns:250px minmax(0,1fr) 285px;gap:18px;align-items:start}.member-list{max-height:78vh;overflow:auto}.member-title{font-weight:750}.validation{margin-top:18px}.export-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:480px;margin:18px 0}.download{margin-top:12px;background:#dff4e9;color:#2c6f50}.placement-crosshair{pointer-events:none}.placing{cursor:crosshair}.place-active{outline:3px solid rgba(122,110,230,.18)}
@keyframes pulse{50%{transform:translateY(-1px);filter:brightness(1.07)}}
@media(max-width:1050px){.designer-shell,.refine-grid{grid-template-columns:220px minmax(0,1fr)}.properties{grid-column:1/-1}.upload-grid{grid-template-columns:1fr}.library-top,.template-editor{align-items:stretch;flex-direction:column}.template-buttons{width:100%}.template-buttons>*{flex:1}}
@media(max-width:700px){.app-shell{padding:16px 12px 40px}.topbar{align-items:flex-start;flex-direction:column}.steps button span{display:none}.designer-shell,.refine-grid{grid-template-columns:1fr}.action-card,.bottom-actions{align-items:stretch;flex-direction:column}.hero-action{width:100%}.upload-grid{gap:12px}.canvas-frame{padding:8px}.two{grid-template-columns:1fr 1fr}.template-editor{display:flex}.top-actions{width:100%;justify-content:flex-end}}

.upload-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.file-tile em{font-style:normal;font-size:12px;color:#767b90;margin-top:7px;display:block}.file-tile.selected{outline:2px solid rgba(122,110,230,.25);box-shadow:8px 8px 20px var(--shadow1),-8px -8px 20px var(--shadow2),0 0 0 4px rgba(122,110,230,.06)}.file-tile.selected em{color:#3f775e;font-weight:800}.side-tabs{display:flex;align-items:center;gap:8px;margin:0 0 16px}.side-tab,.refine-side-tab{border:0;border-radius:14px;padding:11px 24px;background:#e8eaf2;color:#686d82;font-weight:800;cursor:pointer}.side-tab.active,.refine-side-tab.active{background:linear-gradient(135deg,#7a6ee6,#9287ef);color:#fff;box-shadow:5px 5px 12px #d1d2dc,-4px -4px 10px #fff}.side-tabs span{font-size:11px;color:#8a8ea1;font-weight:800;letter-spacing:.08em}.font-chips{display:flex;gap:6px;flex-wrap:wrap}.font-chips span{padding:6px 9px;border-radius:10px;background:#eceaf9;color:#6159a8;font-size:11px;font-weight:800}.ph .tag{background:transparent!important}.ph{background:transparent!important}.properties input[type=color]{height:42px;padding:5px}.photo-tile .row{position:relative;z-index:4}@media(max-width:1250px){.upload-grid.four{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.upload-grid.four{grid-template-columns:1fr}}

/* Placement/drag restoration */
#placeholderLayer,#refineLayer{pointer-events:none}
.ph{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;border-radius:4px!important}
.ph.photo.circle{border-radius:50%!important}
.ph.text,.ph:not(.photo){border-radius:4px!important}
.ph.dragging{z-index:999;border-style:solid;box-shadow:0 5px 16px rgba(62,55,130,.18)}
.ph .tag{pointer-events:none;user-select:none;-webkit-user-select:none}
.resize-handle{pointer-events:auto;width:14px;height:14px;right:-7px;bottom:-7px;border:2px solid #fff;box-shadow:0 2px 5px rgba(0,0,0,.18);z-index:5}
.placement-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.ghost.compact{padding:9px 8px;font-size:11px}
.nudge-tools{display:grid;grid-template-columns:repeat(4,38px) 1fr;gap:6px;align-items:center;margin:8px 0 12px}
.nudge-tools button{height:38px;border:0;border-radius:10px;background:#e9eaf3;color:#514a9c;font-weight:900;cursor:pointer;box-shadow:3px 3px 7px #d7d9e2,-2px -2px 6px #fff}
.nudge-tools button:active{box-shadow:inset 2px 2px 5px #d3d5df,inset -2px -2px 5px #fff}
.nudge-tools span{font-size:10px;color:#85899c;line-height:1.25}
#pFont option[value="Montserrat"],#pFont option[value="Shree-Dev-1266"]{font-weight:700}
#canvas.placing{cursor:crosshair}
@media(max-width:700px){.placement-tools{grid-template-columns:1fr}.nudge-tools{grid-template-columns:repeat(4,1fr)}.nudge-tools span{grid-column:1/-1}}

/* Text alignment controls */
.text-align-block{display:flex;flex-direction:column;gap:7px}
.prop-caption{font-size:12px;font-weight:700;color:#62677b}
.align-segment{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding:5px;border-radius:14px;background:#e9eaf2;box-shadow:inset 2px 2px 5px #d9dbe4,inset -2px -2px 5px #fff}
.align-btn{min-height:42px;border:0;border-radius:10px;background:transparent;color:#686d82;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px}
.align-btn span{font-size:11px}
.align-btn:hover{background:rgba(255,255,255,.55)}
.align-btn.active{background:linear-gradient(135deg,#7a6ee6,#9084ef);color:#fff;box-shadow:3px 3px 7px #d3d4de,-2px -2px 5px #fff}
.sr-control{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
