/* Layout: app de duas telas (Inbox e Funil). Inbox em três painéis no desktop, um painel por vez no celular. */
:root {
  --bg: #EEF1F4;
  --surface: #FFFFFF;
  --surface-2: #F5F7F9;
  --head: #D9E3F2;
  --ink: #14202B;
  --muted: #586774;
  --line: #DCE2E8;
  --accent: #2255D4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EBFB;
  --good: #1B7F4B;
  --good-soft: #DDF3E6;
  --bad: #B3261E;
  --tg0-bg: #E3EBFB; --tg0-ink: #1D45B0; --tg1-bg: #DDF3E6; --tg1-ink: #17683D;
  --tg2-bg: #FBE8D6; --tg2-ink: #8A4B06; --tg3-bg: #F6E1EE; --tg3-ink: #8E2A66;
  --ai-bg: #EDE7FA;
  --ai-ink: #3F2A86;
  --ch-wa: #178A45;
  --ch-ig: #B02A78;
  --ch-ms: #0A66D6;
  --ch-em: #5B6674;
  --ch-sms: #A86100;
  --ch-tt: #0E7C86;
  --f-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F161C; --surface: #17212A; --surface-2: #1C2832; --head: #25384C; --ink: #E7EDF2; --muted: #9DAEBB; --line: #2A3845;
    --accent: #6D95FF; --accent-ink: #0B1220; --accent-soft: #1E2D4D; --good: #5AD08F; --good-soft: #17372A; --bad: #FF8A80;
    --tg0-bg: #1E2D4D; --tg0-ink: #9DB8FF; --tg1-bg: #17372A; --tg1-ink: #7FE0A8;
    --tg2-bg: #3D2A12; --tg2-ink: #F2C07A; --tg3-bg: #3C1F31; --tg3-ink: #F2A9D1;
    --ai-bg: #2A2347; --ai-ink: #CBBBFF; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F161C; --surface: #17212A; --surface-2: #1C2832; --head: #25384C; --ink: #E7EDF2; --muted: #9DAEBB; --line: #2A3845;
  --accent: #6D95FF; --accent-ink: #0B1220; --accent-soft: #1E2D4D; --good: #5AD08F; --good-soft: #17372A; --bad: #FF8A80;
    --tg0-bg: #1E2D4D; --tg0-ink: #9DB8FF; --tg1-bg: #17372A; --tg1-ink: #7FE0A8;
    --tg2-bg: #3D2A12; --tg2-ink: #F2C07A; --tg3-bg: #3C1F31; --tg3-ink: #F2A9D1;
  --ai-bg: #2A2347; --ai-ink: #CBBBFF; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font: 700 18px/1 var(--f-display); margin: 0; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.count { min-width: 20px; padding: 0 6px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.tab[aria-selected="true"] .count { background: var(--accent-ink); color: var(--accent); }
.sample { margin-left: auto; font-size: 12px; color: var(--muted); }

main { flex: 1; min-height: 0; }

/* Inbox */
#inbox { height: 100%; display: grid; grid-template-columns: 330px minmax(0, 1fr) 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-list { border-right: 1px solid var(--line); }
.pane-details { border-left: 1px solid var(--line); }
.pane-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.list { flex: 1; overflow-y: auto; min-height: 0; }
.conv { width: 100%; text-align: left; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; min-height: 68px; }
.conv:hover { background: var(--surface-2); }
.conv[aria-current="true"] { background: var(--accent-soft); }
.avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: 0 0 auto; }
.row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.preview { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row2 .preview { flex: 1; min-width: 0; }
.tops { display: flex; gap: 4px; flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.toppill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.stg-chip { --tbg: var(--surface-2); --tink: var(--ink); border: 1px solid var(--line); }
.chn { display: inline-flex; flex: 0 0 auto; }
.cfg-show { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 4px; font-size: 13px; }
.cfg-show label { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.row3 { flex-wrap: wrap; display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.row3 .acc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.unread { margin-left: auto; flex: 0 0 auto; }
.badge { width: 18px; height: 18px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tag-ai { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--ai-bg); color: var(--ai-ink); font-weight: 600; flex: 0 0 auto; }
.empty { padding: 24px 16px; color: var(--muted); text-align: center; }

.chat-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head .sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.icon { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.btn-sm { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 500; }
.switch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 5px; font-size: 13px; font-weight: 600; }
.switch .track { width: 30px; height: 18px; border-radius: 9px; background: var(--line); position: relative; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); }
.switch[aria-checked="true"] .track { background: var(--accent); }
.switch[aria-checked="true"] .track::after { left: 14px; }
.switch[aria-checked="true"] { color: var(--ai-ink); border-color: var(--ai-ink); }

.msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.msg { white-space: pre-line; max-width: min(78%, 460px); padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.msg.ai { align-self: flex-end; background: var(--ai-bg); color: var(--ai-ink); border-color: transparent; }
.msg .meta { display: block; font-size: 11px; opacity: 0.75; margin-top: 2px; }
.msg .who-ai { display: block; font-size: 11px; font-weight: 700; margin-bottom: 1px; }
.sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 999px; padding: 3px 12px; text-align: center; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.composer form { display: flex; gap: 8px; }
.composer input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.send { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 0 16px; font-weight: 600; }
.link { align-self: flex-start; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.d-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-height: 57px; }
.d-head h2 { margin: 0; font: 700 15px/1 var(--f-display); }
.d-body { padding: 16px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.d-body .who { display: flex; gap: 10px; align-items: center; }
.d-body .who .avatar { width: 44px; height: 44px; }
.muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .lbl { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.field select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.val { font: 700 22px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.inline { display: flex; align-items: center; gap: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 13px; color: var(--muted); }
.tag[aria-pressed="true"] { background: var(--tbg, var(--accent-soft)); border-color: var(--tink, var(--accent)); color: var(--tink, var(--accent)); font-weight: 600; }

.only-narrow { display: none; }

/* Funil */
#funil { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg .hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.board { flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
.col { flex: 0 0 min(290px, 82vw); scroll-snap-align: start; display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border: 1px solid var(--line); border-top: 4px solid var(--sc, var(--line)); border-radius: 12px; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.col-head .t { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.col-head .sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cards { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; cursor: grab; }
.card.drag { opacity: 0.45; }
.card .top2 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.card .meta2 { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card .acts { display: flex; gap: 8px; align-items: center; }
.card select { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.mini-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--tbg, var(--accent-soft)); color: var(--tink, var(--accent)); font-weight: 600; }

/* Menu lateral */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 20, 0.5); z-index: 20; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(280px, 84vw);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px;
  transform: translateX(-100%); visibility: hidden;
  transition: transform 0.2s ease, visibility 0s linear 0.2s;
}
.drawer.open { transform: none; visibility: visible; transition: transform 0.2s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer.open { transition: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 4px; }
.drawer-brand { font: 700 17px/1.2 var(--f-display); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 10px; font-weight: 600; color: var(--ink); min-height: 44px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* Destaques de etapa e etiqueta, reforços e aviso */
.stg { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 13px; color: var(--muted); }
.stg:hover { background: var(--surface-2); }
.gl.here { color: var(--accent); }
.otherf { margin-top: 2px; }
.otherf summary { cursor: pointer; color: var(--accent); font-size: 13px; min-height: 28px; display: flex; align-items: center; }
.otherf .tgroups { margin-top: 8px; }
.req { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.req.ok { color: var(--good); border-color: var(--good); }
.req.miss { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qhint { font-size: 12px; color: var(--accent); font-weight: 600; }
#untChip { border-style: dashed; border-color: var(--accent); color: var(--accent); }
#untChip[aria-pressed="true"] { border-style: solid; }
#untChip .count { margin-left: 4px; }
.cfg-move { min-height: 34px; max-width: 130px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; padding: 0 6px; }
.rules { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.rule-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rule-on { display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 32px; }
.rule-f { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 0; }
.rule-f .lbl { font-size: 12px; color: var(--muted); }
.rule-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cfg-move.wide { max-width: none; width: 100%; }
.rule-test { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cfg-card.wide { grid-column: 1 / -1; }
.cfg-tgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cfg-tg { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cfg-tg .tx { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sw-cfg[aria-checked="true"] { color: var(--accent); border-color: var(--accent); }
.cfg-req { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cfg-req .lbl-t { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.reqs { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.reqs label { display: flex; align-items: center; gap: 8px; min-height: 32px; }
#gscrim { z-index: 39; }
.gdlg { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 40px rgba(8, 14, 20, 0.3); }
.gdlg h2 { margin: 0; font: 700 17px/1.25 var(--f-display); }
.gdlg p { margin: 0; color: var(--muted); }
.gdlg { max-height: calc(100vh - 32px); overflow-y: auto; }
.gbody { display: flex; flex-direction: column; gap: 12px; }
.gbody .field { gap: 6px; }
.gbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.gbtns .btn-sm { min-height: 40px; padding: 8px 14px; }
.gbtns .primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tag-none { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* Classificação rápida na conversa */
.hcls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 100%; order: 5; }
@media (min-width: 1180px) { .chat-head .switch { order: 1; } }
@media (max-width: 1179px) { .chat-head .switch { order: 6; } }
.chat-head .side-btn { order: 7; }
@media (min-width: 1180px) { .chat-head .side-btn { order: 2; } }
[hidden] { display: none !important; }
.qg { max-width: 100%; }
.qg .gn { white-space: nowrap; }
.qg .gv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.qg.has { background: var(--tbg, var(--accent-soft)); color: var(--tink, var(--accent)); border-color: var(--tink, var(--accent)); }
.qg.need { border: 1px dashed var(--accent); color: var(--accent); font-weight: 600; }
.qg[aria-expanded="true"], .qstage[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
.qwrap { position: relative; border-top: 1px solid var(--line); padding: 8px 12px; background: var(--surface); }
.qwrap + .composer { border-top: 0; padding-top: 2px; }
.qbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.qstage { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.qadd.need { border: 1px dashed var(--accent); color: var(--accent); font-weight: 600; }
.qchip { display: inline-flex; align-items: center; gap: 2px; background: var(--tbg, var(--accent-soft)); color: var(--tink, var(--accent)); border-radius: 999px; padding: 3px 3px 3px 11px; font-size: 13px; font-weight: 600; min-height: 34px; }
.qx { border: 0; background: transparent; color: inherit; width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.qx:hover { opacity: 0.65; }
.qpop { max-height: min(40vh, 300px); overflow-y: auto; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.qpop-in { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.qgrp { display: flex; flex-direction: column; gap: 6px; }
.qopts { display: flex; flex-wrap: wrap; gap: 6px; }
.qopt { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; min-height: 36px; font-size: 14px; }
.qopt:hover { background: var(--surface-2); }
.qopt[aria-pressed="true"] { background: var(--tbg, var(--accent-soft)); border-color: var(--tink, var(--accent)); color: var(--tink, var(--accent)); font-weight: 600; }
.qfoot { display: flex; justify-content: flex-end; }
.stg[aria-pressed="true"], .qst[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.stg[aria-pressed="true"]::before, .qst[aria-pressed="true"]::before, .tag[aria-pressed="true"]::before, .qtag[aria-pressed="true"]::before { content: '✓ '; }
.tag-none { font-size: 11px; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; padding: 0 5px; white-space: nowrap; flex: 0 0 auto; }

/* Filtro de etiquetas na Inbox */
.ifilter { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.btn-sm.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.if-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.if-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.if-panel .flt label { width: 112px; flex: 0 0 auto; }
.if-panel .flt select { flex: 1; min-width: 0; }

/* Grupos de etiquetas */
.tg0 { --tbg: var(--tg0-bg); --tink: var(--tg0-ink); }
.tg1 { --tbg: var(--tg1-bg); --tink: var(--tg1-ink); }
.tg2 { --tbg: var(--tg2-bg); --tink: var(--tg2-ink); }
.tg3 { --tbg: var(--tg3-bg); --tink: var(--tg3-ink); }
.gdot { width: 10px; height: 10px; border-radius: 50%; background: var(--tink, var(--accent)); flex: 0 0 auto; }
.tgroups { display: flex; flex-direction: column; gap: 12px; }
.tgroup { display: flex; flex-direction: column; gap: 6px; }
.gl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.flt-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.flt { display: flex; align-items: center; gap: 8px; }
.flt label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.flt select { padding: 6px 8px; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.flt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.cards:empty::before { content: 'Nenhum card'; color: var(--muted); font-size: 13px; padding: 4px 2px; }
.cfg-pipe .cfg-list { margin: 10px 0; }
.cfg-list:empty::before { content: 'Nenhuma etiqueta neste grupo.'; color: var(--muted); font-size: 13px; }

/* Configurações */
#respostas, #envios, #campanhas { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-width: none; }
.qrbtn { white-space: nowrap; }
.qrpanel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: min(32vh, 260px); overflow-y: auto; }
.qr-list { display: flex; flex-direction: column; gap: 6px; }
.qr-item { display: flex; gap: 8px; align-items: stretch; }
.qr-use { flex: 1; min-width: 0; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; min-height: 44px; }
.qr-use:hover { border-color: var(--accent); }
.qr-t { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.qr-s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qr-slash { margin: 0; font-size: 12px; }
.short { font-size: 12px; font-weight: 600; color: var(--accent); }
.kinds { display: flex; gap: 4px; flex-wrap: wrap; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); align-self: flex-start; }
.msg.media { display: flex; flex-direction: column; gap: 6px; }
.msg.me .kind { background: rgba(255, 255, 255, 0.22); color: inherit; }
.qimg { width: 100%; max-width: 240px; height: auto; border-radius: 8px; display: block; }
.mfile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.08); }
.mplay { font-size: 12px; }
.mbar { flex: 1 1 60px; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.4; min-width: 60px; }
.qbs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.qb-h { display: flex; justify-content: space-between; align-items: center; }
.qb-btns { display: flex; gap: 4px; }
.qtx { resize: vertical; font: inherit; }
.qb-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qb-prev { flex: 1 1 100%; max-width: 240px; }
.qb-pick { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; position: relative; }
.qb-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qr-cats { margin: 8px 0 12px; }
#equipe, #equipes { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-width: none; }
.drawer-foot { margin-top: auto; padding: 12px 4px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.drawer-foot p { margin: 0; font-size: 12px; }
.avatar.mini { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.own { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.eq-invite { flex-wrap: wrap; margin-bottom: 12px; }
.eq-invite .cfg-in { flex: 1 1 220px; }
.tbl-wrap { overflow-x: auto; }
.perm-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-tbl th, .perm-tbl td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.perm-tbl thead th { border-top: 0; font-size: 12px; color: var(--muted); }
.perm-tbl th[scope="row"], .perm-tbl thead th:first-child { text-align: left; }
.perm-tbl th[scope="row"] { font-weight: 400; display: table-cell; }
.perm-tbl th[scope="row"] .muted { display: block; font-size: 12px; }
.perm-tbl input[type="checkbox"] { width: 20px; height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#ownSeg .chip { font-size: 13px; }
#canais { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; align-content: start; max-width: none; }
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.acc-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.acc-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-note { margin: 0; font-size: 13px; }
.acc-btns, .wiz-btns, .wiz-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.wiz-proto { font-size: 12px; margin: 8px 0 0; }
.wiz { display: flex; flex-direction: column; gap: 12px; border-color: var(--accent); }
.wiz h2:focus { outline: none; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--good); border-color: var(--good); }
.pill.warn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill.off { color: var(--muted); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.optc { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; }
.optc:hover { border-color: var(--accent); background: var(--surface-2); }
.optc .muted { font-size: 13px; }
.qrbox { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.qrimg { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; line-height: 0; }
.qrsteps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cnx-err { margin: 0; color: var(--bad); font-weight: 600; }
.btn-sm.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-sm:disabled { opacity: 0.5; }
#contatos { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-width: none; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ct-sub { margin: 6px 0 8px; font-size: 14px; }
.ct-row .acc-main { align-items: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #E5484D; margin-left: 6px; vertical-align: middle; }
#interno { height: 100%; display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 12px; min-height: 0; }
.ic-list, .ic-thread { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ic-items { overflow-y: auto; }
.ic-item { display: flex; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; width: 100%; align-items: center; }
.ic-item[aria-current="true"] { background: var(--accent-soft); }
.ic-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ic-pv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ic-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ic-m { max-width: 78%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.ic-m.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ic-m .who { display: block; font-size: 11px; font-weight: 700; opacity: .8; }
.ic-m .meta { display: block; font-size: 11px; opacity: .7; text-align: right; }
.ic-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ic-form input { flex: 1; min-width: 0; }
.bottombar { display: none; }
#ownSeg { flex-wrap: wrap; }
@media (max-width: 979px) {
  #interno { grid-template-columns: minmax(0, 1fr); }
  #interno[data-pane="list"] .ic-thread, #interno[data-pane="chat"] .ic-list { display: none; }
  .bottombar { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--surface); margin: 0 -16px -12px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .bb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 4px 8px; min-width: 64px; }
  .bb[aria-current="page"] { color: var(--accent); font-weight: 700; }
  .bb .count { position: absolute; top: 0; right: 10px; }
}
#empresa { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-width: none; }
.me-box { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.me-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.me-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.me-btns .link { font-size: 12px; }
.avatar.mini.photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.mini img, .own.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.own.ph { padding: 0; width: 20px; height: 20px; overflow: hidden; display: inline-flex; border-radius: 50%; }
.logo-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; flex-wrap: wrap; }
.logo-box { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; color: var(--accent); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.filebtn { position: relative; cursor: pointer; display: inline-flex; align-items: center; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg.bot { white-space: pre-line; align-self: flex-end; background: var(--surface-2); color: var(--ink); border-style: dashed; }
.simbar { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; }
.simnote { font-size: 12px; }
.bot-prev pre { margin: 4px 0 0; white-space: pre-wrap; font: inherit; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.rule.bo { background: var(--surface-2); }
#config, #funis, #etiquetas { height: 100%; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 12px; align-content: start; }
.cfg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.cfg-card h2 { margin: 0; font: 700 16px/1.2 var(--f-display); }
.cfg-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* títulos de cartão padronizados: caixa alta e faixa de fundo */
.cfg-card > h2:first-child, .cfg-card > .cfg-title:first-child { margin: -16px -16px 12px; padding: 10px 16px; background: var(--head); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; text-transform: uppercase; letter-spacing: .04em; }
.cfg-card > .cfg-title:first-child h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.cfg-card > h2:first-child { font-size: 14px; }
.cfg-help { margin: 4px 0 12px; font-size: 13px; }
.cfg-note { grid-column: 1 / -1; margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cfg-list, .cfg-stages { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cfg-row { display: flex; align-items: center; gap: 8px; }
.cfg-in { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.cfg-in.strong { font-weight: 600; }
.cfg-n { font-size: 12px; white-space: nowrap; }
.cfg-add { display: flex; gap: 8px; }
.cfg-pipe + .cfg-pipe { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cfg-pipe .cfg-stages { margin: 10px 0; }
.idx { width: 20px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.icon-sm { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.icon-sm:disabled { opacity: 0.35; cursor: default; }
.danger { color: var(--bad); }

@media (max-width: 979px) {
  #config, #funis, #etiquetas { grid-template-columns: minmax(0, 1fr); }
  #inbox { grid-template-columns: minmax(0, 1fr); }
  #inbox .pane { display: none; border: 0; }
  #inbox[data-pane="list"] .pane-list,
  #inbox[data-pane="chat"] .pane-chat,
  #inbox[data-pane="details"] .pane-details { display: flex; }
  .only-narrow { display: inline-flex; }
  .sample { margin-left: 0; width: 100%; }
}
@media (min-width: 980px) { .only-wide-hide { display: none; } }

/* Janela (modal) para editar */
.mdl-back { position: fixed; inset: 0; background: rgba(10, 20, 30, .5); z-index: 60; }
.mdl { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(calc(100vw - 24px), 680px); max-height: calc(100dvh - 24px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.mdl > .cfg-card { border: 0; box-shadow: none; margin: 0; }
body:has(.mdl) { overflow: hidden; }
.tick { color: var(--muted, #6b7280); letter-spacing: -2px; }
.tick.read { color: #2b8cf0; }
.qrimg img { display: block; width: 220px; height: 220px; max-width: 100%; }
.maudio { max-width: 100%; display: block; }
.mvideo { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }

/* IA */
.ai-prompt { width: 100%; min-height: 160px; resize: vertical; font: inherit; line-height: 1.45; }
.ai-key-state { margin: 6px 0 10px; font-weight: 600; }
.ai-test { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ai-test p { margin: 4px 0 0; white-space: pre-wrap; }
.ai-rules { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.cfg-note.bad { color: var(--bad); border-color: var(--bad); }
#aiNote:empty { display: none; }

/* Assinatura */
.bl-plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.bl-plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.bl-plan.cur { border-color: var(--accent); background: var(--accent-soft); }
.bl-ph { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bl-price { font-weight: 700; }
.bl-price small { font-weight: 400; opacity: .7; }
.bl-feats { margin: 0 0 6px; padding-left: 18px; font-size: 13px; display: grid; gap: 2px; }
.bl-pays { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bl-pay { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bl-pay:last-child { border-bottom: 0; }
.bl-pm { display: grid; flex: 1; min-width: 140px; }
.bl-sbx { border-color: #E3B35A; background: #FFF1D6; color: #5C3B00; }
#assinatura .pill, .bl-wrap .pill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
#assinatura .pill.good, .bl-wrap .pill.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
#assinatura .pill.warn, .bl-wrap .pill.warn { background: #FFF1D6; color: #5C3B00; border-color: #E3B35A; }
#assinatura .pill.bad, .bl-wrap .pill.bad { background: #FBE4E2; color: #7A1C14; border-color: #B3261E; }
#assinatura .pill.info, .bl-wrap .pill.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.bl-wrap { width: min(760px, 100%); display: grid; gap: 12px; }

/* logo da empresa e crédito discreto */
.co-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin-right: 4px; }
.co-brand[hidden] { display: none; }
.co-brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: var(--surface, #fff); }
.co-brand span { font: 600 14px/1 var(--f-display); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.drawer-brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.powered { margin: 10px 0 0; font-size: 11px; color: var(--muted); opacity: .75; text-align: center; letter-spacing: .02em; }
.powered strong { font-weight: 600; }
@media (max-width: 480px) { .co-brand span { display: none; } }

.powered img { height: 16px; width: auto; max-width: 110px; vertical-align: middle; margin-left: 4px; opacity: .9; }
.mp-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; margin-right: 10px; background: #fff; border-radius: 6px; padding: 2px; }

/* relatórios */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.rp-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-k { font-size: 12px; color: var(--muted); }
.rp-v { font: 700 22px/1.2 var(--f-display); }
.rp-h { font-size: 11px; }
.rp-per { margin: 10px 0 0; }
.rp-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.rp-chart { display: flex; gap: 4px; align-items: stretch; height: 150px; margin-top: 10px; }
.rp-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.rp-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.rp-bar { width: 42%; max-width: 14px; min-height: 2px; border-radius: 3px 3px 0 0; }
.rp-bar.in, .rp-sw.in { background: #3b82f6; }
.rp-bar.out, .rp-sw.out { background: #16a34a; }
.rp-lbl { font-size: 10px; color: var(--muted); height: 14px; white-space: nowrap; }
.rp-legend { font-size: 12px; display: flex; gap: 6px; align-items: center; margin: 6px 0 0; }
.rp-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.rp-legend .rp-sw:first-child { margin-left: 0; }
.rp-scroll { overflow-x: auto; }
.rp-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-t th, .rp-t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rp-t thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.rp-t tbody th { font-weight: 600; }
.rp-note { font-size: 12px; margin: 8px 0 0; }
.rp-sub { font-size: 14px; margin: 12px 0 6px; }
.rp-fun { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rp-fun li { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.rp-fb { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.rp-fb span { display: block; height: 100%; background: #3b82f6; border-radius: 6px; }
.rp-fc { font-variant-numeric: tabular-nums; }
.rp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
#relatorios .cfg-card { margin-bottom: 12px; }

.rp-bar.ai, .rp-sw.ai { background: #a855f7; }
.rp-bar { width: 30%; max-width: 10px; }
.rp-heat { display: grid; gap: 2px; min-width: 540px; }
.rp-hrow { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; align-items: center; }
.rp-hd { font-size: 11px; color: var(--muted); }
.rp-hc { font-size: 10px; color: var(--muted); text-align: left; min-height: 12px; }
.rp-cell { height: 20px; border-radius: 3px; background: rgba(59, 130, 246, var(--a, 0)); outline: 1px solid var(--line); outline-offset: -1px; }
.rp-best { margin: 10px 0 4px; }
.rp-ramp { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(59,130,246,.15), rgba(59,130,246,1)); vertical-align: middle; margin: 0 4px; }

/* anexos, gravação e menu da mensagem */
.msg { position: relative; }
.msg .mact { position: absolute; top: 2px; right: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; }
.msg:hover .mact, .msg .mact:focus-visible { opacity: 0.85; }
@media (hover: none) { .msg .mact { opacity: 0.55; } }
.msg.del { opacity: .78; border: 1px dashed #d4574a; background-image: repeating-linear-gradient(135deg, rgba(212,87,74,.07) 0 8px, transparent 8px 16px); }
.msg.del.me, .msg.del.ai, .msg.del.bot { color: inherit; }
.msg.del > :not(.delnote):not(.meta) { text-decoration: line-through; text-decoration-color: rgba(212,87,74,.8); }
.delnote { display: block; margin-top: 4px; font-size: 11px; font-style: normal; font-weight: 600; color: #b3392d; line-height: 1.3; }
.msg.del.me .delnote, .msg.del.ai .delnote, .msg.del.bot .delnote { color: #ffd2cc; }
.msg.hasrx { margin-bottom: 12px; }
.msg .rx { position: absolute; bottom: -12px; right: 10px; padding: 0 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 20px; color: var(--ink); }
.msg.flash { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
.pinbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.pinbar[hidden] { display: none; }
.pinbar button { border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.pinbar button:hover, .pinbar button:focus-visible { background: var(--accent-soft); }
.pinbar .pb-pin { flex: 1; min-width: 0; text-align: left; display: flex; gap: 4px; align-items: center; }
.pinbar .pb-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pinbar .pb-star { white-space: nowrap; }
.mmenu { position: fixed; z-index: 60; min-width: 190px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.mmenu > button { text-align: left; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.mmenu > button:hover, .mmenu > button:focus-visible { background: var(--surface-2); }
.mmenu .danger { color: var(--bad); }
.mmenu > button:disabled { opacity: .55; cursor: not-allowed; }
.mm-emo { display: flex; gap: 2px; padding: 4px 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mm-emo button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; font-size: 19px; cursor: pointer; line-height: 1; }
.mm-emo button:hover, .mm-emo button:focus-visible { background: var(--surface-2); transform: scale(1.15); }
.mm-emo button.on { background: var(--accent-soft); }
.mfwd { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mfwd-box { width: min(420px, 100%); max-height: 80vh; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border-radius: 12px; }
.mfwd-h { display: flex; justify-content: space-between; align-items: center; }
.mfwd-act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.btn-sm.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.mfwd-q { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.mfwd-l { overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.mfwd-i { text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.mfwd-i:hover, .mfwd-i:focus-visible { background: var(--surface-2); }
.replybar { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; font-size: 13px; }
.replybar[hidden] { display: none; }
.replybar .rq { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#attBtn { font-size: 16px; }
.micbtn { flex: none; width: 40px; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.micbtn:hover, .micbtn:focus-visible { background: var(--accent); color: var(--accent-ink); }
/* barra de gravação (estilo WhatsApp) */
.recbar { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); }
.recbar[hidden] { display: none; }
#form.rec > :not(.recbar) { display: none !important; }
.recbar button { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rb-trash { border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); }
.rb-trash:hover, .rb-trash:focus-visible { background: var(--surface-2); }
.rb-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #C2185B; animation: recblink 1.2s ease-in-out infinite; }
.recbar.paused .rb-dot { animation: none; opacity: .4; }
@keyframes recblink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rb-dot { animation: none; } }
.rb-time { flex: none; font-variant-numeric: tabular-nums; min-width: 34px; }
.rb-wave { flex: 1; min-width: 0; height: 32px; color: var(--muted); }
.rb-pause { border: 0; background: transparent; color: #C2185B; }
.rb-pause:hover, .rb-pause:focus-visible { background: var(--surface-2); }
.rb-send { border: 0; background: #111; color: #fff; }
.rb-send:hover, .rb-send:focus-visible { background: #333; }

/* painel ⚡ de respostas rápidas (barra à direita) */
.pane-qr { border-left: 1px solid var(--line); background: var(--surface); }
#inbox[data-side="qr"] { grid-template-columns: 330px minmax(0, 1fr) 340px; }
#inbox[data-side="qr"] .pane-details { display: none; }
#inbox:not([data-side="qr"]) .pane-qr { display: none; }
@media (max-width: 979px) {
  #inbox[data-pane="qr"] .pane-qr { display: flex !important; }
  #inbox[data-pane="details"] .pane-details { display: flex !important; }
  #inbox[data-pane="details"] .pane-qr { display: none !important; }
}
.qside-btn { font-size: 18px; }
.qside-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.qs-tabs { flex: 1; display: flex; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.qs-tabs button { flex: 1; border: 0; border-radius: 8px; padding: 7px 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qs-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qs-tabs button:not([aria-selected="true"]):hover { color: var(--ink); }
.qs-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.qs-top { display: flex; gap: 8px; }
.qs-top .cfg-in { flex: 1; min-width: 0; }
.qs-to { margin: 0; font-size: 12px; }
.qs-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.qs-sel { appearance: auto; padding-right: 8px; }
.qs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qs-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 8px; }
.qs-row { display: flex; align-items: center; gap: 6px; }
.qs-t { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.qs-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-sub { font-size: 12px; }
.qs-btns { display: flex; gap: 2px; flex: none; }
.qs-ic { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
.qs-ic:hover, .qs-ic:focus-visible { background: var(--surface-2); color: var(--ink); }
.qs-ic.go { color: var(--accent); }
.qs-ic.go:hover, .qs-ic.go:focus-visible { background: var(--accent); color: var(--accent-ink); }
.qs-more { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.qs-more button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.qs-more button.danger { color: var(--bad); }
.qs-steps { margin: 6px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.qs-steps .kind { margin-right: 4px; }
.qs-run { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.qs-empty { list-style: none; padding: 8px 2px; }
.qs-edit .cfg-card { border: 0; padding: 0; box-shadow: none; background: transparent; }
.qact .qa-f { display: flex; flex-direction: column; gap: 6px; }
.qa-sec { display: flex; align-items: center; gap: 8px; }
.qa-sec .cfg-in { width: 90px; }
.qa-note { margin: 0; font-size: 12px; }
.amenu { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface-2); }
.amenu summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.am-g { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 8px; }

/* ordenar etiquetas e grupos */
.cfg-drag{cursor:grab;color:var(--muted,#8a94a6);font-size:16px;line-height:1;padding:0 4px;user-select:none}
.cfg-drag:active{cursor:grabbing}
.cfg-row.dragging{opacity:.4}
.cfg-row.drop-before{box-shadow:0 -2px 0 0 var(--brand,#2563eb)}
.cfg-list.drop-end{box-shadow:inset 0 -2px 0 0 var(--brand,#2563eb)}
.icon-sm[disabled]{opacity:.35;cursor:default}

/* celular: campo de texto em cima, botões embaixo (o botão de áudio não corta mais) */
.composer form > input#msgInput { min-width: 0; flex: 1 1 auto; }
.micbtn { min-width: 40px; height: 40px; }
@media (max-width: 640px) {
  .composer form { flex-wrap: wrap; }
  .composer form > input#msgInput { order: -1; flex: 1 1 100%; }
  .composer form > .send { margin-left: auto; min-height: 40px; }
}

/* linha de hora e status abaixo da mensagem: uma linha só */
.msg .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
@media (max-width: 640px) { .msg .meta { font-size: 10.5px; letter-spacing: -0.1px; } }

/* celular: botões do campo de mensagem sempre numa linha só */
@media (max-width: 640px) {
  .composer form { gap: 6px; }
  .composer form > .btn-sm, .composer form > .send, .composer form > .micbtn { min-height: 38px; height: 38px; font-size: 13px; padding: 0 9px; flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .composer form > #attBtn { padding: 0 10px; }
  .composer form > .send { margin-left: auto; padding: 0 14px; }
  .composer form > .micbtn { width: 40px; padding: 0; flex: none; }
}
@media (max-width: 640px) {
  .composer form { gap: 5px; }
  .composer form > .btn-sm, .composer form > .send { font-size: 12px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
  .composer form > #attBtn { padding: 0; width: 36px; flex: none; }
  .composer form > .micbtn { width: 38px; }
  .composer form > .send { padding: 0 12px; }
}
@media (max-width: 640px) { .composer form > .btn-sm, .composer form > .send { display: inline-flex; align-items: center; justify-content: center; line-height: 1; } }

.msg.del .link { font-size: 11px; margin-left: 6px; }
.mfwd-box .orig { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--line, #d0d7e2); background: var(--bg-soft, #f4f6fa); white-space: pre-wrap; word-break: break-word; border-radius: 6px; }

/* nota interna, adiar, tarefas */
.ctabs { display: flex; gap: 4px; padding: 6px 12px 0; }
.ctabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px 8px 0 0; font: inherit; font-size: 13px; color: var(--muted, #5b6676); cursor: pointer; border-bottom: 2px solid transparent; }
.ctabs button[aria-selected="true"] { color: var(--ink, #111827); font-weight: 600; border-bottom-color: #f2b705; }
#form.note { background: #fff8db; }
#form.note #attBtn, #form.note #qrBtn, #form.note #aiBtn, #form.note #micBtn { display: none !important; }
#form.note #msgInput { background: #fffdf0; border-color: #f2b705; }
.mpop { position: relative; }
.mpop[hidden] { display: none; }
.mpop { margin: 0 12px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #d0d7e2); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); overflow: hidden; }
.mpop button { text-align: left; border: 0; background: transparent; padding: 8px 12px; font: inherit; cursor: pointer; }
.mpop button:hover, .mpop button:focus { background: #fff3c4; }
.msg.note { align-self: stretch; max-width: 100%; background: #fff3c4; color: #3d3200; border: 1px solid #f2d96a; border-radius: 10px; }
.msg.note .who-note { display: block; font-size: 11px; font-weight: 700; color: #7a5d00; margin-bottom: 3px; }
.msg.note .meta { color: #7a5d00; }
.mnt-in { background: #ffe27a; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; background: #f2b705; color: #3d3200; font-size: 11px; font-weight: 700; margin-right: 4px; }
#toasts { position: fixed; right: 12px; bottom: 12px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 24px)); }
.toast { text-align: left; border: 0; background: #1f2937; color: #fff; padding: 10px 14px; border-radius: 10px; font: inherit; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
.tk-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tk { display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line, #d0d7e2); border-radius: 10px; background: #fff; }
.tk.late { border-color: #e0a39b; background: #fff4f2; }
.tk-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tk-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tk-sec { margin-top: 10px; } .tk-sec.late > strong { color: #b3392d; }
#tkCount { background: #d4574a; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 6px 0; }
@media (max-width: 640px) { .ctabs button { padding: 4px 9px; font-size: 12.5px; } }

.wt { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 1px 6px; margin-right: 4px; white-space: nowrap; background: #e8f3ec; color: #1f6b49; }
.wt.warn { background: #fff0c2; color: #6b4a00; }
.wt.late { background: #fde0de; color: #9b1c14; }

.gsn { font-style: normal; color: var(--accent, #2f7d5b); }
.presbar { background: #fff6d6; color: #6b4a00; font-size: 13px; padding: 6px 12px; border-bottom: 1px solid #f0dca0; }

.ins-sum { margin: 4px 0; font-size: 13px; line-height: 1.4; }
.lead { font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 8px; background: #e3eefc; color: #1b4b8f; }
.lead.morno { background: #fff0c2; color: #6b4a00; }
.lead.quente { background: #fde0de; color: #9b1c14; }

.cmp-bar { height: 8px; background: var(--line, #e5e5e5); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.cmp-bar span { display: block; height: 8px; background: #2f7d5b; }
.cmp-form { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; border-top: 1px solid var(--line, #e5e5e5); padding-top: 10px; }
.cmp-form h3 { margin: 0; font-size: 15px; }

.ag-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.ag-day.today { border-color: #2f7d5b; box-shadow: 0 0 0 1px #2f7d5b inset; }
.ag-item.canceled, .ag-item.noshow { opacity: .55; }
.ag-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ag-empty { margin: 4px 0; }

.ok-t { color: #1f6b49; font-weight: 600; }
.late-t { color: #9b1c14; font-weight: 600; }

/* cores escolhidas (0032) */
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.cfg-color { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; flex: 0 0 auto; }
.col-head .t span:first-child { display: inline-flex; align-items: center; }

/* barra lateral oculta por padrão (botão "Mostrar painel" no topo da conversa) */
.wide-only { display: none; }
@media (min-width: 980px) {
  .wide-only { display: inline-flex; }
  #inbox[data-side="off"] { grid-template-columns: 330px minmax(0, 1fr); }
  #inbox[data-side="off"] .pane-details, #inbox[data-side="off"] .pane-qr { display: none; }
}
.side-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ===== Visual mais enxuto (fontes e espaços menores) ===== */
body { font-size: 13px; }
.brand { font-size: 16px; } .drawer-brand { font-size: 15px; }
.d-head h2 { font-size: 14px; } .cfg-card h2 { font-size: 14px; } .gdlg h2 { font-size: 15px; }
.val, .rp-v { font-size: 18px; }
.live .simbar, .live .simnote:empty { display: none; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.icon-sm { width: 28px; height: 28px; }
.chip { padding: 3px 9px; font-size: 12px; }
.search { padding: 7px 10px; font-size: 13px; }
.pane-head { padding: 8px 10px; gap: 6px; }
.chips { flex-wrap: nowrap; gap: 4px; }
.chips .chip { white-space: nowrap; }
.ifilter { gap: 6px; flex-wrap: wrap; }
.if-panel { padding: 8px; gap: 6px; }
.flt-chan { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flt-chan .chips { flex: 1; min-width: 0; }
#ifTags { display: flex; flex-direction: column; gap: 6px; }
/* cartões da lista: sem quebra de linha */
.conv { padding: 8px 10px; gap: 8px; min-height: 0; grid-template-columns: 34px minmax(0, 1fr); }
.conv .avatar { width: 34px; height: 34px; font-size: 12px; }
.row3 { flex-wrap: nowrap; overflow: hidden; gap: 4px; margin-top: 3px; font-size: 11px; }
.row3 > * { flex: 0 0 auto; }
.name { font-size: 13px; }
.preview { font-size: 12px; }
/* painel de detalhes e conversa */
.d-body { padding: 10px; gap: 10px; }
.field { gap: 3px; }
.field label, .field .lbl { font-size: 11px; }
.field select { padding: 6px 8px; }
.msgs { padding: 12px; gap: 6px; }
.msg { padding: 6px 10px; }
.composer { padding: 8px 10px; gap: 6px; }
.composer input { padding: 8px 10px; }
.nav-item { padding: 9px 12px; min-height: 38px; }
/* configurações */
#config, #funis, #etiquetas { gap: 10px; }
.cfg-card { padding: 12px; }
.cfg-help { margin: 2px 0 8px; font-size: 12px; }
.cfg-list, .cfg-stages { gap: 4px; margin-bottom: 8px; }
.cfg-in { padding: 5px 8px; font-size: 13px; }
.cfg-move { min-height: 28px; font-size: 12px; }
.cfg-color { width: 28px; height: 26px; }
.cfg-pipe + .cfg-pipe { margin-top: 12px; padding-top: 12px; }
.cfg-show { font-size: 12px; } .cfg-show label { min-height: 26px; }
/* cabeçalho da conversa compacto (computador) */
@media (min-width: 980px) {
  .chat-head { padding: 6px 10px; gap: 4px 8px; }
  .chat-head .avatar { width: 32px; height: 32px; font-size: 12px; }
  .chat-head .icon { width: 30px; height: 30px; }
  .hcls { flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: thin; padding-bottom: 2px; }
  .qbtn { min-height: 26px; padding: 2px 9px; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
  .switch { padding: 2px 8px 2px 4px; font-size: 12px; }
}
#ownSeg { flex-wrap: nowrap; } #ownSeg .chip { font-size: 12px; }
.cfg-row .btn-sm.danger, .cfg-pipe .btn-sm.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.cfg-row .btn-sm.danger:hover { background: var(--surface-2); }
.cfg-row .cfg-move { max-width: 96px; }

/* nova conversa e grupos de mensagens */
.search-row { display: flex; gap: 6px; align-items: center; }
.search-row .search { flex: 1; min-width: 0; }
.newconv-btn { flex: 0 0 auto; white-space: nowrap; }
.newconv-btn[hidden] { display: none; }
.nc-tabs { padding: 0; margin: 6px 0 8px; }
.mg-var { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; }
.mg-var textarea { flex: 1; min-width: 0; }
.mfwd-box { overflow-y: auto; width: min(480px, 100%); }
.mfwd-box > * { flex-shrink: 0; }
.mfwd-box .rule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.mfwd-box textarea.mfwd-q { min-height: 70px; }
.mfwd-box .mfwd-act { position: sticky; bottom: -14px; background: var(--surface); padding: 8px 0 2px; }

/* Celular: menu lateral rola (o botão Sair da conta fica sempre acessível) e o cabeçalho da conversa não amontoa */
.drawer { overflow-y: auto; overscroll-behavior: contain; }
body.live #asUser, body.live label[for="asUser"], body.live .drawer-foot p.muted { display: none; }
.drawer-foot .logout-btn { width: 100%; justify-content: center; margin-top: 4px; }
@media (max-width: 979px) {
  .chat-head .who { flex: 1 1 calc(100% - 110px); min-width: 0; }
  .chat-head .name, .chat-head .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-head .sub { flex-wrap: nowrap; }
  .chat-head .icon[data-act="snooze"], .chat-head .icon[data-act="transfer"], .chat-head .icon[data-act="close-conv"], .chat-head .icon[data-act="reopen"] { order: 2; }
  .chat-head [data-act="details"] { order: 2; margin-left: auto; }
  .chat-head .hcls { order: 3; flex: 1 1 100%; }
}

/* ===== Menu superior (computador) ===== */
.topnav, .topuser { display: none; }
.ct-adv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; padding-top: 4px; }
.ct-adv .acc-btns { grid-column: 1 / -1; }
@media (min-width: 980px) {
  #menuBtn, .top .brand, .drawer, #scrim { display: none !important; }
  .top { flex-wrap: nowrap; gap: 8px; }
  .topnav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
  .top .sample { margin-left: 12px; width: auto; }
  .topuser { display: block; position: relative; margin-left: auto; }
  .tn-item { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .tn-item:hover { background: var(--surface-2); color: var(--ink); }
  .tn-item[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }
  .tn-item .count { position: static; }
  .tn-group { position: relative; }
  .tn-menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 30, 50, .16); z-index: 40; flex-direction: column; gap: 2px; }
  .tn-group.open .tn-menu { display: flex; }
  .tn-sub { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink); }
  .tn-sub:hover { background: var(--surface-2); }
  .tn-sub[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .topuser-btn { border: 0; background: transparent; padding: 2px; border-radius: 999px; line-height: 0; }
  .topuser-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
  .tmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 30, 50, .16); z-index: 40; display: flex; flex-direction: column; gap: 8px; }
  .tmenu[hidden] { display: none; }
  .tu-info { display: flex; flex-direction: column; }
  #contatos { max-width: none; }
}
#funis, #etiquetas { grid-template-columns: minmax(0, 1fr); max-width: none; }
#funis .cfg-card, #etiquetas .cfg-card { grid-column: 1 / -1; }

/* ---- base de conhecimento, instruções da IA, selo "padrão do sistema" ---- */
.badge-sys { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #E8EEFC; color: #1F3F9E; vertical-align: middle; white-space: nowrap; }
.kb-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.kb-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kb-t .kb-pick { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line, #d8dce6); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.kb-t.on .kb-pick { border-color: #2255D4; background: rgba(34, 85, 212, .08); }
.kb-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kb-scroll { overflow: auto; max-width: 100%; max-height: 62vh; border: 1px solid var(--line, #d8dce6); border-radius: 8px; }
.kb-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.kb-table th, .kb-table td { padding: 4px 6px; border-bottom: 1px solid var(--line, #e6e9f0); text-align: left; white-space: nowrap; }
.kb-table th { position: sticky; top: 0; background: var(--surface, #fff); z-index: 1; font-size: 12px; }
.kb-cell { width: 100%; min-width: 110px; border: 1px solid transparent; background: transparent; color: inherit; padding: 4px 6px; border-radius: 6px; font: inherit; }
.kb-cell:hover { border-color: var(--line, #d8dce6); }
.kb-cell:focus { border-color: #2255D4; outline: none; background: var(--surface, #fff); }
.kb-off .kb-cell { opacity: .5; }
.kb-act { width: 1%; white-space: nowrap; }
.kb-pg { display: flex; align-items: end; gap: 6px; white-space: nowrap; }
.kb-prev { margin: 10px 0; }
.kb-ia { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.rule.off { opacity: .65; }
.btn-sm.on { background: #2255D4; color: #fff; border-color: #2255D4; }
@media (min-width: 980px) {
  .kb-wrap { grid-template-columns: 280px minmax(0, 1fr); }
  .kb-ia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#base { height: 100%; overflow-y: auto; }

/* ---- modelos do sistema (painel do master) ---- */
.tp-h { font-size: 13px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #667); }
.tp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.tp-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line, #d8dce6); border-radius: 8px; }
.tp-it.off { opacity: .6; }
.tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-main .muted { font-size: 12px; }
.tp-n { white-space: nowrap; font-size: 12px; }
.tp-form { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }

/* Empresas unificadas: braços da NexSync */
.mp-plan { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.mp-arms { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-arm { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line, #e3e6ee); border-radius: 8px; }
.mp-arm.off { opacity: .65; background: rgba(120,130,150,.06); }
.mp-arm .mp-main { flex: 1 1 200px; min-width: 0; }
.mp-arm .mp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-arm .mp-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.logo-pair { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 28px; margin: 4px 0 8px; }
.logo-pair .logo-row { margin: 0 0 4px; }
.ia-tabs { margin-bottom: 8px; }

/* ---------- Marketing (painel da equipe e portal do cliente) ---------- */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mk-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mk-grid .mk-card { margin-bottom: 0; }
.mk-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mk-top { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.mk-top h2 { margin: 0; font: 700 18px/1.2 var(--f-display); }
.mk-tabs { overflow-x: auto; }
.mk-month { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.mk-month strong { min-width: 140px; text-align: center; text-transform: capitalize; }
.mk-kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mk-kv li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.mk-kv li span { color: var(--muted); }
.mk-bad { color: var(--bad); }
.mk-up { color: var(--good); font-weight: 600; }
.mk-alert { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; }
.mk-cap { margin: 0; white-space: normal; }
.mk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.mk-form { display: grid; gap: 10px; margin: 8px 0; }
.mk-sub { border-top: 1px solid var(--line); padding-top: 8px; }
.mk-metric { align-self: center; }
.mk-md { white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 480px; overflow: auto; font: 13px/1.5 var(--f-body); }
.mk-table { width: 100%; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }
.mk-table th, .mk-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.mk-chat { display: grid; gap: 8px; max-height: 420px; overflow: auto; margin-top: 8px; }
.mk-msg { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 92%; }
.mk-msg small { display: block; color: var(--muted); }
.mk-msg.user { background: var(--accent-soft); justify-self: end; }
.mk-hist { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.info { color: var(--muted); }
.mp-arm .pill.warn, .mp-card .pill.warn, .mk-row .pill.warn, .mk-card .pill.warn { background: #FFF1D6; color: #5C3B00; border-color: #E3B35A; }

/* Nova conversa: modal maior, grade de intervalos e escolha de mensagens */
.mfwd-wide .mfwd-box { width: min(720px, 100%); height: min(780px, 92vh); max-height: 92vh; }
.mfwd-wide .nc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; align-items: end; margin: 6px 0; }
.mfwd-wide .nc-grid.nc-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nc-grid .rule-f { flex: initial; justify-content: flex-end; }
.nc-grid .rule-f .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-grid .cfg-in, .nc-grid .cfg-move { width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .mfwd-wide .nc-grid, .mfwd-wide .nc-grid.nc-g2 { grid-template-columns: 1fr 1fr; } .nc-grid .rule-f .lbl { white-space: normal; } }
.nc-chosen { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.nc-prev { white-space: pre-wrap; margin: 0; }
.nc-cats { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 52vh; }
.nc-cat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.nc-chk { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; cursor: pointer; }
.nc-chk input { margin-top: 3px; flex: none; }
.nc-cat-h { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.nc-msg { padding-left: 18px; font-size: 13px; white-space: pre-wrap; }
.nc-count { margin-right: auto; align-self: center; }
.mfwd-wide .nc-cats { flex: 1 1 auto; max-height: none; min-height: 0; }

/* Resumo da conversa: etapa colorida e opções por etapa/etiqueta */
.toppill.stgpill { background: var(--tbg, var(--surface-2)); color: var(--tink, var(--accent)); }
.cfg-list > li.cfg-row, .cfg-stages > li.cfg-row { flex-wrap: wrap; }
.cfg-flags { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 30px; font-size: 12px; color: var(--muted); }
.cfg-flags label { display: flex; align-items: center; gap: 6px; min-height: 26px; cursor: pointer; }
@media (min-width: 980px) {
  .cfg-list > li.cfg-row, .cfg-stages > li.cfg-row { flex-wrap: nowrap; }
  .cfg-list > li.cfg-row .cfg-in, .cfg-stages > li.cfg-row .cfg-in { min-width: 90px; }
  .cfg-flags { flex: 0 0 auto; flex-basis: auto; flex-wrap: nowrap; padding-left: 0; gap: 4px 14px; white-space: nowrap; }
  .cfg-list > li.cfg-row .cfg-move { max-width: 120px; }
}

/* ===== Celular (até 979px): tela cheia, sem cabeçalho, barra de abas embaixo ===== */
.m-tabs, .m-ic, .pendbar { display: none; }
.team-pill { display: inline-block; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 17px; }
.m-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); flex: 0 0 auto; }
.m-ico.on { color: var(--accent); background: var(--accent-soft); }
.m-n { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; line-height: 15px; text-align: center; }
@media (max-width: 979px) {
  body { padding: 0; gap: 0; height: 100dvh; }
  header.top { display: none; }
  main { padding: 0 8px; }
  #inbox { border: 0; border-radius: 0; background: transparent; }
  #inbox, #funil, #contatos, #interno { margin-top: 0; }
  .bottombar { margin: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .bb { min-width: 0; flex: 1; padding: 2px 4px; }
  #inbox[data-pane="chat"] ~ * , #inbox[data-pane="details"] ~ * { }
  /* lista */
  .pane-list .pane-head { padding: 4px 4px 6px; gap: 4px; }
  .pane-list .search-row .newconv-btn, .pane-list #ownSeg, .pane-list .ifilter, .pane-list #ifPanel { display: none !important; }
  .m-tabs { display: flex; align-items: center; gap: 2px; }
  .m-tab { position: relative; flex: 0 0 auto; border: 0; background: transparent; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
  .m-tab[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
  .m-tab .dot, .m-tabs .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e5484d; margin-left: 4px; vertical-align: super; }
  .m-r { margin-left: auto; display: inline-flex; gap: 0; }
  .m-ttl { flex: 1; font-size: 15px; }
  .search-row { display: flex; align-items: center; gap: 2px; }
  .search-row .search { flex: 1; min-width: 0; }
  .m-ic { display: inline-flex; gap: 0; }
  .conv { padding: 7px 4px; }
  .conv .row1 .tops { display: none; }
  .row3 .team-pill { flex: 0 1 auto; }
  /* conversa */
  .pane-chat .chat-head { flex-wrap: nowrap; gap: 4px; padding: 4px 6px; min-height: 0; }
  .m-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 2px; }
  .m-who .who { display: flex; flex-direction: column; min-width: 0; }
  .m-who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
  .m-who .sub { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
  .m-st { padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 17px; }
  .m-st.st-a { background: var(--accent-soft); color: var(--accent); } .m-st.st-p { background: #fff1c9; color: #7a5a00; } .m-st.st-c { background: var(--surface-2); color: var(--muted); }
  .m-stage { display: inline-flex; align-items: center; gap: 4px; max-width: 110px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
  .m-stage span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pane-chat .hcls { display: none; }
  .msgs { padding: 8px; }
  .composer { padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)); gap: 2px; }
  .composer .ctabs { margin: 0; }
  #qrBtn, #aiBtn { display: none; }
  .pendbar { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
  .pendbar .btn-sm { flex: 1; padding: 11px 8px; font-size: 14px; }
  .pane-chat.pend .composer { display: none; }
  /* sobre o contato */
  .m-dtabs { display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); }
  .m-dtabs button { flex: 1; border: 0; background: transparent; padding: 8px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
  .m-dtabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
  .m-stagecard { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
  .m-stagecard .lbl { font-size: 11px; color: var(--muted); }
  .m-stagecard .m-sv { flex: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
  .m-hist { margin: 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
  .pane-details .qs-tabs { display: none; }
  /* folhas de baixo */
  .mfwd.sheet { align-items: flex-end; padding: 0; }
  .mfwd.sheet .mfwd-box { width: 100%; max-height: 85vh; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .sheet-body { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  .sh-t { font-weight: 700; font-size: 13px; margin-top: 8px; }
  .m-opts { display: flex; flex-wrap: wrap; gap: 6px; }
  .m-opt { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
  .m-opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .sheet-go { padding: 12px; font-size: 14px; }
  .m-info { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 13px; color: var(--muted); }
  .m-info strong { color: var(--ink); text-align: right; }
  .mfwd-i { padding: 13px 10px; font-size: 15px; }
  .mfwd-i[aria-disabled="true"] { opacity: .55; }
  .m-radio { display: flex; align-items: center; gap: 10px; }
  .m-radio .rd { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
  .m-radio[aria-pressed="true"] .rd { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
}
@media (max-width: 979px) {
  .pane-chat .chat-head .m-who { order: 0; margin-left: 0; }
  .pane-chat .chat-head .m-stage { order: 1; } .pane-chat .chat-head [data-act="m-chatmenu"] { order: 2; }
}
@media (max-width: 979px) { .mfwd.sheet .mfwd-box { overflow-y: auto; max-height: 82dvh; } }

/* ===== Ajustes de uso (atendimento) ===== */
#ifBtn[aria-expanded="true"], #ifBtn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ===== Janelas: título e X fixos no topo, texto alinhado ao topo, botão "Topo" ===== */
.mx-h { position: sticky; top: 0; z-index: 4; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mfwd-box .mx-h { margin: -14px -14px 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mdl .mx-h { padding: 4px 0 10px; margin-bottom: 8px; box-shadow: -16px 0 0 var(--surface), 16px 0 0 var(--surface), 0 -16px 0 var(--surface); border-bottom: 1px solid var(--line); }
.mx-h > strong, .mx-h > h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mx-x { order: 99; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; font-size: 16px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mx-x:hover, .mx-x:focus-visible { background: var(--surface-2); }
.mx-topw { position: sticky; bottom: 10px; height: 0; z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; margin-top: -8px; }
.mfwd-box:has(.mfwd-act) .mx-topw { bottom: 58px; }
.mx-topw[hidden] { display: none; }
.mx-top { pointer-events: auto; transform: translateY(-100%); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: pointer; }
/* texto da janela começa no topo; a janela fica ancorada no alto da tela (não pula quando o conteúdo muda) */
.mfwd-box { justify-content: flex-start; text-align: left; }
@media (min-width: 640px) {
  .mfwd { align-items: flex-start; padding-top: 7vh; }
  .mdl { top: 7vh; transform: translateX(-50%); max-height: 86dvh; }
  .gdlg { top: 7vh; transform: translateX(-50%); }
}

/* ===== Contratos e usuários do painel ===== */
.ct-pre { white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 13px/1.5 var(--f-body, system-ui); margin: 8px 0; }
.ct-ta { width: 100%; min-height: 320px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.ct-keys { columns: 2; list-style: none; padding: 0; margin: 6px 0; font-size: 13px; } .ct-keys li { break-inside: avoid; margin: 2px 0; }
.ct-keys code { background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
@media (max-width: 640px) { .ct-keys { columns: 1; } }
.mp-menu { position: relative; align-self: center; }
.mp-menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 4px; display: flex; flex-direction: column; }
.mp-menu-list button { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.mp-menu-list button:hover, .mp-menu-list button:focus-visible { background: var(--surface-2); }

.mk-alerts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.mk-alerts li { padding-top: 8px; border-top: 1px solid var(--line, rgba(128,128,128,.25)); }
.mk-alerts li:first-child { border-top: 0; padding-top: 0; }
.mk-slides ol { margin: 4px 0 0; padding-left: 20px; }
.mk-script summary { cursor: pointer; }

/* Usuários: lista enxuta + janela de dados */
.eq-row { display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.eq-row:hover { border-color: var(--accent, #4f8cff); }
.eq-row .acc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eq-top { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding-top: 12px; }
.avatar.big { width: 56px; height: 56px; font-size: 20px; }
.avatar.big img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.eq-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.eq-dl dt { color: var(--muted); font-size: .85em; }
.eq-dl dd { margin: 0; overflow-wrap: anywhere; }
.eq-edit { display: flex; flex-direction: column; gap: 10px; }
.eq-cred { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }

.mfwd.eq-wide .mfwd-box { width: min(960px, 100%); }
.eq-grid { display: grid; gap: 10px 14px; }
.eq-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.eq-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .eq-grid.g3, .eq-grid.g2 { grid-template-columns: 1fr; } }
.eq-edit textarea.cfg-in { min-height: 0; height: 64px; resize: vertical; }

.mfwd.tm-wide .mfwd-box { width: min(640px, 100%); }
.tm-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tm-bar .cfg-in { flex: 1 1 180px; min-width: 0; }
.tm-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.tm-list li { padding: 6px 10px; border-top: 1px solid var(--line); }
.tm-list li:first-child { border-top: 0; }
.tm-list li[hidden] { display: none; }
.tm-list .chk { display: flex; align-items: center; gap: 10px; }

/* Janelas: barra do título com cor própria e título menor; campos do modal não esticam */
:root { --mxh: #e6edfb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mxh: #1f2a44; } }
:root[data-theme="dark"] { --mxh: #1f2a44; }
.mx-h { background: var(--mxh); }
.mx-h > strong, .mx-h > h2 { font-size: 14px; font-weight: 600; margin: 0; }
.mfwd-box .mx-h { margin: -14px -14px 6px; padding: 8px 14px; border-radius: 12px 12px 0 0; }
.mdl .mx-h { padding: 6px 0 8px; box-shadow: -16px 0 0 var(--mxh), 16px 0 0 var(--mxh), 0 -16px 0 var(--mxh); }
.mx-x { width: 30px; height: 30px; }
.mfwd-box .rule-f { flex: none; }
.mfwd-box .rule-row .rule-f { flex: 1 1 0; }
#equipes .cfg-add { margin: 12px 0 16px; }
.mfwd-box .mx-h { top: -14px; margin-bottom: 10px; }

.al-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 18px; margin-bottom: 10px; }
.al-f { flex: none; }
.al-f .cfg-in { max-width: 140px; }
.al-help { font-size: 12px; line-height: 1.35; }
.al-cli { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.al-cli:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

/* Pendências do cliente: modal largo, linhas compactas que expandem */
.mdl.mdl-wide { width: min(calc(100vw - 24px), 1040px); }
.pd-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-row { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pd-row.done .pd-t { text-decoration: line-through; opacity: .7; }
.pd-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.pd-chk { flex: none; width: 18px; height: 18px; margin: 0; }
.pd-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.pd-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-arrow { flex: none; color: var(--muted, #667); }
.pd-sel { flex: none; width: auto; min-width: 0; padding: 4px 8px; font-size: .85rem; }
.pd-body { padding: 4px 12px 12px 36px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.pd-prev { border: 2px solid var(--accent, #2b6cb0); border-radius: 10px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.pd-prev h3 { margin: 0; }
.pd-prev textarea { width: 100%; font: inherit; }
.pd-warn { margin: 0; padding: 8px 10px; border-left: 3px solid #E3B35A; background: #FFF1D6; color: #5C3B00; border-radius: 6px; }
@media (max-width: 640px) { .pd-head { flex-wrap: wrap; } .pd-title { flex-basis: calc(100% - 30px); } .pd-sel { flex: 1; } .pd-body { padding-left: 12px; } }
.pd-sent { border: 2px solid #2f855a; border-radius: 10px; padding: 12px; margin: 10px 0; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.pd-sent h3 { margin: 0; } .pd-sent input { flex: 1; min-width: 0; }
.pd-items { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; }
.pd-items li span:first-child { margin-right: 8px; }
.pd-perms { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; }
.mk-ob { width: 100%; height: min(72vh, 680px); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

/* chat (computador): etapa do funil e etiquetas logo depois do nome, na mesma linha dos botões */
@media (min-width: 980px) {
  .chat-head { flex-wrap: nowrap; }
  .chat-head .who { flex: 0 1 auto; min-width: 120px; }
  .chat-head .hcls { order: 0; flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; }
  .chat-head .icon[data-act="snooze"] { margin-left: auto; }
}
.ap-cv { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.ap-cvb { text-align: left; justify-content: flex-start; }

/* Agenda */
.ag-card { padding-bottom: 12px; }
.ag-gc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; }
.ag-gst.ok { color: #2f7d5b; font-weight: 600; }
.ag-tool { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.ag-seg .btn-sm:first-child { border-radius: 8px 0 0 8px; } .ag-seg .btn-sm:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.ag-seg .btn-sm.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ag-who { display: inline-flex; align-items: center; gap: 6px; }
.ag-who .lbl { white-space: nowrap; }
.ag-new { margin-left: auto; }
.ag-day h3 { margin: -10px -10px 8px; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.ag-mh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.ag-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.ag-cell { display: flex; flex-direction: column; gap: 2px; align-items: stretch; text-align: left; min-height: 96px; padding: 4px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; color: inherit; min-width: 0; overflow: hidden; }
.ag-cell:hover { border-color: var(--accent); }
.ag-cell.out { opacity: .5; }
.ag-cell.today { border-color: #2f7d5b; box-shadow: 0 0 0 1px #2f7d5b inset; }
.ag-pv { font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-pv.g { color: var(--muted); }
.ag-more { font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .ag-cell { min-height: 64px; padding: 3px; } .ag-pv { font-size: 10px; } .ag-new { margin-left: 0; } }
@media (min-width: 1100px) { .ag-week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.ag-day { display: flex; flex-direction: column; gap: 8px; }
.ag-day h3 { margin: -10px -10px 0; padding: 8px 10px; background: var(--head); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.ag-day.today h3 { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ag-item { border: 1px solid var(--line); border-left: 4px solid #d19a1f; border-radius: 8px; padding: 8px 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ag-item.confirmed { border-left-color: #2f7d5b; }
.ag-item.done { border-left-color: #8a97a3; }
.ag-item.canceled, .ag-item.noshow { border-left-color: #8a97a3; }
.ag-item.ag-g { border-left-color: #8a97a3; background: var(--surface-2); }
.ag-cl { font-weight: 700; }
.ag-free { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; text-align: left; min-width: 0; }
button.ag-free { cursor: pointer; }
button.ag-free:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ag-free.past { opacity: .45; }
.ag-cn { font-weight: 700; font-size: 12px; background: var(--head); border-radius: 4px; padding: 0 5px; align-self: flex-start; }
.ag-mh span { background: var(--head); border-radius: 6px; padding: 4px 0; }
.ag-nav { font-size: 14px; min-width: 210px; margin-right: 30px; }
.ag-seg { display: inline-flex; margin-right: 30px; }
.ag-seg .btn-sm { border-radius: 0; width: 92px; text-align: center; justify-content: center; }
.ag-seg .btn-sm:first-child { border-radius: 8px 0 0 8px; } .ag-seg .btn-sm:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.ag-seg .btn-sm.on { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 700px) { .ag-nav { min-width: 0; margin-right: 8px; } .ag-seg { margin-right: 8px; } }

.ag-act { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; margin-top: 4px; }
.ag-item .btn-sm { padding: 3px 9px; font-size: 12px; line-height: 1.3; }
.ag-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ag-menu .btn-sm { text-align: left; padding: 8px 10px; font-size: 13px; }

.ag-item { position: relative; }
.ag-item .ag-h { padding-right: 26px; }
.ag-dots { position: absolute; top: 4px; right: 4px; width: 24px; height: 28px; border: 0; background: transparent; border-radius: 6px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.ag-dots:hover, .ag-dots.on { background: var(--head); color: var(--ink); }
.ag-act:empty { display: none; }

.ag-item.menu-open { min-height: 190px; }
.ag-drop { position: absolute; top: 34px; right: 6px; z-index: 2; min-width: 150px; max-width: calc(100% - 12px); display: flex; flex-direction: column; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ag-drop button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.ag-drop button:hover { background: var(--head); }
.ag-drop button.bad { color: #b3261e; }
.ag-act { flex-direction: column; align-items: stretch; gap: 6px; }
.ag-act .btn-sm { width: 100%; text-align: center; justify-content: center; padding: 6px 10px; }
.ag-act { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
.ag-act .btn-sm { flex: 1 1 0; width: auto; min-width: 0; white-space: nowrap; padding: 6px 4px; }

.ag-free.off { border-style: dotted; opacity: .6; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 12px); }
button.ag-free.off:hover { opacity: 1; border-color: #b3261e; color: #b3261e; background: transparent; }
.wh-box { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.wh-row .cfg-in { padding: 5px 6px; }

.mfwd.eq-wide { align-items: center; padding: 8px; }
.mfwd.eq-wide .mfwd-box { max-height: calc(100vh - 16px); gap: 6px; }
.mfwd.eq-wide .eq-edit { gap: 6px; }
.mfwd.eq-wide .wh-box { gap: 3px; margin: 2px 0 6px; }
.mfwd.eq-wide .wh-row .cfg-in { padding: 3px 6px; }
.mfwd.eq-wide textarea.cfg-in { min-height: 0; }

.wh-row { display: grid; grid-template-columns: 110px repeat(4, 124px); justify-content: start; align-items: center; gap: 6px; }
.wh-head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
@media (max-width: 760px) { .wh-row { grid-template-columns: 90px repeat(4, minmax(0, 1fr)); gap: 4px; } .wh-head { font-size: 9px; } .wh-row .cfg-in { padding: 3px 2px; font-size: 12px; } }

/* ===== Automação / Chatbot / IA: layout compacto em tela cheia ===== */
#auto, #chatbot, #ia { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; max-width: none; width: 100%; align-content: start; font-size: 12px; }
#auto[hidden], #chatbot[hidden], #ia[hidden] { display: none; }
#auto > *, #chatbot > *, #ia > * { flex: 0 0 auto; }
:is(#auto, #chatbot, #ia) .cfg-card { padding: 10px 14px; border-radius: 10px; }
:is(#auto, #chatbot, #ia) .cfg-card > .cfg-title:first-child { margin: -10px -14px 8px; padding: 6px 14px; min-height: 40px; }
:is(#auto, #chatbot, #ia) .cfg-card .cfg-title h2 { font-size: 13px; }
:is(#auto, #chatbot, #ia) .cfg-help { margin: 0 0 8px; font-size: 11px; line-height: 1.4; max-width: 1200px; }
:is(#auto, #chatbot, #ia) .muted { font-size: 11px; }
:is(#auto, #chatbot, #ia) .rules { margin: 0; gap: 8px; display: grid; grid-template-columns: 1fr; list-style: none; padding: 0; }
:is(#auto, #chatbot, #ia) .rule { padding: 8px 10px; gap: 6px 8px; border-radius: 10px; }
:is(#auto, #chatbot, #ia) .rule-f { gap: 2px; flex: 1 1 160px; min-width: 0; }
:is(#auto, #chatbot, #ia) .rule-f .lbl { font-size: 10px; text-transform: none; letter-spacing: 0; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#auto, #chatbot, #ia) :is(.cfg-in, .cfg-move, select, textarea, .rule-on, .btn-sm) { font-size: 12px; }
:is(#auto, #chatbot, #ia) :is(.cfg-in, .cfg-move) { min-height: 30px; }
:is(#auto, #chatbot, #ia) .btn-sm { min-height: 28px; padding: 0 10px; }
:is(#auto, #chatbot, #ia) .cfg-card > .cfg-in { width: 100%; }
#auto #ruleTestOut { margin-top: 6px; }
/* barra de liga/desliga */
.cfg-card.bar { background: var(--accent-soft); border-color: var(--accent); padding: 0 !important; }
.cfg-card.bar > .cfg-title:first-child { margin: 0 !important; background: transparent !important; border: 0 !important; padding: 8px 14px !important; min-height: 48px; }
.cfg-card.bar .bar-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cfg-card.bar .bar-t h2 { font-size: 14px !important; }
.cfg-card.bar .bar-t .muted { font-size: 11px; }
/* linha única: [ligado/nome] campos... [Excluir] */
@media (min-width: 1100px) {
  #auto .rule { display: grid; grid-template-columns: 78px 1.5fr 2fr 1fr 1fr 1fr 1.35fr 66px; align-items: end; }
  #auto .rule-h, #auto .rule-row { display: contents; }
  #auto .rule-h .rule-on { grid-area: 1 / 1; }
  #auto .rule-h .btn-sm.danger { grid-area: 1 / 8; justify-self: end; }
  #auto .rule > * { min-width: 0; }
  #auto .rule p.rule-f { font-size: 10px; line-height: 1.25; margin: 0; align-self: center; }
  #chatbot .botc { display: grid; grid-template-columns: 78px 1.2fr 1fr 1fr 110px; align-items: end; gap: 6px 8px; }
  #chatbot .botc > .rule-h, #chatbot .botc > .rule-row { display: contents; }
  #chatbot .botc > .rule-h .rule-on { grid-area: 1 / 1; }
  #chatbot .botc > .rule-h .btn-sm.danger { grid-area: 1 / 5; justify-self: end; }
  #chatbot .botc > label.rule-f:has(textarea) { grid-column: 1 / 4; }
  #chatbot .botc > label.rule-f:has([data-cfg="bot-bad"]) { grid-column: 4 / -1; }
  #chatbot .botc > .field, #chatbot .botc > .bot-prev, #chatbot .botc > p { grid-column: 1 / -1; }
  #chatbot .botc .rule.bo { display: grid; grid-template-columns: 78px 1fr 1.3fr 1fr 1fr 1fr 1fr 66px; align-items: end; background: var(--surface); }
  #chatbot .botc .rule.bo .rule-h, #chatbot .botc .rule.bo .rule-row { display: contents; }
  #chatbot .botc .rule.bo .rule-h > strong { grid-area: 1 / 1; align-self: center; }
  #chatbot .botc .rule.bo .rule-h .btn-sm.danger { grid-area: 1 / 8; justify-self: end; }
}
@media (max-width: 1099px) {
  #auto .rule, #chatbot .rule { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); align-items: end; }
  #auto .rule-h, #chatbot .rule-h { grid-column: 1 / -1; }
  #auto .rule-row, #chatbot .rule-row { display: contents; }
}
#chatbot .botc { gap: 6px 8px; }
#chatbot .bot-prev pre { max-height: 100px; overflow: auto; padding: 6px 8px; font-size: 12px; margin: 0; }
#chatbot .botc p.muted { margin: 0; }
#chatbot textarea.qtx { min-height: 0; }
/* IA */
.ia-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr .8fr 2.2fr; gap: 6px 8px; align-items: end; margin-bottom: 8px; }
.ia-row .ia-w { grid-column: auto; }
#ia .ia-prompt { display: flex; }
#ia .ai-prompt { width: 100%; min-height: 90px; resize: vertical; line-height: 1.4; }
#ia .ia-note { margin: 6px 0 0; }
.ia-test { display: flex; gap: 8px; align-items: center; }
.ia-test .cfg-in { flex: 1; width: auto; }
#ia .ai-test { margin-top: 8px; }
#ia .ai-rules { margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.5; display: block; columns: 2; column-gap: 32px; }
#ia .ai-rules li { break-inside: avoid; margin-bottom: 3px; }
@media (max-width: 1099px) { .ia-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
/* instruções e preenchimentos da IA: uma linha, Excluir no fim */
#iaBlocks { display: flex; flex-direction: column; gap: 10px; }
#iaBlocks .kb-ia { grid-template-columns: 1fr !important; gap: 10px; margin-top: 0; }
#iaBlocks .rule.ins { display: grid; grid-template-columns: 96px 1fr 3fr 66px; align-items: end; gap: 6px 8px; }
#iaBlocks .rule.ins.ext { grid-template-columns: 96px 1fr 1fr 90px 2.4fr 66px; }
#iaBlocks .rule.ins .switch { align-self: end; }
#iaBlocks .ins-del { justify-self: end; }
#iaBlocks .rule.ins textarea { min-height: 30px; resize: vertical; }
@media (max-width: 1099px) { #iaBlocks .rule.ins, #iaBlocks .rule.ins.ext { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } #iaBlocks .rule.ins .ins-body { grid-column: 1 / -1; } }
/* Mensagens rápidas: tela cheia e mais compacto */
#respostas { max-width: none; width: 100%; font-size: 12px; gap: 10px; }
#respostas .cfg-card { padding: 10px 14px; }
#respostas .cfg-card > .cfg-title:first-child { margin: -10px -14px 8px; padding: 6px 14px; min-height: 40px; }
#respostas .cfg-help { margin: 0 0 8px; font-size: 11px; }
#respostas .cfg-card > .rule-row { display: flex; gap: 8px; max-width: 420px; }
#respostas .qr-cats { margin: 8px 0; }
#respostas .acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
#respostas .acc-card { padding: 8px 10px; gap: 4px; border-radius: 10px; }
#respostas .acc-main { gap: 6px; flex-wrap: nowrap; }
#respostas .acc-t { flex: 1 1 auto; }
#respostas .acc-note { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#respostas .acc-btns { gap: 6px; margin-top: 2px; }
#respostas .btn-sm { min-height: 26px; padding: 0 9px; font-size: 12px; }
#respostas .pill { font-size: 10px; padding: 1px 7px; }
/* modelos do painel principal (master) */
.mp-card .tp-h { margin: 0; }
.tp-sec { margin: 0 0 10px; border: 1px solid var(--line, #d8dce6); border-radius: 10px; overflow: hidden; background: var(--surface); }
.tp-sec > .cfg-title { margin: 0; padding: 6px 14px; min-height: 40px; background: var(--head); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; text-transform: uppercase; letter-spacing: .04em; }
.tp-sec > .cfg-title h2, .tp-sec > .cfg-title h3 { margin: 0; font-size: 13px; }
.tp-sec .tp-list { padding: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tp-form { font-size: 12px; }
.tp-form .rule-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.tp-form .cfg-in, .tp-form .cfg-move { font-size: 12px; min-height: 30px; }
.tp-form .lbl { font-size: 10px; }
.cfg-card.bar .bar-t .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* barra mais baixa: título e texto na mesma linha */
.cfg-card.bar .bar-t { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cfg-card.bar > .cfg-title:first-child { min-height: 40px; padding: 6px 14px !important; }
.cfg-card.bar .bar-t h2 { white-space: nowrap; }
/* instruções da IA: tudo alinhado no topo */
#iaBlocks .rule.ins { align-items: start; }
#iaBlocks .rule.ins .switch { align-self: start; margin-top: 14px; }
#iaBlocks .ins-del { align-self: start; margin-top: 14px; }

/* Configurações: chave da OpenAI e do Asaas em tela cheia, campo + botões numa linha */
#aiKeyCard .cfg-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#aiKeyCard .ai-key-state { margin: 0; font-size: 12px; }
#aiKeyCard .cfg-help, #asCard .cfg-help { margin: 6px 0 10px; }
.keyrow { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.keyrow .rule-f { flex: 1 1 320px; max-width: 640px; margin: 0; }
.keyrow .cfg-in { width: 100%; }
.keyrow .btn-sm { flex: none; }

/* Ícones dos canais: logotipo em branco sobre a cor da marca */
.badge.chb { width: 20px; height: 20px; border-radius: 6px; font-size: 0; }
.badge.chb svg { display: block; }

/* Conversas paradas */
.conv.stalled { background: #FDECEC; box-shadow: inset 3px 0 0 #D93B3B; }
.conv.stalled[aria-current="true"] { background: #FADADA; }
.conv.stalled.blink { animation: stBlink 1s ease-in-out infinite alternate; }
@keyframes stBlink { from { background: #FDECEC; } to { background: #F6B3B3; } }
@media (prefers-reduced-motion: reduce) { .conv.stalled.blink { animation: none; background: #F6B3B3; } }
#stallAlerts { position: fixed; right: 16px; bottom: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.stall-al { background: #fff; border: 1px solid #E5A3A3; border-left: 4px solid #D93B3B; border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(15,23,42,.22); display: grid; gap: 2px; font-size: 13px; }
.stall-al span { color: #5B6578; }
.stall-al .st-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
body.stall-modal::before { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 1000; }
body.stall-modal #inbox .pane-chat { position: fixed; z-index: 1001; inset: 8vh 6vw 4vh; display: flex !important; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
body.stall-modal #inbox .pane-chat .msgs { flex: 1 1 auto; min-height: 0; overflow: auto; }
#stallBar { position: fixed; z-index: 1002; top: 2vh; left: 6vw; right: 6vw; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #D93B3B; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
#stallBar .bad { background: #fff; color: #B42318; padding: 2px 8px; border-radius: 6px; }
#stallBar .btn-sm { background: rgba(255,255,255,.2); color: #fff; border-color: transparent; }
.st-row { flex-wrap: wrap; }
.st-row .st-min { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5B6578; white-space: nowrap; }
.st-row .st-min .cfg-in { width: 72px; }

/* avisos: com X e sumindo sozinhos */
.toast { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.toast .toast-t { flex: 1; }
.toast-x { flex: none; border: 0; background: transparent; color: inherit; opacity: .7; font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }
.toast-x:hover { opacity: 1; }
.stall-al { position: relative; padding-right: 30px; }
.stall-al .toast-x { position: absolute; top: 6px; right: 8px; color: #5B6578; }

/* Pesquisa de satisfação: respiro e rótulo alinhado ao topo */
.cfg-tgs + .rule-row { margin-top: 12px; }
.rule-row + .csat-msg { margin-top: 14px; }
.csat-msg { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; align-items: start; }
.csat-msg .lbl { font-size: 12px; color: var(--muted); padding-top: 9px; }
.csat-msg textarea { width: 100%; min-height: 0; resize: vertical; font: inherit; box-sizing: border-box; }
@media (max-width: 600px) { .csat-msg { grid-template-columns: 1fr; } .csat-msg .lbl { padding-top: 0; } }

/* Classificação por etiqueta: título, grupos e aviso numa linha só (quebra em telas estreitas) */
.cfg-req { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.cfg-req .lbl-t { text-transform: none; letter-spacing: 0; font-weight: 600; }
.cfg-req .muted { font-size: 12px; }
.cfg-req .lbl-t .up { text-transform: uppercase; letter-spacing: 0.03em; }

/* Importar e exportar contatos */
#ie .cfg-card + .cfg-card { margin-top: 12px; }
#ie .ie-grp { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
#ie .ie-sp { display: block; margin-top: 14px; }
#ie .lbl-t { font-size: 12px; color: var(--muted); font-weight: 600; }
#ie .chk { display: flex; align-items: center; gap: 8px; }
#ie .cfg-card > .cfg-move, #ie .cfg-card > .rule-f, #ie .cfg-card > .acc-btns { margin-top: 10px; }

/* Contatos: seleção, bloqueio */
.ct-views { margin: 4px 0 8px; }
.ct-views .btn-sm[aria-pressed="true"] { background: var(--pri, #2457d6); color: #fff; border-color: transparent; }
.ct-bulk { align-items: center; margin-bottom: 8px; }
.ct-pk { width: 18px; height: 18px; margin-right: 8px; flex: none; }
#ie .ie-cc { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line, #d8dee8); border-radius: 10px; background: #f6f8fc; }

/* Contatos v2: painel lateral, filtros em uma linha, chips */
.ct-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; min-height: 360px; }
.ct-wrap.has-side { grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); }
.ct-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.ct-side { position: static; min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; }
.side-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.side-h .acc-t { flex: 1; min-width: 0; }
.dl { margin: 10px 0; display: grid; gap: 6px; }
.dl-r { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.dl-r dt { color: var(--muted); }
.dl-r dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.ct-filters { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; margin: 8px 0; }
.ct-filters .ct-q { flex: 2 1 260px; min-width: 200px; }
.ct-fb { display: flex; gap: 8px; align-items: center; margin-left: 4px; }
.ms { position: relative; flex: 1 1 200px; min-width: 170px; }
.ms > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ms > summary::-webkit-details-marker { display: none; }
.ms .ms-v { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2, #f6f8fc); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-p { position: absolute; z-index: 30; left: 0; top: 100%; margin-top: 4px; min-width: 260px; max-width: 360px; max-height: 340px; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.ms-g { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.ms-o { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-row { cursor: pointer; }
.ct-row.on { border-color: var(--pri, #2457d6); box-shadow: 0 0 0 1px var(--pri, #2457d6) inset; background: rgba(36, 87, 214, .14); }
.ct-row .acc-main { flex-wrap: wrap; }
.ct-row .ct-chips { margin-left: auto; justify-content: flex-end; max-width: 55%; }
.pill.tg { background: #eef2ff; border-color: #c9d3f5; color: #2b3f8f; }
.pill.st { background: #ecfdf3; border-color: #bfe8cf; color: #176b3a; }
.ct-side-act { margin-top: 14px; }
@media (max-width: 900px) {
  .ct-wrap.has-side { grid-template-columns: minmax(0, 1fr); }
  .ct-wrap.has-side .ct-main { display: none; }
  .ct-side { max-height: none; }
  .ct-row .ct-chips { max-width: 100%; margin-left: 0; justify-content: flex-start; }
}
#contatos { max-width: none !important; }

/* Contatos: painel único ocupando a tela, lista rolando por dentro */
#contatos .ct-panel { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
#contatos .ct-panel > * { flex: none; }
#contatos .ct-panel > #ctList { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#contatos .ct-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
#contatos .ct-head .ct-views { margin: 0; }
#contatos .ct-edit .ct-grid { grid-template-columns: minmax(0, 1fr); }

/* Funis e Etiquetas: colunas alinhadas, uma linha embaixo da outra */
@media (min-width: 980px) {
  #etiquetas .cfg-list > li.cfg-row { display: grid; align-items: center; column-gap: 18px; grid-template-columns: 22px 12px minmax(200px, 340px) 44px 210px 130px 1fr 84px; padding: 4px 0; }
  #funis .cfg-stages > li.cfg-row { display: grid; align-items: center; column-gap: 18px; grid-template-columns: 22px 22px minmax(200px, 340px) 44px 210px 1fr 84px; padding: 4px 0; }
  #etiquetas .cfg-list > li.cfg-row .cfg-in, #funis .cfg-stages > li.cfg-row .cfg-in { width: 100%; min-width: 0; }
  #etiquetas .cfg-list > li.cfg-row .cfg-move { max-width: none; width: 100%; }
  #etiquetas .cfg-flags, #funis .cfg-flags { display: flex; flex-wrap: nowrap; gap: 28px; white-space: nowrap; padding: 0; }
  #etiquetas .cfg-list > li.cfg-row .cfg-n, #funis .cfg-stages > li.cfg-row .cfg-n { white-space: nowrap; }
  #funis .cfg-pipe > .cfg-row { column-gap: 18px; }
}

/* Avisos de pendência: configuração à esquerda e textos à direita */
.mk-av { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1100px) { .mk-av { grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); } }
.mk-mdls { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.mk-mdl { border: 1px solid var(--line, #dfe3ea); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.mk-mdl.off { opacity: .6; }
.mk-mdl-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.mk-mdl textarea { width: 100%; resize: vertical; font: inherit; line-height: 1.4; }
.mk-prev { white-space: pre-wrap; margin: 6px 0 0; padding: 10px; border-radius: 8px; background: rgba(36, 87, 214, .07); font: inherit; }

.mk-pub .mk-time { font-weight: 600; min-width: 5.5em; }
.mk-pub.off { opacity: .55; }

#iaBlocks .ins-mv { display: inline-flex; gap: 2px; align-self: start; margin-top: 14px; }
#iaBlocks .rule.ins { grid-template-columns: 22px 96px 1fr 3fr 66px; }
#iaBlocks .rule.ins.ext { grid-template-columns: 22px 96px 1fr 1fr 90px 2.4fr 66px; }
#iaBlocks .rule.ins .cfg-drag { align-self: start; margin-top: 16px; }
.mk-av > div:first-child { display: flex; flex-direction: column; gap: 12px; }

/* ordenar arrastando (sort.js) */
.cfg-drag{touch-action:none}
[data-sort-i].sort-drag{opacity:.45}
[data-sort-i].sort-before{box-shadow:0 -2px 0 0 var(--brand,#2563eb)}
[data-sort-i].sort-after{box-shadow:0 2px 0 0 var(--brand,#2563eb)}
[data-sort].sort-end{box-shadow:inset 0 -2px 0 0 var(--brand,#2563eb)}
.qb-h .cfg-drag{margin-right:6px}
.cfg-pipe > .cfg-row > .cfg-drag{margin-right:4px}

/* Botão Excluir: um só formato em todo o sistema (fundo claro, texto vermelho, mesma altura). Fica no fim da linha. */
.btn-sm.danger:not(#_) { background: var(--surface); color: var(--bad); border: 1px solid var(--line); min-height: 28px; padding: 0 12px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.btn-sm.danger:not(#_):hover { background: var(--surface-2); border-color: var(--bad); }
.cfg-row > .btn-sm.danger { justify-self: end; margin-left: auto; }

/* IA (ia.js): lista de IAs, resumo e passos. Tela inteira; negrito só nos títulos. */
#ia { --ixg: #1B7F4B; --ixw: #E0A25A; }
#ia h2, #ia h3 { margin: 0; font-weight: 700; } #ia h2 { font-size: 18px; } #ia h3 { font-size: 15px; }
#ia b, #ia strong { font-weight: 400; }
.ix-sm { font-size: 13px; } .ix-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; } .ix-row > h2, .ix-row > h3 { margin-right: auto; }
.ix-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ix-p { text-transform: none; letter-spacing: 0; display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.ix-p.g { background: #DDF3E6; color: #17683D; } .ix-p.o { background: #FBE8D6; color: #8A4B06; } .ix-p.n { background: var(--surface-2); color: var(--muted); border-color: var(--line); } .ix-p.b { background: var(--accent-soft); color: var(--accent); } .ix-p.p { background: #EDE7FA; color: #3F2A86; }
.ix-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.ix-step { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ix-step.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); } .ix-step.add { border-style: dashed; color: var(--accent); }
.ix-pick { min-height: 36px; border-radius: 99px; border: 1px solid #14202B; background: #14202B; color: #fff; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; max-width: 260px; }
.ix-dot { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ixg); color: #fff; font-size: 11px; font-style: normal; } .ix-dot.w { background: var(--ixw); } .ix-dot.n { background: #C5CDD5; color: #14202B; }
.ix-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; } .ix-head p { margin: 4px 0 0; } .ix-head .ix-btns { margin: 0; }
.ix-cols { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; } .ix-main { flex: 3 1 760px; min-width: 0; display: flex; flex-direction: column; gap: 14px; } .ix-side { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ix-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ix-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; } .ix-card.sel { border: 2px solid var(--accent); }
.ix-dots { display: flex; gap: 5px; } .ix-dots i { flex: 1; height: 7px; border-radius: 99px; background: #C5CDD5; } .ix-dots i.d { background: var(--ixg); } .ix-dots i.w { background: var(--ixw); }
.ix-card > .ix-p { align-self: flex-start; }
.ix-kv { display: flex; flex-direction: column; } .ix-kv > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--surface-2); } .ix-kv > div > span:last-child { text-align: right; overflow-wrap: anywhere; }
.ix-scroll { overflow-x: auto; } .ix-table { width: 100%; border-collapse: collapse; } .ix-table th, .ix-table td { text-align: left; padding: 9px 10px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: top; } .ix-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; font-weight: 500; }
.ix-tpls { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; } .ix-tpl { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; } .ix-tpl.dash { border-style: dashed; }
.ix-ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.55; font-size: 14px; }
.ix-lnk { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 500; padding: 4px 0; cursor: pointer; text-decoration: underline; }
.ix-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .ix-hero-t { flex: 1 1 300px; } .ix-hero-t p { margin: 6px 0 0; } .ix-hero-t .ix-row { justify-content: flex-start; } .ix-hero-t h2 { font-size: 24px; margin-right: 0; }
.ix-stats { flex: 3 1 640px; display: flex; gap: 10px; flex-wrap: wrap; } .ix-stats > div { flex: 1 1 130px; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; } .ix-stats b { font-size: 20px; font-family: var(--f-display); font-weight: 700; color: var(--ink); }
.ix-stats > div.ok { background: #DDF3E6; color: #17683D; } .ix-stats > div.ok b { color: #17683D; } .ix-stats > div.bad { background: #FBE4E2; color: #7A1C14; } .ix-stats > div.bad b { color: #7A1C14; }
.ix-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ix-sum { display: flex; flex-direction: column; } .ix-sum.warn { border-color: var(--ixw); background: #FFFBF5; } .ix-sum .ix-btns { margin-top: auto; padding-top: 10px; }
.ix-sc { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; } .ix-sc > div { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; padding: 7px 10px; background: var(--surface-2); border-radius: 8px; } .ix-sc > div.w { background: #FBE8D6; } .ix-sc > div > span:last-child { text-align: right; }
.ix-cols2 { display: flex; gap: 14px; flex-wrap: wrap; } .ix-cols2 > * { flex: 1 1 380px; } .ix-addc { flex: 2 1 600px; border-style: dashed; background: var(--surface-2); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.ix-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; } .ix-3b { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ix-colA, .ix-colB, .ix-colC, .ix-colR { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ix-2c { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; } .ix-2r { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.ix-f { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; min-width: 0; } .ix-lb { font-size: 12px; color: var(--muted); display: block; margin: 8px 0 4px; } .ix-f .ix-lb { margin: 0; }
.ix-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 10px; }
.ix-info { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; margin: 6px 0; font-size: 14px; } .ix-info .ix-lb { margin: 0; }
.ix-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 2px 0 6px; } .ix-seg button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; } .ix-seg button:last-child { border-right: 0; }
.ix-seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .ix-seg button.on.ia { background: #DDF3E6; color: #17683D; } .ix-seg button.on.sugere { background: var(--accent-soft); color: var(--accent); } .ix-seg button.on.pessoa { background: #FBE8D6; color: #8A4B06; } .ix-seg button:disabled { opacity: .55; }
.ix-box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin: 10px 0; } .ix-box.warn { background: #FBE8D6; color: #5C3B00; }
.ix-ck { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 14px; line-height: 1.45; } .ix-ck input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.ix-num { width: 64px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; text-align: center; } .ix-line { margin: 12px 0; font-size: 14px; line-height: 2; } .ix-line b { color: var(--accent); }
.ix-sr { margin: 10px 0; } .ix-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .ix-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.ix-add { border: 1px dashed var(--accent); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; max-width: 220px; min-height: 30px; }
.ix-chat { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; } .ix-chat.big { max-height: 440px; overflow-y: auto; padding: 4px 2px; }
.ix-b { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; } .ix-b.me { align-self: flex-end; background: var(--accent-soft); } .ix-b.ia { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.ix-why { align-self: flex-start; max-width: 90%; background: #FFFBF5; border: 1px solid #F0D9B5; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.5; } .ix-why .ix-lb { margin: 0 0 2px; }
.ix-stat { list-style: none; margin: 8px 0; padding: 0; } .ix-stat li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--surface-2); font-size: 14px; } .okc { color: #17683D; } .badc { color: var(--bad); }
.ix-tl { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; } .ix-ev { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; } .ix-t { width: 44px; flex: none; color: var(--muted); } .ix-ev i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.ix-srow { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--surface-2); } .ix-srow.def { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; border-top: 0; margin-bottom: 4px; }
.ix-gw { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; } .ix-gs { flex: 0 0 210px; display: flex; flex-direction: column; gap: 4px; } .ix-g { display: flex; justify-content: space-between; gap: 6px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; color: inherit; } .ix-g.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .ix-g small { color: var(--muted); }
.ix-rs { flex: 1 1 340px; min-width: 0; } .ix-rtop { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; } .ix-rtop .ix-btns { margin: 0; } .ix-rtop p { margin: 4px 0 0; }
.ix-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; } .ix-rule { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); } .ix-rule.off { background: var(--surface-2); } .ix-rule p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.ix-rb { flex: 1; min-width: 0; } .ix-rb .ix-row { justify-content: flex-start; } .ix-edit { margin-top: 8px; } .ix-tasks { list-style: none; margin: 10px 0; padding: 0; }
.ix-kbw { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; } .ix-kbs { flex: 2 1 460px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; } .ix-kba { flex: 1 1 320px; }
.ix-kb { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; background: var(--surface); } .ix-kb.sel { border: 2px solid var(--accent); } .ix-kb.need { border-color: var(--ixw); background: #FFFBF5; } .ix-kb.off { opacity: .7; }
.ix-when { font-size: 13px; line-height: 1.45; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; } .ix-when .ix-lb { margin: 0 0 2px; } .ix-find { margin: 10px 0; } .ix-st { border-top: 1px solid var(--line); padding: 10px 0; }
@media (max-width: 1199px) { .ix-3, .ix-3b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 799px) { .ix-3, .ix-3b, .ix-2c, .ix-2r, .ix-grid { grid-template-columns: minmax(0, 1fr); } .ix-gs { flex-basis: 100%; } .ix-b { max-width: 94%; } }

.ix-srow > div:first-child { flex: 1 1 130px; } .ix-srow .ix-seg { flex-wrap: nowrap; }
.ix-rbtn { margin: 0; flex: 0 0 auto; align-self: flex-start; } .ix-ul details summary { cursor: pointer; }
.ix-fl { border-top: 1px solid var(--line); padding: 12px 0; } .ix-fl.off { opacity: .6; } .btn-sm.disabled { opacity: .5; pointer-events: none; }
.wa-prev { margin: 6px 0 10px; padding: 10px; border-radius: 10px; background: #e7ded3; background-image: radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px); background-size: 14px 14px; }
.wa-bub { position: relative; display: inline-block; max-width: 85%; padding: 6px 9px 16px; background: #d9fdd3; color: #111b21; border-radius: 8px 8px 2px 8px; font-size: 13.5px; line-height: 1.4; box-shadow: 0 1px .5px rgba(0,0,0,.13); word-break: break-word; }
.wa-t { position: absolute; right: 7px; bottom: 2px; font-size: 10.5px; color: #667781; }
.wa-prev .muted { color: #54656f; margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-prev { background: #0b141a; } :root:not([data-theme="light"]) .wa-bub { background: #005c4b; color: #e9edef; } :root:not([data-theme="light"]) .wa-t { color: #8fb3aa; } }
:root[data-theme="dark"] .wa-prev { background: #0b141a; } :root[data-theme="dark"] .wa-bub { background: #005c4b; color: #e9edef; } :root[data-theme="dark"] .wa-t { color: #8fb3aa; }
.conv-add { display: block; width: calc(100% - 16px); margin: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.conv-add:hover, .conv-add:focus-visible { border-color: var(--primary, #2255D4); }
.mgal summary { cursor: pointer; padding: 2px 0; } .mgal-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.mgal-g img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; } .mgal-ph { display: grid; place-items: center; aspect-ratio: 1; background: var(--surface-2); border-radius: 6px; }
.mgal-l { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; } .mgal-l li { padding: 4px 0; overflow-wrap: anywhere; }

/* ===== Campanhas (lista + editor em duas colunas) ===== */
.cp { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.cp h2 { margin: 0; font-size: 20px; }
.cp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cp-top .cfg-help { max-width: 760px; margin: 4px 0 0; }
.cp-top .link { margin-bottom: 4px; }
.cp-none { border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; background: var(--surface); }
.cp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--line); }
.cp-card.st-running { border-top-color: var(--good); } .cp-card.st-paused { border-top-color: #d99a1a; } .cp-card.st-draft { border-top-color: var(--accent); }
.cp-c-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cp-c-h strong { font-size: 15px; display: block; } .cp-when { display: block; font-size: 12px; color: var(--accent); margin-top: 2px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cp-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.cp-neg { color: var(--bad); }
.cp-msg { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.4; }
.cp-nums, .cp-sub { margin: 0; font-size: 12.5px; color: var(--muted); } .cp-nums b { color: var(--ink); }
.cp-bad { color: var(--bad); }
.cp-alert { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fdecea; color: #8a1c14; font-size: 12.5px; border: 1px solid #f3b8b3; }
.cp-eta { margin: 0; font-size: 12.5px; color: var(--muted); } .cp-eta.warn { color: var(--bad); }
.cp-card .acc-btns { margin-top: auto; padding-top: 4px; }
.cp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.cp-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cp-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.cp-sec h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.cp-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.cp-hint { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.cp-row, .cp-row3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-l { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cp-h { font-size: 12px; color: var(--muted); line-height: 1.4; }
.cp-in { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13.5px; min-width: 0; }
.cp-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
select.cp-in { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23586774' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; text-overflow: ellipsis; }
textarea.cp-in { resize: vertical; line-height: 1.45; }
.cp-segs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; align-self: flex-start; }
.cp-seg { border: 0; background: var(--surface); padding: 8px 14px; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line); cursor: pointer; }
.cp-seg:last-child { border-right: 0; } .cp-seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); min-height: 38px; box-sizing: border-box; }
.cp-tags .mini-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; font-size: 12.5px; }
.cp-x { border: 0; background: transparent; cursor: pointer; font-size: 11px; line-height: 1; color: inherit; opacity: .65; padding: 3px 5px; border-radius: 50%; }
.cp-x:hover { opacity: 1; background: rgba(0,0,0,.1); }
.cp-in.cp-add { width: auto; min-width: 150px; max-width: 100%; padding: 4px 28px 4px 10px; border-style: dashed; background-color: var(--surface); font-size: 12.5px; color: var(--accent); }
.cp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .cp-tools .muted { margin-left: auto; font-size: 12px; }
.cp-drop { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; padding: 16px; border: 1.5px dashed var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); text-align: center; }
.cp-drop:hover { border-color: var(--accent); background: var(--accent-soft); } .cp-drop span { font-weight: 600; font-size: 13.5px; color: var(--accent); } .cp-drop small { color: var(--muted); font-size: 12px; } .cp-drop.busy { opacity: .6; pointer-events: none; }
.cp-att { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.cp-att > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .cp-att b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; } .cp-att small { color: var(--muted); font-size: 12px; }
.cp-thumb { width: 54px; height: 54px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; overflow: hidden; flex: 0 0 auto; }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cp-days { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-day { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.cp-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cp-side { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 20px); overflow-y: auto; padding-right: 2px; }
.cp-side h3 { margin: 0 0 8px; font-size: 14px; }
.cp-pv, .cp-sum, .cp-risk, .cp-go { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cp-phone { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.08); background: #efe7dd; }
.cp-ph-top { display: flex; align-items: center; gap: 10px; background: #0f5d4f; color: #fff; padding: 9px 12px; }
.cp-ph-top b { display: block; font-size: 13.5px; line-height: 1.2; } .cp-ph-top small { font-size: 11px; opacity: .8; }
.cp-av { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #0f5d4f; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cp-ph-body { padding: 14px 10px 18px; min-height: 150px; background-color: #efe7dd; background-image: radial-gradient(rgba(0,0,0,.045) 1px, transparent 1px); background-size: 14px 14px; }
.cp-b { position: relative; max-width: 88%; margin-left: auto; background: #d9fdd3; color: #111b21; border-radius: 10px 10px 2px 10px; padding: 5px 8px 18px; box-shadow: 0 1px 1px rgba(0,0,0,.14); font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.cp-b::after { content: ''; position: absolute; right: -6px; bottom: 0; border: 6px solid transparent; border-left-color: #d9fdd3; border-bottom-color: #d9fdd3; }
.cp-img { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: 7px; margin-bottom: 5px; }
.cp-doc { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 7px; background: rgba(0,0,0,.06); margin-bottom: 5px; font-size: 12.5px; } .cp-doc span { background: #d33; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 5px; border-radius: 4px; } .cp-doc b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sair { margin-top: 6px; font-size: 11.5px; color: #54656f; font-style: italic; }
.cp-tm { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #667781; }
.cp-empty { margin: 0; text-align: center; color: #54656f; font-size: 12.5px; padding-top: 40px; }
.cp-ph-in { display: none; }
.cp-pv-bar { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cp-sum dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; } .cp-sum dt { color: var(--muted); } .cp-sum dd { margin: 0; text-align: right; }
.cp-risk { border-left: 4px solid var(--good); } .cp-risk.mid { border-left-color: #d99a1a; } .cp-risk.high { border-left-color: var(--bad); }
.cp-rk-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cp-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good); } .cp-risk.mid .cp-badge { background: #fbeccd; color: #8a5a00; } .cp-risk.high .cp-badge { background: #fdecea; color: var(--bad); }
.cp-meter { display: flex; gap: 4px; margin-bottom: 8px; } .cp-meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.cp-risk .cp-meter i.on { background: var(--good); } .cp-risk.mid .cp-meter i.on { background: #d99a1a; } .cp-risk.high .cp-meter i.on { background: var(--bad); }
.cp-risk ul { margin: 0 0 8px; padding-left: 18px; font-size: 12.5px; color: var(--ink); line-height: 1.4; } .cp-risk li { margin-bottom: 3px; }
.cp-risk p { margin: 0; font-size: 12.5px; }
.cp-go { display: flex; flex-direction: column; gap: 10px; }
.cp-ck { font-size: 12.5px; line-height: 1.4; align-items: flex-start; } .cp-ck.warn { color: var(--bad); }
.cp-create { width: 100%; padding: 11px; font-size: 14px; } .cp-create[disabled] { opacity: .5; cursor: not-allowed; }
.cp-small { margin: 0; font-size: 12px; }
@media (max-width: 1100px) { .cp-grid { grid-template-columns: 1fr; } .cp-side { position: static; max-height: none; } .cp-row3 { grid-template-columns: 1fr; } .cp-row { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cp-phone, :root:not([data-theme="light"]) .cp-ph-body { background-color: #0b141a; } :root:not([data-theme="light"]) .cp-b { background: #005c4b; color: #e9edef; } :root:not([data-theme="light"]) .cp-b::after { border-left-color: #005c4b; border-bottom-color: #005c4b; } :root:not([data-theme="light"]) .cp-sair, :root:not([data-theme="light"]) .cp-tm { color: #8fb3aa; } :root:not([data-theme="light"]) .cp-alert { background: #3a1a17; color: #ffb4ab; border-color: #6b2a24; } }
:root[data-theme="dark"] .cp-phone, :root[data-theme="dark"] .cp-ph-body { background-color: #0b141a; } :root[data-theme="dark"] .cp-b { background: #005c4b; color: #e9edef; } :root[data-theme="dark"] .cp-b::after { border-left-color: #005c4b; border-bottom-color: #005c4b; } :root[data-theme="dark"] .cp-sair, :root[data-theme="dark"] .cp-tm { color: #8fb3aa; } :root[data-theme="dark"] .cp-alert { background: #3a1a17; color: #ffb4ab; border-color: #6b2a24; }

#cpNote:empty { display: none; }
.cp-sec > .btn-sm { align-self: flex-start; }

/* campanhas: menu do chatbot na prévia, seção "quando responder", lista de quem recebeu */
.cp-menu { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.cp-menu > span:first-child { font-weight: 600; margin-bottom: 2px; }
.cp-reply { gap: 8px; margin-top: 12px; }
.cp-who { max-height: 50vh; overflow: auto; margin-top: 8px; }
.cp-who table { width: 100%; font-size: 13px; }

/* saúde do número */
.pill.hl-ok { background: #e3f6ea; color: #14683a; }
.pill.hl-warn { background: #fff3d6; color: #8a5a00; }
.pill.hl-risk { background: #fde4e1; color: #a1281c; }
.hl-box { border-left: 4px solid #d9892b; }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hl-list > li > ul { margin: 6px 0 4px 18px; padding: 0; }
@media (prefers-color-scheme: dark) { .pill.hl-ok { background: #123222; color: #8fe0b0; } .pill.hl-warn { background: #3a2c0c; color: #f2c46d; } .pill.hl-risk { background: #3d1612; color: #ff9d92; } }

/* receitas prontas de automação */
.rc-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.rc-list .acc-card { width: 100%; text-align: left; }
.rc-how { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.rc-msg { white-space: pre-wrap; background: var(--head); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; font-size: 13px; line-height: 1.4; font-family: inherit; }
.rc-sum { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; list-style: none; }
.rc-sum::-webkit-details-marker { display: none; }
.rc-sum h2 { margin: 0; }
.cfg-card > .rc-det > .rc-sum { margin: 0; }

/* sequências, chaves de API e dispositivos (0100) */
.sq-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sq-item { border: 1px solid var(--line, #e3e6ea); border-radius: 12px; background: var(--card, #fff); }
.sq-h { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; flex-wrap: wrap; }
.sq-t { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; flex: 1 1 260px; }
.sq-body { padding: 4px 12px 12px; border-top: 1px solid var(--line, #e3e6ea); display: grid; gap: 10px; }
.sq-opts { display: flex; gap: 16px; flex-wrap: wrap; }
.sq-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sq-step { border: 1px dashed var(--line, #d5d9de); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.sq-sh { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sq-w { display: inline-flex; gap: 6px; align-items: center; }
.cfg-in.sq-n { width: 84px; }
.ak-fresh { border: 2px solid #1f9d55; background: #eefaf3; border-radius: 10px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 6px; }
.ak-pre { background: #f3f4f6; border-radius: 8px; padding: 10px; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; background: #e8f0fe; color: #1a4fb4; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
