/* Garant font for headings */
@font-face {
  font-display: swap;
  font-family: Garant;
  font-style: normal;
  font-weight: 600;
  src: url('https://cdn.templafy.com/fonts/Garant-SemiBold-v3.woff2')
    format('woff2');
}

@font-face {
  font-display: swap;
  font-family: Garant;
  font-style: normal;
  font-weight: 400;
  src: url('https://cdn.templafy.com/fonts/Garant-Regular-v2.woff2')
    format('woff2');
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  background-color: #FAFAFA;
}

/* Global Focus Ring Styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #6F81F1;
  outline-offset: 1px;
}

/* App Layout with Admin Sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-width: 1440px;
}

/* Admin Center Sidebar */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background-color: #232323;
  display: flex;
  flex-direction: column;
  color: #BABABA;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px 4px;
  cursor: pointer;
}

.admin-org-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.admin-header-chevron {
  color: #BABABA;
}

.admin-sidebar-domain {
  font-size: 12px;
  color: #808080;
  padding: 0 20px 16px;
}

.admin-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #BABABA;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.admin-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.admin-nav-item.active {
  background-color: #464646;
  color: #fff;
}

.admin-nav-item.active svg {
  color: #fff;
}

.admin-nav-item svg {
  flex-shrink: 0;
  color: #BABABA;
}

.admin-nav-item:hover svg {
  color: #fff;
}

.admin-nav-divider {
  height: 1px;
  background-color: #3a3a3a;
  margin: 8px 0;
}

.admin-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #3a3a3a;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.admin-logo svg {
  color: #fff;
}

.admin-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #BABABA;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

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

/* App Container */
.app-container {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

/* Header - Full width spanning left and right panels */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.header-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-back-btn:hover {
  background-color: rgba(50, 50, 50, 0.08);
  color: #111827;
}

.header-back-btn:active {
  background-color: rgba(50, 50, 50, 0.13);
}

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

.header-title {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-draft {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* Buttons */
.btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0px 12px;
  gap: 8px;
  height: 32px;
  background: rgba(50, 50, 50, 0.13);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #323232;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: rgba(50, 50, 50, 0.18);
}

.btn-primary {
  background: #4A61ED;
  color: #FFFFFF;
  font-weight: 300;
}

.btn-primary:hover {
  background: #244AB8;
}

.btn-primary:active {
  background: #153075;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  color: #9ca3af;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* Unified delete button style */
.btn-delete,
.btn-remove-config,
.slide-action-btn.delete,
.section-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #464646;
}

.btn-delete:hover,
.btn-remove-config:hover,
.slide-action-btn.delete:hover,
.section-delete:hover {
  background: rgba(50, 50, 50, 0.20);
}

.btn-delete svg,
.btn-remove-config svg,
.slide-action-btn.delete svg,
.section-delete svg {
  width: 12px;
  height: 12px;
}

.btn-close {
  color: #6b7280;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover {
  color: #374151;
}

/* Main Content - Contains left and right panels below header */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Panel - Navigation cards */
.left-panel {
  width: 380px;
  flex: 0 0 380px;
  padding: 24px;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

/* Config section container */
.config-section:first-child {
  /* No border */
}

/* Cards */
.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 4px;
  align-self: stretch;
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: #c0c0c0;
}

.card-active {
  border: 2px solid #6366f1;
  background: #fff;
}

.card-active:hover {
  border-color: #4f46e5;
}

/* Card configured state - show tags only, no visual indicators */
.card.configured {
  /* Configuration indicated by tags only */
}

/* Card with status indicator */
.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #d1d5db;
  flex-shrink: 0;
}

.card-status-dot.configured {
  background-color: #10b981;
}

.card-status-dot.partial {
  background-color: #f59e0b;
}

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

.card-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.card-title {
  font-family: Garant, serif;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.card-description {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.panel-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 32px;
  margin: 24px auto 0;
  max-width: 360px;
  opacity: 0.85;
}

.panel-empty-state .double-star-icon {
  margin-bottom: 12px;
  opacity: 0.8;
}

.panel-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 4px 0;
}

.panel-empty-hint {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.5;
  margin: 0;
}

.card-hint {
  font-size: 11px;
  color: #9ca3af;
  margin: 4px 0 0 0;
}

.input-title {
  width: 100%;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  background: transparent;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-title::placeholder {
  color: #9ca3af;
}

/* Tags */
.tags {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 0;
  gap: 8px;
}

.tags-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.tag {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  height: 20px;
  max-width: 100%;
  padding: 2px 8px;
  background-color: #EBEBEB;
  border-radius: 10px;
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag svg,
.tag .tag-icon {
  width: 12px;
  height: 12px;
  color: currentColor;
  flex-shrink: 0;
}

.tag-section {
  background-color: #f3f4f6;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-section:hover {
  background-color: #e5e7eb;
}

.tag-ai svg {
  color: #6366f1;
}

/* Outline section items */
.outline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.outline-item-icon {
  flex-shrink: 0;
}

.outline-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.outline-item-count {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Right Panel - Content area that scrolls under header */
.right-panel {
  flex: 1 1 auto;
  min-width: 0;
  padding: 24px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
}

.structure-header {
  margin-bottom: 20px;
}

.structure-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.structure-description {
  font-size: 14px;
  color: #6b7280;
}

.btn-add-section {
  margin: 0;
  margin-bottom: 16px;
  white-space: nowrap;
  width: fit-content;
}

/* Sections */
.sections-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
}

.section {
  border-radius: 12px;
  background: #FFF;
  border: none;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(41, 48, 56, 0.06), 0 2px 4px 0 rgba(41, 48, 56, 0.03), 0 6px 12px 0 rgba(41, 48, 56, 0.03);
  transition: box-shadow 0.2s ease;
}

.section.active {
  box-shadow: 0 0 0 2px #6366f1, 0 2px 4px 0 rgba(41, 48, 56, 0.03), 0 6px 12px 0 rgba(41, 48, 56, 0.03);
}

.section-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
}

.section-drag-handle {
  cursor: grab;
  color: #d1d5db;
  display: flex;
  align-items: center;
}

.section-drag-handle:active {
  cursor: grabbing;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #6b7280;
  transition: background-color 0.15s ease;
}

.section-toggle svg {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-toggle:hover {
  background-color: #f3f4f6;
}

.section:not(.expanded) .section-toggle svg {
  transform: rotate(-90deg);
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  outline: none;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.4;
}

.section-title:hover {
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

.section-title:focus {
  background-color: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.section-title-wrapper .btn-edit {
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.section-title-wrapper:hover .btn-edit,
.section-title:focus + .btn-edit {
  opacity: 1;
}

.section-slide-count {
  font-size: 14px;
  font-weight: 400;
  color: #9ca3af;
  flex-shrink: 0;
}

.section-delete {
  flex-shrink: 0;
}

/* Section Content - Using CSS Grid for smooth animation */
.section-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease-in-out;
}

.section-content > .section-content-inner {
  overflow: hidden;
  padding: 0 16px 0 48px;
}

.section.expanded .section-content {
  grid-template-rows: 1fr;
}

.section.expanded .section-content > .section-content-inner {
  padding-bottom: 16px;
}

/* Section Topic */
.section-topic-group {
  margin-bottom: 20px;
}

.section-topic-input {
  resize: none;
}

/* AI Slides Row */
.ai-slides-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-slides-hint {
  font-size: 13px;
  color: #9ca3af;
}

.ai-slides-hint.has-ai {
  color: #6b7280;
}

.ai-slides-hint .ai-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  color: #6366f1;
}

/* AI Instructions Field */
.ai-instructions-field {
  margin-top: 12px;
  padding: 12px 16px;
  background-color: #f9fafb;
  border-radius: 8px;
}

.ai-instructions-field .form-label {
  margin-bottom: 6px;
}

.form-label-sm {
  font-size: 12px;
}

.optional-label {
  font-weight: 400;
  color: #9ca3af;
}

/* Pre-made Slides Group */
.section-premade-group {
  margin-top: 20px;
}

.section-premade-group .form-help-message {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
}

/* Section Empty Note - Callout/Banner style */
.section-empty-note {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 8px 16px;
  gap: 8px;
  background: #F1F1F1;
  border-radius: 12px;
  font-size: 13px;
  color: #464646;
  margin-bottom: 16px;
}

.section-empty-note.hidden {
  display: none;
}

/* Build Mode Selector - Segmented Control */
.build-mode-selector {
  display: inline-flex;
  padding: 4px;
  background-color: #F1F1F1;
  border-radius: 8px;
  margin-bottom: 16px;
}

.build-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #464646;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.build-mode-btn:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.5);
}

.build-mode-btn.active {
  background-color: #fff;
  color: #464646;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.build-mode-btn.active svg {
  color: #464646;
}

.build-mode-btn svg {
  color: #464646;
}

.build-mode-btn:hover:not(.active) svg {
  color: #464646;
}

/* Build AI Options */
.build-ai-options {
  margin-bottom: 16px;
  padding: 16px;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.build-ai-options .form-field {
  margin-bottom: 16px;
}

.build-ai-options .form-field:last-child {
  margin-bottom: 0;
}

/* Build Mix Options */
.build-mix-options {
  margin-bottom: 16px;
}

/* Number Input Inline */
.number-input-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
}

.number-input-inline .number-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background-color: #f3f4f6;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.number-input-inline .number-btn:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.number-input-inline .number-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

/* Build Pre-made Options */
.build-premade-options {
  margin-top: 16px;
}

/* Slides Carousel */
.slides-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

.slides-carousel::-webkit-scrollbar {
  height: 6px;
}

.slides-carousel::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.slides-carousel::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.slide-card {
  flex-shrink: 0;
  width: 160px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.slide-card .slide-preview {
  height: 88px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #ffffff;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Inline mock slide content (used when no thumbnail image is available) */
.slide-mock-content-preview {
  position: absolute;
  inset: 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  overflow: hidden;
  z-index: 0;
}

.slide-card .slide-preview > .slide-ai-badge,
.slide-card .slide-preview > .slide-premade-badge,
.slide-card .slide-preview > .slide-drag-handle,
.slide-card .slide-preview > .slide-delete-btn {
  z-index: 2;
}

.slide-mock-content-preview .mock-title {
  height: 6px;
  width: 55%;
  background: #1f2937;
  border-radius: 1px;
}

.slide-mock-content-preview .mock-line {
  height: 3px;
  background: #d1d5db;
  border-radius: 1px;
  width: 100%;
}

.slide-mock-content-preview .mock-line.short { width: 70%; }
.slide-mock-content-preview .mock-line.tiny { width: 40%; }

.slide-mock-content-preview .mock-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
  flex: 1;
}

.slide-mock-content-preview.two-col .mock-body {
  flex-direction: row;
  gap: 6px;
}

.slide-mock-content-preview.two-col .mock-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slide-mock-content-preview.image-text .mock-body {
  flex-direction: row;
  gap: 6px;
}

.slide-mock-content-preview.image-text .mock-image {
  width: 38%;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  border-radius: 2px;
}

.slide-mock-content-preview.image-text .mock-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.slide-mock-content-preview.full-image {
  padding: 6px;
}

.slide-mock-content-preview.full-image .mock-image-full {
  flex: 1;
  background: linear-gradient(135deg, #c7d2fe, #6366f1);
  border-radius: 2px;
}

.slide-mock-content-preview.title-only {
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
}

.slide-mock-content-preview.title-only .mock-title {
  width: 70%;
  height: 7px;
}

.slide-mock-content-preview.title-only .mock-line {
  width: 45%;
}

.slide-card-title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  font-size: 11px;
  color: #374151;
  background-color: #fff;
  white-space: nowrap;
  overflow: hidden;
}

.slide-card-title .slide-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

/* Slide delete button on hover */
.slide-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slide-card:hover .slide-delete-btn {
  opacity: 1;
}

.slide-delete-btn:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.slide-delete-btn svg {
  width: 16px;
  height: 16px;
}

/* Slide drag indicator */
.slide-card:not(.slide-card-add) {
  cursor: grab;
}

.slide-card:not(.slide-card-add):active {
  cursor: grabbing;
}

.slide-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.slide-placeholder {
  flex-shrink: 0;
  width: 3px;
  height: 106px;
  border: none;
  border-radius: 2px;
  background-color: #6366f1;
  margin: 0 -1px;
}

/* Vertical drop indicator for slide drag and drop */
.slide-drop-indicator {
  flex-shrink: 0;
  width: 3px;
  height: 106px;
  border: none;
  border-radius: 2px;
  background-color: #6366f1;
  margin: 0 4px;
  animation: slideDropPulse 1s ease infinite;
}

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

.slide-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  border: 2px dashed #e5e7eb;
  color: #9ca3af;
  width: 160px;
  height: 90px;
  flex-shrink: 0;
}

.slide-card-add:hover {
  border-color: #6366f1;
  color: #6366f1;
  background-color: #f5f7ff;
}

.slide-preview {
  width: 100%;
  height: 100%;
  background-color: #1f2937;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide-ai-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-premade-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.slide-preview-1 {
  background-image: url('Slide thumbnails/TemplafySlide01.png');
}

.slide-preview-2 {
  background-image: url('Slide thumbnails/TemplafySlide02.png');
}

.slide-preview-3 {
  background-image: url('Slide thumbnails/TemplafySlide03.png');
}

/* Carousel Scrollbar */
.carousel-scrollbar {
  margin-top: 8px;
}

.scrollbar-track {
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  position: relative;
}

.scrollbar-thumb {
  height: 100%;
  width: 40%;
  background-color: #9ca3af;
  border-radius: 2px;
  position: absolute;
  left: 0;
}

/* Footer */
.footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

/* Push Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 384px;
  height: 100vh;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(41, 48, 56, 0.02), 0 4px 8px 0 rgba(41, 48, 56, 0.05), 0 12px 24px 0 rgba(41, 48, 56, 0.05);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border-left: 1px solid #e5e7eb;
}

.drawer.active {
  transform: translateX(0);
}

/* Slide Type Selector - Segmented Control */
.slide-type-selector {
  display: flex;
  padding: 16px 24px;
  border-bottom: 1px solid #DFDFDF;
  flex-shrink: 0;
}

.slide-type-selector .segmented-control {
  width: 100%;
}

.slide-type-selector .slide-type-option {
  flex: 1;
}

.segmented-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 4px;
  background: #EBEBEB;
  border-radius: 6px;
  width: fit-content;
}

.segmented-control-3 {
  width: 100%;
}

.segmented-control-3 .slide-type-option {
  flex: 1;
  padding: 8px 12px;
}

/* Library Section Styles */
.library-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-section .form-field {
  margin-bottom: 0;
}

.library-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.library-section-count {
  font-size: 12px;
  color: #6b7280;
}

/* Library Separator */
.library-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 16px 0;
}

/* Library Rules Section - Disabled State */
.library-section-rules.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.library-section-rules.disabled .form-label {
  color: #9ca3af;
}

.library-section-rules.disabled .form-input {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
}

/* Templafy Search Input */
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #898989;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s ease, outline 0.15s ease;
}

.search-input-wrapper:hover {
  border-color: #464646;
}

.search-input-wrapper:focus-within {
  outline: 2px solid #6F81F1;
  outline-offset: 1px;
  border-color: #898989;
}

.search-input-icon {
  flex-shrink: 0;
  color: #737373;
  display: flex;
  align-items: center;
}

.form-input.search-input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 0;
  height: 32px;
  box-sizing: border-box;
}

.form-input.search-input-field:hover,
.form-input.search-input-field:focus {
  border: none;
  outline: none;
  box-shadow: none;
}


/* Library Tree */
.library-tree {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.library-tree-item {
  user-select: none;
}

.library-tree-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.library-tree-header:hover {
  background: #f9fafb;
}

.library-tree-chevron {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.library-folder.expanded > .library-tree-header .library-tree-chevron {
  transform: rotate(90deg);
}

.library-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}

.library-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #374151;
  cursor: pointer;
  flex-shrink: 0;
}

.library-folder-icon {
  flex-shrink: 0;
}

.library-tree-name {
  font-size: 13px;
  color: #374151;
  flex: 1;
}

.library-tree-count {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.library-tree-children {
  background: #fafafa;
}

.library-slide .library-tree-header {
  padding-left: 42px;
}

.library-slide-thumb {
  width: 32px;
  height: 20px;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid #d1d5db;
}

/* Library Selected Tags */
.library-selected-tags {
  margin-top: 8px;
}

.library-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Templafy Tag Style */
.library-tag {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 2px 8px;
  gap: 4px;
  background: #EBEBEB;
  border-radius: 10px;
  font-size: 13px;
  color: #323232;
  line-height: 16px;
}

.library-tag-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.library-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: none;
  border: none;
  color: #737373;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.library-tag-remove:hover {
  background: #d1d5db;
  color: #374151;
}

/* Library Instructions Field - Multi-select state */
.form-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.form-badge-required {
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-context-message {
  font-size: 13px;
  color: #374151;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

#libraryInstructionsField.multi-select-required {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
}

#libraryInstructionsField.multi-select-required .form-input {
  border-color: #fcd34d;
}

#libraryInstructionsField.multi-select-required .form-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Validation error state */
#libraryInstructionsField.validation-error {
  background: #fef2f2;
  border-color: #fca5a5;
}

#libraryInstructionsField.validation-error .form-input {
  border-color: #f87171;
}

.form-validation-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #dc2626;
  margin-top: 8px;
}

.form-validation-error svg {
  flex-shrink: 0;
}

/* Folder Selection Grid (in drawer) */
.folder-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.folder-selection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-selection-card:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.folder-selection-card.selected {
  border-color: #6366f1;
  background: #eef2ff;
}

.folder-selection-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  border-radius: 8px;
}

.folder-selection-card.selected .folder-selection-icon {
  background: #c7d2fe;
}

.folder-selection-card.selected .folder-selection-icon svg {
  fill: #6366f1;
}

.folder-selection-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.folder-selection-count {
  font-size: 12px;
  color: #9ca3af;
}

.slide-type-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 300;
  color: #464646;
}

.slide-type-option:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.5);
}

.slide-type-option.active {
  background-color: #fff;
  border: 1px solid #DFDFDF;
  box-shadow: none;
}

.slide-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #464646;
  transition: color 0.2s ease;
}

.slide-type-icon svg {
  width: 18px;
  height: 18px;
}

.slide-type-option:hover:not(.active) .slide-type-icon {
  color: #464646;
}

.slide-type-option.active .slide-type-icon {
  color: #464646;
}

.slide-type-icon-ai {
  color: #464646;
}

.slide-type-option.active .slide-type-icon-ai {
  color: #464646;
}

.slide-type-name {
  font-size: 14px;
  font-weight: 600;
  color: #464646;
  transition: color 0.2s ease;
}

.slide-type-option:hover:not(.active) .slide-type-name {
  color: #464646;
}

.slide-type-option.active .slide-type-name {
  color: #464646;
}

.slide-type-desc {
  display: none;
}

/* Drawer Content */
.drawer-content {
  flex: 1 1 0;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Drawer Footer */
.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #fff;
}

/* Ensure dropdowns are not clipped */
.drawer-content .layout-select-container {
  position: relative;
  z-index: 10;
}

/* Search Input */
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #1f2937;
  outline: none;
}

.search-input::placeholder {
  color: #9ca3af;
}

/* Typeahead Search Component */
.typeahead-container {
  position: relative;
  width: 100%;
}

.typeahead-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #898989;
  border-radius: 6px;
  background-color: #fff;
  min-height: 44px;
}

.typeahead-input-wrapper > .typeahead-icon {
  flex-shrink: 0;
}

.typeahead-input-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.typeahead-input-wrapper:hover {
  border-color: #464646;
}

.typeahead-input-wrapper:focus-within {
  outline: 2px solid #6F81F1;
  outline-offset: 1px;
  border-color: #898989;
}

.typeahead-icon {
  flex-shrink: 0;
  color: #737373;
}

.typeahead-tags {
  display: contents;
}

.typeahead-tags-above {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.typeahead-tags-above:empty {
  display: none;
}

.typeahead-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 2px 8px 2px 10px;
  background-color: #f3f4f6;
  border-radius: 12px;
  font-size: 12px;
  color: #374151;
}

.typeahead-tag svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.typeahead-tag[data-type="folder"] svg {
  color: #f59e0b;
}

.typeahead-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.typeahead-tag-remove:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.typeahead-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #1f2937;
  outline: none;
}

.typeahead-input::placeholder {
  color: #737373;
}

.typeahead-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.typeahead-dropdown-btn:hover {
  background-color: #f3f4f6;
  color: #6b7280;
}

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #898989;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(41, 48, 56, 0.04), 0 3px 6px 0 rgba(41, 48, 56, 0.04), 0 9px 18px 0 rgba(41, 48, 56, 0.04);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.typeahead-container.open .typeahead-dropdown,
.typeahead-dropdown.active {
  display: block;
}

.typeahead-section {
  padding: 8px 0;
}

.typeahead-section:not(:last-child) {
  border-bottom: 1px solid #DFDFDF;
}

.typeahead-section-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #737373;
}

.typeahead-option {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.typeahead-option:hover,
.typeahead-option.highlighted {
  background-color: #4A61ED;
  color: #ffffff;
}

.typeahead-option:hover .typeahead-option-text,
.typeahead-option.highlighted .typeahead-option-text {
  color: #ffffff;
}

.typeahead-option:hover svg,
.typeahead-option.highlighted svg {
  color: #ffffff;
}

.typeahead-option.selected {
  background-color: #eef2ff;
}

.typeahead-option svg {
  flex-shrink: 0;
  color: #6b7280;
}

.typeahead-option[data-type="folder"] svg {
  color: #f59e0b;
}

.typeahead-option-text {
  flex: 1;
  font-size: 14px;
  color: #1f2937;
}

.typeahead-option-text mark {
  background-color: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.typeahead-option-meta {
  font-size: 12px;
  color: #737373;
  margin-left: auto;
}

.typeahead-option:hover .typeahead-option-meta,
.typeahead-option.highlighted .typeahead-option-meta {
  color: rgba(255, 255, 255, 0.8);
}

/* Selected Folder Card */
.selected-folder-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.selected-folder-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.selected-folder-count {
  font-size: 12px;
  color: #9ca3af;
  margin-left: auto;
  margin-right: 8px;
}

.btn-remove-folder {
  flex-shrink: 0;
}

.typeahead-option-count {
  font-size: 12px;
  color: #737373;
}

.typeahead-option:hover .typeahead-option-count,
.typeahead-option.highlighted .typeahead-option-count {
  color: rgba(255, 255, 255, 0.8);
}

.typeahead-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #737373;
  font-size: 14px;
}

/* Layout Options - Segmented Control Style */
.layout-options {
  display: flex;
  padding: 4px;
  background-color: #f3f4f6;
  border-radius: 10px;
}

.layout-option {
  flex: 1;
  cursor: pointer;
}

.layout-option input {
  display: none;
}

.layout-option-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  transition: all 0.25s ease;
  font-size: 13px;
  color: #6b7280;
}

.layout-option-content svg {
  transition: color 0.25s ease;
}

.layout-option:hover .layout-option-content {
  background-color: rgba(255, 255, 255, 0.5);
}

.layout-option.active .layout-option-content,
.layout-option input:checked + .layout-option-content {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

.layout-option.active .layout-option-content svg,
.layout-option input:checked + .layout-option-content svg {
  color: #6366f1;
}

/* Layout Grid */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.layout-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.layout-item:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
}

.layout-item.active {
  border-color: #6366f1;
  background-color: #f5f7ff;
}

.layout-item span {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  font-weight: 500;
}

.layout-item.active span {
  color: #6366f1;
}

.layout-preview-mini {
  width: 80px;
  height: 52px;
  background-color: #1f2937;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layout-line {
  height: 4px;
  background-color: #6366f1;
  border-radius: 1px;
  width: 100%;
}

.layout-line.short {
  width: 60%;
}

.layout-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}

.layout-dots::before,
.layout-dots::after {
  content: '';
  width: 3px;
  height: 3px;
  background-color: #9ca3af;
  border-radius: 50%;
}

.layout-preview-mini.two-col {
  flex-direction: row;
  gap: 6px;
}

.layout-col {
  flex: 1;
  background-color: #374151;
  border-radius: 2px;
}

.layout-preview-mini.img-text {
  flex-direction: row;
  gap: 6px;
}

.layout-img {
  width: 40%;
  background-color: #6366f1;
  border-radius: 2px;
}

.layout-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.layout-text::before,
.layout-text::after {
  content: '';
  height: 4px;
  background-color: #9ca3af;
  border-radius: 1px;
}

.layout-text::after {
  width: 70%;
}

.layout-preview-mini.full-img {
  padding: 6px;
}

.layout-img-full {
  width: 100%;
  height: 100%;
  background-color: #6366f1;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-img-full::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
}

/* Layout Select Component */
.layout-select-container {
  position: relative;
}

.layout-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #898989;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.layout-select-trigger:hover {
  border-color: #464646;
}

.layout-select-trigger:focus {
  outline: 2px solid #6F81F1;
  outline-offset: 1px;
  border-color: #898989;
}

.layout-select-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #323232;
}

.layout-select-ai-icon {
  color: #6366f1;
}

.layout-select-chevron {
  color: #737373;
  transition: transform 0.2s ease;
}

.layout-select-container.open .layout-select-chevron {
  transform: rotate(180deg);
}

.layout-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.layout-select-container.open .layout-select-dropdown {
  display: block;
}

.layout-options-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* Layout Dropdown Options */
.layout-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.layout-option:hover {
  background-color: #f3f4f6;
}

.layout-option.selected {
  background-color: #f0f5ff;
}

.layout-option .layout-preview-mini {
  width: 48px;
  height: 32px;
  padding: 4px;
  flex-shrink: 0;
}

.layout-option-ai-icon {
  color: #6366f1;
  flex-shrink: 0;
}

.layout-option-title {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* Selected Layout Input */
.selected-layout-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  min-height: 42px;
}

.selected-layout-input .layout-preview-mini {
  width: 48px;
  height: 32px;
  padding: 4px;
  flex-shrink: 0;
}

.selected-layout-name {
  flex: 1;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.btn-remove-layout {
  color: #9ca3af;
  padding: 4px;
  border-radius: 4px;
}

.btn-remove-layout:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

/* Collection Dropdown */
.collection-dropdown-container {
  position: relative;
}

.collection-help-text {
  margin: 0;
}

.collection-dropdown-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.collection-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.collection-dropdown-trigger:hover {
  border-color: #9ca3af;
}

.collection-dropdown-trigger:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.collection-dropdown-trigger.has-selection {
  color: #111827;
}

.collection-dropdown-trigger.has-selection .collection-dropdown-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collection-dropdown-placeholder {
  color: #9ca3af;
}

.collection-dropdown-trigger.has-selection .collection-dropdown-placeholder {
  color: #374151;
}

.collection-dropdown-arrow {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.collection-dropdown-container.open .collection-dropdown-arrow {
  transform: rotate(180deg);
}

.collection-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.collection-dropdown-container.open .collection-dropdown {
  display: block;
}

.collection-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.collection-option:hover {
  background-color: #f9fafb;
}

.collection-option:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.collection-option.selected {
  background-color: #f5f7ff;
}

.collection-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #f3f4f6;
  border-radius: 6px;
  color: #6b7280;
  flex-shrink: 0;
}

.collection-option[data-type="link"] .collection-option-icon {
  background-color: #ede9fe;
  color: #7c3aed;
}

.collection-option[data-type="files"] .collection-option-icon {
  background-color: #e0f2fe;
  color: #0284c7;
}

.collection-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.collection-option-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.collection-option-description {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.selected-collection-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.selected-collection-icon svg {
  width: 16px;
  height: 16px;
}

/* Main content shifts when drawer is open */
.main-content {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.drawer-open .main-content {
  width: calc(100% - 384px);
  padding-right: 4px;
}

.app-container.drawer-open .right-panel {
  flex: 1;
  min-width: 0;
}

/* Legacy modal overlay - keep for backwards compatibility but hide */
.modal-overlay {
  display: none;
}

.modal {
  width: 400px;
  height: 100vh;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.tab:hover {
  color: #374151;
}

.tab.active {
  color: #1f2937;
  font-weight: 500;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1f2937;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

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

/* Form Elements */
.form-field {
  margin-bottom: 20px;
}

.form-field-inline {
  display: flex;
  align-items: center;
  gap: 16px;
}

.form-field-inline .form-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Open Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #323232;
  margin-bottom: 8px;
}

.required {
  color: #ef4444;
}

.info-icon {
  color: #9ca3af;
  cursor: help;
}

.form-input {
  width: 100%;
  height: 32px;
  padding: 4px 12px;
  border: 1px solid #898989;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.15s ease;
}

.form-input:hover {
  border-color: #464646;
}

.form-input:focus {
  outline: 2px solid #6F81F1;
  outline-offset: 1px;
  border-color: #898989;
}

.form-input::placeholder {
  color: #737373;
}

.form-help-message {
  font-family: 'Open Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #464646;
  margin-top: 4px;
}

.form-help-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

.form-help-link:hover {
  text-decoration: underline;
}

/* Search Filters */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.search-filters svg {
  color: #9ca3af;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 2px 8px;
  background-color: #EBEBEB;
  border-radius: 10px;
  font-size: 12px;
  color: #374151;
}

.filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.filter-remove:hover {
  color: #6b7280;
}

/* Slides Results - Scrollable Area */
.slides-results {
  flex: 1;
  overflow-y: auto;
  margin-top: 16px;
  padding-right: 4px;
}

.slides-count {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background-color: #fff;
  padding-bottom: 8px;
}

/* Slides Grid */
.slides-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slide-item {
  cursor: pointer;
}

.slide-thumbnail {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.15s ease;
}

.slide-item:hover .slide-thumbnail {
  border-color: #6366f1;
}

.slide-item.selected .slide-thumbnail {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.slide-mock {
  background-color: #1f2937;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  min-height: 140px;
}

.slide-mock.large {
  min-height: 180px;
  padding: 20px;
}

.slide-mock-title {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.slide-mock-subtitle {
  grid-column: 1 / -1;
  font-size: 8px;
  color: #9ca3af;
}

.slide-mock-content {
  font-size: 7px;
  color: #9ca3af;
}

.slide-mock-content ul {
  list-style: disc;
  padding-left: 12px;
}

.slide-mock-content li {
  margin-bottom: 2px;
}

.slide-mock-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #374151;
  border-radius: 4px;
  color: #6b7280;
}

.slide-name {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 2px;
}

.slide-description {
  font-size: 12px;
  color: #6b7280;
}

/* Number Input */
.number-input {
  position: relative;
}

.number-input .form-input {
  padding-right: 70px;
}

.number-controls {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.number-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background-color: #fff;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.number-btn:hover {
  background-color: #f3f4f6;
  color: #374151;
}

/* Layout Section */
.layout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.layout-preview {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
}

/* Modal Footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  background-color: #fff;
  flex-shrink: 0;
  margin-top: auto;
}

.modal-footer-split {
  justify-content: space-between;
}

/* Ghost/Danger Button */
.btn-danger {
  background-color: transparent;
  color: #dc2626;
  border: none;
}

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

/* Edit Slide Modal */
.edit-slide-type {
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.slide-type-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.slide-type-premade {
  background-color: #EBEBEB;
  color: #374151;
}

.slide-type-ai {
  background-color: #EBEBEB;
  color: #6366f1;
}

.slide-type-folder {
  background-color: #EBEBEB;
  color: #374151;
}

.edit-slide-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.edit-slide-preview {
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.edit-slide-preview .slide-mock.large {
  min-height: 200px;
}

.edit-slide-info {
  margin-bottom: 24px;
}

.textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

.textarea-readonly {
  background-color: #f9fafb;
  border-color: #DFDFDF;
  color: #4b5563;
  cursor: default;
  resize: none;
  overflow-y: auto;
  max-height: 200px;
  font-size: 13px;
  line-height: 1.6;
}

.textarea-readonly:focus {
  border-color: #e5e7eb;
  box-shadow: none;
  outline: none;
}

.premade-rules-group {
  flex-shrink: 0;
}

#premadeInstructions {
  field-sizing: content;
  min-height: auto;
  max-height: 200px;
}

.replace-slide-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: border-color 0.15s ease;
}

.replace-slide-search:focus-within {
  border-color: #6366f1;
}

.replace-slide-search svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.replace-slide-search .form-input {
  border: none;
  padding: 0;
  flex: 1;
}

.replace-slide-search .form-input:focus {
  outline: none;
  border: none;
}

/* Selected slide indicator for carousel */
.slide-card.selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* No responsive breakpoints - min-width 1440px with horizontal scroll */

/* Right Panel Content Sections */
.right-panel-content {
  display: none;
}

.right-panel-content.active {
  display: block;
}

.panel-title {
  color: #464646;
  font-family: Garant, serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: 0.144px;
  margin-bottom: 8px;
}

h3.panel-section-title {
  color: #464646;
  font-family: Garant, serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: 24px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.panel-description {
  font-family: 'Open Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #464646;
  margin-bottom: 24px;
}

.panel-body {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.panel-body .form-field {
  margin-bottom: 20px;
}

/* Tone Options */
.tone-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tone-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tone-option:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
}

.tone-option.active,
.tone-option:has(input:checked) {
  border-color: #6366f1;
  background-color: #f5f7ff;
}

.tone-option input[type="radio"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

.tone-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tone-option-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.tone-option-desc {
  font-size: 13px;
  color: #6b7280;
}

/* Knowledge List */
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knowledge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.knowledge-item:hover {
  background-color: #f3f4f6;
}

.knowledge-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
}

.knowledge-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.knowledge-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.knowledge-item-meta {
  font-size: 12px;
  color: #6b7280;
}

/* User Input List */
.user-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.user-input-list-title {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.user-input-list-count {
  font-size: 12px;
  color: #9ca3af;
}

.user-input-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.user-input-item:hover {
  background-color: #f3f4f6;
}

.user-input-item.dragging {
  opacity: 0.5;
  background-color: #e5e7eb;
}

.user-input-item.drag-over {
  border-color: #6366f1;
  background-color: #f5f7ff;
}

.user-input-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #d1d5db;
  cursor: grab;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.user-input-drag-handle:hover {
  color: #9ca3af;
}

.user-input-drag-handle:active {
  cursor: grabbing;
}

/* User Input Accordion */
.user-input-accordion {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.user-input-accordion:hover {
  border-color: #d1d5db;
}

.user-input-accordion.expanded {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}

.user-input-accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  background-color: #f9fafb;
  transition: background-color 0.15s ease;
}

.user-input-accordion:hover .user-input-accordion-header {
  background-color: #f3f4f6;
}

.user-input-accordion.expanded .user-input-accordion-header {
  background-color: #f5f7ff;
  border-bottom: 1px solid #e5e7eb;
}

.user-input-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-input-accordion.expanded .user-input-accordion-toggle {
  transform: rotate(180deg);
}

.user-input-accordion-title-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  row-gap: 4px;
}

.user-input-accordion-number {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.user-input-accordion-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.user-input-accordion-title-wrapper .user-input-section-refs {
  margin-top: 0;
  margin-left: auto;
}

.user-input-accordion-content {
  display: none;
  padding: 16px;
  background-color: #fff;
}

.user-input-accordion.expanded .user-input-accordion-content {
  display: block;
}

.user-input-accordion .btn-delete-user-input {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.user-input-accordion:hover .btn-delete-user-input,
.user-input-accordion.expanded .btn-delete-user-input {
  opacity: 1;
}

.user-input-accordion.dragging {
  opacity: 0.5;
  background-color: #e5e7eb;
}

.user-input-accordion.drag-over {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.user-input-drag-handle:active {
  cursor: grabbing;
}

.user-input-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
  flex-shrink: 0;
}

.user-input-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-input-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-input-item-type {
  font-size: 12px;
  color: #6b7280;
}

.user-input-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-input-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.user-input-item:hover .user-input-item-actions {
  opacity: 1;
}

.btn-edit-user-input,
.btn-delete-user-input {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-user-input:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.btn-delete-user-input:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Required tag for user inputs */
.tag-required {
  background-color: #fef3c7;
  color: #92400e;
  font-size: 10px;
  padding: 2px 6px;
}

.tag-small {
  font-size: 10px;
  padding: 2px 6px;
}

/* Empty state for user input list */
.empty-state-small {
  text-align: center;
  padding: 24px 16px;
  color: #9ca3af;
  font-size: 13px;
}

/* Form select styling */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Checkbox styling */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #6366f1;
}

.checkbox-label {
  font-weight: 500;
}

/* Section User Input Selector */
.section-user-inputs-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.user-input-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-input-checkbox-item:hover {
  background-color: #f3f4f6;
}

.user-input-checkbox-item.selected {
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  margin: -1px;
}

.user-input-checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #6366f1;
  flex-shrink: 0;
}

.user-input-checkbox-label {
  flex: 1;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-inputs-empty-hint {
  padding: 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.user-inputs-empty-hint a {
  color: #6366f1;
  text-decoration: none;
}

.user-inputs-empty-hint a:hover {
  text-decoration: underline;
}

.section-user-inputs-field {
  margin-top: 8px;
}

/* Folder User Input Selector (in drawer) */
.folder-user-inputs-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#folderUserInputsField {
  margin-top: 16px;
}

/* Add Item Button */
.btn-add-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  background-color: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 16px;
}

.btn-add-item:hover {
  border-color: #6366f1;
  color: #6366f1;
  background-color: #f5f7ff;
}

/* Small Segmented Control (for Default/Custom toggle) */
.segmented-control-sm {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  background-color: #EBEBEB;
  border-radius: 6px;
}

.segment-option {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #464646;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-option:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.5);
}

.segment-option.active {
  background-color: #fff;
  color: #464646;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tone Mode Selector */
.tone-mode-selector {
  display: flex;
  margin-bottom: 12px;
}

.tone-mode-content {
  margin-top: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(41, 48, 56, 0.06), 0 2px 4px 0 rgba(41, 48, 56, 0.03), 0 6px 12px 0 rgba(41, 48, 56, 0.03);
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Knowledge Mode Selector */
.knowledge-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.knowledge-mode-selector .collection-dropdown-container {
  margin-top: 0;
}

.knowledge-mode-content {
  margin-top: 16px;
}

/* Knowledge Source Tabs */
.knowledge-source-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 20px;
}

.knowledge-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.knowledge-tab:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

.knowledge-tab.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.knowledge-tab svg {
  flex-shrink: 0;
}

/* Knowledge Tab Content */
.knowledge-tab-content {
  display: none;
}

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

.knowledge-section-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Knowledge Collections List */
.knowledge-collections-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.knowledge-collection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.knowledge-collection-item:hover {
  background: #f9fafb;
}

.knowledge-collection-item:has(input:checked),
.knowledge-collection-item:has(input:checked):hover {
  background: none;
}

.knowledge-collection-item .checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: #374151;
  cursor: pointer;
  flex-shrink: 0;
}

.collection-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 8px;
  color: #6b7280;
  flex-shrink: 0;
}

.knowledge-collection-item:has(input:checked) .collection-item-icon {
  background: #f3f4f6;
  color: #6b7280;
}

.collection-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.collection-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.collection-item-meta {
  font-size: 12px;
  color: #6b7280;
}

.knowledge-collections-info {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.knowledge-collections-info-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 6px 0;
}

.knowledge-collections-info-description {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.knowledge-manage-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
}

.knowledge-manage-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* SharePoint Browser Inline */
.sharepoint-search {
  position: relative;
  margin-bottom: 12px;
}

.sharepoint-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.sharepoint-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sharepoint-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sharepoint-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.sp-breadcrumb-item {
  color: #6b7280;
  cursor: pointer;
}

.sp-breadcrumb-item:hover {
  color: #2563eb;
}

.sp-breadcrumb-item.active {
  color: #111827;
  font-weight: 500;
}

/* SharePoint Tree */
.sharepoint-tree {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
}

.sp-tree-item {
  user-select: none;
}

.sp-tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sp-tree-header:hover {
  background: #f9fafb;
}

.sp-tree-chevron {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.sp-tree-item.expanded > .sp-tree-header .sp-tree-chevron {
  transform: rotate(90deg);
}

.sp-tree-icon {
  flex-shrink: 0;
}

.sp-tree-spacer {
  width: 14px;
  flex-shrink: 0;
}

.sp-tree-name {
  font-size: 13px;
  color: #374151;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-tree-size {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.sp-tree-add-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #6b7280;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sp-tree-header:hover .sp-tree-add-btn {
  opacity: 1;
}

.sp-tree-add-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.sp-tree-children {
  padding-left: 22px;
}

.sp-file .sp-tree-header {
  cursor: default;
}

/* Knowledge Drop Zone */
.knowledge-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.2s ease;
  background: #fafafa;
}

.knowledge-dropzone:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
}

.knowledge-dropzone.drag-over {
  border-color: #6b7280;
  background: #e5e7eb;
  border-style: solid;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  color: #9ca3af;
  margin-bottom: 8px;
}

.knowledge-dropzone:hover .dropzone-icon,
.knowledge-dropzone.drag-over .dropzone-icon {
  color: #4b5563;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

.dropzone-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.dropzone-browse-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.dropzone-browse-btn:hover {
  color: #1d4ed8;
}

.dropzone-formats {
  font-size: 12px;
  color: #9ca3af;
  margin: 8px 0 0 0;
}

/* Added Knowledge Sources Section */
.knowledge-added-section {
  margin-bottom: 20px;
}

.knowledge-added-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.knowledge-added-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.knowledge-added-count {
  display: none;
}

.knowledge-added-list {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  padding: 4px;
  gap: 4px;
}

.knowledge-added-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.knowledge-added-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #111827;
}

.knowledge-added-item-icon svg {
  stroke: #111827 !important;
}

.knowledge-added-item-info {
  flex: 1;
  min-width: 0;
}

.knowledge-added-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-added-item-meta {
  font-size: 12px;
  color: #6b7280;
}

.knowledge-added-item-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.knowledge-added-item-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.tone-info-text {
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.5;
}

.tone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #6366f1;
  text-decoration: none;
}

.tone-link:hover {
  text-decoration: underline;
}

/* Toggle Switch */
.tone-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tone-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #323232;
}

.tone-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #c45c32;
  cursor: pointer;
}

.tone-checkbox-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.tone-checkbox-label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #6366f1;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  color: #374151;
}

/* Tag Input Container */
.tag-input-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  min-height: 48px;
}

.tag-input-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
}

.tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.tag-remove:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #6b7280;
}

.tag-input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tag-clear-btn,
.tag-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tag-clear-btn:hover,
.tag-dropdown-btn:hover {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* Tone Preview Box */
.tone-preview-box {
  padding: 12px 16px;
  background-color: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.tone-preview-box.empty {
  background-color: #fafafa;
  border-color: #e5e7eb;
}

.tone-preview-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

.form-label-muted {
  color: #9ca3af;
}

/* Upload Area */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  background-color: #f9fafb;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.upload-area:hover {
  border-color: #6366f1;
  background-color: #f5f7ff;
}

.upload-area.drag-over {
  border-color: #6366f1;
  background-color: #eef2ff;
}

.upload-area-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: #e5e7eb;
  border-radius: 12px;
  color: #6b7280;
}

.upload-area:hover .upload-area-icon {
  background-color: #e0e7ff;
  color: #6366f1;
}

.upload-area-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.upload-area-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.upload-area-subtitle {
  font-size: 13px;
  color: #6b7280;
}

.btn-link-inline {
  background: none;
  border: none;
  color: #6366f1;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link-inline:hover {
  color: #4f46e5;
}

.upload-area-hint {
  font-size: 12px;
  color: #9ca3af;
}

/* File Source Options */
.file-source-options {
  display: flex;
  gap: 12px;
}

.file-source-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-source-card:hover {
  border-color: #6366f1;
  background-color: #f5f7ff;
}

.file-source-card.drag-over {
  border-color: #6366f1;
  background-color: #eef2ff;
}

.file-source-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-color: #f3f4f6;
  color: #6b7280;
  transition: all 0.15s ease;
}

.file-source-card:hover .file-source-icon {
  background-color: #e0e7ff;
  color: #6366f1;
}

.file-source-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.file-source-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.file-source-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.file-source-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* Uploaded File Card */
.uploaded-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.uploaded-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #e0e7ff;
  border-radius: 8px;
  color: #4338ca;
  flex-shrink: 0;
}

.uploaded-file-info {
  flex: 1;
  min-width: 0;
}

.uploaded-file-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploaded-file-size {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.btn-remove-file {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-file:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Save to Collection Section */
.save-to-collection-section {
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.save-collection-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-collection-toggle .toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.collection-save-options {
  padding-left: 44px;
}

.collection-option-new {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 8px;
}

.collection-option-new .collection-option-icon {
  color: #6366f1;
}

.collection-option-new .collection-option-title {
  color: #6366f1;
  font-weight: 500;
}

/* Knowledge List Header */
.knowledge-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.knowledge-list-title {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.knowledge-list-count {
  font-size: 12px;
  color: #9ca3af;
}

/* Layout Select Dropdown */
.layout-select-container {
  position: relative;
  width: 100%;
}

.layout-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  font-size: 14px;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-select-btn:hover {
  border-color: #d1d5db;
}

.layout-select-btn:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.layout-select-text {
  flex: 1;
  text-align: left;
}

.layout-select-text.placeholder {
  color: #9ca3af;
}

.layout-select-btn svg {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.layout-select-container.open .layout-select-btn svg {
  transform: rotate(180deg);
}

.layout-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.layout-select-container.open .layout-dropdown {
  display: block;
}

.layout-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.layout-dropdown-item:hover {
  background-color: #f3f4f6;
}

.layout-dropdown-item.selected {
  background-color: #eef2ff;
}

.layout-dropdown-preview {
  flex-shrink: 0;
  width: 48px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background-color: #1f2937;
}

.layout-dropdown-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.layout-dropdown-name {
  font-size: 14px;
  color: #1f2937;
}

/* Layout Mini Previews (in dropdown) */
.layout-mini {
  width: 100%;
  height: 100%;
  background-color: #1f2937;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layout-mini-title {
  height: 4px;
  width: 60%;
  background-color: #6366f1;
  border-radius: 1px;
}

.layout-mini-body {
  flex: 1;
  background-color: #374151;
  border-radius: 1px;
}

.layout-mini-title-content {
  flex-direction: column;
}

.layout-mini-two-col {
  flex-direction: row;
  gap: 3px;
}

.layout-mini-two-col .layout-mini-col {
  flex: 1;
  background-color: #374151;
  border-radius: 1px;
}

.layout-mini-img-text {
  flex-direction: row;
  gap: 3px;
}

.layout-mini-img-text .layout-mini-img {
  width: 45%;
  background-color: #6366f1;
  border-radius: 1px;
}

.layout-mini-img-text .layout-mini-text {
  flex: 1;
  background-color: #374151;
  border-radius: 1px;
}

.layout-mini-full-img {
  padding: 3px;
}

.layout-mini-full-img .layout-mini-img-full {
  width: 100%;
  height: 100%;
  background-color: #6366f1;
  border-radius: 1px;
}

.layout-mini-title-only {
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.layout-mini-title-only .layout-mini-title-lg {
  width: 70%;
  height: 6px;
  background-color: #fff;
  border-radius: 1px;
}

.layout-mini-title-only .layout-mini-subtitle {
  width: 50%;
  height: 3px;
  background-color: #6b7280;
  border-radius: 1px;
}

.layout-mini-comparison {
  flex-direction: column;
}

.layout-mini-comparison .layout-mini-title {
  height: 3px;
  width: 50%;
  margin-bottom: 2px;
}

.layout-mini-comparison .layout-mini-cols {
  flex: 1;
  display: flex;
  gap: 3px;
}

.layout-mini-comparison .layout-mini-col {
  flex: 1;
  background-color: #374151;
  border-radius: 1px;
}

/* Layout Preview Area (large preview) */
.layout-preview-area {
  margin-top: 16px;
}

.layout-preview-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background-color: #1f2937;
  min-height: 180px;
  position: relative;
}

/* Large Layout Previews */
.layout-preview-large {
  width: 100%;
  height: 180px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.layout-preview-large .preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.layout-preview-large .preview-subtitle {
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.layout-preview-large .preview-content {
  flex: 1;
  background-color: #374151;
  border-radius: 4px;
  padding: 12px;
}

.layout-preview-large .preview-content-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layout-preview-large .preview-line {
  height: 8px;
  background-color: #4b5563;
  border-radius: 2px;
}

.layout-preview-large .preview-line:nth-child(2) {
  width: 85%;
}

.layout-preview-large .preview-line:nth-child(3) {
  width: 70%;
}

/* Two Column Preview */
.layout-preview-two-col {
  flex-direction: column;
}

.layout-preview-two-col .preview-columns {
  flex: 1;
  display: flex;
  gap: 12px;
}

.layout-preview-two-col .preview-column {
  flex: 1;
  background-color: #374151;
  border-radius: 4px;
  padding: 12px;
}

/* Image & Text Preview */
.layout-preview-img-text {
  flex-direction: column;
}

.layout-preview-img-text .preview-row {
  flex: 1;
  display: flex;
  gap: 12px;
}

.layout-preview-img-text .preview-image {
  width: 45%;
  background-color: #6366f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-preview-img-text .preview-image svg {
  color: rgba(255, 255, 255, 0.5);
}

.layout-preview-img-text .preview-text {
  flex: 1;
  background-color: #374151;
  border-radius: 4px;
  padding: 12px;
}

/* Full Image Preview */
.layout-preview-full-img {
  padding: 12px;
}

.layout-preview-full-img .preview-image-full {
  width: 100%;
  height: 100%;
  background-color: #6366f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-preview-full-img .preview-image-full svg {
  color: rgba(255, 255, 255, 0.5);
}

/* Title Only Preview */
.layout-preview-title-only {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.layout-preview-title-only .preview-title-large {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.layout-preview-title-only .preview-subtitle-large {
  font-size: 12px;
  color: #9ca3af;
}

/* Comparison Preview */
.layout-preview-comparison {
  flex-direction: column;
}

.layout-preview-comparison .preview-header {
  text-align: center;
  margin-bottom: 12px;
}

.layout-preview-comparison .preview-columns {
  flex: 1;
  display: flex;
  gap: 12px;
}

.layout-preview-comparison .preview-column {
  flex: 1;
  background-color: #374151;
  border-radius: 4px;
  padding: 12px;
}

.layout-preview-comparison .preview-column-header {
  font-size: 10px;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 8px;
  text-align: center;
}

/* Layout Preview Image (using actual thumbnails) */
.layout-preview-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Add Configuration Dropdown */
.add-config-container {
  position: relative;
  margin-top: 8px;
}

.btn-add-config {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed #e5e7eb;
  border-radius: 10px;
  background-color: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-config:hover {
  border-color: #6366f1;
  color: #6366f1;
  background-color: #f5f7ff;
}

.btn-add-config .chevron-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.add-config-container.open .btn-add-config .chevron-icon {
  transform: rotate(180deg);
}

.add-config-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.add-config-container.open .add-config-dropdown {
  display: block;
}

.config-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.config-option:hover {
  background-color: #f3f4f6;
}

.config-option.added {
  background-color: #f0fdf4;
}

.config-option.added:hover {
  background-color: #dcfce7;
}

.config-option-name {
  font-size: 14px;
  color: #1f2937;
}

.config-option-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

.config-option.added .config-option-status {
  color: #10b981;
}

.config-option.added .config-option-status svg {
  display: none;
}

.config-option.added .config-option-status::after {
  content: '✓';
  font-size: 14px;
  font-weight: 600;
}

/* Optional card styling */
.card-optional {
  position: relative;
}

.card-empty-hint {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

.card-summary {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* Warning Modal */
.warning-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.warning-modal-overlay.active {
  opacity: 1;
}

.warning-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.warning-modal-overlay.active .warning-modal {
  transform: scale(1);
}

.warning-modal-icon {
  width: 48px;
  height: 48px;
  background-color: #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.warning-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px;
}

.warning-modal-message {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}

.warning-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-warning {
  background-color: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background-color: #d97706;
}

/* Section Builder - Config Row */
.section-config-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 2px;
}

.section-description-field {
  flex: 1;
  min-width: 0;
}

.section-description-input {
  width: 100%;
  font-size: 14px;
  padding: 11px;
}

.section-ai-count-field {
  flex-shrink: 0;
}

.section-ai-count-field .form-label {
  white-space: nowrap;
}

/* AI Config Section */
.section-ai-config {
  margin-top: 16px;
  padding: 16px;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.section-ai-config .form-field {
  margin-bottom: 0;
}

.section-ai-config .form-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-ai-config .form-label::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236366f1'%3E%3Cpath d='M12 2L9.19 8.63L2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2z'/%3E%3C/svg%3E");
  background-size: contain;
}

/* Section Preview Area */
.section-preview-area {
  margin-top: 4px;
}

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

.section-preview-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.btn-add-slides {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 180px;
  height: 125px;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  background-color: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-add-slides:hover {
  border-color: #6366f1;
  color: #6366f1;
  background-color: #f5f7ff;
}

.btn-add-slides svg {
  flex-shrink: 0;
}

.section-preview-container {
  position: relative;
}

/* Section Preview - Visual treatment for carousel */
.section-preview {
  background-color: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  min-height: 140px;
}

.section-preview .slide-card {
  width: 180px;
}

.section-preview .slide-card .slide-preview {
  height: 100px;
}

.section-preview .slide-card-title {
  font-size: 11px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Slide type indicator icon */
.slide-type-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.slide-type-indicator svg {
  width: 10px;
  height: 10px;
}

.slide-type-indicator.library svg {
  color: #6b7280;
}

.slide-type-indicator.folder svg {
  color: #f59e0b;
}

.slide-type-indicator.ai svg {
  color: #6366f1;
}

/* Empty state for section preview */
.section-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: #9ca3af;
  width: 100%;
}

.section-empty-state svg {
  opacity: 0.5;
}

.section-empty-state span {
  font-size: 13px;
}

/* Hide empty state when slides are present */
.section-preview:has(.slide-card) .section-empty-state {
  display: none;
}

/* Slide card with drag handle and actions */
.slide-card {
  position: relative;
}

.slide-card-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.slide-card:hover .slide-card-header {
  opacity: 1;
}

.slide-drag-handle {
  display: flex;
  align-items: center;
  color: #fff;
  cursor: grab;
  padding: 2px;
}

.slide-drag-handle:active {
  cursor: grabbing;
}

.slide-drag-handle:hover {
  color: #e5e7eb;
}

.slide-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.slide-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

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

/* Selection Preview */
.selection-preview {
  margin-top: 24px;
}

.selection-preview .form-label {
  margin-bottom: 12px;
}

/* Selected Slide Preview */
.selected-slide-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}

.selected-slide-image {
  height: 160px;
  background-color: #1f2937;
  background-size: cover;
  background-position: center;
}

.selected-slide-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}

.selected-slide-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.selected-slide-card .btn-remove-selection {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.selected-slide-card:hover .btn-remove-selection {
  opacity: 1;
}

/* Folder Expansion Panel */
.folder-expansion-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}

.folder-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.folder-panel-header:hover {
  background-color: #f9fafb;
}

.folder-icon {
  flex-shrink: 0;
}

.folder-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  flex: 1;
}

.folder-slide-count {
  font-size: 13px;
  color: #6b7280;
}

.folder-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #464646;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.folder-expand-btn:hover {
  background-color: #f3f4f6;
}

.folder-expand-btn svg {
  transition: transform 0.2s ease;
}

.folder-expansion-panel.expanded .folder-expand-btn svg {
  transform: rotate(180deg);
}

.folder-panel-content {
  display: none;
  border-top: 1px solid #e5e7eb;
  padding: 16px;
  background-color: #f9fafb;
}

.folder-expansion-panel.expanded .folder-panel-content {
  display: block;
}

.folder-slides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.folder-slide-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-slide-item:hover {
  border-color: #6366f1;
}

.folder-slide-thumb {
  height: 60px;
  background-color: #1f2937;
  background-size: cover;
  background-position: center;
}

.folder-slide-name {
  font-size: 11px;
  color: #374151;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   Option D: AI-first Section Builder Styles
   ============================================ */

/* AI mode toggle row */
.ai-mode-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Inline number input (hidden by default, shown when toggle is ON) */
.number-input-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.number-input-inline .number-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.number-input-inline .number-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background-color: #f5f7ff;
}

.number-input-inline .number-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

/* AI placeholder card styling */
.slide-card.ai-placeholder {
  background-color: #fff;
}

.slide-card.ai-placeholder .slide-preview {
  background: linear-gradient(135deg, #f0f0f8 0%, #e8e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slide drag handle - top left corner */
.slide-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #9ca3af;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slide-card:hover .slide-drag-handle {
  opacity: 1;
}

.slide-drag-handle:hover {
  background-color: #fff;
  color: #6366f1;
}

.slide-drag-handle:active {
  cursor: grabbing;
}

/* Hide AI badge when drag handle is present */
.slide-card.ai-placeholder .slide-ai-badge {
  display: none;
}

/* Full-height add button in section preview */
.section-preview .slide-card-add {
  width: 180px;
  height: 100px;
  flex-direction: row;
  gap: 4px;
  border-radius: 6px;
}

/* Slide count hint text */
.slide-count-hint {
  margin-top: 8px;
}

/* Section topic group */
.section-topic-group .textarea {
  resize: vertical;
  min-height: 72px;
}

/* Section preview group */
.section-preview-group .slides-carousel {
  padding: 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* ============================================
   Configuration Section Divider
   ============================================ */

.config-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Optional section */
.config-section-optional {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.config-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}

.config-section-divider::before,
.config-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: #e5e7eb;
}

.config-section-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #464646;
}

/* Sections List in Right Panel */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* Section Accordion */
.section-accordion {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.section-accordion:hover {
  border-color: #d1d5db;
}

.section-accordion.expanded {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}

.section-accordion.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.section-accordion .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid transparent;
}

.section-accordion.expanded .section-header {
  border-bottom-color: #e5e7eb;
}

.section-accordion .section-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #9ca3af;
  cursor: grab;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.section-accordion .section-drag-handle:hover {
  color: #6b7280;
  background: rgba(0, 0, 0, 0.05);
}

.section-accordion .section-drag-handle:active {
  cursor: grabbing;
}

.section-name-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.section-name-input {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  background: transparent;
  border: none;
  outline: none;
  padding: 6px 8px;
  margin: -6px 0;
  border-radius: 6px;
  min-width: 60px;
  width: auto;
  max-width: 100%;
}

.section-name-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px #6366f1;
}

.section-name-input::placeholder {
  color: #9ca3af;
}

.section-edit-icon {
  flex-shrink: 0;
  color: #9ca3af;
  transition: color 0.15s ease;
  margin-left: 4px;
  cursor: pointer;
}

.section-name-wrapper:hover .section-edit-icon {
  color: #6b7280;
}

.section-name-input:focus ~ .section-edit-icon {
  display: none;
}

.section-configure-btn {
  flex-shrink: 0;
}

.section-delete-btn {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.section-accordion:hover .section-delete-btn {
  opacity: 1;
}

/* Section Content (Accordion Body) */
.section-accordion .section-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.section-accordion.expanded .section-content {
  grid-template-rows: 1fr;
}

.section-accordion .section-content-inner {
  overflow: hidden;
  padding: 0 16px;
}

.section-accordion.expanded .section-content-inner {
  padding: 16px;
}

/* Section Mode Selector */
.section-mode-selector {
  margin-bottom: 16px;
}

/* Mode Content Areas */
.section-mode-content {
  animation: sectionFadeIn 0.2s ease;
}

@keyframes sectionFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Folder Cards Grid */
.folder-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-card:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.folder-card.selected {
  border-color: #6366f1;
  background: #eef2ff;
}

.folder-card-icon {
  color: #6b7280;
}

.folder-card.selected .folder-card-icon {
  color: #6366f1;
}

.folder-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.folder-card-count {
  font-size: 11px;
  color: #9ca3af;
}

/* Folder Slide Card (in section preview) */
.folder-slide-card {
  width: 160px;
}

.folder-slide-card .folder-preview {
  background: #f9fafb;
  position: relative;
  overflow: hidden;
  height: 88px;
}

.folder-bg-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  pointer-events: none;
}

.folder-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.folder-expand-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.folder-slide-card:hover .folder-expand-btn {
  opacity: 1;
}

.folder-expand-btn svg {
  transition: transform 0.2s ease;
  color: #6b7280;
}

.folder-slide-card.expanded .folder-expand-btn svg {
  transform: rotate(180deg);
}

.folder-slide-card .slide-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
}

.folder-name {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-slide-count {
  font-size: 10px;
  color: #9ca3af;
}

/* Expandable folder samples */
.folder-samples {
  padding: 8px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.folder-sample-slide {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sample-thumbnail {
  height: 40px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  background-color: #e5e7eb;
}

.sample-title {
  font-size: 9px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-more {
  grid-column: span 2;
  text-align: center;
  font-size: 10px;
  color: #9ca3af;
  padding-top: 4px;
}

/* Section slide preview */
.section-slides-preview {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
}

/* Preview update visual feedback */
.section-slides-preview.preview-updated {
  animation: previewFlash 0.3s ease;
}

@keyframes previewFlash {
  0%, 100% { background: transparent; }
  50% { background: rgba(99, 102, 241, 0.1); border-radius: 8px; }
}

/* Drop Indicator - Horizontal Blue Line */
.section-drop-indicator {
  height: 3px;
  background: #6366f1;
  border-radius: 2px;
  margin: 6px 0;
  animation: dropIndicatorPulse 1s ease infinite;
}

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

/* =====================================================
   User Targeting Styles
   ===================================================== */

/* User card in left panel */
.card-inheritance-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.tag-inherited {
  background: #F3F4F6;
  color: #6b7280;
  border: 1px dashed #D1D5DB;
}

/* Inherited info box */
.inherited-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-top: 16px;
}

.inherited-info-box svg {
  color: #1f2937;
  flex-shrink: 0;
}

.inherited-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.inherited-info-title {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.inherited-info-value {
  font-size: 12px;
  color: #6b7280;
}

.btn-link-small {
  font-size: 12px;
  color: #6366F1;
  text-decoration: none;
  white-space: nowrap;
}

.btn-link-small:hover {
  text-decoration: underline;
}

/* User group list */
.user-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.user-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-group-item:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.user-group-item:has(input:checked) {
  background: #F5F3FF;
  border-color: #C7D2FE;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: #6366F1;
  cursor: pointer;
}

.user-group-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.user-group-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.user-group-count {
  font-size: 12px;
  color: #6b7280;
}

/* User access summary */
.user-access-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #4338CA;
}

.user-access-summary svg {
  color: #6366F1;
}

/* User search */
.user-search-container {
  position: relative;
}

.user-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
}

.user-search-input {
  padding-left: 40px !important;
}

/* Selected users list */
.selected-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.selected-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.selected-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.selected-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.selected-user-name {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
}

.selected-user-email {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-user-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.selected-user-remove:hover {
  background: #FEE2E2;
  color: #EF4444;
}

/* Reset button */
.btn-link-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-link-subtle:hover {
  color: #4338CA;
}

.btn-link-subtle svg {
  flex-shrink: 0;
}

/* Ghost button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: #F3F4F6;
  color: #374151;
}

.btn-ghost:active {
  background: #E5E7EB;
}

.btn-ghost svg {
  flex-shrink: 0;
}

/* Inheritance toggle section */
.inheritance-toggle-section {
  margin-bottom: 16px;
}

/* Connection status for user access (reusing existing styles) */
.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  margin-top: 12px;
}

.connection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
}

.connection-status-text {
  font-size: 13px;
  color: #166534;
}

/* Tone Details Accordion */
.tone-details {
  margin-top: 12px;
}

.tone-details-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary, #737373);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tone-details-summary::-webkit-details-marker {
  display: none;
}

.tone-details-summary::marker {
  display: none;
  content: '';
}

.tone-details-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

details.tone-details[open] .tone-details-chevron {
  transform: rotate(0deg);
}

.tone-details-content {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-secondary, #737373);
  line-height: 1.5;
}

/* Storage Browser Drawer */
#storageBrowserDrawer {
  width: 480px;
}

#storageBrowserDrawer .drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Storage Source Tabs */
.storage-source-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.storage-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.storage-tab:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.storage-tab.active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #6366f1;
}

/* Storage Search */
.storage-search {
  position: relative;
  display: flex;
  align-items: center;
}

.storage-search-icon {
  position: absolute;
  left: 12px;
  color: #9ca3af;
  pointer-events: none;
}

.storage-search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.15s ease;
}

.storage-search-input:focus {
  outline: none;
  border-color: #6366f1;
}

.storage-search-input::placeholder {
  color: #9ca3af;
}

/* Storage Breadcrumb */
.storage-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #6b7280;
}

.breadcrumb-item {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.breadcrumb-item:hover {
  background: #f3f4f6;
}

.breadcrumb-item.active {
  color: #1f2937;
  font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: #d1d5db;
}

/* Storage Tree */
.storage-tree {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  min-height: 300px;
}

.tree-item {
  user-select: none;
}

.tree-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.tree-item-header:hover {
  background-color: #f3f4f6;
}

.tree-item.selected > .tree-item-header {
  background-color: #eef2ff;
}

.tree-chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.15s ease;
}

.tree-item.expanded > .tree-item-header .tree-chevron {
  transform: rotate(90deg);
}

.tree-spacer {
  width: 14px;
  flex-shrink: 0;
}

.tree-icon {
  flex-shrink: 0;
}

.tree-icon-folder {
  color: #f59e0b;
}

.tree-icon-file {
  color: #6b7280;
}

.tree-item-name {
  flex: 1;
  font-size: 13px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item-size {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.tree-children {
  padding-left: 20px;
}

/* File type specific icons */
.tree-file[data-path$=".pdf"] .tree-icon-file {
  color: #ef4444;
}

.tree-file[data-path$=".docx"] .tree-icon-file,
.tree-file[data-path$=".doc"] .tree-icon-file {
  color: #2563eb;
}

.tree-file[data-path$=".xlsx"] .tree-icon-file,
.tree-file[data-path$=".xls"] .tree-icon-file {
  color: #16a34a;
}

.tree-file[data-path$=".pptx"] .tree-icon-file,
.tree-file[data-path$=".ppt"] .tree-icon-file {
  color: #ea580c;
}

/* =====================================================
   INHERITANCE UI PATTERNS
   Additional styles for Universal/Custom Agent inheritance
   ===================================================== */

/* Tag for overridden properties */
.tag-overridden {
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}

/* Custom-only configuration label */
.card-custom-only-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 8px;
  font-style: italic;
}

/* Universal Agent specific styles */
.badge-universal {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
}

/* Inheritance banner for Universal Agent */
.inheritance-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  margin-bottom: 16px;
}

.inheritance-banner-icon {
  width: 20px;
  height: 20px;
  color: #D97706;
  flex-shrink: 0;
}

.inheritance-banner-text {
  font-size: 13px;
  color: #92400E;
}

.inheritance-banner-text strong {
  font-weight: 600;
}

/* Per-card inheritance indicator */
.card-universal-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #D97706;
  margin-top: 4px;
}

.card-universal-indicator svg {
  width: 12px;
  height: 12px;
}

/* Impact stats for Universal Agent */
.impact-stats {
  display: flex;
  gap: 24px;
  padding: 16px;
  background: #F9FAFB;
  border-radius: 8px;
  margin-top: 16px;
}

.impact-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.impact-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.impact-stat-label {
  font-size: 12px;
  color: #6b7280;
}

/* Repository link card */
.repository-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-top: 12px;
}

.repository-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #E0E7FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.repository-icon svg {
  width: 20px;
  height: 20px;
  color: #4338CA;
}

.repository-info {
  flex: 1;
  min-width: 0;
}

.repository-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 2px;
}

.repository-meta {
  font-size: 12px;
  color: #6b7280;
}

.repository-action {
  color: #6b7280;
  transition: color 0.15s ease;
}

.repository-action:hover {
  color: #4338CA;
}

/* Layout preview grid for Universal Agent */
.layout-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.layout-option-card {
  padding: 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.layout-option-card:hover {
  border-color: #C7D2FE;
}

.layout-option-card.selected {
  border-color: #6366F1;
  background: #F5F3FF;
}

.layout-option-preview {
  width: 100%;
  height: 60px;
  background: #F3F4F6;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-option-name {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
}

/* Agent card inheritance indicator (for overview page) */
.agent-card-inheritance {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
  padding: 8px 12px;
  background: #F9FAFB;
  border-radius: 8px;
  margin-bottom: 16px;
}

.agent-card-inheritance svg {
  width: 14px;
  height: 14px;
  color: #D97706;
}

.inheritance-overridden {
  color: #4338CA;
  font-weight: 500;
}

/* Reset to inherited button container */
.reset-to-inherited {
  margin-top: 20px;
}

/* Users mode content visibility */
.users-mode-content {
  /* Display controlled by JS */
}

/* Confirmation modal styles */
.confirmation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirmation-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.confirmation-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.confirmation-modal-text {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirmation-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: #F3F4F6;
  color: #374151;
}

.btn-secondary:hover {
  background: #E5E7EB;
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
}

.btn-danger:hover {
  background: #FECACA;
}

/* ===== AI Question Suggestions ===== */

.suggest-questions-field {
  margin-top: 4px;
}

.suggest-questions-container {
  position: relative;
  display: inline-block;
}

.user-input-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.user-input-actions .btn-add-section {
  margin-bottom: 0;
}

.suggest-questions-panel {
  position: relative;
}

.btn-suggest-questions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #323232;
  background: rgba(50, 50, 50, 0.13);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-suggest-questions:hover {
  background: rgba(50, 50, 50, 0.18);
}

.btn-suggest-questions:active {
  background: rgba(50, 50, 50, 0.22);
}

.btn-suggest-questions svg {
  color: #323232;
}

.btn-suggest-questions:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-suggest-questions:disabled:hover {
  background: rgba(50, 50, 50, 0.13);
}

.btn-suggest-questions.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-suggest-questions.loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Suggestion Popover */
.suggest-questions-popover {
  position: fixed;
  width: 380px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
}

.suggest-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F3F4F6;
}

.suggest-popover-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggest-popover-title::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L9.19 8.63L2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L9.19 8.63L2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
}

.suggest-popover-close {
  padding: 4px;
  color: #9ca3af;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.suggest-popover-close:hover {
  background: #F3F4F6;
  color: #6b7280;
}

.suggest-popover-hint {
  padding: 10px 16px 8px;
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.suggest-popover-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 8px;
}

.suggest-popover-empty {
  padding: 24px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.suggest-popover-empty svg {
  display: block;
  margin: 0 auto 8px;
  color: #d1d5db;
}

/* Suggestion Item */
.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.suggestion-item:hover {
  background: #F9FAFB;
}

.suggestion-item.selected {
  background: rgba(99, 102, 241, 0.08);
}

.suggestion-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid #D1D5DB;
  border-radius: 4px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.suggestion-item.selected .suggestion-checkbox {
  background: #6366f1;
  border-color: #6366f1;
}

.suggestion-checkbox svg {
  opacity: 0;
  color: #fff;
  transition: opacity 0.1s ease;
}

.suggestion-item.selected .suggestion-checkbox svg {
  opacity: 1;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-question {
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  word-wrap: break-word;
}

.suggestion-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
}

.suggestion-source svg {
  width: 10px;
  height: 10px;
}

/* Popover Footer */
.suggest-popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #F3F4F6;
  background: #FAFAFA;
}

.suggest-popover-footer .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.suggest-popover-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.suggest-popover-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 12px;
}

.suggest-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #E5E7EB;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.suggest-loading-text {
  font-size: 13px;
  color: #6b7280;
}

/* Section Reference Tag in User Inputs */
.user-input-section-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.user-input-section-ref {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 10px;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 3px;
}

.user-input-section-ref svg {
  width: 10px;
  height: 10px;
}

/* ===== Section Actions Row ===== */

.section-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-question-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-actions-row .ai-mode-toggle-row {
  margin: 0;
}

.add-question-container {
  position: relative;
  display: inline-block;
}

.btn-add-question-section {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #323232;
  background: rgba(50, 50, 50, 0.13);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-question-section:hover {
  background: rgba(50, 50, 50, 0.18);
}

.btn-add-question-section:active {
  background: rgba(50, 50, 50, 0.22);
}

.btn-add-question-section svg {
  color: #323232;
}

/* Add Question Popover */
.add-question-popover {
  position: fixed;
  width: 360px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
}

.add-question-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F3F4F6;
}

.add-question-popover-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.add-question-popover-close {
  padding: 4px;
  color: #9ca3af;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.add-question-popover-close:hover {
  background: #F3F4F6;
  color: #6b7280;
}

.add-question-popover-body {
  padding: 16px;
}

.add-question-popover-body .form-label {
  margin-bottom: 6px;
}

.add-question-popover-body .form-help-message {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.add-question-input {
  width: 100%;
  resize: vertical;
  min-height: 60px;
}

.add-question-popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #F3F4F6;
  background: #FAFAFA;
}

.add-question-popover-footer .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.add-question-popover-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
