/* ==========================================================================
   NOTEFROMUS™ HoD Workspace — Script Writer Stylesheet
   Design: IMAH-Landing Page Aesthetic (Ivory, Charcoal, Terracotta & Sage)
           + Clean White Screenplay Paper (WriterDuet Hollywood Standard)
   ========================================================================== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ==========================================================================
   NOTEFROMUS™ Cinematic Design Tokens & Palette
   Inspired by adiletfndr.com Cinematic Noir & Modern Film Suite Aesthetics
   ========================================================================== */
/* ==========================================================================
   ULTRA-MINIMALIST SLIM SCROLLBARS (Cross-Browser & WebKit)
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transition: background 0.15s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 47, 0.65);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

:root {
  /* Cinematic Midnight Palette */
  --bg-cinema: #0b0e13;
  --bg-cinema-card: rgba(255, 255, 255, 0.045);
  --bg-cinema-card2: #141922;
  --line-cinema: rgba(255, 255, 255, 0.1);
  --line-cinema-subtle: rgba(255, 255, 255, 0.06);
  --text-cinema: #f5f2ee;
  --text-cinema-body: rgba(245, 242, 238, 0.85);
  --text-cinema-mute: rgba(245, 242, 238, 0.58);

  /* Flame Orange / Amber Gradient */
  --or: #ff7a2f;
  --or2: #fb923c;
  --orsoft: rgba(255, 122, 47, 0.12);
  --amber: #FFB000;
  --amber-hover: #EAA000;
  --amber-active: #D69000;
  --amber-border: rgba(255, 122, 47, 0.35);

  /* Screenplay Paper (Hollywood Clean White) */
  --paper-bg: #FFFFFF;
  --paper-text: #000000;
  --paper-muted: #333333;

  /* Aliases for ScriptWriter Elements */
  --bg-ivory: #0b0e13;
  --bg-ivory-light: #141922;
  --bg-ivory-card: rgba(255, 255, 255, 0.045);
  --text-black: #FFFFFF;
  --text-charcoal: #f5f2ee;
  --text-muted: rgba(245, 242, 238, 0.65);
  --text-subtle: rgba(245, 242, 238, 0.45);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);

  --ink: #FFFFFF;
  --muted: rgba(245, 242, 238, 0.65);
  --line: rgba(255, 255, 255, 0.1);
  --brand: #ff7a2f;
  --radius: 14px;
}

/* Keyboard Accessibility */
*:focus-visible {
  outline: 2px solid #ff7a2f !important;
  outline-offset: 2px !important;
}

/* Global Primary Button (Flame Amber with Shine Sweep Animation) */
.primary-btn, .sw-btn-primary {
  position: relative !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, #9a3412 0%, #ea580c 50%, #fb923c 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-weight: 800 !important;
  padding: 10px 22px !important;
  font-size: 13.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 12px 32px rgba(234, 88, 12, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  min-height: 42px !important;
}

.primary-btn::after, .sw-btn-primary::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: -60% !important;
  width: 40% !important;
  height: 100% !important;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent) !important;
  transform: skewX(-20deg) !important;
  animation: shine 3.2s ease-in-out infinite !important;
}

@keyframes shine {
  0%, 55% { left: -60%; }
  100% { left: 130%; }
}

.primary-btn:hover, .sw-btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 40px rgba(234, 88, 12, 0.45) !important;
}

.primary-btn:active, .sw-btn-primary:active {
  transform: scale(0.98) !important;
}

/* Global Secondary Button (Cinematic Glass) */
.secondary-btn, .sw-btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5f2ee !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-weight: 600 !important;
  padding: 9px 18px !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.secondary-btn:hover, .sw-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 122, 47, 0.45) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px) !important;
}

/* Custom architectural grid & technical patterns */
.bg-arch-grid {
  background-size: 24px 24px;
  background-image: 
    linear-gradient(to right, rgba(221, 216, 206, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(221, 216, 206, 0.4) 1px, transparent 1px);
}

.bg-arch-grid-dense {
  background-size: 16px 16px;
  background-image: 
    linear-gradient(to right, rgba(221, 216, 206, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(221, 216, 206, 0.3) 1px, transparent 1px);
}

.bg-blueprint {
  background-color: #24414B;
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

/* Main Container */
.scriptwriter-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: viewFadeSlide 0.22s ease-out;
}

/* ==========================================================================
   A. SCRIPT LIST (Daftar Naskah)
   ========================================================================== */
.sw-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sw-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sw-header-actions .secondary-btn {
  background: #FFFFFF;
  color: var(--text-charcoal);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(35, 39, 43, 0.04);
  transition: all 0.15s ease;
  cursor: pointer;
}

.sw-header-actions .secondary-btn:hover {
  background: #1a1d23;
  border-color: rgba(35, 39, 43, 0.3);
  transform: translateY(-1px);
}

.sw-header-actions .primary-btn {
  background: var(--amber);
  color: #000000;
  border: 1px solid #EAA000;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(255, 176, 0, 0.28);
  transition: all 0.15s ease;
  cursor: pointer;
}

.sw-header-actions .primary-btn:hover {
  background: var(--amber-hover);
  border-color: var(--amber-active);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 176, 0, 0.35);
}

.sw-list-title-box h2 {
  font: 700 24px 'Space Grotesk', sans-serif;
  letter-spacing: -0.5px;
  margin: 4px 0 6px;
  color: var(--ink);
}

.sw-list-title-box p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.sw-list-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-cinema);
}

.sw-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 260px;
  flex: 1;
}

.sw-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #FFFFFF;
  width: 100%;
}

.sw-search-box input::placeholder {
  color: rgba(244, 246, 250, 0.45);
}

.sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.sw-card {
  background: var(--bg-cinema-card);
  border: 1px solid var(--line-cinema);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.sw-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 122, 47, 0.6);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 122, 47, 0.18);
}

.sw-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.sw-card-title {
  font: 700 18px 'Space Grotesk', sans-serif;
  color: #FFFFFF;
  margin: 0 0 4px;
  line-height: 1.25;
}

.sw-card-author {
  font-size: 12px;
  color: var(--text-cinema-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-card-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 122, 47, 0.15);
  border: 1px solid rgba(255, 122, 47, 0.4);
  color: #ff9d5c;
  font-weight: 700;
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sw-badge-draft {
  background: rgba(255, 122, 47, 0.15);
  color: #ff9d5c;
  border: 1px solid rgba(255, 122, 47, 0.4);
}

.sw-badge-step {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.sw-badge-brand {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.sw-card-snippet {
  font-size: 12.5px;
  color: rgba(244, 246, 250, 0.72);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sw-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.sw-card-date {
  font-size: 11px;
  color: #928373;
}

.sw-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sw-btn-icon {
  background: transparent;
  border: 1px solid rgba(80, 44, 13, 0.14);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #9ab0c8;
  transition: all 0.15s ease;
}

.sw-btn-icon:hover {
  background: rgba(255, 145, 69, 0.15);
  color: #fb923c;
  border-color: #ff9145;
}

.sw-btn-icon.danger:hover {
  background: rgba(254, 226, 226, 0.15);
  color: #f87171;
  border-color: rgba(252, 165, 165, 0.4);
}

.sw-btn-open {
  background: var(--ink);
  color: #d1cfc8;
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.sw-btn-open:hover {
  background: #ff9145;
  color: #171512;
}

/* Empty State */
.sw-empty-state {
  background: rgba(255, 255, 255, 0.035);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sw-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 122, 47, 0.15);
  color: #ff9d5c;
  border: 1px solid rgba(255, 122, 47, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 4px;
}

.sw-empty-state h3 {
  font: 700 20px 'Space Grotesk', sans-serif;
  margin: 0;
  color: #FFFFFF;
}

.sw-empty-state p {
  color: var(--text-cinema-muted);
  font-size: 13px;
  max-width: 440px;
  margin: 0 0 8px;
  line-height: 1.5;
}

/* ==========================================================================
   B. WORKSPACE HEADER & STEPPER
   ========================================================================== */
.sw-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.sw-editor-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(14, 18, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 0 14px;
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 122, 47, 0.04);
  margin-bottom: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

/* Stepper replaced by unified single workspace */
.sw-topbar-stepper {
  display: none !important;
}

/* Highlighted Panduan & Export Buttons in Topbar */
.sw-btn-guide-highlight {
  background: rgba(251, 146, 60, 0.12) !important;
  color: #fb923c !important;
  border: 1px solid rgba(251, 146, 60, 0.38) !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.sw-btn-guide-highlight:hover {
  background: rgba(251, 146, 60, 0.22) !important;
  border-color: #fb923c !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

.sw-topbar-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(244, 246, 250, 0.85);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sw-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1560px) {
  .sw-hide-laptop {
    display: none !important;
  }
}

.sw-btn-export-trigger {
  font-size: 11px !important;
  padding: 4px 8px !important;
}

.sw-topbar-right .secondary-btn {
  font-size: 11px !important;
  padding: 4px 8px !important;
}

.sw-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  white-space: nowrap;
}

.sw-topbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
  flex-shrink: 0;
}

.sw-script-meta-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sw-btn-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #f4f6fa;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.sw-btn-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 122, 47, 0.5);
}

.sw-meta-title {
  font: 700 13.5px 'Space Grotesk', sans-serif;
  color: #FFFFFF;
  letter-spacing: -0.2px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-btn-edit-title {
  font-size: 11px;
  color: rgba(244, 246, 250, 0.45);
  background: none;
  border: none;
  padding: 1px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-btn-edit-title:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.sw-meta-dot,
.sw-meta-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

.sw-author-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  transition: all 0.15s ease;
  font-size: 11px;
}

.sw-author-pill-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 122, 47, 0.4);
}

.sw-author-label {
  font-size: 10px;
  color: rgba(244, 246, 250, 0.45);
}

.sw-author-name {
  color: #f4f6fa;
  font-weight: 600;
  cursor: pointer;
  font-size: 11px;
}

.sw-btn-edit-author {
  font-size: 10px;
  color: rgba(244, 246, 250, 0.5);
  background: none;
  border: none;
  padding: 1px 3px;
  cursor: pointer;
}

.sw-draft-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sw-draft-selector {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: #ffaa6e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.sw-draft-selector:hover {
  border-color: rgba(255, 122, 47, 0.4);
}

.sw-btn-new-draft-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: #ffaa6e;
  background: rgba(255, 122, 47, 0.1);
  border: 1px solid rgba(255, 122, 47, 0.28);
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-btn-new-draft-pill:hover {
  background: rgba(255, 122, 47, 0.2);
  color: #FFFFFF;
  border-color: #ff7a2f;
}

.sw-topbar-right {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.sw-save-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.sw-save-status.saved {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sw-save-status.unsaved {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 600;
}

.sw-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.sw-status-dot.saved {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.sw-status-dot.unsaved {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.sw-btn-manual-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  background: #ff7a2f;
  color: #ffffff;
  border: 1px solid #ff7a2f;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.sw-btn-manual-save:hover {
  background: #ff8c47;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 122, 47, 0.35);
}
.sw-btn-manual-save .sw-kbd-badge {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  letter-spacing: 0.5px;
}
.sw-btn-manual-save.has-unsaved {
  animation: pulseSaveBtn 2s infinite ease-in-out;
}
@keyframes pulseSaveBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 47, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(255, 122, 47, 0); }
}

.sw-toolbar-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sw-toolbar-save-btn:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
}
.sw-toolbar-save-btn.has-unsaved {
  color: #ffaa6e;
  background: rgba(255, 122, 47, 0.15);
  border-color: #ff7a2f;
  box-shadow: 0 0 8px rgba(255, 122, 47, 0.35);
}

.sw-save-status.saving {
  color: #facc15;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.sw-save-status.saving .dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #facc15;
  animation: pulse 1s infinite;
}

.sw-save-status.error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* Stepper Bar */
.sw-stepper-bar {
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.sw-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(244, 246, 250, 0.55);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sw-step-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.sw-step-item.active {
  background: linear-gradient(135deg, #9a3412, #ea580c);
  color: #FFFFFF;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.4);
}

.sw-step-item.active .sw-step-num {
  background: #FFFFFF;
  color: #c2410c;
}

.sw-step-item.completed:not(.active) .sw-step-num {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.sw-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(244, 246, 250, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.sw-step-arrow {
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
}

/* ==========================================================================
   1. STAGE: PREMIS & SINOPSIS
   ========================================================================== */
.sw-stage-card {
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sw-section-head h3 {
  font: 700 18px 'Space Grotesk', sans-serif;
  color: #FFFFFF;
  margin: 0 0 4px;
}

.sw-section-head p {
  color: var(--text-cinema-muted);
  font-size: 12px;
  margin: 0;
}

.sw-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
  color: #f4f6fa;
}

.sw-helper-text {
  font-size: 11px;
  font-weight: 400;
  color: rgba(244, 246, 250, 0.55);
  font-style: italic;
}

.sw-textarea-premise {
  width: 100%;
  min-height: 90px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;
}

.sw-textarea-premise:focus {
  border-color: #ff7a2f;
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.25);
}

.sw-textarea-synopsis {
  width: 100%;
  min-height: 240px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;
}

.sw-textarea-synopsis:focus {
  border-color: #ff7a2f;
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.25);
}


/* Checklist 3 Unsur Premis */
.sw-premise-checklist-box {
  background: rgba(255, 176, 0, 0.05);
  border: 1px solid rgba(255, 176, 0, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-premise-checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sw-premise-checklist-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #FFFFFF;
}

.sw-premise-checklist-title strong {
  color: #FFB000;
  font-weight: 700;
}

.sw-premise-checklist-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 246, 250, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.sw-premise-checklist-badge.complete {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.sw-premise-checklist-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.sw-premise-check-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sw-premise-check-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 176, 0, 0.4);
}

.sw-premise-check-item.checked {
  background: rgba(255, 176, 0, 0.08);
  border-color: rgba(255, 176, 0, 0.45);
}

.sw-premise-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #FFB000;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-premise-check-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-premise-check-content strong {
  font-size: 13px;
  color: #FFFFFF;
  line-height: 1.3;
}

.sw-premise-check-item.checked .sw-premise-check-content strong {
  color: #FFB000;
}

.sw-premise-check-desc {
  font-size: 11px;
  color: rgba(244, 246, 250, 0.6);
  line-height: 1.4;
}

.sw-premise-check-desc em {
  color: rgba(244, 246, 250, 0.8);
  font-style: normal;
}

.sw-word-counter {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-cinema-muted);
}

.sw-stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   2. STAGE: TREATMENT (Scene per Scene)
   ========================================================================== */
.sw-treatment-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sw-treatment-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.sw-treatment-count {
  font-size: 12px;
  font-weight: 700;
  color: #ff9d5c;
}

.sw-treatment-actions {
  display: flex;
  gap: 8px;
}

.sw-scene-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-scene-card {
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.sw-scene-card:hover {
  border-color: rgba(255, 122, 47, 0.5);
}

.sw-scene-card.dragging {
  opacity: 0.45;
  border: 2px dashed #ff7a2f;
}

.sw-scene-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
}

.sw-scene-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sw-drag-handle {
  cursor: grab;
  color: rgba(244, 246, 250, 0.4);
  font-size: 16px;
  padding: 2px 4px;
}

.sw-scene-heading-title {
  font: 700 13px 'Space Grotesk', sans-serif;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  text-transform: uppercase;
}

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

.sw-scene-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
}

.sw-scene-body.collapsed {
  display: none;
}

.sw-scene-meta-grid {
  display: grid;
  grid-template-columns: 110px 1fr 130px;
  gap: 10px;
}

.sw-scene-meta-grid select,
.sw-scene-meta-grid input {
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.sw-scene-meta-grid select option {
  background: #11151e;
  color: #FFFFFF;
}

.sw-scene-char-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-scene-char-row label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(244, 246, 250, 0.8);
}
  color: #635343;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sw-scene-char-row input {
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #2d3340;
  border-radius: 6px;
}

.sw-scene-desc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-scene-desc-row label {
  font-size: 11px;
  font-weight: 700;
  color: #635343;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sw-scene-desc-row textarea {
  min-height: 80px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #2d3340;
  border-radius: 6px;
  resize: vertical;
}

.sw-scene-notes-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-scene-notes-row label {
  font-size: 10px;
  font-weight: 600;
  color: #8c7a68;
}

.sw-scene-notes-row input {
  padding: 6px 10px;
  font-size: 11px;
  border: 1px solid #e7ded4;
  border-radius: 6px;
  background: #faf6f1;
}

/* ==========================================================================
   3. STAGE: SCRIPT / SCREENPLAY (WriterDuet Style)
   ========================================================================== */
.sw-screenplay-container {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  min-height: calc(100vh - 180px);
  width: 100%;
  padding: 0 16px 40px 16px;
  box-sizing: border-box;
}

/* Right: Brief & Checklist Always Visible Docked Panel (Non-intrusive side-by-side) */
.sw-brief-docked-panel {
  width: 280px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: rgba(17, 21, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  max-height: calc(100vh - 70px) !important;
  position: sticky !important;
  top: 54px !important;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 122, 47, 0.05);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
  z-index: 90 !important;
}

.sw-brief-docked-panel.collapsed {
  width: 44px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(17, 21, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

.sw-brief-docked-panel.collapsed:hover {
  background: rgba(255, 122, 47, 0.12);
  border-color: rgba(255, 122, 47, 0.4);
}

.sw-brief-docked-collapsed-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 6px;
  height: 100%;
  gap: 16px;
  user-select: none;
}

.sw-dock-vertical-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffaa6e;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sw-btn-dock-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(244, 246, 250, 0.7);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-btn-dock-toggle:hover {
  background: rgba(255, 122, 47, 0.15);
  color: #FFFFFF;
  border-color: #ff7a2f;
}

/* ==========================================================================
   LEFT: SCENE CHECKLIST & NAVIGATOR DOCKED PANEL
   Structured identical to Brief Checklist for unified workstation UI
   ========================================================================== */
.sw-scene-docked-panel,
.sw-outline-panel {
  width: 270px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: rgba(17, 21, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  max-height: calc(100vh - 70px) !important;
  position: sticky !important;
  top: 54px !important;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 122, 47, 0.05);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
  z-index: 90 !important;
}

.sw-scene-docked-panel.collapsed {
  width: 44px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(17, 21, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

.sw-scene-docked-panel.collapsed:hover {
  background: rgba(255, 122, 47, 0.12);
  border-color: rgba(255, 122, 47, 0.4);
}

.sw-scene-docked-collapsed-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 6px;
  height: 100%;
  gap: 16px;
  user-select: none;
}

.sw-scene-check-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-scene-check-card:hover {
  background: rgba(255, 255, 255, 0.065) !important;
  border-color: rgba(255, 122, 47, 0.45) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sw-scene-check-card.active {
  border-color: #ff7a2f !important;
  background: rgba(255, 122, 47, 0.1) !important;
  box-shadow: 0 0 14px rgba(255, 122, 47, 0.25);
}

.sw-outline-title {
  font: 700 12px 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5c4c3e;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sw-outline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-outline-item {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #4a3e33;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1.35;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-outline-item:hover {
  background: rgba(251, 146, 60, 0.08);
  color: #fb923c;
}

.sw-outline-item.active {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  font-weight: 700;
}

.sw-badge-treatment-updated {
  font-size: 9px;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  padding: 2px 4px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Center: Screenplay Writing Area (Sidebars never overlap script sheet) */
.sw-editor-main {
  flex: 0 0 auto;
  width: 1040px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Editor Toolbar (Single Unified Toolbar Container - Pinned cleanly at top: 0) */
.sw-script-toolbar {
  width: 100%;
  max-width: 1040px;
  background: rgba(15, 19, 27, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 122, 47, 0.08);
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  transition: all 0.2s ease;
}

.sw-toolbar-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.sw-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.sw-type-dropdown {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 1400px) {
  .sw-type-dropdown {
    display: none !important;
  }
}
@media (max-width: 1399px) {
  .sw-type-btns {
    display: none !important;
  }
  .sw-type-dropdown {
    display: inline-flex !important;
    font-size: 11px;
    padding: 4px 6px;
    max-width: 135px;
  }
}

.sw-type-dropdown option {
  background: #11151e;
  color: #FFFFFF;
}

.sw-type-btns {
  display: flex;
  gap: 4px;
}

.sw-type-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 246, 250, 0.8);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-type-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.sw-type-btn.active {
  background: #2563eb !important;
  color: #FFFFFF !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45) !important;
  font-weight: 700 !important;
}

.sw-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Page Stat Badge in Screenplay Toolbar */
.sw-page-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 176, 0, 0.12);
  border: 1px solid rgba(255, 176, 0, 0.35);
  border-radius: 999px;
  font-size: 11.5px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  color: #ffc233;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  user-select: none;
}

/* POP-UP PROMINENT TOTAL PAGE BADGE (User request: terlihat lebih jelas & pop up) */
.sw-page-stat-badge.popup-prominent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.25), rgba(255, 122, 47, 0.35));
  border: 1.5px solid #FFB000;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(255, 176, 0, 0.35), 0 0 12px rgba(255, 122, 47, 0.22);
  user-select: none;
  letter-spacing: 0.3px;
  animation: swPulseStat 3s infinite ease-in-out;
}

@keyframes swPulseStat {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(255, 176, 0, 0.28), 0 0 8px rgba(255, 122, 47, 0.15);
  }
  50% {
    box-shadow: 0 4px 22px rgba(255, 176, 0, 0.55), 0 0 16px rgba(255, 122, 47, 0.4);
  }
}

.sw-page-stat-badge.popup-prominent .sw-stat-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 7px #22c55e;
  display: inline-block;
}

.sw-page-stat-badge.popup-prominent .sw-stat-label {
  color: #ffaa6e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.sw-page-stat-badge.popup-prominent strong {
  font-size: 13.5px;
  color: #FFB000;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 176, 0, 0.4);
}

.sw-page-stat-badge.popup-prominent .sw-stat-unit {
  font-size: 10.5px;
  color: #FFFFFF;
  font-weight: 700;
}

.sw-page-stat-badge.popup-prominent .sw-page-stat-dur {
  color: rgba(244, 246, 250, 0.85);
  font-size: 10.5px;
  font-weight: 600;
}

/* Navigation buttons moved to the left of toolbar before Action */
.sw-toolbar-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sw-toolbar-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid rgba(255, 122, 47, 0.4);
  background: rgba(255, 122, 47, 0.12);
  color: #ffaa6e;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sw-toolbar-nav-btn:hover {
  background: rgba(255, 122, 47, 0.24);
  color: #ffffff;
  border-color: #ff7a2f;
}

.sw-toolbar-nav-btn.active {
  background: linear-gradient(135deg, #ff7a2f, #ea580c);
  color: #ffffff;
  border-color: #ff9d5c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
}

.sw-toolbar-divider-v {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

/* Continuous Screenplay Surface & Multi-Block Selection (WriterDuet Standard) */
.sw-page-sheet {
  user-select: text !important;
  -webkit-user-select: text !important;
}

#swBlocksContainer {
  user-select: text !important;
  -webkit-user-select: text !important;
  width: 100% !important;
  outline: none !important;
  cursor: text;
}

.sw-block {
  user-select: text !important;
  -webkit-user-select: text !important;
}

.sw-page-stat-badge strong {
  font-weight: 700;
  color: #ffffff;
}

.sw-page-stat-dur {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

/* Page Pill in Stepper Navigation */
.sw-step-page-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 176, 0, 0.22);
  color: #ffb000;
  border: 1px solid rgba(255, 176, 0, 0.45);
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

/* Zoom Widget in Toolbar */
.sw-zoom-widget {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 1px 3px;
  gap: 2px;
  user-select: none;
}
.sw-zoom-btn {
  background: transparent;
  border: none;
  color: rgba(244, 246, 250, 0.8);
  font-size: 13px;
  font-weight: bold;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.sw-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.sw-zoom-label {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 4px;
  cursor: pointer;
  min-width: 36px;
  text-align: center;
  transition: all 0.15s ease;
}
.sw-zoom-label:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* ==========================================================================
   WRITERDUET FORMATTING TOOLBAR (Integrated seamlessly inside Toolbar)
   ========================================================================== */
.sw-writerduet-bar {
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 3px 6px;
  gap: 4px;
  margin: 0;
  overflow-x: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
}

.sw-writerduet-bar.collapsed {
  padding: 2px 6px;
}

.sw-writerduet-bar.collapsed .sw-wd-tools-row {
  display: none !important;
}

.sw-wd-collapse-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sw-wd-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sw-wd-tools-row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sw-wd-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 7px;
  min-width: 44px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  flex-shrink: 0;
}

.sw-wd-tool-btn span {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  color: #cbd5e1;
  white-space: nowrap;
}

.sw-wd-tool-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.sw-wd-tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.sw-wd-tool-btn:hover svg {
  transform: translateY(-1px);
}
.sw-wd-tool-btn:hover span {
  color: #ffffff;
}

/* Active Highlight in Studio Cyan-Blue (Bright & Crisp against Dark Slate) */
.sw-wd-tool-btn.active {
  color: #ffffff !important;
  background: #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45) !important;
}

.sw-wd-tool-btn.active span {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.sw-wd-tool-btn.active svg {
  stroke: #ffffff !important;
}

/* Screenplay Paper Sheet (Enlarged & Crisp - Default directly 125% Zoom) */
.sw-page-sheet {
  box-sizing: border-box !important;
  width: 1040px !important;
  max-width: 1040px !important;
  min-height: 1300px !important;
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
  border-radius: 3px !important;
  padding: 76px 96px 96px 140px !important; /* Standard 125% margins: 1.5 in left, 1 in top/bottom/right */
  font-family: 'Courier Prime', 'Courier New', Courier, monospace !important;
  font-size: 20px !important;
  line-height: 1.32 !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  transition: width 0.2s ease, font-size 0.2s ease, padding 0.2s ease !important;
}

/* Zoom Levels */
.sw-page-sheet.zoom-100 {
  width: 880px !important;
  max-width: 880px !important;
  font-size: 16.5px !important;
  padding: 68px 80px 80px 120px !important;
}
.sw-page-sheet.zoom-115 {
  width: 960px !important;
  max-width: 960px !important;
  font-size: 18px !important;
  padding: 72px 88px 88px 130px !important;
}
.sw-page-sheet.zoom-125 {
  width: 1040px !important;
  max-width: 1040px !important;
  font-size: 20px !important;
  padding: 76px 96px 96px 140px !important;
}

.sw-page-sheet * {
  box-sizing: border-box;
}

/* Page Break Divider & Number */
.sw-page-break {
  margin: 40px -80px 40px -120px;
  padding: 10px 24px;
  background: #f8fafc;
  border-top: 1px dashed #cbd5e1;
  border-bottom: 1px dashed #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Page 1 has NO header number in authentic screenplay format (WriterDuet / Hollywood Industry Standard) */
.sw-page-header-number {
  display: none !important;
}
.sw-page-number {
  position: absolute !important;
  top: 36px !important;
  right: 72px !important;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace !important;
  font-size: 14px !important;
  color: #000000 !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  user-select: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Top Screenplay Status Bar (Stats & Save Confirmation Indicator) */
.sw-sheet-status-bar {
  width: 100%;
  max-width: 1040px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 14px;
  margin: 4px 0 0 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 11.5px;
  color: rgba(244, 246, 250, 0.75);
  box-shadow: none;
  user-select: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.sw-sheet-status-bar.saved-pulse {
  border-color: rgba(34, 197, 94, 0.75) !important;
  background: rgba(14, 28, 20, 0.98) !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4), 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.sw-status-items-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
}

.sw-status-left-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.sw-sheet-status-bar .sw-status-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  white-space: nowrap;
}

.sw-sheet-status-bar .sw-status-group strong {
  color: #ffb000;
  font-weight: 700;
}

.sw-sheet-status-bar .sw-status-dot {
  color: rgba(255, 255, 255, 0.2);
  font-weight: bold;
}

/* Top Status Save Tag */
.sw-status-save-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: #4ade80;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.sw-status-save-tag.unsaved {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
}

.sw-status-save-tag.unsaved .sw-status-save-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7) !important;
}

.sw-status-save-tag.saving {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

.sw-status-save-tag.saving .sw-status-save-dot {
  background: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7) !important;
  animation: pulse 1s infinite alternate;
}

.sw-status-save-tag.saved {
  background: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #4ade80 !important;
}

.sw-status-save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}

.sw-status-save-tag.pulse-saved {
  animation: swSaveTagGlow 1.6s ease;
}

@keyframes swSaveTagGlow {
  0% {
    transform: scale(1.08);
    background: rgba(34, 197, 94, 0.35);
    border-color: #22c55e;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.5);
  }
  100% {
    transform: scale(1);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: none;
  }
}

/* Screenplay Blocks (WriterDuet Seamless Continuous Document) */
.sw-block,
.sw-block:focus,
.sw-block:focus-visible,
#swBlocksContainer *:focus,
#swBlocksContainer *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.sw-block {
  outline: none !important;
  border: none !important;
  border-radius: 2px;
  position: relative;
  min-height: 1.25em;
  word-break: break-word;
  white-space: pre-wrap;
  transition: background 0.12s ease;
  line-height: 1.15 !important;
  color: #000000 !important;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace !important;
}

/* Subtle WriterDuet Soft Blue Line Highlight on Focus */
.sw-block:focus {
  background: rgba(224, 242, 254, 0.55) !important;
  border-radius: 2px !important;
}

.sw-block::after {
  content: attr(data-placeholder);
  position: absolute;
  left: 0;
  top: 0;
  color: #b5a89b;
  pointer-events: none;
  opacity: 0.5;
}

.sw-block:not(:empty)::after,
.sw-block:focus:not(:empty)::after {
  display: none;
}

/* Specific Block Typographies & Indents (100% Industry Standard Screenplay & WriterDuet Precision) */
.sw-block[data-type="scene_heading"] {
  text-transform: uppercase !important;
  font-weight: 700 !important;
  margin-top: 24px !important;
  margin-bottom: 12px !important;
  margin-left: 0 !important;
  width: 100% !important;
  color: #000000 !important;
}

.sw-block[data-type="action"] {
  text-transform: none !important;
  font-weight: 400 !important;
  margin-top: 0 !important;
  margin-bottom: 14px !important;
  margin-left: 0 !important;
  max-width: 60ch !important;
  width: 100% !important;
  color: #000000 !important;
}

.sw-block[data-type="character"] {
  text-transform: uppercase !important;
  font-weight: 700 !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  margin-left: 37% !important;
  max-width: 32ch !important;
  width: 63% !important;
  color: #000000 !important;
}

.sw-block[data-type="parenthetical"] {
  text-transform: none !important;
  font-weight: 400 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 28% !important;
  max-width: 26ch !important;
  width: 48% !important;
  color: #111111 !important;
}

.sw-block[data-type="dialogue"] {
  text-transform: none !important;
  font-weight: 400 !important;
  margin-top: 0 !important;
  margin-bottom: 14px !important;
  margin-left: 17% !important;
  max-width: 36ch !important;
  width: 64% !important;
  color: #000000 !important;
}

.sw-block[data-type="transition"] {
  text-transform: uppercase !important;
  font-weight: 700 !important;
  text-align: right !important;
  margin-top: 16px !important;
  margin-bottom: 16px !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  width: 100% !important;
  color: #000000 !important;
}

/* WriterDuet Additional Elements: Shot, Text, Note, Outline, New Act, End Act, Lyrics, Image, Sequence, Dual */
.sw-block[data-type="shot"] {
  text-transform: uppercase !important;
  font-weight: 700 !important;
  margin-top: 18px !important;
  margin-bottom: 8px !important;
  margin-left: 0 !important;
  width: 100% !important;
  color: #000000 !important;
}

.sw-block[data-type="text"] {
  text-transform: none !important;
  font-weight: 400 !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  margin-left: 0 !important;
  width: 100% !important;
  color: #1e293b !important;
}

.sw-block[data-type="note"] {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-left: 3px solid #f59e0b !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 13.5px !important;
  margin: 10px 0 !important;
  line-height: 1.4 !important;
}

.sw-block[data-type="outline"] {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #1d4ed8 !important;
  border-left: 3px solid #2563eb !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  margin: 16px 0 8px 0 !important;
  letter-spacing: 0.5px !important;
}

.sw-block[data-type="new_act"] {
  text-align: center !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
  margin-top: 28px !important;
  margin-bottom: 16px !important;
  font-size: 17px !important;
  color: #000000 !important;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.sw-block[data-type="end_act"] {
  text-align: center !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  text-decoration: underline !important;
  letter-spacing: 1.5px !important;
  margin-top: 24px !important;
  margin-bottom: 24px !important;
  color: #000000 !important;
}

.sw-block[data-type="lyrics"] {
  font-style: italic !important;
  margin-left: 20% !important;
  margin-right: 15% !important;
  margin-top: 4px !important;
  margin-bottom: 12px !important;
  color: #0f172a !important;
}

.sw-block[data-type="image"] {
  background: #f8fafc !important;
  border: 1px dashed #94a3b8 !important;
  border-radius: 6px !important;
  padding: 10px 14px !important;
  margin: 14px 0 !important;
  font-size: 12.5px !important;
  color: #475569 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-block[data-type="sequence"] {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  padding: 8px 14px !important;
  border-radius: 6px !important;
  margin: 20px 0 10px 0 !important;
  letter-spacing: 1px !important;
}

/* Dual Dialogue Component (WriterDuet Exact Authentic Screenplay) */
.sw-block[data-type="dual"],
.sw-block.sw-block-dual {
  display: block !important;
  margin: 14px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: transparent !important;
  border: none !important;
}

.sw-dual-wrapper {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 2px 0 !important;
  position: relative;
  user-select: text;
}

.sw-dual-badge-bar,
.sw-dual-pill,
.sw-dual-btn-revert {
  display: none !important;
}

.sw-dual-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 28px !important;
  width: 100% !important;
  user-select: text;
}

.sw-dual-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.sw-dual-input {
  font-family: 'Courier Prime', Courier, monospace !important;
  font-size: 12pt !important;
  line-height: 1.25 !important;
  color: #000000 !important;
  outline: none !important;
  min-height: 20px;
  word-break: break-word;
  transition: background 0.12s ease;
}

.sw-dual-input:focus {
  background: rgba(56, 189, 248, 0.09) !important;
  border-radius: 3px !important;
}

.sw-dual-char {
  font-weight: 700 !important;
  text-transform: uppercase !important;
  text-align: center !important;
  color: #000000 !important;
  letter-spacing: 0.5px;
  margin: 0 0 2px 0 !important;
}

.sw-dual-text {
  text-align: left !important;
  padding: 0 2px !important;
  color: #000000 !important;
  margin: 0 !important;
}

.sw-dual-input:empty:before {
  content: attr(placeholder);
  color: #94a3b8 !important;
  font-style: italic;
  pointer-events: none;
}
  color: #94a3b8 !important;
  font-style: italic;
  pointer-events: none;
}

/* Autocomplete Popup */
.sw-autocomplete-pop {
  position: absolute;
  background: #1a1d23;
  border: 1px solid #2d3340;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  flex-direction: column;
}

.sw-autocomplete-item {
  padding: 6px 12px;
  font-size: 12px;
  color: #c8d4e8;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  border: none;
  background: transparent;
}

.sw-autocomplete-item:hover,
.sw-autocomplete-item.selected {
  background: rgba(255, 145, 69, 0.12);
  color: #fb923c;
  font-weight: 700;
}

/* ==========================================================================
   RIGHT: UNIFIED PREMIS & TREATMENT DRAWER
   ========================================================================== */
.sw-ref-drawer {
  width: 360px;
  flex-shrink: 0;
  background: #0f131c;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px 0 0 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 72px) !important;
  position: sticky !important;
  top: 56px !important;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.55);
  z-index: 900 !important;
  box-sizing: border-box;
}

.sw-ref-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
}

.sw-ref-tab-nav {
  display: inline-flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px;
}

.sw-ref-tab-pill {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: 600 11.5px 'Plus Jakarta Sans', sans-serif;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.sw-ref-tab-pill:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.sw-ref-tab-pill.active {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
}

.sw-drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.sw-drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(90deg);
}

.sw-ref-tab-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.sw-ref-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-ref-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #ff9d5c;
  letter-spacing: 0.3px;
}

.sw-ref-autosave-badge {
  font-size: 10px;
  font-weight: 600;
  color: #4ade80;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sw-ref-textarea {
  width: 100%;
  background: rgba(8, 12, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  font: 400 12.5px/1.55 'Plus Jakarta Sans', sans-serif;
  color: #f1f5f9;
  resize: vertical;
  min-height: 105px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-ref-textarea:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
  background: rgba(12, 16, 24, 0.9);
}

.sw-ref-storytest-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-ref-storytest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sw-ref-storytest-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sw-ref-badge-test {
  font-size: 10.5px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.6px;
}

.sw-ref-storytest-sub {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.sw-ref-storytest-desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
}

/* Vertical Causality Chain inside Drawer */
.sw-causality-chain {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.sw-chain-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 3.5px;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.sw-chain-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sw-chain-card.c-jika {
  border-left-color: #f59e0b;
}

.sw-chain-card.c-maka1 {
  border-left-color: #38bdf8;
}

.sw-chain-card.c-karna {
  border-left-color: #c084fc;
}

.sw-chain-card.c-tapi {
  border-left-color: #fb7185;
}

.sw-chain-card.c-maka2 {
  border-left-color: #34d399;
}

.sw-chain-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-chain-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.sw-chain-badge.c-jika {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.sw-chain-badge.c-maka1 {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.sw-chain-badge.c-karna {
  background: rgba(192, 132, 252, 0.18);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.sw-chain-badge.c-tapi {
  background: rgba(251, 113, 133, 0.18);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.sw-chain-badge.c-maka2 {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.sw-chain-role {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.sw-chain-body {
  font-size: 11.5px;
  line-height: 1.48;
  color: #f1f5f9;
}

.sw-chain-arrow {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  margin: -3px 0;
  user-select: none;
}

.sw-ref-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sw-ref-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #ff9d5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sw-ref-scenes-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.sw-ref-card {
  background: #181d27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease;
}

.sw-ref-card:hover {
  border-color: rgba(234, 88, 12, 0.35);
}

.sw-ref-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-ref-card-num {
  font-size: 10px;
  font-weight: 700;
  background: rgba(234, 88, 12, 0.2);
  color: #fb923c;
  border-radius: 4px;
  padding: 1px 5px;
}

.sw-ref-card-slug {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  flex: 1;
}

.sw-ref-card-chars {
  font-size: 10px;
  color: #a3a3a3;
}

.sw-ref-card-text {
  font-size: 11.5px;
  line-height: 1.4;
  color: #cbd5e1;
}

.sw-ref-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.sw-btn-del-ref {
  color: #ef4444 !important;
  font-size: 11px !important;
  padding: 1px 4px !important;
}

.sw-btn-insert-ref {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 145, 69, 0.12);
  border: 1px solid rgba(255, 145, 69, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  color: #fb923c;
  transition: all 0.15s ease;
}

.sw-btn-insert-ref:hover {
  background: #ff9145;
  color: #171512;
}

.sw-ref-bottom-actions {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Backdrop for Mobile / Tablet drawers */
.sw-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10005;
}

/* ==========================================================================
   FOCUS MODE (Mode Menulis Bebas Distraksi)
   ========================================================================== */
body.sw-focus-mode .sidebar {
  display: none !important;
}

body.sw-focus-mode .topbar {
  display: none !important;
}

body.sw-focus-mode .main-footer {
  display: none !important;
}

body.sw-focus-mode .sw-outline-panel,
body.sw-focus-mode .sw-ref-drawer {
  display: none !important;
}

body.sw-focus-mode .app-shell {
  grid-template-columns: 1fr !important;
}

body.sw-focus-mode .content {
  padding: 20px 0 !important;
}

body.sw-focus-mode .sw-editor-main {
  max-width: 860px;
  margin: 0 auto;
}

/* ==========================================================================
   MODALS (Buat Naskah, Draft Baru, Konfirmasi Hapus, Brief, Import, Panduan)
   ========================================================================== */
.modal-backdrop,
.sw-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(35, 39, 43, 0.65) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.sw-modal-box {
  width: min(100%, 580px);
  background: linear-gradient(180deg, #161b26 0%, #0d1017 100%) !important;
  border-radius: 24px !important;
  padding: 32px 36px !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9), 0 0 45px rgba(255, 122, 47, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  margin: auto !important;
  position: relative !important;
  color: #f4f6fa !important;
}

.sw-modal-card {
  background: #11151e !important;
  border-radius: 20px !important;
  padding: 28px 30px !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 122, 47, 0.15) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  margin: auto !important;
  position: relative !important;
  color: #f4f6fa !important;
}

.sw-modal-box h2, .sw-modal-card h2 {
  font: 700 22px 'Space Grotesk', sans-serif !important;
  margin: 0 0 6px !important;
  color: #FFFFFF !important;
}

.sw-modal-box p, .sw-modal-card p {
  color: rgba(244, 246, 250, 0.65) !important;
  font-size: 13px !important;
  margin: 0 0 18px !important;
}

.sw-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sw-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(244, 246, 250, 0.85) !important;
}

.sw-modal-form input,
.sw-modal-form select,
.sw-modal-form textarea,
.sw-modal-box input[type="text"],
.sw-modal-box select,
.sw-modal-box textarea,
.sw-modal-card input[type="text"],
.sw-modal-card select,
.sw-modal-card textarea {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05) !important;
  font-size: 13.5px;
  color: #FFFFFF !important;
  transition: all 0.15s ease;
  width: 100%;
}

.sw-modal-form input:focus,
.sw-modal-form select:focus,
.sw-modal-form textarea:focus,
.sw-modal-box input[type="text"]:focus,
.sw-modal-box select:focus,
.sw-modal-box textarea:focus,
.sw-modal-card input[type="text"]:focus,
.sw-modal-card select:focus,
.sw-modal-card textarea:focus {
  outline: none;
  border-color: #ff7a2f !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.25) !important;
}

.sw-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Export Button & Dropdown Menu */
.sw-btn-export-trigger {
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(255, 122, 47, 0.22), rgba(234, 88, 12, 0.35));
  color: #ffaa6e;
  border: 1px solid rgba(255, 122, 47, 0.55);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 10px rgba(255, 122, 47, 0.15);
}

.sw-btn-export-trigger:hover {
  background: linear-gradient(135deg, #ff7a2f, #ea580c);
  color: #FFFFFF;
  border-color: #ff7a2f;
  box-shadow: 0 4px 18px rgba(255, 122, 47, 0.4);
  transform: translateY(-1px);
}

.sw-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #141822;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 122, 47, 0.15);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 270px;
  z-index: 9999 !important;
}

.sw-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.sw-dropdown-item:hover {
  background: rgba(255, 122, 47, 0.15);
  color: #FFFFFF;
  transform: translateX(2px);
}

.sw-dropdown-item-desc {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sw-dropdown-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.sw-dropdown-item-sub {
  font-size: 10.5px;
  color: rgba(244, 246, 250, 0.6);
  font-weight: 400;
}
  color: #fb923c;
}

/* ==========================================================================
   BRIEF & CHECKLIST DO'S / DON'TS (KOLABORASI BRAND & KLIEN)
   ========================================================================== */

/* Brand Collaboration Pill in Header */
.sw-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 145, 69, 0.14);
  color: #a44805;
  border: 1px solid rgba(255, 145, 69, 0.35);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-brand-pill:hover {
  background: #ff9145;
  color: #171512;
  border-color: #f77d2a;
}

.sw-btn-brief-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #161920;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #4a3e32;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sw-btn-brief-trigger:hover {
  background: #ffebd6;
  color: #171512;
  border-color: #ff9145;
}

.sw-btn-brief-trigger.has-violations {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.sw-badge-counter {
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 1px 6px;
  background: #e6dacd;
  color: #4a3c2e;
}

.sw-badge-counter.alert {
  background: #ef4444;
  color: #ffffff;
}

.sw-badge-counter.success {
  background: #10b981;
  color: #ffffff;
}

/* Slide-over / Modal Panel: Brief & Checklist */
.sw-brief-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(92vw, 680px);
  background: #11151e;
  color: #f4f6fa;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 122, 47, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.sw-brief-panel-head {
  padding: 16px 22px;
  background: #161b26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sw-brief-panel-head h3 {
  font: 700 19px 'Space Grotesk', sans-serif;
  margin: 2px 0 4px;
  color: #FFFFFF;
}

.sw-brief-panel-head p {
  color: var(--text-cinema-muted);
  font-size: 12px;
  margin: 0;
}

.sw-brief-panel-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* KPI Summary Bar */
.sw-brief-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sw-kpi-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-kpi-card .kpi-num {
  font: 700 20px 'Space Grotesk', sans-serif;
  color: #FFFFFF;
}

.sw-kpi-card .kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-cinema-muted);
  letter-spacing: 0.3px;
}

.sw-kpi-card.kpi-success .kpi-num { color: #4ade80; }
.sw-kpi-card.kpi-pending .kpi-num { color: #facc15; }
.sw-kpi-card.kpi-danger .kpi-num { color: #f87171; }

/* Filter & Action Bar */
.sw-brief-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sw-brief-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sw-brief-filters select {
  padding: 6px 10px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.sw-brief-filters select option {
  background: #11151e;
  color: #FFFFFF;
}

.sw-brief-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Group Headers: DO & DON'T */
.sw-rules-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-group-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(80, 44, 13, 0.12);
}

.sw-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 13px 'Space Grotesk', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sw-group-title.group-do { color: #047857; }
.sw-group-title.group-dont { color: #b91c1c; }

/* DO & DON'T Badge with Icon & Label */
.sw-badge-do {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.sw-badge-dont {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(252, 165, 165, 0.3);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Rule Card */
.sw-rule-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sw-rule-card:hover {
  border-color: rgba(255, 122, 47, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.sw-rule-card.violation {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.sw-rule-card.fulfilled {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.06);
}

.sw-rule-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.sw-rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.sw-tag-level {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.sw-tag-level.wajib {
  background: #171512;
  color: #d1cfc8;
}

.sw-tag-level.anjuran {
  background: #f1e7db;
  color: #6d5b4b;
}

.sw-tag-scope {
  font-size: 9.5px;
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
}

.sw-tag-stage {
  font-size: 9px;
  background: #1e2128;
  color: #8a9bb0;
  border-radius: 4px;
  padding: 2px 5px;
}

.sw-rule-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 500;
}

/* Status Selectors & Status Badges */
.sw-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(80, 44, 13, 0.1);
  flex-wrap: wrap;
}

.sw-status-label-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.sw-status-select {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #2d3340;
  background: #1a1d23;
  cursor: pointer;
  color: #c8d4e8;
}

.sw-status-select.pending {
  background: rgba(254, 243, 199, 0.1);
  color: #fbbf24;
  border-color: rgba(253, 230, 138, 0.3);
}

.sw-status-select.fulfilled,
.sw-status-select.no_violation {
  background: rgba(209, 250, 229, 0.08);
  color: #34d399;
  border-color: rgba(167, 243, 208, 0.3);
}

.sw-status-select.needs_revision,
.sw-status-select.needs_recheck {
  background: rgba(255, 237, 213, 0.08);
  color: #fb923c;
  border-color: rgba(253, 186, 116, 0.3);
}

.sw-status-select.violation_found {
  background: rgba(254, 226, 226, 0.08);
  color: #f87171;
  border-color: rgba(252, 165, 165, 0.3);
}

.sw-status-select.not_relevant {
  background: rgba(243, 244, 246, 0.05);
  color: #8a9bb0;
  border-color: rgba(229, 231, 235, 0.2);
}

/* Notes & Evidence in Rule Card */
.sw-rule-evidence-box {
  background: #161920;
  border: 1px solid #2d3340;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  color: #9ab0c8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-rule-evidence-box strong {
  color: #fb923c;
  font-size: 10px;
  text-transform: uppercase;
}

.sw-btn-goto-scene {
  background: none;
  border: 1px solid #2d3340;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #6d5b4b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}

.sw-btn-goto-scene:hover {
  background: #ff9145;
  color: #171512;
  border-color: #f77d2a;
}

/* Upload Dropzone */
.sw-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #f4f6fa !important;
}

.sw-dropzone:hover,
.sw-dropzone.dragover {
  border-color: #ff7a2f !important;
  background: rgba(255, 122, 47, 0.08) !important;
}

.sw-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 122, 47, 0.15);
  color: #ff9d5c;
  border: 1px solid rgba(255, 122, 47, 0.4);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sw-dropzone-formats {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.sw-fmt-tag {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: #ff9d5c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* File Attachment Pill */
.sw-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1d23;
  border: 1px solid #2d3340;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 11px;
  color: #c8d4e8;
}

.sw-file-pill a {
  color: #fb923c;
  font-weight: 700;
  text-decoration: underline;
}

/* Text Extraction & Proposed Rules */
.sw-extracted-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-extracted-box textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #2d3340;
  border-radius: 8px;
  background: #161920;
  color: #c8d4e8;
}

.sw-rule-proposal-card {
  background: #1a1d23;
  border: 1px solid #2d3340;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-rule-proposal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sw-btn-proposal-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.sw-btn-proposal-type.active-do {
  background: #059669;
  color: #ffffff;
}

.sw-btn-proposal-type.active-dont {
  background: #dc2626;
  color: #ffffff;
}

.sw-btn-proposal-type.inactive {
  background: #1e2128;
  color: #6b7280;
}

/* Pre-Flight Compliance Modal */
.sw-compliance-warning-box {
  background: #fff8f8;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-compliance-warning-box h4 {
  font: 700 14px 'Space Grotesk', sans-serif;
  color: #991b1b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-compliance-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #4b382a;
}

.sw-compliance-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* ==========================================================================
   GUIDE & NOTES CARDS (PREMISE, SYNOPSIS, TREATMENT, AND SCREENPLAY)
   ========================================================================== */
.sw-guide-card {
  background: #fffcf8;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(217, 104, 24, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-out;
}

.sw-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(251, 146, 60, 0.2);
  padding-bottom: 10px;
}

.sw-guide-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 13.5px 'Space Grotesk', sans-serif;
  color: #fb923c;
}

.sw-guide-header-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  padding: 2px 8px;
  border-radius: 999px;
}

.sw-guide-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sw-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.sw-guide-col {
  background: #1a1d23;
  border: 1px solid rgba(251, 146, 60, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-guide-col h4 {
  font: 700 12.5px 'Space Grotesk', sans-serif;
  color: #fb923c;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-guide-col p {
  font-size: 11.5px;
  line-height: 1.5;
  color: #9ab0c8;
  margin: 0;
}

.sw-formula-pill {
  background: rgba(249, 115, 22, 0.1);
  border: 1px dashed #f97316;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: #fb923c;
  line-height: 1.45;
  font-weight: 600;
}

.sw-formula-example {
  background: #161920;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  color: #c8d4e8;
  line-height: 1.45;
  font-style: italic;
}

.sw-guide-tip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #c8b89a;
  margin: 0;
  padding-left: 16px;
}

.sw-guide-tip-list li {
  line-height: 1.4;
}

/* ==========================================================================
   SCREENPLAY ELEMENT FORMAT GUIDE & CHEATSHEET MODAL
   ========================================================================== */
.sw-element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.sw-element-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.sw-element-card:hover {
  border-color: rgba(255, 122, 47, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.sw-element-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sw-element-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-heading { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); }
.badge-action { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }
.badge-character { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
.badge-parenthetical { background: rgba(192, 132, 252, 0.1); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.25); }
.badge-dialogue { background: rgba(52, 211, 153, 0.1); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.25); }
.badge-transition { background: rgba(251, 113, 133, 0.1); color: #fb7185; border: 1px solid rgba(251, 113, 133, 0.25); }

.sw-element-sample {
  background: #090c10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 11px;
  color: #e2e8f0;
  white-space: pre-wrap;
  line-height: 1.4;
}

.sw-element-flow-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-top: 10px;
}

.sw-element-flow-table th,
.sw-element-flow-table td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.sw-element-flow-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  color: #FFFFFF;
}

.sw-kbd-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #ff9d5c;
}

/* ==========================================================================
   IMPORT SCRIPT MODAL & PARSER PREVIEW
   ========================================================================== */
.sw-import-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
}

.sw-import-stat-item {
  font-size: 11.5px;
  font-weight: 600;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sw-import-preview-sheet {
  background: #090c10;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 11.5px;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.45;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sw-import-preview-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sw-import-preview-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  width: 58px;
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}



/* ==========================================================================
   UNIVERSAL MODAL CLOSE & ICON BUTTONS (Large 44px hit-target, tactile & prominent)
   ========================================================================== */
.icon-btn,
.sw-modal-close-btn,
#swCloseCreateModal,
#swCloseImportModal,
#swCloseElementGuide,
#swCloseBriefPanel,
#swCloseNewDraftModal,
#swCloseEditMeta,
#swCloseAddRuleModal,
#swCloseEditRuleModal,
#swCloseAutoCheckModal,
#swClosePreFlightModal {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f4f6fa !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

.icon-btn:hover,
.sw-modal-close-btn:hover,
#swCloseCreateModal:hover,
#swCloseImportModal:hover,
#swCloseElementGuide:hover,
#swCloseBriefPanel:hover,
#swCloseNewDraftModal:hover,
#swCloseEditMeta:hover,
#swCloseAddRuleModal:hover,
#swCloseEditRuleModal:hover,
#swCloseAutoCheckModal:hover,
#swClosePreFlightModal:hover {
  background: rgba(255, 122, 47, 0.25) !important;
  border-color: #ff7a2f !important;
  color: #FFFFFF !important;
  transform: scale(1.1) rotate(90deg) !important;
  box-shadow: 0 6px 22px rgba(255, 122, 47, 0.45) !important;
}

.icon-btn:active,
.sw-modal-close-btn:active,
#swCloseCreateModal:active,
#swCloseImportModal:active {
  transform: scale(0.94) !important;
}

/* Modal Action Buttons (Prominent, High-Contrast & Tactile) */
.sw-modal-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 14px !important;
  margin-top: 24px !important;
  padding-top: 20px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sw-modal-actions .secondary-btn,
#swCancelCreateModal,
#swCancelImportModal {
  padding: 13px 26px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #c8d4e8 !important;
  cursor: pointer !important;
  min-height: 48px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

.sw-modal-actions .secondary-btn:hover,
#swCancelCreateModal:hover,
#swCancelImportModal:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

.sw-modal-actions .primary-btn,
#swCreateForm button[type="submit"],
#swBtnDoImport {
  position: relative !important;
  overflow: hidden !important;
  padding: 14px 34px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #ff7a2f 0%, #ea580c 50%, #c2410c 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.45), 0 0 20px rgba(255, 122, 47, 0.25) !important;
  cursor: pointer !important;
  min-height: 48px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  letter-spacing: 0.3px !important;
}

.sw-modal-actions .primary-btn:hover,
#swCreateForm button[type="submit"]:hover,
#swBtnDoImport:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 16px 42px rgba(234, 88, 12, 0.65), 0 0 35px rgba(255, 122, 47, 0.45) !important;
}

.sw-modal-actions .primary-btn:active,
#swCreateForm button[type="submit"]:active {
  transform: translateY(1px) scale(0.98) !important;
}

/* ==========================================================================
   NOTEFROMUS™ SCRIPT STUDIO — REAL-TIME COLLABORATION & REVIEW/COMMENT SYSTEM
   ========================================================================== */

/* Review Mode Workspace Banner */
.sw-review-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(2, 132, 199, 0.18) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.sw-review-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-review-badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sw-review-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f0f9ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-review-banner-desc {
  font-size: 11.5px;
  color: rgba(224, 242, 254, 0.75);
}

.sw-review-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sw-btn-review-comment {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.15s ease;
}

.sw-btn-review-comment:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

/* Pulsing Real-time indicator dot */
.sw-realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
}

.sw-realtime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: swRealtimePulse 1.8s infinite ease-in-out;
}

@keyframes swRealtimePulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #22c55e; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Inline Scene Comment Button & Badges */
.sw-scene-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  margin-left: 12px;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  opacity: 0;
  user-select: none;
}

.sw-block[data-type="scene_heading"]:hover .sw-scene-comment-btn,
.sw-block.sw-block-readonly .sw-scene-comment-btn,
body.sw-review-active .sw-scene-comment-btn {
  opacity: 1;
}

.sw-scene-comment-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.sw-scene-comment-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  margin-left: 8px;
  border-radius: 6px;
  background: rgba(255, 176, 0, 0.15);
  border: 1px solid rgba(255, 176, 0, 0.4);
  color: #ffb000;
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.sw-scene-comment-count-badge:hover {
  background: rgba(255, 176, 0, 0.3);
  color: #ffffff;
}

/* Comments Slide-over Drawer */
.sw-comments-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sw-comments-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sw-comments-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 94vw);
  height: 100vh;
  background: #0d121c;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -12px 0 45px rgba(0, 0, 0, 0.75);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.sw-comments-drawer.open {
  transform: translateX(0);
}

.sw-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.sw-drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-drawer-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #38bdf8;
  text-transform: uppercase;
}

.sw-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-drawer-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.sw-drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Drawer Toolbar & Filter Tabs */
.sw-drawer-filter-bar {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sw-drawer-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-drawer-tab-btn {
  background: transparent;
  border: none;
  color: rgba(244, 246, 250, 0.65);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-drawer-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-weight: 700;
}

.sw-drawer-btn-add {
  background: linear-gradient(135deg, #ff7a2f 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
  transition: all 0.15s ease;
}

.sw-drawer-btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.45);
}

/* Comment Cards List */
.sw-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-comment-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.18s ease;
}

.sw-comment-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.sw-comment-card.resolved {
  opacity: 0.65;
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.2);
}

.sw-comment-card.resolved:hover {
  opacity: 0.9;
}

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

.sw-comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-comment-author-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
}

.sw-comment-role-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sw-comment-role-tag.client {
  background: rgba(255, 176, 0, 0.15);
  color: #ffb000;
  border-color: rgba(255, 176, 0, 0.3);
}

.sw-comment-role-tag.director {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

.sw-comment-time {
  font-size: 11px;
  color: rgba(244, 246, 250, 0.5);
}

.sw-comment-scene-target {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.sw-comment-scene-target:hover {
  color: #ffaa6e;
  border-color: rgba(255, 122, 47, 0.4);
}

.sw-comment-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.sw-comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sw-comment-status-pill {
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sw-comment-status-pill.pending {
  color: #ffb000;
}

.sw-comment-status-pill.resolved {
  color: #22c55e;
}

.sw-comment-actions {
  display: flex;
  gap: 6px;
}

.sw-comment-btn-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(244, 246, 250, 0.7);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-comment-btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sw-comment-btn-action.resolve-btn {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.sw-comment-btn-action.resolve-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  color: #ffffff;
}

.sw-comment-btn-action.delete-btn:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

/* Empty Comments State */
.sw-comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: rgba(244, 246, 250, 0.5);
  gap: 12px;
}

.sw-comments-empty-icon {
  font-size: 42px;
  opacity: 0.6;
}

/* Real-time remote edit banner notification */
.sw-remote-sync-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  color: #f0f9ff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  animation: swSlideDown 0.3s ease;
}

@keyframes swSlideDown {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   REVIEW MODE ULTRA-FOCUSED WORKSPACE & MOBILE RESPONSIVENESS
   ========================================================================== */

/* Review Mode Meta Bar */
.sw-review-meta-bar {
  background: rgba(14, 20, 31, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 10px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sw-review-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-review-script-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e0f2fe;
}

.sw-review-script-title {
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  color: #ffffff;
  font-size: 15px;
}

.sw-review-script-draft {
  color: #38bdf8;
  font-weight: 600;
  font-size: 12px;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.sw-review-script-author {
  font-size: 12px;
  color: rgba(244, 246, 250, 0.7);
}

.sw-review-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dedicated Review Floating Toolbar */
.sw-review-script-toolbar {
  position: sticky !important;
  top: 56px !important;
  z-index: 95 !important;
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(56, 189, 248, 0.15) !important;
  border-radius: 12px !important;
}

.sw-review-hint-text {
  font-size: 11.5px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
@media (max-width: 1450px) {
  .sw-review-hint-text {
    display: none !important;
  }
}

.sw-btn-review-comment-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  padding: 7px 15px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35) !important;
  transition: all 0.15s ease !important;
}

.sw-btn-review-comment-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.5) !important;
}

.sw-btn-review-drawer-toggle {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  padding: 7px 13px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}

.sw-btn-review-drawer-toggle:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

/* Mobile Floating Action Button (FAB) */
.sw-mobile-review-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 99;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.55), 0 0 16px rgba(56, 189, 248, 0.4);
  font-size: 24px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.sw-mobile-review-fab:active {
  transform: scale(0.92);
}

.sw-mobile-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff7a2f;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #07090c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ==========================================================================
   RESPONSIVE LAYOUT (TABLET & MOBILE HP)
   ========================================================================== */

/* Visibility text toggles */
.sw-save-text-compact {
  display: none;
}
.sw-save-text-full {
  display: inline;
}
.sw-show-hp {
  display: none;
}
.sw-hide-hp {
  display: inline;
}

/* HP / Mobile Read-Only Mode & Desktop Lock */
.sw-readonly-pill {
  display: none;
}
.sw-mobile-readonly-strip {
  display: none;
}
.sw-readonly-reader-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* TABLET & MOBILE (<= 1024px: iPad, Tablet, Galaxy Tab, Mobile) */
@media (max-width: 1024px) {
  .sw-type-btns {
    display: none !important;
  }
  .sw-type-dropdown {
    display: inline-flex !important;
    font-size: 11px;
    padding: 4px 8px;
    max-width: 140px;
  }
  .sw-screenplay-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .sw-editor-main {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }

  /* Overlay Slide-over Drawers on Tablet & Mobile (Never squashes screenplay sheet!) */
  .sw-scene-docked-panel.collapsed,
  .sw-brief-docked-panel.collapsed {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
  }
  .sw-scene-docked-panel:not(.collapsed) {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    top: 52px !important;
    bottom: 0 !important;
    width: min(85vw, 340px) !important;
    max-height: none !important;
    z-index: 1000 !important;
    background: #0f131a !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 0 16px 16px 0 !important;
  }
  .sw-brief-docked-panel:not(.collapsed) {
    display: flex !important;
    position: fixed !important;
    right: 0 !important;
    top: 52px !important;
    bottom: 0 !important;
    width: min(85vw, 340px) !important;
    max-height: none !important;
    z-index: 1000 !important;
    background: #0f131a !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 16px 0 0 16px !important;
  }
  .sw-ref-drawer {
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(90vw, 360px) !important;
    max-height: none !important;
    z-index: 10010 !important;
    background: #111622 !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 16px 0 0 16px !important;
    padding-top: 16px !important;
  }

  /* Tablet Screenplay Paper Sheet */
  .sw-page-sheet {
    width: 100% !important;
    max-width: 820px !important;
    min-height: auto !important;
    padding: 40px 48px 60px 48px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    font-size: 14.5px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4) !important;
  }
  .sw-page-break {
    margin: 32px -48px 32px -48px !important;
    padding: 8px 16px !important;
  }
}

/* MOBILE (HP <= 768px: iPhone, Android, Small Screens) */
@media (max-width: 768px) {
  .sw-save-text-full {
    display: none !important;
  }
  .sw-save-text-compact {
    display: inline !important;
  }
  .sw-show-hp {
    display: inline !important;
  }
  .sw-hide-hp {
    display: none !important;
  }
  .sw-mobile-review-fab {
    display: none !important;
  }

  /* HP / Mobile Read-Only UI Styles */
  .sw-reader-toolbar {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .sw-reader-toolbar .sw-toolbar-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .sw-reader-toolbar .sw-toolbar-nav-group {
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .sw-reader-toolbar .sw-toolbar-nav-btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
  }
  .sw-reader-toolbar .sw-toolbar-right {
    flex-shrink: 0 !important;
  }
  .sw-reader-toolbar #swBtnFind {
    padding: 4px 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  .sw-readonly-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    color: #38bdf8;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    user-select: none;
  }
  .sw-mobile-readonly-strip {
    display: flex !important;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 4px 10px 8px 10px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 3px solid #38bdf8;
    border-radius: 6px;
    font-size: 11px;
    color: #bae6fd;
    line-height: 1.35;
    box-sizing: border-box;
  }
  .sw-unified-screenplay-flow {
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: default !important;
  }
  .sw-unified-screenplay-flow .sw-block {
    cursor: default !important;
    user-select: text !important;
    -webkit-user-select: text !important;
  }
  .sw-unified-screenplay-flow .sw-block:focus,
  .sw-unified-screenplay-flow .sw-block:active,
  .sw-unified-screenplay-flow:focus {
    outline: none !important;
    box-shadow: none !important;
  }
  .sw-dual-input {
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: default !important;
    pointer-events: none !important;
  }
  .sw-block-readonly {
    cursor: default !important;
  }
  .sw-review-meta-bar {
    padding: 8px 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .sw-review-script-info {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .sw-review-hint-text {
    display: none !important;
  }

  /* TOPBAR on Mobile: Always clean single row with horizontal scroll for metadata */
  .sw-editor-topbar,
  .sw-editor-shell[data-stage="script"] > .sw-editor-topbar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 6px 10px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 6px !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .sw-topbar-left {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
  }
  .sw-topbar-left::-webkit-scrollbar {
    display: none !important;
  }
  .sw-topbar-right {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .sw-meta-title {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .sw-author-pill-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
  }
  .sw-author-label {
    display: none !important;
  }
  .sw-topbar-stepper {
    margin: 0 !important;
    flex-shrink: 0 !important;
    gap: 1px !important;
  }
  .sw-topbar-stepper .sw-step-item {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }
  .sw-topbar-right {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .sw-topbar-right .sw-save-status {
    padding: 3px 6px !important;
    font-size: 10.5px !important;
  }
  .sw-btn-export-trigger,
  .sw-topbar-right .sw-simple-btn {
    padding: 4px 7px !important;
    font-size: 11px !important;
  }

  /* SCREENPLAY TOOLBAR on Mobile: Pinned cleanly to top: 0, 2 neat rows, smooth horizontal swipe */
  .sw-script-toolbar,
  .sw-simple-screenplay .sw-simple-toolbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px 6px !important;
    gap: 3px !important;
    border-radius: 8px !important;
    background: rgba(17, 22, 31, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  }
  .sw-toolbar-row,
  .sw-toolbar-row-main {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  .sw-format-group {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .sw-format-group::-webkit-scrollbar {
    display: none !important;
  }
  .sw-controls-group {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    flex-wrap: nowrap !important;
  }
  .sw-toolbar-row-sub {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    padding-top: 3px !important;
    margin-top: 2px !important;
  }
  .sw-toolbar-row-sub::-webkit-scrollbar {
    display: none !important;
  }
  .sw-format-group-sub {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    flex: 0 0 auto !important;
  }
  .sw-sub-bar-tag {
    font-size: 9px !important;
    flex-shrink: 0 !important;
    margin-right: 2px !important;
    color: rgba(255, 255, 255, 0.4) !important;
  }
  .sw-wd-tool-btn {
    min-width: 38px !important;
    height: 33px !important;
    padding: 2px 4px !important;
  }
  .sw-wd-key {
    font-size: 10px !important;
  }
  .sw-wd-label {
    font-size: 8.5px !important;
  }
  .sw-icon-tool-btn {
    flex-shrink: 0 !important;
    padding: 4px 6px !important;
    min-height: 28px !important;
    font-size: 11px !important;
    gap: 3px !important;
    border-radius: 5px !important;
  }
  .sw-icon-tool-btn svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }
  .sw-controls-group .sw-simple-btn {
    flex-shrink: 0 !important;
    padding: 4px 7px !important;
    min-height: 28px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
  }
  .sw-simple-menu-panel {
    right: 0 !important;
    left: auto !important;
    min-width: 190px !important;
  }

  /* Screenplay Paper Track & Canvas on Mobile */
  .sw-paper-track {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }
  .sw-writing-canvas,
  .sw-print-preview {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .sw-writing-canvas .sw-unified-screenplay-flow {
    padding: 24px 14px 44px 16px !important;
    font-size: 12px !important;
    line-height: 1.18 !important;
  }
  .sw-writing-canvas .sw-block[data-type="character"] {
    margin-left: 18% !important;
    width: auto !important;
    max-width: 80% !important;
  }
  .sw-writing-canvas .sw-block[data-type="parenthetical"] {
    margin-left: 13% !important;
    width: auto !important;
    max-width: 80% !important;
  }
  .sw-writing-canvas .sw-block:is([data-type="dialogue"], [data-type="lyrics"]) {
    margin-left: 8% !important;
    margin-right: 4% !important;
    width: auto !important;
  }
  .sw-writing-canvas .sw-block[data-type="transition"] {
    text-align: right !important;
    width: 100% !important;
  }
  .sw-writing-canvas .sw-block:is([data-type="scene_heading"], [data-type="action"], [data-type="shot"], [data-type="text"], [data-type="note"], [data-type="outline"]) {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .sw-writing-page .sw-print-page-number {
    font-size: 11px !important;
    right: 14px !important;
    top: 10px !important;
  }
  .sw-screenplay-summary {
    padding: 4px 6px !important;
    font-size: 11px !important;
    gap: 6px !important;
    justify-content: flex-end !important;
  }
  .sw-page-jump {
    padding: 2px 5px !important;
    font-size: 11px !important;
  }

  /* Scene Docked Panel Drawer on Mobile */
  .sw-scene-docked-panel:not(.collapsed) {
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1002 !important;
  }
}

/* Review Mode Header Visibility */
body.is-review-mode .qr-review-btn,
body.is-review-mode .qr-btn,
body.is-review-mode .guide-btn,
body.is-review-mode .sw-autosave-indicator,
body.is-review-mode .sw-studio-header .hide-mobile,
body.is-review-mode .sw-studio-header .default-home-btn {
  display: none !important;
}
body.is-review-mode #swReviewHeaderActions {
  display: flex !important;
}
@media (max-width: 640px) {
  body.is-review-mode #swReviewHeaderActions {
    display: none !important;
  }
}

/* Screenplay workspace: Topbar is non-sticky so it scrolls away naturally, leaving 100% viewport to the sticky WriterDuet Toolbar */
.sw-editor-shell[data-stage="script"] > .sw-editor-topbar {
  position: relative !important;
  top: auto !important;
  z-index: 10000 !important;
  height: auto;
  min-height: 44px;
  padding: 6px 12px;
  background: #151920;
  box-shadow: none;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.sw-editor-shell[data-stage="script"] .sw-step-num,
.sw-editor-shell[data-stage="script"] .sw-step-arrow {
  display: none;
}
.sw-editor-shell[data-stage="script"] .sw-step-item {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.sw-editor-shell[data-stage="script"] .sw-step-item.active {
  background: #232a35;
  color: #f1f4f8;
}
.sw-editor-shell[data-stage="script"] .sw-meta-title {
  max-width: min(160px, 27vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-simple-screenplay .sw-editor-main {
  flex: 0 1 1040px;
  width: min(100%, 1040px);
  min-width: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sw-simple-screenplay .sw-scene-docked-panel.collapsed,
.sw-simple-screenplay .sw-brief-docked-panel.collapsed {
  display: none;
}
.sw-simple-screenplay .sw-simple-toolbar,
.sw-simple-screenplay .sw-review-script-toolbar {
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  background: #11161f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 8px;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-simple-screenplay .sw-simple-toolbar::-webkit-scrollbar {
  display: none;
}
.sw-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}
.sw-toolbar-row-sub {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 4px;
  justify-content: flex-start;
  gap: 6px;
}
.sw-format-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.sw-controls-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.sw-sub-bar-tag {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
  user-select: none;
}
.sw-simple-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
}
.sw-simple-screenplay .sw-script-sheet {
  width: var(--script-width, 816px);
  max-width: 100%;
}
.sw-format-label {
  padding: 0 4px;
  color: #b7c0ce;
  font-size: 12px;
}
.sw-simple-btn,
.sw-simple-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e4e9f1;
  font: 600 12px system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.sw-simple-select {
  background: #202631;
  border-color: #404858;
  color-scheme: dark;
}
.sw-simple-btn:hover,
.sw-simple-btn[aria-pressed="true"],
.sw-simple-btn.active,
.sw-simple-menu[open] > summary {
  background: #2a3341;
  color: #fff;
}
.sw-simple-btn:focus-visible,
.sw-simple-select:focus-visible {
  outline: 2px solid #ffc096;
  outline-offset: 1px;
}
.sw-simple-btn.sw-simple-save {
  margin-left: auto;
  color: #171315;
  background: #f4b085;
}
.sw-simple-btn.sw-simple-save:hover,
.sw-simple-btn.sw-simple-save.has-unsaved {
  background: #ffccaa !important;
  color: #171315 !important;
  box-shadow: none !important;
}
.sw-simple-menu {
  position: relative;
}
.sw-simple-menu summary::-webkit-details-marker {
  display: none;
}
.sw-simple-menu-panel {
  position: absolute;
  z-index: 10005 !important;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  min-width: 170px;
  padding: 5px;
  background: #202631;
  border: 1px solid #404858;
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.85);
}
.sw-simple-zoom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #404858;
  margin-top: 4px;
  padding-top: 4px;
}
.sw-screenplay-summary {
  align-self: stretch;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 2px;
  color: #b7c0ce;
  font: 12px system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.sw-screenplay-summary strong {
  color: #f1f4f8;
}
.sw-writing-canvas[hidden],
.sw-print-preview[hidden],
.sw-screenplay-summary [hidden] {
  display: none !important;
}
.sw-writing-canvas,
.sw-print-preview {
  width: 100%;
  container-type: inline-size;
  color: #171717;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-variant-ligatures: none;
}
.sw-writing-page,
.sw-print-page {
  background: #fff;
  box-shadow: 0 3px 16px #0004;
}
.sw-writing-canvas {
  position: relative;
  isolation: isolate;
}
.sw-writing-paper,
.sw-writing-page {
  position: absolute;
  inset-inline: 0;
  pointer-events: none;
}
.sw-writing-paper {
  inset-block: 0;
  z-index: -1;
}
.sw-writing-page,
.sw-print-page {
  scroll-margin-top: 112px;
}
.sw-writing-page .sw-print-page-number {
  font-size: clamp(9px, 1.9608cqw, 24px);
}
.sw-page-jump {
  color: #f1f4f8;
  background: #202631;
  border: 1px solid #404858;
  border-radius: 5px;
  padding: 3px 6px;
  font: inherit;
}
.sw-screenplay-summary {
  align-items: center;
  flex-wrap: wrap;
}
.sw-writing-canvas .sw-unified-screenplay-flow {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 129.4118cqw;
  padding: 11.7647cqw 11.7647cqw 11.7647cqw 17.6471cqw;
  font-size: clamp(9px, 1.9608cqw, 24px);
  line-height: 1;
}
.sw-writing-canvas .sw-block:not([data-type="note"], [data-type="outline"]) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-height: 1em;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  font-size: inherit !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}
.sw-writing-canvas .sw-unified-screenplay-flow > .sw-block {
  --sw-block-gap: 1em;
  flex: none;
  margin-top: calc(var(--sw-block-gap) + var(--sw-page-shift, 0px)) !important;
}
.sw-writing-canvas .sw-block:is([data-type="scene_heading"], [data-type="new_act"], [data-type="dual"]) {
  --sw-block-gap: 2em;
}
.sw-writing-canvas .sw-block:is([data-type="character"], [data-type="parenthetical"], [data-type="dialogue"])
  + .sw-block:is([data-type="parenthetical"], [data-type="dialogue"]),
.sw-writing-canvas .sw-unified-screenplay-flow > .sw-block:first-child {
  --sw-block-gap: 0px;
}
.sw-writing-canvas .sw-block[data-type="character"] {
  margin-left: 22ch !important;
  width: min(38ch, calc(100% - 22ch)) !important;
}
.sw-writing-canvas .sw-block[data-type="parenthetical"] {
  margin-left: 16ch !important;
  width: min(25ch, calc(100% - 16ch)) !important;
}
.sw-writing-canvas .sw-block:is([data-type="dialogue"], [data-type="lyrics"]) {
  margin-left: 10ch !important;
  margin-right: 0 !important;
  width: min(35ch, calc(100% - 10ch)) !important;
}
.sw-print-preview {
  display: grid;
  gap: 16px;
}
.sw-print-page {
  position: relative;
  width: 100%;
  aspect-ratio: 8.5 / 11;
  box-sizing: border-box;
  font-size: 1.9608cqw;
  line-height: 1;
}
.sw-print-page-number,
.sw-print-line {
  position: absolute;
}
.sw-print-page-number {
  top: 5.8824cqw;
  right: 11.7647cqw;
}
.sw-print-line {
  left: var(--x);
  top: calc(var(--y) * 1cqw);
  transform: translateX(var(--align));
  white-space: pre;
}
@media (max-width: 600px) {
  .sw-simple-screenplay .sw-simple-toolbar {
    top: 0 !important;
  }
  .sw-simple-tools {
    gap: 2px;
  }
  .sw-format-label {
    display: none;
  }
  .sw-simple-btn,
  .sw-simple-select {
    padding-inline: 5px;
  }
  .sw-simple-select {
    max-width: 113px;
  }
  .sw-simple-menu-panel {
    left: auto;
    right: 0;
  }
  .sw-studio-product,
  .sw-studio-sep {
    display: none;
  }
}

.sw-workspace-menu > .sw-simple-menu-panel {
  left: 0 !important;
  right: auto !important;
  min-width: 220px !important;
}
.sw-paper-track {
  width: 100%;
  margin-top: 2px;
  overflow-x: auto;
}
.sw-paper-track > :is(.sw-writing-canvas, .sw-print-preview) {
  width: min(var(--script-width, 816px), var(--script-mobile-zoom, 100%));
  margin-inline: auto;
}
@media (max-width: 768px) {
  .sw-editor-shell[data-stage="script"] .sw-author-name,
  .sw-editor-shell[data-stage="script"] .sw-draft-selector {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Writing forms */
.sw-writing-heading,
.sw-treatment-toolbar,
.sw-treatment-actions,
.sw-stage-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sw-writing-heading {
  justify-content: space-between;
}

.sw-writing-heading h3,
.sw-writing-heading p {
  margin: 0;
}

.sw-writing-heading h3 {
  font-size: 18px;
  color: #f4f6fa;
}

.sw-writing-heading p {
  margin-top: 4px;
  color: var(--muted, #aeb7c6);
  font-size: 13px;
}

.sw-writing-heading .sw-treatment-count {
  color: var(--muted, #aeb7c6);
  font-weight: 500;
}

.sw-writing-details {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
}

.sw-writing-details summary {
  cursor: pointer;
  color: #f4f6fa;
  font-size: 13px;
  font-weight: 600;
}

.sw-writing-details summary span {
  color: var(--muted, #aeb7c6);
  font-weight: 400;
}

.sw-writing-details > :not(summary) {
  margin-top: 10px;
}

.sw-field-group > p.sw-helper-text {
  margin: 0;
}

.sw-scene-meta-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
}

.sw-scene-meta-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  color: #e0e5ed;
}

.sw-scene-meta-grid select,
.sw-scene-meta-grid input {
  width: 100%;
  min-width: 0;
}

.sw-scene-header-left {
  min-width: 0;
}

.sw-scene-heading-title {
  overflow-wrap: anywhere;
}

@media (max-width: 540px) {
  .sw-scene-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sw-scene-meta-grid label:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .sw-scene-header {
    flex-wrap: wrap;
  }

  .sw-scene-header-left {
    flex-basis: 100%;
  }
}

/* ==========================================================================
   WRITERDUET UNIFIED TOOLBAR (Exact 16-Element Layout)
   ========================================================================== */
.sw-wd-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  background: rgba(15, 20, 30, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
}

.sw-wd-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
}

.sw-wd-format-group {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.sw-wd-format-group::-webkit-scrollbar {
  display: none !important;
}

.sw-wd-tool-btn {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 3px 4px !important;
  min-width: 36px !important;
  height: 38px !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}

.sw-wd-key {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -0.2px !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 14px !important;
}

.sw-wd-key svg {
  stroke: #94a3b8 !important;
  width: 13px !important;
  height: 13px !important;
}

.sw-wd-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 9px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: -0.2px !important;
  opacity: 0.85 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
}

.sw-wd-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.sw-wd-tool-btn:hover .sw-wd-key,
.sw-wd-tool-btn:hover .sw-wd-label {
  color: #ffffff !important;
  opacity: 1 !important;
}

.sw-wd-tool-btn:hover .sw-wd-key svg {
  stroke: #ffffff !important;
}

/* WriterDuet Active State (Signature Cyan Blue) */
.sw-wd-tool-btn.active,
.sw-wd-tool-btn[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2) !important;
}

.sw-wd-tool-btn.active .sw-wd-key,
.sw-wd-tool-btn[aria-pressed="true"] .sw-wd-key {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.sw-wd-tool-btn.active .sw-wd-label,
.sw-wd-tool-btn[aria-pressed="true"] .sw-wd-label {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

.sw-wd-tool-btn.active .sw-wd-key svg,
.sw-wd-tool-btn[aria-pressed="true"] .sw-wd-key svg {
  stroke: #38bdf8 !important;
}

/* WriterDuet Active Line / Focus Cursor Bar on Screenplay Sheet */
.sw-writing-canvas .sw-block:focus,
.sw-writing-canvas .sw-block:focus-within,
.sw-writing-canvas .sw-block.sw-block-active {
  background: rgba(56, 189, 248, 0.08) !important;
  border-radius: 4px !important;
}

/* ==========================================================================
   ENHANCED FORMAT ELEMENTS PER-ICON STRIP (Screenplay Toolbar)
   ========================================================================== */
.sw-format-icon-strip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 4px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sw-icon-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: #c4cdd8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}

.sw-icon-tool-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

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

.sw-icon-tool-btn.active,
.sw-icon-tool-btn[aria-pressed="true"] {
  background: rgba(255, 122, 47, 0.18);
  color: #ffaa6e;
  border-color: rgba(255, 122, 47, 0.4);
  box-shadow: 0 0 10px rgba(255, 122, 47, 0.15);
  font-weight: 700;
}

.sw-icon-tool-btn.active svg,
.sw-icon-tool-btn[aria-pressed="true"] svg {
  stroke: #ffaa6e;
}

.sw-icon-tool-btn[data-secondary="true"] {
  color: #94a3b8;
  padding: 3px 7px;
  font-size: 11px;
}

.sw-icon-tool-btn[data-secondary="true"] span {
  display: inline-block !important;
  font-size: 11px;
  font-weight: 500;
}

.sw-icon-tool-btn[data-secondary="true"]:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.sw-format-sub-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
  flex-shrink: 0;
}

.sw-more-elements-menu {
  position: relative;
}

.sw-more-elements-menu summary.sw-icon-tool-btn {
  list-style: none;
}

.sw-more-elements-menu summary.sw-icon-tool-btn::-webkit-details-marker {
  display: none;
}

.sw-more-elements-menu .sw-simple-menu-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
  min-width: 280px;
}

/* ==========================================================================
   STAGE 1: PREMIS & IDE CERITA (Clean & Simple)
   ========================================================================== */
.sw-stage-card-simple {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(17, 22, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.sw-simple-field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-simple-field-block .sw-field-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #e6ebf2;
  letter-spacing: 0.2px;
}

.sw-textarea-premise,
.sw-textarea-synopsis {
  width: 100%;
  background: rgba(0, 0, 0, 0.32) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px;
  color: #f4f6fa !important;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  padding: 14px 16px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.sw-textarea-premise {
  min-height: 110px;
}

.sw-textarea-synopsis {
  min-height: 190px;
}

.sw-textarea-premise:focus,
.sw-textarea-synopsis:focus {
  outline: none;
  border-color: rgba(255, 122, 47, 0.6) !important;
  background: rgba(0, 0, 0, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.15);
}

/* ==========================================================================
   STAGE 2: TREATMENT (Clean & Simple Scene Cards)
   ========================================================================== */
.sw-scene-card-simple {
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}

.sw-scene-card-simple:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.sw-scene-card-simple .sw-scene-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-scene-num-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffaa6e;
  background: rgba(255, 122, 47, 0.12);
  border: 1px solid rgba(255, 122, 47, 0.28);
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.sw-scene-card-simple .sw-scene-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-scene-slugline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-slug-select {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 6px;
  color: #f4f6fa !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  color-scheme: dark;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.sw-slug-select:focus {
  border-color: rgba(255, 122, 47, 0.5) !important;
}

.sw-slug-location-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sw-slug-location-input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
  font-weight: 500;
  text-transform: none;
}

.sw-slug-sep {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  user-select: none;
}

.sw-scene-summary-input {
  width: 100%;
  min-height: 80px;
  background: rgba(0, 0, 0, 0.28) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px;
  color: #f4f6fa !important;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, background-color 0.15s;
}

.sw-scene-summary-input:focus {
  border-color: rgba(255, 122, 47, 0.5) !important;
  outline: none;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.12);
}

.sw-scene-sub-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sw-scene-sub-field {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 7px;
  padding: 8px 12px;
  color: rgba(244, 246, 250, 0.9) !important;
  font-family: inherit;
  font-size: 12.5px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.sw-scene-sub-field:focus {
  border-color: rgba(255, 122, 47, 0.4) !important;
  outline: none;
  background: rgba(255, 255, 255, 0.05) !important;
}

@media (max-width: 640px) {
  .sw-scene-sub-inputs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STAGE 2: ULTRA-MINIMALIST TREATMENT (Sleek, Streamlined & Modern)
   ========================================================================== */
.sw-treatment-toolbar-minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 4px 0;
  gap: 12px;
}

.sw-treatment-heading-minimal {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-treatment-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f4f6fa;
  letter-spacing: -0.2px;
}

.sw-treatment-count-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
}

.sw-treatment-actions-minimal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-btn-tool-minimal {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c4cdd8;
  padding: 6px 12px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-btn-tool-minimal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.sw-btn-add-minimal {
  background: #ff7a2f;
  border: 1px solid #ffaa6e;
  color: #07090c;
  padding: 6px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sw-btn-add-minimal:hover {
  background: #ff8c47;
  box-shadow: 0 0 14px rgba(255, 122, 47, 0.35);
}

/* Ultra-Clean Scene Card */
.sw-scene-card-ultra-clean {
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sw-scene-card-ultra-clean:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.sw-scene-card-ultra-clean.collapsed {
  border-color: rgba(255, 255, 255, 0.06);
}

.sw-scene-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.sw-scene-card-ultra-clean.collapsed .sw-scene-top-bar {
  border-bottom: none;
}

.sw-scene-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: default;
}

.sw-scene-top-left .sw-drag-handle {
  color: #475569;
  cursor: grab;
  font-size: 12px;
  padding: 0 2px;
}

.sw-scene-top-left .sw-drag-handle:hover {
  color: #94a3b8;
}

.sw-scene-top-left .sw-scene-num-badge {
  font-size: 11px;
  font-weight: 700;
  color: #ffaa6e;
  background: rgba(255, 122, 47, 0.12);
  border: 1px solid rgba(255, 122, 47, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sw-slug-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.sw-slug-select-minimal {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 5px;
  color: #ffaa6e !important;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 6px;
  color-scheme: dark;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.sw-slug-select-minimal:focus {
  border-color: #ff7a2f !important;
}

.sw-slug-location-minimal {
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 580px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 3px 6px;
}

.sw-slug-location-minimal::placeholder {
  color: rgba(255, 255, 255, 0.25) !important;
  font-weight: 500;
  text-transform: none;
}

.sw-slug-divider {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
  user-select: none;
  flex-shrink: 0;
}

.sw-scene-top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: default;
}

.sw-btn-icon-subtle {
  background: transparent;
  border: none;
  color: #64748b;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.sw-btn-icon-subtle svg {
  stroke: currentColor;
}

.sw-btn-icon-subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.sw-btn-icon-subtle.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.sw-btn-icon-subtle:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Seamless Minimalist Textarea */
.sw-scene-textarea-minimal {
  width: 100%;
  min-height: 72px;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  color: #e2e8f0 !important;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px 14px 6px 14px;
  resize: vertical;
  box-sizing: border-box;
  outline: none !important;
}

.sw-scene-textarea-minimal::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.sw-scene-textarea-minimal:focus {
  background: rgba(0, 0, 0, 0.15) !important;
}

/* Sleek Single-Line Meta Strip (Tokoh & Catatan) */
.sw-scene-meta-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 10px 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.sw-meta-strip-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sw-meta-strip-icon {
  stroke: #64748b;
  flex-shrink: 0;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
}

.sw-meta-strip-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: rgba(226, 232, 240, 0.75) !important;
  font-family: inherit;
  font-size: 12px;
  padding: 2px 0;
  min-width: 0;
  transition: color 0.15s;
}

.sw-meta-strip-input:focus {
  color: #ffffff !important;
}

.sw-meta-strip-input::placeholder {
  color: rgba(255, 255, 255, 0.25) !important;
}

.sw-meta-strip-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
  user-select: none;
}

@media (max-width: 640px) {
  .sw-scene-meta-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .sw-meta-strip-divider {
    display: none;
  }
}

/* ==========================================================================
   METODE PENGUJIAN SCRIPT: KAUSALITAS DRAMATIS
   (JIKA... MAKA... KARNA... TAPI... MAKA...)
   Prinsip 'Therefore / But' vs 'And Then' (South Park / Pixar Story Logic)
   ========================================================================== */
.sw-story-test-section {
  background: #0b0f17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-story-test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-story-test-header-info {
  flex: 1;
  min-width: 240px;
}

.sw-story-test-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.sw-story-test-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin: 3px 0 2px;
}

.sw-story-test-desc {
  font-size: 11.5px;
  color: var(--muted, #94a3b8);
  margin: 0;
  line-height: 1.45;
}

.sw-story-test-actions {
  display: flex;
  gap: 6px;
}

.sw-btn-test-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sw-btn-test-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sw-causality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.sw-causality-item {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}

.border-jika {
  border-top: 2.5px solid #f59e0b !important;
}

.border-maka1 {
  border-top: 2.5px solid #0284c7 !important;
}

.border-karna {
  border-top: 2.5px solid #a855f7 !important;
}

.border-tapi {
  border-top: 2.5px solid #f43f5e !important;
}

.border-maka2 {
  border-top: 2.5px solid #10b981 !important;
}

.sw-causality-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.causality-num {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tag-jika .causality-num,
.tag-jika .tag-title {
  color: #fbbf24;
}

.tag-maka1 .causality-num,
.tag-maka1 .tag-title {
  color: #38bdf8;
}

.tag-karna .causality-num,
.tag-karna .tag-title {
  color: #c084fc;
}

.tag-tapi .causality-num,
.tag-tapi .tag-title {
  color: #fb7185;
}

.tag-maka2 .causality-num,
.tag-maka2 .tag-title {
  color: #34d399;
}

.causality-role,
.tag-sub {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.sw-causality-input,
.sw-causality-field {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.15s ease;
}

.sw-causality-input:focus,
.sw-causality-field:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
}

.sw-causality-live-box,
.sw-causality-output-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-causality-live-head,
.sw-causality-output-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sw-test-badge-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.3px;
}

.sw-test-badge-status.complete {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sw-test-badge-status.progress {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

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

.sw-test-badge-status.empty {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sw-btn-apply-causality {
  background: #ea580c;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.sw-btn-apply-causality:hover {
  background: #f97316;
}

.sw-causality-sentence-preview,
.sw-causality-live-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: #e2e8f0;
}

.sw-preview-placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  font-size: 12px;
}

.kw-pill {
  display: inline-block;
  font-weight: 800;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-right: 2px;
}

.kw-jika {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.kw-maka1 {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.kw-karna {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.kw-tapi {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.kw-maka2 {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Modal Specific Causality Styling */
.sw-causality-formula-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: 8px;
  margin: 10px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.step-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.step-arr {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
}

.c-jika {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.c-maka1 {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.c-karna {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.c-tapi {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.c-maka2 {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* SIMPLIFIED 2-COLUMN SPLIT CAUSALITY MODAL */
.sw-causality-split-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .sw-causality-split-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.sw-causality-steps-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-causality-step-row {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sw-causality-step-row:focus-within {
  background: rgba(15, 23, 42, 0.95);
}

.sw-causality-step-row.border-jika { border-left: 3.5px solid #f59e0b; }
.sw-causality-step-row.border-jika:focus-within { border-color: rgba(245, 158, 11, 0.6); }

.sw-causality-step-row.border-maka1 { border-left: 3.5px solid #38bdf8; }
.sw-causality-step-row.border-maka1:focus-within { border-color: rgba(56, 189, 248, 0.6); }

.sw-causality-step-row.border-karna { border-left: 3.5px solid #c084fc; }
.sw-causality-step-row.border-karna:focus-within { border-color: rgba(192, 132, 252, 0.6); }

.sw-causality-step-row.border-tapi { border-left: 3.5px solid #fb7185; }
.sw-causality-step-row.border-tapi:focus-within { border-color: rgba(251, 113, 133, 0.6); }

.sw-causality-step-row.border-maka2 { border-left: 3.5px solid #34d399; }
.sw-causality-step-row.border-maka2:focus-within { border-color: rgba(52, 211, 153, 0.6); }

.sw-causality-step-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.sw-causality-step-badge .step-num {
  font-weight: 800;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.tag-jika .step-num { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-maka1 .step-num { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.tag-karna .step-num { background: rgba(192, 132, 252, 0.2); color: #c084fc; }
.tag-tapi .step-num { background: rgba(251, 113, 133, 0.2); color: #fb7185; }
.tag-maka2 .step-num { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.sw-causality-step-badge .step-sub {
  color: #94a3b8;
  font-size: 11px;
}

.sw-causality-field {
  background: transparent !important;
  border: none !important;
  color: #f1f5f9 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  padding: 2px 0 !important;
  resize: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

.sw-causality-field::placeholder {
  color: #475569 !important;
  font-style: normal !important;
}

.sw-causality-field:focus {
  outline: none !important;
  background: transparent !important;
}

/* Right Column: Live Story Narrative Card */
.sw-causality-preview-col {
  display: flex;
  flex-direction: column;
}

.sw-causality-preview-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.sw-causality-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-causality-live-body {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.65;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  max-height: 280px;
}

.sw-causality-action-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Comment & Review Note System Hidden */
#swAddCommentModal,
.sw-comments-drawer,
.sw-comments-drawer-backdrop,
.sw-mobile-review-fab,
.sw-btn-scene-comment,
.sw-scene-comment-btn,
.sw-scene-comment-count-badge,
.sw-btn-review-comment-primary,
.sw-btn-review-drawer-toggle {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}



