/* Keep the same action feedback across the site's older page-specific themes.
   Important rules in this layer take precedence over their unlayered overrides. */
@layer sla-link-feedback {
  :root {
    --sla-red-ink: #bc171c;
    --sla-red-on-dark: #ff3025;
    --link-feedback: var(--sla-red-ink);
    --editorial-active-ink: var(--ink, #191b1e);
  }

  :where(header, footer, #nav, #site-search, .hero-text, .dark, .cx-charcoal,
    .owner-head, .owner-end, .owner-view, .detail-hero, .d25-hero, .cx-masthead,
    .services-introduction, .supporting-contact, .team-development, .contact-team, .skid-operator, .page-footer, .becx-leadership, .marcus-becx-lead, .document-return,
    .home-partnership, .home-team-feature-link, .cx-facilities, .facility-panel,
    .msi-related-grid, .sensor-check, .dashboard-bottom, .trend-workspace, #reach.reach-section,
    .market-showcase, .market-story-card, .specialist-focus-card, .integration-flow-hub, .integration-flow-links,
    .data-wave-restored, .home-approach .approach-intro, .readiness-bridge[data-onsite-feature],
    .d25-delivery, .mike-international, .quality-growth, .service-catalog-entry:nth-child(even)) {
    --link-feedback: var(--sla-red-on-dark, #ff3025);
    --editorial-active-ink: #fff;
  }
  :where(.light, .cx-paper, .cx-white, .service-wheel, .wheel-actions,
    .service-card, .project-detail-card, .client-resource-grid, .depth-scope, .portfolio-why .quality-growth,
    .experience-panel, .owner-background, .skid-more, .skid-history, .skid-intro, .service-catalog-entry:nth-child(odd)) {
    --link-feedback: var(--sla-red-ink, #bc171c);
    --editorial-active-ink: var(--ink, #191b1e);
  }

  :where(a[href], a[href] *, button, button *, summary, summary *) {
    text-decoration-line: none !important;
  }

  /* Remove borders drawn as text underlines; keep card, table and menu separators. */
  :where(.text-link, .cx-text-link, .service-story-action, .opening-replay,
    .becx-contact-link, .owner-view a, #twin-copy a, .case-trace a, .sensor-check > a) {
    border-bottom-color: transparent !important;
  }

  @media (min-width: 1181px) {
    :where(#nav .ribbon-links a[aria-current], #nav .ribbon-links a[data-current-group],
      .home-scroll-nav a[aria-current]) {
      border-bottom-color: transparent !important;
      background-color: #30373d;
    }
  }

  /* Standalone prose links remain identifiable before a pointer reaches them. */
  :where(p, li) > a[href]:not([class]) {
    font-weight: 700;
    color: var(--link-feedback);
  }

  :where(a[href], button:enabled, summary):focus-visible {
    outline: 2px solid var(--link-feedback) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px white !important;
  }

  /* Change the action or card headline itself. Long descriptions retain the
     color established by their section, including inside linked cards. */
  :where(
    a[href]:not(.brand-lockup, .spoke-action, .opening-core):not(:has(:is(h1,h2,h3,h4,h5,h6,p))):is(:hover,:focus-visible,:active),
    a[href]:not(.brand-lockup):is(:hover,:focus-visible,:active) :is(h1,h2,h3,h4,h5,h6),
    a[href]:not(.brand-lockup):is(:hover,:focus-visible,:active) :is(h1,h2,h3,h4,h5,h6) em,
    a[href]:not(.brand-lockup):is(:hover,:focus-visible,:active) > :is(strong,b):first-child,
    a[href]:is(:hover,:focus-visible,:active) :is(.service-story-action,.read-more,.text-link,.home-team-cta),
    button.text-link:enabled:is(:hover,:focus-visible,:active),
    .wheel-actions button:enabled:is(:hover,:focus-visible,:active),
    summary:is(:hover,:focus-visible,:active), summary:is(:hover,:focus-visible,:active) :is(strong,b,h2,h3,h4)
  ) {
    color: var(--link-feedback) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* Editorial actions are visible at rest. Only the actionable words in a
     linked card use these colors; the rest of the card keeps its hierarchy. */
  :where(a[href], button:enabled):is(:hover,:focus-visible,:active) {
    --editorial-ink: var(--editorial-active-ink);
  }

  :where(a.text-link, button.text-link, a.editorial-action, a.cx-text-link,
    a.becx-contact-link, a.cx-lighting-contact, a.cx-level-detail-link, a.background-link,
    .home-hero-actions a, .supporting-reference a, .skid-page-action a, .service-planning-links a,
    .skid-more a, .trend-actions a, .owner-view > a, .case-trace a, main figcaption > a[href],
    main article > a[href]:not([class]):not(:has(img,h2,h3,h4,p)),
    main details > a[href]:not([class]):not(:has(img,h2,h3,h4,p)),
    .specialist-route-links a, .integration-flow-links a, .integration-flow-hub > a,
    .project-reference-links a, .project-certification a, .owner-background-references a,
    .requirement-references a, .cx-level-references a, .d25-source-links a,
    .d25-market-links a, .market-showcase-footer a, .mike-international-footer a,
    .cx-reference-pointer a, .sensor-check > a, .twin-flow-evidence > a, .guide-index a,
    a .read-more, a .service-story-action, a .becx-service-action) {
    color: var(--editorial-ink, var(--link-feedback)) !important;
    -webkit-text-fill-color: currentColor !important;
    background: transparent !important;
    border-bottom-color: transparent !important;
    text-decoration-line: none !important;
  }

  /* Linked names or sources that belong in a sentence stay in that sentence. */
  :where(main p:not(.breadcrumbs,.skid-crumb,.supporting-context) > a[href]:not([class]):not(:has(img,b,strong,small,p))) {
    color: var(--editorial-ink, var(--link-feedback)) !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 700;
  }

  /* A block-level action starts its own line even when an older paragraph
     ends in a labelled link. Long labels wrap inside the text column. */
  :where(a.text-link, a.editorial-action, a.cx-text-link, a.becx-contact-link,
    a.cx-lighting-contact, a.cx-level-detail-link, a.background-link,
    .supporting-reference a, .skid-page-action a, .service-planning-links a):not([hidden]) {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 44px !important;
    min-width: 0;
    margin-block-start: .5rem !important;
    gap: .4em;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  :where(.skid-page-action, .supporting-reference) {
    margin-block-start: .9rem !important;
  }
  :where(.skid-page-action, .supporting-reference) > a[href] {
    margin-block-start: 0 !important;
  }

  /* Where we work and its adjacent travel section share the same charcoal surface. */
  #reach.reach-section :is(.eyebrow, h2 em, h3 em, .travel-delivery-points > div > span) {
    color: var(--link-feedback) !important;
  }

  /* Filled actions invert as a unit. Keep an edge on white pages and red footers. */
  :where(.btn, .profile-email, .direct-email a, .owner-background-contact, .document-return .back, .print-action,
    .cx-expanded a:not(.text-link), .trend-toolbar button, .quick-ribbon a:first-child) {
    color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
    background-color: var(--sla-red-ink) !important;
  }
  :where(.btn, .profile-email, .direct-email a, .owner-background-contact, .document-return .back, .print-action,
    .cx-expanded a:not(.text-link), .trend-toolbar button, .quick-ribbon a:first-child):not(:disabled):is(:hover,:focus-visible,:active) {
    background-color: #fff !important;
    color: var(--sla-red-ink) !important;
    border-color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
  }
  :where(.btn, .profile-email, .direct-email a, .owner-background-contact, .document-return .back, .print-action,
    .cx-expanded a:not(.text-link), .trend-toolbar button, .quick-ribbon a:first-child) > :is(span,b,strong) {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* Preserve the selected indicator when a visitor points at a red selected tab. */
  :where(.work-thumbs, .sector-tabs, .system-choices, .readiness-choices, .perf-tabs,
    .owner-controls, .dashboard-review-controls, .ocx-cycle, .integration-flow-inputs,
    .guide-sequence-options, .reach-choices, .finding-buttons, .fdd-stages,
    .sensor-check-controls, .facility-tabs, .cx-level-selectors)
    button:is([aria-pressed=true],[aria-selected=true],.active,.guide-step-active):is(:hover,:focus-visible,:active) {
    background-color: #fff !important;
    color: var(--sla-red-ink) !important;
    -webkit-text-fill-color: currentColor !important;
    border-color: var(--sla-red-ink) !important;
    box-shadow: inset 3px 0 var(--sla-red-ink) !important;
  }
  :where(.work-thumbs, .sector-tabs, .system-choices, .readiness-choices, .perf-tabs,
    .owner-controls, .dashboard-review-controls, .ocx-cycle, .integration-flow-inputs,
    .guide-sequence-options, .reach-choices, .finding-buttons, .fdd-stages,
    .sensor-check-controls, .facility-tabs, .cx-level-selectors)
    button:is([aria-pressed=true],[aria-selected=true],.active,.guide-step-active):is(:hover,:focus-visible,:active) > :is(span,strong,b,small) {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* Nested cards define their own surface independently of the section around them. */
  :where(.controls-capability-band, .perf-cards > a, .guide-routes > a, .catalog-items .route-card) {
    --link-feedback: var(--sla-red-ink);
    --editorial-active-ink: #161b1e;
  }
  :where(.becx-service-feature, .readiness-bridge[data-onsite-feature], .specialist-focus-card,
         .home-team-feature-link) {
    --link-feedback: var(--sla-red-on-dark);
    --editorial-active-ink: #fff;
  }

  /* Each card has one clickable boundary. Keep its title, explicit action and supporting copy distinct. */
  :where(a :is(.capability-band-action, .read-more, .service-story-action, .becx-service-action,
               .service-more, .readiness-bridge-cta), .guide-routes > a > b, .perf-cards > a > span:last-child) {
    color: var(--link-feedback) !important;
    -webkit-text-fill-color: currentColor !important;
    background-color: transparent !important;
  }
  :where(a[href]:is(:hover,:focus-visible,:active) :is(.capability-band-action, .read-more,
         .service-story-action, .becx-service-action, .service-more, .readiness-bridge-cta),
         .guide-routes > a:is(:hover,:focus-visible,:active) > b,
         .perf-cards > a:is(:hover,:focus-visible,:active) > span:last-child) {
    color: var(--editorial-active-ink) !important;
    -webkit-text-fill-color: currentColor !important;
  }
  :where(a :is(.capability-band-action, .read-more, .service-story-action, .becx-service-action,
               .home-team-cta, .readiness-bridge-cta) > [aria-hidden="true"]) {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* The team-card action is a filled badge. On interaction, keep the change on that badge. */
  :where(.home-team-feature-link:is(:hover,:focus-visible,:active) .home-team-cta) {
    background-color: #fff !important;
    color: var(--sla-red-ink) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* Image-only destinations have no text to recolor. Give the cover or slide a visible edge. */
  :where(.qualifications-cover, .realize-slide-frame a[href]):is(:hover,:focus-visible,:active) {
    outline: 2px solid var(--link-feedback) !important;
    outline-offset: 3px;
  }

  /* The opening wheel, navigation and the skid each have their own control surfaces. */
  :where(.service-wheel,.wheel-actions,.skid-history) {
    --link-feedback:var(--sla-red-ink);
    --editorial-active-ink:#172127;
  }
  :where(#nav.site-ribbon,#site-search,.skid-operator) {
    --link-feedback:var(--sla-red-on-dark);
    --editorial-active-ink:#fff;
  }

  .service-wheel .wheel-service,
  .wheel-actions .opening-replay:enabled {
    color:#172127!important;
    -webkit-text-fill-color:currentColor!important;
    background-color:transparent!important;
    text-decoration:none!important;
  }
  .service-wheel .wheel-service:is(:hover,:focus-visible,:active),
  .wheel-actions .opening-replay:enabled:is(:hover,:focus-visible,:active) {
    color:var(--sla-red-ink)!important;
  }

  /* The logo keeps both brand colors and the linked name responds without a tile. */
  header .brand-lockup:is(:hover,:focus-visible,:active) {background-color:transparent!important}
  header .brand-lockup:is(:hover,:focus-visible,:active) .brand-name {color:var(--sla-red-on-dark)!important}
  header .brand-lockup:is(:hover,:focus-visible,:active) .brand-name > span {color:#fff!important}

  /* Preserve charcoal current-page markers, mobile separators and expanded chevrons. */
  #nav.site-ribbon :where(.ribbon-links>a,.ribbon-group>a,.ribbon-dropdown a,.page-jump a,
    .page-jump>summary,.ribbon-menu-toggle,.ribbon-overview-toggle,.ribbon-home,#global-motion):is(:hover,:focus-visible,:active),
  header .search-open:is(:hover,:focus-visible,:active),
  #site-search :is(.search-close,.search-paging button:enabled,#search-results a,.explore-shortcuts a):is(:hover,:focus-visible,:active) {
    color:var(--sla-red-on-dark)!important;
    -webkit-text-fill-color:currentColor!important;
    background-color:var(--interaction-surface,transparent)!important;
    text-decoration:none!important;
  }
  #nav .ribbon-links :is(a[aria-current],a[data-current-group]) {--interaction-surface:#30373d}
  #nav .ribbon-menu-toggle[aria-expanded=true] {--interaction-surface:var(--sla-red-ink);color:#fff!important}
  #nav .ribbon-menu-toggle[aria-expanded=true]:is(:hover,:focus-visible,:active),
  #nav .ribbon-menu-toggle[aria-expanded=true]:is(:hover,:focus-visible,:active)>span {
    --interaction-surface:white;
    color:var(--sla-red-ink)!important;
    -webkit-text-fill-color:currentColor!important;
  }
  #nav.site-ribbon > .sla-back:is(:hover,:focus-visible,:active) {
    color:var(--sla-red-ink)!important;
    background-color:white!important;
    border-color:var(--sla-red-ink)!important;
    -webkit-text-fill-color:currentColor!important;
  }
  #nav .page-jump a[aria-current=location]:is(:hover,:focus-visible,:active),
  #nav.site-ribbon .browse-overview:is(:hover,:focus-visible,:active),
  #nav.site-ribbon .browse-overview:is(:hover,:focus-visible,:active)>span {
    color:var(--sla-red-ink)!important;
    background-color:white!important;
    -webkit-text-fill-color:currentColor!important;
  }
  #nav.site-ribbon .browse-overview:is(:hover,:focus-visible,:active)>small {color:#26343b!important}
  #site-search .search-paging button {--interaction-surface:#252e36}
  #site-search .explore-shortcuts a {--interaction-surface:#20272e}
  #site-search .explore-shortcuts a:is(:hover,:focus-visible,:active) {transform:none!important}
  #site-search .explore-shortcuts a:is(:hover,:focus-visible,:active)>strong {color:var(--sla-red-on-dark)!important}
  #site-search .explore-shortcuts a:is(:hover,:focus-visible,:active)>span {color:#e4e8eb!important}
  #site-search #search-results a[aria-selected=true] {
    --interaction-surface:#303b45;
    color:var(--sla-red-on-dark)!important;
    box-shadow:inset 4px 0 var(--sla-red-on-dark)!important;
  }

  /* A point name opens a faceplate. The adjacent live reading retains its state color. */
  .skid-values button[data-point]:is(:hover,:focus-visible,:active) {background-color:#233238!important}
  .skid-values button[data-point][aria-pressed=true]:is(:hover,:focus-visible,:active) {background-color:#32474e!important}
  .skid-values button[data-point]:is(:hover,:focus-visible,:active)>span,
  .skid-faults summary:is(:hover,:focus-visible,:active) {color:var(--sla-red-on-dark)!important}
  .skid-values button[data-point]:is(:hover,:focus-visible,:active)>[data-reading] {
    color:var(--reading-ink,#fff)!important;
    -webkit-text-fill-color:currentColor!important;
  }
  .skid-lesson[data-proof=unknown] [data-reading=proof],
  .skid-lesson[data-level=low] [data-reading=level] {--reading-ink:#ffcf8b}
  .skid-actions button:enabled:is(:hover,:focus-visible,:active),
  .skid-history-bar button:enabled:is(:hover,:focus-visible,:active) {
    background-color:var(--skid-button-surface,#263438)!important;
    color:var(--skid-button-ink,var(--sla-red-on-dark))!important;
    -webkit-text-fill-color:currentColor!important;
  }
  .skid-actions button[data-action=pump] {--skid-button-surface:#f0f3ed;--skid-button-ink:var(--sla-red-ink)}
  .skid-history-bar button {--skid-button-surface:#fff;--skid-button-ink:var(--sla-red-ink)}
  .skid-history-bar button[aria-pressed=true] {--skid-button-surface:#26363c;--skid-button-ink:var(--sla-red-on-dark)}

  #nav.site-ribbon :is(.ribbon-dropdown,.page-jump>nav),
  #nav.site-ribbon.ribbon-open .ribbon-links {background-color:#171c20!important}
  #nav.site-ribbon :is(.ribbon-links,.ribbon-group)>:is(a[aria-current],a[data-current-group]),
  #nav.site-ribbon .ribbon-menu-toggle[aria-expanded=false] {
    --interaction-surface:#12181b;
    background-color:var(--interaction-surface)!important;
  }
  #nav.site-ribbon :is(.ribbon-links,.ribbon-group)>:is(a[aria-current],a[data-current-group]) {
    box-shadow:inset 3px 0 var(--sla-red-on-dark);
  }

  #site-search .explore-shortcuts a,
  #site-search .search-paging button {
    --interaction-surface:#171c20;
    background-color:var(--interaction-surface)!important;
  }
  #site-search #search-results a[aria-selected=true] {
    --interaction-surface:#12181b;
    background-color:var(--interaction-surface)!important;
  }
  #site-search #search-results a[aria-selected=true]:is(:hover,:focus-visible,:active),
  #site-search:has(#page-query:focus-visible) #search-results a[aria-selected=true] {
    color:white!important;
    -webkit-text-fill-color:currentColor!important;
  }
  #site-search #page-query {
    color:#171c20!important;
    -webkit-text-fill-color:currentColor!important;
    background-color:white!important;
    caret-color:var(--sla-red-ink);
  }
  #site-search #page-query:focus-visible {
    outline:2px solid white!important;
    outline-offset:3px!important;
    border-color:var(--sla-red-ink)!important;
  }

  .skid-values button[data-point],
  .skid-values button[data-point]:is(:hover,:focus-visible,:active),
  .skid-values button[data-point][aria-pressed=true]:is(:hover,:focus-visible,:active) {
    background-color:var(--skid-point-surface,#171c20)!important;
  }
  .skid-values button[data-point][aria-pressed=true] {--skid-point-surface:#12181b}
  .skid-values button[data-point][aria-pressed=true]:focus-visible {
    box-shadow:inset 3px 0 #85c9c6,0 0 0 2px white!important;
  }
  .skid-actions button:not([data-action=pump]),
  .skid-history-bar button[aria-pressed=true] {
    --skid-button-surface:#171c20;
    background-color:var(--skid-button-surface)!important;
  }
  .skid-faults summary {background-color:#161e22!important}

  /* These evidence panels set their own surface inside light or charcoal chapters. */
  :where(.market-story-page .market-experience-story, .becx-owner-record, .cx-reference-pointer,
    .data-lab, .twin-flow-evidence, #today.ecosystem-map, .system-evidence-text,
    .experience-numbers, .buyer-home .contact-next, .architecture-section, .handoff-receiver,
    .dashboard-review-controls, .supporting-guide .editorial-top .supporting-context,
    .portfolio-resource-group.dark .client-resource-grid, .guide-editorial .actions:has(a[href="operator-handoff.html"]),
    main > p > a[href="commissioning.html#cx-data"]) {
    --link-feedback: var(--sla-red-on-dark);
    --editorial-active-ink: #fff;
  }
  :where(.cx-example-record, .electrical-example, .portfolio-profile-intro,
    .meter-explorer .owner-links, .kpi-lab .perf-links,
    .critical-leadership, .project-service-context) {
    --link-feedback: var(--sla-red-ink);
    --editorial-active-ink: #191b1e;
  }

  /* Keep the red text readable across each whole panel, including where the link wraps. */
  :where(.cx-reference-pointer, .data-lab, .twin-flow-evidence,
    .dashboard-review-controls, .dashboard-bottom, .cx-dacx-chapter, .facility-panel,
    .home-partnership figcaption, .integration-flow-hub, .integration-flow-result,
    .marcus-becx-lead, .sensor-check) {
    background-color: #171c20 !important;
  }
  .integration-flow[data-flow-stage="integration"] .integration-flow-hub {
    background-color: #30171a !important;
  }
  .dark .related-links a:is(:hover,:focus-visible,:active) {
    background-color: transparent !important;
  }
  .portfolio-resource-group.dark .client-resource-grid > a {
    background-color: #171c20 !important;
  }

  :where(a.career-origin-mark, .electrical-example a, .portfolio-profile-intro > a,
    .meter-explorer .owner-links a, .kpi-lab .perf-links a,
    .critical-leadership a, .project-service-context a,
    .dashboard-review-controls > a) {
    color: var(--editorial-ink, var(--link-feedback)) !important;
    -webkit-text-fill-color: currentColor !important;
    background-color: transparent !important;
  }

  @media (forced-colors: active) {
    :where(a[href], a[href] *) {
      color: LinkText !important;
      -webkit-text-fill-color: currentColor !important;
    }

    :where(a[href], button:enabled, summary):is(:hover,:focus-visible,:active),
    :where(a[href], button:enabled, summary):is(:hover,:focus-visible,:active) * {
      forced-color-adjust: auto;
      -webkit-text-fill-color: currentColor !important;
    }
    :where(a[href], button:enabled, summary):focus-visible {
      outline-color: Highlight !important;
    }
  }
}
