/* =====================================================================
   Design system da plataforma (tokens remapeados em signaprod-theme.css)
   Claro por padrão, minimalista: superfícies brancas, bordas finas,
   um único verde de destaque e o violeta reservado ao Eco (IA).
   ===================================================================== */
:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --panel-3: #fafafa;
  --line: #e8e8eb;
  --line-strong: #d9d9de;
  --text: #18181b;
  --muted: #5f5f69;
  --soft: #9b9ba5;
  --accent: #059669;
  --accent-2: #047857;
  --accent-bg: #ecfdf5;
  --accent-line: #a7f3d0;
  --eco: #7c3aed;
  --eco-bg: #f5f3ff;
  --eco-line: #e6defe;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --bubble-in: #ffffff;
  --bubble-out: #e7f8ef;
  --chat-bg: #f4f4f5;
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, .04);
  --shadow: 0 1px 2px rgba(24, 24, 27, .05), 0 1px 3px rgba(24, 24, 27, .04);
  --shadow-md: 0 4px 16px -4px rgba(24, 24, 27, .08), 0 2px 4px -2px rgba(24, 24, 27, .04);
  --shadow-lg: 0 24px 48px -12px rgba(24, 24, 27, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  --r: 12px;
  --r-sm: 8px;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --panel: #141417;
  --panel-2: #1b1b1f;
  --panel-3: #17171a;
  --line: #26262b;
  --line-strong: #33333a;
  --text: #ececef;
  --muted: #a1a1aa;
  --soft: #6b6b75;
  --accent: #10b981;
  --accent-2: #34d399;
  --accent-bg: #0b2a20;
  --accent-line: #14532d;
  --eco: #a78bfa;
  --eco-bg: #1c1730;
  --eco-line: #362c5e;
  --warn: #fbbf24;
  --warn-bg: #2a2008;
  --warn-line: #4a3a10;
  --danger: #f87171;
  --danger-bg: #2c1212;
  --info: #93c5fd;
  --info-bg: #0f1f38;
  --bubble-in: #1b1b1f;
  --bubble-out: #0f3326;
  --chat-bg: #101012;
  --shadow-xs: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
small, .muted { color: var(--muted); }
.soft { color: var(--soft); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- inputs & botões ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 8px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--soft); }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--muted); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); font-weight: 550; }
label.f > span.h { font-weight: 400; color: var(--soft); font-size: 12.5px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 550; font-size: 13.5px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--panel-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--panel); }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--panel)); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.eco { background: var(--eco); border-color: var(--eco); color: #fff; }
.btn.eco:hover { background: color-mix(in srgb, var(--eco) 88%, #000); }
.btn.eco.ghost { background: var(--eco-bg); color: var(--eco); border-color: var(--eco-line); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 10px; }
.btn.icon { padding: 0; width: 36px; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 20px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.pill svg.i { width: 13px; height: 13px; }
.pill.ok { background: var(--accent-bg); color: var(--accent); }
.pill.eco { background: var(--eco-bg); color: var(--eco); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.outline { background: transparent; border-color: var(--line-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); flex: none; }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.danger { background: var(--danger); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.tag button { all: unset; cursor: pointer; color: var(--soft); }
kbd { font: 11px ui-monospace, Menlo, monospace; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty > svg.i { width: 22px; height: 22px; color: var(--muted); padding: 11px; box-sizing: content-box; background: var(--panel-2); border-radius: 12px; margin-bottom: 6px; }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { max-width: 380px; }
.empty .btn { margin-top: 10px; }
.ic-box { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; }
.ic-box.ok { background: var(--accent-bg); color: var(--accent); }
.ic-box.eco { background: var(--eco-bg); color: var(--eco); }
.ic-box.warn { background: var(--warn-bg); color: var(--warn); }
.ic-box.info { background: var(--info-bg); color: var(--info); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.shell > * { min-width: 0; }
.shell.focus { grid-template-columns: 1fr; }
.shell.focus .side { display: none; }
.side { background: var(--panel-3); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; font-weight: 700; font-size: 15px; letter-spacing: -.02em; color: var(--text); }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--text); display: grid; place-items: center; color: var(--panel); flex: none; }
.logo svg.i { width: 16px; height: 16px; stroke-width: 2.2; }
.ws-switch { margin: 0 0 12px; position: relative; }
.ws-switch select, .ws-switch .ws-name { font-size: 13px; font-weight: 600; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-xs); }
.ws-switch .ws-name { display: flex; align-items: center; gap: 8px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .grp { font-size: 11px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-weight: 520; font-size: 13.5px; }
.nav a svg.i { width: 17px; height: 17px; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.nav a.on svg.i { color: var(--accent); }
.nav a .badge { margin-left: auto; }
.nav a.parent-on { color: var(--text); font-weight: 600; }
.nav a.parent-on svg.i { color: var(--accent); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px 18px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav a.sub { padding: 5px 10px; font-size: 13px; }
.nav a.sub svg.i { width: 15px; height: 15px; }
.side .ob-mini { margin: 14px 0 4px; padding: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.side .ob-mini:hover { border-color: var(--line-strong); }
.side .ob-mini .row { font-size: 12.5px; font-weight: 600; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; color: #fff; flex: none; background: var(--soft); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.main { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.main > #view { flex: 1; min-height: 0; }
.page { padding: 28px 32px 40px; max-width: 1200px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head > .grow { flex: 1 1 240px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 13.5px; border-bottom: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.banner b { color: var(--text); }
.banner .btn { margin-left: auto; }

/* ---------- autenticação (login / cadastro) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 6vw, 88px); }
.auth-form .inner { width: 100%; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.auth-form .brand { padding: 0 0 36px; }
.auth h1 { font-size: 26px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth form .btn { height: 42px; }
.auth .switch-mode { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.auth-side { background: var(--panel-2); border-left: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 80% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent), radial-gradient(500px 300px at 0% 100%, color-mix(in srgb, var(--eco) 9%, transparent), transparent); }
.auth-side .inner { position: relative; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth-side h2 { font-size: 22px; letter-spacing: -.02em; line-height: 1.3; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.auth-side li b { color: var(--text); display: block; font-weight: 600; }
.plan-chip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-3); }
.plan-chip b { display: block; }

/* gravação de áudio */
.rec-bar { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recblink 1s infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes recblink { 50% { opacity: .25; } }
.voice-note { display: flex; align-items: center; gap: 10px; }
.voice-note .avatar { width: 38px; height: 38px; }

/* ---------- painel ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.stat .k svg.i { width: 16px; height: 16px; color: var(--soft); }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.bar { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--danger); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

/* primeiros passos */
.checklist { padding: 0; overflow: hidden; margin-bottom: 16px; }
.checklist .head { padding: 18px 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.checklist .head .bar { width: 140px; }
.checklist .items { display: grid; grid-template-columns: repeat(3, 1fr); }
.check-item { display: flex; gap: 12px; padding: 16px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); align-items: flex-start; transition: background .12s; }
.check-item:nth-child(3n) { border-right: 0; }
.check-item:nth-last-child(-n+3) { border-bottom: 0; }
.check-item:hover { background: var(--panel-3); }
.check-item .ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; margin-top: 1px; }
.check-item.done .ck { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-item .ck svg.i { width: 13px; height: 13px; stroke-width: 3; }
.check-item b { font-weight: 600; display: block; font-size: 13.5px; }
.check-item.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.check-item span { font-size: 12.5px; color: var(--muted); }

/* ---------- onboarding guiado ---------- */
.ob { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ob-top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.ob-top .brand { padding: 0; }
.ob-top .bar { width: 160px; }
.ob-body { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 680px); gap: 40px; justify-content: center; padding: 40px 28px 64px; }
.ob-steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 96px; align-self: start; }
.ob-step { all: unset; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 520; }
.ob-step:hover { background: var(--panel-2); }
.ob-step.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.ob-step .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; background: var(--panel); }
.ob-step.on .n { border-color: var(--text); color: var(--text); }
.ob-step.done .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.ob-step .n svg.i { width: 13px; height: 13px; stroke-width: 3; }
.ob-card { padding: 32px; display: flex; flex-direction: column; gap: 20px; animation: rise .25s ease; }
.ob-card .eyebrow { font-size: 12.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.ob-card h1 { font-size: 24px; }
.ob-card .lead { color: var(--muted); font-size: 15px; margin-top: 6px; }
.ob-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; transition: .12s; background: var(--panel); }
.choice:hover { border-color: var(--soft); }
.choice.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.choice b { font-size: 13.5px; font-weight: 600; }
.choice span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.success-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-line); }
.success-box b { color: var(--text); display: block; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 13px; }
.note svg.i { flex: none; margin-top: 1px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.mini-chat { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; height: 380px; }
.mini-chat .msgs { background: var(--chat-bg); padding: 16px; }

/* ---------- assinatura ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { padding: 24px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.plan.featured { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), var(--shadow-md); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .flag { position: absolute; top: -11px; left: 24px; background: var(--text); color: var(--panel); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.plan.current .flag { background: var(--accent); color: #fff; }
.plan .price { display: flex; align-items: baseline; gap: 4px; }
.plan .price b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.plan .price span { color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.plan li svg.i { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; stroke-width: 2.4; }
.sub-status { display: flex; align-items: center; gap: 16px; padding: 20px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- conversas ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr 340px; height: 100%; min-height: 0; }
.inbox.no-panel { grid-template-columns: 340px 1fr; }
.conv-list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.conv-list .top { padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 550; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.convs { overflow-y: auto; flex: 1; padding: 6px; }
.conv { display: flex; gap: 11px; padding: 10px; cursor: pointer; border-radius: 10px; position: relative; }
.conv:hover { background: var(--panel-2); }
.conv.on { background: var(--panel-2); }
.conv.human::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--warn); }
.conv .meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--soft); margin-top: 4px; }
.conv .name { font-weight: 600; }
.conv .last { color: var(--muted); font-size: 13px; }
.conv.unread .last { color: var(--text); font-weight: 550; }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 60px; }
.eco-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.eco-bar.on { background: var(--eco-bg); color: var(--eco); }
.eco-bar.paused, .eco-bar.human { background: var(--warn-bg); color: var(--warn); }
.eco-bar.off { background: var(--panel-3); color: var(--muted); }
.msgs { flex: 1; overflow-y: auto; padding: 18px 6% 10px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--panel); padding: 3px 10px; border-radius: 99px; margin: 12px 0; border: 1px solid var(--line); }
.msg { max-width: min(560px, 78%); align-self: flex-start; position: relative; }
.msg.out { align-self: flex-end; }
.bubble { background: var(--bubble-in); padding: 8px 11px 6px; border-radius: 12px; border-top-left-radius: 4px; box-shadow: var(--shadow-xs); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.out .bubble { background: var(--bubble-out); border-color: transparent; border-radius: 12px; border-top-right-radius: 4px; }
.msg.ai .bubble { background: var(--eco-bg); border: 1px solid var(--eco-line); }
.bubble .who { font-size: 11.5px; font-weight: 650; margin-bottom: 2px; display: flex; gap: 4px; align-items: center; }
.bubble .who svg.i { width: 13px; height: 13px; }
.msg.ai .who { color: var(--eco); }
.msg.human .who, .msg.phone .who, .msg.api .who { color: var(--accent); }
.bubble .time { font-size: 10.5px; color: var(--soft); float: right; margin: 6px 0 0 10px; display: inline-flex; gap: 3px; align-items: center; }
.bubble .time svg.i { width: 14px; height: 14px; }
.bubble .time .read { color: #3b9ee8; }
.bubble img, .bubble video { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 4px; cursor: zoom-in; }
.bubble audio { width: 260px; max-width: 100%; display: block; }
.bubble .transcript { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 4px; }
.msg .teach { position: absolute; top: 4px; left: -36px; opacity: 0; transition: opacity .15s; }
.msg:hover .teach { opacity: 1; }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 40px; max-height: 160px; resize: none; border-radius: 20px; padding: 9px 15px; }
.composer .btn.icon { border-radius: 50%; width: 40px; height: 40px; }
.composer .file-chip { font-size: 12px; }

.panel { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; min-height: 0; }
.panel-sec { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.panel-sec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.panel-sec h4 svg.i { width: 14px; height: 14px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; align-items: center; font-size: 13px; }
.kv > span { color: var(--muted); font-size: 12.5px; }
.kv input, .kv select { padding: 5px 8px; font-size: 13px; }
.ai-box { background: var(--eco-bg); border: 1px solid var(--eco-line); border-radius: 10px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.ai-box b { color: var(--eco); font-weight: 650; }
.score { display: flex; align-items: center; gap: 8px; }
.score .bar { flex: 1; }
.score .bar > i { background: linear-gradient(90deg, #f59e0b, #10b981); }
.memory li { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; padding: 3px 0; }
.memory ul { list-style: none; margin: 0; padding: 0; }
.timeline { display: flex; flex-direction: column; gap: 12px; font-size: 12.5px; }
.timeline .ev { display: flex; gap: 9px; }
.timeline .ev .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); flex: none; color: var(--muted); }
.timeline .ev .ic svg.i { width: 12px; height: 12px; }
.timeline .ev.ai .ic { background: var(--eco-bg); color: var(--eco); }

/* ---------- CRM ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: calc(100vh - 170px); }
.kcol { width: 284px; flex: none; background: var(--panel-2); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 180px); border: 1px solid var(--line); }
.kcol.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kcol header { display: flex; align-items: center; gap: 6px; padding: 4px 6px; font-weight: 600; font-size: 13.5px; }
.kcol .cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 7px; transition: border-color .12s, box-shadow .12s; }
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.kcard.dragging { opacity: .4; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-3); position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .btn { vertical-align: middle; }
.tbl tr.click:hover td { background: var(--panel-3); cursor: pointer; }
.seg { display: inline-flex; padding: 3px; background: var(--panel-2); border-radius: 9px; border: 1px solid var(--line); gap: 2px; }
.seg .btn { height: 28px; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.seg .btn.primary, .seg .btn.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.search { position: relative; }
.search > svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--soft); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 34px; }

/* ---------- números ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.num-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.num-card .phone { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.qr-wrap { display: grid; place-items: center; min-height: 300px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr-wrap img { width: 264px; height: 264px; image-rendering: pixelated; }
.pair-code { font-size: 32px; font-weight: 750; letter-spacing: .12em; font-family: ui-monospace, Menlo, monospace; color: #18181b; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--line); border-top-color: var(--text); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ecos ---------- */
.ecos { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.eco-item { padding: 12px; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 8px; transition: .12s; }
.eco-item:hover { border-color: var(--line-strong); }
.eco-item.on { border-color: var(--eco); box-shadow: 0 0 0 1px var(--eco); }
.eco-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--eco-bg); color: var(--eco); display: grid; place-items: center; flex: none; border: 1px solid var(--eco-line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: 10px 12px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.kb-item { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.kb-item .body { flex: 1; min-width: 0; }
.kb-item .preview { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.kb-item.pending { border-color: var(--warn-line); background: var(--warn-bg); }
.play { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.play-chat { height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.play-chat .msgs { background: var(--chat-bg); padding: 16px; }
.used { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.used .pill { font-weight: 500; }
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.dropzone:hover, .dropzone.over { border-color: var(--eco); background: var(--eco-bg); color: var(--eco); }

/* ---------- modal, drawer, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(24, 24, 27, .4); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
.modal header { padding: 18px 20px 14px; display: flex; align-items: center; gap: 10px; }
.modal .content { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--panel-3); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); box-shadow: var(--shadow-lg); z-index: 40; overflow-y: auto; animation: slide .18s; border-left: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--panel); padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 360px; font-size: 13.5px; animation: pop .2s; cursor: pointer; }
.toast.err { background: var(--danger); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast b { display: block; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: grid; place-items: center; z-index: 120; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
.code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: pre; }
.sec { margin-bottom: 28px; }
.sec > .card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sec-title > svg.i { color: var(--muted); }
.sec-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- responsivo ---------- */
.back-btn { display: none; }
@media (max-width: 1180px) {
  .inbox, .inbox.no-panel { grid-template-columns: 300px 1fr; }
  .inbox .panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100vw); z-index: 30; box-shadow: var(--shadow-lg); }
  .inbox.panel-closed .panel { display: none; }
  .grid2, .play { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
  .checklist .items { grid-template-columns: 1fr 1fr; }
  .check-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .check-item:nth-child(2n) { border-right: 0; }
  .check-item:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .check-item:nth-last-child(-n+2) { border-bottom: 0; }
  .ob-body { grid-template-columns: 1fr; gap: 20px; }
  .ob-steps { position: static; flex-direction: row; overflow-x: auto; }
  .ob-step .lbl { display: none; }
  .ob-step.on .lbl { display: inline; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; gap: 2px; }
  .side .brand span, .side .ws-switch, .nav a span.lbl, .side .foot .who, .nav .grp, .side .ob-mini { display: none; }
  .nav-sub { flex-direction: row; margin: 0; padding: 0; border: 0; }
  .brand { padding: 0 6px 0 0; }
  .nav { flex-direction: row; gap: 2px; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .inbox, .inbox.no-panel { grid-template-columns: 1fr; height: calc(100vh - 54px); }
  .inbox .conv-list { display: flex; }
  .inbox.chat-open .conv-list { display: none; }
  .inbox:not(.chat-open) .chat { display: none; }
  .back-btn { display: inline-flex; }
  .page { padding: 20px 16px 32px; }
  .ecos, .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .checklist .items { grid-template-columns: 1fr; }
  .check-item, .check-item:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .msgs { padding: 12px 10px 8px; }
  .msg .teach { position: static; opacity: .6; padding: 2px; }
  .eco-bar { flex-wrap: wrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .ob-top { padding: 12px 16px; }
  .ob-top .bar { display: none; }
  .ob-body { padding: 20px 16px 48px; }
  .ob-card { padding: 22px; }
}

/* guia de número virtual (BRDID) */
.vguide { display: flex; flex-direction: column; gap: 14px; }
.vsteps { margin: 0; padding: 0; list-style: none; counter-reset: v; display: flex; flex-direction: column; gap: 12px; }
.vsteps li { counter-increment: v; display: grid; grid-template-columns: 26px 1fr; gap: 2px 12px; font-size: 13.5px; }
.vsteps li::before { content: counter(v); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--panel); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.vsteps li span { color: var(--muted); line-height: 1.55; }
.vhelp summary, .vbox summary { cursor: pointer; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; list-style: none; }
.vhelp summary::-webkit-details-marker, .vbox summary::-webkit-details-marker { display: none; }
.vhelp ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.vbox { padding: 14px 16px; }
.vbox[open] summary { margin-bottom: 14px; }

/* Agenda: horário de atendimento por dia */
.hours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.hours-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 550; }
.hours-grid input { font-size: 13px; }

/* =====================================================================
   Ecos 2.0 — ativação, nível de treino, limites, fluxograma, conhecimento
   ===================================================================== */
.ecos > * { min-width: 0; }
#detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.eco-head { padding: 14px 18px; }
.eco-body { min-width: 0; }
.eco-note { background: var(--eco-bg); color: var(--text); border: 1px solid var(--eco-line); margin-bottom: 16px; line-height: 1.5; }
.eco-note svg.i { color: var(--eco); }
.badge.neutral { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); text-transform: lowercase; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.live-dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.ok-t { color: var(--accent); font-weight: 600; } .warn-t { color: var(--warn); font-weight: 600; }
.eco-item:focus-visible { outline: none; box-shadow: var(--ring); }
.eco-item .pill { max-width: 100%; }

/* ativação + nível */
.eco-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.eco-top > section { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.es-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.es-head h2 { overflow-wrap: anywhere; }
.es-head p { font-size: 13px; margin-top: 2px; }
.es-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--panel-2); color: var(--muted); }
.es-ic svg.i { width: 20px; height: 20px; }
.es-on { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-bg), var(--panel) 70%); }
.es-on .es-ic { background: var(--accent); color: #fff; }
.es-paused, .es-off { border-color: var(--warn-line); }
.es-paused { background: var(--warn-bg); }
.es-paused .es-ic { background: var(--warn); color: #fff; }
.es-nums { display: flex; flex-direction: column; gap: 8px; }
.es-num { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.es-state { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.es-state.on { color: var(--accent); }
.es-how { font-size: 13px; color: var(--muted); }
.es-how summary, .lv-list summary, .lim-prev summary { cursor: pointer; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; list-style: none; }
.es-how summary::-webkit-details-marker, .lv-list summary::-webkit-details-marker, .lim-prev summary::-webkit-details-marker { display: none; }
.es-how summary::after, .lv-list summary::after { content: "▾"; margin-left: auto; color: var(--soft); transition: transform .15s; }
details[open] > summary::after { transform: rotate(180deg); }
.es-how ol { margin: 10px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.lv-head { display: flex; align-items: center; gap: 14px; }
.lv-head h2 { overflow-wrap: anywhere; } .lv-head p { font-size: 13px; margin-top: 2px; }
.ring { position: relative; width: 62px; height: 62px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--eco); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .4s; }
.lv-good .ring-fg { stroke: var(--accent); } .lv-mid .ring-fg { stroke: var(--eco); } .lv-low .ring-fg { stroke: var(--warn); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-variant-numeric: tabular-nums; }
.lv > .btn { align-self: flex-start; max-width: 100%; white-space: normal; height: auto; min-height: 30px; padding-top: 5px; padding-bottom: 5px; text-align: left; }
.lv-list { font-size: 13px; }
.lv-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.lv-item:first-of-type { margin-top: 10px; }
.lv-item .grow b { font-weight: 600; } .lv-item .muted { font-size: 12.5px; }
.lv-c { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; margin-top: 1px; }
.lv-c svg.i { width: 11px; height: 11px; stroke-width: 3; }
.lv-item.done .lv-c { background: var(--accent); border-color: var(--accent); color: #fff; }
.lv-item.done b { color: var(--muted); }

/* barra de salvar */
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; padding: 12px 0 0; background: linear-gradient(0deg, var(--panel) 75%, transparent); border-top: 1px solid var(--line); }
.savebar-msg { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--soft); }
.savebar.dirty .savebar-msg { color: var(--warn); font-weight: 600; }

/* limites */
.lim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.lim-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin-bottom: 0; }
.lim-card + .lim-card:not(.lim-grid .lim-card) { margin-top: 16px; }
.lim-head { display: flex; gap: 10px; align-items: flex-start; }
.lim-head p { font-size: 12.5px; margin-top: 2px; }
.lim-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.lim-ic.warn { background: var(--warn-bg); color: var(--warn); } .lim-ic.info { background: var(--info-bg); color: var(--info); } .lim-ic.danger { background: var(--danger-bg); color: var(--danger); }
.lim-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-content: flex-start; }
.lim-empty { font-size: 13px; }
.lim-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); background: var(--panel-2); }
.lim-chip.warn { background: var(--warn-bg); border-color: var(--warn-line); } .lim-chip.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); } .lim-chip.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.lim-t { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.lim-chip button { all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); flex: none; }
.lim-chip button:hover { background: rgba(0, 0, 0, .08); color: var(--text); } .lim-chip button:focus-visible { box-shadow: var(--ring); }
.lim-chip button svg.i { width: 12px; height: 12px; }
.lim-add { gap: 6px; } .lim-add input { min-width: 0; } .lim-add .btn { flex: none; }
.lim-sug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.lim-sug .chip { white-space: normal; text-align: left; line-height: 1.3; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: .12s; background: var(--panel); }
.choice:hover { border-color: var(--line-strong); }
.choice.on { border-color: var(--eco); background: var(--eco-bg); }
.choice input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice:focus-within { box-shadow: var(--ring); }
.choice-b { display: flex; gap: 10px; align-items: flex-start; } .choice-b > svg.i { margin-top: 2px; color: var(--eco); }
.choice-b small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.lim-prev { margin-top: 16px; } .lim-prev[open] summary { margin-bottom: 10px; }
.lim-pre { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; max-height: 420px; overflow: auto; margin: 0; }

/* fluxograma */
.flow-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-3); }
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.flow-wrap .flow-view { order: -1; }
.flow-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 10px; align-items: start; }
.flow-steps > .add-step, .flow-steps > .empty { grid-column: 1 / -1; }

.step { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step.sel { box-shadow: var(--ring); border-color: var(--eco); }
.step.t-ask { border-left-color: #0ea5e9; } .step.t-say { border-left-color: #64748b; } .step.t-decide { border-left-color: #f59e0b; }
.step.t-book { border-left-color: #10b981; } .step.t-human { border-left-color: #ef4444; } .step.t-end { border-left-color: #8b5cf6; }
.step-h { display: flex; align-items: center; gap: 8px; }
.step-h select { width: auto; min-width: 0; max-width: 100%; padding: 4px 8px; font-weight: 600; flex: 0 1 auto; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step textarea { min-height: 56px; font-size: 13.5px; }
.step-br { display: flex; flex-direction: column; gap: 6px; }
.br-row { gap: 6px; } .br-row input { min-width: 0; flex: 1 1 40%; } .br-row select { min-width: 0; flex: 1 1 45%; }
.step-next { display: flex; align-items: center; gap: 8px; font-size: 12.5px; } .step-next select { min-width: 0; flex: 1; }
.step-end { margin: 0; font-size: 12.5px; }
.add-step { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; font-size: 12.5px; }
.flow-view { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-3); min-width: 0; }
.flow-view-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.flow-chart { overflow: auto; max-height: min(560px, calc(100vh - 220px)); min-height: 200px; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; border-radius: 0 0 12px 12px; }
.flow-canvas { position: relative; margin: 0 auto; }
.flow-canvas svg { position: absolute; inset: 0; color: var(--soft); overflow: visible; pointer-events: none; }
.fl-edge { fill: none; stroke: currentColor; stroke-width: 1.6; } .fl-edge.back { stroke-dasharray: 5 4; }
.fl-label { position: absolute; transform: translate(-50%, -50%); max-width: 150px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 99px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
.fnode { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px 11px; border-radius: 11px; border: 1.5px solid var(--line-strong); border-top-width: 4px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .12s, transform .12s; }
.fnode:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); } .fnode:focus-visible { outline: none; box-shadow: var(--ring); }
.fnode.sel { border-color: var(--eco); box-shadow: 0 0 0 3px var(--eco-bg), var(--shadow-md); }
.fnode.t-ask { border-top-color: #0ea5e9; } .fnode.t-say { border-top-color: #64748b; } .fnode.t-decide { border-top-color: #f59e0b; background: var(--warn-bg); }
.fnode.t-book { border-top-color: #10b981; } .fnode.t-human { border-top-color: #ef4444; } .fnode.t-end { border-top-color: #8b5cf6; }
.fnode.orphan { opacity: .7; border-style: dashed; }
.fn-h { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.fn-h svg.i { width: 13px; height: 13px; } .fn-h b { color: var(--text); background: var(--panel-2); border-radius: 99px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; font-size: 11px; padding: 0 4px; }
.fn-h em { font-style: normal; margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 10.5px; padding: 0 6px; border-radius: 99px; background: var(--accent-bg); color: var(--accent); } .fn-h em.bad { background: var(--danger-bg); color: var(--danger); }
.fn-t { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.flow-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 56px 20px; color: var(--muted); text-align: center; }
.flow-empty svg.i { width: 26px; height: 26px; }

/* conhecimento */
.kb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kb-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-3); display: flex; flex-direction: column; min-width: 0; }
.kb-stats b { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kb-stats span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.kb-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin: 0 0 14px; line-height: 1.5; } .kb-note svg.i { margin-top: 2px; }
.src-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.src-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.src-card p { font-size: 13px; line-height: 1.45; margin: 0; }
.src-card > .btn, .src-card .btn.sm { align-self: flex-start; }
.src-h { display: flex; align-items: center; gap: 8px; } .src-h svg.i { color: var(--eco); }
#drop { border: 1.5px dashed var(--line-strong); cursor: pointer; transition: .15s; }
#drop:hover, #drop.over { border-color: var(--eco); background: var(--eco-bg); }
.fmt { display: flex; flex-wrap: wrap; gap: 5px; } .fmt .pill { font-weight: 500; }
.upl-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.upl-list:empty { display: none; }
.upl { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; min-width: 0; }
.upl.ok { border-color: var(--accent-line); background: var(--accent-bg); } .upl.err { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-bg); }
.upl-i { width: 20px; height: 20px; display: grid; place-items: center; flex: none; margin-top: 1px; } .upl.ok .upl-i { color: var(--accent); } .upl.err .upl-i { color: var(--danger); }
.upl-n { overflow-wrap: anywhere; } .upl-m { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; line-height: 1.45; }
.upl.err .upl-m { color: var(--danger); } .upl-d { margin-top: 4px; font-size: 12.5px; } .upl-d summary { cursor: pointer; color: var(--muted); }
.kb-item .body { min-width: 0; }
.kb-title { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; font-size: 11.5px; color: var(--soft); margin-top: 4px; }
.kb-meta a { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; } .kb-meta a svg.i { width: 12px; height: 12px; }
.kb-actions { display: flex; gap: 2px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.kb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
.kb-filters .chips { flex: 1 1 auto; }
.kb-search { position: relative; flex: 1 1 220px; max-width: 340px; min-width: 180px; } .kb-search input { padding-left: 32px; }
.kb-search-i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--soft); display: grid; pointer-events: none; }
.kb-hits { margin-bottom: 12px; background: var(--eco-bg); border-color: var(--eco-line); } .kb-hits > b { color: var(--eco); }
.kb-hit { margin-top: 8px; font-size: 13px; white-space: pre-wrap; border-top: 1px solid var(--eco-line); padding-top: 8px; overflow-wrap: anywhere; }

.play-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.send-btn { border-radius: 50%; width: 40px; height: 40px; flex: none; }
.f.switch-f { justify-content: center; font-weight: 500; }
.banner.paused { background: var(--info-bg); border-bottom-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }

@media (max-width: 1280px) {
  .lim-grid { grid-template-columns: 1fr 1fr; } .src-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) { .eco-top { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .lim-grid, .src-grid, .choice-row { grid-template-columns: 1fr; } .kb-stats { grid-template-columns: 1fr 1fr; }
  .kb-item { flex-wrap: wrap; } .kb-actions { width: 100%; justify-content: flex-start; }
  .kb-search { max-width: none; flex-basis: 100%; }
  .es-num { flex-wrap: wrap; } .es-num .grow { flex-basis: 100%; }
  .page-head .btn { flex: 1 1 auto; }
}

/* ===== Segurança / MFA ===== */
.pw-checks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--soft); }
.pw-checks li { display: inline-flex; align-items: center; gap: 5px; }
.pw-checks li.ok { color: var(--accent); }
.pw-checks svg.i { width: 13px; height: 13px; }
.mfa-grid { display: grid; grid-template-columns: 212px 1fr; gap: 22px; align-items: start; }
.mfa-qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; place-items: center; }
.mfa-qr img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.mfa-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: .28em; text-align: center; padding: 10px 8px; }
.mfa-manual { margin: 10px 0; font-size: 13px; }
.mfa-manual summary { cursor: pointer; color: var(--muted); }
.mfa-secret { display: block; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; word-break: break-all; user-select: all; letter-spacing: .06em; }
.rec-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.rec-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; letter-spacing: .08em; user-select: all; }
.wiz { margin-top: 12px; }
.ok-note { background: var(--accent-bg); color: var(--accent-2); }
.gate { min-height: 100vh; }
.gate .auth-form { width: 100%; }
.list-rows { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.tbl.audit tr.bad td { color: var(--danger); background: var(--danger-bg); }
.banner.soft { background: var(--info-bg); border-bottom-color: #bfdbfe; color: var(--info); }
.banner.urgent { background: var(--danger-bg); border-bottom-color: #fecaca; color: var(--danger); }
.banner > span { min-width: 0; }

/* ===== Canais ===== */
.ch-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.ch-badge svg.i { width: 12px; height: 12px; }
.ch-whatsapp { background: var(--accent-bg); color: var(--accent-2); }
.ch-instagram { background: var(--eco-bg); color: var(--eco); }
.ch-tiktok { background: #f0f9ff; color: #0369a1; }
.ch-custom { background: var(--warn-bg); color: var(--warn); }
.choice-grid.ch-pick { grid-template-columns: 1fr 1fr; }
.choice-grid .choice, .mode-opt { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; }
.choice-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-t b { font-size: 13.5px; }
.choice-t span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.mode-opt.off { opacity: .55; cursor: not-allowed; }

/* ===== Treino em massa ===== */
.train-card { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; border-color: var(--eco-line); background: var(--eco-bg); }
.drop-big { border: 2px dashed var(--line-strong); background: var(--panel-3); padding: 28px 16px; text-align: center; transition: .12s; }
.drop-big.over { border-color: var(--eco); background: var(--eco-bg); }
.team-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; min-width: 0; }
.team-opt:hover { border-color: var(--line-strong); }
.team-opt .grow { min-width: 0; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); position: sticky; top: 0; z-index: 3; }
.kb-sel { margin-top: 4px; flex: none; width: 17px; height: 17px; }
.sec-title .count { background: var(--warn-bg); color: var(--warn); font-size: 12px; padding: 1px 8px; border-radius: 99px; margin-left: 6px; font-weight: 600; }

/* ===== Responsivo (novas telas) ===== */
@media (max-width: 860px) {
  .mfa-grid { grid-template-columns: 1fr; }
  .mfa-qr { justify-self: center; }
  .choice-grid.ch-pick { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .banner { padding: 10px 14px; flex-wrap: wrap; }
  .banner .btn { margin-left: 0; }
  .lrow { padding: 12px; }
  .rec-codes { grid-template-columns: 1fr 1fr; }
  .bulk-bar .btn { flex: 1 1 auto; }
}

/* ===== Ajustes de QA (celular) ===== */
.checklist .head { flex-wrap: wrap; }
.checklist .head .grow { min-width: 160px; }
@media (max-width: 860px) {
  .checklist .head .bar { order: 5; flex: 1 1 100%; width: auto; }
  .banner.soft, .banner.urgent { font-size: 13px; gap: 8px; padding: 8px 12px; align-items: center; flex-wrap: nowrap; }
  .banner.soft > span, .banner.urgent > span { flex: 1; }
  .banner .mfa-long { display: none; }
}
.card:has(> table.tbl) { overflow-x: auto; }
@media (max-width: 860px) { .tbl.audit th, .tbl.audit td { padding: 10px 8px; } .tbl.audit td { font-size: 12.5px; } }
.choice:has(input:checked) { border-color: var(--eco); background: var(--eco-bg); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice.mode-opt:has(input:disabled) { opacity: .55; cursor: not-allowed; }
