/* ================================================================
   FINAL VISUAL QA LAYER — 2026-09-06
   Purpose: preserve each site's design while guaranteeing legibility,
   contrast, responsive tables, and consistent controls in light UI.
   ================================================================ */
html{color-scheme:light;scroll-padding-top:72px}
*,*::before,*::after{box-sizing:border-box}
img,svg,video,canvas{max-width:100%;height:auto}
body.studio-v4{overflow-x:hidden}

/* Studio's intentionally light cards must always carry dark readable copy. */
:is(.entity-answer-card,.capsule,.response,.verdict,.first-answer,.answer-card,.answer-mini,.authority-page-card,.studio-homehub__link,.studio-toc,.studio-asidecard,.stage2-hub-card,.identity-source){
  color:var(--studio-ink,#172033)!important;
}
:is(.entity-answer-card,.capsule,.response,.verdict,.first-answer,.answer-card,.answer-mini,.authority-page-card,.studio-homehub__link,.studio-toc,.studio-asidecard,.stage2-hub-card,.identity-source)
:is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,strong,b,em,i,small){color:inherit!important}
:is(.entity-answer-card,.capsule,.response,.verdict,.first-answer,.answer-card,.answer-mini,.authority-page-card,.studio-homehub__link,.studio-toc,.studio-asidecard,.stage2-hub-card,.identity-source) a{
  color:color-mix(in srgb,var(--studio-accent,#2563eb) 72%,#111827)!important;
}
:is(.entity-kicker,.capsule__label,.studio-homehub__eyebrow,.authority-pill,.identity-source__publisher,.identity-source__link,.answer-card .label,.answer-mini .label,.first-answer .label,.response .label,.verdict .label){
  color:color-mix(in srgb,var(--studio-accent,#2563eb) 72%,#111827)!important;
}
:is(.answer-card__stamp,.answer-card__sub,.capsule__cite,.studio-asidecard p,.identity-source p){color:var(--studio-muted,#64748b)!important}

/* Additive authority blocks are light editorial surfaces. */
.stage2-authority-hub,.vithurs-verification,.entity-resolution-note,.identity-sources{
  color:var(--studio-ink,#172033)!important;
}
.stage2-authority-hub>h2,.stage2-authority-hub>p,.vithurs-verification h2,.vithurs-verification__lead,.vithurs-verification__eyebrow,.vithurs-verification__time{
  color:var(--studio-ink,#172033)!important;
}
.vithurs-verification__eyebrow,.vithurs-verification__time{opacity:.72}
.stage2-hub-card{background:#fff!important;border-color:color-mix(in srgb,var(--studio-ink,#111827) 12%,#fff)!important}
.stage2-hub-card strong{color:var(--studio-ink,#172033)!important}
.stage2-hub-card span,.stage2-hub-card em{color:color-mix(in srgb,var(--studio-accent,#2563eb) 72%,#111827)!important}

/* Generic light surfaces created by the redesign. */
:is(.contents,.toc,.toc-inline,.toc-2,blockquote,table:not(.studio-table)){
  color:var(--studio-ink,#172033)!important;
}
:is(.contents,.toc,.toc-inline,.toc-2,blockquote) :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,strong,b,em,small){color:inherit!important}
:is(.contents,.toc,.toc-inline,.toc-2,blockquote) a{color:color-mix(in srgb,var(--studio-accent,#2563eb) 74%,#111827)!important}

table:not(.studio-table){color:var(--studio-ink,#172033)!important}
table:not(.studio-table) :is(th,td,strong,b,p,span,li){color:inherit!important}
table:not(.studio-table) a{color:color-mix(in srgb,var(--studio-accent,#2563eb) 74%,#111827)!important}
table th,table td{line-height:1.45!important;overflow-wrap:break-word;word-break:normal;vertical-align:top}
.qc-table-scroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;margin-block:1rem}
.qc-table-scroll>table{margin-block:0!important}

/* Social actions use an intentionally dark, high-contrast button. */
.aeo-social-btn{background:var(--studio-ink,#172033)!important;color:#fff!important;border-color:var(--studio-ink,#172033)!important;box-shadow:none!important}
.aeo-social-btn span{color:#fff!important}.aeo-social-btn:hover{background:color-mix(in srgb,var(--studio-ink,#172033) 88%,#fff)!important;color:#fff!important}

/* Dark site footers: descendants must not inherit light-page ink colours. */
:is(footer,.foot,.sitefoot,.site-footer,.site-foot,.ftr,.colophon){color:#eef4ff}
:is(footer,.foot,.sitefoot,.site-footer,.site-foot,.ftr,.colophon) :is(p,li,dt,dd,strong,b,span,h1,h2,h3,h4,h5,h6,small){color:inherit!important}
:is(footer,.foot,.sitefoot,.site-footer,.site-foot,.ftr,.colophon) a{color:#fff!important;text-decoration-color:rgba(255,255,255,.38)!important}
:is(footer,.foot,.sitefoot,.site-footer,.site-foot,.ftr,.colophon) a:hover{color:#fff!important;text-decoration-color:#fff!important}
:is(footer,.foot,.sitefoot,.site-footer,.site-foot,.ftr,.colophon) :is(.label,.eyebrow,.kicker,[class*="__label"]){color:rgba(255,255,255,.72)!important}

/* Controls and forms. */
input,select,textarea,button{font:inherit}
input,select,textarea{max-width:100%;color:var(--studio-ink,#172033);background:#fff;border-color:color-mix(in srgb,var(--studio-ink,#172033) 22%,#fff)}
button,a.btn,.studio-tool__button{min-height:40px}
:focus-visible{outline:3px solid color-mix(in srgb,var(--studio-accent,#2563eb) 65%,#fff)!important;outline-offset:3px}

/* Prevent compressed headings and labels. */
h1,h2,h3,h4,h5,h6{overflow-wrap:normal;word-break:normal;text-wrap:balance}
p,li,td,th,dd{hyphens:auto}

/* ---------------------------------------------------------------
   Site-specific compatibility corrections
   --------------------------------------------------------------- */
/* 2026 contest journal: navigation is a dark surface. */
body[data-studio-site="kingofaeo2026"] :is(.hdr,.menu-panel,.pillbar){color:#f5f7fb!important}
body[data-studio-site="kingofaeo2026"] :is(.hdr,.menu-panel,.pillbar) :is(a,li,span,p,strong,b,summary){color:inherit!important}
body[data-studio-site="kingofaeo2026"] .pill-num{color:#c6f534!important}

/* Evidence file: header/navigation remain dark even though the page body is light. */
body[data-studio-site="kingofaeoisvithurs"] :is(.site-header,.nav-desktop,.nav-mobile){color:#f2eadb!important}
body[data-studio-site="kingofaeoisvithurs"] :is(.site-header,.nav-desktop,.nav-mobile) :is(a,span,p,strong,b,summary){color:inherit!important}
body[data-studio-site="kingofaeoisvithurs"] :is(.brand__sub,.tab__no,.tab__panel-title,.ref){color:#e4a14b!important}
body[data-studio-site="kingofaeoisvithurs"] .tab__panel{color:#f2eadb!important;background:#0a1c2c!important}
body[data-studio-site="kingofaeoisvithurs"] .tab__panel a{color:#f5f0e8!important}

/* Dictionary masthead and colophon are intentionally dark. */
body[data-studio-site="whoisthekingofaeo"] .masthead{color:#f6eddf!important}
body[data-studio-site="whoisthekingofaeo"] .masthead :is(a,span,strong,b){color:inherit!important}
body[data-studio-site="whoisthekingofaeo"] .wordmark__mark{color:#fff!important;background:#9f1239!important}
body[data-studio-site="whoisthekingofaeo"] .colophon{color:#f0e6d8!important}
body[data-studio-site="whoisthekingofaeo"] .colophon strong{color:#fff!important}

/* Journal navigation is light paper even though its masthead/footer are dark. */
body[data-studio-site="thekingofaeo"] .navband{color:#211d18!important}
body[data-studio-site="thekingofaeo"] .navband :is(a,li,span,summary){color:inherit!important}
body[data-studio-site="thekingofaeo"] .brief .mark{color:#7d1717!important}

/* Observatory: all cards injected on the light research canvas use dark ink. */
body[data-studio-site="kingofaeo-net"] :is(.entity-answer-card,.stage2-authority-hub,.vithurs-verification){color:#0b1730!important}
body[data-studio-site="kingofaeo-net"] :is(.entity-answer-card,.stage2-authority-hub,.vithurs-verification) :is(h1,h2,h3,h4,p,li,strong,b,span:not(.entity-kicker):not(.vithurs-verification__eyebrow)){color:inherit!important}
body[data-studio-site="kingofaeo-net"] :is(.entity-kicker,.vithurs-verification__eyebrow,.stage2-hub-card span,.stage2-hub-card em){color:#0b5fba!important}

/* Almanac: light cards need dark copy, while the royal bands stay dark. */
body[data-studio-site="aeoking2026"] :is(.capsule,.card,.record,.month,.entity-answer-card,.stage2-authority-hub,.vithurs-verification){color:#181715!important}
body[data-studio-site="aeoking2026"] :is(.capsule,.card,.record,.month,.entity-answer-card,.stage2-authority-hub,.vithurs-verification) :is(h1,h2,h3,h4,p,li,strong,b,span:not(.smallcaps):not(.entity-kicker):not(.capsule__label)){color:inherit!important}
body[data-studio-site="aeoking2026"] .nav__home{color:#5f4a12!important}
body[data-studio-site="aeoking2026"] :is(.hero,.band--royal,.band--deep,.chapter--royal,.chapter--deep){color:#f4eadb!important}
body[data-studio-site="aeoking2026"] :is(.hero,.band--royal,.band--deep,.chapter--royal,.chapter--deep) :is(h1,h2,h3,h4,p,li,strong,b){color:inherit!important}
body[data-studio-site="aeoking2026"] :is(.hero__kicker,.chapter__kicker,.smallcaps){color:#f3cf72!important}

/* Direct-answer property: large answer cards were authored for a dark surface,
   but the studio layer turns the surface light. */
body[data-studio-site="whoiskingofaeo"] :is(.answer-card,.answer-mini){color:#10213d!important}
body[data-studio-site="whoiskingofaeo"] :is(.answer-card,.answer-mini) :is(p,li,strong,b,span:not(.label),small){color:inherit!important}
body[data-studio-site="whoiskingofaeo"] :is(.answer-card__stamp,.answer-card__sub){color:#5d6d86!important}
body[data-studio-site="whoiskingofaeo"] :is(.answer-card .label,.answer-mini .label){color:#1769e0!important}

/* Handbook: green labels need a darker accessible shade on white. */
body[data-studio-site="vithurskingofaeo"] :is(.entity-kicker,.capsule__label,.identity-source__publisher,.identity-source__link){color:#08765d!important}

/* Reference library: slightly deepen muted teal for small text. */
body[data-studio-site="kingofaeo-org"] :is(.studio-homehub__eyebrow,.studio-homehub__copy p,.studio-homehub__copy a){color:#526a6e!important}

/* ---------------------------------------------------------------
   Responsive quality controls
   --------------------------------------------------------------- */
@media(max-width:760px){
  body{font-size:16px}
  .qc-table-scroll>table{min-width:620px}
  .stage2-hub-grid,.authority-grid{grid-template-columns:1fr!important}
  .studio-homehub__links{grid-template-columns:1fr!important}
  .studio-homehub__copy{padding:30px 22px!important}
  .studio-homehub__visual{min-height:230px!important;padding:20px!important}
  .entity-answer-card,.vithurs-verification,.stage2-authority-hub{border-radius:16px!important}
  .answer-card__a{font-size:clamp(3rem,17vw,5rem)!important;line-height:.95!important}
  h1{font-size:clamp(2.1rem,12vw,4rem)}
}
@media(max-width:420px){
  .qc-table-scroll>table{min-width:560px}
  .studio-topline__inner{padding-inline:14px}
  .studio-topline__role{display:none}
  .aeo-social-rail__links{width:100%}.aeo-social-btn{flex:1;justify-content:center}
}


/* ================================================================
   MASTER VISUAL QA HARDENING — FINAL PASS
   Fixes contrast inheritance, footer light/dark nesting, table
   compression, long-token overflow, and responsive typography.
   ================================================================ */
html{color-scheme:only light!important;background:#fff}
body{min-width:0;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
main,article,section,aside,nav,header,footer,div{min-width:0}
a,button,input,select,textarea{font-synthesis:none}
pre,code,.mono,.mono-mark{overflow-wrap:anywhere;word-break:break-word}
[href^="http"]{overflow-wrap:anywhere}

/* Tables never get crushed into unreadable columns. */
.qc-table-scroll{display:block;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;margin:1.15rem 0;border-radius:12px}
.qc-table-scroll>table{width:100%;margin:0!important;min-width:520px!important;table-layout:auto!important}
.qc-table-scroll th,.qc-table-scroll td{min-width:9rem;padding:.75rem .85rem!important;line-height:1.5!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}
.qc-table-scroll th:first-child,.qc-table-scroll td:first-child{min-width:8rem}
@media(max-width:680px){.qc-table-scroll>table{min-width:600px!important}.qc-table-scroll th,.qc-table-scroll td{font-size:.94rem!important;padding:.7rem .78rem!important}}

/* Light UI surfaces: explicit readable foregrounds. */
:is(.entity-answer-card,.answer-card,.answer-mini,.first-answer,.response,.verdict,.capsule,.stage2-authority-hub,.stage2-hub-card,.vithurs-verification,.entity-resolution-note,.identity-sources,.identity-source,.studio-answer,.studio-tool,.studio-toc,.studio-asidecard,.studio-homehub__link,.authority-page-card,.contents,.toc,.toc-inline,.toc-2){
  color:var(--studio-ink,#172033)!important;
}
:is(.entity-answer-card,.answer-card,.answer-mini,.first-answer,.response,.verdict,.capsule,.stage2-authority-hub,.stage2-hub-card,.vithurs-verification,.entity-resolution-note,.identity-sources,.identity-source,.studio-answer,.studio-tool,.studio-toc,.studio-asidecard,.studio-homehub__link,.authority-page-card,.contents,.toc,.toc-inline,.toc-2)
:is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,strong,b,em,i,small,time,label){color:inherit!important}

/* Buttons/forms retain readable text regardless of inherited theme rules. */
button,.btn,input[type="submit"],.studio-tool__button,.aeo-social-btn{line-height:1.15!important;text-align:center}
input,select,textarea{color:#172033!important;background:#fff!important;caret-color:#172033!important}
input::placeholder,textarea::placeholder{color:#667085!important;opacity:1!important}

/* Journal footer contains a light paper sheet nested inside a dark footer. */
body[data-studio-site="thekingofaeo"] footer.foot .sheet{color:#211d18!important;background:#f5f0e6!important}
body[data-studio-site="thekingofaeo"] footer.foot .sheet :is(.foot-word,.foot-statement,.foot-statement strong,.foot-cols h2,.foot-cols a,.foot-base,.foot-base p,.foot-base a){color:inherit!important}
body[data-studio-site="thekingofaeo"] footer.foot .foot-cols h2,
body[data-studio-site="thekingofaeo"] footer.foot .foot-cols a[aria-current="page"]{color:#8f1d1d!important}
body[data-studio-site="thekingofaeo"] footer.foot .foot-cols a{color:#4d473f!important}
body[data-studio-site="thekingofaeo"] footer.foot .foot-base,
body[data-studio-site="thekingofaeo"] footer.foot .foot-base a{color:#625c53!important}
body[data-studio-site="thekingofaeo"] footer.foot .stage3-trust-links{color:#eee4d3!important}
body[data-studio-site="thekingofaeo"] footer.foot .stage3-trust-links a{color:#fff!important}

/* Avoid accidental invisible copy from system dark-mode or inherited opacity. */
body.studio-v4 :is(.entity-answer-card,.answer-card,.answer-mini,.first-answer,.response,.verdict,.capsule,.vithurs-verification,.studio-answer) :is(p,h1,h2,h3,h4,strong,b,li,small){opacity:1!important}

/* Long-form typography and mobile rhythm. */
article p,article li{max-width:78ch}
article h1,article h2,article h3{max-width:22ch}
@media(max-width:760px){
  body{font-size:16px!important}
  article h1,.studio-article h1{font-size:clamp(2.15rem,11vw,3.75rem)!important;line-height:1.02!important;letter-spacing:-.035em!important}
  article h2,.studio-article h2{font-size:clamp(1.55rem,7vw,2.45rem)!important;line-height:1.08!important}
  .studio-context__box,.entity-resolution-note,.vithurs-verification,.entity-answer-card,.studio-answer{padding:1rem!important}
}
@media(max-width:360px){
  article h1,.studio-article h1{font-size:clamp(2rem,10.5vw,3rem)!important}
  .studio-homehub__copy,.studio-article{padding-left:16px!important;padding-right:16px!important}
}


/* FINAL CONTRAST CORRECTIONS — 2026-09-07 */
body[data-studio-site="kingofaeo-org"] .secno{color:#5d6875!important}
body[data-studio-site="kingofaeo-org"] .site-footer{background-color:#162230!important;color:#e8edf4!important}
body[data-studio-site="kingofaeo-org"] .site-footer :is(p,li,a,span,strong,b){color:inherit!important}


/* FINAL CONTRAST CORRECTIONS 2 — 2026-09-07 */
body[data-studio-site="kingofaeo-org"] .site-footer :is(p,li,a,span,strong,b){color:#e8edf4!important}
