/* ==========================================================================
   BOOKTOK STUDIO SLATE - OBS MODE & MULTI-SCENE CANVAS RENDER STYLES
   ========================================================================== */

:root {
  /* Default Theme: Dark Academia */
  --bg-primary: #141110;
  --bg-secondary: #221d1a;
  --bg-card: rgba(38, 32, 29, 0.85);
  --bg-glass: rgba(45, 38, 35, 0.75);
  
  --text-primary: #f5eedc;
  --text-secondary: #c4b9a5;
  --text-muted: #8c8070;
  
  --accent-gold: #d4af37;
  --accent-gold-glow: rgba(212, 175, 55, 0.35);
  --accent-crimson: #9e2a2b;
  --accent-amber: #e07a5f;
  --accent-emerald: #3d405b;
  --accent-spicy: #ff4d4d;
  
  --border-color: rgba(212, 175, 55, 0.3);
  --border-glass: rgba(245, 238, 220, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-code: 'Fira Code', monospace;
  
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 36px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 25px var(--accent-gold-glow);
  
  --chroma-bg: transparent;
}

/* OBS & CHROMA WORKFLOW MODES (FULL SCREEN SLATE) */
body.mode-obs .slate-bottom-half,
body.mode-chroma .slate-bottom-half {
  display: none !important;
}

body.mode-obs .slate-top-half,
body.mode-chroma .slate-top-half {
  height: 100% !important;
  border-bottom: none !important;
}

/* Cozy Pastel Theme Override */
body.theme-cozy-pastels {
  --bg-primary: #f5efe6;
  --bg-secondary: #e8ded1;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  
  --text-primary: #1f1815;
  --text-secondary: #4a3e37;
  --text-muted: #73645c;
  
  --accent-gold: #b36b22;
  --accent-gold-glow: rgba(179, 107, 34, 0.25);
  --accent-crimson: #a62b2b;
  
  --border-color: rgba(179, 107, 34, 0.4);
  --border-glass: rgba(0, 0, 0, 0.12);
}

body.theme-cozy-pastels .book-title { color: #110d0c; }
body.theme-cozy-pastels .book-author { color: #594a43; }
body.theme-cozy-pastels .quote-card-sticky {
  background: rgba(179, 107, 34, 0.12);
  border-left-color: #b36b22;
}
body.theme-cozy-pastels .quote-text { color: #2b201b; }
body.theme-cozy-pastels .trope-pill {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: #241c19;
}
body.theme-cozy-pastels .viral-hook-banner {
  background: #a62b2b;
  color: #ffffff;
}
body.theme-cozy-pastels .hook-text { color: #ffffff; }
body.theme-cozy-pastels .top5-item-title { color: #2b201b; }
body.theme-cozy-pastels .cam-frame-border {
  border-color: rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.04);
}
body.theme-cozy-pastels .cam-text { color: #2b201b; }

/* Velvet Night Theme */
body.theme-velvet-night {
  --bg-primary: #0a0814;
  --bg-secondary: #161228;
  --bg-card: rgba(28, 23, 50, 0.88);
  --bg-glass: rgba(35, 29, 65, 0.75);
  --text-primary: #f0edff;
  --text-secondary: #b6b0db;
  --text-muted: #7972a1;
  --accent-gold: #ffd700;
  --accent-gold-glow: rgba(255, 215, 0, 0.4);
  --border-color: rgba(138, 43, 226, 0.4);
}

body.theme-chroma-green {
  --chroma-bg: #00FF00 !important;
}

body.theme-chroma-blue {
  --chroma-bg: #0000FF !important;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: 48px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
}

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

.brand-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--accent-gold);
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-gold);
}

.brand-tagline {
  font-size: 8px;
  color: var(--text-muted);
}

/* ALWAYS VISIBLE QUICK WORKFLOW & THEME BAR */
.quick-workflow-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 95;
  flex-shrink: 0;
}

.workflow-tabs {
  display: flex;
  background: rgba(0,0,0,0.3);
  padding: 2px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--accent-gold);
  color: #141110;
  box-shadow: 0 2px 8px var(--accent-gold-glow);
}

.theme-select-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.theme-icon {
  font-size: 11px;
}

.theme-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rec-header-btn {
  background: #a62b2b;
  color: #fff;
  border: 1px solid #ff4d4d;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
  transition: all 0.2s ease;
}

.rec-header-btn.is-recording {
  background: #ff0000;
  animation: pulseRec 1.2s infinite;
}

.rec-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.icon-btn.active {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.2);
}

/* Layout */
.studio-container {
  flex: 1;
  display: flex;
  height: calc(100vh - 96px);
  height: calc(100dvh - 96px);
  overflow: hidden;
  position: relative;
}

.control-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.mobile-tab-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.library-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-subtitle {
  font-size: 9px;
  color: var(--text-muted);
}

.highlight-section {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Typography Controls */
.typo-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.typo-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.size-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.size-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 5px 2px;
  border-radius: var(--radius-sm);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.size-btn.active {
  background: var(--accent-gold);
  color: #141110;
  border-color: var(--accent-gold);
  font-weight: 800;
}

.style-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.format-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.format-btn.active {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 800;
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-dot:hover, .color-dot.active {
  transform: scale(1.25);
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.form-input {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.quantity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.qty-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.qty-btn.active {
  background: var(--accent-gold);
  color: #141110;
  border-color: var(--accent-gold);
  font-weight: 800;
}

.qty-num {
  font-size: 13px;
  font-weight: 800;
}

.qty-label {
  font-size: 8px;
}

.scene-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scene-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.scene-btn.active {
  background: var(--accent-gold);
  color: #141110;
  border-color: var(--accent-gold);
  font-weight: 800;
}

.quick-triggers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

.trigger-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.trigger-btn:hover {
  background: var(--accent-gold);
  color: #141110;
}

.trigger-btn.active {
  background: var(--accent-gold) !important;
  color: #141110 !important;
  border-color: var(--accent-gold) !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.book-select {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(0,0,0,0.15);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lib-item.active {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.12);
}

.lib-thumb {
  width: 26px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
}

.lib-info {
  flex: 1;
  overflow: hidden;
}

.lib-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-author {
  font-size: 9px;
  color: var(--text-muted);
}

.lib-item-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lib-item-edit-btn:hover {
  color: var(--accent-gold);
  background: rgba(255,255,255,0.1);
}

/* Canvas Viewport */
.canvas-viewport-container {
  flex: 1;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 60px 12px;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.canvas-frame.mode-9-16 {
  height: min(640px, calc(100vh - 160px));
  height: min(640px, calc(100dvh - 160px));
  aspect-ratio: 9 / 16;
  width: auto;
  background: var(--chroma-bg, var(--bg-secondary));
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
  margin: 0 auto;
}

.rec-timer-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(218, 0, 0, 0.88);
  color: #ffffff;
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.rec-indicator-dot {
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulseDot 1s infinite;
}

/* Slate Top Half */
.slate-top-half {
  height: 50%;
  width: 100%;
  position: relative;
  background: var(--chroma-bg, var(--bg-glass));
  backdrop-filter: blur(16px);
  border-bottom: 2px dashed var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: font-size 0.2s ease, font-family 0.2s ease;
}

/* INITIAL CENTER INTRO HOOK CARD STYLES */
.slate-hook-intro-card {
  position: absolute;
  inset: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  text-align: center;
  z-index: 40;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.intro-hook-badge {
  background: var(--accent-crimson);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.intro-hook-text {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  max-width: 94%;
  margin-bottom: 10px;
}

.intro-tap-hint {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--accent-gold);
  animation: pulseDot 1.4s infinite;
}

/* MULTI-LINE VIRAL HOOK HEADER BANNER */
.viral-hook-banner {
  min-height: 32px;
  height: auto !important;
  flex-shrink: 0;
  background: var(--accent-crimson, #9e2a2b);
  border-bottom: 2px solid var(--accent-gold);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 25;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hook-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.hook-text {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  white-space: normal !important;
  word-break: break-word;
}

/* TAP-TO-REVEAL VISIBILITY CLASSES */
.hidden-element {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(10px) scale(0.9) !important;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.reveal-element {
  display: flex !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Typography Classes */
.slate-top-half.font-playfair,
.slate-top-half.font-playfair .book-title,
.slate-top-half.font-playfair .hook-text,
.slate-top-half.font-playfair .quote-text {
  font-family: 'Playfair Display', Georgia, serif;
}

.slate-top-half.font-cursive,
.slate-top-half.font-cursive .book-title,
.slate-top-half.font-cursive .hook-text,
.slate-top-half.font-cursive .quote-text {
  font-family: 'Dancing Script', cursive !important;
  font-size: 118% !important;
}

.slate-top-half.font-arial,
.slate-top-half.font-arial .book-title,
.slate-top-half.font-arial .hook-text,
.slate-top-half.font-arial .quote-text {
  font-family: 'Inter', Arial, sans-serif !important;
}

.slate-top-half.font-bold-impact,
.slate-top-half.font-bold-impact .book-title,
.slate-top-half.font-bold-impact .hook-text,
.slate-top-half.font-bold-impact .quote-text {
  font-family: 'Inter', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: -0.5px;
}

.slate-top-half.font-code,
.slate-top-half.font-code .book-title,
.slate-top-half.font-code .hook-text,
.slate-top-half.font-code .quote-text {
  font-family: 'Fira Code', monospace !important;
}

/* Size Classes */
.slate-top-half.size-sm .book-title { font-size: 11px !important; }
.slate-top-half.size-sm .hook-text { font-size: 9px !important; }
.slate-top-half.size-sm .quote-text { font-size: 7.5px !important; }

.slate-top-half.size-md .book-title { font-size: 13.5px; }
.slate-top-half.size-md .hook-text { font-size: 10.5px; }
.slate-top-half.size-md .quote-text { font-size: 8.5px; }

.slate-top-half.size-lg .book-title { font-size: 16px !important; }
.slate-top-half.size-lg .hook-text { font-size: 12.5px !important; }
.slate-top-half.size-lg .quote-text { font-size: 10px !important; }

.slate-top-half.size-xl .book-title { font-size: 19px !important; line-height: 1.1; }
.slate-top-half.size-xl .hook-text { font-size: 14px !important; }
.slate-top-half.size-xl .quote-text { font-size: 11px !important; }

/* Formatting Classes */
.slate-top-half.style-bold .book-title,
.slate-top-half.style-bold .hook-text,
.slate-top-half.style-bold .quote-text {
  font-weight: 900 !important;
}

.slate-top-half.style-italic .book-title,
.slate-top-half.style-italic .hook-text,
.slate-top-half.style-italic .quote-text {
  font-style: italic !important;
}

.slate-top-half.style-uppercase .book-title,
.slate-top-half.style-uppercase .hook-text {
  text-transform: uppercase !important;
}

/* Custom Text Color Overrides */
.slate-top-half.has-custom-color,
.slate-top-half.has-custom-color .book-title,
.slate-top-half.has-custom-color .book-author,
.slate-top-half.has-custom-color .quote-text,
.slate-top-half.has-custom-color .top5-item-title,
.slate-top-half.has-custom-color .duo-header h2,
.slate-top-half.has-custom-color .duo-card h4,
.slate-top-half.has-custom-color .rapid-info h2,
.slate-top-half.has-custom-color .rapid-info h4,
.slate-top-half.has-custom-color .countdown-card h2,
.slate-top-half.has-custom-color .countdown-card h4,
.slate-top-half.has-custom-color .chalk-output,
.slate-top-half.has-custom-color .intro-hook-text {
  color: var(--custom-text-color) !important;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(35px);
  pointer-events: none;
  opacity: 0.25;
}

.bg-glow-1 {
  width: 130px;
  height: 130px;
  background: var(--accent-gold);
  top: -20px;
  left: -20px;
}

.bg-glow-2 {
  width: 110px;
  height: 110px;
  background: var(--accent-crimson);
  bottom: -20px;
  right: -20px;
}

.slate-texture {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 12px 12px;
  pointer-events: none;
}

.scene-view {
  position: absolute;
  top: 34px;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.scene-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.spotlight-card-wrapper {
  display: flex;
  gap: 10px;
  height: 100%;
}

.book-cover-container {
  width: 95px;
  height: 145px;
  position: relative;
  flex-shrink: 0;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px rgba(0,0,0,0.5);
  border: 1px solid var(--border-glass);
}

.cover-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 14px var(--accent-gold-glow);
  pointer-events: none;
}

.release-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--accent-crimson);
  color: #fff;
  font-size: 7.5px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: var(--radius-full);
}

.book-info-slate {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.tag-pill-container {
  align-self: flex-start;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.book-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 9.5px;
  color: var(--text-secondary);
}

.rating-box {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 1px 0;
}

.stars-container {
  display: flex;
  gap: 2px;
}

.star {
  font-size: 13px;
  color: #555;
  transition: all 0.2s ease;
}

.star.active {
  color: var(--accent-gold);
  text-shadow: 0 0 6px var(--accent-gold-glow);
  transform: scale(1.1);
}

.rating-score {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold);
}

.tropes-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 36px;
  overflow: hidden;
}

.trope-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.meters-row {
  display: flex;
  gap: 8px;
  font-size: 8.5px;
  color: var(--text-secondary);
}

.quote-card-sticky {
  background: rgba(245, 238, 220, 0.12);
  border-left: 3px solid var(--accent-gold);
  padding: 4px 6px;
  border-radius: 4px;
  margin-top: auto;
  position: relative;
}

.sticky-pin {
  position: absolute;
  top: -4px;
  right: 4px;
  font-size: 9px;
}

.quote-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 8.5px;
  line-height: 1.2;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Duo View */
.duo-header {
  text-align: center;
  margin-bottom: 4px;
}

.duo-badge {
  background: var(--accent-crimson);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.duo-header h2 {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 2px;
}

.duo-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 140px;
}

.duo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  gap: 3px;
}

.duo-card.highlight {
  transform: scale(1.04);
}

.duo-tag {
  font-size: 7.5px;
  font-weight: 800;
  color: var(--text-muted);
}

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

.duo-cover {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border-glass);
}

.duo-arrow {
  font-size: 16px;
  color: var(--accent-gold);
  font-weight: 800;
}

.duo-card h4 {
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Top 5 Shelf */
.top5-header {
  text-align: center;
  margin-bottom: 4px;
}

.top5-badge {
  background: var(--accent-gold);
  color: #141110;
  font-size: 7.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.top5-header h2 {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--text-primary);
}

.top5-grid {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-end;
  height: 135px;
}

.top5-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 46px;
  position: relative;
}

.top5-rank {
  position: absolute;
  top: -5px;
  background: var(--accent-crimson);
  color: #fff;
  font-size: 7.5px;
  font-weight: 800;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.top5-cover {
  width: 44px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-glass);
}

.top5-item-title {
  font-size: 6.5px;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Rapid Stack */
.scene-rapid {
  align-items: center;
}

.rapid-counter-badge {
  background: var(--accent-gold);
  color: #141110;
  font-family: var(--font-code);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.rapid-card {
  display: flex;
  gap: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 8px;
  width: 100%;
}

.rapid-cover {
  width: 65px;
  height: 98px;
  object-fit: cover;
  border-radius: 5px;
}

.rapid-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rapid-info h2 {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--text-primary);
}

.rapid-info h4 {
  font-size: 9px;
  color: var(--text-muted);
}

.rapid-tropes {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

/* Countdown & Typewriter */
.scene-countdown {
  align-items: center;
  justify-content: center;
}

.countdown-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  width: 100%;
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.timer-unit {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--accent-gold);
  border-radius: 4px;
  padding: 3px 6px;
}

.unit-val {
  font-family: var(--font-code);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-gold);
}

.unit-lbl {
  font-size: 6.5px;
}

.timer-sep {
  font-size: 14px;
  color: var(--accent-gold);
}

.chalkboard-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.chalkboard-header {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.chalk-textarea {
  width: 100%;
  height: 36px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 4px;
  font-size: 9.5px;
  resize: none;
  margin-bottom: 4px;
}

.chalk-output {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 6px;
  font-family: var(--font-serif);
  font-size: 10px;
  color: var(--text-primary);
  overflow-y: auto;
}

/* Bottom Half Camera Viewport */
.slate-bottom-half {
  height: 50%;
  width: 100%;
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.webcam-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  transition: filter 0.3s ease;
}

/* CAMERA BEAUTY & LIGHTING FILTERS */
.slate-bottom-half.beauty-smooth video {
  filter: contrast(1.05) brightness(1.08) saturate(1.1) drop-shadow(0 0 10px rgba(255,255,255,0.15));
}

.slate-bottom-half.beauty-ringlight video {
  filter: contrast(1.1) brightness(1.18) saturate(1.05);
}

.slate-bottom-half.beauty-golden video {
  filter: contrast(1.06) brightness(1.1) saturate(1.3) sepia(0.18);
}

.slate-bottom-half.beauty-coquette video {
  filter: contrast(1.08) brightness(1.12) saturate(1.2) hue-rotate(-12deg);
}

.slate-bottom-half.beauty-dramatic video {
  filter: contrast(1.2) brightness(0.98) sepia(0.25) saturate(1.1);
}

.slate-bottom-half.beauty-none video {
  filter: none;
}

.camera-filter-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(20, 17, 16, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.filter-icon {
  font-size: 11px;
}

.filter-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 9.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.camera-placeholder {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-frame-border {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
}

.cam-icon-box {
  text-align: center;
  color: var(--text-muted);
}

.cam-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 2px;
  opacity: 0.6;
}

.cam-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.cam-subtext {
  font-size: 7.5px;
  color: var(--text-muted);
}

.studio-watermark {
  position: absolute;
  bottom: 5px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 7.5px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 10;
}

/* Floating Control Touch Bar */
.mobile-touch-bar {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 17, 16, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7), var(--shadow-glow);
  z-index: 200;
  max-width: 95%;
  overflow-x: auto;
}

.touch-bar-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.touch-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.touch-btn:hover {
  background: var(--accent-gold);
  color: #141110;
}

.touch-btn.active {
  background: var(--accent-gold) !important;
  color: #141110 !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 8px var(--accent-gold-glow);
}

.touch-btn.touch-font {
  background: rgba(168, 222, 222, 0.2);
  border-color: #a8dede;
}

.touch-btn.touch-accent {
  background: var(--accent-gold);
  color: #141110;
}

.touch-btn.touch-star {
  background: rgba(252, 196, 25, 0.2);
  border-color: var(--accent-gold);
}

.touch-btn.touch-rec {
  background: #a62b2b;
  color: #fff;
  border-color: #ff4d4d;
}

.touch-btn.touch-rec.is-recording {
  background: #ff0000;
  animation: pulseRec 1.2s infinite;
}

.touch-btn.touch-clean {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* NATIVE MOBILE APP BOTTOM NAVBAR */
.mobile-app-navbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: rgba(18, 15, 14, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 250;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab-btn .nav-icon {
  font-size: 18px;
}

.nav-tab-btn .nav-label {
  font-size: 9px;
  font-weight: 700;
}

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

.nav-tab-btn.active .nav-icon {
  transform: translateY(-2px) scale(1.1);
}

.recording-orb {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(158, 42, 43, 0.9);
  border: 2px solid var(--accent-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 300;
}

/* Clean Mode */
body.clean-recording-active .control-panel,
body.clean-recording-active .app-header,
body.clean-recording-active .quick-workflow-bar,
body.clean-recording-active .mobile-touch-bar,
body.clean-recording-active .mobile-app-navbar {
  display: none !important;
}

body.clean-recording-active .canvas-viewport-container {
  padding: 0;
}

body.clean-recording-active .canvas-frame.mode-9-16 {
  height: 100dvh !important;
  width: auto;
  border: none;
  border-radius: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 400px;
  max-width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 14px;
}

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

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

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

.flex-1 {
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 9.5px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gold);
  color: #141110;
  border: none;
}

.btn-edit {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
}

.btn-edit:hover {
  background: var(--accent-gold);
  color: #141110;
}

.btn-danger {
  background: rgba(166, 43, 43, 0.3);
  color: #ff4d4d;
  border: 1px solid #a62b2b;
  padding: 4px 8px;
  font-size: 9.5px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger:hover {
  background: #a62b2b;
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.hidden {
  display: none !important;
}

@keyframes pulseRec {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

@keyframes pulseDot {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* SCREEN WIDTH <= 768px OVERRIDES */
@media (max-width: 768px) {
  .mobile-app-navbar {
    display: flex;
  }

  .workflow-tabs {
    display: flex !important;
  }

  .quick-workflow-bar {
    padding: 6px 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .studio-container {
    flex-direction: column;
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
  }

  body.mobile-view-slate .control-panel {
    display: none;
  }

  body.mobile-view-slate .canvas-viewport-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 6px 6px 60px 6px;
  }

  body.mobile-view-slate .canvas-frame.mode-9-16 {
    height: calc(100dvh - 150px) !important;
    width: auto;
    max-width: 100%;
  }

  body:not(.mobile-view-slate) .canvas-viewport-container {
    display: none;
  }

  body:not(.mobile-view-slate) .control-panel {
    display: flex;
    width: 100%;
    height: 100%;
    border-right: none;
    border-top: none;
    padding: 12px 12px 65px 12px;
  }

  .mobile-touch-bar {
    bottom: 60px;
  }
}
