/* ============================================================
   PFM Creator Copilot — Design System v2
   Ultra-modern dark · Purple/slate · Premium feel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Backgrounds */
  --bg-base:       #080812;
  --bg-surface:    #0e0e1c;
  --bg-card:       #12121f;
  --bg-card-hover: #181828;
  --bg-input:      #0f0f1e;
  --bg-glass:      rgba(255,255,255,0.03);

  /* Borders */
  --border:        rgba(130, 80, 240, 0.14);
  --border-light:  rgba(255,255,255,0.06);
  --border-focus:  rgba(168, 85, 247, 0.55);

  /* Purple palette */
  --purple-300:    #c084fc;
  --purple-400:    #a855f7;
  --purple-500:    #9333ea;
  --purple-600:    #7c3aed;
  --violet-400:    #818cf8;
  --pink-400:      #f472b6;
  --indigo-400:    #818cf8;

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #7c3aed 0%, #a855f7 60%, #ec4899 100%);
  --grad-soft:     linear-gradient(135deg, rgba(124,58,237,0.9), rgba(168,85,247,0.9));
  --grad-card:     linear-gradient(145deg, rgba(130,60,220,0.08) 0%, transparent 60%);
  --grad-glow:     radial-gradient(ellipse 80% 50% at 50% -10%, rgba(168,85,247,0.18) 0%, transparent 70%);
  --grad-sidebar:  linear-gradient(180deg, #0e0e1c 0%, #0a0a16 100%);

  /* Text */
  --text-primary:  #f2f0ff;
  --text-secondary:#a89ec0;
  --text-muted:    #5e5878;

  /* Semantic */
  --green:  #10d9a0;
  --yellow: #f59e0b;
  --red:    #f87171;
  --blue:   #60a5fa;

  /* Layout */
  --sidebar-w: 236px;
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow:    0 4px 32px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 60px rgba(120,50,220,0.2);
  --shadow-glow: 0 0 0 1px rgba(168,85,247,0.2), 0 8px 32px rgba(120,50,220,0.3);

  --font: 'Inter', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.2s var(--ease);
}

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

html { font-size: 15px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background-image: var(--grad-glow);
}

/* ══ SIDEBAR ═══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--grad-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 22px 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px 22px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.logo-mark {
  width: 38px; height: 38px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(168,85,247,0.4);
}

.logo-title { font-size: 14px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.logo-sub   { font-size: 10px; color: var(--purple-400); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover { background: rgba(168,85,247,0.07); color: var(--text-secondary); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(168,85,247,0.1));
  color: var(--purple-300);
  border-color: rgba(168,85,247,0.2);
  font-weight: 600;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 10px 0;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.creator-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(168,85,247,0.05);
  border: 1px solid var(--border);
  cursor: default;
}

.creator-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

.creator-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.creator-role { font-size: 10.5px; color: var(--text-muted); }

/* ══ MAIN ═══════════════════════════════════════════════════ */
.main {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  padding: 32px 36px;
  position: relative;
}

/* ══ PAGES ══════════════════════════════════════════════════ */
.page { display: none; animation: fadeUp 0.3s var(--ease); }
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; }
.page-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 5px; }

/* ══ CARDS ══════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
  background-image: var(--grad-card);
  transition: border-color var(--transition);
}

.card:hover { border-color: rgba(168,85,247,0.22); }

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

.card-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: -8px 0 18px;
  line-height: 1.6;
}

.card-title { font-size: 15px; font-weight: 700; }

.card-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Step labels */
.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(168,85,247,0.4);
}

.step-text { font-size: 15px; font-weight: 700; }

.assist-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 100px;
  background: rgba(168,85,247,0.1);
  color: var(--purple-300);
  border: 1px solid rgba(168,85,247,0.2);
  white-space: nowrap;
}

/* ══ STORY BADGE ════════════════════════════════════════════ */
.story-id-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,217,160,0.08);
  border: 1px solid rgba(16,217,160,0.25);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

.badge-reset {
  background: none; border: none; color: var(--green);
  cursor: pointer; font-size: 14px; opacity: 0.6;
  padding: 0; line-height: 1;
  transition: opacity var(--transition);
}
.badge-reset:hover { opacity: 1; }

/* ══ INPUTS ═════════════════════════════════════════════════ */
.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
  background: rgba(15,15,30,0.9);
}

.textarea { resize: vertical; min-height: 90px; line-height: 1.65; }
select.input {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e5878' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-grid  { display: flex; flex-direction: column; gap: 16px; }
.form-row   { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 110px; }

.input-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.label-muted { font-weight: 400; color: var(--text-muted); }

/* ══ BUTTONS ════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 2px 16px rgba(124,58,237,0.35);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: rgba(168,85,247,0.08);
  color: var(--purple-300);
  border: 1px solid rgba(168,85,247,0.22);
}
.btn-ghost:hover { background: rgba(168,85,247,0.16); border-color: rgba(168,85,247,0.4); }

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ══ EDITOR LAYOUT ══════════════════════════════════════════ */
.editor-layout { display: grid; grid-template-columns: 1fr 272px; gap: 20px; align-items: start; }
.editor-main   { min-width: 0; }

/* ══ COPILOT SIDEBAR ════════════════════════════════════════ */
.copilot-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 0;
  background-image: var(--grad-card);
}

.copilot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.copilot-avatar-wrap { position: relative; flex-shrink: 0; }
.copilot-avatar-icon { font-size: 28px; line-height: 1; }
.copilot-pulse {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-card);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100% { opacity:1; transform: scale(1); } 50% { opacity:0.5; transform: scale(0.85); } }

.copilot-name   { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.copilot-status { font-size: 11px; color: var(--green); margin-top: 2px; font-weight: 500; }

.copilot-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.copilot-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.copilot-btn {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
}

.copilot-btn:hover {
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.35);
  color: var(--text-primary);
  transform: translateX(2px);
}
.copilot-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.copilot-log {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: 16px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 7px 10px;
  background: rgba(168,85,247,0.04);
  border-radius: var(--radius-xs);
  border-left: 2px solid rgba(168,85,247,0.25);
}

.log-welcome { color: var(--text-muted); border-color: rgba(255,255,255,0.08); }

/* ══ AI OUTPUT ══════════════════════════════════════════════ */
.ai-output {
  background: var(--bg-card);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
  animation: fadeUp 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.ai-output::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-primary);
  opacity: 0.6;
}

.ai-output-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.ai-badge {
  background: var(--grad-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.assist-note {
  font-size: 11px;
  color: var(--purple-300);
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.ai-output h3  { font-size: 18px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.02em; }
.ai-output p   { font-size: 14px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 12px; }
.ai-output pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.65;
  margin: 14px 0;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.characters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 14px 0; }

.character-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: var(--transition);
}
.character-card:hover { border-color: rgba(168,85,247,0.3); }

.char-name { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.char-role { font-size: 10px; color: var(--purple-400); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.char-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }

.roadmap-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }

.roadmap-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.roadmap-item:hover { border-color: rgba(168,85,247,0.25); }

.ep-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}

.ep-info { flex: 1; min-width: 0; }
.ep-title  { font-size: 13px; font-weight: 600; line-height: 1.4; }
.ep-purpose{ font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }

.cliff-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 100px;
  background: rgba(245,158,11,0.12); color: var(--yellow); font-weight: 700;
  flex-shrink: 0;
}

/* ══ QUALITY ════════════════════════════════════════════════ */
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.quality-item { background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); padding: 13px; border: 1px solid var(--border-light); }
.quality-label { font-size: 10.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.quality-score { font-size: 22px; font-weight: 800; }
.q-green { color: var(--green); } .q-yellow { color: var(--yellow); } .q-red { color: var(--red); }
.quality-bar { height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; margin-top: 8px; }
.quality-bar-fill { height: 100%; border-radius: 2px; background: var(--grad-primary); transition: width 0.8s var(--ease); }

/* ══ WRITERS ROOM ═══════════════════════════════════════════ */
.writers-room-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }

.writer-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 15px;
  transition: var(--transition);
}
.writer-card:hover { border-color: rgba(168,85,247,0.3); }

.writer-role      { font-size: 10px; color: var(--purple-400); font-weight: 700; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.08em; }
.writer-rating    { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.writer-feedback  { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.writer-suggestion{ font-size: 12px; color: var(--green); margin-top: 8px; font-weight: 600; }

/* ══ CLIFFHANGERS ═══════════════════════════════════════════ */
.cliff-cards { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }

.cliff-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 15px;
  transition: var(--transition);
}
.cliff-card:hover { border-color: rgba(245,158,11,0.3); }

.cliff-type  { font-size: 10px; color: var(--yellow); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.cliff-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.cliff-desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 10px; }
.cliff-script { font-style: italic; font-size: 13px; color: var(--violet-400); line-height: 1.65; }
.cliff-score-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; }

/* ══ PREDICT ════════════════════════════════════════════════ */
.predict-score {
  font-size: 72px; font-weight: 900;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-align: center; margin: 16px 0 8px;
  line-height: 1;
}
.predict-label { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.predict-grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.predict-item  { background: rgba(255,255,255,0.02); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 13px; }
.predict-dim   { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.predict-score-sm { font-size: 20px; font-weight: 800; color: var(--purple-400); }

/* ══ EPISODE CARD ═══════════════════════════════════════════ */
.episode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.episode-card:hover { border-color: rgba(168,85,247,0.3); transform: translateX(3px); }
.ep-card-left    { flex: 1; min-width: 0; }
.ep-card-num     { font-size: 10.5px; color: var(--purple-400); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.ep-card-title   { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.ep-card-summary { font-size: 13px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-card-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ══ STATUS BADGES ══════════════════════════════════════════ */
.status-badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 100px;
  text-transform: capitalize;
}
.status-draft     { background: rgba(94,88,120,0.2); color: var(--text-muted); border: 1px solid rgba(94,88,120,0.3); }
.status-active    { background: rgba(16,217,160,0.1); color: var(--green); border: 1px solid rgba(16,217,160,0.25); }
.status-published { background: rgba(16,217,160,0.1); color: var(--green); border: 1px solid rgba(16,217,160,0.25); }
.status-completed { background: rgba(168,85,247,0.12); color: var(--purple-400); border: 1px solid rgba(168,85,247,0.25); }

/* ══ IMPROVEMENTS ═══════════════════════════════════════════ */
.improvement-item {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid;
}
.imp-high   { background: rgba(248,113,113,0.06); border-color: var(--red); }
.imp-medium { background: rgba(245,158,11,0.06); border-color: var(--yellow); }
.imp-low    { background: rgba(16,217,160,0.06); border-color: var(--green); }
.imp-area   { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }
.imp-issue  { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.imp-sug    { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

/* ══ AUDIO STUDIO ═══════════════════════════════════════════ */
.audio-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.audio-line {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.audio-line:hover { background: rgba(255,255,255,0.02); }

.audio-narrator { background: rgba(96,165,250,0.05); border-left-color: var(--blue); }
.audio-character{ background: rgba(168,85,247,0.05); border-left-color: var(--purple-400); }
.audio-sfx      { background: rgba(245,158,11,0.05); border-left-color: var(--yellow); }
.audio-music    { background: rgba(16,217,160,0.05); border-left-color: var(--green); }

.audio-type-badge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; align-self: flex-start; margin-top: 2px; white-space: nowrap; letter-spacing: 0.05em; }
.badge-narrator  { background: rgba(96,165,250,0.18); color: var(--blue); }
.badge-character { background: rgba(168,85,247,0.18); color: var(--purple-400); }
.badge-sfx       { background: rgba(245,158,11,0.18); color: var(--yellow); }
.badge-music     { background: rgba(16,217,160,0.18); color: var(--green); }
.audio-text      { font-size: 13px; line-height: 1.65; color: var(--text-primary); }
.audio-meta      { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ══ EPISODES PAGE ══════════════════════════════════════════ */

/* ══ TOAST ══════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s var(--ease);
  z-index: 999;
  max-width: 340px;
  backdrop-filter: blur(12px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,217,160,0.4); color: var(--green); }
.toast.error   { border-color: rgba(248,113,113,0.4); color: var(--red); }

/* ══ LOADER ═════════════════════════════════════════════════ */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(8,8,18,0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  gap: 20px;
}

.loader-ring {
  width: 52px; height: 52px;
  position: relative;
}

.loader-ring div {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring div:nth-child(1) { border-top-color: #a855f7; animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { border-top-color: #ec4899; animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { border-top-color: #7c3aed; animation-delay: -0.15s; }
.loader-ring div:nth-child(4) { border-top-color: #818cf8; }

@keyframes ring { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loader-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* ══ EMPTY STATE ════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 52px; margin-bottom: 18px; opacity: 0.6; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13.5px; }

/* ══ MISC ════════════════════════════════════════════════════ */
.tag-pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(168,85,247,0.08);
  color: var(--purple-300);
  border: 1px solid rgba(168,85,247,0.18);
  margin: 2px;
}

.divider { height: 1px; background: var(--border-light); margin: 18px 0; }
.section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 12px; }

.row-gap { display: flex; gap: 12px; align-items: center; }

/* ══ RESPONSIVE ═════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr; }
  .copilot-sidebar { position: static; }
  .audio-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .main { padding: 20px 16px; }
  .sidebar { width: 58px; }
  .sidebar .logo-title, .sidebar .logo-sub, .nav-item span:last-child, .creator-name, .creator-role { display: none; }
  .sidebar-logo { justify-content: center; padding: 0 0 16px; }
  .quality-grid, .predict-grid { grid-template-columns: 1fr 1fr; }
  .writers-room-grid { grid-template-columns: 1fr; }
}
