.pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: color-mix(in srgb, var(--sf) 86%, transparent);
  backdrop-filter: blur(30px) saturate(1.8);
  border-radius: 12px;
  padding: 5px;
  min-width: 220px;
  box-shadow:
    0 0 0 0.5px var(--ln),
    0 18px 44px rgba(0, 0, 0, 0.22);
  z-index: 9;
}
.pop button {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
}
.pop button:hover {
  background: var(--ac);
  color: #fff;
}
.pop hr {
  border: 0;
  border-top: 0.5px solid var(--ln);
  margin: 5px 8px;
}
.pop small {
  display: block;
  padding: 4px 10px;
  color: var(--mu);
  font-size: 11.5px;
  font-weight: 600;
}
.ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 10;
  display: grid;
  place-items: center;
}
.md {
  background: var(--bg);
  border-radius: 14px;
  padding: 20px;
  width: min(400px, 92vw);
  box-shadow:
    0 0 0 0.5px var(--ln),
    0 30px 80px rgba(0, 0, 0, 0.35);
  animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
}
.seg2 {
  display: flex;
  background: var(--sf2);
  padding: 2px;
  border-radius: 9px;
  margin: 12px 0;
}
.seg2 button {
  flex: 1;
  text-align: center;
  padding: 5px 2px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 560;
}
.seg2 .on {
  background: var(--sf);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.pd {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 8px;
}
.pd i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--mu);
}
.pd i.on {
  background: var(--tx);
  box-shadow: none;
}
.kp {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px;
  justify-content: center;
}
.kp button {
  height: 64px;
  border-radius: 50%;
  background: var(--sf2);
  font-size: 24px;
  text-align: center;
  display: grid;
  place-items: center;
}
.kp button:active {
  background: var(--ln);
}
.in.bad {
  border-color: #ff3b30;
  animation: shk 0.35s;
}
@keyframes shk {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Kodepanelet: ingen pop-animasjon (den spilte av for hvert tastetrykk), men en liten risting ved feil kode */
.ov.nopop .md {
  animation: none;
}
.pd.shake {
  animation: shk 0.35s;
}
.kp button {
  transition:
    background 0.1s,
    transform 0.08s;
}
.kp button:active {
  transform: scale(0.92);
}
