.access-lock-overlay,
.access-lock-panel,
.access-lock-key,
.access-lock-input {
  /*
   * Apollo live edit 2026-04-29: the worker terminal blocky lock font is the
   * approved standard for every lock/passcode/account gate. Keep the typeface
   * centralized here so chat, worker, engineer, login, passkey, and passcode
   * screens do not drift into page-specific fonts again.
   */
  --access-lock-font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /*
   * Apollo live correction 2026-04-29: every shared "Enter your/the
   * 4-digit access code" lock must render the instruction copy smaller.
   * Keep this as the single shared token source so chat, worker, engineer,
   * demo Founder Website, passkey, and passcode gates cannot drift by route.
   */
  --access-lock-body-font-size: 11px;
  --access-lock-body-line-height: 1.18;
  --access-lock-code-slot-font-size: 13px;
  --access-lock-key-font-size: 15px;
  --access-lock-key-number-font-size: 16px;
  --access-lock-key-letter-font-size: 8px;
  --access-lock-delete-font-size: 14px;
  --access-lock-keypad-max-width: 292px;
  font-family: var(--access-lock-font);
}

.access-lock-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  box-sizing: border-box;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 1200;
}

/* P0 unlock-stuck-text fix (2026-04-26): when JS sets hidden=true or adds the
 * .hidden class after a successful /api/access/unlock, the overlay must
 * actually disappear. Without this rule the .access-lock-overlay's
 * display:flex above wins over the user-agent [hidden] {display:none}. */
.access-lock-overlay[hidden],
.access-lock-overlay.hidden {
  display: none !important;
}

.access-lock-panel {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.access-lock-title {
  margin: 0;
  font-family: var(--access-lock-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-lock-panel .access-lock-body,
.access-lock-body.unlock-copy,
.access-lock-body {
  margin: 0;
  max-width: 34ch;
  font-family: var(--access-lock-font);
  /*
   * Apollo live correction 2026-04-29: this exact instruction text was too
   * large on multiple locks. Higher specificity keeps route-level
   * `.unlock-copy` rules from overriding the one shared lock standard.
   */
  font-size: var(--access-lock-body-font-size);
  line-height: var(--access-lock-body-line-height);
}

.access-lock-display {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 248px;
  justify-items: center;
}

.access-lock-dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 242, 222, 0.96);
  font-size: var(--access-lock-code-slot-font-size);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.access-lock-dot[data-state="filled"] {
  background: linear-gradient(180deg, #fff2d9 0%, #d7b98a 100%);
  border-color: rgba(255, 231, 190, 0.95);
  box-shadow:
    0 0 0 4px rgba(215, 185, 138, 0.14),
    0 0 22px rgba(255, 224, 176, 0.28);
  transform: scale(1.06);
}

.access-lock-dot[data-state="revealed"],
.access-lock-dot[data-state="confirmed"] {
  background: rgba(255, 246, 233, 0.12);
  border-color: rgba(255, 231, 190, 0.82);
  box-shadow:
    0 0 0 4px rgba(215, 185, 138, 0.1),
    0 0 20px rgba(255, 224, 176, 0.18);
}

.access-lock-error {
  min-height: 20px;
  color: #ff8d8d;
  font-size: 0.92em;
}

.access-lock-panel {
  position: relative;
}

/*
  Do not remove keypad input focusability. Mobile keyboard auto-popup depends on
  this input remaining focusable, enabled, measurable, and pointer-safe. The
  four dots are the only visible code-entry surface; this real input must stay
  visually hidden, not display:none/visibility:hidden/disabled/readonly.
*/
.access-lock-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  padding: 0;
  opacity: 0.01;
  pointer-events: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: var(--access-lock-key-font-size);
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  transform: none;
  z-index: 3;
  -webkit-text-security: disc;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.access-lock-input::placeholder {
  color: transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  -webkit-text-security: none;
}

.access-lock-input:focus {
  outline: none;
}

.access-lock-panel:focus-within .access-lock-dot {
  border-color: rgba(255, 231, 190, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(215, 185, 138, 0.1);
}

.access-lock-input::selection,
.access-lock-input::-moz-selection {
  background: transparent;
  color: transparent;
}

.access-lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: var(--access-lock-keypad-max-width);
  box-sizing: border-box;
}

.access-lock-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  font-size: var(--access-lock-key-number-font-size);
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.08s ease,
    border-color 0.08s ease,
    transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.access-lock-key-number {
  font-size: var(--access-lock-key-number-font-size);
  font-weight: 600;
  line-height: 1;
}

.access-lock-key-letters {
  min-height: 11px;
  margin-top: 3px;
  color: rgba(231, 226, 217, 0.58);
  font-size: var(--access-lock-key-letter-font-size);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.access-lock-key:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
}

.access-lock-key:active:not(:disabled),
.access-lock-key.pressed:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.32);
  transform: scale(0.94);
}

.access-lock-key-del {
  font-size: var(--access-lock-delete-font-size);
}

.access-lock-key-spacer {
  visibility: hidden;
  pointer-events: none;
}

.access-lock-keypad.submitting .access-lock-key {
  opacity: 0.35;
  pointer-events: none;
}

.access-lock-auth-options {
  width: 100%;
  max-width: var(--access-lock-keypad-max-width);
  display: grid;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--access-lock-font);
}

.access-lock-passkey {
  border: 1px solid rgba(255, 231, 190, 0.28);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: 800 11px/1.2 var(--access-lock-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.access-lock-panel :where(button, [role="button"], input[type="submit"]) {
  white-space: nowrap;
}

.access-lock-passkey:disabled {
  cursor: default;
  opacity: 0.62;
}

.access-lock-auth-status {
  min-height: 16px;
  margin: 0;
  color: rgba(255, 242, 222, 0.68);
  font-size: 11px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .access-lock-panel {
    gap: 12px;
  }

  .access-lock-display,
  .access-lock-keypad {
    max-width: 100%;
  }
}
