@font-face { font-family: "Hanken Grotesk"; src: url("/assets/hanken-latin.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/lib/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
:root {
  --osso: #F8F5EF; --surface: #FEFDFB; --surface-2: #F1EDE5; --surface-3: #EAE5DC;
  --carvao: #1D1914; --carvao-3: #352F28; --ink: #3B352D; --ink-2: #6E675E; --ink-3: #948C82;
  --line: #E3DED4; --line-2: #D2CBBF; --terracota: #DE6A41; --terracota-ink: #A3421F; --terracota-wash: #FBF1EB;
  --ok: #4F8A62; --bad: #B04A33; --bad-soft: #F3DDD6;
  --font: "Hanken Grotesk", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --lateral: 280px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--osso); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
.oculto { position: absolute; left: -9999px; }
.mudo { color: var(--ink-2); }

/* --- casca: lista à esquerda, conversa à direita ---------------------------------------------- */
.app { display: flex; min-height: 100dvh; }
.lateral { flex: 0 0 var(--lateral); width: var(--lateral); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.app.sem-login .lateral, .app.sem-login .topo-acoes, .app.sem-login .so-celular { display: none; }
.lateral-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.marca { display: inline-flex; align-items: center; gap: 8px; color: var(--carvao); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.lateral-acoes { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 12px; }
.lateral-acoes input { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--osso); font: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.lista { flex: 1; overflow: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.lista .grupo { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.lista .item { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.lista .item:hover { background: var(--surface-2); }
.lista .item.atual { background: var(--terracota-wash); color: var(--carvao); }
.lista .item .nome { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .item.atual .nome { font-weight: 600; }
.lista .item .quando { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.lista .vazia { padding: 10px 12px; color: var(--ink-3); font-size: 13px; }
.lateral-rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.quem-area { display: flex; flex-direction: column; min-width: 0; }
.quem { font-weight: 600; font-size: 13.5px; color: var(--carvao); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lojas { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link { border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 4px; text-decoration: none; }
.link:hover { color: var(--carvao); }
.veu { position: fixed; inset: 0; background: rgba(29, 25, 20, .35); z-index: 4; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.topo { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.titulo-area { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.titulo { font-weight: 700; font-size: 16px; color: var(--carvao); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chip.falta::before { background: var(--bad); }
.icone { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--carvao); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.so-celular { display: none; }
.botao { height: 42px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--terracota); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.botao:disabled { opacity: .5; cursor: default; }
.botao-leve { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }

/* --- login ------------------------------------------------------------------------------------ */
.cartao-login { max-width: 400px; width: calc(100% - 32px); margin: 64px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.cartao-login h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.cartao-login .mudo { margin: 0 0 16px; }
.cartao-login label { display: block; font-size: 12px; color: var(--ink-2); margin: 10px 0 4px; }
.cartao-login input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; }
.cartao-login .botao { width: 100%; margin-top: 16px; }
.erro { color: var(--bad); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }

/* --- conversa --------------------------------------------------------------------------------- */
.chat { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 920px; margin: 0 auto; padding: 20px 24px 0; }
.mensagens { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.bolha { max-width: 92%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bolha.agente { align-self: flex-start; max-width: 100%; width: 100%; padding: 4px 2px; white-space: normal; }
.bolha.pessoa { align-self: flex-end; max-width: 78%; background: var(--carvao); color: #F2EFE9; border-bottom-right-radius: 4px; }
.bolha.sistema { align-self: center; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; text-align: center; }
.bolha.sistema.falha { background: var(--bad-soft); color: var(--bad); }
.cartao { align-self: flex-start; max-width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); }
.cartao summary { cursor: pointer; padding: 6px 10px; list-style: none; display: flex; align-items: center; gap: 8px; }
.cartao summary::-webkit-details-marker { display: none; }
.cartao summary::before { content: "▸"; color: var(--ink-3); }
.cartao[open] summary::before { content: "▾"; }
.cartao summary .resumo { color: var(--ok); }
.cartao.erro summary, .cartao.erro summary .resumo { color: var(--bad); }
.cartao pre { margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; color: var(--ink); }
.cartao .rotulo { padding: 4px 10px 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--line); }
.compor-area { position: sticky; bottom: 0; background: var(--osso); padding: 6px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.acima-do-campo { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.pensando { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; box-shadow: 0 1px 2px rgba(29, 25, 20, .04); }
.pensando .tempo { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pontos { display: inline-flex; gap: 4px; align-items: center; }
.pontos i { width: 6px; height: 6px; border-radius: 50%; background: var(--terracota); display: block; animation: pontinho 1.3s infinite ease-in-out; }
.pontos i:nth-child(2) { animation-delay: .18s; } .pontos i:nth-child(3) { animation-delay: .36s; }
@keyframes pontinho { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
.ir-fim { margin-left: auto; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--carvao); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(29, 25, 20, .12); }
.ir-fim:hover { background: var(--surface-2); }
.compor { display: flex; flex-direction: column; gap: 6px; }
.caixa { display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 8px; border: 1px solid var(--line-2); border-radius: 26px; background: var(--surface); box-shadow: 0 1px 2px rgba(29, 25, 20, .04); }
.caixa:focus-within { border-color: var(--terracota); box-shadow: 0 0 0 3px rgba(222, 106, 65, .12); }
.caixa textarea { flex: 1; min-width: 0; resize: none; min-height: 36px; max-height: 220px; overflow-y: auto; padding: 8px 4px; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.redondo { width: 36px; height: 36px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.redondo.leve { background: var(--surface-2); color: var(--carvao); }
.redondo.leve:hover { background: var(--surface-3); }
.redondo.enviar { background: var(--terracota); color: #fff; }
.redondo.enviar:disabled { opacity: .45; cursor: default; }
.anexos-pendentes { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 6px; }
.chip-anexo { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--ink-2); max-width: 260px; }
.chip-anexo img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.chip-anexo .doc { width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--ink-2); text-transform: uppercase; }
.chip-anexo .nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-anexo button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font: inherit; font-size: 16px; line-height: 1; padding: 0 2px; }
.bolha.pessoa .anexo { display: block; max-width: 100%; max-height: 280px; border-radius: 10px; margin: 2px 0 6px; }
.bolha.pessoa .anexo-doc { display: inline-block; margin: 2px 0 6px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); font-size: 12.5px; color: #F2EFE9; text-decoration: none; }
.rodape-linha { display: flex; justify-content: space-between; gap: 12px; padding: 0 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.modelo { color: var(--ink-3); }
.rodape.falha { color: var(--bad); }

/* --- Markdown da resposta ------------------------------------------------------------------------ */
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; } .md ul, .md ol { margin: 0 0 10px; padding-left: 22px; } .md li { margin: 2px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; line-height: 1.3; letter-spacing: -.01em; color: var(--carvao); }
.md h1 { font-size: 18px; } .md h2 { font-size: 16.5px; } .md h3, .md h4 { font-size: 15px; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.md pre { margin: 0 0 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md a { color: var(--terracota-ink); }
.md strong { font-weight: 700; color: var(--carvao); }
.tabela { position: relative; margin: 4px 0 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tabela table { border-collapse: collapse; width: max-content; min-width: 100%; max-width: none; font-size: 14px; }
.tabela th, .tabela td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: normal; word-break: normal; max-width: 420px; }
.tabela code { white-space: nowrap; }
.tabela th { background: var(--surface-2); font-weight: 700; color: var(--carvao); white-space: nowrap; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td.num, .tabela th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela .copiar { position: absolute; top: 4px; right: 4px; font: inherit; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; opacity: 0; transition: opacity .15s; }
.tabela:hover .copiar, .tabela .copiar:focus { opacity: 1; }
.arquivos { margin-top: 8px; font-size: 13px; color: var(--ink-2); } .arquivos a { color: var(--terracota-ink); font-weight: 600; }

/* --- celular: a lista vira gaveta --------------------------------------------------------------- */
@media (max-width: 860px) {
  body { font-size: 14px; }
  .so-celular { display: inline-flex; }
  .app.sem-login .so-celular { display: none; }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(320px, 86vw); z-index: 5; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 32px rgba(29, 25, 20, .18); }
  .lateral.aberta { transform: none; }
  .app.sem-login .lateral { display: none; }
  .topo { padding: 10px 14px; }
  .topo-acoes .chip { display: none; }
  .chat { padding: 14px 14px 0; }
  .bolha.pessoa { max-width: 88%; }
}
