/* Modal / bottom sheet dan toast. */

#modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

#modal.on {
  display: block;
}

.ov {
  position: absolute;
  inset: 0;
  background: var(--ov);
  backdrop-filter: blur(3px);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92%;
  overflow: auto;
  background: var(--sf);
  border: 1px solid var(--bd);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom,0px));
  animation: up .25s ease;
}

@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes pop {
  from {
    transform: translate(-50%,-48%) scale(.97);
    opacity: 0;
  }
  to {
    transform: translate(-50%,-50%);
    opacity: 1;
  }
}

.sh-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sh-h h2 {
  font-size: 18px;
  font-weight: 800;
}

.x {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sf2);
  color: var(--mu);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom,0px));
  transform: translate(-50%,20px);
  background: var(--tx);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 60;
  max-width: 90%;
}

#toast.on {
  opacity: 1;
  transform: translate(-50%,0);
}

@media (min-width:720px) {
  .sheet {
    left: 50%;
    top: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%,-50%);
    width: 470px;
    border-radius: 24px;
    max-height: 90%;
    animation: pop .2s ease;
  }
}

@media (min-width:1024px) {
  #toast {
    bottom: 32px;
  }
}
