/* ========== Credits Confirmation Settings ========== */
.power-confirm-field {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.power-confirm-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.power-confirm-field-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}
.power-confirm-reset {
  border: none;
  background: transparent;
  color: #E8651A;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.power-confirm-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.power-confirm-input {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.power-confirm-input:focus {
  border-color: #E8651A;
}
.power-confirm-unit {
  font-size: 13px;
  color: #666;
}
.power-confirm-hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
  line-height: 1.4;
}
.verification-option-btn {
  padding: 6px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #344054;
  transition: all 0.2s;
}
.verification-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.verification-option-btn.power-approve {
  background: #E8651A;
  border-color: #E8651A;
  color: #fff;
}
.verification-option-btn.power-reject {
  background: #fff;
  border-color: #fda29b;
  color: #b42318;
}

/* ========== Marketing Mode Agent Chat Page Styles ========== */
:root {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-sidebar: #fafafa;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e8e8e8;
  --border-light: #f0f0f0;
  --accent-color: #E8651A;
  --accent-hover: #C4520E;
  --accent-light: #FFF0E6;
  --user-bubble: #FFF0E6;
  --user-bubble-border: #FDCFB0;
  --ai-bubble: #ffffff;
  --ai-bubble-border: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --header-height: 56px;
  --sidebar-width: 260px;
  --input-height: 80px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* Prevent Vue template / v-if modal FOUC before mount (same pattern as index.css) */
[v-cloak] {
  display: none !important;
}

/* ========== Layout ========== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ========== Left Narrow Nav (First Column) ========== */
.marketing-nav {
  width: 64px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
  flex-shrink: 0;
}

.marketing-nav-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 16px;
  border-radius: 10px;
  transition: background 0.2s;
}

.marketing-nav-logo:hover {
  background: #f0f0f0;
}

.marketing-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  width: 56px;
  color: #666;
  text-decoration: none;
}

.marketing-nav-item:hover {
  background: #f0f0f0;
  color: #333;
}

.marketing-nav-item.active {
  background: #FFF0E6;
  color: #E8651A;
}

.marketing-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.marketing-nav-text {
  font-size: 11px;
  line-height: 1.2;
}

.marketing-nav-back {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.marketing-nav-back svg {
  width: 20px;
  height: 20px;
}

/* ========== Left Sidebar (Second Column) ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

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

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

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

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.new-chat-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

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

.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.sidebar-nav {
  padding: 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-nav-item:hover {
  background: var(--border-light);
}

.sidebar-nav-item.active {
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 500;
}

.sidebar-nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-section {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.sidebar-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.sidebar-history-item:hover {
  background: var(--border-light);
}

.sidebar-history-item.active {
  background: var(--accent-light);
  color: var(--accent-color);
}

.sidebar-history-item .history-title-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-history-item .history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-history-item .history-id {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

.sidebar-history-item .history-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sidebar-history-item:hover .history-date,
.sidebar-history-item .history-date.hide {
  display: none;
}

/* History More Button */
.history-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-muted);
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.history-more-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

/* History Hover Menu */
.sidebar-history-item {
  position: relative;
}
.history-menu {
  position: absolute;
  right: 8px;
  top: 100%;
  z-index: 100;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 120px;
  overflow: hidden;
}
.history-menu-item {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.history-menu-item:hover {
  background: var(--border-light);
}
.history-menu-item.danger {
  color: #e74c3c;
}
.history-menu-item.danger:hover {
  background: #fef2f2;
}
.history-menu-item.danger.disabled {
  color: #ccc;
  cursor: not-allowed;
}
.history-menu-item.danger.disabled:hover {
  background: transparent;
}

/* Rename Input Field */
.history-rename-input {
  flex: 1;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  outline: none;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-width: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-footer .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ========== Main Content Area ========== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-primary);
}

/* ========== Top Bar ========== */
.top-bar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--border-light);
}

.top-bar-date {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 499px) {
  .top-bar-date {
    display: inline-block;
    width: 1em;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
  }
}

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

.language-switcher-container {
  display: flex;
  align-items: center;
}

.top-bar-search {
  position: relative;
}

.top-bar-search input {
  padding: 8px 12px 8px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  outline: none;
  width: 200px;
  transition: all 0.2s;
}

.top-bar-search input:focus {
  border-color: var(--accent-color);
  width: 260px;
}

.top-bar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown select {
  padding: 8px 28px 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  appearance: none;
}

.filter-dropdown::after {
  content: '▼';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ========== Message Stream Area ========== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

/* Welcome Card */
.welcome-card {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 20px;
}

.welcome-card .welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.welcome-card .welcome-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-card .welcome-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Messages */
.message {
  display: flex;
  padding: 12px 20px;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--accent-color);
  color: #fff;
}

.message.ai .message-avatar {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

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

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}

.message.user .message-bubble {
  background: var(--user-bubble);
  border: 1px solid var(--user-bubble-border);
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  margin-left: auto;
  max-width: 80%;
}

.message.ai .message-bubble {
  background: var(--ai-bubble);
  border: 1px solid var(--ai-bubble-border);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  box-shadow: var(--shadow);
  max-width: 90%;
}

.agent-preference-details {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  font-size: 12px;
}

.agent-preference-details summary {
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
}

.agent-preference-list {
  margin-top: 6px;
}

.agent-preference-item + .agent-preference-item {
  margin-top: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.message.ai .message-time {
  text-align: left;
}

/* Completed Label */
.task-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f0f9ff;
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 500;
  margin: 8px 0;
  cursor: pointer;
}

.task-status:hover {
  background: #e0f2fe;
}

.task-status.completed::before {
  content: '✓';
  font-weight: 700;
}

/* Analysis Table */
.analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.analysis-table th,
.analysis-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.analysis-table th {
  background: #fafafa;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analysis-table td {
  color: var(--text-secondary);
}

.analysis-table tr:last-child td {
  border-bottom: none;
}

.analysis-table tr:hover td {
  background: #fafafa;
}

/* Markdown Styles */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.message-bubble h1 { font-size: 18px; }
.message-bubble h2 { font-size: 16px; }
.message-bubble h3 { font-size: 14px; }

.message-bubble p {
  margin: 8px 0;
}

.message-bubble ul,
.message-bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-bubble li {
  margin: 4px 0;
}

.message-bubble code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
}

.message-bubble pre {
  background: #f8f8f8;
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 8px 0;
}

.message-bubble pre code {
  background: none;
  padding: 0;
}

.message-bubble strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-bubble blockquote {
  border-left: 3px solid var(--accent-color);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}

/* Continue Button */
.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--accent-color);
  background: var(--bg-secondary);
  color: var(--accent-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 12px 0;
}

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

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 18px;
}

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

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ========== Bottom Input Area ========== */
.input-area {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  flex-shrink: 0;
}

.input-wrapper {
  margin: 0 auto;
  max-width: 925px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent-color);
}

.input-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.input-box:focus-within {
  border-color: var(--accent-color);
}

.input-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
  min-height: 24px;
  max-height: 200px;
  font-family: inherit;
}

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

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

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

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

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--border-light);
  border-color: #d0d0d0;
}

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

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.send-btn:disabled {
  background: #d0d0d0;
  cursor: not-allowed;
}

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

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 100;
    height: 100vh;
    transform: translateX(-100%);
  }

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

  .menu-toggle {
    display: block;
  }

  .message.user .message-bubble,
  .message.ai .message-bubble {
    max-width: 90%;
  }

  .top-bar-search input {
    width: 120px;
    padding: 6px 10px 6px 28px;
    font-size: 12px;
  }

  .top-bar-search input:focus {
    width: 150px;
  }

  .top-bar-search .search-icon {
    left: 8px;
    font-size: 12px;
  }

  .filter-dropdown {
    display: none;
  }
}

@media (max-width: 480px) {
  .top-bar-search input {
    width: 90px;
    padding: 5px 8px 5px 26px;
  }

  .top-bar-search input:focus {
    width: 120px;
  }
}

/* ========== Loading State ========== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== Error Messages ========== */
.error-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========== Marketing Input Area Styles (reused from index.css and adapted for light theme) ========== */
.marketing-input-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.marketing-input-box.drag-over {
  outline: 2px dashed #E8651A;
  outline-offset: 4px;
  border-radius: 8px;
}

.marketing-input-upload {
  flex-shrink: 0;
}

.marketing-upload-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px dashed #d0d0d0;
  background: #fafafa;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.marketing-upload-btn:hover {
  border-color: #E8651A;
  color: #E8651A;
  background: #f0f9ff;
}

.marketing-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  background: transparent;
  min-height: 48px;
  max-height: 200px;
  font-family: inherit;
  width: 100%;
  padding: 4px 0;
}

.marketing-textarea::placeholder {
  color: #aaa;
}

.marketing-input-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.marketing-input-bar-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.marketing-input-bar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.marketing-bar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.marketing-bar-btn:hover {
  background: var(--border-light);
  border-color: #d0d0d0;
}

.marketing-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.marketing-send-btn:disabled {
  background: #d0d0d0;
  cursor: not-allowed;
}

/* Dropdown Menu Common Styles */
.marketing-dropdown-menu {
  animation: fadeInUp 0.15s ease;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Large panel modal: always constrained within viewport, prevents top options (Image/Video etc.) from being pushed off-screen on short/small windows */
.marketing-panel {
  animation: fadeInUp 0.15s ease;
  box-sizing: border-box;
  max-width: min(420px, calc(100vw - 32px));
  max-height: min(72vh, calc(100vh - 96px));
  max-height: min(72vh, calc(100dvh - 96px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Agent "Customize" Comprehensive Settings Panel: scrollable sections within fixed-height area, title always visible */
.marketing-settings-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  min-width: min(360px, calc(100vw - 32px));
}

.marketing-panel-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.marketing-panel-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.marketing-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.marketing-panel-close:hover {
  color: #666;
}

.marketing-panel-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 20px;
}

/* Model list within panel: limit height to prevent panel overflow */
.marketing-model-list {
  max-height: min(200px, 32vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ========== Video Duration Selection (Custom Panel) ==========
   ≤3 numeric options: compact equally-spaced radio buttons
   ≥4 numeric options: auto-fixed + horizontal scroll chips + number input */
.duration-picker {
  margin-bottom: 20px;
}

.duration-picker-label {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  display: block;
  margin-bottom: 12px;
}

.duration-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.duration-picker-compact {
  width: 100%;
}

.duration-picker-compact .duration-chip {
  flex: 1;
  text-align: center;
}

.duration-picker-scroll {
  width: 100%;
  min-width: 0;
}

.duration-chip {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid #e8e8e8;
  background: #f5f5f5;
  color: #1a1a1a;
  box-sizing: border-box;
  white-space: nowrap;
}

.duration-chip:hover {
  border-color: #b3e5f7;
}

.duration-chip.active {
  border: 2px solid #E8651A;
  background: #FFF0E6;
  color: #E8651A;
  padding: 9px 7px; /* Prevent size jump when selected (border 2px vs 1px) */
}

.duration-chip-auto {
  flex-shrink: 0;
}

.duration-chip-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Left-right fade-out: hints at horizontal scrollability */
  mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  padding-bottom: 2px;
}

.duration-chip-scroll::-webkit-scrollbar {
  height: 4px;
}

.duration-chip-scroll::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 2px;
}

.duration-chip-scroll::-webkit-scrollbar-track {
  background: transparent;
}

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

.duration-input {
  width: 56px;
  padding: 8px 6px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 14px;
  color: #1a1a1a;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.duration-input::-webkit-outer-spin-button,
.duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.duration-input:focus {
  outline: none;
  border-color: #E8651A;
  background: #fff;
}

.duration-input-unit {
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
}

/* Short screen/small width: switch to viewport-constrained fixed panel, ensure all options are scrollable
   No transform centering to avoid overriding fadeInUp's translateY animation */
@media (max-height: 760px), (max-width: 720px) {
  .marketing-panel {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    margin: 0 auto !important;
    width: min(420px, calc(100vw - 24px)) !important;
    min-width: auto !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    z-index: 1100 !important;
  }
}

/* Disabled button tooltip */
.marketing-bar-btn[title="In Development"]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: #333;
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 200;
}

.marketing-bar-btn[title="In Development"]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #333;
  z-index: 200;
}

/* Generated Image Thumbnails */
.generated-image-wrapper {
  display: inline-block;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  max-width: 280px;
}

.generated-image {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s;
}

.generated-image-wrapper:hover .generated-image {
  transform: scale(1.02);
}

.generated-result-card {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.generated-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.publish-result-btn {
  border: 1px solid #0ea5e9;
  background: #0ea5e9;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.publish-result-btn:hover {
  background: #0284c7;
}

.publish-result-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #94a3b8;
  border-color: #94a3b8;
}

.publish-asset-btn {
  border: 1px solid #0ea5e9;
  background: #0ea5e9;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.publish-asset-btn:hover {
  background: #0284c7;
}

.publish-asset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #94a3b8;
  border-color: #94a3b8;
}

/* ========== Credits Display ========== */
.computing-power-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.computing-power-display:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.computing-power-display .power-icon {
  font-size: 15px;
  line-height: 1;
}

.computing-power-display .power-value {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}

.computing-power-display.low-power {
  border-color: #ef4444;
  background: #fef2f2;
}
.computing-power-display.low-power .power-icon,
.computing-power-display.low-power .power-value {
  color: #ef4444;
}

.computing-power-display.medium-power {
  border-color: #f59e0b;
  background: #fffbeb;
}
.computing-power-display.medium-power .power-icon,
.computing-power-display.medium-power .power-value {
  color: #f59e0b;
}

.computing-power-display.high-power {
  border-color: #22c55e;
  background: #f0fdf4;
}
.computing-power-display.high-power .power-icon,
.computing-power-display.high-power .power-value {
  color: #22c55e;
}

.top-bar-docs-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted, #9ca3af);
  transition: color 0.15s, background 0.15s;
}
.top-bar-docs-link:hover {
  color: #7c3aed;
  background: #f3e8ff;
}

/* ========== General Modals ========== */
.modal-overlay-container {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

.modal-dialog.large {
  max-width: 1200px;
  height: 85vh;
}


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

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

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.modal-action-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.modal-action-btn.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modal-action-btn.secondary:hover {
  background: var(--border-light);
}

.modal-action-btn.danger {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
}

.modal-action-btn.danger:hover {
  background: #ef4444;
  color: white;
}

/* Recharge Package Items */
.package-item {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.package-item:hover {
  border-color: var(--accent-color);
  background: var(--accent-light);
}

/* ========== Floating Feedback Button ========== */
a.feedback-fab-container {
  text-decoration: none;
}

.feedback-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.feedback-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color);
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 168, 230, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 168, 230, 0.45);
}

.feedback-fab-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
  z-index: 1;
}

.feedback-fab-close:hover {
  transform: scale(1.15);
  background: #dc2626;
}

@media (max-width: 1389px) {
  .feedback-fab-container {
    display: none;
  }
}

/* ========== Contact Us Modal Content ========== */
.feedback-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  text-align: center;
}

.feedback-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.qr-wrapper {
  padding: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: inline-block;
}

.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  display: block;
}

/* ========== Asset Library ========== */
.asset-library {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-primary);
}

.asset-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.asset-library-header h2 {
  font-size: 20px;
  font-weight: 650;
  margin: 0;
  color: var(--text-primary);
}

.asset-library-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.asset-refresh-btn,
.asset-page-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.asset-refresh-btn:hover,
.asset-page-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-light);
}

.asset-page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.asset-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.asset-preview {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #f2f4f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-preview img,
.asset-preview video {
  display: block;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.asset-preview video {
  /* Don't use width:100%: portrait video stretched to card width would exceed 1:1 container height, overflow clips top/bottom. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.asset-card-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f6f7f9;
  border-radius: 4px;
  padding: 2px 6px;
}

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

.asset-card-actions button,
.asset-card-actions a {
  flex: 1;
  text-align: center;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.asset-card-actions button:hover,
.asset-card-actions a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.asset-empty-state {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  text-align: center;
}

.asset-empty-state h3 {
  font-size: 16px;
  color: var(--text-primary);
}

.asset-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

.asset-empty-icon {
  font-size: 34px;
}

.asset-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 499px) {
  .mobile-foldable {
    display: none !important;
  }

  .toolbar-expanded .mobile-foldable {
    display: flex !important;
  }

  /* Extra small screen: fullscreen drawer, prevent absolute popup from being clipped */
  .marketing-panel {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    min-width: auto !important;
    max-width: none !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    z-index: 1100 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .marketing-settings-panel .marketing-panel-body,
  .marketing-panel:not(.marketing-settings-panel) {
    overflow-y: auto !important;
  }

  .marketing-panel:not(.marketing-settings-panel) {
    padding: 16px !important;
    overflow-y: auto !important;
  }
}

@media (min-width: 500px) {
  .mobile-settings-toggle {
    display: none !important;
  }
}

/* ── Responsive: Marketing nav → bottom tab bar ── */
@media (max-width: 640px) {
  .marketing-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 56px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    gap: 0;
    border-right: none;
    border-top: 1px solid var(--border-color);
    z-index: 200;
  }
  .marketing-nav-logo {
    display: none;
  }
  .marketing-nav-item {
    width: auto;
    padding: 6px 12px;
    gap: 2px;
    border-radius: 0;
  }
  .marketing-nav-icon {
    font-size: 18px;
  }
  .marketing-nav-text {
    font-size: 10px;
  }
  .marketing-nav-back {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }
  .app-container {
    flex-direction: column;
  }
  .main-content {
    padding-bottom: 72px;
  }
}
