/* Dolvero v2 shared background + glass surfaces.
   Cached immutable for 30 days - bump the ?v= stamp in the including page.

   Both palettes are declared on :root first, so a token can never exist only
   inside the light block. That is how half-themed pages happen. */

:root{
  --bg-ink:#070b13;
  --bg-glass:rgba(255,255,255,.045);
  --bg-glass-line:rgba(147,184,255,.16);
  --bg-glass-hi:rgba(255,255,255,.16);
  --bg-panel:rgba(11,17,32,.62);
  --theme-ease:cubic-bezier(.32,.72,0,1);
  --theme-dur:900ms;
}
:root[data-theme="light"]{
  --bg-ink:#eef3fd;
  --bg-glass:rgba(255,255,255,.62);
  --bg-glass-line:rgba(20,45,110,.14);
  --bg-glass-hi:rgba(255,255,255,.9);
  --bg-panel:rgba(255,255,255,.66);
}

/* ---------- the ground ---------- */
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;
  background:radial-gradient(120% 90% at 50% 8%, #101c31 0%, #0b1221 42%, #070b13 78%)}
:root[data-theme="light"] .bg{background:
  radial-gradient(120% 95% at 50% -10%, #ffffff 0%, #eff4fe 38%, #dfe9fb 72%, #d3e0f8 100%)}

.bg__canvas{position:absolute;inset:0;width:100%;height:100%;display:block;
  opacity:0;transition:opacity 1.1s ease}
.bg__canvas.is-live{opacity:1}
body.gl-on .bg__aurora{display:none}

/* CSS fallback when WebGL is unavailable */
.bg__aurora{position:absolute;inset:-25%;filter:blur(90px);opacity:.92}
:root[data-theme="light"] .bg__aurora{opacity:.9;filter:blur(72px)}
.blob{position:absolute;border-radius:50%;mix-blend-mode:screen;
  will-change:transform;transform:translateZ(0);backface-visibility:hidden}
.blob--a{width:68vmax;height:68vmax;left:-14%;top:-16%;
  background:radial-gradient(circle at 34% 34%, rgba(37,84,212,.92) 0%, rgba(37,84,212,.34) 42%, transparent 68%);
  animation:driftA 52s ease-in-out infinite}
.blob--b{width:58vmax;height:58vmax;right:-12%;top:6%;
  background:radial-gradient(circle at 60% 40%, rgba(79,125,240,.78) 0%, rgba(79,125,240,.24) 44%, transparent 70%);
  animation:driftB 64s ease-in-out infinite}
.blob--c{width:52vmax;height:52vmax;left:16%;bottom:-24%;
  background:radial-gradient(circle at 50% 50%, rgba(147,184,255,.44) 0%, rgba(74,111,165,.18) 46%, transparent 72%);
  animation:driftC 46s ease-in-out infinite}
.blob--d{width:38vmax;height:38vmax;left:44%;top:26%;
  background:radial-gradient(circle at 50% 50%, rgba(28,47,79,.9) 0%, rgba(28,47,79,.3) 50%, transparent 74%);
  animation:driftD 58s ease-in-out infinite}
@keyframes driftA{0%,100%{transform:translate3d(0,0,0) scale(1)}33%{transform:translate3d(7vw,5vh,0) scale(1.12)}66%{transform:translate3d(-4vw,9vh,0) scale(.94)}}
@keyframes driftB{0%,100%{transform:translate3d(0,0,0) scale(1.04)}40%{transform:translate3d(-9vw,7vh,0) scale(.9)}70%{transform:translate3d(-3vw,-6vh,0) scale(1.16)}}
@keyframes driftC{0%,100%{transform:translate3d(0,0,0) scale(.98)}50%{transform:translate3d(9vw,-8vh,0) scale(1.18)}}
@keyframes driftD{0%,100%{transform:translate3d(0,0,0) scale(1)}45%{transform:translate3d(-8vw,4vh,0) scale(1.2)}80%{transform:translate3d(5vw,-5vh,0) scale(.92)}}
body.is-paused .blob{animation-play-state:paused}
@media (prefers-reduced-motion: reduce){.blob{animation:none}}

.bg__grid{position:absolute;inset:0;
  background-image:radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size:22px 22px;
  -webkit-mask-image:radial-gradient(115% 85% at 50% 45%, #000 35%, transparent 78%);
  mask-image:radial-gradient(115% 85% at 50% 45%, #000 35%, transparent 78%)}
:root[data-theme="light"] .bg__grid{
  background-image:radial-gradient(circle, rgba(20,45,110,.10) 1px, transparent 1px)}

/* Keeps content legible wherever the ribbon drifts. In light it LIFTS to white
   rather than darkening - the inverse of the dark behaviour, not a recolour. */
.bg__scrim{position:absolute;inset:0;background:
  radial-gradient(56% 44% at 50% 46%, rgba(3,6,12,.72) 0%, rgba(3,6,12,.38) 46%, transparent 76%)}
:root[data-theme="light"] .bg__scrim{background:
  radial-gradient(56% 44% at 50% 44%, rgba(255,255,255,.93) 0%, rgba(255,255,255,.66) 48%, rgba(255,255,255,0) 78%)}

.bg__vignette{position:absolute;inset:0;
  background:radial-gradient(105% 75% at 50% 45%, transparent 40%, rgba(4,7,13,.72) 100%)}
:root[data-theme="light"] .bg__vignette{background:
  radial-gradient(120% 88% at 50% 42%, transparent 46%, rgba(147,180,235,.34) 100%)}

/* Content must sit above the ground. */
body > *:not(.bg){position:relative;z-index:1}

/* That selector outranks a bare class, so anything deliberately layered has to
   take its position back here rather than in v2.css. The nav is sticky on every
   v2 page; the terminal is the one exception and says so in its own sheet. */
body > .tnav{position:sticky;top:0;z-index:40}

/* THE INSTRUMENT SEARCH OVERLAY, for the same reason and by the same rule.

   _nav.php deliberately reparents #navSearchPop to <body> - .tnav carries a
   backdrop-filter, and a filtered ancestor becomes the containing block for its
   fixed descendants, which would trap the overlay inside a 52px bar. Moving it
   out is what makes `fixed` mean the viewport.

   And moving it out is exactly what put it in range of the rule above. That
   selector scores 0-1-1; `.navsearch__pop{position:fixed}` in v2.css scores
   0-1-0, so it LOST. The overlay was handed position:relative and z-index:1,
   which made it an ordinary block at the end of the document: it took up
   layout space and pushed the page down by its own height instead of covering
   it. Measured on /rules - the document grew 12,706px to 12,986px on open.

   v2-select.css:47 carries the identical note about the select panel, which hit
   this first. Two components have now been caught by one selector, so this is
   the place to look when a third appears to open "below the page". */
body > .navsearch__pop{position:fixed;inset:0;z-index:200}

/* ---------- glass surfaces ---------- */
.glass{background:var(--bg-glass);border:1px solid var(--bg-glass-line);
  -webkit-backdrop-filter:blur(14px) saturate(1.35);backdrop-filter:blur(14px) saturate(1.35);
  box-shadow:0 10px 34px -18px rgba(0,0,0,.6), inset 0 1px 0 var(--bg-glass-hi)}
.glass-panel{background:var(--bg-panel);border:1px solid var(--bg-glass-line);
  -webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3)}

/* One shared curve so chrome and background never move out of step. */
body,.bg,.bg__scrim,.bg__vignette,.bg__grid,.glass,.glass-panel{
  transition:background-color var(--theme-dur) var(--theme-ease),
             /* background-image is NOT transitioned. It is a DISCRETE property -
                no engine can interpolate one gradient into another - so the
                browser swaps it at the halfway point of the duration instead.
                For the first 450ms of every theme change the element therefore
                had NO background image at all, which is why the primary sign-in
                button rendered as white-on-white (its blue glow painted, its
                gradient did not) and why glass panels washed out mid-flip.
                Colours still cross-fade through background-color. */
             color var(--theme-dur) var(--theme-ease),
             border-color var(--theme-dur) var(--theme-ease),
             box-shadow var(--theme-dur) var(--theme-ease),
             opacity var(--theme-dur) var(--theme-ease)}
@media (prefers-reduced-motion: reduce){
  body,.bg,.bg__scrim,.bg__vignette,.bg__grid,.glass,.glass-panel{transition:none}
}

/* ---------- buy/sell text contrast in light mode ----------
   #10b981 on white is 2.54:1 and #ef4444 is 3.76:1 - both fail WCAG AA for
   text (4.5:1). Measured, not guessed.

   The FILLS, candles and chart series keep the exact original colours: those
   are functional trading signals and a trader reading a chart expects that
   green. Only TEXT is darkened, and only in light mode, where it is being read
   as words rather than seen as a signal. Dark mode is untouched - the original
   colours already pass comfortably against the dark ground. */
:root{ --buy-text:var(--buy); --sell-text:var(--sell); }
:root[data-theme="light"]{ --buy-text:#0a7d5a; --sell-text:#c02626; }  /* 5.13:1 and 5.92:1 */

:root[data-theme="light"] .up,
:root[data-theme="light"] .ok,
:root[data-theme="light"] .pill2.b,
:root[data-theme="light"] .tfa-state.on{ color:var(--buy-text) }

:root[data-theme="light"] .down,
:root[data-theme="light"] .bad,
:root[data-theme="light"] .pill2.s{ color:var(--sell-text) }

/* ---------- shared theme toggle ----------
   THE definition. Every v2 page gets the button from _nav.php and its
   appearance from here; no page carries a private copy any more.

   It used to be position:fixed - a pill pinned to the viewport, floating over
   whatever happened to be underneath and colliding with the top-left of the
   page. It is now a plain flex child of the nav, sitting immediately left of
   the notifications bell, so there is no geometry to reconcile against the bar
   and nothing to overlap: it is IN the bar.

   Sized and coloured as a twin of .iconbtn so the right-hand cluster reads as
   one row of three controls. It lives here rather than in v2.css because
   v2-bg.css is the sheet every v2 page loads, migrated or not. */
.themer{position:relative;width:32px;height:32px;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:8px;cursor:pointer;font-family:inherit;
  border:1px solid var(--line,var(--bg-glass-line));
  background:var(--w1,rgba(255,255,255,.03));
  color:var(--muted)}
.themer:hover{color:var(--text);border-color:var(--line2,var(--bg-glass-line))}
.themer:focus-visible{outline:2px solid var(--soft);outline-offset:2px}
.themer__ico{display:flex;align-items:center;justify-content:center}
.themer__ico svg{display:block}
/* v2-theme.js writes the current scheme's name in here, so it has to stay in
   the DOM. There is no room for a word at nav scale, so it is hidden the
   accessible way rather than with display:none - the button names itself with
   aria-label and title. */
.themer__lbl{position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* ---------- numerics ----------
   Numbers were set in JetBrains Mono. Mono buys column alignment but reads as a
   terminal emulator, which is not the register we want. Inter with TABULAR
   figures gives the same alignment - every digit occupies identical width - in
   the same typeface as everything else.

   Selector is `body .mono` on purpose: each page defines a plain `.mono` in its
   own inline <style>, which loads after this file, so an equally-specific rule
   here would lose. */
body .mono,
body .mono * {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:"tnum" 1,"lnum" 1,"ss01" 1;
  letter-spacing:-.005em;
}

/* ==========================================================================
   Glass, second pass. Three things the first version got wrong, per current
   guidance (2026):

   1. NO FALLBACK. backdrop-filter is not universal, and where it is missing a
      0.06-opacity panel is just unreadable text on a moving background. Glass
      must be progressive enhancement, never the baseline.
   2. NO prefers-reduced-transparency SUPPORT. Some people disable transparency
      at OS level precisely because it hurts them to read. That must be honoured
      the same way we already honour prefers-reduced-motion.
   3. TEXT SAT DIRECTLY ON THE TRANSPARENCY. Guidance is to put a denser film
      behind the text itself rather than raising the whole panel's opacity -
      you keep the depth without losing legibility.
   ========================================================================== */

/* --- 1. the baseline is SOLID. glass is layered on top only if supported --- */
.glass, .glass-panel{
  background:var(--solid-fallback, #0d1424);
  border:1px solid var(--bg-glass-line);
  border-radius:14px;
}
:root{ --solid-fallback:#0d1424; }
:root[data-theme="light"]{ --solid-fallback:#ffffff; }

@supports ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass{
    background:var(--bg-glass);
    -webkit-backdrop-filter:blur(14px) saturate(1.35);
    backdrop-filter:blur(14px) saturate(1.35);
  }
  .glass-panel{
    background:var(--bg-panel);
    -webkit-backdrop-filter:blur(18px) saturate(1.3);
    backdrop-filter:blur(18px) saturate(1.3);
  }
}

/* --- 2. honour a stated preference for less transparency --- */
@media (prefers-reduced-transparency: reduce){
  .glass, .glass-panel{
    background:var(--solid-fallback) !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
  }
  .bg__aurora, .bg__canvas{ opacity:.28 }
}

/* --- 3. the glass EDGE: a lit top rim and a soft outer shadow.
       Shape should be readable from the border and shadow alone, so the
       component still reads as a surface when transparency is off. --- */
.glass, .glass-panel{
  position:relative;
  box-shadow:
    0 1px 0 0 var(--bg-glass-hi) inset,          /* lit top rim */
    0 18px 40px -24px rgba(0,0,0,.55),           /* lift */
    0 2px 8px -4px rgba(0,0,0,.25);
}
:root[data-theme="light"] .glass,
:root[data-theme="light"] .glass-panel{
  box-shadow:
    0 1px 0 0 rgba(255,255,255,.9) inset,
    0 18px 38px -26px rgba(20,45,110,.30),
    0 2px 8px -5px rgba(20,45,110,.14);
}

/* --- 4. a denser film behind text-heavy regions inside a glass panel ---
   Apply .glass-film to the block that actually holds copy or figures. It keeps
   the panel translucent while giving the text a readable ground. */
.glass-film{
  background:linear-gradient(180deg,
    rgba(10,16,32,.34) 0%, rgba(10,16,32,.22) 100%);
  border-radius:11px;
}
:root[data-theme="light"] .glass-film{
  background:linear-gradient(180deg,
    rgba(255,255,255,.62) 0%, rgba(255,255,255,.44) 100%);
}
@media (prefers-reduced-transparency: reduce){
  .glass-film{ background:transparent }
}
