/* Original AiOS · chat flutuante
   Ideia: cada janela é uma comanda. Topo café com borda picotada e título em Anton;
   o resto é papel liso, sem degradê e sem balão nas respostas. */
@font-face { font-family: "Anton"; src: url(/fontes/Anton-Regular.ttf) format("truetype"); font-display: swap; }

.wc {
  --cafe: #2b231c;
  --cafe-2: #3a2f26;
  --creme: #f6efe2;
  --mostarda: #e0a43a;
  --papel: var(--card);
  --titulo: "Anton", "Oswald", Impact, sans-serif;
  font-family: var(--fonte); color: var(--texto);
}
:root[data-tema="escuro"] .wc { --cafe: #0d0b09; --cafe-2: #1f1a15; --creme: #efe4d0; }
.wc .i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wc button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.wc button:focus-visible, .wc textarea:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

/* anel do logo, recortado de logo-aios.png (ícone em 4..84 px de 256x89) */
.wc-marca { --t: 26px; width: var(--t); height: var(--t); background: url(/logo-aios.png) no-repeat;
  background-size: calc(var(--t) * 3.2) auto; background-position: calc(var(--t) * -0.05) calc(var(--t) * -0.05); }
.wc-avatar.pequeno .wc-marca { --t: 22px; }

/* ---------- botão principal: um botão de esmalte, sem brilho nem degradê ---------- */
.wc-lancador { position: fixed; right: 18px; bottom: 6px; z-index: 2000; width: 44px; height: 44px; border-radius: 50%;
  background: var(--cafe) !important; color: var(--creme) !important; display: grid; place-items: center;
  box-shadow: 0 2px 0 var(--acento), 0 4px 10px rgba(30, 20, 10, .22); transition: transform .12s, box-shadow .12s; }
.wc-lancador:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--acento), 0 4px 10px rgba(30, 20, 10, .28); }
.wc-lancador > span { grid-area: 1 / 1; transition: opacity .15s; }
.wc-lancador .wc-x { opacity: 0; }
.wc-lancador .wc-x .i { width: 22px; height: 22px; stroke-width: 2; }
.wc-lancador.aberto .wc-marca { opacity: 0; }
.wc-lancador.aberto .wc-x { opacity: 1; }
/* alguma conversa trabalhando: um ponto mostarda fixo, sem pulsar */
.wc-lancador.trabalhando::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--mostarda); box-shadow: 0 0 0 2.5px var(--cafe); }
.wc-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d93a26; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.wc-lancador .wc-badge { position: absolute; top: -3px; right: -3px; box-shadow: 0 0 0 2px var(--fundo); }

/* ---------- lista: o trilho de comandas ---------- */
.wc-lista { position: fixed; right: 12px; bottom: calc(var(--barra, 52px) + 8px); z-index: 2000; width: 350px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 130px));
  display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: var(--papel);
  border: 1px solid var(--linha); box-shadow: 0 18px 50px rgba(30, 20, 10, .22); transform-origin: bottom right; animation: wc-abrir .16s ease-out; }
@keyframes wc-abrir { from { opacity: 0; transform: translateY(6px); } }
.wc-lista-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 16px 18px; background: var(--cafe); color: var(--creme); position: relative; }
.wc-lista-topo b { font: 400 24px/1 var(--titulo); letter-spacing: .01em; display: block; }
.wc-lista-topo small { display: block; margin-top: 5px; font-size: 12px; color: color-mix(in srgb, var(--creme) 65%, transparent); }
.wc-nova { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 9px; border-radius: 6px;
  background: var(--acento) !important; color: #fff !important; font-size: 13px !important; font-weight: 600; flex: none; }
.wc-nova:hover { filter: brightness(1.08); }
.wc-nova:disabled { opacity: .6; }
.wc-lista-itens { overflow: auto; flex: 1; overscroll-behavior: contain; }
.wc-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border-bottom: 1px dashed var(--linha) !important; }
.wc-item:last-child { border-bottom: 0 !important; }
.wc-item:hover { background: var(--hover); }
.wc-item.aberta { box-shadow: inset 3px 0 0 var(--acento); }
.wc-item-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wc-item-texto b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-item-texto small { font-size: 12px; color: var(--texto-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.wc-item-lado { display: flex; align-items: center; gap: 6px; color: var(--texto-3); }
.wc-item-lado em { font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--texto-2); }
.wc-item-lado .i { width: 14px; height: 14px; }
.wc-vazio { color: var(--texto-2); font-size: 13px; padding: 28px 18px; line-height: 1.5; }
.wc-lista-rodape { display: flex; border-top: 1px solid var(--linha); }
.wc-lista-rodape button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; font-size: 12.5px !important; color: var(--texto-2) !important; }
.wc-lista-rodape button:hover { background: var(--hover) !important; color: var(--texto) !important; }
.wc-lista-rodape button + button { border-left: 1px solid var(--linha) !important; }

.wc-avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--hover); color: var(--texto-2); }
.wc-avatar.pequeno { width: 30px; height: 30px; background: transparent; color: var(--creme); }
.wc-ponto { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--texto-3); box-shadow: 0 0 0 2px var(--papel); }
.wc-ponto.online { background: var(--verde); }
.wc-ponto.trabalhando { background: var(--mostarda); }
.so-topo .wc-ponto { box-shadow: 0 0 0 2px var(--cafe); }

/* ---------- recheio da janela de conversa (a casca é do janelas.css) ---------- */
.wc-conversa { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--papel); }

.wc-aviso { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 14px 9px; font-size: 12.5px;
  background: color-mix(in srgb, var(--mostarda) 20%, var(--papel)); border-bottom: 1px solid var(--linha); flex: none; }
.wc-aviso button { height: 26px; padding: 0 10px; border-radius: 5px; background: var(--cafe) !important; color: var(--creme) !important; font-size: 12px !important; font-weight: 600; white-space: nowrap; }

.wc-mensagens { flex: 1; overflow: auto; padding: 20px 16px 10px; display: flex; flex-direction: column; gap: 12px; background: var(--papel); overscroll-behavior: contain; }
.wc-terminal { flex: 1; min-height: 0; background: #1c1c1e; padding: 10px 4px 4px 8px; display: none; }
.wc-conversa.modo-terminal .wc-terminal { display: block; }
.wc-conversa.modo-terminal .wc-mensagens, .wc-conversa.modo-terminal .wc-escrever, .wc-conversa.modo-terminal .wc-aviso { display: none; }

.wc-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.wc-msg small { font-size: 10.5px; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.wc-balao { font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
/* o que você escreve: bloco dourado liso, canto reto do lado de quem fala */
.wc-msg.voce { align-self: flex-end; align-items: flex-end; max-width: 80%; }
.wc-msg.voce .wc-balao { background: var(--acento); color: #fff; padding: 8px 12px; border-radius: 8px 8px 2px 8px; }
.wc-msg.enviando { opacity: .6; }
/* o que o AiOS responde: texto no papel, com o fio dourado de comanda impressa */
.wc-msg.claude { align-self: stretch; max-width: none; padding-left: 12px; border-left: 2px solid var(--acento); }
.wc-msg.claude .wc-balao { max-width: 62ch; }
.wc-balao > :first-child { margin-top: 0; }
.wc-balao > :last-child { margin-bottom: 0; }
.wc-balao p, .wc-balao ul, .wc-balao ol { margin: 0 0 8px; }
.wc-balao ul, .wc-balao ol { padding-left: 18px; }
.wc-balao h1, .wc-balao h2, .wc-balao h3 { font: 400 16px/1.2 var(--titulo); letter-spacing: .01em; margin: 12px 0 5px; }
.wc-balao strong { font-weight: 650; }
.wc-balao code { font-family: var(--mono); font-size: 12px; background: var(--hover); padding: 1px 4px; border-radius: 3px; }
.wc-balao pre { background: var(--hover); padding: 8px 10px; border-radius: 6px; overflow: auto; font-size: 12px; }
.wc-balao pre code { background: none; padding: 0; }
.wc-balao table { border-collapse: collapse; font-size: 12px; display: block; overflow: auto; margin: 4px 0 8px; }
.wc-balao th, .wc-balao td { border-bottom: 1px solid var(--linha); padding: 4px 10px 4px 0; text-align: left; }
.wc-balao a { color: var(--acento); }
.wc-msg.voce .wc-balao a { color: #fff; }

.wc-acoes { font-size: 12px; color: var(--texto-3); padding-left: 14px; }
.wc-acoes summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-acoes summary:hover { color: var(--texto-2); }
.wc-acoes summary::-webkit-details-marker { display: none; }
.wc-acoes summary .i { width: 12px; height: 12px; transition: transform .15s; }
.wc-acoes[open] summary .i { transform: rotate(90deg); }
.wc-acoes div { padding: 2px 0 2px 16px; overflow-wrap: anywhere; }
/* troca de dia: uma linha tracejada, como o picote entre comandas */
.wc-dia { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--texto-3); margin: 2px 0; }
.wc-dia::before, .wc-dia::after { content: ""; flex: 1; border-top: 1px dashed var(--linha); }
/* trabalhando: diz o que está fazendo em vez de pontinhos pulando */
.wc-agora { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--texto-2); padding-left: 14px; }
.wc-agora i { width: 7px; height: 7px; border-radius: 50%; background: var(--mostarda); flex: none; animation: wc-respirar 1.6s ease-in-out infinite; }
@keyframes wc-respirar { 50% { opacity: .35; } }
.wc-erro { font-size: 12.5px; color: #c0321f; border-left: 2px solid #c0321f; padding: 2px 0 2px 12px; }
.wc-boas-vindas { margin: auto 0 4px; color: var(--texto-2); }
.wc-boas-vindas b { display: block; font: 400 22px/1.1 var(--titulo); letter-spacing: .01em; color: var(--texto); margin-bottom: 6px; }
.wc-boas-vindas p { font-size: 13px; margin: 0; max-width: 34ch; line-height: 1.5; }

.wc-escrever { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 12px; border-top: 1px dashed var(--linha); background: var(--papel); flex: none; }
.wc-escrever textarea { flex: 1; resize: none; border: 1px solid var(--linha); background: var(--fundo); color: var(--texto); border-radius: 8px; padding: 9px 12px;
  font: 13.5px/1.4 var(--fonte); max-height: 140px; outline: none; }
.wc-escrever textarea:focus { border-color: var(--acento); }
.wc-escrever textarea:disabled { opacity: .6; }
.wc-escrever button { width: 38px; height: 38px; border-radius: 8px; background: var(--cafe) !important; color: var(--creme) !important; display: grid; place-items: center; flex: none; }
.wc-escrever button:hover { background: var(--acento) !important; color: #fff !important; }

@media (prefers-reduced-motion: reduce) {
  .wc-lista { animation: none; }
  .wc-agora i { animation: none; }
}
@media (max-width: 640px) {
  .wc-lista { right: 12px; left: 12px; width: auto; max-width: none; }
}

/* lista: só o ponto de status, sem avatar repetido */
.wc-item > .wc-ponto { position: static; box-shadow: none; width: 9px; height: 9px; flex: none; align-self: flex-start; margin-top: 5px; }
.wc-zap { display: inline-grid; vertical-align: -2px; margin-right: 5px; color: #25a35a; }
.wc-zap .i { width: 14px; height: 14px; }

/* o chat substitui a coluna antiga de conversas da direita */
#conversas { display: none !important; }
