/*!
  Copyright © 2020–2026 Stuart J. Berkowitz. All rights reserved.
  Bayesian Causal Atlas · longevityresearch.ca. ip:SB-hdr
  Proprietary and confidential. Unauthorized copying, modification, distribution,
  or use of this file or its data, in whole or in part, is strictly prohibited.
*/
/* ============================================================================
   bca-overlay.css — non-destructive accessibility + chrome overlay
   Injected AFTER each oracle's own styles so it converges look-and-feel
   without rewriting any oracle. Leverages the shared token names.
   ========================================================================== */

/* 1) Default contrast lift — only the low-contrast muted token, applied last so it wins.
   (Most oracles set --t3 ~#6f8296 ≈4.5:1; lift to ≈7:1 AAA. Palette identity kept.) */
:root{ --t3:#93a4b6 !important; }

/* 2) High-contrast mode (opt-in via the toolbar; class on <html>) */
html.bca-hc{
  --bg:#05080c !important; --t1:#ffffff !important; --t2:#e4ecf3 !important; --t3:#c2d0de !important;
  --line:#4a5d73 !important; --teal:#39f2e4 !important; --gold:#ffd699 !important;
}
html.bca-hc body{ background:#05080c !important; color:#fff !important; }

/* 3) Floating accessibility toolbar (fixed corner; unobtrusive; consistent everywhere) */
#bca-a11y-bar{position:fixed;right:14px;bottom:14px;z-index:99999;display:flex;gap:6px;align-items:center;
  background:rgba(20,27,36,.96);border:1px solid #3a4a5e;border-radius:12px;padding:7px 9px;
  font-family:'JetBrains Mono',ui-monospace,monospace;box-shadow:0 4px 18px rgba(0,0,0,.5)}
#bca-a11y-bar button{min-width:38px;min-height:38px;font-size:15px;background:#0b1017;color:#f2f7fb;
  border:1px solid #3a4a5e;border-radius:7px;cursor:pointer;line-height:1;padding:0 8px}
#bca-a11y-bar button:hover{border-color:#22e6d8}
#bca-a11y-bar button:focus-visible{outline:3px solid #22e6d8;outline-offset:2px}
#bca-a11y-bar .bca-lbl{font-size:10px;color:#93a4b6;text-transform:uppercase;letter-spacing:.05em;padding:0 2px}
#bca-a11y-bar .bca-val{font-size:12px;color:#22e6d8;min-width:40px;text-align:center}
html.bca-hc #bca-a11y-bar{background:#000;border-color:#4a5d73}
@media print{ #bca-a11y-bar{display:none!important} }

/* 4) Mobile scroll fix — some oracles use a desktop app-shell (body{height:100vh;overflow:hidden}),
   which traps scrolling on phones. On narrow screens, let the document scroll naturally.
   Applied last + !important so it overrides each oracle's own body rule; no-op where not needed. */
@media (max-width:768px){
  html, body{
    height:auto !important;
    min-height:100% !important;
    overflow-x:hidden !important;   /* stop horizontal-overflow trapping vertical scroll on phones */
    overflow-y:auto !important;     /* page scrolls normally */
    -webkit-overflow-scrolling:touch;
  }
  /* the rtl-flow card ordering is a desktop multi-column trick; in the single-column
     mobile layout it only introduces an rtl scroll/anchor anomaly — neutralise it. */
  .gallery.rtl-flow, .gallery{ direction:ltr !important; }
/* © Stuart J. Berkowitz · ip:SB-2b4cb8d5 */
  .gallery.rtl-flow > *{ direction:ltr !important; }
}
