/* Companheira de Feira — Travel & Co (navy #324158 / amarelo #FFE600) */
:root {
  --navy: #324158;
  --navy-escuro: #27334a;
  --amarelo: #FFE600;
  --fundo: #f4f5f7;
  --tinta: #2b2b2b;
  --cinza: #7a8494;
  --branco: #fff;
  --raio: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fundo); color: var(--tinta); font-size: 16px;
}
.oculto { display: none !important; }

/* ---------- LOGIN ---------- */
.login {
  position: fixed; inset: 0; background: var(--navy);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100;
}
.login-caixa { width: 100%; max-width: 340px; text-align: center; }
.login-marca { font-family: Georgia, serif; font-size: 34px; color: #fff; }
.login-marca span { color: var(--amarelo); }
.login-sub { color: #b9c2d0; margin: 8px 0 28px; font-size: 14px; }
.login input {
  width: 100%; padding: 14px 16px; border: none; border-radius: var(--raio);
  font-size: 17px; margin-bottom: 12px; text-align: center;
}
.login button {
  width: 100%; padding: 14px; border: none; border-radius: var(--raio);
  background: var(--amarelo); color: var(--navy); font-size: 17px; font-weight: 700; cursor: pointer;
}
.login-erro { color: #ffb3b3; margin-top: 12px; font-size: 14px; min-height: 18px; }

/* ---------- ESTRUTURA ---------- */
.app { display: flex; flex-direction: column; height: 100dvh; }
.topo {
  background: var(--navy); color: #fff; padding: 10px 16px calc(10px);
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; justify-content: space-between; align-items: baseline; flex-shrink: 0;
}
.topo-marca { font-family: Georgia, serif; font-size: 18px; }
.topo-marca span { color: var(--amarelo); }
.topo-marca em { font-style: normal; font-size: 12px; color: #b9c2d0; margin-left: 6px; }
.topo-evento { font-size: 11px; color: #b9c2d0; }

#conteudo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.aba { display: none; padding: 14px; padding-bottom: 24px; }
.aba.ativa { display: block; }

.painel-cabeca { margin-bottom: 14px; }
.painel-cabeca h2 { font-family: Georgia, serif; color: var(--navy); font-size: 22px; }
.painel-cabeca p { color: var(--cinza); font-size: 13px; margin-top: 4px; }

/* ---------- CONVERSA ---------- */
.mensagens { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: var(--raio); line-height: 1.5; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.usuario { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistente { align-self: flex-start; background: var(--branco); border: 1px solid #e2e6ec; border-bottom-left-radius: 4px; }
.msg .selo { display: inline-block; font-size: 10px; opacity: .65; margin-bottom: 4px; letter-spacing: .06em; text-transform: uppercase; }
.msg img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.msg.assistente strong { color: var(--navy); }
.captura-aviso {
  align-self: center; background: #fff9c2; border: 1px solid #efe27a; color: #6b5d00;
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
}
.digitando { display: flex; gap: 5px; padding: 12px 16px; }
.digitando span { width: 8px; height: 8px; background: var(--cinza); border-radius: 50%; animation: pulo 1.2s infinite; }
.digitando span:nth-child(2) { animation-delay: .15s; }
.digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- ENTRADA ---------- */
.entrada {
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom) * 0);
  background: var(--branco); border-top: 1px solid #e2e6ec; flex-shrink: 0;
}
.entrada textarea {
  flex: 1; border: 1px solid #d5dae2; border-radius: var(--raio); padding: 10px 14px;
  font-size: 16px; font-family: inherit; resize: none; max-height: 110px; outline: none;
}
.entrada textarea:focus { border-color: var(--navy); }
.botao-icone {
  width: 42px; height: 42px; border: none; border-radius: 50%; background: var(--fundo);
  font-size: 19px; cursor: pointer; flex-shrink: 0;
}
.botao-icone:disabled { opacity: .35; }
.botao-enviar {
  width: 42px; height: 42px; border: none; border-radius: 50%; background: var(--navy);
  color: var(--amarelo); font-size: 17px; cursor: pointer; flex-shrink: 0;
}
.gravando {
  position: fixed; inset: 0; background: rgba(50, 65, 88, .95); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #fff; font-size: 16px;
}
.gravando-pulso { width: 84px; height: 84px; border-radius: 50%; background: #e53e3e; animation: pulso 1.1s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(229, 62, 62, .5); } 100% { box-shadow: 0 0 0 26px rgba(229, 62, 62, 0); } }

/* ---------- DOSSIÊ ---------- */
.dossie .secao { background: var(--branco); border: 1px solid #e2e6ec; border-radius: var(--raio); margin-bottom: 10px; overflow: hidden; }
.dossie summary {
  padding: 14px 16px; font-family: Georgia, serif; font-size: 16px; color: var(--navy);
  cursor: pointer; list-style: none; position: relative; padding-right: 34px;
}
.dossie summary::after { content: '+'; position: absolute; right: 16px; top: 12px; font-size: 20px; color: var(--cinza); }
.dossie details[open] summary { border-bottom: 2px solid var(--amarelo); }
.dossie details[open] summary::after { content: '–'; }
.secao-corpo { padding: 12px 16px 16px; font-size: 14.5px; line-height: 1.6; }
.secao-corpo h3 { color: var(--navy); margin: 14px 0 6px; font-size: 15px; }
.secao-corpo p { margin: 8px 0; }
.secao-corpo ul, .secao-corpo ol { padding-left: 18px; margin: 8px 0; }
.secao-corpo li { margin: 4px 0; }
.secao-corpo table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; display: block; overflow-x: auto; }
.secao-corpo th { background: var(--navy); color: #fff; padding: 6px 8px; text-align: left; white-space: nowrap; }
.secao-corpo td { padding: 6px 8px; border-bottom: 1px solid #e2e6ec; vertical-align: top; }
.secao-corpo a { color: var(--navy); }
.secao-corpo blockquote { border-left: 3px solid var(--amarelo); padding: 4px 12px; background: #fdfbef; margin: 8px 0; font-style: italic; }

/* ---------- DIÁRIO ---------- */
.diario { display: flex; flex-direction: column; gap: 10px; }
.cartao {
  background: var(--branco); border: 1px solid #e2e6ec; border-radius: var(--raio);
  padding: 14px 16px; border-left: 4px solid var(--navy);
}
.cartao.tipo-fornecedor { border-left-color: var(--navy); }
.cartao.tipo-contato { border-left-color: #4a7fa5; }
.cartao.tipo-ideia { border-left-color: #c9a227; }
.cartao.tipo-alerta { border-left-color: #c0392b; }
.cartao h3 { font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.cartao .meta { font-size: 11px; color: var(--cinza); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.cartao dl { font-size: 13.5px; line-height: 1.5; }
.cartao dt { font-weight: 700; color: var(--navy); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-top: 7px; }
.cartao dd { margin: 1px 0 0; }
.diario-vazio { text-align: center; color: var(--cinza); padding: 40px 20px; font-size: 14px; line-height: 1.6; }

/* ---------- RESUMO ---------- */
.botao-amplo {
  width: 100%; padding: 15px; border: none; border-radius: var(--raio);
  background: var(--navy); color: var(--amarelo); font-size: 16px; font-weight: 700; cursor: pointer; margin-bottom: 14px;
}
.botao-amplo:disabled { opacity: .5; }
.resumo { background: var(--branco); border: 1px solid #e2e6ec; border-radius: var(--raio); padding: 16px; font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }
.resumo:empty { display: none; }
.resumo .quando { font-size: 11px; color: var(--cinza); margin-bottom: 10px; display: block; }

/* ---------- NAVEGAÇÃO ---------- */
.navegacao {
  display: flex; background: var(--branco); border-top: 1px solid #e2e6ec; flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; border: none; background: none; padding: 8px 4px 10px; font-size: 11px; color: var(--cinza);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.nav-item span { font-size: 20px; }
.nav-item.ativo { color: var(--navy); font-weight: 700; }
.nav-item.ativo::before { content: ''; width: 26px; height: 3px; background: var(--amarelo); border-radius: 2px; margin-bottom: 2px; }
.nav-item::before { content: ''; width: 26px; height: 3px; background: transparent; border-radius: 2px; margin-bottom: 2px; }

@media (min-width: 760px) {
  #conteudo, .entrada, .navegacao, .topo { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
  body { background: #e8eaee; }
  .app { background: var(--fundo); box-shadow: 0 0 30px rgba(0,0,0,.08); }
}
