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

/* 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;
}

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

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

[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"] .change-agent-btn,
[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 {
  background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
  border-color: rgba(254, 191, 15, 0.4);
}

[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);
}

[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-quick-link {
  color: var(--text);
}
[data-theme="dark"] .sidebar-quick-link:hover {
  background: rgba(254, 191, 15, 0.15);
}
[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 */
[data-theme="dark"] .chat-header {
  background: var(--card-bg);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .current-agent-icon {
  color: var(--text);
}
[data-theme="dark"] .current-agent-name {
  color: var(--accent);
}
[data-theme="dark"] .change-agent-btn {
  background: var(--card-bg);
  color: var(--text);
  border-color: rgba(254, 191, 15, 0.4);
}
[data-theme="dark"] .change-agent-btn:hover {
  background: rgba(254, 191, 15, 0.1);
  border-color: var(--accent);
}

/* 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 {
  background: var(--card-bg);
  border-color: var(--border);
}
[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);
}

/* 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;
  display: flex;
  flex-direction: column;
  overflow-x: 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 rgba(254, 191, 15, 0.3);
  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: 1px solid rgba(254, 191, 15, 0.2);
  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;
}

.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% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #003366;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.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: 1px solid rgba(254, 191, 15, 0.2);
  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;
}

/* 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;
  background: rgba(0, 51, 102, 0.04);
  border: 1px solid rgba(0, 51, 102, 0.08);
  border-radius: 5px;
  transition: border-color 0.2s;
  height: 28px;
}

.sidebar-search-bar:focus-within {
  border-color: rgba(254, 191, 15, 0.5);
  background: rgba(254, 191, 15, 0.04);
}

.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: 2px solid rgba(0, 51, 102, 0.15);
  border-bottom: 1px solid rgba(0, 51, 102, 0.08);
}

.sidebar-footer-links .sidebar-quick-link:not(:last-child) {
  border-bottom: 1px solid rgba(0, 51, 102, 0.07);
  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;
}

[data-theme="dark"] .sidebar-footer-links .sidebar-quick-link:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* 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: 1px solid rgba(0, 51, 102, 0.08);
}

.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: rgba(254, 191, 15, 0.1);
  border-color: rgba(254, 191, 15, 0.3);
}

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

.sidebar-quick-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 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 */
.sidebar-quick-link:not(:last-child) {
  border-bottom: 1px solid rgba(0, 51, 102, 0.06);
  border-radius: 0;
}

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

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

[data-theme="dark"] .sidebar-quick-link:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}


/* 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;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Ubuntu', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

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

.sidebar-manage-btn:hover {
  background: var(--field-bg);
  color: var(--text);
  border-color: var(--text-muted);
}

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

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

.sidebar-manage-btn.plan-expired:hover {
  background: rgba(239, 68, 68, 0.06);
  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;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 51, 102, 0.15);
  border: 1px solid var(--border);
  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: var(--field-bg);
  border-bottom: 1px solid var(--border);
}

.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;
  background: var(--border);
}

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

/* Workspace Switcher */
.workspace-switcher {
  padding: 4px 0;
}

.workspace-switcher-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px 4px;
  display: block;
}

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

.workspace-option {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  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: rgba(0, 51, 102, 0.05);
}

.workspace-option.active {
  background: rgba(254, 191, 15, 0.1);
}

.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 {
  background: rgba(255, 255, 255, 0.05);
}

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

/* 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;
  min-height: 100vh;
  display: flex;
  justify-content: 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;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  padding: 0 24px;
  min-height: 100vh;
  overflow: visible;
}

/* ============================================================================
   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: 40px;
  line-height: 1.2;
}

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

.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-bottom: 8px;
}

.hero-file-preview {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--field-bg, #f5f5f5);
  border-radius: 8px;
  border: 1px solid var(--border, #e0e0e0);
  flex-wrap: wrap;
  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: 18px;
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
  padding: 0 8px;
}

.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;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 50%;
  font-size: 24px;
  border: 2px solid rgba(0, 51, 102, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.agent-pill:hover .agent-pill-icon {
  transform: scale(1.1);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.2);
}

.agent-pill.active .agent-pill-icon {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.2);
}

.agent-pill-name {
  font-size: 11px;
  line-height: 1.3;
  max-width: 90px;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  color: var(--text);
}

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

.agent-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 20px;
  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;
  overflow: hidden;
  position: relative;
  height: calc(100vh - 70px);
}

.chat-container.active {
  display: flex;
}

/* Chat Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border: none;
  border-bottom: 1px solid rgba(0, 51, 102, 0.15);
  background: transparent;
  box-shadow: none;
}

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

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

.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: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Ubuntu', sans-serif;
  transition: all 0.2s;
}

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

.share-btn:hover {
  background: rgba(0, 51, 102, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 51, 102, 0.2);
}

.current-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  transition: all 0.2s;
}

.current-agent-icon {
  font-size: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.06) 0%, rgba(254, 191, 15, 0.06) 100%);
  border-radius: 9px;
}

.current-agent-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 15px;
}

.change-agent-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.change-agent-btn:hover {
  border-color: rgba(254, 191, 15, 0.3);
  background: rgba(254, 191, 15, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(254, 191, 15, 0.12);
}

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

/* 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;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 24px 16px;
  padding-bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  max-height: calc(100vh - 180px);
}

.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: 1;
  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;
  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 - Fixed at bottom, aligned with main container
   ============================================================================ */
.chat-input-container {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  padding: 16px 24px 24px;
  background: var(--bg);
  z-index: 90;
  border-top: 1px solid rgba(254, 191, 15, 0.3);
  box-shadow: 0 -4px 20px rgba(254, 191, 15, 0.08);
  transition: left 0.08s ease;
}

body.sidebar-collapsed .chat-input-container {
  left: 60px;
}

.file-preview {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--field-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  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%;
}

.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: center;
  position: relative;
  background: var(--card-bg);
  border: 1px solid rgba(254, 191, 15, 0.4);
  border-radius: 26px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 0 0 1px rgba(254, 191, 15, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06);
  max-width: 800px;
  margin: 0 auto;
}

.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 var(--border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 180px;
  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: 400;
  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;
}

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

[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;
  background: transparent;
  border: none;
  padding: 8px 0;
  color: var(--text);
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px; /* Minimum 16px prevents iOS zoom on focus */
  resize: none;
  min-height: 24px;
  max-height: 150px;
  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);
}

.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 */
}

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

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  /* 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;
  }

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

  .main-container {
    padding: 0 12px;
    padding-top: 70px;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .chat-input-container {
    left: 0 !important;
  }

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

  /* Mobile header bar - lower z-index so sidebar covers it */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
  }

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

  .mobile-header .mobile-logo {
    height: 24px;
  }

  .mobile-header .mobile-menu-trigger {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    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%;
    overflow-x: visible;
  }

  .agents-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    flex-wrap: wrap;
    gap: 16px 8px;
    padding: 0 8px;
    justify-items: center;
  }

  .hero-section {
    padding: 20px 0;
  }

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

  .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: 16px 8px;
  }

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

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

  .agent-pill-name {
    font-size: 10px;
    max-width: 80px;
  }

  .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: 10px 12px;
  }

  .current-agent-icon {
    font-size: 16px;
  }

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

  .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: 10px;
  }

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

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

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

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

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

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

  .agent-pill-name {
    font-size: 9px;
    max-width: 70px;
  }

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

/* Canvas 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;
}

.wce-canvas-tip-btn {
  align-self: flex-start;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #00ff00;
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.wce-canvas-tip-btn:hover {
  background: #00e600;
  box-shadow: 0 4px 16px rgba(0, 255, 0, 0.4);
  transform: translateY(-1px);
}

[data-theme="dark"] .wce-canvas-tip {
  background: #1e1730;
  border-color: #3b2a6e;
}

[data-theme="dark"] .wce-canvas-tip-text {
  color: #c4b5fd;
}

/* 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;
}

/* 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;
}

.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: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 400px;
}

.generated-video {
  width: 100%;
  max-width: 400px;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: 16px 16px 0 0;
}

.video-info {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(30, 58, 95, 0.05);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.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;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  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: 12px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.pres-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pres-icon {
  font-size: 1.5rem;
}

.pres-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.pres-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

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

.pres-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pres-action-btn:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
  color: var(--primary);
}

.pres-action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary);
}

.pres-action-btn.primary:hover {
  background: #e6ac00;
  transform: translateY(-1px);
}

.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: 100px;
  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: 100px;
  height: 56.25px; /* 100 * 9/16 for 16:9 ratio */
  overflow: hidden;
  position: relative;
  background: #f8f9fa;
}

.pres-slide-mini .pres-slide {
  position: absolute;
  top: 0;
  left: 0;
  /* Render at 640x360 then scale to fit 100px width thumbnail */
  width: 640px;
  height: 360px;
  transform: scale(0.15625); /* 100/640 = 0.15625 */
  transform-origin: top left;
  overflow: hidden;
  box-sizing: border-box;
}

.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-slide {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.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 in Canvas 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: 8px;
  padding: 10px 32px;
  background: #00ff00;
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.pres-edit-canvas-btn:hover {
  background: #00e600;
  box-shadow: 0 4px 20px rgba(0, 255, 0, 0.4);
  transform: translateY(-1px);
}

.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-slide {
  width: 100%;
  height: 100%;
}

.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-slide {
  width: 100%;
  max-width: min(100%, calc((100vh - 140px) * 16 / 9));
  aspect-ratio: 16/9;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.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: 100px;
  }
  
  .pres-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .pres-actions {
    width: 100%;
  }
  
  .pres-action-btn {
    flex: 1;
    justify-content: center;
  }
  
  .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;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Ubuntu', system-ui, -apple-system, 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-edit-btn,
.pres-fullscreen-main:hover .slide-edit-btn {
  opacity: 1;
}

.slide-edit-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

.slide-edit-btn svg {
  stroke: currentColor;
}

/* 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 Canvas Overlay ─────────────────────────────────────────────────── */
.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-canvas-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-canvas-body:focus { box-shadow: 0 0 0 2px rgba(0,51,102,.15), 0 1px 6px rgba(0,0,0,.06); }
.bc-canvas-body h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 12px; }
.bc-canvas-body h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 6px; }
.bc-canvas-body h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
.bc-canvas-body h4 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.bc-canvas-body p  { margin-bottom: 1.1rem; line-height: 1.8; font-family: Georgia, serif; font-size: 1.05rem; }
.bc-canvas-body ul, .bc-canvas-body ol { margin: 0 0 1.1rem 1.6rem; font-family: Georgia, serif; }
.bc-canvas-body li { margin-bottom: .35rem; line-height: 1.7; }
.bc-canvas-body a  { color: #2563eb; }
.bc-canvas-body strong { font-weight: 700; }
.bc-canvas-body em { font-style: italic; }
.bc-canvas-body code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: .9em; font-family: monospace; }
.bc-canvas-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-canvas-body hr { border: none; border-top: 2px solid #f0f0f0; margin: 2.2rem 0; }
.bc-canvas-body table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; }
.bc-canvas-body th, .bc-canvas-body td { text-align: left; padding: 9px 13px; border-bottom: 1px solid #e5e7eb; font-size: .95rem; }
.bc-canvas-body th { background: #f9fafb; font-weight: 600; }
.bc-canvas-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; }
@media (max-width: 700px) { .bc-canvas-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; }

/* ============================================================
   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: #1e293b;
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  overflow: hidden;
}

/* ── Toolbar ── */
.sce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #003366 0%, #001a33 100%);
  flex-shrink: 0;
  gap: 12px;
}
.sce-toolbar-left, .sce-toolbar-center, .sce-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sce-toolbar-left { min-width: 0; }
.sce-toolbar-right { flex-shrink: 0; }

.sce-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Ubuntu', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 8px;
}
.sce-back-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}

.sce-slide-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  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: 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;
}
.sce-tool-btn:hover { background: rgba(255,255,255,0.18); color: white; }
.sce-tool-img { border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
.sce-tool-img:hover { background: rgba(16,185,129,0.15); }

.sce-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;
}
.sce-done-btn:hover { background: #e6ab00; }

/* ── 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;
}

/* ── Canvas Area ── */
.sce-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 8px;
  overflow-y: auto;
  background: #0f172a;
}

.sce-canvas-frame {
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
}

.sce-canvas-slide {
  width: 100%;
  height: 100%;
}

.sce-slide-canvas {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.sce-canvas-hint {
  font-size: 0.7rem;
  color: #475569;
  text-align: center;
  margin-top: 8px;
  flex-shrink: 0;
}

/* ── Editable Elements ── */
.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); }

/* ── 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;
  background: #1e293b;
  border-top: 1px solid #334155;
  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 #475569;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #f1f5f9;
  background: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
}
.sce-ai-field:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.15); }
.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;
}

/* ── Canvas edit tip section (below image actions, above Edit in Canvas 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);
}

/* ── Conspicuous Edit in Canvas button (below image in chat) ── */
.img-btn-edit-canvas {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 18px !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  gap: 6px !important;
  box-shadow: 0 2px 12px rgba(5,150,105,0.45) !important;
  transition: opacity 0.15s, transform 0.1s !important;
}
.img-btn-edit-canvas:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  transform: translateY(-1px) !important;
}
.img-btn-edit-canvas svg { stroke: #fff !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; }
}
