:root {
  color-scheme: light;
}
.pwa-banner {
  position: fixed;
  z-index: 20;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  max-width: 440px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #dce3f1;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 32px #15283e26;
  animation: pwa-enter 0.24s ease-out;
}
.orders-page .pwa-banner {
  bottom: calc(88px + env(safe-area-inset-bottom));
}
.pwa-banner img,
.pwa-dialog img,
.pwa-account-open img {
  border-radius: 12px;
  flex: 0 0 auto;
}
.pwa-banner > div {
  flex: 1;
  min-width: 0;
}
.pwa-banner strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}
.pwa-instructions {
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: #2348cf;
  text-align: left;
  min-height: 44px;
  font-size: 14px;
}
.pwa-close {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  background: #f2f5fa;
  color: #22344b;
  border: 0;
  border-radius: 12px;
}
.pwa-close svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}
.pwa-dialog {
  box-sizing: border-box;
  width: min(100% - 32px, 480px);
  height: fit-content;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid #e1e7f0;
  border-radius: 24px;
  color: #15283e;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pwa-dialog[open] {
  animation: pwa-enter 0.24s ease-out;
}
.pwa-dialog::backdrop {
  background: #15283e70;
}
.pwa-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.pwa-dialog h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}
.pwa-intro {
  color: #52647d;
  font-size: 15px;
  margin: 0 0 20px;
  line-height: 1.5;
}
.pwa-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #f2f5fa;
  border-radius: 12px;
}
.pwa-platforms button {
  flex: 1 1 100px;
  border: 0;
  background: transparent;
  color: #52647d;
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
  padding: 8px;
}
.pwa-platforms button[aria-pressed="true"] {
  background: #fff;
  color: #2348cf;
  box-shadow: 0 1px 4px #15283e12;
  font-weight: 600;
}
#pwa-steps {
  list-style: none;
  padding: 0;
  margin: 24px 0 16px;
  counter-reset: steps;
}
#pwa-steps li {
  position: relative;
  counter-increment: steps;
  padding-left: 42px;
  margin-bottom: 22px;
}
#pwa-steps li::before {
  content: counter(steps);
  position: absolute;
  top: -2px;
  left: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #edf2ff;
  color: #2348cf;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
}
#pwa-steps strong {
  font-size: 16px;
  line-height: 1.4;
}
#pwa-steps p {
  font-size: 14px;
  line-height: 1.55;
  color: #52647d;
  margin: 6px 0 0;
}
.pwa-primary,
.pwa-secondary {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
}
.pwa-primary {
  border: 1px solid #2850e8;
  background: #2850e8;
  color: white;
}
.pwa-secondary {
  border: 1px solid #bdcbe5;
  color: #22344b;
  background: #fff;
}
.pwa-text-button {
  display: block;
  width: 100%;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: #52647d;
  font-size: 13px;
  margin-top: 8px;
}
.pwa-message {
  color: #52647d;
  font-size: 14px;
  line-height: 1.5;
}
.pwa-message:empty {
  display: none;
}
.pwa-modal-open {
  overflow: hidden;
}
.pwa-account-open {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  margin: 20px 0;
  border: 1px solid #dce3f1;
  background: white;
  color: #15283e;
  border-radius: 16px;
  text-align: left;
}
.pwa-account-open strong,
.pwa-account-open small {
  display: block;
  line-height: 1.45;
}
.pwa-account-open strong {
  font-size: 16px;
}
.pwa-account-open small {
  font-size: 13px;
  color: #52647d;
  margin-top: 3px;
}
.pwa-keyboard-open .pwa-banner,
.pwa-keyboard-open .orders-create-bar,
.pwa-keyboard-open .back-to-top {
  display: none;
}
.pwa-dialog button:active,
.pwa-banner button:active,
.pwa-account-open:active {
  opacity: 0.75;
}
.pwa-dialog button:focus-visible,
.pwa-banner button:focus-visible,
.pwa-account-open:focus-visible {
  outline: 3px solid #7b9cff;
  outline-offset: 3px;
}
.pwa-offline {
  max-width: 440px;
  margin: 15vh auto;
  padding: 24px;
  text-align: center;
}
.pwa-offline img {
  border-radius: 20px;
}
.pwa-offline p {
  line-height: 1.6;
  color: #52647d;
}
@keyframes pwa-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 600px) {
  .pwa-dialog {
    width: 100%;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    padding: 24px max(20px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
  }
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .order-app,
  .create-app,
  .management-shell,
  .login-shell {
    padding-top: max(20px, env(safe-area-inset-top));
  }
  .management-shell {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .order-tabs {
    top: env(safe-area-inset-top);
  }
}
@media (display-mode: standalone) {
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: white;
    z-index: 30;
    pointer-events: none;
  }
  .pwa-banner,
  #pwa-account-open {
    display: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pwa-banner,
  .pwa-dialog[open] {
    animation: none;
  }
}

/* Insets also apply to landscape iPhones and iPads wider than the phone breakpoint. */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.orders-create-bar {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
