:root {
  --tomate: #d7261e;
  --manjericao: #1e6b3a;
  --manjericao-escuro: #154f2a;
  --anel: #f6d31c;
  --forno: #221c18;
  --forno-claro: #2f2722;
  --papel: #fbfaf4;
  --tinta: #1d1b19;
  --chat-fundo: #efeae2;
  --bolha-cliente: #d9fdd3;
  --bolha-bia: #ffffff;
  --texto: #111b21;
  --texto-suave: #667781;
  --visto: #53bdeb;
  --fonte-marca: "Anton", "Arial Narrow", Impact, sans-serif;
  --fonte-chat: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fonte-comanda: "Courier Prime", "Courier New", ui-monospace, monospace;
  --altura-marca: 64px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--forno);
  color: var(--texto);
  font-family: var(--fonte-chat);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--anel); outline-offset: 2px; }

.visualmente-oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- marca */

.marca {
  height: var(--altura-marca);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  color: var(--papel);
  border-bottom: 3px solid var(--tomate);
}

.marca-logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; }

.marca-texto { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }

.marca-nome {
  font-family: var(--fonte-marca);
  font-size: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.marca-sub { font-size: 12.5px; color: #cfc6bd; }

.abas { display: none; margin-left: auto; }

/* ---------------------------------------------------------------- palco */

.palco {
  height: calc(100dvh - var(--altura-marca));
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(320px, 560px);
  justify-content: center;
  gap: 32px;
  padding: 24px 24px 0;
}

/* ---------------------------------------------------------------- conversa */

.telefone {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chat-fundo);
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  box-shadow: 0 0 0 8px #000, 0 20px 60px rgba(0, 0, 0, 0.5);
}

.chat-topo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--manjericao);
  color: #fff;
}

.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; object-fit: cover; }

.chat-quem { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.chat-quem strong { font-size: 16px; font-weight: 600; }
.chat-status { font-size: 12.5px; color: #d6eadb; }

.chat-recomecar {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12.5px;
}
.chat-recomecar:hover { background: rgba(255, 255, 255, 0.12); }

.chat-rolagem {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 6px;
  scrollbar-color: #c4bdb3 transparent;
  scroll-behavior: smooth;
}

.chat-dia {
  width: max-content;
  margin: 4px auto 10px;
  padding: 4px 12px;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  color: var(--texto-suave);
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.chat-nota {
  max-width: 300px;
  margin: 0 auto 12px;
  padding: 6px 12px;
  background: #ffeecd;
  color: #54656f;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.chat-mensagens { display: flex; flex-direction: column; gap: 3px; padding-bottom: 4px; }

.bolha {
  position: relative;
  max-width: 85%;
  padding: 6px 9px 18px;
  border-radius: 8px;
  font-size: 14.6px;
  line-height: 1.38;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  overflow-wrap: anywhere;
  animation: entra 0.18s ease-out;
}

.bolha p { margin: 0; white-space: pre-wrap; min-width: 58px; }

.bolha.cliente { align-self: flex-end; background: var(--bolha-cliente); border-top-right-radius: 0; }
.bolha.bia { align-self: flex-start; background: var(--bolha-bia); border-top-left-radius: 0; }
.bolha.cliente + .bolha.cliente, .bolha.bia + .bolha.bia { border-radius: 8px; }
.bolha.cliente:not(.bolha.cliente + .bolha.cliente) { margin-top: 6px; }
.bolha.bia:not(.bolha.bia + .bolha.bia) { margin-top: 6px; }

.bolha-hora {
  position: absolute;
  right: 8px;
  bottom: 3px;
  font-size: 11px;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: 3px;
}

.visto { width: 16px; height: 11px; fill: var(--visto); }

.bolha.imagem { padding: 3px 3px 18px; width: 260px; }
.bolha.imagem button { display: block; padding: 0; border: 0; background: none; width: 100%; }
.bolha.imagem img { display: block; width: 100%; max-height: 330px; object-fit: cover; object-position: top; border-radius: 6px; }
.bolha.imagem .legenda { padding: 5px 6px 0; font-size: 13.5px; }

.bolha.falha { background: #fff4f2; border: 1px solid #f1b8b1; }
.bolha.falha button { margin-top: 4px; background: none; border: 0; padding: 0; color: var(--tomate); font-weight: 600; }

.digitando { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.digitando span {
  width: 7px; height: 7px; border-radius: 50%; background: #9aa6ac;
  animation: pula 1.1s infinite ease-in-out;
}
.digitando span:nth-child(2) { animation-delay: 0.15s; }
.digitando span:nth-child(3) { animation-delay: 0.3s; }

.sugestoes {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 10px 2px;
  scrollbar-width: none;
}
.sugestoes[hidden] { display: none; }

.sugestao {
  flex: none;
  border: 1px solid #c9d8cd;
  background: #fff;
  color: var(--manjericao-escuro);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13.5px;
}
.sugestao:hover { background: #f1f8f3; }

.chat-envio { display: flex; gap: 6px; padding: 8px 8px 10px; }

.chat-envio input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 22px;
  padding: 11px 16px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--texto);
}
.chat-envio input:focus-visible { outline: 2px solid var(--manjericao); outline-offset: 0; }

.chat-enviar {
  flex: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--manjericao);
  display: grid;
  place-items: center;
}
.chat-enviar svg { width: 21px; height: 21px; fill: #fff; }
.chat-enviar:disabled { opacity: 0.55; cursor: default; }

/* ---------------------------------------------------------------- pizzaria */

.pizzaria {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--papel);
  padding-bottom: 40px;
  scrollbar-color: #4a4039 transparent;
}

.pizzaria-cabeca h1 {
  margin: 4px 0 4px;
  font-family: var(--fonte-marca);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pizzaria-cabeca p { margin: 0 0 22px; color: #cfc6bd; font-size: 14.5px; max-width: 44ch; }

/* A impressora de comanda: o pedido sai daqui como a cozinha já está acostumada a ver. */
.impressora {
  position: relative;
  width: 340px;
  max-width: 100%;
  height: 22px;
  margin: 0 auto;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(#3c332d, #171310);
  box-shadow: inset 0 -5px 0 #0c0a09, 0 2px 0 #4a4039;
  z-index: 2;
}

.impressora-luz {
  position: absolute;
  right: 14px;
  top: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3f6f4b;
}
.impressora.imprimindo .impressora-luz { background: #6cff8f; box-shadow: 0 0 8px #6cff8f; }

.comandas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: -6px;
  padding-bottom: 30px;
  overflow: hidden;
}

.vazio {
  width: 300px;
  max-width: 100%;
  margin: 0;
  padding: 26px 18px 18px;
  text-align: center;
  font-size: 14px;
  color: #a79d93;
  border: 1px dashed #4a4039;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.comanda {
  --dente: 7px;
  width: 300px;
  max-width: 100%;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fonte-comanda);
  font-size: 13.5px;
  line-height: 1.45;
  padding: 18px 16px calc(16px + var(--dente));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--dente)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--dente)) 100%;
}

.comanda .titulo { font-weight: 700; font-size: 15px; }
.comanda .confirmar { font-weight: 700; color: var(--tomate); }

.comanda.nova { animation: imprime 1.8s steps(14, end) both; }

.chamados-bloco { margin-top: 34px; }
.chamados-bloco h2, .pendencias summary {
  font-family: var(--fonte-marca);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.chamados { display: flex; flex-direction: column; gap: 10px; }

.chamado {
  background: var(--forno-claro);
  border-left: 4px solid var(--anel);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}
.chamado .motivo { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--anel); }
.chamado .pergunta { font-weight: 600; margin: 4px 0; }
.chamado .resumo { color: #cfc6bd; white-space: pre-wrap; font-size: 13px; }

.atalhos { margin-top: 34px; display: grid; gap: 12px; }
.atalho {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: 12px; text-decoration: none;
  background: var(--forno-claro); color: var(--papel); border: 1px solid #3a312b;
}
.atalho strong { font-family: var(--fonte-marca); font-weight: 400; font-size: 21px; text-transform: uppercase; letter-spacing: 0.03em; }
.atalho span { color: #cfc6bd; font-size: 14px; }
.atalho:hover { border-color: var(--anel); }
.atalho-formulario { background: var(--anel); color: var(--forno); border-color: var(--anel); }
.atalho-formulario span { color: #3d3300; }

.bolha-quem { display: block; font-size: 12px; font-weight: 700; color: var(--manjericao); margin-bottom: 2px; }
.bolha.sistema-aviso { background: #fff8d6; }

.comanda-status { font-family: var(--fonte); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--manjericao); display: block; margin-bottom: 6px; }

/* ---------------------------------------------------------------- avisos */

.aviso {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--forno);
  color: var(--papel);
  border-left: 4px solid var(--anel);
  border-radius: 8px;
  padding: 10px 10px 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 14.5px;
  z-index: 20;
  max-width: calc(100vw - 32px);
}
.aviso[hidden] { display: none; }
.aviso-ver { border: 0; border-radius: 6px; background: var(--anel); color: var(--forno); font-weight: 700; padding: 6px 12px; }

.bloqueio {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: var(--forno);
  color: var(--papel);
  z-index: 40;
}
.bloqueio[hidden] { display: none; }
.bloqueio img { border-radius: 50%; background: #fff; }
.bloqueio p { max-width: 32ch; font-size: 16px; line-height: 1.5; margin: 0; }

.foto-cheia {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.94);
  overflow: auto;
  z-index: 30;
  padding: 56px 12px 24px;
  text-align: center;
}
.foto-cheia[hidden] { display: none; }
.foto-cheia img { max-width: min(100%, 900px); height: auto; }
.foto-fechar {
  position: fixed;
  top: 12px;
  right: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--papel);
  color: var(--forno);
  font-weight: 700;
  padding: 8px 16px;
}

/* ---------------------------------------------------------------- celular */

@media (max-width: 899px) {
  :root { --altura-marca: 52px; }

  .marca { padding: 0 10px; gap: 8px; border-bottom-width: 2px; }
  .marca-logo, .marca-sub { display: none; }
  .marca-nome { font-size: 19px; }

  .abas {
    display: flex;
    background: #0f0c0a;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
  }
  .aba {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #cfc6bd;
    padding: 6px 12px;
    font-size: 13.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .aba[aria-pressed="true"] { background: var(--papel); color: var(--forno); font-weight: 600; }
  .aba-contador {
    min-width: 19px; height: 19px; border-radius: 999px;
    background: var(--tomate); color: #fff;
    font-size: 11.5px; font-weight: 700;
    display: inline-grid; place-items: center; padding: 0 5px;
  }
  .aba-contador[hidden] { display: none; }

  .palco { display: block; padding: 0; height: calc(100dvh - var(--altura-marca)); }
  .telefone { height: 100%; border-radius: 0; box-shadow: none; }
  .pizzaria { height: 100%; padding: 20px 16px 40px; }
  .palco[data-tela-ativa="conversa"] .pizzaria { display: none; }
  .palco[data-tela-ativa="pizzaria"] .telefone { display: none; }
  .bolha { max-width: 88%; }
  .aviso { bottom: 76px; }
}

/* ---------------------------------------------------------------- movimento */

@keyframes entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pula { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes imprime { from { transform: translateY(-101%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .bolha, .comanda.nova, .digitando span { animation: none; }
  .chat-rolagem { scroll-behavior: auto; }
}
