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

:root {
  --sage: #555;
  --sage-light: #e0e0e0;
  --sage-dark: #171717;
  --cream: #ffffff;
  --warm-white: #f4f6f8;
  --text: #171717;
  --text-muted: #6b6b6b;
  --border: rgba(23, 23, 23, 0.12);
  --accent: #171717;
  --accent-light: #e0e0e0;
}

html, body {
  height: 100%;
  background: var(--warm-white);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: none;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.layout {
  min-height: 100vh;
  display: none;
  grid-template-columns: 300px 1fr;
  position: relative;
  z-index: 1;
}

.layout.authenticated { display: grid; }

/* ── LOGIN OVERLAY ── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

.login-overlay.hidden { display: none; }

.login-box {
  text-align: center;
  max-width: 380px;
  padding: 40px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-brand .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.login-brand .brand-icon svg { width: 16px; height: 16px; }

.login-brand .brand-name { font-size: 16px; }

.login-title {
  font-family: 'Jost', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--sage-dark);
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all 0.2s;
}

.google-signin-btn:hover { background: #333; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

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

.login-domains {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-error {
  margin-top: 16px;
  font-size: 12px;
  color: #ef4444;
  display: none;
}

.login-error.visible { display: block; }

/* ── USER BADGE (sidebar) ── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.user-badge img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.user-badge-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout-btn {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.signout-btn:hover { color: #ef4444; border-color: #ef4444; }

/* ── SIDEBAR ── */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--sage-dark);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg { width: 13px; height: 13px; fill: var(--cream); }

.brand-name {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sage-dark);
  text-transform: uppercase;
}

.sidebar-title {
  font-family: 'Jost', sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 8px;
}

.sidebar-title em { font-style: italic; font-weight: 300; color: var(--text-muted); }

.sidebar-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

.active-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(23,23,23,0.06);
  border: 1px solid var(--sage-light);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 500;
  color: var(--sage-dark);
  margin-bottom: 24px;
  transition: all 0.3s;
}

.active-brand-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

.steps { display: flex; flex-direction: column; gap: 14px; flex: 1; }

.step {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.step.active { opacity: 1; }
.step.done { opacity: 0.55; }

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--sage-dark);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.3s;
}

.step.active .step-num { background: var(--sage-dark); border-color: var(--sage-dark); color: white; }
.step.done .step-num { background: var(--sage-light); border-color: var(--sage-light); }

.step-label { font-size: 12px; color: var(--text); line-height: 1.5; }
.step-label strong { display: block; font-weight: 500; margin-bottom: 1px; }

.sidebar-footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── ENV TOGGLE ── */
.env-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}
.env-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--sage-light);
  position: relative;
  transition: background 0.2s;
}
.env-toggle-track.dev { background: #ef4444; }
.env-toggle-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.env-toggle-track.dev .env-toggle-thumb { transform: translateX(16px); }
.env-toggle-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.env-toggle-label.dev { color: #ef4444; }
.env-banner {
  display: none;
  background: #ef4444;
  color: white;
  text-align: center;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}
.env-banner.visible { display: block; }
body.dev-mode .layout { margin-top: 28px; }
body.dev-mode .sidebar { height: calc(100vh - 28px); top: 28px; }

/* ── MAIN ── */
.main { padding: 40px 48px; max-width: 820px; }

.section {
  margin-bottom: 40px;
  animation: fadeUp 0.5s ease both;
}

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

.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── BRAND SELECTOR ── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.brand-option {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s;
  background: var(--cream);
  position: relative;
}

.brand-option:hover { border-color: var(--sage); }
.brand-option.selected { border-color: var(--sage-dark); background: rgba(23,23,23,0.04); }
.brand-option input { display: none; }
.brand-emoji { font-size: 20px; margin-bottom: 6px; display: block; }
.brand-option-name { font-size: 12px; font-weight: 500; color: var(--text); display: block; margin-bottom: 1px; }
.brand-option-cat { font-size: 10px; color: var(--text-muted); display: block; }
.brand-option.selected .brand-option-name { color: var(--sage-dark); }

.brand-checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: var(--sage-dark);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.brand-option.selected .brand-checkmark { display: flex; }
.brand-checkmark svg { width: 9px; height: 9px; stroke: white; }

/* ── CUSTOM BRAND ── */
.brand-option--custom { border-style: dashed; }
.brand-option--custom .brand-emoji { font-size: 24px; }

.custom-brand-form {
  display: none;
  margin-top: 16px;
  padding: 20px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: fadeUp 0.3s ease both;
}
.custom-brand-form.visible { display: block; }
.custom-brand-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.custom-brand-form .form-group { display: flex; flex-direction: column; gap: 4px; }
.custom-brand-form .form-group.full-width { grid-column: 1 / -1; }
.custom-brand-form label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}
.custom-brand-form label .req { color: #ef4444; }
.custom-brand-form input,
.custom-brand-form textarea {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--warm-white);
  color: var(--text);
  transition: border-color 0.2s;
}
.custom-brand-form input:focus,
.custom-brand-form textarea:focus {
  outline: none;
  border-color: var(--sage-dark);
}
.custom-brand-form textarea { resize: vertical; min-height: 56px; }
.custom-brand-form .form-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.save-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--sage-dark);
  background: none;
  border: 1.5px solid var(--sage-light);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}
.save-brand-btn:hover { background: var(--sage-dark); color: white; border-color: var(--sage-dark); }
.save-brand-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── AD TYPE SELECTOR ── */
.adtype-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.adtype-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s;
  background: var(--cream);
  position: relative;
}

.adtype-card:hover { border-color: var(--sage); }
.adtype-card.selected { border-color: var(--sage-dark); background: rgba(23,23,23,0.04); }
.adtype-card input { display: none; }

.adtype-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  transition: background 0.2s;
}

.adtype-card.selected .adtype-icon { background: var(--sage-dark); }
.adtype-card.selected .adtype-icon svg { stroke: white; }

.adtype-name { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.adtype-desc { font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.adtype-card.selected .adtype-name { color: var(--sage-dark); }

.adtype-checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: var(--sage-dark);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.adtype-card.selected .adtype-checkmark { display: flex; }
.adtype-checkmark svg { width: 9px; height: 9px; stroke: white; }

/* ── ART TYPE SELECTOR ── */
.arttype-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.arttype-chip {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s;
  background: var(--cream);
  position: relative;
}

.arttype-chip:hover { border-color: var(--sage); }
.arttype-chip.selected { border-color: var(--sage-dark); background: rgba(23,23,23,0.04); }
.arttype-chip.disabled { opacity: 0.35; cursor: not-allowed; }

.arttype-emoji { font-size: 18px; display: block; margin-bottom: 4px; }
.arttype-name { font-size: 10px; font-weight: 500; color: var(--text); display: block; line-height: 1.3; }
.arttype-chip.selected .arttype-name { color: var(--sage-dark); }

.arttype-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: var(--sage-dark);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: white;
  font-weight: 600;
}

.arttype-chip.selected .arttype-badge { display: flex; }

.arttype-counter {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── PRODUCTS ── */
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.products-counter { font-size: 13px; color: var(--text-muted); }

.add-product-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sage-dark);
  background: none;
  border: 1.5px solid var(--sage-light);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  transition: all 0.2s;
}

.add-product-btn:hover { background: var(--sage-dark); color: white; border-color: var(--sage-dark); }
.add-product-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.product-card {
  position: relative;
  border: 1.5px dashed var(--sage-light);
  border-radius: 12px;
  overflow: hidden;
  background: var(--cream);
  aspect-ratio: 1;
  cursor: pointer;
  transition: all 0.22s;
}

.product-card:hover { border-color: var(--sage); }
.product-card.has-file { border-style: solid; border-color: var(--sage); }
.product-card.drag-over { border-color: var(--sage-dark); transform: scale(1.02); background: rgba(23,23,23,0.03); }

.product-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.product-card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  gap: 6px;
}

.product-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  display: none;
}

.product-card.has-file .product-preview { display: block; }
.product-card.has-file .product-card-inner { display: none; }
.product-card-icon { color: var(--sage); }

.product-card-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.badge-required {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  background: var(--sage-dark);
  color: white;
  padding: 2px 6px;
  border-radius: 20px;
  z-index: 3;
  pointer-events: none;
}

.product-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(30,30,30,0.65);
  color: white;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4;
  font-size: 13px;
  line-height: 1;
  transition: background 0.2s;
}

.product-card.has-file .product-remove { display: flex; }
.product-remove:hover { background: rgba(180,50,30,0.8); }

.product-fname {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(23,23,23,0.82);
  color: white;
  font-size: 9px;
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
  z-index: 3;
}

.product-card.has-file .product-fname { display: block; }

.products-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── PERSONA ── */
.persona-zone {
  border: 1.5px dashed var(--sage-light);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.22s;
  position: relative;
  background: var(--cream);
  display: flex;
  align-items: center;
  gap: 16px;
}

.persona-zone:hover { border-color: var(--sage); }
.persona-zone.has-file { border-style: solid; border-color: var(--sage); }

.persona-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.persona-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
  flex-shrink: 0;
  border: 2px solid var(--sage-light);
}

.persona-zone.has-file .persona-thumb { display: block; }

.persona-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px dashed var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--sage);
}

.persona-zone.has-file .persona-placeholder { display: none; }
.persona-info { text-align: left; }
.persona-title { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.persona-hint { font-size: 11px; color: var(--text-muted); }
.persona-fname { font-size: 11px; color: var(--sage-dark); font-weight: 500; margin-top: 3px; display: none; }
.persona-zone.has-file .persona-fname { display: block; }

.badge-optional {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  background: var(--sage-light);
  color: var(--sage-dark);
  padding: 2px 7px;
  border-radius: 20px;
  pointer-events: none;
}

/* ── INPUTS ── */
.field { margin-bottom: 16px; }

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
}

textarea, input[type="text"] {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
  transition: border-color 0.2s;
  resize: none;
  outline: none;
  line-height: 1.6;
}

textarea:focus, input:focus { border-color: var(--sage); }
textarea::placeholder, input::placeholder { color: var(--text-muted); opacity: 0.55; }

/* ── FORMAT ── */
.format-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }

.format-option {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--cream);
}

.format-option:hover { border-color: var(--sage); }
.format-option.selected { border-color: var(--sage-dark); background: rgba(23,23,23,0.04); }
.format-option input { display: none; }
.format-visual { display: flex; align-items: center; justify-content: center; height: 40px; }

.format-box {
  background: var(--sage-light);
  border-radius: 3px;
  transition: background 0.2s;
}

.format-option.selected .format-box { background: var(--sage-dark); }
.format-name { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.format-desc { font-size: 10px; color: var(--text-muted); }

/* ── QUALITY ── */
.quality-toggle { display: flex; gap: 10px; }

.quality-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.quality-btn.selected {
  border-color: var(--sage-dark);
  color: var(--sage-dark);
  font-weight: 500;
  background: rgba(23,23,23,0.04);
}

/* ── SUBMIT ── */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--sage-dark);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
}

.submit-btn:hover:not(:disabled) {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.submit-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ── STATUS PANEL ── */
.status-panel {
  display: none;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
}

.status-panel.visible { display: block; }

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

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.status-dot.done { background: #22c55e; animation: none; }
.status-dot.error { background: #ef4444; animation: none; }

@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.5; transform:scale(0.85); }
}

.status-title {
  font-family: 'Jost', sans-serif;
  font-size: 18px;
  font-weight: 300;
}

.status-log {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 2;
  font-family: 'Courier New', monospace;
  max-height: 180px;
  overflow-y: auto;
}

.log-line { display: flex; gap: 10px; animation: fadeUp 0.3s ease both; }
.log-time { color: var(--text-muted); }
.log-ok { color: #22c55e; }
.log-err { color: #ef4444; }

/* ── RESULTS ── */
.results-section {
  margin-top: 24px;
  display: none;
}

.results-section.visible { display: block; }

.results-section-title {
  font-family: 'Jost', sans-serif;
  font-size: 20px;
  font-weight: 300;
  margin-bottom: 16px;
  color: var(--text);
}

.copy-variants-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.copy-variant-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.copy-variant-card:hover { border-color: var(--sage); }

.variant-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.variant-a .variant-badge { background: rgba(23,23,23,0.08); color: #171717; }
.variant-b .variant-badge { background: rgba(59,130,246,0.1); color: #2563eb; }
.variant-c .variant-badge { background: rgba(168,85,247,0.1); color: #7c3aed; }

.variant-image-copy {
  font-family: 'Jost', sans-serif;
  font-size: 17px;
  font-weight: 500;
  font-style: normal;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.variant-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--sage-dark);
  margin-bottom: 10px;
}

.variant-primary-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.variant-principle {
  margin-top: 8px;
  font-size: 10px;
  color: var(--sage);
  font-style: italic;
}

.strategy-notes {
  background: rgba(23,23,23,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.strategy-notes strong {
  font-weight: 500;
  color: var(--sage-dark);
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--sage-dark);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--sage-light);
  border-radius: 8px;
  transition: all 0.2s;
}

.drive-link:hover { background: var(--sage-dark); color: white; border-color: var(--sage-dark); }

.images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.result-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
  animation: fadeUp 0.4s ease both;
}

.result-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.result-img-label {
  padding: 6px 10px;
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── EXPORT ACTIONS ── */
.export-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.export-btn:hover {
  background: var(--text);
  color: var(--cream);
}

.export-btn--brief {
  background: var(--text);
  color: var(--cream);
}

.export-btn--brief:hover {
  opacity: 0.85;
}

.error-msg {
  background: rgba(192,96,74,0.06);
  border: 1px solid rgba(192,96,74,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #a04030;
  margin-top: 12px;
  line-height: 1.7;
}

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

@media (max-width: 900px) {
  .layout.authenticated { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 24px 18px; }
  .adtype-grid { grid-template-columns: repeat(2,1fr); }
  .arttype-grid { grid-template-columns: repeat(3,1fr); }
  .copy-variants-grid { grid-template-columns: 1fr; }
}
