#app-launch-screen { display: none; }
/* Avoid downloading the other account font while authentication/font setup runs. */
html.ledger-booting #layout,
html.ledger-booting #bottom-bar { display:none !important; }
html.ledger-booting #app-launch-screen strong { font-family:system-ui,sans-serif; }

#pwa-offline-view {
  box-sizing: border-box;
  width: min(100% - 40px, 390px);
  margin: max(70px, 17vh) auto;
  padding: 32px 25px;
  text-align: center;
  color: #51493f;
  background: #f2dce2;
  border: 1px solid #cfc4b2;
  border-radius: 22px 17px 20px 15px;
  box-shadow: 0 8px 0 rgba(91,73,62,.08), 0 18px 42px rgba(91,73,62,.12);
}
#pwa-offline-view img { width: 132px; height: 132px; border-radius: 28px; }
#pwa-offline-view h1 { margin: 20px 0 10px; font-size: 30px; }
#pwa-offline-view p { margin: 0 0 22px; font-size: 18px; line-height: 1.65; }
#pwa-offline-view button { min-height: 48px; padding: 10px 24px; border: 1px solid #9d596b; border-radius: 12px; background: #bf667d; color: #fffaf2; font: inherit; font-size: 18px; }
html[data-theme="dark"] #pwa-offline-view { color: #f3eadc; background: #503b43; border-color: #625a50; }

@media (display-mode: standalone) {
  #app-launch-screen {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
    color: #51493f;
    background: #fffaf0;
    opacity: 1;
    transition: opacity .2s ease;
  }
  #app-launch-screen.is-ready { opacity: 0; pointer-events: none; }
  #app-launch-screen img { width: 142px; height: 142px; border-radius: 30px; box-shadow: 0 8px 24px rgba(86,67,56,.16); }
  #app-launch-screen strong { font-size: 29px; font-weight: 700; }
  html[data-theme="dark"] #app-launch-screen { color: #f3eadc; background: #202126; }
  #bottom-bar { padding-bottom: calc(6px + env(safe-area-inset-bottom)) !important; }
}

.pwa-install-card { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 18px; align-items: start; }
.pwa-install-icon { width: 88px; height: 88px; border-radius: 19px; box-shadow: 0 5px 14px rgba(75,59,49,.15); }
.pwa-install-content { min-width: 0; }
.pwa-install-content .card-title { margin-bottom: 8px; }
.pwa-install-state { display: grid; gap: 7px; font-size: 16px; line-height: 1.55; }
.pwa-install-state strong { color: var(--primary); font-size: 19px; }
.pwa-install-state span { color: var(--text-muted); }
.pwa-install-state ol { margin: 2px 0 0; padding-left: 24px; }
.pwa-install-state li + li { margin-top: 5px; }
.pwa-installed strong { color: var(--income); }

@media (max-width:600px) {
  .pwa-install-card { grid-template-columns: 64px minmax(0,1fr); gap: 13px; padding: 20px 16px !important; }
  .pwa-install-icon { width: 64px; height: 64px; border-radius: 15px; }
  .pwa-install-state { font-size: 15px; }
  .pwa-install-state strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #app-launch-screen { transition: none !important; }
}
