/* Norty Times - claro e escuro; a cor da marca (--marca) vem da logo da empresa e o tema da conversa troca --acento e o fundo. */
:root {
  --marca: #6366F1; --marca2: #14B8A6;
  --fundo: #F4F5FA; --painel: #FFFFFF; --painel2: #F8F9FC; --linha: #E5E7EF; --texto: #161A2B; --muted: #6B7185;
  --balao-outro: #FFFFFF; --balao-outro-borda: #E7E9F1; --sombra: 0 10px 30px rgba(20, 24, 60, .08);
  --verde: #16A34A; --vermelho: #DC2626; --ambar: #D97706; --amarelo: #CA8A04; --cinza: #9CA3AF;
  --acento: var(--marca); --acento2: var(--marca2); --acento-tinta: #fff;
  --raio: 14px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
:root[data-modo="escuro"] {
  --fundo: #0E1018; --painel: #161925; --painel2: #1B1F2D; --linha: #272B3B; --texto: #E8EAF3; --muted: #9096AB;
  --balao-outro: #1F2333; --balao-outro-borda: #2A2F42; --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fundo); color: var(--texto); }
body { font-size: 14px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ entrada */
.entrada { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--marca) 22%, transparent), transparent),
              radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--marca2) 20%, transparent), transparent), var(--fundo); }
.balao-entrada { position: relative; width: min(380px, 100%); padding: 34px 30px 28px; background: var(--painel); border-radius: 28px;
  box-shadow: var(--sombra), 0 0 0 1px var(--linha); text-align: center; animation: sobe .5s cubic-bezier(.2, .9, .3, 1.2); }
.balao-entrada::after { content: ""; position: absolute; left: 46px; bottom: -14px; width: 28px; height: 28px; background: var(--painel);
  border-radius: 0 0 0 26px; box-shadow: -1px 1px 0 var(--linha); transform: skewX(-18deg); }
.marca-entrada { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; }
.marca-entrada img { max-height: 64px; max-width: 170px; object-fit: contain; }
.marca-entrada .logo-times { width: 56px; height: 56px; }
.balao-entrada h1 { margin: 14px 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.balao-entrada h1 b { background: linear-gradient(90deg, var(--marca), var(--marca2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.entrada-texto { margin: 0 0 18px; color: var(--muted); min-height: 20px; }
.entrada-dica { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.barras { display: flex; gap: 5px; justify-content: center; height: 26px; align-items: center; margin-bottom: 6px; }
.barras i { width: 5px; border-radius: 3px; background: linear-gradient(var(--marca), var(--marca2)); animation: barra 1s ease-in-out infinite; }
.barras i:nth-child(1) { animation-delay: 0s; } .barras i:nth-child(2) { animation-delay: .12s; } .barras i:nth-child(3) { animation-delay: .24s; }
.barras i:nth-child(4) { animation-delay: .36s; } .barras i:nth-child(5) { animation-delay: .48s; }
.barras.parado i { animation: none; height: 6px; opacity: .5; }
@keyframes barra { 0%, 100% { height: 6px; } 50% { height: 24px; } }
@keyframes sobe { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; background: var(--painel2); box-shadow: 0 0 0 1px var(--linha); }
.btn.primario { background: var(--acento); color: var(--acento-tinta); box-shadow: none; }
.btn.perigo { background: var(--vermelho); color: #fff; box-shadow: none; }
.btn:hover { filter: brightness(1.05); }

/* ------------------------------------------------------------------ app */
.app { display: grid; grid-template-columns: 72px 320px 1fr; height: 100vh; }
.trilho { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: var(--painel); border-right: 1px solid var(--linha); }
.trilho-marca { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.trilho-marca #logo-empresa { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; }
.trilho-marca .logo-times { width: 34px; height: 34px; }
.trilho-marca #logo-empresa:not([hidden]) + .logo-times { width: 22px; height: 22px; opacity: .9; }
.trilho-btn { position: relative; width: 58px; padding: 8px 0 6px; border: 0; background: transparent; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.trilho-btn:hover { background: var(--painel2); color: var(--texto); }
.trilho-btn.ativo { color: var(--acento); background: color-mix(in srgb, var(--acento) 12%, transparent); }
.trilho-btn em { position: absolute; top: 3px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--vermelho);
  color: #fff; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; }
.trilho-fim { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.eu { position: relative; border: 0; background: transparent; padding: 0; border-radius: 50%; }
.eu .avatar { width: 40px; height: 40px; font-size: 14px; }
.ponto { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--painel); background: var(--cinza); }

.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 13px;
  background: linear-gradient(135deg, var(--a1, var(--marca)), var(--a2, var(--marca2))); user-select: none; position: relative; }
.avatar.grupo { border-radius: 11px; }
.p-available { background: var(--verde); } .p-in_call, .p-busy, .p-dnd { background: var(--vermelho); } .p-wrapup, .p-paused { background: var(--ambar); }
.p-away { background: var(--amarelo); } .p-offline { background: var(--cinza); }
.p-dnd::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 2px; margin-top: -1px; background: #fff; border-radius: 1px; }

/* ------------------------------------------------------------------ lista */
.lista { display: flex; flex-direction: column; min-width: 0; background: var(--painel2); border-right: 1px solid var(--linha); }
.lista-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 18px; }
.lista-titulo h2 { margin: 0; font-size: 19px; font-weight: 650; }
.lista-titulo span { font-size: 12px; }
.icone { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.icone:hover { background: color-mix(in srgb, var(--texto) 7%, transparent); color: var(--texto); }
.busca { margin: 0 12px 8px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 11px; background: var(--painel); box-shadow: 0 0 0 1px var(--linha); color: var(--muted); }
.busca svg { width: 17px; height: 17px; }
.busca input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.busca:focus-within { box-shadow: 0 0 0 2px var(--acento); }
.lista-itens { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.secao { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; position: relative; }
.item:hover { background: color-mix(in srgb, var(--texto) 5%, transparent); }
.item.ativo { background: color-mix(in srgb, var(--acento) 13%, transparent); }
.item .avatar .ponto { width: 12px; height: 12px; border-color: var(--painel2); }
.item-corpo { flex: 1; min-width: 0; }
.item-linha { display: flex; align-items: baseline; gap: 6px; }
.item-nome { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-hora { font-size: 11px; color: var(--muted); }
.item-previa { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item.nao-lida .item-nome, .item.nao-lida .item-previa { color: var(--texto); font-weight: 650; }
.contador { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--acento); color: var(--acento-tinta); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.contador.mencao { background: var(--vermelho); color: #fff; }
.resultado { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; }
.resultado:hover { background: color-mix(in srgb, var(--texto) 5%, transparent); }
.resultado b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.resultado span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ conversa */
.conversa { min-width: 0; display: flex; background: var(--fundo); }
.vazio { margin: auto; max-width: 380px; text-align: center; padding: 24px; color: var(--muted); }
.vazio-logo { width: 84px; height: 84px; opacity: .9; }
.vazio h3 { color: var(--texto); margin: 14px 0 6px; font-weight: 600; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative;
  background-color: color-mix(in srgb, var(--acento) 4%, var(--fundo)); background-image: var(--padrao, none); }
.chat-topo { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 18px; background: color-mix(in srgb, var(--painel) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--linha); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--acento) 55%, transparent); }
.chat-quem { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat-quem h3 { margin: 0; font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-quem p { margin: 1px 0 0; font-size: 12.5px; }
.chat-acoes { display: flex; gap: 2px; }
.voltar { display: none; }
.mensagens { flex: 1; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 2px; }
.dia { align-self: center; margin: 14px 0 8px; padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: color-mix(in srgb, var(--painel) 85%, transparent); box-shadow: 0 0 0 1px var(--linha); }
.msg { display: flex; gap: 9px; max-width: min(720px, 82%); position: relative; }
.msg .avatar { width: 30px; height: 30px; font-size: 11px; margin-top: 18px; }
.msg.seguida .avatar { visibility: hidden; height: 0; margin: 0; }
.msg-corpo { min-width: 0; }
.msg-autor { font-size: 12px; font-weight: 650; margin: 8px 0 3px 4px; color: var(--acento); }
.msg.seguida .msg-autor { display: none; }
.balao { position: relative; padding: 8px 12px 6px; border-radius: 16px; background: var(--balao-outro); box-shadow: 0 0 0 1px var(--balao-outro-borda), 0 1px 2px rgba(0, 0, 0, .04);
  line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg:not(.seguida) .balao { border-top-left-radius: 5px; }
.msg.minha { align-self: flex-end; flex-direction: row-reverse; }
.msg.minha .avatar, .msg.minha .msg-autor { display: none; }
.msg.minha .balao { background: linear-gradient(135deg, var(--acento), color-mix(in srgb, var(--acento) 70%, var(--acento2))); color: var(--acento-tinta); box-shadow: none; }
.msg.minha:not(.seguida) .balao { border-top-left-radius: 16px; border-top-right-radius: 5px; }
.msg.minha:not(.seguida) { margin-top: 8px; }
.msg-rodape { display: flex; justify-content: flex-end; gap: 6px; font-size: 10.5px; opacity: .7; margin-top: 2px; }
.msg.apagada .balao { font-style: italic; opacity: .65; }
.mencao { font-weight: 650; color: var(--acento); background: color-mix(in srgb, var(--acento) 14%, transparent); padding: 0 3px; border-radius: 4px; }
.msg.minha .mencao { color: inherit; background: rgba(255, 255, 255, .22); }
.msg.me-mencionou .balao { box-shadow: 0 0 0 2px var(--ambar); }
.balao a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.citacao { display: block; margin: 0 0 6px; padding: 5px 9px; border-left: 3px solid var(--acento); border-radius: 6px; font-size: 12.5px;
  background: color-mix(in srgb, var(--texto) 6%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; cursor: pointer; }
.msg.minha .citacao { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .16); }
.imagem { display: block; max-width: min(360px, 100%); max-height: 320px; border-radius: 10px; margin: 2px 0 4px; cursor: zoom-in; background: var(--painel2); }
.anexo { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--texto) 6%, transparent); text-decoration: none; color: inherit; margin: 2px 0 4px; }
.anexo small { display: block; opacity: .7; }
.msg-menu { position: absolute; top: -12px; right: 6px; display: none; gap: 2px; padding: 2px; border-radius: 9px; background: var(--painel); box-shadow: var(--sombra), 0 0 0 1px var(--linha); z-index: 2; }
.msg.minha .msg-menu { right: auto; left: 6px; }
.msg:hover .msg-menu { display: flex; }
.msg-menu button { border: 0; background: transparent; width: 28px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.msg-menu button:hover { background: var(--painel2); color: var(--texto); }
.msg-menu svg { width: 16px; height: 16px; }
.visto { align-self: flex-end; font-size: 11px; color: var(--muted); margin: 2px 4px 0; }
.digitando { min-height: 20px; padding: 0 24px; font-size: 12px; color: var(--muted); font-style: italic; }
.mais-antigas { align-self: center; margin: 4px 0 10px; }

.compor { padding: 6px 16px 14px; }
.compor-linha { display: flex; align-items: flex-end; gap: 6px; padding: 6px; border-radius: 16px; background: var(--painel); box-shadow: var(--sombra), 0 0 0 1px var(--linha); }
.compor-linha:focus-within { box-shadow: var(--sombra), 0 0 0 2px var(--acento); }
.compor textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 4px; max-height: 160px; line-height: 1.4; }
.enviar { width: 38px; height: 38px; border: 0; border-radius: 12px; display: grid; place-items: center; background: var(--acento); color: var(--acento-tinta); }
.enviar svg { width: 18px; height: 18px; }
.respondendo { display: flex; align-items: center; gap: 8px; margin: 0 6px 6px; padding: 6px 10px; border-left: 3px solid var(--acento); border-radius: 8px; background: var(--painel); font-size: 12.5px; }
.respondendo span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mencoes { margin: 0 6px 6px; max-height: 220px; overflow-y: auto; border-radius: 12px; background: var(--painel); box-shadow: var(--sombra), 0 0 0 1px var(--linha); padding: 4px; }
.mencoes button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.mencoes button.sel, .mencoes button:hover { background: color-mix(in srgb, var(--acento) 12%, transparent); }
.mencoes .avatar { width: 26px; height: 26px; font-size: 10px; }

/* ------------------------------------------------------------------ baloes suspensos, janelas e aviso */
.camada { position: fixed; inset: 0; z-index: 20; }
.camada.escura { background: rgba(10, 12, 25, .45); display: grid; place-items: center; padding: 16px; animation: aparece .15s; }
.suspenso { position: fixed; min-width: 230px; padding: 6px; border-radius: 16px; background: var(--painel); box-shadow: var(--sombra), 0 0 0 1px var(--linha); animation: sobe .18s ease-out; z-index: 21; }
.suspenso h4 { margin: 8px 10px 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
.opcao { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.opcao:hover { background: var(--painel2); }
.opcao .ponto { position: static; border: 0; width: 11px; height: 11px; flex: none; }
.opcao small { display: block; color: var(--muted); font-size: 11.5px; }
.opcao.sel { background: color-mix(in srgb, var(--acento) 12%, transparent); }
.janela { width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 22px; background: var(--painel); box-shadow: var(--sombra); animation: sobe .2s ease-out; overflow: hidden; }
.janela header { padding: 18px 20px 8px; } .janela h3 { margin: 0; font-size: 17px; } .janela header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.janela .corpo { padding: 8px 20px; overflow-y: auto; }
.janela footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.campo { width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--painel2); box-shadow: 0 0 0 1px var(--linha); outline: 0; margin-bottom: 10px; }
.campo:focus { box-shadow: 0 0 0 2px var(--acento); }
.escolha { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.escolha:hover { background: var(--painel2); }
.escolha input { accent-color: var(--acento); width: 17px; height: 17px; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tema { border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--painel2); box-shadow: 0 0 0 1px var(--linha); text-align: left; }
.tema.sel { box-shadow: 0 0 0 2.5px var(--acento); }
.tema-amostra { height: 64px; position: relative; }
.tema-amostra i { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 16px; border-radius: 8px 8px 3px 8px; }
.tema-amostra b { position: absolute; left: 10px; top: 10px; width: 36px; height: 12px; border-radius: 8px 8px 8px 3px; background: var(--balao-outro); box-shadow: 0 0 0 1px var(--balao-outro-borda); }
.tema span { display: block; padding: 7px 10px 8px; font-size: 12.5px; font-weight: 600; }
.tema em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--acento); margin-left: 4px; }
.aviso { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: #1F2333; color: #fff;
  box-shadow: var(--sombra); z-index: 40; animation: sobe .2s; }
.zoom { max-width: 92vw; max-height: 90vh; border-radius: 12px; box-shadow: var(--sombra); }
@keyframes aparece { from { opacity: 0; } }

/* ------------------------------------------------------------------ janela estreita (balao da Estacao, celular) */
@media (max-width: 860px) {
  .app { grid-template-columns: 60px 1fr; }
  .trilho-btn { width: 50px; } .trilho-btn span { display: none; }
  .conversa { display: none; }
  .app.abriu .lista { display: none; }
  .app.abriu .conversa { display: flex; }
  .voltar { display: grid; }
  .msg { max-width: 92%; }
}
@media (max-width: 420px) {
  .app { grid-template-columns: 1fr; }
  .trilho { display: none; }
  .mensagens { padding: 12px 10px 6px; }
}
