/* ══════════════════════════════════════════════════
   HOME / LIBRARY VIEW
══════════════════════════════════════════════════ */
.home-view {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

/* ── Header ── */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 18px;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-brand-mark {
  display: block;
  flex-shrink: 0;
}
.home-brand-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: var(--text);
}
.home-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  height: 36px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  transition: border-color 0.15s;
}
.home-user-btn:hover { border-color: var(--accent); }
.home-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
}
.home-actions { display: flex; align-items: center; gap: 6px; }

/* ── Body content ── */
.home-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* ── Search ── */
.home-search-wrap {
  position: relative;
  margin-bottom: 30px;
}
.home-search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text3);
}
.home-search-input {
  width: 100%;
  padding: 13px 14px 13px 42px !important;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.home-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Section titles ── */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--text2);
  letter-spacing: 0.1px;
}

/* ── Stats ── */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-value {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}
@media (max-width: 640px) { .stats-dashboard { grid-template-columns: repeat(2, 1fr); } }

/* ── Continue carousel ── */
.continue-carousel { margin-bottom: 36px; }
.continue-carousel-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.continue-carousel-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.continue-carousel-row::-webkit-scrollbar { display: none; }
.continue-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 9px 14px 9px 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  max-width: 260px;
  min-width: 180px;
}
.continue-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.continue-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.continue-chip-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.continue-chip-body { min-width: 0; }
.continue-chip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-chip-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.continue-chip-play {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 9px;
  margin-left: auto;
}

/* ── Hero card (continue reading) ── */
.hero-card {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.hero-card:hover { border-color: var(--accent); }
.hero-cover {
  width: 320px;
  min-height: 220px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.hero-cover-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, var(--bg2));
  pointer-events: none;
}
.hero-body {
  padding: 28px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.hero-last-played { font-size: 12px; color: var(--text3); }
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: var(--text);
  margin-bottom: 10px;
}
.hero-desc {
  margin-bottom: 20px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-serif);
}
.hero-actions { display: flex; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.hero-stats {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 22px;
  color: var(--text3);
  font-size: 12px;
}
.hero-stat { color: var(--text2); }

/* ── Story grid ── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ── Story card ── */
.story-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.story-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.story-cover {
  height: 150px;
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  flex-shrink: 0;
}
.story-cover img { width: 100%; height: 100%; object-fit: cover; }
.story-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
}
.story-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7));
  pointer-events: none;
}
.story-cover-genre {
  position: absolute;
  top: 12px;
  left: 12px;
}
.story-cover-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}
.story-card-body {
  padding: 14px 16px 10px;
  flex: 1;
}
.story-card-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}
.story-card-desc {
  font-size: 12.5px;
  color: var(--text2);
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  font-family: var(--font-serif);
}
.story-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-ui);
}
.story-stat { display: flex; align-items: center; gap: 3px; }
.story-card-actions {
  display: flex;
  gap: 4px;
  padding: 0 12px 12px;
  align-items: center;
}
.story-card-actions .btn-primary { flex: 1; justify-content: center; }

/* ── Story action icon button ── */
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg3); border-color: var(--border2); color: var(--text); }
.icon-btn-danger:hover { border-color: var(--danger, #e53935); color: var(--danger, #e53935); background: color-mix(in srgb, var(--danger, #e53935) 12%, var(--bg2)); }

/* ── Last-played ── */
.story-card-last-played {
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.story-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.story-tag-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--text3);
}
.content-tag-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.content-tag-badge {
  background: var(--danger-bg);
  border: 1px solid rgba(199,110,90,0.2);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--danger);
}

/* ── New story card ── */
.new-story-card {
  border: 1.5px dashed var(--border);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 230px;
  color: var(--text2);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: var(--font-ui);
  padding: 20px;
}
.new-story-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow2);
}
.new-story-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px dashed currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.15s;
}
.new-story-card:hover .new-story-icon { transform: scale(1.08); }
.new-story-card .new-story-label {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
}
.new-story-card .new-story-sub {
  font-size: 12px;
  color: var(--text3);
}

/* ── Drag and drop ── */
.story-card.dragging { opacity: 0.4; transform: scale(0.97); }
.story-card.drag-over { border: 2px dashed var(--accent); background: var(--bg3); }

/* ── Tag filter bar ── */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}
.tag-filter-label { font-size: 12px; color: var(--text3); }
.tag-chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.12s;
  background: transparent;
  font-family: var(--font-ui);
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ── Quick start modal ── */
.quick-start-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.quick-start-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}
.quick-start-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
  font-family: var(--font-ui);
}
.quick-start-item:hover { border-color: var(--accent); background: var(--bg3); }
.quick-start-item small { font-size: 11px; color: var(--text3); }

/* ── Template modal ── */
.template-modal {
  max-width: 640px;
  width: 92vw;
  max-height: 82vh;
  overflow-y: auto;
}
.template-modal-header { margin-bottom: 16px; }
.template-modal-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.template-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.template-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.template-row:last-child { border-bottom: none; }
.template-row:hover { background: var(--bg3); }
.template-row-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.template-row-info { flex: 1; min-width: 0; }
.template-row-title { font-weight: 600; font-size: 14px; color: var(--text); }
.template-row-desc { font-size: 12px; color: var(--text2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-row-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.template-row-arrow { color: var(--text3); font-size: 18px; }

/* ── AI Wizard ── */
.wizard-modal {
  max-width: 620px;
  width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
}
.wizard-header { margin-bottom: 20px; }
.wizard-form { display: flex; flex-direction: column; gap: 16px; }
.wizard-chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wizard-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: var(--font-ui);
}
.wizard-chip:hover { border-color: var(--accent); color: var(--accent); }
.wizard-chip.active { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.wizard-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg2);
}
.wizard-result-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.wizard-chars { margin-top: 12px; }
.wizard-chars-label { font-size: 12px; font-weight: 600; color: var(--text3); margin-bottom: 6px; }
.wizard-char-row { font-size: 13px; color: var(--text2); padding: 4px 0; border-top: 1px solid var(--border); }
.char-pc-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* ── Skeleton ── */
.skeleton-story-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.skeleton-img {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-text {
  height: 12px;
  border-radius: 6px;
  margin: 8px 14px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-text.wide { width: calc(100% - 28px); }
.skeleton-text.med  { width: 70%; }
.skeleton-text.short { width: 45%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Cover row (editor) ── */
.cover-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cover-thumb {
  width: 120px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.cover-thumb img, .cover-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-thumb-placeholder {
  width: 120px;
  height: 80px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* ── Content level badge ── */
.content-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(199,110,90,0.2);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .home-header {
    padding: 20px 18px 14px;
  }
  .home-body {
    padding: 0 18px 80px;
  }
  .home-brand-name { font-size: 20px; }
  .hero-card { flex-direction: column; }
  .hero-cover { width: 100%; height: 180px; }
  .hero-cover-fade {
    background: linear-gradient(180deg, transparent 50%, var(--bg2));
  }
  .hero-title { font-size: 24px; }
  .hero-body { padding: 6px 20px 20px; }
  .story-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
@media (max-width: 640px) {
  .home-user-btn span { display: none; }
}

/* ── Wizard mode select ──────────────────────────────────────────────────── */
.wizard-mode-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.wizard-mode-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.wizard-mode-card:hover {
  border-color: var(--accent);
}
.wizard-mode-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.wizard-mode-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.wizard-mode-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.wizard-mode-desc {
  font-size: 12px;
  color: var(--text3);
}

/* ── Provider collapse ───────────────────────────────────────────────────── */
.wizard-provider-collapse {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.wizard-provider-toggle {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.wizard-provider-panel {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Review workspace ────────────────────────────────────────────────────── */
.wizard-review {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.wizard-review-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--surface);
}
.wizard-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.wizard-review-header h4 {
  margin: 0;
  font-size: 14px;
}
.wizard-review-body {
  padding: 12px 14px;
}
.wizard-char-edit {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}
.wizard-char-edit .form-group {
  margin-bottom: 8px;
}

/* ── Wizard enhancements ─────────────────────────────────────────────────── */
.wizard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.wizard-gen-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wizard-gen-step {
  transition: opacity 0.5s ease;
}
.wizard-reading-time {
  font-size: 13px;
  color: var(--accent);
  margin-top: 8px;
  font-weight: 500;
}
.wizard-make-more {
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}
.wizard-make-more label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}
.wizard-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.wizard-slider-row span {
  font-size: 12px;
  color: var(--text2);
  width: 100px;
  flex-shrink: 0;
}
.wizard-slider-row input[type="range"] {
  flex: 1;
}
.wizard-opening-preview {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text1);
  max-height: 200px;
  overflow-y: auto;
}
.wizard-prose-preview {
  white-space: pre-wrap;
}
.wizard-lore-chip {
  background: var(--surface2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  margin-bottom: 6px;
}
.wizard-cover-prompt {
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px;
}
.wizard-cover-prompt textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}
.wizard-version-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.wizard-version-row:hover {
  border-color: var(--accent);
}
.wizard-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text3);
  color: var(--surface);
  font-size: 10px;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}
.wizard-upload-area:hover { border-color: var(--accent) !important; }
.wizard-diff { display:inline; }
.wizard-pacing-graph > div { transition: height 0.3s ease; }

/* ══════════════════════════════════════════════════
   DUAL CREATE CTAs
══════════════════════════════════════════════════ */
.create-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 540px) { .create-cta-row { grid-template-columns: 1fr; } }

.create-cta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  font-family: var(--font-ui);
}
.create-cta-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-1px);
}
.create-cta-interactive:hover { border-color: #6c9ef8; box-shadow: 0 0 0 3px rgba(108,158,248,0.15); }
.create-cta-novel:hover       { border-color: #e0a060; box-shadow: 0 0 0 3px rgba(224,160,96,0.15); }

.create-cta-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.create-cta-body { flex: 1; min-width: 0; }
.create-cta-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.create-cta-desc {
  font-size: 12px;
  color: var(--text3);
}
.create-cta-arrow {
  font-size: 18px;
  color: var(--text3);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.create-cta-card:hover .create-cta-arrow { transform: translateX(3px); }

/* ── Mode badge on story cards ── */
.story-cover-genre {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.mode-badge {
  font-size: 13px;
  line-height: 1;
  background: rgba(0,0,0,0.45);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ══════════════════════════════════════════════════
   WIZARD STEP 0 — TYPE SELECT (hero size)
══════════════════════════════════════════════════ */
.wizard-type-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
@media (max-width: 480px) { .wizard-type-select { grid-template-columns: 1fr; } }

.wizard-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  transition: border-color 0.15s, background 0.15s;
}
.wizard-type-card:hover { border-color: var(--accent); }
.wizard-type-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg3));
}
.wizard-type-icon { font-size: 26px; flex-shrink: 0; }
.wizard-type-body { min-width: 0; }
.wizard-type-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.wizard-type-desc  { font-size: 12px; color: var(--text3); }

/* ── Template scroll grid ── */
.wizard-vibe-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wizard-vibe-btn {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.wizard-vibe-btn:hover { border-color: var(--accent); color: var(--text); }
.wizard-vibe-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

.wizard-template-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-wrap: wrap;
  max-height: 280px;
  overflow-y: auto;
}
.wizard-tpl-card {
  flex: 0 0 auto;
  width: 130px;
  padding: 10px 10px 8px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-ui);
  transition: border-color 0.12s, transform 0.12s;
}
.wizard-tpl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.wizard-tpl-card[style*="display: none"] { display: none !important; }
.wizard-tpl-icon { font-size: 22px; margin-bottom: 5px; display: block; }
.wizard-tpl-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.wizard-tpl-meta {
  font-size: 10px;
  color: var(--text3);
}

/* ══════════════════════════════════════════════════
   REVIEW WORKSPACE — TUNE BAR
══════════════════════════════════════════════════ */
.wizard-tune-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wizard-tune-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}
.wizard-tune-btn {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
}
.wizard-tune-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg3)); transform: scale(1.04); }

/* ═══════════════════════════════════════════════════
   STEAL THE VIBE
══════════════════════════════════════════════════ */
.wizard-vibe-steal-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wizard-vibe-steal-row input { flex: 1; }

/* ═══════════════════════════════════════════════════
   MOOD BOARD
══════════════════════════════════════════════════ */
.wizard-mood-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}
@media (max-width: 480px) { .wizard-mood-board { grid-template-columns: repeat(2, 1fr); } }
.wizard-mood-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
  font-family: var(--font-ui);
}
.wizard-mood-tile:hover { border-color: var(--accent); transform: scale(1.04); }
.wizard-mood-tile.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--bg2)); }
.mood-tile-emoji { font-size: 22px; }
.mood-tile-label { font-size: 11px; color: var(--text2); text-align: center; line-height: 1.2; }

/* ═══════════════════════════════════════════════════
   TROPE PICKER
══════════════════════════════════════════════════ */
.wizard-trope-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.wizard-trope-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.wizard-trope-chip:hover { border-color: var(--accent); }
.wizard-trope-chip.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg2)); color: var(--text); }

/* ═══════════════════════════════════════════════════
   EMOTIONAL ARC PLANNER
══════════════════════════════════════════════════ */
.wizard-arc-beats {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 6px;
}
@media (max-width: 520px) { .wizard-arc-beats { grid-template-columns: repeat(4, 1fr); } }
.wizard-arc-beat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
  font-family: var(--font-ui);
}
.wizard-arc-beat:hover { border-color: var(--accent); transform: scale(1.05); }
.wizard-arc-beat.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg2)); }
.arc-beat-icon { font-size: 18px; }
.arc-beat-label { font-size: 10px; color: var(--text2); text-align: center; line-height: 1.2; }

/* ═══════════════════════════════════════════════════
   COMMUNITY CONCEPT CARD
══════════════════════════════════════════════════ */
.community-concept-card {
  transition: border-color 0.12s, box-shadow 0.12s;
}
.community-concept-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent);
}
