/* ═══════════════════════════════════════════════════════════════════
   Vibe Sender — painel (aplicação do design system oficial)
   Tokens em /ds/tokens; este arquivo estiliza os componentes do app.
   ═══════════════════════════════════════════════════════════════════ */
@import url("/ds/styles.css");
@import url("/ds/icons.css");

:root {
  /* Aliases de compatibilidade (código legado referencia estes nomes) */
  --bg: var(--bg-app);
  --panel: var(--surface-card);
  --panel2: var(--surface-raised);
  --line: var(--border-default);
  --text: var(--text-body);
  --muted: var(--text-muted);
  --green: var(--accent);
  --green-d: var(--neon-green-600);
  --blue: var(--neon-cyan-500);
  --red: var(--danger);
  --amber: var(--warning);
  --radius: var(--radius-card);
  --radius-sm: var(--radius-control);
  --shadow: var(--shadow-md);
}

body {
  margin: 0;
  color: var(--text-body);
  background:
    radial-gradient(900px 480px at -10% -12%, rgba(59,255,163,.07), transparent 60%),
    radial-gradient(760px 420px at 108% -6%, rgba(34,224,255,.05), transparent 60%),
    var(--bg-app);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* ── Layout: rail fixo + conteúdo rolável ── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface-sunken); border-right: 1px solid var(--border-subtle);
  padding: var(--space-7) var(--space-5);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar .brand {
  display: flex; align-items: center; gap: var(--space-4);
  font-family: var(--font-display); font-weight: var(--weight-black);
  font-size: var(--text-md); letter-spacing: var(--tracking-tightest);
  text-transform: lowercase; color: var(--text-strong);
  margin: 2px 0 22px; padding: 0 var(--space-3);
}
.brand-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); box-shadow: var(--glow-green); flex: none; }
.sidebar .brand span:not(.brand-dot) { color: var(--text-strong); }

.side-nav { display: flex; flex-direction: column; gap: var(--space-6); }
.menu-group { display: flex; flex-direction: column; gap: 2px; }
.menu-head {
  font: var(--type-eyebrow); letter-spacing: var(--tracking-widest);
  text-transform: uppercase; color: var(--fg-5); padding: var(--space-3) var(--space-4) var(--space-2);
}
.side-nav .tab {
  display: flex; align-items: center; gap: var(--space-5); text-align: left;
  background: transparent; color: var(--text-muted); border: none;
  height: 38px; padding: 0 var(--space-5); border-radius: var(--radius-control);
  cursor: pointer; font: var(--type-ui); width: 100%;
  transition: var(--transition-control);
}
.side-nav .tab:hover { background: rgba(234,255,246,.05); color: var(--text-strong); }
.side-nav .tab.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }

.meta-health {
  margin-top: auto; display: flex; align-items: center; gap: var(--space-4);
  padding: 9px 11px; border-radius: var(--radius-control);
  background: transparent; border: 1px solid var(--border-subtle);
  font: var(--type-code); font-size: var(--text-2xs); color: var(--text-muted);
  cursor: pointer; user-select: none; transition: var(--transition-control);
}
.meta-health:hover { border-color: var(--border-strong); }
.mh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-idle); flex-shrink: 0; }
.meta-health[data-state="online"] .mh-dot { background: var(--status-sent); box-shadow: 0 0 8px var(--status-sent); }
.meta-health[data-state="unstable"] .mh-dot { background: var(--status-warn); box-shadow: 0 0 8px var(--status-warn); animation: vs-pulse 1.6s var(--ease-in-out) infinite; }
.meta-health[data-state="offline"] .mh-dot { background: var(--status-fail); box-shadow: 0 0 8px var(--status-fail); animation: vs-pulse 1s var(--ease-in-out) infinite; }

.user-box { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-4) 0; border-top: 1px solid var(--border-subtle); margin-top: var(--space-4); }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; font-size: var(--text-xs); }

.content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }
main { max-width: 1024px; margin: 0 auto; padding: var(--gutter-page) var(--space-8); }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border-subtle); padding: var(--space-5); }
  .sidebar .brand { margin: 0 var(--space-5) 0 var(--space-3); }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: var(--space-3); }
  .menu-group { flex-direction: row; align-items: center; gap: var(--space-2); }
  .menu-head { display: none; }
  .meta-health { margin: 0; }
  .user-box { border: none; padding: 0; margin: 0; }
  .content { height: auto; }
}

/* ── Stepper do disparo ── */
.stepper { display: flex; gap: 0; margin-bottom: var(--space-6); }
.sdot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-2); cursor: default; position: relative; }
.sdot::before { content: ''; position: absolute; top: 22px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
.sdot:first-child::before { display: none; }
.sdot.active::before, .sdot.done::before { background: var(--accent); opacity: .5; }
.sdot .sn {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: var(--weight-bold) var(--text-sm)/1 var(--font-mono);
  background: var(--surface-raised); border: 2px solid var(--border-default); color: var(--text-muted);
  transition: var(--transition-control);
}
.sdot .sl { font: var(--type-label); font-size: var(--text-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.sdot.active .sn { background: var(--accent); border-color: var(--accent); color: var(--text-on-neon); box-shadow: var(--glow-green-sm); }
.sdot.active .sl { color: var(--text-strong); }
.sdot.done { cursor: pointer; }
.sdot.done .sn { background: var(--accent-soft); border-color: var(--border-neon); color: var(--accent); font-size: 0; }
.sdot.done .sn::after {
  content: ''; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("/ds/icons/check.svg") center/contain no-repeat; mask: url("/ds/icons/check.svg") center/contain no-repeat;
}
@media (max-width: 560px) { .sdot .sl { display: none; } }

/* ── Wizard ── */
.wizard { min-height: 220px; display: flex; flex-direction: column; }
.step { display: none; flex: 1; }
.step.active { display: block; animation: vs-rise var(--dur-base) var(--ease-out); }
.wizard-nav { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.wizard-nav .spacer { flex: 1; }
.page { display: none; }
.page.active { display: block; animation: vs-rise var(--dur-base) var(--ease-out); }

/* ── Cards ── */
.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); padding: var(--space-8); margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md); transition: border-color var(--dur-fast) var(--ease-out);
}
.card:hover { border-color: var(--border-default); }
.card h2 { margin: 0 0 var(--space-6); font: var(--weight-bold) var(--text-lg)/var(--leading-snug) var(--font-display); letter-spacing: var(--tracking-tight); color: var(--text-strong); }
.card h3 { margin: var(--space-7) 0 var(--space-4); font: var(--type-eyebrow); font-size: var(--text-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: var(--tracking-widest); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-6); }
.card-head h2 { margin: 0; white-space: nowrap; flex-shrink: 0; }

/* ── Formulários ── */
label { display: block; margin: var(--space-6) 0 var(--space-3); font: var(--type-label); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
label.check { display: flex; align-items: center; gap: var(--space-4); font: var(--type-ui); text-transform: none; letter-spacing: 0; cursor: pointer; color: var(--text-body); }
label.check input { width: auto; accent-color: var(--accent); }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=file], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; height: var(--control-h-md); padding: 0 12px;
  background: var(--surface-sunken); border: 1px solid var(--border-default);
  border-radius: var(--radius-control); color: var(--text-strong);
  font: var(--type-body); font-size: var(--text-sm);
  box-shadow: var(--inset-sunken); transition: var(--transition-control);
}
textarea { height: auto; padding: 10px 12px; line-height: var(--leading-normal); }
input[type=file] { padding: 7px 12px; }
input::placeholder, textarea::placeholder { color: var(--fg-5); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-neon); box-shadow: var(--glow-green-sm); }
select { appearance: none; -webkit-appearance: none; background-image: url("/ds/icons/chevron-down.svg"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 32px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.row { display: flex; gap: var(--space-4); align-items: center; }
.row select { flex: 1; }

.hint { color: var(--text-faint); font-size: var(--text-xs); font-weight: var(--weight-regular); margin: var(--space-2) 0; text-transform: none; letter-spacing: 0; }
/* Texto secundário de listas e cartões. Estava sem estilo: 25 usos no app
   saíam com o mesmo peso do título, e nada tinha hierarquia. */
.meta { color: var(--text-faint); font-size: var(--text-xs); line-height: 1.6; }
code { background: var(--surface-raised); padding: 1px 6px; border-radius: var(--radius-xs); font: var(--type-code); font-size: var(--text-xs); }
.hidden { display: none !important; }
.info { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); margin-top: var(--space-5); font-size: var(--text-sm); }
.info.err { border-color: var(--status-fail); color: var(--status-fail); }

.actions { display: flex; gap: var(--space-5); justify-content: flex-end; margin-top: var(--space-6); }
#d-actions { margin: var(--space-5) 0 var(--space-8); }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-4);
  height: var(--control-h-md); padding: 0 16px;
  border-radius: var(--radius-control); border: 1px solid transparent; cursor: pointer;
  font: var(--type-ui); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight);
  white-space: nowrap; transition: var(--transition-control);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--text-on-neon); }
.btn.primary:hover { background: var(--accent-hover); box-shadow: var(--glow-green); }
.btn.primary:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; background: var(--accent); }
.btn.ghost { background: var(--surface-raised); color: var(--text-strong); border-color: var(--border-default); }
.btn.ghost:hover { background: var(--surface-card-hover); border-color: var(--border-strong); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--border-default); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.mini { height: var(--control-h-sm); padding: 0 12px; font-size: var(--text-xs); }

/* ── Mapeamento campo → coluna ── */
.fld-row { display: grid; grid-template-columns: 170px 1fr; gap: var(--space-5); align-items: center; margin-bottom: var(--space-4); }
.fld-row label { margin: 0; }
@media (max-width: 560px) { .fld-row { grid-template-columns: 1fr; gap: var(--space-2); } }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  background: var(--accent-2-soft); color: var(--accent-2); border: 1px solid rgba(34,224,255,.35);
  font: var(--type-label); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; border-radius: var(--radius-pill);
}

/* ── Progresso de disparo ── */
.progress-wrap { display: flex; align-items: center; gap: var(--space-6); margin: var(--space-3) 0 var(--space-6); }
.progress-bar { flex: 1; height: 12px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; box-shadow: var(--inset-sunken); border: none; }
.progress-fill {
  height: 100%; width: 0%;
  background: var(--gradient-vibe);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px rgba(59,255,163,.45);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress-pct { font: var(--type-metric); font-size: var(--text-xl); min-width: 64px; text-align: right; color: var(--text-strong); }
.counters { display: flex; gap: var(--space-7); flex-wrap: wrap; font: var(--type-code); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.counters b { font-size: var(--text-base); font-weight: var(--weight-bold); }
.c-sent { color: var(--status-sent); }
.c-skip { color: var(--status-warn); }
.c-fail { color: var(--status-fail); }
.c-total { color: var(--text-muted); margin-left: auto; }
.feed { max-height: 280px; overflow-y: auto; background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-4); font: var(--type-code); font-size: var(--text-xs); }
.feed .ln { padding: 2px 4px; border-bottom: 1px solid var(--border-subtle); }
.feed .ok { color: var(--status-sent); }
.feed .skip { color: var(--status-warn); }
.feed .fail { color: var(--status-fail); }

/* ── Dashboard ── */
.dash-controls { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; }
.dash-controls select { min-width: 210px; max-width: 100%; width: auto; }
@media (max-width: 520px) { .dash-controls select { min-width: 0; width: 100%; } }
.seg { display: flex; background: var(--surface-sunken); border: 1px solid var(--border-default); border-radius: var(--radius-control); overflow: hidden; }
.seg button { background: transparent; color: var(--text-muted); border: none; padding: 7px 12px; cursor: pointer; font: var(--type-ui); font-size: var(--text-xs); transition: var(--transition-control); }
.seg button:hover { color: var(--text-strong); }
.seg button.active { background: var(--accent-soft); color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--space-5); }
@media (max-width: 600px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  padding: var(--space-6); text-align: left; box-shadow: var(--shadow-sm);
  transition: var(--transition-control);
}
.kpi:hover { transform: translateY(var(--hover-lift)); border-color: var(--border-default); }
.kpi-n { font: var(--type-metric); font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); color: var(--text-strong); line-height: 1.05; }
.kpi-l { font: var(--type-eyebrow); font-size: var(--text-2xs); letter-spacing: var(--tracking-widest); text-transform: uppercase; color: var(--text-faint); margin-top: var(--space-3); }
#dashboard .kpis { gap: var(--space-5); margin-bottom: var(--space-2); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
@media (max-width: 640px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .card { min-width: 0; }
.dash-grid .card h3, #dashboard .card h3 { margin: 0 0 var(--space-5); display: flex; align-items: center; gap: var(--space-4); }
#dashboard .card h3::before { content: ''; width: 3px; height: 12px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.svgchart { width: 100%; height: auto; display: block; }
.svgchart .ax { fill: var(--text-faint); font-size: 10px; font-family: var(--font-mono); }
.legend { display: flex; gap: var(--space-6); justify-content: center; margin-top: var(--space-4); font-size: var(--text-xs); color: var(--text-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.donut-wrap { text-align: center; }
.donut { width: 150px; height: 150px; }
.donut-num { fill: var(--fg-1); font-size: 26px; font-weight: 700; font-family: var(--font-mono); }
.donut-sub { fill: var(--fg-4); font-size: 10px; font-family: var(--font-mono); }
.hbar { display: grid; grid-template-columns: 120px 1fr 40px; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); font-size: var(--text-sm); }
.hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.hbar-track { background: var(--surface-sunken); border-radius: var(--radius-pill); height: 12px; overflow: hidden; box-shadow: var(--inset-sunken); }
.hbar-fill { height: 100%; border-radius: var(--radius-pill); min-width: 2px; transition: width var(--dur-slow) var(--ease-out); }
.hbar-v { text-align: right; font: var(--type-code); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--text-strong); }

/* ── Cards de contas ── */
/* Cabeçalho de canal dentro do card de contas: mesma hierarquia para WhatsApp
   e Instagram, sem card dentro de card. */
/* Seletor de posts do Instagram (gatilho "comentou no post") */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: var(--space-4); max-height: 52vh; overflow-y: auto; padding: 2px; }
.post-pick { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 2px solid transparent; background: var(--surface-raised); cursor: pointer; transition: var(--transition-control); }
.post-pick:hover { border-color: var(--border-default); }
.post-pick.on { border-color: var(--accent); }
.post-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-pick .cap { position: absolute; inset: auto 0 0 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-pick .chk { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--accent); color: #04120b; display: none; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.post-pick.on .chk { display: flex; }
.post-pick .noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); }
.post-all { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-5); cursor: pointer; }
.post-all.on { border-color: var(--accent); background: var(--surface-raised); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: var(--space-7) 0 var(--space-4); }
.card > .sec-head:first-of-type { margin-top: 0; }
.sec-head h3 { margin: 0; display: flex; align-items: center; gap: var(--space-3); }
.acc-id { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.acc-id .ic { color: var(--text-faint); flex: none; }
.acc-avatar { width: 34px; height: 34px; border-radius: var(--radius-pill); object-fit: cover; flex: none; border: 1px solid var(--border-subtle); }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 600px) { .acc-grid { grid-template-columns: 1fr; } }
.acc-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: var(--space-6); box-shadow: var(--shadow-sm); transition: var(--transition-control); }
.acc-card:hover { border-color: var(--border-default); transform: translateY(var(--hover-lift)); }
.acc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.acc-top b { color: var(--text-strong); font-family: var(--font-display); }
.acc-actions { display: flex; gap: var(--space-3); flex-shrink: 0; }
.acc-ins { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); font-size: var(--text-sm); line-height: 1.7; }
.acc-foot { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-5); }
.acc-foot a { text-decoration: none; border-bottom: none; }

/* ── Analytics da base (UF) ── */
.ba-tools { display: flex; justify-content: space-between; align-items: center; gap: var(--space-5); margin: var(--space-5) 0 var(--space-4); }
#ba-list { max-height: 46vh; overflow-y: auto; }
.ufrow { display: grid; grid-template-columns: 18px 1fr 90px 40px; gap: var(--space-5); align-items: center; padding: 6px 4px; cursor: pointer; margin: 0; font-weight: var(--weight-regular); text-transform: none; letter-spacing: 0; font-size: var(--text-sm); color: var(--text-body); }
.ufrow:hover { background: var(--surface-raised); border-radius: var(--radius-sm); }
.uf-name { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uf-bar { background: var(--surface-sunken); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.uf-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.uf-n { text-align: right; font: var(--type-code); font-size: var(--text-xs); font-weight: var(--weight-bold); }

/* ── Bases agrupadas ── */
.base-group { margin-bottom: var(--space-7); }
.base-group-head { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-sm); color: var(--text-strong); padding: var(--space-3) 0 var(--space-5); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-5); }
.base-group-head .meta { font-weight: var(--weight-regular); }

/* ── Listas ── */
.list { display: flex; flex-direction: column; gap: var(--space-4); }
.item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--space-5) var(--space-6);
  transition: var(--transition-control);
}
.item:hover { border-color: var(--border-default); }
.item b { color: var(--text-strong); }
.item .meta { font-size: var(--text-xs); color: var(--text-muted); }
.item .item-actions { display: flex; gap: var(--space-4); }
.empty { color: var(--text-faint); font-size: var(--text-sm); padding: var(--space-4) 0; }
.meta { color: var(--text-muted); }

/* ── Modal ── */
.modal {
  position: fixed; inset: 0; background: rgba(3,7,5,.72);
  backdrop-filter: var(--blur-scrim); -webkit-backdrop-filter: var(--blur-scrim);
  display: flex; align-items: center; justify-content: center; z-index: 70; padding: var(--space-7);
}
/* Modal fica acima das gavetas (z 60): quem abre "Add task" de dentro da
   gaveta do negócio tem de ver a tarefa na frente, não atrás do desfoque. */
.modal.hidden { display: none; }
.modal-box {
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-panel); padding: var(--space-8);
  max-width: 580px; width: 100%; max-height: 88vh; overflow: auto;
  box-shadow: var(--shadow-panel), var(--glow-green-sm);
}
.modal:not(.hidden) .modal-box { animation: vs-rise var(--dur-base) var(--ease-out); }
.modal-box h2 { margin: 0 0 var(--space-5); font-family: var(--font-display); color: var(--text-strong); }

/* ── Integrações no form de conta ── */
#d-cw-opts { margin-top: var(--space-5); }
#c-chatwoot-fields { margin-top: var(--space-5); padding-left: var(--space-5); border-left: 2px solid var(--accent-soft); }
#c-kommo-fields { margin-top: var(--space-5); padding-left: var(--space-5); border-left: 2px solid var(--accent-soft); }

/* ── Ajuda contextual ── */
.help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-default); color: var(--text-faint); font-size: 10px; font-weight: var(--weight-bold); cursor: pointer; margin-left: 4px; opacity: .5; user-select: none; vertical-align: middle; }
.help:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.help-pop { position: absolute; max-width: 300px; background: var(--bg-elevated); border: 1px solid var(--border-neon); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); font-size: var(--text-xs); line-height: 1.5; z-index: 200; box-shadow: var(--shadow-lg), var(--glow-green-sm); }
.help-pop a { color: var(--accent); font-weight: var(--weight-semibold); }
.help-pop.hidden { display: none; }

/* ── Jobs ── */
.jobcard { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: var(--space-6); box-shadow: var(--shadow-sm); transition: var(--transition-control); }
.jobcard:hover { border-color: var(--border-default); }
.jobcard b { color: var(--text-strong); }
.job-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.jbadge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px;
  font: var(--type-label); font-size: var(--text-2xs); letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-pill); text-transform: uppercase; border: 1px solid transparent;
}
.jbadge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.jbadge.st-run { background: var(--info-soft); color: var(--info); border-color: rgba(34,224,255,.35); }
.jbadge.st-run::before { animation: vs-pulse 1.6s var(--ease-in-out) infinite; }
.jbadge.st-done { background: var(--success-soft); color: var(--success); border-color: rgba(59,255,163,.35); }
.jbadge.st-pause { background: var(--warning-soft); color: var(--warning); border-color: rgba(255,210,61,.35); }
.jbadge.st-fail { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,77,109,.35); }

/* ── Prévia estilo WhatsApp (única casa de emoji da UI) ── */
.wa-preview { margin-top: var(--space-2); }
.wa-chat {
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 30px),
    var(--surface-sunken);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-6);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.wa-bubble { background: #202c33; color: #e9edef; border-radius: 4px 16px 16px 16px; padding: 8px 10px 6px; max-width: 86%; font-size: var(--text-sm); line-height: 1.45; box-shadow: var(--shadow-sm); }
.wa-htext { font-weight: var(--weight-bold); margin-bottom: 5px; }
.wa-hmedia { background: #0b141a; border-radius: 6px; padding: 22px 10px; text-align: center; color: #8696a0; margin-bottom: 6px; font-size: var(--text-sm); }
.wa-body { white-space: pre-wrap; word-break: break-word; }
.wa-ph { color: #8696a0; font-style: italic; }
.wa-footer { color: #8696a0; font-size: var(--text-xs); margin-top: 6px; }
.wa-time { text-align: right; color: #8696a0; font-size: 10px; margin-top: 3px; font-family: var(--font-mono); }
.wa-btns { max-width: 86%; margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.wa-btn { background: #202c33; color: #53bdeb; text-align: center; padding: 9px; border-radius: 8px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* ── Chips ── */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0 var(--space-1); }
.chip { background: var(--surface-raised); border: 1px solid var(--border-default); color: var(--text-body); border-radius: var(--radius-pill); padding: 5px 12px; font-size: var(--text-xs); font-weight: var(--weight-medium); cursor: pointer; transition: var(--transition-control); }
.chip:hover { border-color: var(--border-neon); color: var(--text-strong); }
.chip.chip-on { background: var(--accent-soft); color: var(--accent); border-color: var(--border-neon); }

/* ── Builder de template ── */
.tplv-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.tplv-tag { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-neon); text-align: center; padding: 8px; border-radius: var(--radius-control); font: var(--type-code); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.btn-row { display: grid; grid-template-columns: 160px 1fr 1fr 38px; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
@media (max-width: 560px) { .btn-row { grid-template-columns: 1fr; } }
.tpl-filters { display: flex; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-3) 0 var(--space-2); }
.tpl-filters #tpl-search { flex: 1; min-width: 170px; }
.tpl-filters select { max-width: 190px; }
.tpl-group-h { font: var(--type-eyebrow); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-widest); color: var(--accent); margin: var(--space-6) 0 var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.tpl-group-h:first-child { margin-top: 2px; }

/* ── Caixa de teste ── */
.test-box { background: var(--surface-raised); border: 1px dashed var(--border-default); border-radius: var(--radius-md); padding: var(--space-6); margin: var(--space-6) 0; }

/* ── Ritmo ── */
.rate-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-6) 0; }

/* ── Logs ── */
.feed.log { max-height: 360px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 8px var(--accent); animation: vs-pulse 1.6s var(--ease-in-out) infinite; }
.logln { padding: 2px 4px; border-bottom: 1px solid var(--border-subtle); white-space: pre-wrap; word-break: break-word; }
.logln .lt { color: var(--text-faint); }
.logln .lv { display: inline-block; min-width: 42px; font-weight: var(--weight-bold); text-transform: uppercase; font-size: var(--text-2xs); }
.logln.call .lv { color: var(--info); }
.logln.ok .lv, .logln.send .lv { color: var(--status-sent); }
.logln.error .lv { color: var(--status-fail); }
.logln.error { color: var(--neon-red-300); }
.logln.info .lv { color: var(--status-warn); }

/* ── Cadastro integrado (Embedded Signup) ── */
#es-box { border-color: var(--border-neon); box-shadow: var(--glow-green-sm); }
#es-box b { color: var(--text-strong); }

/* ── Toast (vidro, DS) ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-glass); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-default); color: var(--text-strong);
  padding: 12px 20px; border-radius: var(--radius-md); font-size: var(--text-sm); z-index: 100; max-width: 90%;
  box-shadow: var(--shadow-lg);
}
.toast:not(.hidden) { animation: vs-rise var(--dur-base) var(--ease-out); }
.toast.err { border-color: rgba(255,77,109,.4); box-shadow: var(--shadow-lg), var(--glow-danger); }
.toast.ok { border-color: rgba(59,255,163,.4); box-shadow: var(--shadow-lg), var(--glow-green-sm); }

/* ── Logos (form + marca) ── */
.logo-row { display: flex; gap: var(--space-6); align-items: center; }
.logo-prev { width: 88px; height: 88px; flex-shrink: 0; border: 1px dashed var(--border-default); border-radius: var(--radius-md); background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; font-size: var(--text-2xs); color: var(--text-faint); overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ═════════ Relatório do cliente (tema claro p/ PDF — impresso usa o verde escuro) ═════════ */
.modal-box.report { max-width: 900px; background: #fff; color: #1d2127; padding: 30px; border: none; box-shadow: var(--shadow-panel); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin: -30px -30px 22px; padding: 30px 34px; border-radius: 14px 14px 0 0;
  background: linear-gradient(120deg, #04361F 0%, #00734A 60%, #00A862 130%); color: #fff; }
.rep-title { font-family: var(--font-display); font-size: 25px; font-weight: var(--weight-black); letter-spacing: -.02em; }
.rep-sub { color: #c6ecd9; font-size: 14px; margin-top: 4px; }
.rep-meta { text-align: right; font-size: 12px; color: #d4efe2; line-height: 1.7; white-space: nowrap; font-family: var(--font-mono); }
.report h3 { color: #16181d; margin: 26px 0 12px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 9px; }
.report h3::before { content: ''; width: 4px; height: 15px; background: #00A862; border-radius: 3px; }
.report .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 11px; margin: 2px 0 6px; }
.report .kpi { background: #fff; border: 1px solid #ebedf0; border-radius: 13px; padding: 16px 12px; text-align: center; box-shadow: 0 1px 3px rgba(20,30,50,.05); }
.report .kpi-n { color: #16181d; font-size: 25px; }
.report .kpi-l { color: #8a909a; font-size: 10px; margin-top: 3px; }
.report .hbar-l, .report .legend, .report .meta { color: #6a707a; }
.report .meta { font-size: 12px; background: #f6f7f9; border-radius: 8px; padding: 8px 10px; line-height: 1.7; }
.report .hbar-track { background: #eef0f2; box-shadow: none; }
.report .hbar-v { color: #16181d; }
.report .uf-bar { background: #eef0f2; }
.report .uf-bar > span { background: #00A862; }
.report .donut-num { fill: #16181d; } .report .donut-sub { fill: #888; }
.report .svgchart .ax { fill: #999; } .report .svgchart line { stroke: #e2e4e8; }
.rep-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.rep-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; border: 1px solid #ebedf0; border-radius: 11px; overflow: hidden; }
.rep-table thead { background: #f6f7f9; }
.rep-table th { text-align: left; color: #6a707a; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; padding: 11px 12px; }
.rep-table td { padding: 10px 12px; border-top: 1px solid #f0f1f3; }
.rep-table tbody tr:nth-child(even) { background: #fafbfc; }
.rep-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.rep-tpl { border: 1px solid #ebedf0; border-radius: 12px; padding: 12px; background: #fafbfc; }
.rep-tpl-name { font-weight: 700; font-size: 13px; margin-bottom: 8px; color: #16181d; }
.rep-tpl .wa-chat { border: none; border-radius: 10px; padding: 14px; background: #0b141a; }
.rep-head-l { display: flex; align-items: center; gap: 16px; }
.rep-head-r { display: flex; align-items: center; gap: 14px; }
.rep-logo { height: 90px; max-width: 240px; object-fit: contain; background: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
@media (max-width: 560px) { .rep-head { flex-direction: column; gap: 14px; } .rep-head-r { align-self: flex-start; } }

@media print {
  body > *:not(#report-modal) { display: none !important; }
  #report-modal { position: static; display: block; background: #fff; padding: 0; backdrop-filter: none; }
  .modal-box.report { max-width: none; max-height: none; border: none; box-shadow: none; overflow: visible; border-radius: 0; }
  .rep-head { border-radius: 0; }
  .no-print { display: none !important; }
  .rep-head, .report .kpis, .rep-2col > div, .donut-wrap, .svgchart,
  .rep-tpl, .report .meta, .rep-table tr, .rep-table thead { break-inside: avoid; page-break-inside: avoid; }
  .report h3 { break-after: avoid; page-break-after: avoid; }
  .rep-tpls { break-inside: auto; }
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-7);
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 30px),
    radial-gradient(720px 420px at 18% 8%, rgba(59,255,163,.1), transparent 60%),
    radial-gradient(600px 380px at 88% 20%, rgba(34,224,255,.06), transparent 60%),
    var(--bg-page);
}
.login-box { width: 100%; max-width: 380px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-panel); padding: var(--space-9); box-shadow: var(--shadow-panel), var(--glow-green-sm); animation: vs-rise var(--dur-slow) var(--ease-out); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-bottom: var(--space-3); font-family: var(--font-display); font-weight: var(--weight-black); font-size: var(--text-xl); letter-spacing: var(--tracking-tightest); text-transform: lowercase; color: var(--text-strong); }
.login-sub { text-align: center; margin-bottom: var(--space-8); }
.login-box label { display: block; margin: var(--space-5) 0 var(--space-3); }
.login-box input { width: 100%; }
.login-box .btn { width: 100%; margin-top: var(--space-7); }
.login-err { margin-top: var(--space-5); color: var(--danger); font-size: var(--text-sm); text-align: center; min-height: 18px; }
.login-foot { margin-top: var(--space-7); text-align: center; }

/* ── Movimento reduzido ── */
@media (prefers-reduced-motion: reduce) {
  .page.active, .step.active, .modal:not(.hidden) .modal-box, .toast:not(.hidden), .login-box { animation: none; }
}

/* ── Modal de template: harmonia das seções ── */
.modal-box h3 { margin: var(--space-7) 0 var(--space-4); font: var(--type-eyebrow); font-size: var(--text-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: var(--tracking-widest); }
.modal-box h3 .hint { text-transform: none; letter-spacing: 0; }
.btn-row .tb-rm { padding: 0; width: 38px; justify-content: center; }
#tpl-preview .wa-chat { margin-top: var(--space-2); }

/* ── Glifo oficial da marca (assets/logo-glyph.svg) ── */
.brand-glyph { height: 15px; width: auto; display: block; flex: none; }
.brand-glyph.lg { height: 22px; }

/* ── Avisos de entrega no card da conta ── */
.acc-warn { margin-top: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-sm); background: var(--warning-soft); border: 1px solid rgba(255,210,61,.35); color: var(--warning); font-size: var(--text-xs); line-height: 1.5; }
.acc-warn b { color: var(--warning); }
#d-health-warn { margin-top: var(--space-4); }
#d-health-warn .acc-warn { margin-top: var(--space-3); }

/* ═══════════════ INBOX (3 colunas estilo WhatsApp Web) ═══════════════ */
.nav-badge { margin-left: auto; background: var(--accent); color: var(--text-on-neon); font: var(--type-code); font-size: var(--text-2xs); font-weight: var(--weight-bold); min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); padding: 0 5px; }
.inbox-page.active { display: flex; animation: none; }
.inbox-page { padding: 0; max-width: none; }
main:has(.inbox-page.active) { max-width: none; padding: 0; height: 100vh; }
.inbox-grid { display: grid; grid-template-columns: 320px 1fr; height: 100vh; width: 100%; }
.inbox-grid:has(.ibx-lead:not(.hidden)) { grid-template-columns: 320px 1fr 300px; }

/* coluna 1 */
.ibx-list { border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-height: 0; background: var(--surface-sunken); }
.ibx-list-head { display: flex; gap: var(--space-3); padding: var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.ibx-list-head input { flex: 1; }
.ibx-list-head select { max-width: 96px; }
.ibx-threads { flex: 1; overflow-y: auto; min-height: 0; }
.ibx-thread-item { display: flex; gap: var(--space-4); padding: var(--space-5); cursor: pointer; border-bottom: 1px solid var(--border-subtle); align-items: center; transition: background var(--dur-fast) var(--ease-out); }
.ibx-thread-item:hover { background: rgba(234,255,246,.04); }
.ibx-thread-item.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.ibx-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.ibx-avatar { overflow: hidden; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-raised); display: flex; align-items: center; justify-content: center; font: var(--weight-bold) var(--text-sm)/1 var(--font-display); color: var(--accent); flex: none; text-transform: uppercase; }
.ibx-thread-main { flex: 1; min-width: 0; }
.ibx-thread-top { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.ibx-thread-name { font-weight: var(--weight-semibold); color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibx-thread-time { font: var(--type-code); font-size: var(--text-2xs); color: var(--text-faint); flex: none; }
.ibx-thread-prev { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ibx-unread { background: var(--accent); color: var(--text-on-neon); font: var(--type-code); font-size: var(--text-2xs); font-weight: var(--weight-bold); min-width: 18px; height: 18px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; flex: none; }

/* coluna 2 */
.ibx-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ibx-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); color: var(--text-faint); }
.ibx-empty .ic { width: 40px; height: 40px; }
.ibx-conv { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ibx-conv-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.ibx-messages { flex: 1; overflow-y: auto; min-height: 0; padding: var(--space-6);
  background: repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 30px), repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 30px), var(--surface-sunken);
  display: flex; flex-direction: column; gap: var(--space-3); }
.ibx-msg { max-width: 68%; padding: 8px 11px 6px; border-radius: 12px; font-size: var(--text-sm); line-height: 1.4; word-break: break-word; position: relative; }
.ibx-msg.in { align-self: flex-start; background: var(--surface-raised); color: var(--text-body); border-top-left-radius: 4px; }
.ibx-msg.out { align-self: flex-end; background: var(--accent-ink); color: var(--neon-green-100); border-top-right-radius: 4px; box-shadow: inset 0 0 0 1px rgba(59,255,163,.18); }
.ibx-msg .mtime { display: block; font: var(--type-code); font-size: 10px; color: var(--text-faint); text-align: right; margin-top: 3px; }
.ibx-msg .mtick { color: var(--accent-2); }
.ibx-msg img, .ibx-msg video { max-width: 100%; border-radius: 8px; display: block; margin-bottom: 4px; }
.ibx-msg audio { width: 240px; max-width: 100%; }
.ibx-msg .mdoc { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.ibx-day { align-self: center; background: var(--surface-glass); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: var(--text-2xs); padding: 3px 12px; border-radius: var(--radius-pill); margin: var(--space-2) 0; }
.ibx-window-closed { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); background: var(--warning-soft); border-top: 1px solid rgba(255,210,61,.3); color: var(--warning); font-size: var(--text-xs); }
.ibx-composer { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); background: var(--surface-sunken); }
.ibx-composer input#ibx-input { flex: 1; }
.ibx-composer.recording input#ibx-input { color: var(--danger); }
#ibx-mic.rec { background: var(--danger-soft); color: var(--danger); }
.ibx-rec { flex: 1; display: flex; align-items: center; gap: var(--space-3); color: var(--danger); font-size: var(--text-sm); }
.ibx-rec .dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--danger); animation: vs-pulse 1s var(--ease-in-out) infinite; flex: none; }
.ibx-audio-prev { flex: 1; display: flex; align-items: center; gap: var(--space-3); }
.ibx-audio-prev audio { flex: 1; height: 36px; }

/* coluna 3: lead */
.ibx-lead { border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-height: 0; background: var(--surface-sunken); }
.ibx-lead-head { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); font-family: var(--font-display); font-weight: var(--weight-bold); }
.ibx-lead-body { flex: 1; overflow-y: auto; padding: var(--space-6); font-size: var(--text-sm); }
.ibx-lead-body .lead-field { margin-bottom: var(--space-5); }
.ibx-lead-body .lead-label { font: var(--type-eyebrow); font-size: var(--text-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-bottom: 3px; }

@media (max-width: 900px) {
  .inbox-grid, .inbox-grid:has(.ibx-lead:not(.hidden)) { grid-template-columns: 1fr; }
  .inbox-grid { position: relative; }
  .ibx-list { display: var(--ibx-mobile-list, flex); }
}

/* ═══════════════ CRM — Kanban ═══════════════ */
.kanban { display: flex; gap: var(--space-5); overflow-x: auto; padding-bottom: var(--space-5); align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 272px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); display: flex; flex-direction: column; max-height: 72vh; }
.kcol.drag-over { border-color: var(--border-neon); box-shadow: var(--glow-green-sm); }
.kcol-head { padding: var(--space-5); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: var(--space-3); }
.kcol-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kcol-name { font: var(--type-label); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-strong); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcol-count { font: var(--type-code); font-size: var(--text-2xs); color: var(--text-faint); }
.kcol-sum { font: var(--type-code); font-size: var(--text-2xs); color: var(--accent); padding: 0 var(--space-5) var(--space-3); }
.kcol-cards { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); min-height: 60px; }
.kcard { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-5); cursor: grab; transition: var(--transition-control); }
.kcard:hover { border-color: var(--border-default); transform: translateY(var(--hover-lift)); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard-title { font-weight: var(--weight-semibold); color: var(--text-strong); font-size: var(--text-sm); margin-bottom: 4px; }
.kcard-meta { font-size: var(--text-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.kcard-value { font: var(--type-code); font-size: var(--text-sm); color: var(--accent); font-weight: var(--weight-bold); margin-top: 6px; }
.kcard.won { border-color: rgba(59,255,163,.35); }
.kcard.lost { border-color: rgba(255,77,109,.3); opacity: .75; }

/* Drawer lateral do deal */
.drawer { position: fixed; inset: 0; background: rgba(3,7,5,.6); backdrop-filter: var(--blur-scrim); -webkit-backdrop-filter: var(--blur-scrim); z-index: 60; display: flex; justify-content: flex-end; }
.drawer.hidden { display: none; }
.drawer-box { width: var(--panel-w); max-width: 100%; background: var(--bg-elevated); border-left: 1px solid var(--border-default); height: 100%; overflow-y: auto; padding: var(--space-8); box-shadow: var(--shadow-panel); animation: vs-rise var(--dur-base) var(--ease-out); }
.deal-row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.deal-row .k { color: var(--text-faint); }
.timeline { list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.timeline li { display: flex; gap: var(--space-4); padding: var(--space-3) 0; font-size: var(--text-xs); color: var(--text-muted); border-left: 2px solid var(--border-subtle); padding-left: var(--space-5); }
.timeline li b { color: var(--text-body); }
.stage-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: var(--space-3); background: var(--surface-raised); cursor: grab; }
.stage-row.dragging { opacity: .45; }
.stage-row input { flex: 1; }
.stage-row select { max-width: 110px; }

/* ═══════════ Menu lateral recolhível ═══════════ */
.sidebar { transition: width var(--dur-base) var(--ease-out), padding var(--dur-base) var(--ease-out); }
.sidebar .brand { position: relative; }
.rail-toggle { margin-left: auto; background: transparent; border: 1px solid var(--border-subtle); color: var(--text-faint); border-radius: var(--radius-sm); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition-control); flex: none; }
.rail-toggle:hover { color: var(--accent); border-color: var(--border-neon); }
.sidebar.collapsed { width: var(--sidebar-w-collapsed); padding-left: var(--space-3); padding-right: var(--space-3); }
.sidebar.collapsed .brand { justify-content: center; padding: 0; }
.sidebar.collapsed .brand-word,
.sidebar.collapsed .menu-head,
.sidebar.collapsed .tab > span:not(.ic):not(.nav-badge),
.sidebar.collapsed .user-email,
.sidebar.collapsed .mh-txt,
.sidebar.collapsed #btn-logout span:not(.ic) { display: none; }
.sidebar.collapsed .rail-toggle { position: absolute; right: -10px; top: 26px; background: var(--surface-card); z-index: 2; }
.sidebar.collapsed .rail-toggle .ic { transform: rotate(180deg); }
.sidebar.collapsed .tab { justify-content: center; padding: 0; gap: 0; }
.sidebar.collapsed .nav-badge { position: absolute; margin: 0; transform: translate(12px, -10px); }
.sidebar.collapsed .tab { position: relative; }
.sidebar.collapsed .menu-group { gap: 4px; }
.sidebar.collapsed .meta-health { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .user-box { justify-content: center; }
@media (max-width: 760px) { .rail-toggle { display: none; } .sidebar.collapsed { width: 100%; padding: var(--space-5); } .sidebar.collapsed .brand-word, .sidebar.collapsed .tab > span:not(.ic) { display: inline; } }

/* ═══════════ CRM em tela cheia ═══════════ */
main:has(.crm-page.active) { max-width: none; padding: 0; height: 100vh; }
.crm-page.active { display: flex; flex-direction: column; height: 100vh; min-height: 0; animation: none; }
.crm-page > .card {
  border: none; border-radius: 0; margin: 0; box-shadow: none; background: transparent;
  padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.crm-page > .card:hover { border-color: transparent; }
.crm-page .card-head { margin-bottom: var(--space-5); flex-wrap: nowrap; }
/* A barra do Kanban tem 2 selects + busca + 3 botões. Com os 210px de
   min-width que os selects herdam do dashboard, o conjunto estoura e o botão
   Deal cai para a linha de baixo. Aqui os campos cedem e os botões não. */
.crm-page .dash-controls { flex-wrap: nowrap; gap: var(--space-4); min-width: 0; }
.crm-page .dash-controls select { min-width: 0; flex: 0 1 170px; }
.crm-page .dash-controls input { flex: 0 1 180px; min-width: 0; }
.crm-page .dash-controls .btn { flex: none; white-space: nowrap; }
.crm-page .kanban { flex: 1; min-height: 0; padding-bottom: var(--space-4); }
.crm-page .kcol { max-height: 100%; flex: 0 0 288px; }
@media (max-width: 760px) {
  main:has(.crm-page.active) { height: auto; } .crm-page.active { height: auto; }
  .crm-page > .card { padding: var(--space-5); }
  /* no celular não cabe em uma linha — aí quebrar é o certo */
  .crm-page .card-head, .crm-page .dash-controls { flex-wrap: wrap; }
}

/* Tag do número (central multi-conta) */
.ibx-acc-tag { display: inline-flex; align-items: center; font: var(--type-code); font-size: 10px; color: var(--accent-2); background: var(--accent-2-soft); border: 1px solid rgba(34,224,255,.25); border-radius: var(--radius-pill); padding: 1px 7px; margin-top: 3px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ibx-conv-head .ibx-acc-tag { margin: 0 0 0 6px; }
.mini-sel { height: var(--control-h-sm); font-size: var(--text-xs); max-width: 130px; }

/* Separador "or" entre senha e login social */
.login-sep { display: flex; align-items: center; gap: var(--space-4); color: var(--text-muted); font: var(--type-ui); font-size: var(--text-xs); }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--border-default); }

/* Campo com prefixo fixo (R$, %, etc): o símbolo faz parte da moldura, não do valor */
.field-prefix { display: flex; align-items: center; background: var(--surface-sunken); border: 1px solid var(--border-default); border-radius: var(--radius-control); overflow: hidden; transition: var(--transition-control); }
.field-prefix:focus-within { border-color: var(--accent); box-shadow: var(--focus-shadow); }
.field-prefix > span { padding: 0 10px; color: var(--text-muted); font: var(--type-ui); font-size: var(--text-xs); border-right: 1px solid var(--border-subtle); align-self: stretch; display: flex; align-items: center; }
.field-prefix > input { border: none; background: transparent; border-radius: 0; flex: 1; min-width: 0; }
.field-prefix > input:focus { box-shadow: none; border-color: transparent; }

/* Editor de etapas: linha com alça de arraste legível */
.stage-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--surface-sunken); margin-bottom: var(--space-3); transition: var(--transition-control); }
.stage-row:hover { border-color: var(--border-default); }
.stage-row.dragging { opacity: .45; }
.stage-row > .ic { color: var(--text-faint); cursor: grab; flex: none; }
.stage-row input { flex: 1; min-width: 0; }
.stage-row select { max-width: 130px; }

/* Campos de data/hora: sem color-scheme o navegador pinta o calendário nativo
   em branco, e o ícone some no tema escuro. Segue o tema do documento. */
:root { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
input[type=date], input[type=datetime-local], input[type=time] { font: var(--type-ui); }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; transition: opacity var(--dur-fast) var(--ease-out); }
input[type=date]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* ── Tabela de dados da interface ──
   Existe porque .rep-table é do RELATÓRIO impresso: ela tem cores claras
   fixas de propósito, para sair certa no papel. Reusá-la na tela dava texto
   claro sobre listra quase branca. Esta aqui vive de tokens e funciona nos
   dois temas. */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--type-ui); font-size: var(--text-sm);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card); overflow: hidden; }
.data-table thead { background: var(--surface-sunken); }
.data-table th { text-align: left; color: var(--text-muted); font-size: var(--text-2xs); text-transform: uppercase;
  letter-spacing: var(--tracking-wide); font-weight: 700; padding: var(--space-4) var(--space-5); white-space: nowrap; }
.data-table td { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); color: var(--text-body); }
.data-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--surface-card-hover); }
.data-table td b { color: var(--text-strong); }
/* números alinhados à direita leem melhor em coluna */
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); }
.data-table .row-link { cursor: pointer; }

/* Rolagem horizontal própria: tabela larga não empurra a página inteira */
.table-wrap { overflow-x: auto; }

/* ── Automações: trilha de passos ─────────────────────────────────────────── */
.fl-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-5); }
.fl-bar .fl-id { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.fl-bar h2 { margin: 0; }
.fl-acts { display: flex; align-items: center; gap: var(--space-3); }
.fl-empty-lane { color: var(--text-faint); font-size: var(--text-xs); padding: var(--space-3) 0; }
.fl-model { display: flex; gap: var(--space-4); align-items: flex-start; width: 100%; text-align: left; padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); background: var(--surface-card); cursor: pointer; margin-bottom: var(--space-4); transition: var(--transition-control); }
.fl-model:hover { border-color: var(--accent); }
.fl-model .ic { color: var(--accent); flex: none; margin-top: 2px; }

/* ── Canvas das automações ────────────────────────────────────────────────── */
.cv-wrap { position: relative; height: calc(100vh - 230px); min-height: 420px; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-card); background: var(--surface-sunken);
  background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px); background-size: 22px 22px; cursor: grab; }
.cv-wrap.panning { cursor: grabbing; }
.cv-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.cv-world svg { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.cv-node { position: absolute; width: 210px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-5); box-shadow: var(--shadow-sm); cursor: grab; user-select: none; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.cv-node:hover { border-color: var(--border-strong); }
.cv-node.trig { border-color: var(--accent-soft); background: var(--surface-raised); }
.cv-node.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cv-node.bad { border-color: var(--status-fail); }
.cv-node.dragging { cursor: grabbing; box-shadow: var(--shadow-panel); z-index: 5; }
.cv-head { display: flex; align-items: center; gap: var(--space-3); }
.cv-head .ic { color: var(--text-faint); flex: none; }
.cv-tit { font-size: var(--text-sm); color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-sub { margin-top: 3px; font-size: var(--text-2xs); color: var(--text-faint); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cv-del { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: var(--radius-pill); border: 1px solid var(--border-default);
  background: var(--surface-raised); color: var(--text-faint); display: none; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; line-height: 1; }
.cv-node:hover .cv-del { display: flex; }
.cv-del:hover { color: var(--status-fail); border-color: var(--status-fail); }
.cv-porta { position: absolute; width: 12px; height: 12px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 2px solid var(--border-strong); cursor: crosshair; }
.cv-porta:hover, .cv-porta.ativa { background: var(--accent); border-color: var(--accent); }
.cv-porta.ent { left: -7px; top: 50%; margin-top: -6px; cursor: default; }
.cv-porta-rot { position: absolute; font-size: var(--text-2xs); color: var(--text-muted); white-space: nowrap; transform: translateY(-50%); background: var(--surface-sunken); padding: 0 5px; border-radius: var(--radius-xs); }
.cv-fio { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.cv-fio.hot { stroke: var(--accent); }
.cv-fio-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.cv-tools { position: absolute; top: var(--space-5); right: var(--space-5); display: flex; gap: var(--space-3); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); padding: var(--space-3); }
.cv-dica { position: absolute; left: var(--space-5); bottom: var(--space-5); font-size: var(--text-2xs); color: var(--text-faint); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); padding: 4px 10px; }
.msg-story { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--surface-raised); border: 1px solid var(--border-subtle); text-decoration: none; border-bottom: 1px solid var(--border-subtle); }
.msg-story img { width: 34px; height: 54px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.msg-story span { font-size: var(--text-2xs); color: var(--text-faint); }
.ig-card { display: flex; align-items: center; gap: var(--space-4); min-width: 220px; max-width: 280px; padding: var(--space-3);
  border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--border-subtle); text-decoration: none !important; color: inherit !important; }
.ig-card:hover { border-color: var(--border-strong); }
.ig-card img, .ig-card-capa { width: 48px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.ig-card-capa { display: grid; place-items: center; background: var(--surface-raised); color: var(--text-faint); }
.ig-card-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ig-card-txt b { font-size: var(--text-sm); }
.ig-card-txt span { font-size: var(--text-2xs); color: var(--text-faint); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ig-card + div { margin-top: var(--space-3); }
/* com capa: prévia grande, como no Direct */
.ig-card-grande { flex-direction: column; align-items: stretch; gap: var(--space-3); width: 220px; min-width: 0; padding: 0 0 var(--space-3); overflow: hidden; position: relative; }
.ig-card-grande img { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.ig-card-reel.ig-card-grande img { aspect-ratio: 9 / 16; max-height: 360px; }
.ig-card-grande .ig-card-txt { padding: 0 var(--space-4); }
.ig-card-reel.ig-card-grande::after { content: ''; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; background: #fff;
  -webkit-mask: url(/ds/icons/play.svg) center/contain no-repeat; mask: url(/ds/icons/play.svg) center/contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.msg-sticker { width: 120px; height: 120px; object-fit: contain; background: transparent; }
/* Mensagem de sistema (trocou de número, abriu a conversa): fica no meio, sem balão de ninguém. */
/* Separador "ou": duas maneiras de montar a lista de disparo. */
.sep-ou { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-5) 0; color: var(--text-faint); font-size: var(--text-2xs); }
.sep-ou::before, .sep-ou::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
/* Tarefa na gaveta do negócio: caixa e texto na mesma linha. */
.dl-task { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.msg-sistema { font-size: var(--text-2xs); color: var(--text-faint); text-align: center; }
.ibx-msg.sis { align-self: center; background: transparent; border: 0; box-shadow: none; max-width: 90%; }
.ibx-msg.sis .mtime { display: none; }
/* "Encaminhada" e "editada": contexto da mensagem, acima do conteúdo. */
.msg-marca { font-size: var(--text-2xs); color: var(--text-faint); margin-bottom: 2px; }
.ig-card-nd .ig-card-txt span { -webkit-line-clamp: 3; }
.msg-reacao { font-size: var(--text-2xs); color: var(--text-faint); }
.msg-reacao span { font-size: var(--text-lg, 18px); margin-left: 4px; }
.ig-mencao { font-size: var(--text-2xs); color: var(--text-faint); margin-top: 4px; }
.ibx-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.ibx-msg.in a { color: var(--accent); }

/* "ver como": o admin precisa saber o tempo todo que não está na própria conta */
.vercomo-faixa { position: fixed; top: 0; left: 0; right: 0; z-index: 200; display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  padding: 7px var(--space-5); background: var(--status-warn); color: #1b1400; font-size: var(--text-sm); }
.vercomo-faixa .btn { background: rgba(0,0,0,.18); color: #1b1400; border-color: transparent; }
body.vercomo { padding-top: 38px; }

/* canvas: "+" na saída livre, menu de adicionar, execuções */
.cv-mais { position: absolute; width: 22px; height: 22px; border-radius: var(--radius-pill); border: 1px dashed var(--border-strong); background: var(--surface-card);
  color: var(--text-muted); font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cv-mais:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }
.fl-menu-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); }
.fl-menu-cols h3 { margin: 0 0 var(--space-3); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.fl-menu { max-height: 86vh; overflow: auto; }
#fl-seg { margin-bottom: var(--space-5); }
#fl-runs { padding-top: var(--space-2); }
.fl-runs-filtro { margin-bottom: var(--space-6); }
.fl-tpl-body { white-space: pre-wrap; font-size: var(--text-sm); color: var(--text-muted); background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-3) 0; }
.fl-vars { margin-top: var(--space-3); }
.fl-vars .chip { font-family: var(--font-mono, monospace); font-size: var(--text-2xs); }
.fl-busca { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); max-height: 50vh; overflow: auto; }
#btn-push.on { color: var(--accent); border-color: var(--border-neon); }
.ibx-filtro { margin: var(--space-3) var(--space-4) 0; }
.ibx-filtro button { flex: 1; padding: 5px 0; font-size: var(--text-2xs); }
.ibx-assignee { display: inline-flex; align-items: center; gap: 3px; font-size: var(--text-2xs); color: var(--text-faint); margin-left: auto; }
.ibx-msg .mtick.fail { color: var(--status-fail); cursor: help; }

/* ═══════════ Celular (≤760px): barra inferior, inbox e CRM em tela cheia ═══════════ */
.mobile-bar { display: none; }
.mob-only { display: none !important; }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .mob-only { display: inline-flex !important; }
  .content { height: auto; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  main { padding: var(--space-5) var(--space-4); }
  html, body { -webkit-text-size-adjust: 100%; }
  input, select, textarea { font-size: 16px; }   /* abaixo disso o iOS dá zoom ao focar */
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface-glass); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); border-top: 1px solid var(--border-subtle); }
  .mobile-bar button { flex: 1; position: relative; background: transparent; border: none; color: var(--text-muted); font: var(--type-ui); font-size: var(--text-2xs); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
  .mobile-bar button.active { color: var(--accent); }
  .mobile-bar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  .mob-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: none; border-radius: var(--radius-panel) var(--radius-panel) 0 0; max-height: 85dvh; padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom)); }
  .mob-sheet h3 { margin: var(--space-4) 0 var(--space-3); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
  .mob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .mob-grid .fl-model { margin: 0; }
  .mob-foot { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .desktop-first::before { content: 'This screen works best on a desktop.'; display: block; margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-raised); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: var(--text-xs); }
  /* modais e gavetas em tela cheia */
  .modal { padding: var(--space-3); align-items: flex-end; }
  .modal-box { padding: var(--space-6) var(--space-5); max-height: 92dvh; border-radius: var(--radius-panel); }
  .drawer-box { width: 100%; padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom)); border-left: none; }
  /* inbox: uma coluna; lista OU conversa; lead por cima */
  .content:has(.inbox-page.active) { padding-bottom: 0; height: 100dvh; overflow: hidden; }
  main:has(.inbox-page.active) { height: calc(100dvh - 60px - env(safe-area-inset-bottom)); }
  .ibx-composer { padding-bottom: var(--space-3); }
  .inbox-page.active { height: calc(100dvh - 60px - env(safe-area-inset-bottom)); }
  .inbox-grid, .inbox-grid:has(.ibx-lead:not(.hidden)) { grid-template-columns: 1fr; height: calc(100dvh - 60px - env(safe-area-inset-bottom)); }
  .ibx-list { border-right: none; }
  .inbox-grid.conv-open .ibx-list { display: none; }
  .inbox-grid:not(.conv-open) .ibx-thread { display: none; }
  .ibx-list-head { padding: var(--space-4); }
  .ibx-list-head select { max-width: 110px; }
  .ibx-thread-item { padding: var(--space-4); }
  .ibx-conv-head { padding: var(--space-3) var(--space-4); }
  .ibx-messages { padding: var(--space-4); }
  .ibx-msg { max-width: 84%; }
  .ibx-msg img, .ibx-msg video { max-width: 100%; }
  .ibx-composer { padding: var(--space-3) var(--space-3); }
  .ibx-lead { position: fixed; inset: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 40; border-left: none; }
  .ibx-lead-head { display: flex; align-items: center; }
  .ibx-filtro { margin: var(--space-3) var(--space-3) 0; }
  /* kanban: uma coluna por tela, rolagem com encaixe; gestão de etapas fica no desktop */
  main:has(.crm-page.active) { height: auto; }
  .crm-page.active { height: auto; }
  .crm-page > .card { padding: var(--space-4); }
  .crm-page .card-head { margin-bottom: var(--space-4); }
  .crm-page .dash-controls { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }
  .crm-page .dash-controls select, .crm-page .dash-controls input { flex: none; width: 100%; max-width: none !important; }
  .crm-page .dash-controls input { grid-column: 1 / -1; }
  #crm-edit-stages, #crm-new-pipeline { display: none; }
  #crm-new-deal { grid-column: 1 / -1; }
  .kanban { scroll-snap-type: x mandatory; gap: var(--space-4); min-height: 0; -webkit-overflow-scrolling: touch; }
  .crm-page .kcol, .kcol { flex: 0 0 86vw; scroll-snap-align: center; max-height: calc(100dvh - 300px); }
  .kcard { cursor: pointer; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .card { padding: var(--space-5); }
  .card-head { gap: var(--space-4); }
  .cv-wrap { height: calc(100dvh - 320px); min-height: 320px; }
}
/* rodapé da lateral: o e-mail ocupa a linha de cima, os botões a de baixo */
.user-box { flex-wrap: wrap; }
.user-box .user-email { flex-basis: 100%; max-width: none; }
.dash-view-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
#dash-sales > .card, #dash-broadcasts > .card { margin-top: var(--space-5); }
@media (max-width: 760px) { #vd-period { flex-wrap: wrap; } #vd-period button { flex: 1 1 auto; } }
.kb-pager { display: none; }
@media (max-width: 760px) {
  /* CRM ocupa a tela toda: a rolagem lateral e o paginador ficam colados na barra inferior */
  .content:has(.crm-page.active) { padding-bottom: 0; height: 100dvh; overflow: hidden; }
  main:has(.crm-page.active) { height: calc(100dvh - 60px - env(safe-area-inset-bottom)); }
  .crm-page.active { height: 100%; display: flex; flex-direction: column; }
  .crm-page > .card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .crm-page .kanban { flex: 1; min-height: 0; padding-bottom: var(--space-2); align-items: stretch; }
  .crm-page .kcol, .kcol { max-height: 100%; }
  .kb-pager { display: flex; align-items: center; gap: 6px; padding: var(--space-3) 0 var(--space-2); flex: none; }
  .kb-pager button { width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; background: var(--border-strong); }
  .kb-pager button.active { background: var(--accent); width: 18px; border-radius: 4px; }
  .kb-pager-nome { margin-left: auto; font: var(--type-code); font-size: var(--text-2xs); color: var(--text-muted); }
}

/* ═══════════ Agentes de IA ═══════════ */
#agents { max-width: 1180px; margin: 0 auto; }
.jbadge.st-off { background: var(--surface-raised); color: var(--text-faint); border-color: var(--border-default); }
.jbadge.st-off::before { box-shadow: none; }

/* lista */
.ag-aviso { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-6);
  border: 1px solid rgba(255,210,61,.35); background: var(--warning-soft); color: var(--warning); border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.45; }
.ag-aviso .ic { margin-top: 2px; }
.ag-resumo { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin-bottom: var(--space-7); }
.ag-resumo > * { background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); }
.ag-resumo-num { display: flex; flex-direction: column; justify-content: center; }
.ag-resumo-num b { font: var(--type-metric); font-size: var(--text-xl); color: var(--text-strong); line-height: 1.1; }
.ag-resumo-num .kpi-l { margin-top: var(--space-2); }
.ag-mes { display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); }
.ag-mes-topo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.ag-mes-topo b { color: var(--text-strong); font-size: var(--text-md); }
.ag-mes-topo .hint { margin: 0; }
.ag-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--space-5); }
.ag-cartao { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-6); background: var(--surface-sunken);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card); transition: var(--transition-control); }
.ag-cartao:hover { border-color: var(--border-default); transform: translateY(var(--hover-lift, -1px)); }
.ag-cartao-topo { display: flex; align-items: center; gap: var(--space-4); }
.ag-cartao-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-cartao-nome b { color: var(--text-strong); font-family: var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-cartao-nome .hint { margin: 0; }
.ag-cartao-canais { display: flex; flex-wrap: wrap; gap: var(--space-3); min-height: 20px; }
.ag-cartao-canais .tag { gap: 4px; text-transform: none; letter-spacing: 0; max-width: 100%; overflow: hidden; }
.ag-cartao-canais .hint { margin: 0; }
.ag-cartao-numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
.ag-cartao-numeros div { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 0; }
.ag-cartao-numeros b { color: var(--text-strong); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cartao-numeros .kpi-l { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cartao-acoes { display: flex; gap: var(--space-3); margin-top: auto; }
.ag-cartao-acoes .primary { flex: 1; }
.ag-avatar { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-neon); }
.ag-avatar.grande { width: 56px; height: 56px; border-radius: var(--radius-card); }
.ag-vazio { display: flex; flex-direction: column; align-items: center; gap: var(--space-5); padding: var(--space-9, 48px) var(--space-6); text-align: center; }
.ag-vazio b { color: var(--text-strong); font-family: var(--font-display); font-size: var(--text-md); }

/* editor */
.ag-editor { padding-bottom: var(--space-7); }
.ag-bar { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.ag-nome { flex: 1; min-width: 160px; font: var(--weight-bold) var(--text-lg)/1.2 var(--font-display); background: transparent; border-color: transparent; padding-left: var(--space-3); }
.ag-nome:hover { border-color: var(--border-default); }
.ag-modo { flex: none; }
.ag-modo button { padding: 7px 14px; }
.ag-modo button[data-modo="auto"].active { background: var(--success-soft); color: var(--success); }
.ag-modo button[data-modo="off"].active { background: var(--surface-raised); color: var(--text-strong); }
.ag-sujo { font-size: var(--text-2xs); color: var(--warning); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.ag-abas { display: flex; gap: 2px; border-bottom: 1px solid var(--border-subtle); margin: var(--space-6) 0 var(--space-7); overflow-x: auto; scrollbar-width: none; }
.ag-abas button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-faint);
  padding: 10px 14px; font: var(--type-ui); font-size: var(--text-sm); cursor: pointer; white-space: nowrap; transition: var(--transition-control); }
.ag-abas button:hover { color: var(--text-strong); }
.ag-abas button.on { color: var(--text-strong); border-bottom-color: var(--accent); }
.ag-conta { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--text-muted);
  font-size: var(--text-2xs); display: inline-flex; align-items: center; justify-content: center; }
.ag-abas button.on .ag-conta { background: var(--accent-soft); color: var(--accent); }
.ag-duas { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-7); align-items: start; }
.ag-painel { min-width: 0; }
.ag-painel h3:first-child, .ag-painel-topo h3 { margin-top: 0; }
.ag-painel-topo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.ag-painel-topo h3 { margin-bottom: 0; }
.ag-painel-topo .hint { margin: 0; }
.ag-lateral { background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-6); }
.ag-lateral h3 { margin: var(--space-7) 0 var(--space-3); }
.ag-lateral h3:first-child { margin-top: 0; }
.ag-lateral label { margin-top: var(--space-5); }
.ag-lateral input, .ag-lateral select, .ag-lateral textarea { background: var(--surface-card); }
.ag-dica { margin-top: var(--space-3); }
.ag-prompt { min-height: 460px; font: var(--type-code); font-size: var(--text-sm); line-height: 1.6; resize: vertical; }
.ag-seg-cheio button { flex: 1; padding: 7px 4px; }
.ag-linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.ag-linha2 label { margin-top: 0; min-height: 2.6em; display: flex; align-items: flex-end; }
.field-sufixo { position: relative; }
.field-sufixo input { padding-right: 52px; }
.field-sufixo span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: var(--text-xs); pointer-events: none; }

/* chave liga/desliga */
.ag-interruptor { display: inline-flex; align-items: center; gap: var(--space-4); cursor: pointer; font: var(--type-ui); font-size: var(--text-sm);
  text-transform: none; letter-spacing: 0; color: var(--text-body); position: relative; }
label.ag-interruptor { display: flex; margin-top: var(--space-6); }
.ag-interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ag-trilho { width: 34px; height: 20px; flex: none; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--border-default);
  position: relative; transition: var(--transition-control); }
.ag-trilho::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform var(--dur-fast, .15s) var(--ease-out, ease), background var(--dur-fast, .15s); }
.ag-interruptor input:checked + .ag-trilho { background: var(--accent-soft); border-color: var(--border-neon); }
.ag-interruptor input:checked + .ag-trilho::after { transform: translateX(14px); background: var(--accent); box-shadow: var(--glow-green-sm); }
.ag-interruptor input:focus-visible + .ag-trilho { box-shadow: var(--glow-green-sm); }
.ag-interruptor input:disabled + .ag-trilho { opacity: .4; }

/* conhecimento */
.ag-soltar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); margin: 0; padding: var(--space-8) var(--space-6);
  border: 1.5px dashed var(--border-default); border-radius: var(--radius-card); background: var(--surface-sunken); color: var(--text-muted);
  text-align: center; cursor: pointer; text-transform: none; letter-spacing: 0; font: var(--type-ui); transition: var(--transition-control); }
.ag-soltar b { color: var(--text-strong); font-size: var(--text-sm); }
.ag-soltar .hint { margin: 0; }
.ag-soltar:hover, .ag-soltar.sobre { border-color: var(--border-neon); background: var(--accent-soft); color: var(--accent); }
.ag-soltar.lendo { pointer-events: none; opacity: .7; }
.ag-doc { display: flex; align-items: flex-start; gap: var(--space-5); padding: var(--space-5) 0; border-bottom: 1px solid var(--border-subtle); }
.ag-doc:last-child { border-bottom: 0; }
.ag-doc-ic { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-control); background: var(--surface-raised); color: var(--text-muted); }
.ag-doc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ag-doc-txt b { color: var(--text-strong); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-doc-txt .hint { margin: 0; }
.ag-amostra { font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; opacity: .8; }
.ag-barra { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--surface-raised); overflow: hidden; }
.ag-barra span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--dur-slow, .4s) var(--ease-out, ease); }
.ag-barra.alerta span { background: var(--warning); }

/* canais */
.ag-canais { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.ag-canal { display: flex; align-items: center; gap: var(--space-5); margin: 0; padding: var(--space-5) var(--space-6); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--surface-sunken); cursor: pointer; text-transform: none; letter-spacing: 0; font: var(--type-ui); transition: var(--transition-control); }
.ag-canal:hover { border-color: var(--border-default); }
.ag-canal:has(input:checked) { border-color: var(--border-neon); }
.ag-canal.ocupado { opacity: .55; cursor: not-allowed; }
.ag-canal-ic { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-control); background: var(--surface-raised); color: var(--text-muted); }
.ag-canal-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-canal-txt b { color: var(--text-strong); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-canal-txt .hint { margin: 0; }

/* teste */
.ag-teste { max-width: 760px; margin: 0 auto; }
.ag-teste-bar { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.ag-chat { display: flex; flex-direction: column; gap: 6px; height: min(520px, 60vh); overflow-y: auto; padding: var(--space-6);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card); background: var(--surface-sunken); }
.ag-chat .ibx-msg img, .ag-chat .ibx-msg video { display: block; max-width: 260px; max-height: 260px; border-radius: var(--radius-control); margin-bottom: 4px; }
.ag-chat .ibx-msg audio { display: block; max-width: 260px; margin-bottom: 4px; }
.ag-anexo-doc { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 4px; border-radius: var(--radius-control); background: rgba(255,255,255,.06); font-size: var(--text-xs); }
.ag-chat-vazio { margin: auto; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; color: var(--text-faint); font-size: var(--text-sm); line-height: 1.5; }
.ag-anexo { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); padding: 6px 6px 6px 12px; border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); background: var(--surface-raised); font-size: var(--text-sm); width: fit-content; max-width: 100%; }
.ag-anexo > span:not(.ic):not(.hint) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.ag-anexo .hint { margin: 0; white-space: nowrap; }
.ag-composer { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.ag-composer input { flex: 1; }
.ag-pensando { opacity: .7; font-style: italic; display: inline-flex; align-items: center; gap: 6px; }
.ic.gira { animation: ag-gira 1s linear infinite; }
@keyframes ag-gira { to { transform: rotate(360deg); } }

/* uso */
.ag-dias { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); }
.ag-dia { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.ag-dia span { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .75; transition: opacity var(--dur-fast, .15s); }
.ag-dia:hover span { opacity: 1; }
.ag-dias-eixo { display: flex; justify-content: space-between; margin-top: var(--space-3); font: var(--type-code); font-size: var(--text-2xs); color: var(--text-faint); }
.ag-linha-uso { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.ag-linha-uso:last-child { border-bottom: 0; }
.ag-linha-uso > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-linha-uso b { color: var(--text-strong); text-align: right; }
.ag-linha-uso .hint { grid-column: 1 / -1; margin: 0; }

@media (max-width: 900px) {
  .ag-duas { grid-template-columns: 1fr; }
  .ag-resumo { grid-template-columns: 1fr 1fr; }
  .ag-resumo .ag-mes { grid-column: 1 / -1; }
  .ag-prompt { min-height: 320px; }
}
@media (max-width: 560px) {
  .ag-bar .ag-modo { order: 5; width: 100%; }
  .ag-modo button { flex: 1; }
  .ag-cartao-numeros { grid-template-columns: 1fr 1fr; }
}

/* IA dentro do inbox: sugestão para aprovar e estado da conversa */
.ai-sugestao { margin: 0 var(--space-5) var(--space-4); padding: var(--space-5); border: 1px solid var(--border-neon, var(--border-default)); border-radius: var(--radius-md); background: var(--surface-card); }
.ai-sugestao-head { display: flex; align-items: center; gap: 6px; font-size: var(--text-2xs); color: var(--text-faint); margin-bottom: 6px; }
.ai-sugestao textarea { min-height: 70px; font-size: var(--text-sm); }
.ai-sugestao .actions { margin-top: 8px; }
.msg-transcricao { font-size: var(--text-2xs); color: var(--text-faint); margin-top: 4px; font-style: italic; }

/* ── Consentimento do OAuth (conectar Claude/ChatGPT) ── */
.cst-box { max-width: 460px; }
.cst-titulo { margin: var(--space-6) 0 var(--space-2); font: var(--weight-bold) var(--text-lg)/1.35 var(--font-display); color: var(--text-body); }
.cst-titulo b { color: var(--text-strong); }
.cst-como { font-size: var(--text-xs); color: var(--text-faint); margin-bottom: var(--space-6); }
.cst-host { font: var(--type-code); font-size: var(--text-2xs); background: var(--surface-raised); padding: 1px 6px; border-radius: var(--radius-xs); }
.cst-aviso { padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); border: 1px solid rgba(255,210,61,.35);
  background: var(--warning-soft); color: var(--warning); border-radius: var(--radius-md); font-size: var(--text-sm); }
.cst-lista { list-style: none; margin: 0 0 var(--space-7); padding: 0; display: grid; gap: var(--space-4); }
.cst-lista li { position: relative; padding-left: 22px; font-size: var(--text-sm); color: var(--text-body); line-height: 1.45; }
.cst-lista li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cst-acoes { display: flex; gap: var(--space-4); }
.cst-acoes .btn { flex: 1; justify-content: center; }
.cst-rodape { margin-top: var(--space-5); text-align: center; }

/* ── Conexões de IA (MCP) na aba Agents ── */
.mcp-url { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-6); }
.mcp-url code { flex: 1; background: none; padding: 0; font-size: var(--text-sm); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcp-passos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); }
.mcp-passos > div { display: flex; flex-direction: column; gap: 4px; padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.mcp-passos b { color: var(--text-strong); font-size: var(--text-sm); }
.mcp-passos span { font-size: var(--text-xs); color: var(--text-faint); line-height: 1.5; }
.mcp-passos code { font-size: var(--text-2xs); word-break: break-all; }
.mcp-linha { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5) 0; border-bottom: 1px solid var(--border-subtle); }
.mcp-linha:last-child { border-bottom: 0; }
.mcp-ic { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-control); background: var(--surface-raised); color: var(--text-muted); }
.mcp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mcp-txt b { color: var(--text-strong); font-size: var(--text-sm); }
.mcp-txt .hint { margin: 0; }
.mcp-pat { display: flex; gap: var(--space-4); margin-top: var(--space-6); }
.mcp-pat input { flex: 1; max-width: 320px; }
.mcp-token { margin-top: var(--space-5); padding: var(--space-5) var(--space-6); border: 1px solid var(--border-neon);
  border-radius: var(--radius-md); background: var(--accent-soft); display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.mcp-token code { word-break: break-all; background: var(--surface-card); font-size: var(--text-xs); }
.mcp-token .hint { margin: 0; }
