/* Opt-in only. Load after host styles; template badges, buttons and editors
   retain their semantic colors. Exclude nested grids that did not opt in. */
:is(.seic-grid-high-contrast-selected.e-grid, .seic-grid-high-contrast-selected .e-grid) > .e-gridcontent tr.e-selectionbackground:not(.e-grid .e-grid *),
:is(.seic-grid-high-contrast-selected.e-grid, .seic-grid-high-contrast-selected .e-grid) > .e-gridcontent tr.e-selectionbackground > .e-rowcell:not(.e-grid .e-grid *),
:is(.seic-grid-high-contrast-selected.e-grid, .seic-grid-high-contrast-selected .e-grid) > .e-gridcontent td:is(.e-selectionbackground, .e-cellselectionbackground):not(.e-grid .e-grid *) {
    background-color: #1d4ed8 !important;
    color: #fff !important;
}

/* Specificity also preserves selection under compact-grid !important hover. */
:is(.seic-grid-high-contrast-selected.e-grid, .seic-grid-high-contrast-selected .e-grid) > .e-gridcontent tr.e-selectionbackground:focus-within:not(.e-grid .e-grid *),
:is(.seic-grid-high-contrast-selected.e-grid, .seic-grid-high-contrast-selected .e-grid) > .e-gridcontent td:is(.e-selectionbackground, .e-cellselectionbackground):is(.e-focused, :focus-within):not(.e-grid .e-grid *) {
    outline: 2px solid #fbbf24;
    outline-offset: -2px;
}
