/* =========================================================================
   Alnous Agent · estilos
   Sumário: 1 Tokens · 2 Base · 3 Layout · 4 Lateral · 5 Topo · 6 Boas-vindas
            7 Conversa · 8 Blocos · 9 Compositor · 10 Menus · 11 Painéis
            12 Entrar · 13 Utilidades · 14 Celular/Tablet
   ========================================================================= */

/* ---------- 1. Tokens (cores do Alnous) ---------- */
:root {
  --fundo: #eef2f8; --lateral: #e7edf6; --sup: #ffffff; --sup-2: #f2f4f9; --sup-3: #e9edf5;
  --linha: #e2e7f0; --linha-2: #d5dbe7;
  --texto: #0e1628; --texto-2: #3a4660; --suave: #66738d; --fraco: #97a2b8;
  --acento: #2563eb; --acento-tinta: #ffffff; --acento-suave: #e7edfd; --acento-texto: #2556d6;
  --pos: #1ba922; --neg: #d34530; --aviso: #c27803;
  --balao: #e9edf5;
  --sombra-1: 0 1px 2px rgba(14, 22, 40, .05);
  --sombra-2: 0 2px 6px rgba(14, 22, 40, .05), 0 12px 32px rgba(14, 22, 40, .07);
  --sombra-comp: 0 1px 2px rgba(14, 22, 40, .04), 0 6px 24px rgba(14, 22, 40, .06);
  --r-1: 8px; --r-2: 12px; --r-3: 16px; --r-4: 24px;
  --lat-w: 272px; --fio-w: 768px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fonte: "Urbanist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --fundo: #0a1020; --lateral: #0d1528; --sup: #121a2c; --sup-2: #18233a; --sup-3: #1d2a45;
  --linha: #1d2843; --linha-2: #283553;
  --texto: #e7ecf6; --texto-2: #c3cbdb; --suave: #8a97b2; --fraco: #5f6c88;
  --acento: #3b82f6; --acento-tinta: #ffffff; --acento-suave: #172648; --acento-texto: #7ea2ff;
  --pos: #1ba922; --neg: #d34530; --aviso: #f0a030;
  --balao: #1a2642;
  --sombra-1: 0 1px 2px rgba(0, 0, 0, .3);
  --sombra-2: 0 2px 6px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .35);
  --sombra-comp: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 28px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #0a1020; --lateral: #0d1528; --sup: #121a2c; --sup-2: #18233a; --sup-3: #1d2a45;
    --linha: #1d2843; --linha-2: #283553;
    --texto: #e7ecf6; --texto-2: #c3cbdb; --suave: #8a97b2; --fraco: #5f6c88;
    --acento: #3b82f6; --acento-tinta: #ffffff; --acento-suave: #172648; --acento-texto: #7ea2ff;
    --pos: #1ba922; --neg: #d34530; --aviso: #f0a030;
    --balao: #1a2642;
    --sombra-1: 0 1px 2px rgba(0, 0, 0, .3);
    --sombra-2: 0 2px 6px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .35);
    --sombra-comp: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 28px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--fonte); font-size: 15px; line-height: 1.5; color: var(--texto); background: var(--fundo);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none; touch-action: manipulation;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: var(--r-1); }
::selection { background: color-mix(in srgb, var(--acento) 25%, transparent); }
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.peq { width: 16px; height: 16px; }
.logo { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- 3. Layout ---------- */
.app { display: grid; grid-template-columns: auto minmax(0, 1fr); height: var(--vvh, 100dvh); }
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fundo); position: relative; }
.palco { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vista { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; scrollbar-width: thin; scrollbar-color: var(--linha-2) transparent; }
.rodape { flex: none; display: none; }
.principal.com-compositor .rodape { display: block; }
.veu { display: none; }
.so-mobile { display: none !important; }

/* Boas-vindas no desktop: saudação + caixa no meio da tela (estilo Gemini/Claude) */
.principal.modo-inicio .palco { justify-content: center; overflow-y: auto; }
.principal.modo-inicio .vista { flex: 0 0 auto; overflow: visible; }
.principal.modo-inicio .rodape { padding-bottom: 12vh; }

/* ---------- 4. Lateral ---------- */
.lateral {
  width: var(--lat-w); background: var(--lateral); border-right: 1px solid var(--linha);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  transition: width .25s var(--ease);
}
.lat-topo { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 44px; padding: 0 2px 0 6px; margin-bottom: 6px; }
.lat-marca { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; min-width: 0; white-space: nowrap; }
.lat-acao {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: var(--r-2);
  color: var(--texto-2); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; position: relative;
}
.lat-acao:hover { background: var(--sup-3); color: var(--texto); }
.lat-acao.ativo { background: var(--acento-suave); color: var(--acento-texto); }
.lat-nova { color: var(--texto); margin-bottom: 2px; }
.lat-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.contador { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--acento); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.lat-busca { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: var(--r-2); background: var(--sup); border: 1px solid var(--linha); color: var(--fraco); margin: 0 2px 8px; }
.lat-busca input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--texto); }
.lat-busca input::placeholder { color: var(--fraco); }
.lat-busca input::-webkit-search-cancel-button { -webkit-appearance: none; }
.lat-lista { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 8px; scrollbar-width: thin; scrollbar-color: var(--linha-2) transparent; }
.lat-grupo { font-size: 11.5px; font-weight: 500; color: var(--fraco); padding: 14px 10px 6px; }
.lat-item { position: relative; display: flex; align-items: center; border-radius: var(--r-1); }
.lat-item a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 36px 0 10px; font-size: 14px; color: var(--texto-2); border-radius: var(--r-1); }
.lat-item:hover a, .lat-item a:focus-visible { background: var(--sup-3); color: var(--texto); }
.lat-item.ativo a { background: var(--sup-3); color: var(--texto); font-weight: 500; }
.lat-titulo { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lat-tag { display: grid; color: var(--fraco); }
.lat-tag .i { width: 15px; height: 15px; }
.lat-mais { position: absolute; right: 4px; opacity: 0; }
.lat-item:hover .lat-mais, .lat-item.ativo .lat-mais, .lat-mais:focus-visible { opacity: 1; }
.lat-vazio { color: var(--fraco); font-size: 13.5px; padding: 16px 10px; }
.lat-rodape { border-top: 1px solid var(--linha); padding-top: 8px; margin-top: 6px; }
.lat-usuario { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-2); white-space: nowrap; }
.lat-usuario:hover, .lat-usuario.ativo { background: var(--sup-3); }
.lat-usuario .txt { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.lat-usuario strong { font-size: 14px; font-weight: 500; }
.lat-usuario small { font-size: 12px; color: var(--suave); overflow: hidden; text-overflow: ellipsis; }
.lat-engrenagem { flex: none !important; color: var(--suave); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--acento); color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }

/* Recolhida: trilho de ícones */
.recolhida .lateral { --lat-w: 68px; }
.recolhida .lateral .txt, .recolhida .lateral .txt-bloco, .recolhida .lateral .contador { display: none !important; }
.recolhida .lat-topo { flex-direction: column; height: auto; gap: 8px; padding: 0; }
.recolhida .lat-acao, .recolhida .lat-usuario { justify-content: center; padding: 0; }
.recolhida .lat-acao::after { content: ""; }
.recolhida .lat-nav .lat-acao:has(.contador:not([hidden]))::before { content: ""; position: absolute; top: 9px; right: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--acento); }
.recolhida .lat-rodape { margin-top: auto; }

/* ---------- 5. Topo ---------- */
.topo {
  flex: none; display: flex; align-items: center; gap: 8px; height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0 18px; background: var(--fundo); position: relative; z-index: 2;
}
.topo-centro { flex: 1; min-width: 0; }
.topo-titulo { font-size: 15px; font-weight: 500; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-dir { display: flex; align-items: center; gap: 4px; }
.pilula-pc { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--linha); color: var(--suave); font-size: 13px; white-space: nowrap; margin-right: 4px; }
.pilula-pc:hover { background: var(--sup-2); }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--fraco); display: inline-block; flex: none; }
.ponto.on, .pilula-pc.on .ponto { background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 20%, transparent); }
.selo-demo { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--aviso); border: 1px solid color-mix(in srgb, var(--aviso) 40%, transparent); padding: 3px 8px; border-radius: 6px; margin-right: 4px; }

.btn-icone { width: 40px; height: 40px; border-radius: var(--r-2); display: inline-grid; place-items: center; color: var(--suave); flex: none; transition: background .15s, color .15s; }
.btn-icone:hover { background: var(--sup-3); color: var(--texto); }
.btn-icone.peq { width: 30px; height: 30px; border-radius: var(--r-1); }
.btn-icone.peq .i { width: 17px; height: 17px; }

/* ---------- 6. Boas-vindas ---------- */
.boas-vindas { max-width: var(--fio-w); margin: 0 auto; padding: 0 24px 28px; animation: subir .5s var(--ease) both; }
.bv-titulo { font-size: clamp(28px, 4.2vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.bv-sauda { color: var(--suave); font-weight: 500; }
.bv-nome { color: var(--acento-texto); }
.bv-sub { font-size: clamp(18px, 2.4vw, 24px); color: var(--fraco); margin-top: 6px; font-weight: 500; letter-spacing: -.01em; }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 7. Conversa ---------- */
.fio { max-width: var(--fio-w); margin: 0 auto; padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 26px; }
.msg { display: flex; gap: 14px; animation: entrar-msg .3s var(--ease) both; min-width: 0; }
@keyframes entrar-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-usuario { flex-direction: column; align-items: flex-end; gap: 6px; }
.balao { background: var(--balao); color: var(--texto); padding: 10px 16px; border-radius: 20px 20px 6px 20px; max-width: min(85%, 600px); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-usuario.pendente .balao { opacity: .7; }
.msg-usuario.falhou .balao { border: 1px solid color-mix(in srgb, var(--neg) 50%, transparent); }
.reenviar { color: var(--neg) !important; }
.msg-av { flex: none; padding-top: 2px; }
.msg-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.msg-rodape { display: flex; align-items: center; gap: 10px; min-height: 30px; color: var(--fraco); font-size: 12px; opacity: .85; }
.msg-agente:hover .msg-rodape { opacity: 1; }
.origem { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--linha-2); color: var(--suave); font-weight: 500; font-size: 11.5px; white-space: nowrap; }
.origem-comando, .origem-aprendido, .origem-ia_leve { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 30%, transparent); }
.origem-claude_pc { color: var(--acento-texto); border-color: color-mix(in srgb, var(--acento) 35%, transparent); }
.digitando { display: inline-flex; gap: 5px; padding: 10px 0; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--fraco); animation: pulo 1.1s infinite; }
.digitando i:nth-child(2) { animation-delay: .15s; } .digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.carregando-fio { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; }
.esqueleto { display: block; height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--sup-2), var(--sup-3), var(--sup-2)); background-size: 200% 100%; animation: brilho 1.2s infinite; }
.esqueleto:nth-child(2) { width: 80%; } .esqueleto:nth-child(3) { width: 55%; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- 8. Blocos de resposta ---------- */
.b-texto { color: var(--texto); font-size: 15.5px; line-height: 1.62; overflow-wrap: anywhere; }
.b-texto p + p, .b-texto p + ul, .b-texto ul + p, .b-texto p + ol { margin-top: 10px; }
.b-texto ul, .b-texto ol { margin: 6px 0 0; padding-left: 22px; }
.b-texto li + li { margin-top: 4px; }
.b-texto strong { font-weight: 600; }
.b-texto code { font-family: var(--mono); font-size: .9em; background: var(--sup-2); padding: 1px 6px; border-radius: 5px; }
.b-texto a { color: var(--acento-texto); text-decoration: underline; text-underline-offset: 2px; }
.tom-pos { color: var(--pos) !important; } .tom-neg { color: var(--neg) !important; }
.b-titulo { font-weight: 600; font-size: 14.5px; }
.suave { color: var(--suave); }

.b-numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.num { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-2); padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.num-rotulo { font-size: 12.5px; color: var(--suave); }
.num-valor { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.num-nota { font-size: 12px; color: var(--fraco); margin-top: 1px; }

.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { font-size: 11.5px; font-weight: 500; color: var(--fraco); text-transform: uppercase; letter-spacing: .05em; text-align: right; padding: 0 10px 8px; white-space: nowrap; }
td { padding: 10px; border-top: 1px solid var(--linha); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; white-space: normal; }
th:last-child, td:last-child { padding-right: 0; }
.b-tabela { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-3); padding: 14px 16px 6px; }
.b-tabela .b-titulo { margin-bottom: 10px; }
.b-detalhes { border: 1px solid var(--linha); border-radius: var(--r-2); background: var(--sup); }
.b-detalhes summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13.5px; color: var(--suave); user-select: none; }
.b-detalhes summary::-webkit-details-marker { display: none; }
.b-detalhes summary .seta { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.b-detalhes[open] summary .seta { transform: rotate(90deg); }
.b-detalhes summary:hover { color: var(--texto); }
.b-detalhes .tabela-rolagem { padding: 0 16px 6px; }

.b-grafico { margin: 0; background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-3); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.b-grafico figcaption { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.barra-linha { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.barra-rotulo { color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-trilho { height: 10px; background: var(--sup-2); border-radius: 6px; overflow: hidden; }
.barra { display: block; height: 100%; width: var(--w); background: var(--acento); border-radius: 6px; animation: crescer .7s var(--ease) both; transform-origin: left; }
.barra.tom-pos { background: var(--pos); } .barra.tom-neg { background: var(--neg); } .barra.tom-neutro { background: var(--fraco); }
.barra-valor { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
@keyframes crescer { from { transform: scaleX(0); } }

.b-confirmar, .b-tarefa { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-3); padding: 14px 16px; }
.b-confirmar { border-color: color-mix(in srgb, var(--aviso) 35%, var(--linha)); }
.conf-itens { list-style: none; margin: 10px 0 0; padding: 0; }
.conf-itens li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linha); font-size: 14px; }
.conf-itens li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.conf-itens li span:last-child { white-space: nowrap; }
.conf-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.conf-acoes.ocupado { opacity: .6; pointer-events: none; }
.conf-estado { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--suave); }
.conf-estado.ok { color: var(--pos); font-weight: 500; }
.conf-estado.erro { color: var(--neg); }
.tar-topo { display: flex; align-items: center; gap: 12px; }
.tar-ic { width: 34px; height: 34px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--sup-2); color: var(--suave); flex: none; }
.b-tarefa[data-status="feito"] .tar-ic { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.b-tarefa[data-status="erro"] .tar-ic, .b-tarefa[data-status="aguardando_confirmacao"] .tar-ic { background: color-mix(in srgb, var(--aviso) 14%, transparent); color: var(--aviso); }
.tar-txt { flex: 1; min-width: 0; }
.tar-txt .suave { font-size: 13px; }
.tar-pedido { margin-top: 10px; color: var(--texto-2); font-size: 14px; overflow-wrap: anywhere; }
.tar-log { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--suave); background: var(--sup-2); border-radius: var(--r-1); padding: 8px 10px; overflow-wrap: anywhere; }
.giro { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 2.5px solid var(--sup-3); border-top-color: var(--acento); animation: girar .8s linear infinite; }
.cl-ic .giro { width: 20px; height: 20px; border-width: 2px; }
@keyframes girar { to { transform: rotate(360deg); } }

.b-sugestoes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-sug { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--linha-2); background: var(--sup); color: var(--texto-2); font-size: 13.5px; transition: background .15s, border-color .15s; }
.chip-sug .i { width: 15px; height: 15px; color: var(--suave); }
.chip-sug:hover { background: var(--sup-2); border-color: var(--fraco); color: var(--texto); }
.b-aviso { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-2); background: var(--sup-2); color: var(--texto-2); font-size: 14px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-2); font-weight: 500; font-size: 14.5px; white-space: nowrap; transition: background .15s, filter .15s, transform .1s; }
.btn .i { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.peq { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.grande { height: 50px; font-size: 15.5px; width: 100%; }
.btn-primario { background: var(--acento); color: var(--acento-tinta); }
.btn-primario:hover:not(:disabled) { filter: brightness(1.07); }
.btn-sec { background: var(--sup); border: 1px solid var(--linha-2); color: var(--texto); }
.btn-sec:hover:not(:disabled) { background: var(--sup-2); }
.btn-perigo { background: var(--neg); color: #fff; }
.btn-perigo:hover:not(:disabled) { filter: brightness(1.07); }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--acento-texto); font-size: 13.5px; font-weight: 500; }
.link .i { width: 16px; height: 16px; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 9. Compositor ---------- */
.rodape-in { max-width: var(--fio-w); margin: 0 auto; padding: 0 24px calc(14px + env(safe-area-inset-bottom)); }
.compositor {
  position: relative; background: var(--sup); border: 1px solid var(--linha-2); border-radius: var(--r-4);
  box-shadow: var(--sombra-comp); padding: 12px 12px 10px 18px; transition: border-color .15s, box-shadow .15s;
}
.compositor:focus-within { border-color: color-mix(in srgb, var(--acento) 55%, var(--linha-2)); }
.compositor textarea { display: block; width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.5; max-height: 200px; min-height: 26px; padding: 2px 4px 2px 0; color: var(--texto); }
.compositor textarea::placeholder { color: var(--fraco); }
.compositor.ocupado { opacity: .7; pointer-events: none; }
.comp-barra { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; margin-left: -8px; }
.comp-modelo { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 17px; color: var(--texto-2); font-size: 13.5px; font-weight: 500; max-width: 70%; transition: background .15s; }
.comp-modelo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-modelo .i { width: 17px; height: 17px; color: var(--suave); }
.comp-modelo:hover { background: var(--sup-2); }
.comp-dir { display: flex; align-items: center; gap: 4px; }
.comp-enviar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--acento); color: #fff; transition: opacity .15s, transform .1s, background .15s; }
.comp-enviar:disabled { background: var(--sup-3); color: var(--fraco); }
.comp-enviar:active:not(:disabled) { transform: scale(.93); }
.comp-enviar .i { width: 19px; height: 19px; stroke-width: 2; }
.compositor.gravando textarea { display: none; }
.compositor.gravando .comp-mic { background: var(--neg); color: #fff; }
.comp-gravando { display: flex; align-items: center; gap: 10px; height: 30px; color: var(--neg); font-variant-numeric: tabular-nums; font-size: 14px; }
.rec-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--neg); animation: piscar 1s infinite; }
@keyframes piscar { 50% { opacity: .3; } }
.rec-onda { flex: 1; display: flex; align-items: center; gap: 3px; height: 22px; overflow: hidden; }
.rec-onda i { flex: 1; max-width: 3px; min-width: 2px; background: color-mix(in srgb, var(--neg) 70%, transparent); border-radius: 2px; animation: onda 1s ease-in-out infinite; }
.rec-onda i:nth-child(3n) { animation-delay: .2s; } .rec-onda i:nth-child(3n+1) { animation-delay: .4s; } .rec-onda i:nth-child(4n) { animation-delay: .1s; }
@keyframes onda { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.comp-gravando .link { color: var(--suave); }

.atalhos { display: none; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.principal.modo-inicio .atalhos { display: flex; animation: subir .5s .08s var(--ease) both; }
.atalho { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--linha-2); background: var(--sup); color: var(--texto-2); font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s; }
.atalho .i { width: 17px; height: 17px; color: var(--acento-texto); }
.atalho:hover { background: var(--sup-2); border-color: var(--fraco); color: var(--texto); }
.comp-nota { text-align: center; color: var(--fraco); font-size: 12px; margin-top: 10px; }
.principal.modo-inicio .comp-nota { display: none; }

/* ---------- 10. Menus, toasts, carregando ---------- */
.menu-flutuante { position: fixed; inset: 0; z-index: 80; }
.menu-caixa {
  position: absolute; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-2); padding: 6px;
  opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .15s, transform .15s var(--ease);
}
.menu-flutuante.on .menu-caixa { opacity: 1; transform: none; }
.menu-titulo { font-size: 11.5px; font-weight: 500; color: var(--fraco); padding: 10px 10px 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px; border-radius: var(--r-1); text-align: left; font-size: 14px; color: var(--texto); }
.menu-item:hover:not(:disabled) { background: var(--sup-2); }
.menu-item:disabled { opacity: .45; }
.menu-item .i { color: var(--suave); }
.menu-item.perigo, .menu-item.perigo .i { color: var(--neg); }
.menu-item.sel { background: var(--acento-suave); }
.mi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-txt strong { font-weight: 500; }
.mi-txt small { font-size: 12px; color: var(--suave); }
.mi-check { color: var(--acento-texto) !important; }
.menu-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px; margin-top: 4px; border-top: 1px solid var(--linha); font-size: 13.5px; cursor: pointer; }
.menu-toggle.apagado { opacity: .5; }
.menu-toggle input { margin-top: 3px; accent-color: var(--acento); width: 16px; height: 16px; }
.menu-toggle small { display: block; color: var(--suave); font-size: 12px; }

.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--texto); color: var(--fundo); padding: 10px 16px; border-radius: var(--r-2); font-size: 14px; box-shadow: var(--sombra-2); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease); }
.toast.on { opacity: 1; transform: none; }
.toast.erro { background: var(--neg); color: #fff; }
.toast.ok { background: var(--pos); color: #fff; }

.carregando { position: fixed; inset: 0; z-index: 100; background: var(--fundo); display: grid; place-items: center; transition: opacity .3s; }
.carregando svg { animation: respirar 1.4s ease-in-out infinite; }
.carregando.fora { opacity: 0; pointer-events: none; }
@keyframes respirar { 50% { transform: scale(.92); opacity: .75; } }
.erro-fatal { position: fixed; inset: 0; z-index: 101; background: var(--fundo); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.erro-fatal button { background: var(--acento); color: #fff; padding: 12px 20px; border-radius: var(--r-2); }

/* ---------- 11. Painéis (Alertas, Tarefas, Ajustes) ---------- */
.painel { max-width: 760px; margin: 0 auto; padding: 8px 24px 48px; animation: subir .35s var(--ease) both; }
.painel-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.painel-topo h1 { font-size: 26px; }
.painel-topo p { color: var(--suave); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.painel-acoes { display: flex; gap: 8px; flex: none; }
.filtros { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px 16px; padding: 0 24px; }
.filtros::-webkit-scrollbar { display: none; }
.filtro { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--linha-2); color: var(--suave); font-size: 13.5px; }
.filtro.on { background: var(--texto); color: var(--fundo); border-color: var(--texto); }
.lista-cartoes { display: flex; flex-direction: column; gap: 6px; }
.lista-cartoes .esqueleto { height: 64px; border-radius: var(--r-2); }
.grupo-rotulo { font-size: 12px; font-weight: 500; color: var(--fraco); margin: 14px 4px 4px; }
.cartao-linha { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: var(--r-2); background: var(--sup); border: 1px solid var(--linha); text-align: left; transition: background .15s, border-color .15s; }
.cartao-linha:hover { border-color: var(--linha-2); background: var(--sup-2); }
.cl-ic { width: 38px; height: 38px; border-radius: var(--r-2); display: grid; place-items: center; flex: none; background: var(--sup-2); color: var(--suave); }
.ic-cakto { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.ic-claude { color: var(--acento-texto); background: var(--acento-suave); }
.ic-metrica { color: var(--aviso); background: color-mix(in srgb, var(--aviso) 12%, transparent); }
.cl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-txt strong { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-txt small { color: var(--suave); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-meta { color: var(--fraco); font-size: 12.5px; white-space: nowrap; }
.cartao-linha.nao-lido strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acento); margin-left: 8px; vertical-align: middle; }
.selo { flex: none; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--sup-2); color: var(--suave); white-space: nowrap; }
.selo.st-feito { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.selo.st-rodando, .selo.st-fila { color: var(--acento-texto); background: var(--acento-suave); }
.selo.st-erro, .selo.st-aguardando_confirmacao { color: var(--aviso); background: color-mix(in srgb, var(--aviso) 12%, transparent); }
.cl-ic.st-feito { color: var(--pos); }
.vazio { text-align: center; padding: 56px 20px; color: var(--suave); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vazio > .i { width: 32px; height: 32px; color: var(--fraco); margin-bottom: 4px; }
.vazio h2 { font-size: 17px; color: var(--texto); }
.vazio p { max-width: 380px; font-size: 14px; }
.vazio .btn { margin-top: 10px; }

.ajustes .secao { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-3); padding: 18px 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.secao h2 { font-size: 15.5px; display: flex; align-items: center; gap: 10px; }
.secao h2 .i { color: var(--suave); }
.secao > .suave { font-size: 13.5px; margin-top: -4px; }
.segmentado { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--sup-2); border-radius: var(--r-2); }
.segmentado button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: var(--r-1); color: var(--suave); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.segmentado button .i { width: 17px; height: 17px; }
.segmentado button.on { background: var(--sup); color: var(--texto); box-shadow: var(--sombra-1); }
.linha-acao { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.linha-acao > div { min-width: 0; display: flex; flex-direction: column; }
.linha-acao strong { font-weight: 500; }
.linha-acao small { color: var(--suave); font-size: 13px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--linha); cursor: pointer; font-size: 14.5px; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor i { width: 42px; height: 26px; border-radius: 13px; background: var(--sup-3); position: relative; transition: background .2s; flex: none; }
.interruptor i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.interruptor input:checked + i { background: var(--acento); }
.interruptor input:checked + i::after { transform: translateX(16px); }
.interruptor input:focus-visible + i { outline: 2px solid var(--acento); outline-offset: 2px; }
.lista-ias { display: flex; flex-direction: column; }
.ia-linha { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--linha); font-size: 14.5px; }
.ia-linha span:first-child { display: flex; align-items: center; gap: 10px; }
.ia-linha .i { color: var(--suave); }
.add-memoria { display: flex; gap: 8px; }
.lista-memoria { list-style: none; margin: 0; padding: 0; }
.lista-memoria li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--linha); font-size: 14.5px; }
.campo { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--linha-2); background: var(--sup); font-size: 16px; outline: none; color: var(--texto); transition: border-color .15s; }
.campo:focus { border-color: var(--acento); }
.campo.grande { width: 100%; height: 52px; font-size: 17px; }
.campo.codigo { text-align: center; letter-spacing: .45em; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: calc(12px + .45em); }
.versao { text-align: center; font-size: 12.5px; margin-top: 8px; }

/* ---------- 12. Entrar ---------- */
.entrar { position: fixed; inset: 0; z-index: 70; background: var(--fundo); display: grid; place-items: center; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top)); overflow-y: auto; }
.entrar-caixa { width: 100%; max-width: 380px; text-align: center; animation: subir .4s var(--ease) both; }
.entrar-caixa > .logo { margin: 0 auto 22px; }
.entrar-passo { display: flex; flex-direction: column; gap: 12px; }
.entrar-passo h1 { font-size: 24px; }
.entrar-passo p { color: var(--suave); font-size: 14.5px; margin-bottom: 8px; }
.entrar-passo .link { align-self: center; margin-top: 6px; }
.entrar-passo .peq { font-size: 12.5px; margin-top: 4px; }
.entrar-erro { color: var(--neg); font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ---------- 13. Utilidades ---------- */
@media (hover: none) { .lat-mais { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* ---------- 14. Tablet ---------- */
@media (max-width: 1023px) and (min-width: 768px) {
  :root { --lat-w: 248px; }
  .fio, .rodape-in, .boas-vindas { padding-left: 20px; padding-right: 20px; }
}

/* ---------- 14. Celular ---------- */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .so-mobile { display: inline-grid !important; }
  .so-desktop { display: none !important; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(86vw, 320px) !important; height: var(--vvh, 100dvh);
    transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--sombra-2); border-right: 0;
  }
  .recolhida .lateral .txt, .recolhida .lateral .txt-bloco, .recolhida .lateral .contador { display: revert !important; }
  .recolhida .lat-topo { flex-direction: row; height: 44px; padding: 0 2px 0 6px; }
  .recolhida .lat-acao, .recolhida .lat-usuario { justify-content: flex-start; padding: 0 10px; }
  .recolhida .lat-usuario { padding: 8px; }
  .lat-usuario .txt { display: flex !important; }
  .app.gaveta .lateral { transform: none; }
  .veu { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(5, 10, 20, .45); animation: aparecer .25s both; }
  @keyframes aparecer { from { opacity: 0; } }
  .lat-acao, .lat-item a { height: 44px; }

  .topo { padding-left: 6px; padding-right: 6px; height: calc(52px + env(safe-area-inset-top)); }
  .topo-titulo { text-align: center; font-size: 15px; }
  .pilula-pc { width: 32px; padding: 0; justify-content: center; margin: 0; }
  .pc-txt { display: none; }
  .selo-demo { display: none; }

  /* Boas-vindas no celular: saudação no meio, caixa embaixo (como Gemini/Claude mobile) */
  .principal.modo-inicio .palco { justify-content: flex-start; overflow: hidden; }
  .principal.modo-inicio .vista { flex: 1; overflow-y: auto; display: grid; align-content: center; }
  .principal.modo-inicio .rodape { padding-bottom: 0; }
  .boas-vindas { padding: 0 22px 12px; }
  .bv-titulo { font-size: 30px; }
  .bv-sub { font-size: 19px; }
  .atalhos { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px; order: -1; }
  .atalhos::-webkit-scrollbar { display: none; }
  .principal.modo-inicio .rodape-in { display: flex; flex-direction: column; }
  .atalho { height: 36px; font-size: 13.5px; }

  .fio { padding: 6px 16px 20px; gap: 22px; }
  .msg { gap: 10px; }
  .msg-agente .msg-av { display: none; }
  .balao { max-width: 88%; }
  .b-texto { font-size: 15.5px; }
  .b-numeros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .num-valor { font-size: 18px; }
  .barra-linha { grid-template-columns: minmax(60px, 34%) 1fr auto; gap: 8px; }
  .msg-rodape { opacity: 1; }

  .rodape-in { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .compositor { border-radius: 22px; padding: 10px 8px 8px 14px; }
  .comp-nota { display: none; }

  .menu-flutuante { background: rgba(5, 10, 20, .4); }
  .menu-flutuante.folha .menu-caixa {
    left: 0 !important; right: 0; bottom: 0; top: auto !important; max-width: none; width: 100%;
    border-radius: 20px 20px 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
    transform: translateY(100%); max-height: 80vh;
  }
  .menu-flutuante.folha.on .menu-caixa { transform: none; }
  .menu-flutuante.folha .menu-caixa::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--linha-2); margin: 2px auto 8px; }
  .menu-item { min-height: 48px; }

  .painel { padding: 4px 16px 40px; }
  .painel-topo { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .painel-topo h1 { font-size: 24px; }
  .filtros { margin: 0 -16px 14px; padding: 0 16px; }
  .ajustes .secao { padding: 16px; }
  .segmentado button { font-size: 13.5px; gap: 6px; }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
