/* =========================================
   BLOGWIZARD — Global CSS
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

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

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 0%, #121330 0%, #05060d 100%);
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(109,84,251,0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(109,84,251,0.5); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100% { opacity:0.6; } 50% { opacity:1; } }
@keyframes dashFill { from { stroke-dashoffset: 276; } }

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7070a0;
  font-weight: 600;
  margin-bottom: 8px;
}

.copy-btn {
  font-size: 10px;
  color: #9090b8;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.copy-btn:hover { color: #9999bb; border-color: rgba(255,255,255,0.14); }
.copy-btn.copied { color: #10b981; border-color: rgba(16,185,129,0.3); }

.badge {
  display: inline-block;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 10px;
  border: 0.5px solid;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

input[type="text"],
input[type="number"],
textarea {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: rgba(109,84,251,0.5);
  box-shadow: 0 0 0 3px rgba(109,84,251,0.07);
}

/* =========================================
   CANVAS & AURORA
   ========================================= */

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.aurora-blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(40px);
}
.blob-1 {
  width: 600px; height: 600px;
  top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(109,84,251,0.18) 0%, transparent 65%);
}
.blob-2 {
  width: 500px; height: 500px;
  bottom: -100px; right: -100px;
  background: radial-gradient(circle, rgba(20,184,166,0.12) 0%, transparent 65%);
}
.blob-3 {
  width: 350px; height: 350px;
  top: 30%; left: 60%;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 65%);
}

/* =========================================
   NAVBAR
   ========================================= */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(8,9,20,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.nav-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.3px;
}
.logo-blog { color: #fff; }
.logo-wizard { color: #6d54fb; }
.logo-in { color: #fff; }

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

.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #b0b0cc;
  text-decoration: none;
  transition: color 0.15s;
}
/* Auth-gated nav links: hidden via class so the mobile
   `.nav-link { display:none }` rule is never overridden by inline styles */
.nav-hidden { display: none !important; }
.nav-link:hover { color: #9999bb; }

.nav-signin {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #6d54fb;
  border: 0.5px solid rgba(109,84,251,0.35);
  padding: 6px 16px;
  border-radius: 7px;
  background: rgba(109,84,251,0.06);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.nav-signin:hover { background: rgba(109,84,251,0.12); }

.nav-topic-badge {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #6d54fb;
  background: rgba(109,84,251,0.08);
  border: 0.5px solid rgba(109,84,251,0.2);
  padding: 5px 14px;
  border-radius: 6px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-new-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #9090b8;
  border: 0.5px solid rgba(255,255,255,0.07);
  padding: 5px 14px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nav-new-btn:hover { color: #9999bb; border-color: rgba(255,255,255,0.14); }

.nav-blog-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #9999bb;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Nav user dropdown ── */
.user-signed-in {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #a78bfa;
  border: 0.5px solid rgba(109,84,251,0.35);
  padding: 6px 14px;
  border-radius: 7px;
  background: rgba(109,84,251,0.08);
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-signed-in:hover { background: rgba(109,84,251,0.14); }

.nav-user-wrap {
  position: relative;
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: rgba(12,13,26,0.96);
  backdrop-filter: blur(16px);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  overflow: hidden;
  display: none;
  z-index: 200;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}
.nav-user-menu.open { display: block; }

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #c4c4d8;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.nav-menu-item:hover { background: rgba(255,255,255,0.04); }
.nav-menu-item.danger { color: #f87171; }
.nav-menu-item.danger:hover { background: rgba(239,68,68,0.08); }
.nav-menu-divider {
  height: 0.5px;
  background: rgba(255,255,255,0.06);
  margin: 2px 0;
}

/* =========================================
   SCREEN CONTAINER (landing + generating)
   ========================================= */

.screen-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 56px;
}

/* =========================================
   LANDING HERO
   ========================================= */

.hero-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 16px 20px;
}

.eyebrow-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d54fb;
  border: 0.5px solid rgba(109,84,251,0.25);
  background: rgba(109,84,251,0.06);
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: 54px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 16px;
}
.hero-headline .accent {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  color: #6d54fb;
  background: linear-gradient(to right, #8b5cf6, #6d54fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 18px;
  color: #a8a8c8;
  text-align: center;
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .hero-headline {
    font-size: 36px;
  }
  .hero-sub {
    font-size: 15px;
    margin-bottom: 28px;
  }
}

/* Search card */
.search-card {
  width: min(820px, 92vw);
  background: rgba(15,16,35,0.45);
  backdrop-filter: blur(16px);
  border: 0.5px solid rgba(109,84,251,0.25);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-card:focus-within {
  border-color: rgba(109,84,251,0.6);
  box-shadow: 0 0 0 4px rgba(109,84,251,0.12), 0 8px 32px 0 rgba(0,0,0,0.37);
}

.search-input-row {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  gap: 0;
}

.search-icon {
  font-size: 18px;
  color: #9090b8;
  flex-shrink: 0;
}

#topic-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  color: #fff;
  flex: 1;
  padding: 0 16px;
  box-shadow: none;
}
#topic-input::placeholder { color: #6868a0; }

.clear-btn {
  background: transparent;
  border: none;
  color: #9090b8;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.clear-btn:hover { color: #9999bb; }

.search-divider {
  height: 0.5px;
  background: rgba(255,255,255,0.05);
  margin: 0 24px;
}

.search-controls-row {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.tone-btns {
  display: flex;
  gap: 8px;
}

.tone-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #a8a8c8;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  padding: 6px 16px;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tone-btn.active {
  color: #6d54fb;
  border-color: rgba(109,84,251,0.4);
  background: rgba(109,84,251,0.08);
  font-weight: 500;
}
.tone-btn:hover:not(.active) {
  color: #9999bb;
  border-color: rgba(255,255,255,0.12);
}

.word-count-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.wc-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #a8a8c8;
}

#word-count {
  width: 70px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #9999bb;
  font-size: 12px;
  text-align: center;
  padding: 5px;
}

/* Test Mode Toggle */
.test-mode-group {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.test-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.test-toggle input {
  display: none;
}

.test-toggle-slider {
  position: relative;
  width: 34px;
  height: 18px;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
  transition: background 0.2s;
}

.test-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #666;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.test-toggle input:checked + .test-toggle-slider {
  background: rgba(16, 185, 129, 0.3);
}

.test-toggle input:checked + .test-toggle-slider::after {
  transform: translateX(16px);
  background: #10b981;
}

.test-toggle-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.test-toggle input:checked ~ .test-toggle-label {
  color: #10b981;
}

.generate-btn {
  background: #6d54fb;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 9px;
  border: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.generate-btn:hover { background: #7d66fc; transform: translateY(-1px); }
.generate-btn:active { transform: scale(0.98); }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.generate-btn .ti-loader-2 { animation: spin 1s linear infinite; }

/* Suggestions */
.suggestions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 820px;
  width: 100%;
  margin-top: 24px;
}

.suggestion-chip {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  color: #a8a8c8;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 6px 15px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.15s;
}
.suggestion-chip:hover {
  border-color: rgba(109,84,251,0.3);
  color: #9999bb;
  background: rgba(109,84,251,0.04);
}

/* Provider strip */
.provider-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin-top: 24px;
}

.provider-strip-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #9090b8;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #9090b8;
}

.prov-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3a3a5a;
  flex-shrink: 0;
}
.prov-dot.active { background: #14b8a6; }
.prov-dot-off { background: #3a3a5a !important; }

.provider-item.configured .prov-dot { background: #14b8a6; }
.provider-item.configured { color: #b0b0cc; }

.provider-item.provider-disabled {
  opacity: 0.5;
  color: #606080;
}
.prov-off-label {
  font-size: 10px;
  color: #9090b8;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  text-decoration: none;
  vertical-align: middle;
  font-style: normal;
}

/* =========================================
   SCREEN 2: GENERATING
   ========================================= */

.gen-body {
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 0 16px;
}

/* Step list */
.step-list {
  position: relative;
  width: 100%;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.step-row:not(.last)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 40px;
  bottom: -12px;
  width: 0.5px;
  background: rgba(255,255,255,0.06);
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 0.5px solid rgba(255,255,255,0.07);
  transition: all 0.3s;
}

.step-dot.done {
  background: rgba(20,184,166,0.1);
  border-color: rgba(20,184,166,0.3);
}
.step-dot.done .step-num { display: none; }
.step-dot.done::after {
  content: '✓';
  color: #14b8a6;
  font-size: 12px;
  font-weight: 700;
}

.step-dot.active {
  background: rgba(109,84,251,0.1);
  border-color: rgba(109,84,251,0.4);
}
.step-dot.active .step-num { display: none; }

.step-spinner {
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(109,84,251,0.3);
  border-top-color: #6d54fb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.step-num {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #7070a0;
}

.step-text {
  flex: 1;
  padding-top: 5px;
}

.step-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #7070a0;
  transition: color 0.3s;
}
.step-row.state-done .step-title { color: #9999bb; }
.step-row.state-active .step-title { color: #ffffff; }

.step-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.5;
  color: #3a3a5a;
  transition: color 0.3s;
}
.step-row.state-done .step-subtitle { color: #9090b8; }
.step-row.state-active .step-subtitle { color: #6d54fb; }

/* Progress bar */
.progress-wrap {
  width: 100%;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #9090b8;
}

.progress-pct {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #6d54fb;
  font-weight: 500;
}

.progress-track {
  height: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #6d54fb;
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* Powered by */
.powered-by {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #9090b8;
  text-align: center;
}

/* =========================================
   SCREEN 3: OUTPUT LAYOUT
   ========================================= */

.output-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 56px);
  margin-top: 56px;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: #0a0a14;
  border-right: 0.5px solid rgba(255,255,255,0.06);
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-text {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 11.5px;
  color: #b4b4d6;
  line-height: 1.6;
}

/* Donut */
.donut-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.donut-svg {
  width: 120px;
  height: 120px;
}

.donut-fill {
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.donut-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #10b981;
}

.donut-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #7070a0;
}

/* Count badges */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.count-badge.danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.count-badge.success { background: rgba(16,185,129,0.15); color: #10b981; }

/* Issues / strengths items */
.issue-item, .strength-item, .gap-item {
  display: flex;
  gap: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 6px;
  align-items: flex-start;
}
.issue-marker { color: #ef4444; flex-shrink: 0; font-weight: 500; }
.strength-marker { color: #10b981; flex-shrink: 0; font-weight: 500; }
.gap-marker { color: #6d54fb; flex-shrink: 0; font-weight: 500; }

/* Intent pill */
.intent-pill {
  display: inline-block;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 0.5px solid;
}
.intent-informational  { background: rgba(59,130,246,0.1); color: #60a5fa; border-color: rgba(59,130,246,0.2); }
.intent-transactional  { background: rgba(16,185,129,0.1); color: #34d399; border-color: rgba(16,185,129,0.2); }
.intent-investigational{ background: rgba(245,158,11,0.1); color: #fbbf24; border-color: rgba(245,158,11,0.2); }
.intent-navigational   { background: rgba(109,84,251,0.1); color: #a78bfa; border-color: rgba(109,84,251,0.2); }

/* Stat pills */
.stat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: #cbd5e1;
}
.difficulty-pill.beginner     { color: #10b981; }
.difficulty-pill.intermediate { color: #f59e0b; }
.difficulty-pill.advanced     { color: #ef4444; }

/* Provider badge */
.provider-badge {
  background: rgba(109,84,251,0.08);
  border: 0.5px solid rgba(109,84,251,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #6d54fb;
  font-weight: 500;
}

/* Tags */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag-pill {
  background: rgba(109,84,251,0.08);
  color: #a78bfa;
  border: 0.5px solid rgba(109,84,251,0.15);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10px;
}
.kw-pill {
  background: rgba(255,255,255,0.03);
  color: #cbd5e1;
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10px;
}

/* Featured snippet */
.snippet-note {
  font-size: 10px;
  color: #9090b8;
  margin-bottom: 6px;
}
.snippet-box {
  background: rgba(109,84,251,0.06);
  border: 0.5px solid rgba(109,84,251,0.25);
  border-radius: 8px;
  padding: 12px;
}
.snippet-italic {
  font-style: italic;
  line-height: 1.65;
}

/* =========================================
   MAIN PANEL
   ========================================= */

.main-panel {
  background: #080918;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main-header {
  padding: 24px 32px 0;
}

.main-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blog-title-edit {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  min-height: 30px;
  outline: none;
  cursor: text;
  flex: 1;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.blog-title-edit:hover { border-bottom-color: rgba(255,255,255,0.15); }
.blog-title-edit:focus { border-bottom-color: rgba(109,84,251,0.5); outline: none; }

.seo-toggle-btn {
  background: rgba(109,84,251,0.06);
  border: 0.5px solid rgba(109,84,251,0.25);
  border-radius: 8px;
  color: #a78bfa;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.seo-toggle-btn:hover {
  background: rgba(109,84,251,0.12);
  border-color: rgba(109,84,251,0.45);
  color: #fff;
}
.seo-toggle-btn .chevron-icon {
  transition: transform 0.2s ease;
  font-size: 10px;
}
.seo-toggle-btn.expanded .chevron-icon {
  transform: rotate(180deg);
}

.seo-panel {
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.3s ease;
  margin-top: 14px;
}
.seo-panel.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.seo-panel-inner {
  padding: 2px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.meta-desc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.meta-desc-edit {
  flex: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
  background: rgba(15,16,35,0.25);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
  min-height: 48px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.meta-desc-edit:focus {
  border-color: rgba(109,84,251,0.5);
  box-shadow: 0 0 0 3px rgba(109,84,251,0.07);
}

.char-counter {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  padding-top: 14px;
  white-space: nowrap;
  color: #7070a0;
}
.char-counter.ok    { color: #10b981; }
.char-counter.over  { color: #ef4444; }
.char-counter.under { color: #ef4444; }

.slug-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.slug-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15,16,35,0.25);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 6px 12px;
  min-width: 0;
  flex: 1;
}

.field-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7070a0;
  flex-shrink: 0;
}

.field-value {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #9999bb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.field-value.mono { font-family: monospace; }
.field-value.accent { color: #6d54fb; }

.icon-copy-btn {
  background: transparent;
  border: none;
  color: #9090b8;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.icon-copy-btn:hover { color: #9999bb; }

/* Tab bar */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  padding: 0 32px;
  margin-top: 16px;
  flex-shrink: 0;
}

.tab-btn {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  color: #9090b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover:not(.active) { color: #9999bb; }
.tab-btn.active { color: #fff; border-bottom-color: #6d54fb; }

.tab-content {
  flex: 1;
  overflow-y: auto;
}

.tab-pane {
  padding: 24px 32px;
}

/* =========================================
   PROSE (Preview tab)
   ========================================= */

.prose h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 18px;
}
.prose h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 32px 0 14px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(255,255,255,0.06);
}
.prose h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 24px 0 10px;
}
.prose p {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.85;
  margin-bottom: 16px;
}
.prose blockquote {
  border-left: 3px solid #6d54fb;
  padding: 12px 18px;
  margin: 20px 0;
  background: rgba(109,84,251,0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #cbd5e1;
  font-size: 13.5px;
}
.prose ul, .prose ol {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.85;
  padding-left: 20px;
}
.prose li { margin-bottom: 6px; }
.prose strong { color: #e2e8f0; font-weight: 600; }
.prose a { color: #6d54fb; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose hr { border: none; border-top: 0.5px solid rgba(255,255,255,0.06); margin: 24px 0; }

/* Code blocks */
.code-block-wrapper {
  position: relative;
  background: #0d1117;
  border-radius: 8px;
  border: 0.5px solid rgba(255,255,255,0.08);
  margin: 16px 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.code-lang-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #9090b8;
}

.prose pre {
  margin: 0;
  background: transparent !important;
}

.prose pre code {
  font-size: 12px !important;
  line-height: 1.7 !important;
  padding: 14px !important;
  background: transparent !important;
}

/* =========================================
   SOCIAL TAB
   ========================================= */

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.social-card {
  background: #111120;
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px;
}

.social-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.social-name {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.linkedin-name  { color: #60a5fa; }
.twitter-name   { color: #fff; }
.instagram-name { color: #f472b6; }
.whatsapp-name  { color: #34d399; }

.social-body {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.tweet-item {
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.05);
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.65;
}
.tweet-item:last-child { border-bottom: none; }

/* =========================================
   IMAGES TAB
   ========================================= */

.images-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.image-card {
  background: #111120;
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px;
}

.image-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.image-type-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.tool-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 0.5px solid;
}
.tool-badge.dalle  { background: rgba(20,184,166,0.1); color: #2dd4bf; border-color: rgba(20,184,166,0.2); }
.tool-badge.ideogram { background: rgba(109,84,251,0.1); color: #a78bfa; border-color: rgba(109,84,251,0.2); }
.tool-badge.sd      { background: rgba(255,255,255,0.04); color: #9090b8; border-color: rgba(255,255,255,0.08); }

.image-prompt-box {
  background: rgba(255,255,255,0.02);
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  padding: 10px 12px;
  margin: 10px 0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #9999bb;
  line-height: 1.65;
}

.alt-text-row {
  margin-top: 8px;
}

.alt-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7070a0;
}

.alt-value-edit {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #6d54fb;
  margin-top: 4px;
  outline: none;
  cursor: text;
  display: inline;
}
.alt-value-edit:focus { outline: none; text-decoration: underline; }

.alt-hint { font-size: 9px; color: #7070a0; margin-left: 4px; }

.copy-btn-full {
  width: 100%;
  text-align: center;
  padding: 6px;
  margin-top: 4px;
}

/* =========================================
   SCHEMA TAB
   ========================================= */

.schema-top-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.schema-section {
  margin-bottom: 12px;
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  user-select: none;
}

.schema-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
}

.schema-chevron {
  color: #9090b8;
  transition: transform 0.2s;
  font-size: 14px;
}
.schema-header.expanded .schema-chevron { transform: rotate(180deg); }

.schema-body {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease;
}
.schema-body.collapsed {
  max-height: 0;
}

.schema-pre {
  background: #090a15;
  border-radius: 10px;
  padding: 16px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  color: #a78bfa;
  line-height: 1.7;
  margin-top: 12px;
  border: 0.5px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* =========================================
   LINKS TAB
   ========================================= */

.link-card {
  background: rgba(15,16,35,0.3);
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.25s ease;
}
.link-card:hover {
  border-color: rgba(109,84,251,0.3);
  background: rgba(109,84,251,0.04);
}

.link-anchor {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.link-url {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  color: #a78bfa;
}

.link-placement {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: #9090b8;
  margin-top: 6px;
}

.link-reason {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 6px;
}

.link-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* =========================================
   BOTTOM ACTION BAR
   ========================================= */

.bottom-bar {
  position: sticky;
  bottom: 0;
  background: #080918;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.status-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 0.5px solid;
}
.status-badge.draft {
  background: rgba(245,158,11,0.1);
  color: #f59e0b;
  border-color: rgba(245,158,11,0.2);
}
.status-badge.published {
  background: rgba(16,185,129,0.1);
  color: #10b981;
  border-color: rgba(16,185,129,0.2);
}

.bottom-actions {
  display: flex;
  gap: 10px;
}

.btn-save-draft {
  font-family: 'Inter', sans-serif;
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.12);
  color: #9999bb;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.publish-select {
  background: rgba(10, 10, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s;
}
.publish-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.publish-select option {
  background: #0d0d18;
  color: #e2e8f0;
}

.btn-publish {
  font-family: 'Inter', sans-serif;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-publish:hover { background: #0d9f74; }
.btn-publish:disabled { background: #0d9f74; cursor: not-allowed; }

/* =========================================
   MULTI-PLATFORM PUBLISH TOGGLES
   ========================================= */

.platform-toggles-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.platform-toggles-label {
  font-size: 10px;
  font-weight: 600;
  color: #5a5a80;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.platform-toggles-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.platform-toggle-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 7px;
  border: 0.5px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #5a5a80;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.platform-toggle-btn i { font-size: 13px; }
.platform-toggle-btn:hover { border-color: rgba(255,255,255,0.18); color: #a0a0c8; }

.platform-toggle-btn.active {
  background: rgba(109,84,251,0.14);
  border-color: rgba(109,84,251,0.4);
  color: #a78bfa;
}
/* Per-platform active colours */
.platform-toggle-btn[data-platform="history"].active { background: rgba(109,84,251,0.12); border-color: rgba(109,84,251,0.35); color: #a78bfa; }
.platform-toggle-btn[data-platform="wordpress"].active { background: rgba(33,117,156,0.12); border-color: rgba(33,117,156,0.35); color: #60a5fa; }
.platform-toggle-btn[data-platform="medium"].active { background: rgba(200,200,200,0.07); border-color: rgba(200,200,200,0.2); color: #e2e8f0; }
.platform-toggle-btn[data-platform="hashnode"].active { background: rgba(32,163,255,0.12); border-color: rgba(32,163,255,0.35); color: #38bdf8; }
.platform-toggle-btn[data-platform="devto"].active { background: rgba(79,70,229,0.12); border-color: rgba(79,70,229,0.35); color: #a78bfa; }
.platform-toggle-btn[data-platform="ghost"].active { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; }
.platform-toggle-btn[data-platform="flask"].active { background: rgba(20,184,166,0.1); border-color: rgba(20,184,166,0.3); color: #2dd4bf; }

/* Publish result toast */
.publish-toast {
  position: fixed;
  bottom: 70px;
  right: 24px;
  z-index: 999;
  background: #12122a;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #c4c4d8;
  min-width: 240px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.publish-toast-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.publish-toast-row i { font-size: 13px; }
.toast-ok { color: #10b981; }
.toast-err { color: #ef4444; }
.toast-skip { color: #f59e0b; }

/* =========================================
   AFFILIATE LINKS TAB
   ========================================= */

.affiliate-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.05);
}
.affiliate-item:last-child { border-bottom: none; }

.aff-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(167,139,250,0.1);
  border: 0.5px solid rgba(167,139,250,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #a78bfa;
  flex-shrink: 0;
  margin-top: 2px;
}

.aff-details { flex: 1; min-width: 0; }

.aff-anchor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.aff-anchor-text {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  font-style: italic;
}
.aff-type-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(20,184,166,0.08);
  color: #2dd4bf;
  border: 0.5px solid rgba(20,184,166,0.2);
  white-space: nowrap;
}

.aff-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.aff-url-input {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  color: #a78bfa;
  font-family: 'Inter', monospace;
  outline: none;
  transition: border-color 0.2s;
}
.aff-url-input:focus { border-color: rgba(109,84,251,0.4); }
.aff-url-input::placeholder { color: #4a4a6a; }

.aff-hint {
  font-size: 11px;
  color: #6a6a90;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.aff-context {
  font-size: 11.5px;
  color: #7070a0;
  line-height: 1.6;
}

.aff-empty {
  text-align: center;
  padding: 40px 20px;
  color: #5a5a80;
  font-size: 13px;
}
.aff-empty i { font-size: 28px; display: block; margin-bottom: 8px; opacity: 0.4; }

/* =========================================
   HISTORY PAGE
   ========================================= */

.history-container {
  padding: 80px 40px 40px;
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.history-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.btn-new-blog {
  background: #6d54fb;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-new-blog:hover { background: #7d66fc; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #9090b8;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 6px 16px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill.active {
  color: #6d54fb;
  border-color: rgba(109,84,251,0.4);
  background: rgba(109,84,251,0.08);
}
.filter-pill:hover:not(.active) { color: #9999bb; border-color: rgba(255,255,255,0.14); }

.history-search-wrap {
  position: relative;
  margin-left: auto;
}
.history-search-wrap .ti-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #7070a0;
}

#history-search {
  width: 220px;
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  padding: 7px 14px 7px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #fff;
}
#history-search::placeholder { color: #7070a0; }

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

.blog-card {
  background: #0d0d17;
  border: 0.5px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
  display: block;
}
.blog-card:hover { border-color: rgba(109,84,251,0.3); }

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.difficulty-badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 0.5px solid;
  font-weight: 500;
}
.diff-beginner     { background: rgba(16,185,129,0.1);  color: #34d399; border-color: rgba(16,185,129,0.2); }
.diff-intermediate { background: rgba(245,158,11,0.1);  color: #fbbf24; border-color: rgba(245,158,11,0.2); }
.diff-advanced     { background: rgba(239,68,68,0.1);   color: #f87171; border-color: rgba(239,68,68,0.2); }

.ai-badge {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  color: #6d54fb;
  background: rgba(109,84,251,0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-topic {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #7070a0;
  margin-bottom: 12px;
}

.card-middle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mini-donut-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.mini-donut-svg {
  width: 32px;
  height: 32px;
}

.mini-donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 700;
  color: #10b981;
}

.card-reading-time {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #7070a0;
}

.card-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 0.5px solid rgba(255,255,255,0.05);
  padding-top: 8px;
  margin-top: 8px;
}

.card-date {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #7070a0;
}

.card-status {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
}
.status-draft     { background: rgba(245,158,11,0.1);  color: #f59e0b; }
.status-published { background: rgba(16,185,129,0.1);  color: #10b981; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  grid-column: 1 / -1;
}
.empty-icon { font-size: 40px; color: #3a3a5a; }
.empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  color: #7070a0;
  margin-top: 12px;
}
.empty-sub {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #3a3a5a;
  margin-top: 6px;
}

/* Transition helpers */
.fade-out {
  opacity: 0 !important;
  transform: translateY(-20px) !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* =========================================
   RESPONSIVE — MOBILE
   ========================================= */

.nav-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0.5px solid rgba(109,84,251,0.2);
  color: #a78bfa;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-back-btn:hover { color: #c4b5fd; border-color: rgba(109,84,251,0.4); background: rgba(109,84,251,0.06); }
.nav-back-btn i { font-size: 14px; }

/* Navbar: hide text links; auth moves into the hamburger menu */
@media (max-width: 600px) {
  .navbar {
    padding: 0 16px;
    height: 52px;
    justify-content: flex-start;
  }
  .nav-logo {
    font-size: 15px;
  }
  .nav-link {
    display: none;
  }
  .nav-right {
    gap: 10px;
    margin-left: auto;
  }
  /* Sign-in / user chip live in the hamburger menu on mobile —
     prevents the centered button and duplicate sign-out entries */
  .navbar .nav-signin,
  .navbar .nav-user-wrap {
    display: none;
  }
}

/* Hero headline scales down */
@media (max-width: 600px) {
  .hero-headline {
    font-size: 26px;
    letter-spacing: -0.3px;
  }
  .hero-sub {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .eyebrow-label {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 14px;
  }
  .hero-content {
    padding: 0 12px;
  }
}

/* Search card: stack controls vertically */
@media (max-width: 520px) {
  .search-card {
    width: calc(100vw - 24px);
    border-radius: 12px;
  }
  .search-input-row {
    padding: 14px 16px;
  }
  #topic-input {
    font-size: 14px;
    padding: 0 8px;
  }
  .search-controls-row {
    padding: 10px 14px;
    gap: 8px;
  }
  .tone-btns {
    gap: 5px;
  }
  .tone-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
  .word-count-group {
    margin-left: 0;
  }
  .wc-label {
    font-size: 12px;
  }
  #word-count {
    width: 55px;
    font-size: 12px;
  }
  .generate-btn {
    font-size: 13px;
    padding: 8px 16px;
    margin-left: auto;
  }
}

/* Suggestions row */
@media (max-width: 520px) {
  .suggestions-row {
    gap: 6px;
    margin-top: 16px;
  }
  .suggestion-chip {
    font-size: 12px;
    padding: 5px 11px;
  }
}

/* Provider strip: wrap neatly */
@media (max-width: 520px) {
  .provider-strip {
    flex-wrap: wrap;
    gap: 10px 14px;
    justify-content: center;
    margin-top: 18px;
  }
  .provider-strip-label {
    width: 100%;
    text-align: center;
    font-size: 11px;
  }
  .provider-item {
    font-size: 12px;
  }
}

/* Output layout: single column on mobile */
@media (max-width: 768px) {
  .output-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .tab-bar {
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .main-header {
    padding: 20px 16px 0;
  }
  .tab-pane {
    padding: 16px;
  }
  .bottom-bar {
    padding: 10px 16px;
  }
}

/* History page */
@media (max-width: 600px) {
  .history-container {
    padding: 72px 12px 40px;
  }
  .history-title {
    font-size: 20px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .filter-row {
    gap: 8px;
  }
  .filter-pill {
    font-size: 11px;
    padding: 5px 12px;
  }
  #history-search {
    width: 180px;
  }
}

/* ─── Nav right cluster spacing on mobile ─────────────────────────────── */
@media (max-width: 600px) {
  .navbar .nav-right {
    gap: 6px;
  }
}

/* ─── Mobile hamburger & menu ─────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #c4c4d8;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 52px;
  left: 0; right: 0;
  background: #0b0c1e;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  z-index: 998;
  flex-direction: column;
  padding: 8px 0 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #c4c4d8;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.nav-mobile-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-mobile-item i { font-size: 16px; color: #9090b8; }
.nav-mobile-item.danger { color: #ef4444; }
.nav-mobile-item.danger i { color: #ef4444; }

@media (max-width: 600px) {
  .nav-hamburger { display: flex; }
}

/* ─── Platform toggles: horizontal scroll on mobile ───────────────────────── */
@media (max-width: 600px) {
  .platform-toggles-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 32px);
  }
  .platform-toggles-wrap::-webkit-scrollbar { display: none; }
  .platform-toggles-row {
    flex-wrap: nowrap;
    min-width: max-content;
  }
  .platform-toggle-btn {
    font-size: 11px;
    padding: 5px 9px;
    white-space: nowrap;
  }
}
@media (max-width: 360px) {
  .platform-toggle-btn {
    font-size: 9px;
    padding: 4px 6px;
    gap: 2px;
  }
  .platform-toggle-btn i { font-size: 10px; }
  .platform-toggles-wrap { max-width: calc(100vw - 16px); }
}

/* ─── Bottom bar: stack on mobile ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }
  .bottom-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .btn-save-draft {
    font-size: 12px;
    padding: 7px 14px;
  }
  .btn-publish {
    font-size: 12px;
    padding: 7px 14px;
  }
  .btn-cms-settings {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* ─── Output nav: keep back + new blog visible on mobile ──────────────────── */
@media (max-width: 600px) {
  #nav-right-output .nav-link { display: none; }
  .nav-blog-title { display: none; }
  .nav-back-btn { font-size: 12px; padding: 5px 10px; }
  .nav-new-btn { font-size: 12px; padding: 5px 12px; }
}

/* ─── Preview toolbar: stack on very small screens ────────────────────────── */
@media (max-width: 600px) {
  .preview-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .toolbar-left,
  .toolbar-right {
    justify-content: center;
  }
  .toolbar-btn {
    font-size: 11px;
    padding: 5px 10px;
  }
  .toolbar-btn i {
    font-size: 12px;
  }
}

/* ─── Bottom actions: toggles scroll on their own row, buttons stay put ───── */
@media (max-width: 600px) {
  .bottom-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    align-items: center;
  }
  /* Platform toggles become a full-width scrollable first row, so
     Save Draft + Publish never scroll out of reach */
  .bottom-actions .platform-toggles-wrap {
    order: -1;
    flex-basis: 100%;
  }
  .bottom-actions .btn-publish {
    margin-left: auto;
  }
  .btn-cms-settings {
    font-size: 10px;
    padding: 6px 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-cms-settings i { font-size: 11px; }
  .btn-cms-settings span { display: none; }
  .btn-save-draft {
    font-size: 11px;
    padding: 6px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-publish {
    font-size: 11px;
    padding: 6px 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-publish i { font-size: 11px; }
  .status-badge {
    font-size: 10px;
    padding: 3px 8px;
    flex-shrink: 0;
  }
}

/* ─── Platform toggles: scrollable row inside bottom bar ──────────────────── */
@media (max-width: 600px) {
  .platform-toggles-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .platform-toggles-wrap::-webkit-scrollbar { display: none; }
  .platform-toggles-row {
    flex-wrap: nowrap;
    min-width: max-content;
    gap: 3px;
  }
  .platform-toggle-btn {
    font-size: 10px;
    padding: 4px 7px;
    flex-shrink: 0;
  }
  .platform-toggle-btn i { font-size: 11px; }
}

/* ─── Tab content on mobile ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .prose h1 { font-size: 20px; }
  .prose h2 { font-size: 17px; }
  .prose h3 { font-size: 15px; }
  .prose p { font-size: 13px; }
  .prose blockquote { font-size: 12px; padding: 10px 14px; }
  .tab-info-banner { font-size: 11px; padding: 10px 12px; }
  .tab-info-banner i { font-size: 14px; }
  .tab-info-banner span { font-size: 11px; }
  .link-card { padding: 12px; }
  .link-anchor { font-size: 13px; }
  .affiliate-item { flex-direction: column; gap: 8px; }
  .aff-num { display: none; }
  .image-card { padding: 12px; }
  .image-prompt-box { font-size: 10px; padding: 8px 10px; }
  .image-mockup-preview { height: 100px; }
  .social-card { padding: 12px; }
  .social-body { font-size: 11px; }
  .schema-pre { font-size: 10px; padding: 10px; }
}

/* ─── Editor (wysiwyg) on mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .wysiwyg-container {
    border-radius: 8px;
  }
  .editor-content-area {
    min-height: 300px;
  }
  .visual-editor-content {
    min-height: 300px;
    font-size: 14px;
    padding: 14px;
  }
  #html-editor {
    min-height: 300px;
    font-size: 13px;
    padding: 14px;
  }
  .wysiwyg-toolbar {
    gap: 4px;
    padding: 8px 12px;
    overflow-x: auto;
    flex-wrap: wrap;
  }
  .tb-btn {
    width: 32px;
    height: 32px;
  }
  .editor-header-row {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ─── Mobile editor & header ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Compact main header */
  .main-header {
    padding: 12px 14px 0;
  }
  .main-header-top {
    gap: 8px;
    align-items: flex-start;
  }

  /* Blog title: crush from 28px serif to compact 15px —
     without this it wraps to 5 lines and pushes editor off-screen */
  .blog-title-edit {
    font-size: 15px !important;
    font-family: 'Inter', sans-serif !important;
    line-height: 1.4;
    max-height: 42px;          /* ≈ 2 lines visible while not focused */
    overflow: hidden;
    transition: max-height 0.2s ease;
  }
  .blog-title-edit:focus {
    max-height: 120px;         /* expand when editing */
    overflow-y: auto;
  }

  /* SEO details toggle: shrink button */
  .seo-toggle-btn {
    font-size: 11px !important;
    padding: 5px 8px !important;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .seo-toggle-btn span { display: none; } /* hide "SEO Details" text, keep icons */

  /* Meta description edit */
  .meta-desc-edit {
    font-size: 12px;
  }

  /* Tab buttons */
  .tab-btn {
    font-size: 12px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* WYSIWYG toolbar: single scrollable row, no wrapping */
  .wysiwyg-toolbar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 10px;
    gap: 4px;
  }
  .wysiwyg-toolbar::-webkit-scrollbar { display: none; }

  /* Toolbar items compact */
  .tb-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
  .tb-select {
    font-size: 11px;
    padding: 3px 6px;
    flex-shrink: 0;
  }
  .tb-divider { flex-shrink: 0; }

  /* Editor content: taller tap targets, comfortable on phone */
  .editor-content-area {
    min-height: 240px;
  }
  .visual-editor-content {
    min-height: 240px;
    font-size: 14px;
    padding: 14px;
  }
  #html-editor {
    min-height: 240px;
    font-size: 13px;
    padding: 12px 14px;
  }

  /* Editor mode toggle (Visual / HTML Source) */
  .editor-mode-toggle {
    font-size: 11px;
    padding: 5px 10px;
  }
  .editor-header-row {
    padding: 8px 12px;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .editor-section-label {
    font-size: 10px;
  }
}

/* Modern Templates */
.modern-template {
  background: rgba(15,16,35,0.4) !important;
  border: 0.5px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px !important;
  padding: 18px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modern-template .social-card-header {
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  padding-bottom: 12px;
  margin-bottom: 0;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #6d54fb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.linkedin-avatar { background: #0077b5; }
.x-avatar { background: #000; border: 0.5px solid rgba(255,255,255,0.15); }
.insta-avatar { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.email-avatar { background: rgba(109,84,251,0.15); color: #a78bfa; border: 0.5px solid rgba(109,84,251,0.3); }

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.user-title {
  font-size: 10px;
  color: #9090b8;
}

.user-handle {
  font-size: 11px;
  color: #7070a0;
}

.post-time {
  font-size: 9px;
  color: #7070a0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-location {
  font-size: 10px;
  color: #7070a0;
}

/* Social Footer Mock Actions */
.social-footer-actions {
  display: flex;
  justify-content: space-between;
  border-top: 0.5px solid rgba(255,255,255,0.04);
  padding-top: 10px;
  margin-top: 6px;
  color: #7070a0;
  font-size: 12px;
}
.social-footer-actions span {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s;
}
.social-footer-actions span:hover {
  color: #b0b0cc;
}

/* X specific */
.twitter-template .social-footer-actions {
  justify-content: space-around;
  font-size: 14px;
}

/* Insta Specific */
.insta-image-placeholder {
  height: 140px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #7070a0;
  font-size: 11px;
}
.insta-image-placeholder i {
  font-size: 24px;
}
.insta-actions {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  font-size: 16px;
}
.insta-actions .left-actions {
  display: flex;
  gap: 12px;
}
.insta-actions i {
  cursor: pointer;
  transition: color 0.15s;
}
.insta-actions i:hover { color: #b0b0cc; }

/* Newsletter specific */
.email-envelope-preview {
  background: rgba(109,84,251,0.04);
  border: 0.5px solid rgba(109,84,251,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.email-line {
  color: #b0b0cc;
}
.email-line strong {
  color: #7070a0;
  margin-right: 4px;
}

/* Image mockup previews */
.image-mockup-preview {
  position: relative;
  height: 150px;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid rgba(255,255,255,0.06);
}

.gradient-0 {
  background: linear-gradient(135deg, #1e1b4b 0%, #311050 50%, #4c1d95 100%);
}
.gradient-1 {
  background: linear-gradient(135deg, #064e3b 0%, #0d5c48 50%, #0f766e 100%);
}
.gradient-2 {
  background: linear-gradient(135deg, #7c2d12 0%, #853a15 50%, #9a3412 100%);
}

.mockup-grid-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 12px 12px;
  z-index: 1;
}

.mockup-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  gap: 8px;
}

.mockup-overlay i {
  font-size: 28px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 12px rgba(109,84,251,0.4);
  animation: pulse 2s infinite ease-in-out;
}

.mockup-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  margin-top: 4px;
}

.mockup-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a78bfa;
}

/* Copied icon glow */
.icon-copy-btn.copied {
  color: #10b981 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Educational Info Banner inside Tabs */
.tab-info-banner {
  background: rgba(109, 84, 251, 0.04);
  border: 0.5px solid rgba(109, 84, 251, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tab-info-banner i {
  font-size: 16px;
  color: #a78bfa;
  flex-shrink: 0;
  margin-top: 2px;
}
.tab-info-banner span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #b4b4d6;
  line-height: 1.5;
}
.tab-info-banner strong {
  color: #fff;
  font-weight: 600;
  margin-right: 4px;
}

/* Bottom CMS Settings Button */
.btn-cms-settings {
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: #9090b8;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  margin-right: auto;
}
.btn-cms-settings:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.btn-cms-settings i {
  font-size: 12px;
}

/* Modal overlay styling */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 4, 10, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: #0d0f22;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: min(540px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.modal-title-row i {
  font-size: 18px;
  color: #a78bfa;
}
.modal-title-row h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: #9090b8;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #9090b8;
  margin-bottom: 4px;
}

.integration-item {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
}

.integration-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.integration-logo.wordpress { background: rgba(0, 116, 181, 0.1); color: #0074b5; border: 0.5px solid rgba(0, 116, 181, 0.2); }
.integration-logo.medium { background: rgba(255, 255, 255, 0.05); color: #fff; border: 0.5px solid rgba(255, 255, 255, 0.1); }
.integration-logo.hashnode { background: rgba(41, 98, 255, 0.1); color: #2962ff; border: 0.5px solid rgba(41, 98, 255, 0.2); }
.integration-logo.devto { background: rgba(255, 255, 255, 0.05); color: #a78bfa; border: 0.5px solid rgba(167, 139, 250, 0.2); }
.integration-logo.ghost { background: rgba(241, 101, 41, 0.1); color: #f16529; border: 0.5px solid rgba(241, 101, 41, 0.2); }

.integration-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.integration-details h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.integration-details p {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  color: #9090b8;
  line-height: 1.4;
}

.integration-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.modal-input {
  background: rgba(4, 4, 10, 0.3);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 12px;
  color: #fff;
  font-size: 11.5px;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: rgba(109, 84, 251, 0.5); }

.btn-connect {
  background: rgba(109, 84, 251, 0.1);
  border: 0.5px solid rgba(109, 84, 251, 0.3);
  border-radius: 6px;
  color: #a78bfa;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}
.btn-connect:hover {
  background: #6d54fb;
  border-color: #6d54fb;
  color: #fff;
}
.btn-connect.connected {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #10b981 !important;
}

/* =========================================
   PREVIEW TOOLBAR & EDITOR
   ========================================= */
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 15, 25, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
  gap: 12px;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.toolbar-btn i {
  font-size: 14px;
}
.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
.toolbar-btn.active {
  background: rgba(109, 84, 251, 0.15);
  color: #a78bfa;
  border-color: rgba(109, 84, 251, 0.4);
}
/* =========================================
   WYSIWYG RICH TEXT EDITOR STYLES
   ========================================= */
.wysiwyg-container {
  display: flex;
  flex-direction: column;
  background: rgba(13, 13, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
}

.editor-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 18, 0.3);
}

.editor-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.editor-mode-toggles {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 3px;
  border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.editor-mode-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.editor-mode-toggle:hover {
  color: #fff;
}

.editor-mode-toggle.active {
  background: #00f0ff; /* Visual cyan active badge */
  color: #04040a !important;
  font-weight: 600;
}

.wysiwyg-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(15, 15, 25, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tb-select {
  background: rgba(4, 4, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.tb-select option {
  background: #0d0d18;
  color: #cbd5e1;
}

.tb-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 4px;
}

.tb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.tb-btn i {
  font-size: 14px;
}

.tb-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.editor-content-area {
  position: relative;
  min-height: 480px;
  background: rgba(10, 10, 18, 0.4);
}

.visual-editor-content {
  min-height: 480px;
  padding: 24px;
  color: #cbd5e1;
  outline: none;
  overflow-y: auto;
  box-sizing: border-box;
}

.visual-editor-content[contenteditable="true"]:empty:before {
  content: 'Write your blog post content here...';
  color: #64748b;
  font-style: italic;
}

.html-editor-content {
  width: 100%;
  min-height: 480px;
  background: rgba(5, 5, 10, 0.9);
  border: none;
  padding: 24px;
  color: #a78bfa;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

/* Dropdown for download */
.dropdown-wrapper {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #0d0d18;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
  min-width: 180px;
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.dropdown-menu button {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 12px;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.dropdown-menu button:hover {
  background: rgba(109, 84, 251, 0.1);
  color: #a78bfa;
}
