wide-screen-width = 360px

@media (prefers-color-scheme: dark), (prefers-color-scheme: no-preference)
  #root .UpgradeScreen
    --bg: #303132
    --fg: #fff
    --done-fg: #64df64
    --active-fg: #4993E6
    --err-fg: #df6464
    --btn-fg: #fff
    --frame-fg: #afafaf
@media (prefers-color-scheme: light)
  #root .UpgradeScreen
    --bg: #efefef
    --fg: #000
    --done-fg: #098623
    --active-fg: #146fd9
    --err-fg: #d72f2f
    --btn-fg: #000
    --frame-fg: #323232

.UpgradeScreen
  position: absolute
  display: flex
  flex-direction: column
  top: 0
  left: 0
  width: 100%
  height: 100%
  z-index: 10000
  background-color: var(--bg)
  overflow-y: auto
  scrollbar-width: thin

.UpgradeScreen .container
  position: relative
  display: flex
  height: 100%
  flex-direction: column
  padding: 8px
  transform: translateZ(0)

.UpgradeScreen .title
  position: sticky
  top: 0
  margin: 24px 0 8px
  padding: 8px 0
  text-align: center
  font-size: rem(17)
  font-weight: 700
  color: var(--fg)
  z-index: 1
  background-color: var(--bg)
  box-shadow: 0 0 8px 0 var(--bg)
@media (min-width: wide-screen-width)
  .UpgradeScreen .title
    font-size: rem(24)
    margin: 32px 0 16px

.UpgradeScreen .loading-box
  position: relative

.UpgradeScreen .LoadingDots
  position: absolute
  top: auto
  height: auto
.UpgradeScreen[data-loading="false"] .LoadingDots
  display: none

.UpgradeScreen .progress
  position: relative
  width: 100%
  padding: 0 0 16px
  margin: 16px 0 auto

.UpgradeScreen .progress .list
  position: relative
  max-width: 210px
  margin: 0 auto

.UpgradeScreen .progress .item
  position: relative
  margin: 10px 0
  padding: 0 0 0 13px
  color: var(--fg)
  opacity: .7
  transition: opacity .2s, color .2s
  &:before
    content: ''
    position: absolute
    top: 9px
    left: 0
    width: 5px
    height: 5px
    border-radius: 50%
    background-color: var(--fg)
    opacity: .3
    transition: opacity .2s
.UpgradeScreen .progress .item[data-status="done"]
  opacity: 1
  color: var(--done-fg)
.UpgradeScreen .progress .item[data-status="no"]
  opacity: .3
.UpgradeScreen .progress .item[data-status="err"]
  opacity: 1
  color: var(--err-fg)
.UpgradeScreen .progress .item[data-status="in-progress"]
  opacity: 1
  color: var(--active-fg)
  &:before
    opacity: .7
.UpgradeScreen .progress .item[data-status="finish"]
  opacity: 1
  padding: 16px 0 0 6px
  color: var(--fg)
  &:before
    display: none
  .label
    font-size: rem(14)
    font-weight: 400
    line-height: 1.3rem

.UpgradeScreen .progress .label
  position: relative
  font-size: rem(15)
  font-weight: 700
  line-height: 1.2rem

.UpgradeScreen .progress .status
  position: relative
  font-size: rem(13)
  margin: 1px 0 0
  white-space: pre-wrap
  overflow-wrap: anywhere

.UpgradeScreen .error-box
  position: relative
  margin: auto
  max-width: 210px

.UpgradeScreen .error
  position: relative
  white-space: pre-wrap
  overflow-wrap: anywhere
  text-align: center
  font-size: rem(14)
  font-weight: 700
  color: var(--err-fg)

.UpgradeScreen .error-note
  position: relative
  margin: 24px 0 0 0
  white-space: pre-wrap
  overflow-wrap: anywhere
  text-align: center
  font-size: rem(14)
  font-weight: 600
  color: var(--fg)
  opacity: .7

.UpgradeScreen .controls
  position: sticky
  bottom: 0
  display: flex
  justify-content: center
  align-items: center
  flex-direction: column
  grid-gap: 8px
  width: 100%
  padding: 16px 0
  background-color: var(--bg)
  box-shadow: 0 0 8px 0 var(--bg)
