[hidden]{display:none!important}
.tool-shell{max-width:1120px;margin:0 auto}
.tool-heading{max-width:800px;margin-bottom:24px}
.tool-heading h1{font-size:clamp(34px,5vw,54px);line-height:1.02;margin:4px 0 12px}
.tool-heading p{font-size:18px;line-height:1.6;color:var(--muted,#667085)}
.back-link{display:inline-block;margin-bottom:22px;color:#2563eb;text-decoration:none;font-weight:700}
.tool-title-line{display:flex;align-items:center;gap:14px}.tool-title-line h1{margin:0}.tool-title-icon{width:52px;height:52px;border-radius:13px;object-fit:cover;display:block;flex:0 0 52px}
.chip-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.chip{display:inline-flex;align-items:center;padding:8px 12px;border:1px solid var(--line,#d7ddea);border-radius:999px;background:var(--surface,#fff);font-size:14px;font-weight:700;color:var(--text,#344054)}
.tool-workspace{display:grid;grid-template-columns:minmax(310px,.95fr) minmax(0,1.35fr);gap:22px;align-items:start}
.tool-form,.preview-card{background:var(--surface,#fff);border:1px solid var(--line,#dfe4ec);border-radius:18px;padding:22px;box-shadow:0 5px 22px rgba(16,24,40,.04)}
.field{margin-bottom:18px}.field label{display:block;font-weight:750;margin-bottom:7px}.field input[type=text]{width:100%;padding:12px;border:1px solid #cfd6e2;border-radius:11px;background:var(--surface,#fff);color:var(--text,#111827);font:inherit}.field input[type=color]{width:100%;height:46px;border:1px solid #cfd6e2;border-radius:11px;background:var(--surface,#fff);padding:4px}
.field-range input[type=range]{width:100%}.range-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.range-head strong{font-size:14px;color:var(--text,#0f172a)}
.options-grid{display:grid;gap:12px}.options-grid-2{grid-template-columns:1fr 1fr}
.check-row{display:flex;gap:9px;align-items:flex-start;font-weight:650;margin:6px 0 10px}
.button-row{display:flex;gap:10px;flex-wrap:wrap}.compact-actions{margin-bottom:14px}.mini-help{font-size:14px;color:var(--muted,#667085);margin:0 0 18px}.tool-submit{width:100%}
.preview-stack{display:grid;gap:22px}.preview-label{font-size:13px;font-weight:800;color:var(--muted,#475467);margin-bottom:12px;text-transform:uppercase;letter-spacing:.06em}
.preview-stage{min-height:260px;border:1px dashed #cbd5e1;border-radius:14px;background:var(--bg,#f8fafc);display:grid;place-items:center;overflow:hidden;color:#98a2b3;text-align:center;padding:14px}.result-stage img{display:block;max-width:100%;max-height:620px;object-fit:contain}.preview-stage-editor{padding:12px}
.meme-canvas-wrap{position:relative;display:inline-block;max-width:100%;max-height:620px;line-height:0;border-radius:10px;overflow:hidden;background:#111827;touch-action:none}
.meme-canvas-wrap canvas{display:block;max-width:100%;max-height:620px;width:auto;height:auto;cursor:default;touch-action:none;user-select:none;-webkit-user-select:none}
.meme-canvas-wrap canvas.is-over-text{cursor:grab}.meme-canvas-wrap canvas.is-dragging{cursor:grabbing}
.editor-hint{margin-top:10px;color:var(--muted,#667085);font-size:13px;text-align:center}
.result-actions{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.tool-progress{display:flex;flex-direction:column;gap:10px;color:var(--muted,#475467);margin-top:15px}.progress-meta{display:flex;align-items:center;gap:10px;justify-content:flex-start}.progress-meta strong{margin-left:auto;color:var(--text,#0f172a)}.progress-bar{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden}.progress-bar span{display:block;height:100%;width:0;background:linear-gradient(90deg,#2563eb,#4f8dff);border-radius:999px;transition:width .18s ease}
.spinner{width:18px;height:18px;border:2px solid #d0d5dd;border-top-color:#2563eb;border-radius:50%;animation:wcspin .7s linear infinite}@keyframes wcspin{to{transform:rotate(360deg)}}
.upload-dropzone{position:relative;border:2px dashed #bfd0ec;border-radius:14px;background:color-mix(in srgb,var(--surface,#fff) 92%,#2563eb 8%);padding:20px;text-align:center;cursor:pointer;transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease;outline:none}.upload-dropzone:hover,.upload-dropzone:focus,.upload-dropzone.is-dragover{border-color:#2563eb;background:color-mix(in srgb,var(--surface,#fff) 84%,#2563eb 16%);box-shadow:0 0 0 4px rgba(37,99,235,.08)}.upload-dropzone-inner{display:grid;gap:6px;justify-items:center}.upload-icon{width:42px;height:42px;border-radius:999px;background:#dbeafe;color:#1d4ed8;display:grid;place-items:center;font-weight:900;font-size:22px}.upload-title{font-weight:800;color:var(--text,#0f172a)}.upload-note{color:var(--muted,#667085);font-size:14px}.sr-only-file{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;overflow:hidden;clip:rect(0 0 0 0)}
@media(max-width:900px){.tool-workspace{grid-template-columns:1fr}}
@media(max-width:560px){.options-grid-2{grid-template-columns:1fr}.result-actions{flex-direction:column}.tool-form,.preview-card{padding:18px}}
@media(prefers-reduced-motion:reduce){.meme-tool *{scroll-behavior:auto!important;transition:none!important}}
