/* ==========================================================================
   PWA UI: operational update/offline notices and explicit Settings controls.
   All elements are position: fixed and injected/removed by pwa-ui.js.
   ========================================================================== */

/* Update banner (top, full width) */
.pwa-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: #3b82f6;
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: 500 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: pwa-slide-down 0.3s ease-out;
}
.pwa-update-banner__reload {
  background: white;
  color: #3b82f6;
  border: none;
  padding: 6px 14px;
  border-radius: 9999px;
  font: 600 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
}
.pwa-update-banner__close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}

/* Offline banner (top thin bar) */
.pwa-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: #7f1d1d;
  color: white;
  padding: 6px 16px;
  text-align: center;
  font: 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: pwa-slide-down 0.3s ease-out;
}

@keyframes pwa-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Settings page: standalone "Workflow notifications" toggle card
   ========================================================================== */
.settings-notifications-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  font: 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.settings-notifications-card .section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #f9fafb;
}
.settings-notifications-card .notifications-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.settings-notifications-card .notifications-copy { flex: 1; }
.settings-notifications-card .notifications-label {
  font-weight: 500;
  color: #f9fafb;
  margin-bottom: 4px;
}
.settings-notifications-card .notifications-desc {
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.4;
}
.settings-notifications-card .notifications-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 100px;
}
.settings-notifications-card .notifications-btn:hover:not(:disabled) { background: #2563eb; }
.settings-notifications-card .notifications-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.settings-notifications-card .notifications-btn[data-state="on"] {
  background: #374151;
  color: #f9fafb;
}
.settings-notifications-card .notifications-btn[data-state="on"]:hover:not(:disabled) {
  background: #4b5563;
}
.settings-notifications-card .notifications-hint {
  margin-top: 10px;
  font-size: 13px;
  color: #9ca3af;
}
.settings-notifications-card .notifications-hint.is-error { color: #fca5a5; }
.settings-notifications-card .settings-install-row {
  border-top: 1px solid #374151;
  margin-top: 18px;
  padding-top: 18px;
}

/* ---- Store-app context (Android TWA and iOS app) ---------------------- */
/* app-context.js sets html[data-store-app="1"] synchronously in <head> when
   the page runs inside the Android TWA or the iOS app. Purchase CTAs are
   hidden there (Play payments policy; App Store guideline 3.1);
   informational billing state stays visible. .gm-purchase-ui is THE class
   convention for server-rendered purchase UI (the standalone billing
   templates inline the same rule because they do not load this sheet).
   html[data-twa="1"] stays for one release, for markup cached before the
   store-app hook existed. */
html[data-twa="1"] .gm-purchase-ui,
html[data-store-app="1"] .gm-purchase-ui {
  display: none !important;
}
/* The header balance chip stays visible (the balance is useful) but must not
   navigate to the billing tab. billing.js also strips its href; this rule
   covers the pre-JS window. */
html[data-twa="1"] #credit-balance,
html[data-store-app="1"] #credit-balance {
  pointer-events: none;
  cursor: default;
}
/* Replaces purchase buttons in billing.js-rendered modals/dashboards inside
   the TWA. Lives here (loaded by every pwa_head page) rather than in the
   orphaned billing.css — see backlog B-BILLING-CSS-ORPHANED. */
.billing-twa-notice {
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  margin: 12px 0;
}
