/* Resident PWA install invitation. Available on login and dashboard. */
.resident-install-modal[hidden],
.resident-install-instructions[hidden]{display:none!important}
body.resident-install-open{overflow:hidden}
.resident-install-modal{
  position:fixed;
  inset:0;
  z-index:1700;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:rgba(7,24,45,.43);
  padding:16px 14px calc(18px + env(safe-area-inset-bottom,0px));
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
}
.resident-install-sheet{
  width:min(100%,440px);
  max-height:min(85vh,650px);
  overflow-y:auto;
  border:1px solid rgba(217,229,243,.95);
  border-radius:24px;
  background:#fff;
  padding:20px;
  box-shadow:0 22px 66px rgba(7,31,57,.27);
  color:#193a5d;
  font-family:system-ui,-apple-system,sans-serif;
  -webkit-overflow-scrolling:touch;
}
.resident-install-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:12px;
}
.resident-install-logo{
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:#f0f6fd;
  border:1px solid #dbe9f7;
}
.resident-install-logo img{
  display:block;
  width:48px;
  height:48px;
  object-fit:contain;
}
.resident-install-close{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid #dce6f0;
  border-radius:12px;
  background:#f5f8fc;
  color:#5c7088;
  font-size:26px;
  cursor:pointer;
}
.resident-install-eyebrow{
  display:block;
  margin-bottom:6px;
  font-size:11px;
  font-weight:800;
  color:#2182d0;
  letter-spacing:.08em;
}
.resident-install-sheet h2{
  margin:0 0 8px;
  color:#193957;
  font-size:23px;
  line-height:1.23;
  font-weight:850;
}
.resident-install-sheet p{
  margin:0;
  font-size:13px;
  line-height:1.55;
  color:#637992;
}
.resident-install-instructions{
  margin-top:14px;
  border-radius:12px;
  padding:13px 14px;
  font-size:13px;
  line-height:1.55;
  background:#ecf5fd;
  color:#234a73;
}
.resident-install-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  margin-top:18px;
}
.resident-install-actions button{
  min-height:46px;
  border:0;
  border-radius:13px;
  padding:0 16px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}
.resident-install-primary{
  background:#147cce;
  color:#fff;
  box-shadow:0 7px 14px rgba(20,124,206,.16);
}
.resident-install-secondary{
  background:#eef3f8;
  color:#425b73;
}
.resident-install-already{
  display:block;
  width:100%;
  padding:12px 8px 2px;
  margin-top:9px;
  border:0;
  background:transparent;
  color:#687f94;
  font-size:12px;
  text-decoration:underline;
  cursor:pointer;
}
@media (min-width:650px){
  .resident-install-modal{align-items:center}
}
@media (display-mode:standalone){
  .resident-install-modal{display:none!important}
}

/* Dark theme: follow the portal's resolved html[data-theme] state.
 * 'auto' resolves via resident/js/theme.js using the phone preference;
 * explicit Cerah/Gelap overrides it without reloading the page.
 */
html[data-theme="dark"] .resident-install-modal{
  background:rgba(2,10,19,.67);
}
html[data-theme="dark"] .resident-install-sheet{
  border-color:rgba(145,188,230,.20);
  background:linear-gradient(150deg,#122840 0%,#0a1b2d 100%);
  color:#eef6ff;
  box-shadow:0 26px 72px rgba(0,0,0,.48),
    inset 0 1px 0 rgba(255,255,255,.04);
}
html[data-theme="dark"] .resident-install-logo{
  background:#f5f8fc;
  border-color:rgba(145,188,230,.25);
}
html[data-theme="dark"] .resident-install-close{
  border-color:rgba(145,188,230,.20);
  background:rgba(255,255,255,.06);
  color:#c1d5e9;
}
html[data-theme="dark"] .resident-install-eyebrow{
  color:#75baff;
}
html[data-theme="dark"] .resident-install-sheet h2{
  color:#f2f8ff;
}
html[data-theme="dark"] .resident-install-sheet p{
  color:#a8bed2;
}
html[data-theme="dark"] .resident-install-instructions{
  background:rgba(36,111,190,.16);
  border:1px solid rgba(109,181,246,.21);
  color:#c8e4ff;
}
html[data-theme="dark"] .resident-install-primary{
  background:linear-gradient(135deg,#147cce,#256dd0);
  color:#fff;
  box-shadow:0 9px 24px rgba(0,90,187,.20);
}
html[data-theme="dark"] .resident-install-secondary{
  background:rgba(148,181,214,.12);
  color:#d0e0ef;
  border:1px solid rgba(145,188,230,.17);
}
html[data-theme="dark"] .resident-install-already{
  color:#a5c9ed;
}
html[data-theme="dark"] :is(
  .resident-install-close,
  .resident-install-primary,
  .resident-install-secondary,
  .resident-install-already
):focus-visible{
  outline:2px solid #83c2ff;
  outline-offset:3px;
}
