/* PPDO DMS native app refinements. No selector applies without app-context. */

.app-context {
  --ppdo-safe-top: env(safe-area-inset-top, 0px);
  --ppdo-safe-right: env(safe-area-inset-right, 0px);
  --ppdo-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ppdo-safe-left: env(safe-area-inset-left, 0px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
}

body.app-context {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: rgba(43, 79, 175, 0.12);
}

.app-context .ppdo-page-shell {
  padding-bottom: max(96px, calc(72px + var(--ppdo-safe-bottom)));
}

.app-context .dms-sidebar,
.app-context .ppdo-drawer {
  padding-bottom: var(--ppdo-safe-bottom);
}

.app-context .ppdo-bottom-alert {
  bottom: var(--ppdo-safe-bottom) !important;
}

.app-context .toast {
  bottom: max(16px, calc(8px + var(--ppdo-safe-bottom))) !important;
}

.ppdo-mobile-system-region {
  position: relative;
  z-index: 2147483000;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.ppdo-mobile-system-region [hidden] {
  display: none !important;
}

.ppdo-mobile-connectivity,
.ppdo-mobile-update,
.ppdo-mobile-push-optin,
.ppdo-mobile-toast {
  position: fixed;
  z-index: 2147483000;
  color: var(--dms-ink, #182032);
  -webkit-font-smoothing: antialiased;
}

.ppdo-mobile-connectivity {
  top: max(10px, calc(var(--ppdo-safe-top, 0px) + 8px));
  left: max(12px, calc(var(--ppdo-safe-left, 0px) + 10px));
  right: max(12px, calc(var(--ppdo-safe-right, 0px) + 10px));
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin-inline: auto;
  padding: 12px 12px 12px 15px;
  border: 1px solid #e9dcb8;
  border-radius: 14px;
  background: var(--dms-amber-50, #f7eeda);
  box-shadow: 0 12px 34px rgba(22, 36, 74, 0.16);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 220ms var(--dms-ease, cubic-bezier(0.3, 0.7, 0.3, 1));
}

.ppdo-mobile-connectivity.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ppdo-mobile-connectivity.is-online {
  border-color: #c9e2d3;
  background: var(--dms-green-50, #ddf0e5);
}

.ppdo-mobile-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dms-amber, #7d5a10);
  box-shadow: 0 0 0 4px rgba(125, 90, 16, 0.1);
}

.is-online > .ppdo-mobile-status-dot {
  background: var(--dms-green, #23724a);
  box-shadow: 0 0 0 4px rgba(35, 114, 74, 0.1);
}

.ppdo-mobile-system-copy {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.ppdo-mobile-system-copy strong {
  color: var(--dms-navy, #16244a);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ppdo-mobile-system-copy > span {
  color: var(--dms-ink-2, #4e586e);
  font-size: 12px;
}

.ppdo-mobile-system-action,
.ppdo-mobile-icon-action {
  min-height: 40px;
  border: 1px solid var(--dms-border-strong, #d3dae6);
  border-radius: 11px;
  background: var(--dms-surface, #fff);
  color: var(--dms-blue-700, #24439b);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ppdo-mobile-system-action {
  padding: 0 14px;
}

.ppdo-mobile-icon-action {
  padding: 0 12px;
  color: var(--dms-ink-2, #4e586e);
}

.ppdo-mobile-system-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ppdo-mobile-system-action:focus-visible,
.ppdo-mobile-icon-action:focus-visible {
  outline: 2px solid var(--dms-blue-500, #4169d1);
  outline-offset: 2px;
}

.ppdo-mobile-system-action:active,
.ppdo-mobile-icon-action:active {
  transform: scale(0.98);
}

.ppdo-mobile-system-action-primary {
  border-color: var(--dms-blue-700, #24439b);
  background: var(--dms-blue-700, #24439b);
  color: #fff;
}

.ppdo-mobile-update {
  right: max(12px, calc(var(--ppdo-safe-right, 0px) + 10px));
  bottom: max(12px, calc(var(--ppdo-safe-bottom, 0px) + 10px));
  left: max(12px, calc(var(--ppdo-safe-left, 0px) + 10px));
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 640px;
  margin-inline: auto;
  padding: 13px 13px 13px 16px;
  border: 1px solid var(--dms-border, #e5e9f1);
  border-radius: 15px;
  background: var(--dms-surface, #fff);
  box-shadow: 0 16px 42px rgba(22, 36, 74, 0.18);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 220ms var(--dms-ease, cubic-bezier(0.3, 0.7, 0.3, 1));
}

.ppdo-mobile-push-optin {
  right: max(12px, calc(var(--ppdo-safe-right, 0px) + 10px));
  bottom: max(12px, calc(var(--ppdo-safe-bottom, 0px) + 10px));
  left: max(12px, calc(var(--ppdo-safe-left, 0px) + 10px));
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  margin-inline: auto;
  padding: 14px 14px 14px 17px;
  border: 1px solid var(--dms-border, #e5e9f1);
  border-radius: 15px;
  background: var(--dms-surface, #fff);
  box-shadow: 0 16px 42px rgba(22, 36, 74, 0.18);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 220ms var(--dms-ease, cubic-bezier(0.3, 0.7, 0.3, 1));
}

.ppdo-mobile-push-optin.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ppdo-mobile-update.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ppdo-mobile-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ppdo-mobile-toast {
  right: max(18px, calc(var(--ppdo-safe-right, 0px) + 14px));
  bottom: max(22px, calc(var(--ppdo-safe-bottom, 0px) + 16px));
  left: max(18px, calc(var(--ppdo-safe-left, 0px) + 14px));
  width: max-content;
  max-width: min(420px, calc(100vw - 36px));
  margin-inline: auto;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--dms-navy, #16244a);
  box-shadow: 0 12px 32px rgba(22, 36, 74, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease-out, transform 180ms ease-out;
}

.ppdo-mobile-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (pointer: coarse) {
  .app-context :is(button, [role="button"], input[type="button"], input[type="submit"], .btn, .tab-btn, .dms-menu-btn, .dms-nav-item, .ppdo-sign-out),
  .app-context .ppdo-notification-anchor > button,
  .app-context :is(input.inp, select.inp) {
    min-height: 44px;
  }

  .app-context :is(button, [role="button"], input[type="button"], input[type="submit"], .btn, .tab-btn, .dms-menu-btn, .dms-nav-item, .ppdo-sign-out) {
    min-width: 44px;
  }

  .ppdo-mobile-system-action,
  .ppdo-mobile-icon-action {
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .ppdo-mobile-android :is(button, [role="button"], input[type="button"], input[type="submit"], .btn, .tab-btn, .dms-menu-btn, .dms-nav-item, .ppdo-sign-out),
  .ppdo-mobile-android .ppdo-notification-anchor > button,
  .ppdo-mobile-android :is(input.inp, select.inp),
  .ppdo-mobile-android .ppdo-mobile-system-action,
  .ppdo-mobile-android .ppdo-mobile-icon-action {
    min-height: 48px;
  }

  .ppdo-mobile-android :is(button, [role="button"], input[type="button"], input[type="submit"], .btn, .tab-btn, .dms-menu-btn, .dms-nav-item, .ppdo-sign-out) {
    min-width: 48px;
  }
}

@media (max-width: 540px) {
  .ppdo-mobile-connectivity {
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 10px;
  }

  .ppdo-mobile-connectivity .ppdo-mobile-system-action {
    grid-column: 2;
    justify-self: start;
  }

  .ppdo-mobile-update {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .ppdo-mobile-push-optin {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .ppdo-mobile-update-actions,
  .ppdo-mobile-update-actions > button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-context,
  .app-context *,
  .app-context *::before,
  .app-context *::after {
    scroll-behavior: auto !important;
  }

  .ppdo-mobile-connectivity,
  .ppdo-mobile-update,
  .ppdo-mobile-push-optin,
  .ppdo-mobile-toast {
    transition-duration: 0.01ms !important;
    transform: none !important;
  }
}

@media (forced-colors: active) {
  .ppdo-mobile-connectivity,
  .ppdo-mobile-update,
  .ppdo-mobile-push-optin,
  .ppdo-mobile-toast {
    border: 1px solid CanvasText;
    forced-color-adjust: auto;
  }

  .ppdo-mobile-status-dot {
    background: CanvasText;
    box-shadow: none;
  }
}

@media print {
  .ppdo-mobile-system-region {
    display: none !important;
  }
}
