/* Painel de operação: leitura rápida, números alinhados, uma cor de destaque. Guia completo em design.md. */
:root {
  --fundo: #f4f6f9; --sup: #ffffff; --sup2: #eef1f5; --linha: #dfe4eb;
  --txt: #111a26; --suave: #5d6a7a; --destaque: #1f6fe0; --sobre: #ffffff;
  --bom: #12764a; --atencao: #9a5800; --ruim: #b3261e;
  --bom-f: #e0f4e9; --atencao-f: #fdefd6; --ruim-f: #fbe4e2;
  --sombra: 0 1px 2px rgba(17, 26, 38, .05), 0 6px 20px -12px rgba(17, 26, 38, .18);
  --sombra-alta: 0 24px 60px -20px rgba(17, 26, 38, .35);
  --r-sm: 6px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 20px;
  color-scheme: light;
}
/* Tema escuro: automático pelo aparelho, ou fixado em Ajustes (data-tema="escuro" / "claro" na raiz). Os dois blocos têm os mesmos valores. */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fundo: #0a0e14; --sup: #111722; --sup2: #19212e; --linha: #232d3c;
    --txt: #edf1f7; --suave: #8b98aa; --destaque: #5b9dff; --sobre: #06101f;
    --bom: #4fd08e; --atencao: #f2b449; --ruim: #ff7d75;
    --bom-f: #10301f; --atencao-f: #38290c; --ruim-f: #3d1719;
    --sombra: 0 1px 0 rgba(255, 255, 255, .03) inset;
    --sombra-alta: 0 30px 80px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --fundo: #0a0e14; --sup: #111722; --sup2: #19212e; --linha: #232d3c;
  --txt: #edf1f7; --suave: #8b98aa; --destaque: #5b9dff; --sobre: #06101f;
  --bom: #4fd08e; --atencao: #f2b449; --ruim: #ff7d75;
  --bom-f: #10301f; --atencao-f: #38290c; --ruim-f: #3d1719;
  --sombra: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --sombra-alta: 0 30px 80px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scrollbar-color: var(--linha) transparent; scrollbar-width: thin; }
body { margin: 0; background: var(--fundo); color: var(--txt); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
h1 .logo { height: 24px; width: auto; flex: none; display: block; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 650; }
.suave { color: var(--suave); }
.num { font-variant-numeric: tabular-nums; }
button, select, summary, a, label { touch-action: manipulation; }

/* topo e abas */
.topo { position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--linha);
  background: color-mix(in srgb, var(--fundo) 78%, transparent); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); }
.topo-in { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.topo-in h1 { margin-right: auto; }
.topo-in #relogio { font-size: 13px; font-variant-numeric: tabular-nums; }
.abas { display: flex; gap: 4px; max-width: 1100px; margin: 0 auto; overflow-x: auto; padding: 0 max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.abas button { flex: none; background: none; border: 0; border-radius: 999px; color: var(--suave); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 13px; cursor: pointer; transition: background .15s, color .15s; }
.abas svg { display: none; width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.abas .rot-c { display: none; }
.abas button:hover { color: var(--txt); background: var(--sup2); }
.abas button[aria-current="page"] { color: var(--destaque); background: color-mix(in srgb, var(--destaque) 14%, transparent); }

.tela { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }

/* botões e campos */
.btn { font: inherit; font-weight: 600; border-radius: var(--r-md); border: 1px solid var(--destaque); background: var(--destaque); color: var(--sobre); padding: 8px 15px; cursor: pointer;
  transition: filter .15s, transform .08s, background .15s, border-color .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.fantasma { background: var(--sup); color: var(--txt); border-color: var(--linha); }
.btn.fantasma:hover { filter: none; background: var(--sup2); border-color: color-mix(in srgb, var(--suave) 45%, var(--linha)); }
.btn.mini { padding: 4px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
:is(button, input, select, textarea, summary, a):focus-visible { outline: 2px solid var(--destaque); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--txt); background: var(--sup2); border: 1px solid transparent; border-radius: var(--r-md); padding: 8px 11px; min-width: 0; transition: border-color .15s, background .15s, box-shadow .15s; }
:is(input, select, textarea):hover { border-color: var(--linha); }
:is(input, select, textarea):focus { outline: none; background: var(--sup); border-color: var(--destaque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--destaque) 22%, transparent); }
::placeholder { color: var(--suave); opacity: .8; }
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--suave); }
label > :is(input, select, textarea) { font-size: 15px; }

.filtro { display: flex; gap: 6px; flex-wrap: wrap; }
.filtro button { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--linha); background: var(--sup); color: var(--suave); border-radius: 999px; padding: 5px 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-align: left; }
.filtro button:hover { color: var(--txt); border-color: color-mix(in srgb, var(--suave) 45%, var(--linha)); }
.filtro button[aria-pressed="true"] { background: color-mix(in srgb, var(--destaque) 14%, var(--sup)); color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 45%, transparent); }

/* cartões e números */
.cartao { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--r-xl); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--sombra); }
.cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cab h2 { margin-right: auto; }
.grade { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.kpis { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.025em; }
.kpi span { font-size: 12px; line-height: 1.35; color: var(--suave); }

.selo { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.selo.bom { background: var(--bom-f); color: var(--bom); }
.selo.atencao { background: var(--atencao-f); color: var(--atencao); }
.selo.ruim { background: var(--ruim-f); color: var(--ruim); }
.selo.neutro { background: var(--sup2); color: var(--suave); }
.sobe { color: var(--bom); } .desce { color: var(--ruim); }

.alerta { background: var(--ruim-f); color: var(--ruim); border: 1px solid color-mix(in srgb, var(--ruim) 30%, transparent); border-left: 3px solid var(--ruim); border-radius: var(--r-lg); padding: 11px 15px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.nota { background: var(--sup2); border-radius: var(--r-lg); padding: 11px 15px; font-size: 13.5px; line-height: 1.55; color: var(--suave); }

/* listas e tabelas */
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lista li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--linha); min-width: 0; }
.lista li:first-child { border-top: 0; }
.lista .quem { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.lista .fim { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--suave); }
.dia { display: flex; flex-direction: column; gap: 4px; }
.dia > h3 { display: flex; gap: 8px; align-items: center; }
/* variação ao lado do número e seletor de período (dia, semana, mês) */
.delta { font-size: 12.5px; font-weight: 650; letter-spacing: 0; margin-left: 6px; vertical-align: 2px; font-variant-numeric: tabular-nums; }
.periodo { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.periodo > span { margin-right: auto; }
.periodo button { font: inherit; font-weight: 600; color: var(--suave); background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 11px; cursor: pointer; min-height: 30px; }
.periodo button[aria-pressed="true"] { color: var(--destaque); background: color-mix(in srgb, var(--destaque) 14%, transparent); border-color: color-mix(in srgb, var(--destaque) 35%, transparent); }

/* cartões recolhidos do Início */
.dobra { display: flex; flex-direction: column; gap: 14px; }
.dobra-t { margin-right: auto; font-size: 15.5px; letter-spacing: -.01em; }
details.faixa.solta > summary { flex-wrap: nowrap; }

/* ranking de revendas */
.pos { display: inline-block; min-width: 22px; margin-right: 6px; color: var(--suave); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.th-ord { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 6px 0; margin: -6px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.th-ord:hover { color: var(--txt); }
th[aria-sort] .th-ord { color: var(--destaque); }
.th-ord .seta { font-size: 9px; }
table.ordenavel th { padding-top: 10px; padding-bottom: 10px; }
details.explica { border-top: 0; padding-top: 0; }
details.explica[open] > summary { margin-bottom: 8px; }
details.faixa[data-det^="rev-"][open] > summary { margin-bottom: 10px; }

/* sino do topo e painel de sugestões */
.btn.sino { position: relative; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; flex: none; }
.btn.sino[hidden] { display: none; }
.btn.sino svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sino-n { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--destaque); color: var(--sobre);
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--fundo); }
.sino-n.urgente { background: var(--ruim); color: var(--fundo); }
dialog.sino-dlg { width: min(520px, calc(100vw - 24px)); padding: 18px; }
dialog.sino-dlg[open] { display: flex; flex-direction: column; gap: 16px; }
.sino-dlg .cartao { border: 0; padding: 0; box-shadow: none; background: none; border-radius: 0; }
.sino-dlg .cartao + .cartao { border-top: 1px solid var(--linha); padding-top: 14px; }

/* gráfico de crescimento: barras finas, nome à esquerda, valor à direita em tinta de texto */
.g-par { display: grid; gap: 18px 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-bloco { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grafico { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.grafico li { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 30px; border-radius: 6px; padding: 0 4px; }
.grafico li:hover { background: var(--sup2); }
.g-nome { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.g-nome small, .g-val small { display: block; font-size: 11px; font-weight: 400; color: var(--suave); }
.g-trilho { display: block; height: 10px; }
.g-barra { display: block; height: 100%; background: var(--bom); border-radius: 0 4px 4px 0; }
.g-barra.cai { background: var(--ruim); }
.g-val { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; min-width: 52px; line-height: 1.2; }

/* sugestões da IA: título numa linha, contexto abre ao tocar */
.sugs { display: flex; flex-direction: column; }
details.sug { border-top: 1px solid var(--linha); }
details.sug:first-child { border-top: 0; }
details.sug > summary { display: flex; gap: 9px; align-items: baseline; padding: 8px 0; cursor: pointer; list-style: none; font-size: 13.5px; line-height: 1.35; }
details.sug > summary::-webkit-details-marker { display: none; }
.ponto { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--suave); transform: translateY(-1px); }
.ponto.ruim { background: var(--ruim); } .ponto.atencao { background: var(--atencao); }
.sug-tit { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.sug-val { flex: none; font-size: 12.5px; font-weight: 650; color: var(--bom); font-variant-numeric: tabular-nums; }
.sug-corpo { padding: 0 0 10px 17px; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 5px; }
.sug-corpo p { margin: 0; }
details.sug.lida > summary { color: var(--suave); }
details.sug.lida .sug-tit { font-weight: 500; }
details.sug.lida .sug-val { color: var(--suave); font-weight: 400; }
details.sug.lida .sug-corpo { padding-left: 0; }
.rodape { margin: 0; font-size: 12px; line-height: 1.5; color: var(--suave); }
.lista.sugs > li.sug { display: flex; flex-direction: column; align-items: stretch; gap: 3px; font-size: 13px; line-height: 1.45; }
details.faixa.mais { padding-top: 10px; }
details.faixa.mais > summary { font-size: 13px; font-weight: 600; color: var(--suave); }
details.faixa.mais[open] > summary { margin-bottom: 12px; }
details.faixa.solta { border-top: 0; padding-top: 0; }
details.faixa.solta[open] > summary { margin-bottom: 10px; }
details.dia { display: block; }
details.dia > summary { font-size: 14px; }
details.dia[open] > summary { margin-bottom: 6px; }
.dia.vazio { border-top: 1px solid var(--linha); padding-top: 12px; opacity: .6; }
.dia.vazio > h3 { padding-left: 22px; }

details.faixa { border-top: 1px solid var(--linha); padding-top: 12px; }
details.faixa > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 650; list-style: none; }
details.faixa > summary::-webkit-details-marker { display: none; }
details.faixa > summary::before { content: "›"; color: var(--suave); font-size: 18px; line-height: 1; width: 12px; transition: transform .15s; }
details.faixa[open] > summary::before { transform: rotate(90deg); }
details.faixa > summary .btn { margin-left: auto; }
.orienta { font-style: italic; color: var(--suave); font-size: 14px; margin: 6px 0 2px; }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--linha); }
.rec .info { min-width: 0; }
.rec .info b { overflow-wrap: anywhere; }
.rec .info small { display: block; color: var(--suave); }
.rec .acoes { display: flex; gap: 6px; align-items: start; }
.rec select { padding: 4px 6px; font-size: 13px; }
.rec input { grid-column: 1 / -1; font-size: 13px; padding: 5px 9px; }

.rolagem { overflow-x: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: right; padding: 9px 9px; border-top: 1px solid var(--linha); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { font-size: 11px; color: var(--suave); font-weight: 650; border-top: 0; text-transform: uppercase; letter-spacing: .06em; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--sup); }
td:first-child { font-weight: 600; }
tbody tr:hover td { background: var(--sup2); }

.busca { display: flex; gap: 8px; }
.busca input { flex: 1; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form .largo { grid-column: 1 / -1; }
.linha-btn { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* janela, aviso flutuante, login */
dialog { border: 1px solid var(--linha); border-radius: var(--r-2xl); background: var(--sup); color: var(--txt); padding: 20px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--sombra-alta); }
dialog::backdrop { background: rgba(4, 8, 14, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { display: flex; flex-direction: column; gap: 14px; }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); background: var(--txt); color: var(--fundo); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 20; max-width: calc(100vw - 32px); box-shadow: var(--sombra-alta); }
.login { max-width: 360px; width: 100%; margin: 12vh auto 0; padding: 24px; }

/* chat */
.conversa { display: flex; flex-direction: column; gap: 12px; }
.msg { border-radius: var(--r-xl); padding: 11px 15px; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.msg.eu { align-self: flex-end; background: var(--destaque); color: var(--sobre); max-width: 85%; border-bottom-right-radius: 5px; }
.msg.ia { align-self: stretch; background: var(--sup2); border: 1px solid var(--linha); border-bottom-left-radius: 5px; display: flex; flex-direction: column; gap: 9px; }
.msg.ia.erro { background: var(--ruim-f); color: var(--ruim); border-color: color-mix(in srgb, var(--ruim) 30%, transparent); }
.msg.ia :is(p, ul, h3) { margin: 0; }
.msg.ia ul { padding-left: 20px; }
.msg.ia td:first-child, .msg.ia th:first-child, .msg.ia tbody tr:hover td { background: var(--sup2); }
.msg.ia code, .chat code { background: var(--fundo); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.msg-pe { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; }
.chat .modo { flex-direction: row; align-items: center; gap: 6px; }
.chat .modo select { font-size: 13px; padding: 4px 8px; }

@media (max-width: 520px) { .topo-in #relogio { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Celular (iPhone): campos com 16px para o Safari não dar zoom ao tocar, alvos de toque maiores e linhas que quebram em vez de vazar da tela. */
@media (max-width: 640px), (pointer: coarse) {
  input, select, textarea, label > :is(input, select, textarea), .rec select, .rec input, .chat .modo select { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn.mini { min-height: 38px; padding: 6px 12px; }
  .abas button { padding: 10px 14px; }
  .filtro button { min-height: 38px; padding: 7px 14px; }
  .rec select, .chat .modo select { min-height: 38px; }
  details.faixa > summary { min-height: 40px; }
}
/* iOS: em tela de toque o "hover" gruda depois do toque, então só vale o estado apertado; nada de menu de toque longo nem seleção em botões. */
@media (hover: none) {
  .btn:hover, .btn.fantasma:hover { filter: none; background: var(--destaque); }
  .btn.fantasma:hover { background: var(--sup); border-color: var(--linha); }
  .abas button:hover { background: none; color: var(--suave); }
  .abas button[aria-current="page"]:hover { color: var(--destaque); }
  .filtro button:hover { color: var(--suave); border-color: var(--linha); }
  .filtro button[aria-pressed="true"]:hover { color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 45%, transparent); }
  tbody tr:hover td { background: var(--sup); }
  .btn:active, .filtro button:active, .abas button:active { opacity: .7; }
  button, summary, .abas, .selo, h1, h2, h3 { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
.rolagem, .abas { -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  /* barra de abas embaixo, ao alcance do polegar, respeitando a área do gesto de início do iPhone */
  .topo { background: var(--fundo); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topo-in { padding-bottom: 10px; }
  .abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-width: none; margin: 0; gap: 0; overflow: visible;
    padding: 5px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--linha); background: color-mix(in srgb, var(--fundo) 80%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
  .abas button, .abas button[aria-current="page"] { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0 3px; min-height: 50px; border-radius: 12px; background: none; font-size: 10px; font-weight: 600; letter-spacing: -.01em; }
  .abas svg { display: block; }
  .abas .rot { display: none; }
  .abas .rot-c { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tela { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .aviso { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  dialog { max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px)); }

  .tela { gap: 12px; padding-top: 14px; }
  .cartao { padding: 14px 15px; border-radius: 14px; }
  .cartao { gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .kpi b { font-size: 20px; }
  .kpi span { font-size: 11.5px; }
  .grade { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); } /* Início: painéis dois por linha */
  .grade .cartao { padding: 12px; gap: 10px; }
  .grade .cab h2 { font-size: 14px; overflow-wrap: anywhere; }
  .grade .kpis { grid-template-columns: 1fr; gap: 8px; }
  .grade .kpi b { font-size: 19px; }
  .grade .kpi span { font-size: 11px; }
  .nota { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
  .cab { gap: 8px; }
  .cab h2 { font-size: 15px; }
  details.faixa.mais > summary { min-height: 32px; }
  .lista li { flex-wrap: wrap; row-gap: 2px; }
  .lista .fim { white-space: normal; text-align: right; }
  .msg { padding: 10px 13px; }
  .msg.eu { max-width: 92%; }
  .chat .cab h2 { flex-basis: 100%; }
  th, td { padding: 8px 7px; }
}

/* título que separa os avisos das revendas, no fim da aba Revendas */
h2.secao { font-size: 15px; margin: 20px 2px 2px; color: var(--suave); }

/* central de incidentes: faixa colorida à esquerda pela situação, etapas tocáveis */
.inc-cab { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.inc-cab h2 { font-size: 20px; }
.inc-cab p { margin: 0; font-size: 13px; }
.filtro.segmento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filtro.segmento button { text-align: center; }
.inc { --c: var(--destaque); border-left: 4px solid var(--c); gap: 12px; }
.inc.critico { --c: var(--ruim); } .inc.solucao { --c: var(--bom); } .inc.comunicado { --c: var(--atencao); }
.inc-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.inc-topo .suave { margin-left: auto; font-variant-numeric: tabular-nums; }
.inc-txt { display: flex; flex-direction: column; gap: 4px; }
.inc-txt p { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.inc-sol { background: var(--bom-f); border-radius: var(--r-md); padding: 9px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.inc-sol p { margin: 0; }
.inc-sol.dica { background: var(--sup2); }
.inc-sol.dica b { font-size: 12px; color: var(--suave); font-weight: 650; }
.inc-sol code { background: var(--sup); border-radius: var(--r-sm); padding: 1px 6px; font-weight: 650; }
.etapas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.etapas li { position: relative; }
.etapas li + li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--linha); }
.etapas li.feita + li::before, .etapas li.feita + li.atual::before { background: var(--c); }
.etapas button { position: relative; width: 100%; min-height: 48px; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12px; color: var(--suave); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.etapas i { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--linha); background: var(--sup); }
.etapas .feita i { background: var(--c); border-color: var(--c); }
.etapas .atual i { border-color: var(--c); background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.etapas .atual span { color: var(--c); font-weight: 650; }
.inc-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.inc-rel li { flex-direction: column; align-items: stretch; gap: 2px; font-size: 13.5px; overflow-wrap: anywhere; }
.inc-rel li .suave { font-size: 12px; }
.inc-rel a { color: var(--destaque); font-size: 12.5px; }
.inc-man { margin-right: auto; font-size: 12px; align-self: center; }
.inc-arq { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.rodape.centro { text-align: center; padding: 0 12px; }
.abas button { position: relative; }
.aba-ponto { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ruim); }
.aba-ponto[hidden] { display: none; }
@media (max-width: 640px) { .aba-ponto { top: 5px; right: calc(50% - 16px); } }

/* ativação Clouddy */
.atv-form { display: flex; flex-direction: column; gap: 8px; }
.atv-form > .btn { align-self: flex-start; }
.atv-print { flex-direction: row; font-size: 14px; color: inherit; cursor: pointer; }
.atv-cli { border: 1px solid var(--linha); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.atv-cli h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.atv-cli p { margin: 0; }
.atv-cli code { background: var(--sup2); border-radius: 5px; padding: 2px 7px; font-size: 14px; overflow-wrap: anywhere; }
.atv-mini { max-width: 120px; max-height: 160px; border-radius: var(--r-md); border: 1px solid var(--linha); margin-top: 8px; object-fit: cover; }
.atv-cli .lista .fim { white-space: normal; text-align: right; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* Voltaram, separado por revenda */
.volta-grupo { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.volta-grupo h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* histórico: gráficos em SVG desenhados à mão (uma série, cor de destaque) */
.h-svg { width: 100%; height: auto; display: block; overflow: visible; }
.h-grade { stroke: var(--linha); stroke-width: 1; }
.h-eixo { fill: var(--suave); font-size: 10px; font-variant-numeric: tabular-nums; }
.h-rot { fill: var(--txt); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.h-linha { fill: none; stroke: var(--destaque); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.h-ponto { fill: var(--destaque); stroke: var(--sup); stroke-width: 2; }
.h-ponto.vazio { fill: var(--sup); stroke: var(--destaque); stroke-width: 2; }
.h-barra { fill: var(--destaque); }
.h-barra.parcial { fill: color-mix(in srgb, var(--destaque) 40%, var(--sup)); }
.h-toque { fill: transparent; }
.h-alvo { cursor: pointer; }
.h-alvo.ativo .h-barra, .h-alvo:hover .h-barra { fill: color-mix(in srgb, var(--destaque) 75%, var(--txt)); }
.h-alvo.ativo .h-ponto { r: 6; }
.h-dica { margin: 0; font-size: 12.5px; min-height: 1.5em; }
.h-mud { stroke: var(--atencao); stroke-width: 1.5; stroke-dasharray: 4 3; }
.h-linha.fina { stroke-width: 1.5; stroke: color-mix(in srgb, var(--destaque) 45%, var(--sup)); }
.h-linha.media { stroke-width: 2.5; }
.h-legenda { margin: 0; font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h-lg { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--destaque); margin-left: 6px; }
.h-lg.fina { border-top: 1.5px solid color-mix(in srgb, var(--destaque) 45%, var(--sup)); margin-left: 0; }
h3.h-sub { margin-top: 6px; }

/* chat flutuante: botão redondo no canto, acima da barra de abas no celular */
.chat-flut { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 7;
  width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--destaque); color: var(--sobre); display: grid; place-items: center; cursor: pointer; box-shadow: var(--sombra-alta); }
.chat-flut[hidden] { display: none; }
.chat-flut svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-flut:active { transform: scale(.94); }
dialog.chat-dlg { display: none; padding: 14px; width: min(520px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 32px)); }
dialog.chat-dlg[open] { display: flex; flex-direction: column; gap: 10px; }
.chatf-cab { display: flex; align-items: center; gap: 8px; }
.chatf-cab h2 { margin-right: auto; }
.chatf-conversa { flex: 1; overflow-y: auto; min-height: 0; }
.chat-dlg .chat-form textarea { min-height: 44px; }
@media (max-width: 640px) {
  .chat-flut { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; }
  dialog.chat-dlg { width: 100vw; max-width: 100vw; height: calc(100dvh - env(safe-area-inset-top, 0px)); max-height: none; margin: env(safe-area-inset-top, 0px) 0 0; border-radius: 16px 16px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
h3.g-dia { margin: 8px 0 0; }
/* responder às sugestões da IA */
.sug-resp { display: flex; gap: 6px; margin-top: 4px; }
.sug-resp input { flex: 1; min-width: 0; }
.linha-btn.esq { justify-content: flex-start; }
.sug-voce { font-weight: 600; }
.sug-ia { background: var(--sup2); border-radius: var(--r-md); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.sug-ia p { margin: 0; }
/* arrastar para o lado marca como lida */
[data-arrastar] { transition: transform .18s ease, opacity .18s ease; touch-action: pan-y; }
[data-arrastar].arrastando { transition: none; }
.sugs { overflow-x: hidden; }
/* ranking das revendas */
.rk-rot { font-size: 13px; align-self: center; }
.rk-datas { display: flex; gap: 10px; flex-wrap: wrap; }
.rk-datas label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--suave); }
.rk-lista li { align-items: center; }
.rk-pos { flex: none; width: 24px; font-weight: 700; color: var(--suave); font-variant-numeric: tabular-nums; }
.rk-lista .quem { display: flex; flex-direction: column; }
.rk-lista .quem small { font-weight: 400; font-size: 12px; }
.rk-num { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; line-height: 1.35; }
.rk-princ { font-weight: 700; font-size: 14px; color: var(--txt); }
/* ranking no layout de chips (pedido do dono, com print de referência) */
.rk .rk-tit { display: flex; align-items: center; gap: 10px; }
.rk .rk-tit h2 { font-size: 22px; font-weight: 750; }
.rk-ajuda { width: 26px; height: 26px; border-radius: 50%; border: 1.8px solid var(--suave); background: none; color: var(--suave); font: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.rk-datas-txt { margin-left: auto; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rk-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rk-linha.rola { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.rk-linha.rola::-webkit-scrollbar { display: none; }
.rk-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 15px; border-radius: 12px; border: 1px solid var(--linha); background: var(--sup2); color: var(--suave); font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.rk-chip svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rk-chip[aria-pressed="true"] { color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 70%, transparent); background: color-mix(in srgb, var(--destaque) 14%, var(--sup)); }
.rk-seta { font-size: 11px; }
.rk-rot { flex: none; font-size: 14px; }
.rk-chip:active { opacity: .7; }
/* escolha de painel num botão só (abre a lista ao tocar) */
.sel-filtro { position: relative; display: inline-flex; align-self: flex-start; }
.sel-filtro select { appearance: none; -webkit-appearance: none; min-height: 42px; padding: 8px 38px 8px 15px; border-radius: 12px; border: 1px solid var(--linha); background: var(--sup2); color: var(--txt); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; }
.sel-filtro::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; font-size: 14px; }
.sel-filtro.ativo select { color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 70%, transparent); background: color-mix(in srgb, var(--destaque) 14%, var(--sup)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* padrão único de chips (pedido do dono): o mesmo dos botões de período do Ranking, menor, em todos os menus de escolha */
.filtro button, .periodo button, .rk-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 11px; border-radius: 10px;
  border: 1px solid var(--linha); background: var(--sup2); color: var(--suave); font: inherit; font-size: 13px; font-weight: 650; line-height: 1.25; cursor: pointer; }
.filtro button[aria-pressed="true"], .periodo button[aria-pressed="true"], .rk-chip[aria-pressed="true"] {
  color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 70%, transparent); background: color-mix(in srgb, var(--destaque) 14%, var(--sup)); }
.filtro button:disabled { opacity: .45; cursor: default; }
.rk-chip svg { width: 16px; height: 16px; }
.rk-ajuda { width: 22px; height: 22px; font-size: 12.5px; }
.rk .rk-tit h2 { font-size: 19px; }
.rk-rot { font-size: 13px; }
.rk-linha { gap: 6px; }
.sel-filtro select { min-height: 34px; padding: 5px 32px 5px 11px; border-radius: 10px; font-size: 13.5px; }
.sel-filtro::after { right: 11px; }
.filtro.segmento button { justify-content: center; }
@media (max-width: 640px), (pointer: coarse) {
  .filtro button, .periodo button, .rk-chip { min-height: 36px; padding: 6px 12px; }
  .sel-filtro select { min-height: 36px; font-size: 16px; }
}
@media (hover: none) {
  .filtro button:hover { color: var(--suave); border-color: var(--linha); }
  .filtro button[aria-pressed="true"]:hover { color: var(--destaque); border-color: color-mix(in srgb, var(--destaque) 70%, transparent); }
}
.rk-ligar { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--atencao); text-decoration: underline; cursor: pointer; text-align: left; }
.rk-ligar { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; border-radius: 50%; background: var(--atencao); color: var(--sobre); font-size: 12px; font-weight: 800; text-decoration: none; vertical-align: 1px; }
.rk-ligar::before { content: ""; position: absolute; inset: -10px; } /* área de toque maior */
.rk-ligar { position: relative; }
/* linha de período do Ranking: tudo numa linha só, dividindo a largura */
.rk-linha.rk-per { flex-wrap: nowrap; gap: 5px; }
.rk-per .rk-chip { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 5px 7px; font-size: 13px; }
.rk-per .rk-chip[data-rk-cal], .rk-per .rk-chip[data-rk-lupa] { flex: 0 0 36px; padding: 0; }
p.rodape[hidden] { display: none; }
.cab .rk-ajuda { flex: none; }
.cab h2 + .rk-ajuda { margin-left: -2px; margin-right: auto; }
.cab:has(h2 + .rk-ajuda) h2 { margin-right: 0; }
.rk-ajuda.solto { align-self: flex-start; }
.ajuda-tela { align-self: center; }
.h-linha.cred { stroke: var(--ruim); stroke-width: 2; }
.h-ponto.cred { fill: var(--ruim); stroke: var(--sup); stroke-width: 1.5; }
.h-linha.cred.proj { stroke-dasharray: 4 3; }
.h-ponto.cred.vazio { fill: var(--sup); stroke: var(--ruim); stroke-width: 2; }

/* chips em pílula numa linha só, rolando com o dedo para o lado (pedido do dono, com print de referência) */
.filtro, .rk-linha { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 6px; padding: 1px; }
.filtro::-webkit-scrollbar, .rk-linha::-webkit-scrollbar { display: none; }
.filtro.quebra { flex-wrap: wrap; overflow: visible; }
.filtro button, .periodo button, .rk-chip { flex: none; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.filtro.quebra button { white-space: normal; border-radius: 14px; text-align: left; }
.sel-filtro select { border-radius: 999px; }
/* linha com o calendário (e a lupa) fixos à direita; o resto rola */
.chips-fixo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chips-fixo > .filtro, .chips-fixo > .rk-linha { flex: 1 1 auto; min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 18px; }
.chips-fixo > .rk-chip { flex: none; width: 38px; padding: 0; justify-content: center; }
.filtro.segmento { overflow: visible; }
/* ano a ano em tabela compacta */
table.anos { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.anos th, table.anos td { padding: 9px 6px; border-top: 1px solid var(--linha); text-align: right; vertical-align: top; }
table.anos thead th { border-top: 0; font-size: 12px; color: var(--suave); font-weight: 600; padding-top: 0; }
table.anos tbody th { text-align: left; font-weight: 700; font-size: 15px; }
table.anos tbody th small { display: block; font-weight: 400; font-size: 11.5px; color: var(--suave); margin-top: 2px; }
table.anos td b { font-size: 14.5px; font-weight: 650; }
table.anos td .delta { margin-left: 0; font-size: 12px; }
table.anos tr.destaque th, table.anos tr.destaque td { background: color-mix(in srgb, var(--destaque) 8%, transparent); }
table.anos tr.destaque th { border-radius: 8px 0 0 8px; } table.anos tr.destaque td:last-child { border-radius: 0 8px 8px 0; }
table.anos tbody th { text-transform: none; letter-spacing: 0; color: var(--txt); border-top: 1px solid var(--linha); white-space: normal; position: static; background: none; }
table.anos thead th { text-transform: none; letter-spacing: 0; position: static; background: none; }
table.anos tr.destaque th { background: color-mix(in srgb, var(--destaque) 8%, transparent); }
/* chat flutuante menor e sem escurecer a tela: dá para tocar fora e voltar */
dialog.chat-dlg { position: fixed; inset: auto max(16px, env(safe-area-inset-right, 0px)) calc(84px + env(safe-area-inset-bottom, 0px)) auto; margin: 0; z-index: 8;
  width: min(420px, calc(100vw - 24px)); height: min(520px, 62dvh); box-shadow: var(--sombra-alta); }
@media (max-width: 640px) {
  dialog.chat-dlg { inset: auto 8px calc(132px + env(safe-area-inset-bottom, 0px)) 8px; width: auto; max-width: none; height: min(470px, 55dvh); border-radius: 16px; padding: 10px; }
}
.ltv-orig { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; font-size: 13px; line-height: 1.45; }
.ltv-orig > div { background: var(--sup2); border-radius: var(--r-md); padding: 8px 10px; }
/* ativação: situação do cliente que já tem esse M3U no Clouddy */
.atv-sit { margin: 8px 0 0; padding: 9px 12px; border-radius: var(--r-md); font-size: 14px; line-height: 1.6; background: var(--sup2); }
.atv-sit.ok { background: var(--bom-f); }
.atv-sit.ruim { background: var(--atencao-f); }
.atv-sit.livre { color: var(--suave); }

/* conversa do WhatsApp (responder pelo gestor) */
dialog.wa-dlg { padding: 0; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; border: 0; border-radius: 0; background: var(--fundo); }
dialog.wa-dlg[open] { display: flex; flex-direction: column; }
.wa-cab { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: var(--sup); border-bottom: 1px solid var(--linha); }
.wa-cab .wa-quem { flex: 1; min-width: 0; }
.wa-cab .wa-quem b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-cab .wa-quem span { font-size: 12px; color: var(--suave); }
.wa-caso { padding: 8px 12px; font-size: 13px; background: var(--sup2); border-bottom: 1px solid var(--linha); }
.wa-msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.wa-b { max-width: 82%; padding: 8px 11px; border-radius: 14px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 15px; }
.wa-b.cli { align-self: flex-start; background: var(--sup); border: 1px solid var(--linha); border-bottom-left-radius: 4px; }
.wa-b.eu { align-self: flex-end; background: var(--destaque); color: var(--sobre); border-bottom-right-radius: 4px; }
.wa-b small { display: block; font-size: 11px; opacity: .7; margin-top: 3px; text-align: right; }
.wa-dia { align-self: center; font-size: 12px; color: var(--suave); margin: 6px 0; }
.wa-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--sup); border-top: 1px solid var(--linha); }
.wa-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; }
/* assistente dentro da conversa */
dialog.wa-dlg { position: fixed; }
.wa-assist-btn { position: absolute; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 2; border-radius: 999px; padding: 10px 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.wa-assist { position: absolute; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 3; max-height: 58dvh; overflow-y: auto;
  background: var(--sup); border: 1px solid var(--linha); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 8px; }
.wa-assist h3 { margin: 0; font-size: 15px; flex: 1; }
.wa-assist ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.wa-assist .wa-resp { background: var(--sup2); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
.wa-assist .wa-aten { color: var(--ruim); }

.wa-trans summary { font-size: 12px; opacity: .8; cursor: pointer; }
.wa-trans[open] summary { margin-bottom: 3px; }

.wa-form { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
.wa-form textarea { min-width: 0; }
.wa-form .btn { flex: none; padding-left: 12px; padding-right: 12px; }

.wa-b .tique { font-weight: 700; letter-spacing: -2px; margin-left: 2px; }
.wa-b .tique.lida { color: #53bdeb; opacity: 1; }
.wa-b.eu .tique.lida { color: #b8f0ff; }
/* conversa com as cores do WhatsApp (fundo com desenhos discretos próprios, balões verdes/brancos) */
dialog.wa-dlg { --wa-fundo: #efeae2; --wa-risco: rgba(0,0,0,.05); --wa-eu: #d9fdd3; --wa-eu-txt: #111b21; --wa-cli: #ffffff; --wa-cli-txt: #111b21; --wa-hora: #667781; --wa-lida: #53bdeb; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) dialog.wa-dlg { --wa-fundo: #0b141a; --wa-risco: rgba(255,255,255,.035); --wa-eu: #005c4b; --wa-eu-txt: #e9edef; --wa-cli: #202c33; --wa-cli-txt: #e9edef; --wa-hora: #8696a0; --wa-filtro: invert(1); } }
:root[data-tema="escuro"] dialog.wa-dlg { --wa-fundo: #0b141a; --wa-risco: rgba(255,255,255,.035); --wa-eu: #005c4b; --wa-eu-txt: #e9edef; --wa-cli: #202c33; --wa-cli-txt: #e9edef; --wa-hora: #8696a0; --wa-filtro: invert(1); }
.wa-msgs { background-color: var(--wa-fundo); position: relative; }
.wa-msgs::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06; filter: var(--wa-filtro, none);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Ccircle cx='18' cy='20' r='7'/%3E%3Cpath d='M70 14l8 8-8 8-8-8z'/%3E%3Cpath d='M98 60c6-8 16-8 16 0s-10 10-16 0z'/%3E%3Crect x='28' y='70' width='14' height='10' rx='3'/%3E%3Cpath d='M64 96q8-10 16 0'/%3E%3Cpath d='M8 104h10M13 99v10'/%3E%3C/svg%3E");
  background-size: 120px 120px; background-attachment: local; }
.wa-msgs > * { position: relative; }
.wa-b.cli { background: var(--wa-cli); color: var(--wa-cli-txt); border: 0; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-b.eu { background: var(--wa-eu); color: var(--wa-eu-txt); box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-b small { color: var(--wa-hora); opacity: 1; }
.wa-b .tique { color: var(--wa-hora); }
.wa-b .tique.lida, .wa-b.eu .tique.lida { color: var(--wa-lida); }
.wa-b a { color: #027eb5; }
.wa-dia { background: var(--wa-cli); color: var(--wa-hora); padding: 3px 10px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }

/* Incidentes → Conversas: lista compacta como caixa de entrada */
.cv-lista { display: flex; flex-direction: column; border-top: 1px solid var(--linha); }
.cv-linha { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--linha); padding: 12px 4px; color: var(--txt); font: inherit; cursor: pointer; }
.cv-linha:active { background: var(--sup2); }
.cv-av { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--sup2); display: grid; place-items: center; font-weight: 700; color: var(--suave); }
.cv-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cv-top { display: flex; justify-content: space-between; gap: 8px; }
.cv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-top .suave { flex: none; font-size: 12px; }
.cv-prev { color: var(--suave); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.cv-tags .selo { font-size: 11px; }
.selo.roxo { background: color-mix(in srgb, #8b5cf6 22%, transparent); color: #b79cff; }

.cv-linha { user-select: none; }
.cv-tags .cv-ok { margin-left: auto; min-height: 30px; padding: 3px 10px; font-size: 12px; }

.cv-chk { flex: none; display: grid; place-items: center; width: 28px; min-height: 42px; cursor: pointer; }
.cv-chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--destaque); }
.cab .cv-chk { min-height: auto; width: 26px; }
.cv-linha.sel { background: color-mix(in srgb, var(--destaque) 10%, transparent); }
.sel-barra { position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--sup); border: 1px solid var(--destaque); border-radius: var(--r-md); padding: 8px 12px; margin: 8px 0; }
.sel-barra span { margin-right: auto; }

.sit-chips button[aria-pressed="true"] { background: var(--bom-f); color: var(--bom); border-color: var(--bom); }

/* imagem/comprovante aberto por cima da conversa */
.wa-luz { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top, 0px)) 10px calc(16px + env(safe-area-inset-bottom, 0px)); }
.wa-luz-topo { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; display: flex; gap: 8px; }
.wa-luz img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.wa-luz iframe { width: min(900px, 100%); height: 100%; border: 0; background: #fff; border-radius: 6px; }

.wa-sug { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 0; background: var(--sup); scrollbar-width: none; }
.wa-sug button { flex: none; max-width: 78%; white-space: normal; text-align: left; font: inherit; font-size: 13px; line-height: 1.3; background: var(--sup2); color: var(--txt); border: 1px solid var(--linha); border-radius: 14px; padding: 7px 11px; cursor: pointer; }

.cv-av { position: relative; overflow: hidden; }
.cv-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.wa-lista { display: flex; flex-direction: column; margin: 4px 0 8px; }
.wa-linha { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--linha); flex-wrap: wrap; }
.wa-linha b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.wa-linha .suave { font-size: 13px; }
.wa-linha .btn { margin-left: auto; min-height: 32px; padding: 2px 12px; }
.pt { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--suave); }
.pt.ok { background: var(--bom); } .pt.atencao { background: var(--atencao); }

.wa-av { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sup2); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--suave); }
.wa-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.wa-av .pt { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid var(--sup); }
.wa-cab-av { width: 38px; height: 38px; font-size: 15px; }

.wa-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wa-tile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 8px 10px; border: 1px solid var(--linha); border-radius: 14px; background: var(--sup2); min-width: 0; }
.wa-tile.aberto { grid-column: 1 / -1; }
.wa-tile .wa-av { width: 52px; height: 52px; font-size: 20px; margin-bottom: 4px; }
.wa-tile b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-tile .suave { font-size: 12px; }
.wa-tile-menu { position: absolute; top: 6px; right: 6px; min-height: 28px !important; padding: 0 8px !important; }
.wa-tile-acoes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
