*{box-sizing:border-box}
body{margin:0;background:#f5f7fb;color:#172033;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Noto Sans Bengali","Noto Sans",sans-serif}
header{height:62px;background:#111827;color:#fff;padding:0 18px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:20}
header a{color:#fff;text-decoration:none}
main{max-width:1120px;margin:auto;padding:18px}
.hero{background:#fff;padding:22px;border-radius:20px;margin-bottom:16px}
.hero h1{margin:0 0 7px}
.search{display:flex;gap:8px}
.search input,.filters select,.formbox input{width:100%;padding:12px;border:1px solid #d8deea;border-radius:11px;font-size:15px}
.search button,.actions a,.actions button,.formbox button,.primary{padding:11px 15px;border:0;border-radius:11px;background:#4f46e5;color:#fff;text-decoration:none;font-weight:700}
.filters{display:flex;gap:8px;margin-top:9px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
.card{background:#fff;padding:18px;border-radius:18px}
.card small{color:#635bdb}
.quote{font-size:20px;line-height:1.5;margin:13px 0}
.author{color:#667085}
.actions{display:flex;gap:8px;margin-top:14px}
.actions button{background:#fff;color:#172033;border:1px solid #ddd}
.generator{max-width:650px;margin:auto}
.quoteimg{min-height:390px;border-radius:24px;background:linear-gradient(135deg,#312e81,#7c3aed);color:#fff;padding:35px;display:flex;flex-direction:column;justify-content:center;text-align:center;font-size:29px;line-height:1.5}
.quoteimg small{font-size:13px;opacity:.8}
.quoteimg p{font-size:16px}
.note,.help{color:#667085}

.maker{max-width:1080px;margin:auto}
.maker-head{background:#fff;border-radius:20px;padding:18px;margin-bottom:16px}
.maker-head h1{margin:0 0 5px;font-size:27px}
.maker-head p{margin:0;color:#667085}
.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}
.editor-preview-wrap{background:#fff;padding:14px;border-radius:20px;position:sticky;top:75px}
.quote-canvas{position:relative;width:100%;aspect-ratio:4/5;overflow:hidden;border-radius:18px;background:linear-gradient(135deg,#312e81,#7c3aed);touch-action:none;box-shadow:0 10px 30px rgba(0,0,0,.12)}
.bg-image,.bg-fallback,.shade{position:absolute;inset:0;width:100%;height:100%}
.bg-image{object-fit:cover;z-index:0}
.bg-fallback{z-index:0;background:linear-gradient(135deg,#312e81,#7c3aed)}
.shade{z-index:1;background:rgba(0,0,0,.34)}
.quote-text-layer{position:absolute;z-index:3;left:8%;right:8%;top:50%;transform:translateY(-50%);color:#fff;text-align:center;text-shadow:0 2px 8px rgba(0,0,0,.5);pointer-events:none}
.quote-category{font-size:12px;text-transform:uppercase;letter-spacing:1.5px;font-weight:800;opacity:.9;margin-bottom:18px}
.big-quote{font-size:clamp(22px,4vw,36px);line-height:1.4;font-weight:800}
.quote-author{font-size:15px;margin-top:18px;opacity:.95}
.avatar{position:absolute;z-index:5;width:110px;height:110px;border-radius:50%;overflow:hidden;border:4px solid #fff;box-shadow:0 4px 18px rgba(0,0,0,.35);cursor:grab;touch-action:none;transform:translate(-50%,-50%);background:#fff}
.avatar:active{cursor:grabbing}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.save-row{display:flex;gap:8px;margin-top:12px}
.save-row button{flex:1;padding:13px;border:0;border-radius:12px;font-weight:800;background:#fff;border:1px solid #d8deea;color:#172033}
.save-row .primary{background:#4f46e5;color:#fff;border-color:#4f46e5}
.status{min-height:20px;text-align:center;color:#4f46e5;font-weight:700;margin:8px 0 0}
.editor-controls{display:grid;gap:12px}
.control-box{background:#fff;padding:16px;border-radius:18px}
.control-box h3{margin:0 0 10px;font-size:16px}
.control-box button{width:100%;margin-top:7px;padding:10px;border:1px solid #d8deea;background:#fff;border-radius:10px;font-weight:700;color:#172033}
.control-box input[type=file]{width:100%;font-size:13px}
.control-box input[type=range]{width:100%}
.position-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.position-grid button{margin:0;font-size:12px}
.help{font-size:12px;line-height:1.5;margin:9px 0 0}

.formbox{max-width:430px;margin:50px auto;background:#fff;padding:25px;border-radius:20px}
.formbox form{display:grid;gap:10px}

@media(max-width:800px){
 .editor-layout{grid-template-columns:1fr}
 .editor-preview-wrap{position:relative;top:auto}
 .editor-controls{grid-template-columns:1fr 1fr}
 .control-box:last-child{grid-column:1/-1}
}
@media(max-width:600px){
 .search,.filters{flex-direction:column}
 .hero h1{font-size:24px}
 .quoteimg{min-height:360px;font-size:25px}
 main{padding:12px}
 .editor-controls{grid-template-columns:1fr}
 .control-box:last-child{grid-column:auto}
 .maker-head h1{font-size:23px}
 .quote-canvas{border-radius:14px}
 .big-quote{font-size:25px}
}
.save-row button{min-height:46px}.save-row button.primary{font-size:15px}.editor-preview-wrap{overflow:hidden}

/* Smart quote-image maker */
.smart-maker{max-width:760px;margin:auto}.smart-title{background:#fff;border-radius:18px;padding:16px 18px;margin-bottom:14px}.smart-title h1{margin:0 0 5px;font-size:25px}.smart-title p{margin:0;color:#667085;font-size:14px}.smart-card{background:#fff;padding:12px;border-radius:20px}.smart-shade{position:absolute;inset:0;z-index:1;transition:.25s}.text-panel{position:absolute;z-index:3;top:52%;transform:translateY(-50%);width:76%;pointer-events:none}.text-left{left:9%;text-align:left}.text-right{right:9%;text-align:right}.text-center{left:12%;width:76%;text-align:center}.text-panel.dark-text .quote-category,.text-panel.dark-text .big-quote,.text-panel.dark-text .quote-author{text-shadow:none}.text-panel.dark-text{color:#111827}.text-panel.long .big-quote{font-size:clamp(20px,3.4vw,31px);line-height:1.35}.text-panel .big-quote{font-size:clamp(22px,4.2vw,36px);line-height:1.4;font-weight:850}.text-panel .quote-category{font-size:11px;letter-spacing:1.5px;text-transform:uppercase;font-weight:800;margin-bottom:14px;opacity:.9}.text-panel .quote-author{font-size:14px;margin-top:16px;font-weight:600}.quick-actions{display:flex;gap:8px;margin-top:10px}.quick-actions button{flex:1;min-height:48px;border:0;border-radius:12px;background:#fff;border:1px solid #d8deea;font-weight:800;color:#172033}.quick-actions .primary{background:#4f46e5;color:#fff;border-color:#4f46e5}.photo-tools{margin-top:12px;padding:12px;border:1px solid #e5e7eb;border-radius:15px}.photo-upload{display:flex;align-items:center;justify-content:center;padding:11px;border:1px dashed #b8bfd0;border-radius:11px;font-weight:800;cursor:pointer}.photo-upload input{display:none}.photo-options{display:flex;gap:6px;align-items:center;margin-top:9px}.photo-options button{width:42px;height:38px;border:1px solid #d8deea;background:#fff;border-radius:9px;font-size:18px}.photo-options label{display:flex;align-items:center;gap:6px;flex:1;font-size:12px}.photo-options input{width:100%}.photo-tools p{margin:8px 0 0;color:#667085;font-size:12px;line-height:1.5}.tiny-status{text-align:center;min-height:20px;margin-top:9px;color:#4f46e5;font-size:13px;font-weight:800}
@media(max-width:600px){.smart-title h1{font-size:22px}.smart-card{padding:8px}.quick-actions{flex-direction:column}.text-panel .big-quote{font-size:24px}.text-panel.long .big-quote{font-size:21px}.text-panel .quote-category{font-size:9px}.text-panel .quote-author{font-size:12px}}

/* Smart quote previews on the main quote list */
.image-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.quote-photo-card{position:relative;display:block;min-height:260px;border-radius:16px;overflow:hidden;color:#fff;text-decoration:none;background:#1f2937;box-shadow:0 5px 18px rgba(0,0,0,.12);isolation:isolate}
.quote-photo-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-3;transition:transform .35s ease}
.quote-photo-overlay{position:absolute;inset:0;z-index:-2;background:linear-gradient(135deg,rgba(0,0,0,.62),rgba(0,0,0,.18) 62%,rgba(0,0,0,.48))}
.quote-photo-content{position:relative;z-index:1;min-height:260px;padding:20px;display:flex;flex-direction:column;justify-content:center;text-align:center;text-shadow:0 2px 8px rgba(0,0,0,.7)}
.quote-photo-content small{font-size:12px;opacity:.9;text-transform:capitalize;margin-bottom:10px}
.quote-photo-text{font-size:20px;line-height:1.45;font-weight:800;display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}
.quote-photo-author{font-size:13px;margin-top:13px;opacity:.95}
.make-hint{position:absolute;right:10px;bottom:10px;background:rgba(255,255,255,.92);color:#111827;padding:7px 10px;border-radius:999px;font-size:11px;font-weight:700;z-index:2}
.quote-photo-card:hover .quote-photo-bg{transform:scale(1.04)}
@media(max-width:760px){.image-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.quote-photo-card,.quote-photo-content{min-height:230px}.quote-photo-content{padding:14px}.quote-photo-text{font-size:17px;line-height:1.38}}
@media(max-width:430px){.image-grid{grid-template-columns:1fr}.quote-photo-card,.quote-photo-content{min-height:250px}.quote-photo-text{font-size:20px}}

.name-tools{margin-top:10px}.name-tools label{display:block;font-weight:800;font-size:13px}.name-tools input{display:block;width:100%;margin-top:6px;padding:11px 12px;border:1px solid #d8deea;border-radius:10px;font-size:15px}
