/* ============================================================================
   ALY FIT · FASE 52 — EDITOR EM MODO CONFORTÁVEL (isolado e reversível)
   09/09/2026 · só CSS · não toca banco, prescrição, IDs, sessões nem regras
   ----------------------------------------------------------------------------
   MEDIDO NA TELA SERVIDA ANTES DE MEXER (ficha ZZ52, 9 exercícios, vp 2048):
     .session-ex-row .............. 13px, sem separação entre linhas (mb 0)
     .n (nome do exercício) ....... 13px, peso 400
     .ord (número) ................ 12px, #7e90ab
     .qf-label-text (rótulos) ..... 10px  ← Séries/Reps/Carga/Descanso
     .qf-hint / .c43-selo-sub ..... 10,5px
     campos da prescrição ......... altura 38px, 14,5px
     botões − / + das séries ...... 10×34px
     .fb-layout ................... 1004,65px + 360px, gap 28px
     .exlib-sidebar ............... 360px, sem rolagem própria (overflow visible)
   ESCOPO: só dentro de #fichaBuilderView. Nenhum outro módulo é afetado.
   REVERSÍVEL: tudo depende de `html:not(.c52-off)`.
     desligar → window.__C52.off()   ligar → window.__C52.on()
   A Biblioteca recolhida é a classe `c52-lib-off` no <html> (a fase52 .js
   guarda a escolha; nada é removido do DOM, então busca e filtros ficam).
   ========================================================================== */

/* ------------------------------------------------ 1. MODO CONFORTÁVEL */
html:not(.c52-off) #fichaBuilderView{
  font-size: 15px !important;
  padding-bottom: 120px !important;   /* a barra preta não cobre o último item */
}
html:not(.c52-off) #fichaBuilderView .session-ex-row{
  font-size: 15px !important;
  padding: 16px 12px !important;
  border-top: 1px solid rgba(207, 220, 236, .16) !important;
}
html:not(.c52-off) #fichaBuilderView .session-ex-row:first-of-type{
  border-top: 0 !important;
}
html:not(.c52-off) #fichaBuilderView .ex-row-top{
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}
html:not(.c52-off) #fichaBuilderView .ord{
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #cfdcec !important;
  min-width: 26px !important;
}
html:not(.c52-off) #fichaBuilderView .n{
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #f4f7fb !important;
}

/* rótulos permanentes dos quatro campos, com contraste forte */
html:not(.c52-off) #fichaBuilderView .qf-label-text{
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #cfdcec !important;
  letter-spacing: .01em !important;
  display: block !important;
  margin-bottom: 4px !important;
}
html:not(.c52-off) #fichaBuilderView .qf-hint,
html:not(.c52-off) #fichaBuilderView .c43-selo-sub{
  font-size: 12px !important;
  color: #b6c6da !important;
}

/* campos: 44px de altura e valor em 16px */
html:not(.c52-off) #fichaBuilderView .ex-row-quick input,
html:not(.c52-off) #fichaBuilderView .ex-row-quick select,
html:not(.c52-off) #fichaBuilderView .session-ex-row input,
html:not(.c52-off) #fichaBuilderView .session-ex-row select{
  min-height: 44px !important;
  font-size: 16px !important;
  padding: 10px 12px !important;
  line-height: 1.3 !important;
}
html:not(.c52-off) #fichaBuilderView .ex-row-quick{
  gap: 14px !important;
  row-gap: 12px !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
}

/* botões: nunca abaixo de 14px, alvo confortável */
html:not(.c52-off) #fichaBuilderView button{
  font-size: 14px !important;
}
html:not(.c52-off) #fichaBuilderView .ex-row-quick button{
  min-height: 44px !important;
  min-width: 44px !important;
  font-size: 16px !important;
  padding: 8px 12px !important;
}
/* − / + das séries: eram 10×34 */
html:not(.c52-off) #fichaBuilderView .ex-row-quick button:is([data-passo], .qf-step, .btn-mini){
  min-width: 46px !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

/* ações secundárias não competem com os campos principais */
html:not(.c52-off) #fichaBuilderView .acts{
  gap: 8px !important;
  opacity: .82 !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
}
html:not(.c52-off) #fichaBuilderView .acts .icon-btn,
html:not(.c52-off) #fichaBuilderView .acts button{
  min-width: 38px !important;
  min-height: 38px !important;
  font-size: 15px !important;
}
html:not(.c52-off) #fichaBuilderView .acts:hover{ opacity: 1 !important; }

/* segunda linha: substituições e bi-set legíveis */
html:not(.c52-off) #fichaBuilderView .c43-subs{
  font-size: 13.5px !important;
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px dashed rgba(207, 220, 236, .14) !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
html:not(.c52-off) #fichaBuilderView .c43-subs button{
  min-height: 38px !important;
  font-size: 13.5px !important;
}

/* cabeçalho da sessão */
html:not(.c52-off) #fichaBuilderView .session-head-input{
  min-height: 44px !important;
  font-size: 15px !important;
}
html:not(.c52-off) #fichaBuilderView .session-ex-header{
  font-size: 13px !important;
  color: #cfdcec !important;
}

/* --------------------------------- 2. ÁREA DE PRESCRIÇÃO MAIOR */
html:not(.c52-off) #fichaBuilderView .fb-layout{
  grid-template-columns: minmax(0, 1fr) 340px !important;
  gap: 28px !important;
  max-width: 100% !important;
}
html:not(.c52-off) #fichaBuilderView .fb-main{
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* --------------------------------- 3. BIBLIOTECA RECOLHÍVEL */
html:not(.c52-off) #fichaBuilderView .exlib-sidebar{
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
  max-height: calc(100vh - 170px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
/* recolhida: a prescrição toma a largura toda. O painel continua no DOM,
   só oculto — busca, filtros e rolagem ficam exatamente como estavam. */
html.c52-lib-off:not(.c52-off) #fichaBuilderView .fb-layout{
  grid-template-columns: minmax(0, 1fr) !important;
}
html.c52-lib-off:not(.c52-off) #fichaBuilderView .exlib-sidebar{
  display: none !important;
}
#c52LibBtn{
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #9fb3c8;
  background: #ffffff;
  color: #12243b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#c52LibBtn:hover{ background: #dce9f7; border-color: #4a7fb5; }
#c52LibBtn:focus-visible{ outline: 3px solid #1d6fd0; outline-offset: 2px; }

/* tela sem espaço: a Biblioteca vira painel lateral sobreposto, e a ficha
   nunca é espremida numa coluna estreita */
@media (max-width: 1200px){
  html:not(.c52-off) #fichaBuilderView .fb-layout{
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html:not(.c52-off):not(.c52-lib-off) #fichaBuilderView .exlib-sidebar{
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 360px !important;
    max-height: none !important;
    z-index: 60 !important;
    box-shadow: -10px 0 30px rgba(0,0,0,.45) !important;
    border-radius: 0 !important;
  }
}

/* ------------------- 4. MARGENS LATERAIS: a ficha usa a largura de verdade */
/* medido: #fichaBuilderView tinha 46,08px de padding lateral e -25,6px de
   margem esquerda, o que sobrava 1393px de layout dentro de 1485px uteis.
   Com a Biblioteca em 320px e 28px de respiro, a prescricao passa de 74%
   para ~76% da largura. */
html:not(.c52-off) #fichaBuilderView{
  padding-left: 8px !important;
  padding-right: 8px !important;
  margin-left: 0 !important;
}
html:not(.c52-off) #fichaBuilderView .fb-layout{
  grid-template-columns: minmax(0, 1fr) 320px !important;
}
@media (min-width: 1700px){
  html:not(.c52-off) #fichaBuilderView .fb-layout{
    grid-template-columns: minmax(0, 1fr) 340px !important;
  }
}
