:root {
  /* Color Palette - Deep Obsidian & Cyber Emerald */
  --bg-main: #070a12;
  --bg-sidebar: #0b101c;
  --bg-panel: #0e1524;
  --bg-card: #131c30;
  --bg-card-hover: #17233c;
  --bg-input: #090e18;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-focus: #10b981;

  /* Radiant Accents */
  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-primary-dim: rgba(16, 185, 129, 0.15);
  --accent-primary-glow: rgba(16, 185, 129, 0.35);

  --accent-cyan: #06b6d4;
  --accent-cyan-hover: #0891b2;
  --accent-cyan-dim: rgba(6, 182, 212, 0.15);

  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);

  --accent-purple: #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.15);

  /* Typography Colors */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Status */
  --status-green: #10b981;
  --status-green-dim: rgba(16, 185, 129, 0.15);
  --status-red: #f43f5e;
  --status-red-dim: rgba(244, 63, 94, 0.15);
  --status-blue: #38bdf8;
  --status-blue-dim: rgba(56, 189, 248, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ============================================================ */
/* TOP HEADER                                                   */
/* ============================================================ */
.top-header {
  height: 56px;
  background-color: rgba(11, 16, 28, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  user-select: none;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 0 16px var(--accent-primary-glow);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.2px;
  background: linear-gradient(90deg, #ffffff 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.menu-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-toggle:hover {
  background: var(--bg-card);
  color: #fff;
  border-color: var(--border-light);
}

.header-project-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border-color);
}

.breadcrumb-label {
  font-size: 11.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-novel-title {
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--status-green-dim);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--status-green);
  font-weight: 600;
}
.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-green);
  box-shadow: 0 0 6px var(--status-green);
  animation: pulse 1.8s infinite;
}

.mode-badge {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.btn-header {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-continue {
  background: var(--status-green-dim);
  color: var(--status-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.btn-continue:hover {
  background: var(--status-green);
  color: #fff;
}

.btn-stop {
  background: var(--status-red-dim);
  color: var(--status-red);
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.btn-stop:hover {
  background: var(--status-red);
  color: #fff;
}

.btn-delete {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-delete:hover {
  background: var(--status-red-dim);
  color: var(--status-red);
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-primary-glow {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-primary-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.tools-dropdown-container {
  position: relative;
}

.btn-tools {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-tools:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-light);
}

.tools-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  background: #0f172a;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  padding: 6px 0;
  display: none;
  z-index: 200;
}
.tools-menu.active {
  display: block;
  animation: fadeIn 0.15s ease-out;
}
.tools-menu-header {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}
.tools-menu-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tools-menu-item:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.tools-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ============================================================ */
/* AUTH WIDGET                                                  */
/* ============================================================ */
.auth-container {
  margin-left: 6px;
  position: relative;
}

.btn-google-login {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.btn-google-login:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.user-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(16, 185, 129, 0.4);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-primary);
  object-fit: cover;
  background: #1e293b;
}
.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.user-name {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-vault-tag {
  font-size: 9px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #0b1220;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7);
  padding: 12px;
  display: none;
  z-index: 200;
}
.user-dropdown-menu.active {
  display: block;
  animation: fadeIn 0.15s ease-out;
}
.user-menu-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.user-menu-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.user-menu-email {
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
}
.user-role-pill {
  display: inline-block;
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 5px;
}
.user-menu-stats {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.user-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.user-stat-val {
  color: #fff;
  font-weight: 600;
}
.btn-logout {
  width: 100%;
  background: var(--status-red-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-logout:hover {
  background: var(--status-red);
  color: #fff;
}

/* ============================================================ */
/* APP CONTAINER & WORKSPACE                                    */
/* ============================================================ */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar (Left Rail) */
.sidebar {
  width: 290px;
  min-width: 290px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  transition: width 0.2s ease;
}

.sidebar-header {
  padding: 14px 14px 8px 14px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.novel-count-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
}

.sidebar-search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.sidebar-search-box input:focus {
  border-color: var(--accent-primary);
}

.sidebar-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
}
.filter-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.filter-tab-btn.active {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
}

/* Novel List in Sidebar */
.novel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.novel-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.novel-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateX(2px);
}
.novel-item.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--accent-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.novel-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.novel-item-genre {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 2px 6px;
  border-radius: 4px;
}
.novel-item-date {
  font-size: 10px;
  color: var(--text-dim);
}
.novel-item-title {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.novel-item-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.novel-item-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 2px;
}
.novel-item-footer {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Stats Box at bottom of Sidebar */
.stats-box {
  background: #090e18;
  border-top: 1px solid var(--border-color);
  padding: 12px 14px;
}
.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.btn-text-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.btn-text-link:hover {
  text-decoration: underline;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 10px;
  color: var(--text-dim);
}
.stat-val {
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
}
.stat-val.highlight {
  color: var(--accent-primary);
}
.stat-val.text-emerald {
  color: var(--accent-primary);
}
.stat-val.text-cyan {
  color: var(--accent-cyan);
}
.stat-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}
.sidebar-privacy-badge {
  font-size: 9.5px;
  color: var(--text-dim);
  margin-top: 8px;
  text-align: center;
}

/* ============================================================ */
/* WORKSPACE PANELS                                             */
/* ============================================================ */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  background-color: var(--bg-main);
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-center {
  flex: 1.25;
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-panel);
}

.panel-right {
  flex: 0.95;
  background-color: var(--bg-main);
}

.panel-header {
  height: 44px;
  background-color: rgba(11, 16, 28, 0.7);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  user-select: none;
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-main-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.6px;
}

.panel-title-with-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.6px;
}

.panel-badge-live {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.panel-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  border-radius: 6px;
}
.panel-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.panel-tab-btn.active {
  background: var(--bg-card);
  color: #fff;
  font-weight: 700;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-panel-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-panel-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Chapter tabs bar */
.chapter-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.ch-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.ch-tab-btn.active {
  background: var(--accent-primary-dim);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Panel Body - Story Text */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  position: relative;
}

.story-text-container {
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  font-size: 14.5px;
  line-height: 1.8;
  max-width: 820px;
  margin: 0 auto;
}

/* Unauthenticated Gate Card */
.auth-gate-banner {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.auth-gate-card {
  max-width: 460px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.15);
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
}
.auth-gate-icon {
  font-size: 42px;
  margin-bottom: 12px;
}
.auth-gate-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.auth-gate-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.btn-gate-login {
  width: 100%;
  padding: 10px 18px;
  font-size: 14px;
  justify-content: center;
}

/* ============================================================ */
/* RIGHT PANEL: AGENTS PIPELINE & COCKPIT                       */
/* ============================================================ */

/* 4-Agent Pipeline Flow */
.agents-pipeline-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}
.pipeline-step {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s;
}
.pipeline-step.active {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}
.pipeline-step .step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
}
.pipeline-step.active .step-num {
  background: var(--accent-primary);
  color: #000;
  font-weight: 800;
}
.pipeline-arrow {
  color: var(--text-dim);
  font-size: 11px;
}

/* Timeline Body */
.timeline-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  transition: border-color 0.2s;
  animation: slideIn 0.2s ease-out;
}
.timeline-card:hover {
  border-color: var(--border-light);
}

.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.timeline-agent-badge {
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-primary);
}
.timeline-time {
  font-size: 10px;
  color: var(--text-dim);
}
.timeline-card-content {
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}
.timeline-card-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* Integrated Director Cockpit (Bottom of Right Panel) */
.director-cockpit {
  background: #090e18;
  border-top: 1px solid var(--border-color);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cockpit-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.cockpit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

.cockpit-quick-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  background: var(--accent-primary-dim);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-primary);
}

.steer-form {
  display: flex;
  gap: 6px;
}
.steer-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.steer-input:focus {
  border-color: var(--accent-primary);
}
.btn-steer-send {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.btn-steer-send:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* ============================================================ */
/* MODALS                                                       */
/* ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: #0d1322;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  transition: all 0.25s ease;
}
.modal-box.expanded {
  width: 95vw !important;
  height: 94vh !important;
  max-height: 94vh !important;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}
.modal-icon {
  font-size: 18px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-modal-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-modal-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
}
.form-textarea {
  resize: vertical;
  line-height: 1.6;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #fff;
  padding: 7px 18px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
}

.btn-suggest-idea {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.btn-suggest-idea:hover {
  background: var(--accent-cyan);
  color: #fff;
}

/* Reader Toolbar & Container */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.reader-select-ch {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}
.reader-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
}
.reader-text-container {
  white-space: pre-wrap;
  word-break: break-word;
  color: #d6d3d1;
  font-size: 16px;
  line-height: 1.9;
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 16px;
}
.reader-text-container.serif {
  font-family: 'Merriweather', Georgia, serif;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 240px; min-width: 240px; }
  .panel-right { display: none; }
}
