:root {
  --green: #0f7a5c;
  --green-dark: #0a5c45;
  --green-soft: #e3f4ee;
  --wa-out: #d9fdd3;
  --wa-in: #ffffff;
  --wa-bg: #efeae2;
  --bg: #fafaf7;
  --card: #ffffff;
  --text: #1c2321;
  --muted: #667570;
  --line: #e3e7e4;
  --red: #d64545;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #2bb88c; --green-dark: #1f9873; --green-soft: #15332a;
    --wa-out: #144d37; --wa-in: #26302c; --wa-bg: #0e1512;
    --bg: #101513; --card: #1a211e; --text: #eef3f0; --muted: #8fa099; --line: #2a3430;
  }
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Container: no desktop vira "celular" centralizado */
.app {
  max-width: 440px; height: 100dvh; margin: 0 auto; background: var(--bg);
  display: flex; flex-direction: column; position: relative;
}
@media (min-width: 600px) {
  body { background: #dfe5e2; padding: 24px 0; }
  .app { height: 820px; border-radius: 32px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
}
/* Só o conteúdo rola: barra do topo, botões de ação e abas ficam na base */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.screen { flex: 1; display: flex; flex-direction: column; padding: 24px 20px 20px; animation: in .25s ease; }
@keyframes in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.grow { flex: 1; }
.center { text-align: center; align-items: center; }

/* Tipografia */
h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 10px; }
h1.h-sm { font-size: 24px; margin-bottom: 18px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }
.lead { color: var(--muted); margin-bottom: 22px; }
.muted { color: var(--muted); font-size: 15px; }
.label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 16px; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.icon-btn:active { background: var(--line); }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .3s; }
.step-count { font-size: 14px; color: var(--muted); min-width: 28px; text-align: right; }

/* Botões */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-decoration: none;
  width: 100%; min-height: 56px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 17px; padding: 14px 18px; transition: transform .1s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-dark); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.small { width: auto; min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn.ghost { background: var(--green-soft); color: var(--green); }
.link { background: none; border: 0; color: var(--green); font-weight: 600; padding: 12px 0; cursor: pointer; text-align: left; font-size: 15px; }
/* Ação principal sempre na base, com o conteúdo rolando por baixo */
.footer {
  margin: auto -20px -20px; padding: 18px 20px 20px; position: sticky; bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 16px);
}
.footer .btn + .btn { margin-top: 10px; }
.link-row { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.link.center { text-align: center; padding: 12px 14px; }
.screen > #connect-input, .screen > #connect-code { flex: 1; display: flex; flex-direction: column; }
.code-hint { text-align: center; margin: -6px 0 22px; }

/* Inputs */
.input {
  width: 100%; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 17px; outline: none;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.area { resize: none; min-height: 200px; line-height: 1.5; overflow-y: auto; }
.label + .muted { margin: -4px 0 10px; }
.input + .link, .area + .link { margin-top: 4px; }

/* Welcome */
.logo { font-weight: 800; font-size: 28px; letter-spacing: -.02em; color: var(--green); }
.logo span { color: var(--text); }
.welcome-art {
  margin: 28px 0 20px; padding: 20px 16px; border-radius: 22px; background: var(--wa-bg);
  display: flex; flex-direction: column; gap: 10px;
}
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 15.5px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble.in { background: var(--wa-in); align-self: flex-start; border-top-left-radius: 3px; }
.bubble.out { background: var(--wa-out); align-self: flex-end; border-top-right-radius: 3px; }
.bubble.big { max-width: 92%; font-size: 17px; }

/* Cards de nicho */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card-opt {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  min-height: 64px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--line); cursor: pointer; font-weight: 600;
}
.card-opt .emoji { font-size: 28px; }
.card-opt[aria-checked="true"] { border-color: var(--green); background: var(--green-soft); }
#niche-other { margin-top: 10px; }

/* Preview do chat */
.chat-preview { margin-top: 22px; padding: 16px; border-radius: 20px; background: var(--wa-bg); display: flex; flex-direction: column; }
.chat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }

/* Código */
.code-box {
  margin: 8px 0 22px; padding: 28px 12px; text-align: center; border-radius: 20px;
  background: var(--green-soft); color: var(--green); border: 2px dashed var(--green);
  font-size: 44px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums;
}
.steps { padding-left: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; }
.steps li > span { flex: 1; min-width: 0; }
.steps li::before {
  content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}

/* Aceite no checkout e páginas de documentos */
.check-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check-row input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--green); }
.check-row a, .doc a { color: var(--green); font-weight: 600; }
.doc h1 { font-size: 24px; margin: 20px 0 6px; }
.doc h2 { font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 24px 0 6px; }
.doc p, .doc li { font-size: 16px; margin-bottom: 8px; }
.doc ul { padding-left: 20px; margin-bottom: 8px; }
.doc .version { color: var(--muted); font-size: 14px; }

/* Espera do pagamento */
.wait-icon { margin: 28px 0 14px; color: var(--green); }
.wait-icon svg { width: 56px; height: 56px; stroke-width: 1.5; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.wait-list { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.wait-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--card); font-size: 15px; }
.wait-list svg { flex: none; width: 22px; height: 22px; color: var(--green); margin-top: 1px; }
.wait-list strong { display: block; font-size: 16px; }

/* Teste */
/* Conversa de teste: painel com cabeçalho do contato */
.chat-panel { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--card); margin-top: 8px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 40px; height: 40px; }
.chat-head strong { display: block; line-height: 1.25; }
.chat-head small { color: var(--muted); font-size: 14px; }
.chat-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; min-height: 240px; max-height: 60vh; overflow-y: auto; background: var(--wa-bg); }
.test-chat { display: contents; }
.test-chat .bubble { white-space: pre-wrap; }
.test-empty { margin: auto 0; }
.checklist { list-style: none; margin: 14px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card); font-size: 15px; }
.checklist svg { flex: none; width: 22px; height: 22px; color: var(--muted); }
.checklist li.done svg { color: var(--green); }
.checklist li.optional { font-size: 14px; color: var(--muted); }
#test-handoff > span { display: block; min-width: 0; }
#test-handoff blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--green); color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
#test-tune { margin-top: 12px; }
#doc { display: none; }
.status-switch { flex: none; display: flex; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.draft-bar { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; margin: 16px 20px 0; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-left: 5px solid #e0a412; color: var(--text); }
.draft-bar strong { font-size: 17px; }
.draft-bar .muted { font-size: 14px; }
.draft-bar .link { color: var(--muted); padding: 12px 8px; }
.draft-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.version-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.version-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.version-list li:first-child { border-top: 0; }
.version-list small { display: block; color: var(--muted); margin: 2px 0 6px; font-size: 14px; }
#test-tune .btn { margin-top: 12px; }
#test-tune summary { justify-content: center; text-align: center; }

/* Sucesso */
.confetti { margin: 40px 0 12px; color: var(--green); }
.confetti svg { width: 72px; height: 72px; stroke-width: 1.5; }
.tip { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 8px; }

/* Dashboard */
.dash { padding-bottom: 24px; }
.status-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-radius: var(--radius); background: var(--green-soft); }
.status-card.off { background: #fbe4e4; }
@media (prefers-color-scheme: dark) { .status-card.off { background: #3a1d1d; } }
.status-title { font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.25); }
.status-card.off .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(214,69,69,.25); }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.metric .num { font-size: 38px; font-weight: 800; color: var(--green); line-height: 1.1; }
.row-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-bottom: 10px;
  padding: 16px; min-height: 68px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); cursor: pointer; font-size: 22px;
}
.row-btn .grow-t { flex: 1; font-size: 17px; font-weight: 600; }
.row-btn small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.chev { color: var(--muted); width: 22px; height: 22px; flex: none; }
.row-btn > svg:first-child { width: 26px; height: 26px; color: var(--green); flex: none; }
.icon-btn svg { width: 24px; height: 24px; vertical-align: middle; }
.hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--text); font-size: 15px; }
.hint svg { flex: none; width: 20px; height: 20px; color: var(--green); margin-top: 1px; }
.tip-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tip-title svg { width: 20px; height: 20px; color: var(--green); }
.mute-list li span { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mute-list li span svg, .remove svg { width: 20px; height: 20px; color: var(--muted); }
.howto { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.howto summary { display: flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 600; color: var(--green); cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary svg { width: 20px; height: 20px; }
.howto ol { padding-left: 20px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.howto p { padding-bottom: 14px; }
.demo-toggle { margin-top: 24px; color: var(--muted); font-weight: 400; font-size: 13px; }

.group { margin-bottom: 24px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer;
}
.choice { flex: none; width: 24px; height: 24px; accent-color: var(--green); }
.switch-row small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 99px;
  background: var(--line); position: relative; transition: background .2s; cursor: pointer;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

.add-row { display: flex; gap: 8px; margin: 12px 0; }
.add-row .input { flex: 1; min-width: 0; }
.mute-list { list-style: none; padding: 0; }
.mute-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.remove { border: 0; background: none; font-size: 20px; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.remove:active { background: var(--line); }

.sticky-save { position: sticky; bottom: 0; margin: auto -20px -20px; padding: 14px 20px; background: linear-gradient(transparent, var(--bg) 30%); }

/* Tab bar */
.tabbar { display: flex; border-top: 1px solid var(--line); background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; border: 0; background: none; padding: 10px 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; }
.tab svg { width: 24px; height: 24px; stroke-width: 2; }
.tab.active { color: var(--green); }

/* Indicador de que há mais conteúdo abaixo */
.scroll-hint {
  position: absolute; left: 50%; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--green); cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.16); display: grid; place-items: center;
  animation: bob 1.6s ease-in-out infinite;
}
.scroll-hint svg { width: 22px; height: 22px; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; transform: translateX(-50%); } }

/* Toast */
/* No topo, acima de tudo: embaixo ficava escondido atrás da seta de rolagem e dos botões. */
.toast {
  position: absolute; z-index: 30; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 600; transition: all .25s;
  /* Mensagens longas quebram em linhas dentro da tela, em vez de ficarem cortadas */
  width: max-content; max-width: calc(100% - 32px); text-align: center; line-height: 1.35;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Conversas pausadas */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 8px 0; align-self: flex-start; }
.back-link svg { width: 18px; height: 18px; }
.paused-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.paused-list li { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 700; }
.p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-body .muted { font-size: 14px; }
.p-time { flex: none; font-size: 13px; color: var(--muted); }

.paused-list li { padding: 0; }
.p-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; text-decoration: none; }
.p-main:active { background: var(--green-soft); border-radius: var(--radius); }
.paused-list li { flex-wrap: wrap; }
.p-last { font-size: 14px; color: var(--text); opacity: .8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-summary { font-size: 14px; margin-top: 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.p-ad { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); min-width: 0; }
.p-ad svg { flex: none; width: 14px; height: 14px; }
.p-ad span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tag { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--green-soft); color: var(--green); vertical-align: middle; }
.p-actions { flex: 1 0 100%; display: flex; gap: 8px; padding: 0 14px 14px; }
.p-actions .btn { flex: 1; min-height: 44px; }
.p-actions .p-dismiss svg { width: 18px; height: 18px; margin-right: 6px; }
.paused-list li.is-holding .p-hold { display: none; }
.paused-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paused-head .h-sm { margin: 0; }
.more { position: relative; }
.more-menu { position: absolute; right: 0; top: 44px; z-index: 20; min-width: 200px; padding: 6px; background: var(--card, var(--bg)); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.more-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; text-align: left; border-radius: 8px; cursor: pointer; }
.more-item:active { background: var(--green-soft); }
.more-item:disabled { opacity: .4; cursor: default; }
.more-item svg { width: 20px; height: 20px; color: var(--green); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 48px 16px; }
.empty svg { width: 56px; height: 56px; color: var(--green); stroke-width: 1.5; }

.advanced { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 20px; font-size: 14px; color: var(--muted); text-align: center; }
.advanced svg { flex: none; width: 16px; height: 16px; }
.advanced a { color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Página não encontrada / admin */
.notfound { min-height: 80dvh; }
.nf-ico { width: 88px; height: 88px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 20px; }
.nf-ico svg { width: 44px; height: 44px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.link-result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.status-sub-off { color: var(--red); }

/* ── Versões: item clicável e leitura em tela cheia ───────────── */
.version-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer; color: inherit;
}
.version-item-text { flex: 1; min-width: 0; }
.version-item .chev { flex: none; }
.version-item:hover strong { color: var(--green); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; vertical-align: 1px; }
/* A prévia das pausadas só existe no desktop (no celular, é o atalho) */
.home-paused { display: none; }

.modal {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg);
  animation: in .2s ease;
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; margin: 0; font-size: 19px; text-transform: none; letter-spacing: 0; color: var(--text); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.version-text {
  margin-top: 12px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; max-width: 760px;
}
.modal-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.modal-foot .muted { margin-top: 8px; text-align: center; }

/* ── Menu lateral e conteúdo em colunas (painel no desktop) ──── */
.desk-only { display: none; }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.cols > .col { min-width: 0; }

@media (min-width: 960px) {
  body:has(.app.is-dashboard) { padding: 0; background: var(--bg); }
  .app.is-dashboard {
    max-width: none; width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; overflow: visible;
    display: grid; grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  }
  .app.is-dashboard.no-side { grid-template-columns: minmax(0, 1fr); }
  .is-dashboard .desk-only { display: flex; }
  .is-dashboard .scroll-hint { display: none; }
  .is-dashboard .back-link { display: none; }

  /* Menu lateral */
  .is-dashboard .tabbar {
    grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 28px 16px 20px; border-top: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .is-dashboard .side-logo { padding: 0 12px 24px; font-weight: 800; font-size: 28px; letter-spacing: -.02em; color: var(--green); }
  .is-dashboard .side-logo span { color: var(--text); }
  .is-dashboard .tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px;
    padding: 10px 12px; border-radius: 12px; font-size: 16px; text-align: left;
  }
  .is-dashboard .tab:hover { background: var(--bg); color: var(--text); }
  .is-dashboard .tab.active { background: var(--green-soft); color: var(--green); }
  .is-dashboard .tab .badge { margin-left: auto; }
  .is-dashboard .nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
  .is-dashboard .side-status {
    margin-top: auto; align-items: center; gap: 10px; padding: 14px; border-radius: 14px;
    background: var(--green-soft); font-size: 14px;
  }
  .is-dashboard .side-status.off { background: #fbe4e4; }
  .is-dashboard .side-status strong { display: block; font-size: 15px; }
  .is-dashboard .side-status.off .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(214,69,69,.25); }
  .is-dashboard .side-status .dot { flex: none; }

  /* Conteúdo */
  .is-dashboard main { grid-column: 2; grid-row: 1; }
  .is-dashboard.no-side main { grid-column: 1; }
  .is-dashboard .screen { width: 100%; max-width: 1160px; margin: 0 auto; padding: 36px 48px 72px; }
  .is-dashboard h1.h-sm, .is-dashboard .screen > h1 { font-size: 30px; }
  .is-dashboard .screen > .lead { max-width: 760px; }

  .is-dashboard .cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .is-dashboard .cols > .col > .group:last-child { margin-bottom: 0; }

  /* Faixa de rascunho em linha */
  .is-dashboard .draft-bar {
    position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px;
    max-width: 1064px; width: calc(100% - 96px); margin: 24px auto -12px;
  }
  .is-dashboard .draft-bar > strong, .is-dashboard .draft-bar > .muted { grid-column: 1; }
  .is-dashboard .draft-bar .draft-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }

  /* Início: status e métricas em três colunas; pausadas + atalhos abaixo */
  .is-dashboard [data-screen="home"]:not([hidden]) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-content: start; }
  .is-dashboard [data-screen="home"] > .hint, .is-dashboard [data-screen="home"] > .home-cols { grid-column: 1 / -1; }
  .is-dashboard [data-screen="home"] .metrics { display: contents; }
  .is-dashboard [data-screen="home"] .metric { margin: 0; display: flex; flex-direction: column; justify-content: center; }
  .is-dashboard .status-card { height: 100%; }
  .is-dashboard .home-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; margin-top: 12px; }
  .is-dashboard .home-paused { display: block; }
  .is-dashboard .home-cols:has(#home-paused[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .is-dashboard .shortcuts .row-btn:first-of-type { display: none; } /* "Ver conversas pausadas" já está no menu */

  /* Pausadas, teste e Inteligência aproveitam a largura */
  .is-dashboard [data-screen="paused"] .paused-list, .is-dashboard [data-screen="paused"] .paused-head { max-width: 760px; }
  .is-dashboard .area { min-height: 320px; }
  .is-dashboard .sticky-save { position: static; margin: 16px 0 0; padding: 0; background: none; }
  .is-dashboard .sticky-save .btn { width: auto; min-width: 220px; }
  .is-dashboard .footer { margin-top: 24px; padding-top: 0; }
  .is-dashboard .footer .btn { max-width: 420px; }
  .is-dashboard #test-wait { padding: 20px; }

  /* Teste: conversa (com os passos embaixo) e instruções ocupando o resto da largura */
  .is-dashboard [data-screen="test"].screen { max-width: none; padding: 20px 24px 16px; }
  .is-dashboard [data-screen="test"] > h1 { display: inline; font-size: 26px; margin-right: 14px; }
  .is-dashboard [data-screen="test"] > .lead { display: inline; margin: 0; }
  .is-dashboard #test-live {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: stretch;
    height: calc(100dvh - 200px); min-height: 520px; margin-top: 14px;
  }
  .is-dashboard #test-live .col-chat {
    display: flex; flex-direction: column; min-height: 0;
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card);
  }
  .is-dashboard #test-live .chat-panel { flex: 1; display: flex; flex-direction: column; margin: 0; min-height: 0; border: 0; border-radius: 0; }
  .is-dashboard .chat-body { flex: 1; min-height: 0; max-height: none; }
  .is-dashboard .test-steps { padding: 12px 16px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
  .is-dashboard .test-steps .checklist { flex: 1 1 100%; margin: 0; gap: 4px; }
  .is-dashboard .test-steps .checklist li { background: none; padding: 2px 0; font-size: 14.5px; gap: 8px; }
  .is-dashboard .test-steps .checklist li.optional { font-size: 13.5px; }
  .is-dashboard .test-steps .checklist svg { width: 18px; height: 18px; }
  .is-dashboard .test-steps .btn { flex: 1 1 100%; width: auto; min-height: 40px; padding: 0 10px; font-size: 14.5px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .is-dashboard .test-steps .link { flex: 1 1 100%; padding: 6px 0 0; }
  .is-dashboard #test-live .col-side { display: flex; flex-direction: column; min-height: 0; }
  .is-dashboard #versions-box { flex: none; margin-top: 12px; }
  .is-dashboard .version-list { max-height: 220px; overflow-y: auto; }
  .is-dashboard #test-tune { display: none; }

  .is-dashboard #doc {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
    border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden;
  }
  .doc-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .doc-head h2 { font-size: 17px; white-space: nowrap; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; }
  .doc-head .spacer, .doc-foot .spacer { flex: 1; }
  .doc-head .btn { gap: 8px; display: inline-flex; align-items: center; white-space: nowrap; }
  .chip { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
  .chip.draft { background: #fff1d6; color: #b26a00; }
  @media (prefers-color-scheme: dark) { .chip.draft { background: #3a2b0f; color: #f0b04a; } }
  .doc-search { position: relative; }
  .doc-search input { height: 40px; width: 180px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); font-size: 15px; }
  .doc-search small { position: absolute; right: 10px; top: 11px; font-size: 12px; color: var(--muted); pointer-events: none; }
  .doc-main { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
  .doc-main.no-toc { grid-template-columns: minmax(0, 1fr); }
  .doc-main.no-toc .doc-toc { display: none; }
  .doc-toc { border-right: 1px solid var(--line); padding: 14px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .doc-toc-title { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 6px; }
  .doc-toc button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); line-height: 1.25; }
  .doc-toc button:hover { background: var(--bg); color: var(--text); }
  .doc-toc button.on { background: var(--green-soft); color: var(--green); font-weight: 600; }
  .doc-toc select { display: none; }
  .doc-scroll { position: relative; overflow-y: auto; padding: 22px 40px 48px; scroll-behavior: smooth; }
  .doc-prose { max-width: 92ch; font-size: 16.5px; line-height: 1.65; }
  .doc-prose h3 { font-size: 17px; margin: 26px 0 8px; scroll-margin-top: 12px; }
  .doc-prose h3:first-child { margin-top: 0; }
  .doc-prose .sub { font-weight: 700; margin: 16px 0 4px; }
  .doc-prose .li { padding-left: 20px; position: relative; margin: 3px 0; }
  .doc-prose .li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
  .doc-prose .ex { margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 8px 8px 0; font-size: 15.5px; }
  .doc-prose p { margin: 6px 0; overflow-wrap: anywhere; }
  .doc-prose .gap { height: 8px; }
  .doc-prose mark { background: #ffe58a; color: #1c2321; border-radius: 3px; padding: 0 1px; }
  .doc-prose mark.cur { outline: 2px solid var(--green); }
  .doc-editor { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; resize: none; padding: 22px 40px; background: var(--card); font-size: 16.5px; line-height: 1.65; }
  .doc-editor:focus { outline: none; }
  .doc-main:has(.doc-editor:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .doc-main:has(.doc-editor:not([hidden])) .doc-toc { display: none; }
  .doc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); }
  .doc-foot small { color: var(--muted); flex: 1 1 220px; }
  .doc-foot .spacer { display: none; }
  .doc-foot .btn { white-space: nowrap; }
  .doc-foot .btn { width: auto; }

  /* Menos largo: o índice vira um seletor "Ir para…" */
  @media (max-width: 1199px) {
    .doc-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .doc-main.no-toc { grid-template-rows: minmax(0, 1fr); }
    .doc-toc { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
    .doc-toc-title, .doc-toc button { display: none; }
    .doc-toc select { display: block; width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--bg); }
  }

  /* Modal: dentro da área de conteúdo, ao lado do menu */
  .is-dashboard .modal { position: fixed; }
  .modal-body { padding: 28px 48px; }
  .modal-foot { display: flex; align-items: center; gap: 16px; padding: 16px 48px; }
  .modal-foot .btn { width: auto; min-width: 240px; }
  .modal-foot .muted { margin: 0; text-align: left; }
}

/* No celular, "pausadas" é uma subtela do Início */
@media (max-width: 959px) {
  .tab.parent { color: var(--green); }
  /* Empilhado, fica abaixo do "Salvar rascunho" (que é sticky e sobrepõe a margem) */
  #versions-box { margin-top: 22px; }
  #test-tune > :not(summary) { display: none; }
}

/* ── Teste grátis (/experimentar) ─────────────────────────────────── */
.trial-bar { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; padding: 8px 12px; }
.trial-bar svg { width: 16px; height: 16px; }
.trial .icon-btn { display: inline-grid; place-items: center; color: inherit; text-decoration: none; }
.promise { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 22px; padding: 0; }
.promise li { list-style: none; display: flex; gap: 12px; align-items: flex-start; }
.promise svg { flex: none; width: 24px; height: 24px; color: var(--green); margin-top: 1px; }
.promise strong { display: block; }
.trial-form { display: flex; flex-direction: column; flex: 1; }
.trial .q { margin-bottom: 16px; }
.trial .q .label { margin-bottom: 6px; font-size: 15px; }
.trial .q .area { min-height: 120px; }
.trial .count { font-size: 13px; color: var(--muted); margin-top: 6px; }
.trial .count.bad { color: var(--red); }
.trial .error { color: var(--red); font-size: 15px; margin-top: 10px; }
.trial .fine { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 12px; }
.trial .fine a, .trial .left a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.trial .left { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.test-code { margin: 8px 0 14px; padding: 22px 12px; text-align: center; border-radius: 20px; background: var(--green-soft); color: var(--green); border: 2px dashed var(--green); font-size: 38px; font-weight: 800; letter-spacing: .03em; }
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.checks .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.checks .ic svg { width: 16px; height: 16px; opacity: 0; color: #fff; }
.checks li.done { color: var(--text); border-color: var(--green); background: var(--green-soft); }
.checks li.done .ic { background: var(--green); border-color: var(--green); }
.checks li.done .ic svg { opacity: 1; }
.checks li.wait .ic { border-color: var(--green); border-top-color: transparent; animation: trial-spin 1s linear infinite; }
@keyframes trial-spin { to { transform: rotate(360deg); } }
.benefits { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; margin: 4px 0 0; }
.benefits li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; font-size: 18px; line-height: 1.3; }
.benefits svg { flex: none; width: 24px; height: 24px; color: var(--green); margin-top: 1px; }
.divider { height: 1px; background: var(--line); margin: 20px 0 16px; }
.extras { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 16px; }
.extras li { display: flex; gap: 10px; align-items: center; }
.extras svg { flex: none; width: 20px; height: 20px; color: var(--green); }
.trial .price { font-size: 44px; font-weight: 800; color: var(--green); line-height: 1.1; margin: 14px 0 4px; }
.trial .price small { font-size: 17px; font-weight: 600; color: var(--muted); }
.expired-art { width: 84px; height: 84px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 40px auto 18px; }
.expired-art svg { width: 40px; height: 40px; }
.trial a.btn { display: grid; place-items: center; text-decoration: none; }

/* Teste grátis: ordem em destaque, caixa grande de melhoria, compra segura */
.trial .area.tall { min-height: 300px; }
.trial .todo { display: flex; gap: 14px; align-items: flex-start; margin: 14px 0; padding: 18px 16px; border-radius: 18px; background: var(--green-soft); border: 2px solid var(--green); font-size: 18px; line-height: 1.4; animation: todo-pulse 2s ease-in-out 3; }
.trial .todo-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; display: grid; place-items: center; }
.trial .todo-sub { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
@keyframes todo-pulse { 50% { box-shadow: 0 0 0 6px var(--green-soft); } }
.trial .fine.secure { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.trial .fine.secure svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* Botão final: brilho que circula pela borda */
@property --glow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn.glow { position: relative; isolation: isolate; }
.btn.glow::before {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 18px;
  background: conic-gradient(from var(--glow-angle), transparent 0 45%, #34d399 70%, #fff 88%, #34d399 94%, transparent 100%);
  animation: glow-spin 2.4s linear infinite;
}
.btn.glow::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 14px; background: var(--green); }
@keyframes glow-spin { to { --glow-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .btn.glow::before { animation: none; } }
