/* ==========================================================================
   NovelCraft Studio // Core Design System & Layout Styles
   ========================================================================== */

:root {
  /* Obsidian Studio Dark Palette */
  --bg-primary: #0d0f14;
  --bg-secondary: #131720;
  --bg-tertiary: #1a202c;
  --bg-card: #1f2737;
  --bg-card-hover: #263044;
  --bg-elevated: #28334a;

  /* Accent & Highlight Colors */
  --accent-gold: #e5a93c;
  --accent-gold-glow: rgba(229, 169, 60, 0.25);
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.2);
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(229, 169, 60, 0.4);

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

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-epic: 'Cinzel', serif;
  --font-mono: 'Fira Code', monospace;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow-gold: 0 0 20px var(--accent-gold-glow);
  --shadow-glow-cyan: 0 0 20px var(--accent-cyan-glow);

  /* Dimensions */
  --header-height: 56px;
  --sidebar-width: 280px;
  --inspector-width: 320px;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Base App Shell */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 0%, #171d2b 0%, #0d0f14 80%);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.studio-header {
  height: var(--header-height);
  background: rgba(19, 23, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  position: relative;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo .logo-icon {
  font-size: 20px;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 8px var(--accent-gold-glow));
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1.5px;
  color: #fff;
}

.brand-name .highlight {
  color: var(--accent-gold);
}

.brand-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.8px;
}

/* Project Selector Dropdown */
.project-selector-wrapper {
  position: relative;
}

.project-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.project-dropdown-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
}

.project-dropdown-btn i.fa-book-bookmark {
  color: var(--accent-gold);
}

.demo-pill-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(229, 169, 60, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 60, 0.5);
  letter-spacing: 0.8px;
  display: inline-block;
}

.btn-header-new-book {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: var(--transition-fast);
}

.btn-header-new-book:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-menu-create {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  font-weight: 600 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.btn-menu-create:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  color: #fff !important;
}

.project-dropdown-btn .caret-icon {
  font-size: 10px;
  color: var(--text-muted);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: fadeInDown 0.15s ease;
}

.dropdown-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-header i {
  color: var(--accent-gold);
}

.dropdown-items-list {
  max-height: 280px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition-fast);
}

.dropdown-item:hover, .dropdown-item.active {
  background: rgba(229, 169, 60, 0.12);
  color: var(--accent-gold);
}

.dropdown-section-title {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-lead-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.dropdown-item .item-title {
  font-weight: 600;
  font-size: 13px;
}

.dropdown-item .item-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.dropdown-footer {
  padding: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-menu-action {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-menu-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Nav Tabs */
.views-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.nav-tab.active i {
  color: var(--accent-gold);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audience-badge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.audience-badge-container:hover {
  border-color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.08);
}

.audience-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.genre-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-gold);
  position: relative;
  padding-left: 8px;
}

.genre-tag::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card);
  color: #fff;
  border-color: var(--border-strong);
}

.btn-export {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  font-size: 12px;
}

.btn-export:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: var(--shadow-glow-cyan);
}

.save-status-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.save-status-indicator.unsaved {
  background: var(--accent-amber);
  animation: pulse 1.5s infinite;
}

/* ==========================================================================
   Workspace Layout & Sidebars
   ========================================================================== */
.studio-main-body {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  position: relative;
}

/* Left Sidebar: Structure & Scene Tree */
.studio-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.sidebar-title i {
  color: var(--accent-gold);
}

/* Progress Stats Box */
.progress-stats-box {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-lbl {
  color: var(--text-muted);
}

.stat-val {
  font-weight: 600;
  font-family: var(--font-mono);
}

.stat-val.highlight {
  color: var(--accent-gold);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin: 6px 0 8px 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #f59e0b);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Chapter / Scene Tree */
.tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.chapter-node {
  margin-bottom: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chapter-header {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

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

.chapter-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.chapter-title-wrap i {
  font-size: 11px;
  color: var(--accent-gold);
  transition: transform 0.2s ease;
}

.chapter-node.collapsed .chapter-title-wrap i {
  transform: rotate(-90deg);
}

.chapter-scenes-list {
  padding: 2px 0 6px 14px;
}

.chapter-node.collapsed .chapter-scenes-list {
  display: none;
}

.scene-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.scene-node:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.scene-node.active {
  background: rgba(229, 169, 60, 0.15);
  color: var(--accent-gold);
  font-weight: 600;
  border-left: 2px solid var(--accent-gold);
}

.scene-node-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.scene-beat-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

/* Center Workspace Area */
.studio-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.workspace-view {
  display: none;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

.workspace-view.active {
  display: flex;
  flex-direction: column;
}

/* Right Inspector Panel */
.studio-inspector {
  width: var(--inspector-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, transform 0.2s ease;
}

.studio-inspector.collapsed {
  width: 0;
  transform: translateX(100%);
  border-left: none;
  overflow: hidden;
}

.inspector-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.inspector-val-pill {
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.inspector-subtext {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.inspector-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-item {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.guideline-card {
  padding: 10px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  color: #bae6fd;
  line-height: 1.5;
}

.inspector-textarea {
  width: 100%;
  height: 110px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  resize: vertical;
}

.inspector-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

/* ==========================================================================
   Generic Components, Buttons & Utilities
   ========================================================================== */
.btn-primary {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: var(--shadow-glow-gold);
}

.btn-primary-ghost {
  background: rgba(229, 169, 60, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 60, 0.3);
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-primary-ghost:hover {
  background: rgba(229, 169, 60, 0.2);
  border-color: var(--accent-gold);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  box-shadow: var(--shadow-glow-cyan);
}

.btn-icon-xs {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon-xs:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon-sm:hover {
  background: var(--bg-card);
  color: #fff;
}

.w-100 {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Studio Select / Input styles */
.studio-select, .studio-select-lg {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.studio-select-lg {
  padding: 8px 14px;
  font-weight: 600;
  background: var(--bg-card);
  border-color: var(--border-strong);
}

/* View Header Banner */
.view-header {
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.view-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-title i {
  color: var(--accent-gold);
}

.view-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   MANUSCRIPT & SCENE EDITOR STYLING
   ========================================================================== */
.editor-header-bar {
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.scene-meta-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.scene-title-field {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  outline: none;
  width: 90%;
}

.scene-tags-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-tag i {
  color: var(--accent-gold);
}

.inline-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}

.inline-slider {
  width: 80px;
  accent-color: var(--accent-rose);
  cursor: pointer;
}

.editor-quick-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.btn-tool {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.manuscript-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  justify-content: center;
  background: #090b0e;
}

.manuscript-paper {
  width: 100%;
  max-width: 820px;
  min-height: 800px;
  background: #151922;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 50px 60px;
}

.rich-scene-editor {
  min-height: 700px;
  outline: none;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.85;
  color: #e2e8f0;
}

.rich-scene-editor p {
  margin-bottom: 1.4em;
  text-indent: 2em;
}

.rich-scene-editor p:first-of-type {
  text-indent: 0;
}

.rich-scene-editor p:first-of-type::first-letter {
  font-family: var(--font-epic);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  margin: 0.1em 0.15em 0 0;
  color: var(--accent-gold);
}

.rich-scene-editor blockquote {
  border-left: 3px solid var(--accent-gold);
  padding-left: 18px;
  font-style: italic;
  color: var(--text-muted);
  margin: 1.5em 0;
}

.rich-scene-editor .scene-break {
  text-align: center;
  letter-spacing: 0.8em;
  color: var(--accent-gold);
  margin: 2em 0;
  font-weight: 700;
}

/* ==========================================================================
   PLOT ARC & BEAT SHEET ENGINE
   ========================================================================== */
.tension-curve-card {
  margin: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

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

.curve-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.curve-title i {
  color: var(--accent-cyan);
}

.curve-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-item .dot.planned { background: #38bdf8; }
.legend-item .dot.actual { background: #e5a93c; }
.legend-item .dot.climax { background: #f43f5e; }

.tension-canvas-wrapper {
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

.beat-cards-grid {
  padding: 0 24px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.beat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
  position: relative;
}

.beat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.beat-card.completed {
  border-left: 4px solid var(--accent-emerald);
}

.beat-card.in-progress {
  border-left: 4px solid var(--accent-gold);
}

.beat-card.pending {
  border-left: 4px solid var(--text-dim);
}

.beat-card.climax-beat {
  border-left: 4px solid var(--accent-rose);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, var(--bg-card) 100%);
}

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

.beat-number-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
}

.beat-target-pct {
  font-size: 11px;
  color: var(--text-muted);
}

.beat-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.beat-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.beat-linked-scene {
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent-gold);
}

/* ==========================================================================
   STORYLINE MATRIX & SUBPLOTS
   ========================================================================== */
.matrix-table-container {
  padding: 24px;
  flex: 1;
  overflow: auto;
}

.storyline-matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.storyline-matrix-table th, .storyline-matrix-table td {
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border-subtle);
}

.storyline-matrix-table th {
  background: var(--bg-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.storyline-matrix-table td {
  background: var(--bg-card);
  vertical-align: top;
}

.storyline-thread-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #fff;
}

.storyline-thread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.matrix-cell-card {
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.matrix-cell-card .scene-tag {
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

/* ==========================================================================
   WORLD MAP & SPATIAL CHARACTER TRACKER (COMPACT & FULL HEIGHT)
   ========================================================================== */
#world-map-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: #090d16;
}

#world-map-view.active {
  display: flex;
}

.map-view-top-bar {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
  gap: 12px;
}

.map-title-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.map-quick-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.map-ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.map-ctrl-label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.map-compact-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 140px;
}

.map-compact-select option {
  background: var(--bg-card);
  color: #fff;
}

.btn-map-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-map-action:hover {
  background: rgba(229, 169, 60, 0.15);
  border-color: rgba(229, 169, 60, 0.4);
  color: var(--accent-gold);
}

.btn-map-action.btn-gold-pill {
  background: rgba(229, 169, 60, 0.15);
  border-color: rgba(229, 169, 60, 0.4);
  color: var(--accent-gold);
}

.btn-map-action.btn-gold-pill.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
}

.world-canvas-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  width: 100%;
  background: #090d16;
}

.world-canvas-wrapper {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  user-select: none;
  cursor: grab;
}

.world-canvas-wrapper:active {
  cursor: grabbing;
}

#world-map-canvas {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: 4px;
}

.map-interactive-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Floating Zoom & Map Navigation Toolbar */
.map-floating-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  padding: 4px 10px;
  border-radius: 30px;
  border: 1px solid rgba(229, 169, 60, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 100;
  pointer-events: auto;
}

.map-toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

.map-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-tool-icon {
  font-size: 11px;
  color: var(--accent-gold);
}

.map-floating-select {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 130px;
}

.map-floating-select option {
  background: var(--bg-card);
  color: #fff;
}

.btn-map-tool {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-map-tool:hover {
  background: rgba(229, 169, 60, 0.15);
  color: var(--accent-gold);
}

.btn-map-tool.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
}

.map-zoom-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 12px;
  min-width: 44px;
  text-align: center;
}

/* ==========================================================================
   WORLD MAP TOOLBAR, LAYERS & DECLUTTER CONTROLS
   ========================================================================== */
.btn-map-layer-tool {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-map-layer-tool:hover {
  color: var(--text-primary);
  border-color: rgba(229, 169, 60, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.btn-map-layer-tool.active {
  background: rgba(229, 169, 60, 0.18);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(229, 169, 60, 0.2);
}

.btn-map-declutter {
  background: linear-gradient(135deg, rgba(229, 169, 60, 0.25), rgba(180, 83, 9, 0.25)) !important;
  border: 1px solid var(--accent-gold) !important;
  color: var(--accent-gold) !important;
  font-weight: 700 !important;
}

.btn-map-declutter:hover {
  background: var(--accent-gold) !important;
  color: #000 !important;
  box-shadow: 0 0 14px rgba(229, 169, 60, 0.5) !important;
  transform: translateY(-1px);
}

.world-canvas-wrapper.drop-target-active {
  box-shadow: inset 0 0 0 3px var(--accent-gold), inset 0 0 40px rgba(229, 169, 60, 0.25) !important;
}

/* ==========================================================================
   STREAMLINED MAP NODES & ANTI-COLLISION PINS
   ========================================================================== */
.map-node {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 60;
  transition: transform 0.15s ease;
}

.map-node:hover {
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 100;
}

.map-node-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 10px rgba(229, 169, 60, 0.25);
  transition: all 0.2s ease;
}

.map-node-icon.glow-active {
  animation: pulse-ring 2s infinite;
}

/* Floating Tooltip Badges (Anti-Collision Hover Cards) */
.map-node-tooltip,
.char-pin-tooltip,
.plot-item-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 169, 60, 0.4);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 12px rgba(229, 169, 60, 0.15);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.map-node-tooltip::after,
.char-pin-tooltip::after,
.plot-item-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(10, 15, 29, 0.95) transparent transparent transparent;
}

.map-node:hover .map-node-tooltip,
.character-pin:hover .char-pin-tooltip,
.plot-item-pin:hover .plot-item-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.map-node-tooltip.always-visible,
.char-pin-tooltip.always-visible,
.plot-item-tooltip.always-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tooltip-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
}

.tooltip-meta {
  font-size: 9.5px;
  color: var(--text-muted);
}

.tooltip-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.btn-tooltip-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-tooltip-action:hover {
  background: rgba(229, 169, 60, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Character Pins */
.character-pin {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  z-index: 80;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.character-pin:hover {
  transform: translate(-50%, -50%) scale(1.22);
  z-index: 105;
}

.character-pin.dragging {
  cursor: grabbing !important;
  transform: translate(-50%, -50%) scale(1.3) !important;
  z-index: 120 !important;
}

.char-pin-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 50%;
  position: relative;
}

.char-pin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
}

.active-pov-pulse::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  animation: pov-beacon 1.8s infinite;
  pointer-events: none;
}

@keyframes pov-beacon {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Plot Relic Pins */
.plot-item-pin {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  z-index: 75;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.plot-item-pin:hover {
  transform: translate(-50%, -50%) scale(1.22);
  z-index: 102;
}

.plot-item-pin.dragging {
  cursor: grabbing !important;
  transform: translate(-50%, -50%) scale(1.35) !important;
  z-index: 120 !important;
}

.plot-item-token {
  width: 30px;
  height: 30px;
  transform: rotate(45deg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  border: 2px solid #ffffff;
  transition: all 0.2s ease;
}

.plot-item-token i {
  transform: rotate(-45deg);
  font-size: 12px;
  color: #ffffff;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* ==========================================================================
   ORGANIZED NARRATIVE ENTITY & ASSET LIBRARY SIDEBAR
   ========================================================================== */
.map-library-sidebar {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}

.map-library-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border-left: none !important;
  visibility: hidden;
}

.library-header {
  padding: 12px 14px 10px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.library-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-library-add {
  background: var(--accent-gold);
  color: #000;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-library-add:hover {
  filter: brightness(1.15);
  transform: scale(1.03);
}

.library-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 8px;
  position: relative;
}

.library-search-box i {
  color: var(--text-muted);
  font-size: 11px;
}

.library-search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 11.5px;
  width: 100%;
  outline: none;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 11px;
}

.btn-clear-search:hover {
  color: #fff;
}

/* Placement Filter Pills */
.library-status-filters {
  display: flex;
  gap: 4px;
}

.lib-status-filter-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.lib-status-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.lib-status-filter-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

.library-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin-top: 2px;
}

.lib-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 5px 2px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.lib-tab-btn i {
  font-size: 11px;
}

.lib-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.lib-tab-btn.active {
  background: rgba(229, 169, 60, 0.15);
  border-color: rgba(229, 169, 60, 0.35);
  color: var(--accent-gold);
}

.library-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.lib-tab-pane {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.lib-tab-pane.active {
  display: flex;
}

.lib-section-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.lib-section-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-micro-add {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-micro-add:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.lib-entity-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lib-entity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}

.lib-entity-card:hover {
  border-color: rgba(229, 169, 60, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.lib-entity-card.is-unplaced {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.45);
}

.lib-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lib-card-left-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.lib-avatar-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.lib-card-names {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lib-card-name-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-card-role-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.btn-card-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-icon:hover {
  background: rgba(229, 169, 60, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-card-icon.active-gold {
  background: rgba(229, 169, 60, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.lib-card-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 4px;
}

.lib-location-tag {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 3px;
}

.lib-status-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.lib-status-pill.on-map {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.lib-status-pill.unplaced {
  background: rgba(229, 169, 60, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.lib-empty-state {
  text-align: center;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.lib-empty-state i {
  font-size: 24px;
  color: var(--border-strong);
}

/* ==========================================================================
   CHARACTER ROSTER
   ========================================================================== */
.characters-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
}

.character-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.char-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-avatar-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.char-info-block {
  flex: 1;
}

.char-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.char-role-tag {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.char-arc-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 12px;
}

.char-arc-row {
  display: flex;
  gap: 8px;
}

.char-arc-row .label {
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 65px;
}

/* ==========================================================================
   AI STORY LAB & SUGGESTIONS
   ========================================================================== */
.ai-lab-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.ai-icon {
  font-size: 20px;
  color: var(--accent-gold);
}

.ai-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.ai-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ai-results-box {
  margin-top: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(229, 169, 60, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.6;
}

.ai-suggestion-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-suggestion-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.ai-suggestion-title {
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.studio-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  width: 94vw;
  max-width: 620px;
  max-height: min(92vh, 580px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  margin: auto;
  animation: scaleUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-dialog-lg {
  max-width: 780px;
}

.modal-dialog-xl {
  max-width: 880px;
}

.modal-header {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-lead-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 2px;
}

.modal-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-size: 12.5px;
  outline: none;
}

.form-textarea {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-size: 12px;
  outline: none;
  resize: vertical;
  min-height: 44px;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-gold);
}

.modal-sub-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.modal-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.modal-tab-btn.active {
  background: rgba(229, 169, 60, 0.12);
  color: var(--accent-gold);
  border-color: rgba(229, 169, 60, 0.3);
}

.category-rules-preview-box {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.5;
}

.export-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.export-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  align-items: center;
}

.export-card .export-icon {
  font-size: 32px;
  color: var(--accent-gold);
}

.export-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.export-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.2s ease;
}

.toast.success { border-color: var(--accent-emerald); }
.toast.info { border-color: var(--accent-cyan); }
.toast.warn { border-color: var(--accent-amber); }

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Page Capacity Indicators & Modal */
.btn-capacity-pill {
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
}

.btn-capacity-pill:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.capacity-active-summary-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Cover Studio Modal & 3D Jacket Layout Styles
   ========================================================================== */
.cover-studio-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 850px) {
  .cover-studio-layout {
    grid-template-columns: 1fr;
  }
}

.cover-tab-content {
  display: none;
}

.cover-tab-content.active {
  display: block;
}

.fal-badge-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.fal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}

/* Cover Preset Cards */
.cover-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.cover-preset-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cover-preset-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.cover-preset-card.active {
  border-color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.08);
  box-shadow: 0 0 16px rgba(229, 169, 60, 0.25);
}

.cover-thumb-box {
  width: 100%;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-preset-card b {
  font-size: 11px;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.25;
}

.cover-preset-card span {
  font-size: 9.5px;
  color: var(--text-dim);
}

/* Custom Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-dropzone:hover {
  border-color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.04);
}

.dropzone-icon {
  font-size: 30px;
  color: var(--accent-gold);
  opacity: 0.8;
}

.upload-dropzone h3 {
  font-size: 14px;
  color: var(--text-main);
  margin: 0;
}

.upload-dropzone p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* Right 3D Jacket Preview Panel */
.cover-preview-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-jacket-3d-stage {
  flex: 1;
  min-height: 200px;
  max-height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #090d16 100%);
  border-radius: 8px;
  padding: 12px;
  perspective: 1000px;
}

.jacket-preview-card {
  position: relative;
  width: 145px;
  height: 210px;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 
    -8px 8px 24px rgba(0, 0, 0, 0.7),
    0 12px 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease;
}

.jacket-preview-card:hover {
  transform: scale(1.03) rotateY(-6deg);
}

/* Multi-Layer 1: Background Art Canvas */
.jacket-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #0f172a;
  overflow: hidden;
}

.jacket-bg-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Multi-Layer 2: Contrast Scrim / Gradient Overlay */
.jacket-scrim-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: all 0.3s ease;
}

.scrim-dark-bottom {
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, transparent 40%, rgba(0,0,0,0.85) 100%);
}

.scrim-vignette {
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%);
}

.scrim-top-bottom {
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.85) 100%);
}

.scrim-none {
  background: transparent;
}

/* Multi-Layer 3-7: Live Typography Layer Overlays */
.jacket-typography-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
  box-sizing: border-box;
}

.jacket-typography-layer.pos-center {
  justify-content: space-between;
}

.jacket-typography-layer.pos-top .jacket-middle-block {
  margin-top: 4px;
  margin-bottom: auto;
}

.jacket-typography-layer.pos-bottom .jacket-middle-block {
  margin-top: auto;
  margin-bottom: 4px;
}

.jacket-top-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.jacket-middle-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.jacket-bottom-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.jacket-accolade-badge {
  font-family: var(--font-sans);
  font-size: 7.5px;
  font-weight: 600;
  color: #fef08a;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 2px 6px;
  border-radius: 3px;
  max-width: 90%;
  line-height: 1.2;
}

.jacket-genre-tag {
  font-family: var(--font-display);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(229, 169, 60, 0.35);
  text-transform: uppercase;
}

.jacket-title {
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.18;
  margin: 0;
  transition: all 0.2s ease;
}

/* Typography Fonts */
.font-cinzel { font-family: 'Cinzel', Georgia, serif; }
.font-playfair { font-family: 'Playfair Display', Georgia, serif; font-style: normal; }
.font-cormorant { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; letter-spacing: 1.5px; }
.font-montserrat { font-family: 'Montserrat', sans-serif; font-weight: 800; letter-spacing: 1.2px; }
.font-fredoka { font-family: 'Fredoka', cursive, sans-serif; font-weight: 600; text-transform: none; }
.font-spectral { font-family: 'Spectral', Georgia, serif; }
.font-outfit { font-family: 'Outfit', sans-serif; font-weight: 800; letter-spacing: 1.5px; }

/* Typography Color Themes */
.theme-gold {
  color: #fef08a;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 45%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.95));
}

.theme-white {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.95), 0 0 16px rgba(255,255,255,0.4);
}

.theme-silver {
  color: #f1f5f9;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #64748b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.95));
}

.theme-crimson {
  color: #fca5a5;
  background: linear-gradient(135deg, #fecaca 0%, #ef4444 50%, #7f1d1d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.95));
}

.theme-cyan {
  color: #67e8f9;
  text-shadow: 0 0 8px rgba(6,182,212,0.8), 0 2px 8px rgba(0,0,0,0.95);
}

.theme-noir {
  color: #090d16;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5), 0 -1px 2px rgba(0,0,0,0.8);
}

/* Typography Sizes */
.size-compact { font-size: 10px; }
.size-standard { font-size: 12px; }
.size-large { font-size: 14.5px; }
.size-xl { font-size: 17px; }

.jacket-subtitle {
  font-family: 'Spectral', Georgia, serif;
  font-size: 8.5px;
  font-style: italic;
  color: #f1f5f9;
  text-shadow: 0 1px 4px rgba(0,0,0,0.95);
  max-width: 90%;
  line-height: 1.2;
}

.jacket-author {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}

.jacket-imprint-mini {
  font-size: 6px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

/* Layer Group Styling in Studio */
.cover-layer-group {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
}

.cover-layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.cover-layer-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   PUBLISHING IMPRINT, RIGHTS & LEGAL SUITE
   ========================================================================== */
#publishing-view {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-deep);
  padding-bottom: 40px;
}

#publishing-view.active {
  display: flex;
}

.pub-readiness-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 8px 14px;
  min-width: 220px;
}

.pub-readiness-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.pub-readiness-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-readiness-val {
  font-weight: 800;
  color: var(--accent-emerald);
}

.pub-readiness-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.pub-readiness-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-emerald));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Sub-Navigation Tabs */
.pub-subnav-bar {
  display: flex;
  gap: 6px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
  overflow-x: auto;
}

.pub-subnav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.pub-subnav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.pub-subnav-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.06);
}

/* Tab Panes */
.pub-tab-pane {
  display: none;
  padding: 24px;
}

.pub-tab-pane.active {
  display: block;
}

.pub-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .pub-grid-2col {
    grid-template-columns: 1fr;
  }
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.pub-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}

.pub-icon {
  font-size: 20px;
  color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.12);
  padding: 10px;
  border-radius: var(--border-radius-md);
}

.pub-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pub-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Checklist Roadmap */
.pub-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pub-check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pub-check-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(229, 169, 60, 0.3);
}

.pub-checklist-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-gold);
  margin-top: 2px;
  cursor: pointer;
}

.pub-check-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pub-check-text b {
  font-size: 13.5px;
  color: #fff;
}

.pub-check-text span {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Guidance Info Boxes */
.pub-info-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-info-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-info-box p {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Copyright Toggles */
.pub-toggles-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
}

.pub-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.pub-switch-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-gold);
}

.pub-switch-item b {
  color: #fff;
}

/* Previews */
.pub-preview-box {
  background: #020617;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.pub-preview-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.pub-cip-pre {
  margin: 0;
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Barcode Container */
.pub-barcode-preview-card {
  background: #ffffff;
  padding: 12px;
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Permissions Table */
.pub-table-responsive {
  overflow-x: auto;
}

.pub-permissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.pub-permissions-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.pub-permissions-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.pub-permissions-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.perm-title-cell {
  display: flex;
  align-items: center;
  color: #fff;
}

.perm-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.perm-type-chip {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.perm-fee-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-gold);
}

.status-pill.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.badge-pd {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.status-pill.badge-rf {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   ELEGANT BOOK FRONT MATTER & TABLE OF CONTENTS
   ========================================================================== */
.book-toc-wrapper {
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  font-family: 'Spectral', 'Merriweather', Georgia, serif;
  color: #1e293b;
  user-select: none;
}

.toc-header {
  text-align: center;
  margin-bottom: 24px;
}

.toc-title {
  font-family: 'Cinzel', 'Spectral', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.toc-ornament {
  font-size: 8px;
  letter-spacing: 6px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.toc-entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.toc-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  color: #1e293b;
}

.toc-entry:hover {
  background: rgba(229, 169, 60, 0.12);
  color: #b45309;
}

.toc-title-wrap {
  display: flex;
  flex-direction: column;
  max-width: 76%;
  flex-shrink: 0;
}

.toc-chapter-title {
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-meta-sub {
  display: block;
  font-size: 9.5px;
  color: #64748b;
  font-style: italic;
  margin-top: 1px;
}

.toc-leader {
  flex: 1;
  margin: 0 6px 3px 6px;
  min-width: 12px;
}

.toc-leader.leader-dots {
  border-bottom: 1px dotted rgba(100, 116, 139, 0.45);
}

.toc-leader.leader-dashes {
  border-bottom: 1px dashed rgba(100, 116, 139, 0.45);
}

.toc-leader.leader-solid {
  border-bottom: 1px solid rgba(100, 116, 139, 0.35);
}

.toc-leader.leader-none {
  border-bottom: none;
}

.toc-ornament-line {
  width: 48px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  margin: 6px auto;
}

.toc-header.align-left {
  text-align: left;
}

.toc-header.align-right {
  text-align: right;
}

.toc-header.align-center {
  text-align: center;
}

.toc-page-num {
  font-family: 'Spectral', Georgia, serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  flex-shrink: 0;
  text-align: right;
  min-width: 22px;
}

.toc-empty {
  text-align: center;
  color: #94a3b8;
  font-style: italic;
  font-size: 12px;
}

/* ==========================================================================
   TABLE OF CONTENTS STUDIO MODAL & STYLE GENERATOR
   ========================================================================== */
.modal-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  overflow-x: auto;
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.modal-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-tab-btn.active {
  background: rgba(229, 169, 60, 0.15);
  color: var(--accent-gold);
  border-color: rgba(229, 169, 60, 0.3);
}

.toc-studio-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  min-height: 380px;
}

.toc-tab-content {
  display: none;
}

.toc-tab-content.active {
  display: block;
}

.toc-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.toc-preset-card {
  background: var(--bg-tertiary, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-preset-card:hover {
  border-color: var(--accent-gold, #e5a93c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.toc-preset-card.active {
  border-color: var(--accent-gold, #e5a93c);
  background: rgba(229, 169, 60, 0.08);
  box-shadow: 0 0 0 1px var(--accent-gold, #e5a93c);
}

.toc-preset-card b {
  font-size: 13px;
  color: var(--text-primary, #f8fafc);
}

.toc-preset-card span {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.35;
}

.preset-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--accent-gold, #e5a93c);
  color: #0f172a;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-chip-btn {
  background: var(--bg-tertiary, #1e293b);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-secondary, #cbd5e1);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.preset-chip-btn:hover {
  background: rgba(229, 169, 60, 0.15);
  border-color: var(--accent-gold, #e5a93c);
  color: var(--accent-gold, #e5a93c);
  transform: scale(1.02);
}

.toc-studio-preview {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.toc-preview-header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-paper-preview-card {
  background: #fdfcf7;
  color: #1e293b;
  border-radius: 4px;
  padding: 16px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  min-height: 320px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   CONTINUITY SENTINEL & PLOT HOLE INSPECTOR
   ========================================================================== */
.header-continuity-btn {
  position: relative;
}

.continuity-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f43f5e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.5);
  border: 1.5px solid #0f172a;
}

.btn-scene-continuity {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  margin-left: 6px;
}

.btn-scene-continuity:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.btn-scene-continuity.has-issues {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

.btn-scene-continuity.has-warnings {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.continuity-health-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.health-score-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border: 2px solid #38bdf8;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-score-number {
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}

.health-score-label {
  font-size: 8.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.continuity-stats-grid {
  display: flex;
  gap: 12px;
  flex: 1;
}

.stat-pill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 8px;
  flex: 1;
}

.stat-pill-item i {
  font-size: 18px;
}

.stat-pill-item b {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-pill-item span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.stat-pill-item.badge-critical i { color: #f43f5e; }
.stat-pill-item.badge-warning i { color: #f59e0b; }
.stat-pill-item.badge-info i { color: #38bdf8; }

.continuity-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.continuity-tab-container {
  min-height: 360px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.continuity-tab-content {
  display: none;
}

.continuity-tab-content.active {
  display: block;
}

.continuity-issues-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.continuity-issue-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-gold);
  border-radius: 8px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.continuity-issue-card.severity-critical {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.05);
}

.continuity-issue-card.severity-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.continuity-issue-card.severity-suggestion {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

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

.issue-type-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.badge-critical-tag {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-warning-tag {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-suggestion-tag {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.issue-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.issue-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.issue-card-desc b {
  color: var(--text-primary);
}

.issue-fixes-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.btn-fix-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-fix-action:hover {
  background: rgba(229, 169, 60, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.character-journey-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.character-journey-wrapper::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 20px;
  left: 10px;
  width: 2px;
  background: rgba(56, 189, 248, 0.3);
}

.journey-step-node {
  position: relative;
  padding-bottom: 20px;
}

.journey-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.journey-step-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.journey-step-info b {
  font-size: 13px;
  color: var(--text-primary);
}

.journey-step-info span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.journey-dist-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(229, 169, 60, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.travel-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.rule-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.rule-icon {
  font-size: 22px;
  color: #38bdf8;
  width: 36px;
  height: 36px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rule-info b {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.rule-info span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.relic-continuity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.relic-card-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.relic-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   AXIOS MEDIA GROUP // BUSINESS TASKS & CALENDAR SCHEDULER
   ========================================================================== */
.pub-calendar-dest-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(229, 169, 60, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 16px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.calendar-dest-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.calendar-dest-badges {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pub-task-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pub-task-filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-task-filter-btn:hover {
  background: rgba(229, 169, 60, 0.1);
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.pub-task-filter-btn.active {
  background: rgba(229, 169, 60, 0.18);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 700;
}

.pub-tasks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 1080px) {
  .pub-tasks-grid {
    grid-template-columns: 1fr;
  }
}

.pub-task-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pub-task-card:hover {
  border-color: rgba(229, 169, 60, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.pub-task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pub-task-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.pub-category-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pub-priority-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.pub-priority-chip.chip-high {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.pub-priority-chip.chip-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pub-priority-chip.chip-low {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.pub-task-status-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-task-to-schedule {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-task-scheduled {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-task-in-progress {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-task-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pub-task-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
}

.pub-task-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pub-task-meta-item .meta-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pub-task-meta-item .meta-val {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.pub-task-portal-link {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
}

.pub-task-portal-link a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.pub-task-portal-link a:hover {
  text-decoration: underline;
}

.pub-task-instructions-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
}

.instructions-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-task-step-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pub-task-step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pub-task-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  margin-top: 4px;
}

.status-quick-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-task-dispatch-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-task-action {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-task-action.btn-gcal {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.4);
  color: #60a5fa;
}

.btn-task-action.btn-gcal:hover {
  background: rgba(66, 133, 244, 0.25);
  border-color: #60a5fa;
}

.btn-task-action.btn-ics {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-task-action.btn-ics:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.btn-task-action.btn-mailto {
  background: rgba(229, 169, 60, 0.12);
  border-color: rgba(229, 169, 60, 0.4);
  color: var(--accent-gold);
}

.btn-task-action.btn-mailto:hover {
  background: rgba(229, 169, 60, 0.25);
  border-color: var(--accent-gold);
}

/* ==========================================================================
   PRISTINE ZEN FOCUS MODE (DISTRACTION-FREE BOOK INTERFACE)
   ========================================================================== */
body.zen-focus-mode .studio-header {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.zen-focus-mode .studio-sidebar,
body.zen-focus-mode .scene-inspector-panel {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.zen-focus-mode .scene-inspector-panel {
  transform: translateX(100%);
}

body.zen-focus-mode .studio-main-body {
  height: 100vh !important;
  max-height: 100vh !important;
  padding: 0 !important;
  background: radial-gradient(circle at center, #131b2e 0%, #080c16 100%);
}

body.zen-focus-mode .workspace-center-canvas {
  width: 100vw !important;
  height: 100vh !important;
  padding: 30px !important;
}

body.zen-focus-mode .book-page-spread-container {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 100px rgba(229, 169, 60, 0.08);
}

.btn-exit-zen {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 169, 60, 0.4);
  color: var(--accent-gold);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.btn-exit-zen:hover {
  background: rgba(229, 169, 60, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   AMBIENT VOICE ORB & FLOATING TRIGGER
   ========================================================================== */
.header-voice-btn {
  position: relative;
}

.header-voice-btn.is-listening {
  background: rgba(229, 169, 60, 0.25);
  border-color: var(--accent-gold);
}

.header-voice-btn.is-listening .voice-pulse-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  animation: voicePulse 1.5s infinite ease-out;
}

.ambient-voice-orb {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  z-index: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.voice-orb-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.4) 0%, transparent 70%);
  animation: orbBreathe 3s infinite ease-in-out;
  pointer-events: none;
}

.voice-orb-core {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1.5px solid rgba(229, 169, 60, 0.6);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.ambient-voice-orb:hover {
  transform: scale(1.1);
}

.ambient-voice-orb:hover .voice-orb-core {
  border-color: var(--accent-gold);
  color: #fff;
  background: linear-gradient(135deg, #2d3b55, #1e293b);
  box-shadow: 0 0 20px rgba(229, 169, 60, 0.5);
}

.ambient-voice-orb.is-listening .voice-orb-core {
  background: linear-gradient(135deg, rgba(229, 169, 60, 0.3), #0f172a);
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
  animation: listeningJitter 0.8s infinite alternate ease-in-out;
}

.ambient-voice-orb.is-thinking .voice-orb-core {
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
  animation: thinkingSpin 2s infinite linear;
}

.voice-orb-tooltip {
  position: absolute;
  right: 62px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.2s ease;
}

.ambient-voice-orb:hover .voice-orb-tooltip {
  opacity: 1;
  transform: translateX(0);
}

@keyframes voicePulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes orbBreathe {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.25); opacity: 0.8; }
}

@keyframes listeningJitter {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.15); }
}

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

/* ==========================================================================
   VOICE THOUGHT STUDIO MODAL & REAL-TIME VISUALIZER
   ========================================================================== */
.voice-studio-dialog {
  max-width: 860px;
  width: 95%;
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 169, 60, 0.35) !important;
}

.voice-mic-orb-indicator {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(229, 169, 60, 0.15);
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.voice-mic-orb-indicator.is-listening {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.voice-live-canvas-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.voice-waveform-canvas {
  width: 100%;
  height: 50px;
  display: block;
}

.voice-live-transcript-bubble {
  font-size: 13px;
  font-style: italic;
  color: var(--accent-gold);
  text-align: center;
  min-height: 20px;
}

.voice-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .voice-studio-grid {
    grid-template-columns: 1fr;
  }
}

.voice-thought-panel,
.voice-stream-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.voice-thought-result-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.thought-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 24px 12px;
}

.voice-sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.sample-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-chip:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.1);
}

.thought-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thought-category-chip {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.thought-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.thought-lead-summary {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.thought-pathways-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
}

.pathways-heading {
  font-size: 11px;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.thought-pathways-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thought-pathway-item {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.thought-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.btn-thought-action {
  background: rgba(229, 169, 60, 0.12);
  border: 1px solid rgba(229, 169, 60, 0.4);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-thought-action:hover {
  background: rgba(229, 169, 60, 0.25);
  color: #fff;
  border-color: var(--accent-gold);
}

.voice-transcript-stream {
  height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.voice-bubble {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.voice-bubble-user {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  align-self: flex-start;
  width: 90%;
}

.voice-bubble-ai {
  background: rgba(229, 169, 60, 0.1);
  border: 1px solid rgba(229, 169, 60, 0.25);
  align-self: flex-end;
  width: 90%;
}

.bubble-sender {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
}

.voice-command-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.btn-voice-mic-main {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}

.btn-voice-mic-main:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: translateY(-1px);
}

.voice-input-wrapper {
  flex: 1;
  display: flex;
  position: relative;
}

.voice-manual-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 42px 10px 14px;
  font-size: 12.5px;
  outline: none;
}

.voice-manual-input:focus {
  border-color: var(--accent-gold);
}

.btn-send-thought {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
}

.voice-cheatsheet-banner {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}

.cmd-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
}
