/* MyNextOpp — global polish layer.
   Small, low-risk refinements that apply to every route:
   focus visibility, selection, scrollbars, route progress, back-to-top,
   reduced motion, print and the vNext route hand-off. */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

::selection {
  background: rgba(6, 182, 212, 0.32);
  color: #f8fafc;
}

/* A single, visible focus treatment for keyboard users everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-cyan, #06b6d4);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Slim, theme-aware scrollbars (WebKit + Firefox). */
* { scrollbar-width: thin; scrollbar-color: #2a3559 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2a3559;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #3b4a75; background-clip: content-box; }

/* Images never overflow their container. */
img, svg, video, canvas { max-width: 100%; }

/* Route-change progress indicator. */
.mno-route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6);
  z-index: 2147483000;
  pointer-events: none;
  transition: transform 0.15s ease-out, opacity 0.3s ease;
  opacity: 0;
}
.mno-route-progress.is-active { opacity: 1; }

/* Back to top. */
.mno-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-color, #1e2749);
  background: color-mix(in srgb, var(--bg-secondary, #0b1030) 92%, transparent);
  color: var(--text-primary, #e2e8f0);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(10px);
}
.mno-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.mno-to-top:hover { border-color: var(--accent-cyan, #06b6d4); color: #67e8f9; }
.mno-to-top svg { width: 1.1rem; height: 1.1rem; }

/* Screen-reader route announcer. */
.mno-route-live {
  position: fixed;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* vNext pages take over their route; hide the React page underneath. */
html.v2-route-active #main-content { display: none !important; }
html.v2-route-active #root {
  min-height: 0 !important;
  height: 0 !important;
  overflow: visible !important;
}
html.v2-route-active { background: var(--bg-primary, #070b1f); }

/* Keep the cookie banner and install prompt above our surfaces. */
.mno-toasts { z-index: 2147482000; }

/* Respect reduced motion for the platform's own transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Print: strip chrome. */
@media print {
  .mno-to-top, .mno-route-progress, .v2-topbar, nav, footer { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
