/* ==========================================================================
   GATE PASS — PWA UI (offline banner + install button)
   ========================================================================== */

.offline-bar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-overlay);
  padding: var(--space-2) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-inverse);
  background: var(--color-warn);
}

.install-btn {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
}
.install-btn:hover { background: var(--accent-hover); }

/* When running as an installed PWA, hide the install affordance. */
@media (display-mode: standalone) {
  .install-btn { display: none; }
}

/* On mobile the bottom tab bar owns the bottom of the screen — float the
   install button ABOVE it so it doesn't cover the last tab item. Also
   shrink it to a less visually heavy chip. */
@media (max-width: 1023px) {
  .install-btn {
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    right: 12px;
    padding: 8px 14px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  }
}

/* "New version available" banner — sits at top of viewport, above content
   but below modals. Slides into view; auto-stacks above the offline bar
   if both happen to be visible (rare). */
.update-banner {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-overlay);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  animation: slide-down 240ms ease-out;
}
.update-banner > span { flex: 1 1 auto; min-width: 0; }
.update-banner > button { flex-shrink: 0; }
.update-banner .btn--accent {
  background: #fff;
  color: var(--text-primary);
}
@keyframes slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
