/* === APP SHELL === */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 13, 43, 0.95);
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-glyph { font-size: 1.4rem; }

.logo-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-nav { display: flex; gap: 1.5rem; }

.nav-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--gold); background: rgba(255,215,0,0.08); }
.nav-link.active { color: var(--gold); background: rgba(255,215,0,0.12); }

/* === GENERATOR PAGE === */
.generator-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.generator-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.gen-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.gen-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, #fff 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.gen-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* === PROGRESS BAR === */
.steps-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.progress-step.active { opacity: 1; }
.progress-step.done { opacity: 0.7; }

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s;
}

.progress-step.active .step-num {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  border-color: transparent;
  color: white;
  box-shadow: 0 0 20px rgba(123, 47, 247, 0.4);
}

.progress-step.done .step-num {
  background: rgba(46, 207, 108, 0.2);
  border-color: rgba(46, 207, 108, 0.5);
  color: var(--kid-green);
}

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
}

.progress-step.active .step-label { color: var(--gold); }

.progress-line {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 1.2rem;
}

/* === GENERATOR LAYOUT === */
.generator-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 950px) {
  .generator-layout { grid-template-columns: 1fr; }
}

/* === FORM PANEL === */
.gen-form-panel { }

.form-card {
  background: rgba(26, 26, 78, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}

/* === STEP CARDS === */
.step-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s, opacity 0.2s;
}

.step-card.locked {
  opacity: 0.55;
  pointer-events: none;
}

.step-card.locked .step-body { display: none; }

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
  user-select: none;
}

.step-header:hover { background: rgba(255,255,255,0.04); }

.step-title-group { flex: 1; }

.step-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(123, 47, 247, 0.8);
  display: block;
}

.step-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--light);
  margin: 0;
}

.step-check {
  font-size: 1rem;
  color: var(--kid-green);
  font-weight: 700;
}

.step-selected-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-chevron {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  transition: transform 0.2s;
}

.step-card.collapsed .step-chevron { transform: rotate(180deg); }

.step-body { padding: 1rem 1.25rem 1.25rem; }
.step-hint { font-size: 0.82rem; color: rgba(255,255,255,0.45); margin: 0 0 1rem; }

/* === PILLAR GRID === */
.selection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pillar-grid { margin-bottom: 1rem; }

/* === SELECTION BUTTONS === */
.selection-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.18s;
}

.selection-btn:hover {
  background: rgba(123, 47, 247, 0.2);
  border-color: var(--mystery-purple);
  color: white;
}

.selection-btn.selected {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  border-color: transparent;
  color: white;
}

/* Custom topic */
.custom-topic-wrap {
  margin-top: 0.75rem;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-input:focus { border-color: var(--mystery-purple); }

/* === TEMPLATE GRID === */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.template-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}

.template-card:hover {
  background: rgba(123, 47, 247, 0.12);
  border-color: rgba(123, 47, 247, 0.4);
  transform: translateY(-1px);
}

.template-card.selected {
  background: rgba(123, 47, 247, 0.2);
  border-color: var(--mystery-purple);
  box-shadow: 0 0 16px rgba(123, 47, 247, 0.25);
}

.template-icon { font-size: 1.6rem; margin-bottom: 0.35rem; }
.template-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 0.2rem;
}
.template-desc { font-size: 0.7rem; color: rgba(255,255,255,0.4); line-height: 1.4; }

/* === VISUAL STYLE GRID === */
.style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.style-card {
  flex: 1;
  min-width: 80px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.7rem 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}

.style-card:hover {
  background: rgba(58, 94, 255, 0.12);
  border-color: rgba(58, 94, 255, 0.4);
}

.style-card.selected {
  background: rgba(58, 94, 255, 0.18);
  border-color: var(--bright-blue);
  box-shadow: 0 0 14px rgba(58, 94, 255, 0.25);
}

.style-icon { font-size: 1.4rem; margin-bottom: 0.3rem; }
.style-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

/* === VOICE GRID === */
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.voice-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
}

.voice-card:hover {
  background: rgba(255, 107, 43, 0.1);
  border-color: rgba(255, 107, 43, 0.3);
}

.voice-card.selected {
  background: rgba(255, 107, 43, 0.15);
  border-color: var(--fun-orange);
  box-shadow: 0 0 14px rgba(255, 107, 43, 0.2);
}

.voice-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.voice-icon { font-size: 1.1rem; }
.voice-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--light);
}

.voice-tagline {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fun-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.voice-desc { font-size: 0.72rem; color: rgba(255,255,255,0.4); line-height: 1.4; }

/* === GENERATE BUTTON === */
.generate-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(123, 47, 247, 0.35);
  margin-top: 0.75rem;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(123, 47, 247, 0.5);
}

.generate-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(100, 100, 150, 0.4);
}

/* === OUTPUT PANEL === */
.gen-output-panel { min-height: 400px; }

/* Idle */
.output-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 320px;
  background: rgba(26, 26, 78, 0.3);
  border: 1px dashed rgba(255,215,0,0.2);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
}

.idle-icon { font-size: 3.5rem; opacity: 0.4; }
.idle-text { color: rgba(255,255,255,0.5); line-height: 1.6; font-size: 1rem; }
.idle-sub { font-size: 0.82rem; color: rgba(255,255,255,0.3); margin-top: 0.25rem; }

/* Loading */
.output-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 320px;
  background: rgba(26, 26, 78, 0.4);
  border: 1px solid rgba(123, 47, 247, 0.3);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
}

.loading-orb {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  border-radius: 50%;
  animation: pulse-orb 1.4s ease-in-out infinite;
}

@keyframes pulse-orb {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.loading-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  color: var(--gold);
}

.loading-subtext { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* Error */
.output-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 200px;
  background: rgba(255, 107, 43, 0.08);
  border: 1px solid rgba(255, 107, 43, 0.3);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
}

.error-icon { font-size: 2.5rem; }
.error-text { color: rgba(255,255,255,0.7); font-size: 0.95rem; }

.retry-btn {
  background: rgba(255, 107, 43, 0.2);
  border: 1px solid var(--fun-orange);
  color: var(--fun-orange);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  padding: 0.5rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.retry-btn:hover { background: rgba(255,107,43,0.3); }

/* Result */
.output-result {
  background: rgba(26, 26, 78, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
}

/* Package meta */
.package-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.meta-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.meta-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pillar-badge { background: rgba(123,47,247,0.25); border: 1px solid rgba(123,47,247,0.5); color: rgba(200,180,255,0.9); }
.template-badge { background: rgba(58,94,255,0.2); border: 1px solid rgba(58,94,255,0.4); color: rgba(180,200,255,0.9); }
.style-badge { background: rgba(46,207,108,0.15); border: 1px solid rgba(46,207,108,0.3); color: var(--kid-green); }
.voice-badge { background: rgba(255,107,43,0.15); border: 1px solid rgba(255,107,43,0.3); color: var(--fun-orange); }

.meta-date { font-size: 0.78rem; color: rgba(255,255,255,0.3); }

/* Script sections */
.script-section {
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.85rem;
}

.hook-section { background: rgba(123, 47, 247, 0.12); border: 1px solid rgba(123, 47, 247, 0.25); }
.body-section { background: rgba(58, 94, 255, 0.1); border: 1px solid rgba(58, 94, 255, 0.2); }
.cta-section { background: rgba(255, 215, 0, 0.06); border: 1px solid rgba(255, 215, 0, 0.2); }

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-icon { font-size: 1.1rem; }

.section-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}

.section-content {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
}

/* SEO */
.seo-panel {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.seo-title-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  color: var(--kid-green);
  margin-bottom: 0.75rem;
}

.seo-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.seo-row:last-child { border-bottom: none; }

.seo-field-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  min-width: 80px;
  padding-top: 0.1rem;
}

.seo-value {
  flex: 1;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.seo-copy-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.seo-copy-btn:hover { background: rgba(255,255,255,0.1); color: white; }

.seo-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag-chip {
  display: inline-block;
  background: rgba(46, 207, 108, 0.12);
  border: 1px solid rgba(46, 207, 108, 0.25);
  color: var(--kid-green);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

/* Sub-topic */
.sub-topic-used {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.sub-topic-value { color: rgba(255,255,255,0.65); }

/* Result actions */
.result-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.generate-another-btn {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.generate-another-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.view-all-link {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}
.view-all-link:hover { text-decoration: underline; }

/* === PLATFORM EXPORT GUIDE === */
.platform-guide {
  margin-top: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(46, 207, 108, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.platform-guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  background: rgba(46, 207, 108, 0.06);
  border: none;
  color: rgba(46, 207, 108, 0.85);
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.platform-guide-toggle:hover {
  background: rgba(46, 207, 108, 0.1);
  color: #3ecf6c;
}

.toggle-icon { font-size: 1.1rem; }
.toggle-label { flex: 1; }
.toggle-chevron { font-size: 0.7rem; opacity: 0.7; }

.platform-guide-body { padding: 0 1.25rem 1.5rem; }

.platform-hero-callout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(46, 207, 108, 0.08);
  border: 1px solid rgba(46, 207, 108, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.callout-icon { font-size: 1.2rem; }
.callout-text { font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); line-height: 1.5; }
.callout-text strong { color: var(--kid-green); }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.platform-card {
  background: rgba(26, 26, 78, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
}
.platform-card:hover { border-color: rgba(46, 207, 108, 0.25); }
.platform-card--primary { background: rgba(46, 207, 108, 0.06); border-color: rgba(46, 207, 108, 0.3); }

.platform-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.platform-icon { font-size: 1rem; }
.platform-name { font-family: 'Fredoka', sans-serif; font-size: 0.88rem; font-weight: 600; color: var(--light); flex: 1; }

.platform-badge {
  background: rgba(46, 207, 108, 0.15);
  border: 1px solid rgba(46, 207, 108, 0.3);
  color: var(--kid-green);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-specs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.platform-specs li { display: flex; justify-content: space-between; font-size: 0.78rem; }
.spec-label { color: rgba(255, 255, 255, 0.4); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.spec-val { color: rgba(255, 255, 255, 0.7); }

.platform-actions { display: flex; justify-content: flex-end; }

.copy-specs-btn {
  background: rgba(46, 207, 108, 0.1);
  border: 1px solid rgba(46, 207, 108, 0.3);
  color: var(--kid-green);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.copy-specs-btn:hover { background: rgba(46, 207, 108, 0.18); transform: translateY(-1px); }

/* === LIBRARY PAGE === */
.library-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.library-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.new-script-btn {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(123, 47, 247, 0.35);
}
.new-script-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Filters */
.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.18s;
}
.filter-btn:hover { border-color: rgba(255,215,0,0.3); color: var(--gold); }
.filter-btn.active { background: rgba(255,215,0,0.12); border-color: rgba(255,215,0,0.4); color: var(--gold); }

/* Script cards grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  line-height: 1.8;
}
.empty-state a { color: var(--gold); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.script-card {
  background: rgba(26, 26, 78, 0.6);
  border: 1px solid rgba(255,215,0,0.12);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.18s, border-color 0.18s;
}
.script-card:hover { transform: translateY(-3px); border-color: rgba(255,215,0,0.3); }

.script-card-top { display: flex; align-items: center; justify-content: space-between; }

.card-pillar-badge {
  background: rgba(123, 47, 247, 0.2);
  border: 1px solid rgba(123, 47, 247, 0.4);
  color: rgba(200,180,255,0.9);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

.card-date { font-size: 0.75rem; color: rgba(255,255,255,0.3); }

.card-seo-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--light);
  line-height: 1.3;
}

.card-hook { font-size: 0.85rem; color: rgba(255,255,255,0.5); line-height: 1.5; flex: 1; }

.card-expand-btn {
  align-self: flex-start;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.2);
  color: var(--gold);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s;
}
.card-expand-btn:hover { background: rgba(255,215,0,0.18); }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: #141432;
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 20px;
  padding: 2rem;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { color: white; background: rgba(255,255,255,0.1); }

.modal-header { margin-bottom: 1.25rem; }
.modal-pillar-badge {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 50px;
}

.modal-section {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.modal-section:nth-child(2) { background: rgba(123, 47, 247, 0.1); border: 1px solid rgba(123, 47, 247, 0.2); }
.modal-section:nth-child(3) { background: rgba(58, 94, 255, 0.08); border: 1px solid rgba(58, 94, 255, 0.15); }
.modal-section:nth-child(4) { background: rgba(255, 215, 0, 0.05); border: 1px solid rgba(255, 215, 0, 0.15); }

.modal-seo { margin-top: 1rem; }

/* === CARD ACTIONS === */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.card-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.card-video-btn:hover { background: rgba(255,215,0,0.18); }

/* === PLATFORM EXPORT GUIDE === */
.platform-guide {
  margin-top: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(46, 207, 108, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.platform-guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  background: rgba(46, 207, 108, 0.06);
  border: none;
  color: rgba(46, 207, 108, 0.85);
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.platform-guide-toggle:hover {
  background: rgba(46, 207, 108, 0.1);
  color: #3ecf6c;
}

.toggle-icon { font-size: 1.1rem; }

.toggle-label { flex: 1; }

.toggle-chevron {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.25s;
}

.platform-guide-body {
  padding: 0 1.25rem 1.5rem;
}

/* Hero callout */
.platform-hero-callout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(46, 207, 108, 0.08);
  border: 1px solid rgba(46, 207, 108, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.callout-icon { font-size: 1.2rem; }

.callout-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.callout-text strong { color: var(--kid-green); }

/* Platform grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.platform-card {
  background: rgba(26, 26, 78, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.platform-card:hover { border-color: rgba(46, 207, 108, 0.25); }

.platform-card--primary {
  background: rgba(46, 207, 108, 0.06);
  border-color: rgba(46, 207, 108, 0.3);
}

.platform-card--alt {
  background: rgba(58, 94, 255, 0.06);
  border-color: rgba(58, 94, 255, 0.2);
}

.platform-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.platform-icon { font-size: 1rem; }

.platform-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--light);
  flex: 1;
}

.platform-badge {
  background: rgba(46, 207, 108, 0.15);
  border: 1px solid rgba(46, 207, 108, 0.3);
  color: var(--kid-green);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-badge--alt {
  background: rgba(58, 94, 255, 0.15);
  border-color: rgba(58, 94, 255, 0.3);
  color: var(--bright-blue);
}

.platform-specs {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.platform-specs li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.spec-label {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.spec-val {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

.platform-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.6rem;
  margin-top: 0.25rem;
}

/* Copy specs button */
.platform-actions {
  display: flex;
  justify-content: flex-end;
}

.copy-specs-btn {
  background: rgba(46, 207, 108, 0.1);
  border: 1px solid rgba(46, 207, 108, 0.3);
  color: var(--kid-green);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.copy-specs-btn:hover {
  background: rgba(46, 207, 108, 0.18);
  transform: translateY(-1px);
}

/* === STEP PROGRESS === */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 2.5rem;
  max-width: 700px;
  padding: 0 1rem;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.step-item.active { opacity: 1; }
.step-item.completed { opacity: 0.7; }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s;
}

.step-item.active .step-num {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  border-color: var(--mystery-purple);
  color: white;
  box-shadow: 0 0 16px rgba(123, 47, 247, 0.5);
}

.step-item.completed .step-num {
  background: var(--kid-green);
  border-color: var(--kid-green);
  color: white;
}

.step-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
}

.step-item.active .step-label { color: var(--gold); }
.step-item.completed .step-label { color: rgba(255,255,255,0.5); }

.step-divider {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 0.5rem;
  max-width: 60px;
}

/* === STEP SECTIONS === */
.step-section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: opacity 0.3s;
}

.step-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.step-section.step-locked {
  opacity: 0.4;
  pointer-events: none;
}

.step-section.step-locked::after {
  content: 'Complete previous step to unlock';
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

.step-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step-icon { font-size: 1.2rem; }

.step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--kid-green);
  background: rgba(46, 207, 108, 0.1);
  border: 1px solid rgba(46, 207, 108, 0.2);
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  margin-left: auto;
}

/* === TEMPLATE / STYLE / VOICE GRIDS === */
.template-grid,
.style-grid,
.voice-grid {
  display: grid;
  gap: 0.6rem;
}

.template-grid { grid-template-columns: 1fr 1fr; }
.style-grid { grid-template-columns: repeat(5, 1fr); }
.voice-grid { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 600px) {
  .template-grid { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: repeat(3, 1fr); }
  .voice-grid { grid-template-columns: 1fr; }
}

.template-btn,
.style-btn,
.voice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.template-btn:hover,
.style-btn:hover,
.voice-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.template-btn.selected,
.style-btn.selected,
.voice-btn.selected {
  background: rgba(123, 47, 247, 0.15);
  border-color: var(--mystery-purple);
  box-shadow: 0 0 12px rgba(123, 47, 247, 0.3);
}

.template-emoji,
.style-emoji,
.voice-emoji { font-size: 1.6rem; }

.template-name,
.style-name,
.voice-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--light);
}

.template-desc,
.style-desc,
.voice-desc {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.3;
}

/* === CUSTOM TOPIC === */
.custom-topic-row {
  margin-top: 1rem;
}

.custom-topic-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color 0.2s;
}

.custom-topic-toggle:hover { color: var(--gold); }
.custom-topic-toggle .toggle-icon { color: var(--gold); }

.custom-topic-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.custom-topic-cancel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 1rem;
}

.custom-topic-cancel:hover { background: rgba(255,255,255,0.12); color: white; }

/* === GENERATE STEP 5 === */
.generate-ready-state {
  margin-bottom: 1.25rem;
}

.ready-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.check-icon {
  font-size: 1rem;
  color: rgba(255,255,255,0.25);
  width: 20px;
  text-align: center;
}

.checklist-item.checked .check-icon { color: var(--kid-green); }

.check-label { color: rgba(255,255,255,0.55); }
.checklist-item.checked .check-label { color: rgba(255,255,255,0.8); }

.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.75rem;
}

.reset-btn:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.2); }

/* === IDLE CHOICE PREVIEW === */
.idle-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  width: 100%;
}

.choice-preview {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.choice-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.3);
  min-width: 60px;
  font-size: 0.7rem;
  padding-top: 0.1rem;
}

.choice-value {
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}

/* === RESULT BADGES === */
.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.script-pillar-badge,
.script-template-badge,
.script-style-badge,
.script-voice-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  white-space: nowrap;
}

.script-pillar-badge {
  background: linear-gradient(135deg, var(--mystery-purple), var(--bright-blue));
  color: white;
}

.script-template-badge {
  background: rgba(46, 207, 108, 0.15);
  border: 1px solid rgba(46, 207, 108, 0.3);
  color: var(--kid-green);
}

.script-style-badge {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: var(--gold);
}

.script-voice-badge {
  background: rgba(58, 94, 255, 0.1);
  border: 1px solid rgba(58, 94, 255, 0.25);
  color: var(--bright-blue);
}

/* === PACKAGE META === */
.package-meta {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
}

.package-meta-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  color: var(--kid-green);
  margin-bottom: 0.75rem;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem;
}

.meta-row:last-child { border-bottom: none; }

.meta-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
}

.meta-value { color: rgba(255,255,255,0.75); font-weight: 600; }

/* === UTILITIES === */
.hidden { display: none !important; }