/* BBXNEXUS — single Cosmic Dark Glass design language.
   Presentation-only override: no scene geometry, layout coordinates, script
   timing, freight logic, trade data, or account behaviour is changed.
   All seven fixed neon hues remain available; interface chrome uses one
   globe-owned --bbx-page-neon accent at a time, never a rainbow band. */
:root{
  --bbx-neon-red:#FF2028;
  --bbx-neon-cyan:#00E5FF;
  --bbx-neon-jade:#00FF9C;
  --bbx-neon-blue:#326BFF;
  --bbx-neon-orange:#FF6A00;
  --bbx-neon-violet:#A855FF;
  --bbx-neon-lime:#B6FF00;
  --bbx-cosmic-void:#030916;
  --bbx-cosmic-night:#081426;
  --bbx-cosmic-glass:rgba(12,30,50,.88);
  --bbx-cosmic-glass-deep:rgba(7,19,36,.94);
  --bbx-cosmic-raised:rgba(25,51,73,.68);
  --bbx-cosmic-line:rgba(177,207,231,.30);
  --bbx-cosmic-soft-line:rgba(156,194,221,.16);
  --bbx-cosmic-text:#f3f8fd;
  --bbx-cosmic-copy:#c5d7e5;
  --bbx-cosmic-muted:#a6bfce;
  --bbx-cosmic-focus:#00E5FF;
  --bbx-cosmic-active:var(--bbx-page-neon,var(--bbx-neon-red));
}

@media (forced-colors:none){
  html{color-scheme:dark}
  body{background:var(--bbx-cosmic-void);color:var(--bbx-cosmic-text)}

  /* The globe remains the only dominant artwork: ambient space around it. */
  body[data-hero="true"] #experience{
    background:
      radial-gradient(ellipse 39% 53% at 29% 45%,rgba(34,70,111,.26),transparent 79%),
      radial-gradient(ellipse 34% 47% at 82% 72%,rgba(0,229,255,.035),transparent 78%),
      linear-gradient(128deg,#030713 0%,#081326 49%,#040914 100%);
  }
  body[data-hero="false"] #experience,
  body[data-landing-overlays="false"] #experience{
    background:radial-gradient(ellipse at 53% 40%,#10233a 0%,#050e1e 64%,#030713 100%);
  }
  #bbx-loader{
    background:
      radial-gradient(ellipse 42% 57% at 50% 69%,rgba(27,67,103,.16),transparent 79%),
      linear-gradient(140deg,#020916,#041323 56%,#030b1a);
  }
  #bbx-loader .loader-subtitle{color:var(--bbx-cosmic-copy)}
  /* Keep the approved editorial rail legible against the cosmic background.
     Its position and the globe-owned accent remain unchanged. */
  body[data-hero="true"] #hero .hero-copy{
    color:var(--bbx-cosmic-copy);
    font-size:clamp(14px,1.05vw,16px);
    line-height:1.65;
  }
  body[data-hero="true"] #chain-panel:has(#chain-content[hidden]) #chain-toggle small{
    color:var(--bbx-cosmic-copy);
    font-size:13px;
    line-height:1.45;
  }
  body[data-hero="true"] #chain-toggle:focus-visible{
    outline:2px solid var(--bbx-cosmic-focus);
    outline-offset:5px;
  }

  /* Unified silver-edged glass for the brand bar and top-level controls. */
  body #experience > header{
    background:linear-gradient(155deg,rgba(12,28,47,.91),rgba(5,14,29,.91));
    border-bottom:1px solid var(--bbx-cosmic-soft-line);
    box-shadow:inset 0 1px 0 rgba(243,250,255,.09),0 12px 35px rgba(0,8,23,.35);
    backdrop-filter:blur(16px) saturate(130%);
    -webkit-backdrop-filter:blur(16px) saturate(130%);
  }
  body[data-rendering] #experience > header :is(#account-login,#incoterms-open,#bbx-menu-open),
  #journey-register{
    color:var(--bbx-cosmic-text)!important;
    background:linear-gradient(150deg,rgba(36,66,92,.76),rgba(11,27,47,.90))!important;
    border:1px solid var(--bbx-cosmic-line)!important;
    border-radius:9px;
    box-shadow:inset 0 1px 0 rgba(243,250,255,.12),0 8px 23px rgba(0,8,23,.33)!important;
    backdrop-filter:blur(14px) saturate(120%);
    -webkit-backdrop-filter:blur(14px) saturate(120%);
    transition:background .22s ease,border-color .22s ease,box-shadow .22s ease;
  }
  body[data-rendering] #experience > header :is(#account-login,#incoterms-open,#bbx-menu-open):is(:hover,[aria-expanded="true"]),
  #journey-register:hover{
    background:linear-gradient(150deg,rgba(49,83,108,.90),rgba(16,43,67,.94))!important;
    border-color:rgba(201,231,246,.7)!important;
  }
  body[data-rendering] #experience > header :is(#account-login,#incoterms-open,#bbx-menu-open):focus-visible,
  #journey-register:focus-visible{
    outline:2px solid var(--bbx-cosmic-focus)!important;outline-offset:3px;
  }

  /* Menu: same glass family; one changing neon glint, not seven stripes. */
  .bbx-site-menu,
  .account-dialog{
    color:var(--bbx-cosmic-text);
    background:
      radial-gradient(ellipse 90% 44% at 95% -12%,rgba(35,91,130,.23),transparent 76%),
      linear-gradient(155deg,rgba(12,30,50,.96),rgba(5,15,30,.97) 82%);
    border:1px solid var(--bbx-cosmic-line);
    box-shadow:inset 0 1px 0 rgba(244,250,255,.12),0 29px 83px rgba(0,6,21,.67);
    backdrop-filter:blur(22px) saturate(130%);
    -webkit-backdrop-filter:blur(22px) saturate(130%);
  }
  .bbx-site-menu::before{
    height:2px;
    background:linear-gradient(90deg,transparent 5%,var(--bbx-cosmic-active) 50%,transparent 95%);
    box-shadow:0 0 15px color-mix(in srgb,var(--bbx-cosmic-active) 30%,transparent);
  }
  .bbx-menu-head,.account-head{
    background:linear-gradient(110deg,rgba(29,59,82,.24),rgba(6,18,34,.15));
    border-bottom-color:var(--bbx-cosmic-soft-line);
  }
  .bbx-menu-head p,.account-head p:last-child{color:var(--bbx-cosmic-copy)}
  .bbx-menu-eyebrow,.account-eyebrow{color:var(--bbx-cosmic-active)}
  .bbx-site-menu nav section{border-bottom-color:var(--bbx-cosmic-soft-line)}
  .bbx-site-menu nav h3{color:var(--bbx-cosmic-text)}
  .bbx-site-menu nav h3 span,.bbx-menu-disclosure{color:var(--bbx-cosmic-muted)}
  .bbx-site-menu details,
  .account-role-list button,
  .account-profile{
    background:linear-gradient(145deg,rgba(26,53,76,.62),rgba(11,29,49,.67));
    border:1px solid var(--bbx-cosmic-line);
    box-shadow:inset 0 1px 0 rgba(238,247,255,.065);
  }
  .bbx-site-menu details:hover,.account-role-list button:hover{
    border-color:rgba(177,222,242,.57);
    background:linear-gradient(145deg,rgba(36,70,95,.74),rgba(15,37,60,.77));
  }
  .bbx-site-menu details[open]{background:rgba(21,47,68,.84);border-color:rgba(153,217,236,.5)}
  .bbx-site-menu summary,.account-role-list button{color:var(--bbx-cosmic-text)}
  .bbx-site-menu summary:hover{background:rgba(39,77,102,.33)}
  .bbx-site-menu summary::after{color:var(--bbx-cosmic-focus)}
  .bbx-site-menu details p{color:var(--bbx-cosmic-copy)}
  .bbx-site-menu :is(button,summary):focus-visible{outline:2px solid var(--bbx-cosmic-focus)}

  /* Member access: remove copper/peach treatment, keep all disabled states. */
  .account-dialog::backdrop{background:rgba(1,7,19,.75);backdrop-filter:blur(7px)}
  .account-tabs{border-bottom:1px solid var(--bbx-cosmic-soft-line)}
  .account-tabs button,
  .account-signup-entry #account-signup,
  .account-foot button,
  .account-login-preview button,
  #account-close,
  #bbx-menu-close{
    color:var(--bbx-cosmic-text);
    background:linear-gradient(145deg,rgba(33,63,86,.79),rgba(12,31,51,.89));
    border:1px solid var(--bbx-cosmic-line);
    border-radius:9px;
    box-shadow:inset 0 1px 0 rgba(248,252,255,.08);
    transition:background .2s ease,border-color .2s ease,box-shadow .2s ease;
  }
  .account-tabs button:not(:disabled):hover,
  .account-signup-entry #account-signup:hover,
  #account-close:hover,
  #bbx-menu-close:hover{background:rgba(40,78,103,.8);border-color:rgba(188,235,246,.66)}
  .account-tabs button[aria-pressed="true"]{
    color:#f6fbff;
    background:linear-gradient(142deg,rgba(37,85,105,.89),rgba(16,46,72,.95));
    border-color:var(--bbx-cosmic-active);
    box-shadow:inset 0 1px 0 rgba(238,249,255,.14),inset 0 -2px 0 color-mix(in srgb,var(--bbx-cosmic-active) 50%,transparent),0 0 18px rgba(0,229,255,.08);
  }
  .account-hint,.account-foot span,.account-login-note,
  .account-profile p,.account-profile li{color:var(--bbx-cosmic-copy)}
  .account-role-list button span{color:#8edfe7}
  .account-role-list button[aria-pressed="true"]{
    background:linear-gradient(145deg,rgba(26,73,92,.87),rgba(13,43,69,.92));
    border-color:var(--bbx-cosmic-active);
    box-shadow:inset 3px 0 0 var(--bbx-cosmic-active),inset 0 1px 0 rgba(247,252,255,.13);
  }
  .account-profile{border-radius:11px}
  .account-profile .profile-category{color:var(--bbx-cosmic-active)}
  .account-profile h5{color:#dcecf4}
  .account-foot,.account-signup-entry{border-top-color:var(--bbx-cosmic-soft-line)}
  .account-login-preview input{
    color:var(--bbx-cosmic-copy);background:rgba(19,46,67,.77);
    border:1px solid var(--bbx-cosmic-line);border-radius:9px;
  }
  .account-dialog button:disabled{opacity:.66}
  .account-dialog button:not(:disabled):focus-visible,
  .account-login-preview input:focus-visible{outline:2px solid var(--bbx-cosmic-focus);outline-offset:3px}

  /* Incoterms and expanded proof sheet share the exact same glass texture. */
  body[data-hero] #incoterms-panel,
  body[data-hero="true"] #chain-panel:has(#chain-content:not([hidden])){
    background:
      radial-gradient(ellipse 91% 32% at 92% 0%,rgba(48,91,125,.21),transparent 86%),
      linear-gradient(150deg,rgba(13,35,57,.91),rgba(5,17,34,.95));
    border:1px solid var(--bbx-cosmic-line);
    color:var(--bbx-cosmic-text);
    box-shadow:inset 0 1px 0 rgba(243,250,255,.13),0 25px 74px rgba(0,8,23,.62);
    backdrop-filter:blur(20px) saturate(132%);
    -webkit-backdrop-filter:blur(20px) saturate(132%);
  }
  body[data-hero] #incoterms-panel .incoterms-heading{
    background:linear-gradient(115deg,rgba(35,72,99,.75),rgba(9,27,47,.68));
    border-bottom:1px solid var(--bbx-cosmic-soft-line);
  }
  body[data-hero] #incoterms-panel :is(button,input,select),
  .chain-panel .chain-events button{
    background:linear-gradient(145deg,rgba(31,65,89,.8),rgba(11,32,53,.9));
    border:1px solid var(--bbx-cosmic-line);border-radius:9px;
    color:var(--bbx-cosmic-text);
    transition:background .2s ease,border-color .2s ease;
  }
  body[data-hero] #incoterms-panel button:hover,
  .chain-panel .chain-events button:hover{
    background:rgba(40,80,102,.79);border-color:rgba(173,227,244,.68);
  }
  body[data-hero] #incoterms-panel :is(input,select):focus-visible,
  body[data-hero] #incoterms-panel button:focus-visible,
  .chain-panel .chain-events button:focus-visible{outline:2px solid var(--bbx-cosmic-focus);outline-offset:3px}
  #incoterms-panel .incoterms-help,#incoterms-panel .incoterms-notices,
  #incoterms-panel .incoterms-summary,#incoterms-panel dt{color:var(--bbx-cosmic-muted)}
  #incoterms-panel #incoterm-stages li{border-color:var(--bbx-cosmic-soft-line);color:var(--bbx-cosmic-copy)}
  #incoterms-panel #incoterm-stages li[aria-current="step"]{border-color:var(--bbx-cosmic-active);color:#f5fbff}
  #incoterms-panel a{color:#87e9fa}
  .chain-panel .chain-disclosure{color:var(--bbx-cosmic-copy)}

  /* The freight interface follows the same surfaces, not a second theme. */
  @media (min-width:901px){
    body[data-hero="false"] #experience .narrative,
    body[data-hero="false"] #experience .record,
    body[data-hero="false"] #experience footer#journey-dock,
    .process-dock,
    #proof-card{
      background:linear-gradient(145deg,rgba(13,33,53,.88),rgba(5,16,31,.93));
      border-color:var(--bbx-cosmic-line);
      box-shadow:inset 0 1px 0 rgba(239,251,255,.08),0 14px 34px rgba(0,8,22,.46);
      backdrop-filter:blur(16px) saturate(122%);
      -webkit-backdrop-filter:blur(16px) saturate(122%);
    }
    .process-button[aria-current="step"]{border-left-color:var(--bbx-cosmic-active)}
  }
  .record-body .stage-profile-link{
    color:var(--bbx-cosmic-text);background:rgba(18,51,70,.88);
    border-color:var(--bbx-cosmic-line);border-radius:8px;
  }
  .record-body .stage-profile-link:hover{background:rgba(32,78,93,.92)}
  .record-body .stage-profile-link:focus-visible{outline:2px solid var(--bbx-cosmic-focus)}
}

@media (prefers-reduced-motion:reduce){
  .bbx-site-menu :is(button,summary),.account-dialog button,
  #incoterms-panel :is(button,input,select){transition:none}
}

/* Give tablet and wide-phone controls a consistent touch height. */
@media (min-width:481px) and (max-width:900px){
  body[data-hero="true"] #experience > header{gap:8px}
  body[data-hero="true"] #experience > header .bbxn-brand-logo{gap:6px}
  body[data-hero="true"] #experience > header .bbxn-brand-logo__coin{
    width:34px;height:34px;flex-basis:34px;
  }
  body[data-hero="true"] #experience > header .bbxn-brand-logo__wordmark{
    width:clamp(96px,20vw,158px);flex-basis:clamp(96px,20vw,158px);
  }
  body[data-hero="true"] #experience > header :is(#account-login,#incoterms-open,#bbx-menu-open){
    min-height:44px;padding:8px 9px;font-size:11px;white-space:nowrap;
  }
}

/* Compact phones: keep the full brand and all three actions readable and
   reachable. The desktop header and the journey controller stay untouched. */
@media (max-width:480px){
  body[data-hero="true"] #experience > header{
    left:max(12px,env(safe-area-inset-left));
    right:max(12px,env(safe-area-inset-right));
    top:env(safe-area-inset-top);
    height:110px;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1.55fr) minmax(0,1fr);
    grid-template-rows:50px 44px;
    gap:4px 6px;
    align-content:center;
    align-items:center;
  }
  body[data-hero="true"] #experience > header .bbxn-brand-logo{
    grid-column:1 / -1;
    justify-self:start;
  }
  body[data-hero="true"] #experience > header .bbxn-brand-logo__coin{
    width:34px;height:34px;flex-basis:34px;
  }
  body[data-hero="true"] #experience > header .bbxn-brand-logo__wordmark{
    width:133px;flex-basis:133px;
  }
  body[data-hero="true"] #experience > header .account-actions{
    width:100%;min-width:0;margin:0;
  }
  body[data-hero="true"] #experience > header :is(#account-login,#incoterms-open,#bbx-menu-open){
    width:100%;min-width:0;min-height:44px;
    padding:8px 5px;font-size:11px;white-space:nowrap;
  }
  body[data-hero="true"] #hero .hero-editorial{
    top:calc(120px + env(safe-area-inset-top));
  }
  /* Retain the existing no-WebGL status positioning pending ZEFU Z01. */
  body[data-hero="true"][data-rendering="static"] #hero .hero-editorial{
    top:calc(163px + env(safe-area-inset-top));
  }
}

/* Present the existing no-WebGL status separately from the hero text. The
   fallback implementation and navigation remain owned by the 3D workstream. */
@media (min-width:901px){
  body[data-hero="true"][data-rendering="static"] #fallback{
    background:transparent;pointer-events:none;z-index:1;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p{
    position:absolute;left:6%;right:auto;top:45%;bottom:auto;
    width:40%;max-width:420px;margin:0;padding:0;
    color:var(--bbx-cosmic-copy);text-align:left;
    font:400 13px/1.5 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    letter-spacing:0;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p::after{content:none}
}
@media (max-width:900px) and (min-height:501px){
  body[data-hero="true"][data-rendering="static"] #fallback{
    background:transparent;pointer-events:none;z-index:1;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p{
    position:absolute;left:5%;right:5%;top:auto;bottom:14px;
    width:auto;max-width:none;margin:0;padding:0;
    color:var(--bbx-cosmic-copy);text-align:left;
    font:400 11px/1.45 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    letter-spacing:0;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p::after{content:none}
  body[data-hero="true"][data-rendering="static"] #experience .hero-global-vision{
    bottom:76px;
  }
}

/* Wide, short screens need a compact editorial rail. It remains separate
   from the illustration and does not change the scene or its playback. */
@media (min-width:481px) and (max-width:900px) and (max-height:500px){
  body[data-hero="true"] #hero .hero-editorial,
  body[data-hero="true"][data-rendering="static"] #hero .hero-editorial{
    top:82px;left:auto;right:4%;width:48%;
  }
  body[data-hero="true"] #hero #hero-title{
    font-size:clamp(23px,4vw,31px);line-height:1.03;margin-bottom:8px;
  }
  body[data-hero="true"] #hero .hero-copy{font-size:11px;line-height:1.4}
  body[data-hero="true"] #chain-panel:has(#chain-content[hidden]){
    right:4%;width:48%;padding-top:7px;
  }
  body[data-hero="true"] #chain-panel:has(#chain-content[hidden]) #chain-toggle{
    min-height:46px;font-size:18px;
  }
  body[data-hero="true"] #chain-panel:has(#chain-content[hidden]) #chain-toggle small{
    margin-top:3px;font-size:11px;
  }
  body[data-hero="true"][data-rendering="static"] #fallback{
    background:transparent;pointer-events:none;z-index:1;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p{
    position:absolute;left:5%;right:auto;top:100px;bottom:auto;
    width:37%;max-width:none;margin:0;padding:0;
    color:var(--bbx-cosmic-copy);text-align:left;
    font:400 11px/1.45 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    letter-spacing:0;
  }
  body[data-hero="true"][data-rendering="static"] #fallback p::after{content:none}
}

@media (max-width:900px){
  /* The inactive journey panel must not leave a scrollbar across the hero. */
  body[data-landing-overlays="true"] #journey-panel{scrollbar-width:none}
  body[data-landing-overlays="true"] #journey-panel::-webkit-scrollbar{display:none}
}
