/*
 * LDG ESG v4.5.4.3 — Component Contrast Final Fix
 * Scope: targeted component contrast only. No routing, DB, CRUD, report logic or global grid changes. Includes only micro sizing on report chips to prevent label overlap.
 */
:root{
  --ldg4543-ink:#071f35;
  --ldg4543-text:#12334d;
  --ldg4543-muted:#405f76;
  --ldg4543-dark:#073b67;
  --ldg4543-dark-2:#05263d;
  --ldg4543-light:#ffffff;
  --ldg4543-soft:#f7fbfe;
  --ldg4543-pale:#eaf4ff;
  --ldg4543-line:#d7e7f2;
}

/* Absolute rule for dark clickable/action components that were still inheriting ink colors. */
.ldg40-root :is(
  .ldg42-action-link,
  .ldg42-gold-actionbar details > summary,
  .ldg453-actionbar details > summary,
  .ldg42-action-menu > a,
  .ldg40-switch .ldg42-action-link,
  a.ldg42-action-link,
  button.ldg42-action-link,
  .ldg40-primary,
  .ldg42-primary,
  .ldg453-primary,
  .ldg451-primary,
  .ldg42-action-dark
){
  background:var(--ldg4543-dark)!important;
  color:#ffffff!important;
  border-color:var(--ldg4543-dark)!important;
  text-shadow:none!important;
}
.ldg40-root :is(
  .ldg42-action-link,
  .ldg42-gold-actionbar details > summary,
  .ldg453-actionbar details > summary,
  .ldg42-action-menu > a,
  .ldg40-switch .ldg42-action-link,
  a.ldg42-action-link,
  button.ldg42-action-link,
  .ldg40-primary,
  .ldg42-primary,
  .ldg453-primary,
  .ldg451-primary,
  .ldg42-action-dark
) *{color:#ffffff!important;text-shadow:none!important;}

/* System Boundary Map: convert these long text cards to light cards to eliminate the fragile dark-surface issue. */
.ldg40-root .ldg450-boundary-grid > article,
.ldg40-root.ldg4543-component-contrast-final .ldg450-boundary-grid > article,
.ldg40-root .ldg450-boundary-grid > article.ldg-surface-dark,
.ldg40-root .ldg450-boundary-grid > article.ldg4542-surface-dark{
  background:#ffffff!important;
  color:var(--ldg4543-ink)!important;
  border:1px solid var(--ldg4543-line)!important;
  border-top:4px solid var(--ldg4543-dark)!important;
  box-shadow:0 14px 32px rgba(7,59,103,.05)!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-boundary-grid > article :is(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,div),
.ldg40-root .ldg450-boundary-grid > article.ldg-surface-dark :is(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,div),
.ldg40-root .ldg450-boundary-grid > article.ldg4542-surface-dark :is(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,div){
  color:var(--ldg4543-ink)!important;
  background:transparent!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-boundary-grid > article :is(p,span,small,li,dd),
.ldg40-root .ldg450-boundary-grid > article.ldg-surface-dark :is(p,span,small,li,dd),
.ldg40-root .ldg450-boundary-grid > article.ldg4542-surface-dark :is(p,span,small,li,dd){
  color:var(--ldg4543-muted)!important;
  background:transparent!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-boundary-grid > article em,
.ldg40-root .ldg450-boundary-grid > article.ldg-surface-dark em,
.ldg40-root .ldg450-boundary-grid > article.ldg4542-surface-dark em{
  background:var(--ldg4543-pale)!important;
  color:var(--ldg4543-dark)!important;
  border:1px solid #d4eaff!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-boundary-grid > article em *{color:var(--ldg4543-dark)!important;background:transparent!important;}

/* Dark chip text in lifecycle/report cards: these are dark chips inside light cards, not full dark surfaces. */
.ldg40-root .ldg450-stage > b,
.ldg40-root .ldg450-stage b,
.ldg40-root .ldg450-report-grid > a > b,
.ldg40-root .ldg450-report-grid a b,
.ldg40-root .ldg43-checks b,
.ldg40-root .ldg44-carbon-steps article b,
.ldg40-root .ldg43-icon-dark,
.ldg40-root .ldg450-icon{
  background:var(--ldg4543-dark)!important;
  color:#ffffff!important;
  border-color:var(--ldg4543-dark)!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-stage > b *,
.ldg40-root .ldg450-stage b *,
.ldg40-root .ldg450-report-grid > a > b *,
.ldg40-root .ldg450-report-grid a b *,
.ldg40-root .ldg43-checks b *,
.ldg40-root .ldg44-carbon-steps article b *,
.ldg40-root .ldg43-icon-dark *,
.ldg40-root .ldg450-icon *{color:#ffffff!important;background:transparent!important;text-shadow:none!important;}

/* Report grid cards: text and badges must not overlap or inherit chip color. */
.ldg40-root .ldg450-report-grid > a{
  background:#ffffff!important;
  color:var(--ldg4543-ink)!important;
  border-color:var(--ldg4543-line)!important;
  text-shadow:none!important;
}
.ldg40-root .ldg450-report-grid > a > b{
  min-width:44px!important;
  width:auto!important;
  max-width:96px!important;
  padding:0 10px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  font-size:.75rem!important;
  line-height:1!important;
}
.ldg40-root .ldg450-report-grid > a :is(strong,h3,h4,label){color:var(--ldg4543-ink)!important;background:transparent!important;}
.ldg40-root .ldg450-report-grid > a :is(span,p,small,em:not(:last-child)){color:var(--ldg4543-muted)!important;background:transparent!important;}
.ldg40-root .ldg450-report-grid > a > em,
.ldg40-root .ldg450-report-grid > a .ldg-report-action{
  background:var(--ldg4543-pale)!important;
  color:var(--ldg4543-dark)!important;
  border-color:#d4eaff!important;
}

/* Safety for any explicitly dark surface that remains after component-specific overrides. */
.ldg40-root :is(.ldg-surface-dark,.ldg4542-surface-dark,.ldg4543-surface-dark,.ldg40-hero,.ldg40-sidebar) :is(h1,h2,h3,h4,h5,h6,strong,b,label,summary,dt,a),
.ldg40-root :is(.ldg-surface-dark,.ldg4542-surface-dark,.ldg4543-surface-dark,.ldg40-hero,.ldg40-sidebar) :is(p,span,small,li,dd,em){
  color:#ffffff!important;
  text-shadow:none!important;
}
.ldg40-root :is(.ldg-surface-dark,.ldg4542-surface-dark,.ldg4543-surface-dark,.ldg40-hero,.ldg40-sidebar) :is(p,span,small,li,dd){color:#eaf4ff!important;}

/* But never allow white text inside known light form/table/card surfaces. */
.ldg40-root :is(
  .ldg40-field,
  .ldg40-inline-guide,
  .ldg40-help,
  .ldg40-switch,
  .ldg40-stat,
  .ldg450-stage,
  .ldg450-report-grid > a,
  .ldg450-boundary-facts > div,
  .ldg44-table-wrap,
  table,
  td,
  input,
  select,
  textarea
){
  color:var(--ldg4543-ink)!important;
  text-shadow:none!important;
}
.ldg40-root :is(input,select,textarea){background:#ffffff!important;color:var(--ldg4543-ink)!important;border-color:var(--ldg4543-line)!important;}
.ldg40-root :is(input,select,textarea)::placeholder{color:#60788d!important;opacity:1!important;}

/* Known warning/action panels are light surfaces. */
.ldg40-root :is(.tone-warning,.status-warn,.ldg44-badge.tone-warning){background:#fff7e8!important;color:#8a4b00!important;}
.ldg40-root :is(.tone-danger,.status-danger,.ldg44-badge.tone-danger){background:#fdecec!important;color:#b42318!important;}
.ldg40-root :is(.tone-success,.status-ok,.ldg44-badge.tone-success){background:#ecf8e8!important;color:#287d4c!important;}
.ldg40-root :is(.tone-warning,.tone-danger,.tone-success,.status-warn,.status-danger,.status-ok,.ldg44-badge) *{color:inherit!important;}

/* PDF/print guard for the same components. */
@media print{
  .ldg40-root .ldg450-boundary-grid > article,
  .ldg40-root .ldg450-boundary-grid > article *{background:#ffffff!important;color:#071f35!important;}
  .ldg40-root .ldg450-stage b,
  .ldg40-root .ldg450-report-grid a b{background:#073b67!important;color:#ffffff!important;}
}
