/* ==========================================================================
   Nexos — Claude (N.claude) · prefixo .cl-
   Painel lateral direito no desktop (sem escurecer o fundo), tela cheia no
   celular, ou janela flutuante quando o usuário "destaca".
   Abas: Conversa · Sugestões · Pedidos · Rotinas.
   Cartões-fantasma = propostas do Claude (borda tracejada na cor de destaque).
   ========================================================================== */

/* ==========================================================================
   Painel lateral
   ========================================================================== */
.cl-panel {
  --cl-w: 420px;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(var(--cl-w), 100vw);
  /* abaixo das janelas flutuantes: uma nota aberta pelo painel aparece por cima */
  z-index: calc(var(--z-window) - 1);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  transform: translateX(calc(100% + 28px));
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.cl-panel.is-open { transform: none; box-shadow: var(--shadow-window); }
.cl-panel.is-closing { transition-duration: .26s; pointer-events: none; }
.cl-panel > .cl-root { flex: 1; min-height: 0; }

/* Elementos do shell abrem espaço para o painel (só no desktop) */
:root:has(.cl-panel) .fab { transition: transform .22s var(--spring), box-shadow .2s, right .3s var(--ease); }
@media (min-width: 761px) {
  body.cl-open .fab { right: calc(420px + 26px); }
  body.cl-open .toasts, body.cl-open .dock { left: calc(50% - 210px); }
}

/* ==========================================================================
   Estrutura (lateral e janela)
   ========================================================================== */
.cl-root {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  background: var(--bg); color: var(--text);
  font-size: var(--fs);
}

/* Janela flutuante ("Destacar") */
.cl-win { overflow: hidden; background: var(--bg); }
.cl-win > .cl-root { position: absolute; inset: 0; }

/* ---- Cabeçalho ---- */
.cl-head-wrap { flex-shrink: 0; background: var(--surface); }
.cl-head {
  display: flex; align-items: center; gap: 11px;
  min-height: 66px; padding: 13px 10px 11px var(--pad);
}
.cl-logo {
  width: 38px; height: 38px; border-radius: var(--r); flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--on-accent);
  background: radial-gradient(120% 120% at 25% 15%, color-mix(in srgb, var(--accent) 60%, var(--surface)), var(--accent) 60%, var(--accent-2));
  box-shadow: 0 6px 16px var(--accent-ring);
}
.cl-logo svg.lucide { width: 19px; height: 19px; stroke-width: 2; }
.cl-head-text { flex: 1; min-width: 0; }
.cl-title { display: flex; align-items: center; gap: 7px; font-weight: 720; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.25; }
.cl-status { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.cl-status .status-dot { flex-shrink: 0; animation: clBreath 2.6s ease-in-out infinite; }
.cl-head-btns { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.cl-head-btns .btn { color: var(--text-2); }
.cl-head-btns .btn:hover { color: var(--text); }
.cl-close svg.lucide { width: 19px; height: 19px; }
/* na lateral o "Destacar" vira só ícone (com dica), para o status caber inteiro */
.cl-root--side .cl-detach { width: 28px; padding: 0; }
.cl-root--side .cl-detach span { display: none; }
.cl-head-btns [data-tip]:hover::after { left: auto; right: 0; transform: none; }

/* ---- Abas ---- */
.cl-tabs-wrap { flex-shrink: 0; padding: 0 var(--pad) 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cl-tabs { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
.cl-tabs::-webkit-scrollbar { display: none; }
.cl-tabs button { flex: 1 0 auto; height: 32px; padding: 0 10px; gap: 6px; }
.cl-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full);
  background: var(--accent); color: var(--on-accent);
  font-size: 10.5px; font-weight: 750; line-height: 1;
}
.cl-tabs button:not(.on) .cl-count { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- Painéis ---- */
.cl-panes { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.cl-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: clFade .22s var(--ease); }
.cl-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px var(--pad) 28px;
}

/* ---- Rodapé ---- */
.cl-disclaimer {
  flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: center; gap: 6px;
  padding: 0 calc(var(--pad) + 6px) 11px;
  background: var(--bg);
  font-size: 11px; line-height: 1.45; color: var(--text-3);
}
.cl-disclaimer svg.lucide { width: 13px; height: 13px; margin-top: 1px; color: var(--success); opacity: .85; }
/* depois que a conversa começa, o rodapé encolhe para uma linha */
.cl-root:has(.cl-thread:not(.is-empty)) .cl-disc-long,
.cl-root:has(.cl-pane[data-pane="conversa"][hidden]) .cl-disc-long { display: none; }

.cl-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ==========================================================================
   Conversa
   ========================================================================== */
.cl-thread {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: 18px var(--pad) 20px;
}
.cl-msgs { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.cl-thread.is-empty .cl-msgs { flex: 1; }

/* ---- Boas-vindas (estado vazio) ---- */
.cl-welcome {
  margin: auto 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 6px 0 4px;
}
.cl-orb {
  position: relative;
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; margin: 10px 0 18px;
  color: var(--on-accent);
  background: radial-gradient(110% 110% at 28% 18%, color-mix(in srgb, var(--accent) 55%, var(--surface)), var(--accent) 58%, var(--accent-2));
  box-shadow: 0 14px 34px var(--accent-ring), 0 0 0 7px var(--accent-soft);
  animation: clFloat 5.5s ease-in-out infinite;
}
.cl-orb::before {
  content: ""; position: absolute; inset: -15px; border-radius: 50%;
  border: 1.5px dashed var(--accent-ring);
  animation: clSpin 28s linear infinite;
}
.cl-orb svg.lucide { width: 28px; height: 28px; stroke-width: 1.9; }
.cl-w-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; animation: clRise .4s var(--ease) both; }
.cl-w-text { max-width: 330px; margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); animation: clRise .4s .04s var(--ease) both; }
.cl-w-text b { color: var(--text); font-weight: 650; }
.cl-starters { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.cl-starter {
  display: flex; align-items: center; gap: 11px; width: 100%;
  min-height: 50px; padding: 8px 12px 8px 8px;
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 13.8px; font-weight: 580; text-align: left; color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur), transform .18s var(--ease);
  animation: clRise .4s var(--ease) both;
}
.cl-starter:nth-child(1) { animation-delay: .08s; }
.cl-starter:nth-child(2) { animation-delay: .13s; }
.cl-starter:nth-child(3) { animation-delay: .18s; }
.cl-starter:hover { border-color: var(--accent-ring); box-shadow: var(--shadow); transform: translateY(-1px); }
.cl-starter:active { transform: scale(.985); }
.cl-starter-ico { width: 34px; height: 34px; border-radius: var(--r); flex-shrink: 0; display: grid; place-items: center; background: var(--c-bg); color: var(--c-ink); }
.cl-starter-ico svg.lucide { width: 16px; height: 16px; }
.cl-starter-go { color: var(--text-3); transition: transform .2s var(--ease), color .2s; }
.cl-starter:hover .cl-starter-go { color: var(--accent); transform: translate(2px, -2px); }
.cl-w-more { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 20px; animation: clRise .4s .24s var(--ease) both; }
.cl-w-more .cl-chips { justify-content: center; }

/* ---- Mensagens ---- */
.cl-msg { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.cl-msg--user { justify-content: flex-end; padding-left: 40px; }
/* só o que acabou de chegar anima (o painel re-renderiza a cada mudança no store) */
.cl-msg.cl-new, .cl-thinking { animation: clMsgIn .3s var(--ease) both; }
.cl-msg--user.cl-new { animation-name: clMsgInRight; }
.cl-bubble {
  max-width: 100%;
  padding: 9px 14px; border-radius: calc(var(--r-lg) + 2px) calc(var(--r-lg) + 2px) var(--r-xs) calc(var(--r-lg) + 2px);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.cl-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: grid; place-items: center;
  color: var(--on-accent);
  background: radial-gradient(110% 110% at 28% 18%, color-mix(in srgb, var(--accent) 55%, var(--surface)), var(--accent) 60%, var(--accent-2));
  box-shadow: 0 3px 10px var(--accent-ring);
}
.cl-av svg.lucide { width: 14px; height: 14px; stroke-width: 2.1; }
.cl-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-block { min-width: 0; max-width: 100%; }
.cl-block--text, .cl-block--tabbtn { align-self: flex-start; }
.cl-text {
  padding: 9px 13px; border-radius: var(--r-xs) calc(var(--r-lg) + 2px) calc(var(--r-lg) + 2px) calc(var(--r-lg) + 2px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 14px; line-height: 1.62; color: var(--text);
  overflow-wrap: anywhere;
}
.cl-block:not(:first-child) > .cl-text { border-top-left-radius: calc(var(--r-lg) + 2px); }
.cl-text b { font-weight: 690; }
.cl-meta { margin-top: -2px; padding: 0 4px; font-size: 11px; color: var(--text-3); }

/* ---- "Pensando…" ---- */
.cl-thinking .cl-av { animation: clPulse 1.6s ease-in-out infinite; }
.cl-thinking .cl-av svg.lucide { animation: clTwinkle 1.6s ease-in-out infinite; }
.cl-think {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 9px 15px 9px 13px;
  border-radius: var(--r-xs) calc(var(--r-lg) + 2px) calc(var(--r-lg) + 2px) calc(var(--r-lg) + 2px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.cl-dots { display: inline-flex; align-items: center; gap: 4px; }
.cl-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: clDot 1.1s ease-in-out infinite; }
.cl-dots i:nth-child(2) { animation-delay: .15s; }
.cl-dots i:nth-child(3) { animation-delay: .3s; }
.cl-think-label {
  font-size: 12.8px; font-weight: 560;
  background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 35%, var(--text) 50%, var(--text-3) 65%, var(--text-3) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: clShimmer 1.8s linear infinite;
}

/* ---- Entrada progressiva das respostas ---- */
.cl-pending { display: none !important; }
.cl-tw-hide { display: none !important; }
.cl-in { animation: clRise .32s var(--ease) both; }
.cl-typing .cl-text::after {
  content: ""; display: inline-block;
  width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px;
  border-radius: 2px; background: var(--accent);
  animation: clCaret .8s steps(1) infinite;
}

/* ---- Referências a itens/espaços (chips clicáveis dentro do texto) ---- */
.cl-ref {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%; height: 23px; padding: 0 8px 0 6px; margin: 0 1px;
  vertical-align: middle;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--surface-3); color: var(--text);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  transition: background var(--dur), color var(--dur), border-color var(--dur), transform .1s;
}
.cl-ref svg.lucide { width: 12px; height: 12px; color: var(--text-3); }
.cl-ref-emo { font-size: 12.5px; line-height: 1; }
.cl-ref-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.cl-ref:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-ring); }
button.cl-ref:hover svg.lucide { color: var(--accent); }
button.cl-ref:active { transform: scale(.96); }
.cl-ref--space { background: var(--c-bg); color: var(--c-ink); }
button.cl-ref--space:hover { background: color-mix(in srgb, var(--c-s) 24%, var(--c-bg)); color: var(--c-ink); border-color: color-mix(in srgb, var(--c-s) 45%, transparent); }
.cl-ref.is-gone { background: transparent; border: 1px dashed var(--border-2); color: var(--text-3); text-decoration: line-through; cursor: default; }

/* ---- Sugestões rápidas (chips) ---- */
.cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 5px 12px;
  border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 12.8px; font-weight: 560; line-height: 1.25; text-align: left;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform .1s;
}
.cl-chip svg.lucide { width: 13px; height: 13px; flex-shrink: 0; color: var(--accent); }
.cl-chip:hover { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent-ink); }
.cl-chip:active { transform: scale(.97); }
.cl-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cl-label { font-size: 10.8px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }

/* ---- Blocos ricos ---- */
.cl-note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.5; color: var(--text-2);
}
.cl-note > svg.lucide { width: 13px; height: 13px; margin-top: 3px; color: var(--accent); }

/* ==========================================================================
   Cartões-fantasma (propostas: o Claude propõe, você decide)
   ========================================================================== */
.cl-ghosts { display: flex; flex-direction: column; gap: 8px; }
.cl-accept-all { align-self: flex-start; }
.cl-ghost-list { display: flex; flex-direction: column; gap: 10px; }
.cl-ghost {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 12px 11px; border-radius: var(--r-lg);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 58%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur), transform .2s var(--ease);
}
.cl-ghost:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 12%, transparent); }
.cl-ghost-top { display: flex; align-items: center; gap: 7px; font-size: 11.8px; font-weight: 660; color: var(--accent-ink); }
.cl-ghost-ico { width: 24px; height: 24px; border-radius: var(--r-sm); flex-shrink: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cl-ghost-ico svg.lucide { width: 13px; height: 13px; }
.cl-ghost-tag {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: var(--r-full);
  border: 1px dashed var(--accent-ring);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent);
}
.cl-ghost-tag svg.lucide { width: 11px; height: 11px; }
.cl-ghost-text { font-size: 13.8px; font-weight: 620; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }
.cl-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cl-flow .chip { height: 23px; }
.cl-flow-arrow, .cl-flow-link { display: inline-grid; place-items: center; color: var(--accent); }
.cl-flow-link { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--accent-ring); }
.cl-flow-link svg.lucide { width: 12px; height: 12px; }
.cl-flow-from { gap: 7px; }
.cl-ghost-task {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  min-height: 28px; padding: 3px 10px 3px 7px;
  border-radius: var(--r-sm); border: 1px dashed var(--border-2); background: var(--surface);
  font-size: 13px; font-weight: 560; line-height: 1.3;
}
.cl-ghost-check { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; border: 1.6px dashed var(--accent); }
.cl-ghost-why { display: flex; align-items: flex-start; gap: 7px; font-size: 12.3px; line-height: 1.45; color: var(--text-2); }
.cl-ghost-why svg.lucide { width: 13px; height: 13px; margin-top: 2px; color: var(--text-3); }
.cl-ghost-btns { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.cl-ghost-btns .btn-primary { padding: 0 13px; }

.cl-ghost.is-leaving { pointer-events: none; }
.cl-ghost.is-accepting {
  border-style: solid; border-color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  animation: clGhostAccept .32s var(--ease) forwards;
}
.cl-ghost.is-rejecting { animation: clGhostReject .3s var(--ease) forwards; }

/* sugestão já resolvida (na conversa) */
.cl-resolved {
  display: flex; align-items: center; gap: 9px;
  min-height: 40px; padding: 8px 12px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.8px; color: var(--text-3);
}
.cl-resolved svg.lucide { width: 15px; height: 15px; }
.cl-resolved .grow { text-decoration: line-through; text-decoration-color: var(--border-2); }
.cl-resolved.is-ok { background: color-mix(in srgb, var(--success) 8%, var(--surface)); border-color: color-mix(in srgb, var(--success) 26%, transparent); color: var(--text-2); }
.cl-resolved.is-ok svg.lucide { color: var(--success); }
.cl-resolved.is-ok .grow { text-decoration: none; }
.cl-resolved.is-ok .tiny { color: var(--success); font-weight: 650; }

/* ==========================================================================
   Campo de mensagem (fixo embaixo)
   ========================================================================== */
.cl-composer {
  position: relative; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px var(--pad) 10px;
  background: var(--bg);
}
.cl-composer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.cl-quick {
  display: flex; gap: 6px;
  margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad);
  overflow-x: auto; scrollbar-width: none; scroll-padding: 0 var(--pad);
}
.cl-quick::-webkit-scrollbar { display: none; }
.cl-quick .cl-chip { flex-shrink: 0; min-height: 30px; padding: 4px 11px; font-size: 12.3px; white-space: nowrap; }
.cl-ctx { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 4px; font-size: 11.5px; color: var(--text-3); }
.cl-ctx svg.lucide { width: 13px; height: 13px; }
.cl-ctx .chip { height: 20px; font-size: 11.3px; }

.cl-input-wrap {
  position: relative;
  display: flex; align-items: flex-end; gap: 2px;
  padding: 5px 5px 5px 15px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.cl-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm); }
.cl-input {
  flex: 1; min-width: 0; align-self: center;
  max-height: 140px; padding: 7px 0;
  border: 0; outline: 0; background: transparent; resize: none;
  font-size: 14.5px; line-height: 1.45; color: var(--text);
  overflow-y: auto;
}
.cl-input::placeholder { color: var(--text-3); }
.cl-input:focus-visible { outline: none; }
.cl-mic, .cl-send { width: 36px; height: 36px; border-radius: max(calc(var(--r-xl) - 5px), 6px); flex-shrink: 0; }
.cl-mic { color: var(--text-3); }
.cl-mic:hover { color: var(--text); }
.cl-send { transition: background var(--dur), color var(--dur), transform .18s var(--spring), box-shadow var(--dur); }
.cl-send svg.lucide { width: 18px; height: 18px; stroke-width: 2.3; }
.cl-send:not(:disabled):hover { transform: translateY(-1px); }
.cl-send:disabled { opacity: 1; background: var(--surface-3); color: var(--text-3); box-shadow: none; }
.cl-send.is-busy { background: var(--accent-soft); color: var(--accent); }
.cl-send.is-busy svg.lucide { animation: clBob 1s ease-in-out infinite; }

/* Ditado por voz */
.cl-wave { display: none; align-items: center; gap: 3px; height: 36px; padding: 0 6px; }
.cl-wave i { display: block; width: 3px; height: 16px; border-radius: 3px; background: var(--accent); transform-origin: center; animation: clWave .9s ease-in-out infinite; }
.cl-wave i:nth-child(2) { animation-delay: .12s; }
.cl-wave i:nth-child(3) { animation-delay: .24s; }
.cl-wave i:nth-child(4) { animation-delay: .36s; }
.cl-wave i:nth-child(5) { animation-delay: .48s; }
.cl-input-wrap.is-listening { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cl-input-wrap.is-listening .cl-wave { display: inline-flex; }
.cl-input-wrap.is-listening .cl-mic { background: var(--accent); color: var(--on-accent); animation: clMicRing 1.4s ease-out infinite; }

/* ==========================================================================
   Sugestões
   ========================================================================== */
.cl-sug, .cl-rtp { display: flex; flex-direction: column; gap: 12px; }
.cl-sec-head { display: flex; align-items: center; gap: 10px; }
.cl-sec-head .btn { flex-shrink: 0; }
.cl-sec-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.cl-sec-sub { margin-top: 1px; font-size: 12.3px; line-height: 1.4; color: var(--text-2); }

.cl-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 16px 26px; text-align: center; }
.cl-empty-ico { width: 60px; height: 60px; margin-bottom: 4px; border-radius: var(--r-xl); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); animation: clFloat 5.5s ease-in-out infinite; }
.cl-empty-ico svg.lucide { width: 26px; height: 26px; }
.cl-empty-title { font-size: 15.5px; font-weight: 680; }
.cl-empty-text { max-width: 300px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.cl-empty .btn { margin-top: 6px; }

/* Resumo da madrugada */
.cl-night {
  position: relative; overflow: hidden;
  padding: 13px 14px 13px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--c-lilac), var(--c-sky));
  color: var(--c-lilac-ink);
}
.cl-night::after {
  content: ""; position: absolute; top: -40px; right: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 30%, transparent);
  pointer-events: none;
}
.cl-night > * { position: relative; z-index: 1; }
.cl-night-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.cl-night-emo { font-size: 18px; line-height: 1; }
.cl-night-time { margin-left: auto; font-size: 11.5px; opacity: .78; white-space: nowrap; }
.cl-night ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.cl-night li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.8px; line-height: 1.45; color: var(--text); }
.cl-night li svg.lucide { width: 14px; height: 14px; margin-top: 2px; color: var(--c-lilac-ink); }

/* ==========================================================================
   Pedidos (Caixa @claude)
   ========================================================================== */
.cl-req-head:empty, .cl-req-list:empty { display: none; }
.cl-req-list { display: flex; flex-direction: column; gap: 12px; }

.cl-server {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.cl-server-ico { position: relative; width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--c-mint); color: var(--c-mint-ink); }
.cl-server-ico::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2.5px var(--surface); }
.cl-server-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13.8px; font-weight: 650; }
.cl-online {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px; border-radius: var(--r-full);
  background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success);
  font-size: 11px; font-weight: 650;
}
.cl-online .status-dot { width: 6px; height: 6px; box-shadow: none; animation: clBreath 2.4s ease-in-out infinite; }
.cl-server-sub { margin-top: 1px; font-size: 11.8px; color: var(--text-3); }
.cl-process { grid-column: 1 / -1; width: 100%; height: 36px; }

.cl-req-form {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.cl-req-form:focus-within { border-color: var(--accent-ring); box-shadow: var(--shadow); }
.cl-req-label { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 7px; font-size: 13.5px; }
.cl-req-label svg.lucide { width: 15px; height: 15px; color: var(--accent); }
.cl-req-input { display: flex; flex-direction: column; gap: 8px; }
textarea.cl-req-text { min-height: 66px; resize: none; font-size: 13.5px; background: var(--surface-2); }
textarea.cl-req-text:focus { background: var(--surface); }
.cl-req-send { align-self: flex-end; }

.cl-reqs { display: flex; flex-direction: column; gap: 8px; }
.cl-req {
  position: relative; overflow: hidden;
  padding: 11px 12px 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.cl-req.is-wait { background: var(--surface-2); border-style: dashed; border-color: var(--border-2); box-shadow: none; }
.cl-req.is-run { border-color: var(--accent-ring); }
.cl-req.is-run::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
  background-size: 45% 100%;
  animation: clSweep 1.2s linear infinite;
}
.cl-req-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.cl-req-when { flex: 1 1 auto; min-width: 0; font-size: 11.8px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-st {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; margin-left: auto;
  height: 22px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 11.3px; font-weight: 640; white-space: nowrap;
}
.cl-st svg.lucide { width: 12px; height: 12px; }
.cl-st--ok { background: color-mix(in srgb, var(--success) 13%, transparent); color: var(--success); }
.cl-st--run { background: var(--accent-soft); color: var(--accent-ink); }
.cl-st--wait { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.cl-req-body { margin-top: 8px; font-size: 13.8px; font-weight: 560; line-height: 1.45; overflow-wrap: anywhere; }
.cl-req-res {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 10px; padding: 10px 11px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.8px; line-height: 1.5; color: var(--text-2);
}
.cl-req-res > svg.lucide { width: 14px; height: 14px; margin-top: 3px; color: var(--accent); }
.cl-req-open { margin-top: 7px; }

.cl-upsell {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 11px 12px; border-radius: var(--r-lg);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 560; line-height: 1.4;
}
.cl-upsell > .grow { flex: 1 1 170px; }

/* "Como funciona?" */
.cl-how summary {
  display: flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 6px 10px; border-radius: var(--r);
  list-style: none; cursor: pointer;
  font-size: 12.8px; font-weight: 600; color: var(--text-2);
  transition: background var(--dur), color var(--dur);
}
.cl-how summary::-webkit-details-marker { display: none; }
.cl-how summary::marker { content: ""; }
.cl-how summary svg.lucide { width: 14px; height: 14px; color: var(--warning); }
.cl-how summary::after {
  content: ""; margin-left: auto;
  width: 7px; height: 7px;
  border: solid var(--text-3); border-width: 0 1.8px 1.8px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s var(--ease);
}
.cl-how[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.cl-how summary:hover { background: var(--hover); color: var(--text); }
.cl-how p { padding: 4px 10px 8px 31px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); animation: clFade .2s ease; }
.cl-code { padding: 1px 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }

/* ==========================================================================
   Rotinas
   ========================================================================== */
.cl-day { padding: 12px 14px 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cl-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-day-track { position: relative; height: 34px; margin: 28px 8px 2px; }
.cl-day-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 6px; margin-top: -3px; border-radius: var(--r-full);
  /* madrugada → dia → fim de tarde → noite */
  background: linear-gradient(90deg, var(--c-lilac) 0%, var(--c-lilac) 21%, var(--c-yellow) 31%, var(--c-yellow) 70%, var(--c-peach) 77%, var(--c-lilac) 86%, var(--c-lilac) 100%);
}
.cl-day-tick { position: absolute; top: 50%; width: 2px; height: 12px; margin-top: -6px; transform: translateX(-50%); border-radius: 2px; background: var(--accent); opacity: .55; }
.cl-day-tick.is-past { opacity: .22; }
.cl-day-mark {
  position: absolute; top: 50%; z-index: 2;
  width: 28px; height: 28px; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center;
  background: var(--c-bg); box-shadow: 0 0 0 2.5px var(--surface), var(--shadow-sm);
  font-size: 13.5px; line-height: 1;
  transition: transform .2s var(--spring);
}
.cl-day-mark:hover { z-index: 4; transform: translate(-50%, -50%) scale(1.18); }
.cl-day-mark.is-past { filter: saturate(.55); opacity: .78; box-shadow: 0 0 0 2.5px var(--surface); }
.cl-day-now { position: absolute; top: -4px; bottom: -4px; z-index: 3; width: 2px; transform: translateX(-50%); border-radius: 2px; background: var(--accent); pointer-events: none; }
.cl-day-now::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cl-day-now span {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 2px; padding: 1px 6px; border-radius: var(--r-full);
  background: var(--accent); color: var(--on-accent);
  font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.cl-day-hours { display: flex; justify-content: space-between; margin-top: 2px; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cl-day > .tiny { margin-top: 6px; }

.cl-rts { display: flex; flex-direction: column; gap: 8px; }
.cl-rt {
  display: flex; align-items: stretch; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.cl-rt:hover { border-color: var(--border-2); }
.cl-rt-main {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 4px 12px 12px; border-radius: 0; text-align: left;
  transition: background var(--dur);
}
.cl-rt-main:hover { background: var(--hover); }
.cl-rt-main:focus-visible { outline-offset: -3px; }
.cl-rt-emoji { width: 40px; height: 40px; border-radius: var(--r); flex-shrink: 0; display: grid; place-items: center; background: var(--c-bg); font-size: 19px; line-height: 1; transition: filter .2s, opacity .2s; }
.cl-rt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-rt-name { font-size: 13.8px; font-weight: 650; line-height: 1.3; }
.cl-rt-prompt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.3px; line-height: 1.45; color: var(--text-2); }
.cl-rt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; }
.cl-rt-side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; flex-shrink: 0; padding: 6px 8px 8px 2px; }
.cl-switch-btn { display: grid; place-items: center; min-width: 50px; min-height: 40px; border-radius: var(--r-full); }
.cl-switch-btn:hover .switch:not(.on) { background: var(--text-3); }
.cl-switch-btn .switch { pointer-events: none; }
.cl-rt.is-off { background: var(--surface-2); box-shadow: none; }
.cl-rt.is-off .cl-rt-emoji { filter: grayscale(1); opacity: .55; }
.cl-rt.is-off .cl-rt-name { color: var(--text-2); }
.cl-rt.is-off .cl-rt-meta .chip { opacity: .7; }

/* ---- Formulário de rotina (modal) ---- */
.cl-form { display: flex; flex-direction: column; gap: 14px; }
.cl-form-ideas { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--border-2); }
.cl-form-row { display: flex; align-items: flex-end; gap: 10px; }
.cl-emoji-btn {
  width: 46px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 21px; line-height: 1;
  transition: border-color var(--dur), background var(--dur), transform .15s var(--spring);
}
.cl-emoji-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.cl-emoji-btn:active { transform: scale(.94); }
.cl-freq { display: flex; flex-wrap: wrap; width: 100%; }
.cl-freq button { flex: 1 1 auto; }
.cl-when .cl-f-dow { flex: 1; min-width: 0; }
.cl-when .cl-f-time { flex: 0 0 132px; }
.cl-when .cl-f-dow[hidden] + .cl-f-time { flex: 1; }
.cl-when:not(:has(> :not([hidden]))) { display: none; }
.cl-form-preview { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); font-size: 12.8px; font-weight: 560; line-height: 1.4; }
.cl-form-preview svg.lucide { flex-shrink: 0; }
.cl-form .input.cl-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); animation: clShake .36s var(--ease); }

/* ==========================================================================
   IA real: seletor de provedor, histórico, markdown, erros e estados
   ========================================================================== */
/* status do cabeçalho vira botão (abre o seletor de provedor/modelo) */
.cl-pick-btn {
  max-width: 100%; height: 22px; margin-left: -6px; padding: 0 6px;
  border-radius: var(--r-full); background: transparent; border: 0;
  font: inherit; font-size: 12px; color: var(--text-3); text-align: left; cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.cl-pick-btn:hover { background: var(--hover); color: var(--text-2); }
.cl-pick-btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
.cl-pick-chev { flex-shrink: 0; opacity: .7; }
.cl-pick-btn.is-off .status-dot, .status-dot.is-off { background: var(--text-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-3) 18%, transparent); animation: none; }
.cl-pick-btn.is-off { color: var(--warning); }
.cl-pick-btn.is-wait .status-dot { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }

.popover.cl-pick-pop, .popover.cl-hist-pop { width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; }
.cl-pick-head, .cl-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 8px; font-size: 13.5px; }
.cl-pick-list { display: flex; flex-direction: column; gap: 2px; }
.cl-pick-prov { border-radius: var(--r); }
.cl-pick-prov.is-on { background: var(--accent-soft); }
.cl-pick-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--r); text-align: left; color: var(--text);
}
.cl-pick-row:hover { background: var(--hover); }
.cl-pick-prov.is-off .cl-pick-row { cursor: default; }
.cl-pick-prov.is-off .cl-pick-name { color: var(--text-2); }
.cl-pick-radio {
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; border: 1.6px solid var(--border-2); color: var(--on-accent);
}
.cl-pick-prov.is-on .cl-pick-radio { background: var(--accent); border-color: var(--accent); }
.cl-pick-radio svg.lucide { width: 12px; height: 12px; stroke-width: 3; }
.cl-pick-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; font-weight: 640; }
.cl-pick-kind { padding: 1px 7px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-3); font-size: 10.5px; font-weight: 650; }
.cl-pick-st { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.cl-pick-st .status-dot { width: 6px; height: 6px; flex-shrink: 0; }
.cl-pick-help { display: block; margin-top: 4px; font-size: 11.8px; line-height: 1.45; color: var(--text-2); }
.cl-pick-models { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 10px 10px 38px; }
.cl-pick-model {
  min-height: 28px; padding: 3px 10px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: 12.3px; font-weight: 560;
}
.cl-pick-model:hover { border-color: var(--accent-ring); color: var(--text); }
.cl-pick-model.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cl-pick-custom { display: flex; gap: 6px; width: 100%; margin-top: 3px; }
.cl-pick-custom .input { flex: 1; min-width: 0; height: 32px; font-size: 12.5px; }
.cl-pick-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; padding: 6px 2px 2px; border-top: 1px solid var(--border); }
.cl-pick-foot.is-busy [data-cl-prov-refresh] svg.lucide { animation: clSpin 1s linear infinite; }
.cl-pick-empty { padding: 14px 10px; font-size: 12.8px; color: var(--text-3); text-align: center; }

.cl-hist-list { display: flex; flex-direction: column; gap: 2px; }
.cl-hist-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r); text-align: left; color: var(--text); }
.cl-hist-row:hover { background: var(--hover); }
.cl-hist-row.is-on { background: var(--accent-soft); }
.cl-hist-ico { width: 28px; height: 28px; border-radius: var(--r-sm); flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.cl-hist-row.is-on .cl-hist-ico { background: var(--accent); color: var(--on-accent); }
.cl-hist-t { display: block; font-size: 13.2px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cl-hist-sub { display: block; margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.cl-hist-row .chip { height: 20px; font-size: 10.8px; flex-shrink: 0; }

/* markdown leve nas respostas */
.cl-md > :first-child { margin-top: 0; }
.cl-md > :last-child { margin-bottom: 0; }
.cl-md p { margin: 0 0 8px; }
.cl-md p.cl-md-h { margin: 10px 0 4px; font-weight: 700; font-size: 14.5px; letter-spacing: -.005em; }
.cl-md ul, .cl-md ol { margin: 2px 0 8px; padding-left: 20px; }
.cl-md li { margin: 2px 0; padding-left: 2px; }
.cl-md li::marker { color: var(--accent); }
.cl-md b { font-weight: 690; }
.cl-md a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-ring); text-underline-offset: 2px; overflow-wrap: anywhere; }
.cl-md a:hover { text-decoration-color: var(--accent); }
.cl-md code { padding: 1px 5px; border-radius: var(--r-xs); background: var(--surface-3); font-family: var(--font-mono); font-size: .88em; }
.cl-md pre { margin: 4px 0 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; }
.cl-md pre code { padding: 0; background: none; font-size: 12.5px; white-space: pre; }
.cl-md hr { margin: 10px 0; border: 0; border-top: 1px solid var(--border); }
.cl-text.cl-md { min-width: 0; }
.cl-msg--claude.is-streaming .cl-text { border-color: var(--accent-ring); }
.cl-typing .cl-md > :last-child::after {
  content: ""; display: inline-block;
  width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px;
  border-radius: 2px; background: var(--accent);
  animation: clCaret .8s steps(1) infinite;
}
.cl-typing .cl-text::after { content: none; }
.cl-msg.is-local { opacity: .78; }

/* erro da resposta */
.cl-err {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent);
  font-size: 13px; line-height: 1.5; color: var(--text);
}
.cl-err > svg.lucide { width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; color: var(--danger); }
.cl-err-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ações já resolvidas e cartões que perderam o sentido */
.cl-res-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.4; }
.cl-resolved .cl-res-btn { flex-shrink: 0; height: 26px; padding: 0 8px; margin: -4px -6px -4px 0; font-size: 12px; }
.cl-ghost.is-stale { border-style: dotted; border-color: var(--border-2); background: var(--surface-2); }
.cl-ghost.is-stale .cl-ghost-text { color: var(--text-2); }

/* botão Parar (no lugar do Enviar) */
.cl-send.is-stop { background: var(--text); color: var(--bg); }
.cl-send.is-stop:not(:disabled):hover { transform: none; filter: brightness(1.15); }
.cl-send.is-stop svg.lucide { width: 14px; height: 14px; fill: currentColor; animation: none; }
.cl-input:disabled { cursor: not-allowed; }
.cl-input-wrap:has(.cl-input:disabled) { background: var(--surface-2); box-shadow: none; }

/* aviso no composer quando a IA escolhida caiu */
.cl-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 10px; border-radius: var(--r);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  font-size: 12.5px; line-height: 1.4; color: var(--text);
}
.cl-banner[hidden] { display: none; }
.cl-banner > svg.lucide { color: var(--warning); flex-shrink: 0; }
.cl-banner > .grow { flex: 1 1 160px; min-width: 0; }

/* estado vazio: conectar uma IA */
.cl-connect { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; animation: clRise .35s var(--ease) both; }
.cl-connect .cl-empty-ico { animation: none; }
.cl-connect-list { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; text-align: left; }
.cl-connect-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
}
.cl-connect-row .status-dot { margin-top: 6px; flex-shrink: 0; }
.cl-connect-row b { display: block; font-size: 13.3px; font-weight: 650; }
.cl-connect-st { display: block; font-size: 12px; color: var(--text-3); }
.cl-connect-help { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.cl-connect-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.cl-connect-how { width: 100%; margin-top: 8px; text-align: left; }
.cl-connect-how .cl-connect-list { margin-top: 4px; animation: clFade .2s ease; }

/* pedidos e rotinas reais */
.cl-server.is-off .cl-server-ico { background: var(--surface-3); color: var(--text-3); }
.cl-server.is-off .cl-server-ico::after { background: var(--text-3); }
.cl-online.is-off { background: color-mix(in srgb, var(--warning) 13%, transparent); color: var(--warning); }
.cl-online.is-off .status-dot { background: var(--warning); animation: none; }
.cl-req-del { margin: -4px -6px -4px -2px; color: var(--text-3); }
.cl-req-del:hover { color: var(--danger); }
.cl-st--err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.cl-req.is-err { border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.cl-req-res.is-err > svg.lucide { color: var(--danger); }
.cl-req-res .cl-md { font-size: 13px; line-height: 1.55; }
.cl-req-sug { margin-top: 8px; }
.cl-rt-res {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 6px;
  padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface-2);
  font-size: 12px; line-height: 1.45; color: var(--text-2);
}
.cl-rt-res svg.lucide { width: 12px; height: 12px; margin-top: 2px; flex-shrink: 0; color: var(--accent); }
.cl-rt-res.is-err { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.cl-rt-res.is-err svg.lucide { color: var(--danger); }
.cl-rt.is-running { border-color: var(--accent-ring); }
.cl-night-sum { margin: 8px 0 0; font-size: 12.8px; line-height: 1.5; }

/* ==========================================================================
   Utilidades e animações
   ========================================================================== */
.cl-spin { animation: clSpin 1s linear infinite; }

@keyframes clFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes clRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes clMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes clMsgInRight { from { opacity: 0; transform: translate(10px, 6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes clDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes clShimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
@keyframes clCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes clPulse { 0%, 100% { box-shadow: 0 3px 10px var(--accent-ring), 0 0 0 0 var(--accent-ring); } 50% { box-shadow: 0 3px 10px var(--accent-ring), 0 0 0 6px transparent; } }
@keyframes clTwinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.82) rotate(18deg); } }
@keyframes clFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes clSpin { to { transform: rotate(360deg); } }
@keyframes clBreath { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes clLinkPop { from { transform: scale(0) rotate(-45deg); } to { transform: none; } }
@keyframes clBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes clWave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes clMicRing { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes clSweep { from { background-position: -80% 0; } to { background-position: 180% 0; } }
@keyframes clShake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes clGhostAccept {
  0% { transform: none; opacity: 1; }
  40% { transform: scale(1.015); opacity: 1; }
  100% { transform: scale(.97) translateY(-4px); opacity: 0; }
}
@keyframes clGhostReject { to { transform: translateX(28px) scale(.97); opacity: 0; } }

/* ==========================================================================
   Celular: tela cheia, alvos de toque >= 40px
   ========================================================================== */
@media (max-width: 760px) {
  .cl-panel {
    width: 100%;
    z-index: calc(var(--z-bottomnav) + 20);
    border-left: 0;
    padding-top: env(safe-area-inset-top);
    transform: translateY(100%);
    transition: transform .32s var(--ease);
  }
  .cl-panel.is-open { transform: none; box-shadow: none; }

  /* toasts sobem para não cobrir o campo de mensagem */
  body.cl-open .toasts { top: calc(env(safe-area-inset-top) + 116px); bottom: auto; left: 12px; right: 12px; transform: none; flex-direction: column; }

  .cl-head { min-height: 60px; padding: 8px 6px 8px 14px; gap: 10px; }
  .cl-logo { width: 36px; height: 36px; }
  .cl-head-btns .btn, .cl-head-btns .btn-sm { height: 40px; }
  .cl-head-btns .btn-icon { width: 40px; }
  .cl-tabs-wrap { padding: 0 12px 10px; }
  .cl-tabs button { height: 40px; padding: 0 8px; font-size: 13px; }

  .cl-thread { padding: 14px 14px 18px; }
  .cl-scroll { padding: 14px 14px 24px; }
  .cl-msg--user { padding-left: 28px; }
  .cl-bubble, .cl-text { font-size: 14.5px; }

  .cl-root .btn-sm { height: 40px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); }
  .cl-root .btn-sm.btn-icon { width: 40px; padding: 0; }
  .cl-chip { min-height: 40px; padding: 8px 14px; font-size: 13.2px; }
  .cl-quick .cl-chip { min-height: 40px; padding: 6px 13px; font-size: 13px; }
  .cl-starter { min-height: 56px; }
  .cl-root .check { position: relative; width: 22px; height: 22px; }
  .cl-root .check::before { content: ""; position: absolute; inset: -10px; }
  button.cl-ref::before { content: ""; position: absolute; inset: -9px -2px; }
  .cl-ghost-btns .btn { flex: 1; }
  .cl-ghost-btns .btn-primary { flex: 1.4; }
  .cl-rt-main { padding: 12px 2px 12px 12px; }
  .cl-pick-model { min-height: 36px; padding: 6px 12px; }
  .cl-pick-row, .cl-hist-row { min-height: 48px; }
  .cl-pick-btn { height: 28px; }

  .cl-composer { padding: 6px 12px 8px; }
  .cl-quick { margin: 0 -12px; padding: 2px 12px; }
  .cl-input { font-size: 16px; }
  .cl-mic, .cl-send { width: 40px; height: 40px; }
  .cl-disclaimer { padding: 0 18px calc(8px + env(safe-area-inset-bottom)); }
  .cl-disc-long { display: none; }

  .cl-form-row { flex-wrap: nowrap; }
  .cl-freq button { height: 36px; }
  .cl-when .cl-f-time { flex-basis: 120px; }
}
