/* RatioJuris — layout adaptativo para celular, tablet e PC.
   Preserva identidade visual original e o painel de acessibilidade. */
.ratio-header-inner,.ratio-header-actions,.ratio-brand{min-width:0}
.ratio-brand{flex-shrink:1}
.ratio-brand-title{white-space:nowrap}
.ratio-nav-mobile[hidden]{display:none!important}
.ratio-nav-mobile a{display:flex;align-items:center;min-height:48px;max-width:100%;
  padding:12px 16px;border-radius:10px;font-weight:650;overflow-wrap:anywhere}
.ratio-nav-mobile a:active{background:rgba(168,85,247,.15)}
#oab-arquivo,#simulador-oficial,#gabinete{scroll-margin-top:100px}
#simulador-oficial{min-width:0;overflow-wrap:anywhere}
.ratio-study-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;align-items:start}
.ratio-study-layout>*{min-width:0}
.ratio-study-layout .ratio-study-pane{order:1}
.ratio-study-layout #visualizadorProvaIntegrado{order:2}
#consultaPdfOpcional>summary{min-height:44px;display:flex;align-items:center}
#consultaPdfOpcional:not([open]) .ratio-pdf-iframe{display:none}
.ratio-study-pane{min-width:0;overflow-wrap:anywhere}
.ratio-pdf-iframe{display:block;width:100%;height:440px;height:clamp(270px,53svh,520px);border:0;background:#fff}
.ratio-study-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;align-items:stretch}
.ratio-study-actions>*{min-width:0;width:100%;white-space:normal;text-wrap:balance}
#simulador-oficial :where(button,select,a){min-height:44px}
#simulador-oficial button:disabled{opacity:.6;cursor:not-allowed}
#simulador-oficial :where(a,p,h3,h4,h5,button),#painelAcessibilidade :where(p,button){
 overflow-wrap:anywhere;
}
#alternativasQuestaoOficial button{min-height:55px;font-size:1.05rem}
/* Leitura confortavel para textos juridicos extensos, sem alterar o conteudo. */
#cardEnunciadoCompleto{min-width:0;overflow-wrap:anywhere}
#textoQuestaoDentroSimulador{
  font-size:1rem;
  line-height:1.85;
  letter-spacing:.005em;
  max-width:72ch;
  max-height:clamp(320px,62vh,760px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:.35rem .25rem 1rem;
  white-space:pre-line;
  overflow-wrap:break-word;
}
#cardEnunciadoCompleto[open]>summary{padding-bottom:.5rem;border-bottom:1px solid rgba(124,58,237,.25)}
#cardEnunciadoCompleto>summary{line-height:1.5}

#fundamentacaoErroOficial a{max-width:100%;white-space:normal;word-break:break-word}
#fundamentacaoErroOficial{min-width:0}
#cardEstatisticaOAB{min-width:0}
#pdfLeitorControles{min-width:0}
#pdfTextoExtraido{max-width:100%;word-break:normal;overflow-wrap:anywhere}
@media(max-width:767px){
 /* O simulador ocupa a largura util da tela, sem margens internas duplas. */
 html,body,#appBody{max-width:100%;min-width:0}
 #oab-arquivo{width:100%;padding-top:1.5rem!important;padding-bottom:2rem!important}
 #oab-arquivo>.max-w-6xl{width:100%;max-width:none!important;padding-inline:5px!important}
 #oab-arquivo>.max-w-6xl>.rounded-2xl{padding:10px!important;border-radius:12px}
 #simulador-oficial{width:100%;padding:10px!important;margin-inline:0!important;box-shadow:none}
 #simulador-oficial>.ratio-study-layout{gap:.5rem}
 #simulador-oficial .ratio-study-pane{margin-top:0!important;padding:10px!important}
 #cardEnunciadoCompleto{padding:10px!important}
 #textoQuestaoDentroSimulador{max-width:100%;line-height:1.7;font-size:1rem;max-height:min(62svh,600px)}
 #alternativasQuestaoOficial{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #alternativasQuestaoOficial button{padding:12px 10px!important}
 #simulador-oficial :where(select,input,button){max-width:100%}
}
@media(max-width:430px){
 .ratio-header-inner{padding-left:.6rem!important;padding-right:.6rem!important;gap:.35rem}
 .ratio-brand{gap:.4rem!important}
 .ratio-brand-mark{width:36px!important;height:36px!important;font-size:1.15rem!important;flex-shrink:0}
 .ratio-brand-title{font-size:clamp(14px,3.75vw,16px)!important;letter-spacing:0!important;line-height:1.25}
 .ratio-brand-caption{font-size:8px!important;letter-spacing:.025em!important}
 .ratio-header-actions{gap:.25rem!important;flex-shrink:0}
 .ratio-header-actions>button{min-width:42px;min-height:44px;padding:8px!important}
 #simulador-oficial{padding:12px!important}
 .ratio-question-pane{padding:13px!important}
 .ratio-pdf-iframe{height:340px;height:clamp(265px,48svh,400px)}
 .ratio-study-actions{gap:8px}
 .ratio-study-actions button{padding:10px 7px!important;font-size:.82rem!important}
 #alternativasQuestaoOficial button{padding:10px!important}
}
@media(min-width:431px) and (max-width:767px){
 .ratio-pdf-iframe{height:510px;height:clamp(330px,58svh,570px)}
}
@media(min-width:768px){
 .ratio-study-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
 .ratio-pdf-iframe{height:640px;height:clamp(480px,68svh,760px)}
}
@media(min-width:1200px){
 .ratio-study-layout{grid-template-columns:minmax(0,1.13fr) minmax(0,.87fr);gap:1.25rem}
 .ratio-study-pane{margin-top:0!important}
 .ratio-pdf-iframe{height:720px;height:clamp(560px,72svh,860px)}
}
@media(prefers-reduced-motion:reduce){
 .ratio-nav-mobile,.ratio-pdf-iframe{scroll-behavior:auto!important}
}

/* Estados de correção com contraste independente do compilador Tailwind. */
#feedbackQuestaoOficial.ratio-resposta-certa{
  background:#d1fae5!important;color:#064e3b!important;
  border:3px solid #059669!important;box-shadow:0 0 0 2px rgba(5,150,105,.14);
}
#feedbackQuestaoOficial.ratio-resposta-errada{
  background:#ffe4e6!important;color:#881337!important;
  border:3px solid #e11d48!important;
}
html.dark #feedbackQuestaoOficial.ratio-resposta-certa{
  background:#064e3b!important;color:#ecfdf5!important;border-color:#34d399!important;
}
html.dark #feedbackQuestaoOficial.ratio-resposta-errada{
  background:#881337!important;color:#fff1f2!important;border-color:#fda4af!important;
}
#conferenciaLegislacaoOpcional>summary{list-style-position:inside}
#selecaoBancaJuridica :where(a,button){min-width:0;overflow-wrap:anywhere}

/* RATIO JURIS — fluxo único para leitura confortável em todas as telas.
   A questão aparece primeiro; documentos oficiais permanecem opcionais. */
#simulador-oficial .ratio-study-layout{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:1rem!important;
}
#simulador-oficial .ratio-study-layout > .ratio-study-pane{
  order:0!important;
  width:100%;
}
#simulador-oficial .ratio-study-layout > #ajudaDocumentosProva{
  order:1!important;
  width:100%;
}
#simulador-oficial summary,
#simulador-oficial select,
#simulador-oficial button{
  min-height:44px;
}
#simulador-oficial #alternativasQuestaoOficial button{
  min-height:54px;
  font-size:1.05rem;
}
@media (max-width:640px){
  #simulador-oficial #alternativasQuestaoOficial{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #simulador-oficial #alternativasQuestaoOficial button{
    font-size:1.15rem;
    text-align:center;
  }
}

/* Ajustes multiplataforma: telefones compactos, tablets e desktops. */
html{scroll-padding-top:5.5rem}
body,#appBody{overflow-x:clip}
#oabExamSelect,#oabTipoSelect,#questaoOficialNumeroSelect,#gabaritoHistoricoSelect{
  width:100%;max-width:100%;font-size:1rem;min-height:50px;
  touch-action:manipulation;
}
#oab-arquivo :where(button,a,summary,input,select),
#leitorPdfAcessivel :where(button,a,input,select),
#gabinete :where(button,a,input,select){
  touch-action:manipulation;
}
#oab-arquivo :where(button,select),#gabinete :where(button,select),#leitorPdfAcessivel :where(button,select){
  font-size:max(.875rem,14px);
}
#oab-arquivo :where(button,summary),#leitorPdfAcessivel :where(button,summary){
  min-height:44px;
}
#oab-arquivo :where(.grid,.flex)>*{min-width:0}
#cardEstatisticaOAB,#simulador-oficial,#ajudaDocumentosProva,#detalhesLeitorPdf{
  max-width:100%;min-width:0;
}
#statusLocalizacaoQuestao,#oabStatus,#pdfLeitorStatus,#feedbackQuestaoOficial{
  overflow-wrap:anywhere;
}
#alternativasQuestaoOficial button{
  touch-action:manipulation;
  font-weight:800;
}
#consultaPdfOpcional iframe,#detalhesGabaritoIntegrado iframe,
#pdf-banca-cebraspe,#pdf-banca-vunesp{
  width:100%;max-width:100%;min-width:0;
}
@media(max-width:359px){
  #oab-arquivo>.max-w-6xl{padding-inline:4px!important}
  #oab-arquivo>.max-w-6xl>.rounded-2xl{padding:8px!important}
  #cardEstatisticaOAB{padding:10px!important}
  #simulador-oficial{padding:8px!important}
  #alternativasQuestaoOficial{grid-template-columns:repeat(2,minmax(0,1fr))}
  #alternativasQuestaoOficial button{padding:12px 5px!important;font-size:1.1rem!important}
  .ratio-study-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .ratio-study-actions button{padding:12px 6px!important;font-size:.88rem!important}
}
@media(min-width:360px) and (max-width:767px){
  #oab-arquivo>.max-w-6xl>.rounded-2xl{padding:10px!important}
  .ratio-study-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .ratio-study-actions button{font-size:1rem!important}
  #oabExamSelect,#oabTipoSelect{font-size:16px}
  #textoQuestaoDentroSimulador{max-height:none;overflow-y:visible}
}
@media(min-width:768px) and (max-width:1199px){
  #simulador-oficial{padding:1.25rem!important}
  #alternativasQuestaoOficial{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ratio-study-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  #textoQuestaoDentroSimulador{max-height:min(65svh,760px)}
}
@media(min-width:1200px){
  #simulador-oficial{max-width:100%}
  #textoQuestaoDentroSimulador{max-width:90ch}
}
@media(hover:none) and (pointer:coarse){
  #oab-arquivo select,#oab-arquivo input,#gabinete input,#gabinete select{
    font-size:16px!important;
  }
  #alternativasQuestaoOficial button{min-height:60px}
}

/* Leitura jurídica acessível: priorizar palavras completas e alternativas longas. */
#simulador-oficial #textoQuestaoDentroSimulador{
  font-family:"Plus Jakarta Sans",system-ui,sans-serif;
  font-size:1rem;
  line-height:1.65;
  letter-spacing:normal;
  word-spacing:normal;
  text-align:left;
  white-space:pre-wrap;
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:none;
}
#simulador-oficial #alternativasQuestaoOficial{
  grid-template-columns:minmax(0,1fr)!important;
  gap:.75rem;
}
#simulador-oficial #alternativasQuestaoOficial button{
  font-family:"Plus Jakarta Sans",system-ui,sans-serif;
  font-size:1rem!important;
  line-height:1.55;
  letter-spacing:normal;
  word-spacing:normal;
  text-align:left!important;
  text-wrap:wrap;
  font-weight:600!important;
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:none;
  padding:14px 16px!important;
  min-height:56px;
}
@media(max-width:767px){
  #simulador-oficial #textoQuestaoDentroSimulador{
    font-size:1rem!important;
    line-height:1.7;
    max-height:none!important;
    overflow-y:visible!important;
  }
  #simulador-oficial #alternativasQuestaoOficial{
    grid-template-columns:minmax(0,1fr)!important;
  }
}

/* Ajuste estável de largura útil — 14/11/2026.
   Altera somente o espaço lateral da seção OAB, sem tocar nos botões ou na lógica. */
@media (max-width:767px){
  #oab-arquivo > .max-w-6xl{
    box-sizing:border-box;
    width:100%;
    max-width:100%!important;
    padding-left:4px!important;
    padding-right:4px!important;
  }
  #oab-arquivo > .max-w-6xl > .rounded-2xl{
    box-sizing:border-box;
    width:100%;
    padding-left:8px!important;
    padding-right:8px!important;
  }
}
@media (min-width:768px) and (max-width:1199px){
  #oab-arquivo > .max-w-6xl{
    width:100%;
    max-width:100%!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }
}
@media (min-width:1200px){
  #oab-arquivo > .max-w-6xl{
    max-width:1280px!important;
  }
}
