/* Visor de PDF em modal (painel e portal) — publico/js/visor_pdf.js */
.vpdf { --vpdf-cor: var(--c-primaria, #1e4fa8); position:fixed; inset:0; z-index:100000; background:rgba(15, 23, 42, .62); display:flex; align-items:center; justify-content:center; padding:16px; }
.vpdf[hidden] { display:none; }
html.vpdf-aberto, html.vpdf-aberto body { overflow:hidden; }
.vpdf__caixa { background:#fff; width:min(1180px, 100%); height:min(94vh, 100%); border-radius:14px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 64px rgba(0,0,0,.35); font-family:inherit; color:#111827; }
.vpdf__topo { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:10px 12px 10px 18px; border-bottom:1px solid #E5E7EB; flex:none; }
.vpdf__titulo { flex:1 1 160px; min-width:0; margin:0; font-size:16px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#111827; }
.vpdf__acoes { display:flex; align-items:center; gap:8px; flex:none; }
.vpdf__btn { display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 14px; border-radius:10px; border:1px solid #D1D5DB; background:#fff; color:#1F2937 !important;
  font:inherit; font-size:14px; font-weight:600; cursor:pointer; text-decoration:none !important; }
.vpdf__btn:hover { background:#F3F4F6; }
.vpdf__btn--primario { background:var(--vpdf-cor); border-color:var(--vpdf-cor); color:#fff !important; }
.vpdf__btn--primario:hover { filter:brightness(.95); background:var(--vpdf-cor); }
.vpdf__btn[hidden], .vpdf__fechar[hidden] { display:none; }
.vpdf__fechar { width:40px; height:40px; border-radius:10px; border:0; background:#F3F4F6; color:#111827; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.vpdf__btn:focus-visible, .vpdf__fechar:focus-visible, .vpdf__op:focus-visible, .vpdf__graficos:focus-within { outline:3px solid #1e4fa8; outline-offset:2px; }

.vpdf__opcoes { display:flex; flex-wrap:wrap; gap:8px; align-items:center; flex:none; }
.vpdf__opcoes[hidden] { display:none; }
.vpdf__grupo { display:inline-flex; gap:2px; padding:2px; background:#E5E7EB; border-radius:9px; }
.vpdf__op { display:inline-flex; align-items:center; gap:6px; border:0; background:transparent; border-radius:7px; padding:0 10px; min-height:32px;
  cursor:pointer; font:inherit; font-size:13px; font-weight:600; color:#4B5563; }
.vpdf__op[aria-pressed=true] { background:#fff; color:#111827; box-shadow:0 1px 2px rgba(0,0,0,.14); }
.vpdf__op-ico { width:10px; height:13px; border:1.5px solid currentColor; border-radius:2px; flex:none; opacity:.7; }
.vpdf__op--orientacao-paisagem .vpdf__op-ico { width:14px; height:10px; }
.vpdf__op--papel-A3 .vpdf__op-ico { width:12px; height:15px; }
.vpdf__op[aria-pressed=true] .vpdf__op-ico { color:var(--vpdf-cor); opacity:1; }
.vpdf__graficos { display:inline-flex; align-items:center; gap:6px; padding:0 10px; min-height:36px; border:1px solid #D1D5DB; border-radius:9px; background:#fff;
  cursor:pointer; font-size:13px; font-weight:600; color:#374151; white-space:nowrap; }
.vpdf__curto { display:none; }
.vpdf__graficos input { width:16px; height:16px; accent-color:var(--vpdf-cor); margin:0; }

.vpdf__corpo { flex:1; min-height:0; position:relative; background:#E5E7EB; }
.vpdf__quadro { width:100%; height:100%; border:0; display:block; background:#E5E7EB; }
.vpdf__quadro[hidden], .vpdf__paginas[hidden], .vpdf__erro[hidden], .vpdf__carregando[hidden] { display:none; }
.vpdf__paginas { position:absolute; inset:0; overflow:auto; padding:8px; display:flex; flex-direction:column; align-items:center; gap:10px; -webkit-overflow-scrolling:touch; }
.vpdf__paginas canvas { background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.18); max-width:100%; height:auto; }
.vpdf__carregando { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:#374151; font-weight:600; }
.vpdf__giro { width:36px; height:36px; border-radius:50%; border:4px solid #CBD5E1; border-top-color:var(--vpdf-cor); animation:vpdf-giro .8s linear infinite; }
@keyframes vpdf-giro { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vpdf__giro { animation:none; } }
.vpdf__erro { margin:24px auto; max-width:520px; background:#FEF2F2; color:#991B1B; border:1px solid #FECACA; border-radius:10px; padding:14px 16px; }

/* celular: tela cheia, como aplicativo; ações com ícone e rótulo curto */
@media (max-width: 760px) {
  .vpdf { padding:0; }
  .vpdf__caixa { width:100%; height:100%; border-radius:0; }
  .vpdf__topo { padding:8px 8px 8px 14px; gap:6px; }
  .vpdf__titulo { font-size:15px; }
  .vpdf__btn { padding:0 10px; }
  .vpdf__btn:not(.vpdf__btn--primario) span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .vpdf__opcoes { order:3; flex-basis:100%; gap:6px; flex-wrap:nowrap; }
  .vpdf__grupo { flex:1 1 auto; }
  .vpdf__op { flex:1; justify-content:center; padding:0 6px; font-size:12.5px; }
  .vpdf__op-ico { display:none; }
  .vpdf__graficos { flex:none; padding:0 8px; font-size:12.5px; }
  .vpdf__longo { display:none; } .vpdf__curto { display:inline; }
}
@media print { .vpdf { display:none !important; } }
