:root {
  --bg: #07111d;
  --bg-strong: #0b1828;
  --surface: #0b1828;
  --surface-2: #0e1f31;
  --text: #f5f7fb;
  --muted: #9fb3cd;
  --line: rgba(99, 229, 208, 0.14);
  --primary: #63e5d0;
  --primary-dark: #3dbfaa;
  --accent: #63e5d0;
  --bubble-me: linear-gradient(135deg, #63e5d0, #3dbfaa);
  --bubble-them: #0e1f31;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(99, 229, 208, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 229, 208, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hidden { display: none !important; }

/* ---------- Topbar / brand ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(11, 24, 40, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--text); }
.brand-accent {
  background: linear-gradient(90deg, #f5e642 40%, #3cb043 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* "App" com as cores da bandeira de Portugal (verde -> vermelho) */
.brand-app {
  background: linear-gradient(90deg, #006600 0%, #d81e05 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.table-tag, .staff-name { font-size: .85rem; color: var(--muted); font-weight: 600; }
.top-left { display: flex; align-items: center; gap: 6px; }

/* interrogação "Como funciona": centralizada no topo, amarela, piscando */
.help-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px; z-index: 4;
  background: none; border: none; cursor: pointer; color: #f5e642;
  animation: helpblink 1.4s ease-in-out infinite;
}
.help-mark {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 2px solid #f5e642;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; line-height: 1;
}
.help-text { font-weight: 700; font-size: .82rem; white-space: nowrap; }
.help-btn:hover { color: #fff266; }
@keyframes helpblink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (max-width: 540px) { .help-text { display: none; } }

/* ajuda "Como funciona" — passo a passo estilo stories */
.help-modal { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 14px; }
.stories {
  position: relative; width: 100%; max-width: 420px; height: min(88vh, 760px);
  background: radial-gradient(120% 80% at 50% -10%, #123a4d 0%, transparent 55%), linear-gradient(180deg, #0b1828 0%, #07111d 100%);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
}
.story-bars { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 6; display: flex; gap: 5px; }
.story-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
.story-bar.on, .story-bar.done { background: var(--primary); }
.story-close {
  position: absolute; top: 20px; right: 14px; z-index: 8; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
/* zonas de toque: esquerda volta, direita avança (estilo Instagram) */
.story-tap { position: absolute; top: 0; bottom: 0; z-index: 5; border: none; background: transparent; cursor: pointer; }
.story-tap.prev { left: 0; width: 32%; }
.story-tap.next { right: 0; width: 68%; }
.story-stage { flex: 1; display: grid; place-items: center; padding: 54px 26px 34px; text-align: center; }
.story-card { display: flex; flex-direction: column; align-items: center; gap: 18px; animation: storyIn .28s ease; }
@keyframes storyIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.story-illu { min-height: 190px; display: grid; place-items: center; width: 100%; }
.story-count { font-size: .72rem; font-weight: 800; letter-spacing: .1em; color: var(--primary); }
.story-title { font-size: 1.5rem; font-weight: 800; margin: 0; line-height: 1.2; }
.story-text { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; max-width: 15em; }

/* ilustrações (reaproveitam bandeiras/botões/ícones do app) */
.story-illu svg { fill: currentColor; }
.illu-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.illu-flags img { width: 76px; height: 54px; border-radius: 9px; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.illu-row { display: flex; gap: 20px; }
.illu-card { width: 96px; height: 96px; border-radius: 20px; background: #fff; color: var(--primary-dark); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.illu-card svg { width: 52px; height: auto; }
.illu-side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.illu-side img { width: 46px; height: 32px; border-radius: 6px; object-fit: cover; }
.illu-side svg { width: 26px; height: 26px; fill: var(--primary); }
.illu-pill { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 26px; background: rgba(255,140,26,.16); border: 1px solid #ff8c1a; color: #ff8c1a; font-weight: 800; font-size: 1.1rem; }
.illu-pill svg { width: 26px; height: 26px; }
.illu-circle { width: 96px; height: 96px; border-radius: 50%; background: #fff; color: #07111d; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.illu-circle svg { width: 46px; height: 46px; }
.illu-qr { width: 128px; height: 128px; border-radius: 18px; background: #fff; color: #07111d; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.illu-qr svg { width: 84px; height: 84px; }
.illu-queue { display: flex; gap: 12px; }
.illu-q { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; width: 62px; border-radius: 12px; border: 1px solid var(--primary); background: rgba(99,229,208,.12); }
.illu-q b { font-size: .8rem; color: var(--primary); }
.illu-q img { width: 30px; height: 21px; border-radius: 4px; object-fit: cover; }
.illu-q small { font-size: .66rem; color: var(--muted); font-weight: 700; }

/* botão de vozes (abre o seletor de text-to-speech) */
.voice-btn {
  display: inline-grid; place-items: center; width: 38px; height: 34px; padding: 0;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--primary); cursor: pointer; transition: .12s;
}
.voice-btn svg { width: 18px; height: 18px; fill: currentColor; }
.voice-btn:hover { border-color: var(--primary); }

/* modal do seletor de vozes */
.voice-modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 18px; }
.voice-panel {
  width: 100%; max-width: 460px; max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.voice-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.voice-close { width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--surface-2); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.voice-langs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); max-height: 122px; overflow-y: auto; }
.voice-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .82rem; cursor: pointer; }
.voice-tab img { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; }
.voice-tab.on { border-color: var(--primary); color: var(--primary); background: rgba(99,229,208,.1); }
.voice-list { overflow-y: auto; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.voice-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.voice-row.on { border-color: var(--primary); background: rgba(99,229,208,.1); }
.voice-play { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--primary); color: #07120e; font-size: .8rem; cursor: pointer; }
.voice-name { flex: 1; font-size: .9rem; font-weight: 600; }
.voice-g { color: var(--muted); font-weight: 700; }
.voice-pick { flex: 0 0 auto; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--primary); background: transparent; color: var(--primary); font-weight: 700; font-size: .8rem; cursor: pointer; }
.voice-row.on .voice-pick { background: var(--primary); color: #07120e; }
.voice-empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 16px 0; }

/* botão "lugar barulhento" (liga a supressão de ruído sempre) */
.noisy-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); font-size: .8rem; font-weight: 700; cursor: pointer; transition: .12s;
}
.noisy-btn svg { width: 18px; height: 18px; fill: currentColor; }
.noisy-btn:hover { border-color: var(--muted); }
.noisy-btn.on { background: rgba(255,140,26,.16); border-color: #ff8c1a; color: #ff8c1a; }
.back-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--primary); display: grid; place-items: center; border-radius: 8px;
}
.back-btn svg { width: 26px; height: 26px; fill: currentColor; }
.back-btn:hover { background: rgba(99,229,208,.12); }

/* seletor de modo do chat: "Model" + triângulo laranja invertido */
.model-sel {
  background: none; border: none; cursor: pointer; align-self: center;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  color: #ff8c1a; font-weight: 800; font-size: .9rem; letter-spacing: .03em;
}
.model-sel::after {
  content: ""; width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 10px solid #ff8c1a;
}
.model-sel:hover { color: #ffa54d; }
.model-sel:hover::after { border-top-color: #ffa54d; }
.mode-menu {
  position: fixed; transform: translateX(-50%); z-index: 30; min-width: 170px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display: flex; flex-direction: column;
}
.mode-menu button {
  padding: 14px 16px; background: none; border: none; color: var(--text);
  font-size: .95rem; font-weight: 600; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.mode-menu button + button { border-top: 1px solid var(--line); }
.mode-menu button:hover { background: var(--surface); }
.mode-menu svg { width: 22px; height: 22px; fill: #ff8c1a; flex: 0 0 auto; }

/* ---------- Cliente ---------- */
body.client { display: flex; flex-direction: column; }
.picker { flex: 1; padding: 28px 20px; max-width: 720px; margin: 0 auto; width: 100%; }
.picker-title { font-size: 1.6rem; margin: 8px 0 4px; }
.picker-sub { color: var(--muted); margin: 0 0 22px; font-size: .95rem; }
.picker-note { color: var(--muted); opacity: .8; margin: -14px 0 20px; font-size: .8rem; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.lang-btn {
  padding: 16px; border-radius: 16px; border: 1px solid #e3d8c4;
  background: #fff; color: #1b1a16; font-size: 1.05rem; font-weight: 600;
  cursor: pointer; text-align: left; transition: transform .08s, box-shadow .15s;
}
.lang-btn:hover { box-shadow: 0 8px 24px rgba(99,229,208,.28); transform: translateY(-2px); }
.lang-btn small { display: block; color: #6b6559; font-weight: 500; font-size: .78rem; margin-top: 2px; }
.lang-btn { display: flex; align-items: center; gap: 12px; }
.lang-btn .flag { width: 36px; height: 26px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lang-btn .lname { display: flex; flex-direction: column; }
.qr-link { display: block; padding: 12px 16px; color: var(--primary-dark); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.qr-link:hover { background: var(--bg); }

/* ---------- Escolha de modo: texto ou audio ---------- */
.mode {
  flex: 1; padding: 10vh 20px 40px; max-width: 760px; margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.mode-title { font-size: 1.6rem; margin: 0 0 40px; text-align: center; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(200px, 300px)); justify-content: center; gap: 22px; width: 100%; }
.mode-btn {
  min-height: 230px; padding: 40px 22px; border-radius: 24px; border: 1px solid #e3d8c4;
  background: #fff; color: #1b1a16; font-size: 1.35rem; font-weight: 700;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: transform .08s, box-shadow .15s;
}
.mode-btn:hover { box-shadow: 0 10px 28px rgba(99,229,208,.3); transform: translateY(-2px); }
.mode-btn .ico { height: 70px; width: auto; fill: var(--primary-dark); }
.mode-btn small { color: #6b6559; font-weight: 500; font-size: .95rem; line-height: 1.35; }
@media (max-width: 520px) {
  .mode { padding-top: 6vh; }
  .mode-grid { grid-template-columns: minmax(0, 340px); }
  .mode-btn { min-height: 190px; padding: 30px 20px; }
}
.mode-qr {
  margin-top: 26px; padding: 13px 22px; border-radius: 30px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: .95rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: .12s;
}
.mode-qr:hover { border-color: var(--primary); }
.mode-qr svg { width: 24px; height: 24px; fill: var(--primary); }

/* tela do QR da sala direta */
.qr-box { background: #fff; padding: 18px; border-radius: 18px; display: inline-block; }
.qr-box img, .qr-box canvas { display: block; }
.qr-hint { text-align: center; margin-top: 20px; }
.qr-close {
  margin-top: 22px; padding: 11px 28px; border-radius: 24px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: .95rem; font-weight: 700; cursor: pointer; transition: .12s;
}
.qr-close:hover { border-color: var(--primary); }
#qr { position: relative; }
.qr-close-x {
  position: absolute; top: 14px; right: 14px; z-index: 8;
  width: 46px; height: 46px; border-radius: 12px; border: none;
  background: #e23b3b; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: .12s;
}
.qr-close-x:hover { background: #c93030; }
.qr-close-x:active { transform: scale(.94); }

/* ---------- Conversação presencial ---------- */
.conv-bar {
  display: flex; align-items: center; justify-content: center; gap: 22px; padding: 14px;
  max-width: 820px; width: 100%; margin: 0 auto;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  overflow: hidden; /* o anel girando do botão não pode esticar a página (tremor na rolagem) */
}
/* Fila de atendimentos no canto direito (modo presencial de áudio) */
#conversa { position: relative; }
.conv-queue {
  position: absolute; top: 12px; right: 8px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  max-height: calc(100% - 150px); overflow-y: auto;
}
.q-item {
  position: relative; width: 58px; padding: 7px 4px 6px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: .12s;
}
.q-item.on { border-color: var(--primary); background: rgba(99,229,208,.12); }
.q-num { font-size: .72rem; font-weight: 800; color: var(--muted); }
.q-item.on .q-num { color: var(--primary); }
.q-flag { width: 30px; height: 21px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.q-lang { font-size: .66rem; font-weight: 700; color: var(--muted); }
.q-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: #e23b3b; color: #fff; font-size: .8rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.q-add {
  width: 40px; height: 40px; border-radius: 50%; border: 1px dashed var(--line);
  background: transparent; color: var(--primary); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.q-add:hover { border-color: var(--primary); }

/* QR no meio da conversa: quando a outra pessoa está distante (ex.: atrás do balcão) */
.conv-qr {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--primary);
  cursor: pointer; display: grid; place-items: center; transition: .12s;
}
.conv-qr svg { width: 26px; height: 26px; fill: currentColor; }
.conv-qr:hover { border-color: var(--primary); transform: translateY(-2px); }
.conv-qr:active { transform: scale(.94); }

/* botões de falar: um por idioma (toca a bandeira do lado de quem vai falar) */
.conv-side {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 22px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: transform .12s ease, border-color .12s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.conv-side .flag { width: 46px; height: 32px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.conv-side .side-mic { width: 26px; height: 26px; fill: var(--primary); }
.conv-side:active { transform: scale(.96); }
.conv-side.recording { border-color: #e23b3b; background: rgba(226,59,59,.12); animation: pulse 1.1s infinite; }
.conv-side.recording .side-mic { fill: #e23b3b; }
.conv-side.recording::after {
  content: ""; position: absolute; inset: -6px; border-radius: 22px;
  border: 3px solid rgba(226,59,59,.9); border-top-color: transparent;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* botão redondo do modo voz do chat (voicebar: Texto/Áudio) */
.conv-mic {
  position: relative; width: 76px; height: 76px; border-radius: 50%; border: none;
  background: #fff; color: #07111d; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .12s ease;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.conv-mic svg { width: 34px; height: 34px; display: block; fill: currentColor; }
.conv-mic:active { transform: scale(.94); }
.conv-mic.recording { background: #e23b3b; color: #fff; animation: pulse 1.1s infinite; }
.conv-mic.recording::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid rgba(226,59,59,.9); border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* ---------- Modo voz do chat: só os dois botões, sem caixa de fundo ---------- */
.voicebar {
  display: flex; align-items: center; justify-content: center; gap: 34px; padding: 14px 12px;
  max-width: 820px; width: 100%; margin: 0 auto;
  /* ~4 dedos acima da borda inferior */
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  overflow: hidden; /* o anel girando do botão não pode esticar a página (tremor na rolagem) */
}
.vb-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vb-label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.conv-mic.on { box-shadow: 0 0 0 3px #ff8c1a, 0 6px 18px rgba(0,0,0,.35); }

/* ---------- Chat (compartilhado) ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 820px; width: 100%; margin: 0 auto;
}
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 18px; line-height: 1.35;
  font-size: 1rem; word-wrap: break-word; box-shadow: 0 2px 8px rgba(27,26,22,.05);
}
.bubble .sub { display: block; font-size: .72rem; opacity: .7; margin-top: 4px; }
.bubble.me { align-self: flex-end; background: var(--bubble-me); color: #07120e; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--bubble-them); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.img { padding: 4px; max-width: 70%; }
.bubble.img.me, .bubble.img.them { background: var(--surface-2); border: 1px solid var(--line); }
.bubble.img img { display: block; width: 100%; max-width: 260px; border-radius: 14px; cursor: pointer; }
.status { text-align: center; color: var(--muted); font-size: .8rem; padding: 2px 0 6px; min-height: 1.1em; }

.composer {
  display: flex; align-items: center; gap: 8px; padding: 12px;
  border-top: 1px solid var(--line); background: rgba(11,24,40,.92);
  max-width: 820px; width: 100%; margin: 0 auto;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.input {
  flex: 1; padding: 12px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 1rem; color: var(--text); outline: none;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--primary); }
.mic, .send {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; border: none;
  font-size: 1.1rem; cursor: pointer; display: grid; place-items: center;
}
.mic {
  background: #fff; color: #07111d; border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  transition: transform .12s ease, filter .15s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mic:hover { filter: brightness(.97); }
.mic:active { transform: scale(.9); }
.mic svg { width: 22px; height: 22px; display: block; fill: currentColor; }
.mic.recording { background: #e23b3b; color: #fff; transform: scale(1.12); animation: pulse 1.1s infinite; }
.send { background: #fff; color: #07111d; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(226,59,59,.55); } 50% { box-shadow: 0 0 0 10px rgba(226,59,59,0); } }

/* ---------- Painel funcionario ---------- */
body.staff { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(11,24,40,.6); }
.tabs { display: flex; gap: 6px; padding: 10px 12px 2px; }
.tab { flex: 1; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-weight: 700; font-size: .82rem; cursor: pointer; transition: .12s; }
.tab.on { background: var(--primary); color: #07120e; border-color: var(--primary); }
.retention-note { margin: 6px 4px 12px; padding: 11px 13px; border-radius: 12px; background: rgba(245,230,66,.12); border: 1px solid rgba(245,230,66,.5); color: #f5e642; font-size: .82rem; line-height: 1.4; }
.retention-note b { color: #fff; }
.hist-meta { color: var(--muted); opacity: .82; font-size: .76rem; }
.empty-hist { list-style: none; color: var(--muted); font-size: .85rem; padding: 14px 4px; }
.hist-banner { align-self: center; max-width: 90%; text-align: center; margin: 4px auto 8px; padding: 8px 14px; border-radius: 12px; background: rgba(245,230,66,.12); border: 1px solid rgba(245,230,66,.5); color: #f5e642; font-size: .8rem; line-height: 1.4; }
.hist-banner b { color: #fff; }
.save-btn { width: 100%; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--primary); border-radius: 10px; background: rgba(99,229,208,.1); color: var(--primary); font-weight: 700; font-size: .85rem; cursor: pointer; transition: .12s; }
.save-btn:hover { background: var(--primary); color: #07120e; }
.save-inline { width: auto; margin: 0; padding: 6px 12px; font-size: .78rem; flex: 0 0 auto; }
.board { overflow-y: auto; padding: 8px 12px; }
.board-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 4px 6px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.card {
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: border-color .12s;
}
.card:hover, .card.selected { border-color: var(--primary); }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .who { font-weight: 700; }
.card .lang { font-size: .72rem; color: #07120e; background: var(--accent); padding: 1px 7px; border-radius: 10px; }
.card .meta { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.card .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e23b3b; color: #fff; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.card.unread { border-color: var(--primary); background: rgba(99,229,208,.08); }
.card.unread .who { font-weight: 800; }
.card .preview { font-size: .82rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace { display: flex; flex-direction: column; min-height: 0; }
.conv-header { padding: 10px 18px; border-bottom: 1px solid var(--line); font-weight: 700; background: rgba(11,24,40,.85); min-height: 56px; display: flex; align-items: center; }
.conv-info { display: flex; align-items: center; gap: 10px; width: 100%; }
.conv-name { flex: 1; font-weight: 700; font-size: 1rem; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; }
.conv-name::placeholder { color: var(--muted); font-weight: 500; }
.conv-name:hover { border-color: var(--line); }
.conv-name:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.conv-info .lang { font-size: .72rem; color: #07120e; background: var(--accent); padding: 2px 8px; border-radius: 10px; flex: 0 0 auto; }

@media (max-width: 760px) {
  body.staff { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  body.staff.show-sidebar .sidebar { display: flex; }
  body.staff.show-sidebar .workspace { display: none; }
}
