/* Mobile additions use the existing DX monochrome identity, without changing desktop layout. */
.pwa-install-entry, .pwa-settings-entry, .pwa-mobile-note { display: none; }
.pwa-install-prompt { position: fixed; z-index: 190; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; color: #f7f8fb; background: #111318; box-shadow: 0 12px 32px rgba(12,18,28,.24); }
.pwa-install-prompt[hidden], .pwa-install-modal[hidden], .pwa-ios-guide[hidden], .pwa-browser-guide[hidden], #pwaInstallAction[hidden] { display: none; }
.pwa-install-prompt-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #111318; background: #fff; font-size: 13px; font-weight: 900; }
.pwa-install-prompt-copy { min-width: 0; line-height: 1.4; }
.pwa-install-prompt-copy strong, .pwa-install-prompt-copy span { display: block; }
.pwa-install-prompt-copy strong { font-size: 14px; }
.pwa-install-prompt-copy span { margin-top: 3px; color: #bdc5d2; font-size: 12px; }
.pwa-install-prompt button, .pwa-install-modal button { font: inherit; cursor: pointer; }
.pwa-install-prompt-action { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; color: #111318; background: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pwa-install-prompt-dismiss { width: 44px; height: 44px; padding: 0; border: 0; color: #bdc5d2; background: transparent; font-size: 24px; line-height: 1; }
.pwa-install-modal { background: rgba(9,12,18,.58); }
.pwa-install-box { width: min(430px, 100%); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #e2e7ee; border-radius: 20px; color: #111318; background: #f8fafc; box-shadow: 0 20px 60px rgba(8,15,27,.24); overscroll-behavior: contain; }
.pwa-install-close { float: right; width: 44px; height: 44px; margin: -8px -8px 0 0; border: 0; border-radius: 50%; color: #445064; background: #e9edf2; font-size: 24px; line-height: 1; }
.pwa-install-kicker { margin-top: 6px; color: #536174; font-size: 12px; font-weight: 700; }
.pwa-install-box h2 { margin: 8px 44px 12px 0; font-size: 26px; line-height: 1.3; text-wrap: balance; }
.pwa-install-description { margin: 0; color: #526073; font-size: 14px; line-height: 1.75; }
.pwa-install-actions { display: flex; gap: 10px; margin-top: 20px; }
.pwa-install-actions button { flex: 1; min-height: 48px; padding: 10px 14px; border-radius: 12px; }
#pwaInstallAction { flex: 1; display: flex; }
#pwaInstallAction button { width: 100%; }
.pwa-install-primary { border: 0; color: #fff; background: #111318; font-weight: 700; }
.pwa-install-primary:disabled { cursor: wait; opacity: .7; }
.pwa-install-secondary { border: 1px solid #c8d1dd; color: #445064; background: #fff; }
.pwa-ios-guide, .pwa-browser-guide { margin: 18px 0 0; padding: 16px; border-radius: 12px; color: #3f4c60; background: #edf2f7; font-size: 14px; line-height: 1.75; }
.pwa-ios-guide ol, .pwa-browser-guide ol { margin: 8px 0 0 20px; padding: 0; }
.pwa-ios-guide li + li, .pwa-browser-guide li + li { margin-top: 6px; }
.pwa-install-note, .pwa-install-status { margin: 14px 0 0; color: #536174; font-size: 13px; line-height: 1.65; }
.pwa-install-status:empty { display: none; }
.pwa-install-status { color: #146b9e; }
@media (min-width: 769px) and (pointer: fine), (min-width: 1025px) { .pwa-install-prompt { display: none; } }
@media (max-width: 430px) {
  .pwa-install-prompt { grid-template-columns: 36px minmax(0, 1fr) 44px; gap: 8px; padding: 10px; }
  .pwa-install-prompt-icon { width: 36px; height: 36px; }
  .pwa-install-prompt-dismiss { grid-column: 3; grid-row: 1; align-self: start; }
  .pwa-install-prompt-action { grid-column: 2 / 4; grid-row: 2; }
  .pwa-install-box { padding: 22px 18px; }
}
@media (max-width: 768px), (max-width: 1024px) and (pointer: coarse) {
  .pwa-install-entry { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 8px 12px; border: 0; background: transparent; color: #111318; font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }
  .pwa-settings-entry { display: flex; }
  .lock-screen .lock-hero > .pwa-mobile-note { display: block; width: 100%; margin: 18px 0 0; color: #526073; font-size: 13px; line-height: 1.8; }
  body > header .self-check-header-btn { display: none !important; }
  body > header .account-entry-btn { min-width: 60px; white-space: nowrap; }
  body > header .ghost-btn, body > header .buy-btn, body > header .tabs button { min-height: 44px; }
  body > header { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .modal { 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)); }
  .modal .modal-box { max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); overscroll-behavior: contain; }
  #activateModal { justify-content: center; }
  #activateModal .modal-box { min-height: 0; margin-right: 0; padding: 28px 22px; }
  #activateModal h2 { font-size: 30px; }
  #activateModal input { font-size: 16px; min-height: 48px; }
  #activateModal button, #agreementModal button { min-height: 44px; }
}
@media (max-width: 640px) {
  .lock-screen { overflow-y: auto; padding: max(30px, env(safe-area-inset-top)) 20px max(156px, env(safe-area-inset-bottom)); }
  .lock-screen .lock-hero h1 { font-size: 48px; line-height: 1.2; }
  .lock-screen .lock-proof { margin-top: 26px; }
  body > header .header-left .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body > header .header-right { gap: 8px; }
}
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .lock-screen { overflow-y: auto; padding: 24px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left)); }
  .lock-screen .lock-hero { padding: 0; }
  .lock-screen .lock-actions { flex-direction: row; justify-content: center; max-height: none; }
  .lock-screen .lock-proof { margin-top: 22px; }
  #activateModal .modal-box { padding: 24px; }
}

@media (max-width: 768px), (max-width: 1024px) and (pointer: coarse) {
  .lock-screen .lock-hero { height: auto; min-height: 0; flex-shrink: 0; }
  .lock-screen .brand-mark--intro { flex-shrink: 0; height: 90px; }
  .lock-screen .lock-proof { color: #344256; text-shadow: none; }
  #activateModal .activate-status-visual[hidden] { display: none; }
}

/* Legacy main.css uses !important for its >=769px desktop drawer.
   Override only touch-screen landscape, never the Windows/desktop layout. */
@media (min-width: 769px) and (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
  #activateModal { justify-content: center !important; padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)) !important; }
  #activateModal .modal-box { width: min(520px, 100%) !important; min-height: 0 !important; max-height: calc(100dvh - 32px) !important; padding: 24px !important; justify-content: flex-start; background: #f8fafc !important; }
  #activateModal .modal-box .brand-mark { display: none; }
}
