/* ==========================================================================
   fix 5 Part 3 (bonfium-fix5/PROMPT.md, board HEADER.png): one header, one pop-up.
   Loaded on every page by fix3_head() (app/fix3.php), last in the head. No switch.

   1. The header (bf_header() in app/v4.php): the same items in both shells, the v3/v4 pages' fixed bar
      (.v3-hdr) and the home page's and older pages' bar (.bf-nav-shell). 52 px bar, 15 px text, 30 px between
      items, no centred link group; phones: the logo, a 36 px Start a trade and a 36 px round glass menu button.
      Start a trade and every pop-up are the header pill's liquid glass (Vilius, 12 Oct evening).
   2. .bf-pop: every pop-up and menu (Have a code?, language, the avatar menu, the bell panel, the account pages'
      language sheet, the phone sheet). The pill glass, one rhythm (16 forms / 8 lists, 12 between form blocks,
      2 between rows), one-column lists, the selected row tinted (never ink, never a ring).
      Placement and closing: assets/fix5/pop.js. On phones every pop-up is a bottom sheet; the menu is a top sheet.
   The "Have a code?" field itself: assets/fix3/code.css.
   ========================================================================== */

:root{
  /* Vilius, 12 Oct evening: every pop-up is the header pill's own liquid glass (assets/navigation.css, assets/fix3/glass.css --pill-*) */
  --bfp-bg:var(--pill-bg,rgba(255,255,255,.16));
  --bfp-filter:var(--pill-filter,blur(20px) saturate(1.7));
  --bfp-shadow:var(--pill-edge,inset 0 1px 0 rgba(255,255,255,.55),inset 0 0 0 1px rgba(255,255,255,.12)),var(--pill-shadow,0 10px 28px -14px rgba(15,21,25,.28));
  --bfp-ink:#0E1417;
  --bfp-sub:rgba(14,20,23,.68);   /* on the clear glass a tint of ink, not a fixed grey, so it darkens with the ground */
  --bfp-sel:rgba(14,20,23,.06);
  --bfp-hover:rgba(14,20,23,.04);
}

/* ---------------------------------------------------------------- 1. the header */

/* the bar: 52 px, 30 px between items, the logo left and everything else right */
html body .v3-hdr .nav.bf-hdr,
html body .bf-nav-shell .bf-nav.bf-hdr{display:flex;align-items:center;gap:30px;height:52px;min-height:52px;max-width:min(1200px,calc(100% - 48px));
  padding:0 6px 0 24px;box-sizing:border-box;font-family:var(--text,'Instrument Sans',system-ui,sans-serif)}
html body .bf-nav-shell .bf-nav.bf-hdr{grid-template-columns:none}
/* every page's pill has the home pill's girth: 60 px, as the scrolled home bar (navigation.css:79) (Vilius, 12 Oct:
   "match the width girth to that on homepage pill menu"). The bar is fixed, so nothing below it moves. Phones keep 52. */
html body .v3-hdr .nav.bf-hdr{height:60px;min-height:60px}
html body .bf-nav-shell .bf-hdr{color:var(--bf-nav-ink,#0E1417)}
.bf-hdr .logo,.bf-hdr .bf-nav-logo{flex:none}
.bf-hdr-links{display:flex;align-items:center;gap:30px;min-width:0}
.bf-hdr-r{display:flex;align-items:center;gap:30px;margin-left:auto;flex:none}
/* Every header, signed in or out, home, public and private (Vilius, 13 Oct): the text items (Trades · Money · Rewards ·
   Help, or Pricing · Have a code? · EN · Log in) in the exact middle of the pill, the logo left, the actions right and
   close together. A grid, so the sides can never overlap the middle; the pill's 24/6 padding is evened out with left. */
@media (min-width:761px){
  html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr):has(>.bf-hdr-links){display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr):has(>.bf-hdr-links)>:is(.logo,.bf-nav-logo){justify-self:start}
  html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr):has(>.bf-hdr-links)>.bf-hdr-r{justify-self:end;margin-left:0}
  /* signed in: bell · New trade · avatar close together; signed out, EN · Log in · Start a trade keep the 30 px rhythm */
  html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr)>.bf-hdr-r:has(>.bf-hdr-acct){gap:12px}
  html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr)>.bf-hdr-links{position:relative;left:-9px}
}
@media (min-width:761px) and (max-width:900px){html body :is(.v3-hdr .nav.bf-hdr,.bf-nav-shell .bf-nav.bf-hdr)>.bf-hdr-links{left:-5px}}
/* the 6 px right inset is for a pill (Start a trade, the avatar); a text item ending the row (New trade hides the CTA,
   so "Log in" is last) gets the logo's 24 px instead (Vilius, 12 Oct: "look how its off the log in") */
.bf-hdr-r>.bf-hdr-i:last-child{margin-right:18px}

/* text items: Pricing, Have a code?, EN, Log in, and the signed-in Trades · Money · Rewards · Help */
html body .bf-hdr .bf-hdr-i{display:inline-flex;align-items:center;gap:4px;height:40px;margin:0;padding:0;border:0;border-radius:0;background:none;
  color:inherit;font:500 0.9375rem/1 var(--text,'Instrument Sans',system-ui,sans-serif);letter-spacing:0;text-decoration:none;white-space:nowrap;cursor:pointer;
  transition:opacity .15s ease-out}
html body .bf-hdr .bf-hdr-i:hover{opacity:.72}
html body .bf-hdr .bf-hdr-lang svg{opacity:.8}
/* the page you are on (signed in): a soft pill that keeps the 30 px rhythm */
html body .bf-hdr .bf-hdr-links .bf-hdr-i[aria-current="page"]{margin:0 -14px;padding:0 14px;border-radius:999px;background:rgba(14,20,23,.06);opacity:1}

/* the one ink pill: Start a trade / New trade (Vilius, 12 Oct evening: the top button stays as it was) */
html body .bf-hdr-cta{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;padding:0 18px;border:0;border-radius:999px;flex:none;
  background:var(--bfp-ink);color:#fff;font:600 0.9375rem/1 var(--text,'Instrument Sans',system-ui,sans-serif);text-decoration:none;white-space:nowrap;
  box-shadow:0 8px 20px -12px rgba(14,20,23,.45);transition:background-color .15s ease-out}
html body .bf-hdr-cta:hover{background:#26303A;color:#fff}

/* the bell and the avatar */
html body .bf-hdr-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:999px;flex:none;color:inherit}
html body .bf-hdr-bell .dot{position:absolute;top:9px;right:10px;width:6px;height:6px;border-radius:50%;background:currentColor}
html body .bf-hdr-bell[aria-current="page"],html body .bf-hdr-bell[aria-expanded="true"]{background:rgba(14,20,23,.06)}
html body .bf-hdr-acct{display:inline-flex;align-items:center;gap:8px;height:40px;padding:4px 12px 4px 4px;border:0;border-radius:999px;flex:none;cursor:pointer;
  background:transparent;color:inherit;font:500 0.9375rem/1 var(--text,'Instrument Sans',system-ui,sans-serif);white-space:nowrap}
html body .bf-hdr-acct:hover,html body .bf-hdr-acct[aria-expanded="true"]{background:rgba(14,20,23,.06)}
html body .bf-hdr-acct .ini{width:32px;height:32px;border-radius:50%;flex:none;display:inline-flex;align-items:center;justify-content:center;
  font:400 0.8125rem/1 var(--display,'Outfit',system-ui,sans-serif);background:var(--bfp-ink);color:#fff}

/* on a field (at rest over a colour field or the home hero): white text, glass chips */
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) .bf-hdr-links .bf-hdr-i[aria-current="page"],
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) :is(.bf-hdr-bell[aria-current="page"],.bf-hdr-bell[aria-expanded="true"]){background:rgba(255,255,255,.22)}
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) .bf-hdr-acct{background:rgba(255,255,255,.16);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 0 0 1px rgba(255,255,255,.18)}
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) .bf-hdr-acct:hover,
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) .bf-hdr-acct[aria-expanded="true"]{background:rgba(255,255,255,.26)}
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) .bf-hdr-acct .ini{background:rgba(255,255,255,.92);color:var(--bfp-ink)}

/* white text on a light field (a pale photo, the /plans field): a soft shadow under the words and in the glass pill */
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) :is(.bf-hdr-i){text-shadow:0 1px 2px rgba(14,20,23,.3)}
@media (max-width:1023px){html body .bf-nav-shell.bf-hdr-auth:not(.bf-nav-scrolled) :is(.bf-hdr-i){text-shadow:0 1px 2px rgba(14,20,23,.3)}}

/* narrower desktops: the same items, closer */
@media (max-width:1100px){
  html body .v3-hdr .nav.bf-hdr,html body .bf-nav-shell .bf-nav.bf-hdr,.bf-hdr-links,.bf-hdr-r{gap:22px}
  html body .bf-hdr .bf-hdr-links .bf-hdr-i[aria-current="page"]{margin:0 -11px;padding:0 11px}
  html body .bf-hdr-acct{padding-right:4px}
  html body .bf-hdr-acct>span:last-child{display:none}
}
@media (max-width:900px){
  html body .v3-hdr .nav.bf-hdr,html body .bf-nav-shell .bf-nav.bf-hdr{max-width:calc(100% - 20px);padding:0 6px 0 16px}
  html body .v3-hdr .nav.bf-hdr,html body .bf-nav-shell .bf-nav.bf-hdr,.bf-hdr-links,.bf-hdr-r{gap:18px}
  html body .bf-hdr .bf-hdr-links .bf-hdr-i[aria-current="page"]{margin:0 -9px;padding:0 9px}
  .bf-hdr-r>.bf-hdr-i:last-child{margin-right:10px}
  /* signed in, the narrowest desktops: New trade keeps its plus, the words stay for screen readers */
  html body .bf-hdr-r .bf-hdr-cta>span{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html body .bf-hdr-r .bf-hdr-cta:has(>span){width:40px;padding:0}
}

/* ---------- phones (3.2): the logo, Start a trade (36 px, ink) and the 36 px round glass menu button ---------- */
html body .bf-nav .bf-hdr-m{display:none}
.bf-hdr-m{align-items:center;gap:8px}
html body .bf-hdr-cta.bf-hdr-cta--sm{position:relative;height:36px;padding:0 14px;font-size:0.9375rem;box-shadow:none}
html body .bf-hdr-menu,html body .bf-hdr-me{position:relative;width:36px;height:36px;border-radius:50%;flex:none;display:inline-flex;align-items:center;justify-content:center;
  margin:0;padding:0;border:0;cursor:pointer;color:var(--bfp-ink);background:rgba(14,20,23,.06);font:400 0.875rem/1 var(--display,'Outfit',system-ui,sans-serif);
  transition:background-color .15s ease-out}
html body .bf-hdr-me{background:var(--bfp-ink);color:#fff}
/* 44 px to touch, 36 px to see */
html body :is(.bf-hdr-cta--sm,.bf-hdr-menu,.bf-hdr-me)::after{content:"";position:absolute;inset:-4px}
html body :is(.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled)) :is(.bf-hdr-menu,.bf-hdr-me){color:#fff;background:rgba(255,255,255,.16);
  -webkit-backdrop-filter:blur(20px) saturate(1.7);backdrop-filter:blur(20px) saturate(1.7);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 0 0 1px rgba(255,255,255,.2)}
html body :is(.bf-hdr-menu,.bf-hdr-me)[aria-expanded="true"]{background:var(--bfp-ink)!important;color:#fff!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:none!important}
html body .v3-mtop .bf-hdr-bell,html body .bf-hdr-m .bf-hdr-bell{width:44px;height:44px;background:none}
html body .v3-mtop .bf-hdr-bell .dot,html body .bf-hdr-m .bf-hdr-bell .dot{top:11px;right:12px}

@media (max-width:760px){
  html body .bf-nav-shell .bf-nav.bf-hdr{height:52px;min-height:52px;max-width:calc(100% - 20px);padding:0 8px 0 14px;gap:8px}
  html body .bf-nav-shell .bf-nav.bf-hdr .bf-nav-logo svg{width:87px;height:42px;margin-left:-4px}
  html body .bf-nav .bf-hdr-r,html body .bf-nav .bf-hdr-links{display:none}
  html body .bf-nav .bf-hdr-m{display:flex;margin-left:auto}
  html body .v3-hdr .nav.bf-hdr{display:none}
  html body .v3-hdr .v3-mtop{height:52px;padding:0 8px 0 14px}
  html body .v3-hdr .v3-mtop .mright.bf-hdr-m{display:flex;gap:8px}
}

/* ---------------------------------------------------------------- 2. .bf-pop */

html body .bf-pop{position:fixed;z-index:1000;box-sizing:border-box;margin:0;border:0!important;border-radius:20px;
  background:var(--bfp-bg)!important;-webkit-backdrop-filter:var(--bfp-filter)!important;backdrop-filter:var(--bfp-filter)!important;
  box-shadow:var(--bfp-shadow)!important;color:var(--bfp-ink)!important;
  font:400 0.9375rem/1.35 var(--text,'Instrument Sans',system-ui,sans-serif);text-align:left;text-shadow:none;
  opacity:0;transform:translateY(-6px);transition:opacity .16s ease-out,transform .16s ease-out}
html body .bf-pop.is-open{opacity:1;transform:none}
html body .bf-pop[hidden],.bfp-scrim[hidden],.bfp-view[hidden]{display:none!important}
html body .bf-pop *{box-sizing:border-box}
html body .bf-pop a{color:inherit;text-decoration:none}

/* one rhythm: 16 for forms, 8 for lists; 12 between form blocks, 2 between rows */
html body .bf-pop--form{width:300px;padding:16px}
html body .bf-pop--list{padding:8px}
/* fix 6 Part 5: sized to its content, no fixed max-height. All 12 languages fit at 1440×900 (the list is 546 px).
   Only a viewport shorter than the pop-up caps it (pop.js sets --bfp-top as it places it), and then it scrolls with
   no scrollbar (the rule under "no scrollbar anywhere" below). */
html body .bf-pop{max-height:calc(100vh - var(--bfp-top,84px) - 12px);overflow:auto;overscroll-behavior:contain}
html body .bf-pop--lang{width:240px}
html body .bf-pop--acct{width:280px}
html body .bf-pop--bell{width:520px;max-height:calc(100vh - 120px);overflow:auto;overscroll-behavior:contain}
.bfp-list{display:flex;flex-direction:column;gap:2px;margin:0;padding:0}
/* the language rows (bf_langs() in app/v4.php): one column, evenly spaced, each row one line */
.bfp-langs{display:flex;flex-direction:column;gap:2px;margin:0;padding:0}
html body .bf-pop .bfp-label{margin:0;padding:6px 12px 4px;font:400 0.75rem/1.3 var(--text,'Instrument Sans',system-ui,sans-serif);color:var(--bfp-sub)}

/* rows: one column, 40 px (52 on phones), padding 0 12, radius 12 */
html body .bf-pop .bfp-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:40px;min-height:40px;margin:0;padding:0 12px;
  border:0;border-radius:12px;background:transparent;color:inherit;font:400 0.9375rem/1.2 var(--text,'Instrument Sans',system-ui,sans-serif);
  text-align:left;text-decoration:none;cursor:pointer;outline:none;box-shadow:none;transition:background-color .12s ease-out}
html body .bf-pop .bfp-row>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .bf-pop .bfp-row:hover{background:var(--bfp-hover)}
/* the selected row: a soft tint, 600 and a check. Never an ink fill, an outline or a second ring. */
html body .bf-pop .bfp-row:is(.is-on,[aria-current="page"],[aria-current="true"]){background:var(--bfp-sel);font-weight:600;color:inherit}
html body .bf-pop .bfp-row svg{flex:none}
html body .bf-pop .bfp-row-v{display:inline-flex;align-items:center;gap:4px;flex:none;color:var(--bfp-sub);font-weight:400}
html body .bf-pop .bfp-back{justify-content:flex-start;gap:8px;font-weight:600}
html body .bf-pop .bfp-hr{height:1px;margin:0 12px;background:rgba(14,20,23,.08);flex:none}
html body .bf-pop .bfp-out{margin:0;padding:0}
html body .bf-pop .bfp-who{display:flex;align-items:center;gap:12px;padding:8px 12px;min-width:0}
html body .bf-pop .bfp-who .av{width:40px;height:40px;border-radius:50%;flex:none;display:inline-flex;align-items:center;justify-content:center;
  font:400 0.875rem/1 var(--display,'Outfit',system-ui,sans-serif);background:var(--bfp-ink)!important;color:#fff!important}
html body .bf-pop .bfp-who>span{min-width:0}
html body .bf-pop .bfp-who b{display:block;font-weight:600;font-size:0.9375rem}
html body .bf-pop .bfp-who span span{display:block;font-size:0.8125rem;color:var(--bfp-sub)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bfp-sr{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}

/* the bell panel's rows (assets/fix3/private.css .f3-bellpanel) sit straight on the list padding */
html body .bf-pop--bell .f3a-ph{padding:6px 12px 10px}

/* Language slides in, one level in; back slides out */
@media (prefers-reduced-motion:no-preference){
  .bfp-view.bfp-in{animation:bf-slide-in .16s ease-out}
  .bfp-view.bfp-back-in{animation:bf-slide-back .16s ease-out}
}
@keyframes bf-slide-in{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:none}}
@keyframes bf-slide-back{from{opacity:0;transform:translateX(-12px)}to{opacity:1;transform:none}}

/* ---------- the phone sheet (3.2): from the top, the logo and a close button, 52 px rows, a full-width ink button ---------- */
html body .bfp-sheet{top:10px;left:10px;right:10px;width:auto;max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain;border-radius:24px}
html body .bfp-sheet .bfp-sheet-top{display:flex;align-items:center;justify-content:space-between;height:52px;padding:0 4px 0 12px;margin-bottom:2px}
html body .bfp-sheet .bfp-sheet-logo{display:block;height:42px}
html body .bfp-sheet .bfp-sheet-logo img{display:block;height:42px;width:auto;margin-left:-4px}
html body .bfp-sheet .bfp-sheet-x{position:relative;width:36px;height:36px;border-radius:50%;border:0;padding:0;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(14,20,23,.06);color:var(--bfp-ink);cursor:pointer}
html body .bfp-sheet .bfp-sheet-x::after{content:"";position:absolute;inset:-4px}
html body .bfp-sheet .bfp-row{height:52px;min-height:52px;font-size:1.0625rem}
html body .bfp-sheet .bfp-sheet-code{padding:2px 12px 8px}
html body .bfp-sheet .bfp-sheet-cta{display:flex;align-items:center;justify-content:center;gap:8px;height:52px;margin-top:12px;border-radius:999px;
  background:var(--bfp-ink);color:#fff;font:600 1rem/1 var(--text,'Instrument Sans',system-ui,sans-serif);text-decoration:none}
html body .bfp-sheet .bfp-sheet-cta:hover{background:#26303A}
.bfp-scrim{position:fixed;inset:0;z-index:999;background:rgba(247,248,250,.62);opacity:0;transition:opacity .16s ease-out}
.bfp-scrim.is-open{opacity:1}
@media (min-width:761px){html body .bfp-sheet,.bfp-scrim{display:none!important}}

/* ---------- phones: every other pop-up is a bottom sheet, full width with 10 px insets, radius 24 at the top, a grab handle ---------- */
@media (max-width:760px){
  html body .bf-pop:not(.bfp-sheet){left:10px!important;right:10px!important;top:auto!important;bottom:0!important;width:auto!important;max-width:none;
    max-height:calc(100dvh - 72px);overflow:auto;overscroll-behavior:contain;border-radius:24px 24px 0 0;
    padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));transform:translateY(6px)}
  html body .bf-pop:not(.bfp-sheet).is-open{transform:none}
  html body .bf-pop:not(.bfp-sheet)::before{content:"";display:block;width:36px;height:5px;margin:0 auto 10px;border-radius:999px;background:rgba(14,20,23,.18)}
  html body .bf-pop .bfp-row{height:52px;min-height:52px;font-size:1rem}
  html body .bfp-sheet .bfp-row{font-size:1.0625rem}
  /* fix 6 Part 5: 12 languages in one column of 52 px rows are 770 px, taller than a phone's visible screen once the
     browser bars are in (≈ 660–750 px at 390×844). Two columns of six, filled down the first column, each row still one
     line and 52 px to touch: the list is 322 px and fits every phone sheet with no scrolling. */
  html body .bf-pop .bfp-langs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(var(--bfp-lang-rows,6),auto);
    grid-auto-flow:column;gap:2px 4px}
}

/* ---------- fix 6 Part 5: no scrollbar anywhere in a pop-up, menu or sheet (LANG_SCROLLBAR.png) ----------
   The one source for every pop-up (.bf-pop: code, language, account, bell, the phone sheet), the account pages' and
   rooms' sheets (.v3-sheetpanel), the cookie settings and anything else that is a dialog, menu or listbox. Everything
   is sized to fit; where a very short screen still has to scroll, it scrolls with the bar hidden and the page behind
   does not scroll with it. A text box in a sheet (the room's "What happened?") hides its bar too: at 360 px its
   placeholder alone overflowed by 4 px and showed one. Native <select> lists are drawn by the system. */
html body :is(.bf-pop,.v3-sheetpanel,[role="dialog"],[role="menu"],[role="listbox"]),
html body :is(.bf-pop,.v3-sheetpanel,[role="dialog"],[role="menu"],[role="listbox"]) :not(select){scrollbar-width:none}
html body :is(.bf-pop,.v3-sheetpanel,[role="dialog"],[role="menu"],[role="listbox"])::-webkit-scrollbar,
html body :is(.bf-pop,.v3-sheetpanel,[role="dialog"],[role="menu"],[role="listbox"]) :not(select)::-webkit-scrollbar{display:none;width:0;height:0}
html body :is(.bf-pop,.v3-sheetpanel,[role="dialog"],[role="menu"],[role="listbox"],.bf-cc-card){overscroll-behavior:contain}

/* ---------- the account pages' language sheet (app/v3.php v3_lang_sheet, opened by v3.js) ---------- */
html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3{z-index:1000;padding:8px;color:var(--bfp-ink)!important}
html body.v3 .v3-scrim[data-v3-scrim="v3-sheet-lang"]{z-index:999}
@media (min-width:761px){
  html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3{width:240px;max-height:calc(100vh - 40px);border-radius:20px;transform:translate(-50%,calc(-50% - 6px));opacity:0}
  html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3.is-open{transform:translate(-50%,-50%);opacity:1;transition:opacity .16s ease-out,transform .16s ease-out,visibility 0s}
}
@media (max-width:760px){
  html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3{left:10px;right:10px;bottom:0;border-radius:24px 24px 0 0;max-height:calc(100dvh - 72px)}
  html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3.is-open{opacity:1;transform:none;transition:opacity .16s ease-out,transform .16s ease-out,visibility 0s}
}
html body :is(.v3-scrim[data-v3-scrim="v3-sheet-lang"]){background:rgba(247,248,250,.62)!important}

/* ---------- the pill glass over a dark ground (Vilius, 12 Oct evening: every pop-up is the header pill's glass) ----------
   The glass is 16 % white, so what is behind each line decides its colour. pop.js measures the ground under every row,
   label and title of a desktop pop-up as it opens (the field photo, the hero, the auth image, a dark card, or the paper)
   and marks the line .bfp-w where white reads better than ink. Phones: the light wash behind a sheet keeps ink. The
   solid fallbacks below (reduced transparency, no backdrop-filter, low-memory phones) are light: always ink. */
html body .bf-pop .bfp-w{color:#fff!important;text-shadow:0 1px 2px rgba(14,20,23,.32)}
html body .bf-pop .bfp-w :is(.bfp-row-v,span span){color:rgba(255,255,255,.82)!important}
html body .bf-pop .bfp-label.bfp-w,html body .bf-pop .bf-code-help.bfp-w{color:rgba(255,255,255,.86)!important}
html body .bf-pop .bfp-who.bfp-w .av{background:#fff!important;color:var(--bfp-ink)!important;text-shadow:none}
html body .bf-pop .bfp-row.bfp-w:hover{background:rgba(255,255,255,.12)}
html body .bf-pop .bfp-row.bfp-w:is(.is-on,[aria-current="page"],[aria-current="true"]){background:rgba(255,255,255,.2)}
html body .bf-pop .bfp-row.bfp-w{--bf-ring:0 0 0 3px rgba(255,255,255,.55)}
html body .bf-pop .f3a-ph.bfp-w :is(h2,a){color:#fff}

/* Start a trade / New trade: on paper the glass is nearly white, so its edge carries it; while a pop-up of its own
   header is open nothing changes. Its text follows the header (white on a field, ink on paper). */

/* ---------- the auth pages (bf_auth_header, Vilius 12 Oct evening): the same header, laid over the layout ----------
   Fixed, so nothing in the form, the field or the copy moves. Phones and tablets (the stacked layout, < 1024 px): it
   rests on the red field, white like over the home hero, and stands in for the layout's own white logo there. Beside
   the form (>= 1024 px) the field is only the right half, so it stays ink. */
html body .bf-nav-shell.bf-hdr-auth{position:fixed;top:0;left:0;right:0}
@media (max-width:1023px){
  html body .bf-nav-shell.bf-hdr-auth:not(.bf-nav-scrolled){--bf-nav-ink:#fff}
  html body .bf-nav-shell.bf-hdr-auth:not(.bf-nav-scrolled) .bf-nav-logo{color:#fff}
  html body .bf-nav-shell.bf-hdr-auth:not(.bf-nav-scrolled) :is(.bf-hdr-menu,.bf-hdr-me){color:#fff;background:rgba(255,255,255,.16);
    -webkit-backdrop-filter:blur(20px) saturate(1.7);backdrop-filter:blur(20px) saturate(1.7);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 0 0 1px rgba(255,255,255,.2)}
  html body:has(.bf-hdr-auth) .auth-split-logo{visibility:hidden}
}

/* ---------- reduced motion, reduced transparency, no backdrop-filter ---------- */
@media (prefers-reduced-motion:reduce){
  html body .bf-pop,html body .bf-pop.is-open,.bfp-scrim,html body .bf-hdr .bf-hdr-i,html body .bf-hdr-cta,html body .bf-pop .bfp-row{transition:none!important}
  html body .bf-pop,html body .bf-pop:not(.bfp-sheet){transform:none!important}
  html body.v3 .v3-sheetpanel.bf-pop.bf-pop--v3{transition:none!important}
}
@media (prefers-reduced-transparency:reduce){
  html body .bf-pop{background:rgba(250,251,252,.97)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  html body .bfp-sheet .bfp-sheet-cta{background:var(--bfp-ink)!important;color:#fff!important}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  html body .bf-pop{background:rgba(250,251,252,.97)!important}
  html body .bfp-sheet .bfp-sheet-cta{background:var(--bfp-ink)!important;color:#fff!important}
}
html.v3-lite body .bf-pop{background:rgba(250,251,252,.97)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* a solid fill is light whatever is behind it: ink text, never the white-on-dark lines */
@media (prefers-reduced-transparency:reduce){
  html body .bf-pop .bfp-w,html body .bf-pop .bfp-w :is(h2,a){color:var(--bfp-ink)!important;text-shadow:none!important}
  html body .bf-pop .bfp-w :is(.bfp-row-v,span span),html body .bf-pop :is(.bfp-label,.bf-code-help).bfp-w{color:var(--bfp-sub)!important}
  html body .bf-pop .bfp-row.bfp-w:is(.is-on,[aria-current="page"],[aria-current="true"]){background:var(--bfp-sel)}
  html body .bf-pop .bfp-who.bfp-w .av{background:var(--bfp-ink)!important;color:#fff!important}
  html body .bf-pop .bfp-row.bfp-w{--bf-ring:0 0 0 3px rgba(14,20,23,.18)}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  html body .bf-pop .bfp-w,html body .bf-pop .bfp-w :is(h2,a){color:var(--bfp-ink)!important;text-shadow:none!important}
  html body .bf-pop .bfp-w :is(.bfp-row-v,span span),html body .bf-pop :is(.bfp-label,.bf-code-help).bfp-w{color:var(--bfp-sub)!important}
  html body .bf-pop .bfp-who.bfp-w .av{background:var(--bfp-ink)!important;color:#fff!important}
}
html.v3-lite body .bf-pop .bfp-w,html.v3-lite body .bf-pop .bfp-w :is(h2,a){color:var(--bfp-ink)!important;text-shadow:none!important}
html.v3-lite body .bf-pop .bfp-w :is(.bfp-row-v,span span),html.v3-lite body .bf-pop :is(.bfp-label,.bf-code-help).bfp-w{color:var(--bfp-sub)!important}
html.v3-lite body .bf-pop .bfp-who.bfp-w .av{background:var(--bfp-ink)!important;color:#fff!important}

/* auth pages on desktop (≥1024 px): the form column keeps its own big logo, so the header shows no second logo (Vilius, 12 Oct evening) */
@media (min-width:1024px){
  html body .bf-nav-shell.bf-hdr-auth:not(.bf-nav-scrolled) .bf-nav-logo{visibility:hidden}
}
