.ff-phone-keypad[hidden] { display: none !important; }
.ff-phone-keypad {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  align-items: end;
  justify-items: center;
  font-family: inherit;
}
.ff-phone-keypad__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(3, 16, 12, .58);
  backdrop-filter: blur(4px);
  cursor: default;
}
.ff-phone-keypad__sheet {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 460px);
  max-height: min(92dvh, 760px);
  overflow: auto;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #f9fffb 0%, #eef8f1 100%);
  box-shadow: 0 -24px 70px rgba(4, 42, 28, .28);
  animation: ff-phone-keypad-in .22s ease-out;
}
.ff-phone-keypad__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ff-phone-keypad__header small {
  display: block;
  color: #27835a;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .15em;
}
.ff-phone-keypad__header h2 {
  margin: 2px 0 0;
  color: #103526;
  font-size: 1.1rem;
}
.ff-phone-keypad__close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #cadfd1;
  border-radius: 50%;
  background: #fff;
  color: #375447;
  font-size: 1.5rem;
}
.ff-phone-keypad__screen {
  display: block;
  min-height: 68px;
  padding: 15px;
  border: 1px solid #b8d8c5;
  border-radius: 18px;
  background: #fff;
  color: #0c3d2b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 24px rgba(13, 82, 55, .08);
  font-size: clamp(1.42rem, 7vw, 2rem);
  font-weight: 900;
  letter-spacing: .025em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ff-phone-keypad__hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 2px 12px;
  color: #526c60;
  font-size: .78rem;
}
.ff-phone-keypad__hint strong { color: #176b48; }
.ff-phone-keypad__hint span { text-align: right; }
.ff-phone-keypad__hint span[data-tone="error"] { color: #b42318; font-weight: 800; }
.ff-phone-keypad__hint span[data-tone="success"] { color: #087443; font-weight: 800; }
.ff-phone-keypad__keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ff-phone-keypad__keys button {
  min-height: 58px;
  border: 1px solid #c8ded0;
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #f6fbf8);
  color: #123c2c;
  box-shadow: 0 5px 0 #c7ddcf, 0 10px 20px rgba(14, 76, 51, .08);
  font: 900 1.28rem/1 inherit;
  touch-action: manipulation;
}
.ff-phone-keypad__keys button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c7ddcf;
}
.ff-phone-keypad__keys .ff-phone-keypad__spacer { min-height: 58px; }
.ff-phone-keypad__keys .is-delete { color: #9f2f2a; }
.ff-phone-keypad__actions {
  display: grid;
  grid-template-columns: .75fr 1.75fr;
  gap: 10px;
  margin-top: 14px;
}
.ff-phone-keypad__actions button {
  min-height: 52px;
  border-radius: 15px;
  font: 850 .95rem/1 inherit;
}
.ff-phone-keypad__actions .is-clear {
  border: 1px solid #cbdad1;
  background: #fff;
  color: #5c7065;
}
.ff-phone-keypad__actions .is-confirm {
  border: 1px solid #08774e;
  background: linear-gradient(135deg, #0b8b5b, #076a47);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 119, 78, .23);
}
body.ff-phone-keypad-open { overflow: hidden; }
[data-ff-phone-input][readonly]:not([disabled]) {
  cursor: pointer;
  background-image: linear-gradient(135deg, rgba(14, 132, 88, .04), rgba(14, 132, 88, .09));
}
[data-ff-phone-input][data-ff-phone-locked="1"] { cursor: not-allowed; }

@keyframes ff-phone-keypad-in {
  from { transform: translateY(28px); opacity: .3; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 700px) {
  .ff-phone-keypad { align-items: center; }
  .ff-phone-keypad__sheet { border-radius: 26px; padding-bottom: 22px; }
  .ff-phone-keypad__keys button { min-height: 62px; }
}

@media (max-width: 360px) {
  .ff-phone-keypad__sheet { padding-inline: 12px; }
  .ff-phone-keypad__keys { gap: 8px; }
  .ff-phone-keypad__keys button { min-height: 52px; }
  .ff-phone-keypad__keys .ff-phone-keypad__spacer { min-height: 52px; }
  .ff-phone-keypad__hint { align-items: flex-start; flex-direction: column; }
  .ff-phone-keypad__hint span { text-align: left; }
}

@media (max-height: 680px) {
  .ff-phone-keypad__sheet { padding-top: 10px; }
  .ff-phone-keypad__header { margin-bottom: 8px; }
  .ff-phone-keypad__screen { min-height: 54px; padding: 10px; }
  .ff-phone-keypad__hint { margin-block: 7px 9px; }
  .ff-phone-keypad__keys { gap: 7px; }
  .ff-phone-keypad__keys button,
  .ff-phone-keypad__keys .ff-phone-keypad__spacer { min-height: 46px; }
  .ff-phone-keypad__actions { margin-top: 10px; }
  .ff-phone-keypad__actions button { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .ff-phone-keypad__sheet { animation: none; }
  .ff-phone-keypad__keys button { transition: none; }
}
