@media (display-mode: standalone) {
  :root {
    --header-height: calc(58px + env(safe-area-inset-top));
    --footer-height: 0px;
    --pwa-safe-area-bottom: env(safe-area-inset-bottom);
  }
  .global { padding-top: env(safe-area-inset-top); }
}

/* iOS still reports `display-mode: browser` in a few older standalone
   lifecycle states. `navigator.standalone` is mirrored by app.js. */
html[data-installed-pwa="1"] { --footer-height:0px; }

@supports (height: 100dvh) {
  .app-modal-embed { min-height: 100dvh; }
}

.app-push-nudge {
  position: fixed;
  z-index: var(--z-popover);
  right: 18px;
  bottom: calc(var(--footer-height) + 14px);
  width: min(430px, calc(100vw - 36px));
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
#gwPushSettings .workspace-modal-body { display:grid; gap:18px; }
#gwPushSettings .workspace-modal-body > section { display:grid; gap:10px; min-width:0; }
#gwPushSettings .workspace-modal-body :is(h3,p) { margin:0; }
#gwPushSettings .workspace-modal-body small { color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
#gwPushSettings .form-actions { display:flex; flex-wrap:wrap; gap:8px; }
#gwPushSettings label:has(> input[type="checkbox"]) { display:flex; align-items:center; gap:8px; }
#gwPushSettings input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; margin:0; }
#gwPushSettings [data-push-devices] { display:grid; gap:12px; }
#gwPushSettings [data-push-devices] > section { display:grid; gap:8px; padding:12px; border:1px solid var(--border); border-radius:var(--radius); }
.app-push-nudge[hidden] { display: none; }
.app-push-nudge > div { min-width: 0; display: grid; gap: 3px; }
.app-push-nudge strong { color: var(--text); font-size: 14px; }
.app-push-nudge small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.app-push-nudge > span { flex: none; display: flex; align-items: center; gap: 6px; }
body.chat-open .app-push-nudge { display: none; }

@media (max-width: 640px) {
  .app-push-nudge {
    right: 10px;
    bottom: calc(var(--footer-height) + 10px);
    left: 10px;
    width: auto;
    gap: 10px;
    padding-left: 13px;
  }
  .app-push-nudge .btn { padding-inline: 11px; white-space: nowrap; }
}
