*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --primary:#6C63FF;--secondary:#4ECDC4;
  --bg:#0f0f14;--bg-surface:#18181f;--bg-card:#1e1e28;
  --border:rgba(255,255,255,.08);
  --text:#e8e8f0;--text-muted:#8888a8;--text-faint:#555570;
  --radius-sm:8px;--radius-md:14px;--radius-lg:20px;
  --transition:.18s cubic-bezier(.4,0,.2,1);
  /* editor */
  --editor-bg:#ffffff;--editor-text:#111827;
}
html{scroll-behavior:smooth}
body{font-family:'Inter',system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;-webkit-font-smoothing:antialiased;min-height:100vh}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:none;background:none}

/* ── HEADER ── */
.site-header{position:sticky;top:0;z-index:100;background:rgba(15,15,20,.9);backdrop-filter:blur(16px);border-bottom:1px solid var(--border)}
.header-inner{display:flex;align-items:center;gap:24px;height:64px;width:100%;max-width:1280px;margin-inline:auto;padding-inline:clamp(16px,4vw,48px)}
.logo{display:flex;align-items:center;gap:10px;flex-shrink:0}
.logo-icon{width:36px;height:36px}
.logo-text{font-size:1.1rem;font-weight:700;letter-spacing:-.02em;background:linear-gradient(135deg,#fff 40%,var(--primary));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.main-nav{display:flex;align-items:center;gap:4px;margin-left:auto}
.nav-link{padding:6px 14px;border-radius:var(--radius-sm);font-size:.9rem;font-weight:500;color:var(--text-muted);transition:all var(--transition)}
.nav-link:hover,.nav-link.active{color:var(--text);background:rgba(255,255,255,.06)}

/* ── LAYOUT ── */
.main-wrap{width:100%;max-width:1280px;margin-inline:auto;padding:clamp(16px,2.5vw,36px) clamp(16px,4vw,48px) clamp(40px,6vw,80px)}

/* ── HERO ── */
.tool-hero{text-align:center;padding:clamp(14px,2.5vw,28px) 0 clamp(16px,2.5vw,24px)}
.tool-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 14px;border-radius:999px;font-size:.75rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;background:rgba(108,99,255,.12);border:1px solid rgba(108,99,255,.3);color:#a78bfa;margin-bottom:14px}
.tool-title{font-size:clamp(1.8rem,4.5vw,2.8rem);font-weight:900;letter-spacing:-.04em;line-height:1.1;margin-bottom:8px}
.gradient-title{background:linear-gradient(135deg,var(--primary),var(--secondary));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.tool-subtitle{font-size:clamp(.88rem,2vw,1rem);color:var(--text-muted);max-width:520px;margin:0 auto}

/* ── EDITOR SHELL ── */
.editor-shell{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;display:flex;flex-direction:column}

/* ── TOOLBAR ── */
.rte-toolbar{display:flex;align-items:center;gap:2px;padding:8px 12px;background:var(--bg-surface);border-bottom:1px solid var(--border);flex-wrap:wrap;row-gap:4px}
.tb-group{display:flex;align-items:center;gap:2px}
.tb-sep{width:1px;height:20px;background:var(--border);margin:0 4px;flex-shrink:0}

.tb-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border-radius:6px;
  color:var(--text-muted);transition:all var(--transition);flex-shrink:0;
  position:relative;
}
.tb-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tb-btn:hover{background:rgba(255,255,255,.07);color:var(--text)}
.tb-btn.active{background:rgba(108,99,255,.15);color:#a78bfa}
.tb-btn[disabled]{opacity:.35;cursor:default;pointer-events:none}

/* wide buttons */
.tb-select{
  height:30px;padding:0 8px;border-radius:6px;
  background:rgba(255,255,255,.05);border:1px solid var(--border);
  color:var(--text-muted);font-size:.75rem;font-family:inherit;cursor:pointer;
  transition:all var(--transition);
}
.tb-select:focus{outline:none;border-color:var(--primary)}
.tb-select option{background:#1e1e28;color:#e8e8f0}

/* color input */
.tb-color{width:30px;height:30px;border-radius:6px;border:1px solid var(--border);padding:2px;cursor:pointer;background:rgba(255,255,255,.05)}
.tb-color::-webkit-color-swatch-wrapper{padding:0;border-radius:4px}
.tb-color::-webkit-color-swatch{border:none;border-radius:4px}

/* ── EDITOR AREA ── */
.rte-body{
  background:var(--editor-bg);
  color:var(--editor-text);
  min-height:480px;
  padding:clamp(20px,3vw,40px) clamp(20px,5vw,64px);
  font-family:Georgia,'Times New Roman',serif;
  font-size:1.05rem;
  line-height:1.8;
  outline:none;
  overflow-y:auto;
  caret-color:var(--primary);
}
.rte-body:empty::before{content:attr(data-placeholder);color:#aaa;pointer-events:none}
/* basic prose inside editor */
.rte-body h1{font-size:2rem;font-weight:700;margin:.6em 0 .3em;line-height:1.2}
.rte-body h2{font-size:1.5rem;font-weight:700;margin:.6em 0 .3em;line-height:1.3}
.rte-body h3{font-size:1.2rem;font-weight:700;margin:.5em 0 .3em}
.rte-body h4{font-size:1rem;font-weight:700;margin:.4em 0 .2em}
.rte-body p{margin:.5em 0}
.rte-body ul,.rte-body ol{margin:.5em 0 .5em 1.5em}
.rte-body li{margin:.2em 0}
.rte-body blockquote{border-left:4px solid #6C63FF;margin:.7em 0;padding:.4em 1em;color:#555;background:#f8f7ff;border-radius:0 6px 6px 0}
.rte-body pre,.rte-body code{font-family:'Fira Code',monospace;background:#f1f5f9;border-radius:4px;padding:2px 5px;font-size:.9em}
.rte-body pre{padding:12px 16px;display:block;overflow-x:auto}
.rte-body a{color:#6C63FF;text-decoration:underline}
.rte-body table{border-collapse:collapse;width:100%;margin:.7em 0}
.rte-body th,.rte-body td{border:1px solid #e5e7eb;padding:8px 12px;text-align:left}
.rte-body th{background:#f8f7ff;font-weight:700}
.rte-body img{max-width:100%;border-radius:4px;margin:.5em 0}
.rte-body hr{border:none;border-top:2px solid #e5e7eb;margin:1.2em 0}
.rte-body mark{background:#fef08a;color:#111;border-radius:2px;padding:0 2px}

/* focus ring */
.rte-body:focus{box-shadow:inset 0 0 0 2px rgba(108,99,255,.15)}

/* ── STATUS BAR ── */
.rte-statusbar{display:flex;align-items:center;gap:16px;padding:7px 16px;background:var(--bg-surface);border-top:1px solid var(--border);flex-wrap:wrap;font-size:.73rem;color:var(--text-faint)}
.rte-stat{display:flex;align-items:center;gap:4px}
.rte-stat span{color:var(--primary);font-weight:700;font-family:'Fira Code',monospace}
.rte-statusbar .spacer{flex:1}

/* ── OUTPUT TABS ── */
.output-tabs{display:flex;gap:0;margin-top:16px;border-bottom:1px solid var(--border)}
.output-tab{padding:9px 20px;font-size:.82rem;font-weight:600;color:var(--text-faint);border-bottom:2px solid transparent;cursor:pointer;transition:all var(--transition);margin-bottom:-1px}
.output-tab.active{color:var(--primary);border-bottom-color:var(--primary)}
.output-tab:hover:not(.active){color:var(--text-muted)}

.output-pane{display:none}
.output-pane.active{display:block}

.output-pre{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:16px;font-family:'Fira Code','JetBrains Mono',monospace;font-size:.82rem;line-height:1.75;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#86efac;margin-top:12px;max-height:320px;overflow-y:auto}
.output-preview{background:#fff;border:1px solid var(--border);border-radius:var(--radius-md);padding:clamp(16px,3vw,32px) clamp(20px,5vw,56px);margin-top:12px;min-height:160px;font-family:Georgia,serif;font-size:1rem;line-height:1.8;color:#111;max-height:480px;overflow-y:auto}

/* reuse prose styles in preview */
.output-preview h1{font-size:1.9rem;font-weight:700;margin:.5em 0 .25em;line-height:1.2}
.output-preview h2{font-size:1.4rem;font-weight:700;margin:.5em 0 .25em}
.output-preview h3{font-size:1.15rem;font-weight:700;margin:.4em 0 .2em}
.output-preview p{margin:.4em 0}
.output-preview ul,.output-preview ol{margin:.4em 0 .4em 1.4em}
.output-preview blockquote{border-left:4px solid #6C63FF;margin:.6em 0;padding:.4em 1em;color:#555;background:#f8f7ff;border-radius:0 6px 6px 0}
.output-preview pre,.output-preview code{font-family:'Fira Code',monospace;background:#f1f5f9;border-radius:4px;padding:2px 5px;font-size:.88em}
.output-preview a{color:#6C63FF;text-decoration:underline}
.output-preview table{border-collapse:collapse;width:100%;margin:.6em 0}
.output-preview th,.output-preview td{border:1px solid #e5e7eb;padding:7px 10px}
.output-preview th{background:#f8f7ff;font-weight:700}
.output-preview mark{background:#fef08a;color:#111;border-radius:2px;padding:0 2px}
.output-preview hr{border:none;border-top:2px solid #e5e7eb;margin:1em 0}

/* output action row */
.output-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.btn-out{display:inline-flex;align-items:center;gap:6px;padding:7px 16px;border-radius:var(--radius-sm);font-size:.82rem;font-weight:700;transition:all var(--transition);cursor:pointer}
.btn-out svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-linecap:round}
.btn-out-primary{background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff;border:none}
.btn-out-primary:hover{opacity:.88}
.btn-out-ghost{background:rgba(255,255,255,.05);border:1px solid var(--border);color:var(--text-muted)}
.btn-out-ghost:hover{border-color:rgba(255,255,255,.2);color:var(--text)}

/* ── MODAL ── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.65);backdrop-filter:blur(4px);z-index:200;display:flex;align-items:center;justify-content:center;padding:20px}
.modal-box{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;width:100%;max-width:420px;display:flex;flex-direction:column;gap:14px}
.modal-title{font-size:1rem;font-weight:700;margin-bottom:2px}
.modal-input{width:100%;background:var(--bg-surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 14px;color:var(--text);font-size:.9rem;outline:none;transition:border-color var(--transition);font-family:inherit}
.modal-input:focus{border-color:var(--primary)}
.modal-row{display:flex;gap:8px}
.modal-btn{flex:1;padding:9px 16px;border-radius:var(--radius-sm);font-size:.85rem;font-weight:700;cursor:pointer;font-family:inherit;border:none;transition:all var(--transition)}
.modal-btn-primary{background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff}
.modal-btn-primary:hover{opacity:.88}
.modal-btn-ghost{background:rgba(255,255,255,.06);border:1px solid var(--border);color:var(--text-muted)}
.modal-btn-ghost:hover{color:var(--text)}
.modal-label{font-size:.78rem;color:var(--text-faint);margin-bottom:3px}

/* ── PAGE SECTIONS ── */
.page-section{margin-top:clamp(32px,4vw,56px)}
.section-head{margin-bottom:20px}
.section-title{font-size:1.35rem;font-weight:800;letter-spacing:-.02em;margin-bottom:6px}
.section-desc{font-size:.88rem;color:var(--text-muted);line-height:1.7}
.section-divider{height:1px;background:var(--border);margin:clamp(32px,4vw,56px) 0}

.steps-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.step-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:18px}
.step-number{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,var(--primary),var(--secondary));display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:800;color:#fff;margin-bottom:12px}
.step-title{font-size:.9rem;font-weight:700;margin-bottom:6px}
.step-desc{font-size:.82rem;color:var(--text-muted);line-height:1.65}

.features-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.feature-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:16px}
.feature-icon{font-size:1.4rem;margin-bottom:10px}
.feature-title{font-size:.88rem;font-weight:700;margin-bottom:5px}
.feature-desc{font-size:.8rem;color:var(--text-muted);line-height:1.6}

/* ── FAQ ── */
.faq-list{display:flex;flex-direction:column;gap:10px}
.faq-item{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}
.faq-q{width:100%;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.92rem;font-weight:600;color:var(--text);text-align:left;transition:background var(--transition)}
.faq-q:hover{background:rgba(255,255,255,.025)}
.faq-icon{width:20px;height:20px;border-radius:50%;border:1.5px solid var(--border);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.82rem;color:var(--text-faint);transition:transform var(--transition)}
.faq-item.open .faq-icon{transform:rotate(45deg);border-color:var(--primary);color:var(--primary)}
.faq-a{max-height:0;overflow:hidden;transition:max-height .35s ease,padding .25s ease}
.faq-item.open .faq-a{max-height:400px;padding:0 18px 14px}
.faq-a p{font-size:.88rem;color:var(--text-muted);line-height:1.78}
.faq-a code{background:rgba(108,99,255,.1);color:#a78bfa;padding:1px 5px;border-radius:4px;font-family:'Fira Code',monospace;font-size:.85em}

/* ── RELATED ── */
.related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.related-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:16px;display:flex;flex-direction:column;gap:8px;transition:all var(--transition)}
.related-card:hover{border-color:rgba(108,99,255,.4);transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.3)}
.related-icon{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.related-icon svg{width:18px;height:18px;color:#fff}
.related-name{font-size:.88rem;font-weight:700}
.related-desc{font-size:.78rem;color:var(--text-muted);line-height:1.5;flex:1}
.related-link{font-size:.78rem;font-weight:600;color:var(--primary)}

/* ── AD ── */
.ad-slot{background:var(--bg-card);border:1px dashed rgba(255,255,255,.06);border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;color:var(--text-faint);font-size:.75rem;min-height:90px}

/* ── TOAST ── */
.toast{position:fixed;bottom:28px;right:28px;padding:11px 20px;background:#1e1e28;border:1px solid rgba(108,99,255,.4);border-radius:var(--radius-md);font-size:.85rem;font-weight:600;color:#a78bfa;box-shadow:0 8px 32px rgba(0,0,0,.4);opacity:0;transform:translateY(10px);transition:all .25s ease;pointer-events:none;z-index:999}
.toast.show{opacity:1;transform:translateY(0)}

/* ── FOOTER ── */
.site-footer{background:var(--bg-surface);border-top:1px solid var(--border);padding:clamp(28px,4vw,48px) 0 20px}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:40px;margin-bottom:36px;width:100%;max-width:1280px;margin-inline:auto;padding-inline:clamp(16px,4vw,48px)}
.footer-brand-text{font-size:.88rem;color:var(--text-muted);line-height:1.7;margin-top:10px;max-width:240px}
.footer-heading{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-faint);margin-bottom:12px}
.footer-links{display:flex;flex-direction:column;gap:8px}
.footer-links a{font-size:.88rem;color:var(--text-muted);transition:color var(--transition)}
.footer-links a:hover{color:var(--text)}
.footer-bottom{display:flex;align-items:center;justify-content:space-between;padding-top:20px;border-top:1px solid var(--border);flex-wrap:wrap;gap:10px;font-size:.82rem;color:var(--text-faint);width:100%;max-width:1280px;margin-inline:auto;padding-inline:clamp(16px,4vw,48px)}

@media(max-width:860px){.rte-body{min-height:340px;padding:20px 18px}.footer-grid{grid-template-columns:1fr 1fr}}
@media(max-width:580px){.footer-grid{grid-template-columns:1fr}.rte-toolbar{gap:1px}}
