/*
  IngSoft V84.24 — Contraste final por orden de cascada real
  Corrección estructural: esta capa se carga al FINAL del <head> en todas las páginas,
  después de CSS heredados V80/V81/V83/V84, para que la semántica de superficie no sea anulada.
  Criterio: tarjeta clara = texto oscuro; tarjeta oscura = texto claro; sin texto invisible.
*/

:root{
  --aq24-ink:#071832;
  --aq24-ink-2:#173454;
  --aq24-ink-3:#365a78;
  --aq24-light:#ffffff;
  --aq24-light-2:#f4f9fd;
  --aq24-light-3:#edf7fd;
  --aq24-line:#b9d9ed;
  --aq24-dark:#06152a;
  --aq24-dark-card:#0b223c;
  --aq24-dark-card-2:#102c4c;
  --aq24-white:#ffffff;
  --aq24-white-2:#eaf7ff;
  --aq24-cyan:#8bd4ff;
  --aq24-accent:#58b8ea;
}

/* A. Contrato global de superficies claras */
html body :is(
  .surface-light,
  .section-light,
  .light-section,
  .surface-light-card,
  .card--light,
  .panel--light,
  .v83-proof-panel,
  .v83-proof-list > div,
  .kv-grid > div,
  .key-value-grid > div,
  .kv-card,
  .proof-card,
  .meta-card,
  .stat-card,
  .quote-box,
  .source-box,
  .notice-box,
  .citation-output,
  .v93-citation-box,
  .contact-clean-form-card,
  .contact-clean-info-card,
  .publication-card,
  .data-card,
  .learning-mode-panel,
  .assessment-panel,
  .assessment-question,
  .physics-validation-panel,
  .scientific-report-tools
){
  background:linear-gradient(180deg,var(--aq24-light) 0%,var(--aq24-light-2) 100%) !important;
  border-color:var(--aq24-line) !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:initial !important;
  opacity:1 !important;
  filter:none !important;
  mix-blend-mode:normal !important;
  text-shadow:none !important;
}
html body :is(
  .surface-light,
  .section-light,
  .light-section,
  .surface-light-card,
  .card--light,
  .panel--light,
  .v83-proof-panel,
  .v83-proof-list > div,
  .kv-grid > div,
  .key-value-grid > div,
  .kv-card,
  .proof-card,
  .meta-card,
  .stat-card,
  .quote-box,
  .source-box,
  .notice-box,
  .citation-output,
  .v93-citation-box,
  .contact-clean-form-card,
  .contact-clean-info-card,
  .publication-card,
  .data-card,
  .learning-mode-panel,
  .assessment-panel,
  .assessment-question,
  .physics-validation-panel,
  .scientific-report-tools
) :is(h1,h2,h3,h4,h5,h6,strong,b,dt,th,.title,.label,.kv-label,.key,.meta-label,.field-label):not(.btn):not(.button):not([class*="btn"]){
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
  opacity:1 !important;
  filter:none !important;
  text-shadow:none !important;
}
html body :is(
  .surface-light,
  .section-light,
  .light-section,
  .surface-light-card,
  .card--light,
  .panel--light,
  .v83-proof-panel,
  .v83-proof-list > div,
  .kv-grid > div,
  .key-value-grid > div,
  .kv-card,
  .proof-card,
  .meta-card,
  .stat-card,
  .quote-box,
  .source-box,
  .notice-box,
  .citation-output,
  .v93-citation-box,
  .contact-clean-form-card,
  .contact-clean-info-card,
  .publication-card,
  .data-card,
  .learning-mode-panel,
  .assessment-panel,
  .assessment-question,
  .physics-validation-panel,
  .scientific-report-tools
) :is(p,li,span,small,dd,label,.value,.kv-value,.meta-value,.field-value,.desc,.meta,.muted,.subtitle):not(.eyebrow):not(.btn):not(.button):not([class*="btn"]):not(option){
  color:var(--aq24-ink-2) !important;
  -webkit-text-fill-color:var(--aq24-ink-2) !important;
  opacity:1 !important;
  filter:none !important;
  text-shadow:none !important;
}

/* B. Ficha reproducible del Observatorio: máxima prioridad semántica */
html body.page-observatorio .v83-repro-proof .v83-proof-panel,
html body.page-observatorio .v83-repro-proof .v83-proof-panel.surface-light-card{
  background:linear-gradient(180deg,#ffffff 0%,#f4f9fd 100%) !important;
  border:2px solid var(--aq24-line) !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:initial !important;
  opacity:1 !important;
  filter:none !important;
  mix-blend-mode:normal !important;
  text-shadow:none !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list,
html body.page-observatorio .v83-repro-proof .kv-grid{
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:initial !important;
  opacity:1 !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list > div,
html body.page-observatorio .v83-repro-proof .v83-proof-list > div.surface-light-card,
html body.page-observatorio .v83-repro-proof .v83-proof-list > div.kv-card,
html body.page-observatorio .v83-repro-proof .v83-proof-list > div.card--light{
  background:linear-gradient(180deg,#ffffff 0%,#edf7fd 100%) !important;
  border:1.7px solid var(--aq24-line) !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:initial !important;
  opacity:1 !important;
  filter:none !important;
  mix-blend-mode:normal !important;
  text-shadow:none !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list > div *,
html body.page-observatorio .v83-repro-proof .kv-card *{
  opacity:1 !important;
  filter:none !important;
  mix-blend-mode:normal !important;
  text-shadow:none !important;
  background-image:none !important;
  -webkit-background-clip:border-box !important;
  background-clip:border-box !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list dt,
html body.page-observatorio .v83-repro-proof .v83-proof-list .kv-label,
html body.page-observatorio .v83-repro-proof .v83-proof-list .label{
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
  font-weight:950 !important;
  opacity:1 !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list dd,
html body.page-observatorio .v83-repro-proof .v83-proof-list dd *,
html body.page-observatorio .v83-repro-proof .v83-proof-list .kv-value,
html body.page-observatorio .v83-repro-proof .v83-proof-list .value{
  color:var(--aq24-ink-2) !important;
  -webkit-text-fill-color:var(--aq24-ink-2) !important;
  font-weight:850 !important;
  opacity:1 !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-list dd:empty::before{
  content:"—";
  color:var(--aq24-ink-3) !important;
  -webkit-text-fill-color:var(--aq24-ink-3) !important;
  font-weight:900 !important;
  opacity:1 !important;
}
html body.page-observatorio .v83-repro-proof .v83-proof-panel .eyebrow,
html body.page-observatorio .v83-repro-proof .v83-proof-panel .eyebrow *{
  background:#ffffff !important;
  border-color:var(--aq24-accent) !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
  opacity:1 !important;
}

/* C. Contrato global de superficies oscuras */
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer){
  color:var(--aq24-white-2) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel),
html body :is(.surface-dark,.section-dark,.dark-section,.agent-lab-section,.v83-repro-section) :is(.card,.panel,.box,.tile,.item-card,.info-card,.feature-card,.mini-panel,.summary-card,.metric-card,.report-card):not(.surface-light-card):not(.card--light):not(.panel--light):not(.v83-proof-panel):not(.kv-card):not(.quote-box):not(.source-box):not(.notice-box):not(.scientific-assistant--v9){
  background:linear-gradient(180deg,var(--aq24-dark-card) 0%,var(--aq24-dark-card-2) 100%) !important;
  border:1.5px solid rgba(139,212,255,.34) !important;
  color:var(--aq24-white-2) !important;
  -webkit-text-fill-color:initial !important;
}
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer)
  :is(h1,h2,h3,h4,h5,h6,strong,b,.title,.headline,.section-title):not(.eyebrow):not(.badge-label):not(.pill-label):not(.surface-light-card *):not(.card--light *):not(.v83-proof-panel *){
  color:var(--aq24-white) !important;
  -webkit-text-fill-color:var(--aq24-white) !important;
}
html body :is(.surface-dark,.section-dark,.dark-section,.hero-dark,.agent-lab-section,.v83-repro-section,.lab-dark,.sim-dark,.science-panel-dark,.site-footer,footer)
  :is(p,li,dt,dd,label,small,span,.meta,.muted,.subtitle,.desc,.lead):not(.eyebrow):not(.badge-label):not(.pill-label):not(.btn):not(.button):not([class*="btn"]):not(option):not(.surface-light-card *):not(.card--light *):not(.v83-proof-panel *){
  color:var(--aq24-white-2) !important;
  -webkit-text-fill-color:var(--aq24-white-2) !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel)
  :is(h1,h2,h3,h4,h5,h6,strong,b,.title){
  color:var(--aq24-white) !important;
  -webkit-text-fill-color:var(--aq24-white) !important;
}
html body :is(.surface-dark-card,.card--dark,.panel--dark,.agent-card,.v83-repro-card,.v91-sim-card,.agent-output-panel)
  :is(p,li,span,small,dt,dd,label,.meta,.muted,.subtitle,.desc):not(.eyebrow):not(option){
  color:var(--aq24-white-2) !important;
  -webkit-text-fill-color:var(--aq24-white-2) !important;
}

/* D. Formularios, selects y tablas */
html body :is(input,select,textarea,pre,code,kbd,samp){
  background-color:#ffffff !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
  border-color:var(--aq24-line) !important;
}
html body select option,
html body select optgroup{
  background:#ffffff !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
}
html body :is(table,thead,tbody,tr,td,th){
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
}
html body thead th{background:#e8f4fc !important;color:var(--aq24-ink) !important;}

/* E. Botones y etiquetas */
html body :is(button,.btn,.button,[class*="btn"],[class*="button"]):not(.secondary):not(.btn-secondary):not(.outline):not(.btn-outline){
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
html body :is(.btn-secondary,.secondary,.outline,.btn-outline){
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
  background:#ffffff !important;
}
html body :is(.eyebrow,.v91-eyebrow,.lab84-kicker,.lab84-badge,.badge-label,.section-badge,.pill-label):not(.is-dark):not(.dark){
  background:#ffffff !important;
  border:2px solid var(--aq24-accent) !important;
  color:var(--aq24-ink) !important;
  -webkit-text-fill-color:var(--aq24-ink) !important;
}
