/* r166 · Rob.i discreto: um botão de vidro no canto de baixo à direita, com o número de chamados; o painel só abre no
   toque. Vidro só no que flutua (botão e painel); os cartões dentro do painel ficam em fundo sólido para a leitura.
   Cores do briefing: verde Wambak #0F4D3A, texto #14201B e #5E6A65. Toque mínimo de 44 px. */
.r166-dock {
  --r166-verde: #0F4D3A; --r166-texto: #14201B; --r166-texto2: #5E6A65; --r166-linha: rgba(20, 32, 27, .08);
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 9999;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--r166-texto); -webkit-font-smoothing: antialiased;
}
.r166-dock.vazio { display: none; }
.r166-dock [hidden] { display: none !important; }

/* ---------- o botão */
.r166-robi {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 48px; height: 48px; padding: 0 14px 0 12px; border-radius: 24px; cursor: pointer;
  color: var(--r166-verde); font: inherit;
  background: rgba(255, 255, 255, .58);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 8px 28px rgba(20, 32, 27, .16), 0 1px 2px rgba(20, 32, 27, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, background .25s ease;
}
.r166-robi:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(20, 32, 27, .2), 0 1px 2px rgba(20, 32, 27, .08), inset 0 1px 0 rgba(255, 255, 255, .8); }
.r166-robi:active { transform: scale(.96); }
.r166-robi:focus-visible { outline: 3px solid rgba(15, 77, 58, .35); outline-offset: 3px; }
.r166-dock.aberto .r166-robi { background: rgba(255, 255, 255, .82); }
.r166-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.r166-n {
  min-width: 22px; height: 22px; padding: 0 7px; box-sizing: border-box; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--r166-verde); color: #fff; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.r166-robi.so-rascunho .r166-n { background: rgba(15, 77, 58, .12); color: var(--r166-verde); }
.r166-ponto { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--r166-verde); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.r166-robi.pulsa::after {
  content: ""; position: absolute; inset: -5px; border-radius: 29px; border: 2px solid rgba(15, 77, 58, .45);
  animation: r166-pulso 1.25s cubic-bezier(.2, .8, .2, 1) 2; pointer-events: none;
}
@keyframes r166-pulso { from { opacity: .9; transform: scale(.94); } to { opacity: 0; transform: scale(1.18); } }

/* ---------- o painel */
.r166-painel {
  width: 368px; max-width: calc(100vw - 32px); max-height: min(72vh, 580px); box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px;
  background: rgba(246, 249, 247, .78);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 28px 70px rgba(20, 32, 27, .24), 0 2px 6px rgba(20, 32, 27, .08), inset 0 1px 0 rgba(255, 255, 255, .85);
  transform-origin: 100% 100%; animation: r166-abre .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes r166-abre { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.r166-cab { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px 18px; }
.r166-tit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.r166-tit b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.r166-sub { font-size: 12.5px; color: var(--r166-texto2); }
.r166-fechar, .r166-ocultar {
  flex: none; width: 40px; height: 40px; border-radius: 20px; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--r166-texto2);
  transition: background .2s ease, color .2s ease;
}
.r166-fechar:hover, .r166-ocultar:hover { background: rgba(20, 32, 27, .06); color: var(--r166-texto); }
.r166-ico-x { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.r166-ocultar { width: 32px; height: 32px; margin: -6px -6px -6px 0; }
.r166-lista { overflow-y: auto; overscroll-behavior: contain; padding: 2px 10px 6px; display: flex; flex-direction: column; gap: 8px; }
.r166-item {
  background: #fff; border-radius: 18px; padding: 12px 14px 12px; box-shadow: 0 1px 2px rgba(20, 32, 27, .05), 0 0 0 1px var(--r166-linha);
  animation: r166-item .24s ease-out; transition: opacity .3s ease;
}
@keyframes r166-item { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.r166-item.feito { opacity: .6; }
.r166-item-topo { display: flex; align-items: center; gap: 8px; }
.r166-item-topo b { flex: 0 1 auto; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r166-funcao { flex: 1; min-width: 0; font-size: 12px; color: var(--r166-texto2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r166-pergunta {
  margin: 5px 0 10px; font-size: 13.5px; line-height: 1.42; color: var(--r166-texto);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.r166-pergunta.r166-livre { display: block; white-space: pre-line; }
.r166-item.com-resp .r166-pergunta { -webkit-line-clamp: 6; }
.r166-resumo { background: #F3F8F5; box-shadow: 0 0 0 1px rgba(15, 77, 58, .14); }
.r166-acoes { display: flex; align-items: center; gap: 6px; }
.r166-responder {
  height: 36px; padding: 0 16px; border-radius: 18px; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  background: var(--r166-verde); color: #fff; transition: filter .2s ease, transform .15s ease;
}
.r166-responder:hover { filter: brightness(1.12); }
.r166-responder:active { transform: scale(.97); }
.r166-responder.r166-claro { background: rgba(15, 77, 58, .1); color: var(--r166-verde); }
.r166-abrir, .r166-link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 18px;
  color: var(--r166-verde) !important; font-size: 13.5px; font-weight: 500; text-decoration: none !important;
}
.r166-abrir:hover, .r166-link:hover { background: rgba(15, 77, 58, .07); }
.r166-responder:focus-visible, .r166-abrir:focus-visible, .r166-link:focus-visible, .r166-enviar:focus-visible,
.r166-fechar:focus-visible, .r166-ocultar:focus-visible { outline: 3px solid rgba(15, 77, 58, .35); outline-offset: 2px; }
.r166-resp { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.r166-resp textarea {
  width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical; border-radius: 14px; padding: 10px 12px;
  border: 1px solid #DDE3E0; background: #fff; color: var(--r166-texto); font: inherit; font-size: 14px; line-height: 1.4;
}
.r166-resp textarea:focus { outline: none; border-color: var(--r166-verde); box-shadow: 0 0 0 3px rgba(15, 77, 58, .14); }
.r166-resp-linha { display: flex; align-items: center; gap: 10px; }
.r166-enviar {
  height: 36px; padding: 0 18px; border-radius: 18px; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  background: var(--r166-verde); color: #fff;
}
.r166-enviar:disabled { opacity: .55; cursor: default; }
.r166-res { flex: 1; min-width: 0; font-size: 12.5px; color: var(--r166-texto2); }
.r166-vazio { margin: 18px 8px 22px; text-align: center; font-size: 13.5px; color: var(--r166-texto2); }
.r166-rodape { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px 10px 8px; border-top: 1px solid var(--r166-linha); }
.r166-todos { margin-left: auto; }

/* sem vidro no navegador: fundo sólido, para não perder leitura */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .r166-robi { background: rgba(255, 255, 255, .96); }
  .r166-painel { background: rgba(246, 249, 247, .98); }
}

/* celular: o painel vira uma folha de baixo, com áreas de toque de 44 px */
@media (max-width: 600px) {
  .r166-dock { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .r166-painel {
    position: fixed; left: 8px; right: 8px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px);
    width: auto; max-width: none; max-height: 70vh;
  }
  .r166-responder, .r166-enviar, .r166-abrir, .r166-link { height: 44px; border-radius: 22px; }
  .r166-fechar { width: 44px; height: 44px; border-radius: 22px; }
  .r166-ocultar { width: 44px; height: 44px; border-radius: 22px; margin: -10px -10px -10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .r166-robi, .r166-painel, .r166-item { animation: none !important; transition: none !important; }
  .r166-robi.pulsa::after { animation: none; }
}
@media print { .r166-dock { display: none !important; } }
