html.pwa-standalone #pwa-login-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.pwa-standalone:not(.pwa-authed) {
  overflow-x: hidden;
  max-width: 100%;
}

html.pwa-standalone:not(.pwa-authed) body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

html.pwa-standalone:not(.pwa-authed) #app {
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
}

#pwa-login-screen,
#pwa-login-screen * {
  box-sizing: border-box;
}

html.pwa-standalone.pwa-authed #pwa-login-screen {
  display: none;
}

.pwa-login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(10, 132, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(94, 92, 230, 0.18), transparent 50%),
    #000;
}

@media (prefers-color-scheme: light) {
  .pwa-login-bg {
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(10, 132, 255, 0.15), transparent 55%),
      radial-gradient(ellipse 60% 40% at 100% 100%, rgba(94, 92, 230, 0.1), transparent 50%),
      #f2f2f7;
  }
}

.pwa-login-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: 100%;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pwa-login-inner {
  width: 100%;
  max-width: min(440px, 100%);
  margin: 0 auto;
  flex-shrink: 0;
  min-width: 0;
}

.pwa-login-hero {
  text-align: center;
  margin-bottom: clamp(16px, 4vw, 28px);
}

.pwa-login-logo {
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
  margin: 0 auto clamp(12px, 3vw, 18px);
  border-radius: clamp(18px, 5vw, 22px);
  background: linear-gradient(145deg, #0a84ff 0%, #5e5ce6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 12px 32px rgba(10, 132, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pwa-login-logo svg {
  width: clamp(36px, 10vw, 48px);
  height: clamp(36px, 10vw, 48px);
}

.pwa-login-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.pwa-login-tagline {
  margin: 0;
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 400;
  color: rgba(235, 235, 245, 0.6);
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: light) {
  .pwa-login-title { color: #1c1c1e; }
  .pwa-login-tagline { color: rgba(60, 60, 67, 0.6); }
}

.pwa-login-sheet {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 22px) clamp(14px, 3.5vw, 20px);
  border-radius: clamp(18px, 4vw, 22px);
  background: rgba(28, 28, 30, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  min-width: 0;
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  .pwa-login-sheet {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  }
}

.pwa-login-segment {
  margin-bottom: 18px;
}

.pwa-login-segment--single {
  display: none;
}

.pwa-login-segment-track {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.24);
  overflow: hidden;
  max-width: 100%;
}

.pwa-login-segment-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 3px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  transition: transform 0.28s cubic-bezier(0.25, 0.1, 0.25, 1), width 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

@media (prefers-color-scheme: light) {
  .pwa-login-segment-track { background: rgba(118, 118, 128, 0.16); }
  .pwa-login-segment-thumb {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  }
}

.pwa-login-segment-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(235, 235, 245, 0.55);
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.pwa-login-segment-btn--active {
  color: #fff;
}

@media (prefers-color-scheme: light) {
  .pwa-login-segment-btn { color: rgba(60, 60, 67, 0.55); }
  .pwa-login-segment-btn--active { color: #1c1c1e; }
}

.pwa-login-alert {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 69, 58, 0.14);
  border: 1px solid rgba(255, 69, 58, 0.22);
  font-size: 13px;
  line-height: 1.4;
  color: #ff6961;
  text-align: center;
}

.pwa-login-alert[hidden] {
  display: none !important;
}

.pwa-login-alert--info {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.22);
  color: #64b5ff;
}

@media (prefers-color-scheme: light) {
  .pwa-login-alert { color: #ff3b30; }
  .pwa-login-alert--info { color: #007aff; }
}

.pwa-login-pane {
  animation: pwaLoginFadeIn 0.32s ease;
  min-width: 0;
  max-width: 100%;
}

.pwa-login-sub {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: rgba(235, 235, 245, 0.55);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: light) {
  .pwa-login-sub { color: rgba(60, 60, 67, 0.55); }
}

.pwa-login-widget-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.pwa-login-widget {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  overflow: visible;
}

.pwa-login-widget iframe {
  width: 100% !important;
  min-height: 48px !important;
  height: 52px !important;
}

.pwa-btn--telegram {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2aabee;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.pwa-btn--telegram:hover {
  opacity: 0.92;
}

.pwa-btn--telegram:active {
  transform: scale(0.98);
}

.pwa-btn--telegram:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pwa-btn--telegram svg {
  flex-shrink: 0;
}

.pwa-install-hint {
  margin: 24px auto 0;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: rgba(235, 235, 245, 0.35);
}

@media (prefers-color-scheme: light) {
  .pwa-install-hint { color: rgba(60, 60, 67, 0.4); }
}

.pwa-input-group {
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.pwa-input-group:focus-within {
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.pwa-input-group--password {
  background: rgba(28, 28, 30, 0.45);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (prefers-color-scheme: light) {
  .pwa-input-group { background: rgba(118, 118, 128, 0.12); border-color: rgba(60, 60, 67, 0.12); }
  .pwa-input-group--password { background: rgba(255, 255, 255, 0.92); border-color: rgba(60, 60, 67, 0.18); }
}

.pwa-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 52px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}

.pwa-input-row:focus-within {
  background: rgba(10, 132, 255, 0.08);
}

.pwa-input-row:last-child {
  border-bottom: none;
}

@media (prefers-color-scheme: light) {
  .pwa-input-row { border-bottom-color: rgba(60, 60, 67, 0.12); }
}

.pwa-input-label {
  flex-shrink: 0;
  width: 72px;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.02em;
}

@media (prefers-color-scheme: light) {
  .pwa-input-label { color: #1c1c1e; }
}

.pwa-input-field {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: none;
  background: transparent;
  color: #fff;
  font: 16px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.pwa-input-field::placeholder {
  color: rgba(235, 235, 245, 0.3);
}

.pwa-input-field:focus {
  outline: none;
}

.pwa-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pwa-input-field--password {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.pwa-input-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.28);
  color: rgba(235, 235, 245, 0.75);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pwa-input-toggle:active {
  background: rgba(118, 118, 128, 0.42);
}

.pwa-input-toggle-icon {
  width: 22px;
  height: 22px;
}

.pwa-input-toggle-icon--hide {
  display: none;
}

.pwa-input-toggle--visible .pwa-input-toggle-icon--show {
  display: none;
}

.pwa-input-toggle--visible .pwa-input-toggle-icon--hide {
  display: block;
}

.pwa-input-toggle--visible {
  color: #0a84ff;
  background: rgba(10, 132, 255, 0.16);
}

@media (prefers-color-scheme: light) {
  .pwa-input-row:focus-within { background: rgba(10, 132, 255, 0.06); }
  .pwa-input-toggle {
    background: rgba(118, 118, 128, 0.16);
    color: rgba(60, 60, 67, 0.65);
  }
  .pwa-input-toggle--visible {
    color: #007aff;
    background: rgba(10, 132, 255, 0.12);
  }
}

@media (prefers-color-scheme: light) {
  .pwa-input-field { color: #1c1c1e; }
  .pwa-input-field::placeholder { color: rgba(60, 60, 67, 0.3); }
}

.pwa-email-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.pwa-btn {
  display: block;
  width: 100%;
  min-height: clamp(46px, 12vw, 52px);
  padding: clamp(12px, 3vw, 14px) 20px;
  border: none;
  border-radius: clamp(12px, 3vw, 14px);
  font: 600 clamp(16px, 4.2vw, 17px)/1.1 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.pwa-btn:active {
  transform: scale(0.98);
  opacity: 0.88;
}

.pwa-btn--primary {
  background: #0a84ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}

.pwa-btn--secondary {
  background: rgba(118, 118, 128, 0.24);
  color: #fff;
}

.pwa-btn--full {
  margin-top: 12px;
}

.pwa-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

@media (prefers-color-scheme: light) {
  .pwa-btn--secondary {
    background: rgba(118, 118, 128, 0.16);
    color: #1c1c1e;
  }
}

.pwa-text-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: none;
  background: none;
  color: #0a84ff;
  font: 400 15px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  cursor: pointer;
  text-align: center;
}

.pwa-email-verify-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}

/* --- Экран подтверждения email (Wallet-style) --- */
.pwa-verify-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #f2f2f7;
  color: #1c1c1e;
  overflow: hidden;
}

.pwa-verify-view[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  .pwa-verify-view {
    background: #000;
    color: #f2f2f7;
  }
}

.pwa-verify-nav {
  flex-shrink: 0;
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
}

.pwa-verify-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border: none;
  background: none;
  color: #0a84ff;
  font: 400 17px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  cursor: pointer;
}

.pwa-verify-back:active {
  opacity: 0.55;
}

.pwa-verify-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 24px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pwa-verify-mailbox {
  margin: 12px 0 28px;
  font-size: clamp(72px, 20vw, 88px);
  line-height: 1;
}

.pwa-verify-title {
  margin: 0 0 12px;
  font: 700 clamp(24px, 6.5vw, 28px)/1.15 -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  letter-spacing: -0.03em;
}

.pwa-verify-sub {
  margin: 0 0 28px;
  max-width: 320px;
  font: 400 clamp(15px, 4vw, 17px)/1.45 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  color: rgba(60, 60, 67, 0.72);
}

.pwa-verify-sub strong {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  color: inherit;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .pwa-verify-sub {
    color: rgba(235, 235, 245, 0.62);
  }
  .pwa-verify-sub strong {
    color: rgba(235, 235, 245, 0.92);
  }
}

.pwa-verify-view .pwa-otp-wrap {
  width: min(100%, 340px);
  margin-bottom: 20px;
  padding: 0;
}

.pwa-verify-view .pwa-otp-cells {
  gap: clamp(8px, 2.2vw, 12px);
}

.pwa-verify-view .pwa-otp-cell {
  aspect-ratio: auto;
  min-height: clamp(52px, 14vw, 58px);
  border: 1.5px solid rgba(60, 60, 67, 0.18);
  border-radius: 14px;
  background: #fff;
  color: #1c1c1e;
  font: 600 clamp(24px, 6.5vw, 28px)/1 -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  box-shadow: none;
}

.pwa-verify-view .pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus) {
  border-style: solid;
  border-color: rgba(60, 60, 67, 0.16);
}

.pwa-verify-view .pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus)::before {
  display: none;
}

.pwa-verify-view .pwa-otp-cell:focus {
  border-color: #0a84ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}

.pwa-verify-view .pwa-otp-cell--filled:not(:focus) {
  border-color: rgba(60, 60, 67, 0.28);
  background: #fff;
}

.pwa-verify-view .pwa-otp-wrap--busy .pwa-otp-cell {
  opacity: 0.55;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .pwa-verify-view .pwa-otp-cell {
    background: rgba(28, 28, 30, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
  }
  .pwa-verify-view .pwa-otp-cell:focus {
    background: rgba(28, 28, 30, 1);
  }
  .pwa-verify-view .pwa-otp-cell--filled:not(:focus) {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(28, 28, 30, 0.96);
  }
}

.pwa-verify-error {
  margin: 0 0 16px;
  max-width: 320px;
  font: 400 14px/1.35 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  color: #ff3b30;
}

.pwa-verify-error[hidden] {
  display: none !important;
}

.pwa-verify-resend {
  margin-top: auto;
  padding: 12px 16px;
  border: none;
  background: none;
  color: rgba(60, 60, 67, 0.45);
  font: 400 15px/1.35 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  cursor: default;
}

.pwa-verify-resend--ready {
  color: #0a84ff;
  cursor: pointer;
}

.pwa-verify-resend--ready:active {
  opacity: 0.55;
}

.pwa-verify-resend:disabled:not(.pwa-verify-resend--ready) {
  opacity: 1;
}

.pwa-verify-passwords {
  width: min(100%, 340px);
  margin: 24px auto 0;
  text-align: left;
}

.pwa-verify-passwords .pwa-input-group {
  margin-bottom: 12px;
}

.pwa-verify-passwords .pwa-btn--full {
  margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
  .pwa-verify-resend {
    color: rgba(235, 235, 245, 0.38);
  }
  .pwa-verify-resend--ready {
    color: #0a84ff;
  }
}

#pwa-login-screen {
  position: relative;
}

.pwa-auth-highlight {
  padding: 16px 12px;
  border-radius: 14px;
  background: rgba(28, 28, 30, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pwa-email-verify-block.pwa-auth-highlight,
#pwa-reset-form-block.pwa-auth-highlight {
  border-top: none;
  padding-top: 16px;
}

@media (prefers-color-scheme: light) {
  .pwa-auth-highlight {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(60, 60, 67, 0.16);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }
  .pwa-email-verify-block { border-top-color: rgba(60, 60, 67, 0.12); }
}

.pwa-email-reset-view {
  min-width: 0;
  max-width: 100%;
}

.pwa-email-reset-view[hidden] {
  display: none !important;
}

#pwa-email-main-view[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: light) {
  .pwa-email-verify-block:not(.pwa-auth-highlight) { border-top-color: rgba(60, 60, 67, 0.12); }
}

.pwa-verify-label {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.02em;
  color: rgba(235, 235, 245, 0.92);
  text-align: center;
}

@media (prefers-color-scheme: light) {
  .pwa-verify-label { color: #1c1c1e; }
}

.pwa-otp-wrap {
  position: relative;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 6px 2px;
}

.pwa-otp-autofill {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: 0;
  top: 0;
}

.pwa-otp-cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(5px, 1.8vw, 10px);
  align-items: stretch;
  width: 100%;
}

.pwa-otp-cell {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  aspect-ratio: 1 / 1;
  min-height: 46px;
  height: auto;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: clamp(10px, 2.5vw, 13px);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 700 clamp(22px, 6vw, 30px)/1 -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  text-align: center;
  caret-color: #0a84ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus) {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.42);
}

.pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus)::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: rgba(235, 235, 245, 0.55);
  pointer-events: none;
}

.pwa-otp-cell:focus {
  outline: none;
  border-style: solid;
  border-color: #0a84ff;
  background: rgba(10, 132, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(10, 132, 255, 0.28);
}

.pwa-otp-cell--filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(118, 118, 128, 0.32);
}

.pwa-otp-cell--filled:not(:focus) {
  border-color: rgba(48, 209, 88, 0.55);
  background: rgba(48, 209, 88, 0.1);
}

@media (prefers-color-scheme: light) {
  .pwa-otp-cell {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(60, 60, 67, 0.35);
    color: #1c1c1e;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 2px 8px rgba(0, 0, 0, 0.06);
  }
  .pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus) {
    border-color: rgba(60, 60, 67, 0.4);
  }
  .pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus)::before {
    background: rgba(60, 60, 67, 0.4);
  }
  .pwa-otp-cell:focus {
    background: rgba(10, 132, 255, 0.08);
  }
  .pwa-otp-cell--filled {
    background: rgba(118, 118, 128, 0.1);
    border-color: rgba(60, 60, 67, 0.35);
  }
  .pwa-otp-cell--filled:not(:focus) {
    border-color: rgba(52, 199, 89, 0.65);
    background: rgba(52, 199, 89, 0.1);
  }
}

/* legacy single-field otp hidden */
.pwa-otp-input {
  display: none;
}

/* Legacy class aliases (widget errors) */
.pwa-login-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: #ff453a;
  line-height: 1.4;
}

.pwa-login-card { display: contents; }
.pwa-login-tabs { display: none; }
.pwa-login-tab { display: none; }
.pwa-email-form {
  text-align: left;
  min-width: 0;
  max-width: 100%;
}
.pwa-email-input { display: none; }
.pwa-email-btn { display: none; }
.pwa-email-link { display: none; }
.pwa-email-otp { display: none; }
.pwa-email-btn--full { display: none; }

/* --- Адаптив: узкие экраны --- */
@media (max-width: 380px) {
  .pwa-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 14px;
    min-height: auto;
  }

  .pwa-input-label {
    width: auto;
    font-size: 13px;
    opacity: 0.65;
  }

  .pwa-input-field {
    padding: 2px 0 6px;
    width: 100%;
  }

  .pwa-login-sub {
    font-size: 13px;
  }

  .pwa-otp-cells {
    gap: 5px;
  }

  .pwa-otp-cell {
    border-radius: 10px;
    font-size: 22px;
    min-height: 42px;
  }

  .pwa-otp-cell:not(.pwa-otp-cell--filled):not(:focus)::before {
    width: 14px;
    height: 3px;
  }

  .pwa-input-row--password {
    flex-direction: row;
    align-items: center;
  }

  .pwa-input-row--password .pwa-input-label {
    width: 72px;
    opacity: 1;
  }
}

/* --- Адаптив: низкий экран (iPhone SE, landscape) --- */
@media (max-height: 680px) {
  .pwa-login-scroll {
    justify-content: flex-start;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .pwa-login-hero {
    margin-bottom: 14px;
  }

  .pwa-install-hint {
    margin-top: 16px;
  }
}

@media (max-height: 560px) {
  .pwa-login-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
  }

  .pwa-login-logo svg {
    width: 32px;
    height: 32px;
  }

  .pwa-login-title {
    font-size: 22px;
  }

  .pwa-login-tagline {
    font-size: 13px;
  }

  .pwa-install-hint {
    display: none;
  }

  .pwa-login-segment {
    margin-bottom: 12px;
  }

  .pwa-login-sub {
    margin-bottom: 12px;
  }
}

/* --- Landscape на телефоне: hero и форма в ряд --- */
@media (orientation: landscape) and (max-height: 520px) {
  .pwa-login-scroll {
    justify-content: center;
  }

  .pwa-login-inner {
    display: grid;
    grid-template-columns: minmax(140px, 34%) minmax(0, 1fr);
    gap: clamp(16px, 4vw, 28px);
    align-items: center;
    max-width: min(820px, 100%);
  }

  .pwa-login-hero {
    text-align: left;
    margin-bottom: 0;
  }

  .pwa-login-logo {
    margin-left: 0;
    margin-right: 0;
  }

  .pwa-login-tagline {
    font-size: 13px;
    line-height: 1.35;
  }

  .pwa-install-hint {
    display: none;
  }
}

/* --- Планшет и широкие экраны --- */
@media (min-width: 600px) {
  .pwa-login-scroll {
    padding:
      max(24px, env(safe-area-inset-top))
      max(32px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(32px, env(safe-area-inset-left));
  }

  .pwa-login-inner {
    max-width: min(920px, 100%);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 420px);
    gap: clamp(32px, 5vw, 56px);
    align-items: center;
  }

  .pwa-login-hero {
    text-align: left;
    margin-bottom: 0;
  }

  .pwa-login-logo {
    margin-left: 0;
    margin-right: 0;
  }

  .pwa-login-sheet {
    padding: 24px 22px;
  }
}

@media (min-width: 900px) {
  .pwa-login-inner {
    grid-template-columns: minmax(280px, 1fr) 440px;
    gap: 64px;
  }

  .pwa-login-title {
    font-size: 34px;
  }
}

/* --- Клавиатура открыта (JS-класс) --- */
html.pwa-standalone.pwa-keyboard-open .pwa-login-scroll {
  justify-content: flex-start;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-hero {
  margin-bottom: 10px;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-logo svg {
  width: 28px;
  height: 28px;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-title {
  font-size: 20px;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-tagline,
html.pwa-standalone.pwa-keyboard-open .pwa-install-hint {
  display: none;
}

html.pwa-standalone.pwa-keyboard-open .pwa-login-inner {
  display: block;
  max-width: min(440px, 100%);
}

/* --- Telegram widget: не вылезает за край --- */
.pwa-login-widget iframe,
.pwa-login-widget script + iframe {
  max-width: 100% !important;
}

@media (max-width: 400px) {
  .pwa-login-scroll {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .pwa-login-sheet {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pwa-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 12px;
    min-height: auto;
  }

  .pwa-input-label {
    width: auto;
    font-size: 13px;
    opacity: 0.65;
  }

  .pwa-input-field {
    padding: 2px 0 6px;
    width: 100%;
  }

  .pwa-login-widget iframe {
    transform: scale(min(1, calc((100vw - 56px) / 270)));
    transform-origin: center center;
  }
}

@keyframes pwaLoginFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pwa-login-widget,
.pwa-login-widget iframe {
  max-width: 100%;
}

.pwa-account-wrap {
  margin: 12px 16px 0;
}

.pwa-account-block {
  padding: 16px;
  border-radius: 16px;
  background: var(--f7-block-strong-bg-color, rgba(255, 255, 255, 0.08));
}

.pwa-account-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

.pwa-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pwa-account-row:last-child {
  border-bottom: none;
}

.pwa-account-label {
  opacity: 0.6;
}

.pwa-account-value {
  text-align: right;
  word-break: break-all;
}

.pwa-account-link-widget {
  margin-top: 12px;
  min-height: 44px;
  display: flex;
  justify-content: center;
}

.pwa-account-status--ok {
  color: #30d158;
}

.pwa-account-status--warn {
  color: #ff9f0a;
}

.pwa-account-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}

.pwa-btn--danger {
  background: rgba(255, 69, 58, 0.16);
  color: #ff6961;
  box-shadow: none;
}

.pwa-btn--danger:active {
  background: rgba(255, 69, 58, 0.24);
}

@media (prefers-color-scheme: light) {
  .pwa-account-actions {
    border-top-color: rgba(60, 60, 67, 0.12);
  }
  .pwa-btn--danger {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
  }
}

html.pwa-standalone .checkout-stars-btn,
html.pwa-standalone #checkout-telegram-btn,
html.pwa-standalone #checkout-telegram-hint {
  display: none !important;
}

html.pwa-standalone .payment-method-item[data-method="telegram"],
html.pwa-standalone .payment-method-item[data-method="stars"] {
  display: none !important;
}

html.pwa-standalone .payment-method-close {
  display: flex;
}

html.pwa-standalone .checkout-card-actions {
  grid-template-columns: 1fr;
}

.push-settings-block {
  margin: 12px 16px 16px;
}

.push-settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.push-settings-title .icon {
  font-size: 20px;
  color: var(--f7-theme-color, #0a84ff);
}

.push-settings-hint {
  margin: 0 0 14px;
  font-size: 14px;
  opacity: 0.65;
  line-height: 1.45;
}

.push-settings-actions {
  display: flex;
  gap: 10px;
}

.push-settings-actions .button {
  flex: 1;
  margin: 0;
}

.push-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.push-prompt-modal--visible {
  pointer-events: auto;
  opacity: 1;
}

.push-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.push-prompt-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px 22px 22px;
  border-radius: 20px;
  background: var(--f7-block-strong-bg-color, #1c1c1e);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.push-prompt-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}

.push-prompt-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.push-prompt-text {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.45;
  opacity: 0.75;
}

.push-prompt-actions {
  display: flex;
  gap: 10px;
}

.push-prompt-actions .button {
  flex: 1;
  margin: 0;
}

/* --- iOS: установка PWA (как в Telegram) --- */
html.tg-a2hs-open {
  overflow: hidden;
}

html.tg-a2hs-open body {
  overflow: hidden;
}

.tg-a2hs {
  --tg-a2hs-bg: #000000;
  --tg-a2hs-text: #ffffff;
  --tg-a2hs-phone-bg: #000000;
  --tg-a2hs-border: #48484a;
  --tg-a2hs-slot-border: #48484a;
  --tg-a2hs-accent: #0a84ff;
  --tg-a2hs-bubble: #0a84ff;
  --tg-a2hs-add-icon-filter: invert(1);

  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--tg-a2hs-bg);
  color: var(--tg-a2hs-text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  .tg-a2hs {
    --tg-a2hs-bg: #ffffff;
    --tg-a2hs-text: #000000;
    --tg-a2hs-phone-bg: #ffffff;
    --tg-a2hs-border: #d1d1d6;
    --tg-a2hs-slot-border: #d1d1d6;
    --tg-a2hs-accent: #007aff;
    --tg-a2hs-bubble: #007aff;
    --tg-a2hs-add-icon-filter: none;

    color-scheme: light;
  }
}

.tg-a2hs[hidden] {
  display: none !important;
}

.tg-a2hs__main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(max(16px, env(safe-area-inset-top)) + 10vh)
    24px
    calc(env(safe-area-inset-bottom, 0px) + 120px);
}

.tg-a2hs__phone {
  width: min(248px, 66vw);
  margin: 0 auto 36px;
}

.tg-a2hs__phone-inner {
  position: relative;
  padding: 30px 18px 24px;
  border: 2px solid var(--tg-a2hs-border);
  border-radius: 32px;
  background: var(--tg-a2hs-phone-bg);
}

.tg-a2hs__notch {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 7px;
  border-radius: 999px;
  background: var(--tg-a2hs-slot-border);
}

.tg-a2hs__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row dense;
  gap: 10px;
}

.tg-a2hs__slot {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1.5px solid var(--tg-a2hs-slot-border);
  background: transparent;
}

.tg-a2hs__slot--featured {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 22px;
  background: linear-gradient(150deg, #ffb340 0%, #ffd026 100%);
  box-shadow: 0 4px 14px rgba(255, 149, 0, 0.3);
}

.tg-a2hs__slot--featured span {
  color: #ffffff;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  user-select: none;
}

.tg-a2hs__title {
  margin: 0 0 32px;
  max-width: 340px;
  font-size: clamp(21px, 5.6vw, 25px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.024em;
  text-align: center;
  color: var(--tg-a2hs-text);
}

.tg-a2hs__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 340px);
  counter-reset: tg-a2hs-step;
}

.tg-a2hs__steps li {
  counter-increment: tg-a2hs-step;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.022em;
  color: var(--tg-a2hs-text);
}

.tg-a2hs__steps li::before {
  content: counter(tg-a2hs-step) '. ';
}

.tg-a2hs__steps li + li {
  margin-top: 16px;
}

.tg-a2hs__steps strong {
  color: var(--tg-a2hs-accent);
  font-weight: 600;
}

.tg-a2hs__inline-icon {
  display: inline-block;
  width: 17px;
  height: 22px;
  margin: 0 1px;
  vertical-align: -4px;
}

.tg-a2hs__inline-icon--add {
  width: 17px;
  height: 17px;
  vertical-align: -2px;
  filter: var(--tg-a2hs-add-icon-filter);
}

.tg-a2hs__hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.tg-a2hs__bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--tg-a2hs-bubble);
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  position: relative;
}

.tg-a2hs__bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 10px solid var(--tg-a2hs-bubble);
}

.tg-a2hs__bubble-icon {
  display: block;
  width: 17px;
  height: 22px;
  filter: brightness(0) invert(1);
}

