/* IntegraGov 1.0.97 — correção de legibilidade e responsividade.
   Atua sobre a apresentação; não altera dados, rotas ou permissões. */

/* Evita que filhos de colunas e painéis ultrapassem suas áreas. */
#main :is(.ig139-view,.ig70-layout,.ig70-workspace,.ig160,.g190,.edu54-hub,.edu54-panel,.edu54-card,.ig193-hub){
  max-width:100%;
  min-width:0;
}
#main :is(.ig139-view,.ig70-workspace,.edu54-hub,.edu54-panel,.ig193-hub) *,
.ig183-nav * {
  box-sizing:border-box;
}

/* Central dos oito programas da Educação: cartões com altura livre, títulos separados. */
#main .ig193-hub{
  width:100%;
  height:auto!important;
  padding:clamp(14px,1.8vw,24px)!important;
  overflow:visible;
}
#main .ig193-hub h2{
  margin:0 0 7px;
  font-size:clamp(19px,1.55vw,24px);
  line-height:1.3;
  overflow-wrap:break-word;
}
#main .ig193-hub p{
  font-size:14px;
  line-height:1.55;
  margin:0 0 18px;
  overflow-wrap:break-word;
}
#main .ig193-hub .ig193-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))!important;
  gap:14px!important;
  align-items:stretch!important;
}
#main .ig193-hub .ig193-card{
  position:relative;
  display:flex!important;
  flex-flow:column nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100%!important;
  height:auto!important;
  min-width:0!important;
  min-height:172px!important;
  max-height:none!important;
  padding:17px!important;
  margin:0!important;
  gap:9px!important;
  line-height:1.42!important;
  text-align:left!important;
  white-space:normal!important;
  overflow:visible!important;
  vertical-align:top;
  border-radius:13px;
}
#main .ig193-hub .ig193-card :is(.ico,strong,small,.go){
  position:static!important;
  display:block!important;
  height:auto!important;
  max-width:100%!important;
  min-width:0!important;
  flex:0 0 auto!important;
  white-space:normal!important;
  text-overflow:clip!important;
  overflow:visible!important;
  overflow-wrap:break-word!important;
  word-break:normal;
}
#main .ig193-hub .ig193-card .ico{
  font-size:24px!important;
  line-height:1.1!important;
  margin:0!important;
}
#main .ig193-hub .ig193-card strong{
  font-size:16px!important;
  line-height:1.4!important;
  font-weight:750;
  margin:0!important;
}
#main .ig193-hub .ig193-card small{
  font-size:13px!important;
  line-height:1.5!important;
  font-weight:400;
  margin:0!important;
}
#main .ig193-hub .ig193-card .go{
  margin-top:auto!important;
  padding-top:8px!important;
  font-size:13px!important;
  line-height:1.4!important;
}

/* Título, seletor de exercício e botões sem colisões. */
#main .ig139-view .ig139-hero{
  flex-wrap:wrap!important;
  height:auto!important;
  min-height:100px;
  align-items:center;
  row-gap:12px;
}
#main .ig139-view .ig139-hero>div{
  min-width:0;
  max-width:100%;
}
#main .ig139-view .ig139-hero h1,
#main .ig139-view .ig139-hero p{
  overflow-wrap:break-word;
}
#main .ig139-view .ig144-year{
  min-width:115px;
  margin-left:auto;
  flex:0 0 auto;
}
#main .ig139-view .ig139-tabs{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:stretch;
  gap:4px;
}
#main .ig139-view .ig139-tabs button{
  min-width:0;
  min-height:44px;
  width:auto;
  height:auto!important;
  padding:10px 12px!important;
  line-height:1.4!important;
  white-space:normal!important;
  overflow-wrap:break-word;
}
#main .ig160-entry{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:stretch!important;
  gap:10px!important;
  height:auto!important;
}
#main .ig160-entry :is(button,a,summary){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  max-width:100%;
  width:auto;
  min-height:44px;
  height:auto!important;
  line-height:1.45!important;
  white-space:normal!important;
  text-align:center;
  overflow-wrap:break-word;
  padding:11px 15px!important;
}

/* AABB e CAESEM: abas, formulários, tabelas e ações com conteúdo completo. */
#main .edu54-panel .top,
#main .ig70-workspace .ig70-program-head{
  flex-wrap:wrap!important;
  gap:12px!important;
  height:auto!important;
}
#main .edu54-panel .top>div,
#main .ig70-workspace .ig70-program-head>div{
  min-width:0;
  flex:1 1 220px;
}
#main .edu54-panel :is(h2,h3,h4,p),
#main .ig70-workspace :is(h2,h3,p,small){
  overflow-wrap:break-word;
}
#main .edu54-panel .edu54-tabs,
#main .ig70-workspace .edu54-tabs{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:stretch!important;
  gap:7px!important;
  padding:8px!important;
  height:auto!important;
}
#main .edu54-panel .edu54-tabs button,
#main .ig70-workspace .edu54-tabs button{
  display:inline-flex!important;
  flex:0 1 auto!important;
  align-items:center;
  justify-content:center;
  min-width:0;
  max-width:100%;
  height:auto!important;
  min-height:42px!important;
  padding:10px 12px!important;
  font-size:13px!important;
  line-height:1.4!important;
  white-space:normal!important;
  text-align:center;
  overflow-wrap:break-word;
}
#main .edu54-panel .formgrid,
#main .edu54-panel .grid,
#main .ig70-workspace .ig70-ficha-grid{
  min-width:0;
}
#main .edu54-panel label,
#main .edu54-panel input,
#main .edu54-panel select,
#main .edu54-panel textarea{
  max-width:100%;
  min-width:0;
}
#main .edu54-panel .tablewrap,
#main .ig70-workspace .ig70-table{
  display:block;
  max-width:100%;
  min-width:0;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch;
}
#main .edu54-panel :is(th,td),
#main .ig70-workspace :is(th,td){
  overflow-wrap:break-word;
  word-break:normal;
  line-height:1.45;
}
#main .ig70-workspace .ig70-row-actions,
#main .edu54-panel .actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:7px;
  height:auto!important;
}
#main .ig70-workspace .ig70-row-actions button,
#main .edu54-panel .actions button{
  width:auto;
  max-width:100%;
  height:auto!important;
  min-height:36px;
  white-space:normal!important;
  line-height:1.35!important;
  overflow-wrap:break-word;
}
#main .ig70-workspace .ig70-module{
  grid-template-columns:38px minmax(0,1fr)!important;
  height:auto!important;
}
#main .ig70-workspace .ig70-module strong,
#main .ig70-workspace .ig70-module small{
  white-space:normal!important;
  overflow-wrap:break-word!important;
}
.ig183-nav .ig183-item,.ig183-nav .ig183-subitem{
  height:auto!important;
  line-height:1.4!important;
  overflow-wrap:break-word;
}

/* Sob zoom alto ou janela estreita, evita texto atrás de campos/botões. */
@media(max-width:1150px){
  #main .ig139-view .ig139-hero{align-items:flex-start}
  #main .ig70-workspace .ig70-ficha-grid{grid-template-columns:minmax(0,1fr)!important}
  #main .edu54-panel .formgrid{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
}
@media(max-width:650px){
  #main .ig193-hub .ig193-grid{grid-template-columns:1fr!important}
  #main .ig193-hub .ig193-card{min-height:132px!important}
  #main .ig139-view .ig139-hero h1{font-size:20px}
  #main .ig139-view .ig144-year{margin-left:0}
  #main .ig139-view .ig139-tabs button{flex:1 1 128px}
  #main .edu54-panel .formgrid{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  #main .ig193-card{transition:none!important}
}
