/* Inova Comenta, painel. Azul-marinho Inova + laranja de destaque. */
:root {
  --navy: #004e7a;
  --navy-2: #00385a;
  --navy-ink: #06263d;
  --orange: #ff7400;
  --orange-soft: #fff1e5;
  --paper: #eef3f6;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --ink: #102230;
  --ink-2: #3d5566;
  --muted: #6a7f8e;
  --line: #d9e3ea;
  --line-2: #e8eef2;
  --ok: #17845a;
  --ok-soft: #e3f4ec;
  --warn: #a75f00;
  --warn-soft: #fff2de;
  --bad: #c2383d;
  --bad-soft: #fde8e8;
  --info: #004e7a;
  --info-soft: #e2f0f8;
  --bubble-in: #e9eef2;
  --bubble-out: #004e7a;
  --focus: 0 0 0 3px rgba(255, 116, 0, .45);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1822;
    --surface: #10222f;
    --surface-2: #142a39;
    --ink: #e4edf3;
    --ink-2: #b4c5d1;
    --muted: #8198a8;
    --line: #22394a;
    --line-2: #1b3242;
    --ok-soft: #10382a;
    --warn-soft: #3a2a10;
    --bad-soft: #3d1a1d;
    --info-soft: #0f3149;
    --orange-soft: #3b2412;
    --bubble-in: #1d3444;
    --bubble-out: #0a6aa3;
    --info: #6cbde8;
    --ok: #4fcf95;
    --warn: #f0a94a;
    --bad: #f07a7e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.2; margin: 0; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; }
a { color: var(--navy); }
@media (prefers-color-scheme: dark) { a { color: #7cc6ee; } }
p { margin: 0; }
img, video { max-width: 100%; display: block; }
code { font-size: .86em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; border: 1px solid var(--line-2); word-break: break-all; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small, .fine { font-size: .85rem; }
.fine { color: var(--muted); text-align: center; margin-top: 24px; }
.t-bad { color: var(--bad); }
.pad { padding: 16px 18px; }
.mt { margin-top: 22px; }
.stack { display: grid; gap: 14px; }
.inline { display: inline; }
.ic { flex: none; }
[hidden] { display: none !important; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100dvh; }
.rail { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.page-title { font-size: 1.5rem; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; }
.content { padding: 4px 16px 24px; max-width: 980px; margin: 0 auto; }
.content.is-wide { max-width: 1240px; }
.is-bare .content { padding: 0; max-width: none; }

.mob-acc { margin: 0 16px 10px; }
.acc { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem; max-width: 100%; }
.acc select { border: 0; background: transparent; font: inherit; color: inherit; padding: 2px 4px; max-width: 200px; }
.acc-pic { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--orange); }
.acc-pic img { width: 100%; height: 100%; object-fit: cover; }
.acc-pic.lg { width: 48px; height: 48px; font-size: 1.1rem; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 9px 2px 8px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; position: relative; }
.tab.is-on { color: var(--navy); }
.tab.is-on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange); }
@media (prefers-color-scheme: dark) { .tab.is-on { color: #7cc6ee; } }
.tab .dot { position: absolute; top: 8px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: var(--orange); border: 2px solid var(--surface); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--navy-ink); color: #cfe0ec; padding: 18px 12px; gap: 14px; }
  .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 2px 8px 6px; }
  .brand-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
  .brand-mark svg rect { fill: #0a6aa3; }
  .rail-acc { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #fff; }
  .rail-acc select option { color: #102230; }
  .rail-acc .acc-pic { box-shadow: 0 0 0 2px var(--navy-ink), 0 0 0 3.5px var(--orange); }
  .rail-nav { display: grid; gap: 2px; flex: 1; align-content: start; overflow-y: auto; }
  .rail-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #b9cfdf; text-decoration: none; font-weight: 600; font: 600 .95rem var(--font); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
  .rail-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .rail-link.is-on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
  .rail-link .count { margin-left: auto; background: var(--orange); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 999px; }
  .rail-sep { font-size: .75rem; color: #7f9bb0; padding: 14px 12px 4px; font-weight: 600; }
  .rail-foot { display: grid; gap: 2px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
  .rail-user { display: flex; gap: 10px; align-items: center; padding: 8px; color: #fff; text-decoration: none; border-radius: 10px; }
  .rail-user:hover { background: rgba(255, 255, 255, .06); }
  .rail-user small { display: block; color: #8fa9bb; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .main { padding-bottom: 24px; }
  .mob-acc, .tabbar { display: none; }
  .topbar { padding: 22px 32px 12px; }
  .page-title { font-size: 1.8rem; }
  .content { padding: 4px 32px 40px; margin: 0; }
}

/* ---------- Botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent; background: var(--navy); color: #fff; font: 700 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-link { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 4px 0; color: var(--navy); font: 700 .9rem var(--font); cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn-link { color: #7cc6ee; } .btn { background: #0a6aa3; } .btn:hover { background: #0c78b8; } .btn-ghost { background: var(--surface-2); } }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--line-2); }
.icon-btn.flip .ic { transform: scaleX(-1); }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.field small { color: var(--muted); font-size: .8rem; }
.field-sm { max-width: 260px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: 400 1rem var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
input:disabled { opacity: .6; }
.hint { color: var(--muted); font-size: .85rem; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }

.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; margin-top: 1px; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--ok); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { box-shadow: var(--focus); }
.toggle-text b { display: block; font-weight: 600; }
.toggle-text small { color: var(--muted); font-size: .84rem; }
.toggle-sm .toggle-ui { width: 40px; height: 24px; }
.toggle-sm .toggle-ui::after { width: 18px; height: 18px; }
.toggle-sm input:checked + .toggle-ui::after { transform: translateX(16px); }

.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--navy); }
.check.is-dis { opacity: .5; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(6, 38, 61, .12), inset 0 -2px 0 var(--orange); }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg-sm span { font-size: .84rem; padding: 6px 11px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font: 600 .84rem var(--font); cursor: pointer; }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-muted { background: var(--line-2); color: var(--muted); }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 16px 12px; font-weight: 500; border-left: 4px solid; }
.content .flash { margin: 0 0 14px; }
@media (min-width: 960px) { .flash { margin: 0 32px 12px; } }
.flash-ok { background: var(--ok-soft); border-color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn); }
.flash-bad { background: var(--bad-soft); border-color: var(--bad); }
.flash-x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .6; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--info-soft); color: var(--navy); display: inline-grid; place-items: center; font-weight: 800; flex: none; font-family: var(--display); }
@media (prefers-color-scheme: dark) { .avatar { color: #9fd3f0; } }
.avatar.sm { width: 34px; height: 34px; font-size: .85rem; }
.avatar.xs { width: 24px; height: 24px; font-size: .7rem; }
.avatar.brand { background: var(--navy); color: #fff; }

/* ---------- Painéis e listas ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line-2); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line-2); }
.row-link, .row-static { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: inherit; text-decoration: none; }
.row-link:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: grid; }
.row-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: grid; justify-items: end; gap: 2px; }
.row-end small { color: var(--muted); font-size: .78rem; }
.thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--line-2); display: grid; place-items: center; color: var(--muted); flex: none; position: relative; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 64px; height: 64px; }
.thumb em { position: absolute; right: 4px; top: 4px; background: rgba(6, 38, 61, .8); color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; padding: 0 5px; border-radius: 5px; }
.grid-2 { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2.align-start { align-items: start; } }

.empty { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 12px; max-width: 460px; margin: 20px auto; }
.empty h2 { font-size: 1.35rem; }
.empty p { color: var(--ink-2); }
.empty-ic { width: 72px; height: 72px; border-radius: 22px; background: var(--orange-soft); color: var(--orange); display: grid; place-items: center; }
.empty-sm { padding: 26px 16px; margin: 0; }

/* ---------- Início: funil ---------- */
.funnel { background: var(--navy); color: #fff; border-radius: 22px; padding: 20px 20px 18px; position: relative; overflow: hidden; }
.funnel::after { content: ""; position: absolute; right: -56px; top: -86px; width: 150px; height: 150px; border-radius: 50%; border: 20px solid var(--orange); }
.funnel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; position: relative; z-index: 1; }
.funnel-head .muted { color: #a9c8dc; font-size: .88rem; }
.funnel-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; position: relative; z-index: 1; }
.funnel-steps li { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.funnel-steps b { font-family: var(--display); font-weight: 800; font-size: 1.7rem; min-width: 84px; font-variant-numeric: tabular-nums; }
.funnel-steps span { color: #cfe2ee; }
.funnel-steps .is-goal b { color: var(--orange); }
.funnel-foot { margin-top: 12px; color: #cfe2ee; font-size: .9rem; position: relative; z-index: 1; }
.funnel-foot b { color: #fff; }
@media (min-width: 760px) {
  .funnel { padding: 26px 28px 22px; }
  .funnel-steps { grid-template-columns: repeat(5, 1fr); margin-top: 22px; }
  .funnel-steps li { display: grid; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .14); padding: 0 16px; gap: 2px; }
  .funnel-steps li:first-child { border-left: 0; padding-left: 0; }
  .funnel-steps b { font-size: 2.3rem; }
  .funnel-steps span { font-size: .88rem; }
}

/* ---------- Automações ---------- */
.auto-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auto { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 8px; border-left: 4px solid var(--ok); }
.auto.is-off { border-left-color: var(--line); }
.auto.is-off .auto-name { color: var(--muted); }
.auto-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.auto-name { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.auto-name:hover { text-decoration: underline; }
.auto-rule { color: var(--ink-2); font-size: .92rem; }
.kw { display: inline-block; background: var(--orange-soft); color: #b55200; border-radius: 6px; padding: 0 7px; font-weight: 700; font-size: .86rem; margin: 0 1px; }
@media (prefers-color-scheme: dark) { .kw { color: #ffb070; } }
.auto-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--muted); }
.auto-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.auto-rate { position: relative; padding-left: 0; }
.auto-rate b { color: var(--ok); }

.mini-funnel { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; color: var(--muted); }
.mini-funnel b { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }
.mini-funnel .is-goal b { color: var(--orange); }

/* ---------- Editor com prévia ---------- */
.editor { display: grid; gap: 20px; }
@media (min-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.editor-form { display: grid; gap: 14px; }
.sect { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); margin: 0; padding: 0; min-width: 0; }
fieldset.sect { border: 1px solid var(--line-2); }
.sect-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px 0; }
.sect-head p { color: var(--muted); font-size: .88rem; }
.step { flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--navy); color: #fff; display: grid; place-items: center; font: 800 .9rem var(--display); }
.sect-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.sub { font-size: .95rem; color: var(--ink-2); margin-top: 4px; }

.vars { display: grid; gap: 8px; }
.var-row { display: grid; grid-template-columns: 22px 1fr 34px; gap: 6px; align-items: start; }
.var-n { font: 700 .78rem var(--display); color: var(--muted); padding-top: 12px; text-align: center; }
.var-row .icon-btn { width: 34px; height: 34px; margin-top: 5px; }
.var-row:only-of-type .var-del { visibility: hidden; }

.btn-rows { display: grid; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr; gap: 6px; background: var(--surface-2); padding: 8px; border-radius: 12px; position: relative; }
.btn-row .icon-btn { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; }
.btn-row input:first-child { padding-right: 44px; }
@media (min-width: 560px) { .btn-row { grid-template-columns: 180px 1fr 36px; align-items: center; } .btn-row .icon-btn { position: static; } .btn-row input:first-child { padding-right: 12px; } }
.upload-inline { display: flex; gap: 8px; align-items: center; }
.upload-inline .btn { flex: none; }

.media-pick { display: grid; gap: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.media-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 0; padding: 0; cursor: pointer; background: var(--line-2); }
.media-item img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.media-item .mi-type { position: absolute; left: 6px; bottom: 6px; background: rgba(6, 38, 61, .75); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.media-item .mi-check { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); display: grid; place-items: center; color: #fff; }
.media-item.is-sel { box-shadow: 0 0 0 3px var(--orange); }
.media-item.is-sel .mi-check { background: var(--orange); border-color: var(--orange); }
.media-item:not(.is-sel) .mi-check .ic { opacity: 0; }

.savebar { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 10; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(6, 38, 61, .12); }
@media (min-width: 960px) { .savebar { bottom: 14px; } }

.preview { display: none; }
.preview.is-open { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(6, 38, 61, .55); padding: 16px; overflow-y: auto; }
.preview.is-open .phone { margin: 0 auto; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; color: #fff; max-width: 340px; margin: 0 auto 10px; }
.preview-bar .icon-btn { color: #fff; }
@media (min-width: 1100px) {
  .preview, .preview.is-open { display: block; position: sticky; top: 90px; inset: auto; background: none; padding: 0; z-index: 1; }
  .preview-bar { color: var(--ink-2); max-width: none; }
  .preview-close, .preview-open { display: none !important; }
}
.phone { max-width: 340px; background: var(--surface); border-radius: 34px; border: 8px solid #0b2231; overflow: hidden; box-shadow: 0 24px 48px rgba(6, 38, 61, .22); }
.phone-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.phone-body { padding: 12px; display: grid; gap: 8px; max-height: 620px; overflow-y: auto; background: var(--surface); }
.pv-post { display: grid; gap: 8px; padding-bottom: 6px; }
.pv-comment { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; }
.pv-comment p { line-height: 1.35; }
.pv-reply { margin-left: 30px; }
.pv-divider, .pv-note { text-align: center; color: var(--muted); font-size: .74rem; padding: 4px 0; }
.pv-divider { border-top: 1px solid var(--line-2); padding-top: 10px; }
.bub { max-width: 84%; padding: 9px 12px; border-radius: 18px; font-size: .88rem; line-height: 1.38; white-space: pre-wrap; word-wrap: break-word; }
.bub-in { background: var(--bubble-in); justify-self: start; border-bottom-left-radius: 6px; }
.bub-out { background: var(--bubble-out); color: #fff; justify-self: end; border-bottom-right-radius: 6px; }
.bub-tap { font-weight: 600; }
.bub-btn { display: block; margin: 9px -12px -9px; padding: 9px 12px; border-top: 1px solid rgba(255, 255, 255, .22); text-align: center; font-weight: 700; }
.bub-btn:empty { display: none; }
.bub-btn + .bub-btn { margin-top: 9px; }
.bub-ok { background: var(--ok); }
.bub img { border-radius: 12px; margin: -3px -6px 8px; max-width: calc(100% + 12px); }
.pv-media { aspect-ratio: 1; background: var(--line-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; }
.pv-media.is-story { aspect-ratio: 9 / 16; }
.pv-media.is-reels { aspect-ratio: 9 / 16; }
.pv-media .pv-count { position: absolute; right: 10px; top: 10px; background: rgba(6, 38, 61, .75); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.pv-caption { padding: 10px 14px 16px; font-size: .88rem; white-space: pre-wrap; word-wrap: break-word; max-height: 220px; overflow: hidden; }

/* ---------- Agenda ---------- */
.agenda { display: grid; gap: 18px; }
@media (min-width: 1000px) { .agenda { grid-template-columns: 400px 1fr; align-items: start; } .cal { position: sticky; top: 90px; } }
.cal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; border-radius: 11px; display: grid; align-content: center; justify-items: center; gap: 3px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; border: 1.5px solid transparent; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.has { background: var(--surface-2); }
.cal-day.is-today { border-color: var(--orange); }
.cal-day.is-sel { background: var(--navy); color: #fff; }
.cal-dots { display: flex; gap: 2px; }
.cal-dots i, .cal-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.d-scheduled, .d-processing { background: var(--navy); }
.cal-day.is-sel .d-scheduled { background: #fff; }
.d-published { background: var(--ok); }
.d-pending_approval { background: var(--orange); }
.d-draft { background: var(--muted); }
.d-failed { background: var(--bad); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.cal-legend i { margin-right: 5px; }
.list-title { margin-bottom: 10px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; text-decoration: none; color: inherit; }
.post-row:hover { border-color: var(--line); }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.dropzone { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.dz-items { display: contents; }
.dz-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line-2); }
.dz-item img, .dz-item video { width: 100%; height: 100%; object-fit: cover; }
.dz-item .dz-tools { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; }
.dz-item .icon-btn { width: 28px; height: 28px; background: rgba(6, 38, 61, .75); color: #fff; border-radius: 8px; }
.dz-item .dz-n { position: absolute; left: 6px; top: 6px; background: var(--orange); color: #fff; font: 800 .72rem var(--display); width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; }
.dz-item.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: shimmer 1.1s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.dz-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .85rem; text-align: center; padding: 6px; }
.dz-add:hover, .dropzone.is-over .dz-add { border-color: var(--orange); color: var(--orange); }

/* ---------- Atendimento ---------- */
.inbox { display: grid; height: calc(100dvh - 118px - var(--tabbar-h) - env(safe-area-inset-bottom)); }
.inbox-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-top: 1px solid var(--line-2); }
.inbox-tools { padding: 10px 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line-2); }
.chips-tight .chip { padding: 5px 10px; }
.threads { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.thread-item { display: flex; gap: 11px; align-items: center; padding: 11px 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font: inherit; color: inherit; border-bottom: 1px solid var(--line-2); }
.thread-item:hover, .thread-item.is-on { background: var(--surface-2); }
.thread-item.is-on { box-shadow: inset 3px 0 0 var(--orange); }
.thread-item .row-main b { font-weight: 700; }
.thread-item.is-unread .row-main small { color: var(--ink); font-weight: 600; }
.thread-item .unread { background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.inbox-thread { display: none; flex-direction: column; min-height: 0; background: var(--paper); }
.inbox.show-thread .inbox-list { display: none; }
.inbox.show-thread .inbox-thread { display: flex; }
.thread-empty { margin: auto; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; padding: 20px; max-width: 280px; }
.th-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.th-head .row-main small { white-space: nowrap; }
.th-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; display: grid; gap: 2px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; justify-items: end; }
.msg .bub { max-width: 100%; }
.msg-meta { font-size: .7rem; color: var(--muted); padding: 0 6px; }
.msg.out.o-bot .bub { background: var(--orange-soft); color: var(--ink); border: 1px solid rgba(255, 116, 0, .35); }
.msg.out.o-app .bub { background: var(--navy-2); }
.th-compose { display: flex; gap: 8px; padding: 10px 12px calc(10px); background: var(--surface); border-top: 1px solid var(--line-2); align-items: flex-end; }
.th-compose textarea { min-height: 44px; max-height: 140px; resize: none; }
.th-compose .btn { width: 46px; padding: 0; flex: none; }
.th-closed { padding: 12px 14px; background: var(--warn-soft); font-size: .88rem; border-top: 1px solid var(--line-2); }
.win { font-size: .74rem; font-weight: 700; }
@media (min-width: 960px) {
  .inbox { grid-template-columns: 340px 1fr; height: calc(100dvh - 86px); border-top: 1px solid var(--line-2); }
  .inbox-list { border-top: 0; border-right: 1px solid var(--line-2); }
  .inbox-thread, .inbox.show-thread .inbox-list { display: flex; }
  .th-back { display: none !important; }
}

/* ---------- Contatos, contas, menu ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.filters input[type=search] { grid-column: 1 / -1; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1.4fr auto; } .filters input[type=search] { grid-column: auto; } }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.acc-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.acc-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 12px; }
.acc-card.is-off { opacity: .75; }
.acc-card-top { display: flex; gap: 12px; align-items: center; }
.acc-card-top > div { flex: 1; display: grid; }
.acc-card-top small { color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.acc-form { display: grid; gap: 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-list { display: grid; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line-2); overflow: hidden; }
.menu-list form { margin: 0; }
.menu-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; color: var(--ink); text-decoration: none; font: 600 1rem var(--font); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.menu-list > :last-child .menu-row, .menu-list > .menu-row:last-child { border-bottom: 0; }
.menu-row:hover { background: var(--surface-2); }
.menu-user small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.perm-group { border: 0; padding: 0; margin: 0; }
.perm-group legend { font: 700 .92rem var(--display); padding: 6px 0 2px; color: var(--ink-2); }
.form-narrow { max-width: 640px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.copy-field span { grid-column: 1 / -1; font-size: .8rem; font-weight: 700; color: var(--muted); }
.copy-field code { background: none; border: 0; padding: 0; font-size: .86rem; }

/* ---------- Login e instalação ---------- */
.auth-body { background: var(--paper); }
.auth { min-height: 100dvh; display: grid; }
.auth-art { display: none; }
.auth-form { display: grid; align-content: center; gap: 18px; padding: 32px 22px; width: 100%; max-width: 420px; margin: 0 auto; }
.auth-form h1 { font-size: 2.2rem; font-weight: 800; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 800 1.2rem var(--display); }
.auth-brand svg { width: 36px; height: 36px; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth-art { display: grid; align-content: center; justify-items: center; gap: 26px; background: var(--navy); padding: 48px; position: relative; overflow: hidden; }
  .auth-art::before { content: ""; position: absolute; box-sizing: border-box; width: 340px; height: 340px; border-radius: 50%; border: 48px solid var(--orange); right: -170px; bottom: -170px; }
  .auth-thread { display: grid; gap: 10px; width: min(380px, 100%); position: relative; }
  .auth-thread .bub { font-size: .98rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
  .auth-thread .bub-in { background: #fff; color: var(--ink); }
  .auth-thread .bub-out { background: #0a6aa3; }
  .auth-thread .bub-ok { background: var(--ok); }
  .auth-thread .bub:nth-child(1) { animation: pop .5s .1s both; }
  .auth-thread .bub:nth-child(2) { animation: pop .5s .6s both; }
  .auth-thread .bub:nth-child(3) { animation: pop .5s 1.1s both; }
  .auth-thread .bub:nth-child(4) { animation: pop .5s 1.6s both; }
  .auth-tag { color: #fff; font: 800 1.9rem/1.15 var(--display); text-align: center; max-width: 380px; position: relative; }
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.install { max-width: 620px; margin: 0 auto; padding: 32px 18px 60px; display: grid; gap: 16px; }
.install h1 { font-size: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ajustes finos */
.media-grid > p { grid-column: 1 / -1; }
@media (max-width: 559px) {
  .savebar { flex-wrap: nowrap; padding: 8px; gap: 6px; }
  .savebar .btn { padding: 0 12px; font-size: .9rem; min-width: 0; }
  .savebar .btn:first-child { flex: 1; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 0 11px; }
}
form[inert] .dz-add, form[inert] .dz-tools, form[inert] .var-add, form[inert] .var-del, form[inert] #btnAdd, form[inert] .btn-row-del { display: none !important; }
