/* =============================================================================
   Custom in-page number keypad — big touch targets, docks at bottom of screen.
   Attach to a field by adding class="keypad-input" and (optionally)
   data-keypad="int" or data-keypad="decimal" (default: decimal).
   ============================================================================= */

.keypad-input {
  cursor: pointer;
  caret-color: transparent;   /* hide the caret since the keypad is authoritative */
}

.keypad-overlay {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(10, 42, 74, 0.60);
  padding: 20px 12px 24px;
  animation: keypad-fade 0.15s ease-out;
}
.keypad-overlay.active { display: block; }

@keyframes keypad-fade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.keypad-panel {
  max-width: 540px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.35);
}

.keypad-preview {
  background: #f5f5e8;
  border: 2px solid #ddd0a0;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.keypad-preview .kp-label {
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 0.82rem;
  color: #4a3d00;
  font-weight: 700;
}
.keypad-preview .kp-value {
  font-family: 'Barlow', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0a2a4a;
  font-variant-numeric: tabular-nums;
  flex: 1;
  text-align: right;
}
.keypad-preview .kp-value.empty { color: #aaa; font-style: italic; font-size: 1rem; }

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keypad-btn {
  min-height: 76px;
  font-size: 1.7rem;
  font-weight: 700;
  font-family: 'Barlow', sans-serif;
  background: #fffdf4;
  color: #0a2a4a;
  border: 2px solid #ddd0a0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.08s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.keypad-btn:hover { background: #fff8dc; }
.keypad-btn:active { background: #f5c518; color: #0a2a4a; transform: scale(0.97); }

.keypad-btn.kp-back  { background: #fff0ee; border-color: #f0b0a0; color: #cc2200; font-size: 1.4rem; }
.keypad-btn.kp-clear { background: #fff0ee; border-color: #f0b0a0; color: #cc2200; font-size: 1.15rem; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.keypad-btn.kp-done  { background: #1456a0; border-color: #1456a0; color: #fff; font-size: 1.15rem; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.keypad-btn.kp-done:hover { background: #0a2a4a; }
.keypad-btn.kp-cancel { background: #fff; border-color: #ccc; color: #4a3d00; font-size: 1rem; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.keypad-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
