/* Vida & Saúde | Painel do Fitoterapeuta | V235
   Passada conjunta desktop + mobile sobre a V234.
   Foco: estabilidade visual em estados reais/carregamento e refinamento dos
   heróis móveis que ainda apresentavam compressão ou invasão decorativa.
   Sem zoom, sem transform:scale e sem alteração dos fluxos funcionais. */

/* Evita que qualquer conteúdo variável force tracks maiores que o workspace. */
body.professional-visual-v235 .professional-section,
body.professional-visual-v235 .professional-section > *,
body.professional-visual-v235 .professional-panel{
  min-width:0!important;
  box-sizing:border-box!important;
}

/* Estados transitórios não podem colapsar áreas que depois recebem conteúdo real. */
body.professional-visual-v235 #professional-attendances .v199-highlight-host:empty{
  position:relative!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
}
body.professional-visual-v235 #professional-attendances .v199-highlight-host:empty::before{
  content:"Carregando próximo atendimento";
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  z-index:2!important;
  transform:translate(-50%,-50%)!important;
  color:#f0dfb5!important;
  font:600 12px/1.25 Arial,"Helvetica Neue",sans-serif!important;
  letter-spacing:.01em!important;
  white-space:nowrap!important;
  opacity:.86!important;
}
body.professional-visual-v235 #professional-guidance > [data-guidance168-host]:empty,
body.professional-visual-v235 #professional-finance [data-finance169-root]:empty{
  position:relative!important;
  min-height:620px!important;
  border-radius:16px!important;
  background:
    linear-gradient(90deg,rgba(236,229,217,.52) 0 24%,transparent 24% 26%,rgba(236,229,217,.38) 26% 72%,transparent 72% 74%,rgba(236,229,217,.32) 74% 100%) 0 225px/100% 112px no-repeat,
    linear-gradient(#0b493f,#07372f) 0 0/100% 205px no-repeat,
    #fbf8f2!important;
}
body.professional-visual-v235 #professional-guidance > [data-guidance168-host]:empty::after,
body.professional-visual-v235 #professional-finance [data-finance169-root]:empty::after{
  content:"Carregando dados protegidos...";
  position:absolute!important;
  left:24px!important;
  top:28px!important;
  z-index:2!important;
  color:#f0dfb5!important;
  font:600 12px/1.25 Arial,"Helvetica Neue",sans-serif!important;
  opacity:.82!important;
}

/* =========================================================
   DESKTOP PRINCIPAL 1448x1086
   Microfit sem tocar nos motores de dados.
   ========================================================= */
@media (min-width:1440px) and (max-width:1535px) and (min-height:1000px){
  /* Mantém títulos e subtítulos no mesmo eixo visual em todas as 13 áreas. */
  body.professional-visual-v235 .professional-header-context{
    width:300px!important;
    min-width:300px!important;
    max-width:300px!important;
  }
  body.professional-visual-v235 .professional-header-title{
    max-width:300px!important;
    white-space:nowrap!important;
  }
  body.professional-visual-v235 .professional-header-summary{
    max-width:300px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* Registros: folha permanece na extremidade direita e não cruza os quatro resumos. */
  body.professional-visual-v235 #professional-records .rec201-hero::after{
    right:-18px!important;
    width:350px!important;
    opacity:.58!important;
    background-size:contain!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics{
    z-index:3!important;
  }

  /* Consentimentos: reduz o avanço da botânica sobre texto e CTA. */
  body.professional-visual-v235 #professional-consents .consents202-hero-leaves{
    right:-12px!important;
    width:365px!important;
    opacity:.82!important;
  }

  /* Estados de carregamento usam a mesma altura do hero final de Atendimentos. */
  body.professional-visual-v235 #professional-attendances .v199-attendance-hero,
  body.professional-visual-v235 #professional-attendances .v199-highlight-host{
    min-height:216px!important;
  }
}

/* =========================================================
   NOTEBOOK 1024–1439
   Proteção de conteúdo real sem escala proporcional.
   ========================================================= */
@media (min-width:1024px) and (max-width:1439px){
  body.professional-visual-v235 .professional-header-context{
    min-width:0!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero::after,
  body.professional-visual-v235 #professional-consents .consents202-hero-leaves{
    max-width:34%!important;
    opacity:.52!important;
  }
  body.professional-visual-v235 #professional-attendances .v199-highlight-host:empty::before{
    font-size:11px!important;
  }
}

/* =========================================================
   TABLET + MOBILE
   ========================================================= */
@media (max-width:1023px){
  /* Cabeçalho: reserva largura real para títulos longos e impede disputa
     com sino/avatar. */
  body.professional-visual-v235 .professional-mobile-bar{
    grid-template-columns:44px minmax(0,1fr) auto!important;
    gap:8px!important;
  }
  body.professional-visual-v235 .professional-mobile-current,
  body.professional-visual-v235 .professional-header-context,
  body.professional-visual-v235 .professional-header-title-line{
    min-width:0!important;
    width:100%!important;
  }
  body.professional-visual-v235 .professional-header-title{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  /* REGISTROS PROFISSIONAIS
     V234 ainda deixava a folha competir com o título em 430/390/360. */
  body.professional-visual-v235 #professional-records .rec201-hero{
    position:relative!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:start!important;
    gap:13px!important;
    min-height:0!important;
    height:auto!important;
    padding:17px 16px 15px!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero::after{
    right:-28px!important;
    top:auto!important;
    bottom:-22px!important;
    width:58%!important;
    height:64%!important;
    opacity:.23!important;
    background-size:contain!important;
    background-position:right bottom!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-copy{
    position:relative!important;
    z-index:4!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-copy h2{
    max-width:320px!important;
    margin:0!important;
    font-size:22px!important;
    line-height:1.08!important;
    text-wrap:balance!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-copy p{
    width:min(100%,325px)!important;
    max-width:325px!important;
    margin:7px 0 0!important;
    font-size:10px!important;
    line-height:1.42!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics{
    position:relative!important;
    z-index:4!important;
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    overflow:hidden!important;
    border:1px solid rgba(229,208,167,.18)!important;
    border-radius:11px!important;
    background:rgba(3,47,40,.28)!important;
    backdrop-filter:blur(1px)!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics article{
    min-height:69px!important;
    padding:9px 11px!important;
    border-top:0!important;
    border-left:1px solid rgba(229,208,167,.2)!important;
    border-bottom:1px solid rgba(229,208,167,.16)!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics article:nth-child(odd){
    border-left:0!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics article:nth-child(n+3){
    border-bottom:0!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics strong{
    font-size:22px!important;
  }

  /* CONSENTIMENTOS
     Força largura horizontal real no texto. O título deixa de se partir em
     3/4 linhas estreitas e a botânica volta para função exclusivamente decorativa. */
  body.professional-visual-v235 #professional-consents .consents202-hero{
    position:relative!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-items:stretch!important;
    align-items:start!important;
    min-height:0!important;
    height:auto!important;
    gap:0!important;
    padding:17px 16px 16px!important;
    text-align:left!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero-copy{
    position:relative!important;
    z-index:5!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    justify-self:stretch!important;
    margin:0!important;
    text-align:left!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero-copy h3{
    display:block!important;
    width:100%!important;
    max-width:325px!important;
    margin:0!important;
    font-size:22px!important;
    line-height:1.08!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
    text-wrap:balance!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero-copy p{
    width:min(100%,330px)!important;
    max-width:330px!important;
    margin:8px 0 12px!important;
    font-size:10.3px!important;
    line-height:1.42!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero-copy .btn,
  body.professional-visual-v235 #professional-consents .consents202-gold{
    position:relative!important;
    z-index:5!important;
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    padding-inline:13px!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero-leaves{
    right:-30px!important;
    top:auto!important;
    bottom:-18px!important;
    width:58%!important;
    height:72%!important;
    opacity:.24!important;
    background-size:contain!important;
    background-position:right bottom!important;
  }
  body.professional-visual-v235 #professional-consents .consents202-hero::after{
    right:-70px!important;
    top:-95px!important;
    width:190px!important;
    height:190px!important;
    opacity:.52!important;
  }

  /* ATENDIMENTOS
     O host vazio mantém a mesma geometria do hero real durante consulta. */
  body.professional-visual-v235 #professional-attendances .v199-attendance-hero{
    min-height:168px!important;
    height:auto!important;
  }
  body.professional-visual-v235 #professional-attendances .v199-highlight-host{
    min-height:168px!important;
  }
  body.professional-visual-v235 #professional-attendances .v199-highlight-host:empty::before{
    top:50%!important;
    font-size:10.5px!important;
  }
  body.professional-visual-v235 #professional-attendances .v199-attendance-hero::after{
    width:56%!important;
    opacity:.30!important;
  }

  /* Roots dinâmicos não deixam a tela parecer quebrada durante autenticação/rede. */
  body.professional-visual-v235 #professional-guidance > [data-guidance168-host]:empty,
  body.professional-visual-v235 #professional-finance [data-finance169-root]:empty{
    min-height:520px!important;
    background:
      linear-gradient(90deg,rgba(236,229,217,.50) 0 49%,transparent 49% 51%,rgba(236,229,217,.36) 51% 100%) 0 180px/100% 100px no-repeat,
      linear-gradient(#0b493f,#07372f) 0 0/100% 160px no-repeat,
      #fbf8f2!important;
  }
}

/* =========================================================
   MOBILE 430 / 390 / 360
   ========================================================= */
@media (max-width:620px){
  body.professional-visual-v235 .professional-main{
    padding-top:8px!important;
  }

  /* Mantém ritmo vertical consistente entre hero e KPIs. */
  body.professional-visual-v235 #professional-clients .v196-clients-hero,
  body.professional-visual-v235 #professional-agenda .v197-agenda-hero,
  body.professional-visual-v235 #professional-evolution .v198-evolution-hero,
  body.professional-visual-v235 #professional-attendances .v199-attendance-hero,
  body.professional-visual-v235 #professional-telehealth .tele201-hero,
  body.professional-visual-v235 #professional-records .rec201-hero,
  body.professional-visual-v235 #professional-consents .consents202-hero,
  body.professional-visual-v235 #professional-guidance .v163-guidance-intro,
  body.professional-visual-v235 #professional-finance .v203-finance-hero,
  body.professional-visual-v235 #professional-copilot .copilot203-hero{
    margin-bottom:10px!important;
  }

  body.professional-visual-v235 #professional-records .rec201-workspace,
  body.professional-visual-v235 #professional-consents .consents202-layout,
  body.professional-visual-v235 #professional-telehealth .tele201-main-grid,
  body.professional-visual-v235 #professional-copilot .copilot203-grid,
  body.professional-visual-v235 #professional-evolution .v198-evolution-workspace{
    gap:9px!important;
  }

  /* Filtros empilhados: altura previsível e sem campos comprimidos. */
  body.professional-visual-v235 #professional-attendances .v199-attendance-toolbar,
  body.professional-visual-v235 #professional-clients .v196-clients-toolbar,
  body.professional-visual-v235 #professional-consents .consents202-filters{
    min-width:0!important;
  }
  body.professional-visual-v235 #professional-attendances .v199-attendance-toolbar input,
  body.professional-visual-v235 #professional-attendances .v199-attendance-toolbar select,
  body.professional-visual-v235 #professional-clients .v196-clients-toolbar input,
  body.professional-visual-v235 #professional-clients .v196-clients-toolbar select,
  body.professional-visual-v235 #professional-consents .consents202-filters input,
  body.professional-visual-v235 #professional-consents .consents202-filters select{
    width:100%!important;
    min-width:0!important;
  }
}

@media (max-width:390px){
  body.professional-visual-v235 #professional-records .rec201-hero-copy h2,
  body.professional-visual-v235 #professional-consents .consents202-hero-copy h3{
    font-size:20.5px!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-copy p,
  body.professional-visual-v235 #professional-consents .consents202-hero-copy p{
    font-size:9.7px!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero::after,
  body.professional-visual-v235 #professional-consents .consents202-hero-leaves{
    width:52%!important;
    opacity:.19!important;
  }
}

@media (max-width:370px){
  body.professional-visual-v235 #professional-records .rec201-hero,
  body.professional-visual-v235 #professional-consents .consents202-hero{
    padding-left:13px!important;
    padding-right:13px!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-metrics article{
    padding-left:9px!important;
    padding-right:9px!important;
  }
  body.professional-visual-v235 #professional-records .rec201-hero-copy h2,
  body.professional-visual-v235 #professional-consents .consents202-hero-copy h3{
    font-size:19.5px!important;
  }
}
