.kb-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--panel, #282d30);
  color: var(--cream, #f2f0eb);
  border: 1px solid #ffffff38;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: 0 10px 26px #00000070;
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.kb-top::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--p, 0%);
  background: var(--sage, #a7bc90);
  transition: width .1s linear;
}

.kb-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kb-top:hover {
  background: var(--sage, #a7bc90);
  border-color: var(--sage, #a7bc90);
  color: var(--bg, #14181b);
}

.kb-top:hover::after {
  background: var(--bg, #14181b);
}

.kb-top:focus-visible {
  outline: 3px solid var(--sage, #a7bc90);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .kb-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kb-top,
  .kb-top::after {
    transition: none;
  }
}