.pwa-network-status,
.pwa-install-sheet {
  box-sizing: border-box;
  font-family: "Creativerse Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.pwa-network-status[hidden],
.pwa-install-sheet[hidden] {
  display: none !important;
}

.pwa-network-status {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(560px, calc(100vw - 28px));
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 104, 75, 0.52);
  border-radius: 8px;
  color: #f7f7ef;
  background: #0b0e0e;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  font-size: 12px;
  line-height: 1.45;
  transform: translateX(-50%);
}

.pwa-network-status svg,
.pwa-sheet-close svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.pwa-network-status svg { color: #ff684b; }

.pwa-install-sheet {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 29;
  width: min(420px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(40, 215, 229, 0.34);
  border-radius: 8px;
  color: #f2f5ef;
  background: #101414;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.54);
}

.pwa-sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #aeb8b4;
  background: transparent;
  cursor: pointer;
}

.pwa-sheet-close:hover { color: #f2f5ef; background: rgba(255, 255, 255, 0.06); }
.pwa-sheet-close:focus-visible,
.pwa-install-actions button:focus-visible { outline: 2px solid #28d7e5; outline-offset: 2px; }

.pwa-install-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 56px;
  padding-right: 40px;
}

.pwa-install-heading img { display: block; width: 52px; height: 52px; border-radius: 8px; }
.pwa-install-heading div { display: grid; gap: 5px; min-width: 0; }
.pwa-install-heading strong { font-size: 18px; line-height: 1.22; letter-spacing: 0; }
.pwa-install-heading p { margin: 0; color: #aeb8b4; font-size: 13px; line-height: 1.5; }

.pwa-install-steps {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
}

.pwa-install-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; }
.pwa-install-steps span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #090b0b; background: #28d7e5; font-size: 12px; font-weight: 850; }
.pwa-install-step-copy { display: grid; gap: 3px; min-width: 0; padding-top: 3px; }
.pwa-install-steps strong { color: #f2f5ef; font-size: 13px; font-weight: 800; line-height: 1.4; }
.pwa-install-steps small { color: #aeb8b4; font-size: 12px; line-height: 1.5; }

.pwa-install-hint {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(40, 215, 229, 0.26);
  color: #28d7e5;
  font-size: 12px;
  line-height: 1.55;
}

.pwa-install-sheet[data-mode="ios"] .pwa-install-actions { grid-template-columns: 1fr; }

.pwa-install-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 16px;
}

.pwa-install-actions button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.pwa-install-primary { border: 0; color: #090b0b; background: #b8ff3d; }
.pwa-install-primary:hover { background: #28d7e5; }
.pwa-install-secondary { border: 1px solid rgba(255, 255, 255, 0.16); color: #dce2dc; background: transparent; }
.pwa-install-secondary:hover { border-color: rgba(40, 215, 229, 0.58); color: #f2f5ef; }

.customer-app .user-menu-item.pwa-menu-install { color: #b8ff3d; }

/*
 * Android PWA file-picker compatibility.
 *
 * MIUI's standalone WebAPK can ignore a file input when it is hidden with
 * the HTML `hidden` attribute or `display:none`, even when its label is
 * tapped. Keep the input rendered in the accessibility tree and clip it
 * visually instead. app.js also binds a synchronous label bridge so the
 * system picker is opened from the original user gesture.
 */
.customer-app input[type="file"].file-input-compat {
  position: absolute !important;
  display: block !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  -webkit-clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0.001 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

.customer-app input[type="file"].file-input-compat:focus-visible {
  outline: 2px solid #28d7e5;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .pwa-install-sheet {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    width: auto;
  }

  .pwa-install-sheet { max-height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
  .pwa-install-actions { grid-template-columns: minmax(0, 1fr) minmax(108px, auto); }

  @media (display-mode: standalone) {
    body.customer-app #homeView .home-topbar {
      min-height: calc(64px + env(safe-area-inset-top));
      padding-top: max(8px, env(safe-area-inset-top));
    }

    body.customer-app #homeView .home-hero,
    body.customer-app #homeView .home-hero.hero-banner-only {
      min-height: calc(100dvh - 64px - env(safe-area-inset-top));
    }
  }
}

@media (max-width: 370px) {
  .pwa-install-sheet { padding: 15px; }
  .pwa-install-heading { grid-template-columns: 46px minmax(0, 1fr); padding-right: 36px; }
  .pwa-install-heading img { width: 46px; height: 46px; }
  .pwa-install-heading strong { font-size: 16px; }
  .pwa-install-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-sheet { scroll-behavior: auto; }
}
