/*
 * LDG ESG v4.5.6 — UI Integrity Recovery
 * Scope: final contrast, collapse controls, checkbox UX and technical-label cleanup only.
 * No routing, DB, CRUD, PDF/DOCX logic or core layout rewrites.
 */
:root{
  --ldg456-ink:#071f35;
  --ldg456-text:#12334d;
  --ldg456-muted:#385971;
  --ldg456-dark:#073b67;
  --ldg456-dark-2:#05263d;
  --ldg456-white:#ffffff;
  --ldg456-soft:#f6fbff;
  --ldg456-pale:#eaf4ff;
  --ldg456-line:#d7e7f2;
}

/* Last loaded hard rule: all known dark controls are white-on-dark. */
html body .ldg40-root.ldg456-ui-integrity .ldg42-action-link,
html body .ldg40-root.ldg456-ui-integrity a.ldg42-action-link,
html body .ldg40-root.ldg456-ui-integrity button.ldg42-action-link,
html body .ldg40-root.ldg456-ui-integrity .ldg42-gold-actionbar summary,
html body .ldg40-root.ldg456-ui-integrity .ldg453-actionbar summary,
html body .ldg40-root.ldg456-ui-integrity .ldg40-switch a.ldg42-action-link,
html body .ldg40-root.ldg456-ui-integrity .ldg456-dark-control,
html body .ldg40-root.ldg456-ui-integrity .ldg456-dark-control *{
  background:var(--ldg456-dark)!important;
  background-color:var(--ldg456-dark)!important;
  background-image:none!important;
  border-color:var(--ldg456-dark)!important;
  color:var(--ldg456-white)!important;
  -webkit-text-fill-color:var(--ldg456-white)!important;
  text-shadow:none!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg42-action-link *,
html body .ldg40-root.ldg456-ui-integrity .ldg42-gold-actionbar summary *,
html body .ldg40-root.ldg456-ui-integrity .ldg453-actionbar summary *{
  color:var(--ldg456-white)!important;
  -webkit-text-fill-color:var(--ldg456-white)!important;
  background:transparent!important;
  text-shadow:none!important;
}

/* Lifecycle/report chip symbols. */
html body .ldg40-root.ldg456-ui-integrity .ldg450-stage b,
html body .ldg40-root.ldg456-ui-integrity .ldg450-stage > b,
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a > b,
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a b,
html body .ldg40-root.ldg456-ui-integrity b.ldg456-chip,
html body .ldg40-root.ldg456-ui-integrity .ldg456-life-chip,
html body .ldg40-root.ldg456-ui-integrity .ldg456-report-chip{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  padding:0!important;
  border-radius:14px!important;
  background:var(--ldg456-dark)!important;
  background-color:var(--ldg456-dark)!important;
  background-image:none!important;
  border-color:var(--ldg456-dark)!important;
  color:var(--ldg456-white)!important;
  -webkit-text-fill-color:var(--ldg456-white)!important;
  font-weight:800!important;
  font-size:.82rem!important;
  line-height:1!important;
  text-align:center!important;
  text-shadow:none!important;
  overflow:hidden!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-stage b *,
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a b *,
html body .ldg40-root.ldg456-ui-integrity b.ldg456-chip *{
  color:var(--ldg456-white)!important;
  -webkit-text-fill-color:var(--ldg456-white)!important;
  background:transparent!important;
}

/* Boundary map: final decision is light cards with dark text. No dark internal title bars. */
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article,
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article.ldg456-boundary-card,
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article.ldg-surface-light,
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article.ldg-surface-dark{
  background:#ffffff!important;
  background-color:#ffffff!important;
  background-image:none!important;
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
  border:1px solid var(--ldg456-line)!important;
  border-top:4px solid var(--ldg456-dark)!important;
  box-shadow:0 14px 32px rgba(7,59,103,.06)!important;
  text-shadow:none!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,div),
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article.ldg456-boundary-card :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,div){
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
  text-shadow:none!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article :where(p,span,small,li,dd),
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article.ldg456-boundary-card :where(p,span,small,li,dd){
  background:transparent!important;
  background-color:transparent!important;
  color:var(--ldg456-muted)!important;
  -webkit-text-fill-color:var(--ldg456-muted)!important;
  text-shadow:none!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-boundary-grid > article em{
  display:inline-flex!important;
  align-items:center!important;
  background:var(--ldg456-pale)!important;
  color:var(--ldg456-dark)!important;
  -webkit-text-fill-color:var(--ldg456-dark)!important;
  border:1px solid #d4eaff!important;
  border-radius:999px!important;
  padding:4px 10px!important;
  font-style:normal!important;
  text-shadow:none!important;
}

/* Report cards: readable card text, chip separated from text. */
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a{
  color:var(--ldg456-ink)!important;
  background:#ffffff!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a :where(strong,h3,h4,label){
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a :where(p,span,small){
  color:var(--ldg456-muted)!important;
  -webkit-text-fill-color:var(--ldg456-muted)!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a > b + strong,
html body .ldg40-root.ldg456-ui-integrity .ldg450-report-grid a > b + h3{
  margin-top:8px!important;
}

/* Technical marker cleanup. */
html body .ldg40-root.ldg456-ui-integrity .ldg456-human-meta{
  display:block!important;
  margin-top:4px!important;
  color:var(--ldg456-muted)!important;
  -webkit-text-fill-color:var(--ldg456-muted)!important;
  font-size:.76rem!important;
  font-weight:500!important;
}

/* Checkbox UX: compact, aligned and explained. */
html body .ldg40-root.ldg456-ui-integrity .ldg43-wizard-form label.ldg40-check,
html body .ldg40-root.ldg456-ui-integrity label.ldg456-email-toggle{
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr)!important;
  align-items:start!important;
  gap:12px!important;
  max-width:760px!important;
  width:auto!important;
  margin:18px 0 14px!important;
  padding:14px 16px!important;
  background:var(--ldg456-soft)!important;
  border:1px solid var(--ldg456-line)!important;
  border-radius:16px!important;
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
}
html body .ldg40-root.ldg456-ui-integrity label.ldg456-email-toggle input,
html body .ldg40-root.ldg456-ui-integrity .ldg43-wizard-form label.ldg40-check input[type="checkbox"]{
  grid-column:1!important;
  width:18px!important;
  height:18px!important;
  margin:3px 0 0 0!important;
  justify-self:start!important;
}
html body .ldg40-root.ldg456-ui-integrity label.ldg456-email-toggle span{
  grid-column:2!important;
  display:block!important;
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
}
html body .ldg40-root.ldg456-ui-integrity label.ldg456-email-toggle strong{
  display:block!important;
  color:var(--ldg456-ink)!important;
  -webkit-text-fill-color:var(--ldg456-ink)!important;
  font-weight:700!important;
}
html body .ldg40-root.ldg456-ui-integrity label.ldg456-email-toggle small{
  display:block!important;
  margin-top:5px!important;
  color:var(--ldg456-muted)!important;
  -webkit-text-fill-color:var(--ldg456-muted)!important;
  line-height:1.45!important;
}

/* Added collapse controls. */
html body .ldg40-root.ldg456-ui-integrity .ldg456-collapse-bar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0 0 14px 0!important;
  padding:10px 12px!important;
  border:1px solid var(--ldg456-line)!important;
  background:linear-gradient(90deg,#f6fbff,#ffffff)!important;
  border-radius:14px!important;
  color:var(--ldg456-ink)!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg456-collapse-title{
  color:var(--ldg456-ink)!important;
  font-weight:700!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg456-collapse-btn{
  appearance:none!important;
  border:0!important;
  background:transparent!important;
  color:#0874d1!important;
  -webkit-text-fill-color:#0874d1!important;
  font-weight:800!important;
  cursor:pointer!important;
  padding:4px 6px!important;
}
html body .ldg40-root.ldg456-ui-integrity .ldg456-collapsed > :not(.ldg456-collapse-bar){
  display:none!important;
}

/* Generic runtime classes assigned by JS contrast scan. */
html body .ldg40-root .ldg456-force-light,
html body .ldg40-root .ldg456-force-light *{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  text-shadow:none!important;
}
html body .ldg40-root .ldg456-force-dark,
html body .ldg40-root .ldg456-force-dark *{
  color:#071f35!important;
  -webkit-text-fill-color:#071f35!important;
  text-shadow:none!important;
}
