/* Strukta Iuris · chat de primeiro atendimento
   Identidade: portfolio/strukta/branding (creme, tinta, petroleo como acento unico).
   Clima: skill ui-de-produto (fundo quente, sombra rara e tingida, raio moderado,
   pilula so em chip e avatar). Tudo escopado em .sk-raiz para nao vazar no site. */

@font-face { font-family: "Cormorant Garamond"; src: url("fontes/CormorantGaramond-regular-ptbr.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fontes/HankenGrotesk-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fontes/JetBrainsMono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

.sk-raiz {
  --sk-creme: #F4F1E8;
  --sk-creme-claro: #FAF8F2;
  --sk-creme-fundo: #EDE8DB;
  --sk-tinta: #1E3038;
  --sk-petroleo: #24566A;
  --sk-petroleo-escuro: #1B4556;
  --sk-cota: #5E6A70;
  --sk-fio: rgba(30, 48, 56, .14);
  --sk-fio-forte: rgba(30, 48, 56, .28);
  --sk-alerta: #A3261E;
  --sk-sombra: 0 0 0 1px rgba(30, 48, 56, .06), 0 2px 4px rgba(30, 48, 56, .06), 0 18px 40px rgba(30, 48, 56, .16);
  --sk-f-inst: "Cormorant Garamond", Georgia, serif;
  --sk-f-trab: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sk-f-reg: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sk-ease: cubic-bezier(.2, .7, .2, 1);

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: var(--sk-f-trab);
  font-size: 14px;
  line-height: 1.5;
  color: var(--sk-tinta);
  -webkit-font-smoothing: antialiased;
}
.sk-raiz *, .sk-raiz *::before, .sk-raiz *::after { box-sizing: border-box; }
.sk-raiz :where(button, input, select, textarea) { font: inherit; color: inherit; }
.sk-raiz p { margin: 0; }
/* reset defensivo: o CSS generico do site (button, input, div, a) nao pode deformar o widget */
/* especificidade de UMA classe (:where zera o resto): vence o "button {}" do site e perde
   para as classes do proprio widget, que vem depois neste arquivo */
.sk-raiz :where(div, p, span, form, label) { float: none; }
.sk-raiz :where(button, input, select, textarea) { margin: 0; text-transform: none; letter-spacing: normal; min-height: 0; min-width: 0; box-shadow: none; line-height: normal; }

/* ------------------------------------------------ lancador */
.sk-lancador {
  display: flex; align-items: center; gap: 12px;
  margin-left: auto;
  padding: 8px 18px 8px 8px;
  background: var(--sk-tinta);
  color: var(--sk-creme);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--sk-sombra);
  cursor: pointer;
  transition: transform .18s var(--sk-ease), background-color .18s var(--sk-ease);
}
.sk-lancador:hover { background: #253b45; transform: translateY(-1px); }
.sk-lancador:focus-visible { outline: 2px solid var(--sk-petroleo); outline-offset: 3px; }
.sk-lancador__texto { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.sk-lancador__titulo { font-weight: 600; font-size: 15px; letter-spacing: .005em; }
.sk-lancador__sub { font-size: 13px; color: rgba(244, 241, 232, .72); }
.sk-aberto .sk-lancador { display: none; }

/* ------------------------------------------------ avatar (slot) */
.sk-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--sk-creme-fundo); }
.sk-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sk-avatar--m { width: 44px; height: 44px; }
.sk-avatar--p { width: 40px; height: 40px; }
.sk-avatar--marca { background: var(--sk-petroleo); box-shadow: inset 0 0 0 1px rgba(244, 241, 232, .18); }
.sk-avatar--marca img { width: 46%; height: 62%; object-fit: contain; }

/* ------------------------------------------------ painel */
.sk-painel {
  width: 392px;
  height: min(660px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  background: var(--sk-creme);
  border-radius: 14px;
  box-shadow: var(--sk-sombra);
  overflow: hidden;
  animation: sk-entra .22s var(--sk-ease);
}
.sk-painel[hidden] { display: none; }
.sk-painel > * { min-width: 0; } /* sem isto o texto sem quebra do topo alarga o painel */
@keyframes sk-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sk-topo {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px 14px 16px;
  background: var(--sk-tinta);
  color: var(--sk-creme);
}
.sk-topo__id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sk-topo__nome { font-family: var(--sk-f-inst); font-size: 22px; line-height: 1.1; letter-spacing: .01em; }
.sk-topo__papel { font-family: var(--sk-f-reg); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(244, 241, 232, .7); margin-top: 4px; line-height: 1.35; } /* quebra, nunca trunca: o rotulo de IA tem de aparecer inteiro */
.sk-fechar, .sk-reiniciar { background: transparent; border: 0; color: rgba(244, 241, 232, .8); cursor: pointer; border-radius: 8px; }
.sk-fechar { width: 34px; height: 34px; font-size: 24px; line-height: 1; }
.sk-reiniciar { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.sk-fechar:hover, .sk-reiniciar:hover { background: rgba(244, 241, 232, .1); color: var(--sk-creme); }
.sk-fechar:focus-visible, .sk-reiniciar:focus-visible { outline: 2px solid var(--sk-petroleo-claro, #9FC0CE); outline-offset: 1px; }

/* ------------------------------------------------ fio de mensagens */
.sk-fio { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.sk-msg { max-width: 86%; padding: 10px 13px; border-radius: 12px; animation: sk-msg .2s var(--sk-ease); white-space: pre-wrap; overflow-wrap: anywhere; }
@keyframes sk-msg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sk-raiz a.sk-artigo { align-self: flex-start; display: inline-flex; flex-wrap: wrap; gap: 0 6px; max-width: 100%; margin: -2px 0 0; padding: 2px 0; font-size: 12.5px; line-height: 1.45; text-decoration: none; background: none; border: 0; }
.sk-raiz a.sk-artigo:hover .sk-artigo__tit, .sk-raiz a.sk-artigo:focus-visible .sk-artigo__tit { text-decoration: underline; }
.sk-artigo__rot { color: var(--sk-cota); }
.sk-artigo__tit { color: var(--sk-petroleo); }
.sk-artigo__tit::after { content: " \2192"; }
.sk-aviso-ia { align-self: flex-start; max-width: 88%; margin: -4px 0 2px; font-size: 12px; line-height: 1.45; color: var(--sk-cota); }
.sk-msg--bot { align-self: flex-start; background: var(--sk-creme-claro); border: 1px solid var(--sk-fio); border-top-left-radius: 4px; }
.sk-msg--eu { align-self: flex-end; background: var(--sk-petroleo); color: var(--sk-creme); border-top-right-radius: 4px; }

.sk-digitando { display: inline-flex; gap: 5px; padding: 13px 14px; }
.sk-digitando span { width: 6px; height: 6px; border-radius: 50%; background: var(--sk-cota); opacity: .35; animation: sk-ponto 1s infinite; }
.sk-digitando span:nth-child(2) { animation-delay: .15s; }
.sk-digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes sk-ponto { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }

/* ------------------------------------------------ sugestoes */
.sk-sugestoes { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 10px; }
.sk-sugestoes:empty { display: none; }
.sk-chip {
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--sk-fio-forte);
  border-radius: 999px;
  color: var(--sk-tinta);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color .15s var(--sk-ease), border-color .15s var(--sk-ease), color .15s var(--sk-ease);
}
.sk-chip:hover { border-color: var(--sk-petroleo); background: var(--sk-petroleo); color: var(--sk-creme); }
.sk-chip:focus-visible { outline: 2px solid var(--sk-petroleo); outline-offset: 2px; }
.sk-chip--discreto { border-style: dashed; color: var(--sk-cota); }

/* ------------------------------------------------ entrada */
.sk-entrada { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 12px; background: var(--sk-creme-claro); border: 1px solid var(--sk-fio-forte); border-radius: 12px; }
.sk-entrada[hidden] { display: none; }
.sk-entrada:focus-within { border-color: var(--sk-petroleo); box-shadow: 0 0 0 3px rgba(36, 86, 106, .14); }
.sk-campo { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 7px 0; max-height: 120px; line-height: 1.45; font-size: 14.5px; }
.sk-campo::placeholder { color: var(--sk-cota); }
.sk-enviar { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--sk-petroleo); color: var(--sk-creme); border: 0; border-radius: 9px; cursor: pointer; }
.sk-enviar:hover { background: var(--sk-petroleo-escuro); }
.sk-enviar:focus-visible { outline: 2px solid var(--sk-tinta); outline-offset: 2px; }

.sk-rodape { padding: 8px 16px 12px; font-family: var(--sk-f-reg); font-size: 10px; letter-spacing: .05em; color: var(--sk-cota); text-align: center; }

/* ------------------------------------------------ cartoes (formulario, final) */
.sk-cartao { align-self: stretch; background: var(--sk-creme-claro); border: 1px solid var(--sk-fio); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; animation: sk-msg .22s var(--sk-ease); }
.sk-cartao__titulo { font-family: var(--sk-f-reg); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sk-cota); }
.sk-linha { display: flex; flex-direction: column; gap: 6px; }
.sk-linha label { font-size: 13px; font-weight: 500; }
.sk-input { width: 100%; height: 40px; padding: 0 12px; background: #fff; border: 1px solid var(--sk-fio-forte); border-radius: 8px; outline: none; font-size: 14.5px; }
.sk-input:focus { border-color: var(--sk-petroleo); box-shadow: 0 0 0 3px rgba(36, 86, 106, .14); }
.sk-input[aria-invalid="true"] { border-color: var(--sk-alerta); }
.sk-tel { display: flex; gap: 8px; }
.sk-ddi { flex: 0 0 auto; width: 118px; padding: 0 8px; }
.sk-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--sk-tinta); cursor: pointer; }
.sk-check { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--sk-petroleo); }
.sk-aviso { font-size: 12px; line-height: 1.45; color: var(--sk-cota); }
.sk-raiz a { color: var(--sk-petroleo); text-decoration: underline; text-underline-offset: 2px; }
.sk-isca { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sk-erro { color: var(--sk-alerta); font-size: 12.5px; }
.sk-erro:empty { display: none; }

.sk-botao { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; background: var(--sk-petroleo); color: var(--sk-creme) !important; border: 0; border-radius: 10px; font-weight: 600; font-size: 14.5px; text-decoration: none !important; cursor: pointer; transition: background-color .15s var(--sk-ease); }
.sk-botao:hover { background: var(--sk-petroleo-escuro); }
.sk-botao:disabled { opacity: .6; cursor: progress; }
.sk-botao:focus-visible { outline: 2px solid var(--sk-tinta); outline-offset: 2px; }
.sk-botao--wa { background: var(--sk-tinta); }
.sk-botao--wa:hover { background: #253b45; }
.sk-wa-icone { width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 0 0-7.8 13.5L3 21l4.6-1.2A9 9 0 1 0 12 3Zm0 1.6a7.4 7.4 0 1 1-3.8 13.8l-.3-.2-2.7.7.7-2.6-.2-.3A7.4 7.4 0 0 1 12 4.6Zm-3 3.6c-.2 0-.5.1-.7.3-.3.3-.9.9-.9 2.1s.9 2.5 1 2.6c.1.2 1.8 2.8 4.4 3.8 2.2.9 2.6.7 3.1.6.5 0 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2l-.4-.3-1.7-.8c-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1-.3-.1-1.1-.4-2-1.3-.8-.7-1.3-1.5-1.4-1.8-.2-.3 0-.4.1-.5l.4-.5.3-.4v-.4l-.8-1.9c-.2-.5-.4-.4-.6-.4H9Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 0 0-7.8 13.5L3 21l4.6-1.2A9 9 0 1 0 12 3Zm0 1.6a7.4 7.4 0 1 1-3.8 13.8l-.3-.2-2.7.7.7-2.6-.2-.3A7.4 7.4 0 0 1 12 4.6Zm-3 3.6c-.2 0-.5.1-.7.3-.3.3-.9.9-.9 2.1s.9 2.5 1 2.6c.1.2 1.8 2.8 4.4 3.8 2.2.9 2.6.7 3.1.6.5 0 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2l-.4-.3-1.7-.8c-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1-.3-.1-1.1-.4-2-1.3-.8-.7-1.3-1.5-1.4-1.8-.2-.3 0-.4.1-.5l.4-.5.3-.4v-.4l-.8-1.9c-.2-.5-.4-.4-.6-.4H9Z'/%3E%3C/svg%3E") center/contain no-repeat; }

.sk-protocolo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--sk-fio); }
.sk-protocolo span { font-family: var(--sk-f-reg); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sk-cota); }
.sk-protocolo strong { font-family: var(--sk-f-reg); font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--sk-petroleo); }
.sk-resumo { font-family: var(--sk-f-inst); font-size: 18px; line-height: 1.35; }
.sk-nota { font-size: 12px; line-height: 1.45; color: var(--sk-cota); }

/* ------------------------------------------------ celular */
@media (max-width: 520px) {
  .sk-raiz { right: 16px; bottom: 16px; }
  .sk-lancador { padding: 6px; border-radius: 50%; }
  .sk-lancador__texto { display: none; }
  .sk-avatar--m { width: 48px; height: 48px; }
  .sk-raiz.sk-aberto { inset: 0; right: 0; bottom: 0; }
  .sk-painel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .sk-topo { padding-top: max(14px, env(safe-area-inset-top)); }
  .sk-rodape { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .sk-campo, .sk-input { font-size: 16px; } /* evita zoom no iOS */
}

@media (prefers-reduced-motion: reduce) {
  .sk-raiz *, .sk-raiz *::before, .sk-raiz *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------ Helena puxa conversa (balao ao lado do lancador) */
.sk-oi {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  width: 368px; max-width: calc(100vw - 32px);
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 40px 16px 16px;
  background: var(--sk-creme-claro); color: var(--sk-tinta);
  border-radius: 14px; box-shadow: var(--sk-sombra);
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--sk-ease), transform .3s var(--sk-ease);
}
.sk-oi--in { opacity: 1; transform: none; }
.sk-oi__ola { font-weight: 600; font-size: 15px; }
.sk-oi__msg { font-size: 15px; line-height: 1.45; margin-top: 2px !important; color: rgba(30, 48, 56, .82); }
.sk-oi__acoes { display: flex; gap: 8px; margin-top: 12px; }
.sk-raiz .sk-oi__sim { background: var(--sk-tinta); color: var(--sk-creme); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.sk-raiz .sk-oi__nao { background: transparent; border: 1px solid var(--sk-fio-forte); border-radius: 8px; padding: 8px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.sk-raiz .sk-oi__fechar { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--sk-cota); cursor: pointer; border-radius: 6px; }
.sk-aberto .sk-oi { display: none; }
@media (prefers-reduced-motion: reduce) { .sk-oi { transition: none; } }
