.pwa-status {
  position: fixed;
  left: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z2);
  border: 1px solid var(--md-default-fg-color--lightest);
}

.pwa-status__dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #9e9e9e;
}

.pwa-status[data-state="online"] .pwa-status__dot { background: #2e7d32; }
.pwa-status[data-state="offline"] .pwa-status__dot { background: #c62828; }
.pwa-status[data-state="update"] .pwa-status__dot { background: #f9a825; }
.pwa-status[data-state="update"] { border-color: #f9a825; }

.pwa-status__btn {
  flex: none;
  min-height: 36px;
  padding: 0.15rem 0.7rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #00897b;
}
[data-md-color-scheme="slate"] .pwa-status__btn { color: #00251f; background: #4db6ac; }

.pwa-status__btn:disabled { opacity: 0.6; cursor: default; }
.pwa-status__btn[hidden] { display: none; }

/* Installationsbanner */
.pwa-install {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(3.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 28rem;
  margin: 0 auto;
  padding: 0.6rem 0.8rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 1px solid #00897b;
  border-radius: 12px;
  box-shadow: var(--md-shadow-z3);
}

.pwa-install[hidden],
.pwa-install__btn[hidden] { display: none; }

.pwa-install__text { flex: 1; }

.pwa-install__btn {
  flex: none;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #00897b;
}
[data-md-color-scheme="slate"] .pwa-install__btn { color: #00251f; background: #4db6ac; }

.pwa-install__close {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.2rem 0.4rem;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--md-default-fg-color--light);
  background: none;
}

@media print {
  .pwa-status,
  .pwa-install { display: none; }
}
