.lock-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)) 20px;
  color: #ffffff;
}

.lock-screen.visible {
  display: flex;
}

.lock-screen.auth-mode {
  color: #111111;
}

.lock-screen.local-mode {
  color: #ffffff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(180deg, #f3f3f3 0%, #ededed 52%, #e6e6e6 100%) !important;
}

.lock-screen-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 26px;
  text-align: center;
}

.lock-screen.auth-mode .lock-screen-top {
  width: 100%;
  padding-top: 30px;
}

.lock-screen-clock {
  font-size: 56px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 1px;
  text-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
}

.lock-screen-date {
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0.94;
  text-shadow: 0 4px 18px rgba(15, 23, 42, 0.24);
}

.lock-screen.auth-mode .lock-screen-clock,
.lock-screen.auth-mode .lock-screen-date {
  color: #111111;
  text-shadow: none;
}

.lock-screen.auth-mode .lock-screen-clock {
  font-size: 68px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lock-screen.auth-mode .lock-screen-date {
  font-size: 15px;
  letter-spacing: 0.16em;
}

.lock-screen.local-mode .lock-screen-clock,
.lock-screen.local-mode .lock-screen-date {
  color: #ffffff;
}

.lock-screen.local-mode .lock-screen-clock {
  font-size: 74px;
  font-weight: 300;
  letter-spacing: 0.03em;
}

.lock-screen.local-mode .lock-screen-date {
  font-size: 16px;
  letter-spacing: 0.14em;
}

.lock-screen-card {
  width: min(100%, 368px);
  align-self: center;
  padding: 22px 20px 18px;
  border-radius: 32px;
}

.lock-screen.auth-mode .lock-screen-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.96)),
    repeating-linear-gradient(
      135deg,
      rgba(17, 17, 17, 0.045) 0 1px,
      transparent 1px 14px
    );
  border: 1px solid rgba(17, 17, 17, 0.14);
  box-shadow:
    0 24px 60px rgba(17, 17, 17, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lock-screen.local-mode .lock-screen-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lock-screen-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.lock-screen.auth-mode .lock-screen-title {
  color: #111111;
  letter-spacing: 0.12em;
}

.lock-screen.local-mode .lock-screen-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.lock-screen-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.lock-screen-note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.lock-screen.auth-mode .lock-screen-note {
  color: rgba(17, 17, 17, 0.62);
}

.lock-screen.local-mode .lock-screen-note {
  color: rgba(255, 255, 255, 0.76);
}

.lock-screen.auth-mode .lock-screen-hint {
  color: rgba(17, 17, 17, 0.72);
}

.lock-screen.local-mode .lock-screen-hint {
  color: rgba(255, 255, 255, 0.88);
}

.lock-screen-input {
  width: 100%;
  margin-top: 14px;
  border-radius: 18px;
  padding: 13px 14px;
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lock-screen.auth-mode .lock-screen-input {
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  box-shadow: inset 0 -1px 0 rgba(17, 17, 17, 0.04);
}

.lock-screen.auth-mode .lock-screen-input::placeholder {
  color: rgba(17, 17, 17, 0.42);
}

.lock-screen.auth-mode .lock-screen-input:focus {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.3);
}

.lock-screen-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.lock-screen-btn {
  flex: 1;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.lock-screen-btn:active {
  transform: scale(0.98);
}

.lock-screen.auth-mode .lock-screen-btn.primary {
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
}

.lock-screen.auth-mode .lock-screen-btn.soft {
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(17, 17, 17, 0.06);
  color: #111111;
}

.lock-screen.local-mode .lock-screen-btn.primary {
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 237, 237, 0.98));
  color: #111111;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 6px 16px rgba(17, 17, 17, 0.08);
}

.lock-screen.local-mode .lock-screen-btn.soft {
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: #111111;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.lock-screen-status {
  min-height: 18px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.lock-screen.auth-mode .lock-screen-status {
  color: rgba(17, 17, 17, 0.84);
}

.lock-screen.local-mode .lock-screen-status {
  color: rgba(255, 255, 255, 0.94);
}

.lock-screen-status.error {
  color: #dc2626;
}

.lock-screen.local-mode .lock-screen-status.error {
  color: #ffe4e6;
}

.lock-screen-status.success {
  color: #166534;
}

.lock-screen.local-mode .lock-screen-status.success {
  color: #dcfce7;
}

.lock-screen-meta {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.lock-screen.auth-mode .lock-screen-meta {
  color: rgba(17, 17, 17, 0.62);
}

.lock-screen.local-mode .lock-screen-meta {
  color: rgba(255, 255, 255, 0.76);
}

.local-lock-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 24px;
}

.local-lock-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: transparent;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.local-lock-dot.filled {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.08);
}

.local-lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 74px));
  justify-content: center;
  gap: 12px 14px;
  margin-top: 2px;
}

.local-lock-key {
  min-height: 72px;
  width: 72px;
  min-width: 72px;
  border-radius: 999px;
  padding: 0;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
}

.local-lock-key.action {
  font-size: 13px;
  font-weight: 600;
}

.lock-screen.local-mode .local-lock-key {
  border: 1px solid rgba(17, 17, 17, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(232, 232, 232, 0.99)),
    repeating-linear-gradient(135deg, rgba(17, 17, 17, 0.04) 0 1px, transparent 1px 12px);
  color: #111111;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 16px rgba(17, 17, 17, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lock-screen.local-mode .local-lock-key.action {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lock-screen.local-mode .local-lock-key:hover {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.98), rgba(240, 240, 240, 0.98));
}

.lock-screen.local-mode .local-lock-key:active {
  background: linear-gradient(180deg, rgba(238, 238, 238, 0.98), rgba(226, 226, 226, 0.98));
}

.lock-screen.local-mode #localLockRefreshBtn {
  display: none;
}

.lock-screen.local-mode .lock-screen-top {
  position: relative;
  z-index: 3;
  gap: 6px;
  padding-top: 14px;
}

.lock-screen-local-cover {
  position: absolute;
  inset: 112px 0 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(243, 243, 243, 0.96), rgba(232, 232, 232, 0.98));
}

.lock-screen-local-cover-decor {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  color: rgba(17, 17, 17, 0.56);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.lock-screen-local-gallery {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 316px;
  height: 520px;
  transform: translateX(-50%);
}

.lock-screen-polaroid {
  position: absolute;
  width: 92px;
  height: 122px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  padding: 8px 8px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.98)),
    repeating-linear-gradient(135deg, rgba(17, 17, 17, 0.03) 0 1px, transparent 1px 12px);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.06);
  cursor: pointer;
}

.lock-screen-polaroid-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #f0f0f0, #e8e8e8);
}

.lock-screen-polaroid-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lock-screen-polaroid-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: rgba(17, 17, 17, 0.48);
  text-align: center;
  padding: 8px;
  line-height: 1.4;
  background: linear-gradient(180deg, #f2f2f2, #eaeaea);
}

.lock-screen-local-swipe {
  position: absolute;
  left: 50%;
  bottom: 142px;
  transform: translateX(-50%);
  width: 180px;
  border: none;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 0;
  color: rgba(17, 17, 17, 0.68);
  cursor: pointer;
}

.lock-screen-local-swipe-bar {
  width: 152px;
  height: 5px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.12);
}

.lock-screen-local-swipe-text {
  display: none;
}

.lock-screen-local-shortcuts {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lock-screen-local-shortcut {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 240, 240, 0.94)),
    repeating-linear-gradient(135deg, rgba(17, 17, 17, 0.03) 0 1px, transparent 1px 12px);
  color: rgba(17, 17, 17, 0.72);
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 16px rgba(17, 17, 17, 0.08);
}

.lock-screen.local-mode .lock-screen-clock,
.lock-screen.local-mode .lock-screen-date {
  color: rgba(17, 17, 17, 0.56);
  text-shadow: none;
}

.lock-screen.local-mode .lock-screen-date {
  font-size: 15px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.lock-screen.local-mode .lock-screen-clock {
  font-size: 84px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.lock-screen.local-mode .lock-screen-card {
  width: min(100%, 368px);
  align-self: center;
  margin-top: auto;
  margin-bottom: 44px;
  padding: 18px 18px 14px;
  background:
    linear-gradient(180deg, rgba(244, 244, 244, 0.995), rgba(232, 232, 232, 0.99)),
    repeating-linear-gradient(135deg, rgba(17, 17, 17, 0.045) 0 1px, transparent 1px 14px);
  border: 1px solid rgba(17, 17, 17, 0.14);
  box-shadow:
    0 20px 48px rgba(17, 17, 17, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lock-screen.local-mode .lock-screen-title {
  color: #111111;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.lock-screen.local-mode .lock-screen-hint {
  color: rgba(17, 17, 17, 0.78);
  margin-top: 0;
  margin-bottom: 6px;
}

.lock-screen.local-mode .lock-screen-status,
.lock-screen.local-mode .lock-screen-meta {
  color: rgba(17, 17, 17, 0.78);
}

.lock-screen-top-note {
  width: auto;
  min-width: 120px;
  max-width: 220px;
  margin-top: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(17, 17, 17, 0.56);
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 999px;
  outline: none;
  opacity: 0.95;
}

.lock-screen-top-note::placeholder {
  color: rgba(17, 17, 17, 0.32);
}

.lock-screen-top-note[readonly] {
  cursor: text;
}

.lock-screen-top-note.is-editing {
  border-color: rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.68);
}

.lock-screen.local-mode .lock-screen-top-note,
.lock-screen.auth-mode .lock-screen-top-note {
  color: rgba(17, 17, 17, 0.56);
}

.lock-screen-local-gallery .photo-1 {
  left: 10px !important;
  top: 34px !important;
}

.lock-screen-local-gallery .photo-2 {
  left: 114px !important;
  top: 52px !important;
}

.lock-screen-local-gallery .photo-3 {
  left: 216px !important;
  top: 28px !important;
}

.lock-screen-local-gallery .photo-4 {
  left: 22px !important;
  top: 196px !important;
}

.lock-screen-local-gallery .photo-5 {
  left: 124px !important;
  top: 220px !important;
}

.lock-screen-local-gallery .photo-6 {
  left: 214px !important;
  top: 176px !important;
}

.lock-screen-local-gallery .photo-7 {
  left: 10px !important;
  top: 356px !important;
}

.lock-screen-local-gallery .photo-8 {
  left: 118px !important;
  top: 366px !important;
}

.lock-screen-local-gallery .photo-9 {
  left: 228px !important;
  top: 370px !important;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .lock-screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .lock-screen-card {
    width: 100%;
  }

  .local-lock-keypad {
    grid-template-columns: repeat(3, minmax(0, 68px));
    gap: 10px 12px;
  }

  .local-lock-key {
    width: 68px;
    min-width: 68px;
    min-height: 68px;
    font-size: 22px;
  }
}
