/* DeepStory - Dual Pane Studio Layout, Subscriptions & Visible Block-Card Screenplay Editor */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --bg-page: #F4F5F6;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4F4F5;
  --bg-hover: #ECECEE;
  --border-color: #E4E4E7;
  --border-strong: #D4D4D8;
  --primary-dark: #18181B;
  --primary-dark-hover: #27272A;
  --text-main: #18181B;
  --text-muted: #71717A;
  --text-dim: #A1A1AA;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent ANY outer page scrolling */
  background-color: var(--bg-page);
  color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D4D4D8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #A1A1AA;
}

/* App View Containers */
.app-view {
  display: none;
  width: 100%;
  height: 100%;
}

.app-view.active {
  display: flex;
}

/* ==========================================================================
   CUSTOM DESKTOP TITLEBAR (Frameless Tauri Window)
   ========================================================================== */
.desktop-titlebar {
  display: none; /* hidden in browser */
  height: 38px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 14px;
  user-select: none;
  z-index: 1000;
  -webkit-app-region: drag;
}

body.is-desktop {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.is-desktop .desktop-titlebar {
  display: flex;
}

body.is-desktop .app-view.active {
  flex: 1;
  height: calc(100vh - 38px);
  overflow: hidden;
}

body.is-desktop #view-auth.active {
  overflow-y: auto;
}

body.is-desktop .landing-only-link {
  display: none !important;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-app-region: drag;
}

.titlebar-title {
  font-size: 12px;
  font-weight: 700;
  color: #18181B;
  letter-spacing: -0.01em;
}

.titlebar-divider {
  font-size: 11px;
  color: #D4D4D8;
}

.titlebar-doc-name {
  font-size: 11.5px;
  color: #71717A;
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-center {
  flex: 1;
  height: 100%;
  -webkit-app-region: drag;
}

.titlebar-right {
  display: flex;
  align-items: center;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  width: 44px;
  height: 38px;
  background: transparent;
  border: none;
  color: #52525B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  -webkit-app-region: no-drag;
}

.titlebar-btn:hover {
  background: #F4F4F5;
  color: #18181B;
}

.titlebar-btn-close:hover {
  background: #EF4444 !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   LANDING PAGE STYLES
   ========================================================================== */

#view-landing {
  flex-direction: column;
  background-color: #FAFAFA;
  min-height: 100vh;
  overflow-y: auto;
}

.landing-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.landing-nav-link:hover {
  color: var(--text-main);
}

.landing-hero-section {
  padding: 72px 24px 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

.landing-hero-title {
  font-size: 3rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #09090B;
  margin-bottom: 18px;
  max-width: 800px;
}

@media (max-width: 640px) {
  .landing-hero-title {
    font-size: 2.2rem;
  }
}

.landing-hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 32px;
}

.landing-cta-btn-primary {
  background: var(--primary-dark);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.15);
}

.landing-cta-btn-primary:hover {
  background: var(--primary-dark-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(24, 24, 27, 0.2);
}

.landing-cta-btn-secondary {
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.landing-cta-btn-secondary:hover {
  background: #F4F4F5;
  border-color: var(--border-strong);
}

/* Landing Preview Mockup */
.landing-mockup-wrapper {
  max-width: 1040px;
  width: 100%;
  margin: 20px auto 72px auto;
  padding: 0 20px;
}

.landing-mockup-frame {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.landing-mockup-topbar {
  height: 40px;
  background: #F4F4F5;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D4D4D8;
}

/* Pricing Section */
.landing-pricing-section {
  max-width: 1040px;
  margin: 0 auto 72px auto;
  padding: 0 24px;
}

.pricing-billing-switch {
  display: inline-flex;
  align-items: center;
  background: #F4F4F5;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 36px;
}

.pricing-billing-btn {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pricing-billing-btn.active {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pricing-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.pricing-card.featured {
  border-color: #18181B;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: #18181B;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #09090B;
}

.landing-features-section {
  max-width: 1040px;
  margin: 0 auto 72px auto;
  padding: 0 24px;
}

.landing-feature-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.landing-feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.landing-cta-box {
  background: #18181B;
  color: #FFFFFF;
  border-radius: 24px;
  padding: 56px 36px;
  text-align: center;
  max-width: 960px;
  margin: 0 auto 64px auto;
}

.landing-footer {
  border-top: 1px solid var(--border-color);
  background: #FFFFFF;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1040px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   AUTH PAGE / VIEW
   ========================================================================== */

#view-auth {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #FAFAFA;
  padding: 24px;
}

.auth-card-container {
  width: 100%;
  max-width: 400px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.05);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 10px;
}

.auth-tab.active {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  background: #F4F4F5;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px 10px 38px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.auth-input:focus {
  background: #FFFFFF;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  color: #A1A1AA;
  pointer-events: none;
  font-size: 18px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  color: #71717A;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.auth-password-toggle:hover {
  color: #18181B;
}

/* ==========================================================================
   STUDIO EDITOR VIEW (#view-app)
   ========================================================================== */

#view-app {
  flex-direction: row;
  height: 100%;
  overflow: hidden;
}

.left-chat-pane {
  width: 420px;
  min-width: 360px;
  max-width: 500px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 20;
}

.chat-pane-header {
  height: 52px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  user-select: none;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.user-directive-bubble {
  background: #F4F4F5;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.assistant-chat-bubble {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.thinking-accordion {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  background: #F4F4F5;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  transition: all 0.15s ease;
  user-select: none;
  font-weight: 500;
}

.thinking-accordion:hover {
  background: #ECECEE;
  color: var(--text-main);
}

.thinking-content-box {
  background: #F8F9FA;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #52525B;
  max-height: 200px;
  overflow-y: auto;
}

.chat-action-pill {
  padding: 5px 10px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: #27272A;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-action-pill:hover {
  background: #F4F4F5;
  border-color: var(--border-strong);
  color: #09090B;
}

.chat-pane-input-wrapper {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-pane-box {
  background: #F4F4F5;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}

.chat-pane-box:focus-within {
  background: #FFFFFF;
  border-color: var(--primary-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-pane-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  min-height: 38px;
  max-height: 120px;
}

.chat-pane-textarea::placeholder {
  color: #A1A1AA;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: #27272A;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.pill-badge:hover {
  background: #ECECEE;
  border-color: var(--border-strong);
}

.btn-send {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-send:hover {
  background: var(--primary-dark-hover);
}

.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 6px;
  z-index: 60;
  display: none;
  min-width: 170px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #27272A;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  font-weight: 500;
}

.dropdown-item:hover {
  background: #F4F4F5;
  color: #09090B;
}

.params-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 14px;
  right: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  z-index: 50;
  display: none;
}

.params-popover.show {
  display: block;
}

/* Tier Badges */
.tier-badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tier-badge-free {
  background: #E4E4E7;
  color: #52525B;
}

.tier-badge-pro {
  background: #18181B;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tier-badge-studio {
  background: linear-gradient(135deg, #18181B 0%, #3F3F46 100%);
  color: #FFFFFF;
  border: 1px solid #71717A;
}

.user-avatar-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #18181B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   CENTER SCRIPT CANVAS & VISIBLE BLOCK CARDS (NO OUTER SHEET)
   ========================================================================== */

.center-script-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #F4F5F6;
  overflow: hidden;
  position: relative;
}

.script-canvas-header {
  height: 52px;
  border-bottom: 1px solid var(--border-color);
  background: #FFFFFF;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  z-index: 10;
}

/* Scroller with generous bottom padding */
.script-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 360px 20px;
  scroll-padding-bottom: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
}

/* The wrapper container - transparent with no background box */
.screenplay-paper-sheet {
  width: 100%;
  max-width: 820px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 auto;
}

/* ==========================================================================
   VISIBLE BLOCK-CARD STYLING (ALWAYS DISTINCT WHITE CARDS)
   ========================================================================== */

.script-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Every paragraph is an independent visible white card at all times */
.script-block {
  position: relative;
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.01);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-block:hover {
  border-color: var(--border-strong) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.script-block:focus-within {
  border-color: #18181B !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Floating Block Action Toolbar (Appears on hover / focus) */
.block-actions-bar {
  position: absolute;
  top: -12px;
  right: 14px;
  background: #18181B;
  border-radius: 8px;
  padding: 4px 8px;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 25;
  user-select: none;
}

.script-block:hover .block-actions-bar,
.script-block:focus-within .block-actions-bar {
  display: flex;
}

.block-action-btn {
  background: transparent;
  border: none;
  color: #D4D4D8;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.block-action-btn:hover {
  background: #27272A;
  color: #FFFFFF;
}

.block-type-indicator {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A1A1AA;
  padding-right: 6px;
  border-right: 1px solid #3F3F46;
}

/* Editable content area inside block */
.block-editable-content {
  outline: none;
  min-height: 24px;
  width: 100%;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-main);
}

.block-editable-content[contenteditable="true"]:empty:before {
  content: "Введите текст абзаца...";
  color: #A1A1AA;
}

/* Classic Courier Font Mode inside visible blocks */
.screenplay-paper-sheet.font-courier .block-editable-content {
  font-family: 'Courier Prime', 'JetBrains Mono', monospace !important;
  font-size: 14px;
  line-height: 1.6;
}

.screenplay-paper-sheet.font-courier * {
  font-family: inherit !important;
}

/* Specialized Block Types */
.block-type-h1 {
  border-left: 4px solid #18181B !important;
}

.block-type-h1 .block-editable-content {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #09090B;
  padding-bottom: 2px;
}

.block-type-h2 .block-editable-content {
  font-size: 1.25rem;
  font-weight: 700;
  color: #18181B;
}

.block-type-h3 .block-editable-content {
  font-size: 1.1rem;
  font-weight: 600;
  color: #18181B;
}

.block-type-slugline {
  background: #FFFFFF !important;
  border-left: 4px solid #18181B !important;
}

.block-type-slugline .block-editable-content {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  color: #09090B;
}

.block-type-character .block-editable-content {
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  font-size: 0.92rem;
  color: #18181B;
}

.block-type-parenthetical .block-editable-content {
  font-style: italic;
  text-align: center;
  font-size: 0.88rem;
  color: #52525B;
}

.block-type-dialogue .block-editable-content {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Add Block Button at bottom */
.btn-add-block-bottom {
  margin-top: 16px;
  padding: 12px 24px;
  border-radius: 14px;
  border: 1px dashed var(--border-color);
  background: #FFFFFF;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.btn-add-block-bottom:hover {
  background: #F4F4F5;
  border-color: #18181B;
  color: #18181B;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* YouTube Table inside block card */
.yt-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
}

.yt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.yt-table th {
  background: #F4F4F5;
  color: #18181B;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
}

.yt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F4F4F5;
  vertical-align: top;
  line-height: 1.5;
  color: #3F3F46;
}

.cursor-blink {
  display: inline-block;
  width: 6px;
  height: 16px;
  background-color: #18181B;
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

#btn-canvas-scroll-bottom {
  position: absolute;
  bottom: 24px;
  right: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #18181B;
  border: 1px solid #27272A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 35;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

#btn-canvas-scroll-bottom.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* History Drawer */
#history-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.08);
  z-index: 90;
  transform: translateX(-100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

#history-drawer.open {
  transform: translateX(0);
}

#history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  z-index: 85;
  display: none;
}

#history-backdrop.open {
  display: block;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #18181B;
  border: 1px solid #27272A;
  color: #FFFFFF;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.25s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { border-left: 4px solid #10B981; }
.toast-error { border-left: 4px solid #EF4444; }
.toast-info { border-left: 4px solid #6366F1; }
.toast-warning { border-left: 4px solid #F59E0B; }

/* Print Styles */
@media print {
  #view-landing,
  #view-auth,
  .left-chat-pane,
  .script-canvas-header,
  .block-actions-bar,
  .btn-add-block-bottom,
  .no-print,
  #toast-container,
  #settings-modal,
  #upgrade-modal,
  #history-drawer,
  #history-backdrop {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
  }

  #view-app {
    display: block !important;
    height: auto !important;
  }

  .center-script-canvas {
    height: auto !important;
    background: #FFFFFF !important;
  }

  .script-scroll-area {
    padding: 0 !important;
    overflow: visible !important;
  }

  .script-block {
    box-shadow: none !important;
    border: none !important;
    padding: 6px 0 !important;
    border-radius: 0 !important;
  }
}
