/* Escopo exclusivo de Gerar ficha; o #main continua sendo o único scroll vertical.
   A barra superior é medida pelo instalador para não cobrir o cabeçalho da tabela. */
@media screen {
  #main:has(#ger-pac-lista) .ger-topo {
    position:sticky;top:0;z-index:8;background:var(--card,#fff)!important;
    padding:8px 0 10px;isolation:isolate;box-shadow:0 -30px 0 var(--paper,#e8eef5);
  }
  #main:has(#ger-pac-lista) .ger-layout.passo-2 {display:flex;flex-direction:column;gap:16px}
  #main:has(#ger-pac-lista) .ger-layout.passo-2 .ger-controls {
    position:static;width:100%!important;max-width:none;min-width:0;flex:1 1 auto;padding-right:0;
  }
  #main:has(#ger-pac-lista) .ger-layout.passo-2 .resize-handle {display:none}
  #main:has(#ger-pac-lista) #ger-etapa-2>.card {overflow:visible}
  #main:has(#ger-pac-lista) .ger-layout.passo-2 .ger-preview-pane {width:100%;flex:0 0 auto;min-width:0}
  #main:has(#ger-pac-lista) #ger-pac-lista {height:auto;max-height:none!important;overflow:visible!important}
  #main:has(#ger-pac-lista) table.gerpac thead th {
    position:sticky;top:var(--rv-generation-top-height,130px);z-index:3;
    background:var(--card,#fff)!important;box-shadow:0 1px 0 var(--line-strong,#d9e0eb);
  }
  #main:has(#ger-pac-lista) table.gerpac td {white-space:normal;overflow-wrap:anywhere}
  #main:has(#ger-pac-lista) .rv-generation-summary {
    border:1px solid var(--line,#d9e0eb);border-radius:12px;background:var(--card,#fff);padding:14px 18px;
  }
  #main:has(#ger-pac-lista) .rv-generation-summary>summary {cursor:pointer;font-weight:600;font-size:12px;color:var(--ink,#1b2447)}
  #main:has(#ger-pac-lista) .rv-generation-summary[open]>summary {margin-bottom:18px}
  #main:has(#ger-pac-lista) .ger-passo {transition:color .25s ease,background .25s ease}
  #main:has(#ger-pac-lista) .ger-passo::before {
    background:#f58220;transform:scaleX(0);transform-origin:left center;
    transition:transform .45s cubic-bezier(.2,.7,.2,1);
  }
  #main:has(#ger-pac-lista) .ger-passo.feito::before,
  #main:has(#ger-pac-lista) .ger-passo.on::before {transform:scaleX(1)}
  #main:has(#ger-pac-lista) .ger-passo:is(.feito,.on),
  #main:has(#ger-pac-lista) .ger-passo .ck {color:#241304}
  #main:has(#ger-pac-lista) .ger-passo.on {box-shadow:inset 0 -3px 0 #a34700}
}
@media screen and (min-width:701px) {
  #main:has(#ger-pac-lista) table.gerpac th:nth-child(2) {width:46%}
  #main:has(#ger-pac-lista) table.gerpac th:is(:nth-child(1),:nth-child(n+4)) {width:1%;white-space:nowrap}
  #main:has(#ger-pac-lista) table.gerpac td:is(:nth-child(n+4)) {white-space:nowrap;overflow-wrap:normal}
  #main:has(#ger-pac-lista) table.gerpac td.nome {overflow-wrap:normal}
}
@media screen and (max-width:700px) {
  /* O nativo troca a tabela por cartões no celular. Não prendemos esse conjunto
     de ordenação nem a barra de ações, que ocupariam boa parte da tela. */
  #main:has(#ger-pac-lista) .ger-topo {position:static;box-shadow:none}
  #main:has(#ger-pac-lista) table.gerpac thead th {position:static}
  #main:has(#ger-pac-lista) .ger-controls {min-width:0}
}
@media (prefers-reduced-motion:reduce) {
  #main:has(#ger-pac-lista) .ger-passo,
  #main:has(#ger-pac-lista) .ger-passo::before,
  #main:has(#ger-pac-lista) .ger-passo .ck {transition:none!important;animation:none!important}
}
