bottom-sheet {
  > dimming {
    background-color: RGB(from var(--shade-color) r g b / calc(alpha * 2));
  }

  > sheet {
    box-shadow: 0 0 14px 2px RGB(0 0 6 / 3%),
                0 0 5px 2px RGB(0 0 6 / 10%),
                0 0 0 1px RGB(0 0 0 / 5%);
    transition: border-radius 100ms ease-out, box-shadow 250ms ease;

    @media (prefers-contrast: more) {
      box-shadow: 0 0 14px 2px RGB(0 0 6 / 3%),
                  0 0 5px 2px RGB(0 0 6 / 10%),
                  0 0 0 1px RGB(0 0 0 / 80%);
    }

    > stack > widget > drag-handle {
      background-color: color-mix(in srgb, currentColor 25%, transparent);
      min-width: 54px;
      min-height: 6px;
      margin: 15px;
      border-radius: 99px;
    }

    > outline {
      box-shadow: inset 1px 0 $window_outline_color,
                  inset -1px 0 $window_outline_color,
                  inset 0 1px $window_outline_color;
      transition: border-radius 100ms ease-out;

      @media (prefers-contrast: more) {
        box-shadow: inset 1px 0 $window_outline_color_hc,
                    inset -1px 0 $window_outline_color_hc,
                    inset 0 1px $window_outline_color_hc;
      }
    }

    > stack > button {
      @include focus-ring($outer: true, $offset: 0, $transition: $button_transition);

      border-radius: 0;
      padding: 0;
      min-width: 0;
      min-height: 0;
      font-weight: inherit;
      background: none;
      box-shadow: none;

      &:hover {
        background: $view_hover_color;
      }

      &.keyboard-activating,
      &:active {
        background: $view_active_color;
      }

      &.inert {
        &:hover, &:active, &.keyboard-activating {
          background: none;
        }
      }
    }

    &,
    > outline,
    > stack > widget,
    > stack > button,
    > stack > button > widget {
      border-top-left-radius: $dialog_radius;
      border-top-right-radius: $dialog_radius;
    }

    &.flush-left > outline {
      box-shadow: inset -1px 0 $window_outline_color,
                  inset 0 1px $window_outline_color;
    }

    &.flush-right > outline {
      box-shadow: inset 1px 0 $window_outline_color,
                  inset 0 1px $window_outline_color;
    }

    &.flush-left.flush-right > outline {
      box-shadow: inset 0 1px $window_outline_color;
    }

    @media (prefers-contrast: more) {
      &.flush-left > outline {
        box-shadow: inset -1px 0 $window_outline_color_hc,
                    inset 0 1px $window_outline_color_hc;
      }

      &.flush-right > outline {
        box-shadow: inset 1px 0 $window_outline_color_hc,
                    inset 0 1px $window_outline_color_hc;
      }

      &.flush-left.flush-right > outline {
        box-shadow: inset 0 1px $window_outline_color_hc;
      }
    }

    &.bottom-bar {
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--shade-color) 75%, transparent),
                  0 2px 8px 2px var(--shade-color),
                  0 3px 20px 10px RGB(0 0 6 / 5%),
                  0 6px 32px 16px RGB(0 0 6 / 2%);

      @media (prefers-contrast: more) {
        box-shadow: 0 0 0 1px RGB(0 0 6 / 80%),
                    0 2px 8px 2px var(--shade-color),
                    0 3px 20px 10px RGB(0 0 6 / 5%),
                    0 6px 32px 16px RGB(0 0 6 / 2%);
      }

      &.hidden {
        box-shadow: none;
      }

      &.flush-left {
        &,
        > outline,
        > stack > widget,
        > stack > button,
        > stack > button > widget {
          border-top-left-radius: 0;
        }
      }

      &.flush-right {
        &,
        > outline,
        > stack > widget,
        > stack > button,
        > stack > button > widget {
          border-top-right-radius: 0;
        }
      }

      @media not (prefers-contrast: more) {
        &, &.flush-left, &.flush-right, &.flush-left.flush-right {
          > outline,
          > stack > widget,
          > stack > button,
          > stack > button > widget {
            box-shadow: none;
          }
        }
      }
    }

    &.has-drag-handle toolbarview .top-bar > windowhandle {
      min-height: 36px;
    }

    &.has-drag-handle toolbarview toolbarview .top-bar > windowhandle {
      min-height: 0;
    }
  }
}
