/* Eme Labs — identidade Eme Digital: roxo profundo, laranja só como acento, Inter, linhas de 1px. */
:root {
  --bg: #2A0A3D;
  --card: #3A0F52;
  --secondary: #41125A;
  --muted: #43175A;
  --fg: #FFFFFF;
  --muted-fg: #C4B8C7;
  --border: #4E1A6A;
  --line-strong: #6A2A8C;
  --placeholder: #9E8FA5;
  --accent: #F97316;
  --accent-hover: #FB8A3C;
  --accent-press: #E8650C;
  --accent-ink: #2A0A3D;
  --accent-10: rgba(249, 115, 22, .1);
  --accent-14: rgba(249, 115, 22, .14);
  --success: #22C55E;
  --success-fg: #6EE7A0;
  --danger: #DC4444;
  --danger-fg: #FF9A9A;
  --scrim: rgba(20, 4, 30, .78);
  --violet: #A855C4;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
  --sidebar: 248px;
  --topbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea { caret-color: var(--accent); }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- Tipografia ---------- */
.kicker { font-size: 12px; line-height: 1.1; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.label { font-size: 11px; line-height: 1.2; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-fg); }
.muted { color: var(--muted-fg); }
.small { font-size: 13px; }
/* Escala fixa de produto: 36 · 20 · 17 · 15 · 13 · 11. Títulos sem kicker quando repetiriam o menu. */
h1.title { font-size: 36px; line-height: 1.08; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
h2.section-title { font-size: 20px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
.lead { font-size: 17px; line-height: 1.5; color: var(--muted-fg); max-width: 62ch; text-wrap: pretty; }
.reading { font-size: 15px; line-height: 1.5; color: var(--fg); max-width: 64ch; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--fg);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:hover { background: var(--secondary); border-color: var(--line-strong); }
.btn:active { background: var(--muted); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: transparent; border-color: var(--border); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.is-on { color: var(--accent); border-color: var(--accent); }
.btn.is-on svg path { fill: currentColor; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { border-color: transparent; color: var(--muted-fg); }
.btn-ghost:hover { color: var(--fg); background: var(--secondary); border-color: transparent; }
.btn-danger { color: var(--danger-fg); }
.btn-lg { min-height: 48px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--fg);
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { background: var(--secondary); }
.icon-btn:active { background: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.is-on { color: var(--accent); border-color: var(--accent); }
.icon-btn.is-on svg path { fill: currentColor; }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-plain { border-color: transparent; color: var(--muted-fg); }
.icon-btn-plain:hover { color: var(--fg); }
.text-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout do app ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 20px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  background: var(--bg); border-right: 1px solid var(--border);
}
/* Histórico de conversas: ocupa o que sobra do menu e rola sozinho. */
.history { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding-top: 14px; border-top: 1px solid var(--border); }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 12px; }
.history-head h2 { font-size: 13px; font-weight: 600; color: var(--muted-fg); }
.history-list { flex: 1 1 0; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.history-item { position: relative; }
.history-item a { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 30px 6px 8px; border-radius: var(--radius-sm); text-decoration: none; }
.history-item a:hover { background: var(--card); }
.history-item a[aria-current="page"] { background: var(--card); }
.history-item img, .history-noimage { display: block; width: 32px; height: 32px; object-fit: cover; border-radius: 8px; background: var(--muted); }
.history-item a > span:last-child { display: grid; min-width: 0; }
.history-item strong { font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { font-size: 12px; line-height: 1.3; color: var(--muted-fg); }
.history-delete { position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--muted-fg); opacity: 0; }
.history-delete svg { width: 14px; height: 14px; }
.history-delete:hover { background: var(--muted); color: var(--fg); }
.history-item:hover .history-delete, .history-delete:focus-visible { opacity: 1; }
@media (hover: none) { .history-delete { opacity: 1; } }
.history-empty { padding: 4px 12px; font-size: 13px; color: var(--muted-fg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; }
.brand img { width: 38px; height: auto; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.brand-name span { font-weight: 400; color: var(--muted-fg); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--muted-fg); text-decoration: none; font-weight: 500; font-size: 15px;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--fg); background: var(--card); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 600; background: var(--card); border-color: var(--border); }
.nav a .count { font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.nav a span:first-of-type { flex: 1; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.sidebar-foot .made-by { display: flex; align-items: center; gap: 10px; color: var(--muted-fg); font-size: 12px; }
.sidebar-foot .made-by img { height: 22px; width: auto; }
.mode-note { font-size: 12px; line-height: 1.4; color: var(--muted-fg); }
.mode-note strong { color: var(--fg); font-weight: 600; }

.app { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; color: var(--muted-fg); }
.crumbs strong { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.credits {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 40px; padding: 0 14px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--muted-fg); text-decoration: none;
}
.credits:hover { background: var(--secondary); color: var(--fg); }
.credits strong { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted-fg); white-space: nowrap;
}
.badge-accent { border-color: var(--accent); color: var(--accent); }
.badge-solid { background: rgba(42,10,61,.82); border-color: transparent; color: #fff; }
.menu-toggle { display: none; }
main { flex: 1; padding: 36px 32px 64px; width: 100%; max-width: 1480px; }
.view { animation: enter .26s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.page-head > div:not(.actions) { display: grid; gap: 12px; min-width: 0; }
.page-head .kicker { margin-bottom: -2px; }
.page-head .actions { display: flex; flex: none; gap: 10px; flex-wrap: wrap; }
/* A barra superior já tem "Novo criativo"; a cópia no cabeçalho da página só aparece onde a barra a esconde. */
.dup-cta { display: none !important; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--fg); }
.back svg { width: 16px; height: 16px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head .muted { font-size: 13px; }

/* ---------- Superfícies ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.empty {
  display: grid; justify-items: start; gap: 12px; padding: 32px;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted-fg);
}
.empty h3 { color: var(--fg); font-size: 18px; letter-spacing: -.02em; }
.empty p { max-width: 52ch; }

/* Número-herói (assinatura Eme) */
.hero-metric { padding: 8px 0 0; }
.hero-number { font-size: clamp(76px, 10vw, 136px); line-height: .92; letter-spacing: -.05em; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hero-metric > .label { margin-top: 12px; }
.hero-number.is-symbol { font-size: clamp(120px, 15vw, 200px); line-height: .74; }
.hero-rule { height: 1px; background: var(--border); margin-top: 28px; }
.hero-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero-cols > div { position: relative; padding: 22px 16px 0 0; display: grid; gap: 6px; }
.hero-cols > div::before { content: ""; position: absolute; top: 0; left: 0; width: 1px; height: 14px; background: var(--border); }
.hero-cols > div > * { padding-left: 14px; }
.hero-cols strong { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-cols a { color: inherit; text-decoration: none; }
.hero-cols a:hover strong { color: var(--accent); }

/* ---------- Início: saldo + começar por uma referência, depois o trabalho recente ---------- */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.flow li { display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 1px solid var(--border); }
.flow .num { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.flow strong { font-size: 15px; font-weight: 600; }
.flow span:last-child { font-size: 14px; color: var(--muted-fg); line-height: 1.45; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 18px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.field-label small { font-size: 12px; font-weight: 400; color: var(--muted-fg); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; transition: border-color .16s var(--ease);
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input[readonly] { color: var(--muted-fg); }
.input[readonly]:hover { border-color: var(--border); }
.input:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C4B8C7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.select option { background: var(--card); }
.hint { font-size: 13px; color: var(--muted-fg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; font-size: 14px; color: var(--muted-fg); white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] svg path { fill: var(--accent); stroke: var(--accent); }
.chip:hover { color: var(--fg); background: var(--secondary); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { color: var(--fg); border-color: var(--accent); background: var(--accent-10); }
.chip-sm { min-height: 30px; font-size: 13px; padding: 0 10px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.segmented button { min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-fg); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.segmented button:hover { color: var(--fg); }
.segmented button[aria-checked="true"] { background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent); }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }

.formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.format {
  display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 104px; padding: 12px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted-fg); text-align: center;
}
.format:hover { background: var(--secondary); color: var(--fg); }
.format[aria-checked="true"] { border-color: var(--accent); color: var(--fg); background: var(--accent-10); }
.format:disabled { opacity: .35; cursor: not-allowed; }
.format .shape { border: 1.5px solid currentColor; border-radius: 3px; height: 34px; }
.format strong { font-size: 13px; font-weight: 600; line-height: 1.15; }
.format small { font-size: 12px; font-variant-numeric: tabular-nums; }

.reference { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.reference img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); background: var(--muted); }
.reference strong { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference > div { min-width: 0; display: grid; gap: 4px; }

/* ---------- Conversa guiada: uma pergunta por vez; o painel de baixo muda conforme a resposta ---------- */
body.is-guide main { padding: 0; max-width: none; }
body.is-guide #new-creative { display: none; }
body.is-guide .view { animation: none; }
.guide { display: flex; flex-direction: column; min-height: calc(100dvh - var(--topbar)); }
body.is-operating .guide { min-height: calc(100dvh - var(--topbar) - 48px); }
.guide-thread { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; width: 100%; max-width: 900px; margin: 0 auto; padding: 40px 24px 28px; }
.guide.is-start .guide-thread { justify-content: center; max-width: 680px; padding-bottom: 48px; }
.guide-dock { position: sticky; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--border); }
.dock-inner { display: grid; gap: 14px; max-width: 900px; margin: 0 auto; padding: 18px 24px 14px; }
.guide.is-results .dock-inner { padding-bottom: 18px; }
.guide-thread > .is-new, .guide-panel-thread > .is-new { animation: rise .32s var(--ease) both; }
.guide-thread > .is-new:has(> .answer-row), .guide-panel-thread > .is-new:has(> .answer-row) { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(answer) { animation-duration: .34s; animation-timing-function: var(--ease); }
::view-transition-old(answer), ::view-transition-new(answer) { height: 100%; animation-duration: .34s; }

.say { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; scroll-margin-top: calc(var(--topbar) + 16px); }
[data-key^="status-"] { scroll-margin-top: calc(var(--topbar) + 16px); }
.say-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); flex: none; }
.say-avatar img { width: 23px; height: auto; }
.say-avatar-lg { width: 60px; height: 60px; }
.say-avatar-lg img { width: 34px; }
.say-body { display: grid; gap: 6px; justify-items: start; min-width: 0; padding-top: 6px; font-size: 16px; line-height: 1.5; }
.say-question { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.say-lead { color: var(--muted-fg); font-size: 16px; max-width: 58ch; text-wrap: pretty; }
.say-error { color: var(--danger-fg); }
.say time { font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.say-typing { display: flex; gap: 6px; padding-top: 16px; }
.say-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-fg); animation: dot 1s ease-in-out infinite; }
.say-typing i:nth-child(2) { animation-delay: .14s; }
.say-typing i:nth-child(3) { animation-delay: .28s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.answer-row { display: flex; justify-content: flex-end; }
.answer { max-width: min(80%, 520px); padding: 10px 16px; border-radius: 18px 18px 6px 18px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.answer-image { width: 132px; padding: 0; background: none; overflow: hidden; border-radius: 16px 16px 6px 16px; }
.answer-image img { width: 100%; height: auto; }
.answer-recap { max-width: min(90%, 560px); padding: 10px 16px 10px 10px; background: var(--card); border: 1px solid var(--border); color: var(--fg); font-weight: 400; }
.recap { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; }
.recap img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); background: var(--muted); }
.recap > div { display: grid; gap: 2px; min-width: 0; }
.recap strong { font-size: 15px; font-weight: 600; }
.recap span { font-size: 13px; color: var(--muted-fg); }

.options { display: grid; gap: 10px; }
.options-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.options-place { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.options-stack { grid-template-columns: 1fr; }
.options-actions { display: flex; flex-wrap: wrap; justify-content: center; }
.option {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: 10px 16px; text-align: center; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--fg); font-size: 15px; font-weight: 600; line-height: 1.25;
  transition: background-color .16s var(--ease), border-color .16s var(--ease);
  animation: rise .28s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
}
.option:hover { background: var(--secondary); border-color: var(--accent); }
.option:active { background: var(--muted); }
.option:disabled { opacity: .5; cursor: not-allowed; }
.option:disabled:hover { background: var(--card); border-color: var(--border); }
.option small { font-size: 13px; font-weight: 400; color: var(--muted-fg); }
.option svg { width: 18px; height: 18px; }
.options-stack .option, .options-actions .option { flex-direction: row; gap: 8px; }
.options-actions .option { min-height: 48px; }
.option-quiet { background: transparent; }
.option-tile { gap: 10px; min-height: 100px; }
.option-tile .shape { display: block; border: 1.5px solid currentColor; border-radius: 4px; }
.shape-play { display: block; }
.shape-play svg { width: 26px; height: 26px; color: var(--accent); }
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
  min-height: 40px; max-width: 100%; padding: 0 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--fg); font-size: 14px; font-weight: 500;
  transition: background-color .16s var(--ease), border-color .16s var(--ease);
}
.option-chip:hover { background: var(--secondary); border-color: var(--line-strong); }
.option-chip.is-on { border-color: var(--accent); background: var(--accent-14); }
.dock-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.input-chat { min-height: 52px; padding: 12px 16px; font-size: 16px; border-radius: var(--radius); background: var(--card); }
.dock-describe { display: grid; gap: 12px; }
.dock-describe .textarea { min-height: 84px; resize: none; line-height: 1.45; }
.option-chips .option-chip { animation: rise .28s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.btn-chat { min-height: 52px; padding: 0 24px; border-radius: var(--radius); font-size: 16px; }
.dock-note { font-size: 14px; color: var(--muted-fg); text-align: center; }
.dock-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 24px; }
.text-quiet { color: var(--muted-fg); font-weight: 500; }
.text-quiet:hover { color: var(--fg); }
.dock-progress { height: 3px; overflow: hidden; border-radius: 2px; background: var(--border); }
.dock-progress span { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width .32s var(--ease); }

.summary { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 20px; width: 100%; margin-top: 8px; padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.summary-plain { grid-template-columns: minmax(0, 1fr); }
.summary-image { position: relative; align-self: start; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-sm); background: var(--muted); }
.summary-image img { width: 100%; height: auto; }
.summary-image span { position: absolute; left: 6px; bottom: 6px; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 600; }
.summary-image:hover span { background: var(--accent); color: var(--accent-ink); }
.summary dl { display: grid; margin: 0; }
.summary-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); }
.summary-row:first-child { padding-top: 2px; }
.summary-row dt { font-size: 14px; color: var(--muted-fg); }
.summary-row dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.summary-cost { grid-column: 1 / -1; font-size: 15px; color: var(--muted-fg); }
.summary-cost strong { color: var(--fg); font-weight: 600; }

.start-hero { display: grid; justify-items: center; gap: 14px; text-align: center; }
.start-hero .notice { width: 100%; text-align: left; margin-bottom: 8px; }
.start-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
.start-lead { font-size: 18px; color: var(--muted-fg); max-width: 46ch; text-wrap: pretty; }
.drop { display: grid; justify-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 44px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--card); transition: border-color .16s var(--ease), background-color .16s var(--ease); }
.drop.is-over, .drop:hover { border-color: var(--accent); }
.drop.is-over { background: var(--accent-10); }
.drop label { cursor: pointer; }
.drop-hint { font-size: 14px; color: var(--muted-fg); }
.start-alt { font-size: 15px; color: var(--muted-fg); }
.start-alt .text-link { font-size: 15px; }
.start-waiting { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; }
.start-waiting:hover { background: var(--secondary); border-color: var(--accent); }
.start-continue { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 10px 14px 10px 10px; text-align: left; text-decoration: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: background-color .16s var(--ease), border-color .16s var(--ease); }
.start-continue:hover { background: var(--secondary); border-color: var(--accent); }
.start-continue img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); background: var(--muted); }
.start-continue > span { display: grid; gap: 1px; min-width: 0; }
.start-continue small { font-size: 13px; color: var(--muted-fg); }
.start-continue strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-continue svg { width: 18px; height: 18px; color: var(--muted-fg); }
/* Biblioteca dentro do painel de respostas: a escolha acontece na própria conversa, sem abrir outra tela. */
.library { display: grid; gap: 16px; max-height: min(44dvh, 400px); overflow-y: auto; padding: 3px; scrollbar-width: thin; }
.library h3 { margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--muted-fg); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.library-tile { display: block; aspect-ratio: 1; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--muted); cursor: pointer; }
.library-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.library-tile:hover, .library-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.start-recent { display: grid; gap: 12px; margin-top: 36px; }
.start-recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.start-recent h2 { font-size: 15px; font-weight: 600; }
.start-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.start-tile { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--muted); }
.start-tile img, .start-tile video { width: 100%; height: 100%; object-fit: cover; }
.start-tile:hover { outline: 2px solid var(--line-strong); outline-offset: 2px; }

.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-left: 54px; }
.result-grid:has(> :only-child) { grid-template-columns: minmax(0, 340px); }
.result-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 300px)); }
.result-grid.r-landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-grid.r-landscape:has(> :only-child) { grid-template-columns: minmax(0, 620px); }

/* Blocos da revisão da entrevista da marca. */
.block { margin: 0; padding: 22px 20px; border: 0; border-bottom: 1px solid var(--border); }
.block:first-child { border-top: 0; }
.block legend { display: flex; align-items: center; gap: 10px; float: left; width: 100%; margin-bottom: 16px; padding: 0; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.block legend + * { clear: both; }
.block legend .num { color: var(--accent); font-size: 13px; letter-spacing: .08em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; align-items: start; }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Cartão de criativo: a peça é o cartão. Sem moldura em volta; seleção e foco desenham o contorno na própria peça. */
.creative { display: grid; gap: 10px; align-content: start; min-width: 0; }
.creative .art { outline: 1px solid transparent; outline-offset: 3px; transition: outline-color .16s var(--ease); }
.creative:hover .art-link .art { outline-color: var(--line-strong); }
.creative.is-selected .art { outline: 2px solid var(--accent); }
.art { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--muted); }
.art > img, .art > video { width: 100%; height: 100%; object-fit: cover; }
.art.r-square { aspect-ratio: 1 / 1; }
.art.r-portrait { aspect-ratio: 4 / 5; }
.art.r-story { aspect-ratio: 9 / 16; }
.art.r-landscape { aspect-ratio: 16 / 9; }
.art-link { display: block; border-radius: var(--radius); }
.art-link:focus-visible { outline: none; }
.art-link:focus-visible .art { outline: 2px solid var(--accent); }
.art-wrap { position: relative; }
.art-wrap .tags { position: absolute; left: 10px; top: 10px; right: 52px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.art-wrap .fav { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; background: rgba(42,10,61,.82); }
.art-wrap .fav:hover { background: var(--bg); }
.creative-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.creative-meta > div { min-width: 0; display: grid; gap: 2px; }
.creative-meta strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creative-meta strong .num { color: var(--accent); margin-right: 2px; }
.creative-meta span { font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creative-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.creative-actions .btn { min-height: 36px; font-size: 13px; }
.creative-actions .icon-btn { width: 36px; height: 36px; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; font-size: 12px; color: var(--muted-fg); cursor: pointer; user-select: none; white-space: nowrap; }
.check:hover { color: var(--fg); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.check-lg { align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--fg); white-space: normal; }
.check-lg input { margin-top: 1px; flex: none; }

.skeleton { display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; text-align: center; color: var(--muted-fg); font-size: 13px; }
/* Prévia das variações antes de gerar: mesmo formato, quantidade e direção de cada uma. */
.progress { width: 70%; height: 3px; overflow: hidden; background: var(--border); border-radius: 2px; }
.progress::after { content: ""; display: block; width: 40%; height: 100%; background: var(--accent); animation: progress 1.3s var(--ease) infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.failed-art { display: grid; place-items: center; padding: 20px; text-align: center; font-size: 13px; color: var(--muted-fg); border: 1px solid rgba(220,68,68,.5); }

/* ---------- Comparar ---------- */
dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--fg); max-width: calc(100vw - 32px); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: enter .26s var(--ease) both; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 18px; letter-spacing: -.02em; }
.dialog-body { padding: 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.compare { width: min(1400px, calc(100vw - 32px)); }
.compare-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.compare-grid > * { scroll-snap-align: start; }
/* A largura sai da altura disponível; nunca passa da coluna, para as peças não se encostarem. */
.compare-grid .art { width: min(100%, calc(min(66vh, 720px) * var(--ar, 1))); height: auto; margin: 0 auto; }
.compare-grid .art.r-portrait { --ar: .8; }
.compare-grid .art.r-story { --ar: .5625; }
.compare-grid .art.r-landscape { --ar: 1.7778; }
.form-dialog { width: min(480px, calc(100vw - 32px)); }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.stage { display: grid; gap: 20px; min-width: 0; }
/* A coluna da peça é estreita (o chat ocupa a direita): título inteiro em cima, ações embaixo. */
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.stage-title { font-size: 28px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
.stage-sub { margin-top: 4px; font-size: 14px; color: var(--muted-fg); }
.stage-canvas { display: grid; place-items: center; padding: 24px; min-height: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.stage-canvas .art { width: 100%; max-height: calc(100dvh - 300px); }
.stage-canvas .art.r-portrait { width: auto; height: min(calc(100dvh - 300px), 760px); }
.stage-canvas .art.r-story { width: auto; height: min(calc(100dvh - 300px), 820px); }
.stage-canvas .art.r-square { width: min(100%, 680px); }
.versions { display: grid; gap: 12px; }
.version-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.version {
  flex: none; display: grid; gap: 6px; width: 112px; padding: 6px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent;
}
.version:hover { background: var(--secondary); }
.version[aria-pressed="true"] { border-color: var(--accent); }
.version .art { border-radius: 6px; }
.version span { font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 4px; }
.version b { color: var(--fg); font-weight: 600; }
.version-detail { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; }
.version-detail p { color: var(--muted-fg); min-width: 0; }
.version-detail p b { color: var(--fg); }

.guide-panel { position: sticky; top: calc(var(--topbar) + 20px); display: grid; grid-template-rows: minmax(0, 1fr) auto; max-height: calc(100dvh - var(--topbar) - 40px); overflow: hidden; border-radius: var(--radius-lg); }
.guide-panel-thread { display: flex; flex-direction: column; gap: 16px; padding: 22px 20px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.guide-panel-thread > :first-child { margin-top: auto; }
.guide-panel-dock { display: grid; gap: 12px; padding: 16px 20px 16px; border-top: 1px solid var(--border); }
.guide-panel .say { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.guide-panel .say-avatar { width: 34px; height: 34px; background: var(--bg); }
.guide-panel .say-avatar img { width: 20px; }
.guide-panel .say-body { padding-top: 4px; font-size: 15px; }
.guide-panel .say-question { font-size: 19px; }
.guide-panel .say-lead { font-size: 14px; }
.guide-panel .answer { font-size: 14px; padding: 8px 14px; }
.guide-panel .option { background: var(--bg); }
.guide-panel .option:hover { background: var(--secondary); }
.guide-panel .dock-foot { grid-template-columns: auto auto; justify-content: space-between; }
.guide-panel .input-chat { background: var(--bg); }
.adjust-form { display: grid; gap: 12px; }
.progress-full { width: 100%; }

/* ---------- Projetos, biblioteca, kit ---------- */
.project-card { display: grid; gap: 14px; padding: 12px; text-decoration: none; transition: border-color .16s var(--ease); }
.project-card:hover { border-color: var(--line-strong); }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg); }
.mosaic img, .mosaic video { width: 100%; height: 100%; object-fit: cover; background: var(--muted); }
.mosaic .empty-tile { display: grid; place-items: center; grid-column: 1 / -1; color: var(--muted-fg); font-size: 13px; }
.project-card h3 { font-size: 17px; letter-spacing: -.02em; }
.project-card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }

.generation { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--border); }
.page-head + .generation { padding-top: 0; margin-top: 0; border-top: 0; }
.generation-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: start; margin-bottom: 18px; }
.generation-head img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); background: var(--muted); }
.generation-noref { display: grid; place-items: center; width: 72px; height: 72px; padding: 6px; border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-fg); font-size: 12px; line-height: 1.2; text-align: center; }
.generation-head h3 { font-size: 16px; letter-spacing: -.01em; }
.generation-head p { font-size: 14px; color: var(--muted-fg); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted-fg); }
.facts b { color: var(--fg); font-weight: 600; }

/* Meus criativos: abas de situação, busca e a peça como protagonista. */
.page-head-plain { align-items: center; padding-bottom: 0; margin-bottom: 20px; border-bottom: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted-fg); font-size: 15px; font-weight: 500; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }
.library-item { display: grid; gap: 10px; align-content: start; min-width: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }
.filters .input { flex: 1 1 280px; width: auto; min-width: 0; }
.filters .select { width: auto; min-width: 0; flex: 0 1 auto; max-width: 240px; }
.filters .segmented { flex: none; }
.filters .segmented button { padding: 0 14px; }
.filters .chip { min-height: 44px; border-radius: var(--radius-sm); }

.kits { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.kit-list { display: grid; gap: 8px; }
.kit-item { display: grid; gap: 10px; padding: 14px; text-align: left; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); color: var(--fg); text-decoration: none; }
.kit-item:hover { background: var(--card); }
.kit-item[aria-current="true"] { background: var(--card); border-color: var(--accent); }
.kit-item strong { font-size: 15px; }
.kit-new { display: flex; align-items: center; gap: 8px; color: var(--muted-fg); font-weight: 600; font-size: 14px; }
.kit-new svg { width: 18px; height: 18px; color: var(--accent); }
.swatches { display: flex; gap: 6px; }
.swatches i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); }
.kit-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.kit-form { padding: 24px; }
.color-row, .cta-row { display: grid; grid-template-columns: 44px 1fr 40px; gap: 8px; align-items: center; }
.cta-row { grid-template-columns: 1fr 40px; }
.color-row input[type="color"] { width: 44px; height: 44px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
.stack { display: grid; gap: 8px; }
.kit-preview { position: sticky; top: calc(var(--topbar) + 20px); display: grid; gap: 12px; }
.mock { display: grid; align-content: space-between; gap: 18px; aspect-ratio: 4 / 5; padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); color: #fff; overflow: hidden; }
.mock .mock-brand { font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.mock h3 { font-size: 30px; line-height: 1.05; letter-spacing: -.035em; }
.mock .mock-cta { justify-self: start; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.mock .mock-tone { font-size: 13px; opacity: .85; }

/* ---------- Tabelas (linhas de 1px, cabeçalho em caixa alta, coluna de referência em laranja 10%) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-fg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(65, 18, 90, .5); }
.table a { color: var(--fg); text-decoration: none; }
.table a:hover { color: var(--accent); }
.num-col { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ref-col { background: var(--accent-10); }
.table tbody tr:hover td.ref-col { background: rgba(249, 115, 22, .14); }
.is-positive { color: var(--success); }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.badge-good { border-color: rgba(34, 197, 94, .55); color: var(--success-fg); }
.badge-danger { border-color: rgba(220, 68, 68, .7); color: var(--danger-fg); }
.hero-cols strong.accent { color: var(--accent); }
.form-error { padding: 10px 12px; border: 1px solid rgba(220, 68, 68, .55); background: rgba(220, 68, 68, .12); border-radius: var(--radius-sm); font-size: 14px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 16px 0 10px; }
.copy-row .input { font-size: 13px; font-family: ui-monospace, Consolas, monospace; }

/* ---------- Conta na barra lateral e área Eme ---------- */
.nav-admin { padding-top: 16px; border-top: 1px solid var(--border); }
.nav-label { padding: 0 12px 6px; }
.count-accent { color: var(--accent) !important; font-weight: 700; }
.account { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account > div { display: grid; gap: 2px; min-width: 0; }
.account strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account span { font-size: 12px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Entrada e convite ---------- */
body.is-auth .sidebar, body.is-auth .app, body.is-auth .scrim, body.is-auth .skip-link { display: none !important; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 56px; border-right: 1px solid var(--border); }
.auth-brand .brand { padding: 0; }
.auth-body { display: grid; gap: 48px; }
.auth-pitch { display: grid; gap: 16px; max-width: 600px; }
.auth-pitch .title { font-size: 48px; line-height: 1.04; letter-spacing: -.04em; }
/* Uma referência, quatro formatos: a ideia do produto mostrada com a imagem de exemplo do próprio estúdio. */
.formats-demo { --h: clamp(120px, 13vw, 184px); display: flex; align-items: flex-end; gap: 14px; margin: 0; }
.formats-demo figure { display: grid; gap: 10px; margin: 0; flex: none; }
.formats-demo img { height: var(--h); width: auto; object-fit: cover; object-position: 50% 62%; border-radius: var(--radius-sm); background: var(--muted); }
.formats-demo .r-ref img { aspect-ratio: 4 / 5; }
.formats-demo .r-1 img { aspect-ratio: 1 / 1; }
.formats-demo .r-9 img { aspect-ratio: 9 / 16; }
.formats-demo .r-16 img { aspect-ratio: 16 / 9; object-position: 50% 70%; }
.formats-demo .r-ref img { outline: 2px solid var(--accent); outline-offset: 3px; }
.formats-demo figcaption { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-fg); white-space: nowrap; }
.formats-demo .r-ref figcaption { color: var(--accent); }
.formats-demo .divider { align-self: stretch; width: 1px; margin: 0 6px 21px; background: var(--border); }
.auth-card > div:first-child { display: grid; gap: 6px; }
.auth-brand .made-by { display: flex; align-items: center; gap: 10px; color: var(--muted-fg); font-size: 12px; }
.auth-brand .made-by img { height: 22px; width: auto; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { display: grid; gap: 18px; width: 100%; max-width: 420px; padding: 32px 28px; }
.auth-card .field + .field { margin-top: 0; }
.auth-card .progress { width: 100%; }
.auth-switch { justify-self: center; }

/* ---------- Mesa de aprovação: decisão em dois botões sob cada peça ---------- */
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-actions .btn { min-height: 40px; font-size: 13px; }
.review-approve svg { color: var(--success-fg); }
.review-reject svg { color: var(--danger-fg); }
.review-approve:hover { border-color: rgba(34, 197, 94, .55); background: rgba(34, 197, 94, .1); }
.review-reject:hover { border-color: rgba(220, 68, 68, .6); background: rgba(220, 68, 68, .1); }
.badge-solid.badge-good { color: var(--success-fg); }
.badge-solid.badge-danger { color: var(--danger-fg); }

/* ---------- Entrar e operar: faixa fixa enquanto o admin usa o workspace de um cliente ---------- */
.operating { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 6px 32px; background: var(--secondary); border-bottom: 1px solid var(--accent); font-size: 14px; }
.operating strong { color: var(--accent); font-weight: 600; }
.operating .btn { flex: none; }
body.is-operating #crumb-root { color: var(--accent); font-weight: 600; }
/* O título da tela já está no conteúdo; a barra só nomeia o cliente quando a Eme está operando. */
.crumbs strong { display: none; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; margin-bottom: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); }
.notice > div { display: grid; gap: 4px; }
.notice .btn { flex: none; }
.notice-danger { border-color: rgba(220, 68, 68, .7); }

/* ---------- Plano e cobrança: aviso no topo, campos de pagamento e escolha de plano ou pacote ---------- */
.billing-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 32px; background: var(--secondary); border-bottom: 1px solid var(--line-strong); font-size: 14px; }
.billing-note.is-blocked { border-bottom-color: var(--danger); }
.billing-note p { margin: 0; max-width: 110ch; }
.billing-note .btn { flex: none; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pay-grid .field + .field { margin-top: 0; }
.field-group { margin-top: 18px; }
.field-group > .field { margin-top: 18px; }
.choices.choices-1 { grid-template-columns: 1fr; }
.catalog-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
/* Planos à venda na página Créditos: três cartões lado a lado, o atual marcado; o botão abre o WhatsApp da Eme. */
.plans-mode { max-width: 420px; margin-bottom: 16px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-card { display: grid; gap: 12px; align-content: start; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.plan-card.is-current { border-color: var(--accent); }
.plan-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.plan-price strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-price span { color: var(--muted-fg); font-size: 14px; }
.plan-card ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted-fg); font-size: 14px; }
.plan-card li::before { content: "✓"; margin-right: 8px; color: var(--accent); }
.plan-card .btn, .plan-card .badge { justify-self: start; }

/* ---------- Controle geral: gastos, clientes, APIs e usuários ---------- */
.control-period { margin-bottom: 28px; }
#control-body { transition: opacity .16s var(--ease); }
#control-body.is-refreshing { opacity: .55; }
.control-figures small { font-size: 13px; font-weight: 400; color: var(--muted-fg); }
.control-note { max-width: 78ch; margin-top: 12px; }
.is-gain { color: var(--success-fg) !important; }
.is-loss { color: var(--danger-fg) !important; }
.table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; }
/* Barras finas, com a base única e o topo arredondado; o valor exato está na dica e em "Ver em tabela". */
.bars { position: relative; margin: 0; }
.bars-plot { position: relative; height: 220px; margin-left: 44px; }
.bars-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.bars-tick span { position: absolute; right: 100%; top: -8px; padding-right: 8px; font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.bars-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.bars-col span { display: block; width: 100%; max-width: 24px; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bars-col:hover { background: var(--secondary); }
.bars-col:hover span, .bars-col:focus-visible span { background: var(--accent-hover); }
.bars-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bars-axis { display: flex; justify-content: space-between; margin: 8px 0 0 44px; font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.bars-tip { position: absolute; top: 0; z-index: 2; transform: translate(-50%, -8px); padding: 8px 10px; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 13px; white-space: nowrap; pointer-events: none; }
.table-toggle { margin-top: 14px; }
.table-toggle summary { width: fit-content; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.table-toggle .table-wrap { margin-top: 12px; }
.meter-row { display: grid; gap: 8px; margin-top: 16px; }
.meter { height: 6px; overflow: hidden; border-radius: 999px; background: var(--muted); }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; max-width: 860px; }
.rates .field + .field { margin-top: 0; }
/* Na mesma linha, um campo com dica mais curta não pode esticar o rótulo e desalinhar a caixa. */
.rates .field, .pay-grid .field { align-content: start; }
.rates .form-error, .rates-foot { grid-column: 1 / -1; }
.rates-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.control-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.control-add .field + .field { margin-top: 0; }
.control-add .btn { min-height: 44px; }
#add-error { margin-top: 12px; }
@media (max-width: 900px) {
  .control-add { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rates { grid-template-columns: 1fr; }
  .bars-plot { height: 180px; }
}

/* ---------- Entrevista da marca: uma pergunta por tela, sem barra lateral enquanto for obrigatória ---------- */
body.is-interview .sidebar, body.is-interview .topbar, body.is-interview .scrim { display: none !important; }
body.is-interview .app { margin-left: 0; }
body.is-interview main { max-width: 1120px; margin: 0 auto; padding-top: 28px; }
.iv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.iv-head .brand { padding: 0; }
.iv-progress { height: 2px; background: var(--border); }
.iv-progress span { display: block; height: 100%; background: var(--accent); transition: width .26s var(--ease); }
.iv-position { margin-top: 12px; }
.iv-body { display: grid; gap: 16px; max-width: 720px; margin: 56px auto 0; }
.iv-body .kicker { margin-bottom: -4px; }
.iv-field { margin-top: 12px; display: grid; gap: 12px; }
.input-lg { min-height: 56px; font-size: 20px; padding: 12px 16px; }
.textarea-lg { min-height: 168px; font-size: 17px; line-height: 1.5; padding: 14px 16px; }
.iv-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.iv-actions > div { display: flex; gap: 8px; }
.iv-body .flow { margin-top: 16px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice, .palette {
  display: grid; gap: 4px; align-content: start; padding: 16px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--fg);
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.choice:hover, .palette:hover { background: var(--secondary); border-color: var(--line-strong); }
.choice[aria-checked="true"], .palette[aria-checked="true"] { border-color: var(--accent); background: var(--accent-10); }
.choice strong, .palette strong { font-size: 16px; font-weight: 600; }
.choice span { font-size: 14px; color: var(--muted-fg); }
.palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.palette { gap: 12px; }
.palette .swatches i, .swatches-lg i { width: 32px; height: 32px; border-radius: 8px; }
.list-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list-edit:empty { display: none; }
.list-edit li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.iv-review-head { margin-top: 32px; }
.iv-review { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.iv-sections { display: grid; gap: 0; }
.iv-sections .block { padding: 0 0 28px; margin-bottom: 28px; }
.iv-sections .block:last-child { border-bottom: 0; }
.iv-sections .field-label small { font-weight: 400; }
.iv-review .kit-preview .text-link { justify-self: center; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.answers > div { padding: 14px 0; border-top: 1px solid var(--border); }
.answers dt { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-fg); }
.answers dd { margin: 6px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-line; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--fg); color: var(--accent-ink); font-size: 14px; font-weight: 500;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); color: #fff; }

.scrim { position: fixed; inset: 0; z-index: 25; background: var(--scrim); }

/* ---------- Responsivo ---------- */
@media (max-width: 1240px) {
  .editor { grid-template-columns: minmax(0, 1fr) 360px; }
  .kit-editor { grid-template-columns: 1fr; }
  .kit-preview { position: static; max-width: 360px; }
}
@media (max-width: 1024px) {
  .operating { padding: 8px 16px; }
  .billing-note { padding: 8px 16px; }
  .iv-review { grid-template-columns: 1fr; }
  .iv-review .kit-preview { position: static; max-width: 420px; }
  .sidebar { transform: translateX(-100%); transition: transform .26s var(--ease); }
  .sidebar.is-open { transform: none; }
  .app { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  main { padding: 24px 16px 56px; }
  .editor, .kits { grid-template-columns: 1fr; }
  .guide-panel { position: static; max-height: none; min-height: 0; }
  .guide-panel-thread { max-height: 420px; }
  .stage-canvas { padding: 12px; min-height: 0; }
  .stage-canvas .art.r-portrait, .stage-canvas .art.r-story { height: auto; width: min(100%, 520px); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 0; border-right: 0; gap: 24px; }
  .auth-brand .made-by, .formats-demo { display: none; }
  .auth-pitch .title { font-size: 28px; }
  .auth-pitch .lead { font-size: 15px; }
  .auth-panel { place-items: start center; padding: 24px 16px 40px; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  h1.title { font-size: 28px; }
  .section { margin-top: 44px; }
  .dup-cta { display: inline-flex !important; }
  .page-head { flex-direction: column; align-items: stretch; padding-bottom: 20px; margin-bottom: 24px; }
  .page-head-plain { padding-bottom: 0; margin-bottom: 16px; }
  .page-head .actions .btn { flex: 1; }
  .guide-thread { padding: 20px 16px 20px; gap: 16px; }
  .guide.is-start .guide-thread { padding-top: 28px; padding-bottom: 32px; }
  .dock-inner, .guide.is-results .dock-inner { padding: 12px 16px 10px; gap: 10px; }
  .say { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .say-avatar { width: 32px; height: 32px; }
  .say-avatar img { width: 19px; }
  .say-avatar-lg { width: 52px; height: 52px; }
  .say-avatar-lg img { width: 30px; }
  .say-body { padding-top: 3px; }
  .say-question { font-size: 19px; }
  .say-lead { font-size: 15px; }
  .start-lead { font-size: 16px; }
  .drop { padding: 28px 16px; }
  .options-3, .options-place { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options .option:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .option { min-height: 50px; }
  .option-tile { min-height: 84px; }
  .option-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .option-chip { flex: none; max-width: 80%; }
  .btn-chat { padding: 0 18px; }
  .summary { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .summary-image { width: 96px; }
  .summary-row { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .result-grid, .result-grid.r-landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-left: 0; }
  .result-grid:has(> :only-child), .result-grid.r-landscape:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
  .result-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options-actions .option { flex: 1 1 100%; }
  /* Com o resultado na tela, as ações ficam no fim da página para não cobrir as peças. */
  .guide.is-results .guide-dock { position: static; }
  .stage-canvas .art.r-portrait, .stage-canvas .art.r-story { width: auto; height: min(54dvh, 460px); }
  .stage-title { font-size: 24px; }
  .creative-meta span { white-space: normal; }
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow li { padding: 14px 0; }
  body.is-interview main { padding-top: 20px; }
  .operating { font-size: 13px; gap: 10px; }
  .operating p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .operating-detail { display: none; }
  .notice { flex-direction: column; align-items: stretch; }
  .billing-note { flex-direction: column; align-items: stretch; gap: 8px; font-size: 13px; }
  .pay-grid { grid-template-columns: 1fr; }
  .review-actions { grid-template-columns: 1fr; }
  .review-actions .btn { min-width: 0; }
  .iv-body { margin-top: 32px; }
  .choices, .answers { grid-template-columns: 1fr; }
  .palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iv-actions { flex-wrap: wrap; }
  .iv-actions > div { flex: 1; justify-content: flex-end; }
  .crumbs > span { display: none; }
  .topbar-actions { gap: 8px; }
  .badge#demo-badge { padding: 0 7px; letter-spacing: .06em; }
  .hero-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .hero-cols strong { font-size: 24px; }
  .grid, .grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .creative-actions { grid-template-columns: 1fr; }
  .creative-actions .icon-btn { display: none; }
  .filters .input { width: 100%; flex: 1 1 100%; }
  .filters .select { flex: 1 1 100%; max-width: none; }
  .credits span { display: none; }
  .topbar-actions .btn-primary { display: none; }
  .generation-head { grid-template-columns: 56px 1fr; }
  .generation-head img { width: 56px; height: 56px; }
  .generation-head .btn { grid-column: 1 / -1; }
  .kit-form { padding: 16px; }
  .block { padding: 18px 16px; }
}
@media (max-width: 420px) {
  .grid-wide { grid-template-columns: 1fr; }
  .grid { gap: 20px 10px; }
  .creative-actions .btn { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
