/* Deex App Builder — sistema visual do portal, Studio, retaguarda e admin (sem etapa de build).
 * Princípios: neutro com um único acento, hierarquia por tipografia e linhas (não por sombras),
 * listas e tabelas em vez de grades de cards, botões só com texto. */
:root {
  --brand: #0b7a5b;
  --brand-600: #08634a;
  --brand-50: #e9f4f0;
  --brand-100: #d3e9e1;
  --ink: #17191c;
  --ink-2: #3f444b;
  --muted: #6c727a;
  --line: #e4e4e0;
  --line-2: #cfcfca;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --ok: #0b7a5b;
  --ok-50: #e9f4f0;
  --warn: #9a5b00;
  --warn-50: #fdf4e3;
  --warn-line: #ecd6a8;
  --danger: #b4281e;
  --danger-50: #fbeeec;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: none;
  --shadow-lg: 0 16px 40px -12px rgba(23, 25, 28, .28);
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0 0 .4rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.45rem; letter-spacing: -.012em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
[x-cloak] { display: none !important; }
i[x-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
/* Ícones com tamanho definido no próprio elemento: o SVG acompanha (inclusive o glifo do simulador). */
i[x-icon][style] > svg { width: 100%; height: 100%; }
svg { stroke-width: 1.75; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ layout do portal */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.shell.has-tips { grid-template-columns: 220px minmax(0, 1fr) 280px; }
.shell.shell-wide { grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.brand { display: block; color: var(--ink); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; padding: 2px 10px 16px;
  text-decoration: none; }
.brand:hover { color: var(--ink); }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2);
  text-decoration: none; }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.active { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.sidebar .btn-create { margin: 0 4px 14px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 10px 0; font-size: .82rem; }
.sidebar-foot .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .mail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.sidebar-foot .link-btn { margin-top: 8px; }
.main { padding: 28px 36px 56px; min-width: 0; max-width: 1120px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 0; color: var(--muted); }
.tips { border-left: 1px solid var(--line); padding: 28px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.tips h3 { color: var(--muted); font-weight: 500; font-size: .85rem; margin-bottom: 12px; }
.tip { padding: 12px 0; border-top: 1px solid var(--line); }
.tip h4 { font-size: .88rem; margin-bottom: 3px; }
.tip p { font-size: .84rem; color: var(--ink-2); margin-bottom: 4px; }

@media (max-width: 1240px) { .shell.has-tips { grid-template-columns: 220px minmax(0, 1fr); } .tips { display: none; } }
@media (max-width: 860px) {
  .shell, .shell.has-tips, .shell.shell-wide { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; padding: 10px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { width: 100%; padding: 2px 10px 8px; }
  .sidebar .btn-create { order: 9; margin: 6px 4px 0; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0 10px; border: 0; }
  .sidebar-foot .who, .sidebar-foot .mail { display: none; }
  .sidebar-foot .link-btn { margin: 0; }
  .nav-link.active { box-shadow: none; }
  .main { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; }
}

/* ------------------------------------------------------------------ componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); border-radius: var(--radius-sm);
  padding: 7px 14px; font: inherit; font-weight: 500; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap;
  text-decoration: none; }
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-soft:hover { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--line-2); }
.btn-danger:hover { background: var(--danger-50); color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: .84rem; }
.btn-icon { padding: 5px; }
.btn-sm.btn-icon { padding: 4px; }
.btn-block { width: 100%; }
.btn-google { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-google:hover { background: var(--bg); color: var(--ink); border-color: var(--line-2); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 4px; font-size: .76rem;
  font-weight: 500; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-brand { background: var(--bg); color: var(--ink-2); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge svg { width: 12px; height: 12px; }

.alert { border-radius: var(--radius-sm); padding: 9px 12px; border: 1px solid var(--line); background: var(--surface);
  display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.alert-warn { background: var(--warn-50); border-color: var(--warn-line); color: #5f3a00; }
.alert-danger { background: var(--danger-50); border-color: #eec9c5; color: #7c1b13; }
.alert-ok { background: var(--ok-50); border-color: var(--brand-100); color: #07523d; }
.alert-brand { background: var(--bg); border-color: var(--line); color: var(--ink-2); }
.lock { display: flex; gap: 8px; align-items: center; border: 1px solid var(--warn-line); border-radius: var(--radius-sm);
  padding: 9px 12px; background: var(--warn-50); font-size: .86rem; color: #5f3a00; }
.lock svg { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------------ formulários */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .label { font-weight: 500; font-size: .86rem; color: var(--ink); }
.help { font-size: .8rem; color: var(--muted); }
.error-text { font-size: .8rem; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 7px 10px; font: inherit; color: var(--ink); background: var(--surface); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.input:disabled { background: var(--bg); color: var(--muted); }
textarea.input { min-height: 90px; resize: vertical; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; min-height: 180px; }
.input-group { display: flex; gap: 8px; align-items: center; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type=color] { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 2px; background: var(--surface); cursor: pointer; }
.color-field .input { width: 100px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; text-transform: uppercase; }
.range-field { display: flex; align-items: center; gap: 10px; }
.range-field input[type=range] { flex: 1; accent-color: var(--brand); }
.range-field output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .label { font-weight: 400; color: var(--ink); }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative;
  cursor: pointer; transition: background .12s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .12s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(14px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.choice { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; text-align: center;
  background: var(--surface); font: inherit; font-size: .85rem; color: var(--ink-2); }
.choice:hover { background: var(--bg); }
.choice.selected { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); color: var(--ink); font-weight: 500; }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice svg { width: 20px; height: 20px; display: block; margin: 0 auto 5px; }

.upload { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; gap: 12px;
  align-items: center; background: var(--surface); }
.upload .thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--bg) center / contain no-repeat;
  border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.upload .thumb.wide { width: 104px; height: 48px; }
.upload .thumb svg { width: 18px; height: 18px; }
.upload .info { flex: 1; min-width: 0; }
.upload .info .label { display: block; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ------------------------------------------------------------------ tabelas */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 500; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.table td .sub { display: block; font-size: .8rem; color: var(--muted); }
.request-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; font-size: .9rem; color: var(--ink-2); }
.stat-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
/* Números do resumo: uma faixa única, separada por linhas, em vez de vários cards. */
.stat-row { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.stat-row > div { flex: 1 1 150px; padding: 12px 18px; border-left: 1px solid var(--line); }
.stat-row > div:first-child { border-left: 0; }
.stat-row .small { color: var(--muted); }

/* ------------------------------------------------------------------ lista de apps e planos */
.app-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.app-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.app-row:first-child { border-top: 0; }
.app-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 600;
  background-size: cover; background-position: center; flex: none; }
.app-row .who { flex: 1; min-width: 0; }
.app-row .who strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .who span { font-size: .85rem; color: var(--muted); }
.app-row .hint-warn { color: var(--warn); }
.app-row .actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 720px) { .app-row { flex-wrap: wrap; } .app-row .actions { width: 100%; } }
.empty { text-align: left; padding: 28px 24px; }
.empty svg { display: none; }
.compare { width: 100%; border-collapse: collapse; background: var(--surface); }
.compare th, .compare td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; vertical-align: top; }
.compare thead th { vertical-align: bottom; padding-top: 16px; font-weight: 600; font-size: 1rem; }
.compare thead .price { display: block; font-size: 1.25rem; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.compare thead .price small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.compare tbody th { font-weight: 400; color: var(--muted); width: 30%; }
.compare .no { color: var(--muted); }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 0; padding: 14px; }
.plain-steps { list-style: decimal; padding-left: 20px; margin: 0; max-width: 640px; }
.plain-steps li { padding-left: 4px; margin-bottom: 14px; }
.plain-steps li::marker { color: var(--muted); }
.plain-steps strong { font-weight: 600; display: block; }
.plain-steps span { color: var(--ink-2); }
.addon-row { display: flex; gap: 18px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
.addon-row:first-child { border-top: 0; }
.addon-row > div:first-child { flex: 1; }
.addon-row p { margin: 2px 0 0; color: var(--ink-2); font-size: .9rem; }
.addon-row .amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ autenticação */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.auth-form { display: flex; flex-direction: column; padding: 28px 40px; }
.auth-form .brand { padding: 0; }
.auth-form .box { width: 100%; max-width: 340px; margin: auto 0; padding: 24px 0; }
.auth-form .foot { font-size: .82rem; color: var(--muted); }
.auth-side { background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center;
  padding: 40px; overflow: hidden; }
.auth-side p { max-width: 440px; font-size: 1.05rem; color: var(--ink-2); margin-bottom: 26px; }
.auth-shots { display: flex; gap: 14px; }
.auth-shots .mini { flex: 0 0 170px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 20px; } }

/* ------------------------------------------------------------------ Wizard */
.wizard-steps { display: flex; gap: 18px; margin-bottom: 18px; font-size: .88rem; color: var(--muted); }
.wizard-steps .ws.on { color: var(--ink); font-weight: 600; }
.segment-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.segment-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 8px 12px; margin-bottom: -1px; font: inherit;
  font-size: .88rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segment-tabs button:hover { color: var(--ink); }
.segment-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.tpl { border: 0; background: none; cursor: pointer; text-align: left; padding: 0; font: inherit; color: var(--ink); }
.tpl .mini { outline: 1px solid var(--line-2); }
.tpl:hover .mini { outline-color: var(--muted); }
.tpl.selected .mini { outline: 2px solid var(--brand); outline-offset: 1px; }
.tpl-body { padding: 8px 2px 0; }
.tpl-body strong { display: block; font-weight: 500; font-size: .9rem; }
.tpl-body span { font-size: .8rem; color: var(--muted); }
/* Miniatura real do app: mesmas cores, layout e ícones que o modelo aplica. */
.mini { border-radius: 10px; overflow: hidden; aspect-ratio: 9 / 15; display: flex; flex-direction: column; background: #fff center / cover no-repeat; font-size: 9px; }
.mini-bar { padding: 8px 9px; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.mini-grid { display: grid; gap: 8px 6px; padding: 10px 9px; align-content: start; }
.mini-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 0; line-height: 1.15; }
.mini-grid.list .mini-tile { flex-direction: row; text-align: left; gap: 6px; }
.mini-icon { display: grid; place-items: center; border-radius: 22%; width: 100%; max-width: 36px; aspect-ratio: 1; }
.mini-grid.cols-2 .mini-icon { max-width: 50px; }
.mini-grid.list .mini-icon { width: 20px; flex: none; }
.mini-icon i, .mini-icon svg { width: 52%; height: 52%; }
.mini-label { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ------------------------------------------------------------------ modal e toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(23, 25, 28, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: 100%; max-width: 720px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-width: 380px; font-size: .88rem; }
.toast.error { background: #8f1f16; }
.toast ul { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; }

/* ------------------------------------------------------------------ Studio */
.studio { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.studio-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.studio-bar .app-name { font-weight: 600; font-size: .98rem; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 7px;
  font-family: inherit; width: 240px; color: var(--ink); background: transparent; }
.studio-bar .app-name:hover { border-color: var(--line); }
.studio-bar .app-name:focus { outline: none; border-color: var(--brand); }
.studio-body { display: grid; grid-template-columns: 176px minmax(0, 1fr) 420px; min-height: 0; }
.studio-tabs { background: var(--surface); border-right: 1px solid var(--line); padding: 12px 8px; overflow-y: auto; }
.studio-tabs button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border: 0; background: transparent;
  border-radius: var(--radius-sm); font: inherit; color: var(--ink-2); cursor: pointer; text-align: left; }
.studio-tabs button:hover { background: var(--bg); }
.studio-tabs button.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.dirty-dot { width: 6px; height: 6px; border-radius: 50%; background: #d48806; margin-left: auto; flex: none; }
.studio-panel { overflow-y: auto; padding: 20px 24px 72px; }
.studio-panel .card { max-width: 820px; }
.studio-preview { border-left: 1px solid var(--line); background: var(--bg); overflow-y: auto; padding: 14px 10px; display: flex;
  flex-direction: column; align-items: center; gap: 10px; }
.save-bar { position: sticky; bottom: -72px; margin-top: 14px; max-width: 820px; display: flex; gap: 8px; align-items: center;
  justify-content: flex-end; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 1200px) { .studio-body { grid-template-columns: 160px minmax(0, 1fr) 370px; } }
@media (max-width: 980px) {
  .studio { height: auto; }
  .studio-bar { flex-wrap: wrap; }
  .studio-body { grid-template-columns: 1fr; }
  .studio-tabs { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .studio-tabs button { width: auto; white-space: nowrap; }
  .studio-preview { border-left: 0; }
}

.module-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.module-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.module-row:first-of-type { border-top: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.module-row.inactive { opacity: .55; }
.module-row .handle { cursor: grab; color: var(--line-2); display: grid; place-items: center; }
.module-row:hover .handle { color: var(--muted); }
.module-row .handle svg { width: 16px; height: 16px; }
.module-row .micon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--bg);
  color: var(--ink-2); background-size: cover; flex: none; }
.module-row .micon svg { width: 16px; height: 16px; }
.module-row .mtitle { flex: 1; min-width: 0; }
.module-row .mtitle strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sortable-ghost { opacity: .35; }
.module-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 18px; }
.module-option { border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; background: none; text-align: left; font: inherit; cursor: pointer;
  display: flex; gap: 10px; color: var(--ink); }
.module-option:hover { background: var(--bg); }
.module-option .micon { width: 28px; height: 28px; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.module-option .micon svg { width: 18px; height: 18px; }
.module-option strong { display: block; font-weight: 500; font-size: .9rem; }
.module-option span { font-size: .8rem; color: var(--muted); }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 170px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.icon-picker button { height: 38px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; display: grid;
  place-items: center; color: var(--ink-2); }
.icon-picker button:hover { background: var(--bg); }
.icon-picker button.on { border-color: var(--brand); color: var(--brand); }
.icon-picker svg { width: 18px; height: 18px; }

.rte { border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 1px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--bg); }
.rte-toolbar button { border: 0; background: none; border-radius: 4px; padding: 4px 6px; cursor: pointer; color: var(--ink-2); display: flex; align-items: center;
  font: inherit; font-size: .8rem; }
.rte-toolbar button:hover { background: var(--line); }
.rte-toolbar button.on { background: var(--line); color: var(--ink); }
.rte-toolbar svg { width: 15px; height: 15px; }
.rte-area { min-height: 150px; max-height: 340px; overflow-y: auto; padding: 10px 12px; outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte textarea { border: 0; border-radius: 0; min-height: 190px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.gallery-item { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gallery-item .input { border: 0; border-top: 1px solid var(--line); border-radius: 0; font-size: .8rem; padding: 5px 7px; }

.slide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slide-item { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.slide-item img { width: 100%; aspect-ratio: 730 / 560; object-fit: cover; display: block; }
.slide-item .row { padding: 5px; justify-content: space-between; }

.hours-day { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.hours-day:last-child { border-bottom: 0; }
.period { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.period .input { width: 104px; padding: 5px 7px; }

/* ------------------------------------------------------------------ simulador */
.sim-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 4px; font: inherit;
  font-size: .82rem; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button svg { width: 15px; height: 15px; }
.phone-scale { width: calc(375px * var(--sim-scale) + 24px); height: calc(780px * var(--sim-scale) + 24px); flex: none; }
.phone { width: 399px; height: 804px; transform: scale(var(--sim-scale)); transform-origin: top left; border-radius: 54px;
  background: #111827; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #374151; }
.phone.android { border-radius: 36px; }
.screen { width: 375px; height: 780px; border-radius: 42px; overflow: hidden; position: relative; background: #fff;
  display: flex; flex-direction: column; font-family: -apple-system, "SF Pro Text", "Roboto", system-ui, sans-serif; }
.phone.android .screen { border-radius: 26px; font-family: "Roboto", system-ui, sans-serif; }
.sb { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; font-size: 14px;
  font-weight: 600; flex: none; position: relative; z-index: 3; }
.phone.android .sb { height: 28px; padding: 0 16px; font-size: 12px; font-weight: 500; }
.sb .island { position: absolute; left: 50%; top: 10px; width: 112px; height: 30px; border-radius: 20px; background: #000;
  transform: translateX(-50%); }
.phone.android .sb .island { width: 12px; height: 12px; top: 8px; border-radius: 50%; }
.sb .sb-icons { display: flex; gap: 5px; align-items: center; }
.sb .sb-icons svg { width: 15px; height: 15px; }
.appbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 12px; flex: none; position: relative; z-index: 2; }
.phone.ios .appbar { height: 48px; justify-content: center; }
.appbar .ab-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.appbar .ab-btn svg { width: 22px; height: 22px; }
.phone.ios .appbar .ab-btn { position: absolute; left: 8px; }
.appbar .ab-title { font-size: 19px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone.ios .appbar .ab-title { font-size: 17px; font-weight: 600; max-width: 230px; }
.appbar img.ab-logo { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; height: 40px; max-width: 195px; object-fit: contain; pointer-events: none; }
.float-menu { position: absolute; left: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid;
  place-items: center; background: rgba(0, 0, 0, .35); color: #fff; z-index: 2; }
.float-menu svg { width: 22px; height: 22px; }
.sim-body { flex: 1; overflow-y: auto; position: relative; background-size: cover; background-repeat: no-repeat; }
.sim-body::-webkit-scrollbar { width: 0; }
.sim-content { position: relative; padding-bottom: 24px; min-height: 100%; }
.sim-logo { display: flex; justify-content: center; padding: 16px 0 6px; }
.sim-logo img { width: 150px; height: 100px; object-fit: contain; }
.sim-slider { position: relative; width: 100%; aspect-ratio: 730 / 560; overflow: hidden; background: #e5e7eb; }
.sim-slider .slide { position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform .6s ease, opacity .6s ease; }
.sim-slider .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; gap: 5px; justify-content: center; }
.sim-slider .dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.sim-slider .dots span.on { background: #fff; }
.sim-grid { display: grid; padding: 16px; }
.sim-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; text-align: center;
  min-width: 0; }
.sim-tile .tile-icon { display: grid; place-items: center; background-size: cover; background-position: center;
  overflow: hidden; }
.sim-tile .tile-label { line-height: 1.2; word-break: break-word; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sim-list { padding: 12px 14px; display: flex; flex-direction: column; }
.sim-list .sim-tile { flex-direction: row; text-align: left; padding: 10px 12px; border-radius: 12px; }
.sim-list .chev { margin-left: auto; opacity: .6; }
.sim-list .chev svg { width: 18px; height: 18px; }
.sim-ads { margin: 8px 14px 0; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px; font-size: 11px; text-align: center;
  color: #64748b; background: rgba(255, 255, 255, .85); }
.sim-drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); z-index: 5; }
.sim-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: 78%; z-index: 6; padding: 56px 0 16px; overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .25); }
.sim-drawer .dh { padding: 0 20px 14px; font-weight: 700; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.sim-drawer .dh img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.sim-drawer .di { display: flex; gap: 14px; align-items: center; padding: 12px 20px; font-size: 15px; cursor: pointer; }
.sim-drawer .di svg { width: 20px; height: 20px; }
.sim-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; }
.sim-popup { background: rgba(0, 0, 0, .55); }
.sim-popup .pbox { position: relative; width: 300px; aspect-ratio: 320 / 480; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4); background: #fff center / cover no-repeat; }
.sim-popup .pclose { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.sim-popup .pclose svg { width: 16px; height: 16px; }
.sim-splash { background-size: cover; background-position: center; }
.sim-splash .splash-icon { width: 120px; height: 120px; border-radius: 28px; background-size: cover; background-position: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.sim-login { display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 28px; gap: 12px; background-size: cover;
  background-position: center; }
.sim-login img { width: 150px; height: 100px; object-fit: contain; align-self: center; }
.sim-login .fake-input { background: rgba(255, 255, 255, .92); border: 1px solid rgba(0, 0, 0, .12); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: #6b7280; }
.sim-login .fake-btn { border-radius: 10px; padding: 13px; text-align: center; font-weight: 600; color: #fff; font-size: 15px; }
.sim-page { position: absolute; inset: 0; background: #fff; z-index: 4; display: flex; flex-direction: column; }
.sim-page-body { flex: 1; overflow-y: auto; }
.sim-page-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.sim-page-empty { padding: 28px 22px; color: #475569; font-size: 14px; text-align: center; }
.sim-page-empty svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .7; }
.sim-homebar { height: 22px; display: grid; place-items: center; flex: none; }
.sim-homebar span { width: 130px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .8); }
.phone.android .sim-homebar { height: 18px; }
.phone.android .sim-homebar span { width: 90px; height: 4px; }

/* ------------------------------------------------------------------ retaguarda */
.bo-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.bo-nav { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.bo-nav .app-head { display: flex; gap: 10px; align-items: center; padding: 2px 8px 12px; }
.bo-nav .app-head .app-icon { width: 32px; height: 32px; border-radius: 8px; font-size: .9rem; }
.bo-nav .app-head strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-nav .group-label { font-size: .78rem; color: var(--muted); padding: 14px 10px 4px; }
.bo-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; }
.bo-nav a:hover { background: var(--bg); color: var(--ink); }
.bo-nav a.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.bo-nav a .pill { margin-left: auto; background: var(--warn-50); color: var(--warn); font-size: .74rem; border-radius: 4px; padding: 0 6px; font-weight: 500; }
.theme-toggle { margin: 14px 10px 0; display: block; }
.bo-main { padding: 24px 32px 56px; min-width: 0; max-width: 1120px; width: 100%; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.share-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
.share-row:first-child { border-top: 0; }
.share-row > div { flex: 1; min-width: 0; }
.share-row a.url { word-break: break-all; }
.qr { width: 92px; height: 92px; border-radius: 4px; background: #fff; padding: 3px; border: 1px solid var(--line); flex: none; }
.seg-tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: 7px 12px; margin-bottom: -1px;
  font: inherit; cursor: pointer; }
.seg-tabs button:hover { color: var(--ink); }
.seg-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.tree-indent { display: inline-block; width: 18px; }
.thumb-sm { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg); display: block; }
.counter { font-size: .78rem; color: var(--muted); text-align: right; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.clickable { cursor: pointer; }
.clickable:hover td { background: var(--bg); }
details.history { margin-top: 14px; font-size: .9rem; }
details.history summary { cursor: pointer; color: var(--muted); }
@media (max-width: 900px) {
  .bo-shell { grid-template-columns: 1fr; }
  .bo-nav { position: static; height: auto; }
  .bo-main { padding: 18px 14px 40px; }
}

/* ------------------------------------------------------------------ tema escuro opcional da retaguarda */
body.dark {
  --ink: #e8e8e6; --ink-2: #c3c4c1; --muted: #8d9093; --line: #2a2c2f; --line-2: #3b3e42; --bg: #151618;
  --surface: #1c1d20; --brand: #1f9d78; --brand-600: #27b48b; --brand-50: rgba(31, 157, 120, .14); --brand-100: rgba(31, 157, 120, .26);
  --ok: #3fc79f; --ok-50: rgba(31, 157, 120, .14); --warn: #e5b45a; --warn-50: rgba(229, 180, 90, .12); --warn-line: #5d4a22;
  --danger: #ef8a81; --danger-50: rgba(239, 138, 129, .12); color-scheme: dark;
}
body.dark .alert-warn, body.dark .lock { color: var(--warn); }
body.dark .alert-danger { color: var(--danger); border-color: #5c2a26; }
body.dark .alert-ok { color: var(--ok); border-color: #1f4d3e; }
body.dark .toast { background: #2d2f33; }
body.dark a { color: #57c9a6; }
body.dark .btn { color: #fff; }
body.dark .btn-ghost, body.dark .btn-soft, body.dark .btn-google { color: var(--ink); }
body.dark .btn-danger { color: var(--danger); }
body.dark .bo-nav a { color: var(--ink-2); }
body.dark .bo-nav a.on, body.dark .bo-nav a:hover { color: var(--ink); }

/* Prévia da abertura em vários tamanhos de tela */
.splash-previews { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 8px; }
.splash-frame { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.splash-frame .frame { display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-2); border-radius: 6px;
  background-size: cover; background-position: center; }
.splash-frame .frame-icon { display: block; background-size: cover; background-position: center; }
.splash-frame figcaption { display: flex; flex-direction: column; font-size: 11px; line-height: 1.35; color: var(--muted, #6b7280); }
.splash-frame figcaption strong { color: var(--ink); font-weight: 500; }
