:root {
  --bg: #0b0f19;
  --surface: #131a2a;
  --border: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent2: #06b6d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover { color: #fff; }

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary.small { padding: 7px 12px; font-size: 12px; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #334155;
}
.btn-secondary:hover { border-color: var(--accent); }

.ghost-btn {
  background: transparent;
  color: #38bdf8;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.hero {
  text-align: center;
  padding: 42px 0 24px;
}
.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto;
  font-size: 15px;
}

.ad-slot {
  margin: 0 auto 24px;
  max-width: 728px;
  height: 76px;
  border: 1px dashed #334155;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 12px;
  background: rgba(19, 26, 42, 0.5);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  margin-bottom: 36px;
}

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

.editor-col, .preview-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.title-input, textarea, .search-input {
  width: 100%;
  background: #0b0f19;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.title-input:focus, textarea:focus, .search-input:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 360px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.theme-picker {
  display: flex;
  gap: 6px;
}

.theme-btn {
  background: #0b0f19;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.theme-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.preview-stage {
  border-radius: 12px;
  padding: 20px;
  min-height: 360px;
  max-height: 460px;
  overflow-y: auto;
}

.preview-stage.theme-paper {
  background: #f8fafc;
  color: #0f172a;
}
.preview-stage.theme-midnight {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1e293b;
}
.preview-stage.theme-gradient {
  background: linear-gradient(135deg, #312e81, #0f172a 65%, #0e7490);
  padding: 28px;
}
.preview-stage.theme-gradient .preview-card {
  background: rgba(15, 23, 42, 0.92);
  color: #f1f5f9;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.card-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #6366f1;
  margin-bottom: 6px;
}
.theme-gradient .card-meta, .theme-midnight .card-meta { color: #38bdf8; }

.preview-card h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.preview-body p { margin-bottom: 10px; font-size: 14px; }
.preview-body h3 { margin: 14px 0 6px; font-size: 16px; }
.preview-body ul { margin: 0 0 12px 20px; }
.preview-body li { margin-bottom: 4px; font-size: 14px; }
.preview-body pre {
  background: #020617;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12px;
}
.preview-body code.inline {
  background: rgba(99, 102, 241, 0.16);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.promo-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 42px;
  flex-wrap: wrap;
}
.promo-box h2 { font-size: 20px; margin-bottom: 4px; }
.promo-box p { color: var(--muted); font-size: 14px; }

.section { margin-bottom: 46px; }
.section h2 { font-size: 22px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-head p { color: var(--muted); font-size: 14px; }
.search-input { max-width: 300px; }

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.prompt-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prompt-item .cat {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
  text-transform: uppercase;
}
.prompt-item h3 { font-size: 15px; }
.prompt-item p {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.aff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.aff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: 0.15s;
}
.aff-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.aff-badge {
  font-size: 11px;
  color: #34d399;
  font-weight: 600;
}
.aff-card h3 { margin: 6px 0; font-size: 16px; }
.aff-card p { font-size: 13px; color: var(--muted); }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #022c22;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  z-index: 99;
}
.hidden { display: none; }
