/*
 * LDG ESG v4.5.4.1 — Contrast Guard Lockdown
 * Scope: contrast only. No routing, no layout engine, no CRUD, no report logic.
 * Loaded after every previous ESG CSS layer.
 */
:root{
  --ldg4541-dark:#073b67;
  --ldg4541-dark-2:#05263d;
  --ldg4541-light:#ffffff;
  --ldg4541-light-2:#f7fbfe;
  --ldg4541-ink:#071f35;
  --ldg4541-text:#12334d;
  --ldg4541-muted:#405f76;
  --ldg4541-subtle:#eaf4ff;
  --ldg4541-line:#d7e7f2;
  --ldg4541-warn:#8a4b00;
  --ldg4541-warn-bg:#fff7e8;
  --ldg4541-danger:#b42318;
  --ldg4541-danger-bg:#fdecec;
  --ldg4541-success:#287d4c;
  --ldg4541-success-bg:#ecf8e8;
}

/* Base: the app must default to dark text on light surface. */
.ldg40-root{
  color:var(--ldg4541-ink)!important;
  background:#eef6fb!important;
}
.ldg40-root .ldg40-content,
.ldg40-root main{
  color:var(--ldg4541-ink)!important;
}

/* Light surfaces: hard lock dark text. */
.ldg40-root .ldg40-card:not(.ldg40-hero):not(.ldg42-priority),
.ldg40-root .ldg43-panel,
.ldg40-root .ldg43-metric,
.ldg40-root .ldg450-card,
.ldg40-root .ldg451-view,
.ldg40-root .ldg451-report-grid article,
.ldg40-root .ldg451-report-catalog article,
.ldg40-root .ldg441-branding-panel,
.ldg40-root .ldg441-brand-panel,
.ldg40-root .ldg441-brand-strip,
.ldg40-root .ldg441-preview,
.ldg40-root .ldg441-upload,
.ldg40-root .ldg441-logo-frame,
.ldg40-root .ldg441-brand-chip,
.ldg40-root .ldg40-switch,
.ldg40-root .ldg42-gold-actionbar,
.ldg40-root .ldg42-action-menu,
.ldg40-root details,
.ldg40-root summary{
  background-color:var(--ldg4541-light)!important;
  color:var(--ldg4541-ink)!important;
  border-color:var(--ldg4541-line)!important;
}
.ldg40-root .ldg40-card:not(.ldg40-hero):not(.ldg42-priority) :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary),
.ldg40-root .ldg43-panel :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary),
.ldg40-root .ldg450-card :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary),
.ldg40-root .ldg451-view :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary),
.ldg40-root .ldg441-branding-panel :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary),
.ldg40-root .ldg441-brand-chip :where(h1,h2,h3,h4,h5,h6,strong,b,label,summary){
  color:var(--ldg4541-ink)!important;
}
.ldg40-root .ldg40-card:not(.ldg40-hero):not(.ldg42-priority) :where(p,span,small,em,li,dd,dt),
.ldg40-root .ldg43-panel :where(p,span,small,em,li,dd,dt),
.ldg40-root .ldg450-card :where(p,span,small,em,li,dd,dt),
.ldg40-root .ldg451-view :where(p,span,small,em,li,dd,dt),
.ldg40-root .ldg441-branding-panel :where(p,span,small,em,li,dd,dt),
.ldg40-root .ldg441-brand-chip :where(p,span,small,em,li,dd,dt){
  color:var(--ldg4541-muted)!important;
}

/* Form controls on light surfaces. */
.ldg40-root input,
.ldg40-root select,
.ldg40-root textarea{
  background:#ffffff!important;
  color:var(--ldg4541-ink)!important;
  border-color:#cbdfea!important;
}
.ldg40-root input::placeholder,
.ldg40-root textarea::placeholder{
  color:#6f899c!important;
  opacity:1!important;
}
.ldg40-root .ldg40-help,
.ldg40-root .ldg40-inline-guide,
.ldg40-root .ldg451-help,
.ldg40-root .ldg453-help{
  background:#eaf4ff!important;
  color:var(--ldg4541-ink)!important;
  border-color:#cce4f4!important;
}
.ldg40-root .ldg40-help *,
.ldg40-root .ldg40-inline-guide *,
.ldg40-root .ldg451-help *,
.ldg40-root .ldg453-help *{
  color:var(--ldg4541-ink)!important;
}

/* Dark surfaces: final lock. This block intentionally comes after light-surface rules. */
.ldg40-root .ldg40-sidebar,
.ldg40-root .ldg40-hero,
.ldg40-root .ldg42-priority,
.ldg40-root .ldg450-boundary-grid article,
.ldg40-root .ldg4541-surface-dark,
.ldg40-root [data-surface="dark"]{
  background-color:var(--ldg4541-dark)!important;
  color:#ffffff!important;
  border-color:rgba(255,255,255,.22)!important;
}
.ldg40-root .ldg40-sidebar *,
.ldg40-root .ldg40-hero *,
.ldg40-root .ldg42-priority *,
.ldg40-root .ldg450-boundary-grid article *,
.ldg40-root .ldg4541-surface-dark *,
.ldg40-root [data-surface="dark"] *{
  color:#ffffff!important;
}
.ldg40-root .ldg40-sidebar :where(p,span,small,em,li),
.ldg40-root .ldg40-hero :where(p,span,small,em,li),
.ldg40-root .ldg42-priority :where(p,span,small,em,li),
.ldg40-root .ldg450-boundary-grid article :where(p,span,small,em,li),
.ldg40-root .ldg4541-surface-dark :where(p,span,small,em,li),
.ldg40-root [data-surface="dark"] :where(p,span,small,em,li){
  color:var(--ldg4541-subtle)!important;
}
.ldg40-root .ldg450-boundary-grid article em,
.ldg40-root .ldg40-hero aside,
.ldg40-root .ldg40-sidebar .ldg40-access{
  background:rgba(255,255,255,.14)!important;
  border-color:rgba(255,255,255,.28)!important;
  color:#ffffff!important;
}
.ldg40-root .ldg450-boundary-grid article em *,
.ldg40-root .ldg40-hero aside *,
.ldg40-root .ldg40-sidebar .ldg40-access *{
  color:#ffffff!important;
}

/* Exception: white pills inside dark sidebar must keep dark text. */
.ldg40-root .ldg40-sidebar .ldg40-access span,
.ldg40-root .ldg40-sidebar .ldg40-access span *{
  background:#ffffff!important;
  color:var(--ldg4541-dark-2)!important;
}
.ldg40-root .ldg40-sidebar nav a.active em{
  background:#a8c72a!important;
  color:var(--ldg4541-dark-2)!important;
}

/* Dark icon chips inside light cards: readable icon text, but do not turn the whole card dark. */
.ldg40-root .ldg450-stage b,
.ldg40-root .ldg450-report-grid a b,
.ldg40-root .ldg43-checks b,
.ldg40-root .ldg44-carbon-steps article b,
.ldg40-root .ldg450-stage .ldg450-icon,
.ldg40-root .ldg43-icon-dark{
  background:var(--ldg4541-dark)!important;
  color:#ffffff!important;
}
.ldg40-root .ldg450-stage b *,
.ldg40-root .ldg450-report-grid a b *,
.ldg40-root .ldg43-checks b *,
.ldg40-root .ldg44-carbon-steps article b *{
  color:#ffffff!important;
}

/* Buttons and action states. */
.ldg40-root button,
.ldg40-root .ldg44-button,
.ldg40-root .ldg451-link,
.ldg40-root a.button{
  color:#ffffff!important;
}
.ldg40-root .ldg44-button.ghost,
.ldg40-root .ldg451-link,
.ldg40-root .ldg42-action-menu a,
.ldg40-root .ldg42-action-menu button:not(.danger):not(.warn):not(.primary){
  background:#eaf4ff!important;
  color:var(--ldg4541-dark)!important;
  border-color:#cce4f4!important;
}
.ldg40-root .ldg42-action-menu .danger,
.ldg40-root .ldg42-action-menu button.danger{
  background:var(--ldg4541-danger-bg)!important;
  color:var(--ldg4541-danger)!important;
}
.ldg40-root .ldg42-action-menu .warn,
.ldg40-root .ldg42-action-menu button.warn{
  background:var(--ldg4541-warn-bg)!important;
  color:var(--ldg4541-warn)!important;
}

/* Status/badges. */
.ldg40-root .tone-danger,
.ldg40-root .ldg44-badge.tone-danger,
.ldg40-root .status-danger{
  background:var(--ldg4541-danger-bg)!important;
  color:var(--ldg4541-danger)!important;
}
.ldg40-root .tone-warning,
.ldg40-root .ldg44-badge.tone-warning,
.ldg40-root .status-warn{
  background:var(--ldg4541-warn-bg)!important;
  color:var(--ldg4541-warn)!important;
}
.ldg40-root .tone-success,
.ldg40-root .ldg44-badge.tone-success,
.ldg40-root .status-ok{
  background:var(--ldg4541-success-bg)!important;
  color:var(--ldg4541-success)!important;
}
.ldg40-root .ldg44-badge,
.ldg40-root .pill,
.ldg40-root .ldg451-pill,
.ldg40-root .ldg430-pill{
  background:#eaf4ff!important;
  color:var(--ldg4541-dark)!important;
}

/* Client branding: white box must never contain white or pale text. */
.ldg40-root .ldg441-brand-chip,
.ldg40-root .ldg441-empty-logo,
.ldg40-root .ldg441-logo-frame,
.ldg40-root .ldg441-preview-box,
.ldg40-root .ldg441-logo-box,
.ldg40-root .ldg441-brand-strip{
  background:#ffffff!important;
  color:var(--ldg4541-ink)!important;
  border-color:var(--ldg4541-line)!important;
}
.ldg40-root .ldg441-brand-chip *,
.ldg40-root .ldg441-empty-logo *,
.ldg40-root .ldg441-logo-frame *,
.ldg40-root .ldg441-preview-box *,
.ldg40-root .ldg441-logo-box *,
.ldg40-root .ldg441-brand-strip *{
  color:var(--ldg4541-ink)!important;
}
.ldg40-root .ldg441-brand-chip :where(small,span,em),
.ldg40-root .ldg441-empty-logo :where(small,span,em),
.ldg40-root .ldg441-logo-frame :where(small,span,em),
.ldg40-root .ldg441-preview-box :where(small,span,em){
  color:var(--ldg4541-muted)!important;
}

/* Tables: hard readable headers and cells. */
.ldg40-root table,
.ldg40-root tbody,
.ldg40-root td{
  background:#ffffff!important;
  color:var(--ldg4541-ink)!important;
}
.ldg40-root td *{
  color:var(--ldg4541-ink)!important;
}
.ldg40-root thead,
.ldg40-root thead tr,
.ldg40-root th{
  background:var(--ldg4541-dark)!important;
  color:#ffffff!important;
}
.ldg40-root th *{
  color:#ffffff!important;
}
.ldg40-root tbody tr:nth-child(even) td{
  background:#f7fbfe!important;
}

/* Final named component fixes observed in runtime screenshots. */
.ldg40-root .ldg450-boundary,
.ldg40-root .ldg450-lifecycle,
.ldg40-root .ldg450-impact,
.ldg40-root .ldg450-quality,
.ldg40-root .ldg450-scenarios,
.ldg40-root .ldg450-reporting{
  background:#ffffff!important;
  color:var(--ldg4541-ink)!important;
}
.ldg40-root .ldg450-boundary .ldg40-section-head,
.ldg40-root .ldg450-lifecycle .ldg40-section-head,
.ldg40-root .ldg450-impact .ldg40-section-head,
.ldg40-root .ldg450-quality .ldg40-section-head,
.ldg40-root .ldg450-scenarios .ldg40-section-head,
.ldg40-root .ldg450-reporting .ldg40-section-head{
  background:#ffffff!important;
  color:var(--ldg4541-ink)!important;
}
.ldg40-root .ldg450-boundary .ldg40-section-head *,
.ldg40-root .ldg450-lifecycle .ldg40-section-head *,
.ldg40-root .ldg450-impact .ldg40-section-head *,
.ldg40-root .ldg450-quality .ldg40-section-head *,
.ldg40-root .ldg450-scenarios .ldg40-section-head *,
.ldg40-root .ldg450-reporting .ldg40-section-head *{
  color:var(--ldg4541-ink)!important;
}
.ldg40-root .ldg450-boundary .ldg40-section-head p,
.ldg40-root .ldg450-lifecycle .ldg40-section-head p,
.ldg40-root .ldg450-impact .ldg40-section-head p,
.ldg40-root .ldg450-quality .ldg40-section-head p,
.ldg40-root .ldg450-scenarios .ldg40-section-head p,
.ldg40-root .ldg450-reporting .ldg40-section-head p{
  color:var(--ldg4541-muted)!important;
}

/* Print/PDF-in-browser safety. */
@media print{
  .ldg40-root{background:#ffffff!important;color:#071f35!important;}
  .ldg40-root .ldg40-hero,
  .ldg40-root .ldg40-hero *,
  .ldg40-root .ldg450-boundary-grid article,
  .ldg40-root .ldg450-boundary-grid article *{
    background:#073b67!important;
    color:#ffffff!important;
  }
  .ldg40-root .ldg40-card:not(.ldg40-hero),
  .ldg40-root .ldg40-card:not(.ldg40-hero) *{
    background:#ffffff!important;
    color:#071f35!important;
  }
}
