/* Tocalo · "Pergunte ao Tocalo": painel de conversa, botão flutuante e barra de pergunta do Início. */

/* Entrada na lateral (computador) */
.lateral .item-leme { margin: 2px 0 12px; border: 1px solid var(--marinho-2); background: rgba(255,255,255,.04); color: #fff; width: 100%; text-align: left; font-weight: 600; }
.lateral .item-leme .ic { color: var(--latao); }
.lateral .item-leme kbd { margin-left: auto; font: 500 .7rem var(--fonte); color: var(--marinho-fraca); border: 1px solid var(--marinho-2); border-radius: 5px; padding: 1px 5px; }

/* Botão flutuante (celular) */
.leme-flutuante { position: fixed; z-index: 25; right: 16px; bottom: calc(var(--barra-abas) + env(safe-area-inset-bottom) + 14px); width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--marinho); color: var(--latao); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(15,26,46,.35); -webkit-tap-highlight-color: transparent; }
.leme-flutuante:active { transform: scale(.96); }
@media (min-width: 900px) { .leme-flutuante { display: none; } }
body.com-leme .leme-flutuante { display: none; }
/* Em /nova e /editar o botão cobriria o Salvar (classe posta em app.js, trocar()). */
body.em-edicao .leme-flutuante { display: none; }

/* Barra de pergunta no Início */
.barra-pergunta { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; background: var(--superficie); border: 1px solid var(--linha); border-radius: 999px; box-shadow: var(--sombra-leve); }
.barra-pergunta > .ic { color: var(--latao); }
.barra-pergunta input { flex: 1; min-width: 0; border: 0 !important; background: none !important; padding: 0 !important; min-height: 40px !important; }
.barra-pergunta input:focus-visible { outline: none; }
.barra-pergunta:focus-within { border-color: var(--destaque); box-shadow: 0 0 0 3px var(--destaque-fundo); }
.barra-pergunta-ir { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--destaque); color: var(--sobre-destaque); display: grid; place-items: center; }
/* No toque, campo e botão de enviar sobem para 44 px. */
@media (pointer: coarse) { .barra-pergunta input { min-height: 44px !important; } .barra-pergunta-ir { width: 44px; height: 44px; } }

/* Painel */
.leme-painel { position: fixed; z-index: 60; inset: 0; display: flex; flex-direction: column; background: var(--fundo);
  padding-top: env(safe-area-inset-top); transform: translateY(16px); opacity: 0; transition: transform .2s ease-out, opacity .2s ease-out; }
.leme-painel.aberto { transform: none; opacity: 1; }
@media (min-width: 900px) {
  .leme-painel { inset: 0 0 0 auto; width: 420px; border-left: 1px solid var(--linha); box-shadow: var(--sombra); padding-top: 0; transform: translateX(24px); }
  body.com-leme main.principal { margin-right: 420px; max-width: 1200px; }
}
@media (min-width: 900px) and (max-width: 1279.98px) { body.com-leme main.principal { margin-right: 0; } }
@media (prefers-reduced-motion: reduce) { .leme-painel { transition: none; } }

.leme-topo { display: flex; align-items: center; gap: 4px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--linha); background: var(--superficie); }
.leme-titulo { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.leme-sinal { width: 30px; height: 30px; border-radius: 9px; background: var(--marinho); color: var(--latao); display: grid; place-items: center; flex: none; }
.leme-selo { font-size: .7rem; font-weight: 650; color: var(--alerta); background: var(--alerta-fundo); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }

.leme-corpo { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.leme-vazio { display: grid; gap: 12px; margin-top: auto; }
.leme-ola { font-family: var(--fonte-titulo); font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; }
.leme-vazio .suave { font-size: .9rem; }
.leme-sugestoes { display: grid; gap: 8px; }
.leme-sugestao { text-align: left; padding: 11px 14px; border: 1px solid var(--linha); border-radius: 12px; background: var(--superficie); font-size: .94rem; box-shadow: var(--sombra-leve); }
.leme-sugestao:hover { border-color: var(--destaque); color: var(--destaque-forte); }

.leme-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.leme-msg.usuario { align-self: flex-end; background: var(--destaque); color: var(--sobre-destaque); border-bottom-right-radius: 5px; }
.leme-msg.assistente { align-self: flex-start; background: var(--superficie); border: 1px solid var(--linha); border-bottom-left-radius: 5px; display: grid; gap: 8px; box-shadow: var(--sombra-leve); }
.leme-msg.assistente ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.leme-msg.erro { align-self: flex-start; display: flex; gap: 8px; align-items: flex-start; background: var(--erro-fundo); color: var(--erro); }
.leme-msg.erro .ic { margin-top: 2px; }
.leme-itens { list-style: none; padding: 0 !important; }
.leme-itens li { padding-left: 14px; position: relative; }
.leme-itens li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--tinta-fraca); }
.leme-itens li.erro::before { background: var(--erro); } .leme-itens li.alerta::before { background: var(--alerta); } .leme-itens li.ok::before { background: var(--ok); }
.leme-fontes { font-size: .76rem; color: var(--tinta-fraca); }
.leme-abrir { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: .9rem; }

.leme-pendente { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--destaque); background: var(--destaque-fundo); }
.leme-pendente strong { color: var(--destaque-forte); }
.leme-pendente ul { color: var(--tinta); font-size: .9rem; }
.leme-pendente-aviso { color: var(--tinta); font-size: .85rem; font-weight: 600; }
.leme-pendente-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.leme-pendente.feito { border-color: var(--ok); background: var(--ok-fundo); }
.leme-pendente.feito strong { color: var(--ok); }
.leme-pendente.cancelado { border-color: var(--linha-forte); background: var(--superficie-2); }
.leme-pendente.cancelado strong { color: var(--tinta-suave); }
.leme-pendente-fim { font-size: .82rem; font-weight: 600; color: var(--tinta-suave); }

.leme-msg.pensando { display: flex; gap: 5px; padding: 14px 16px; }
.leme-msg.pensando span:not(.so-leitor) { width: 7px; height: 7px; border-radius: 50%; background: var(--tinta-fraca); animation: pulsar 1s infinite ease-in-out; }
.leme-msg.pensando span:nth-child(3) { animation-delay: .15s; } .leme-msg.pensando span:nth-child(4) { animation-delay: .3s; }
@keyframes pulsar { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.leme-escrever { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linha); background: var(--superficie); }
.leme-escrever textarea { flex: 1; min-height: 44px !important; max-height: 140px; resize: none; border-radius: 22px !important; padding: 11px 16px !important; line-height: 1.35; }
.leme-enviar { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--destaque); color: var(--sobre-destaque); display: grid; place-items: center; }
/* Visual comercial: entrada do assistente na lateral numa linha só, com borda dourada. */
.lateral .item-leme { white-space: nowrap; padding: 10px 12px; border-color: rgba(232,149,79,.35); background: linear-gradient(180deg, rgba(232,149,79,.12), rgba(232,149,79,.05)); }
.lateral .item-leme:hover { background: rgba(232,149,79,.18); }
.lateral .item-leme span { overflow: hidden; text-overflow: ellipsis; }
.lateral .item-leme { gap: 8px; font-size: .9rem; padding: 10px; }
.lateral .item-leme kbd { padding: 1px 4px; font-size: .66rem; }

/* Logo do assistente (23/11/2026): o leme dourado num selo azul-marinho, em todo lugar onde o Tocalo aparece. */
.glifo-leme { display: block; flex: none; }
.glifo-leme .glifo-furo { fill: var(--furo, #123631); }
.selo-leme { --furo: #123631; width: var(--selo); height: var(--selo); flex: none; display: grid; place-items: center; color: #f4a868;
  border-radius: calc(var(--selo) * .3); background: radial-gradient(120% 120% at 30% 15%, #1f5a52 0%, #123631 55%, #0a1f1c 100%);
  box-shadow: inset 0 0 0 1px rgba(244,168,104,.28), inset 0 1px 0 rgba(255,255,255,.12), 0 2px 6px rgba(10,31,28,.25); }
.selo-leme .glifo-leme { filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.selo-leme.pensando .glifo-giro { transform-origin: 24px 24px; animation: girar-leme 2.4s cubic-bezier(.45,.05,.55,.95) infinite; }
@keyframes girar-leme { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .selo-leme.pensando .glifo-giro { animation: none; } }

/* Lateral */
.lateral .item-leme { padding: 7px 10px 7px 7px; gap: 10px; }
.lateral .item-leme .selo-leme { --selo: 26px; }

/* Botão flutuante: o leme no círculo marinho com aro dourado. */
.leme-flutuante { --furo: #123631; color: #f4a868; background: radial-gradient(120% 120% at 30% 15%, #1f5a52 0%, #123631 55%, #0a1f1c 100%);
  box-shadow: inset 0 0 0 1.5px rgba(244,168,104,.45), 0 8px 24px rgba(10,31,28,.4); }

/* Barra de pergunta */
.barra-pergunta { padding-left: 6px; }

/* Cabeçalho do painel */
.leme-topo .leme-titulo h2 { font-size: 1.05rem; }

/* Conversa: o selo à esquerda de cada resposta. */
.leme-linha { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 94%; }
.leme-linha .leme-msg.assistente { max-width: none; min-width: 0; }
.leme-linha > .selo-leme { margin-bottom: 2px; }
.leme-vazio > .selo-leme { margin-bottom: 4px; box-shadow: inset 0 0 0 1px rgba(244,168,104,.3), 0 10px 24px -8px rgba(10,31,28,.45); }
