/* ==========================================================================
   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™ Official Design Tokens & Palette
   Official Colors:
   - Deep Black:   #000000
   - Charcoal:     #343434
   - Warm Ivory:   #FCFAF1
   - Amber Orange: #FFB000 (Accent, Primary Buttons, Active, Highlights)
   - Pure White:   #FFFFFF (Writing Paper, Clean Cards)
   ========================================================================== */
:root {
  --bg-ivory: #FCFAF1;
  --bg-ivory-light: #FFFFFF;
  --bg-ivory-card: #FFFFFF;
  --text-black: #000000;
  --text-charcoal: #343434;
  --text-muted: #666666;
  --text-subtle: #8E8E93;
  --border-light: #E5E1D5;
  --border-subtle: #ECE8DD;

  /* Amber Orange Accent (NOTEFROMUS Official Accent) */
  --amber: #FFB000;
  --amber-light: #FFF8E6;
  --amber-hover: #EAA000;
  --amber-active: #D69000;
  --amber-dark: #B87D00;
  --amber-border: #FFD270;

  /* Backward Compatibility & Aliases */
  --sage: #8A9A86;
  --sage-light: #F0F4EF;
  --sage-dark: #343434;
  --terracotta: #FFB000;
  --terracotta-light: #FFF8E6;
  --terracotta-dark: #FFB000;
  --butter: #FFB000;
  --butter-light: #FFF8E6;
  --butter-dark: #B87D00;
  --muted-blue: #5B7280;
  --muted-blue-light: #F0F4F6;
  --muted-blue-dark: #343434;

  --ink: #343434;
  --muted: #666666;
  --line: #E5E1D5;
  --brand: #FFB000;
  --radius: 12px;
}

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

/* Global Primary Button (Amber with Black Bold Text) */
.primary-btn, .sw-btn-primary {
  background: var(--amber) !important;
  color: #000000 !important;
  border: 1px solid #EAA000 !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  padding: 8px 18px !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 8px rgba(255, 176, 0, 0.28) !important;
  transition: all 0.18s ease !important;
  cursor: pointer !important;
  text-decoration: none !important;
  min-height: 40px !important;
}

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

.primary-btn:active, .sw-btn-primary:active {
  background: var(--amber-active) !important;
  transform: translateY(0) !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: #FAF6EE;
  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, 250, 243, 0.7);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.sw-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e5d8cb;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 260px;
  flex: 1;
}

.sw-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}

.sw-search-box input::placeholder {
  color: #a49483;
}

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

.sw-card {
  background: #FFFFFF;
  border: 1px solid #DDD8CE;
  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(35, 39, 43, 0.04);
  position: relative;
  overflow: hidden;
}

.sw-card:hover {
  transform: translateY(-3px);
  border-color: #C85028;
  box-shadow: 0 12px 28px rgba(35, 39, 43, 0.08);
}

.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: var(--ink);
  margin: 0 0 4px;
  line-height: 1.25;
}

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

.sw-card-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FAF6EE;
  border: 1px solid #DDD8CE;
  color: #C85028;
  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: #FDEEE9;
  color: #C85028;
  border: 1px solid rgba(242, 140, 107, 0.4);
}

.sw-badge-step {
  background: #EBF1EA;
  color: #37533E;
  border: 1px solid rgba(168, 185, 165, 0.45);
}

.sw-badge-brand {
  background: #FBF4E4;
  color: #B58421;
  border: 1px solid rgba(233, 180, 76, 0.4);
}

.sw-card-snippet {
  font-size: 12.5px;
  color: #5F676E;
  line-height: 1.5;
  background: #FAF6EE;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #DDD8CE;
  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 #EBE7DF;
  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: #4f4234;
  transition: all 0.15s ease;
}

.sw-btn-icon:hover {
  background: #ffffff;
  color: var(--ink);
  border-color: #ff9145;
}

.sw-btn-icon.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.sw-btn-open {
  background: var(--ink);
  color: #fffaf3;
  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, 250, 243, 0.85);
  border: 2px dashed rgba(80, 44, 13, 0.18);
  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: #ffe3ca;
  color: #c95c10;
  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: var(--ink);
}

.sw-empty-state p {
  color: var(--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 {
  background: #FFFFFF;
  border: 1px solid #DDD8CE;
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 18px rgba(35, 39, 43, 0.04);
}

.sw-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sw-btn-back {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-charcoal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.sw-btn-back:hover {
  background: #FCFAF1;
  color: #000000;
  border-color: #343434;
}

.sw-script-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.sw-meta-title {
  font: 700 17px 'Space Grotesk', sans-serif;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.sw-btn-edit-title {
  font-size: 12px;
  color: #8c7a68;
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 4px;
}

.sw-btn-edit-title:hover {
  color: var(--ink);
  background: #f0e4d7;
}

.sw-meta-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.sw-draft-selector {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--amber-light);
  color: #000000;
  border: 1px solid var(--amber-border);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
}

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

.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: #37533E;
  background: #EBF1EA;
}

.sw-save-status.saving {
  color: #b45309;
  background: #fef3c7;
}

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

.sw-save-status.error {
  color: #c62828;
  background: #ffebee;
}

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

/* Stepper Bar */
.sw-stepper-bar {
  background: #FCFAF6;
  border: 1px solid #DDD8CE;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sw-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #5F676E;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sw-step-item:hover {
  background: #FFFFFF;
  color: var(--text-black);
}

.sw-step-item.active {
  background: var(--amber);
  color: #000000;
  font-weight: 700;
  border-color: #EAA000;
  box-shadow: 0 3px 10px rgba(255, 176, 0, 0.28);
}

.sw-step-item.active .sw-step-num {
  background: #000000;
  color: var(--amber);
}

.sw-step-item.completed:not(.active) .sw-step-num {
  background: #343434;
  color: #ffffff;
}

.sw-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6dacd;
  color: #554433;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.sw-step-arrow {
  color: #c4b5a6;
  font-size: 12px;
}

/* ==========================================================================
   1. STAGE: PREMIS & SINOPSIS
   ========================================================================== */
.sw-stage-card {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: 0 4px 20px rgba(98, 55, 18, 0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.sw-section-head p {
  color: var(--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: #3b2f23;
}

.sw-helper-text {
  font-size: 11px;
  font-weight: 400;
  color: #8c7967;
  font-style: italic;
}

.sw-textarea-premise {
  width: 100%;
  min-height: 90px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 9px;
  border: 1px solid #dfcfbd;
  background: #ffffff;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
}

.sw-textarea-premise:focus {
  border-color: #ff9145;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 145, 69, 0.18);
}

.sw-textarea-synopsis {
  width: 100%;
  min-height: 240px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 9px;
  border: 1px solid #dfcfbd;
  background: #ffffff;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
}

.sw-textarea-synopsis:focus {
  border-color: #ff9145;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 145, 69, 0.18);
}

.sw-word-counter {
  align-self: flex-end;
  font-size: 11px;
  color: #8a7867;
}

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

/* ==========================================================================
   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(255, 250, 243, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
}

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

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

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

.sw-scene-card {
  background: #fffdf9;
  border: 1px solid rgba(80, 44, 13, 0.15);
  border-radius: 11px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(98, 55, 18, 0.03);
}

.sw-scene-card:hover {
  border-color: rgba(255, 145, 69, 0.45);
}

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

.sw-scene-header {
  background: #fbf4ea;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(80, 44, 13, 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: #a49484;
  font-size: 16px;
  padding: 2px 4px;
}

.sw-scene-heading-title {
  font: 700 13px 'Space Grotesk', sans-serif;
  letter-spacing: 0.5px;
  color: var(--ink);
  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: #ffffff;
}

.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 #dfcfbd;
  border-radius: 6px;
  background: #fffdfa;
}

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

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

.sw-scene-char-row input {
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #dfcfbd;
  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 #dfcfbd;
  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: 16px;
  align-items: flex-start;
  position: relative;
  min-height: calc(100vh - 180px);
}

/* Left: Scene Outline Navigator */
.sw-outline-panel {
  width: 240px;
  flex-shrink: 0;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 190px);
  position: sticky;
  top: 15px;
  overflow-y: auto;
  box-shadow: 0 4px 14px rgba(98, 55, 18, 0.04);
}

.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: #f7ede2;
  color: var(--ink);
}

.sw-outline-item.active {
  background: #ffdbb8;
  color: #8c3e06;
  font-weight: 700;
}

.sw-badge-treatment-updated {
  font-size: 9px;
  font-weight: 700;
  background: #fef08a;
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Center: Screenplay Writing Area */
.sw-editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* Editor Toolbar */
.sw-script-toolbar {
  width: 100%;
  max-width: 820px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(98, 55, 18, 0.04);
  position: sticky;
  top: 15px;
  z-index: 15;
}

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

.sw-type-dropdown {
  background: #171512;
  color: #fffaf3;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

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

.sw-type-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid #dfcfbd;
  background: #ffffff;
  color: #554433;
  font-weight: 600;
}

.sw-type-btn.active {
  background: #ff9145;
  color: #171512;
  border-color: #f77d2a;
}

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

/* Screenplay Paper Sheet (Pure White, 8.5 x 11 / A4 aspect, WriterDuet format) */
.sw-page-sheet {
  width: 100%;
  max-width: 820px;
  min-height: 1056px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 10px 40px rgba(70, 40, 15, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  padding: 56px 54px 64px 72px; /* Standard screenplay margins */
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 15px;
  line-height: 1.25;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Page Break Divider & Number */
.sw-page-break {
  margin: 40px -54px 40px -72px;
  padding: 10px 24px;
  background: #fbf5ee;
  border-top: 1px dashed #d6c5b4;
  border-bottom: 1px dashed #d6c5b4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #8c7b6b;
  user-select: none;
}

.sw-page-number {
  position: absolute;
  top: 28px;
  right: 48px;
  font-size: 14px;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: #222222;
  user-select: none;
}

/* Screenplay Blocks */
.sw-block {
  outline: none;
  border-radius: 2px;
  position: relative;
  min-height: 1.25em;
  word-break: break-word;
  white-space: pre-wrap;
  transition: background 0.1s;
}

.sw-block:focus {
  background: rgba(255, 145, 69, 0.08);
}

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

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

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

.sw-block[data-type="action"] {
  text-transform: none;
  font-weight: 400;
  margin-top: 8px;
  margin-bottom: 10px;
  margin-left: 0;
  width: 100%;
  color: #111111;
}

.sw-block[data-type="character"] {
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 0;
  margin-left: 38%;
  width: 62%;
  color: #000000;
}

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

.sw-block[data-type="dialogue"] {
  text-transform: none;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 12px;
  margin-left: 18%;
  width: 64%;
  color: #050505;
}

.sw-block[data-type="transition"] {
  text-transform: uppercase;
  font-weight: 700;
  text-align: right;
  margin-top: 18px;
  margin-bottom: 18px;
  margin-right: 18px;
  width: calc(100% - 18px);
  color: #000000;
}

/* Autocomplete Popup */
.sw-autocomplete-pop {
  position: absolute;
  background: #ffffff;
  border: 1px solid #d4c3b2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(40, 20, 10, 0.15);
  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: var(--ink);
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  border: none;
  background: transparent;
}

.sw-autocomplete-item:hover,
.sw-autocomplete-item.selected {
  background: #ffe6cf;
  color: #ad4b05;
  font-weight: 700;
}

/* Right: Treatment Reference Drawer */
.sw-ref-drawer {
  width: 280px;
  flex-shrink: 0;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 190px);
  position: sticky;
  top: 15px;
  overflow-y: auto;
  box-shadow: 0 4px 14px rgba(98, 55, 18, 0.04);
}

.sw-ref-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-ref-premise-box {
  background: #faf2e6;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #514233;
}

.sw-ref-premise-box strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #8c7661;
  margin-bottom: 3px;
}

.sw-ref-card {
  background: #ffffff;
  border: 1px solid #ebdccc;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-ref-card-head {
  font-size: 11px;
  font-weight: 700;
  color: #8c3e06;
}

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

.sw-btn-insert-ref {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  background: #f7ede2;
  border: 1px solid #d4c2af;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}

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

/* ==========================================================================
   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%, 500px);
  background: #FFFFFF !important;
  border-radius: 18px !important;
  padding: 26px 28px !important;
  box-shadow: 0 25px 80px rgba(35, 39, 43, 0.35) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  border: 1px solid #DDD8CE !important;
  margin: auto !important;
  position: relative !important;
}

.sw-modal-card {
  background: #FFFFFF !important;
  border-radius: 18px !important;
  padding: 26px 28px !important;
  box-shadow: 0 25px 80px rgba(35, 39, 43, 0.35) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  border: 1px solid #DDD8CE !important;
  margin: auto !important;
  position: relative !important;
}

.sw-modal-box h2 {
  font: 700 22px 'Space Grotesk', sans-serif;
  margin: 0 0 6px;
  color: var(--ink);
}

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

.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: #403225;
}

.sw-modal-form input,
.sw-modal-form select,
.sw-modal-form textarea {
  padding: 11px 14px;
  border: 1px solid #DDD8CE;
  border-radius: 10px;
  background: #FCFAF6;
  font-size: 13.5px;
  color: var(--ink);
  transition: all 0.15s ease;
  width: 100%;
}

.sw-modal-form input:focus,
.sw-modal-form select:focus,
.sw-modal-form textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(242, 140, 107, 0.25);
}

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

/* Export Dropdown Menu */
.sw-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(60, 30, 10, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  z-index: 50;
}

.sw-dropdown-item {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink);
  border: none;
  background: transparent;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}

.sw-dropdown-item:hover {
  background: #ffe7d1;
  color: #a44805;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .sw-screenplay-container {
    flex-direction: column;
  }
  .sw-outline-panel, .sw-ref-drawer {
    width: 100%;
    position: static;
    max-height: 250px;
  }
}

/* ==========================================================================
   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: #fffdf9;
  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: #fffaf3;
  border-left: 1px solid rgba(80, 44, 13, 0.15);
  box-shadow: -15px 0 45px rgba(50, 25, 10, 0.18);
  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: #fff5ea;
  border-bottom: 1px solid var(--line);
  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: var(--ink);
}

.sw-brief-panel-head p {
  color: var(--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: #ffffff;
  border: 1px solid rgba(80, 44, 13, 0.1);
  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: var(--ink);
}

.sw-kpi-card .kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #7b6a5a;
  letter-spacing: 0.3px;
}

.sw-kpi-card.kpi-success .kpi-num { color: #059669; }
.sw-kpi-card.kpi-pending .kpi-num { color: #d97706; }
.sw-kpi-card.kpi-danger .kpi-num { color: #dc2626; }

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

.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 #dfcfbd;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.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: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  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: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Rule Card */
.sw-rule-card {
  background: #ffffff;
  border: 1px solid rgba(80, 44, 13, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(98, 55, 18, 0.03);
}

.sw-rule-card:hover {
  border-color: rgba(255, 145, 69, 0.4);
  box-shadow: 0 4px 12px rgba(98, 55, 18, 0.06);
}

.sw-rule-card.violation {
  border-color: #fca5a5;
  background: #fff8f8;
}

.sw-rule-card.fulfilled {
  border-color: #a7f3d0;
}

.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: #fffaf3;
}

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

.sw-tag-scope {
  font-size: 9.5px;
  background: #fbf0e4;
  color: #8c420e;
  border: 1px solid #ebd4be;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
}

.sw-tag-stage {
  font-size: 9px;
  background: #f3f4f6;
  color: #4b5563;
  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 #d4c2af;
  background: #fffdfa;
  cursor: pointer;
}

.sw-status-select.pending {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.sw-status-select.fulfilled,
.sw-status-select.no_violation {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.sw-status-select.needs_revision,
.sw-status-select.needs_recheck {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

.sw-status-select.violation_found {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.sw-status-select.not_relevant {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

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

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

.sw-btn-goto-scene {
  background: none;
  border: 1px solid #dfcfbd;
  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 #dfcfbd;
  background: #fffdf9;
  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;
}

.sw-dropzone:hover,
.sw-dropzone.dragover {
  border-color: #ff9145;
  background: #fff5eb;
}

.sw-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffe6cf;
  color: #c95c10;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sw-fmt-tag {
  font-size: 9px;
  font-weight: 700;
  background: #eee3d5;
  color: #554433;
  padding: 2px 6px;
  border-radius: 4px;
}

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

.sw-file-pill a {
  color: #b45309;
  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 #dfcfbd;
  border-radius: 8px;
  background: #ffffff;
}

.sw-rule-proposal-card {
  background: #ffffff;
  border: 1px solid #e0d0bf;
  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: #f3f4f6;
  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 #ffedd5;
  padding-bottom: 10px;
}

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

.sw-guide-header-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #ffedd5;
  color: #c2410c;
  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: #ffffff;
  border: 1px solid #fde68a;
  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: #78350f;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.sw-formula-pill {
  background: #fff7ed;
  border: 1px dashed #f97316;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: #9a3412;
  line-height: 1.45;
  font-weight: 600;
}

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

.sw-guide-tip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #554433;
  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: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.sw-element-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.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: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-action { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.badge-character { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-parenthetical { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-dialogue { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-transition { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }

.sw-element-sample {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 11px;
  color: #0f172a;
  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 #e5e7eb;
  text-align: left;
}

.sw-element-flow-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}

.sw-kbd-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #1e293b;
}

/* ==========================================================================
   IMPORT SCRIPT MODAL & PARSER PREVIEW
   ========================================================================== */
.sw-import-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

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

.sw-import-preview-sheet {
  background: #ffffff;
  border: 1px solid #dfcfbd;
  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: #111827;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.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;
}

