/* Correcao definitiva v10 */
.tab-btn:nth-child(1){background:#E8F1FF!important;color:#0B3A82!important;border-color:#8DB8F4!important}.tab-btn:nth-child(1).active{background:#0B5ED7!important;color:#fff!important}
.tab-btn:nth-child(2){background:#F4E9FF!important;color:#6A238A!important;border-color:#CBA4E3!important}.tab-btn:nth-child(2).active{background:#7B2CBF!important;color:#fff!important}
.tab-btn:nth-child(3){background:#FFF2DD!important;color:#8A4700!important;border-color:#F1B76B!important}.tab-btn:nth-child(3).active{background:#D96C00!important;color:#fff!important}
.tab-btn:nth-child(4){background:#E5F8EE!important;color:#075E35!important;border-color:#74C99A!important}.tab-btn:nth-child(4).active{background:#087F46!important;color:#fff!important}
.tab-btn:nth-child(5){background:#FFE8EE!important;color:#8E1738!important;border-color:#E990A9!important}.tab-btn:nth-child(5).active{background:#C2184B!important;color:#fff!important}
.teoria-card{font-size:16px}.teoria-card .teoria-body{font-size:1em;line-height:1.65}.teoria-size-controls{display:flex;gap:6px;align-items:center;margin-left:auto}.teoria-size-btn{min-width:42px;min-height:38px;border:1px solid #8aa4c4;border-radius:10px;background:#fff;color:#062b57;font-weight:800}.teoria-size-btn.active{background:#0B5ED7;color:#fff}


/* CONSOLIDACAO VISUAL V14 - carregado por ultimo */
.tabs .tab-btn { border-style: solid !important; border-width: 1px !important; font-weight: 800 !important; }
.tabs .tab-btn .tab-label { color: inherit !important; font-weight: 900 !important; line-height: 1.05 !important; white-space: normal !important; overflow-wrap: normal !important; word-break: keep-all !important; text-align: center !important; }
.tabs .tab-btn[data-tab="tab1"] { background:#E8F1FF !important; color:#0B3A82 !important; border-color:#8DB8F4 !important; }
.tabs .tab-btn[data-tab="tab1"].active { background:#0B5ED7 !important; color:#fff !important; }
.tabs .tab-btn[data-tab="tab2"] { background:#F4E9FF !important; color:#6A238A !important; border-color:#CBA4E3 !important; }
.tabs .tab-btn[data-tab="tab2"].active { background:#7B2CBF !important; color:#fff !important; }
.tabs .tab-btn[data-tab="tab3"] { background:#FFF2DD !important; color:#8A4700 !important; border-color:#F1B76B !important; }
.tabs .tab-btn[data-tab="tab3"].active { background:#D96C00 !important; color:#fff !important; }
.tabs .tab-btn[data-tab="tab4"] { background:#E5F8EE !important; color:#075E35 !important; border-color:#74C99A !important; }
.tabs .tab-btn[data-tab="tab4"].active { background:#087F46 !important; color:#fff !important; }
.tabs .tab-btn[data-tab="tab5"] { background:#FFF7D6 !important; color:#6A4700 !important; border-color:#E1BF4D !important; }
.tabs .tab-btn[data-tab="tab5"].active { background:#B77900 !important; color:#fff !important; }

/* Ajuda compacta, sem competir com as ações de estudo */
#fase1-help-button,
.app-header .fase1-help-button,
.app-header button[data-fase1-help="true"] {
  display:inline-flex !important; align-items:center !important; justify-content:center !important; gap:6px !important;
  width:auto !important; min-width:0 !important; min-height:34px !important; padding:6px 12px !important;
  margin-top:10px !important; border-radius:10px !important; font-size:12px !important; line-height:1 !important;
  font-weight:800 !important; white-space:nowrap !important;
}
#fase1-help-button .help-icon { font-size:13px !important; }

/* Flash cards: não cortar pergunta, resposta ou instrução */
.flashcard-wrap, .flashcard-inner { overflow:visible !important; }
.flashcard-inner { height:auto !important; max-height:none !important; min-height:260px !important; }
.flash-pergunta, .flash-resposta, .flash-hint { max-height:none !important; overflow:visible !important; white-space:normal !important; overflow-wrap:anywhere !important; }

@media(max-width:430px){
  .tabs { gap:3px !important; }
  .tabs .tab-btn { min-width:0 !important; padding:8px 3px !important; }
  .tabs .tab-btn .tab-label { font-size:9.5px !important; }
  .tabs .tab-btn[data-tab="tab3"] .tab-label { max-width:52px !important; }
}


/* Seletor de aparência compacto, no padrão do botão Como usar app */
.app-header .theme-control { gap:6px !important; }
.app-header .theme-select,
.app-header #theme-select {
  width:118px !important; min-width:118px !important;
  height:34px !important; min-height:34px !important;
  padding:5px 30px 5px 10px !important;
  border-radius:10px !important; font-size:12px !important;
  line-height:1 !important; font-weight:800 !important;
}
@media (max-width:430px) {
  .app-header .theme-select, .app-header #theme-select { width:112px !important; min-width:112px !important; }
}

/* Ajuste v17: seletor de aparencia no mesmo padrao do botao Como usar app */
.app-header .theme-select,
.app-header #theme-select,
#fase1-help-button,
.app-header .fase1-help-button {
  box-sizing: border-box !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}
.app-header .theme-select,
.app-header #theme-select {
  width: 132px !important;
  min-width: 132px !important;
  padding: 0 32px 0 12px !important;
  line-height: 36px !important;
}

/* V18: prevalece sobre prioridade-4 e remove somente o botão grande legado */
.app-header .header-cta:not(#fase1-help-button),
.app-header .help-btn:not(#fase1-help-button),
.app-header button[aria-label="Abrir instruções de uso do MVP"] {
  display: none !important;
}

/* V18: aparência com as mesmas dimensões do botão Como usar app */
.app-header #theme-select,
.app-header .theme-select,
#fase1-help-button {
  box-sizing: border-box !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
.app-header #theme-select,
.app-header .theme-select {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
  padding: 0 28px 0 10px !important;
}

/* V21: o botão Como usar app possui modal próprio; o legado permanece invisível. */
.fase1-help-modal[hidden] { display: none !important; }
.fase1-help-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.fase1-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 18, 35, .72);
  backdrop-filter: blur(3px);
}
.fase1-help-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #172437;
  border: 1px solid #d8e2ee;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(3, 20, 40, .30);
  outline: none;
}
.fase1-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #d8e2ee;
}
.fase1-help-kicker {
  color: #1769c2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.fase1-help-header h2 { margin: 3px 0 0; color: #0b2c55; font-size: 24px; }
.fase1-help-close {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid #b8c8d8;
  border-radius: 10px;
  background: #f4f7fb;
  color: #0b2c55;
  font-size: 25px;
  line-height: 1;
}
.fase1-help-body {
  overflow-y: auto;
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}
.fase1-help-body article {
  padding: 14px 15px;
  border: 1px solid #d8e2ee;
  border-radius: 12px;
  background: #f8fbff;
}
.fase1-help-body h3 { margin: 0 0 6px; color: #0b2c55; font-size: 16px; }
.fase1-help-body p { margin: 0; color: #42576d; font-size: 15px; line-height: 1.55; }
.fase1-help-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid #d8e2ee;
  display: flex;
  justify-content: flex-end;
}
.fase1-help-done {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #1769c2;
  color: #fff;
  font-weight: 800;
}
body.fase1-help-open { overflow: hidden; }
[data-theme="dark"] .fase1-help-panel { background: #0f2138; color: #edf4fd; border-color: #395774; }
[data-theme="dark"] .fase1-help-header,
[data-theme="dark"] .fase1-help-footer { border-color: #395774; }
[data-theme="dark"] .fase1-help-header h2,
[data-theme="dark"] .fase1-help-body h3 { color: #fff; }
[data-theme="dark"] .fase1-help-body article { background: #142a45; border-color: #395774; }
[data-theme="dark"] .fase1-help-body p { color: #d7e4f3; }
@media (max-width: 520px) {
  .fase1-help-modal { padding: 8px; align-items: end; }
  .fase1-help-panel { max-height: 92vh; border-radius: 16px 16px 10px 10px; }
  .fase1-help-header { padding: 16px 16px 12px; }
  .fase1-help-header h2 { font-size: 21px; }
  .fase1-help-body { padding: 14px 16px; }
  .fase1-help-footer { padding: 12px 16px 16px; }
  .fase1-help-done { width: 100%; }
}


/* V26: controle estável de tamanho do texto, sem reescala cumulativa. */
.fase1-header-tools {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
}
.fase1-header-tools #fase1-help-button { margin-top: 0 !important; }
.fase1-text-size-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 2px !important;
  min-height: 34px !important;
  border: 1px solid rgba(255,255,255,.48) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.10) !important;
}
.fase1-text-size-btn {
  width: 34px !important;
  height: 30px !important;
  min-width: 34px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}
.fase1-text-size-btn:hover,
.fase1-text-size-btn:focus-visible { background: rgba(255,255,255,.20) !important; }
.fase1-text-size-btn.active {
  background: #fff !important;
  color: #0b2c55 !important;
  border-color: #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.18) !important;
}
.fase1-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Tamanhos exatos. Não há cálculo progressivo nem MutationObserver de fonte. */
html[data-study-text-size="small"] .teoria-text,
html[data-study-text-size="small"] .teoria-list li,
html[data-study-text-size="small"] .teoria-destaque,
html[data-study-text-size="small"] .teoria-exemplo { font-size: 14px !important; line-height: 1.55 !important; }
html[data-study-text-size="small"] .teoria-section-title { font-size: 15px !important; }
html[data-study-text-size="small"] .mind-summary-branch li,
html[data-study-text-size="small"] .mind-summary-branch p { font-size: 11px !important; }
html[data-study-text-size="small"] .mind-summary-branch h3 { font-size: 13px !important; }
html[data-study-text-size="small"] .flash-pergunta { font-size: 18px !important; }
html[data-study-text-size="small"] .flash-resposta { font-size: 14px !important; }
html[data-study-text-size="small"] .quiz-box,
html[data-study-text-size="small"] .quiz-option,
html[data-study-text-size="small"] .quiz-feedback,
html[data-study-text-size="small"] .topic-name { font-size: 13px !important; }

html[data-study-text-size="normal"] .teoria-text,
html[data-study-text-size="normal"] .teoria-list li,
html[data-study-text-size="normal"] .teoria-destaque,
html[data-study-text-size="normal"] .teoria-exemplo { font-size: 17px !important; line-height: 1.75 !important; }
html[data-study-text-size="normal"] .teoria-section-title { font-size: 18px !important; }
html[data-study-text-size="normal"] .mind-summary-branch li,
html[data-study-text-size="normal"] .mind-summary-branch p { font-size: 12.5px !important; }
html[data-study-text-size="normal"] .mind-summary-branch h3 { font-size: 15px !important; }
html[data-study-text-size="normal"] .flash-pergunta { font-size: clamp(21px,4vw,28px) !important; }
html[data-study-text-size="normal"] .flash-resposta { font-size: 18px !important; }
html[data-study-text-size="normal"] .quiz-box,
html[data-study-text-size="normal"] .quiz-option,
html[data-study-text-size="normal"] .quiz-feedback,
html[data-study-text-size="normal"] .topic-name { font-size: 15px !important; }

html[data-study-text-size="large"] .teoria-text,
html[data-study-text-size="large"] .teoria-list li,
html[data-study-text-size="large"] .teoria-destaque,
html[data-study-text-size="large"] .teoria-exemplo { font-size: 21px !important; line-height: 1.8 !important; }
html[data-study-text-size="large"] .teoria-section-title { font-size: 23px !important; }
html[data-study-text-size="large"] .mind-summary-branch li,
html[data-study-text-size="large"] .mind-summary-branch p { font-size: 16px !important; line-height: 1.55 !important; }
html[data-study-text-size="large"] .mind-summary-branch h3 { font-size: 19px !important; }
html[data-study-text-size="large"] .flash-pergunta { font-size: 31px !important; line-height: 1.5 !important; }
html[data-study-text-size="large"] .flash-resposta { font-size: 22px !important; line-height: 1.7 !important; }
html[data-study-text-size="large"] .quiz-box,
html[data-study-text-size="large"] .quiz-option,
html[data-study-text-size="large"] .quiz-feedback,
html[data-study-text-size="large"] .topic-name { font-size: 19px !important; line-height: 1.65 !important; }

@media (max-width: 430px) {
  .fase1-header-tools { gap: 6px !important; }
  .fase1-text-size-btn { width: 31px !important; min-width: 31px !important; }
  .fase1-header-tools #fase1-help-button { padding-inline: 10px !important; }
}
