#screen-lock {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
}
#screen-lock .brand {
  margin: 0;
  color: var(--accent);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}
.lock-note {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.92rem;
}
.lock-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
}
#lock-panel .lock-dot:not(.lead),
#lock-boxes {
  opacity: 0;
  transition: opacity 0.35s ease;
}
#screen-lock.awake #lock-panel .lock-dot,
#screen-lock.awake #lock-boxes {
  opacity: 1;
}
#lock-cancel {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 45;
  width: auto;
  margin: 0;
}
@media (hover: hover) {
  #lock-panel:hover .lock-dot,
  #lock-panel:hover #lock-boxes {
    opacity: 1;
  }
}
.pin-boxes {
  display: flex;
  gap: 10px;
}
.pin-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}
.pin-box.on {
  border-color: rgba(212, 101, 74, 0.45);
  background: rgba(212, 101, 74, 0.08);
}
.pin-boxes.shake {
  animation: pin-shake 0.36s ease;
}
@keyframes pin-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(3px);
  }
}
.lock-pad {
  position: relative;
  width: min(240px, 66vw);
  aspect-ratio: 1;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.lock-dot {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  transition:
    opacity 0.35s ease,
    color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.lock-dot.hot {
  color: var(--text);
  background: rgba(212, 101, 74, 0.2);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(212, 101, 74, 0.16);
  transition-duration: 0.08s;
}
#screen-lock:not(.awake) .lock-dot.lead {
  animation: lead-breathe 2.6s ease-in-out infinite;
}
@keyframes lead-breathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.14);
    opacity: 0.9;
  }
}
@media (pointer: coarse), (max-width: 720px) {
  #screen-lock {
    align-content: start;
    padding-top: calc(28px + env(safe-area-inset-top));
    gap: 12px;
  }
  html[data-hand] #lock-panel,
  html[data-hand] #lock-view .lock-panel {
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom));
    width: max-content;
    margin: 0;
    gap: 10px;
    z-index: 3;
  }
  html[data-hand="left"] #lock-panel,
  html[data-hand="left"] #lock-view .lock-panel {
    left: calc(28px + env(safe-area-inset-left));
    right: auto;
  }
  html[data-hand="right"] #lock-panel,
  html[data-hand="right"] #lock-view .lock-panel {
    left: auto;
    right: calc(28px + env(safe-area-inset-right));
  }
  #lock-boxes,
  #lock-setup-boxes {
    position: fixed;
    left: 0;
    right: 0;
    top: 46%;
    width: auto;
    margin: 0;
    justify-content: center;
    z-index: 6;
  }
}
.lock-dot.pop {
  animation: key-pop 0.28s ease-out;
}
@keyframes key-pop {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  40% {
    transform: translate(-50%, -50%) scale(1.22);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}
.lock-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

html.source-privacy-pending body > :not(#source-lock),
html.source-privacy-locked body > :not(#source-lock) {
  display: none !important;
}
#source-lock {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  background: var(--bg, #fff);
  color: var(--text, #1c1916);
  --line: #ccc;
  --muted: #888;
}
#source-lock[hidden] {
  display: none;
}
#source-lock .brand {
  font-size: 1.5rem;
}
#source-lock .privacy-back {
  position: fixed;
  top: 18px;
  right: 18px;
  color: inherit;
}
html[data-theme="dark"] #source-lock {
  background: #1a1a1a;
  color: #f2f0ec;
  --text: #f2f0ec;
  --line: #555;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] #source-lock {
    background: #1a1a1a;
    color: #f2f0ec;
    --text: #f2f0ec;
    --line: #555;
  }
}
#source-lock .lock-dot {
  opacity: 1;
}
#source-lock #lock-boxes {
  opacity: 1;
}
