/* vs-folha.css — folha que sobe de baixo (assets/js/vs-folha.js). Genérico. PADRÕES 20.11 e 20.12.
   Cores por token do projeto, com valor de reserva: --bg-card, --bg-main, --bg-hover, --overlay-bg, --shadow-color-forte,
   --card-border-color, --text-main, --text-secondary. Largura no celular: --vs-folha-largura (640px).
   Carregue ANTES do CSS do app, pra ele poder ajustar. */
.vs-folha-fundo {
  position: fixed; inset: 0; z-index: 1050;
  background: var(--overlay-bg, rgba(15, 20, 30, .45));
  opacity: 0; transition: opacity .2s ease;
  touch-action: none;   /* arrastar no fundo não rola a tela de trás */
}
.vs-folha-fundo.visivel { opacity: 1; }
.vs-folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060;
  max-width: var(--vs-folha-largura, 640px); margin: 0 auto;
  max-height: 88vh; overflow-y: auto;
  overscroll-behavior: contain;   /* rolar até o fim da folha não passa pra tela de trás */
  padding: .6rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card, #fff);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 40px -12px var(--shadow-color-forte, rgba(15, 20, 30, .18));
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.vs-folha.visivel { transform: translateY(0); }
/* Pegador: arrastar pra baixo fecha. Preso no topo mesmo com o conteúdo rolado, e o toque nele nunca vira rolagem. */
.vs-folha-pegador {
  position: sticky; top: -.6rem; z-index: 2;
  margin: -.6rem -1.25rem .4rem; padding: .75rem 0 .65rem;
  display: flex; justify-content: center;
  background: var(--bg-card, #fff);
  touch-action: none; cursor: grab;
}
.vs-folha-pegador::before { content: ''; width: 44px; height: 5px; border-radius: 5px; background: var(--card-border-color, #dcdfe6); }
.vs-folha-pegador:active { cursor: grabbing; }
/* Com a folha aberta a tela de trás não rola. No html: é ele que vale pra janela (no body a trava pode não pegar). */
html.vs-folha-aberta { overflow: hidden; }
.vs-folha-fechar { display: none; }   /* o X só existe no computador (no celular fecha arrastando / no fundo / no voltar) */
.vs-folha h2 { font-size: 1.12rem; font-weight: 800; margin: 0 0 .4rem; }
.vs-folha p { color: var(--text-secondary, #5b6170); font-size: .93rem; }
.vs-folha-botoes { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.1rem; }
.vs-folha-botoes .btn { min-height: 52px; border-radius: 14px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .vs-folha, .vs-folha-fundo { transition: none; } }

/* Computador: janela no meio da tela (fecha no X, no Esc ou clicando fora). PADRÕES 20.12. */
@media (min-width: 992px) {
  .vs-folha {
    top: 50%; right: auto; bottom: auto; left: 50%;
    width: min(560px, calc(100vw - 4rem)); max-width: none; max-height: min(88vh, 900px);
    margin: 0; padding: 1.6rem 1.75rem 1.75rem;
    border-radius: 22px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5), 0 0 0 1px var(--card-border-color, #dcdfe6);
    opacity: 0; transform: translate(-50%, -47%) scale(.97);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
  }
  .vs-folha.visivel { opacity: 1; transform: translate(-50%, -50%); }
  .vs-folha-pegador { display: none; }
  .vs-folha-fechar {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: .9rem; right: .9rem; z-index: 3;
    width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--bg-main, #f3f4f7); color: var(--text-secondary, #5b6170);
    transition: background .15s ease, color .15s ease;
  }
  .vs-folha-fechar:hover, .vs-folha-fechar:focus-visible { background: var(--bg-hover, #e8eaf0); color: var(--text-main, #1b1f2a); }
  .vs-folha > h2 { padding-right: 2.75rem; }
  .vs-folha-botoes { flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; }
  .vs-folha-botoes .btn { min-height: 46px; padding: 0 1.3rem; }
}
