/* Use the existing ink color and keep painted backgrounds on containers. */
@media screen and (forced-colors: none) {
  :is(
    body.graphite:where(.restock-circular, .template-password),
    body.graphite.rk-account-page :where(
      .rap-account-topbar,
      .rap-account-hero,
      .rap-account-customer,
      [data-rk-panel="profile"],
      [data-rk-panel="addresses"],
      [data-rk-panel="favorites"],
      [data-rk-panel="orders"],
      [data-rk-panel="returns"],
      [data-rk-panel="reviews"],
      [data-rk-panel="notifications"],
      [data-rk-panel="activity"],
      [data-rk-panel="settings"],
      .rap-favorites-bottom > section:not(.rap-membership),
      .rk-store-footer
    )
  ) {
    --restock-text-halo: 0 0 .7px #ffffffa1, 0 .5px .65px color-mix(in srgb, currentColor 18%, transparent);
    text-shadow: var(--restock-text-halo);

    & :where(button, summary, select, input, textarea) {
      text-shadow: var(--restock-text-halo);
    }

    & :where(input, textarea)::placeholder {
      text-shadow: 0 0 .65px #fff9;
    }

    & :where(.rc__club, .rau-app-grid, .rp-dynamic-checkout) {
      --restock-text-halo: none;
      text-shadow: none;
    }
  }

  @supports (background-clip: text) and (color: color-mix(in srgb, black, white)) {
    :is(
      body.graphite.restock-circular #MainContent,
      body.graphite.template-password,
      body.graphite.rk-account-page :where(
        .rap-account-hero,
        [data-rk-panel="profile"],
        [data-rk-panel="addresses"],
        [data-rk-panel="favorites"],
        [data-rk-panel="orders"],
        [data-rk-panel="returns"],
        [data-rk-panel="reviews"],
        [data-rk-panel="notifications"],
        [data-rk-panel="activity"],
        [data-rk-panel="settings"],
        .rap-favorites-bottom > section:not(.rap-membership)
      )
    ) :where(
      h1, h2, h3, h4, h5, h6, h1 em, h1 > strong,
      .gh-card__body h3 > a,
      .restock-ink,
      .gh-card__buy > span,
      .rp-add-button > [data-add-button-text],
      .graphite-assistant__chips a > span
    ):not(:where(
      .rai-carrier-logo,
      .rc__club *,
      .rau-app-grid *,
      .rp-dynamic-checkout *,
      .rac-heading h1,
      .graphite-hero__headline h1,
      [class*="__badge"]
    )) {
      background-image: linear-gradient(
        180deg,
        color-mix(in srgb, currentColor 86%, white),
        color-mix(in srgb, currentColor 91%, black) 90%
      );
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: none;
      filter: drop-shadow(0 0 .75px #ffffffc4);
    }
  }
}

/* Preserve the approved accent colors and the hero's stronger white halo. */
body.graphite:where(.restock-circular, .template-password) #MainContent :is(
  .rac-heading h1 em,
  .racat-title h1,
  .rs-summary h1,
  .graphite-reference-category-head h1,
  .graphite-reference-searchhead h1,
  .ras-favorites-heading h1,
  .gi-about-copy h1,
  .gi-page .gi-heading h1,
  .rai-heading h1,
  .restock-auth-card--entry h1:not(:has(em)),
  .restock-auth-card--entry h1 em,
  .graphite-assistant__heading h2 span,
  .rh-finds-head h2,
  .rh-specials__head h2,
  .rs-noresults h2,
  .graphite-empty h2,
  .graphite-recommendations h2,
  .rap-details h2,
  .rc__empty h2,
  .og-cart-summary-title,
  .rac-recommendations h2,
  .gi-related > h2,
  .rai-page:not(.rau-page) :is(.rai-card, .rai-soft) h2:not(.rai-carrier-logo),
  .rau-page :is(.rau-card, .rau-empty, .rau-bid-dialog) h2,
  .restock-auth-benefits__content h2
) {
  color: #347d0b;
  --restock-heading-fill: var(--restock-primary-heading-fill, linear-gradient(180deg, #448e0c, #2d7506 83%));

  &:is(h2, h3) {
    --restock-heading-fill: linear-gradient(180deg, #347e08, #256409 83%);
  }

  @media (forced-colors: none) {
    @supports (background-clip: text) {
      background-image: var(--restock-heading-fill);
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: none;
      filter: drop-shadow(0 0 1px #ffffffd9);
    }
  }
}

body.graphite.restock-circular #MainContent .rac-heading {
  --restock-primary-heading-fill: linear-gradient(180deg, #51b20b, #4da908 31%, #338b00 87%, #328800);
  @supports (color: color(display-p3 1 1 1)) {
    --restock-primary-heading-fill: linear-gradient(180deg, color(display-p3 0.25 0.715 0), color(display-p3 0.24 0.67 0) 31%, color(display-p3 0.18 0.55 0) 87%, color(display-p3 0.17 0.535 0));
  }
}
