/* ========== LOGIN ========== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #2D2D3F 0%, #1a1a2e 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo svg { margin-bottom: 12px; }
.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.login-logo p {
  font-size: 13px;
  color: #94A3B8;
}
.login-field {
  margin-bottom: 16px;
}
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4A5568;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.login-field input:focus {
  border-color: #E8505B;
}
.login-error {
  color: #E8505B;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}
.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #E8505B;
  --primary-dark: #D43F4A;
  --primary-light: #FFF0F1;
  --secondary: #6C63FF;
  --secondary-light: #EEEDFF;
  --success: #0ACF83;
  --success-light: #E6FAF2;
  --warning: #F5A623;
  --danger: #EF4444;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --sidebar-bg: #1A1A2E;
  --sidebar-text: #CBD5E1;
  --sidebar-active: #E8505B;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

html { font-size: 16px; }

html {
  overflow-x: hidden;
}

.mobile-footer { display: none; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-icon { width: 36px; height: 36px; }

.logo-text {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

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

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sidebar-text);
  margin-bottom: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }

.btn-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  transition: var(--transition);
}

.btn-settings:hover { color: #fff; }

.app-version {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  padding: 4px 0 0;
  letter-spacing: 0.5px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
  max-width: 1200px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== DASHBOARD ========== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dash-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dash-card--clone:hover {
  border-color: var(--secondary);
}

.dash-card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.dash-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dash-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.dash-card-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.dash-card--clone .dash-card-action {
  color: var(--secondary);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ========== STEPPER ========== */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  padding: 20px 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: var(--transition);
}

.step.active { opacity: 1; }
.step.completed { opacity: 0.7; }

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.step.active .step-number {
  background: var(--primary);
  color: #fff;
}

.step.completed .step-number {
  background: var(--success);
  color: #fff;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.step.active .step-label {
  color: var(--text);
  font-weight: 600;
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}

/* ========== STEP CONTENT ========== */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.step-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.step-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.step-actions .approved-count,
.step-actions .selected-count {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ========== PLATFORM SELECTOR ========== */
.platform-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.platform-option input { display: none; }

.platform-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
}

.platform-card:hover {
  border-color: var(--text-muted);
}

.platform-option input:checked + .platform-card {
  border-color: var(--primary);
  background: var(--primary-light);
}

.platform-icon {
  width: 24px;
  height: 24px;
}

/* ========== TEMPLATE GRID ========== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.template-card:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
}

.template-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.15);
}

.template-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.9);
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: all 0.15s;
  z-index: 2;
}
.template-card:hover .template-expand-btn {
  display: flex;
}
.template-expand-btn:hover {
  background: #fff;
  color: var(--primary);
}

.template-preview {
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.template-preview-inner {
  width: 85%;
  height: 85%;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

.template-info {
  padding: 16px;
}

.template-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.template-dims {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== FORM ELEMENTS ========== */
.config-form {
  max-width: 640px;
}

.form-group {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.form-select,
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.1);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  min-height: 80px;
  transition: var(--transition);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.1);
}

/* Variations Selector */
.variations-selector {
  display: flex;
  gap: 8px;
}

.var-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.var-btn:hover {
  border-color: var(--text-muted);
}

.var-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Tone Selector */
.tone-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tone-option input { display: none; }

.tone-chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.tone-chip:hover {
  border-color: var(--text-muted);
}

.tone-option input:checked + .tone-chip {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Image Upload */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.image-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.image-upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.image-upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.uploaded-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.uploaded-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.uploaded-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploaded-image .remove-img {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: #FEF2F2;
}

/* ========== GENERATING STATE ========== */
.generating-state {
  text-align: center;
  padding: 80px 0;
}

.generating-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.pulse-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.1; }
}

.generating-icon {
  width: 48px;
  height: 48px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 8px)); }
}

.generating-state h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.generating-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.progress-bar {
  width: 300px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ========== FILTERS ========== */
.filter-row {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 150px;
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.filter-select,
.filter-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.1);
}

.filter-input[type="date"] {
  color-scheme: light;
}

.filter-input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

/* ========== FORMAT SELECTOR ========== */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.format-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  background: white;
  text-align: center;
}

.format-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.format-card.selected {
  border-color: var(--primary);
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.15);
}

.format-card .format-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}

.format-card.selected .format-check {
  display: flex;
}

.format-preview {
  margin: 0 auto 12px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.format-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.format-dims {
  font-size: 12px;
  color: var(--text-muted);
}

.format-platform-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

/* ========== CLONE ANALYZING ========== */
.clone-analyzing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.clone-analyzing-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.clone-analyzing-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.clone-analyzing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clone-analyzing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.clone-analyzing-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.clone-analyzing-info {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clone-analyzing-info strong {
  font-size: 14px;
  color: var(--text);
}

.clone-analyzing-info span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========== COPY CARDS ========== */
.copy-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .copy-cards {
    grid-template-columns: 1fr;
  }
}

.copy-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.copy-source-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.copy-source-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.copy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.copy-card.approved {
  border-color: var(--success);
  background: var(--success-light);
}

.copy-card.discarded {
  opacity: 0.4;
  border-color: var(--border);
}

.copy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.copy-card-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.copy-card-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.copy-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.copy-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copy-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.copy-field-value {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.copy-field-value[contenteditable="true"] {
  border-color: var(--border);
  background: var(--bg);
  cursor: text;
}

.copy-field-value[contenteditable="true"]:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ========== IMAGE GENERATION ========== */
.image-gen-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.image-gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.image-gen-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.image-gen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.image-gen-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s;
}

.image-gen-card.approved {
  border-color: #0ACF83;
  background: #f0fdf4;
}

.image-gen-card-image {
  width: 100%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-gen-card-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.image-gen-card-image .image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

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

.image-gen-card-info {
  padding: 12px 16px;
}

.image-gen-card-info .copy-preview {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.image-gen-card-info .copy-preview strong {
  color: var(--text);
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.image-gen-card-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
}

.image-gen-card-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
}

.model-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* ========== RESULT STATE ========== */
.result-state {
  text-align: center;
  padding: 48px 0;
}

.result-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
}

.result-state h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-description {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.result-details {
  max-width: 400px;
  margin: 0 auto 32px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.figma-icon-sm {
  width: 24px;
  height: 24px;
}

.result-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

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

/* ========== COMPETITORS (Ad Clone) ========== */
.competitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.competitor-card input { display: none; }

.competitor-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.competitor-inner:hover {
  border-color: var(--text-muted);
}

.competitor-card input:checked + .competitor-inner {
  border-color: var(--secondary);
  background: var(--secondary-light);
}

.competitor-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.competitor-name {
  font-size: 14px;
  font-weight: 600;
}

/* Country Selector */
.country-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.country-option input { display: none; }

.country-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.country-inner:hover {
  border-color: var(--text-muted);
}

.country-option input:checked + .country-inner {
  border-color: var(--secondary);
  background: var(--secondary-light);
}

.country-flag {
  font-size: 18px;
  line-height: 1;
}

.country-name {
  font-weight: 500;
}

.competitor-custom-input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

/* ========== ADS GALLERY ========== */
.ads-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.empty-competitor-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 12px;
  color: #6D4C00;
  font-size: 14px;
  margin-bottom: 4px;
}

.empty-notice-icon {
  flex-shrink: 0;
  color: #F9A825;
}

.ad-gallery-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.ad-gallery-card:hover {
  border-color: var(--text-muted);
}

.ad-gallery-card.selected {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.ad-gallery-image {
  aspect-ratio: 1;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-gallery-info {
  padding: 12px;
}

.ad-gallery-advertiser {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ad-gallery-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-country-flag {
  font-size: 14px;
  margin-right: 2px;
}

.ad-gallery-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ad-library-link {
  font-size: 11px;
  color: var(--secondary);
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
}

.ad-library-link:hover {
  text-decoration: underline;
}

/* ========== AD PREVIEW MODAL ========== */
#adPreviewOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ad-preview-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ad-preview-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
}

.ad-preview-close:hover { background: #f0f0f0; }

.ad-preview-content {
  display: flex;
  flex-direction: column;
}

.ad-preview-image {
  width: 100%;
  border-radius: 16px 16px 0 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-preview-image img {
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  display: block;
  object-fit: contain;
}

.ad-preview-details {
  padding: 20px 24px 24px;
}

.ad-preview-advertiser {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ad-preview-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.ad-preview-cta {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.ad-preview-destination {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  word-break: break-all;
}

.destination-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.destination-url {
  color: var(--primary);
  text-decoration: none;
}

.destination-url:hover {
  text-decoration: underline;
}

.ad-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.ad-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ad-gallery-image { position: relative; }

.ad-gallery-card:hover .ad-expand-btn { opacity: 1; }
.ad-expand-btn:hover { background: #fff; }

/* ========== AD VERSION BADGE ========== */
.ad-version-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.ad-status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}
.ad-status-badge.active {
  background: var(--success);
  color: #fff;
}
.ad-status-badge.inactive {
  background: rgba(0,0,0,0.55);
  color: #fff;
}

.ad-dest-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.ad-dest-badge.app { background: #e8f5e9; color: #2e7d32; }
.ad-dest-badge.quiz { background: #fff3e0; color: #e65100; }
.ad-dest-badge.web { background: #e3f2fd; color: #1565c0; }

/* ========== CAROUSEL ========== */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
}

.carousel-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  background: #f5f5f5;
  justify-content: center;
}

.carousel-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}
.carousel-thumb:hover { opacity: 0.9; }
.carousel-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}

/* ========== SEARCH LOADING ========== */
#searchLoadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-loading {
  text-align: center;
  max-width: 420px;
  padding: 40px;
}

.search-loading-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.search-loading-animation .pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: pulse-ring 1.5s ease-out infinite;
}

.search-loading-icon {
  width: 48px;
  height: 48px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: search-spin 2s linear infinite;
}

@keyframes search-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.search-loading-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.search-loading-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.search-loading-steps {
  text-align: left;
  margin: 0 auto 24px;
  max-width: 280px;
}

.search-step {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
}

.search-step.active {
  color: var(--text-primary);
  font-weight: 500;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}

.search-step.active .step-dot {
  background: var(--primary);
  animation: pulse-dot 1s ease-in-out infinite;
}

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

.search-loading-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.search-loading .progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.search-loading .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0;
  transition: width 1s linear;
}

/* ========== HISTORY ========== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}
.history-item:last-child { margin-bottom: 0; }
.history-item .history-item-info {
  width: 100%;
}

.history-item:hover {
  box-shadow: var(--shadow);
}

.history-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.history-item-type {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.history-item-type.create {
  background: var(--primary-light);
  color: var(--primary);
}

.history-item-type.clone {
  background: var(--secondary-light);
  color: var(--secondary);
}

.history-item-details h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.history-item-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.history-item-link,
.history-figma-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.history-item-type.images {
  background: #ECFDF5;
  color: #059669;
}
.history-item-type.figma {
  background: #F0F9FF;
  color: #0284C7;
}

/* History Filters */
.history-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.history-filter {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.history-filter.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.history-filter:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

/* History Copies Preview */
.history-copies-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}
.history-copy-snippet {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.history-copy-snippet.clickable {
  cursor: pointer;
  padding: 6px 8px;
  margin: -2px -8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.history-copy-snippet.clickable:hover {
  background: var(--border-light);
}
.history-copy-snippet.expanded {
  background: var(--border-light);
}
.history-copy-snippet.snippet-hidden {
  display: none;
}
.snippet-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}
.snippet-text {
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}
.snippet-full {
  white-space: pre-wrap;
  word-break: break-word;
}
.snippet-expand-icon {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
  margin-top: 3px;
}
.snippet-more {
  color: var(--text-muted);
  font-size: 12px;
  padding-left: 28px;
}
.snippet-more.clickable {
  cursor: pointer;
  padding: 4px 8px 4px 28px;
  border-radius: 4px;
}
.snippet-more.clickable:hover {
  color: var(--primary);
  background: var(--border-light);
}

/* History Images Preview */
.history-images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-img-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.history-img-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.history-img-thumb:hover {
  transform: scale(1.1);
}
.img-thumb-model {
  font-size: 9px;
  color: var(--text-muted);
  max-width: 60px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-thumb-badges {
  font-size: 8px;
  color: var(--text-muted);
}
.img-thumb-prompt-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.history-img-wrapper:hover .img-thumb-prompt-btn {
  opacity: 1;
}
.img-thumb-prompt-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Prompt Modal */
.prompt-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.prompt-modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.prompt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.prompt-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}
.prompt-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
}
.prompt-modal-scroll {
  overflow-y: auto;
  flex: 1;
}
.prompt-context {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.prompt-context-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.prompt-context-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
  padding-top: 2px;
}
.prompt-context-value {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prompt-context-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}
.prompt-context-thumb:hover {
  transform: scale(1.5);
  z-index: 10;
}
.prompt-context-result {
  width: 64px;
  height: 64px;
}
.prompt-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}
.prompt-badge-ok {
  background: #E8F5E9;
  color: #2E7D32;
}
.prompt-badge-none {
  background: #FFF3E0;
  color: #E65100;
}
.prompt-modal-body {
  padding: 16px 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  background: var(--bg);
  margin: 0;
}
.prompt-modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.history-img-more {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.recent-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ========== MODEL PRIORITY LIST ========== */

.model-priority-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.model-priority-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.model-priority-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.model-priority-item.dragging {
  opacity: 0.5;
  border-color: var(--primary);
}
.model-priority-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.model-priority-rank.fallback {
  background: var(--border);
  color: var(--text-muted);
}
.model-priority-info {
  flex: 1;
}
.model-priority-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.model-priority-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.model-priority-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.model-priority-arrows button {
  width: 24px;
  height: 20px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.model-priority-arrows button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.model-priority-arrows button:disabled {
  opacity: 0.3;
  cursor: default;
}
.model-priority-arrows button:disabled:hover {
  background: #fff;
  color: var(--text-muted);
  border-color: var(--border);
}

/* ========== BRAND KIT ========== */

.brand-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.brand-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.brand-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.brand-tab:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.brand-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 24px;
  color: var(--text-muted);
}
.brand-upload-area:hover,
.brand-upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(232,80,91,0.04);
}
.brand-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.brand-upload-hint {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.6;
}
.brand-upload-category {
  font-size: 12px;
  margin-top: 8px;
  color: var(--primary);
}

.brand-kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.brand-kit-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
}
.brand-kit-card:hover {
  box-shadow: var(--shadow);
}
.brand-kit-card.uploading {
  opacity: 0.6;
}
.brand-kit-card-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.brand-kit-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.brand-kit-card-info {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-kit-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-kit-card-cat {
  font-size: 11px;
  color: var(--text-muted);
}
.brand-kit-card-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.brand-kit-card:hover .brand-kit-card-delete {
  display: flex;
}
.brand-kit-card-delete:hover {
  background: var(--danger);
}
.brand-kit-lang-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 16px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1;
}
.brand-kit-card.pinned {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 2px rgba(232,93,93,0.15);
}
.brand-kit-card-pin {
  position: absolute;
  top: 4px;
  right: 32px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.brand-kit-card:hover .brand-kit-card-pin { display: flex; }
.brand-kit-card-pin.active {
  display: flex;
  opacity: 1;
  background: rgba(232,93,93,0.15);
}
.brand-kit-card-pin:hover { opacity: 1; }
.brand-kit-lang-select {
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  margin-top: 2px;
}
.brand-kit-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.brand-kit-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-muted);
}

/* ========== ASSET PICKER (inline Brand Kit in steps) ========== */
.asset-picker-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}
.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

/* ========== CLONE REFERENCE THUMBNAIL ========== */
.clone-ref-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.clone-ref-thumb:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}
.clone-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clone-ref-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 7px;
  text-align: center;
  padding: 1px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== COMPARISON OVERLAY ========== */
.comparison-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  backdrop-filter: blur(4px);
}
.comparison-overlay.active { display: flex; }
.comparison-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.comparison-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
}
.comparison-side { text-align: center; }
.comparison-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--bg-secondary);
}
@media (max-width: 768px) {
  .comparison-grid { grid-template-columns: 1fr; }
}

/* ========== SETTINGS PAGE ========== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
}

.settings-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.prompt-editor {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
}

.prompt-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }

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

/* ========== RECENT LIST ITEMS ========== */
.recent-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  transition: var(--transition);
}

.recent-item:hover {
  box-shadow: var(--shadow);
}

.recent-item-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.recent-item-badge.template {
  background: var(--primary-light);
  color: var(--primary);
}

.recent-item-badge.clone {
  background: var(--secondary-light);
  color: var(--secondary);
}

.recent-item-info {
  flex: 1;
}

.recent-item-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.recent-item-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.recent-item-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

/* ========== LOADING SKELETON ========== */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; padding: 24px; }
  .dashboard-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-width: 100vw;
    min-height: auto;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    left: auto;
    bottom: auto;
    overflow: hidden;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: none;
    padding: 6px 8px;
    gap: 2px;
    width: 100%;
  }
  .sidebar-nav .nav-item {
    font-size: 11px;
    padding: 8px 10px;
    white-space: nowrap;
    gap: 4px;
    flex-shrink: 0;
  }
  .sidebar-nav .nav-item svg, .sidebar-nav .nav-icon { width: 14px; height: 14px; }
  .sidebar-logo { display: none; }
  .sidebar-footer { display: none; }
  .mobile-footer {
    display: block;
    background: var(--sidebar-bg);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    margin: 32px -16px -16px;
    border-radius: 12px 12px 0 0;
  }
  .mobile-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
  }
  .mobile-footer .btn-settings {
    font-size: 13px;
    padding: 8px 0;
    color: var(--sidebar-text);
  }
  .mobile-footer .btn-settings .nav-icon {
    stroke: var(--sidebar-text);
  }
  .mobile-footer .app-version {
    color: var(--sidebar-text);
    opacity: 0.5;
    font-size: 12px;
  }
  .main-content { margin-left: 0; padding: 16px; overflow-x: hidden; }

  /* Stepper: hide labels, compact */
  .step-label { display: none; }
  .step-line { width: 20px; margin: 0 4px; }
  .stepper { margin-bottom: 24px; padding: 12px 0; }

  /* Platform selector: wrap */
  .platform-selector { flex-wrap: wrap; }
  .platform-card { flex: 1 1 45%; min-width: 140px; }

  /* Copy cards: 1 column */
  .copy-cards-grid { grid-template-columns: 1fr; }

  /* Settings: stack columns */
  .settings-grid { grid-template-columns: 1fr; }

  /* Page titles */
  .page-title { font-size: 22px; }
  .page-description { font-size: 13px; }
}

@media (max-width: 600px) {
  .main-content { padding: 16px 12px; }

  /* Step actions: stack buttons */
  .step-actions { flex-wrap: wrap; gap: 10px; }
  .step-actions .btn { flex: 1 1 auto; min-width: 120px; justify-content: center; }
  .step-actions .approved-count,
  .step-actions .selected-count { width: 100%; text-align: center; order: -1; }

  /* Platform selector: full width */
  .platform-card { flex: 1 1 100%; }

  /* Format cards: smaller min */
  .format-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  /* Template grid: 2 columns on mobile */
  .template-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .template-card { border-radius: 8px; }
  .template-card h4 { font-size: 12px; }
  .template-card p { font-size: 10px; }

  /* Image gen cards: smaller */
  .image-gen-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .image-gen-card-actions { flex-wrap: wrap; }
  .image-gen-card-actions .btn { flex: 1 1 auto; font-size: 12px; padding: 8px 12px; }

  /* Copy card: compact */
  .copy-card { padding: 16px; }
  .copy-card h4 { font-size: 14px; }

  /* Config form: full width */
  .config-form { max-width: 100%; }

  /* Modals: full-width */
  .settings-modal .modal-content,
  .regen-modal .modal-content { max-width: 95%; padding: 16px; }
  .prompt-modal { max-width: 95%; }
  .prompt-modal-body { font-size: 11px; padding: 12px; }
  .prompt-context-label { min-width: 100px; font-size: 11px; }

  /* History: compact */
  .history-item { padding: 12px; }
  .history-item-details h4 { font-size: 13px; }
  .history-item-details p { font-size: 11px; }
  .history-img-thumb { width: 48px; height: 48px; }
  .history-img-wrapper .img-thumb-model { font-size: 8px; }

  /* Brand Kit */
  .brand-upload-area { padding: 20px 12px; }
  .brand-kit-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

  /* Dashboard */
  .dashboard-cards { gap: 16px; }
  .recent-item { padding: 12px; gap: 10px; }
  .recent-item-badge { width: 32px; height: 32px; font-size: 14px; }

  /* Ad Clone: competitor grid */
  .competitor-grid { grid-template-columns: 1fr; }
  .clone-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .main-content { padding: 12px 8px; }

  /* Stepper: tiny */
  .step-number { width: 24px; height: 24px; font-size: 12px; }
  .step-line { width: 12px; }

  /* Buttons: compact */
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-sm { padding: 6px 10px; font-size: 11px; }

  /* Toast: mobile-safe */
  .toast { right: 8px; left: 8px; max-width: none; bottom: 16px; }

  /* Settings modal */
  .settings-modal .modal-content { max-width: 100%; border-radius: 12px 12px 0 0; }

  /* Image gen: single column */
  .image-gen-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Dashboard cost stats: stack */
  .cost-summary-stats { flex-direction: column; gap: 8px; }

  /* Page title */
  .page-title { font-size: 20px; }

  /* History filters: scroll */
  .history-filters { overflow-x: auto; flex-wrap: nowrap; gap: 6px; }
  .history-filter { white-space: nowrap; font-size: 12px; padding: 6px 12px; }

  /* Prompt modal: full screen */
  .prompt-modal-overlay { padding: 8px; }
  .prompt-modal { max-width: 100%; max-height: 95vh; }
  .prompt-context-row { flex-direction: column; gap: 4px; }
  .prompt-context-label { min-width: auto; }
}

/* ========== IMAGE GENERATION SECTION ========== */

.image-gen-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.image-gen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.image-gen-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.image-gen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.image-gen-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.image-gen-card.approved {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(10, 207, 131, 0.15);
}

.image-gen-card-image {
  width: 100%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-gen-card-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
}

.image-gen-card-image img:hover {
  transform: scale(1.03);
}

.model-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.image-gen-card-info {
  padding: 12px 16px;
}

.copy-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.copy-preview strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.image-gen-card-actions {
  padding: 8px 16px 12px;
  display: flex;
  gap: 8px;
}

.image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, #f5f5f7 8%, #ebebef 18%, #f5f5f7 33%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

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

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

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

.image-loading .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(232, 80, 91, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.image-loading .ai-pulse {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232,80,91,0.12), rgba(232,80,91,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  animation: pulse-glow 2s ease-in-out infinite;
}

.image-loading span {
  font-weight: 500;
  color: #666;
}

.image-loading .loading-sub {
  font-size: 11px;
  color: #999;
  font-weight: 400;
  margin-top: -4px;
}

.image-loading-progress {
  width: 100px;
  height: 3px;
  background: rgba(232,80,91,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.image-loading-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: loading-progress 60s ease-out forwards;
}
@keyframes loading-progress {
  0% { width: 0%; }
  20% { width: 30%; }
  50% { width: 55%; }
  75% { width: 75%; }
  100% { width: 95%; }
}

.image-select-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  cursor: pointer;
}

.image-select-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ========== COST TRACKER ========== */

/* Sidebar Widget */
.cost-widget {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.cost-widget:hover {
  background: rgba(255,255,255,0.1);
}
.cost-widget-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cost-widget-icon {
  font-size: 14px;
}
.cost-widget-amount {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cost-widget-label {
  font-size: 11px;
  color: var(--sidebar-text);
  opacity: 0.7;
}
.cost-widget-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  opacity: 0.5;
  padding-left: 22px;
}

/* Dashboard Cost Card */
.cost-dashboard {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.cost-dashboard-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}
.cost-stat {
  flex: 1;
  text-align: center;
}
.cost-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cost-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Chart */
.cost-chart {
  margin-bottom: 20px;
}
.cost-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cost-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  padding-bottom: 20px;
  position: relative;
}
.cost-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cost-chart-bar {
  width: 100%;
  max-width: 40px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.cost-chart-label {
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  bottom: 0;
}

/* Breakdown */
.cost-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.cost-breakdown-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.cost-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
}
.cost-breakdown-row span:last-child {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 600;
}
.cost-empty {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}

/* Cost Log (modal) */
.cost-log-entry {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cost-log-time {
  color: var(--text-muted);
  min-width: 85px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
}
.cost-log-service {
  flex: 1;
  color: var(--text);
}
.cost-log-service small {
  color: var(--text-muted);
  font-weight: 400;
}
.cost-log-amount {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 600;
  color: var(--primary);
}

/* Cost modal filter + day headers */
.cost-modal-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.cost-modal-filter select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.cost-modal-total {
  font-size: 20px;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text);
}
.cost-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
  margin-top: 8px;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.cost-day-header span:last-child {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary);
}
.cost-breakdown-val {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 600;
}
.cost-breakdown-val small {
  color: var(--text-muted);
  font-weight: 400;
}

/* Cost modal overlay (dynamic, created by JS — NOT .modal-overlay to avoid conflict) */
.cost-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}
.modal-content,
.cost-modal-overlay .modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover {
  background: var(--border);
}
.modal-body {
  overflow-y: auto;
}

/* ========== CONTENT LAB ========== */
.cl-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.cl-tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.cl-tab:hover { color: var(--text); }
.cl-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.cl-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}
.cl-input-row .form-input { flex: 1; }

/* Profile Result */
.cl-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.cl-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.cl-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.cl-profile-info h3 { font-size: 18px; margin-bottom: 2px; }
.cl-profile-info p { color: var(--text-muted); font-size: 13px; }
.cl-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cl-metric {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.cl-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cl-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cl-metric-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}
.cl-metric-delta.up { color: var(--success); }
.cl-metric-delta.down { color: var(--danger); }
.cl-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.cl-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cl-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.cl-format-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 8px;
  background: var(--border-light);
}
.cl-format-segment {
  height: 100%;
  transition: width 0.3s;
}

/* Ideas */
.cl-ideas-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cl-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.cl-idea-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.cl-idea-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.cl-idea-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.cl-idea-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.cl-idea-format {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.cl-idea-format.reel { background: #ffe0e6; color: #c0392b; }
.cl-idea-format.carousel { background: #e0f0ff; color: #2980b9; }
.cl-idea-format.image { background: #e8f5e9; color: #27ae60; }
.cl-idea-format.story { background: #fff3e0; color: #e67e22; }
.cl-idea-hook {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.cl-idea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.cl-status-pill {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.cl-status-pill.idea { background: #f0f0f0; color: #666; }
.cl-status-pill.draft { background: #fff3e0; color: #e67e22; }
.cl-status-pill.scheduled { background: #e0f0ff; color: #2980b9; }
.cl-status-pill.published { background: #e8f5e9; color: #27ae60; }
.cl-status-pill.trash { background: #fce4ec; color: #c0392b; }
.cl-idea-hashtags {
  font-size: 11px;
  color: var(--text-muted);
}

/* Profile History */
.cl-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.cl-history-item:hover { background: var(--bg); }
.cl-history-date { font-size: 12px; color: var(--text-muted); }
.cl-history-handle { font-weight: 600; font-size: 14px; }

/* Loading */
.cl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
}
.cl-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 600px) {
  .cl-input-row { flex-wrap: wrap; }
  .cl-input-row .form-input { min-width: 0; }
  .cl-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .cl-ideas-grid { grid-template-columns: 1fr; }
}

/* ========== MULTISELECT DROPDOWN ========== */
.ms-wrap {
  position: relative;
}
.ms-chips {
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.ms-chips:hover { border-color: var(--text-muted); }
.ms-wrap.open .ms-chips { border-color: var(--primary); }
.ms-placeholder {
  color: var(--text-muted);
  font-size: 14px;
}
.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 14px;
}
.ms-chip-x {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.8;
}
.ms-chip-x:hover { opacity: 1; }
.ms-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
}
.ms-wrap.open .ms-dropdown { display: block; }
.ms-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px 4px;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.ms-item:hover { background: var(--border-light); }
.ms-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.ms-item span { font-weight: 500; color: var(--text); }
.ms-item small { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* ========== Image Card Meta Row (QA + Model) ========== */
.image-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 11px;
}
.model-badge-inline {
  background: var(--bg-muted, #e5e7eb);
  color: var(--text-muted, #6b7280);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 11px;
}
.qa-badge-slot { display: inline-flex; }

/* ========== QA Review Badges ========== */
.qa-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.qa-badge.loading { background: var(--bg-muted, #e5e7eb); color: var(--text-muted, #6b7280); }
.qa-badge.approved { background: #22c55e; color: white; }
.qa-badge.needs-work { background: #f59e0b; color: white; cursor: pointer; transition: background 0.15s; }
.qa-badge.needs-work:hover { background: #d97706; }

/* ========== Prompt Accordion ========== */
.prompt-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.prompt-accordion summary {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-muted, #f3f4f6);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prompt-accordion summary::-webkit-details-marker { display: none; }
.prompt-accordion summary::before {
  content: '▸';
  transition: transform 0.15s;
  font-size: 11px;
  color: var(--text-muted);
}
.prompt-accordion[open] summary::before { transform: rotate(90deg); }
.prompt-accordion-body {
  padding: 12px 14px 14px;
}

/* ==========================================================
   QUIZ ANALYTICS — Dashboard de Analytics dos Quizzes Lojong
   ========================================================== */
.qa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.qa-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.qa-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.qa-tab:hover { background: var(--bg); color: var(--text); }
.qa-tab.active {
  background: var(--primary);
  color: #fff;
}
.qa-period {
  display: flex;
  gap: 8px;
  align-items: center;
}
.qa-period select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.qa-refresh {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.qa-refresh:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.qa-content { min-height: 300px; }
.qa-loading { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }
.qa-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }
.qa-error { padding: 16px; background: #FEE; color: var(--danger); border-radius: var(--radius); border: 1px solid #FCC; font-size: 13px; }

/* Cards (overview) */
.qa-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.qa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.qa-card-success { border-color: var(--success); background: var(--success-light); }
.qa-card-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.qa-card-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.qa-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Tables */
.qa-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.qa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.qa-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.qa-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
.qa-table tr:last-child td { border-bottom: none; }
.qa-table tr:hover td { background: var(--bg); }
.qa-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-muted { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.qa-btn-link { background: none; border: none; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.qa-btn-link:hover { text-decoration: underline; }
.qa-code { font-family: 'SF Mono', Menlo, monospace; font-size: 11px; background: var(--bg); padding: 2px 6px; border-radius: 4px; color: var(--text-secondary); }

/* Badges */
.qa-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.qa-badge-pink   { background: #fce7f3; color: #be185d; }
.qa-badge-purple { background: #ede9fe; color: #6d28d9; }
.qa-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.qa-badge-gray   { background: #f1f5f9; color: #475569; }
.qa-badge-cyan   { background: #e0f2fe; color: #0369a1; }

/* Funnel */
.qa-funnel-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.qa-funnel-header label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.qa-funnel-header select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  min-width: 200px;
}
.qa-funnel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.qa-funnel-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.qa-funnel-label { font-size: 13px; color: var(--text); font-weight: 600; }
.qa-funnel-bar-wrap {
  background: var(--bg);
  border-radius: var(--radius-sm);
  height: 32px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.qa-funnel-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  transition: width 0.4s ease;
}
.qa-funnel-count { color: #fff; font-weight: 700; font-size: 13px; padding: 0 12px; }
.qa-funnel-pct { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-align: right; }
.qa-funnel-drop { font-size: 12px; color: var(--danger); font-weight: 600; text-align: right; }

/* Modal */
.qa-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 40px 20px;
  overflow-y: auto;
}
.qa-modal.active { display: flex; }
.qa-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-md);
}
.qa-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.qa-modal-close:hover { color: var(--text); }
.qa-modal-body h3 { margin: 0 0 16px; font-size: 20px; }
.qa-modal-body h4 { margin: 24px 0 12px; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.qa-session-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
}
.qa-session-meta strong { color: var(--text-secondary); font-weight: 600; }
.qa-section { margin-top: 20px; }
.qa-purchase-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.qa-timeline {
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px;
}
.qa-event-row {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.qa-event-row:last-child { border-bottom: none; }
.qa-event-time { color: var(--text-muted); white-space: nowrap; min-width: 130px; }
.qa-event-name { color: var(--text); }

@media (max-width: 768px) {
  .qa-toolbar { flex-direction: column; align-items: stretch; }
  .qa-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .qa-tab { white-space: nowrap; }
  .qa-cards { grid-template-columns: 1fr 1fr; }
  .qa-card-value { font-size: 22px; }
  .qa-funnel-row { grid-template-columns: 100px 1fr 50px; }
  .qa-funnel-drop { display: none; }
  .qa-session-meta { grid-template-columns: 1fr; }
  .qa-modal-content { padding: 20px; }
}

/* ==========================================================
   QUIZ ANALYTICS — Custom period dropdown + UTM select
   ========================================================== */
.qa-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.qa-utm-select select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-width: 180px;
}
.qa-utm-select select:hover { border-color: var(--primary); }

.qa-period-dropdown {
  position: relative;
}
.qa-period-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 180px;
}
.qa-period-btn:hover { border-color: var(--primary); }
.qa-period-btn svg:first-child { color: var(--text-muted); }
.qa-period-btn svg:last-child { color: var(--text-muted); margin-left: auto; }
.qa-period-btn span { flex: 1; text-align: left; }

.qa-period-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 100;
}
.qa-period-menu.open { display: block; }
.qa-period-item {
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}
.qa-period-item:hover { background: rgba(255,255,255,0.1); }
.qa-period-item.active { color: #fff; }
.qa-period-item svg { flex-shrink: 0; }

@media (max-width: 768px) {
  .qa-controls { flex-wrap: wrap; }
  .qa-period-btn { min-width: 140px; }
  .qa-utm-select select { min-width: 140px; }
}

/* ==========================================================
   QUIZ ANALYTICS — Calendar Date Picker
   ========================================================== */
.qa-period-menu {
  right: 0;
}
.qa-period-menu.open {
  display: flex;
  flex-direction: row;
  min-width: 640px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  padding: 0;
  overflow: hidden;
}
.qa-period-presets {
  background: #fafbfc;
  border-right: 1px solid var(--border);
  padding: 8px 0;
  min-width: 200px;
}
.qa-period-presets .qa-period-item {
  color: var(--text);
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.qa-period-presets .qa-period-item:hover { background: #f0f0f0; }
.qa-period-presets .qa-period-item.active { background: #E8EAF6; color: var(--primary); font-weight: 600; }

.qa-period-calendar {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 440px;
}
.qa-cal-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.qa-cal-input-wrap { flex: 1; }
.qa-cal-input-wrap label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}
.qa-cal-input-wrap input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}
.qa-cal-input-wrap input:focus { outline: none; border-color: var(--primary); }
.qa-cal-dash { color: var(--text-muted); padding-bottom: 10px; }

.qa-cal-grids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  position: relative;
}
.qa-cal-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
  z-index: 2;
}
.qa-cal-nav-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  pointer-events: auto;
  transition: all 0.15s;
}
.qa-cal-nav-btn:hover { background: var(--primary-light); color: var(--primary); }

.qa-cal-month {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qa-cal-month-title {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding: 4px 32px;
}
.qa-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.qa-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 0;
}
.qa-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.qa-cal-day {
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
  user-select: none;
}
.qa-cal-day:not(.qa-cal-blank):not(.qa-cal-future):hover { background: var(--primary-light); }
.qa-cal-blank { cursor: default; pointer-events: none; }
.qa-cal-future { color: #cbd5e1; cursor: not-allowed; pointer-events: none; }
.qa-cal-today { font-weight: 700; color: var(--primary); }
.qa-cal-start, .qa-cal-end {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600;
}
.qa-cal-in-range {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-radius: 0;
}

.qa-cal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.qa-cal-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
}
.qa-cal-cancel { color: var(--text-secondary); }
.qa-cal-cancel:hover { background: var(--bg); }
.qa-cal-apply { background: var(--primary); color: #fff; border-color: var(--primary); }
.qa-cal-apply:hover { background: var(--primary-dark); }
.qa-cal-apply:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 900px) {
  .qa-period-menu.open { flex-direction: column; min-width: 320px; }
  .qa-period-presets { border-right: none; border-bottom: 1px solid var(--border); }
  .qa-period-calendar { min-width: 320px; }
  .qa-cal-grids { grid-template-columns: 1fr; }
}

/* ==========================================================
   QUIZ LINKS — Lista de quizzes + Link Builder
   ========================================================== */
.ql-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  width: fit-content;
}
.ql-tab {
  background: transparent;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.ql-tab:hover { color: var(--text); background: var(--bg); }
.ql-tab.active { background: var(--primary); color: #fff; }

.ql-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.ql-info-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ql-info-value {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ql-code-big {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 14px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  flex: 1;
}
.ql-info-help {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.ql-info-help code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--text);
}

.ql-code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.ql-quiz-name { font-weight: 600; font-size: 13px; color: var(--text); }
.ql-quiz-concept { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ql-link {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
}
.ql-link:hover { text-decoration: underline; }

.ql-row-actions { white-space: nowrap; text-align: right; }
.qb-row-actions { white-space: nowrap; text-align: right; display: flex; gap: 8px; justify-content: flex-end; }
.qb-action-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.6;
}
.qb-action-btn:hover { background: #f1f5f9; color: var(--text); }
.qb-action-open { background: var(--primary); color: white; border-color: var(--primary); }
.qb-action-open:hover { background: #d94a4a; color: white; }
.qb-action-delete { color: var(--danger); border-color: var(--danger-light, #fecaca); }
.qb-action-delete:hover { background: #fef2f2; }
.qb-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; margin-top: 4px; }
.qb-toggle input { cursor: pointer; }
.ql-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s;
  text-decoration: none;
}
.ql-btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.ql-btn-copy {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ql-btn-copy:hover { background: var(--primary-dark); }

.ql-btn-small {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.ql-btn-small:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* Builder */
.ql-builder {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
}
.ql-builder-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.ql-builder-section h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ql-muted {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ql-muted code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-family: 'SF Mono', Menlo, monospace; }

.ql-quick-select {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ql-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.ql-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.ql-check:hover { border-color: var(--primary); background: var(--primary-light); }
.ql-check input[type="checkbox"] { display: none; }
.ql-check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ql-check input[type="checkbox"]:checked + .ql-check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.ql-check input[type="checkbox"]:checked + .ql-check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ql-check-text {
  font-size: 13px;
  color: var(--text);
}
.ql-check-text strong { color: var(--primary); margin-right: 4px; }

.ql-utm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.ql-utm-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ql-utm-grid label span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ql-utm-grid label input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  font-family: 'SF Mono', Menlo, monospace;
}
.ql-utm-grid label input:focus { outline: none; border-color: var(--primary); }

.ql-url-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ql-url-box code {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  word-break: break-all;
  line-height: 1.5;
}
.ql-preview {
  margin-top: 12px;
  text-align: right;
}
.ql-preview a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.ql-preview a:hover { text-decoration: underline; }

.ql-steps-cell { text-align: center; }
.ql-steps-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.ql-builder-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ql-builder-badge-sm {
  display: inline-block;
  padding: 1px 5px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin-left: 4px;
}

.ql-mixed-warning {
  padding: 10px 14px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ql-mixed-warning code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Menlo, monospace;
}

/* ==========================================================
   Meta Ads Token Banner
   ========================================================== */
.qa-meta-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.qa-meta-banner-warn {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
}
.qa-meta-banner-expired {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #991B1B;
}
.qa-meta-banner-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.qa-meta-banner-body { flex: 1; }
.qa-meta-banner-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.qa-meta-banner-msg { font-size: 13px; opacity: 0.85; }
.qa-meta-banner-btn {
  padding: 8px 16px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.qa-meta-banner-btn:hover { background: rgba(0,0,0,0.06); }
.qa-meta-banner-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.6;
  line-height: 1;
}
.qa-meta-banner-close:hover { opacity: 1; }

.qa-steps { padding-left: 20px; margin: 12px 0; }
.qa-steps li { margin: 6px 0; font-size: 13px; color: var(--text); }
.qa-steps code { background: var(--bg); padding: 1px 6px; border-radius: 3px; font-family: 'SF Mono', Menlo, monospace; font-size: 12px; }
.qa-code-block {
  background: #1a1a2e;
  color: #a5b4fc;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  overflow-x: auto;
  margin: 12px 0;
  line-height: 1.5;
}

/* ==========================================================
   Meta Ads dashboard cards + ROAS indicators
   ========================================================== */
.qa-card-ads {
  border-color: #6366F1;
  background: #EEF2FF;
}
.qa-card-ads .qa-card-label { color: #4338CA; }
.qa-card-ads .qa-card-value { color: #3730A3; }
.qa-card-ads .qa-card-sub { color: #6366F1; }

.qa-roas-good { color: #10B981; font-weight: 700; }
.qa-roas-meh { color: #F59E0B; font-weight: 700; }
.qa-roas-bad { color: #EF4444; font-weight: 700; }

/* (Multi-currency display removed — all revenue is now shown in EUR
    based on Hotmart's producer commission conversion. Gross and net
    are both in EUR inside the single Receita card.) */

/* ==========================================================
   Sidebar user info + logout button
   ========================================================== */
.user-info {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(232, 80, 91, 0.15);
  color: #FFB3B8;
  border: 1px solid rgba(232, 80, 91, 0.3);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.user-logout-btn:hover {
  background: rgba(232, 80, 91, 0.3);
  color: #fff;
}

/* ========== Campaign Publisher ========== */
.cp-stepper { display:flex; gap:8px; margin-bottom:24px; flex-wrap:wrap; }
.cp-step { display:flex; align-items:center; gap:8px; padding:10px 16px; background:#f1f3f5; border-radius:8px; color:#868e96; font-size:14px; font-weight:500; }
.cp-step.active { background:#E85D5D; color:#fff; }
.cp-step.done { background:#2D2D3F; color:#fff; }
.cp-step-num { display:inline-flex; width:22px; height:22px; align-items:center; justify-content:center; background:rgba(255,255,255,.3); border-radius:50%; font-size:12px; }
.cp-step:not(.active):not(.done) .cp-step-num { background:#dee2e6; color:#495057; }
.cp-card { background:#fff; border:1px solid #e9ecef; border-radius:12px; padding:24px; max-width:780px; }
.cp-card h3 { margin:0 0 8px; font-size:20px; }
.cp-help { color:#868e96; font-size:14px; margin:0 0 16px; }
.cp-empty { padding:32px; text-align:center; color:#868e96; background:#f8f9fa; border-radius:8px; }
.cp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-bottom:12px; }
.cp-thumb { position:relative; cursor:pointer; border:3px solid transparent; border-radius:8px; overflow:hidden; background:#f8f9fa; }
.cp-thumb.selected { border-color:#E85D5D; }
.cp-thumb img { width:100%; height:140px; object-fit:cover; display:block; }
.cp-thumb input { position:absolute; top:8px; left:8px; width:18px; height:18px; }
.cp-thumb-label { display:block; padding:6px 8px; font-size:11px; color:#495057; background:#fff; }
.cp-counter { font-size:13px; color:#495057; margin-bottom:12px; }
/* Campaign Publisher: barra flutuante de seleção (step 1) */
.cp-float-bar { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); width:min(720px, calc(100vw - 48px)); display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:14px 20px; background:#fff; border:1px solid #e9ecef; border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,.18); z-index:1000; }
#cpContent { padding-bottom: 80px; }
.cp-float-count { flex:1; font-size:14px; color:#2D2D3F; font-weight:600; }

/* Campaign Publisher: objective cards */
.cp-obj-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.cp-obj-card { display:flex; flex-direction:column; gap:4px; padding:14px; background:#fff; border:2px solid #e9ecef; border-radius:10px; cursor:pointer; text-align:left; transition:all .15s; }
.cp-obj-card:hover { border-color:#ced4da; }
.cp-obj-card.active { border-color:#E85D5D; background:#fff5f5; }
.cp-obj-card strong { font-size:14px; color:#2D2D3F; }
.cp-obj-card span { font-size:11px; color:#868e96; line-height:1.3; }
.cp-toggle { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; }
.cp-toggle input[type="checkbox"] { width:18px; height:18px; accent-color:#E85D5D; }
.cp-field { display:block; margin-bottom:14px; }
.cp-field > span { display:block; font-size:13px; font-weight:600; color:#2D2D3F; margin-bottom:6px; }
.cp-field input, .cp-field select, .cp-field textarea { width:100%; padding:10px 12px; border:1px solid #dee2e6; border-radius:6px; font-size:14px; font-family:inherit; box-sizing:border-box; }
.cp-field textarea { resize:vertical; }
.cp-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cp-countries { display:flex; flex-wrap:wrap; gap:8px; }
.cp-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border:1px solid #dee2e6; border-radius:20px; font-size:13px; cursor:pointer; }
.cp-chip:has(input:checked) { background:#E85D5D; color:#fff; border-color:#E85D5D; }
.cp-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }
.cp-review { display:grid; grid-template-columns:160px 1fr; gap:8px 16px; margin:0 0 16px; }
.cp-review dt { font-weight:600; color:#495057; font-size:13px; }
.cp-review dd { margin:0; font-size:14px; color:#2D2D3F; }
.cp-review code { background:#f1f3f5; padding:2px 6px; border-radius:4px; font-size:12px; }
.cp-success { border-color:#51cf66; }
.cp-success h3 { color:#37b24d; }

/* Campaign Publisher: zoom + lightbox */
.cp-thumb { position:relative; }
.cp-thumb-zoom { position:absolute; top:8px; right:8px; z-index:2; width:28px; height:28px; border-radius:6px; border:none; background:rgba(0,0,0,.6); color:#fff; cursor:pointer; font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center; }
.cp-thumb-zoom:hover { background:rgba(0,0,0,.85); }
.cp-thumb-clickable { display:block; cursor:pointer; }
.cp-lightbox { position:fixed; inset:0; background:rgba(0,0,0,.9); display:flex; align-items:center; justify-content:center; z-index:9999; cursor:zoom-out; }
.cp-lightbox img { max-width:90vw; max-height:90vh; box-shadow:0 8px 40px rgba(0,0,0,.6); }
.cp-lightbox-close { position:absolute; top:20px; right:24px; background:none; border:none; color:#fff; font-size:40px; cursor:pointer; line-height:1; }

.cp-lang-bar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.cp-lang-chip { padding:6px 12px; border:1px solid #dee2e6; border-radius:20px; background:#fff; cursor:pointer; font-size:13px; display:inline-flex; align-items:center; gap:6px; }
.cp-lang-chip span { background:#f1f3f5; color:#495057; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:600; }
.cp-lang-chip.active { background:#E85D5D; color:#fff; border-color:#E85D5D; }
.cp-lang-chip.active span { background:rgba(255,255,255,.25); color:#fff; }

.cp-thumb-clickable { position:relative; }
.cp-thumb-ratio { position:absolute; bottom:32px; right:6px; background:rgba(0,0,0,.7); color:#fff; font-size:10px; font-weight:600; padding:3px 7px; border-radius:4px; letter-spacing:.3px; }

.history-img-more.clickable { cursor:pointer; transition:background .15s; }
.history-img-more.clickable:hover { background:#E85D5D; color:#fff; }

.cp-field { position:relative; }
.cp-counter-inline { position:absolute; right:8px; bottom:6px; font-size:10px; color:#adb5bd; pointer-events:none; background:#fff; padding:1px 6px; border-radius:3px; }

/* Campaign Publisher: copy groups */
.cp-groups { display:flex; flex-direction:column; gap:12px; margin-bottom:12px; }
.cp-group { border:2px solid #e9ecef; border-radius:10px; padding:14px; background:#fff; transition:border-color .15s; }
.cp-group.selected { border-color:#E85D5D; background:#fff5f5; }
.cp-group-header { display:flex; gap:12px; align-items:flex-start; cursor:pointer; }
.cp-group-header input { width:18px; height:18px; margin-top:4px; flex-shrink:0; }
.cp-group-meta { flex:1; min-width:0; }
.cp-group-headline { font-weight:600; font-size:15px; color:#2D2D3F; }
.cp-group-sub { font-size:12px; color:#868e96; margin-top:2px; line-height:1.4; }
.cp-group-fmts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; align-items:center; }
.cp-fmt-badge { background:#e7f5ff; color:#1864ab; font-size:10px; font-weight:600; padding:2px 7px; border-radius:10px; letter-spacing:.3px; }
.cp-fmt-missing { font-size:10px; color:#c92a2a; background:#ffe3e3; padding:2px 7px; border-radius:10px; }
.cp-fmt-complete { font-size:10px; color:#2b8a3e; background:#d3f9d8; padding:2px 7px; border-radius:10px; }
.cp-group-thumbs { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.cp-mini-thumb { position:relative; width:80px; height:80px; border-radius:6px; overflow:hidden; background:#f8f9fa; }
.cp-mini-thumb img { width:100%; height:100%; object-fit:cover; }
.cp-mini-thumb .cp-thumb-zoom { position:absolute; top:4px; right:4px; width:22px; height:22px; font-size:13px; }
.cp-mini-thumb .cp-thumb-ratio { bottom:4px; right:4px; font-size:9px; padding:1px 5px; }

.cp-thumb-remove { position:absolute; top:4px; left:4px; width:22px; height:22px; border-radius:50%; border:none; background:rgba(220,38,38,.9); color:#fff; cursor:pointer; font-size:14px; font-weight:bold; line-height:1; display:flex; align-items:center; justify-content:center; padding:0; z-index:3; }
.cp-thumb-remove:hover { background:rgb(220,38,38); transform:scale(1.1); }

.cp-var-row { position:relative; margin-bottom:8px; }
.cp-var-row input, .cp-var-row textarea { width:100%; padding:10px 12px; padding-right:90px; border:1px solid #dee2e6; border-radius:6px; font-size:14px; font-family:inherit; box-sizing:border-box; }
.cp-var-row textarea { resize:vertical; }
.cp-var-row .cp-counter-inline { right:36px; bottom:8px; }
.cp-var-remove { position:absolute; top:50%; right:8px; transform:translateY(-50%); width:22px; height:22px; border-radius:50%; border:none; background:#fee; color:#c92a2a; cursor:pointer; font-size:14px; font-weight:bold; line-height:1; padding:0; }
.cp-var-remove:hover { background:#c92a2a; color:#fff; }
.cp-var-row textarea ~ .cp-var-remove { top:8px; transform:none; }
.cp-var-add { display:inline-block; padding:6px 12px; background:#fff5f5; border:1px dashed #E85D5D; border-radius:6px; color:#E85D5D; cursor:pointer; font-size:12px; margin-top:4px; }
.cp-var-add:hover { background:#E85D5D; color:#fff; }

.cp-var-regen { position:absolute; top:50%; right:34px; transform:translateY(-50%); width:22px; height:22px; border-radius:50%; border:none; background:#e7f5ff; color:#1864ab; cursor:pointer; font-size:13px; line-height:1; padding:0; display:flex; align-items:center; justify-content:center; }
.cp-var-regen:hover:not(:disabled) { background:#1864ab; color:#fff; }
.cp-var-regen.busy, .cp-var-regen:disabled { cursor:not-allowed; opacity:0.6; }
.cp-var-row textarea ~ .cp-var-regen { top:8px; transform:none; }
.cp-var-row textarea ~ .cp-var-remove { top:8px; transform:none; right:8px; }

.history-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid #f1f3f5; }

/* ========== Ad Video Spy ========== */
.vs-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; padding:18px; background:#fff; border:1px solid #e9ecef; border-radius:12px; margin-bottom:18px; }
.vs-field { display:flex; flex-direction:column; gap:6px; }
.vs-field.vs-actions { justify-content:flex-end; align-items:flex-start; }
.vs-label { font-size:12px; font-weight:600; color:#495057; text-transform:uppercase; letter-spacing:.4px; }
.vs-select { padding:9px 12px; border:1px solid #dee2e6; border-radius:6px; font-size:14px; background:#fff; cursor:pointer; }
.vs-comp-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.vs-comp-card { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1.5px solid #e9ecef; border-radius:8px; cursor:pointer; transition:all .15s; background:#fff; }
.vs-comp-card.selected { border-color:#E85D5D; background:#fff5f5; }
.vs-comp-card input { display:none; }
.vs-comp-emoji { font-size:18px; }
.vs-comp-icon { width:22px; height:22px; object-fit:contain; border-radius:4px; flex-shrink:0; }
.vs-comp-name { font-size:12px; font-weight:500; }
.vs-net-chips { display:flex; gap:6px; flex-wrap:wrap; }
.vs-net-chip { padding:7px 12px; border:1.5px solid #dee2e6; border-radius:18px; background:#fff; font-size:12px; cursor:pointer; }
.vs-net-chip.active { background:#E85D5D; color:#fff; border-color:#E85D5D; }

.vs-stats { font-size:13px; color:#495057; margin-bottom:12px; font-weight:500; }
.vs-empty { padding:48px 16px; text-align:center; color:#868e96; background:#fff; border:1px dashed #dee2e6; border-radius:12px; }
.vs-empty.vs-error { color:#c92a2a; border-color:#fa5252; background:#fff5f5; }
.vs-spinner { width:36px; height:36px; border:3px solid #f1f3f5; border-top-color:#E85D5D; border-radius:50%; margin:0 auto 12px; animation:spin 1s linear infinite; }

.vs-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.vs-card { background:#fff; border:1px solid #e9ecef; border-radius:12px; overflow:hidden; cursor:pointer; transition:transform .15s, box-shadow .15s; }
.vs-card:hover { transform:translateY(-2px); box-shadow:0 6px 24px rgba(0,0,0,.08); }
.vs-card-thumb { position:relative; aspect-ratio:9/16; background:#f1f3f5; overflow:hidden; }
.vs-card-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.vs-card-thumb-placeholder { display:flex; align-items:center; justify-content:center; height:100%; font-size:48px; color:#adb5bd; }
.vs-card-play { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); width:54px; height:54px; border-radius:50%; background:rgba(0,0,0,.65); color:#fff; display:flex; align-items:center; justify-content:center; font-size:22px; padding-left:4px; }
.vs-card:hover .vs-card-play { background:#E85D5D; }
.vs-card-body { padding:12px 14px; }
.vs-card-advertiser { font-weight:600; font-size:13px; color:#2D2D3F; margin-bottom:4px; }
.vs-card-text { font-size:12px; color:#495057; line-height:1.4; min-height:34px; max-height:50px; overflow:hidden; }
.vs-card-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }
.vs-tag { font-size:10px; padding:2px 7px; border-radius:10px; background:#f1f3f5; color:#495057; font-weight:500; }
.vs-tag-active { background:#d3f9d8; color:#2b8a3e; }
.vs-tag-inactive { background:#f1f3f5; color:#868e96; }
.vs-tag-tiktok { background:#fff0f6; color:#c2255c; }
.vs-tag-meta { background:#e7f5ff; color:#1864ab; }

.vs-modal { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; }
.vs-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.85); }
.vs-modal-content { position:relative; background:#fff; border-radius:12px; max-width:90vw; max-height:90vh; display:flex; gap:0; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.vs-modal-close { position:absolute; top:12px; right:12px; z-index:2; width:36px; height:36px; border-radius:50%; border:none; background:rgba(0,0,0,.6); color:#fff; font-size:22px; cursor:pointer; line-height:1; }
.vs-modal-video-wrap { width:min(540px, 50vw); background:#000; display:flex; align-items:center; justify-content:center; }
.vs-modal-video-wrap video { width:100%; height:auto; max-height:90vh; }
.vs-modal-no-video { color:#fff; padding:48px 24px; text-align:center; }
.vs-modal-info { padding:24px; max-width:420px; overflow-y:auto; max-height:90vh; }
.vs-modal-advertiser { font-weight:700; font-size:18px; color:#2D2D3F; margin-bottom:12px; }
.vs-modal-text { font-size:14px; line-height:1.5; color:#495057; margin-bottom:16px; white-space:pre-wrap; }
.vs-modal-meta { display:flex; flex-wrap:wrap; gap:10px; font-size:12px; color:#868e96; margin-bottom:16px; }
.vs-modal-meta span { display:inline-flex; align-items:center; }
@media (max-width: 720px) {
  .vs-modal-content { flex-direction:column; max-width:95vw; }
  .vs-modal-video-wrap { width:100%; }
  .vs-modal-info { max-width:100%; max-height:40vh; }
}

/* Video Spy: card favicon + destination tags */
.vs-card-advertiser { display:flex; align-items:center; gap:6px; }
.vs-card-fav { width:16px; height:16px; object-fit:contain; border-radius:3px; flex-shrink:0; }
.vs-tag-app { background:#fff4e6; color:#e67700; }
.vs-tag-quiz { background:#f3f0ff; color:#5f3dc4; }
.vs-tag-site { background:#e7f5ff; color:#1864ab; }

/* Ad Clone: broken image card (URL FB CDN expirada) */
.ad-gallery-card.ad-img-broken { position:relative; opacity:0.55; }
.ad-gallery-card.ad-img-broken::before { content:'⚠ URL expirada — atualizando…'; position:absolute; top:8px; left:8px; right:8px; z-index:5; background:rgba(220,38,38,.92); color:#fff; padding:6px 10px; border-radius:6px; font-size:11px; font-weight:600; text-align:center; pointer-events:none; }

.vs-load-more { display:flex; justify-content:center; margin-top:24px; padding:16px; }

/* Video Spy: card selection checkbox */
.vs-card { position:relative; }
.vs-card.vs-card-selected { outline:3px solid #E85D5D; outline-offset:-3px; box-shadow:0 6px 24px rgba(232,93,93,.25); }
.vs-card-check { position:absolute; top:8px; left:8px; z-index:20; width:28px; height:28px; cursor:pointer; border-radius:6px; background:rgba(255,255,255,.95); border:2px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,.3); display:flex; align-items:center; justify-content:center; color:#fff; font-size:16px; font-weight:700; line-height:1; transition:background .15s, border-color .15s, transform .1s; user-select:none; }
.vs-card-check:hover { transform:scale(1.08); }
.vs-card-check.checked { background:#E85D5D; border-color:#E85D5D; }

/* Video Spy: floating export bar */
.vs-export-bar { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); width:min(720px, calc(100vw - 48px)); display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:14px 20px; background:#fff; border:1px solid #e9ecef; border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,.18); z-index:1000; }
.vs-export-count { flex:1; font-size:14px; color:#2D2D3F; font-weight:600; }

/* History: Video Spy export preview */
.history-videos-preview { display:flex; flex-direction:column; gap:6px; margin-top:12px; padding:12px; background:#f8f9fa; border-radius:8px; }
.history-video-row { font-size:13px; color:#495057; display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.history-video-row strong { color:#2D2D3F; }
.history-video-more { font-size:12px; color:#868e96; font-style:italic; padding-top:4px; }
.history-item-type.videos { background:#fff4e6; color:#e67700; }

/* Users Admin */
.users-header { margin-bottom:16px; }
.users-list { display:flex; flex-direction:column; gap:12px; }
.user-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; background:#fff; border:1px solid #e9ecef; border-radius:10px; }
.user-card.inactive { opacity:0.6; }
.user-card-main { flex:1; min-width:0; }
.user-card-head { font-size:15px; color:#2D2D3F; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.user-card-meta { font-size:12px; color:#868e96; margin-top:2px; }
.user-card-features { font-size:12px; color:#495057; margin-top:6px; }
.user-card-actions { display:flex; gap:8px; flex-shrink:0; }
.user-role { display:inline-block; font-size:11px; padding:2px 8px; border-radius:10px; background:#f1f3f5; color:#495057; font-weight:600; }
.user-role-super_admin { background:#ffe3e3; color:#c92a2a; }
.user-role-user { background:#e7f5ff; color:#1864ab; }
/* Users Admin modal — polished */
.ua-modal-content { position:relative; background:#fff; max-width:640px; width:calc(100vw - 32px); margin:40px auto; border-radius:16px; box-shadow:0 24px 80px rgba(0,0,0,.28); z-index:10; max-height:calc(100vh - 80px); display:flex; flex-direction:column; overflow:hidden; }
.ua-modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:24px 28px 18px; border-bottom:1px solid #f1f3f5; }
.ua-modal-header h3 { margin:0 0 4px; color:#2D2D3F; font-size:20px; font-weight:700; }
.ua-modal-sub { margin:0; color:#868e96; font-size:13px; }
.ua-close-btn { background:#f1f3f5; border:none; width:32px; height:32px; border-radius:50%; font-size:20px; cursor:pointer; color:#495057; display:flex; align-items:center; justify-content:center; line-height:1; transition:background .15s; flex-shrink:0; }
.ua-close-btn:hover { background:#e9ecef; color:#2D2D3F; }
.ua-modal-body { padding:20px 28px; overflow-y:auto; flex:1; }
.ua-modal-footer { display:flex; justify-content:flex-end; gap:10px; padding:18px 28px; border-top:1px solid #f1f3f5; background:#fafbfc; }

.ua-field { margin-bottom:18px; }
.ua-field > label { display:block; font-size:13px; font-weight:600; color:#2D2D3F; margin-bottom:8px; }
.ua-field-note { font-weight:400; color:#868e96; font-size:12px; margin-left:6px; }
.ua-field input[type="text"], .ua-field input[type="email"] { width:100%; padding:10px 14px; border:1px solid #dee2e6; border-radius:8px; font-size:14px; color:#2D2D3F; background:#fff; transition:border-color .15s, box-shadow .15s; box-sizing:border-box; font-family:inherit; }
.ua-field input[type="text"]:focus, .ua-field input[type="email"]:focus { outline:none; border-color:#E85D5D; box-shadow:0 0 0 3px rgba(232,93,93,.12); }
.ua-field input[disabled] { background:#f8f9fa; color:#868e96; cursor:not-allowed; }
.ua-hint { margin:6px 0 0; font-size:12px; color:#868e96; }
.ua-pwd-wrap { position:relative; }
.ua-pwd-wrap input { padding-right:44px; }
.ua-pwd-toggle { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:18px; padding:4px; line-height:1; }

.ua-role-cards { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ua-role-card { position:relative; display:flex; align-items:center; gap:12px; padding:14px 16px; background:#fff; border:2px solid #e9ecef; border-radius:10px; cursor:pointer; transition:all .15s; }
.ua-role-card:hover { border-color:#ced4da; }
.ua-role-card.selected { border-color:#E85D5D; background:#fff5f5; }
.ua-role-card input { position:absolute; opacity:0; pointer-events:none; }
.ua-role-icon { font-size:24px; line-height:1; }
.ua-role-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.ua-role-info strong { font-size:14px; color:#2D2D3F; font-weight:700; }
.ua-role-info span { font-size:11px; color:#868e96; line-height:1.3; }

.ua-feat-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
#uaFeaturesField.dimmed { opacity:.45; pointer-events:none; }
.ua-feat-card { position:relative; display:flex; align-items:center; gap:10px; padding:10px 14px; background:#fff; border:2px solid #e9ecef; border-radius:8px; cursor:pointer; transition:all .15s; font-size:13px; }
.ua-feat-card:hover { border-color:#ced4da; }
.ua-feat-card.selected { border-color:#E85D5D; background:#fff5f5; }
.ua-feat-card input { position:absolute; opacity:0; pointer-events:none; }
.ua-feat-check-mark { width:20px; height:20px; border-radius:5px; background:#e9ecef; color:transparent; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all .15s; }
.ua-feat-card.selected .ua-feat-check-mark { background:#E85D5D; color:#fff; }
.ua-feat-icon { font-size:15px; line-height:1; flex-shrink:0; }
.ua-feat-label { color:#2D2D3F; font-weight:500; flex:1; }

.ua-toggle { display:flex !important; align-items:center; gap:10px; font-size:14px; color:#2D2D3F; cursor:pointer; font-weight:500 !important; }
.ua-toggle input[type="checkbox"] { width:18px; height:18px; accent-color:#E85D5D; }

.vs-modal-var-nav { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; background:#f8f9fa; border-radius:8px; margin-bottom:12px; }
.vs-modal-var-btn { width:32px; height:32px; border-radius:50%; border:1px solid #dee2e6; background:#fff; cursor:pointer; font-size:18px; line-height:1; display:flex; align-items:center; justify-content:center; }
.vs-modal-var-btn:hover { background:#E85D5D; color:#fff; border-color:#E85D5D; }
.vs-modal-var-nav span { font-size:12px; font-weight:600; color:#495057; }

.vs-modal-dest { background:#f8f9fa; border:1px solid #e9ecef; border-radius:8px; padding:12px; margin-bottom:14px; }
.vs-modal-dest-label { font-size:11px; font-weight:600; color:#495057; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.vs-modal-dest-link { display:block; color:#1864ab; font-size:12px; text-decoration:none; word-break:break-all; line-height:1.4; }
.vs-modal-dest-link:hover { text-decoration:underline; }
.vs-modal-dest-cta { font-size:11px; color:#868e96; margin-top:6px; font-style:italic; }

/* Video Spy: confirm dialog (clear cache) */
.vs-confirm-content { position:relative; background:#fff; border-radius:12px; max-width:480px; padding:28px; box-shadow:0 20px 60px rgba(0,0,0,.5); z-index:1; }
.vs-confirm-content h3 { margin:0 0 12px; font-size:18px; color:#2D2D3F; }
.vs-confirm-content p { margin:0 0 20px; font-size:14px; line-height:1.5; color:#495057; }
.vs-confirm-content p strong { color:#c92a2a; }
.vs-confirm-actions { display:flex; gap:10px; justify-content:flex-end; }
.btn-danger { background:#c92a2a; color:#fff; border:none; padding:9px 16px; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer; }
.btn-danger:hover { background:#a51919; }

/* Video Spy: actions row (search + clear cache lado a lado) */
.vs-actions-row { display:flex; gap:8px; align-items:flex-start; }
.vs-actions-row .btn { white-space:nowrap; }

/* ==========================================================
   QUIZ BUILDER — Editor visual de Quiz Config
   ========================================================== */

/* List header */
.qb-list-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.qb-btn-new {
  font-size: 13px;
  padding: 10px 20px;
}

/* Status badges */
.qb-badge-draft {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}
.qb-badge-published {
  background: var(--success-light);
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}
.qb-badge-archived {
  background: #FEE2E2;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}

/* Editor container */
.qb-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 80px; /* space for sticky actions */
}
.qb-editor-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Mode toggle (manual / AI) */
.qb-mode-toggle {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qb-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.qb-radio input[type="radio"] {
  accent-color: var(--primary);
}

/* Sections */
.qb-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.qb-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Collapsible toggle */
.qb-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.qb-section-toggle h3 {
  margin: 0;
}
.qb-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.15s;
}

/* Fields */
.qb-fields-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.qb-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qb-field-wide {
  flex: 2;
}
.qb-field label, .qb-field-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.qb-field input[type="text"],
.qb-field input[type="number"],
.qb-field select,
.qb-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.qb-field input:focus,
.qb-field select:focus,
.qb-field textarea:focus {
  border-color: var(--primary);
}
.qb-field textarea {
  resize: vertical;
  min-height: 60px;
}
.qb-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.qb-checkbox input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Screens header */
.qb-screens-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.qb-screens-header h3 {
  margin: 0;
}

/* Insert screen button (between cards) */
.qb-insert-screen {
  display: block;
  width: 100%;
  padding: 4px 0;
  margin: 2px 0;
  border: 1.5px dashed transparent;
  background: none;
  color: var(--text-muted, #999);
  font-size: .72rem;
  cursor: pointer;
  text-align: center;
  border-radius: var(--radius);
  transition: all .15s;
  opacity: 0;
}
.qb-insert-screen:hover {
  opacity: 1;
  border-color: var(--primary, #e85d5d);
  color: var(--primary, #e85d5d);
  background: rgba(232,93,93,.04);
}
#qbScreensList:hover .qb-insert-screen {
  opacity: .4;
}

/* Screen card */
.qb-screen-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0;
  overflow: hidden;
}
.qb-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}
.qb-screen-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qb-screen-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qb-screen-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
}
.qb-screen-type {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  background: var(--bg-card);
  cursor: pointer;
  outline: none;
}
.qb-screen-type:focus {
  border-color: var(--primary);
}
.qb-screen-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.qb-screen-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.qb-screen-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.qb-screen-btn:disabled:hover {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.qb-screen-delete:hover {
  background: #FEE2E2;
  color: var(--danger);
  border-color: var(--danger);
}
.qb-screen-body {
  padding: 16px;
}

/* Options list */
.qb-options-list {
  margin-top: 8px;
}
.qb-options-list .qb-field-label {
  display: block;
  margin-bottom: 8px;
}
.qb-option-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.qb-option-row .qb-opt-emoji { flex-shrink: 0; }
.qb-option-row .qb-opt-text { flex: 2; min-width: 120px; }
.qb-option-row .qb-opt-value { flex: 1; min-width: 70px; }
.qb-option-row .qb-opt-desc { flex: 2; min-width: 120px; }
.qb-opt-desc {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  outline: none;
}
.qb-opt-desc:focus { border-color: var(--primary); color: var(--text); }
.qb-opt-emoji {
  width: 60px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  outline: none;
}
.qb-opt-emoji:focus { border-color: var(--primary); }
.qb-opt-text {
  flex: 2;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.qb-opt-text:focus { border-color: var(--primary); }
.qb-opt-value {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--text-secondary);
  outline: none;
}
.qb-opt-value:focus { border-color: var(--primary); }
.qb-opt-remove {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.qb-opt-remove:hover {
  background: #FEE2E2;
  color: var(--danger);
  border-color: var(--danger);
}
.qb-opt-add {
  margin-top: 6px;
}

/* Actions bar (sticky bottom) */
.qb-actions {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(calc(-50% + 100px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 100;
}
.qb-actions-left, .qb-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qb-btn-publish {
  background: var(--success) !important;
  color: #fff !important;
}
.qb-btn-publish:hover {
  background: #059669 !important;
}
.qb-save-status {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Language panel */
.qb-lang-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qb-lang-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.qb-lang-status {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.qb-lang-done {
  color: var(--success);
}
.qb-lang-pending {
  color: var(--text-muted);
}
.qb-lang-translating {
  color: var(--warning);
}

/* AI section */
.qb-ai-section {
  border-left: 3px solid var(--secondary);
}
.qb-ai-section h3 {
  color: var(--secondary);
}
.qb-ai-status {
  margin-top: 12px;
  font-size: 13px;
}
.qb-ai-loading {
  color: var(--warning);
  font-weight: 600;
}
.qb-ai-error {
  color: var(--danger);
  font-weight: 600;
}
.qb-ai-pending {
  color: var(--text-muted);
}

/* Button: add screen */
.qb-btn-add {
  font-size: 12px;
  padding: 6px 14px;
}

/* Language dropdown button group */
.qb-btn-group {
  display: inline-flex;
  position: relative;
}
.qb-btn-group .qb-action-open {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.qb-action-lang-dd {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.qb-action-lang-dd:hover {
  background: #d94a4a;
}
.qb-lang-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
  min-width: 60px;
  overflow: hidden;
}
.qb-lang-popup a {
  display: block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.qb-lang-popup a:hover {
  background: #f1f5f9;
  color: var(--primary);
}

/* Editor layout: form + preview side by side */
.qb-editor-layout {
  display: flex;
  gap: 24px;
}
.qb-editor-form {
  flex: 1;
  min-width: 0;
  margin-right: 440px;
}
.qb-editor-preview {
  width: 400px;
  position: fixed;
  right: 40px;
  top: 80px;
  max-height: calc(100vh - 100px);
}
.qb-preview-iframe {
  width: 100%;
  height: calc(100vh - 140px);
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #FFF5F0;
}
.qb-preview-placeholder {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border: 2px dashed var(--border);
  border-radius: 16px;
}
.qb-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
/* Info items list */
.qb-items-list {
  margin-top: 8px;
}
.qb-items-list .qb-field-label {
  display: block;
  margin-bottom: 8px;
}
.qb-item-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
/* Offer testimonial row fields */
.qb-item-row .qb-tst-stars {
  width: 50px; flex-shrink: 0;
  padding: 7px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; text-align: center; outline: none;
}
.qb-item-row .qb-tst-text {
  flex: 3; min-width: 150px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}
.qb-item-row .qb-tst-author {
  flex: 1; min-width: 100px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}
.qb-item-row .qb-tst-stars:focus,
.qb-item-row .qb-tst-text:focus,
.qb-item-row .qb-tst-author:focus { border-color: var(--primary); }

.qb-feat-cls {
  width: 75px;
  flex-shrink: 0;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.qb-feat-cls:focus { border-color: var(--primary); }
.qb-item-icon {
  width: 60px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  outline: none;
}
.qb-item-icon:focus { border-color: var(--primary); }
.qb-item-text {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.qb-item-text:focus { border-color: var(--primary); }

/* Optional section containers (stats, testimonial, badges, summary, dynamic) */
.qb-stats-section,
.qb-testimonial-section,
.qb-badges-section,
.qb-summary-section,
.qb-dynamic-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 10px;
  background: var(--bg-card);
}
.qb-stats-section { border-left: 3px solid #f59e0b; }
.qb-testimonial-section { border-left: 3px solid var(--secondary, #2D2D3F); }
.qb-badges-section { border-left: 3px solid #10b981; }
.qb-summary-section { border-left: 3px solid #8b5cf6; }
.qb-dynamic-section { border-left: 3px solid #f97316; }
.qb-ft-section {
  border: 1px solid var(--border);
  border-left: 3px solid #06b6d4;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 10px;
  background: var(--bg-card);
}
.qb-ft-section > .qb-field-label { margin-bottom: 10px; }
.qb-ft-section > .qb-field { margin-bottom: 10px; }
.qb-ft-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.qb-ft-row .qb-ft-feature {
  flex: 2; min-width: 120px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}
.qb-ft-row .qb-ft-feature:focus { border-color: var(--primary); }
.qb-ft-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.qb-ft-check input { cursor: pointer; }
.qb-collapse-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qb-collapse-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .15s;
}
.qb-collapsible-opt[data-collapsed="true"] {
  padding-bottom: 8px;
}
.qb-collapse-body { margin-top: 10px; }
.qb-stats-section > .qb-field-label,
.qb-testimonial-section > .qb-field-label,
.qb-badges-section > .qb-field-label,
.qb-summary-section > .qb-field-label,
.qb-ft-section > .qb-field-label,
.qb-dynamic-section > .qb-field-label { margin-bottom: 0; }

/* Badge rows */
.qb-badge-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.qb-badge-row .qb-badge-icon {
  width: 50px; flex-shrink: 0;
  padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; text-align: center; outline: none;
}
.qb-badge-row .qb-badge-text {
  flex: 1;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}
.qb-badge-row .qb-badge-icon:focus,
.qb-badge-row .qb-badge-text:focus { border-color: var(--primary); }

/* Summary rows */
.qb-summary-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.qb-summary-row input[type="text"] {
  flex: 1; min-width: 80px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
}
.qb-summary-row .qb-sum-valuekey {
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--text-secondary); font-size: 12px;
}
.qb-summary-row input:focus { border-color: var(--primary); }

/* Dynamic content textareas */
.qb-dynamic-section textarea {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 50px;
}
.qb-dynamic-section textarea:focus { color: var(--text); }
.qb-dynamic-section select {
  min-width: 200px;
}

/* Comparison section */
.qb-comparison-section {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary, #E85D5D);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 10px;
  background: var(--bg-card);
}
.qb-comparison-section > .qb-field-label { margin-bottom: 10px; }

/* Report scales */
.qb-scales-list {
  margin-top: 8px;
}
.qb-scales-list > .qb-field-label {
  display: block;
  margin-bottom: 10px;
}
.qb-scale-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.qb-scale-card .qb-fields-row {
  align-items: flex-end;
}
.qb-scale-card > .qb-fields-row > .qb-opt-remove {
  align-self: flex-end;
  margin-bottom: 12px;
}
.qb-levels-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, var(--border));
}
.qb-levels-list > .qb-field-label {
  display: block;
  margin-bottom: 8px;
}
.qb-level-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.qb-level-row input[type="number"] {
  width: 70px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.qb-level-row input[type="text"] {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.qb-level-row input[type="color"] {
  width: 36px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
}
.qb-level-row input:focus { border-color: var(--primary); }

/* Reorder animation */
.qb-screen-card.qb-just-moved {
  animation: qb-highlight 0.6s ease;
}
@keyframes qb-highlight {
  0% { background: #dbeafe; transform: scale(1.01); }
  100% { background: var(--bg-card, #fff); transform: scale(1); }
}

/* Clone button (neutral, same as Editar) */
.qb-action-clone {
  color: var(--text);
  border-color: var(--border);
}
.qb-action-clone:hover {
  background: #f1f5f9;
  color: var(--text);
}

/* ========== QUIZ BUILDER — Per-screen preview ========== */
.qb-preview-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.qb-preview-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.qb-preview-btn.qb-preview-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.qb-screen-card.qb-screen-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Phone frame */
.qb-phone-frame {
  width: 375px;
  margin: 0 auto;
  background: #FFF5F0;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  padding: 20px;
  min-height: 500px;
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  position: relative;
}
.qb-phone-frame .qb-pv-logo {
  text-align: center;
  padding: 12px 0;
}
.qb-phone-frame .qb-pv-logo svg {
  height: 26px;
  width: auto;
}
.qb-phone-frame .qb-pv-progress {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 5px;
}
.qb-phone-frame .qb-pv-progress-bar {
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}
.qb-phone-frame .qb-pv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #E85D5D, #f59e0b);
  border-radius: 2px;
}
.qb-phone-frame .qb-pv-headline {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.3;
}
.qb-phone-frame .qb-pv-sub {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}
.qb-phone-frame .qb-pv-option {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.4;
}
.qb-phone-frame .qb-pv-option-radio {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  flex-shrink: 0;
}
.qb-phone-frame .qb-pv-option-check {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  flex-shrink: 0;
}
.qb-phone-frame .qb-pv-option-emoji {
  font-size: 1.2em;
  flex-shrink: 0;
}
.qb-phone-frame .qb-pv-btn {
  background: #E8A0A0;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
  text-align: center;
}
.qb-phone-frame .qb-pv-btn-binary {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #1e293b;
}
.qb-phone-frame .qb-pv-binary-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.qb-phone-frame .qb-pv-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(225,145,148,.12);
  border: 1px solid rgba(225,145,148,.18);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #E85D5D;
  text-align: center;
  margin: 0 auto 16px;
}
.qb-phone-frame .qb-pv-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #E85D5D;
  border-radius: 50%;
}
.qb-phone-frame .qb-pv-land-image {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  border-radius: 12px;
}
.qb-phone-frame .qb-pv-land-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #152651;
  text-align: center;
  margin-bottom: 10px;
}
.qb-phone-frame .qb-pv-land-sub {
  font-size: 14px;
  line-height: 1.6;
  color: #6B7A8D;
  text-align: center;
  margin-bottom: 20px;
}
.qb-phone-frame .qb-pv-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: #152651;
  font-weight: 500;
}
.qb-phone-frame .qb-pv-feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: #F8F2F4;
}
.qb-phone-frame .qb-pv-proof {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
}
.qb-phone-frame .qb-pv-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 12px;
}
.qb-phone-frame .qb-pv-eye {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #E85D5D;
  margin-bottom: 6px;
}
.qb-phone-frame .qb-pv-body {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 14px;
}
.qb-phone-frame .qb-pv-items {
  margin: 12px 0;
}
.qb-phone-frame .qb-pv-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: white;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.04);
  margin-bottom: 6px;
  font-size: 13px;
  color: #64748b;
}
.qb-phone-frame .qb-pv-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Loading preview */
.qb-phone-frame .qb-pv-loading-title {
  font-size: 16px;
  font-weight: 700;
  color: #152651;
  text-align: center;
  margin-bottom: 16px;
}
.qb-phone-frame .qb-pv-loading-bar {
  height: 5px;
  background: rgba(0,0,0,.05);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.qb-phone-frame .qb-pv-loading-fill {
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, #F2B8BA, #E19194);
  border-radius: 5px;
  animation: qb-pv-load 2s ease-in-out infinite;
}
@keyframes qb-pv-load {
  0% { width: 20%; }
  50% { width: 80%; }
  100% { width: 20%; }
}
.qb-phone-frame .qb-pv-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qb-phone-frame .qb-pv-loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: white;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.04);
  font-size: 13px;
  color: #64748b;
}
.qb-phone-frame .qb-pv-loading-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
}
.qb-phone-frame .qb-pv-loading-step.qb-pv-done .qb-pv-loading-dot {
  background: #E19194;
}

/* Scale preview */
.qb-phone-frame .qb-pv-scale-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 3px;
  margin: 16px 0;
}
.qb-phone-frame .qb-pv-scale-bar {
  flex: 1;
  border-radius: 6px;
  background: #e2e8f0;
  min-width: 0;
}
.qb-phone-frame .qb-pv-scale-bar.qb-pv-filled {
  background: #FDCED6;
}
.qb-phone-frame .qb-pv-scale-bar.qb-pv-active {
  background: #E19194;
}
.qb-phone-frame .qb-pv-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* Input preview */
.qb-phone-frame .qb-pv-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  color: #b0b8c4;
  background: white;
  text-align: center;
  font-weight: 500;
}

/* Report preview */
.qb-phone-frame .qb-pv-report-header {
  text-align: center;
  margin-bottom: 16px;
}
.qb-phone-frame .qb-pv-report-eye {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #E85D5D;
  margin-bottom: 4px;
}
.qb-phone-frame .qb-pv-report-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.qb-phone-frame .qb-pv-scale-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
}
.qb-phone-frame .qb-pv-scale-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
}
.qb-phone-frame .qb-pv-scale-row {
  margin-bottom: 10px;
}
.qb-phone-frame .qb-pv-scale-row:last-child {
  margin-bottom: 0;
}
.qb-phone-frame .qb-pv-scale-lbl {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.qb-phone-frame .qb-pv-scale-nm {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}
.qb-phone-frame .qb-pv-scale-vl {
  font-size: 12px;
  font-weight: 700;
  color: #152651;
}
.qb-phone-frame .qb-pv-scale-trk {
  height: 5px;
  background: rgba(0,0,0,.04);
  border-radius: 5px;
  overflow: hidden;
}
.qb-phone-frame .qb-pv-scale-fl {
  height: 100%;
  border-radius: 5px;
}

/* Preview nav */
.qb-pv-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.qb-pv-nav-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.qb-pv-nav-btn:hover {
  background: var(--primary-light);
}
.qb-pv-nav-btn.qb-pv-nav-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Empty state */
.qb-pv-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 40px 20px;
}
.qb-pv-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* ========== EMAIL TEMPLATES ========== */
.et-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.et-list-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.et-filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.et-filter-select:focus {
  border-color: var(--primary);
}

.et-table tbody tr:hover td {
  background: var(--primary-light);
}

.et-badge-draft {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}
.et-badge-published {
  background: var(--success-light);
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}
.et-badge-archived {
  background: #FEE2E2;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-block;
}

/* Editor */
.et-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 80px;
}
.et-editor-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.et-editor-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.et-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: flex-start;
}
.et-editor-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 1100px) {
  .et-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* HTML textarea */
.et-html-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 240px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  white-space: pre;
  overflow-x: auto;
}
.et-html-textarea:focus {
  border-color: var(--primary);
}

.et-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.et-field-hint code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--text);
}

/* Variables panel */
.et-vars-panel {
  position: sticky;
  top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  align-self: flex-start;
}
.et-vars-panel h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.et-vars-panel h4 {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.et-vars-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
/* Variable rows with editable mock + reset button */
.et-vars-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.et-vars-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}
.et-var-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 4px 10px;
  border-left: 3px solid transparent;
  transition: border-color 0.15s;
}
.et-var-row.et-var-customized {
  border-left-color: #F59E0B;
}
.et-var-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.et-var-name-clickable {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.15s;
}
.et-var-name-clickable:hover code,
.et-var-name-clickable:hover .et-var-row-label {
  text-decoration: underline;
}
.et-var-name-clickable code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--primary);
  background: transparent;
  padding: 0;
}
.et-var-row-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.et-var-row-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 2px;
}
.et-var-reset {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 99px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.et-var-reset:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #D97706;
}
.et-var-reset-placeholder {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.et-mock-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.et-mock-input:focus {
  border-color: var(--primary);
}

/* Preview */
.et-preview-subject {
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-weight: 600;
  border: 1px solid var(--border-light);
}
.et-preview-iframe {
  width: 100%;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.et-preview-status {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  min-height: 14px;
}
