/**
 * Aegis Intel v15.4.4 — Mobile/Web Visual Parity Lock (MackSims LLC)
 * Final authority layer: one canonical light premium canvas for viewport AND full-page scroll.
 * CSS-only — no flow/nav/provider changes.
 */

:root {
  --parity-page-bg: var(--aegis-page-bg, #f3f1ec);
  --parity-page-bg-end: var(--aegis-page-bg-end, #e6e2da);
  --parity-page-background:
    radial-gradient(ellipse 100% 70% at 10% -5%, rgba(26, 122, 98, 0.08), transparent 42%),
    radial-gradient(ellipse 80% 50% at 90% 0%, rgba(13, 142, 168, 0.05), transparent 38%),
    linear-gradient(180deg, var(--parity-page-bg) 0%, #f0ede6 55%, var(--parity-page-bg-end) 100%);
  color-scheme: light;
}

/* ——— 1. Canonical page canvas (html owns gradient; shell stays transparent) ——— */
html {
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--parity-page-bg-end) !important;
  background-image: var(--parity-page-background) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  background-attachment: scroll !important;
}

body,
#app,
.app-shell,
.app-shell.cmd-shell,
.app-main,
.app-view,
.app-view.is-active {
  min-height: 100%;
  min-height: 100dvh;
  background: transparent !important;
}

/* Admin unlock must never repaint the public page canvas dark */
body.admin-mode,
body.admin-mode #app,
body.admin-mode .app-shell,
body.admin-mode .app-main,
body.admin-mode .app-view {
  background: transparent !important;
  color-scheme: light;
}

/* ——— 2. Grid overlay — viewport accent only (does not darken scroll tail) ——— */
html::before {
  position: fixed;
  inset: 0;
  height: auto;
  min-height: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

/* ——— 3. Settings — light premium glass (match Home) ——— */
.cmd-shell .settings-view-block,
.cmd-shell .settings-view-block.panel,
.cmd-shell .settings-about-card,
.cmd-shell .admin-unlock-panel,
.cmd-shell .admin-tools-panel,
.cmd-shell .account-view-block,
.cmd-shell .settings-help-block.panel {
  background: var(--premium-glass-strong, rgba(255, 255, 255, 0.88)) !important;
  border: 1px solid var(--premium-border, rgba(221, 214, 203, 0.62)) !important;
  box-shadow: var(--premium-shadow-card, 0 1px 2px rgba(15, 23, 41, 0.03), 0 8px 24px rgba(15, 23, 41, 0.05)) !important;
  color: var(--text) !important;
}

.cmd-shell .settings-about-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #f8f6f2 100%) !important;
}

.cmd-shell .admin-unlock-panel {
  background: linear-gradient(180deg, #fffdf8, var(--surface-soft, #f7f5f1)) !important;
}

.cmd-shell .admin-tools-panel {
  background: linear-gradient(180deg, #ffffff, #f8faf8) !important;
}

.cmd-shell .settings-grid .switch-line,
.cmd-shell .settings-drawer-content .switch-line {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: var(--line-soft, rgba(221, 214, 203, 0.78)) !important;
  color: var(--text) !important;
}

.cmd-shell .settings-view-block .muted,
.cmd-shell .settings-footer .muted,
.cmd-shell .settings-view-block label,
.cmd-shell .settings-view-block h3 {
  color: inherit;
}

.cmd-shell .settings-view-block .muted,
.cmd-shell .settings-footer .footer-disclaimer,
.cmd-shell .settings-footer .footer-meta {
  color: var(--muted) !important;
}

/* ——— 4. Footer — light theme, transparent over unified canvas ——— */
.site-footer,
.settings-footer,
.app-footer {
  background: transparent !important;
  border-top: 1px solid var(--line-soft, rgba(221, 214, 203, 0.78)) !important;
  color: var(--muted) !important;
}

.site-footer .footer-disclaimer,
.site-footer .footer-meta,
.site-footer .footer-links a,
.settings-footer .footer-disclaimer,
.settings-footer .footer-meta,
.settings-footer .footer-links a {
  color: var(--muted) !important;
}

.site-footer .footer-links a:hover,
.settings-footer .footer-links a:hover {
  color: var(--primary) !important;
}

/* ——— 5. Overscroll / rubber-band — same ivory tail ——— */
html,
body {
  overscroll-behavior-y: none;
}

@supports (-webkit-touch-callout: none) {
  html {
    background-attachment: scroll !important;
  }
}

/* ——— 6. Shell stacking — content above grid overlay ——— */
.app-shell.cmd-shell {
  position: relative;
  z-index: 1;
}
