/* ══════════════════════════════════════════════════════
   Gerador · UI do construtor
   ══════════════════════════════════════════════════════ */

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

:root {
  --app-ink:        #1A1816;
  --app-muted:      #6B6460;
  --app-border:     rgba(0,0,0,0.08);
  --app-border-soft:rgba(0,0,0,0.05);
  --app-bg:         #F5F5F4;
  --app-panel:      #FFFFFF;
  --app-accent:     #BF282A;
  --app-accent-dark:#9a1f21;
  --app-header-h:   56px;
  --sidebar-w:      440px;
  --radius:         8px;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--app-bg);
  color: var(--app-ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* HEADER
   ──────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--app-header-h);
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.app-logo { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.app-logo strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.app-logo span {
  font-size: 12px;
  color: var(--app-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--app-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.15s;
}
.btn-download:hover { background: var(--app-accent-dark); transform: translateY(-1px); }
.btn-download:active { transform: translateY(0); }

/* LAYOUT
   ──────────────────────────────────────────────────── */
.app-main {
  padding-top: var(--app-header-h);
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* SIDEBAR
   ──────────────────────────────────────────────────── */
.sidebar {
  background: var(--app-panel);
  border-right: 1px solid var(--app-border);
  overflow-y: auto;
  padding: 20px 20px 40px;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }

.panel { margin-bottom: 32px; }
.panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--app-border);
}

/* FORM FIELDS
   ──────────────────────────────────────────────────── */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--app-muted);
  letter-spacing: 0.01em;
}
.field input,
.field textarea,
.field select {
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: #fafafa;
  color: var(--app-ink);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--app-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(191,40,42,0.08);
}
.field textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 60px;
  line-height: 1.5;
}

/* TEMPLATE PICKER
   ──────────────────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.template-card {
  background: #fafafa;
  border: 1.5px solid var(--app-border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
  font: inherit;
  text-align: left;
}
.template-card:not(:disabled):hover { border-color: var(--app-ink); }
.template-card.active { border-color: var(--app-accent); background: #fff; box-shadow: 0 0 0 3px rgba(191,40,42,0.08); }
.template-card:disabled { opacity: 0.45; cursor: not-allowed; }

.template-preview {
  aspect-ratio: 4/3;
  border-radius: 4px;
  background: #ddd;
  overflow: hidden;
  position: relative;
}
.tpl-minimal {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
}
.tpl-minimal::before {
  content: '';
  position: absolute;
  top: 10px; left: 8px; right: 40%;
  height: 4px;
  background: #333;
  border-radius: 2px;
  box-shadow: 0 8px 0 #333, 0 16px 0 rgba(0,0,0,0.3);
}
.tpl-minimal::after {
  content: '';
  position: absolute;
  top: 10px; right: 8px; width: 28%; bottom: 10px;
  background: #d4d4d4;
  border-radius: 2px;
}
.tpl-editorial {
  background: linear-gradient(to right, #f5f1ea 0%, #f5f1ea 55%, #c9a961 55%, #c9a961 100%);
}
.tpl-editorial::before {
  content: '';
  position: absolute;
  top: 14px; left: 8px; width: 44%; height: 12px;
  background: #1a1a1a;
  border-radius: 1px;
}
.tpl-classic {
  background: #1a1a1a;
}
.tpl-classic::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1px solid #c9a961;
}
.tpl-classic::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40%; height: 3px;
  background: #c9a961;
}

.template-name { font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--app-ink); }
.template-type {
  font-size: 9.5px;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* PALETTE PICKER
   ──────────────────────────────────────────────────── */
.palette-tabs {
  display: flex;
  gap: 2px;
  background: #efefee;
  padding: 3px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.palette-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 8px;
  border-radius: 4px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.palette-tab:hover { color: var(--app-ink); }
.palette-tab.active {
  background: #fff;
  color: var(--app-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.palette-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.palette-card {
  background: #fafafa;
  border: 1.5px solid var(--app-border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.palette-card:hover { border-color: var(--app-ink); }
.palette-card.active { border-color: var(--app-accent); background: #fff; box-shadow: 0 0 0 3px rgba(191,40,42,0.08); }

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.palette-swatches span { display: block; }
.palette-meta { display: flex; flex-direction: column; gap: 2px; }
.palette-name { font-size: 12px; font-weight: 600; color: var(--app-ink); }
.palette-tag {
  font-size: 9.5px;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* TOGGLES
   ──────────────────────────────────────────────────── */
.toggle-list { display: flex; flex-direction: column; gap: 8px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid var(--app-border);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.toggle:hover { border-color: var(--app-ink); }
.toggle input {
  accent-color: var(--app-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.toggle input:disabled { cursor: not-allowed; }
.toggle em { color: var(--app-muted); font-style: normal; font-size: 11px; }

/* IMÓVEIS (sidebar list)
   ──────────────────────────────────────────────────── */
.imoveis-list { display: flex; flex-direction: column; gap: 6px; }
.imovel-item {
  background: #fafafa;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.12s;
}
.imovel-item:hover { border-color: rgba(0,0,0,0.16); }
.imovel-item[open] { background: #fff; border-color: var(--app-border); }

.imovel-item summary {
  padding: 9px 10px 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.imovel-item summary::-webkit-details-marker { display: none; }
.imovel-item summary::before {
  content: '▸';
  color: var(--app-muted);
  font-size: 9px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.imovel-item[open] summary::before { transform: rotate(90deg); }

.imovel-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.imovel-item-remove {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--app-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.imovel-item-remove:hover {
  background: rgba(191,40,42,0.1);
  color: var(--app-accent);
}

.imovel-item-body {
  padding: 4px 12px 14px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--app-border-soft);
  margin-top: 4px;
  padding-top: 12px;
}
.imovel-item-body .field > span { font-size: 11px; }
.imovel-item-body .field input {
  font-size: 12.5px;
  padding: 7px 10px;
}

.btn-add {
  margin-top: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 1.5px dashed var(--app-border);
  color: var(--app-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, color 0.15s, border-style 0.15s, background 0.15s;
}
.btn-add:hover {
  border-color: var(--app-ink);
  color: var(--app-ink);
  border-style: solid;
  background: #fafafa;
}
.btn-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-add:disabled:hover {
  border-color: var(--app-border);
  color: var(--app-muted);
  border-style: dashed;
  background: transparent;
}

.panel-hint {
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--app-muted);
  text-transform: none;
  margin-left: 6px;
}

/* TESTEMUNHOS & ARTIGOS (sidebar) — reutilizam a estrutura de .imovel-item
   ──────────────────────────────────────────────────── */
.testemunhos-list,
.artigos-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.testemunho-item,
.artigo-item {
  background: #fafafa;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.12s;
}
.testemunho-item:hover,
.artigo-item:hover { border-color: rgba(0,0,0,0.16); }
.testemunho-item[open],
.artigo-item[open] { background: #fff; }

.testemunho-item summary,
.artigo-item summary {
  padding: 9px 10px 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.testemunho-item summary::-webkit-details-marker,
.artigo-item summary::-webkit-details-marker { display: none; }
.testemunho-item summary::before,
.artigo-item summary::before {
  content: '▸';
  color: var(--app-muted);
  font-size: 9px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.testemunho-item[open] summary::before,
.artigo-item[open] summary::before { transform: rotate(90deg); }

.testemunho-item-title,
.artigo-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.testemunho-item-remove,
.artigo-item-remove {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--app-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.testemunho-item-remove:hover,
.artigo-item-remove:hover {
  background: rgba(191,40,42,0.1);
  color: var(--app-accent);
}

.testemunho-item-body,
.artigo-item-body {
  padding: 12px 12px 14px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--app-border-soft);
  margin-top: 4px;
}
.testemunho-item-body .field > span,
.artigo-item-body .field > span { font-size: 11px; }
.testemunho-item-body .field input,
.testemunho-item-body .field textarea,
.artigo-item-body .field input,
.artigo-item-body .field textarea,
.artigo-item-body .field select {
  font-size: 12.5px;
  padding: 7px 10px;
}

/* Mode switch dentro de cada artigo
   ──────────────────────────────────────────────────── */
.artigo-mode-switch {
  display: flex;
  background: #efefee;
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 4px;
}
.artigo-mode-switch button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.artigo-mode-switch button:hover { color: var(--app-ink); }
.artigo-mode-switch button.active {
  background: #fff;
  color: var(--app-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.artigo-mode-block[hidden] { display: none; }

/* PREVIEW
   ──────────────────────────────────────────────────── */
.preview-pane {
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.preview-bar {
  height: 44px;
  padding: 0 20px;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--app-panel);
  flex-shrink: 0;
}
.preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-muted);
}
.preview-device { display: flex; gap: 2px; background: #f0f0f0; padding: 3px; border-radius: 6px; }
.preview-device button {
  background: transparent;
  border: none;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--app-muted);
  letter-spacing: 0.02em;
  transition: background 0.12s, color 0.12s;
}
.preview-device button:hover { color: var(--app-ink); }
.preview-device button.active { background: var(--app-ink); color: #fff; }

.preview-frame-wrap {
  flex: 1;
  padding: 20px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#preview {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  transition: max-width 0.25s ease;
}
.preview-frame-wrap[data-device="tablet"] #preview { max-width: 768px; }
.preview-frame-wrap[data-device="mobile"] #preview { max-width: 390px; }

/* ══════════════════════════════════════════════════════
   SIDEBAR TABS (Landing Page / Hub)
   ══════════════════════════════════════════════════════ */
.sidebar-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
}
.sidebar-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px 10px;
  background: none; border: none;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--app-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.sidebar-tab:hover { color: var(--app-ink); }
.sidebar-tab.active { color: var(--app-ink); border-bottom-color: var(--app-ink); }
.stab-pro {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--app-accent); color: #fff;
  padding: 2px 5px; border-radius: 3px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════
   HUB DE IMÓVEIS PANEL
   ══════════════════════════════════════════════════════ */
.hub-banner {
  background: linear-gradient(135deg, var(--app-ink) 0%, #2d2420 100%);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
  color: #fff;
}
.hub-banner-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; opacity: 0.55; margin-bottom: 6px;
}
.hub-banner-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.hub-banner-desc { font-size: 12.5px; opacity: 0.72; line-height: 1.55; }

/* Version picker */
.hub-version-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-v-card {
  background: #fafafa; border: 1.5px solid var(--app-border);
  border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; font: inherit; text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.hub-v-card:hover { border-color: var(--app-ink); }
.hub-v-card.active { border-color: var(--app-accent); background: #fff; box-shadow: 0 0 0 3px rgba(191,40,42,0.08); }

.hub-v-thumb {
  aspect-ratio: 4/3; border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.07);
  background-repeat: no-repeat;
  overflow: hidden;
}
/* Catálogo thumbnail — nav + 3×2 grid */
.hv-catalogo {
  background-color: #f5f5f5;
  background-image:
    linear-gradient(#1a1a1a 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0),
    linear-gradient(#e0e0e0 100%, transparent 0);
  background-size:
    100% 11%,
    30% 36%, 30% 36%, 30% 36%,
    30% 36%, 30% 36%, 30% 36%;
  background-position:
    0 0,
    3%  15%, 37% 15%, 69% 15%,
    3%  56%, 37% 56%, 69% 56%;
}
/* Portal thumbnail — nav + filter bar + 2-col list */
.hv-portal {
  background-color: #f5f5f5;
  background-image:
    linear-gradient(#1a1a1a 100%, transparent 0),
    linear-gradient(#e8e8e8 100%, transparent 0),
    linear-gradient(#fff 100%, transparent 0),
    linear-gradient(#fff 100%, transparent 0),
    linear-gradient(#fff 100%, transparent 0),
    linear-gradient(#fff 100%, transparent 0);
  background-size:
    100% 11%,
    100% 12%,
    46% 22%, 46% 22%,
    46% 22%, 46% 22%;
  background-position:
    0 0,
    0 11%,
    3%  27%, 52% 27%,
    3%  54%, 52% 54%;
}

.hub-v-name { font-size: 12px; font-weight: 600; color: var(--app-ink); margin-top: 3px; }
.hub-v-desc { font-size: 11px; color: var(--app-muted); line-height: 1.4; }

/* Features list */
.hub-features-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.hub-features-list li { font-size: 12.5px; color: var(--app-ink); display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.hf-ok { color: #16a34a; font-weight: 700; flex-shrink: 0; }

/* Locked CTA */
.hub-locked-cta {
  margin-top: 8px;
  background: #fafafa; border: 1px solid var(--app-border);
  border-radius: 8px; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.hub-locked-row { display: flex; gap: 12px; align-items: flex-start; }
.hub-locked-row svg { flex-shrink: 0; margin-top: 2px; color: var(--app-muted); }
.hub-locked-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.hub-locked-sub { font-size: 12px; color: var(--app-muted); line-height: 1.5; }
.btn-hub-upgrade {
  width: 100%; padding: 10px;
  background: var(--app-ink); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.btn-hub-upgrade:hover { background: #333; }

/* ══════════════════════════════════════════════════════
   PUBLISH FLOW
   ══════════════════════════════════════════════════════ */

/* Header additions */
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn-publish {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--app-ink);
  color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.15s;
}
.btn-publish:hover { background: #333; transform: translateY(-1px); }
.btn-publish:active { transform: translateY(0); }

/* Overlay */
.pub-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.pub-overlay[hidden] { display: none; }

/* Modal card */
.pub-modal {
  background: var(--app-panel);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
  overflow: hidden;
  animation: pub-in 0.2s ease;
}
@keyframes pub-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Steps header */
.pub-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
}
.pub-steps { display: flex; align-items: center; gap: 4px; }
.pub-step {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  color: var(--app-muted); opacity: 0.38;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.pub-step span {
  width: 18px; height: 18px; border-radius: 50%;
  background: currentColor;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  flex-shrink: 0;
}
.pub-step.active  { opacity: 1; color: var(--app-accent); }
.pub-step.active span { background: var(--app-accent); }
.pub-step.done    { opacity: 1; color: #16a34a; }
.pub-step.done span { background: #16a34a; }
.pub-step-sep { color: var(--app-muted); opacity: 0.25; font-size: 11px; padding: 0 2px; }

.pub-close {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--app-muted);
  padding: 2px 4px; border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.pub-close:hover { color: var(--app-ink); background: var(--app-bg); }

/* Panels */
.pub-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.pub-panel[hidden] { display: none; }

.pub-body { flex: 1; overflow-y: auto; padding: 28px 28px 8px; }
.pub-body h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.pub-sub { font-size: 13px; color: var(--app-muted); margin-bottom: 22px; }

.pub-footer {
  padding: 16px 28px 22px;
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--app-border); flex-shrink: 0;
}

/* Buttons */
.btn-pub-primary {
  padding: 10px 20px;
  background: var(--app-accent); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.btn-pub-primary:hover:not(:disabled) { background: var(--app-accent-dark); }
.btn-pub-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-pub-ghost {
  padding: 10px 16px;
  background: none; color: var(--app-muted);
  border: 1px solid var(--app-border); border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500;
  transition: border-color 0.12s, color 0.12s;
}
.btn-pub-ghost:hover { border-color: var(--app-ink); color: var(--app-ink); }

/* Step 1 — Summary */
.pub-summary-card {
  border: 1px solid var(--app-border); border-radius: 8px; overflow: hidden;
}
.pub-summary-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--app-border);
  gap: 12px;
}
.pub-summary-row:last-child { border-bottom: none; }
.pub-lbl { font-size: 12px; font-weight: 500; color: var(--app-muted); white-space: nowrap; }
.pub-val { font-size: 13px; font-weight: 600; color: var(--app-ink); text-align: right; }

/* Step 2 — Payment */
.pub-price-card {
  background: linear-gradient(135deg, var(--app-ink) 0%, #2d2420 100%);
  border-radius: 10px; padding: 20px 22px; color: #fff; margin-bottom: 14px;
}
.pub-price-name {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.6; margin-bottom: 6px;
}
.pub-price-amount {
  font-size: 40px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 14px;
}
.pub-price-amount span { font-size: 15px; font-weight: 400; opacity: 0.65; }
.pub-price-features { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.pub-price-features li { font-size: 13px; opacity: 0.82; }

.pub-demo-note {
  background: #fefce8; border: 1px solid #fde047;
  border-radius: 6px; padding: 8px 12px;
  font-size: 11.5px; font-weight: 500; color: #854d0e;
  margin-bottom: 18px;
}

.pub-card-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.pub-field { display: flex; flex-direction: column; gap: 4px; }
.pub-field > span { font-size: 11.5px; font-weight: 500; color: var(--app-muted); }
.pub-field input {
  font: inherit; font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--app-border); border-radius: 6px;
  background: #fafafa; color: var(--app-ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.pub-field input:focus {
  outline: none; border-color: var(--app-accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(191,40,42,0.08);
}
.pub-field-row { display: grid; grid-template-columns: 1fr 90px; gap: 12px; }

/* Step 3 — Domain */
.pub-domain-box { display: flex; gap: 8px; margin-bottom: 10px; align-items: stretch; }
.pub-domain-input-wrap {
  flex: 1; display: flex; align-items: center;
  border: 1.5px solid var(--app-border); border-radius: 6px;
  background: #fafafa; overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.pub-domain-input-wrap:focus-within {
  border-color: var(--app-accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(191,40,42,0.08);
}
.pub-domain-input-wrap input {
  flex: 1; border: none; background: transparent; outline: none;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 0 10px 12px; min-width: 0; color: var(--app-ink);
}
.pub-domain-suffix {
  font-size: 12.5px; color: var(--app-muted);
  padding: 10px 12px 10px 0; white-space: nowrap;
}
.pub-domain-msg {
  font-size: 13px; font-weight: 600; min-height: 20px; margin-bottom: 12px;
}
.pub-domain-msg.ok  { color: #16a34a; }
.pub-domain-msg.err { color: var(--app-accent); }
.pub-domain-msg.checking { color: var(--app-muted); }
.pub-domain-tip { font-size: 12px; color: var(--app-muted); line-height: 1.55; }

/* Step 4 — Success */
.pub-success-body {
  display: flex !important; flex-direction: column;
  align-items: center; text-align: center;
  padding: 44px 32px 32px !important; gap: 14px;
}
.pub-check-wrap { width: 72px; height: 72px; }
.pub-check-svg { width: 72px; height: 72px; }
.pub-check-circle {
  stroke: #16a34a; stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: pub-stroke 0.55s cubic-bezier(0.65,0,0.45,1) 0.1s forwards;
}
.pub-check-mark {
  stroke: #16a34a; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: pub-stroke 0.3s cubic-bezier(0.65,0,0.45,1) 0.6s forwards;
}
@keyframes pub-stroke { to { stroke-dashoffset: 0; } }

.pub-success-body h2 { font-size: 24px; font-weight: 700; margin: 0; }
.pub-live-url {
  display: inline-block;
  background: var(--app-bg); border: 1px solid var(--app-border);
  border-radius: 6px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: var(--app-accent);
  text-decoration: none; transition: border-color 0.12s;
}
.pub-live-url:hover { border-color: var(--app-accent); }
.pub-success-note { font-size: 12.5px; color: var(--app-muted); max-width: 320px; line-height: 1.6; }
.pub-success-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* TERMS MODAL
   ──────────────────────────────────────────────────── */
.terms-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,8,6,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.terms-overlay[hidden] { display: none; }

.terms-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  overflow: hidden;
}

.terms-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
}
.terms-header-top {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px;
}
.terms-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #FFF7ED; border: 1px solid #FED7AA;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.terms-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.terms-header p { font-size: 13px; color: var(--app-muted); line-height: 1.5; }

.terms-body {
  flex: 1; overflow-y: auto;
  padding: 20px 28px;
  font-size: 13px; line-height: 1.7; color: #374151;
}
.terms-body h3 {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--app-muted);
  margin: 20px 0 6px;
}
.terms-body h3:first-child { margin-top: 0; }
.terms-body p { margin-bottom: 10px; }
.terms-body ul { padding-left: 18px; margin-bottom: 10px; }
.terms-body ul li { margin-bottom: 4px; }
.terms-body a { color: var(--app-accent); }

.terms-fade {
  position: relative;
  flex-shrink: 0;
}
.terms-fade::before {
  content: '';
  position: absolute; top: -32px; left: 0; right: 0; height: 32px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.terms-footer {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--app-border);
  flex-shrink: 0;
}
.terms-check-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; cursor: pointer;
}
.terms-check-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px;
  accent-color: var(--app-accent); flex-shrink: 0; cursor: pointer;
}
.terms-check-label { font-size: 13px; line-height: 1.5; color: var(--app-ink); }
.terms-check-label a { color: var(--app-accent); }

.btn-terms-accept {
  width: 100%; padding: 11px;
  background: var(--app-accent); color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .15s, opacity .15s;
}
.btn-terms-accept:disabled { opacity: .4; cursor: not-allowed; }
.btn-terms-accept:not(:disabled):hover { background: var(--app-accent-dark); }
.terms-legal-note {
  margin-top: 10px; font-size: 11px; color: var(--app-muted);
  text-align: center; line-height: 1.5;
}

/* PHOTO INPUT — drag-and-drop, upload, URL, focal point
   ──────────────────────────────────────────────────── */
.photo-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-preview {
  position: relative;
  aspect-ratio: var(--photo-aspect, 4/5);
  background: #f0f0ef;
  border: 1.5px dashed var(--app-border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.photo-input.has-value .photo-preview {
  border-style: solid;
  border-color: var(--app-border);
}
.photo-input.dragging .photo-preview {
  border-color: var(--app-accent);
  background: rgba(191, 40, 42, 0.06);
  border-style: dashed;
}
.photo-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
}
.photo-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border: 2px solid #fff;
  background: var(--app-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  pointer-events: none;
  transition: left 0.1s, top 0.1s;
}
.photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--app-muted);
  font-size: 11px;
  text-align: center;
  padding: 8px;
  pointer-events: none;
}
.photo-empty svg { opacity: 0.4; }
.photo-actions {
  display: flex;
  gap: 4px;
}
.photo-actions button {
  flex: 1;
  background: #fafafa;
  border: 1px solid var(--app-border);
  padding: 6px 8px;
  border-radius: 5px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--app-ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.photo-actions button:hover {
  background: #fff;
  border-color: var(--app-ink);
}
.photo-actions button[data-action="clear"] {
  color: var(--app-muted);
  flex: 0 0 auto;
  padding: 6px 10px;
}
.photo-actions button[data-action="clear"]:hover {
  color: var(--app-accent);
  border-color: var(--app-accent);
}
.photo-url-input {
  margin-top: 2px;
}
.photo-url-input input {
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 5px;
  background: #fafafa;
  color: var(--app-ink);
  transition: border-color 0.12s, background 0.12s;
}
.photo-url-input input:focus {
  outline: none;
  border-color: var(--app-accent);
  background: #fff;
}
.photo-hint {
  font-size: 10.5px;
  color: var(--app-muted);
  font-style: italic;
  margin-top: 2px;
}
.photo-input.has-value .photo-hint::before {
  content: 'Clica no preview para reposicionar. ';
}

/* RESPONSIVE
   ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 100%; }
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  body { overflow: auto; }
  .sidebar { max-height: none; border-right: none; border-bottom: 1px solid var(--app-border); }
  .preview-pane { min-height: 80vh; }
}
