/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:         #0b0b12;
  --bg-panel:   #12121d;
  --bg-input:   #1a1a2a;
  --border:     rgba(255,255,255,0.07);
  --border-h:   rgba(255,255,255,0.14);
  --text:       #eeeef8;
  --muted:      #7777aa;
  --dim:        #44445a;
  --purple:     #a855f7;
  --pink:       #ec4899;
  --orange:     #f97316;
  --grad:       linear-gradient(135deg, #a855f7, #ec4899, #f97316);
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 4px 32px rgba(0,0,0,0.45);
  --accent:     #a855f7;
}

html { font-family: 'Inter', -apple-system, sans-serif; font-size: 15px; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── Header ─── */
.header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,11,18,0.85);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px;
  background: var(--grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff; letter-spacing: 0.3px;
  flex-shrink: 0;
}
.logo-text { font-size: 19px; font-weight: 700; }
.tagline { color: var(--muted); font-size: 13px; flex: 1; text-align: center; }
.auth-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ─── Main layout ─── */
.main {
  flex: 1;
  max-width: 1200px; width: 100%;
  margin: 0 auto;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

/* ─── Panel ─── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel-header { margin-bottom: 22px; }
.panel-header h2 { font-size: 16px; font-weight: 600; }

/* ─── Fields ─── */
.field { margin-bottom: 18px; }
.label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.badge {
  font-size: 10px; font-weight: 500;
  background: rgba(255,255,255,0.06);
  padding: 2px 7px; border-radius: 20px;
  color: var(--dim); letter-spacing: 0.4px;
}

/* ─── Format Tabs ─── */
.format-tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.tab:hover { border-color: var(--border-h); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border-color: rgba(168,85,247,0.38);
  color: var(--text);
}
.tab-icon { font-size: 14px; }

/* ─── Textarea ─── */
.textarea {
  width: 100%; padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.65;
  resize: vertical; outline: none; transition: border-color 0.18s;
}
.textarea::placeholder { color: var(--dim); }
.textarea:focus { border-color: rgba(168,85,247,0.45); }
.textarea.error { border-color: rgba(239,68,68,0.5) !important; }

/* ─── Upload Zone ─── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 108px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s; overflow: hidden;
}
.upload-zone:hover { border-color: var(--border-h); background: rgba(255,255,255,0.015); }
.upload-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 22px; color: var(--muted); text-align: center;
}
.upload-icon { color: rgba(168,85,247,0.55); margin-bottom: 3px; }
.upload-label { font-size: 13px; font-weight: 500; color: var(--text); }
.upload-hint { font-size: 12px; color: var(--muted); }

.upload-preview { position: relative; width: 100%; }
.upload-preview img { width: 100%; height: 140px; object-fit: cover; display: block; }
.remove-img {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.65); border: none;
  color: #fff; width: 27px; height: 27px;
  border-radius: 50%; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.remove-img:hover { background: rgba(0,0,0,0.88); }

/* ─── Upload Zone Small (modelo extras) ─── */
.upload-zone-sm { min-height: 70px; }
.upload-zone-sm .upload-content { padding: 12px 16px; gap: 3px; }
.upload-zone-sm .upload-icon { display: none; }
.upload-zone-sm .upload-label { font-size: 12px; }
.upload-zone-sm .upload-hint { font-size: 11px; }
.upload-zone-sm .upload-preview img { height: 88px; }

/* ─── Modelo Extras Section ─── */
.modelo-extras {
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.12);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}

/* Badge obrigatório */
.badge-req {
  font-size: 10px; font-weight: 600;
  background: rgba(249,115,22,0.12);
  color: var(--orange);
  border-radius: 5px; padding: 1px 6px;
  letter-spacing: 0.3px; text-transform: none;
  border: 1px solid rgba(249,115,22,0.25);
}

/* ─── Generate Button ─── */
.generate-btn {
  width: 100%; padding: 13px 22px; margin-top: 4px;
  background: var(--grad);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(168,85,247,0.3);
}
.generate-btn:active:not(:disabled) { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Empty State ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 11px;
  min-height: 420px; text-align: center; color: var(--muted);
}
.empty-icon { opacity: 0.25; margin-bottom: 6px; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state p { font-size: 14px; line-height: 1.65; max-width: 240px; }
.empty-state strong { color: var(--text); }

/* Vitrine empty/loading — compacto */
#v-empty, #v-loading, #v-img-loading {
  min-height: 140px;
}
#v-empty .empty-icon { display: none; }
#v-empty h3 { font-size: 14px; }
#v-empty p { font-size: 13px; max-width: 220px; }

/* ─── Loading ─── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 15px; min-height: 420px;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(168,85,247,0.18);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { color: var(--muted); font-size: 14px; }

/* ─── Result Container ─── */
#result-container { display: flex; flex-direction: column; gap: 14px; }

/* Generated image */
.result-image {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.result-image img { width: 100%; display: block; }
.result-image-placeholder {
  height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}

/* Cards */
.result-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.result-card-header {
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted);
}
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-family: inherit;
  padding: 3px 10px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-h); }
.copy-btn.copied { color: var(--purple); border-color: rgba(168,85,247,0.35); }
.card-body { padding: 14px 15px; font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

/* Hashtags */
.hashtags-wrap { padding: 13px 15px; display: flex; flex-wrap: wrap; gap: 7px; }
.hashtag {
  font-size: 13px; color: var(--purple);
  background: rgba(168,85,247,0.1);
  padding: 4px 10px; border-radius: 20px;
  cursor: pointer; transition: background 0.15s;
}
.hashtag:hover { background: rgba(168,85,247,0.18); }

/* Slides (Carrossel) */
.slides-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.slide-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 9px; padding: 14px;
}
.slide-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); font-size: 10px; font-weight: 700; color: #fff;
  margin-bottom: 8px;
}
.slide-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.slide-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Reels Script */
.reels-body { padding: 16px 15px; display: flex; flex-direction: column; gap: 18px; }
.reels-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); margin-bottom: 8px;
}
.reels-gancho {
  font-size: 17px; font-weight: 700; line-height: 1.4;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.reels-point {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.65; margin-bottom: 8px;
}
.reels-point:last-child { margin-bottom: 0; }
.point-num {
  flex-shrink: 0; width: 21px; height: 21px;
  background: rgba(168,85,247,0.13);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--purple);
}
.reels-cta {
  font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(236,72,153,0.1));
  border: 1px solid rgba(168,85,247,0.2);
}

/* ─── Admin cost per user ─── */
.admin-user-cost {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  min-width: 90px; text-align: right;
}
.admin-cost-value { font-size: 12px; font-weight: 600; color: var(--purple); }
.admin-cost-imgs  { font-size: 10px; color: var(--muted); }

/* ─── Admin cost detail (expanded) ─── */
.admin-cost-detail {
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.12);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 2px;
}
.admin-cost-detail-grid {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-bottom: 10px;
}
.acd-item { display: flex; flex-direction: column; gap: 2px; }
.acd-item span  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.acd-item strong { font-size: 13px; font-weight: 600; color: var(--text); }

.acd-monthly-title { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.acd-month-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-top: 1px solid var(--border);
  font-size: 12px;
}
.acd-month-name  { flex: 1; color: var(--text); text-transform: capitalize; }
.acd-month-stats { color: var(--muted); font-size: 11px; }
.acd-month-cost  { font-weight: 600; color: var(--purple); min-width: 80px; text-align: right; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 13px 18px; border-radius: 12px;
  font-size: 13px; max-width: 360px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: fadeUp 0.25s ease;
}
.toast.error {
  background: #1e0a0c;
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.toast.success {
  background: #071a10;
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Mode Nav ─── */
.mode-nav {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.mode-nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px;
  display: flex; gap: 4px;
}
.mode-btn {
  padding: 12px 20px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; gap: 7px;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  color: var(--text);
  border-bottom-color: var(--purple);
}

/* ─── Text Input ─── */
.text-input {
  width: 100%; padding: 11px 13px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color 0.18s;
}
.text-input::placeholder { color: var(--dim); }
.text-input:focus { border-color: rgba(168,85,247,0.45); }

/* ─── Mode Tabs (Produto / Pessoa) ─── */
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.mode-tab {
  padding: 12px 10px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; text-align: center;
}
.mode-tab:hover { border-color: var(--border-h); color: var(--text); }
.mode-tab.active {
  background: rgba(168,85,247,0.12);
  border-color: var(--purple);
  color: #d8b4fe;
  font-weight: 600;
}

/* ─── Shot Type Tabs ─── */
.shot-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px;
}
.shot-btn {
  padding: 9px 4px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; text-align: center; line-height: 1.35;
}
.shot-btn:hover { border-color: var(--border-h); color: var(--text); }
.shot-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border-color: rgba(168,85,247,0.38); color: var(--text);
}
.shot-sub {
  margin-top: 8px; padding: 10px 12px;
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-sm);
}
.shot-sub-row { display: flex; gap: 8px; }
.shot-sub-btn {
  flex: 1; padding: 7px 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; text-align: center;
}
.shot-sub-btn:hover { border-color: var(--border-h); color: var(--text); }
.shot-sub-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.15));
  border-color: rgba(168,85,247,0.45); color: var(--text);
}

/* ─── Objetivo Chips ─── */
.obj-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.obj-chip {
  padding: 7px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.obj-chip:hover { border-color: var(--border-h); color: var(--text); }
.obj-chip.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.15));
  border-color: rgba(168,85,247,0.45); color: var(--text);
}
.obj-sub {
  margin-top: 8px; padding: 10px 12px;
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-sm);
}
.obj-sub-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.date-chip {
  padding: 5px 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.date-chip:hover { border-color: var(--border-h); color: var(--text); }
.date-chip.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(234,179,8,0.15));
  border-color: rgba(249,115,22,0.45); color: var(--text);
}

/* ─── Style Grid (Vitrine) ─── */
.style-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px;
}
.style-btn {
  padding: 9px 4px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; text-align: center;
  line-height: 1.35;
}
.style-btn:hover { border-color: var(--border-h); color: var(--text); }
.style-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border-color: rgba(168,85,247,0.38); color: var(--text);
}

/* ─── Vitrine Output ─── */
.v-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--muted);
  margin: 16px 0 10px;
}

/* Product card */
#v-product-card,
.v-product-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.v-product-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
.v-product-info { flex: 1; min-width: 0; }
.v-product-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.v-product-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.v-product-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.v-product-tag {
  font-size: 11px; background: rgba(168,85,247,0.1);
  color: var(--purple); padding: 2px 8px; border-radius: 20px;
}

/* Scenario cards */
.scenario-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.scenario-card:hover {
  border-color: rgba(168,85,247,0.35);
  background: rgba(168,85,247,0.05);
}
.scenario-card:last-child { margin-bottom: 0; }
.scenario-info { flex: 1; }
.scenario-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.scenario-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.scenario-arrow {
  color: var(--muted); flex-shrink: 0; transition: transform 0.18s;
}
.scenario-card:hover .scenario-arrow { transform: translateX(3px); color: var(--purple); }

/* Results grid */
.v-results-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.v-result-item { display: flex; flex-direction: column; gap: 8px; }
.v-result-item .img-wrap {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden;
  background: #111;
}
/* aspect ratio containers por formato */
.v-result-item .img-wrap.ratio-1-1 { aspect-ratio: 1/1; }
.v-result-item .img-wrap.ratio-4-5 { aspect-ratio: 4/5; }
.v-result-item .img-wrap.ratio-9-16 { aspect-ratio: 9/16; }
.v-result-item .img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.v-result-label {
  font-size: 11px; color: var(--muted); text-align: center;
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;
}
.download-btn {
  width: 100%; padding: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.download-btn:hover { border-color: var(--border-h); background: rgba(255,255,255,0.04); }
.download-original-btn { color: var(--muted); font-size: 11px; }
.download-4k-btn {
  width: 100%; padding: 8px;
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(249,115,22,0.12));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 8px; color: var(--purple);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.download-4k-btn:hover { border-color: rgba(168,85,247,0.55); background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(249,115,22,0.2)); }
.download-4k-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Toast de progresso */
.toast.progress {
  background: var(--bg-panel);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}

/* ─── Caption / Conteúdo Instagram ─── */
#v-caption-box {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.caption-section-title {
  font-size: 13px; font-weight: 600;
  color: var(--text); display: flex; align-items: center; gap: 6px;
}
.caption-loading {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); padding: 8px 0;
}
.spinner-sm {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(168,85,247,0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
.caption-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.caption-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent);
}
.caption-text {
  font-size: 13px; color: var(--text); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.caption-tags { color: var(--muted); font-size: 12px; }
.caption-copy {
  align-self: flex-end;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 500;
  padding: 4px 10px; cursor: pointer; transition: all 0.18s;
}
.caption-copy:hover { border-color: var(--accent); color: var(--accent); }
.caption-error { font-size: 13px; color: var(--muted); }
.caption-retry {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: inherit; font-size: 12px;
  padding: 3px 10px; cursor: pointer; margin-left: 8px;
}

/* ─── Crop Modal ─── */
.crop-modal { position: fixed; inset: 0; z-index: 9999; }
.crop-overlay {
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.crop-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 12px;
}
.crop-title { font-size: 15px; font-weight: 600; text-align: center; }
.crop-hint  { font-size: 11px; color: var(--muted); text-align: center; }
.crop-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid var(--accent);
  cursor: grab;
  user-select: none;
  margin: 0 auto;
  background: #000;
  min-height: 60px;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img {
  position: absolute; top: 0; left: 0;
  display: block; will-change: transform;
}
.crop-actions { display: flex; gap: 8px; }
.crop-cancel, .crop-confirm {
  flex: 1; padding: 10px;
  border-radius: 8px; border: none;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.18s;
}
.crop-cancel  { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.crop-cancel:hover { border-color: var(--border-h); }
.crop-confirm { background: var(--accent); color: #fff; }
.crop-confirm:hover { opacity: 0.9; }

.v-back-btn {
  width: 100%; padding: 10px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.18s;
}
.v-back-btn:hover { color: var(--text); border-color: var(--border-h); }

/* ─── Save indicator ─── */
.v-save-indicator {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}
.v-save-indicator.visible {
  max-height: 32px;
  padding: 6px 0;
  opacity: 1;
}
.v-save-indicator.error { color: var(--orange); }

/* ─── Login Gate ─── */
.login-gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 20px;
  animation: fadeUp 0.3s ease;
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.login-title {
  font-size: 22px; font-weight: 700; line-height: 1.3;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-desc {
  font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 320px;
}
.login-features {
  width: 100%;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px;
}
.login-feature {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text); text-align: left;
}
.login-feature span { font-size: 16px; flex-shrink: 0; }
.login-google-btn {
  width: 100%; padding: 13px 20px;
  background: #fff; border: none; border-radius: 12px;
  color: #1f1f1f; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.login-google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.login-google-btn:active { transform: translateY(0); }
.login-footer {
  font-size: 12px; color: var(--dim);
}

/* ─── In-app browser notice ─── */
.inapp-notice {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(168,85,247,0.07);
  border: 1px solid rgba(168,85,247,0.22);
  border-radius: 14px; padding: 22px 20px;
  animation: fadeUp 0.3s ease;
}
.inapp-icon { font-size: 36px; line-height: 1; }
.inapp-title {
  font-size: 17px; font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.inapp-desc {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  text-align: center; max-width: 300px;
}
.inapp-desc strong { color: var(--text); }
.inapp-copy-btn {
  margin-top: 4px;
  padding: 11px 28px;
  background: var(--grad);
  border: none; border-radius: 12px;
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 2px 18px rgba(168,85,247,0.35);
}
.inapp-copy-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.inapp-copy-btn:active { transform: translateY(0); }
.inapp-copied {
  font-size: 13px; color: #6ee7b7; font-weight: 500;
}

/* ─── Auth area ─── */
.auth-login-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 20px; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.auth-login-btn:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.22), rgba(236,72,153,0.22));
  box-shadow: 0 0 18px rgba(168,85,247,0.2);
}
.auth-counter {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.auth-counter-bar {
  width: 52px; height: 3px;
  background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
}
.auth-counter-fill {
  height: 100%; background: var(--grad); border-radius: 2px;
  transition: width 0.4s ease;
}
.auth-counter.at-limit { color: var(--orange); }
.auth-counter.at-limit .auth-counter-fill { background: var(--orange); }
.auth-admin-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  border: none; cursor: pointer; padding: 2px 4px;
  border-radius: 4px; transition: opacity 0.15s;
}
.auth-admin-badge:hover { opacity: 0.75; }
.auth-history-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; color: var(--muted);
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: all 0.18s; white-space: nowrap;
}
.auth-history-btn:hover { color: var(--text); border-color: var(--border-h); }
.auth-user { display: flex; align-items: center; gap: 7px; }
.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--border); display: block;
}
.auth-avatar-init {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.auth-logout {
  background: none; border: none; color: var(--dim);
  font-family: inherit; font-size: 11px; cursor: pointer;
  padding: 2px 6px; border-radius: 4px; transition: color 0.15s;
}
.auth-logout:hover { color: var(--muted); }

/* ─── History Modal ─── */
.history-modal { position: fixed; inset: 0; z-index: 9990; }
.history-overlay {
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: stretch; justify-content: flex-end;
}
.history-panel {
  width: 100%; max-width: 480px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: histSlide 0.22s ease;
}
@keyframes histSlide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.history-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.history-header h2 { font-size: 15px; font-weight: 600; }
.history-close, .history-reload-btn {
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: all 0.15s;
}
.history-close:hover, .history-reload-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.history-reload-btn { font-size: 17px; margin-right: 2px; }
.history-reload-btn:active { transform: rotate(180deg); }
.history-body { flex: 1; overflow-y: auto; padding: 14px; }
.history-empty {
  text-align: center; color: var(--muted);
  padding: 40px 20px; font-size: 14px; line-height: 1.6;
  display: flex; flex-direction: column; align-items: center;
}

/* History grid */
.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.history-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; transition: all 0.18s;
}
.history-card:hover { border-color: rgba(168,85,247,0.35); transform: translateY(-1px); }
.history-thumb-wrap { aspect-ratio: 4/5; overflow: hidden; background: #111; }
.history-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.history-thumb-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; color: var(--dim);
}
.history-card-info { padding: 8px 10px; }
.history-card-product {
  font-size: 12px; font-weight: 600; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-card-scenario {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-card-date { font-size: 10px; color: var(--dim); margin-top: 3px; }

/* History detail */
.history-detail { display: flex; flex-direction: column; gap: 14px; }
.history-back-btn {
  align-self: flex-start;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted);
  font-family: inherit; font-size: 12px;
  padding: 6px 12px; cursor: pointer; transition: all 0.15s;
}
.history-back-btn:hover { color: var(--text); border-color: var(--border-h); }
.history-detail-product { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.history-detail-scenario { font-size: 13px; color: var(--muted); }
.history-detail-tema { font-size: 12px; color: var(--dim); margin-top: 3px; }
.history-detail-images { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-detail-img-wrap { display: flex; flex-direction: column; gap: 6px; }
.history-detail-img-wrap img { width: 100%; border-radius: 8px; display: block; }
.history-detail-btns { display: flex; flex-direction: column; gap: 5px; }
.history-crop-btn, .history-original-btn {
  width: 100%; padding: 7px 8px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 8px; font-family: inherit; font-size: 11px; cursor: pointer;
  transition: all 0.15s;
}
.history-crop-btn {
  background: var(--grad); border: none; color: #fff; font-weight: 500;
}
.history-crop-btn:hover { opacity: 0.88; }
.history-original-btn {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--muted);
}
.history-original-btn:hover { border-color: var(--border-h); color: var(--text); }
.history-crop-btn:disabled, .history-original-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Admin Panel ─── */
.admin-modal { position: fixed; inset: 0; z-index: 9995; }
.admin-overlay {
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: stretch; justify-content: flex-end;
}
.admin-panel {
  width: 100%; max-width: 620px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: histSlide 0.22s ease;
}
.admin-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.admin-header h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.admin-close {
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: all 0.15s;
}
.admin-close:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.admin-body { flex: 1; overflow-y: auto; padding: 16px; }
.admin-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.admin-stat {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.admin-stat-value { font-size: 22px; font-weight: 700; }
.admin-stat-value.grad {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.admin-table { display: flex; flex-direction: column; gap: 6px; }
.admin-user-row {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.admin-user-row:hover { border-color: var(--border-h); }
.admin-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.admin-avatar-init {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-email { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.admin-plan-badge {
  font-size: 10px; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.admin-plan-badge.free   { background: rgba(119,119,170,0.15); color: var(--muted); border: 1px solid rgba(119,119,170,0.25); }
.admin-plan-badge.pro    { background: rgba(168,85,247,0.15);  color: var(--purple); border: 1px solid rgba(168,85,247,0.3); }
.admin-plan-badge.admin  { background: rgba(249,115,22,0.15);  color: var(--orange); border: 1px solid rgba(249,115,22,0.3); }
.admin-credits {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.admin-credits-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.admin-credits-bar {
  width: 60px; height: 3px;
  background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden;
}
.admin-credits-fill { height: 100%; background: var(--grad); border-radius: 2px; }
.admin-edit-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 7px; color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 500;
  padding: 5px 10px; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.admin-edit-btn:hover { border-color: var(--purple); color: var(--purple); }

/* Edit row (inline) */
.admin-edit-row {
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.admin-edit-row label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.admin-edit-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.admin-edit-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 100px; }
.admin-edit-group label { font-size: 11px; color: var(--muted); }
.admin-edit-input {
  padding: 8px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-family: inherit; font-size: 13px; outline: none;
  transition: border-color 0.18s;
}
.admin-edit-input:focus { border-color: rgba(168,85,247,0.45); }
.admin-edit-select {
  padding: 8px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-family: inherit; font-size: 13px; outline: none;
  cursor: pointer;
}
.admin-save-btn {
  padding: 8px 16px; background: var(--grad); border: none;
  border-radius: 7px; color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.18s;
  white-space: nowrap;
}
.admin-save-btn:hover { opacity: 0.88; }
.admin-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-cancel-btn {
  padding: 8px 12px; background: none;
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--muted); font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-cancel-btn:hover { border-color: var(--border-h); color: var(--text); }

/* ─── Expression Grid (modo pessoa) ─── */
.expression-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
}
.expr-btn {
  padding: 9px 4px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; text-align: center; line-height: 1.35;
}
.expr-btn:hover { border-color: var(--border-h); color: var(--text); }
.expr-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border-color: rgba(168,85,247,0.38); color: var(--text);
}

/* ─── Responsive ─── */
@media (max-width: 780px) {
  .main { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .tagline { display: none; }
  .header { padding: 14px 16px; }
  .auth-counter { display: none; }
  .auth-counter.is-admin { display: flex; } /* admin badge sempre visível */
  .auth-history-btn span { display: none; }
  .history-panel { max-width: 100%; }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .expression-grid { grid-template-columns: repeat(5, 1fr); }
}
