/* Static, tonal light pools and neutral grain for three approved surfaces only.
   Background layers cannot intercept input or soften the foreground text.
   Keep the existing colour families, geometry, menus and reading surfaces intact. */
@media screen and (forced-colors: none) {
  @supports (background-blend-mode: soft-light) {
    body.ep-top-navigation .migration-app > .migration-header,
    body.ep-top-navigation .migration-app .migration-main:has(.ep-bookshelf, .ep-book-entry, .ep-wordbook-study, .ep-vocab-browser),
    body.ep-top-navigation .migration-main .migration-report-page .ep-report-scoreboard > .ep-overall-card {
      --ep-gradient-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'%3E%3Cfilter id='grain' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='1' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='.5 .5 .5 0 -.25 .5 .5 .5 0 -.25 .5 .5 .5 0 -.25 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23grain)' opacity='.38'/%3E%3C/svg%3E");
    }

    body.ep-top-navigation .migration-app > .migration-header {
      background-image:
        var(--ep-gradient-grain),
        linear-gradient(180deg, #ffffff0d 0%, #ffffff00 38%, #161b3e2e 100%),
        radial-gradient(ellipse 35% 220% at 18% -100%, #8fa9dd6b 0%, transparent 72%),
        radial-gradient(ellipse 46% 260% at 74% 150%, #332256a6 0%, transparent 74%),
        var(--ep-workspace-header-background);
      background-size: 128px 128px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
      background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
      background-blend-mode: overlay, normal, normal, normal, normal;
    }

    /* Pale blue above, lavender and rose at the edges: visible tonal depth,
       without darkening the navy text or texturing the book covers and cards. */
    body.ep-top-navigation .migration-app .migration-main:has(.ep-bookshelf, .ep-book-entry, .ep-wordbook-study, .ep-vocab-browser) {
      --ep-gradient-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'%3E%3Cfilter id='grain' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='1' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='.5 .5 .5 0 -.25 .5 .5 .5 0 -.25 .5 .5 .5 0 -.25 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23grain)' opacity='.26'/%3E%3C/svg%3E");
      background-image:
        var(--ep-gradient-grain),
        radial-gradient(ellipse at 6% 0%, #e5efffe0 0%, transparent 58%),
        radial-gradient(ellipse at 96% 14%, #bccdf2b3 0%, transparent 49%),
        radial-gradient(ellipse at 98% 100%, #e9bcd9bf 0%, transparent 59%),
        radial-gradient(ellipse at 0% 100%, #9cb9df70 0%, transparent 48%),
        var(--ep-wordbook-backdrop, linear-gradient(135deg, #819ecf 0%, #9a9ccd 52%, #c39fd5 100%));
      background-size: 128px 128px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
      background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
      background-blend-mode: soft-light, normal, normal, normal, normal, normal;
    }

    body.ep-top-navigation .migration-main .migration-report-page .ep-report-scoreboard > .ep-overall-card {
      background-image:
        var(--ep-gradient-grain),
        linear-gradient(180deg, #17244224 0%, #17244200 35%, #15233f66 100%),
        radial-gradient(ellipse at 8% 112%, #67539bb3 0%, transparent 65%),
        radial-gradient(circle at 85% 0%, #5d79a8 0%, transparent 55%),
        linear-gradient(155deg, #2f4570, #22345a);
      background-size: 128px 128px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
      background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
      background-blend-mode: overlay, normal, normal, normal, normal;
    }
  }
}
