*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:#eef2f7;
  color:#1f2937;
}

.loading-screen{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
}
.logo{font-size:2.1em;font-weight:900;color:#0891b2}
.logo span{color:#2563eb}
.spinner{
  width:40px;height:40px;border-radius:50%;
  border:4px solid #cffafe;
  border-top-color:#0891b2;
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.main-content{width:100%}
.page-wrap{
  max-width:1300px;
  margin:0 auto;
  padding:0 20px 30px;
}

.nav{
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid #e5e7eb;
  box-shadow:0 2px 12px rgba(0,0,0,.04);
}
.nav-in{
  max-width:1300px;
  margin:0 auto;
  padding:0 20px;
  min-height:56px;
  display:flex;
  align-items:center;
}
.nav-links{
  display:flex;
  gap:8px;
  margin-left:auto;
}
.nl{
  padding:8px 14px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
  color:#555;
  font-size:.9em;
  font-weight:700;
  cursor:pointer;
  font-family:inherit;
  transition:all .2s;
}
.nl:hover{
  border-color:#0891b2;
  color:#0891b2;
  background:#ecfeff;
}
.nl.on{
  background:linear-gradient(135deg,#0891b2,#2563eb);
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 14px rgba(8,145,178,.25);
}

.gen-grid{
  display:grid;
  grid-template-columns: 1fr 1.1fr;
  gap:22px;
  margin-top:26px;
}
.card{
  background:#fff;
  border-radius:20px;
  padding:24px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  border:1px solid #e5e7eb;
}
.right-card{position:sticky;top:90px;height:fit-content}

.fg{display:flex;flex-direction:column;margin-bottom:14px}
.fg2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fg label{
  font-size:.88em;
  font-weight:700;
  color:#475569;
  margin-bottom:6px;
}
.fg input,.fg textarea,.fg select{
  width:100%;
  padding:4px 14px;
  border-radius:14px;
  border:2px solid #e2e8f0;
  font:inherit;
  background:#fff;
  outline:none;
  transition:.2s;
}
.fg input:focus,.fg textarea:focus,.fg select:focus{
  border-color:#0891b2;
}
.fg small{
  margin-top:6px;
  color:#94a3b8;
  font-size:.84em;
}

.form-btns{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:11px 18px;
  border-radius:14px;
  border:none;
  cursor:pointer;
  font-weight:800;
  font-size:.92em;
  text-decoration:none;
  font-family:inherit;
  transition:.2s;
}
.btn.pri{
  background:linear-gradient(135deg,#0891b2,#2563eb);
  color:#fff;
  box-shadow:0 8px 20px rgba(8,145,178,.18);
}
.btn.out{
  background:#fff;
  border:1px solid #dbe4f0;
  color:#475569;
}
.btn.sec{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#475569;
}
.btn.danger{
  background:#fee2e2;
  color:#b91c1c;
}
.btn.sm{
  padding:8px 12px;
  font-size:.84em;
}

.top-preview{
  margin-top:12px;
  padding:18px;
  border-radius:18px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  overflow:auto;
}

.code-block{
  margin-top:18px;
  background:#1e1b34;
  border-radius:18px;
  padding:18px;
  color:#e2e8f0;
  overflow:hidden;
}
.code-title{
  font-weight:800;
  margin-bottom:10px;
  color:#fff;
}
.code-block pre{
  margin:0;
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
  line-height:1.7;
  font-size:.88em;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#e2e8f0;
}

.saved-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:24px 0 16px;
  flex-wrap:wrap;
}
.saved-head h1{
  margin:0;
  font-size:1.9em;
  font-weight:900;
  letter-spacing:-0.02em;
}
.saved-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.saved-item{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:18px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}
.saved-title{
  font-weight:800;
  font-size:1em;
}
.saved-meta{
  color:#94a3b8;
  font-size:.88em;
  margin-top:4px;
}
.saved-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.empty-box{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:40px 20px;
  text-align:center;
  color:#64748b;
  box-shadow:0 10px 28px rgba(0,0,0,.05);
}
.empty-icon{font-size:3em;margin-bottom:10px}
.empty-title{font-size:1.2em;font-weight:800;color:#334155;margin-bottom:4px}

.promo-block{
  background:linear-gradient(135deg,#ecfeff,#eff6ff);
  border:2px solid #a5f3fc;
  border-radius:20px;
  padding:28px;
  text-align:center;
  margin-top:28px;
}
.promo-icon{font-size:2.4em;margin-bottom:8px}
.promo-block h3{
  margin:0 0 12px;
  color:#2563eb;
  font-size:1.3em;
}
.promo-block ul{
  list-style:none;
  padding:0;
  margin:0 0 18px;
  display:flex;
  flex-direction:column;
  gap:8px;
  color:#475569;
}

.seo-content{
  margin-top:34px;
  background:#fff;
  border-radius:20px;
  padding:28px;
  border:1px solid #e2e8f0;
  box-shadow:0 10px 28px rgba(0,0,0,.05);
}
.seo-content h2,.seo-content h3{
  margin:0 0 12px;
  color:#0f172a;
}
.seo-content p{
  color:#475569;
  line-height:1.8;
}
.seo-features{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:18px 0;
}
.seo-feature{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:18px;
}
.seo-feature h4{
  margin:0 0 8px;
  color:#0f172a;
}

.toast{
  position:fixed;
  right:18px;
  top:84px;
  z-index:500;
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border-radius:14px;
  box-shadow:0 16px 30px rgba(0,0,0,.12);
  opacity:0;
  transform:translateY(-8px);
  transition:.22s;
}
.toast.show{opacity:1;transform:none}
.t-ok{background:#dcfce7;color:#166534}
.t-err{background:#fee2e2;color:#991b1b}

@media (max-width: 980px){
  .gen-grid{grid-template-columns:1fr}
  .right-card{position:static}
  .seo-features{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .page-wrap{padding:0 14px 24px}
  .nav-in{padding:0 14px}
  .nav-links{margin-left:0;width:100%;justify-content:center;flex-wrap:wrap}
  .fg2{grid-template-columns:1fr}
  .form-btns{flex-direction:column}
  .saved-item{flex-direction:column;align-items:flex-start}
}

/* ============================================================
   Quick ToTop — fixes / UI additions
============================================================ */

#toasts{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:12000;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.toast{
  min-width:260px;
  max-width:420px;
  padding:12px 14px;
  border-radius:14px;
  background:#111827;
  color:#fff;
  display:flex;
  gap:10px;
  align-items:flex-start;
  box-shadow:0 16px 38px rgba(0,0,0,.18);
  opacity:0;
  transform:translateY(10px);
  transition:opacity .2s ease, transform .2s ease;
  font-size:14px;
  line-height:1.5;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

.toast.t-ok{
  background:linear-gradient(135deg, #0f766e, #10b981);
}

.toast.t-err{
  background:linear-gradient(135deg, #b91c1c, #ef4444);
}

.nav{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(148,163,184,.18);
}

.nav-in{
  max-width:1200px;
  margin:0 auto;
  padding:10px 20px;
}

.nav-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.nl{
  border:1px solid #dbe3ef;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.nl:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.nl.on{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}

.qtop-gen{
  display:grid;
  gap:22px;margin-top: 26px;
}

.qtop-grid{
  display:grid;
  grid-template-columns:minmax(320px, 460px) minmax(320px, 1fr);
  gap:22px;
  align-items:start;
}

.qtop-card{
  background:#fff;
  border:1px solid #dbe3ef;
  border-radius:22px;
  padding:22px;
  box-shadow:0 14px 34px rgba(15,23,42,.05);
}

.qtop-title{
  margin:0 0 8px;
  font-size:34px;
  line-height:1.15;
  color:#0f172a;
}

.qtop-sub{
  margin:0 0 18px;
  color:#64748b;
  line-height:1.7;
  font-size:15px;
}

.qtop-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
}

.qtop-span-2{
  grid-column:1 / -1;
}

.qtop-field label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:700;
  color:#0f172a;
}

.qtop-field input[type="text"],
.qtop-field input[type="number"],
.qtop-field select{
  width:100%;
  min-height:46px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  font-size:15px;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
}

.qtop-field input[type="text"]:focus,
.qtop-field input[type="number"]:focus,
.qtop-field select:focus{
  border-color:#8b5cf6;
  box-shadow:0 0 0 4px rgba(139,92,246,.12);
}

.qtop-field input[type="color"]{
  width:100%;
  height:46px;
  border-radius:12px;
  border:1px solid #d8e2ed;
  background:#fff;
  padding:6px;
  cursor:pointer;
}

.qtop-field.off{
  opacity:.5;
}

.qtop-help{
  margin-top:16px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(124,58,237,.12);
  background:linear-gradient(135deg, rgba(124,58,237,.07), rgba(6,182,212,.08));
  color:#334155;
  line-height:1.6;
  font-size:14px;
}

.qtop-checks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.qtop-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid #d8e2ed;
  background:#fff;
  cursor:pointer;
  user-select:none;
  color:#0f172a;
  font-size:14px;
}

.qtop-check input{
  margin:0;
}

.qtop-actions{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.qtop-btn-ui{
  appearance:none;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:12px 16px;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  transition:.2s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.qtop-btn-ui:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.qtop-btn-ui.pri{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}

.qtop-btn-ui.danger{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #dc2626, #ef4444);
}

.qtop-preview{
  width:100%;
  height:620px;
  border:1px solid #dbe3ef;
  border-radius:18px;
  background:#fff;
}

.qtop-code-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.qtop-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.qtop-tab{
  appearance:none;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.qtop-tab.on{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}

.qtop-code{
  margin:0;
  min-height:320px;
  max-height:720px;
  overflow:auto;
  padding:18px;
  border-radius:18px;
  border:1px solid #26223d;
  background:#171527;
  color:#eef2ff;
  font:13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space:pre-wrap;
  word-break:break-word;
}

.qtop-saved-list{
  display:grid;
  gap:14px;
  margin-top:18px;
}

.qtop-saved-item{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:16px;
  border:1px solid #dbe3ef;
  border-radius:16px;
  background:#fff;
}

.qtop-saved-main{
  min-width:0;
}

.qtop-saved-name{
  font-size:18px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:6px;
  word-break:break-word;
}

.qtop-saved-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  color:#64748b;
  font-size:13px;
}

.qtop-saved-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

.qtop-empty{
  margin-top:14px;
  padding:20px;
  border-radius:16px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  color:#475569;
  line-height:1.7;
}

.qtop-empty--error{
  border-style:solid;
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.qtop-empty-actions{
  margin-top:14px;
}

.qtop-seo{
  margin-top:4px;
}

.qtop-seo-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:18px;
}

.qtop-seo-item{
  border:1px solid #dbe3ef;
  border-radius:18px;
  padding:18px;
  background:#fff;
}

.qtop-seo-item h3{
  margin:0 0 8px;
  font-size:20px;
  color:#0f172a;
}

.qtop-seo-item p{
  margin:0;
  color:#64748b;
  line-height:1.7;
}

@media (max-width: 1024px){
  .qtop-grid{
    grid-template-columns:1fr;
  }

  .qtop-seo-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 720px){
  .nav-in{
    padding-left:14px;
    padding-right:14px;
  }

  .qtop-card{
    padding:16px;
    border-radius:18px;
  }

  .qtop-title{
    font-size:28px;
  }

  .qtop-form-grid{
    grid-template-columns:1fr;
  }

  .qtop-span-2{
    grid-column:auto;
  }

  .qtop-preview{
    height:520px;
  }

  .qtop-code{
    padding:14px;
  }

  .qtop-saved-item{
    flex-direction:column;
    align-items:flex-start;
  }

  .qtop-saved-actions{
    width:100%;
    justify-content:flex-start;
  }

  #toasts{
    left:14px;
    right:14px;
    bottom:14px;
  }

  .toast{
    min-width:0;
    max-width:none;
  }
}