:root {
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-right: env(safe-area-inset-right, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pwa-safe-left: env(safe-area-inset-left, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.object-notification-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  white-space: normal;
}

.object-notification-toggle.is-enabled {
  border-color: #86d6ad;
  background: #edf9f2;
  color: #137443;
}

.object-notification-toggle.is-busy {
  opacity: .65;
  cursor: wait;
}

.object-notification-toggle[disabled] {
  opacity: .62;
  cursor: not-allowed;
}

.pwa-offline-status {
  position: fixed;
  right: calc(18px + var(--pwa-safe-right));
  bottom: calc(18px + var(--pwa-safe-bottom));
  z-index: 10000;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 10px 10px 14px;
  border: 1px solid #bfd0e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 47, 85, .18);
  color: #173553;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pwa-offline-status-text {
  flex: 1;
  min-width: 0;
}

.pwa-offline-status-close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 0 2px;
  margin: -2px -2px 0 0;
  font-size: 17px;
  line-height: 1;
  color: inherit;
  opacity: .55;
  cursor: pointer;
}

.pwa-offline-status-close:hover,
.pwa-offline-status-close:focus-visible {
  opacity: 1;
}

.pwa-offline-status[hidden] {
  display: none;
}

.pwa-offline-status[data-kind="syncing"] {
  border-color: #9bbcf8;
  background: #f4f8ff;
  color: #1853b8;
}

.pwa-offline-status[data-kind="ready"] {
  border-color: #9fd9ba;
  background: #effaf4;
  color: #137443;
}

.pwa-offline-status[data-kind="warning"] {
  border-color: #f0c67d;
  background: #fff8e9;
  color: #8a5700;
}

.pwa-offline-status[data-kind="offline"] {
  border-color: #9eafc2;
  background: #173553;
  color: #fff;
}

@media (display-mode: standalone) {
  body {
    padding-right: var(--pwa-safe-right);
    padding-bottom: var(--pwa-safe-bottom);
    padding-left: var(--pwa-safe-left);
  }

  .sidebar {
    padding-top: var(--pwa-safe-top);
  }
}

@media (max-width: 767px) {
  .object-notification-toggle {
    width: 100%;
    min-height: 44px;
  }

  .pwa-offline-status {
    right: calc(12px + var(--pwa-safe-right));
    bottom: calc(12px + var(--pwa-safe-bottom));
    left: calc(12px + var(--pwa-safe-left));
    max-width: none;
    text-align: center;
  }
}
