/* RiverX V157 — unified visual foundation. Loaded after legacy compatibility CSS. */
:root {
  --rx157-bg: #07111d;
  --rx157-bg-deep: #040a12;
  --rx157-surface: #0d1a29;
  --rx157-surface-raised: #122236;
  --rx157-surface-soft: #172a40;
  --rx157-border: rgba(151, 174, 204, 0.16);
  --rx157-border-strong: rgba(151, 174, 204, 0.28);
  --rx157-text: #f5f7fb;
  --rx157-text-soft: #c3cede;
  --rx157-muted: #8496ac;
  --rx157-brand: #7c63ff;
  --rx157-brand-strong: #6848f5;
  --rx157-brand-soft: rgba(124, 99, 255, 0.14);
  --rx157-gold: #d8ad59;
  --rx157-gold-soft: rgba(216, 173, 89, 0.13);
  --rx157-success: #21b979;
  --rx157-success-strong: #169a62;
  --rx157-success-soft: rgba(33, 185, 121, 0.13);
  --rx157-danger: #ef5f70;
  --rx157-danger-soft: rgba(239, 95, 112, 0.13);
  --rx157-warning: #e4a94b;
  --rx157-radius-xs: 7px;
  --rx157-radius-sm: 10px;
  --rx157-radius-md: 14px;
  --rx157-radius-lg: 18px;
  --rx157-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.18);
  --rx157-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.36);
  --rx157-topbar: 68px;
  --rx157-sidebar: 224px;
  --rx157-sidebar-collapsed: 76px;
  --rx157-content: 1320px;

  /* Normalize legacy tokens without changing application behavior. */
  --bg: var(--rx157-bg);
  --bg2: var(--rx157-bg-deep);
  --panel: var(--rx157-surface);
  --panel2: var(--rx157-surface-raised);
  --border: var(--rx157-border);
  --text: var(--rx157-text);
  --muted: var(--rx157-muted);
  --cyan: var(--rx157-brand);
  --blue: var(--rx157-brand-strong);
  --green: var(--rx157-success);
  --purple: var(--rx157-brand);
  --gold: var(--rx157-gold);
  --red: var(--rx157-danger);
  --radius: var(--rx157-radius-lg);
}

html {
  background: var(--rx157-bg-deep);
  color-scheme: dark;
  scrollbar-color: #31465f var(--rx157-bg-deep);
}

body.rx-v157 {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--rx157-text);
  background:
    radial-gradient(circle at 78% -20%, rgba(100, 77, 224, 0.14), transparent 38rem),
    linear-gradient(180deg, #091523 0%, var(--rx157-bg) 48%, #050c15 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 450;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.rx-v157::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

body.rx-v157 .bg-orb,
body.rx-v157 .bg-grid {
  display: none !important;
}

body.rx-v157 *,
body.rx-v157 *::before,
body.rx-v157 *::after {
  box-sizing: border-box;
}

body.rx-v157 :where(h1, h2, h3, h4, p) {
  margin-top: 0;
}

body.rx-v157 :where(h1, h2, h3, h4, strong, button) {
  letter-spacing: -0.012em;
}

body.rx-v157 :where(button, input, select, textarea) {
  font: inherit;
}

body.rx-v157 button {
  -webkit-tap-highlight-color: transparent;
}

body.rx-v157 a {
  color: inherit;
}

body.rx-v157 [hidden] {
  display: none !important;
}

body.rx-v157 :where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(147, 129, 255, 0.5) !important;
  outline-offset: 3px !important;
}

body.rx-v157 ::selection {
  color: #fff;
  background: rgba(124, 99, 255, 0.68);
}

body.rx-v157 .eyebrow,
body.rx-v157 .rx-kicker-v157,
body.rx-v157 .rx-section-kicker-v157 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a99bff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.2;
  letter-spacing: 0.13em !important;
  text-transform: uppercase;
}

body.rx-v157 .rx-kicker-v157::before,
body.rx-v157 .rx-section-kicker-v157::before {
  width: 18px;
  height: 1px;
  content: "";
  background: currentColor;
  opacity: 0.75;
}

body.rx-v157 .account-message:empty,
body.rx-v157 .rx-security-message:empty,
body.rx-v157 .admin-security-message:empty {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.rx-v157 *,
  body.rx-v157 *::before,
  body.rx-v157 *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
