/* Offline mode banner and read-only state (see static/js/offline.js). */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 16px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 72, 0.45);
  background: rgba(255, 158, 44, 0.14);
  color: inherit;
  font-size: 14px;
  line-height: 1.35;
}
.offline-banner[hidden] { display: none; }
.offline-banner b { font-weight: 700; }
.offline-banner .offline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff9e2c;
  flex: none;
}
/* Read-only: actions that change data are dimmed while offline. */
body.is-offline .upload-trigger,
body.is-offline .confirm-import,
body.is-offline [data-decide],
body.is-offline [data-notification-read],
body.is-offline #markAllNotifications,
body.is-offline [data-revoke-device] {
  opacity: 0.45;
  pointer-events: none;
}

/* Native-like pull-to-refresh for the installed iPhone/Android PWA. */
.pull-refresh {
  --pull-distance: 0px;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(69,216,243,.34);
  border-radius: 24px;
  background: rgba(7,29,46,.94);
  color: #eafaff;
  box-shadow: 0 10px 28px rgba(0,10,18,.3);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 16px + var(--pull-distance)));
  transition: transform .16s ease, opacity .16s ease, border-color .16s ease;
  backdrop-filter: blur(14px);
}
.pull-refresh.pulling,.pull-refresh.refreshing { opacity: 1; transition: none; }
.pull-refresh span { font-size: 18px; line-height: 1; transition: transform .16s ease; }
.pull-refresh.ready { border-color: var(--mint); }
.pull-refresh.ready span { transform: rotate(180deg); }
.pull-refresh.refreshing span { animation: pull-refresh-spin .75s linear infinite; }
html[data-theme="light"] .pull-refresh { background: rgba(245,252,254,.96); color: #173b50; border-color: rgba(0,127,156,.3); box-shadow: 0 10px 28px rgba(16,40,59,.18); }
html[data-theme="light"] .pull-refresh.ready { border-color: #1b9a78; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pull-refresh,.pull-refresh span { transition: none; } .pull-refresh.refreshing span { animation: none; } }
