.pwa-install-banner {
  position: fixed;
  inset-inline: 14px;
  bottom: 14px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(30,95,191,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 14px 40px rgba(30,58,138,.20);
  backdrop-filter: blur(12px);
  direction: rtl;
  max-width: 620px;
  margin-inline: auto;
}
.pwa-install-banner__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  object-fit: cover;
}
.pwa-install-banner__content { flex: 1; min-width: 0; }
.pwa-install-banner__title { margin: 0 0 3px; font-weight: 800; color: #17345f; }
.pwa-install-banner__text { margin: 0; font-size: .88rem; color: #60708d; line-height: 1.5; }
.pwa-install-banner__actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.pwa-install-banner__install {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 15px;
  background: #1e5fbf;
  color: #fff;
  font-weight: 800;
}
.pwa-install-banner__close {
  border: 0;
  background: transparent;
  color: #71809a;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.15rem;
}
.pwa-install-banner__ios { direction: rtl; }
.pwa-install-banner__ios strong { color: #17345f; }
@media (max-width: 520px) {
  .pwa-install-banner { inset-inline: 10px; bottom: 10px; padding: 10px; gap: 9px; }
  .pwa-install-banner__icon { width: 40px; height: 40px; flex-basis: 40px; }
  .pwa-install-banner__text { font-size: .8rem; }
  .pwa-install-banner__install { padding: 0 11px; }
}


.pwa-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(13, 31, 73, .56);
  backdrop-filter: blur(5px);
  direction: rtl;
}
.pwa-ios-modal__card {
  position: relative;
  width: min(100%, 430px);
  max-height: min(88dvh, 720px);
  overflow-y: auto;
  border: 1px solid rgba(30,95,191,.12);
  border-radius: 26px;
  padding: 24px 20px 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20,45,100,.30);
  color: #172b4d;
  text-align: right;
}
.pwa-ios-modal__close {
  position: absolute;
  inset-inline-start: 12px;
  top: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #eef3fb;
  color: #5d6b84;
  font-size: 24px;
  line-height: 1;
}
.pwa-ios-modal__brand {
  width: 66px;
  height: 66px;
  margin: 0 auto 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #edf4ff;
}
.pwa-ios-modal__brand img { width: 100%; height: 100%; object-fit: cover; }
.pwa-ios-modal__card h2 { margin: 0 0 8px; text-align: center; font-size: 1.2rem; color: #17345f; }
.pwa-ios-modal__lead { margin: 0 0 14px; line-height: 1.7; color: #60708d; }
.pwa-ios-modal__steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.pwa-ios-modal__steps li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 16px; background: #f6f8fc; line-height: 1.7; }
.pwa-ios-modal__step-icon, .pwa-ios-modal__step-number { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; background: #eaf1ff; color: #1e5fbf; font-weight: 900; }
.pwa-share-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pwa-ios-modal__note { margin: 14px 0; padding: 10px 12px; border-radius: 14px; background: #f4f7fb; color: #687791; font-size: .88rem; line-height: 1.6; }
.pwa-ios-modal__done { width: 100%; min-height: 46px; border: 0; border-radius: 14px; background: #1e5fbf; color: #fff; font-weight: 800; }
.pwa-install-message { position: fixed; inset-inline: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 11001; max-width: 620px; margin-inline: auto; padding: 12px 14px; border-radius: 14px; background: #172b4d; color: #fff; text-align: center; box-shadow: 0 14px 40px rgba(20,45,100,.24); direction: rtl; }
@media (max-width: 520px) {
  .pwa-ios-modal__card { border-radius: 22px; padding: 22px 15px 15px; }
  .pwa-ios-modal__steps li { font-size: .92rem; }
}

/* V27.24 — launch splash: never expose a white frame while the app boots. */
:root { --rehab-splash-blue:#04407F; }
html, body { background:#04407F; }
#rehab-splash {
  position:fixed;
  inset:0;
  z-index:20000;
  min-height:100dvh;
  background-color:var(--rehab-splash-blue);
  background-image:url("../assets/splash-bg.jpg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  opacity:1;
  visibility:visible;
  transition:opacity .22s ease, visibility .22s ease;
}
#rehab-splash.is-hidden { opacity:0; visibility:hidden; pointer-events:none; }
body.safe-area-login {
  min-height:100dvh;
  background-color:var(--rehab-splash-blue);
  background-image:url("../assets/splash-bg.jpg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}
body.safe-area-login #login-screen {
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(3px);
}
@media (max-width:520px) {
  body.safe-area-login #login-screen { width:min(calc(100% - 20px), 31rem); margin:12px auto; padding:18px; }
}
