@-moz-document url-prefix("about:newtab"), url-prefix("about:home") {

  // new tab page colors
  html,
  body {
    // main bg color
    --newtab-background-color: #{get-var("background-color-100")} !important;
    // secondary controls color
    --newtab-background-color-secondary: #{get-var("background-color-0")} !important;
    --newtab-background-card: #{get-var("background-color-0")} !important;
    // controls background-color hover
    --newtab-element-hover-color: #{get-var("control-background-color")} !important;
    // text & svg fill color
    --newtab-text-primary-color: #{get-var("text-primary")} !important;
    --newtab-primary-element-text-color: #{get-var("text-on-accent")} !important;
  }

  @media (prefers-color-scheme: light) {

    html,
    body {
      // main bg color
      --newtab-background-color: #{get-var("background-color-100")} !important;
      // secondary controls color
      --newtab-background-color-secondary: #{get-var("background-color-100")} !important;
      // controls background-color hover
      --newtab-element-hover-color: #{get-var("background-color-0")} !important;
      // text & svg fill color
      --newtab-text-primary-color: #{get-var("text-primary")} !important;
    }

    // new tab shortcuts bg color
    .top-site-outer .tile {
      --newtab-background-color-secondary: #{get-var("background-color-50")} !important;
    }
  }

  @include moz-pref-media("userChrome.theme-chrome-refresh") {
    .top-site-outer .tile {
      --newtab-background-color-secondary: #{get-var("tile-background-color")} !important;
    }
  }

  // hide pin
  .icon.icon-pin-small {
    display: none !important;
  }

  // unpinned sites have lower opacity title
  .top-site-button .title:not(.pinned) {
    opacity: 0.7 !important;
  }

  // search bar
  .search-wrapper .search-inner-wrapper {
    min-height: 48px !important;
  }

  // search bar logo
  .logo-and-wordmark {
    margin-bottom: 38px !important;
  }

  .logo-and-wordmark .wordmark {
    // background-size: 160px !important;
    // height: 92px !important;
    // margin-inline-start: 16px !important;
    // width: 160px !important;
    margin-inline-end: 16px !important;
  }

  // .logo-and-wordmark .logo {
  //   height: 92px !important;
  //   width: 92px !important;
  //   background-size: 92px !important;
  // }

  .search-handoff-button {
    border-radius: 99px !important;
    // background-position: 12px !important;
    // padding-inline-start: 48px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    box-shadow: get-var("elevation-2") !important;
  }

  .search-wrapper.fake-focus:not(.search.disabled) .search-handoff-button {
    border-color: transparent !important;
    outline: 2px solid transparent !important;
    outline-color: get-var("accent-color") !important;
    outline-offset: -2px !important;
  }

  .search-handoff-button .fake-caret {
    // inset-inline-start: 48px !important;
    top: 13px !important;
  }

  .search-disabled .search-handoff-button {
    opacity: 0 !important;
  }

  .search-wrapper .search-handoff-button,
  .search-wrapper input {
    background-color: get-var("input-background-color") !important;
  }

  // top sites
  .top-site-outer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .top-site-outer {

    .tile {
      border-radius: 100px !important;
      height: 44px !important;
      width: 44px !important;
      box-shadow: none !important;
    }

    .tile .icon-wrapper {
      border-radius: 4px !important;
      width: 24px !important;
      height: 24px !important;
    }
  }

  .top-site-outer {

    .default-icon,
    .search-topsite {
      background-size: 16px !important;
      height: 24px !important;
      width: 24px !important;
    }
  }

  .top-site-outer .tile .icon-wrapper.letter-fallback::before {
    font-size: 32px !important;
  }

  // card
  .card-outer,
  .card-outer .card,
  .ds-card-grid.ds-card-grid-border .ds-card:not(.placeholder) {
    border-radius: 6px !important;
  }

  .card-outer .card,
  .ds-card-grid.ds-card-grid-border .ds-card:not(.placeholder) {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
  }

  .card-outer .card-preview-image-outer,
  .ds-card-grid.ds-card-grid-border .ds-card:not(.placeholder) .img-wrapper .img img {
    border-radius: 6px 6px 0 0 !important;
  }

  .fake-textbox {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 400 !important;
  }

  .outer-wrapper.only-search {
    display: flex !important;
    padding: 30px !important;
  }

  .info {
    border-radius: 18px !important;
  }

  .card-outer,
  .card-outer .card,
  .ds-card-grid.ds-card-grid-border .ds-card:not(.placeholder) {
    border-radius: 18px !important;
  }

  .card-outer .card-preview-image-outer,
  .ds-card-grid.ds-card-grid-border .ds-card:not(.placeholder) .img-wrapper .img img {
    border-radius: 18px 18px 0 0 !important;
  }

  // new tab shortcuts
  .top-site-outer {
    border-radius: 18px !important;
  }

  // .card-outer {
  //   box-shadow: get-var("elevation-2") !important;
  // }

  // searchbar shadow
  .search-wrapper .search-handoff-button,
  .search-wrapper input {
    box-shadow: get-var("search-input-shadow") !important;
  }

  // "Resent activity" start button
  .icon.icon-bookmark-added {
    background-image: get-var("star-icon") !important;
  }

  // "Resent activity" start button fill color
  .compact-cards .card-outer .card-context .card-context-icon.icon-bookmark-added {
    fill: get-var("accent-color") !important;
  }

  // open customize-menu button
  .personalize-button {
    // color: get-var("accent-color") !important;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 1px 2px;
    // font-weight: 400 !important;
    min-width: 32px !important;
    border-radius: 100px !important;
  }

  .icon.icon-settings {
    background-image: get-var("edit-icon") !important;

    background-color: get-var("tab-background-color-hover") !important;

    @media (prefers-color-scheme: dark) {
      &:hover {
        // background-color: #29668c !important;
        background-color: get-var("alltabs-background-color-open") !important;
      }
    }
  }

  .top-site-outer.placeholder.add-button .tile {
    background-color: get-var("tab-background-color-hover") !important;
    cursor: pointer !important;
  }

  .top-site-outer.placeholder.add-button {
    cursor: pointer !important;
    user-select: none !important;
  }

  .top-site-outer .context-menu-button {
    fill: get-var("icon-color-primary") !important;
  }

  // .top-sites-list item edit icon
  .top-site-outer .edit-button {
    background-image: get-var("edit-icon") !important;
  }

  // customize-menu window
  .customize-menu {

    // customize-menu close button
    button.close-button {
      color: get-var("accent-color") !important;
      background-color: transparent !important;
      border: 1px solid !important;
      border-color: get-var("menu-border-color") !important;
      padding: 8px 16px !important;
      user-select: none !important;
      cursor: pointer;

      &:hover {
        background-color: get-var("accent-color-transparent") !important;
      }
    }

    button[default].close-button {
      color: get-var("text-on-accent") !important;
      background-color: get-var("accent-color") !important;
      border: none !important;

      &:hover {
        background-color: get-var("accent-color-hover") !important;
      }
    }
  }

  main {
    justify-content: flex-start !important;
  }

  .outer-wrapper.ds-outer-wrapper-breakpoint-override {
    padding-top: 140px !important;
  }

  .search-wrapper {
    padding-bottom: 16px !important;
  }

  .top-site-outer .context-menu-button {
    background-image: get-var("menu-icon") !important;
    top: 4px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 9999px !important;
  }

  // hide outline when click on the home page links
  .tile:active {
    outline: none !important;
  }


  // bigger font size for "new tab" page
  @media (-moz-platform: macos) {

    html,
    body {
      font-weight: 500 !important;
    }

    .fake-textbox {
      font-weight: 500 !important;
    }

    .title {
      font-weight: 500 !important;
    }
  }
}