@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/**
 * AI Agents - Stylesheet
 * Ndovesha PromptKit
 */

/* Feature Announcement Banner - Creative Card Layout */
.feature-banner {
  position: relative;
  background: linear-gradient(135deg, #FEBF0F 0%, #FEBF0F 40%, #FFD54F 100%);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px auto 0;
  max-width: 900px;
  width: calc(100% - 32px);
  overflow: hidden;
  border: 1.5px solid #003366;
  box-shadow: 
    0 4px 16px rgba(0, 51, 102, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
}
.feature-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 12px 12px 0 0;
}
.feature-banner__content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}
.feature-banner__badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(145deg, #003366 0%, #004d99 100%);
  padding: 6px 12px;
  border-radius: 18px;
  box-shadow: 0 3px 10px rgba(0, 51, 102, 0.4);
  animation: badge-bounce 1.5s ease-in-out infinite;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.feature-banner__badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: badge-shimmer 2s ease-in-out infinite;
}
@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes badge-shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}
.feature-banner__badge-icon {
  font-size: 1rem;
}
.feature-banner__badge-text {
  font-size: 0.7rem;
  font-weight: 800;
  font-family: 'Ubuntu', sans-serif;
  color: #ffffff;
  letter-spacing: 1px;
  text-transform: uppercase;
}
/* Showcase banner layout */
.feature-banner__showcase {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.feature-banner__mini-slides {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.mini-slide {
  width: 32px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  animation: miniSlideFloat 3s ease-in-out infinite;
}
.mini-slide--1 {
  background: linear-gradient(135deg, #003366 60%, #FEBF0F 60%);
  animation-delay: 0s;
}
.mini-slide--2 {
  background: linear-gradient(135deg, #004d99 0%, #0066cc 100%);
  transform: translateY(-2px);
  animation-delay: 0.4s;
}
.mini-slide--3 {
  background: linear-gradient(135deg, #FEBF0F 40%, #003366 40%);
  animation-delay: 0.8s;
}
@keyframes miniSlideFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.feature-banner__info {
  flex: 1;
  min-width: 0;
}
.feature-banner__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: 'Ubuntu', sans-serif;
  color: #003366;
  letter-spacing: -0.01em;
}
.feature-banner__subtitle {
  display: block;
  font-size: 0.78rem;
  font-family: 'Ubuntu', sans-serif;
  color: rgba(0, 51, 102, 0.85);
  line-height: 1.3;
}
.feature-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Ubuntu', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, #003366 0%, #004d99 100%);
  color: #FEBF0F;
  border: 1px solid rgba(0, 51, 102, 0.3);
  box-shadow: 0 3px 12px rgba(0, 51, 102, 0.3);
  transition: all 0.25s ease;
}
.feature-banner__cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 51, 102, 0.4);
  background: linear-gradient(135deg, #004080 0%, #0055aa 100%);
}
.feature-banner__cta svg {
  fill: #FEBF0F;
  stroke: #FEBF0F;
}
.feature-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
}
.feature-highlight__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.feature-highlight__text {
  line-height: 1.4;
}
.feature-highlight__text strong {
  color: #FFD700;
  font-weight: 700;
}
.feature-highlight__text code {
  background: rgba(255, 215, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.85em;
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.feature-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.feature-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.feature-banner__btn--primary {
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
  color: #1a1a1a;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5), 0 0 30px rgba(255, 140, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.feature-banner__btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 140, 0, 0.3);
}
.feature-banner__btn--secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}
.feature-banner__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.feature-banner__dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #003366;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.4);
}
.feature-banner__dismiss svg {
  width: 12px;
  height: 12px;
}
.feature-banner__dismiss:hover {
  background: #002244;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 51, 102, 0.5);
}
/* Dark mode adjustments */
[data-theme="dark"] .feature-banner {
  background: linear-gradient(135deg, #FEBF0F 0%, #FEBF0F 40%, #FFD54F 100%);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}
@media (max-width: 700px) {
  .feature-banner {
    padding: 12px;
    padding-top: 36px;
  }
  .feature-banner__content {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .feature-banner__badge {
    position: absolute;
    top: 10px;
    left: 12px;
    padding: 6px 12px;
  }
  .feature-banner__showcase {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .feature-banner__mini-slides {
    justify-content: center;
  }
  .feature-banner__cta {
    padding: 8px 20px;
    font-size: 0.75rem;
  }
  .feature-banner__dismiss {
    top: 8px;
    right: 8px;
  }
}

:root {
  --primary: #003366;
  --accent: #FEBF0F;
  --accent-hover: #e6a600;
  --bg: #EEF2F5;
  --text: #003366;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --field-bg: #f1f5f9;
  --border: rgba(0, 0, 0, 0.08);
  --success: #10b981;
  --error: #dc2626;
  --sidebar-bg: #f8fafc;
  --input-bg: #ffffff;
  --message-user-bg: rgba(254, 191, 15, 0.15);
  --message-ai-bg: #ffffff;
  /* Thin navy→gold accents (sidebar + profile menu) */
  --agents-hairline: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 51, 102, 0.09) 18%,
    rgba(254, 191, 15, 0.28) 50%,
    rgba(0, 51, 102, 0.09) 82%,
    transparent 100%
  );
  --agents-frame: linear-gradient(
    135deg,
    rgba(0, 51, 102, 0.16) 0%,
    rgba(0, 100, 200, 0.12) 38%,
    rgba(254, 191, 15, 0.24) 72%,
    rgba(255, 216, 77, 0.18) 100%
  );
  --agents-frame-hover: linear-gradient(
    135deg,
    rgba(0, 51, 102, 0.22) 0%,
    rgba(0, 100, 200, 0.16) 40%,
    rgba(254, 191, 15, 0.3) 72%,
    rgba(255, 216, 77, 0.24) 100%
  );
  --agents-published-fill: linear-gradient(
    90deg,
    rgba(0, 51, 102, 0.07) 0%,
    rgba(226, 235, 245, 0.88) 42%,
    rgba(255, 248, 228, 0.98) 100%
  );
  --agents-edge-v: linear-gradient(
    180deg,
    rgba(0, 51, 102, 0.1) 0%,
    rgba(254, 191, 15, 0.2) 48%,
    rgba(0, 100, 200, 0.09) 100%
  );
}

/* Dark Mode - True dark theme */
[data-theme="dark"] {
  --primary: #FEBF0F;
  --accent: #FEBF0F;
  --accent-hover: #e6a600;
  --bg: #121212;
  --text: #f5f5f5;
  --text-muted: #a0a0a0;
  --card-bg: #1e1e1e;
  --field-bg: #2a2a2a;
  --border: rgba(255, 255, 255, 0.12);
  --sidebar-bg: #1a1a1a;
  --input-bg: #2a2a2a;
  --message-user-bg: rgba(254, 191, 15, 0.15);
  --message-ai-bg: #1e1e1e;
  --agents-hairline: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 100, 160, 0.22) 20%,
    rgba(254, 191, 15, 0.4) 50%,
    rgba(0, 100, 160, 0.22) 80%,
    transparent 100%
  );
  --agents-frame: linear-gradient(
    135deg,
    rgba(26, 95, 168, 0.48) 0%,
    rgba(59, 141, 224, 0.28) 35%,
    rgba(254, 191, 15, 0.38) 68%,
    rgba(255, 216, 77, 0.3) 100%
  );
  --agents-frame-hover: linear-gradient(
    135deg,
    rgba(32, 112, 192, 0.55) 0%,
    rgba(74, 154, 240, 0.34) 35%,
    rgba(254, 191, 15, 0.45) 68%,
    rgba(255, 216, 77, 0.36) 100%
  );
  --agents-published-fill: linear-gradient(
    90deg,
    rgba(26, 95, 168, 0.22) 0%,
    rgba(45, 58, 78, 0.72) 42%,
    rgba(254, 191, 15, 0.14) 100%
  );
  --agents-edge-v: linear-gradient(
    180deg,
    rgba(0, 90, 150, 0.28) 0%,
    rgba(254, 191, 15, 0.34) 48%,
    rgba(40, 130, 210, 0.22) 100%
  );
}

.dark-mode {
  --agents-published-fill: linear-gradient(
    90deg,
    rgba(26, 95, 168, 0.22) 0%,
    rgba(45, 58, 78, 0.72) 42%,
    rgba(254, 191, 15, 0.14) 100%
  );
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg);
}

[data-theme="dark"] .hero-input,
[data-theme="dark"] .chat-input {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .hero-input::placeholder,
[data-theme="dark"] .chat-input::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] .agent-dropdown {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .agent-dropdown-item:hover {
  background: rgba(254, 191, 15, 0.1);
}

[data-theme="dark"] .message-bubble.user {
  background: var(--message-user-bg);
}

[data-theme="dark"] .message-bubble.assistant {
  background: var(--message-ai-bg);
  border-color: var(--border);
}

[data-theme="dark"] .agent-pill-icon {
  border: 2px solid transparent;
  background-image:
    linear-gradient(var(--card-bg, #1e1e2e), var(--card-bg, #1e1e2e)),
    linear-gradient(135deg, #1a5fa8 0%, #3b8de0 40%, #FEBF0F 70%, #FFD84D 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 2px 8px rgba(60, 140, 255, 0.14),
    0 8px 28px rgba(30, 100, 220, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(60, 140, 255, 0.06);
}

[data-theme="dark"] .agent-pill:hover .agent-pill-icon {
  background-image:
    linear-gradient(var(--card-bg, #1e1e2e), var(--card-bg, #1e1e2e)),
    linear-gradient(135deg, #2070c0 0%, #4a9af0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 3px rgba(60, 140, 255, 0.10),
    0 4px 16px rgba(60, 140, 255, 0.20),
    0 12px 36px rgba(30, 100, 220, 0.12),
    0 0 20px rgba(254, 191, 15, 0.12),
    0 0 32px rgba(80, 160, 255, 0.08);
}

[data-theme="dark"] .agent-pill.active .agent-pill-icon {
  background-image:
    linear-gradient(var(--card-bg, #1e1e2e), var(--card-bg, #1e1e2e)),
    linear-gradient(135deg, #2070c0 0%, #4a9af0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 2px rgba(60, 140, 255, 0.14),
    0 4px 20px rgba(30, 100, 220, 0.18),
    0 0 22px rgba(254, 191, 15, 0.14);
}

[data-theme="dark"] .hero-input-wrapper {
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), linear-gradient(135deg, #1a5fa8 0%, #3b8de0 40%, #FEBF0F 70%, #FFD84D 100%);
  box-shadow: 
    0 2px 8px rgba(60, 140, 255, 0.14),
    0 8px 28px rgba(30, 100, 220, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(60, 140, 255, 0.06);
}
[data-theme="dark"] .hero-input-wrapper:focus-within {
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), linear-gradient(135deg, #2070c0 0%, #4a9af0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow: 
    0 0 0 3px rgba(60, 140, 255, 0.10),
    0 4px 16px rgba(60, 140, 255, 0.20),
    0 12px 36px rgba(30, 100, 220, 0.12),
    0 0 20px rgba(254, 191, 15, 0.12),
    0 0 32px rgba(80, 160, 255, 0.08);
}
[data-theme="dark"] .chat-input-container {
  background: var(--card-bg);
  z-index: 35;
}

/* Session composer — same premium gradient border language as .hero-input-wrapper */
[data-theme="dark"] .chat-input-wrapper,
.dark-mode .chat-input-wrapper {
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), linear-gradient(135deg, #1a5fa8 0%, #3b8de0 40%, #FEBF0F 70%, #FFD84D 100%);
  box-shadow:
    0 2px 8px rgba(60, 140, 255, 0.14),
    0 8px 28px rgba(30, 100, 220, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(60, 140, 255, 0.06);
}

[data-theme="dark"] .chat-input-wrapper:focus-within,
.dark-mode .chat-input-wrapper:focus-within {
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), linear-gradient(135deg, #2070c0 0%, #4a9af0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 3px rgba(60, 140, 255, 0.10),
    0 4px 16px rgba(60, 140, 255, 0.20),
    0 12px 36px rgba(30, 100, 220, 0.12),
    0 0 20px rgba(254, 191, 15, 0.12),
    0 0 32px rgba(80, 160, 255, 0.08);
}

[data-theme="dark"] .session-item:hover {
  background: rgba(254, 191, 15, 0.1);
}

[data-theme="dark"] .session-item.active {
  background: rgba(254, 191, 15, 0.15);
}

/* ============================================================================
   DARK MODE - Comprehensive styling for all elements
   ============================================================================ */

/* New Chat button */
[data-theme="dark"] .new-chat-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #e6a600 100%);
  color: #121212 !important;
}
[data-theme="dark"] .new-chat-btn:hover {
  background: linear-gradient(135deg, #FFD84D 0%, var(--accent) 100%);
}
[data-theme="dark"] .new-chat-btn svg {
  color: #121212;
}

/* Send buttons */
[data-theme="dark"] .hero-send-btn,
[data-theme="dark"] .send-btn {
  background: var(--accent);
  color: #121212;
}
[data-theme="dark"] .hero-send-btn:hover,
[data-theme="dark"] .send-btn:hover {
  background: var(--accent-hover);
}

/* Upload/attach buttons */
[data-theme="dark"] .hero-upload-btn,
[data-theme="dark"] .attach-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .hero-upload-btn:hover,
[data-theme="dark"] .attach-btn:hover {
  color: var(--accent);
  background: rgba(254, 191, 15, 0.1);
}

/* Sidebar elements */
[data-theme="dark"] .sidebar-search-input {
  background: var(--field-bg);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .sidebar-search-input::placeholder {
  color: var(--text-muted);
}
[data-theme="dark"] .sidebar-search svg {
  color: var(--text-muted);
}

[data-theme="dark"] .sidebar-search-bar,
.dark-mode .sidebar-search-bar {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)),
    var(--agents-frame);
}

[data-theme="dark"] .sidebar-search-bar:focus-within,
.dark-mode .sidebar-search-bar:focus-within {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.08), rgba(254, 191, 15, 0.08)),
    var(--agents-frame-hover);
  box-shadow: 0 0 0 1px rgba(254, 191, 15, 0.12);
}

[data-theme="dark"] .sidebar-quick-link {
  color: var(--text);
}
[data-theme="dark"] .sidebar-quick-link:hover {
  background-color: rgba(254, 191, 15, 0.15);
}

[data-theme="dark"] .sidebar-quick-link:not(:last-child):not(.workspace-brand-switcher):hover {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.15), rgba(254, 191, 15, 0.15)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}
[data-theme="dark"] .sidebar-section-title {
  color: var(--text-muted);
}
[data-theme="dark"] .session-title {
  color: var(--text);
}
[data-theme="dark"] .session-time {
  color: var(--text-muted);
}
[data-theme="dark"] .session-delete-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .session-delete-btn:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.1);
}

/* Chat header — dark */
[data-theme="dark"] .chat-header {
  background: linear-gradient(180deg, #1e2130 0%, #1a1c28 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.35),
    inset 0 -1px 0 rgba(254, 191, 15, 0.28);
}

[data-theme="dark"] .current-agent-icon {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .current-agent-name {
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .change-agent-btn {
  background: var(--card-bg);
  color: var(--text);
  border-color: rgba(254, 191, 15, 0.45);
}
[data-theme="dark"] .change-agent-btn:hover {
  background: rgba(254, 191, 15, 0.1);
  border-color: rgba(255, 216, 77, 0.75);
}
[data-theme="dark"] .change-agent-btn:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.95);
  outline-offset: 2px;
}

/* Agent dropdown */
[data-theme="dark"] .agent-dropdown-name {
  color: var(--text);
}
[data-theme="dark"] .agent-dropdown-item.coming-soon .agent-dropdown-name {
  color: var(--text-muted);
}

/* Hero section */
[data-theme="dark"] .hero-title {
  color: var(--text);
}
[data-theme="dark"] .hero-title span {
  color: var(--accent);
}
[data-theme="dark"] .view-all-agents {
  color: var(--accent);
}
[data-theme="dark"] .view-all-agents:hover {
  color: var(--accent-hover);
}

/* Agent pills */
[data-theme="dark"] .agent-pill-name {
  color: var(--text);
}
[data-theme="dark"] .agent-pill.coming-soon .agent-pill-name {
  color: var(--text-muted);
}

/* Messages */
[data-theme="dark"] .message-content {
  color: var(--text);
}
[data-theme="dark"] .message-content p,
[data-theme="dark"] .message-content li {
  color: var(--text);
}
[data-theme="dark"] .message-content code {
  background: var(--field-bg);
  color: var(--accent);
}
[data-theme="dark"] .message-content pre {
  background: #0d0d0d;
  border-color: var(--border);
}
[data-theme="dark"] .message-content pre code {
  color: #e2e8f0;
}

/* Mobile menu button */
[data-theme="dark"] .mobile-menu-btn {
  color: var(--text);
  background: var(--card-bg);
  border-color: var(--border);
}
[data-theme="dark"] .mobile-menu-btn:hover {
  background: rgba(254, 191, 15, 0.1);
}

/* User dropdown */
[data-theme="dark"] .sidebar-user-dropdown,
.dark-mode .sidebar-user-dropdown {
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--card-bg), var(--card-bg)),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
[data-theme="dark"] .sidebar-user-dropdown a,
[data-theme="dark"] .sidebar-user-dropdown button {
  color: var(--text);
}
[data-theme="dark"] .sidebar-user-dropdown a:hover,
[data-theme="dark"] .sidebar-user-dropdown button:hover {
  background: rgba(254, 191, 15, 0.1);
}

/* Usage stats */
[data-theme="dark"] .usage-stats {
  background: var(--card-bg);
  border-color: var(--border);
}
[data-theme="dark"] .usage-label {
  color: var(--text-muted);
}
[data-theme="dark"] .usage-count {
  color: var(--text);
}

/* Toasts */
[data-theme="dark"] .toast {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--field-bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Share button */
[data-theme="dark"] .share-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .share-btn:hover {
  color: var(--accent);
}

/* Chat header share stays primary (global dark rule above targets legacy uses) */
[data-theme="dark"] .chat-header .share-btn {
  color: #fff;
}
[data-theme="dark"] .chat-header .share-btn:hover {
  color: #fff;
}

/* Collapsed sidebar buttons */
[data-theme="dark"] .collapsed-action-btn {
  color: var(--accent);
}
[data-theme="dark"] .collapsed-action-btn.collapsed-new-chat {
  background: linear-gradient(135deg, var(--accent) 0%, #e6a600 100%);
}
[data-theme="dark"] .collapsed-action-btn.collapsed-new-chat svg {
  color: #121212;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 20% Discount Banner */
.discount-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #003366 0%, #004080 100%);
  color: white;
  padding: 12px 20px;
  box-shadow: 0 2px 12px rgba(0, 51, 102, 0.3), 0 3px 0 0 rgba(254, 191, 15, 0.5), 0 4px 12px rgba(254, 191, 15, 0.2);
  border-bottom: 1.5px solid rgba(254, 191, 15, 0.45);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.discount-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.discount-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(254, 191, 15, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
}

.discount-banner-icon svg {
  color: var(--accent);
}

.discount-banner-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  min-width: 250px;
}

.discount-banner-text strong {
  font-weight: 700;
  color: var(--accent);
}

.discount-highlight {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.discount-banner-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(254, 191, 15, 0.2);
  font-family: 'Ubuntu Mono', monospace;
  white-space: nowrap;
}

.discount-banner-timer .timer-label {
  font-size: 11px;
  font-family: 'Ubuntu', sans-serif;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-right: 4px;
  font-weight: 500;
}

.discount-banner-timer .timer-block {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.discount-banner-timer .timer-block span {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

.discount-banner-timer .timer-block em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-family: 'Ubuntu', sans-serif;
}

.discount-banner-timer .timer-sep {
  color: rgba(254, 191, 15, 0.4);
  font-size: 13px;
  font-weight: 700;
  margin: 0 1px;
}

.discount-banner-cta {
  padding: 8px 20px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.discount-banner-cta:hover {
  background: #ffc933;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

.discount-banner-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.discount-banner-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Adjust body padding when banner is visible */
body.has-discount-banner {
  padding-top: 60px;
}

body.has-discount-banner .sidebar {
  top: 60px;
  height: calc(100vh - 60px);
}

body.has-discount-banner .content-wrapper {
  padding-top: 60px;
}

body.has-discount-banner .hero-section {
  padding-top: 8px;
  padding-bottom: 16px;
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .discount-banner {
    padding: 10px 16px;
  }
  
  .discount-banner-content {
    gap: 12px;
  }
  
  .discount-banner-text {
    font-size: 13px;
    min-width: 200px;
  }
  
  .discount-banner-timer {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  .discount-banner-cta {
    padding: 6px 16px;
    font-size: 13px;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.workspace-loading .sidebar-footer,
body.workspace-loading #workspaceSwitcher,
body.workspace-loading #workspaceBrandSwitcherBtn {
  visibility: hidden;
}

/* ============================================================================
   COLLAPSIBLE SIDEBAR - Light Golden/Blue Theme
   ============================================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, #f8f6f1 0%, #fff9eb 100%);
  border-right: 1px solid transparent;
  border-image: var(--agents-edge-v) 1;
  z-index: 100;
  transition: width 0.08s ease;
  box-shadow: 2px 0 12px rgba(0, 51, 102, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: 60px;
  overflow: visible;
}

/* Hide expanded content when collapsed */
.sidebar.collapsed .sidebar-expanded-content,
.sidebar.collapsed .sidebar-chats,
.sidebar.collapsed .sidebar-quick-links {
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  width: 0;
  height: 0;
  pointer-events: none;
  transition: opacity 0.05s ease, visibility 0.05s ease;
}

.sidebar.collapsed .sidebar-user-name {
  display: none;
}

/* Show collapsed actions when collapsed */
.sidebar-collapsed-actions {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: none;
  background: var(--agents-hairline) bottom / 100% 1px no-repeat;
  flex: 0 0 auto;
}

.sidebar.collapsed .sidebar-collapsed-actions {
  display: flex;
}

/* Spacer to push footer to bottom in collapsed mode */
.sidebar.collapsed .sidebar-collapsed-actions ~ .sidebar-footer {
  margin-top: auto;
}

/* Collapsed action buttons */
.collapsed-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.collapsed-action-btn:hover {
  background: rgba(254, 191, 15, 0.15);
}

.collapsed-action-btn.collapsed-new-chat {
  background: linear-gradient(135deg, var(--accent) 0%, #FFD84D 100%);
  box-shadow: 0 2px 8px rgba(254, 191, 15, 0.3);
}

.collapsed-action-btn.collapsed-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

/* Collapsed footer */
.sidebar.collapsed .sidebar-footer {
  padding: 10px 8px;
}

/* Hide text labels in collapsed footer — show only icons */
.sidebar.collapsed .sidebar-footer-links .sidebar-quick-link span,
.sidebar.collapsed .sidebar-credits-display span {
  display: none;
}

.sidebar.collapsed .sidebar-footer-links {
  align-items: center;
  padding: 4px 0;
  border-bottom: none;
}

.sidebar.collapsed .sidebar-credits-display {
  justify-content: center;
  padding: 6px 0;
  /* Allow hover tooltip (base row uses pointer-events: none) */
  pointer-events: auto;
  cursor: default;
}

.sidebar.collapsed .sidebar-footer-links .sidebar-quick-link {
  justify-content: center;
  width: 40px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  position: relative;
}

/* Tooltip on hover for collapsed sidebar footer items */
.sidebar.collapsed .sidebar-footer-links .sidebar-quick-link:hover::after,
.sidebar.collapsed .sidebar-credits-display:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #003366;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 12px;
  border-radius: 6px;
  max-width: calc(100vw - 72px);
  white-space: nowrap;
  text-align: left;
  z-index: 10050;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(254, 191, 15, 0.25);
}

[data-theme="dark"] .sidebar.collapsed .sidebar-footer-links .sidebar-quick-link:hover::after,
[data-theme="dark"] .sidebar.collapsed .sidebar-credits-display:hover::after {
  background: #0f2744;
  color: #f8fafc;
  border-color: rgba(254, 191, 15, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.sidebar.collapsed .sidebar-credits-display {
  position: relative;
}

/* Hide collapsed footer separator lines */
.sidebar.collapsed .sidebar-footer-links .sidebar-quick-link:not(:last-child) {
  border-bottom: none;
}

.sidebar.collapsed .sidebar-user-btn {
  justify-content: center;
  padding: 8px;
}

.sidebar.collapsed .sidebar-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* Collapsed dropdown opens to the right */
.sidebar.collapsed .sidebar-user-dropdown {
  bottom: 0;
  left: 60px;
  right: auto;
  min-width: 220px;
}

/* Toggle Row - Always visible */
.sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: none;
  background: var(--agents-hairline) bottom / 100% 1px no-repeat;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-toggle-row {
  justify-content: center;
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.sidebar-logo:hover {
  opacity: 1;
}

.sidebar-logo img {
  height: 18px;
  width: auto;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar-toggle-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: rgba(0, 51, 102, 0.1);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(254, 191, 15, 0.15);
}

.sidebar.collapsed .theme-toggle {
  display: none;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(254, 191, 15, 0.15);
  color: var(--primary);
}

/* Mobile close button - hidden on desktop */
.mobile-sidebar-close {
  display: none;
}

/* Mobile header - hidden on desktop */
.mobile-header {
  display: none;
  box-sizing: border-box;
}

.mobile-header > a {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.mobile-header .mobile-logo {
  height: 24px;
  width: auto;
  max-width: min(200px, 52vw);
  object-fit: contain;
  display: block;
}

/* Toggle button icon states */
.sidebar-toggle .toggle-ndovesha-icon {
  display: none;
}

.sidebar-toggle .toggle-expand-icon {
  display: block;
}

/* When collapsed: show Ndovesha icon, show expand on hover */
.sidebar.collapsed .sidebar-toggle .toggle-ndovesha-icon {
  display: block;
}

.sidebar.collapsed .sidebar-toggle .toggle-expand-icon {
  display: none;
}

.sidebar.collapsed .sidebar-toggle:hover .toggle-ndovesha-icon {
  display: none;
}

.sidebar.collapsed .sidebar-toggle:hover .toggle-expand-icon {
  display: block;
}

/* Expanded Content Container */
.sidebar-expanded-content {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  opacity: 1;
  visibility: visible;
  transition: none;
}

/* New Chat Row */
.sidebar-new-chat-row {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(254, 191, 15, 0.15);
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #FFD84D 100%);
  border: none;
  border-radius: 6px;
  color: var(--primary);
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(254, 191, 15, 0.2);
}

.new-chat-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

/* Sidebar Search (legacy) */
.sidebar-search {
  display: none;
}

/* Always-visible search bar above YOUR CHATS */
.sidebar-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 10px 1px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: background-image 0.2s, box-shadow 0.2s;
  height: 28px;
  background-image:
    linear-gradient(rgba(0, 51, 102, 0.04), rgba(0, 51, 102, 0.04)),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.sidebar-search-bar:focus-within {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.05), rgba(254, 191, 15, 0.05)),
    var(--agents-frame-hover);
  box-shadow: 0 0 0 1px rgba(254, 191, 15, 0.08);
}

.sidebar-search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-search-bar .sidebar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 11.5px;
  outline: none;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
}

.sidebar-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.sidebar-search-input {
  flex: 1;
  background: white;
  border: 1px solid rgba(0, 51, 102, 0.1);
  border-radius: 5px;
  padding: 5px 8px;
  height: 28px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  font-family: 'Ubuntu', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search-input:focus {
  border-color: var(--accent);
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

/* Sidebar Footer Links (credits + refer) */
.sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0px 10px 4px 10px;
  border-top: none;
  border-bottom: none;
  background:
    var(--agents-hairline) top / 100% 1px no-repeat,
    var(--agents-hairline) bottom / 100% 1px no-repeat;
}

.sidebar-footer-links .sidebar-quick-link:not(:last-child) {
  border-bottom: none;
  border-radius: 0;
}

.sidebar-footer-links .sidebar-quick-link:last-child {
  border-radius: 0 0 5px 5px;
}

.sidebar-footer-links .sidebar-quick-link:first-child {
  border-radius: 5px 5px 0 0;
}

/* Remaining Credits static display row */
.sidebar-credits-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  font-family: inherit;
  pointer-events: none;
  user-select: none;
}

.sidebar-credits-display svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-credits-display.warning,
.sidebar-credits-display.warning svg {
  color: #ef4444;
}

/* Sidebar Quick Links */
.sidebar-quick-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 10px;
  border-bottom: none;
  background: var(--agents-hairline) bottom / 100% 1px no-repeat;
}

.sidebar-quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-quick-link svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.2s;
}

.sidebar-quick-link:hover {
  background-color: rgba(254, 191, 15, 0.1);
  border-color: transparent;
}

.sidebar-quick-link:not(:last-child):not(.workspace-brand-switcher):hover {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.1), rgba(254, 191, 15, 0.1)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}

.sidebar-quick-link:hover svg {
  color: var(--accent);
}

.sidebar-quick-link > span:not(.sidebar-new-badge) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-new-badge {
  flex-shrink: 0;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  line-height: 1;
  background: linear-gradient(135deg, #003366 0%, #0a4d8c 55%, #0055a5 100%);
  box-shadow:
    0 0 0 1px rgba(254, 191, 15, 0.45) inset,
    0 2px 6px rgba(0, 51, 102, 0.28);
}

[data-theme='dark'] .sidebar-new-badge,
.dark-mode .sidebar-new-badge {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  box-shadow:
    0 0 0 1px rgba(254, 191, 15, 0.35) inset,
    0 2px 8px rgba(0, 0, 0, 0.35);
}

.workspace-brand-switcher {
  border: 1px solid transparent;
  background-image:
    linear-gradient(135deg, rgba(0, 51, 102, 0.08) 0%, rgba(0, 51, 102, 0.03) 100%),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 1px 2px rgba(0, 51, 102, 0.1);
  position: relative;
}

.sidebar-quick-link.workspace-brand-switcher svg {
  color: #003366;
}

.sidebar-quick-link.workspace-brand-switcher span {
  color: #003366;
  font-weight: 600;
}

.sidebar-quick-link.workspace-brand-switcher:hover {
  background-image:
    linear-gradient(135deg, rgba(0, 51, 102, 0.12) 0%, rgba(0, 51, 102, 0.05) 100%),
    var(--agents-frame-hover);
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.18);
}

.sidebar-quick-link.workspace-brand-switcher:hover svg {
  color: #002244;
}

.sidebar-quick-link.workspace-brand-switcher:hover span {
  color: #002244;
}

.workspace-brand-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 4px;
  background-image:
    linear-gradient(#fff, #fff),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.12);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 120ms ease;
}

.workspace-brand-menu.show {
  opacity: 1;
  transform: translateY(0);
}

.workspace-brand-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  text-align: left;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.workspace-brand-menu-item:hover {
  background: rgba(0, 51, 102, 0.06);
}

.workspace-brand-menu-item.active {
  background: rgba(254, 191, 15, 0.18);
  color: var(--primary);
  font-weight: 600;
}

/* Credits link — always golden */
.sidebar-credits-link,
.sidebar-credits-link span {
  color: #FEBF0F !important;
}

.sidebar-credits-link svg {
  color: #FEBF0F !important;
}

.sidebar-credits-link:hover {
  background: rgba(254, 191, 15, 0.15) !important;
  border-color: rgba(254, 191, 15, 0.4) !important;
}

/* Warning state overrides golden with red when credits low */
.sidebar-credits-link.warning,
.sidebar-credits-link.warning span {
  color: #ef4444 !important;
}

.sidebar-credits-link.warning svg {
  color: #ef4444 !important;
}

[data-theme="dark"] .sidebar-credits-link.warning,
[data-theme="dark"] .sidebar-credits-link.warning span {
  color: #f87171 !important;
}

[data-theme="dark"] .sidebar-credits-link.warning svg {
  color: #f87171 !important;
}

/* Thin separator lines between quick link items (skip brand switcher — it keeps full frame border) */
.sidebar-quick-link:not(:last-child):not(.workspace-brand-switcher) {
  border-bottom: none;
  border-radius: 0;
  background-image: var(--agents-hairline);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}

.sidebar-quick-link:last-child {
  border-radius: 0 0 5px 5px;
}

.sidebar-quick-link:first-child {
  border-radius: 5px 5px 0 0;
}


/* Chat History Section */
.sidebar-chats {
  flex: 0 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 8px;
  padding-bottom: 4px;
  opacity: 1;
  visibility: visible;
  transition: none;
}

.sidebar-chats::-webkit-scrollbar {
  width: 6px;
}

.sidebar-chats::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-chats::-webkit-scrollbar-thumb {
  background: rgba(0, 51, 102, 0.15);
  border-radius: 3px;
}

.sidebar-section-title {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.no-chats-msg {
  color: var(--text-muted);
  text-align: center;
  padding: 20px 12px;
  font-size: 11px;
  line-height: 1.4;
}

.sessions-show-more-btn {
  display: block;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  border-top: 1px solid rgba(254, 191, 15, 0.2);
  color: var(--accent);
  font-size: 11px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
}

.session-item {
  display: flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
  transition: background 0.15s;
  position: relative;
}

.session-item:hover {
  background: rgba(254, 191, 15, 0.1);
}

.session-item.active {
  background: rgba(254, 191, 15, 0.2);
  border-left: 3px solid var(--accent);
}

.session-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
}

.session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--primary);
  flex: 1;
  min-width: 0;
}

.session-meta {
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.session-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  background: linear-gradient(90deg, transparent, #fff9eb 30%);
  padding-left: 20px;
}

.session-item:hover .session-actions {
  opacity: 1;
}

.session-action-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.session-action-btn:hover {
  background: var(--field-bg);
}

.session-action-btn.delete:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* Sidebar Footer - User Section */
.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
  border-top: none;
  padding: 2px 6px;
  background: linear-gradient(180deg, #f8f6f1 0%, #fff9eb 100%);
  box-sizing: border-box;
}

/* Sidebar Upgrade Button */
.sidebar-upgrade-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: calc(100% - 12px);
  margin: 6px 6px 8px 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, rgba(0, 51, 102, 0.9) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.15);
}

.sidebar-upgrade-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.95) 0%, rgba(0, 51, 102, 0.85) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 51, 102, 0.25);
}

.sidebar.collapsed .sidebar-upgrade-btn {
  display: none !important;
}

/* Sidebar Manage Plan Button (paid users — subtle style) */
.sidebar-manage-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: calc(100% - 12px);
  margin: 4px 6px 6px 6px;
  padding: 6px 12px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Ubuntu', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  background-image:
    linear-gradient(transparent, transparent),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.sidebar-manage-btn svg {
  width: 14px;
  height: 14px;
}

.sidebar-manage-btn:hover {
  color: var(--text);
  background-image:
    linear-gradient(var(--field-bg), var(--field-bg)),
    var(--agents-frame-hover);
}

.sidebar.collapsed .sidebar-manage-btn {
  display: none !important;
}

/* Expired plan state on the Manage Plan button */
.sidebar-manage-btn.plan-expired {
  border: 1px solid #ef4444;
  background-image: none;
  color: #ef4444;
}

.sidebar-manage-btn.plan-expired:hover {
  background-color: rgba(239, 68, 68, 0.06);
  background-image: none;
  border-color: #dc2626;
  color: #dc2626;
}

.plan-expired-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: #ef4444;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
  line-height: 1.6;
}

.sidebar.collapsed .sidebar-footer {
  width: 60px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(254, 191, 15, 0.3);
  background: white;
  color: var(--primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.1);
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(254, 191, 15, 0.1);
}

.sidebar-user {
  position: relative;
}

.sidebar-user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user-btn:hover {
  background: rgba(254, 191, 15, 0.1);
}

.sidebar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #004080 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-name {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  font-family: 'Ubuntu', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* User Dropdown */
.sidebar-user-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  right: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 51, 102, 0.15);
  border: 1px solid transparent;
  background-image:
    linear-gradient(#fff, #fff),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 200;
  overflow: hidden;
}

.sidebar-user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-user-info {
  padding: 14px 16px;
  background-color: var(--field-bg);
  background-image: var(--agents-hairline);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
  border-bottom: none;
}

.dropdown-user-name {
  display: block;
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

.dropdown-user-email {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--agents-hairline);
}

.usage-indicator-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 13px;
  background: rgba(254, 191, 15, 0.08);
}

.usage-indicator-sidebar svg {
  color: var(--accent);
}

.dropdown-item,
button.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(0, 51, 102, 0.05);
}

.dropdown-item svg {
  opacity: 0.7;
  stroke: var(--primary);
}

.dropdown-item.logout {
  color: #dc2626;
}

.dropdown-item.logout:hover {
  background: rgba(220, 38, 38, 0.08);
}

.dropdown-item.logout svg {
  stroke: #dc2626;
}

/* Google Drive — chat asset row */
.gdrive-asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  align-items: center;
}

/* Same row as Download / Share on generated images & videos */
.gdrive-asset-actions--inline {
  display: inline-flex;
  flex-wrap: nowrap;
  margin-top: 0;
  width: auto;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: stretch;
  align-self: flex-end;
  gap: 6px;
}

.image-actions-row--has-drive {
  align-items: flex-end;
  flex-wrap: wrap;
  row-gap: 6px;
}

.video-actions-row--has-drive {
  align-items: flex-end;
  flex-wrap: wrap;
  row-gap: 8px;
}

/* `.img-btn` uses display:flex — must not override the HTML `hidden` attribute */
.gdrive-asset-actions .gdrive-chip[hidden],
.gdrive-asset-actions .gdrive-btn-save[hidden],
.gdrive-asset-actions .gdrive-btn-open[hidden] {
  display: none !important;
}

.gdrive-asset-actions--saved .gdrive-btn-save {
  display: none !important;
}

.gdrive-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px !important;
  border-radius: 10px;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: 'Ubuntu', system-ui, sans-serif !important;
  border: 1px solid transparent;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%) padding-box,
    linear-gradient(125deg, rgba(254, 191, 15, 0.55) 0%, rgba(0, 51, 102, 0.2) 55%, rgba(254, 191, 15, 0.4) 100%) border-box;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 8px rgba(0, 51, 102, 0.08);
  color: var(--primary, #003366) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: box-shadow 0.15s ease, transform 0.12s ease, filter 0.12s ease;
}

[data-theme='dark'] .gdrive-chip,
.dark-mode .gdrive-chip {
  background-image:
    linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.92) 100%) padding-box,
    linear-gradient(125deg, rgba(254, 191, 15, 0.45) 0%, rgba(59, 130, 246, 0.25) 100%) border-box;
  color: #e2e8f0 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 12px rgba(0, 0, 0, 0.35);
}

.gdrive-chip:hover:not(:disabled) {
  filter: brightness(1.03);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 4px 14px rgba(0, 51, 102, 0.12);
}

.gdrive-chip:active:not(:disabled) {
  transform: scale(0.98);
}

.gdrive-chip--busy {
  opacity: 0.88;
  pointer-events: none;
}

.gdrive-chip__drive-icon {
  flex-shrink: 0;
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.gdrive-chip__label {
  line-height: 1.25;
  white-space: nowrap;
}

a.gdrive-chip.gdrive-btn-open {
  color: var(--primary, #003366) !important;
}

[data-theme='dark'] a.gdrive-chip.gdrive-btn-open,
.dark-mode a.gdrive-chip.gdrive-btn-open {
  color: #e2e8f0 !important;
}

.img-btn--gdrive {
  flex-direction: row !important;
}

.meta-publish-block {
  position: relative;
  width: 100%;
  margin-top: 16px;
  margin-bottom: 4px;
  border-radius: 18px;
  box-sizing: border-box;
  overflow: hidden;
  transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

.meta-publish-block__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary, #003366) 0%, var(--accent, #febf0f) 100%);
  opacity: 0.35;
  filter: blur(14px);
  z-index: 0;
  pointer-events: none;
}

.meta-publish-block__inner {
  position: relative;
  z-index: 1;
  padding: 18px 20px 20px;
  border-radius: 17px;
  border: 1px solid rgba(0, 51, 102, 0.18);
  background: linear-gradient(165deg, #fff 0%, rgba(254, 191, 15, 0.1) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 32px rgba(0, 51, 102, 0.08);
}

.meta-publish-block--hidden {
  display: none !important;
}

.meta-publish-block--done {
  opacity: 0.72;
  pointer-events: none;
}

.meta-publish-block--loading-caption .meta-caption-input {
  opacity: 0.55;
  background-image: linear-gradient(
    90deg,
    rgba(0, 51, 102, 0.04) 0%,
    rgba(254, 191, 15, 0.12) 50%,
    rgba(0, 51, 102, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: meta-caption-shimmer 1.2s ease-in-out infinite;
}

@keyframes meta-caption-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.meta-publish-step {
  margin-bottom: 16px;
}

.meta-publish-step--caption {
  margin-bottom: 14px;
}

.meta-publish-step__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #003366);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-publish-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent, #febf0f);
  background: var(--primary, #003366);
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.25);
}

.meta-publish-step__num--light {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: none;
  margin-right: 4px;
}

.social-channel-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.social-channel-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

.social-channel-empty a {
  color: var(--primary, #003366);
  font-weight: 600;
}

.social-channel-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.social-channel-option:hover:not(.social-channel-option--off) {
  border-color: var(--accent, #febf0f);
}

.social-channel-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary, #003366);
  cursor: pointer;
}

.social-channel-option--on {
  border-color: var(--primary, #003366);
  background: rgba(0, 51, 102, 0.06);
  box-shadow: 0 0 0 1px rgba(0, 51, 102, 0.12);
}

.social-channel-option--off {
  opacity: 0.55;
  cursor: not-allowed;
}

.social-channel-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-channel-option__icon--fb .meta-icon-svg {
  width: 22px;
  height: 22px;
  color: #1877f2;
}

.social-channel-option__icon--ig .meta-icon-svg {
  width: 22px;
  height: 22px;
  color: #c13584;
}

.social-channel-option__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #003366);
  line-height: 1.3;
  min-width: 0;
  word-break: break-word;
}

.meta-caption-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.meta-caption-toolbar__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #003366);
  background: rgba(254, 191, 15, 0.2);
  border: 1px solid rgba(0, 51, 102, 0.15);
}

.meta-caption-toolbar__badge .meta-icon-svg {
  color: var(--primary, #003366);
}

.meta-btn-regenerate-caption {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #334155;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.meta-btn-regenerate-caption:hover:not(:disabled) {
  border-color: var(--primary, #003366);
  color: var(--primary, #003366);
  background: rgba(254, 191, 15, 0.12);
}

.meta-btn-regenerate-caption:disabled,
.meta-btn-regenerate-caption--busy {
  opacity: 0.65;
  cursor: wait;
}

.meta-caption-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
}

.meta-caption-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin-bottom: 8px;
}

.meta-caption-hint {
  font-weight: 400;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.meta-icon-svg--sm {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.meta-caption-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  font-family: inherit;
  color: var(--text, #1a1a1a);
  background: #fff;
  box-sizing: border-box;
  margin-bottom: 0;
}

.meta-caption-input:focus {
  outline: none;
  border-color: var(--primary, #003366);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}

.meta-publish-footer {
  margin-top: 4px;
}

.meta-btn-publish-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  color: var(--accent, #febf0f);
  cursor: pointer;
  background: var(--primary, #003366);
  box-shadow: 0 6px 20px rgba(0, 51, 102, 0.28);
  transition: filter 0.15s, transform 0.12s, box-shadow 0.15s;
}

.meta-btn-publish-submit__icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.95;
}

.meta-btn-publish-submit__icons .meta-icon-svg {
  width: 18px;
  height: 18px;
}

.meta-btn-publish-submit__text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-btn-publish-submit:hover:not(:disabled) {
  filter: brightness(1.06);
}

.meta-btn-publish-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.meta-invite-card {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(0, 51, 102, 0.18);
  background: rgba(254, 191, 15, 0.14);
}

.meta-invite-card--dismissed {
  display: none;
}

.meta-invite-card__lead {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--primary, #003366);
}

.meta-invite-card__text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted, #475569);
}

.meta-invite-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-invite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: filter 0.15s, background 0.15s;
}

.meta-invite-btn--primary {
  color: var(--accent, #febf0f);
  background: var(--primary, #003366);
}

.meta-invite-btn--ghost {
  color: var(--primary, #003366);
  background: transparent;
  border: 1px solid rgba(0, 51, 102, 0.25);
}

.meta-posted-card {
  margin-top: 4px;
  padding: 12px 14px 11px;
  border-radius: 12px;
  position: relative;
  overflow: visible;
  border: 1px solid rgba(0, 51, 102, 0.12);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 51, 102, 0.06);
  animation: meta-posted-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.meta-posted-card--success {
  border: 1px solid transparent;
  border-left: 3px solid #febf0f;
  background-image:
    var(--agents-published-fill),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 2px 10px rgba(0, 51, 102, 0.07);
}

.meta-posted-card--success::before,
.meta-posted-card--success::after {
  display: none;
}

@keyframes meta-posted-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  60% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes meta-posted-shine {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

.meta-posted-card--error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
  animation: none;
}

.meta-posted-card__head {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #003366;
  margin-bottom: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.meta-posted-card__head .meta-icon-svg--ok {
  width: 15px;
  height: 15px;
}

.meta-posted-card--error .meta-posted-card__head {
  color: var(--primary, #003366);
}

.meta-posted-card__head .meta-icon-svg {
  color: var(--primary, #003366);
}

.meta-posted-card__head .meta-icon-svg--ok,
.meta-posted-item--ok .meta-icon-svg--ok {
  color: #16a34a;
  stroke: #16a34a;
}

.meta-publish-result {
  margin-top: 12px;
  position: relative;
  overflow: visible;
}

.meta-publish-result:empty {
  display: none;
  margin: 0;
}

.meta-publish-celebration {
  position: absolute;
  inset: -8px;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.meta-publish-confetti {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  opacity: 0;
  animation: meta-confetti-burst var(--dur, 1s) ease-out var(--delay, 0s) forwards;
}

.meta-publish-confetti:nth-child(3n) {
  width: 6px;
  height: 10px;
  border-radius: 50%;
}

.meta-publish-confetti:nth-child(5n) {
  width: 10px;
  height: 6px;
}

@keyframes meta-confetti-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0), var(--ty, -60px)) rotate(var(--rot, 180deg)) scale(0.4);
  }
}

.meta-posted-card__list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  position: relative;
  z-index: 1;
}

.meta-posted-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #003366;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid rgba(0, 51, 102, 0.1);
  position: relative;
  z-index: 1;
  box-shadow: none;
}

.meta-posted-item:last-child {
  margin-bottom: 0;
}

.meta-posted-item--ok {
  background: #f8fafc;
  box-shadow: none;
}

.meta-posted-item strong {
  font-weight: 700;
}

.meta-posted-item .meta-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.meta-posted-item .meta-icon-svg--ok {
  width: 13px;
  height: 13px;
}

.meta-posted-item--fb .meta-icon-svg:not(.meta-icon-svg--ok) {
  color: #1877f2;
}

.meta-posted-item--ig .meta-icon-svg:not(.meta-icon-svg--ok) {
  color: #c13584;
}

.meta-posted-item--muted {
  opacity: 0.65;
}

.meta-posted-item--warn {
  color: #b45309;
}

.meta-posted-card__hint {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  opacity: 1;
  position: relative;
  z-index: 1;
}

.meta-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: meta-spin 0.7s linear infinite;
}

@keyframes meta-spin {
  to {
    transform: rotate(360deg);
  }
}

.generated-image-wrapper .meta-publish-block,
.generated-image-wrapper .meta-invite-card,
.generated-video-wrapper .meta-publish-block,
.generated-video-wrapper .meta-invite-card {
  grid-column: 1 / -1;
  width: 100%;
}

.generated-video-wrapper .image-actions-row--secondary {
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.generated-image-wrapper .image-actions-row--secondary {
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.generated-image-wrapper .image-actions-row--secondary::before {
  content: 'Other actions';
  display: block;
  width: 100%;
  flex-basis: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}

/* Inline Drive in presentation toolbar: horizontal chip, same height as Present/Export */
.pres-toolbar .gdrive-asset-actions--inline .gdrive-chip,
.pres-toolbar .gdrive-asset-actions--inline a.gdrive-chip {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-width: 168px !important;
  max-width: none;
  width: auto;
  padding: 0 16px !important;
  border-radius: 12px !important;
  color: #003366 !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
}

.gdrive-asset-actions--inline .gdrive-chip,
.gdrive-asset-actions--inline a.gdrive-chip {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  min-width: min-content;
  max-width: none;
  width: max-content;
  padding: 7px 12px 6px !important;
  border-radius: 10px;
  border: 2px solid transparent !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  text-align: center;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.97) 100%) padding-box,
    linear-gradient(135deg, #003366 0%, #0064c8 38%, #febf0f 72%, #ffd84d 100%) border-box !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 2px 8px rgba(0, 51, 102, 0.1),
    0 4px 14px rgba(0, 80, 180, 0.08),
    0 0 12px rgba(254, 191, 15, 0.08);
}

.gdrive-asset-actions--inline .gdrive-chip:hover:not(:disabled) {
  filter: brightness(1.02);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 0 0 1px rgba(0, 100, 200, 0.06) inset,
    0 4px 16px rgba(0, 80, 180, 0.12),
    0 0 16px rgba(254, 191, 15, 0.12);
}

[data-theme='dark'] .gdrive-asset-actions--inline .gdrive-chip,
.dark-mode .gdrive-asset-actions--inline .gdrive-chip,
[data-theme='dark'] .gdrive-asset-actions--inline a.gdrive-chip,
.dark-mode .gdrive-asset-actions--inline a.gdrive-chip {
  background-image:
    linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.94) 100%) padding-box,
    linear-gradient(135deg, #1a5fa8 0%, #3b8de0 40%, #febf0f 72%, #ffd84d 100%) border-box !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 2px 12px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(60, 140, 255, 0.12);
}

.pres-toolbar .gdrive-asset-actions--inline .gdrive-chip__drive-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Presentation toolbar: force equal-height horizontal chips (overrides column layout below) */
.pres-toolbar .pres-gdrive-toolbar .gdrive-asset-actions--inline .gdrive-chip,
.pres-toolbar .pres-gdrive-toolbar .gdrive-asset-actions--inline a.gdrive-chip {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 16px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.pres-toolbar .pres-gdrive-toolbar .gdrive-chip__label {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
}

.gdrive-asset-actions--inline .gdrive-chip__drive-icon {
  width: 22px;
  height: 22px;
}

.gdrive-asset-actions--inline .gdrive-chip__label {
  white-space: nowrap;
  text-align: center;
}

.pres-drive-slot {
  margin-top: 0;
  width: 100%;
}

.pres-drive-slot .gdrive-asset-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.asset-library-drive,
.asset-modal-drive {
  margin-top: 8px;
}

.asset-modal-drive .gdrive-asset-actions {
  margin-top: 0;
}

.gdrive-asset-actions__note {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
}

/* Workspace Switcher */
.workspace-switcher {
  padding: 6px 8px 8px;
  margin: 4px 8px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background-image:
    linear-gradient(180deg, rgba(0, 51, 102, 0.035) 0%, rgba(0, 51, 102, 0.015) 100%),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.workspace-switcher-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  padding: 6px 10px 4px;
  display: block;
}

.workspace-options {
  display: flex;
  flex-direction: column;
}

.workspace-option {
  width: 100%;
  padding: 9px 10px;
  border: none;
  background-color: transparent;
  font-size: 13px;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.workspace-option:hover {
  background-color: rgba(0, 51, 102, 0.05);
}

.workspace-option.active {
  background-color: rgba(254, 191, 15, 0.1);
  border-radius: 10px;
}

.workspace-option:not(:last-child) {
  background-image: var(--agents-hairline);
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}

.workspace-option:not(:last-child):hover {
  background-image:
    linear-gradient(rgba(0, 51, 102, 0.05), rgba(0, 51, 102, 0.05)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}

.workspace-option:not(:last-child).active {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.1), rgba(254, 191, 15, 0.1)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}

.workspace-option svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.workspace-option .workspace-name {
  flex: 1;
}

.workspace-option .workspace-check {
  width: 16px;
  height: 16px;
  opacity: 0;
  color: var(--accent);
}

.workspace-option.active .workspace-check {
  opacity: 1;
}

[data-theme="dark"] .workspace-option:hover,
.dark-mode .workspace-option:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .workspace-option.active,
.dark-mode .workspace-option.active {
  background-color: rgba(254, 191, 15, 0.15);
}

[data-theme="dark"] .workspace-option:not(:last-child):hover,
.dark-mode .workspace-option:not(:last-child):hover {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}

[data-theme="dark"] .workspace-option:not(:last-child).active,
.dark-mode .workspace-option:not(:last-child).active {
  background-image:
    linear-gradient(rgba(254, 191, 15, 0.15), rgba(254, 191, 15, 0.15)),
    var(--agents-hairline);
  background-size: auto, 100% 1px;
  background-position: 0 0, bottom;
  background-repeat: no-repeat, no-repeat;
}

[data-theme="dark"] .workspace-switcher,
.dark-mode .workspace-switcher {
  border: 1px solid transparent;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

[data-theme="dark"] .workspace-brand-menu,
.dark-mode .workspace-brand-menu {
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--card-bg), var(--card-bg)),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

[data-theme="dark"] .workspace-brand-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .workspace-brand-switcher,
.dark-mode .workspace-brand-switcher {
  border: 1px solid transparent;
  background-image:
    linear-gradient(135deg, rgba(0, 51, 102, 0.38) 0%, rgba(0, 51, 102, 0.14) 100%),
    var(--agents-frame);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .sidebar-quick-link.workspace-brand-switcher svg,
[data-theme="dark"] .sidebar-quick-link.workspace-brand-switcher span,
.dark-mode .sidebar-quick-link.workspace-brand-switcher svg,
.dark-mode .sidebar-quick-link.workspace-brand-switcher span {
  color: #e8f0fa;
}

[data-theme="dark"] .sidebar-quick-link.workspace-brand-switcher:hover,
.dark-mode .sidebar-quick-link.workspace-brand-switcher:hover {
  background-image:
    linear-gradient(135deg, rgba(64, 128, 191, 0.22) 0%, rgba(0, 51, 102, 0.2) 100%),
    var(--agents-frame-hover);
}

[data-theme="dark"] .sidebar-quick-link.workspace-brand-switcher:hover svg,
[data-theme="dark"] .sidebar-quick-link.workspace-brand-switcher:hover span,
.dark-mode .sidebar-quick-link.workspace-brand-switcher:hover svg,
.dark-mode .sidebar-quick-link.workspace-brand-switcher:hover span {
  color: #fff;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* ============================================================================
   CONTENT WRAPPER - Handles sidebar offset
   ============================================================================ */
.content-wrapper {
  margin-left: 260px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: margin-left 0.08s ease;
}

body.sidebar-collapsed .content-wrapper {
  margin-left: 60px;
}

/* ============================================================================
   MAIN CONTAINER - Centered in content wrapper
   ============================================================================ */
.main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  padding: 0 24px;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Hero landing: agent pill tooltips extend past the column; avoid clipping on the right */
.main-container:not(:has(.chat-container.active)) {
  overflow-x: visible;
}

/* Session chat: lock page scroll — only #chatMessages scrolls */
.main-container:has(.chat-container.active) {
  overflow: hidden;
}

/* Same as :has() above, toggled from JS for reliable scroll containment (see main.js) */
html.session-chat-active {
  height: 100%;
  overflow: hidden;
}

body.session-chat-active {
  height: 100%;
  min-height: 0 !important;
  overflow: hidden;
  overscroll-behavior: none;
}

body.session-chat-active .content-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-height: 100%;
}

body.session-chat-active .main-container {
  overflow: hidden !important;
  flex: 1;
  min-height: 0;
}

body.session-chat-active .chat-container.active {
  flex: 1;
  min-height: 0;
}

body.session-chat-active .chat-messages {
  -webkit-overflow-scrolling: touch;
}

body.session-chat-active .chat-messages img,
body.session-chat-active .chat-messages video,
body.session-chat-active .chat-messages iframe {
  max-width: 100%;
  height: auto;
}

/* Subtle 2FA nudge shown when user has not enabled 2FA yet */
.security-nudge-banner {
  margin: 14px 0 6px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 51, 102, 0.16);
  border-left: 4px solid rgba(254, 191, 15, 0.95);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 191, 15, 0.1) 0%, rgba(255, 255, 255, 0.95) 70%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.security-nudge-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.security-nudge-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 51, 102, 0.08);
  font-size: 14px;
  flex-shrink: 0;
}

.security-nudge-copy strong {
  display: block;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

.security-nudge-copy p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.security-nudge-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.security-nudge-cta {
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 51, 102, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
}

.security-nudge-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .security-nudge-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .security-nudge-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.pending-invite-banner {
  position: relative;
  margin: 12px 0 8px;
  padding: 12px 14px 12px 16px;
  border: 1px solid rgba(0, 51, 102, 0.14);
  border-left: 4px solid rgba(59, 130, 246, 0.65);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(255, 255, 255, 0.98) 60%);
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.08);
  display: none;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.pending-invite-banner.visible {
  display: flex;
  animation: pendingInviteEnter 180ms ease-out;
}

@keyframes pendingInviteEnter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pending-invite-banner .pending-invite-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-invite-banner .pending-invite-title::before {
  content: '✉';
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  font-size: 11px;
  flex-shrink: 0;
}

.pending-invite-banner .pending-invite-list {
  margin: 0;
  padding-left: 0;
  font-size: 12px;
  color: var(--text-secondary);
  list-style: none;
}

.pending-invite-banner .pending-invite-list li {
  margin: 6px 0;
  padding: 8px 9px;
  border: 1px solid rgba(0, 51, 102, 0.1);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 10px;
}

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

.pending-invite-banner .pending-invite-cta {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.pending-invite-banner .pending-invite-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.35);
}

.pending-invite-banner .pending-invite-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

[data-theme="dark"] .pending-invite-banner {
  border-color: rgba(148, 163, 184, 0.26);
  border-left-color: rgba(96, 165, 250, 0.72);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.26) 0%, rgba(15, 23, 42, 0.95) 72%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .pending-invite-banner .pending-invite-title::before {
  background: rgba(96, 165, 250, 0.22);
  color: #bfdbfe;
}

[data-theme="dark"] .pending-invite-banner .pending-invite-list li {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  text-align: center;
  overflow: visible;
}

.hero-section.hidden {
  display: none;
}

.hero-title {
  font-size: 32px;
  font-weight: 300;
  color: var(--primary);
  margin-bottom: 32px;
  line-height: 1.2;
}

.hero-title span {
  color: var(--accent);
}

/* Hero hint — static strip (no typing / reveal animation) */
.hero-hint.hero-hint--static {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin: 0 auto 20px;
  padding: 8px 16px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(212, 165, 25, 0.22);
  border-radius: 999px;
  background: rgba(254, 191, 15, 0.035);
  box-shadow: 0 1px 2px rgba(212, 165, 25, 0.06);
  line-height: 1.35;
}

.hero-hint--static .hero-hint-text {
  white-space: nowrap;
}

.hero-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(254, 191, 15, 0.12);
  border: 1px solid rgba(254, 191, 15, 0.4);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  color: #003366;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.hero-hint-btn:hover {
  background: rgba(254, 191, 15, 0.25);
}

.hero-hint-btn:focus-visible {
  outline: 2px solid var(--primary, #003366);
  outline-offset: 2px;
}

[data-theme='dark'] .hero-hint.hero-hint--static,
.dark-mode .hero-hint.hero-hint--static {
  border-color: rgba(254, 191, 15, 0.32);
  background: rgba(254, 191, 15, 0.045);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

[data-theme='dark'] .hero-hint-btn,
.dark-mode .hero-hint-btn {
  color: #febf0f;
  border-color: rgba(254, 191, 15, 0.3);
  background: rgba(254, 191, 15, 0.08);
}

@media (max-width: 820px) {
  .hero-hint.hero-hint--static {
    flex-wrap: wrap;
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 24px);
    row-gap: 6px;
  }

  .hero-hint--static .hero-hint-text {
    white-space: normal;
  }

  .hero-hint-btn {
    white-space: nowrap;
  }
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-weight: 400;
}

.agent-selection-prompt {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
  margin-bottom: 16px;
  font-weight: 400;
  text-align: center;
}

/* Hero Input */
.hero-input-container {
  width: 100%;
  max-width: 700px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.hero-file-preview {
  position: relative;
  z-index: 2010;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--field-bg, #f5f5f5);
  border-radius: 8px;
  border: 1px solid var(--border, #e0e0e0);
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 8px;
}

.hero-file-preview[style*="display: flex"],
.hero-file-preview[style*="display:flex"] {
  display: flex !important;
}

.hero-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: white;
  border: 2.5px solid transparent;
  border-radius: 20px;
  padding: 16px;
  background-image: linear-gradient(white, white), linear-gradient(135deg, #003366 0%, #0064C8 40%, #FEBF0F 70%, #FFD84D 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 
    0 2px 8px rgba(0, 51, 102, 0.10),
    0 8px 28px rgba(0, 80, 180, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(0, 100, 220, 0.06);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.hero-input-wrapper:focus-within {
  background-image: linear-gradient(white, white), linear-gradient(135deg, #003366 0%, #0070E0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow: 
    0 0 0 3px rgba(0, 100, 200, 0.08),
    0 4px 16px rgba(0, 80, 180, 0.16),
    0 12px 36px rgba(0, 80, 180, 0.10),
    0 0 20px rgba(254, 191, 15, 0.10),
    0 0 32px rgba(0, 120, 255, 0.06);
}

.hero-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px; /* Minimum 16px prevents iOS zoom on focus */
  resize: none;
  min-height: 120px;
  max-height: 200px;
  outline: none;
  -webkit-appearance: none; /* Remove iOS styling */
  appearance: none;
  -webkit-user-select: text; /* Enable text selection on iOS */
  user-select: text;
  touch-action: manipulation; /* Optimize for touch */
}

.hero-input::placeholder {
  color: var(--text-muted);
}

.hero-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.hero-upload-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.hero-upload-btn:hover {
  background: var(--field-bg);
  color: var(--primary);
  border-color: var(--primary);
}

.hero-upload-btn svg {
  width: 20px;
  height: 20px;
}

.hero-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  touch-action: manipulation; /* Optimize for touch */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
}

.hero-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.hero-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hero-send-btn svg {
  width: 22px;
  height: 22px;
}

/* ============================================================================
   AGENT PILLS - Enhanced & Lively
   ============================================================================ */
.agent-pills {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 24px;
  margin-top: 28px;
  width: 100%;
  box-sizing: border-box;
}

.agents-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(6px, 0.9vw, 18px);
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
  /* Vertical padding gives the hover box-shadow / scale transform room to
     breathe without being clipped. Horizontal padding keeps the outermost
     pills from kissing the section edge. */
  padding: 8px 8px 16px;
  overflow: visible;
}
.agents-grid .agent-pill { flex: 0 0 auto; }

.view-all-agents-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 2px;
  transition: all 0.3s ease;
}

.view-all-agents-btn:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.agent-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  background: none;
  position: relative;
  border: none;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: visible;
  text-align: center;
  min-width: 0;
  flex-shrink: 1;
}

.agent-pill.coming-soon-pill {
  opacity: 0.7;
  cursor: not-allowed;
}

.agent-pill.coming-soon-pill .coming-soon-badge {
  display: none;
}

.agent-pill.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
}

.agent-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fluid sizing so all 12 pills fit on one row at any desktop width. */
  width: clamp(38px, 3.6vw, 52px);
  height: clamp(38px, 3.6vw, 52px);
  border-radius: 50%;
  font-size: clamp(16px, 1.7vw, 22px);
  /* Same navy→gold gradient border technique as .hero-input-wrapper */
  border: 2px solid transparent;
  background-image:
    linear-gradient(var(--card-bg, #fff), var(--card-bg, #fff)),
    linear-gradient(135deg, #003366 0%, #0064C8 40%, #FEBF0F 70%, #FFD84D 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 2px 8px rgba(0, 51, 102, 0.10),
    0 8px 28px rgba(0, 80, 180, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(0, 100, 220, 0.06);
  transition: background-image 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.agent-pill:hover {
  z-index: 50;
}

.agent-pill:hover .agent-pill-icon {
  transform: scale(1.08);
  background-image:
    linear-gradient(var(--card-bg, #fff), var(--card-bg, #fff)),
    linear-gradient(135deg, #003366 0%, #0070E0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 3px rgba(0, 100, 200, 0.08),
    0 4px 16px rgba(0, 80, 180, 0.16),
    0 12px 36px rgba(0, 80, 180, 0.10),
    0 0 20px rgba(254, 191, 15, 0.10),
    0 0 32px rgba(0, 120, 255, 0.06);
}

.agent-pill.active .agent-pill-icon {
  background-image:
    linear-gradient(var(--card-bg, #fff), var(--card-bg, #fff)),
    linear-gradient(135deg, #003366 0%, #0070E0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 2px rgba(0, 51, 102, 0.10),
    0 4px 20px rgba(0, 51, 102, 0.16),
    0 0 20px rgba(254, 191, 15, 0.10);
}

.agent-pill-name {
  font-size: clamp(11px, 0.95vw, 13.5px);
  line-height: 1.25;
  max-width: clamp(58px, 5.6vw, 102px);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  letter-spacing: 0;
  color: var(--text);
}

.agent-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10050;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
  pointer-events: none;
}

.agent-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--primary);
}

.agent-pill:hover .agent-tooltip {
  opacity: 1;
  visibility: visible;
}

.view-more-pill {
  background: linear-gradient(135deg, var(--primary) 0%, #004080 100%);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.view-more-pill:hover {
  background: linear-gradient(135deg, #004080 0%, #003366 100%) !important;
  border-color: transparent !important;
  color: white !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.4) !important;
}

/* ============================================================================
   CHAT CONTAINER
   ============================================================================ */
.chat-container {
  display: none;
  flex-direction: column;
  background: var(--bg);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.chat-container.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Chat Header — thin bar; polish lives in typography + buttons, not a framed agent title */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 20px 10px;
  border: none;
  border-bottom: 1px solid rgba(0, 51, 102, 0.1);
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  box-shadow:
    0 2px 12px rgba(0, 51, 102, 0.05),
    inset 0 -1px 0 rgba(254, 191, 15, 0.35);
}

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

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.share-btn {
  padding: 9px 16px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #003366 0%, #004a8f 55%, #0a5cad 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 14px rgba(0, 51, 102, 0.28);
}

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

.share-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 6px 20px rgba(0, 51, 102, 0.32);
}

.current-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.current-agent-icon {
  font-size: 20px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(0, 51, 102, 0.06);
  border: none;
  box-shadow: none;
}

.current-agent-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.change-agent-btn {
  padding: 8px 16px;
  background: white;
  border: 1.5px solid rgba(254, 191, 15, 0.42);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 2px 6px rgba(0, 51, 102, 0.06),
    0 0 12px rgba(254, 191, 15, 0.06);
}

.change-agent-btn:hover {
  border-color: rgba(254, 191, 15, 0.65);
  background: rgba(254, 191, 15, 0.06);
  transform: translateY(-1px);
  box-shadow:
    0 2px 8px rgba(0, 80, 180, 0.08),
    0 4px 12px rgba(254, 191, 15, 0.14);
}

.change-agent-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.08);
}

.change-agent-btn:focus-visible {
  outline: 2px solid rgba(0, 100, 200, 0.9);
  outline-offset: 2px;
}

/* Agent Dropdown */
.agent-dropdown {
  display: none;
  position: absolute;
  top: 50px;
  right: 16px;
  background: white;
  border: 1.5px solid rgba(0, 51, 102, 0.45);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  min-width: 220px;
}

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

.agent-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.agent-dropdown-item:hover {
  background: rgba(254, 191, 15, 0.08);
}

.agent-dropdown-item.active {
  background: rgba(254, 191, 15, 0.15);
}

.agent-dropdown-item.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-dropdown-icon {
  font-size: 18px;
}

.agent-dropdown-name {
  font-size: 14px;
  color: var(--text);
}

/* ============================================================================
   CHAT MESSAGES
   ============================================================================ */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overscroll-behavior: contain;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.chat-empty {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  animation: messageIn 0.3s ease;
}

.message.user {
  align-items: flex-end;
}

.message.assistant {
  align-items: flex-start;
}

.message-avatar {
  display: none;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 15px;
}

.message.user .message-content {
  background: rgba(254, 191, 15, 0.15);
  color: var(--text);
  border-radius: 18px 18px 4px 18px;
}

.message.assistant .message-content {
  background: var(--field-bg);
  color: var(--text);
  max-width: 100%;
  border-radius: 18px 18px 18px 4px;
}

/* Credit Info Badge - shown after AI responses */
.credit-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(254, 191, 15, 0.08) 0%, rgba(0, 51, 102, 0.04) 100%);
  border: 1px solid rgba(254, 191, 15, 0.25);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  font-family: 'Ubuntu', sans-serif;
  letter-spacing: 0.01em;
  animation: creditFadeIn 0.4s ease;
}

.credit-info-badge .credit-used {
  font-weight: 600;
  color: var(--primary, #003366);
}

.credit-info-badge .credit-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted, #6b7280);
  opacity: 0.5;
}

.credit-info-badge .credit-balance {
  color: var(--text-muted, #6b7280);
}

@keyframes creditFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Generation Warning Card — shown when output is truncated, incomplete, or connection dropped */
.generation-warning-card {
  background: #fffbea;
  border: 1px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.generation-warning-text {
  margin: 0;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.5;
}

.generation-retry-btn {
  align-self: flex-start;
  padding: 6px 16px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.generation-retry-btn:hover {
  background: #d97706;
}

[data-theme="dark"] .generation-warning-card {
  background: #2d2200;
  border-color: #d97706;
  border-left-color: #f59e0b;
}

[data-theme="dark"] .generation-warning-text {
  color: #fcd34d;
}

/* Message Actions - Always visible */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Ubuntu', sans-serif;
}

.message-action-btn:hover {
  background: var(--field-bg);
  color: var(--text);
  border-color: var(--accent);
}

.message-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Code blocks */
.message-content pre {
  background: #1a1a1a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 13px;
}

.message-content code {
  font-family: 'Ubuntu Mono', monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* Fancy Thinking Box */
.thinking-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(254, 191, 15, 0.15) 0%, rgba(0, 51, 102, 0.1) 100%);
  border: 1px solid rgba(254, 191, 15, 0.3);
  border-radius: 16px;
  max-width: 320px;
  animation: thinking-pulse-bg 2s ease-in-out infinite;
}

@keyframes thinking-pulse-bg {
  0%, 100% { box-shadow: 0 0 0 0 rgba(254, 191, 15, 0.2); }
  50% { box-shadow: 0 0 20px 5px rgba(254, 191, 15, 0.15); }
}

.thinking-avatar {
  font-size: 28px;
  animation: avatar-bounce 1s ease-in-out infinite;
}

@keyframes avatar-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.thinking-content {
  flex: 1;
}

.thinking-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.thinking-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.thinking-status {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

.thinking-dots {
  display: flex;
  gap: 6px;
}

.thinking-dots .dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 100%);
  border-radius: 50%;
  animation: dot-wave 1.4s ease-in-out infinite;
}

.thinking-dots .dot:nth-child(1) { animation-delay: 0s; }
.thinking-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots .dot:nth-child(3) { animation-delay: 0.3s; }
.thinking-dots .dot:nth-child(4) { animation-delay: 0.45s; }
.thinking-dots .dot:nth-child(5) { animation-delay: 0.6s; }

@keyframes dot-wave {
  0%, 60%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  30% { transform: translateY(-8px) scale(1.2); opacity: 1; }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ============================================================================
   GENERATED IMAGES - Clean Layout
   ============================================================================ */
/* Generation Status - Enhanced */
.generation-status {
  background: linear-gradient(135deg, rgba(254, 191, 15, 0.12) 0%, rgba(0, 51, 102, 0.08) 100%);
  border: 1px solid rgba(254, 191, 15, 0.3);
  border-radius: 16px;
  padding: 20px;
  max-width: 450px;
}

.generation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.thinking-indicator {
  display: flex;
  gap: 4px;
}

.thinking-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.thinking-status {
  transition: all 0.3s ease;
}

.thinking-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
}

/* Progress Steps - Real-time Animation */
.progress-steps {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 16px;
}

.progress-step-container {
  margin-bottom: 8px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: linear-gradient(135deg, rgba(254, 191, 15, 0.2) 0%, rgba(254, 191, 15, 0.1) 100%);
  border: 1px solid rgba(254, 191, 15, 0.4);
}

.progress-step.completed {
  background: rgba(0, 51, 102, 0.05);
  border: 1px solid transparent;
  animation: step-complete 0.4s ease-out;
}

.progress-step .step-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
}

.progress-step.active .step-icon {
  animation: icon-pulse 1s ease-in-out infinite;
}

.progress-step .step-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.progress-step.fading {
  opacity: 0;
  transform: translateY(-5px);
}

@keyframes icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Legacy thinking status (fallback) */
.thinking-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

/* Image Result Container */
.image-result-container {
  max-width: 100%;
}

.image-summary {
  margin: 0 0 12px 0;
  line-height: 1.6;
  color: var(--text);
}

.image-download-note {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.generated-image-wrapper {
  max-width: 400px;
  margin: 4px 0;
}

.generated-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Action buttons row below image - Sleek design */
.image-actions-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  max-width: 100%;
}

.img-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.img-btn:hover {
  background: rgba(254, 191, 15, 0.1);
}

.img-btn:active {
  transform: scale(0.96);
}

.img-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--accent);
}

.img-btn:hover svg {
  stroke: var(--accent-hover);
}

/* Download format dropdown for logo images */
.img-btn-dropdown {
  position: relative;
  display: inline-flex;
}

.download-format-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid rgba(0, 51, 102, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px;
  z-index: 20;
  margin-bottom: 6px;
  min-width: 100px;
}

.download-format-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-format-menu button {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.download-format-menu button:hover {
  background: rgba(254, 191, 15, 0.12);
}

[data-theme="dark"] .download-format-menu {
  background: #1a1a2e;
  border-color: rgba(254, 191, 15, 0.2);
}

[data-theme="dark"] .download-format-menu button {
  color: #fff;
}

[data-theme="dark"] .download-format-menu button:hover {
  background: rgba(254, 191, 15, 0.15);
}

/* Prompt content */
.generated-image-wrapper .prompt-content {
  margin-top: 10px;
}

.prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prompt-toggle:hover {
  background: rgba(0, 51, 102, 0.08);
  color: var(--primary);
}

.prompt-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.prompt-toggle.open svg {
  transform: rotate(180deg);
}

.prompt-content {
  display: none;
  margin-top: 8px;
  padding: 12px;
  background: var(--field-bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.prompt-content.show {
  display: block;
}

/* ============================================================================
   CHAT INPUT — in document flow at bottom of .chat-container (not viewport-fixed)
   so the composer sits under the header with normal flex spacing; suggestions
   can open upward without being clipped.
   ============================================================================ */
.chat-input-container {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 35;
  width: 100%;
  padding: 6px 0 16px;
  background: var(--bg);
  box-shadow: 0 -8px 24px rgba(0, 51, 102, 0.06);
  border-top: 1px solid rgba(254, 191, 15, 0.22);
}

/* Social video agent: compact one-line credit pill (centered, not full-bleed) */
.video-gen-credit-hint-outer {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: min(880px, 100%);
  margin: 0 auto 4px;
  padding: 0 8px;
  box-sizing: border-box;
}
.video-gen-credit-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  width: max-content;
  margin: 0;
  padding: 4px 12px 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.95) 0%, rgba(254, 215, 170, 0.35) 100%);
  border: 1.5px solid rgba(234, 88, 12, 0.45);
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(180, 83, 9, 0.15);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-gen-credit-hint-icon {
  flex: 0 0 auto;
  display: flex;
  color: #c2410c;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  opacity: 0.95;
}
.video-gen-credit-hint-text {
  display: block;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-gen-credit-hint .video-gen-hi {
  font-style: normal;
  color: #b45309;
  font-weight: 700;
}
@media (max-width: 420px) {
  .video-gen-credit-hint {
    white-space: normal;
    max-width: 100%;
  }
}
[data-theme="dark"] .video-gen-credit-hint {
  background: linear-gradient(180deg, rgba(50, 35, 20, 0.95) 0%, rgba(30, 22, 14, 0.98) 100%);
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .video-gen-credit-hint .video-gen-hi {
  color: #fbbf24;
}
[data-theme="dark"] .video-gen-credit-hint-icon {
  color: #fbbf24;
  filter: none;
}
[data-theme="dark"] .video-gen-credit-hint strong {
  color: #fde68a;
}

.file-preview {
  position: relative;
  z-index: 2010;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--field-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 8px;
}

.file-preview[style*="display: flex"],
.file-preview[style*="display:flex"] {
  display: flex !important;
}

.file-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* Inline “importing from Drive” row (same strip as attachment chips) */
.drive-import-banner {
  width: 100%;
  flex-shrink: 0;
}

.drive-import-banner__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(125deg, rgba(0, 112, 224, 0.1) 0%, rgba(254, 191, 15, 0.14) 55%, rgba(255, 255, 255, 0.5) 100%);
  border: 1px solid rgba(0, 112, 224, 0.38);
  box-shadow:
    0 4px 18px rgba(0, 112, 224, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

[data-theme='dark'] .drive-import-banner__inner,
.dark-mode .drive-import-banner__inner {
  background: linear-gradient(125deg, rgba(59, 130, 246, 0.22) 0%, rgba(254, 191, 15, 0.1) 50%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow:
    0 4px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.drive-import-banner__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(0, 112, 224, 0.22);
  border-top-color: var(--primary, #0070e0);
  flex-shrink: 0;
  animation: ndGdriveImportSpin 0.72s linear infinite;
}

[data-theme='dark'] .drive-import-banner__spinner,
.dark-mode .drive-import-banner__spinner {
  border-color: rgba(148, 163, 184, 0.35);
  border-top-color: #93c5fd;
}

@keyframes ndGdriveImportSpin {
  to {
    transform: rotate(360deg);
  }
}

.drive-import-banner__gdrive {
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.drive-import-banner__msg {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #0f172a);
  line-height: 1.35;
}

[data-theme='dark'] .drive-import-banner__msg,
.dark-mode .drive-import-banner__msg {
  color: var(--text, #e2e8f0);
}

.file-preview-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 8px 4px 4px;
  max-width: 200px;
}

.chip-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chip-name {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.chip-remove:hover {
  color: var(--error);
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  position: relative;
  background: var(--card-bg);
  border: 2.5px solid transparent;
  border-radius: 26px;
  padding: 16px 12px 16px 18px;
  background-image:
    linear-gradient(var(--card-bg), var(--card-bg)),
    linear-gradient(135deg, #003366 0%, #0064C8 40%, #FEBF0F 70%, #FFD84D 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 2px 8px rgba(0, 51, 102, 0.10),
    0 8px 28px rgba(0, 80, 180, 0.10),
    0 0 16px rgba(254, 191, 15, 0.08),
    0 0 24px rgba(0, 100, 220, 0.06);
  max-width: 800px;
  margin: 0 auto;
  transition: background-image 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-wrapper:focus-within {
  background-image:
    linear-gradient(var(--card-bg), var(--card-bg)),
    linear-gradient(135deg, #003366 0%, #0070E0 35%, #FEBF0F 65%, #FFD84D 100%);
  box-shadow:
    0 0 0 3px rgba(0, 100, 200, 0.08),
    0 4px 16px rgba(0, 80, 180, 0.16),
    0 12px 36px rgba(0, 80, 180, 0.10),
    0 0 20px rgba(254, 191, 15, 0.10),
    0 0 32px rgba(0, 120, 255, 0.06);
}

/* Inline prompt suggestions (agent phrase pool) — under hero + session composers */
.composer-suggestions {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 8px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0, 51, 102, 0.12));
  box-shadow:
    0 10px 36px rgba(0, 51, 102, 0.12),
    0 0 0 1px rgba(254, 191, 15, 0.12);
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
}

.composer-suggestions[hidden] {
  display: none !important;
}

/* Session chat: fixed bottom bar — open upward so rows stay in the viewport */
.composer-suggestions.composer-suggestions--above {
  top: auto;
  bottom: calc(100% + 10px);
  box-shadow:
    0 -8px 28px rgba(0, 51, 102, 0.12),
    0 0 0 1px rgba(254, 191, 15, 0.12);
}

[data-theme="dark"] .composer-suggestions.composer-suggestions--above,
.dark-mode .composer-suggestions.composer-suggestions--above {
  box-shadow:
    0 -10px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(254, 191, 15, 0.18);
}

.composer-suggestion-row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: var(--text, #1e293b);
  transition: background 0.15s ease;
}

.composer-suggestion-row:hover,
.composer-suggestion-row:focus-visible {
  background: rgba(254, 191, 15, 0.14);
  outline: none;
}

.composer-sug-prefix {
  color: var(--text-muted, #64748b);
  font-weight: 400;
}

.composer-sug-rest {
  font-weight: 600;
  color: #9a7200;
}

[data-theme="dark"] .composer-suggestions .composer-sug-rest,
.dark-mode .composer-suggestions .composer-sug-rest {
  color: #FEBF0F;
}

[data-theme="dark"] .composer-suggestions,
.dark-mode .composer-suggestions {
  background: var(--card-bg, #1e1e2e);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(254, 191, 15, 0.18);
}

[data-theme="dark"] .composer-sug-prefix,
.dark-mode .composer-sug-prefix {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .composer-suggestion-row:hover,
[data-theme="dark"] .composer-suggestion-row:focus-visible,
.dark-mode .composer-suggestion-row:hover,
.dark-mode .composer-suggestion-row:focus-visible {
  background: rgba(254, 191, 15, 0.12);
}

.attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.attach-btn:hover {
  background: rgba(254, 191, 15, 0.1);
  color: var(--accent);
}

.attach-btn svg {
  width: 20px;
  height: 20px;
}

/* URL attach button — same style as file attach button */
.url-attach-btn {
  position: relative;
}

/* ── Attach + button & expand menu ───────────────────────────────────────── */
.attach-menu-wrapper {
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.attach-plus-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #0070E0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.25s ease;
  flex-shrink: 0;
}

.attach-plus-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.attach-plus-btn:hover {
  background: var(--accent, #FEBF0F);
  color: #1a1a1a;
}

.attach-plus-btn.open {
  background: var(--accent, #FEBF0F);
  color: #1a1a1a;
}

.attach-plus-btn.open svg {
  transform: rotate(45deg);
}

/* Hero variant — slightly larger to match hero-upload-btn proportions */
.hero-input-wrapper .attach-plus-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.attach-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 300;
  flex-direction: column;
  gap: 2px;
  background: var(--card-bg, #1e1e2e);
  border: 1px solid rgba(0, 112, 224, 0.28);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 112, 224, 0.06);
  min-width: 200px;
  animation: attachMenuIn 0.15s ease;
}

.attach-menu.open {
  display: flex;
}

@keyframes attachMenuIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--primary, #0070E0);
  font-size: 14px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.attach-menu-item:hover {
  background: rgba(254, 191, 15, 0.12);
  color: var(--accent, #FEBF0F);
}

.attach-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.attach-menu-item .attach-menu-item__gdrive-icon,
.attach-menu-item .attach-menu-item__clip-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

/* Light theme adjustments */
[data-theme="light"] .attach-menu {
  background: #ffffff;
  border: 1px solid rgba(0, 112, 224, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 112, 224, 0.08);
}

[data-theme="light"] .attach-menu-item {
  color: var(--primary, #0070E0);
}

/* URL attach popup */
.url-attach-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  min-width: 280px;
}

.url-attach-popup input[type="url"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary, #fff);
  font-family: 'Ubuntu', sans-serif;
  font-size: 13px;
  padding: 2px 0;
}

.url-attach-popup input[type="url"]::placeholder {
  color: var(--text-muted, rgba(255,255,255,0.4));
}

.url-attach-popup button {
  background: var(--accent, #febf0f);
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.url-attach-popup button:hover { opacity: 0.85; }

/* URL chip styling */
.file-preview-chip.url-chip {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.chat-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 14px 0;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px; /* Minimum 16px prevents iOS zoom on focus */
  resize: none;
  min-height: 96px;
  max-height: 280px;
  line-height: 1.45;
  outline: none;
  -webkit-appearance: none; /* Remove iOS styling */
  appearance: none;
  -webkit-user-select: text; /* Enable text selection on iOS */
  user-select: text;
  touch-action: manipulation; /* Optimize for touch */
}

.chat-input::placeholder {
  color: var(--text-muted);
}

/* After first exchange: slimmer composer so more room for messages */
.chat-container.active:has(.message) .chat-input-container {
  padding: 3px 0 10px;
}

.chat-container.active:has(.message) .chat-input-wrapper {
  padding: 10px 12px 10px 16px;
}

.chat-container.active:has(.message) .chat-input {
  min-height: 52px;
  max-height: 220px;
  padding: 8px 0;
}

.chat-container.active:has(.message) .send-btn {
  width: 36px;
  height: 36px;
  margin-bottom: 1px;
}

.chat-container.active:has(.message) .send-btn svg {
  width: 18px;
  height: 18px;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  touch-action: manipulation; /* Optimize for touch */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
  align-self: flex-end;
  margin-bottom: 2px;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================================
   AGENT CARDS
   ============================================================================ */
.agent-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  overflow: hidden;
}

.agent-card:hover:not(.coming-soon) {
  border-color: var(--accent);
  background: rgba(254, 191, 15, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.agent-card.active {
  border-color: var(--accent);
  background: rgba(254, 191, 15, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.agent-card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 6px;
  background: linear-gradient(135deg, #004080, var(--primary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.agent-card.active .agent-icon {
  background: linear-gradient(135deg, var(--accent), #FFD84D);
}

.agent-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  height: 24px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.agent-badge {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================================
   SESSIONS SIDEBAR
   ============================================================================ */
.sessions-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: white;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sessions-sidebar.open {
  left: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}

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

.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Ubuntu', sans-serif;
  background: var(--field-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search-input:focus {
  border-color: var(--accent);
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Sidebar Footer & New Chat Button */
.sidebar-footer {
  padding: 2px 6px;
  border-top: none;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #FFD84D 100%);
  border: none;
  border-radius: 6px;
  color: var(--primary);
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(254, 191, 15, 0.2);
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

.new-chat-btn:active {
  transform: translateY(0);
}

.new-chat-icon {
  font-size: 18px;
}

.session-item {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0;
  transition: background 0.15s;
  color: var(--text);
  position: relative;
}

.session-item:hover {
  background: var(--field-bg);
}

.session-item.active {
  background: rgba(254, 191, 15, 0.15);
}

.session-item:hover .session-actions {
  opacity: 1;
}

.session-content {
  flex: 1;
  min-width: 0;
}

.session-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text-muted);
}

.session-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.session-action-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.session-action-btn:hover {
  background: var(--field-bg);
  color: var(--text);
}

.session-action-btn.delete:hover {
  background: #fee2e2;
  color: var(--error);
  border-color: var(--error);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================================================
   USAGE INDICATOR - Compact header version
   ============================================================================ */
.usage-indicator-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(254, 191, 15, 0.1);
  border: 1px solid rgba(254, 191, 15, 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  position: relative;
  cursor: help;
}

.usage-indicator-compact.warning {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--error);
}

/* Credits Custom Tooltip */
.credits-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px;
  width: 240px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.credits-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

.usage-indicator-compact:hover .credits-tooltip {
  opacity: 1;
  visibility: visible;
}

.credits-tooltip-title {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
}

.credits-tooltip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

.credits-tooltip-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.credits-tooltip-list li:last-child {
  border-bottom: none;
}

.credit-icon {
  font-size: 14px;
}

.credits-tooltip-note {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Usage Warning Modal */
.usage-warning-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 400px;
  display: none;
}

.usage-warning-modal.show {
  display: block;
  animation: modalIn 0.3s ease;
}

.usage-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.usage-warning-overlay.show {
  display: block;
}

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ============================================================================
   TOAST
   ============================================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  border: 1px solid var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

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

.toast.error {
  border-color: var(--error);
  color: var(--error);
}

/* Prominent import status (still fixed corner, but louder than default toast) */
.toast.show.toast--import-active {
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-width: 2px;
  box-shadow:
    0 8px 28px rgba(0, 112, 224, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: ndToastImportPulse 1.25s ease-in-out infinite;
}

.toast.show.toast--import-done {
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  border-width: 2px;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}

@keyframes ndToastImportPulse {
  0%,
  100% {
    box-shadow:
      0 8px 28px rgba(0, 112, 224, 0.28),
      0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  }
  50% {
    box-shadow:
      0 10px 34px rgba(254, 191, 15, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  }
}

[data-theme='dark'] .toast.show.toast--import-active,
.dark-mode .toast.show.toast--import-active {
  box-shadow:
    0 8px 32px rgba(59, 130, 246, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================================================
   RESPONSIVE — phones, landscape phones, and tablets (≤1024px)
   ============================================================================ */
@media (max-width: 1024px) {
  /* Hide sidebar on mobile by default */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    display: flex;
    flex-direction: column;
    height: 100vh !important;
    top: 0 !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
  }

  /* Override discount banner sidebar offset on mobile - sidebar covers full screen */
  body.has-discount-banner .sidebar {
    top: 0 !important;
    height: 100vh !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* On mobile, expanded content (new chat, search, quick links) stays visible */
  .sidebar .sidebar-expanded-content {
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .sidebar .sidebar-collapsed-actions {
    display: none !important;
  }

  /* Chat history scrolls dynamically - leaves room for toggle row, nav links, and footer */
  .sidebar .sidebar-chats {
    flex: 0 0 auto;
    overflow-y: auto;
    max-height: calc(100vh - 340px);
    min-height: 60px;
    opacity: 1 !important;
    visibility: visible !important;
    padding-bottom: 8px;
  }

  /* When discount banner is visible, sidebar is still 100vh so same calc applies */
  body.has-discount-banner .sidebar .sidebar-chats {
    max-height: calc(100vh - 340px);
  }

  /* Remove collapsed class effects on mobile */
  .sidebar.collapsed {
    width: 280px;
    transform: translateX(-100%);
  }

  .sidebar.collapsed.mobile-open {
    transform: translateX(0);
  }

  .sidebar.collapsed .sidebar-chats,
  .sidebar.collapsed .sidebar-user-name {
    display: block;
  }

  /* Footer always pinned at bottom — override desktop fixed positioning */
  .sidebar .sidebar-footer {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(254, 191, 15, 0.2);
    background: linear-gradient(180deg, #f8f6f1 0%, #fff9eb 100%);
    z-index: 10;
    box-sizing: border-box;
  }

  .sidebar .sidebar-user {
    flex-shrink: 0;
  }

  /* Sidebar toggle row on mobile - fixed at top */
  .sidebar .sidebar-toggle-row {
    flex-shrink: 0;
    padding: 10px 12px;
  }

  /* Remove excess bottom padding since footer is now in flex flow */
  .sidebar .sidebar-chats {
    padding-bottom: 8px;
  }

  /* Keep sidebar toggle visible on mobile - user prefers collapse button */
  .sidebar-toggle {
    display: flex;
  }

  /* Hide mobile close button - not needed since sidebar covers header */
  .mobile-sidebar-close {
    display: none;
  }

  body.sidebar-collapsed .content-wrapper {
    margin-left: 0 !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
  }

  .main-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px;
    padding-top: 70px;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .main-container:not(:has(.chat-container.active)) {
    overflow-x: hidden;
  }

  .mobile-menu-btn {
    display: none;
  }

  /* Mobile header bar — above discount banner; logo must not squeeze the menu button */
  .mobile-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 52px;
    box-sizing: border-box;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 56px 0 16px;
    align-items: center;
    z-index: 1100;
    overflow: visible;
  }

  body.has-discount-banner .mobile-header {
    top: 60px;
  }

  body.has-discount-banner .main-container {
    padding-top: 122px;
  }

  /* Sidebar above mobile header when open */
  .sidebar {
    z-index: 1200;
  }

  .mobile-header > a {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .mobile-header .mobile-logo {
    height: 24px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
  }

  /* Fixed top-right so wide logos cannot cover the control */
  .mobile-header .mobile-menu-trigger {
    position: fixed;
    top: max(6px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 1305;
    flex: 0 0 auto;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(0, 51, 102, 0.2);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    color: #003366;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.15);
  }

  body.has-discount-banner .mobile-header .mobile-menu-trigger {
    top: calc(60px + max(6px, env(safe-area-inset-top, 0px)));
  }

  .mobile-header .mobile-menu-trigger svg {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
  }

  .mobile-header .mobile-menu-trigger svg line {
    stroke: #003366;
    stroke-width: 2;
  }

  [data-theme="dark"] .mobile-header .mobile-menu-trigger,
  .dark-mode .mobile-header .mobile-menu-trigger {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
  }

  [data-theme="dark"] .mobile-header .mobile-menu-trigger svg line,
  .dark-mode .mobile-header .mobile-menu-trigger svg line {
    stroke: #f5f5f5;
  }

  .chat-header .mobile-menu-btn {
    display: inline-flex !important;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 51, 102, 0.12);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--primary, #003366);
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }

  .sidebar-overlay.show,
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .agent-pills {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Flex + wrap keeps incomplete last rows centered (grid left-aligns row 3) */
  .agents-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 22px 14px;
    padding: 4px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-section {
    width: 100%;
    max-width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
  }

  .hero-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .hero-hint.hero-hint--static {
    margin-bottom: 16px;
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .hero-input-container {
    max-width: 100%;
  }

  .hero-input-wrapper {
    padding: 8px 8px 8px 16px;
  }

  .hero-input {
    font-size: 14px;
  }

  .agent-pills {
    gap: 12px;
  }

  .agents-grid {
    gap: 22px 14px;
  }

  .agent-pill {
    min-width: 64px;
  }

  .agent-pill-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .agent-pill-name {
    font-size: 10px;
    max-width: 84px;
    line-height: 1.25;
  }

  .view-all-agents-btn {
    padding: 6px 14px;
    font-size: 11px;
  }

  .chat-container {
    margin: 8px 0;
    border-radius: 12px;
    max-height: calc(100vh - 120px);
  }

  .chat-header {
    padding: 8px 12px 10px;
  }

  .current-agent {
    padding: 0;
    gap: 10px;
  }

  .current-agent-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 10px;
  }

  .current-agent-name {
    font-size: 13px;
  }

  .change-agent-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .agent-dropdown {
    top: 45px;
    right: 8px;
    min-width: 180px;
  }

  .chat-messages {
    padding: 16px 12px;
    gap: 16px;
  }

  .message-content {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 4px 8px 12px;
  }

  .chat-input-wrapper {
    padding: 12px 8px 12px 14px;
  }

  .chat-input {
    font-size: 14px;
    min-height: 72px;
    padding: 12px 0;
  }

  .chat-container.active:has(.message) .chat-input {
    min-height: 48px;
    padding: 6px 0;
  }

  .chat-container.active:has(.message) .chat-input-wrapper {
    padding: 8px 8px 8px 12px;
  }

  .chat-container.active:has(.message) .chat-input-container {
    padding: 2px 8px 8px;
  }

  .attach-btn {
    width: 32px;
    height: 32px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  .send-btn svg {
    width: 18px;
    height: 18px;
  }

  .sessions-sidebar {
    width: 280px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
    margin-bottom: 22px;
  }

  .hero-hint.hero-hint--static {
    font-size: 0.7rem;
    padding: 6px 10px;
    margin-bottom: 14px;
  }

  .agents-grid {
    gap: 20px 12px;
    padding: 8px 10px;
  }

  .agent-pill {
    min-width: 58px;
  }

  .agent-pill-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .agent-pill-name {
    font-size: 9px;
    max-width: 74px;
    line-height: 1.25;
  }

  .view-all-agents-btn {
    padding: 5px 12px;
    font-size: 10px;
  }

  .message-content {
    max-width: 90%;
  }
}

/* ============================================================================
   HTML CODE PREVIEW & EXPORT
   ============================================================================ */
.html-code-container {
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
}

.html-code-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  flex-wrap: wrap;
}

.code-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #475569, #334155);
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  height: 38px;
}

.code-action-btn:hover {
  background: linear-gradient(135deg, var(--accent), #e9b308);
  color: #1e293b;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.code-action-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: block;
}

.code-action-btn span {
  display: inline-block;
  line-height: 16px;
}

.html-code-container pre {
  margin: 0;
  padding: 16px;
  max-height: 400px;
  overflow: auto;
}

.html-code-container code {
  color: #e2e8f0;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* HTML Preview Card - Clean display without raw code */
.html-preview-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Live Iframe Preview */
.html-preview-iframe-container {
  background: #1e293b;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.iframe-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #0f172a;
  gap: 12px;
}

.iframe-dots {
  display: flex;
  gap: 6px;
}

.iframe-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.iframe-dots .dot.red { background: #ef4444; }
.iframe-dots .dot.yellow { background: #eab308; }
.iframe-dots .dot.green { background: #22c55e; }

.iframe-title {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iframe-expand {
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iframe-expand:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.html-preview-iframe {
  width: 100%;
  height: 280px;
  border: none;
  background: #ffffff;
  display: block;
}

.html-preview-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: #f8fafc;
}

.html-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  color: var(--text);
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Ubuntu', sans-serif;
}

.html-preview-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.html-preview-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #e6a600 100%);
  color: #1e293b;
  border-color: transparent;
}

.html-preview-btn.primary:hover {
  background: linear-gradient(135deg, #FFD84D 0%, var(--accent) 100%);
  color: #1e293b;
  box-shadow: 0 4px 16px rgba(254, 191, 15, 0.4);
}

.html-code-hidden {
  display: none !important;
}

/* Publish button styling */
.html-preview-btn.publish {
  background: linear-gradient(135deg, #003366 0%, #004080 100%);
  color: white;
  border-color: transparent;
}

.html-preview-btn.publish:hover {
  background: linear-gradient(135deg, #004080 0%, #0055a5 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.4);
}

/* Published state - green success styling */
.html-preview-btn.publish.published {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: transparent;
  cursor: pointer;
}

.html-preview-btn.publish.published:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* Publish success modal */
.publish-success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.publish-success-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.publish-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.publish-success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.publish-success-content h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.publish-success-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.publish-url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.publish-url-box input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 14px;
  background: var(--field-bg);
}

.publish-url-box button {
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--primary);
  transition: background 0.2s;
}

.publish-url-box button:hover {
  background: #e6a600;
}

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

.publish-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  transition: all 0.2s;
}

.publish-btn:hover {
  border-color: var(--accent);
}

.publish-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #e6a600 100%);
  color: var(--primary);
  border: none;
}

.publish-btn.primary:hover {
  background: linear-gradient(135deg, #FFD84D 0%, var(--accent) 100%);
}

/* Publish input modal - Lean and fancy */
.publish-input-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.publish-input-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: modalPop 0.2s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.publish-input-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.publish-input-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #003366 0%, #004080 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.publish-input-icon svg {
  stroke: white;
  width: 20px;
  height: 20px;
}

.publish-input-header h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 0;
  font-weight: 600;
}

.publish-input-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.publish-input-field {
  margin-bottom: 16px;
}

.publish-input-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.publish-input-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
  background: var(--field-bg);
}

.publish-input-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(254, 191, 15, 0.15);
  background: white;
}

.publish-url-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--field-bg);
  border-radius: 6px;
  font-size: 12px;
}

.publish-url-preview .url-label {
  color: var(--text-muted);
}

.publish-url-preview code {
  font-family: 'Ubuntu Mono', monospace;
  color: var(--primary);
  font-weight: 500;
}

.publish-input-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.publish-input-actions .publish-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
}

.publish-input-actions .publish-btn.primary {
  background: linear-gradient(135deg, #FEBF0F 0%, #FFD84D 100%);
  color: #003366;
}

.publish-input-actions .publish-btn.primary:hover {
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

.publish-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.publish-modal-close:hover {
  background: var(--field-bg);
  color: var(--text);
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Duplicate URL error */
.publish-url-error {
  color: #dc3545;
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.publish-url-error svg {
  width: 12px;
  height: 12px;
}

/* Dark mode for publish modal */
[data-theme="dark"] .publish-success-content,
[data-theme="dark"] .publish-input-content {
  background: var(--card-bg);
}

[data-theme="dark"] .publish-url-box input,
[data-theme="dark"] .publish-input-field input {
  background: var(--field-bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .publish-btn {
  background: var(--card-bg);
  color: var(--text);
}

/* Dark mode for preview card */
[data-theme="dark"] .html-preview-card {
  background: #1a1a1a;
  border-color: var(--border);
}

[data-theme="dark"] .html-preview-actions {
  background: #1e1e1e;
}

[data-theme="dark"] .html-preview-btn {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .html-preview-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Publish Button in HTML Preview */
.html-preview-btn.publish-btn {
  background: linear-gradient(135deg, #003366 0%, #004080 100%);
  color: white;
}

.html-preview-btn.publish-btn:hover {
  background: linear-gradient(135deg, #004080 0%, #0055a5 100%);
}

.html-preview-btn.publish-btn.published {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
}

.html-preview-btn.publish-btn.published:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* Published label - inline status badge */
.html-preview-label.published-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  border: 1px solid #86efac;
  white-space: nowrap;
}

/* Update button - re-publish with changes */
.html-preview-btn.update-btn {
  background: linear-gradient(135deg, #003366 0%, #004080 100%);
  color: white;
  border-color: transparent;
}

.html-preview-btn.update-btn:hover {
  background: linear-gradient(135deg, #004080 0%, #0055a5 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.4);
}

/* Share button for site link */
.html-preview-btn.share-btn {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.html-preview-btn.share-btn:hover {
  background: rgba(0, 51, 102, 0.06);
  border-color: var(--accent);
  color: var(--accent);
}

/* Edit button - website canvas editor */
.html-preview-btn.edit-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  border-color: transparent;
}

.html-preview-btn.edit-btn:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* Visual editor tip block — shown below website preview card */
.wce-canvas-tip {
  margin-top: 12px;
  padding: 14px 18px;
  background: #f8f5ff;
  border: 1px solid #ede9fe;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wce-canvas-tip-text {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.wce-canvas-tip-soon {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
}

/* Website preview — Edit Visually (matches presentation + chat image CTA) */
.wce-canvas-tip-btn {
  align-self: flex-start;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #FEBF0F;
  color: #003366;
  border: 2px solid rgba(0, 51, 102, 0.42);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 4px 16px rgba(0, 51, 102, 0.14),
    0 2px 8px rgba(254, 191, 15, 0.35);
}

.wce-canvas-tip-btn:hover {
  background: #FFD84D;
  border-color: #003366;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 8px 22px rgba(0, 51, 102, 0.18),
    0 3px 12px rgba(254, 191, 15, 0.5);
  transform: translateY(-2px);
}

.wce-canvas-tip-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.35) inset,
    0 2px 10px rgba(0, 51, 102, 0.12);
}

.wce-canvas-tip-btn:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 3px;
}

.wce-canvas-tip-btn svg {
  stroke: currentColor;
  flex-shrink: 0;
}

[data-theme="dark"] .wce-canvas-tip-btn {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(254, 191, 15, 0.22);
}

[data-theme="dark"] .wce-canvas-tip {
  background: #1e1730;
  border-color: #3b2a6e;
}

[data-theme="dark"] .wce-canvas-tip-text {
  color: #c4b5fd;
}

/* SEO Settings button */
.html-preview-btn.seo-btn {
  background: transparent;
  color: #059669;
  border-color: #059669;
}

.html-preview-btn.seo-btn:hover {
  background: rgba(5, 150, 105, 0.06);
  border-color: #047857;
  color: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Connect Domain button */
.html-preview-btn.connect-domain-btn {
  background: transparent;
  color: #7c3aed;
  border-color: #7c3aed;
  text-decoration: none;
}

.html-preview-btn.connect-domain-btn:hover {
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Background task completion notification banner */
.bg-complete-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #003366;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  font-size: 0.9rem;
  max-width: 90vw;
  animation: bgNotifSlideUp 0.35s cubic-bezier(.22,1,.36,1);
}

@keyframes bgNotifSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.bg-notif-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.bg-notif-text {
  flex: 1;
  color: #e8f0fe;
}

.bg-notif-text strong {
  color: #FEBF0F;
}

.bg-notif-view {
  background: #FEBF0F;
  color: #003366;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.bg-notif-view:hover {
  background: #ffd94a;
}

.bg-notif-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  line-height: 1;
}

.bg-notif-close:hover {
  color: #fff;
}

/* Publish Modal */
.publish-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 20, 40, 0.7);
  backdrop-filter: blur(8px);
  padding: 20px;
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
}

.publish-modal-content {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 80px rgba(0, 51, 102, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.publish-modal-content.success {
  text-align: center;
}

.publish-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  border-radius: 8px;
  transition: all 0.2s;
}

.publish-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
}

.publish-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.publish-modal-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #003366 0%, #0055a5 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.publish-modal-icon svg {
  width: 22px;
  height: 22px;
  stroke: white;
}

.publish-modal-header h3 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  font-family: 'Ubuntu', sans-serif;
}

.publish-modal-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
  font-family: 'Ubuntu', sans-serif;
}

.publish-modal-body {
  margin-bottom: 16px;
}

.publish-modal-field {
  margin-bottom: 12px;
}

.publish-modal-field label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-family: 'Ubuntu', sans-serif;
}

.publish-url-input-wrapper {
  display: flex;
  align-items: stretch;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.publish-url-input-wrapper:focus-within {
  border-color: #003366;
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}

.publish-url-input-wrapper input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  font-size: 0.9rem;
  font-family: 'Ubuntu', sans-serif;
  background: white;
}

.publish-url-input-wrapper input:focus {
  outline: none;
}

.publish-url-input-wrapper input::placeholder {
  color: #94a3b8;
}

.publish-url-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.8rem;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  white-space: nowrap;
  border-left: 1px solid #e2e8f0;
}

.publish-url-preview {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
}

.publish-url-preview .preview-label {
  display: block;
  font-size: 0.7rem;
  color: #166534;
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Ubuntu', sans-serif;
}

.publish-url-preview .preview-url {
  display: flex;
  align-items: center;
  gap: 6px;
}

.publish-url-preview .preview-url svg {
  color: #22c55e;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.publish-url-preview code {
  color: #166534;
  font-family: 'Ubuntu Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  word-break: break-all;
}

.publish-hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: 'Ubuntu', sans-serif;
}

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

.publish-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  font-family: 'Ubuntu', sans-serif;
}

.publish-modal-btn.cancel {
  background: #f1f5f9;
  color: #475569;
}

.publish-modal-btn.cancel:hover {
  background: #e2e8f0;
}

.publish-modal-btn.primary {
  background: linear-gradient(135deg, #003366 0%, #0055a5 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.publish-modal-btn.primary:hover {
  background: linear-gradient(135deg, #004080 0%, #0066cc 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 51, 102, 0.4);
}

.publish-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.publish-modal-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success Modal */
.publish-success-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.publish-success-icon svg {
  width: 36px;
  height: 36px;
  stroke: white;
  stroke-width: 2.5;
}

.publish-modal-content.success h3 {
  color: #059669;
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
}

.publish-modal-content.success p {
  color: #64748b;
  margin: 0 0 20px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
}

.publish-url-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #86efac;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.publish-url-box a {
  flex: 1;
  color: #166534;
  font-weight: 600;
  word-break: break-all;
  text-align: left;
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
}

.publish-url-box a:hover {
  text-decoration: underline;
}

.publish-url-box button {
  background: #dcfce7;
  border: none;
  padding: 10px;
  cursor: pointer;
  color: #166534;
  border-radius: 8px;
  transition: all 0.2s;
}

.publish-url-box button:hover {
  background: #bbf7d0;
  transform: scale(1.05);
}

/* Dark theme for publish modal */
[data-theme="dark"] .publish-modal-content {
  background: #1e1e1e;
}

[data-theme="dark"] .publish-modal-close {
  color: #999;
}

[data-theme="dark"] .publish-modal-header h3 {
  color: #fff;
}

[data-theme="dark"] .publish-modal-header p {
  color: #aaa;
}

[data-theme="dark"] .publish-modal-field label {
  color: #ddd;
}

[data-theme="dark"] .publish-modal-field input {
  background: #2d2d2d;
  border-color: #444;
  color: #fff;
}

[data-theme="dark"] .publish-url-preview {
  background: #2d2d2d;
}

[data-theme="dark"] .publish-url-preview code {
  color: #FEBF0F;
}

[data-theme="dark"] .publish-modal-btn.cancel {
  background: #333;
  color: #ccc;
}

/* ==========================================================================
   Publish celebration overlay — confetti + "Your site is live at…" card
   shown after a successful first publish of a landing page / website.
   ========================================================================== */

.publish-celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 30, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10050;
  animation: pcFadeIn 0.22s ease-out;
  overflow: hidden;
}

.publish-celebration-overlay.is-leaving {
  animation: pcFadeOut 0.26s ease-in forwards;
}

@keyframes pcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pcFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.publish-celebration-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  padding: 30px 30px 22px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  animation: pcPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25);
  z-index: 2;
}

@keyframes pcPop {
  0%   { opacity: 0; transform: scale(0.78) translateY(10px); }
  55%  { opacity: 1; transform: scale(1.04) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.publish-celebration-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
}
.publish-celebration-check svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pc-check-circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: pcCircleDraw 0.55s 0.15s ease-out forwards;
  transform-origin: 50% 50%;
}
.pc-check-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: pcMarkDraw 0.35s 0.55s ease-out forwards;
}
@keyframes pcCircleDraw { to { stroke-dashoffset: 0; } }
@keyframes pcMarkDraw   { to { stroke-dashoffset: 0; } }

.publish-celebration-title {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #003366;
  letter-spacing: -0.01em;
}

.publish-celebration-sub {
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 0.92rem;
}

.publish-celebration-url {
  display: inline-block;
  max-width: 100%;
  font-family: 'Ubuntu Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  background: rgba(254, 191, 15, 0.12);
  color: #003366;
  padding: 9px 14px;
  border-radius: 9px;
  text-decoration: none;
  word-break: break-all;
  border: 1px solid rgba(254, 191, 15, 0.35);
  transition: background 0.15s, transform 0.15s;
}
.publish-celebration-url:hover {
  background: rgba(254, 191, 15, 0.22);
  transform: translateY(-1px);
}

.publish-celebration-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pc-btn {
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: 'Ubuntu', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.pc-btn.ghost {
  background: #ffffff;
  border-color: rgba(0, 51, 102, 0.18);
  color: #334155;
}
.pc-btn.ghost:hover {
  background: rgba(0, 51, 102, 0.04);
  border-color: rgba(0, 51, 102, 0.28);
}
.pc-btn.outline {
  background: #ffffff;
  border-color: rgba(254, 191, 15, 0.55);
  color: #003366;
}
.pc-btn.outline:hover {
  background: rgba(254, 191, 15, 0.1);
}
.pc-btn.primary {
  background: linear-gradient(135deg, #FEBF0F 0%, #e6a600 100%);
  color: #003366;
  border: none;
  box-shadow: 0 6px 16px rgba(254, 191, 15, 0.35);
}
.pc-btn.primary:hover {
  background: linear-gradient(135deg, #FFD84D 0%, #FEBF0F 100%);
  transform: translateY(-1px);
}

.publish-celebration-hint {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.pc-bar {
  width: 120px;
  height: 3px;
  background: rgba(0, 51, 102, 0.08);
  border-radius: 99px;
  overflow: hidden;
}
.pc-bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #FEBF0F, #003366);
  transform-origin: left center;
  transform: scaleX(0);
  animation: pcHintProgress 5s linear 0.2s forwards;
}
.pc-hint-text {
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
@keyframes pcHintProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Confetti layer — positioned over the whole overlay so pieces can fall
   from above the card and past it. `pointer-events:none` keeps the card
   and its buttons fully interactive. */
.publish-celebration-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.pc-bit {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: pcFall;
  animation-timing-function: cubic-bezier(0.15, 0.55, 0.4, 1);
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}
@keyframes pcFall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  100% {
    transform: translate3d(var(--pc-drift, 0), 110vh, 0) rotate(var(--pc-spin, 540deg));
    opacity: 0.15;
  }
}

/* Dark theme tweaks for the celebration card. */
[data-theme="dark"] .publish-celebration-card {
  background: #1e1e22;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] .publish-celebration-title { color: #FEBF0F; }
[data-theme="dark"] .publish-celebration-sub   { color: #cbd5e1; }
[data-theme="dark"] .publish-celebration-url   {
  background: rgba(254, 191, 15, 0.15);
  color: #FEBF0F;
  border-color: rgba(254, 191, 15, 0.4);
}
[data-theme="dark"] .pc-btn.ghost {
  background: #2a2a30;
  border-color: #3a3a42;
  color: #d1d5db;
}
[data-theme="dark"] .pc-btn.ghost:hover { background: #33333c; }
[data-theme="dark"] .pc-btn.outline     {
  background: transparent;
  color: #FEBF0F;
}
[data-theme="dark"] .pc-hint-text       { color: #6b7280; }
[data-theme="dark"] .pc-bar             { background: rgba(255, 255, 255, 0.08); }

/* Mobile polish */
@media (max-width: 540px) {
  .publish-celebration-card {
    padding: 24px 20px 18px;
    border-radius: 16px;
  }
  .publish-celebration-title { font-size: 1.25rem; }
  .publish-celebration-url   { font-size: 0.78rem; padding: 8px 12px; }
  .pc-btn                    { padding: 8px 14px; font-size: 0.82rem; }
  .publish-celebration-actions { gap: 8px; }
}

/* Respect user motion preferences — disable confetti / pop animations
   when prefers-reduced-motion is set. */
@media (prefers-reduced-motion: reduce) {
  .publish-celebration-card,
  .publish-celebration-overlay,
  .pc-check-circle,
  .pc-check-mark,
  .pc-bit,
  .pc-bar-fill {
    animation: none !important;
  }
  .pc-bit { display: none; }
  .pc-check-circle, .pc-check-mark { stroke-dashoffset: 0 !important; }
  .pc-bar-fill { transform: scaleX(1); }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .html-preview-iframe {
    height: 200px;
  }
  
  .iframe-header {
    padding: 10px 12px;
  }
  
  .iframe-title {
    font-size: 12px;
  }
  
  .html-preview-actions {
    flex-direction: column;
    padding: 16px;
  }
  
  .html-preview-btn {
    width: 100%;
    justify-content: center;
  }
}

/* HTML Preview Modal */
.html-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.html-preview-modal.show {
  display: flex;
}

.html-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.html-preview-content {
  position: relative;
  width: 95vw;
  max-width: 1400px;
  height: 90vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.html-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--primary);
  color: white;
}

.html-preview-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.html-preview-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.html-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.html-preview-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

@media (max-width: 768px) {
  .html-code-actions {
    padding: 10px 12px;
  }
  
  .code-action-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .html-preview-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* ============================================================================
   CAPTION CARDS - Styled caption output with copy functionality
   ============================================================================ */

.caption-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.caption-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.caption-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.caption-platform {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.caption-style {
  color: #e2e8f0;
  font-size: 13px;
  font-style: italic;
}

.caption-copy-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.caption-copy-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}

.caption-copy-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.caption-content {
  padding: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: #1e293b;
  background: white;
  min-height: 60px;
}

/* Hashtags styling within captions */
.caption-content br + br {
  display: block;
  content: "";
  margin-top: 12px;
}

@media (max-width: 768px) {
  .caption-card {
    margin: 12px 0;
    border-radius: 12px;
  }
  
  .caption-header {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  
  .caption-style {
    display: none;
  }
  
  .caption-content {
    padding: 16px;
    font-size: 14px;
  }
  
  .caption-copy-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ============================================================================
   ARTICLE CARDS - Blog article output with copy/download functionality
   ============================================================================ */

.article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}

.article-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

.article-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1e3a6e 0%, #0d2151 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.article-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.article-stats {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  white-space: nowrap;
}

.article-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.article-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.article-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.02);
}

.article-action-btn.primary {
  background: #FEBF0F;
  border-color: #FEBF0F;
  color: #003366;
  font-weight: 600;
}

.article-action-btn.primary:hover {
  background: #f5b800;
  border-color: #f5b800;
}

/* Gold “Edit Visually” CTA — blog article footer (matches presentations / images / websites) */
.agents-edit-visually-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #FEBF0F;
  color: #003366;
  border: 2px solid rgba(0, 51, 102, 0.42);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 4px 14px rgba(0, 51, 102, 0.14),
    0 2px 8px rgba(254, 191, 15, 0.32);
}

.agents-edit-visually-btn:hover {
  background: #FFD84D;
  border-color: #003366;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 6px 20px rgba(0, 51, 102, 0.18),
    0 3px 12px rgba(254, 191, 15, 0.45);
  transform: translateY(-1px);
}

.agents-edit-visually-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.35) inset,
    0 2px 10px rgba(0, 51, 102, 0.12);
}

.agents-edit-visually-btn:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 3px;
}

.agents-edit-visually-btn svg {
  stroke: currentColor;
  flex-shrink: 0;
}

[data-theme="dark"] .agents-edit-visually-btn {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(254, 191, 15, 0.22);
}

.article-hero {
  padding: 26px 26px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.article-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.article-hero-meta {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.article-featured-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 26px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #FEBF0F;
  border-radius: 10px;
  margin-top: 16px;
}

.article-featured-stat-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.article-featured-stat-text {
  font-size: 15px;
  font-weight: 600;
  color: #78350f;
  line-height: 1.4;
}

.article-seo-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 26px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.article-seo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
}

.article-chip-time {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.article-chip-slug {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.article-card,
.article-hero-title,
.article-hero-meta,
.article-badge,
.article-stats,
.article-action-btn,
.article-seo-chip,
.article-featured-stat-text,
.article-body-content {
  font-family: 'Ubuntu', sans-serif;
}

.article-copy-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 18px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

/* Footer buttons sit on a light background — override the default white-text style */
.article-copy-footer .article-action-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
}

.article-copy-footer .article-action-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: none;
}

.article-copy-btn {
  font-family: 'Ubuntu', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
}

[data-theme="dark"] .article-copy-footer {
  background: #1e293b;
  border-top-color: #334155;
}

[data-theme="dark"] .article-copy-footer .article-action-btn {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .article-copy-footer .article-action-btn:hover {
  background: #1e3a5f;
  border-color: #475569;
  color: #f1f5f9;
}

.article-body-content {
  padding: 20px 24px 24px;
  font-size: 15px;
  line-height: 1.75;
  color: #1e293b;
  font-family: 'Ubuntu', sans-serif;
}

.article-body-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #003366;
  margin: 1.2rem 0 0.6rem;
  line-height: 1.3;
}

.article-body-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #003366;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 6px;
  border-bottom: 2px solid #FEBF0F;
  line-height: 1.35;
}

.article-body-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 1.1rem 0 0.4rem;
}

.article-body-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin: 0.9rem 0 0.3rem;
}

.article-body-content p {
  margin: 0 0 0.9rem;
}

.article-body-content p:last-child {
  margin-bottom: 0;
}

.article-body-content ul,
.article-body-content ol {
  margin: 0.5rem 0 1rem 1.4rem;
  padding: 0;
}

.article-body-content li {
  margin-bottom: 0.35rem;
  line-height: 1.65;
}

.article-body-content hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

.article-body-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 1rem 0;
}

.article-body-content blockquote img,
.article-image-hint img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin: 8px 0 0;
}

.article-body-content strong {
  font-weight: 700;
  color: #0f172a;
}

.article-body-content em {
  font-style: italic;
  color: #475569;
}

.article-body-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
  color: #003366;
}

.article-body-content blockquote,
.article-callout {
  margin: 1.2rem 0;
  padding: 14px 18px 14px 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%);
  border-left: 4px solid #FEBF0F;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  color: #713f12;
  line-height: 1.6;
}

.article-body-content blockquote strong,
.article-callout strong {
  color: #92400e;
  font-weight: 700;
}

.article-image-hint {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  border-left-color: #3b82f6 !important;
  color: #1e3a5f !important;
}

.article-image-hint strong {
  color: #1d4ed8 !important;
}

/* Screenshot suggestion callout */
.article-screenshot-hint {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border-left: 4px solid #16a34a !important;
  color: #14532d !important;
  font-size: 13.5px;
}

.article-screenshot-hint strong {
  color: #15803d !important;
}

/* Article tables */
.article-table-wrapper {
  overflow-x: auto;
  margin: 1.2rem 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  -webkit-overflow-scrolling: touch;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: 'Ubuntu', sans-serif;
  min-width: 400px;
}

.article-table thead {
  background: linear-gradient(135deg, #1e3a6e 0%, #0d2151 100%);
}

.article-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.article-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}

.article-table tbody tr:last-child {
  border-bottom: none;
}

.article-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.article-table tbody tr:hover {
  background: #eff6ff;
}

.article-table td {
  padding: 9px 16px;
  vertical-align: top;
  line-height: 1.55;
  color: #334155;
}

.article-table td strong {
  color: #0f172a;
}

/* Dark theme support */
[data-theme="dark"] .article-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .article-hero {
  border-bottom-color: #334155;
}

[data-theme="dark"] .article-hero-title {
  color: #f1f5f9;
}

[data-theme="dark"] .article-hero-meta {
  color: #94a3b8;
}

[data-theme="dark"] .article-featured-stat {
  background: rgba(254, 191, 15, 0.08);
  border-color: rgba(254, 191, 15, 0.3);
}

[data-theme="dark"] .article-featured-stat-text {
  color: #fcd34d;
}

[data-theme="dark"] .article-seo-panel {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .article-seo-chip {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .article-chip-time {
  background: rgba(134, 239, 172, 0.08);
  border-color: rgba(134, 239, 172, 0.25);
  color: #86efac;
}

[data-theme="dark"] .article-chip-slug {
  background: rgba(147, 197, 253, 0.08);
  border-color: rgba(147, 197, 253, 0.25);
  color: #93c5fd;
}

[data-theme="dark"] .article-copy-footer {
  background: #0f172a;
  border-top-color: #1e293b;
}

[data-theme="dark"] .article-body-content blockquote,
[data-theme="dark"] .article-callout {
  background: rgba(254, 191, 15, 0.06);
  border-left-color: rgba(254, 191, 15, 0.5);
  color: #fcd34d;
}

[data-theme="dark"] .article-body-content blockquote strong,
[data-theme="dark"] .article-callout strong {
  color: #fde68a;
}

[data-theme="dark"] .article-screenshot-hint {
  background: rgba(22, 163, 74, 0.08) !important;
  border-left-color: #16a34a !important;
  color: #86efac !important;
}

[data-theme="dark"] .article-screenshot-hint strong {
  color: #4ade80 !important;
}

[data-theme="dark"] .article-image-hint {
  background: rgba(59, 130, 246, 0.08) !important;
  border-left-color: #3b82f6 !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .article-image-hint strong {
  color: #60a5fa !important;
}

[data-theme="dark"] .article-table-wrapper {
  border-color: #334155;
}

[data-theme="dark"] .article-table tbody tr {
  border-bottom-color: #334155;
}

[data-theme="dark"] .article-table tbody tr:nth-child(even) {
  background: #1e293b;
}

[data-theme="dark"] .article-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .article-table td {
  color: #cbd5e1;
}

[data-theme="dark"] .article-table td strong {
  color: #f1f5f9;
}

/* ============================================================================
   FLYER CARD — Flyers Agent output
   ============================================================================ */

.flyer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Ubuntu', sans-serif;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin: 4px 0;
  position: relative;
}

/* Header */
.flyer-card-header {
  background: linear-gradient(135deg, #1e3a6e 0%, #0d2151 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flyer-badge {
  background: rgba(254, 191, 15, 0.15);
  border: 1px solid rgba(254, 191, 15, 0.4);
  color: #FEBF0F;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.flyer-business-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

/* Meta chips */
.flyer-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 4px;
}

.flyer-chip {
  background: #f1f5f9;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.flyer-chip-dim {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Color palette row */
.flyer-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 10px;
  font-size: 12.5px;
}

.flyer-color-text {
  color: #475569;
  font-style: italic;
}

/* Copy preview panel — simulates A5 flyer look */
.flyer-preview {
  background: linear-gradient(180deg, #0d2151 0%, #1e3a6e 22%, #f8fafc 22%);
  border-top: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 0 20px;
  text-align: center;
}

.flyer-headline {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 20px 20px 14px;
  line-height: 1.25;
}

.flyer-subheadline {
  background: #FEBF0F;
  color: #0d2151;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 20px;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.flyer-body {
  font-size: 13px;
  color: #334155;
  line-height: 1.65;
  padding: 0 20px 10px;
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}

.flyer-key-points {
  list-style: none;
  padding: 0 20px;
  margin: 0 0 10px;
  text-align: left;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.flyer-key-points li {
  font-size: 13px;
  color: #334155;
  padding: 3px 0 3px 18px;
  position: relative;
  line-height: 1.5;
}

.flyer-key-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #1e3a6e;
  font-size: 11px;
  top: 5px;
}

.flyer-event-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: #475569;
  font-weight: 600;
  margin: 6px 20px 10px;
}

.flyer-cta {
  display: inline-block;
  background: #1e3a6e;
  color: #FEBF0F;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 24px;
  border-radius: 6px;
  margin: 10px 20px 8px;
}

.flyer-contact {
  font-size: 12px;
  color: #64748b;
  padding: 4px 20px;
}

.flyer-tagline {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  padding: 2px 20px;
}

/* Design panel (brief, layout, AI prompt) */
.flyer-design-panel {
  padding: 14px 20px 8px;
  border-top: 1px solid #f1f5f9;
}

.flyer-section-block {
  margin-bottom: 14px;
}

.flyer-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flyer-section-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

/* AI image prompt block */
.flyer-ai-block .flyer-section-label {
  justify-content: space-between;
}

.flyer-prompt-text {
  font-family: 'Ubuntu Mono', monospace;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
}

.flyer-copy-prompt-btn {
  background: #e2e8f0;
  color: #334155;
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  transition: background 0.15s;
}

.flyer-copy-prompt-btn:hover {
  background: #cbd5e1;
}

/* Copy footer */
.flyer-copy-footer {
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.flyer-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1e3a6e;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  transition: background 0.15s ease, transform 0.1s ease;
}

.flyer-copy-btn:hover {
  background: #0d2151;
  transform: translateY(-1px);
}

/* Dark mode */
[data-theme="dark"] .flyer-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .flyer-chip {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

[data-theme="dark"] .flyer-chip-dim {
  background: rgba(59,130,246,0.12);
  color: #93c5fd;
  border-color: rgba(59,130,246,0.3);
}

[data-theme="dark"] .flyer-color-row {
  border-color: #334155;
}

[data-theme="dark"] .flyer-color-text {
  color: #94a3b8;
}

[data-theme="dark"] .flyer-preview {
  background: linear-gradient(180deg, #0a1628 0%, #1e3a6e 22%, #1e293b 22%);
  border-bottom-color: #334155;
}

[data-theme="dark"] .flyer-body,
[data-theme="dark"] .flyer-key-points li {
  color: #cbd5e1;
}

[data-theme="dark"] .flyer-event-details {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}

[data-theme="dark"] .flyer-contact,
[data-theme="dark"] .flyer-tagline {
  color: #64748b;
}

[data-theme="dark"] .flyer-design-panel {
  border-top-color: #334155;
}

[data-theme="dark"] .flyer-section-body {
  color: #94a3b8;
}

[data-theme="dark"] .flyer-prompt-text {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .flyer-copy-prompt-btn {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .flyer-copy-prompt-btn:hover {
  background: #475569;
}

[data-theme="dark"] .flyer-copy-footer {
  background: #0f172a;
  border-top-color: #334155;
}

[data-theme="dark"] .article-body-content {
  color: #e2e8f0;
}

[data-theme="dark"] .article-body-content h1,
[data-theme="dark"] .article-body-content h2 {
  color: #93c5fd;
}

[data-theme="dark"] .article-body-content h3,
[data-theme="dark"] .article-body-content h4 {
  color: #bfdbfe;
}

[data-theme="dark"] .article-body-content strong {
  color: #f1f5f9;
}

[data-theme="dark"] .article-body-content code {
  background: #0f172a;
  color: #93c5fd;
}

[data-theme="dark"] .article-body-content hr {
  border-top-color: #334155;
}

.article-toc-section {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 18px 10px;
  margin: 18px 0 22px;
}

.article-toc-section h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  margin: 0 0 10px;
  border-bottom: none;
}

.article-toc-section ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.article-toc-section li {
  font-size: 0.9rem;
  color: #1e40af;
  padding: 3px 0;
  line-height: 1.5;
}

.article-toc-section li a {
  color: #1e40af;
  text-decoration: none;
}

.article-toc-section li a:hover {
  text-decoration: underline;
}

.article-slug {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.article-body-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.article-body-content a:hover {
  color: #1d4ed8;
}

[data-theme="dark"] .article-toc-section {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .article-toc-section h2 {
  color: #93c5fd;
}

[data-theme="dark"] .article-toc-section li {
  color: #bfdbfe;
}

[data-theme="dark"] .article-toc-section li a {
  color: #bfdbfe;
}

[data-theme="dark"] .article-slug {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .article-body-content a {
  color: #60a5fa;
}

[data-theme="dark"] .article-body-content a:hover {
  color: #93c5fd;
}

@media (max-width: 768px) {
  .article-card {
    margin: 12px 0;
    border-radius: 12px;
  }

  .article-card-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .article-display-title {
    padding: 16px 16px 10px;
    font-size: 1.15rem;
  }

  .article-body-content {
    padding: 16px;
    font-size: 14px;
  }

  .article-action-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .article-toc-section {
    padding: 12px 14px 8px;
    margin: 14px 0 18px;
  }
}

/* ============================================================================
   VIDEO GENERATION - Video result display and controls
   ============================================================================ */

.video-result-container {
  margin: 8px 0;
}

.video-summary {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text);
}

.generated-video-wrapper {
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  max-width: min(100%, 420px);
  width: 100%;
}

.generated-video {
  width: 100%;
  max-width: 100%;
  max-height: min(78vh, 720px);
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  display: block;
  margin: 0;
  border-radius: 0;
  background: #000;
}

.video-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(30, 58, 95, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.video-credit-below {
  padding: 8px 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg);
}
.video-credit-below .credit-used {
  color: var(--text);
  font-weight: 600;
}
.video-credit-below .credit-balance {
  color: var(--text-muted);
}

.info-badge {
  background: rgba(30, 58, 95, 0.1);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.video-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.video-gen-info {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .generated-video-wrapper {
    border-radius: 12px;
  }
  
  .generated-video {
    border-radius: 12px 12px 0 0;
  }
  
  .video-actions-row {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  
  .video-info {
    padding: 10px 12px;
  }
}

/* ============================================================================
   CREDITS POPUP MODAL
   ============================================================================ */

.credits-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.credits-popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.credits-popup-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem 1.5rem 1.5rem;
  width: 90%;
  max-width: 420px;
  z-index: 1001;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.credits-popup-modal.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.credits-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 1;
}

.credits-popup-close:hover {
  color: var(--text);
}

.credits-popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(254, 191, 15, 0.12);
  border: 2px solid rgba(254, 191, 15, 0.3);
  margin: 0 auto 1rem;
  color: var(--accent);
}

.credits-popup-header {
  margin-bottom: 0.4rem;
}

.credits-popup-header h3 {
  font-family: 'Ubuntu', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.credits-popup-subtitle {
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.credits-popup-note {
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 1.25rem;
}

.pack-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--primary);
  padding: 0.1rem 0.5rem;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.credit-packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.credit-pack {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.credit-pack:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.credit-pack.best-value {
  border-color: var(--accent);
  border-width: 2px;
}


.pack-credits {
  font-family: 'Ubuntu', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

[data-theme="dark"] .pack-credits {
  color: var(--accent);
}

.pack-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pack-price {
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pack-per-credit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.credits-popup-footer {
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.upgrade-link {
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}

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

[data-theme="dark"] .upgrade-link {
  color: var(--accent);
}

@media (max-width: 480px) {
  .credit-packs-grid {
    grid-template-columns: 1fr;
  }
  
  .credit-pack {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 1rem;
  }
  
  .credit-pack.best-value::before {
    left: auto;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Attachment/upload buttons - enabled */

/* ============================================================================
   PRESENTATION PREVIEW CARDS
   ============================================================================ */

.presentation-preview-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.08);
  position: relative;
}
.presentation-preview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--primary, #003366), var(--accent, #FEBF0F) 60%, var(--primary, #003366));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}

.pres-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 18px;
  /* Soft gradient that picks up the Ndovesha navy tint */
  background: linear-gradient(135deg, #f8fafc 0%, #f0f5fa 100%);
  border-bottom: 1px solid rgba(0,51,102,0.12);
  position: relative;
}

.pres-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
/* Gold hairline accent — ties header to brand palette */
.pres-header::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #FEBF0F 20%, #FEBF0F 80%, transparent);
  opacity: 0.55;
  pointer-events: none;
}

.pres-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pres-icon {
  font-size: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #003366 0%, #0a4d8c 100%);
  color: #FEBF0F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,51,102,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.pres-icon svg, .pres-icon img { width: 20px; height: 20px; }

.pres-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #003366;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
  /* Clamp to 2 lines max with ellipsis so long titles don't bloat the header */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pres-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin: 3px 0 0 0;
  font-weight: 600;
  /* Subtle pill look — reads as metadata, not primary text */
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pres-subtitle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FEBF0F;
  display: inline-block;
}

.pres-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pres-toolbar {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.pres-toolbar .pres-action-btn,
.pres-toolbar .pres-gdrive-toolbar .gdrive-asset-actions--inline .gdrive-chip,
.pres-toolbar .pres-gdrive-toolbar .gdrive-asset-actions--inline a.gdrive-chip {
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
}

.pres-toolbar .pres-action-btn {
  min-width: 128px;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pres-toolbar .pres-gdrive-toolbar {
  display: flex;
  align-items: stretch;
}

.pres-toolbar .pres-gdrive-toolbar .gdrive-asset-actions--inline {
  margin: 0;
  display: flex;
  align-items: stretch;
}

.pres-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.pres-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  pointer-events: none;
}
.pres-action-btn:hover::before { transform: translateX(100%); }

.pres-action-btn:not(.present-btn):not(.primary):hover {
  background: var(--bg-primary);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,51,102,0.15);
}

/* ▶ Present — Ndovesha blue #003366 */
.pres-toolbar .pres-action-btn.present-btn,
.pres-action-btn.present-btn {
  background: linear-gradient(160deg, #004a8f 0%, #003366 52%, #002244 100%);
  color: #ffffff;
  border: 1.5px solid #FEBF0F;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 2px 0 rgba(254, 191, 15, 0.35),
    0 6px 18px rgba(0, 51, 102, 0.45),
    0 0 0 1px rgba(0, 51, 102, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pres-toolbar .pres-action-btn.present-btn svg,
.pres-action-btn.present-btn svg {
  filter: drop-shadow(0 0 4px rgba(254, 191, 15, 0.45));
}
.pres-toolbar .pres-action-btn.present-btn:hover,
.pres-action-btn.present-btn:hover {
  background: linear-gradient(160deg, #0059a8 0%, #003366 48%, #001a33 100%);
  color: #ffffff;
  transform: translateY(-1px);
  border-color: #FEBF0F;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 2px 0 rgba(254, 191, 15, 0.5),
    0 10px 26px rgba(0, 51, 102, 0.5),
    0 0 24px rgba(254, 191, 15, 0.28);
}

/* Export — Ndovesha gold #FEBF0F */
.pres-toolbar .pres-action-btn.primary,
.pres-action-btn.primary {
  background: linear-gradient(160deg, #fff4b8 0%, #FEBF0F 48%, #e5a800 100%);
  border: 1.5px solid #003366;
  color: #003366;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 2px 0 rgba(0, 51, 102, 0.12),
    0 6px 18px rgba(254, 191, 15, 0.5),
    0 0 0 1px rgba(254, 191, 15, 0.35);
  font-weight: 700;
}
.pres-toolbar .pres-action-btn.primary:hover,
.pres-action-btn.primary:hover {
  background: linear-gradient(160deg, #fff8d4 0%, #FEBF0F 44%, #d49a00 100%);
  color: #003366;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 10px 26px rgba(254, 191, 15, 0.58),
    0 0 20px rgba(0, 51, 102, 0.12);
}

.pres-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 100002;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: pres-export-fade-in 0.35s ease-out;
}

@keyframes pres-export-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pres-export-panel--premium {
  position: relative;
  width: min(400px, 100%);
  padding: 1.65rem 1.75rem 1.55rem;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(165deg, #ffffff 0%, #f4f7fb 42%, #eef2f8 100%);
  border: 1px solid rgba(0, 51, 102, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.92) inset,
    0 28px 56px rgba(0, 51, 102, 0.22),
    0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  animation: pres-export-panel-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pres-export-panel-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(254, 191, 15, 0.14), transparent 55%),
    radial-gradient(ellipse 90% 70% at -10% 110%, rgba(10, 77, 140, 0.12), transparent 50%);
  opacity: 1;
}

.pres-export-panel--premium > :not(.pres-export-panel-bg):not(.pres-export-accent-strip) {
  position: relative;
  z-index: 1;
}

@keyframes pres-export-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pres-export-accent-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #003366 0%, #0a4d8c 42%, #febf0f 100%);
  pointer-events: none;
  z-index: 2;
}

.pres-export-brand-badge {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0.35rem auto 0.6rem;
  border-radius: 18px;
  background: linear-gradient(145deg, #003366 0%, #0a4d8c 55%, #002952 100%);
  border: 1px solid rgba(254, 191, 15, 0.45);
  box-shadow:
    0 8px 22px rgba(0, 51, 102, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pres-export-ring {
  position: absolute;
  width: 92px;
  height: 92px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pres-export-ring-track {
  stroke: rgba(0, 51, 102, 0.14);
}

.pres-export-ring-progress {
  stroke: #febf0f;
  stroke-dasharray: 213.628;
  stroke-dashoffset: 213.628;
  transform: rotate(-90deg);
  transform-origin: 36px 36px;
  filter: drop-shadow(0 0 5px rgba(254, 191, 15, 0.55));
  transition: stroke-dashoffset 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}

.pres-export-badge-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(254, 191, 15, 0.35) 0%, transparent 68%);
  animation: pres-export-glow-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pres-export-glow-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

.pres-export-badge-icon {
  position: relative;
  font-size: 1.65rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  z-index: 2;
}

.pres-export-premium-title {
  margin: 0 0 1rem;
  padding: 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #003366;
}

.pres-export-bigpct {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 2.85rem;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1rem;
  white-space: nowrap;
  background: linear-gradient(135deg, #003366 0%, #0a4d8c 40%, #b8860b 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.pres-export-bar--shine {
  height: 11px;
  border-radius: 999px;
  background: rgba(0, 51, 102, 0.08);
  overflow: hidden;
  position: relative;
}

.pres-export-bar--shine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 45%,
    transparent 90%
  );
  animation: pres-export-shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pres-export-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.pres-export-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #003366 0%, #0a4d8c 55%, #febf0f 100%);
  box-shadow: 0 0 12px rgba(254, 191, 15, 0.35);
  transition: width 0.22s cubic-bezier(0.33, 1, 0.68, 1);
  width: 0%;
  position: relative;
  z-index: 1;
}

[data-theme='dark'] .pres-export-panel--premium {
  background: linear-gradient(165deg, #1e293b 0%, #172033 100%);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 28px 56px rgba(0, 0, 0, 0.45);
}

[data-theme='dark'] .pres-export-premium-title {
  color: #f1f5f9;
}

[data-theme='dark'] .pres-export-bigpct {
  background: linear-gradient(135deg, #93c5fd 0%, #febf0f 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme='dark'] .pres-export-bar--shine {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .pres-export-ring-track {
  stroke: rgba(148, 163, 184, 0.28);
}

.dark-mode .pres-export-panel--premium {
  background: linear-gradient(165deg, #1e293b 0%, #172033 100%);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 28px 56px rgba(0, 0, 0, 0.45);
}

.dark-mode .pres-export-premium-title {
  color: #f1f5f9;
}

.dark-mode .pres-export-bigpct {
  background: linear-gradient(135deg, #93c5fd 0%, #febf0f 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

.dark-mode .pres-export-bar--shine {
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .pres-export-ring-track {
  stroke: rgba(148, 163, 184, 0.28);
}

.pres-content {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary, #f5f5f5);
  min-height: 280px;
}

[data-theme="dark"] .pres-content {
  background: var(--bg-primary);
}

.pres-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--border);
}

.pres-thumbnails::-webkit-scrollbar {
  width: 4px;
}

.pres-thumbnails::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.pres-slide-thumb {
  position: relative;
  background: white;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  width: 130px;
  flex-shrink: 0;
}

.pres-slide-thumb:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.15);
}

.pres-slide-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.2);
}

.pres-slide-num {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.pres-slide-mini {
  width: 130px;
  height: 73.125px; /* 130 * 9/16 for 16:9 ratio */
  overflow: hidden;
  position: relative;
  background: #f8f9fa;
}

/* Canonical 1280×720 deck — JS centers stage with translate + scale. */
.pres-scale-host {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #fff;
}

.pres-scale-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform-origin: center center;
}

.pres-scale-stage > .pres-slide {
  width: 1280px !important;
  height: 720px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.pres-slide-mini .pres-scale-host {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.pres-slide-mini .pres-scale-stage > .pres-slide {
  pointer-events: none;
}

.pres-main-slide {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.pres-main-slide .pres-scale-host {
  position: absolute;
  inset: 0;
}

.pres-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.pres-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.pres-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pres-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Edit Visually row below presentation nav */
.pres-canvas-row {
  display: flex;
  justify-content: center;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}

.pres-edit-canvas-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 36px;
  background: #FEBF0F;
  color: #003366;
  border: 2px solid rgba(0, 51, 102, 0.42);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 4px 16px rgba(0, 51, 102, 0.14),
    0 2px 8px rgba(254, 191, 15, 0.35);
}

.pres-edit-canvas-btn:hover {
  background: #FFD84D;
  border-color: #003366;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 8px 22px rgba(0, 51, 102, 0.18),
    0 3px 12px rgba(254, 191, 15, 0.5);
  transform: translateY(-2px);
}

.pres-edit-canvas-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.35) inset,
    0 2px 10px rgba(0, 51, 102, 0.12);
}

.pres-edit-canvas-btn:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 3px;
}

.pres-edit-canvas-btn svg {
  stroke: currentColor;
  flex-shrink: 0;
}

[data-theme="dark"] .pres-edit-canvas-btn {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(254, 191, 15, 0.22);
}

.pres-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

/* Slide Update Notice */
.slide-update-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: 8px;
  color: #00c853;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Fullscreen Presentation Modal */
.pres-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  z-index: 9999;
  display: none;
  flex-direction: column;
}

.pres-fullscreen-modal.active {
  display: flex;
}

.pres-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pres-fullscreen-title {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

.pres-fullscreen-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.pres-fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pres-fullscreen-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.pres-fullscreen-thumbs {
  width: 160px;
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.pres-fullscreen-thumbs::-webkit-scrollbar {
  width: 6px;
}

.pres-fullscreen-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.pres-fs-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pres-fs-thumb:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.pres-fs-thumb.active {
  border-color: var(--accent, #FEBF0F);
  box-shadow: 0 0 0 2px rgba(254, 191, 15, 0.3);
}

.pres-fs-thumb-num {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: var(--primary, #003366);
  color: white;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.pres-fs-thumb-preview {
  aspect-ratio: 16/9;
  overflow: hidden;
  pointer-events: none;
}

.pres-fs-thumb-preview .pres-scale-host {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.pres-fullscreen-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
  overflow: hidden;
}

.pres-fullscreen-slide {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.pres-fullscreen-slide .pres-scale-host.pres-present-host {
  width: 100%;
  max-width: min(100%, calc((100vh - 140px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

.pres-fullscreen-slide .pres-scale-stage > .pres-slide {
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pres-fullscreen-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px;
  flex-shrink: 0;
}

.pres-fullscreen-nav {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.pres-fullscreen-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.pres-fullscreen-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pres-fullscreen-counter {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

/* Presentation Error */
.presentation-error {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .pres-content {
    grid-template-columns: 1fr;
  }
  
  .pres-thumbnails {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  
  .pres-slide-thumb {
    flex-shrink: 0;
    width: 130px;
  }
  
  .pres-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pres-toolbar {
    flex-wrap: wrap;
    padding: 10px 12px 14px;
  }

  .pres-toolbar .pres-action-btn {
    flex: 1;
    min-width: 0;
  }
  
  .pres-fullscreen-content {
    flex-direction: column;
  }
  
  .pres-fullscreen-thumbs {
    width: 100%;
    height: 100px;
    flex-direction: row;
    padding: 8px;
    gap: 8px;
  }
  
  .pres-fs-thumb {
    width: 120px;
    flex-shrink: 0;
  }
  
  .pres-fullscreen-main {
    padding: 12px;
  }
  
  .pres-fullscreen-slide {
    padding: 0;
  }
}

/* ============================================================================
   SLIDE EDIT BUTTON & MODAL
   ============================================================================ */

.slide-edit-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #FEBF0F;
  color: #003366;
  border: 2px solid rgba(0, 51, 102, 0.42);
  border-radius: 999px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  z-index: 10;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 4px 14px rgba(0, 51, 102, 0.16),
    0 2px 8px rgba(254, 191, 15, 0.32);
}

.pres-main-slide:hover .slide-edit-btn,
.pres-fullscreen-main:hover .slide-edit-btn {
  opacity: 1;
}

.slide-edit-btn:hover {
  background: #FFD84D;
  border-color: #003366;
  transform: scale(1.04);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 6px 20px rgba(0, 51, 102, 0.18),
    0 3px 12px rgba(254, 191, 15, 0.45);
}

.slide-edit-btn:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 3px;
}

.slide-edit-btn svg {
  stroke: currentColor;
}

.slide-layout-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 51, 102, 0.78);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.pres-main-slide:hover .slide-layout-btn,
.pres-fullscreen-main:hover .slide-layout-btn { opacity: 1; }
.slide-layout-btn:hover { background: rgba(0,51,102,0.95); }

/* Slide Edit Modal */
#slideEditModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-edit-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.slide-edit-modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: white;
  border-radius: 16px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideEditModalIn 0.2s ease;
}

@keyframes slideEditModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.slide-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
}

.slide-edit-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.slide-edit-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.slide-edit-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.slide-edit-modal-body {
  padding: 20px;
}

.slide-edit-modal-body textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.slide-edit-modal-body textarea:focus {
  outline: none;
  border-color: #FEBF0F;
  box-shadow: 0 0 0 3px rgba(254, 191, 15, 0.15);
}

.slide-edit-modal-body textarea::placeholder {
  color: #999;
}

.slide-edit-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.slide-edit-cancel {
  flex: 1;
  padding: 12px 20px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.slide-edit-cancel:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.slide-edit-submit {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FEBF0F 0%, #f0a500 100%);
  border: none;
  border-radius: 10px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.2s;
}

.slide-edit-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 191, 15, 0.4);
}

/* ── Blog visual editor overlay (article) ─────────────────────────────────── */
.bc-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 1px solid transparent; border-radius: 4px;
  background: none; cursor: pointer; color: #111827; font-size: 13px; font-weight: 600;
}
.bc-tool:hover { background: #f3f4f6; border-color: #e5e7eb; }
.bc-sep { display: inline-block; width: 1px; height: 20px; background: #e5e7eb; margin: 0 3px; }
.bc-sel {
  padding: 4px 7px; border: 1px solid #e5e7eb; border-radius: 4px;
  font-size: 12px; background: #fff; cursor: pointer; color: #111827; outline: none;
}
.bc-editor-body {
  max-width: 760px; margin: 0 auto; background: #fff; border-radius: 12px;
  padding: 40px 48px; min-height: 500px; outline: none;
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); caret-color: #003366;
}
.bc-editor-body:focus { box-shadow: 0 0 0 2px rgba(0,51,102,.15), 0 1px 6px rgba(0,0,0,.06); }
.bc-editor-body h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 12px; }
.bc-editor-body h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 6px; }
.bc-editor-body h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
.bc-editor-body h4 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.bc-editor-body p  { margin-bottom: 1.1rem; line-height: 1.8; font-family: Georgia, serif; font-size: 1.05rem; }
.bc-editor-body ul, .bc-editor-body ol { margin: 0 0 1.1rem 1.6rem; font-family: Georgia, serif; }
.bc-editor-body li { margin-bottom: .35rem; line-height: 1.7; }
.bc-editor-body a  { color: #2563eb; }
.bc-editor-body strong { font-weight: 700; }
.bc-editor-body em { font-style: italic; }
.bc-editor-body code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: .9em; font-family: monospace; }
.bc-editor-body blockquote { border-left: 4px solid #e5e7eb; padding: 10px 18px; margin: 1.4rem 0; background: #f9fafb; color: #555; font-style: italic; border-radius: 0 6px 6px 0; }
.bc-editor-body hr { border: none; border-top: 2px solid #f0f0f0; margin: 2.2rem 0; }
.bc-editor-body table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; }
.bc-editor-body th, .bc-editor-body td { text-align: left; padding: 9px 13px; border-bottom: 1px solid #e5e7eb; font-size: .95rem; }
.bc-editor-body th { background: #f9fafb; font-weight: 600; }
.bc-editor-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; }
@media (max-width: 700px) { .bc-editor-body { padding: 24px 18px; } }

/* ── Logo Generated Image — colour swatches & save button ─────────────────── */

.logo-gen-colors {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 10px 10px;
  flex-wrap: wrap;
}

.logo-gen-swatch-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-gen-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.12);
  flex-shrink: 0;
}

.logo-gen-hex {
  font-size: 12px;
  font-weight: 600;
  font-family: 'Menlo', 'Consolas', monospace;
  color: #334155;
  letter-spacing: .3px;
}

.logo-save-brand-btn {
  gap: 5px;
  color: #003366 !important;
  border-color: #003366 !important;
  font-weight: 600;
}

.logo-save-brand-btn:hover {
  background: #003366 !important;
  color: #ffffff !important;
}

/* dark mode */
.dark-mode .logo-gen-colors { background: #0f172a; border-color: #1e293b; }
.dark-mode .logo-gen-hex { color: #cbd5e1; }
.dark-mode .logo-save-brand-btn { color: #93c5fd !important; border-color: #334155 !important; }
.dark-mode .logo-save-brand-btn:hover { background: #FEBF0F !important; color: #003366 !important; border-color: #FEBF0F !important; }

/* ── Logo Agent Card ──────────────────────────────────────────────────────── */

.logo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.logo-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #003366 0%, #00264d 100%);
  border-bottom: 1px solid #e2e8f0;
}

.logo-badge {
  font-size: 12px;
  font-weight: 600;
  color: #FEBF0F;
  letter-spacing: .3px;
}

.logo-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-header-chips {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.logo-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
}

.logo-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}

.logo-chip-type  { background: #dbeafe; color: #1d4ed8; }
.logo-chip-style { background: #ede9fe; color: #6d28d9; }
.logo-chip-mood  { background: #d1fae5; color: #065f46; }

/* ── Concept panels ── */

.logo-concepts-list {
  padding: 0;
}

.logo-concept {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 16px;
}

.logo-concept:last-child { border-bottom: none; }

.logo-concept-primary {
  background: #fafafa;
}

.logo-concept-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-concept-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #003366;
  color: #FEBF0F;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.logo-concept-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

/* ── Compact swatches row (new colour-card design) ── */

.logo-swatches-row {
  display: flex;
  gap: 10px;
  padding: 6px 0 4px;
  flex-wrap: wrap;
}

.logo-swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.logo-hex {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  font-family: 'Menlo', 'Consolas', monospace;
  letter-spacing: .3px;
}

.logo-chips-inline {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

.logo-industry-chip {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  margin-left: auto;
}

.logo-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: #94a3b8;
}

/* ── Color palette row (legacy — kept for backwards compat) ── */

.logo-palette-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.logo-palette-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  min-width: 44px;
}

.logo-swatches {
  display: flex;
  gap: 4px;
  align-items: center;
}

.logo-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.12);
  flex-shrink: 0;
  cursor: help;
}

.logo-palette-text {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Field rows ── */

.logo-field {
  display: flex;
  gap: 8px;
  margin: 5px 0;
  font-size: 13px;
  line-height: 1.5;
  align-items: flex-start;
}

.logo-field-label {
  font-weight: 600;
  color: #475569;
  min-width: 84px;
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding-top: 2px;
}

.logo-field-value {
  color: #1e293b;
  font-size: 13px;
}

.logo-rationale {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin: 8px 0 4px;
  line-height: 1.6;
  padding: 8px 12px;
  background: #f8fafc;
  border-left: 3px solid #FEBF0F;
  border-radius: 0 4px 4px 0;
}

/* ── AI prompt block ── */

.logo-prompt-block {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.logo-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.logo-copy-prompt-btn {
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #003366;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.logo-copy-prompt-btn:hover {
  background: #003366;
  color: #ffffff;
  border-color: #003366;
}

.logo-prompt-text {
  padding: 10px 12px;
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
  font-family: 'Menlo', 'Consolas', monospace;
  background: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Footer copy button ── */

.logo-copy-footer {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.logo-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #003366;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.logo-copy-btn:hover {
  background: #003366;
  color: #ffffff;
  border-color: #003366;
}

/* ── Dark mode ── */

.dark-mode .logo-hex { color: #cbd5e1; }
.dark-mode .logo-empty { color: #64748b; }
.dark-mode .logo-card { background: #1e293b; border-color: #334155; }
.dark-mode .logo-card-header { background: linear-gradient(135deg, #001a33 0%, #00264d 100%); }
.dark-mode .logo-header-chips { background: #0f172a; border-color: #334155; }
.dark-mode .logo-chip  { background: #334155; color: #94a3b8; }
.dark-mode .logo-chip-type  { background: #1e3a5f; color: #93c5fd; }
.dark-mode .logo-chip-style { background: #2e1065; color: #c4b5fd; }
.dark-mode .logo-chip-mood  { background: #064e3b; color: #6ee7b7; }
.dark-mode .logo-concept { border-color: #1e293b; }
.dark-mode .logo-concept-primary { background: #0f172a; }
.dark-mode .logo-concept-name { color: #f1f5f9; }
.dark-mode .logo-field-value { color: #cbd5e1; }
.dark-mode .logo-palette-text { color: #64748b; }
.dark-mode .logo-rationale { background: #0f172a; color: #94a3b8; border-color: #FEBF0F; }
.dark-mode .logo-prompt-block { border-color: #334155; }
.dark-mode .logo-prompt-header { background: #0f172a; border-color: #334155; color: #94a3b8; }
.dark-mode .logo-copy-prompt-btn { background: #1e293b; color: #93c5fd; border-color: #334155; }
.dark-mode .logo-copy-prompt-btn:hover { background: #FEBF0F; color: #003366; border-color: #FEBF0F; }
.dark-mode .logo-prompt-text { background: #1e293b; color: #cbd5e1; }
.dark-mode .logo-copy-footer { background: #0f172a; border-color: #1e293b; }
.dark-mode .logo-copy-btn { background: #1e293b; color: #93c5fd; border-color: #334155; }
.dark-mode .logo-copy-btn:hover { background: #FEBF0F; color: #003366; border-color: #FEBF0F; }

/* ============================================================
   PROMPT BUILDER CARD — pb- prefix
   ============================================================ */

.pb-card {
  background: #ffffff;
  border: 1px solid #dde3ee;
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 0;
  box-shadow: 0 4px 24px rgba(0,51,102,0.08), 0 1px 4px rgba(0,0,0,0.04);
  font-family: inherit;
}

.pb-prompts-grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Individual prompt card */
.pb-prompt-card {
  border: 1px solid #e0e7f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,51,102,0.05);
  transition: box-shadow 0.2s;
}
.pb-prompt-card:hover {
  box-shadow: 0 4px 18px rgba(0,51,102,0.1);
}

/* Thin Ndovesha-blue accent bar at top of each card */
.pb-card-accent {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #003366 0%, #0055aa 100%);
}

/* Intro line shown above the prompts card */
.pb-intro-line {
  font-size: 0.9rem;
  font-weight: 600;
  color: #003366;
  margin: 4px 2px 8px;
  line-height: 1.4;
}
.pb-intro-line strong { color: #003366; }
.dark-mode .pb-intro-line { color: #93c5fd; }
.dark-mode .pb-intro-line strong { color: #ffffff; }

.pb-variation {
  border-bottom: 1px solid #edf1f7;
}
.pb-variation:last-child { border-bottom: none; }

.pb-var-label {
  display: inline-block;
  margin: 10px 14px 0;
  padding: 2px 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7a99;
  background: #f0f4fb;
  border: 1px solid #dde5f5;
  border-radius: 20px;
}

.pb-prompt-body {
  position: relative;
  padding: 10px 16px 12px;
  font-size: 0.83rem;
  line-height: 1.7;
  color: #2d3748;
  word-break: break-word;
}

/* Visible formatted prompt (paragraphs) */
.pb-prompt-formatted {
  line-height: 1.75;
}

/* Raw text for clipboard / open-in-agent — not shown */
.pb-prompt-raw {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: pre-wrap;
  border: 0;
}

.pb-p-para {
  margin: 0 0 0.65em;
  line-height: 1.75;
  color: inherit;
}

.pb-p-para:last-child {
  margin-bottom: 0;
}

.pb-prompt-hint {
  margin: 0 16px 4px;
  padding: 0 0 2px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #6b7a99;
  font-style: italic;
  border-left: 2px solid rgba(0, 51, 102, 0.12);
  padding-left: 10px;
}

.pb-prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 14px;
  flex-wrap: wrap;
}

.pb-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #ffffff;
  color: #003366;
  border: 1.5px solid #FEBF0F;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(254, 191, 15, 0.12);
}
.pb-copy-btn:hover {
  background: linear-gradient(135deg, #FEBF0F 0%, #f5a800 100%);
  color: #003366;
  border-color: #FEBF0F;
  box-shadow: 0 3px 12px rgba(254, 191, 15, 0.4);
  transform: translateY(-1px);
}

.pb-use-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #003366 0%, #00264d 100%);
  color: #ffffff;
  border: 1.5px solid #003366;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 51, 102, 0.2);
}
.pb-use-btn:hover {
  background: linear-gradient(180deg, #0a4d8a 0%, #003366 100%);
  border-color: #0055aa;
  box-shadow: 0 4px 14px rgba(0, 51, 102, 0.3);
  transform: translateY(-1px);
}
.pb-use-btn svg { stroke: currentColor; }
.dark-mode .pb-use-btn {
  color: #f8fafc;
  background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 100%);
  border-color: #2d3d58;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.dark-mode .pb-use-btn:hover {
  background: linear-gradient(180deg, #2a4d7a 0%, #1e3a5f 100%);
  border-color: #3d5a80;
}

.pb-copy-confirm {
  font-size: 0.72rem;
  color: #16a34a;
  font-weight: 600;
  margin-left: 4px;
}

.dark-mode .pb-prompt-actions { border-top-color: #334155; }

.pb-empty {
  padding: 20px;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

/* Deep-link agent loading skeleton */
.pb-deeplink-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  gap: 14px;
  color: var(--text-muted, #9ca3af);
  font-family: 'Ubuntu', system-ui, sans-serif;
  font-size: 0.9rem;
}
.pb-dl-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(0, 51, 102, 0.12);
  border-top-color: #003366;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.dark-mode .pb-dl-spinner { border-color: rgba(255,255,255,0.1); border-top-color: #FEBF0F; }

/* Carousel summary card — appended after all carousel slides are generated */
.carousel-summary-card {
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 51, 102, 0.14);
  border-radius: 16px;
  background:
    radial-gradient(110% 100% at 0% 0%, rgba(254, 191, 15, 0.16) 0%, rgba(254, 191, 15, 0) 58%),
    linear-gradient(135deg, rgba(254, 191, 15, 0.05), rgba(0, 51, 102, 0.05));
  box-shadow: 0 10px 28px rgba(0, 51, 102, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dark-mode .carousel-summary-card {
  border-color: rgba(254, 191, 15, 0.18);
  background:
    radial-gradient(110% 100% at 0% 0%, rgba(254, 191, 15, 0.14) 0%, rgba(254, 191, 15, 0) 58%),
    linear-gradient(135deg, rgba(254, 191, 15, 0.08), rgba(30, 41, 59, 0.7));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}
.carousel-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.carousel-summary-icon { font-size: 22px; }
.carousel-summary-title { display: flex; flex-direction: column; line-height: 1.3; }
.carousel-summary-title strong { font-size: 0.95rem; color: inherit; }
.carousel-summary-sub { font-size: 0.8rem; color: var(--text-muted, #6b7280); }
.carousel-summary-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.carousel-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 51, 102, 0.16);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 600;
  color: #003366;
}
.carousel-meta-pill.subtle {
  font-weight: 500;
  color: #5b6475;
}
.dark-mode .carousel-meta-pill {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(254, 191, 15, 0.24);
  color: #f8fafc;
}
.dark-mode .carousel-meta-pill.subtle {
  color: #cbd5e1;
}
.carousel-summary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.carousel-summary-hint { font-size: 0.75rem; color: var(--text-muted, #6b7280); }
.carousel-download-all[disabled] { opacity: 0.5; cursor: not-allowed; }
.carousel-download-all {
  background: linear-gradient(135deg, #FEBF0F 0%, #f5a800 100%);
  color: #003366;
  border: 1px solid rgba(254, 191, 15, 0.72);
  box-shadow: 0 8px 20px rgba(254, 191, 15, 0.26);
}
.carousel-download-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(254, 191, 15, 0.34);
}
.carousel-caption-suggest {
  font-size: 0.8rem;
  color: #475569;
  border-top: 1px dashed rgba(0, 51, 102, 0.16);
  padding-top: 10px;
}
.carousel-caption-suggest strong { color: #003366; }
.dark-mode .carousel-caption-suggest {
  color: #cbd5e1;
  border-top-color: rgba(254, 191, 15, 0.22);
}
.dark-mode .carousel-caption-suggest strong { color: #FEBF0F; }

/* Dark mode */
.dark-mode .pb-card { background: #1a2235; border-color: #2d3d58; box-shadow: 0 4px 24px rgba(0,0,0,0.25); }
.dark-mode .pb-prompts-grid { background: #1a2235; }
.dark-mode .pb-prompt-card { background: #111827; border-color: #2d3d58; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.dark-mode .pb-prompt-body { color: #cbd5e1; }
.dark-mode .pb-variation { border-bottom-color: #2d3d58; }
.dark-mode .pb-var-label { color: #8fa3c8; background: #1e2d45; border-color: #2d3d58; }
.dark-mode .pb-copy-btn { background: #1e293b; color: #FEBF0F; border-color: #c9a32a; }
.dark-mode .pb-copy-btn:hover { background: linear-gradient(135deg, #FEBF0F 0%, #f5a800 100%); color: #003366; border-color: #FEBF0F; }
.dark-mode .pb-prompt-hint { color: #94a3b8; border-left-color: rgba(254, 191, 15, 0.2); }

/* ============================================================
   SLIDE CANVAS EDITOR (SCE) — WYSIWYG Canvas
   ============================================================ */

.sce-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  backdrop-filter: blur(4px);
}

.sce-canvas-editor {
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(254,191,15,0.12) 0%, transparent 55%),
    linear-gradient(165deg, #0a1628 0%, #0b1f3a 38%, #0d2847 100%);
  border-radius: 18px;
  width: 100%;
  max-width: 1120px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 32px 96px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.06),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid rgba(254,191,15,0.1);
}

/* ── Text format strip (below main toolbar, never scrolls under it) ── */
.sce-format-strip {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px 10px;
  background:
    linear-gradient(90deg, rgba(0, 51, 102, 0.35) 0%, transparent 22%, transparent 78%, rgba(254, 191, 15, 0.12) 100%),
    linear-gradient(180deg, rgba(254, 191, 15, 0.1) 0%, transparent 42%),
    linear-gradient(155deg, #071a32 0%, #0a2744 45%, #051018 100%);
  border-bottom: 1px solid rgba(254, 191, 15, 0.22);
  position: relative;
  z-index: 8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Toolbar — Ndovesha navy + gold ribbon (pairs with format strip) ── */
.sce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0;
  padding: 12px 18px 10px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(254, 191, 15, 0.22) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(0, 51, 102, 0.55) 0%, transparent 50%),
    linear-gradient(180deg, rgba(254, 191, 15, 0.12) 0%, transparent 38%),
    linear-gradient(158deg, #003366 0%, #082a4a 32%, #041428 72%, #0a1628 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(254, 191, 15, 0.25);
  flex-shrink: 0;
  gap: 12px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(254, 191, 15, 0.08);
  position: relative;
  z-index: 9;
}
.sce-toolbar-left, .sce-toolbar-center, .sce-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sce-toolbar-left { min-width: 0; flex: 1 1 auto; }
.sce-toolbar-right { flex-shrink: 0; }
/* Center tools always drop to their own row, never overlap nav buttons */
.sce-toolbar-center {
  order: 3;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(254, 191, 15, 0.12);
  gap: 5px;
}

.sce-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(165deg, rgba(0, 51, 102, 0.55) 0%, rgba(15, 23, 42, 0.35) 100%);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(254, 191, 15, 0.28);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 0 rgba(0,0,0,0.2);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  margin-right: 8px;
}
.sce-back-btn:hover {
  color: #fff;
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.2) 0%, rgba(0, 51, 102, 0.45) 100%);
  border-color: rgba(254, 191, 15, 0.5);
}

.sce-slide-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 2px 6px;
  box-shadow: 0 0 0 1px rgba(254, 191, 15, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sce-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  font-family: 'Ubuntu', system-ui, sans-serif;
}
.sce-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); color: #fff; }
.sce-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.sce-slide-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 0 2px;
}

/* ── Layout pill button in canvas toolbar ── */
.sce-layout-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: 'Ubuntu', system-ui, sans-serif;
}
.sce-layout-pill:hover { background: rgba(255,255,255,0.22); }
.sce-layout-hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Canvas layout picker panel — single horizontal scrollable strip ── */
.sce-layout-picker-panel {
  background: #1e293b;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 8px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sce-layout-picker-panel::-webkit-scrollbar { height: 4px; }
.sce-layout-picker-panel::-webkit-scrollbar-track { background: transparent; }
.sce-layout-picker-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.sce-lp-strip {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: nowrap;
  width: max-content;
}
/* Legacy group classes kept for compatibility */
.sce-lp-inner { display: flex; flex-direction: row; gap: 8px; }
.sce-lp-group-label { display: none; }
.sce-lp-row { display: flex; gap: 8px; flex-wrap: nowrap; }
.sce-lp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255,255,255,0.04);
}
.sce-lp-item:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
}
.sce-lp-active {
  border-color: #FEBF0F !important;
  background: rgba(254,191,15,0.1) !important;
}
.sce-lp-thumb {
  width: 72px;
  height: 45px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sce-lp-thumb svg { display: block; }
.sce-lp-name {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

.sce-type-select {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.sce-type-select option { background: #1e293b; color: #f1f5f9; }

.sce-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid rgba(254, 191, 15, 0.22);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 0 rgba(0, 0, 0, 0.25);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
  white-space: nowrap;
}
.sce-tool-btn:hover {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-color: rgba(254, 191, 15, 0.45);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(0, 51, 102, 0.35);
}
.sce-tool-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* Toolbar centre — alternate navy / gold chips (matches header gradient) */
.sce-toolbar-center .sce-tool-btn:nth-child(odd) {
  background: linear-gradient(165deg, rgba(0, 51, 102, 0.55) 0%, rgba(15, 23, 42, 0.42) 100%);
  border-color: rgba(254, 191, 15, 0.42);
  color: #f1f5f9;
}
.sce-toolbar-center .sce-tool-btn:nth-child(odd):hover {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.22) 0%, rgba(0, 51, 102, 0.48) 100%);
  border-color: rgba(254, 191, 15, 0.65);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(254, 191, 15, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.sce-toolbar-center .sce-tool-btn:nth-child(even) {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.16) 0%, rgba(0, 51, 102, 0.38) 100%);
  border-color: rgba(147, 197, 253, 0.38);
  color: #e0f2fe;
}
.sce-toolbar-center .sce-tool-btn:nth-child(even):hover {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.28) 0%, rgba(0, 51, 102, 0.52) 100%);
  border-color: rgba(254, 191, 15, 0.55);
  color: #fff;
}
.sce-toolbar-center .sce-tool-upload {
  color: #bfdbfe !important;
  border-color: rgba(147, 197, 253, 0.45) !important;
}
.sce-toolbar-center .sce-tool-upload:hover {
  color: #f0f9ff !important;
  border-color: rgba(254, 191, 15, 0.5) !important;
}
.sce-toolbar-center .sce-tool-add {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.22) 0%, rgba(0, 51, 102, 0.45) 100%) !important;
  border-color: rgba(254, 191, 15, 0.55) !important;
  color: #fffbeb !important;
}
.sce-toolbar-center .sce-tool-add:hover {
  background: linear-gradient(165deg, rgba(254, 191, 15, 0.38) 0%, rgba(0, 51, 102, 0.55) 100%) !important;
  border-color: #FEBF0F !important;
}
.sce-toolbar-center .sce-tool-img {
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #a7f3d0 !important;
}
.sce-toolbar-center .sce-tool-img:hover {
  border-color: rgba(254, 191, 15, 0.45) !important;
  color: #ecfdf5 !important;
}

/* ── Add Element dropdown menu ── */
.sce-tool-menu-wrap { position: relative; display: inline-block; }
.sce-tool-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  background: #14141a;
  border: 1px solid rgba(254,191,15,0.2);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  animation: sce-menu-in 0.12s ease-out;
}
@keyframes sce-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sce-tool-menu[hidden] { display: none; }
.sce-tool-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  border-radius: 7px;
  text-align: left;
  font-family: 'Ubuntu', system-ui, sans-serif;
  transition: background 0.12s;
}
.sce-tool-menu-item:hover { background: rgba(254,191,15,0.12); color: #fff; }
.sce-tool-menu-item svg { flex-shrink: 0; color: #FEBF0F; }
.sce-tool-menu-item span { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.sce-tool-menu-item b   { font-size: 0.82rem; font-weight: 600; }
.sce-tool-menu-item em  { font-size: 0.7rem;  font-style: normal; color: #9ca3af; }

.sce-done-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 7px 18px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid rgba(0, 51, 102, 0.45);
  background: linear-gradient(185deg, #fef08a 0%, #FEBF0F 38%, #d97706 100%);
  color: #0c1929;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(0, 51, 102, 0.35),
    0 4px 0 rgba(0, 51, 102, 0.2),
    0 10px 28px rgba(254, 191, 15, 0.35);
  transition: filter 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.sce-done-btn:hover {
  filter: brightness(1.06);
  border-color: rgba(0, 51, 102, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(0, 51, 102, 0.35),
    0 8px 22px rgba(254, 191, 15, 0.35);
}
.sce-done-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* ── Color Panel (toggle) ── */
.sce-color-panel {
  display: flex;
  gap: 20px;
  padding: 8px 16px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  align-items: center;
}
.sce-cpair {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sce-cpair label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}
.sce-cpair input[type="color"] {
  width: 28px;
  height: 24px;
  border: 1px solid #475569;
  border-radius: 5px;
  padding: 1px;
  cursor: pointer;
  background: none;
}
.sce-cpair span {
  font-size: 0.72rem;
  font-family: monospace;
  color: #64748b;
}

/* ── Editor Body: sidebar + canvas row ── */
.sce-editor-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Layout Sidebar ── */
.sce-layout-sidebar {
  width: 170px;
  flex-shrink: 0;
  background: #0d1526;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sce-sidebar-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 8px 4px;
  flex-shrink: 0;
}
.sce-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.sce-sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sce-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Sidebar section dividers — Best Match / Other */
.sce-sl-section-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FEBF0F;
  padding: 6px 2px 2px;
  flex-shrink: 0;
}
.sce-sl-section-other {
  color: #475569;
  padding-top: 8px;
}

/* Sidebar layout item */
.sce-sl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 5px 6px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  background: rgba(255,255,255,0.03);
}
.sce-sl-item:active { transform: scale(0.97); }
.sce-sl-item:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
}
.sce-sl-active {
  border-color: #FEBF0F !important;
  background: rgba(254,191,15,0.1) !important;
}
.sce-sl-thumb {
  width: 148px;
  height: 83px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sce-sl-thumb svg { display: block; }

/* Live layout preview — scaler wrapper fixes height:100% resolution */
.sce-sl-live-thumb {
  width: 148px;
  height: 93px;   /* 148 * 9/16 ≈ 83, add 10px for label room */
  overflow: hidden;
  position: relative;
  background: #1e293b;
  border-radius: 5px;
  flex-shrink: 0;
}
/* The scaler is 640×360 so height:100% inside .pres-slide = 360px */
.sce-sl-preview-scaler {
  position: absolute;
  top: 0;
  left: 0;
  width: 640px;
  height: 360px;
  transform: scale(0.23125); /* 148/640 = 0.23125 */
  transform-origin: top left;
  overflow: hidden;
  pointer-events: none;
}
.sce-sl-preview-scaler .pres-slide {
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none;
}
.sce-sl-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

/* ── Layout label in toolbar (static, no button) ── */
.sce-layout-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fef9c3;
  white-space: nowrap;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(0, 51, 102, 0.65) 0%, rgba(254, 191, 15, 0.18) 100%);
  border: 1px solid rgba(254, 191, 15, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sce-layout-label svg {
  color: #FEBF0F;
  opacity: 0.95;
}

/* ── Delete slide — neutral by default; warm red only on hover (matches toolbar family) ── */
.sce-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
  white-space: nowrap;
}
.sce-delete-btn:hover {
  border-color: rgba(248,113,113,0.55);
  background: rgba(239,68,68,0.18);
  color: #fff;
}
.sce-delete-btn:active {
  transform: translateY(1px);
}
.sce-delete-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Upload image tool button */
.sce-tool-upload { border-color: rgba(99,102,241,0.4); color: #a5b4fc; }
.sce-tool-upload:hover { background: rgba(99,102,241,0.15); }

/* ── Format Bar — text alignment / bold / italic / font-size ── */
.sce-format-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  background: rgba(15,23,42,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity 0.18s ease, box-shadow 0.18s ease;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.sce-format-bar.sce-fmt-visible {
  opacity: 1;
  pointer-events: all;
}
.sce-fmt-btn {
  background: none;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.7);
  border-radius: 5px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sce-fmt-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }
.sce-fmt-btn.sce-fmt-active { background: rgba(254,191,15,0.15); color: #FEBF0F; border-color: rgba(254,191,15,0.4); }
.sce-fmt-bold  { font-weight: 700; font-size: 0.85rem; }
.sce-fmt-italic { font-style: italic; font-size: 0.85rem; }
.sce-fmt-inc, .sce-fmt-dec { font-size: 0.68rem; font-weight: 700; letter-spacing: -0.03em; }
.sce-fmt-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.12);
  margin: 0 3px;
}

/* Format bar — text colour label (A + swatch chip + hidden colour input) */
.sce-fmt-color-label {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 0 5px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.sce-fmt-color-label:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.sce-fmt-color-a {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  line-height: 1;
}
.sce-fmt-color-swatch {
  display: block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: #000;
  margin-top: 2px;
}
.sce-fmt-color-label input[type=color] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
}

/* Change Layout button */
.sce-tool-layout { border-color: rgba(186,230,253,0.35); color: #bae6fd; font-weight: 600; }
.sce-tool-layout:hover { background: rgba(186,230,253,0.15); border-color: rgba(186,230,253,0.6); color: #e0f2fe; }

/* ── Layout Panel — right-side drawer ── */
.sce-lp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.sce-lp-backdrop.sce-lp-open { opacity: 1; pointer-events: all; }

.sce-lp-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: #0d1526;
  border-left: 1px solid rgba(255,255,255,0.09);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
.sce-lp-panel.sce-lp-open { transform: translateX(0); }

.sce-lp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sce-lp-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; }
.sce-lp-subtitle { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 2px; }

.sce-lp-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.sce-lp-close:hover { color: #fff; }

.sce-lp-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sce-lp-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 10px 2px 6px;
}

.sce-lp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.sce-lp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 6px 7px;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  text-align: center;
}
.sce-lp-item:hover { border-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.08); }
.sce-lp-item:active { transform: scale(0.97); }

/* Reuse existing preview thumb styles inside panel items */
.sce-lp-item .sce-sl-live-thumb { width: 128px; height: 72px; }
.sce-lp-item .sce-sl-preview-scaler { transform: scale(0.2); }
.sce-lp-item .sce-sl-thumb { width: 128px; height: 72px; }

.sce-lp-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  line-height: 1.2;
  width: 100%;
  text-align: center;
}
.sce-lp-item:hover .sce-lp-name { color: #fff; }

.sce-lp-empty {
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  text-align: center;
  padding: 32px 16px;
  line-height: 1.6;
}

/* Text box tool button */
.sce-tool-textbox { border-color: rgba(52,211,153,0.3); color: #6ee7b7; }
.sce-tool-textbox:hover { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.6); }

/* Undo layout button */
.sce-undo-btn {
  border-color: rgba(255,255,255,0.14) !important;
  color: rgba(255,255,255,0.88) !important;
  background: rgba(255,255,255,0.06) !important;
}
.sce-undo-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.24) !important;
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}
.sce-undo-btn:disabled { opacity: 0.28 !important; cursor: not-allowed; }

/* Remix variant items in sidebar — distinct visual treatment */
.sce-sl-remix { border-color: rgba(254,191,15,0.2) !important; }
.sce-sl-remix:hover { border-color: rgba(254,191,15,0.5) !important; background: rgba(254,191,15,0.06) !important; }
.sce-sl-remix.sce-sl-active { border-color: #FEBF0F !important; background: rgba(254,191,15,0.12) !important; }

/* ── Overlay layer — floating items on top of slide content ── */
.sce-ov-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}
.sce-ov-drag-slot {
  border: 2px dashed rgba(254, 191, 15, 0.65);
  background: rgba(254, 191, 15, 0.1);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.sce-ov-item {
  position: absolute;
  pointer-events: all;
}
.sce-ov-move,
.sce-ov-img,
.sce-ov-shape-fill,
.sce-ov-divider-line {
  user-select: none;
}
.sce-ov-textbox,
.sce-ov-callout-title,
.sce-ov-callout-body {
  user-select: text;
}
.sce-ov-item.sce-ov-moving {
  z-index: 60 !important;
  opacity: 0.95;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.45));
  cursor: grabbing;
}
.sce-ov-item:hover .sce-ov-move,
.sce-ov-item:hover .sce-ov-del,
.sce-ov-item:hover .sce-ov-rh { opacity: 1; }

/* Drag move handle — top-left grab icon */
.sce-ov-move {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 4px;
  padding: 2px 4px;
  cursor: move;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}
.sce-ov-move::after { content: 'Move'; }

/* Overlay image */
.sce-ov-img {
  width: 100%;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  outline: 1.5px solid transparent;
  transition: outline-color 0.15s;
}
.sce-ov-item:hover .sce-ov-img { outline-color: rgba(255,255,255,0.5); }
.sce-ov-moving .sce-ov-img { outline-color: #FEBF0F; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }

/* Overlay text box — fully transparent by default so it feels like real free text
   floating on the slide; only shows a dashed outline on hover/focus for affordance. */
.sce-ov-text {
  min-width: 80px;
}
.sce-ov-textbox {
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.5;
  outline: none;
  cursor: text;
  min-height: 2em;
  transition: border-color 0.15s, background 0.15s;
}
.sce-ov-item:hover .sce-ov-textbox {
  border-color: rgba(254,191,15,0.6);
  background: rgba(255,255,255,0.04);
}
.sce-ov-textbox:focus {
  border-color: #FEBF0F;
  background: rgba(255,255,255,0.08);
}

/* ── Overlay callout box — title + body with a colored left accent bar ── */
.sce-ov-callout { min-width: 140px; }
.sce-ov-callout-box {
  background: rgba(255,255,255,0.96);
  border-radius: 10px;
  padding: 12px 14px 12px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  /* border-left color comes inline so user-picked accent flows through */
}
.sce-ov-callout-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  outline: none;
  margin-bottom: 4px;
}
.sce-ov-callout-body {
  font-size: 0.78rem;
  color: #4b5563;
  line-height: 1.45;
  outline: none;
}

/* ── Overlay divider — thin horizontal accent line ── */
.sce-ov-divider {
  min-width: 80px;
  height: auto;
  padding: 8px 0;  /* click target padding */
}
.sce-ov-divider-line {
  width: 100%;
  height: 2px;
  border-radius: 2px;
}

/* ── Overlay shape — soft decorative fill (circle / square) ── */
.sce-ov-shape { min-width: 40px; }
.sce-ov-shape-fill {
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.15s;
}
.sce-ov-item:hover .sce-ov-shape-fill { opacity: 0.4; }

/* 8-direction resize handles */
.sce-ov-rh {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1.5px solid #003366;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 22;
  box-sizing: border-box;
}
.sce-ov-rh-nw { top: -5px;              left: -5px;              cursor: nw-resize; }
.sce-ov-rh-n  { top: -5px;              left: calc(50% - 4.5px); cursor: n-resize; }
.sce-ov-rh-ne { top: -5px;              right: -5px;             cursor: ne-resize; }
.sce-ov-rh-e  { top: calc(50% - 4.5px); right: -5px;             cursor: e-resize; }
.sce-ov-rh-se { bottom: -5px;           right: -5px;             cursor: se-resize; }
.sce-ov-rh-s  { bottom: -5px;           left: calc(50% - 4.5px); cursor: s-resize; }
.sce-ov-rh-sw { bottom: -5px;           left: -5px;              cursor: sw-resize; }
.sce-ov-rh-w  { top: calc(50% - 4.5px); left: -5px;              cursor: w-resize; }

/* Delete button */
.sce-ov-del {
  position: absolute;
  top: -10px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}

/* ── Canvas element drag handles ── */
.sce-el-drag-handle {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.85);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 15;
  pointer-events: all;
}
/* Show handle when hovering any draggable host element, at any depth.
   Previously limited to direct children of .sce-slide-canvas which meant nested
   cards (e.g. individual stat cards inside a grid) could never show their handle. */
.sce-slide-canvas *:hover > .sce-el-drag-handle { opacity: 0.85; }
.sce-hero-card:hover > .sce-el-drag-handle,
.sce-feature-card:hover > .sce-el-drag-handle,
.sce-process-step:hover > .sce-el-drag-handle,
.sce-stat-card:hover > .sce-el-drag-handle,
.sce-card-item:hover > .sce-el-drag-handle,
.sce-li-row:hover > .sce-el-drag-handle { opacity: 1; }
.sce-el-drag-handle:hover { opacity: 1 !important; background: rgba(254,191,15,0.9); color: #000; }
.sce-el-dragging {
  outline: 1.5px dashed rgba(254,191,15,0.7);
  z-index: 50 !important;
  cursor: move;
}

/* ── Image drag (focal-point pan) ── */
.sce-img-zone { cursor: move; }
.sce-img-zone button,
.sce-img-zone input  { cursor: auto; }
.sce-img-dragging .sce-img-preview {
  transition: none !important;
  cursor: grabbing;
}
.sce-img-dragging .sce-img-overlay { opacity: 0 !important; pointer-events: none; }
.sce-img-drag-hint {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  z-index: 5;
}
.sce-img-zone:hover .sce-img-drag-hint { opacity: 1; }
.sce-img-dragging .sce-img-drag-hint  { opacity: 0; }

/* ── Drag-to-reorder list items ── */
.sce-li-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  position: relative;
}
.sce-drag-handle {
  flex-shrink: 0;
  min-width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: rgba(0,51,102,0.88);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  user-select: none;
  padding: 0 5px;
  margin-top: 1px;
  border-radius: 6px;
  background: rgba(0,51,102,0.09);
  border: 1px solid rgba(0,51,102,0.14);
  box-shadow: 0 1px 2px rgba(0,51,102,0.06);
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.sce-li-row:hover .sce-drag-handle,
.sce-drag-handle:hover {
  color: #003366;
  background: rgba(254,191,15,0.42);
  border-color: rgba(0,51,102,0.22);
  box-shadow: 0 2px 5px rgba(0,51,102,0.12);
}
/* Cover / closing slides (grips on dark gradient) */
.sce-drag-handle--on-dark {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: rgba(255,255,255,0.92) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sce-li-row:hover .sce-drag-handle--on-dark,
.sce-drag-handle--on-dark:hover {
  background: rgba(254,191,15,0.92);
  border-color: rgba(0,51,102,0.2);
  color: #003366 !important;
}
.sce-li-dragging .sce-drag-handle { cursor: grabbing; }

/* Card / timeline shells — same reorder affordance as old free-drag handle */
.sce-card-drag {
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0,51,102,0.14);
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  color: #003366 !important;
  font-size: 11px !important;
  font-weight: 800;
  line-height: 1 !important;
  letter-spacing: -0.04em;
  cursor: grab;
  user-select: none;
  transition: background 0.12s, box-shadow 0.12s, opacity 0.12s;
  opacity: 0.95;
}
.sce-hero-card:hover .sce-card-drag,
.sce-stat-card:hover .sce-card-drag,
.sce-feature-card:hover .sce-card-drag,
.sce-process-step:hover .sce-card-drag,
.sce-card-item:hover .sce-card-drag,
.sce-tl-item:hover .sce-card-drag {
  opacity: 1;
  background: rgba(254,191,15,0.92);
  border-color: rgba(0,51,102,0.22);
  box-shadow: 0 2px 8px rgba(0,51,102,0.14);
}
.sce-li-dragging .sce-card-drag { cursor: grabbing; }
.sce-li-dragging {
  opacity: 0.4;
  border: 1.5px dashed rgba(0,51,102,0.4);
  border-radius: 6px;
}
.sce-li-drag-over {
  border-top: 2px solid #003366;
  border-radius: 4px;
}

/* ── Canvas Area ── */
.sce-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 22px 12px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(254,191,15,0.14) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(0,51,102,0.12) 0%, transparent 45%),
    linear-gradient(168deg, #e8eef9 0%, #e4eaf6 35%, #f3f1ea 100%);
}
.sce-canvas-area::-webkit-scrollbar { width: 8px; }
.sce-canvas-area::-webkit-scrollbar-thumb { background: rgba(0,51,102,0.18); border-radius: 4px; }
.sce-canvas-area::-webkit-scrollbar-thumb:hover { background: rgba(0,51,102,0.34); }

/*
 * Frame sizing strategy: keep 16:9 aspect ratio but let the slide grow to use the
 * actual available vertical space. Width is the smaller of (100%, height*16/9),
 * so the slide automatically scales up on tall viewports instead of sitting as a
 * short band with empty space below it (the “squeezed” feel).
 */
.sce-canvas-frame {
  width: min(100%, calc((100vh - 170px) * 16 / 9));
  max-width: 1020px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.12),
    inset 0 0 0 1px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.sce-canvas-slide {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible; /* allows 8-handle resize dots to extend outside item bounds */
}

/* Allow slide content to scroll internally when it overflows the 16:9 frame,
   instead of being clipped at the bottom. */
.sce-slide-canvas {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
}
.sce-slide-canvas::-webkit-scrollbar { width: 5px; }
.sce-slide-canvas::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

.sce-canvas-hint {
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
  margin-top: 10px;
  flex-shrink: 0;
  max-width: 52rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

/* Whole-block drag: grab cursor (drag starts after small pointer move) */
.sce-editable--free-target:not(.sce-el-dragging) {
  cursor: grab;
}

.sce-editable.sce-el-dragging {
  cursor: grabbing;
  outline: 2px solid rgba(254,191,15,0.95) !important;
  outline-offset: 2px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35) !important;
  z-index: 80 !important;
}
.sce-editable {
  border-radius: 4px;
  transition: box-shadow 0.15s, background 0.15s;
  min-width: 40px;
}
.sce-editable:hover {
  box-shadow: 0 0 0 2px rgba(254,191,15,0.3);
}
.sce-editable:focus, .sce-editable.sce-editing {
  box-shadow: 0 0 0 2px #FEBF0F;
  background: rgba(254,191,15,0.06);
}
.sce-editable:empty::before {
  content: attr(placeholder);
  opacity: 0.4;
  pointer-events: none;
}

.sce-list-item {
  border-radius: 6px;
  transition: box-shadow 0.15s;
}
.sce-list-item:hover { box-shadow: 0 0 0 2px rgba(254,191,15,0.25); }
.sce-list-item:focus { box-shadow: 0 0 0 2px #FEBF0F; }

.sce-add-btn {
  background: transparent;
  border: 1px dashed rgba(148,163,184,0.4);
  color: #94a3b8;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 6px;
}
.sce-add-btn:hover { border-color: #FEBF0F; color: #FEBF0F; background: rgba(254,191,15,0.05); }

/* Full-bleed hero canvas — fill height so the image zone stretches */
.sce-imgbg-canvas {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
}
.sce-imgbg-canvas .sce-img-zone {
  flex: 1;
  min-height: 0;
}

/* Free-positioned cards (stats, features, team, …) — drag handle */
.sce-card-floating-move {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 8;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: linear-gradient(145deg, #fffef8, #fde68a);
  color: #0f172a;
  font-size: 15px;
  line-height: 1;
  cursor: grab;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sce-card-floating-move:active {
  cursor: grabbing;
}
.sce-free-card-dragging {
  opacity: 0.96;
  z-index: 50 !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}
.sce-free-card-inner .sce-stat-card,
.sce-free-card-inner .sce-feature-card,
.sce-free-card-inner .sce-hero-card,
.sce-free-card-inner .sce-tl-item,
.sce-free-card-inner .sce-process-step {
  position: relative;
  height: 100%;
}

/* ── Image Zone ── */
.sce-img-zone {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
.sce-img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 1;
  min-height: 0;
}
.sce-img-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.82rem;
  min-height: 140px;
}
.sce-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.sce-img-zone:hover .sce-img-overlay { opacity: 1; }
.sce-img-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-family: 'Ubuntu', system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: rgba(255,255,255,0.95);
  color: #1e293b;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sce-img-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.sce-img-desc-input {
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #374151;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  flex-shrink: 0;
}
.sce-img-desc-input:focus { outline: none; border-top-color: #FEBF0F; }
.sce-img-loading .sce-img-overlay { opacity: 0 !important; }
.sce-img-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(248,250,252,0.92);
  z-index: 5;
}
.sce-img-spinner span { font-size: 0.8rem; color: #374151; font-weight: 600; }
.sce-spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #003366;
  border-radius: 50%;
  animation: sceSpin 0.8s linear infinite;
}
@keyframes sceSpin { to { transform: rotate(360deg); } }

/* ── Inline select & JSON area ── */
.sce-inline-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}
.sce-json-area {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.78rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #111827;
  background: #f8fafc;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
}
.sce-json-area:focus { outline: none; border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,0.1); }

/* ── Chart Editor ── */
.sce-chart-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.75rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  box-sizing: border-box;
}
.sce-chart-input:focus { outline: none; border-color: #003366; }
.sce-chart-val { max-width: 70px; }
.sce-chart-del {
  width: 22px;
  height: 22px;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}
.sce-chart-del:hover { background: #fca5a5; }
#sceChartPreview .pres-slide {
  width: 100% !important;
  height: 100% !important;
}

/* ── Bottom Bar ── */
.sce-bottom-bar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  /* Neutral charcoal to match the rest of the editor chrome. */
  background: #1a1a1f;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  align-items: center;
}
.sce-ai-prompt {
  display: flex;
  flex: 1;
  gap: 6px;
}
.sce-ai-field {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #f1f5f9;
  background: #111115;
  font-family: inherit;
  box-sizing: border-box;
}
.sce-ai-field:focus { outline: none; border-color: rgba(254,191,15,0.55); box-shadow: 0 0 0 3px rgba(254,191,15,0.18); }
.sce-ai-field::placeholder { color: #64748b; }

.sce-ai-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.1);
  color: #93c5fd;
  transition: all 0.15s;
  white-space: nowrap;
}
.sce-ai-go:hover { background: rgba(96,165,250,0.2); color: #bfdbfe; }

.sce-notes-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sce-notes-icon { font-size: 0.85rem; }
.sce-notes-input {
  width: 180px;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 7px;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
}
.sce-notes-input:focus { outline: none; border-color: #60a5fa; }
.sce-notes-input::placeholder { color: #475569; }

/* ── Mobile ── */
@media (max-width: 700px) {
  .sce-canvas-editor { max-height: 100vh; border-radius: 0; }
  .sce-toolbar { flex-wrap: wrap; padding: 8px 12px; }
  .sce-toolbar-center { order: 3; width: 100%; justify-content: center; margin-top: 6px; }
  .sce-canvas-area { padding: 12px 10px 6px; }
  .sce-canvas-frame { aspect-ratio: auto; min-height: 240px; }
  .sce-bottom-bar { flex-direction: column; gap: 8px; }
  .sce-notes-input { width: 100%; }
}

/* ============================================================
   WEBSITE CANVAS EDITOR (WCE) — WYSIWYG Website Editor
   ============================================================ */

.wce-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}

.wce-editor {
  background: #1e293b;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── WCE Toolbar ── */
.wce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(135deg, #003366 0%, #001a33 100%);
  flex-shrink: 0;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.wce-toolbar-left, .wce-toolbar-center, .wce-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wce-toolbar-left { min-width: 0; }
.wce-toolbar-right { flex-shrink: 0; }

.wce-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 8px;
}
.wce-back-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}

.wce-title-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  font-family: 'Ubuntu', system-ui, sans-serif;
}

.wce-align-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.wce-align-group .wce-tool-btn { padding: 5px 7px; }

.wce-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  transition: all 0.15s;
  white-space: nowrap;
}
.wce-tool-btn:hover { background: rgba(255,255,255,0.18); color: white; }

.wce-done-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Ubuntu', system-ui, sans-serif;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: #FEBF0F;
  color: #003366;
  transition: background 0.15s;
}
.wce-done-btn:hover { background: #e6ab00; }

/* ── Device Toggle ── */
.wce-device-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 2px;
}
.wce-device-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.15s;
}
.wce-device-btn:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.08); }
.wce-device-btn.active { background: rgba(255,255,255,0.15); color: #FEBF0F; }

/* ── WCE Canvas / Iframe Area ── */
.wce-canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0f172a;
  padding: 0;
}

.wce-iframe-wrap {
  width: 100%;
  height: 100%;
  transition: width 0.3s ease, max-width 0.3s ease;
  position: relative;
  background: #fff;
}
.wce-iframe-wrap.wce-tablet {
  max-width: 768px;
  margin: 12px auto;
  border-radius: 12px;
  overflow: hidden;
  height: calc(100% - 24px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.wce-iframe-wrap.wce-mobile {
  max-width: 390px;
  margin: 12px auto;
  border-radius: 20px;
  overflow: hidden;
  height: calc(100% - 24px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.wce-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  display: block;
}

/* ── WCE Bottom Bar ── */
.wce-bottom-bar {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  background: #1e293b;
  border-top: 1px solid #334155;
  flex-shrink: 0;
  align-items: center;
}

.wce-ai-prompt {
  display: flex;
  flex: 1;
  gap: 6px;
}
.wce-ai-field {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid #475569;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #f1f5f9;
  background: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
}
.wce-ai-field:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.15); }
.wce-ai-field::placeholder { color: #64748b; }

.wce-ai-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.1);
  color: #93c5fd;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Ubuntu', system-ui, sans-serif;
}
.wce-ai-go:hover { background: rgba(96,165,250,0.2); color: #bfdbfe; }

.wce-hint {
  font-size: 0.7rem;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── WCE Mobile Responsive ── */
@media (max-width: 700px) {
  .wce-toolbar { flex-wrap: wrap; padding: 6px 10px; }
  .wce-toolbar-center { order: 3; width: 100%; justify-content: center; margin-top: 4px; }
  .wce-bottom-bar { flex-direction: column; gap: 6px; }
  .wce-hint { display: none; }
}

/* ============================================================
   IMAGE CANVAS EDITOR (ICE) — Fabric.js Image Editor
   ============================================================ */

.ice-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.ice-modal-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #0f172a;
  overflow: hidden;
}

/* ── Top Bar ── */
.ice-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #003366 0%, #001a33 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: 12px;
}

.ice-topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.ice-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ice-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ice-action-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); color: #fff; }
.ice-action-btn:disabled { opacity: 0.38; cursor: default; }

.ice-dl-btn { border-color: rgba(254,191,15,0.4); color: #FEBF0F; }
.ice-dl-btn:hover { background: rgba(254,191,15,0.15) !important; }

.ice-close-btn:hover { background: rgba(239,68,68,0.25) !important; border-color: rgba(239,68,68,0.5) !important; color: #fca5a5 !important; }

.ice-sep {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.12);
  margin: 0 2px;
}

/* ── Workspace ── */
.ice-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Left Toolbar ── */
.ice-toolbar {
  width: 88px;
  flex-shrink: 0;
  background: #1e293b;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  overflow-y: auto;
}

.ice-toolbar-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 4px;
}

.ice-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 70px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.ice-tool-btn span { line-height: 1.2; }
.ice-tool-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.ice-tool-btn.active { background: rgba(254,191,15,0.15); border-color: rgba(254,191,15,0.4); color: #FEBF0F; }
.ice-tool-btn svg { flex-shrink: 0; }

.ice-delete-btn { color: rgba(239,68,68,0.7) !important; }
.ice-delete-btn:hover { background: rgba(239,68,68,0.12) !important; color: #f87171 !important; }

.ice-toolbar-sep { width: 48px; height: 1px; background: rgba(255,255,255,0.08); margin: 6px 0; }

/* ── Canvas Area ── */
.ice-canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1117;
  overflow: auto;
  padding: 20px;
  position: relative;
}

.ice-canvas-wrap {
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Properties Panel ── */
.ice-properties {
  width: 224px;
  flex-shrink: 0;
  background: #1e293b;
  border-left: 1px solid rgba(255,255,255,0.07);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ice-props-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.5;
}

.ice-props-content {
  padding: 14px 14px 20px;
}

.ice-prop-group {
  margin-bottom: 12px;
}

.ice-prop-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 5px;
}

.ice-prop-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ice-prop-row .ice-prop-group { flex: 1; margin-bottom: 0; }

.ice-prop-select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  cursor: pointer;
}
.ice-prop-select:focus { outline: none; border-color: rgba(254,191,15,0.5); }

.ice-prop-number {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  text-align: center;
}
.ice-prop-number:focus { outline: none; border-color: rgba(254,191,15,0.5); }

.ice-prop-color {
  width: 44px;
  height: 34px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

.ice-prop-slider {
  width: 100%;
  accent-color: #FEBF0F;
  cursor: pointer;
}

.ice-slider-val {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

.ice-style-row {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.ice-style-btn {
  flex: 1;
  padding: 5px 2px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}
.ice-style-btn:hover { background: rgba(255,255,255,0.12); }
.ice-style-btn.active { background: rgba(254,191,15,0.18); border-color: rgba(254,191,15,0.45); color: #FEBF0F; }

.ice-common-props { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; margin-top: 4px; }

/* ── Save Changes button ── */
.ice-save-btn {
  background: linear-gradient(135deg, #003366 0%, #004d99 100%) !important;
  border-color: rgba(254,191,15,0.5) !important;
  color: #FEBF0F !important;
  font-weight: 700 !important;
}
.ice-save-btn:hover:not(:disabled) { background: linear-gradient(135deg, #004d99 0%, #0066cc 100%) !important; }
.ice-save-btn:disabled { opacity: 0.55; cursor: wait !important; }

/* ── Image Adjustments section ── */
.ice-adj-section {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.ice-adj-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.ice-text-overlay-section {
  padding: 12px 14px;
}

/* ── Ubuntu font throughout editor ── */
.ice-modal, .ice-modal * { font-family: 'Ubuntu', Arial, sans-serif; }

/* ── AI Edit progress overlay (sits above selection overlay while AI generates) ── */
.ice-edit-progress {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.72);
  backdrop-filter: blur(3px);
}
.ice-ep-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 36px;
  background: rgba(30, 34, 55, 0.95);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.ice-ep-ring {
  width: 44px; height: 44px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: ice-spin 0.9s linear infinite;
}
@keyframes ice-spin { to { transform: rotate(360deg); } }
.ice-ep-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
}
.ice-ep-sub {
  font-size: 0.75rem;
  color: rgba(226,232,240,0.55);
  text-align: center;
}

/* ── Visual editor tip section (below image actions, above Edit Visually btn) ── */
.canvas-edit-tip {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--bg, #f8fafc);
  border: 1px solid rgba(0, 51, 102, 0.08);
  border-radius: 10px;
}
.canvas-edit-tip p {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
  font-family: 'Ubuntu', sans-serif;
}
.canvas-edit-tip p:last-of-type {
  margin-bottom: 10px;
  color: var(--text, #334155);
}
[data-theme="dark"] .canvas-edit-tip {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* ── Edit Visually (below image in chat) — same gold CTA as presentations / websites ── */
.img-btn.img-btn-edit-canvas {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  background: #FEBF0F !important;
  color: #003366 !important;
  border: 2px solid rgba(0, 51, 102, 0.42) !important;
  border-radius: 999px !important;
  padding: 9px 20px !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em !important;
  gap: 8px !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 4px 16px rgba(0, 51, 102, 0.14),
    0 2px 8px rgba(254, 191, 15, 0.35) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease !important;
}
.img-btn.img-btn-edit-canvas:hover {
  background: #FFD84D !important;
  border-color: #003366 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 8px 22px rgba(0, 51, 102, 0.18),
    0 3px 12px rgba(254, 191, 15, 0.5) !important;
  transform: translateY(-2px) !important;
}
.img-btn.img-btn-edit-canvas:active {
  transform: translateY(0) !important;
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.35) inset,
    0 2px 10px rgba(0, 51, 102, 0.12) !important;
}
.img-btn.img-btn-edit-canvas:focus-visible {
  outline: 2px solid #003366 !important;
  outline-offset: 3px !important;
}
.img-btn.img-btn-edit-canvas svg,
.img-btn.img-btn-edit-canvas:hover svg {
  stroke: #003366 !important;
}

[data-theme="dark"] .img-btn.img-btn-edit-canvas {
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(254, 191, 15, 0.22) !important;
}

/* ── Region-selection overlay (sits over Fabric canvas, handles drag events) ── */
.ice-sel-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  cursor: crosshair;
}
.ice-sel-box {
  position: absolute;
  border: 2px dashed #3b82f6;
  background: rgba(59,130,246,0.12);
  pointer-events: none;
  z-index: 21;
  display: none;
  box-sizing: border-box;
}

/* ── Download format dropdown ── */
.ice-dl-wrap {
  position: relative;
  display: inline-flex;
}
.ice-dl-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #1e2130;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  overflow: hidden;
  z-index: 200;
  min-width: 90px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.ice-dl-menu.open { display: block; }
.ice-dl-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-family: 'Ubuntu', Arial, sans-serif;
  padding: 8px 14px;
  text-align: left;
  cursor: pointer;
}
.ice-dl-menu button:hover { background: rgba(255,255,255,0.08); }

/* ── AI Edit prompt bar (appears below canvas when mask is drawn) ── */
.ice-ai-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 0 0 8px 8px;
  margin-top: -1px;
}

.ice-ai-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  padding: 5px 10px;
  outline: none;
  min-width: 0;
}
.ice-ai-input:focus { border-color: rgba(59,130,246,0.7); background: rgba(255,255,255,0.1); }
.ice-ai-input::placeholder { color: rgba(255,255,255,0.35); }

.ice-ai-apply-btn {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  border-color: rgba(59,130,246,0.5) !important;
  color: #fff !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.ice-ai-apply-btn:hover:not(:disabled) { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important; }
.ice-ai-apply-btn:disabled { opacity: 0.55; cursor: wait !important; }

/* ── Toolbar hint ── */
.ice-toolbar-hint {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
  line-height: 1.4;
  padding: 4px 6px;
  margin-top: 4px;
}

/* ── Back to Chat button ── */
.ice-back-btn {
  border-color: rgba(255,255,255,0.2) !important;
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600 !important;
}
.ice-back-btn:hover { background: rgba(255,255,255,0.14) !important; color: #fff !important; }

/* ── Loading spinner ── */
.ice-loading-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(13,17,23,0.88);
  z-index: 5;
  border-radius: 4px;
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
}
.ice-spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(254,191,15,0.2);
  border-top-color: #FEBF0F;
  border-radius: 50%;
  animation: ice-spin 0.7s linear infinite;
}
@keyframes ice-spin { to { transform: rotate(360deg); } }

/* ── Load error state ── */
.ice-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  text-align: center;
  min-width: 300px;
  min-height: 200px;
}

/* ── Edit button on image cards ── */
.img-btn.ice-edit-btn { color: var(--accent); }
.img-btn.ice-edit-btn svg { stroke: var(--accent); }
.img-btn.ice-edit-btn:hover { background: rgba(0,51,102,0.12); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .ice-properties { display: none; }
  .ice-toolbar { width: 56px; }
  .ice-tool-btn span { display: none; }
  .ice-tool-btn { width: 44px; padding: 8px; }
  .ice-topbar-title span:last-child { display: none; }
}

/* ============================================================================
   PRESENTATION — THEME PICKER, SLIDE MANAGEMENT, STREAMING CARD
   ============================================================================ */

/* ── Theme picker row ── */
.pres-theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--border);
}
.pres-theme-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.pres-theme-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pres-theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.pres-theme-dot:hover {
  transform: scale(1.25);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pres-theme-dot.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

/* ── Slide thumbnail duplicate + delete buttons ── */
.pres-slide-thumb {
  position: relative;
  cursor: grab;
}
.pres-slide-thumb:active { cursor: grabbing; }
.pres-thumb-duplicate {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,51,102,0.82);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
  z-index: 10;
  line-height: 1;
}
.pres-slide-thumb:hover .pres-thumb-duplicate { opacity: 1; }
.pres-thumb-duplicate:hover { background: #003366; }
/* Drag reorder states */
.pres-slide-thumb.pres-thumb-dragging { opacity: 0.45; cursor: grabbing; }
.pres-slide-thumb.pres-thumb-drop-target {
  box-shadow: 0 0 0 2.5px #FEBF0F, 0 2px 8px rgba(254,191,15,0.3);
  border-color: #FEBF0F !important;
}
.pres-thumb-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,68,68,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
  z-index: 10;
  line-height: 1;
}
.pres-slide-thumb:hover .pres-thumb-delete {
  opacity: 1;
}
.pres-thumb-delete:hover {
  background: #dc2626;
}

/* ── + Insert button between slides ── */
.pres-add-between {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 16px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.pres-thumbnails:hover .pres-add-between,
.pres-add-between:hover { opacity: 1; }
.pres-add-between::before {
  content: '+';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--primary, #003366);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  z-index: 5;
}
.pres-add-between::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  z-index: 1;
}

/* ── Add Slide button in thumbnail strip ── */
.pres-add-slide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 0;
  margin-top: 4px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: 'Ubuntu', system-ui, sans-serif;
}
.pres-add-slide-btn:hover {
  border-color: var(--primary, #003366);
  color: var(--primary, #003366);
  background: rgba(0,51,102,0.04);
}

/* ── Horizontal slide strip inside live streaming card ── */
.pres-live-slides {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-height: 90px;
}
.pres-live-slide-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: default;
  animation: pres-row-in 0.22s ease;
}
.plsc-thumb {
  width: 72px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.plsc-thumb svg { display: block; }
.plsc-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  max-width: 72px;
}
.plsc-num {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
}
.plsc-title {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}
.plsc-type {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--primary, #003366);
  opacity: 0.75;
}

/* ── Live slide-build streaming card ── */
.pres-live-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  max-width: 560px;
  margin: 8px 0;
  font-family: system-ui, sans-serif;
}
.pres-live-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}
.pres-live-icon { font-size: 1.4rem; }
.pres-live-title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.pres-live-slides {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
}
.pres-live-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-primary);
  animation: pres-row-in 0.25s ease;
}
@keyframes pres-row-in {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}
.pres-live-row-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 20px;
  text-align: right;
}
.pres-live-row-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pres-live-row-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pres-live-footer {
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Layout picker panel ── */
.pres-layout-panel {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  z-index: 20;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
}
.pres-layout-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.pres-layout-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.pres-layout-close:hover { background: var(--bg-secondary); }
.pres-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.pres-layout-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: center;
}
.pres-layout-item:hover {
  border-color: var(--primary, #003366);
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pres-layout-item.active {
  border-color: var(--primary, #003366);
  background: rgba(0,51,102,0.06);
  box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
}
.pres-layout-thumb {
  width: 96px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pres-layout-thumb svg { display: block; }
.pres-layout-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Progressive streaming card ── */
.pres-streaming-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 480px;
  margin: 8px 0;
  font-family: system-ui, sans-serif;
}
.pres-stream-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.pres-stream-info {
  flex: 1;
  min-width: 0;
}
.pres-stream-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.pres-stream-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.pres-stream-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--primary, #003366);
  border-radius: 50%;
  animation: presSpin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes presSpin { to { transform: rotate(360deg); } }

/* ── Add Element menu: section labels, separators, shape grid, half-width rows ── */
.sce-tool-menu-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.38);
  padding: 6px 12px 2px;
  text-transform: uppercase;
}
.sce-tool-menu-sep {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 0;
}
.sce-tool-menu-row {
  display: flex;
  gap: 2px;
  padding: 0 4px;
}
.sce-tool-menu-half {
  flex: 1;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 6px 8px !important;
}
.sce-tool-menu-half em { display: none !important; }
.sce-tool-menu-shapes {
  display: flex;
  gap: 6px;
  padding: 4px 10px 8px;
}
.sce-tool-menu-shapes button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.sce-tool-menu-shapes button:hover { background: rgba(254,191,15,0.18); border-color: rgba(254,191,15,0.4); }

/* ── Overlay item inline colour picker ── */
.sce-ov-color-wrap {
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.7);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.15s;
}
.sce-ov-item:hover .sce-ov-color-wrap { opacity: 1; }
.sce-ov-color-pick {
  width: 28px;
  height: 28px;
  margin: -6px 0 0 -6px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

/* ── Duplicate slide button in canvas toolbar ── */
.sce-dup-btn { color: #bae6fd !important; border-color: rgba(186,230,253,0.3) !important; }
.sce-dup-btn:hover { background: rgba(186,230,253,0.15) !important; color: #e0f2fe !important; }
