.msg-fab { position: fixed; z-index: 60; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--green); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.msg-fab:hover { background: #2FB76F; }
.msg-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.msg-fab[aria-expanded="true"] { background: var(--ink); color: var(--green); }
.msg-fab svg { width: 26px; height: 26px; }

.msg-fab { transition: transform 0.2s ease, opacity 0.2s ease; }
.msg-fab.recolhido { transform: translateY(calc(100% + 32px + env(safe-area-inset-bottom, 0px))); opacity: 0; pointer-events: none; }
.msg-fab.recolhido:focus-visible { transform: none; opacity: 1; pointer-events: auto; }

.rodape { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

.msg-painel, .msg-folha { background: #FFFFFF; color: var(--ink); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain;
  border-top: 4px solid var(--green); }

.msg-painel { position: fixed; z-index: 70; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: 384px; max-height: calc(100vh - 116px); padding: 18px 20px 16px; border: 1.5px solid var(--ink); border-top: 4px solid var(--green); }
.msg-fundo { position: fixed; z-index: 80; inset: 0; background: rgba(3, 48, 77, 0.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.msg-folha { width: 100%; max-width: 640px; max-height: calc(100vh - 48px); padding: 22px 26px 20px; }
.msg-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.msg-cab h2 { margin: 0; font-size: 19px; line-height: 1.2; }
.msg-folha .msg-cab h2 { font-size: 24px; }
.msg-fechar { flex-shrink: 0; width: 44px; height: 44px; margin: -10px -12px 0 0; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.msg-fechar:hover { color: var(--green-t); }
.msg-intro { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.msg-form { display: flex; flex-direction: column; gap: 12px; }
.msg-par { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.msg-rotulo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.msg-rotulo label { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink2); }
.msg-opcional { font-weight: 500; color: var(--muted); }
.msg-conta { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.msg-conta.perto { color: var(--erro); }
.msg-area { height: auto; min-height: 112px; padding: 10px; line-height: 1.45; font-weight: 500; resize: vertical; }
.msg-folha .msg-area { min-height: 140px; }
.msg-form .entrada[aria-invalid="true"], .msg-form .selecao[aria-invalid="true"] { border-color: var(--erro); }
.msg-erro-campo { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--erro); }
.msg-consent { display: flex; flex-direction: column; gap: 0; }
.msg-consent .marcar { align-items: flex-start; min-height: 0; padding: 4px 0; line-height: 1.4; }
.msg-consent .marcar input { margin-top: 1px; }
.msg-consent input[aria-invalid="true"] { outline: 2px solid var(--erro); outline-offset: 2px; }
.msg-link-priv, .msg-consent .msg-erro-campo { padding-left: 30px; }
.msg-link-priv a { font-weight: 700; }
.msg-rota { margin: 0; }
.msg-rota span { font-weight: 700; color: var(--ink2); }
.msg-acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msg-falha { margin: 0; padding: 10px 12px; font-size: 14px; line-height: 1.45; background: var(--erro-bg); color: var(--erro); font-weight: 600; }
.msg-ok { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--tint); }
.msg-ok-titulo { margin: 0; font-size: 19px; line-height: 1.25; color: var(--ink); }
.msg-ok-titulo:focus { outline: none; }
.msg-ok-teste { margin: 0; color: var(--ink2); }
.msg-pe { margin: 0; padding-top: 8px; border-top: 1px solid var(--hair); }
.msg-pe .link-botao { min-height: 36px; font-size: 13px; text-align: left; }

.msg-pote { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media screen and (max-width: 760px) {
  .msg-fab { width: 44px; height: 44px; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .msg-fab svg { width: 21px; height: 21px; }
  .rodape { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

  .msg-painel { left: calc(8px + env(safe-area-inset-left, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 16px 16px 14px; }
  .msg-fundo { align-items: flex-end; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .msg-folha { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 18px 16px 16px; }
  .msg-folha .msg-cab h2 { font-size: 21px; }
  .msg-par { grid-template-columns: minmax(0, 1fr); }
  .msg-cab h2 { font-size: 18px; }
}

@media print {
  .msg-raiz { display: none !important; }
}
