/* A quiet full-screen interstitial, not a rotated copy of the application. */
:root {
  --pwa-orientation-background: #f7f9fc;
  --pwa-orientation-foreground: #17243a;
  --pwa-orientation-secondary: #526178;
  --pwa-orientation-accent: #2f6bff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-color-scheme="light"]) {
    --pwa-orientation-background: #080f20;
    --pwa-orientation-foreground: #f2f5fb;
    --pwa-orientation-secondary: #a3afc3;
    --pwa-orientation-accent: #91b5ff;
  }
}

:root[data-color-scheme="dark"] {
  --pwa-orientation-background: #080f20;
  --pwa-orientation-foreground: #f2f5fb;
  --pwa-orientation-secondary: #a3afc3;
  --pwa-orientation-accent: #91b5ff;
}

/* The phone-specific media rule is prepared once by pwa-orientation.js.
   CSS, not a late orientation event or the dialog's open attribute, owns paint.
   No inline body styles are mutated, so activity scroll owners survive intact. */
html:root dialog.pwa-orientation-guard {
  display: none !important;
  flex-direction: column;
  align-items: center;
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(24px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--pwa-orientation-background);
  color: var(--pwa-orientation-foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  visibility: visible !important;
  opacity: 1;
  transform: none;
  animation: none !important;
  transition: none !important;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.pwa-orientation-guard::backdrop {
  display: none;
  background: var(--pwa-orientation-background, #080f20);
  animation: none !important;
  transition: none !important;
}

.pwa-orientation-guard__content {
  flex: 0 0 auto;
  width: 100%;
  max-width: 32rem;
  margin: auto;
}

.pwa-orientation-guard__icon {
  display: block;
  width: 88px;
  height: 80px;
  margin: 0 auto 20px;
  color: var(--pwa-orientation-accent);
}

.pwa-orientation-guard__arrow {
  opacity: 0.55;
}

.pwa-orientation-guard__title {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  outline: none;
}

.pwa-orientation-guard__description {
  margin: 10px 0 0;
  color: var(--pwa-orientation-secondary);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

@media (max-height: 320px) {
  .pwa-orientation-guard__icon { width: 66px; height: 60px; margin-bottom: 12px; }
  .pwa-orientation-guard__title { font-size: 1.5rem; }
}

@media (forced-colors: active) {
  html:root dialog.pwa-orientation-guard { background: Canvas; color: CanvasText; }
  .pwa-orientation-guard__icon, .pwa-orientation-guard__description { color: CanvasText; }
}
