/* This shared header layer wins over historical page-specific stack rules.
   1280 CSS px is the desktop floor, independent of translated text width. */
@media (min-width:1280px) {
 body.ultima-partner-page:not(.vr-phone) {
  --vr-desktop-max:1680px; --vr-desktop-height:131px; --vr-desktop-inner:130px;
  --vr-desktop-padding:0 20px; --vr-desktop-gap:20px; --vr-desktop-logo:100px;
  --vr-desktop-list-gap:25px; --vr-desktop-nav-margin:0 28px 0 0;
 }
 body:not(.vr-phone) header :is(.header-container, .ultima-partner-header-container) {
  display:flex !important; flex-flow:row nowrap !important; align-items:center !important;
  justify-content:space-between !important; text-align:initial !important;
  width:calc(100% - 32px) !important; max-width:var(--vr-desktop-max,1240px) !important;
  height:var(--vr-desktop-inner,84px) !important; min-height:var(--vr-desktop-inner,84px) !important; box-sizing:border-box !important;
  padding:var(--vr-desktop-padding,8px clamp(16px,1.5vw,28px)) !important; gap:var(--vr-desktop-gap,clamp(24px,4vw,64px)) !important;
 }
 body:not(.vr-phone) header { height:var(--vr-desktop-height,85px) !important; min-height:var(--vr-desktop-height,85px) !important; }
 body:not(.vr-phone) header :is(.logo, .ultima-partner-logo) { flex:0 0 auto !important; margin:0 !important; }
 body:not(.vr-phone) header :is(.logo, .ultima-partner-logo) > a { display:flex !important; align-items:center !important; flex-wrap:nowrap !important; white-space:nowrap !important; }
 body:not(.vr-phone) header :is(.logo-img, .ultima-partner-logo-img) { width:var(--vr-desktop-logo,68px) !important; height:var(--vr-desktop-logo,68px) !important; max-height:var(--vr-desktop-logo,68px) !important; transition:none !important; }
 body:not(.vr-phone) header .ultima-partner-brand-main { margin:14px 0 0 -18px !important; }
 body:not(.vr-phone) header .logo-text-group { margin-block:0 !important; }
 body:not(.vr-phone) header nav { position:static !important; display:flex !important; flex:1 1 auto !important; min-width:0 !important; width:auto !important; height:auto !important; margin:var(--vr-desktop-nav-margin,0) !important; padding:0 !important; align-items:center !important; transform:none !important; visibility:visible !important; }
 body:not(.vr-phone) header nav > ul { display:flex !important; flex-flow:row nowrap !important; align-items:center !important; justify-content:flex-end !important; width:100% !important; padding:0 !important; margin:0 !important; gap:var(--vr-desktop-list-gap,clamp(14px,1.3vw,24px)) !important; }
 body:not(.vr-phone) header nav > ul > li { flex:0 0 auto !important; min-width:max-content !important; max-width:none !important; }
 html[lang] body:not(.vr-phone) header nav > ul > li > :is(a,button) { white-space:nowrap !important; word-break:normal !important; overflow-wrap:normal !important; }
 body:not(.vr-phone) header :is(.vanrex-nav-toggle,.ultima-partner-nav-toggle) { display:none !important; }
}
/* Give translated desktop headings room without changing the layout mode.
   These rules never apply to the existing phone/tablet drawer. */
@media (min-width:1280px) {
 body:not(.vr-phone) header :is(.header-container, .ultima-partner-header-container) {
  max-width:1680px !important;
  padding-inline:clamp(8px,1vw,20px) !important;
  column-gap:clamp(12px,1.5vw,28px) !important;
 }
 body:not(.vr-phone) header nav { margin-inline:0 !important; }
 body:not(.vr-phone) header nav > ul { column-gap:clamp(8px,.8vw,16px) !important; }
 html[lang] body:not(.vr-phone) header nav > ul > li > :is(a,button) {
  font-size:clamp(13px,.95vw,16px) !important;
  padding-inline:clamp(4px,.45vw,8px) !important;
  letter-spacing:normal !important;
 }
}
/* Keep the fixed partner header's existing content offset in sync with its height. */
body.ultima-partner-page:not(.vr-phone) { --up-header-height:131px !important; }
body.ultima-partner-page.vr-phone { --up-header-height:var(--vr-phone-height) !important; }

/* Shared responsive header: single-row desktop or the confirmed compact drawer. */

 body.vr-phone { --vr-phone-height:66px; }
 body.vr-phone.vr-phone-open { overflow:hidden !important; }
 body.vr-phone .vr-phone-header { height:var(--vr-phone-height) !important; min-height:var(--vr-phone-height) !important; background:#030303 !important; z-index:100003 !important; }
 body.vr-phone .vr-phone-container { width:100% !important; max-width:none !important; height:var(--vr-phone-height) !important; min-height:var(--vr-phone-height) !important; padding:9px 14px !important; margin:0 !important; display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:flex-start !important; gap:10px !important; box-sizing:border-box !important; }
 body.vr-phone .vr-phone-logo { margin:0 auto 0 0 !important; min-width:0 !important; flex:0 1 auto !important; }
 body.vr-phone .vr-phone-logo a { display:flex !important; align-items:center !important; gap:6px !important; min-width:0 !important; }
 body.vr-phone .vr-phone-logo img { width:44px !important; height:44px !important; max-height:44px !important; object-fit:contain !important; }
 body.vr-phone .vr-phone-logo .ultima-partner-brand-main { font-size:1.05rem !important; letter-spacing:1px !important; margin:7px 0 0 -6px !important; }
 body.vr-phone .vr-phone-actions { display:flex !important; align-items:center !important; gap:7px !important; flex:0 0 auto !important; direction:ltr !important; }
 body.vr-phone .vr-phone-actions > .vr-phone-picker,
 body.vr-phone .vr-phone-actions > .vr-phone-toggle { position:relative !important; inset:auto !important; width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; flex:0 0 44px !important; margin:0 !important; padding:10px !important; display:flex !important; align-items:center !important; justify-content:center !important; color:#f3c623 !important; border:1px solid rgba(243,198,35,.42) !important; border-radius:8px !important; background:#17140c !important; box-sizing:border-box !important; z-index:100005 !important; list-style:none !important; visibility:visible !important; cursor:pointer; }
 body.vr-phone .vr-phone-picker > button { display:flex !important; justify-content:center !important; align-items:center !important; width:100% !important; height:100% !important; padding:0 !important; margin:0 !important; border:0 !important; background:transparent !important; color:inherit !important; }
 body.vr-phone .vr-phone-picker svg { width:22px !important; height:22px !important; flex:none !important; }
 body.vr-phone .vr-phone-toggle { flex-direction:column !important; gap:5px !important; }
 body.vr-phone .vr-phone-toggle span { display:block !important; width:21px !important; height:2px !important; flex:none !important; margin:0 !important; border:0 !important; background:currentColor !important; transform:none !important; opacity:1 !important; }
 body.vr-phone.vr-phone-open .vr-phone-toggle span:nth-child(1) { transform:translateY(7px) rotate(45deg) !important; }
 body.vr-phone.vr-phone-open .vr-phone-toggle span:nth-child(2) { opacity:0 !important; }
 body.vr-phone.vr-phone-open .vr-phone-toggle span:nth-child(3) { transform:translateY(-7px) rotate(-45deg) !important; }
 body.vr-phone .vr-phone-nav { position:fixed !important; top:var(--vr-phone-height) !important; right:0 !important; bottom:0 !important; left:auto !important; width:min(88vw,380px) !important; max-width:calc(100vw - 36px) !important; height:auto !important; max-height:none !important; margin:0 !important; padding:14px 14px 22px !important; overflow-x:hidden !important; overflow-y:auto !important; overscroll-behavior:contain; background:linear-gradient(155deg,#17140c 0%,#090909 32%,#030303 100%) !important; border:0 !important; border-left:1px solid rgba(243,198,35,.42) !important; box-shadow:-18px 0 48px rgba(0,0,0,.75) !important; transform:translateX(105%) !important; visibility:hidden !important; transition:transform .28s ease,visibility 0s linear .28s !important; box-sizing:border-box !important; z-index:100002 !important; }
 body.vr-phone.vr-phone-open .vr-phone-nav { visibility:visible !important; transform:none !important; transition:transform .28s ease !important; }
 body.vr-phone .vr-phone-nav > ul { width:100% !important; max-width:none !important; padding:0 !important; margin:0 !important; display:flex !important; flex-flow:column nowrap !important; align-items:stretch !important; justify-content:flex-start !important; gap:7px !important; list-style:none !important; }
 body.vr-phone .vr-phone-nav > ul > li { display:block !important; width:100% !important; min-width:0 !important; min-height:0 !important; margin:0 !important; padding:0 !important; }
 body.vr-phone .vr-phone-nav > ul > li > a,
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group > .vr-phone-heading { display:flex !important; align-items:center !important; justify-content:flex-start !important; gap:0 !important; width:100% !important; min-width:0 !important; min-height:48px !important; height:auto !important; margin:0 !important; padding:12px 14px !important; font-family:inherit !important; font-size:.96rem !important; font-weight:700 !important; line-height:1.45 !important; text-align:left !important; white-space:normal !important; word-break:normal !important; overflow-wrap:anywhere !important; color:#f6f2e8 !important; background:rgba(255,255,255,.035) !important; border:1px solid rgba(255,255,255,.07) !important; border-radius:8px !important; box-shadow:none !important; text-decoration:none !important; box-sizing:border-box !important; transition:none !important; cursor:pointer; }
 body.vr-phone .vr-phone-nav .vr-phone-heading > .arrow { display:none !important; }
 body.vr-phone .vr-phone-nav .vr-phone-heading::after { content:'▼' !important; color:#dedbd2 !important; font-size:10px !important; margin-left:auto !important; padding-left:12px !important; transform:none !important; flex-shrink:0; }
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group[data-vr-expanded] > .vr-phone-heading { background:linear-gradient(100deg,#443722,#30291e) !important; box-shadow:inset 2px 0 0 #c1a15a !important; color:#dbc080 !important; }
 body.vr-phone .vr-phone-nav .vr-phone-group[data-vr-expanded] > .vr-phone-heading::after { content:'▲' !important; color:#f3c623 !important; }
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group > .vr-phone-submenu { display:none !important; position:static !important; width:100% !important; min-width:0 !important; max-width:100% !important; height:auto !important; max-height:none !important; margin:0 0 3px !important; padding:4px 0 !important; overflow:visible !important; opacity:1 !important; visibility:visible !important; pointer-events:auto !important; transform:none !important; background:linear-gradient(100deg,#302b20,#25231d) !important; border:0 !important; border-radius:0 0 8px 8px !important; box-shadow:none !important; box-sizing:border-box !important; gap:0 !important; }
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group[data-vr-expanded] > .vr-phone-submenu { display:flex !important; flex-direction:column !important; }
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group > .vr-phone-submenu > a { display:block !important; width:100% !important; min-width:0 !important; min-height:44px !important; padding:11px 14px !important; margin:0 !important; font-size:.88rem !important; line-height:1.5 !important; font-weight:600 !important; text-align:left !important; white-space:normal !important; overflow-wrap:anywhere !important; word-break:normal !important; color:#dedbd2 !important; background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; text-decoration:none !important; box-sizing:border-box !important; }
 body.vr-phone .vr-phone-nav > ul > .vr-phone-group > .vr-phone-submenu > a + a { border-top:1px solid rgba(207,183,119,.18) !important; }
 body.vr-phone .vr-phone-picker .lang-dropdown,
 body.vr-phone .vr-phone-picker .ultima-partner-lang-dropdown { position:fixed !important; top:var(--vr-phone-height) !important; right:10px !important; left:auto !important; width:min(286px,calc(100vw - 28px)) !important; max-height:calc(100dvh - var(--vr-phone-height) - 16px) !important; overflow-y:auto !important; overflow-x:hidden !important; transform:none !important; z-index:100006 !important; }
@media (max-width:430px) {
 body.vr-phone { --vr-phone-height:62px; }
 body.vr-phone .vr-phone-container { padding:8px 10px !important; gap:7px !important; }
 body.vr-phone .vr-phone-logo img { width:38px !important; height:38px !important; max-height:38px !important; }
 body.vr-phone .vr-phone-logo .ultima-partner-brand-main { font-size:.93rem !important; letter-spacing:.7px !important; }
 body.vr-phone .vr-phone-nav { width:min(91vw,350px) !important; max-width:calc(100vw - 24px) !important; }
}
@media (prefers-reduced-motion:reduce) { body.vr-phone .vr-phone-nav { transition:none !important; } }

/* Open mobile/tablet menu owns the viewport, independent of page layout. */
html.vr-scroll-locked { overflow:hidden !important; overscroll-behavior:none !important; }
html.vr-scroll-locked body { position:fixed !important; top:var(--vr-lock-y) !important; left:0 !important; right:0 !important; width:100% !important; overflow:hidden !important; overscroll-behavior:none !important; }
body.vr-phone .vr-phone-nav { display:none !important; transform:none !important; transition:none !important; }
body.vr-phone .vr-phone-overlay { position:fixed !important; inset:0 !important; width:100% !important; max-width:none !important; height:100% !important; height:100dvh !important; max-height:none !important; margin:0 !important; padding:0 !important; border:0 !important; box-sizing:border-box !important; overflow:hidden !important; background:#030303 !important; color:inherit !important; z-index:2147483647 !important; overscroll-behavior:none !important; }
body.vr-phone .vr-phone-overlay[hidden] { display:none !important; }
body.vr-phone .vr-phone-overlay::backdrop { background:#030303; }
body.vr-phone.vr-phone-open .vr-phone-overlay > .vr-phone-header { position:absolute !important; inset:0 0 auto !important; width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; transform:none !important; filter:none !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
body.vr-phone.vr-phone-open .vr-phone-overlay > .vr-phone-nav { display:block !important; position:absolute !important; inset:var(--vr-phone-height) 0 0 !important; width:100% !important; max-width:none !important; min-width:0 !important; min-height:0 !important; height:auto !important; margin:0 !important; padding:14px 14px max(22px,env(safe-area-inset-bottom)) !important; border:0 !important; box-shadow:none !important; visibility:visible !important; transform:none !important; overflow-x:hidden !important; overflow-y:auto !important; overscroll-behavior:none !important; touch-action:pan-y !important; -webkit-overflow-scrolling:touch; }
body.vr-phone .vr-phone-overlay .vr-phone-nav > ul { position:static !important; inset:auto !important; height:auto !important; min-height:0 !important; transform:none !important; }

/* Phase 4A: translated menus wrap and remain scrollable inside the viewport. */
header :is(.dropdown-content, .ultima-partner-dropdown-content, .lang-dropdown, .ultima-partner-lang-dropdown) {
    /* Viewport clamping is immediate; only the existing reveal animation transitions. */
    transition-property: opacity, visibility, transform !important;
}
header :is(.lang-dropdown, .ultima-partner-lang-dropdown) {
    max-width: calc(100vw - 28px) !important;
    max-height: min(420px, calc(100dvh - 110px)) !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}
header :is(.lang-option, .ultima-partner-lang-option) { min-width: 0; gap: 8px; white-space: normal; }
header :is(.lang-name, .ultima-partner-lang-option > span:first-child) { min-width: 0; overflow-wrap: break-word; }
header :is(.lang-check, .ultima-partner-lang-check) { flex-shrink: 0; }
@media(min-width:1280px) {
    header nav > ul > li:is(.dropdown, .ultima-partner-dropdown) > :is(.dropdown-content, .ultima-partner-dropdown-content) {
        max-height: calc(100dvh - 130px) !important;
        overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    }
}
html[dir="rtl"] body { text-align: start; }
/* Preserve chart axes and literal account data; translations keep their own direction. */
html[dir="rtl"] canvas { direction: ltr; }
html[dir="rtl"] header :is(.dropdown-content a, .ultima-partner-dropdown-content a),
html[dir="rtl"] body.vr-phone .vr-phone-nav :is(a, .vr-phone-heading) { text-align: start !important; direction: rtl; }
html[dir="rtl"] body.vr-phone .vr-phone-logo { margin: 0 0 0 auto !important; }
html[dir="rtl"] body.vr-phone .vr-phone-nav .vr-phone-heading::after { margin-left: 0 !important; margin-right: auto !important; padding-left: 0 !important; padding-right: 12px; }

/* VANREX navbar logo 20261006: complete uploaded wordmark, scoped to header. */
header { --vr-navbar-logo-ready: 1; }
body header :is(.logo, .ultima-partner-logo).vr-navbar-brand {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: clamp(156px, 14vw, 204px) !important;
    max-width: 100% !important;
    transition: none !important;
}
body header :is(.logo, .ultima-partner-logo).vr-navbar-brand > a {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 0 !important;
}
body header :is(.logo, .ultima-partner-logo).vr-navbar-brand img.vr-navbar-logo {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    aspect-ratio: 2048 / 682;
    object-fit: contain !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    transition: none !important;
}
body header .vr-navbar-brand :is(.logo-text-group, .ultima-partner-brand-main) {
    display: none !important;
}
@media (max-width: 1279px) {
    body header :is(.logo, .ultima-partner-logo).vr-navbar-brand {
        width: clamp(116px, 30vw, 144px) !important;
    }
}
