/* ============================================================
   My Prompts Generator — style.css  v2.0
   Dark / Light mode | Typewriter | Quality Score | History
   ============================================================ */

/* ── 1. CSS VARIABLES ───────────────────────────────────────── */
:root {
  /* Dark theme (default) */
  --primary:        #5b50f0;
  --primary-dark:   #4740d6;
  --primary-glow:   rgba(91, 80, 240, 0.18);
  --accent:         #ff5c8a;
  --success:        #22c55e;
  --warning:        #f59e0b;

  --bg:             #0f0e1a;
  --bg-card:        #1a1830;
  --bg-card2:       #201e36;
  --border:         #2d2b4a;
  --border-focus:   #5b50f0;

  --text:           #e8e5ff;
  --text-muted:     #9491b8;
  --text-light:     #5e5c7a;

  --shadow-card:    0 8px 40px rgba(0,0,0,0.45);
  --shadow-btn:     0 4px 20px rgba(91,80,240,0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --tr: .2s ease;
  --max-w: 740px;
}

/* Light theme */
[data-theme="light"] {
  --bg:             #f4f3ff;
  --bg-card:        #ffffff;
  --bg-card2:       #f0effe;
  --border:         #dddaf5;
  --border-focus:   #5b50f0;
  --text:           #1a1830;
  --text-muted:     #5a577a;
  --text-light:     #9491b8;
  --shadow-card:    0 8px 40px rgba(91,80,240,0.10);
  --shadow-btn:     0 4px 20px rgba(91,80,240,0.30);
  --primary-glow:   rgba(91, 80, 240, 0.10);
}

/* ── 2. RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .3s ease, color .3s ease;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(91,80,240,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(255,92,138,0.07) 0%, transparent 60%);
}

/* ── 3. LAYOUT ──────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 20px 60px; }

/* ── 4. SCROLL TO TOP ───────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  box-shadow: 0 4px 16px rgba(91,80,240,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* ── 5. HEADER ──────────────────────────────────────────────── */
.site-header {
  width: 100%;
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 20px rgba(0,0,0,.15);
  transition: background .3s ease, border-color .3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  gap: 12px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-bolt { font-size: 1.2rem; }
.logo-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #a78bfa, #5b50f0, #ff5c8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 10px; }

/* Stats pill */
.stats-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-glow);
  border: 1px solid rgba(91,80,240,.25);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.stats-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.85); }
}

/* Theme toggle */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  flex-shrink: 0;
}
.theme-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  transform: rotate(20deg);
}

/* ── 6. AD ZONES ────────────────────────────────────────────── */
.ad-zone { width: 100%; display: flex; justify-content: center; padding: 10px 20px; }
.ad-inner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s ease;
}
.ad-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); }
.ad-zone--mid { margin: 8px 0; }
.ad-zone--footer { margin-top: 12px; }

/* ── 7. HERO ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 48px 20px 36px;
  max-width: var(--max-w);
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-glow);
  border: 1px solid rgba(91,80,240,.2);
  color: #a78bfa;
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
  letter-spacing: .02em;
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 30%, #a78bfa 70%, #ff5c8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-compat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-light);
}
.compat-chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── 8. GENERATOR CARD ──────────────────────────────────────── */
.generator-section { width: 100%; max-width: var(--max-w); }

.generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background .3s ease, border-color .3s ease;
}

/* ── 9. QUALITY SCORE BAR ───────────────────────────────────── */
.quality-bar-wrap {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.quality-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.quality-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.quality-score-text {
  font-size: .82rem;
  font-weight: 700;
}
.quality-score-text.score-low    { color: var(--accent); }
.quality-score-text.score-good   { color: var(--warning); }
.quality-score-text.score-great  { color: #34d399; }
.quality-score-text.score-expert { color: #a78bfa; }

.quality-track {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.quality-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width .6s cubic-bezier(.4,0,.2,1), background .4s ease;
}
.quality-fill.score-low    { background: var(--accent); }
.quality-fill.score-good   { background: var(--warning); }
.quality-fill.score-great  { background: #34d399; }
.quality-fill.score-expert { background: linear-gradient(90deg, #5b50f0, #a78bfa); }

/* ── 10. INPUT ──────────────────────────────────────────────── */
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  gap: 12px;
  transition: border-color var(--tr), box-shadow var(--tr), background .3s ease;
}
.input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.input-wrap.shake { animation: shake .4s ease; border-color: var(--accent) !important; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-6px); }
  40%, 80%  { transform: translateX(6px); }
}
.input-icon { font-size: 1.2rem; flex-shrink: 0; }
.idea-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.02rem;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
  caret-color: var(--primary);
}
.idea-input::placeholder { color: var(--text-light); }

/* ── Clear input button (× icon inside the input row) ──────── */
.clear-btn {
  /* Flex sibling — sits between idea-input and char-badge */
  flex-shrink: 0;
  display: flex;               /* toggled to none/flex by JS */
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--tr), background var(--tr), border-color var(--tr), transform var(--tr);
  /* Don't inherit the gap from input-wrap — keep tight */
  margin-left: -4px;
}
.clear-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.1);
}
.clear-btn:active { transform: scale(.95); }

.char-badge {
  font-size: .75rem;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color var(--tr);
}

/* ── 11. GENERATE BUTTON ────────────────────────────────────── */
.btn-generate {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), #7c6fff);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: all var(--tr);
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}
.btn-generate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  opacity: 0;
  transition: opacity var(--tr);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(91,80,240,.5); }
.btn-generate:hover::after { opacity: 1; }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* Progress bar inside button */
.btn-generate .progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: rgba(255,255,255,.6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  width: 0%;
  transition: width linear;
}

.btn-generate.loading .btn-icon { display: none; }
.btn-generate.loading .btn-text::after {
  content: '';
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 12. CHIPS ──────────────────────────────────────────────── */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-label { font-size: .78rem; color: var(--text-light); font-weight: 600; white-space: nowrap; }
.chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: .78rem;
  font-family: inherit;
  padding: 4px 12px;
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
}
.chip:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: #a78bfa;
  transform: translateY(-1px);
}

/* ── 13. OUTPUT ─────────────────────────────────────────────── */
.output-section {
  width: 100%;
  max-width: var(--max-w);
  margin-top: 24px;
  display: none;
}
.output-section.visible { display: block; animation: fadeIn .4s ease; }

.output-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  border-top: 2px solid var(--primary);
  transition: background .3s ease;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
  gap: 10px;
  flex-wrap: wrap;
  transition: background .3s ease;
}
.output-meta { display: flex; align-items: center; gap: 10px; }
.output-badge {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--primary-glow);
  color: #a78bfa;
  border: 1px solid rgba(91,80,240,.3);
  padding: 3px 10px;
  border-radius: 100px;
}
.output-words { font-size: .8rem; color: var(--text-light); }

.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--tr);
  white-space: nowrap;
}
.btn-copy {
  background: var(--primary-glow);
  color: #a78bfa;
  border-color: rgba(91,80,240,.25);
}
.btn-copy:hover, .btn-copy.copied {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-share {
  background: rgba(255,92,138,.08);
  color: #ff5c8a;
  border-color: rgba(255,92,138,.2);
}
.btn-share:hover {
  background: #ff5c8a;
  color: #fff;
  border-color: #ff5c8a;
}
.btn-regen {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-regen:hover { color: var(--text); border-color: var(--text-muted); }

/* Output body */
.output-body {
  padding: 26px 28px;
  font-size: .96rem;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  min-height: 100px;
  position: relative;
}

/* Typewriter cursor */
.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary);
  border-radius: 2px;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink .75s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Formatted prompt elements */
.output-body .prompt-heading {
  display: block;
  font-weight: 700;
  font-size: .97rem;
  color: #a78bfa;
  margin: 18px 0 6px;
  letter-spacing: .01em;
}
.output-body .prompt-heading:first-child { margin-top: 0; }
.output-body .prompt-item {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
  align-items: flex-start;
}
.output-body .prompt-bullet {
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.8;
  min-width: 18px;
}

/* Copy toast */
.copy-toast {
  position: absolute;
  bottom: 16px; right: 16px;
  background: rgba(34,197,94,.15);
  color: var(--success);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: .83rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: all .25s ease;
  pointer-events: none;
}
.copy-toast.show    { opacity: 1; transform: translateY(0); }
.copy-toast.visible { opacity: 1; transform: translateY(0); }

/* ── 14. HISTORY ────────────────────────────────────────────── */
.history-section {
  width: 100%;
  max-width: var(--max-w);
  margin-top: 20px;
  animation: fadeIn .4s ease;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: background .3s ease;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.history-title-row { display: flex; align-items: center; gap: 8px; }
.history-icon { font-size: 1rem; }
.history-title { font-size: .95rem; font-weight: 700; color: var(--text); }

.btn-clear-history {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--text-light);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--tr);
}
.btn-clear-history:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.history-item:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateX(4px);
}
.history-item-left { flex: 1; min-width: 0; }
.history-item-idea {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.history-item-preview {
  font-size: .78rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-time {
  font-size: .72rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── 14b. TYPEWRITER OUTPUT LINE STYLES ─────────────────────── */
.tw-heading {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 16px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tw-line {
  font-size: .93rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 3px;
}
.tw-bullet {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.65;
  padding-left: 1.4em;
  position: relative;
  margin-bottom: 3px;
}
.tw-bullet::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.tw-step {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.65;
  padding-left: 0.5em;
  border-left: 2px solid var(--primary);
  margin-bottom: 5px;
  padding-top: 2px;
  padding-bottom: 2px;
}
.tw-numbered {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1em;
  margin-bottom: 3px;
}
.tw-quote {
  font-size: .92rem;
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
  margin: 6px 0 10px;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(255,92,138,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* history load button */
.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  width: 100%;
  min-width: 0;
}
.history-idea {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  /* Mobile overflow fix */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
}
.history-time {
  font-size: .72rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}
.history-load-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--tr);
}
.history-load-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ── 15a. FOOTER NAV ─────────────────────────────────────────── */
.footer-nav {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .82rem;
  transition: color var(--tr);
}
.footer-link:hover { color: var(--primary); text-decoration: underline; }
.footer-sep { color: var(--text-light); font-size: .75rem; }
.footer-trust {
  font-size: .78rem;
  color: var(--text-light);
  opacity: .7;
  margin-bottom: 2px;
}

/* ── 15b. INFO SECTIONS (How it works / Categories / Why use) ── */
.info-section {
  width: 100%;
  max-width: var(--max-w);
  margin-top: 28px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  box-shadow: var(--shadow-card);
  transition: background .3s ease, border-color .3s ease;
}
.info-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.info-sub {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.step-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step-title {
  font-size: .93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.step-desc {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Categories chips grid */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cat-chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--tr);
}
.cat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

/* Why use — info features grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.info-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.feat-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.feat-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.feat-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── 15. FOOTER ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  transition: border-color .3s ease;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.footer-copy  { font-size: .83rem; color: var(--text-light); }
.footer-note  { font-size: .78rem; color: var(--text-light); opacity: .6; }
.footer-dev   { font-size: .82rem; color: var(--text-light); margin-top: 4px; }
.dev-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #25D366;
  font-weight: 700;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(37,211,102,.1);
  border: 1px solid rgba(37,211,102,.25);
  transition: all var(--tr);
  margin-left: 4px;
}
.dev-link:hover {
  background: rgba(37,211,102,.2);
  border-color: rgba(37,211,102,.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,211,102,.2);
}
.dev-wa-icon { font-size: .9rem; }

/* ── 16. RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero  { padding: 32px 0 24px; }
  .generator-card { padding: 18px; }
  .output-header { flex-direction: column; align-items: flex-start; }
  .output-actions { width: 100%; }
  .btn-action { flex: 1; justify-content: center; font-size: .78rem; padding: 6px 10px; }
  .output-body { padding: 18px; font-size: .9rem; }
  .stats-pill { display: none; }
  .scroll-top { bottom: 18px; right: 18px; width: 38px; height: 38px; }
  .history-card { padding: 18px; }

  /* History overflow: mobile-specific hardening */
  .history-section  { max-width: 100%; overflow: hidden; }
  .history-card     { overflow: hidden; max-width: 100%; }
  .history-list     { overflow: hidden; max-width: 100%; }
  .history-item     { max-width: 100%; width: 100%; overflow: hidden; }
  .history-item-top { flex-wrap: wrap; max-width: 100%; }
  .history-idea     {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    min-width: 0;
  }
  .history-load-btn { align-self: flex-start; }

  /* Info sections on mobile */
  .info-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .cats-grid  { grid-template-columns: repeat(2, 1fr); }
  .info-section { padding: 0; }
  .info-card  { padding: 22px 18px; }
  .footer-nav { flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
  .footer-nav .footer-sep { display: none; }

  /* No horizontal scroll */
  body { overflow-x: hidden; }
  .main { overflow-x: hidden; }
}

/* ══════════════════════════════════════════════════════════════
   17. TRUST PAGES — about / privacy / terms / contact
       These styles are used by the separate .html pages only.
   ══════════════════════════════════════════════════════════════ */
.page-main {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page-hero {
  margin-bottom: 32px;
}
.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.page-hero p {
  font-size: .95rem;
  color: var(--text-muted);
}
.page-section {
  margin-bottom: 32px;
}
.page-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.page-section p,
.page-section li {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 8px;
}
.page-section ul,
.page-section ol {
  padding-left: 1.4em;
}
.page-section li { margin-bottom: 4px; }
.page-section a {
  color: var(--primary);
  text-decoration: underline;
}
.page-section a:hover { opacity: .8; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-group input,
.form-group textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--tr);
  width: 100%;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.btn-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--tr), transform var(--tr);
  align-self: flex-start;
}
.btn-submit:hover { background: var(--primary-dark); transform: translateY(-1px); }
.form-success {
  display: none;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--success);
  font-size: .9rem;
  font-weight: 600;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.contact-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: .9rem;
  color: var(--text-muted);
}
.contact-row a { color: var(--primary); text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }

/* Breadcrumb */
.page-breadcrumb {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 20px;
}
.page-breadcrumb a { color: var(--primary); text-decoration: none; }
.page-breadcrumb a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .page-main   { padding: 24px 18px 60px; }
  .page-hero h1 { font-size: 1.4rem; }
  .btn-submit  { width: 100%; text-align: center; }
}

/* ── 18. DESKTOP — min-width: 1024px ──────────────────────── */
@media (min-width: 1024px) {
  :root { --max-w: 1100px; }

  .main { padding: 0 40px 80px; }

  .header-inner { max-width: 1100px; padding: 0 40px; }

  .hero { padding: 64px 0 48px; }
  .hero-title { font-size: 3.6rem; }
  .hero-sub { font-size: 1.2rem; }

  .generator-card { padding: 36px 40px; }

  .ad-inner { max-width: 970px; }

  .output-body { padding: 32px 36px; font-size: 1rem; }
  .tw-heading { font-size: .78rem; }
  .tw-line, .tw-bullet, .tw-step, .tw-numbered { font-size: .96rem; }

  .info-section { margin-top: 36px; }
  .info-card { padding: 36px 40px; }
  .info-title { font-size: 1.4rem; }
  .cats-grid { grid-template-columns: repeat(6, 1fr); }
  .info-grid { gap: 28px; }
  .steps-grid { gap: 24px; }

  .page-main { max-width: 900px; padding: 48px 32px 100px; }
  .page-hero h1 { font-size: 2.2rem; }
}
