/* 2026-08-09 comprehensive contrast/readability fix — AI law & technology foresight */
:root{
  --nxs-muted:#cbd7e3;
  --nxs-line:rgba(255,255,255,.16);
}
body{font-size:16px!important;line-height:1.8!important}

/* Main dark page: all explanatory text must remain readable. */
.lead,.method-head>p,.browser-head p,.section-title p,.thesis-box p,.row-summary,
.research-question,.index-card p,.index-card li,.master-link-status{
  color:#cbd7e3!important;
  font-size:16px!important;
  line-height:1.8!important;
}
.controls label span,.row-meta,.stat span,.research-index summary small{color:#b9cadd!important}

/* Prevent document-control light chips from leaking onto the dark main page. */
body > main .row-tags span,
body > main .chip-grid span,
body > main .mini-chips span,
body > main .article-tags span{
  background:#102f52!important;
  color:#dcecff!important;
  border-color:rgba(122,184,255,.30)!important;
  font-size:13px!important;
}
body > main .controls input,
body > main .controls select{
  background:#0d2948!important;
  color:#f2f6ff!important;
  border-color:rgba(255,255,255,.22)!important;
}
body > main .controls input::placeholder{color:#aebfd0!important}

/* Doctoral-link panel: remove pale/white chips and low-contrast copy. */
.thesis-box{
  background:#0b1d33!important;
  border-color:rgba(255,255,255,.20)!important;
}
.thesis-box .eyebrow{color:#9bc7f2!important}
.thesis-box h2{color:#f2f6ff!important}
.thesis-box>div:first-child>p:last-child{color:#cbd7e3!important}
#phdTags span{
  background:#102f52!important;
  color:#dcecff!important;
  border:1px solid rgba(122,184,255,.30)!important;
}
.lineage{
  background:#0a192b!important;
  border-color:rgba(255,255,255,.16)!important;
}
.lineage-step{
  background:#102f52!important;
  border-color:rgba(122,184,255,.22)!important;
}
.lineage-step-number{color:#9bc7f2!important}
.lineage-step-title{color:#e1ebf5!important}
.master-link-status{color:#b9cadd!important}
.master-link-status a{color:#9ed0ff!important}

/* Research modal is a single coherent paper-reading surface. */
.research-dialog{
  --doc-bg:#ffffff;
  --doc-soft:#f5f7f9;
  --doc-soft2:#eef3f8;
  --doc-text:#172335;
  --doc-muted:#42586d;
  --doc-subtle:#65788a;
  --doc-blue:#2e679d;
  --doc-line:#d7e0e9;
  background:var(--doc-bg)!important;
  color:var(--doc-text)!important;
  border-color:#c6d2de!important;
}
.research-dialog .dialog-shell,
.research-dialog .research-article,
.research-dialog #detailContent,
.research-dialog .article-body,
.research-dialog .article-section,
.research-dialog .article-section-body{
  background:var(--doc-bg)!important;
  color:var(--doc-text)!important;
}
.research-dialog .close{
  background:#eef3f8!important;
  color:#17324d!important;
  border-color:var(--doc-line)!important;
}
.research-dialog .article-header{background:var(--doc-bg)!important;border-color:var(--doc-line)!important}
.research-dialog .article-kicker{color:var(--doc-blue)!important}
.research-dialog .article-header h3,
.research-dialog .article-section-body h4{
  color:#17324d!important;
}
.research-dialog .article-header h3 small{color:#6c7f91!important}
.research-dialog .article-lead{
  color:var(--doc-muted)!important;
  font-size:17px!important;
  line-height:1.82!important;
}
.research-dialog .section-number{color:var(--doc-blue)!important;font-size:12px!important}
.research-dialog .article-section{
  border-color:var(--doc-line)!important;
  box-shadow:none!important;
}
.research-dialog .article-section-body p,
.research-dialog .article-section-body li{
  color:var(--doc-muted)!important;
  font-size:16px!important;
  line-height:1.84!important;
}

/* Question/note/warning/TOC stay light, never dark overlays. */
.research-dialog .article-question,
.research-dialog .article-note,
.research-dialog .forecast-warning,
.research-dialog .document-toc{
  background:var(--doc-soft)!important;
  color:var(--doc-text)!important;
  border-color:var(--doc-line)!important;
  box-shadow:none!important;
}
.research-dialog .article-question strong,
.research-dialog .article-note strong,
.research-dialog .document-toc-title{color:#245b86!important}
.research-dialog .article-question p,
.research-dialog .article-note p{color:var(--doc-muted)!important;font-size:16px!important;line-height:1.78!important}
.research-dialog .forecast-warning{background:#fbf8f0!important;border-color:#dfd1ae!important}
.research-dialog .forecast-warning strong{color:#785f25!important}
.research-dialog .forecast-warning p{color:#5a554b!important;font-size:16px!important;line-height:1.78!important}
.research-dialog .document-toc button{color:#42586d!important;font-size:14px!important}
.research-dialog .document-toc button span{color:var(--doc-blue)!important}

/* Tags and source links inside the white paper use dark text, not white-on-white. */
.research-dialog .article-tags span,
.research-dialog .chip-grid span,
.research-dialog .mini-chips span,
.research-dialog .row-tags span,
.research-dialog .detail-meta-row span{
  background:#eef3f8!important;
  color:#425f78!important;
  border-color:var(--doc-line)!important;
}
.research-dialog .source-list a,
.research-dialog .source-links a{
  background:#f7f9fb!important;
  color:#245f8c!important;
  border-color:var(--doc-line)!important;
}

/* Standard document footer remains on the same light surface. */
.research-dialog .document-footer{background:var(--doc-bg)!important;border-color:#bfcbd7!important}
.research-dialog .document-footer-copy strong{color:#17324d!important}
.research-dialog .document-footer-copy p{color:#65788a!important}
.research-dialog .document-footer-copy a{color:#245f8c!important}
.research-dialog .document-action{background:#f3f6f9!important;color:#245f8c!important;border-color:var(--doc-line)!important}
.research-dialog .document-action.close-action{background:#173f60!important;color:#fff!important;border-color:#173f60!important}

@media(max-width:620px){
  body{font-size:16px!important;line-height:1.8!important}
  .lead,.method-head>p,.browser-head p,.section-title p,.thesis-box p,.row-summary,
  .research-question,.index-card p,.index-card li,.master-link-status{font-size:16px!important;line-height:1.8!important}
  .research-dialog .article-lead,
  .research-dialog .article-section-body p,
  .research-dialog .article-section-body li,
  .research-dialog .article-question p,
  .research-dialog .article-note p,
  .research-dialog .forecast-warning p{font-size:16px!important;line-height:1.8!important}
  .research-dialog .article-section-body h4{font-size:18px!important}
}
