/* =====================================================================
   Skin 3 (vega) — phone layer. Loaded last on every vega page (site-head + landing-head).
   Everything visual lives inside @media (max-width: 767px): desktop and tablet stay untouched.
   Outside the query there is only `display: none` for phone-only elements of the app bar / drawer.
   Hooks: vega-mobile.js (back, collapsing title, support button, scroll rails).
   ===================================================================== */
.vh-back, .vh-mtitle, .vh-sup, .vh-mlang, .vm-lang { display: none; }
.vh-sup[hidden] { display: none !important; }

@media (max-width: 767px) {
  :root { --vm-gut: 16px; --vm-bar: 64px; --vm-tabh: 58px; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body.vega { -webkit-tap-highlight-color: transparent; }
  body.vega :is(a, button, summary, label, select, [role="button"], [role="tab"]) { touch-action: manipulation; }

  /* ---------- App bar ---------- */
  .vh { height: calc(var(--vm-bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 var(--vm-gut); gap: 4px; border-bottom: 1px solid transparent; transition: border-color .2s; }
  .vh.is-scrolled { border-bottom-color: var(--v-line); box-shadow: none; }
  .vh__right { gap: 0; }
  /* bigger bar (user, 2026-11-23: "всё мелкое"): 64px bar, 48px touch targets, 26px glyphs, 24px name */
  .vh .vh-ico { width: 48px; height: 48px; border-radius: 0; }
  .vh .vh-ico > svg { width: 26px; height: 26px; }
  .vh .vh__name { font-size: 24px; letter-spacing: -.035em; }
  .vh .vh__brand { --vh-fs: 24px; }
  .vh .vh__logo { max-width: 150px; }
  .vh .vh__signup { height: 40px; padding: 0 18px; font-size: 16px; }
  .vh .vh-ico:hover, .vh .vh-ico.is-open, .vh .vh-lang:hover > .vh-ico, .vh .vh-lang:focus-within > .vh-ico { background: none; }
  .vh .vh-ico:active { color: var(--v-t2); }
  .vh .vh-ico__dot { top: 7px; right: 6px; box-shadow: none; }
  .vh .vh-lang { display: none; }
  .vh-sup { display: inline-grid; }
  .vh__login + .vh__signup { margin-left: 8px; }
  .vh__signup { margin-right: 6px; }
  .vh__brand { height: 48px; }
  /* a long site name / logo shrinks with an ellipsis; the buttons on the right never move or overlap */
  .vh__left { flex: 1 1 auto; min-width: 0; }
  .vh__right { flex: none; }
  .vh__brand { min-width: 0; max-width: 100%; overflow: hidden; }
  .vh .vh__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* too long even at 15px: two lines (lk-header.ejs fitter); an ellipsis only past the second line */
  .vh .vh__brand .vh__name.is-2l { display: -webkit-box; font-size: 15px !important; line-height: 1.12; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .vh .vh__logo { flex: none; min-width: 0; max-width: 100%; }
}
/* guests (Sign up button in the bar) on narrow phones: the bar never gets wider than the screen */
@media (max-width: 420px) {
  .vh:has(.vh__signup) .vh-ico { width: 44px; height: 44px; }
  .vh:has(.vh__signup) .vh__signup { height: 38px; padding: 0 14px; font-size: 15px; }
  .vh:has(.vh__signup) .vh__name { font-size: 22px; }
  .vh:has(.vh__signup) .vh__brand { --vh-fs: 22px; }
}
@media (max-width: 767px) {

  .vh--sub { padding-left: 4px; }
  /* inner pages swap the logo for the back chevron; the account button stays on every page (it used to vanish here) */
  .vh--sub .vh__brand, .vh--sub .vh__login, .vh--sub .vh__signup { display: none; }
  .vh-back { display: inline-grid; place-items: center; width: 48px; height: 48px; color: var(--v-t1); }
  .vh-back > svg { width: 30px; height: 30px; }
  .vh-back:active { color: var(--v-t2); }
  .vh-mtitle { display: block; position: absolute; top: env(safe-area-inset-top); left: 50%; z-index: 0; max-width: calc(100% - 200px); height: var(--vm-bar); margin: 0; overflow: hidden; color: var(--v-t1); font: 600 18px/var(--vm-bar) var(--v-font); letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; opacity: 0; transform: translateX(-50%); transition: opacity .18s ease; pointer-events: none; }
  .vh--titled .vh-mtitle { opacity: 1; }

  /* ---------- Drawer: language accordion (the globe left the bar) ---------- */
  .vd__lang { display: block; margin-top: 2px; }
  .vd__lang > summary { list-style: none; }
  .vd__lang > summary::-webkit-details-marker { display: none; }
  .vd__lang > summary > svg { flex: none; color: var(--v-t3); transition: transform .2s var(--v-ease); }
  .vd__lang[open] > summary > svg { transform: rotate(180deg); }
  .vd__lang-cur { margin-left: auto; color: var(--v-t2); font-size: 14px; font-weight: 500; }
  .vd__lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px 0 8px; }
  .vd__lang-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; height: 44px; padding: 0 12px; border-radius: var(--v-r-md); color: var(--v-t1); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vd__lang-item:active { background: var(--v-raised); }
  .vd__lang-item.is-on { color: var(--v-brand); background: var(--v-raised); }
  .vd__lang-item svg { flex: none; }
  .vd__link:active { background: var(--v-raised); }

  /* ---------- Support: launcher lives in the bar, the floating button goes ---------- */
  body.vega:has(.vh-sup) .nsw-fab, body.vega:has(.vh-sup) .nsw-hint { display: none !important; }
  body.vega:has(.vh-sup) .nsw:not(:has(.nsw-panel:not([hidden]))) { pointer-events: none; }
  body.vega .nsw:has(.nsw-panel:not([hidden])) { z-index: 95; }
  body.vega .nsw-panel { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.vega:has(.nsw-panel:not([hidden])) .vtb { visibility: hidden; }

  /* ---------- Tab bar ---------- */
  .vtb { padding: 0 4px env(safe-area-inset-bottom); border-top: 1px solid var(--v-line); background: rgba(16, 17, 19, .94); }
  .vtb__a { justify-content: center; gap: 4px; height: var(--vm-tabh); padding: 0; border-radius: 0; font-size: 11px; letter-spacing: 0; }
  .vtb__ico { display: grid; place-items: center; height: 24px; transition: transform .15s var(--v-ease); }
  .vtb__a:active .vtb__ico { transform: scale(.88); }
  body.vega.v-has-tabbar { padding-bottom: calc(var(--vm-tabh) + env(safe-area-inset-bottom)); }
  body.vega.v-has-tabbar .v-cookie { bottom: calc(var(--vm-tabh) + 12px + env(safe-area-inset-bottom)); }
  body.vega.v-has-tabbar .ntoast-stack { top: calc(var(--vm-bar) + 8px + env(safe-area-inset-top)); }

  /* ---------- One gutter: 16px everywhere ---------- */
  body.vega.v-lk:not(.kx-page) .lk-app__body { padding: 0 var(--vm-gut) 24px; }
  body.vega .vlk, body.vega .vk { padding-left: 0; padding-right: 0; }

  /* ---------- Scroll rails: fade only toward the side that still scrolls ---------- */
  .vm-rail { -webkit-mask-image: none !important; mask-image: none !important; scroll-snap-type: x proximity; scroll-padding-inline: var(--vm-gut); }
  /* sideways only: a 1px overhang (the active tab's underline) made these rows scroll up/down too and bounce like
     rubber under the finger; the page still scrolls vertically through them (user, 2026-11-23) */
  .vm-rail, body.vega .kx-blotter__tabs { overflow-y: hidden !important; overscroll-behavior-x: contain; }
  .vm-rail.vm-rail--l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px) !important; mask-image: linear-gradient(90deg, transparent, #000 40px) !important; }
  .vm-rail.vm-rail--r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent) !important; }
  .vm-rail.vm-rail--l.vm-rail--r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 40px), transparent) !important; mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 40px), transparent) !important; }
  .vm-rail > * { scroll-snap-align: start; }
}

/* =====================================================================
   Page passes (phones). Each block names its page; the page's own sheet keeps the desktop layout.
   ===================================================================== */
@media (max-width: 767px) {
  /* Account cards: one inner padding for every card on the settings page */
  body.vega .vlk-main section.vu-card.vu-ac-sec, body.vega .vlk-main section.vu-card.vu-ac-card, body.vega .vlk-main section.vu-card.vu-ac-head { padding: 20px 18px; }

  /* PnL: the three account switches stay on one line */
  body.vega .vpa-head .vod-seg button { padding: 6px 4px; }
}

@media (max-width: 767px) {
  /* Stocks hub: heatmap labels fit the small phone tiles; market table headers never clip */
  @container (max-width: 66px) { .vk-tile__chg { font-size: 11px; letter-spacing: -.01em; } }
  @container (max-width: 56px) { .vk-tile__chg { font-size: 10px; } }
  .vk-table--mkt th:nth-child(2), .vk-table--mkt td:nth-child(2) { width: 88px; }
  .vk-table--mkt th:nth-child(3), .vk-table--mkt td:nth-child(3) { width: 98px; }
  .vk-table--mkt th .vk-sort { max-width: 100%; }
  .vk-cats, .vk-geo { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 767px) {
  /* Terminal: the tab bar stays (Trade is a root tab); Buy / Sell sits right above it */
  /* keyed on the body class the server sets (not :has(.vtb)): the bar sits right from the first paint */
  body.vega.kx-page.v-has-tabbar .vt { padding-bottom: calc(68px + var(--vm-tabh) + env(safe-area-inset-bottom)); }
  body.vega.kx-page.v-has-tabbar .vt-bar { bottom: calc(var(--vm-tabh) + env(safe-area-inset-bottom)); padding: 10px 16px; border-top: 1px solid var(--v-line); }
  body.vega.kx-page .vtb { z-index: 305; }
  body.vega.kx-page .vt-bar button { height: 46px; }
}

@media (max-width: 767px) {
  /* App bar: text buttons first, then the icon cluster at the edge */
  .vh__right > .vh-sup { order: 5; }
  .vh__right > .vh__me { order: 6; }
  .vh__right > .vh-mlang { order: 7; }
  .vh__right > .vh__burger { order: 8; }
}
@media (max-width: 767px) and (hover: none) {
  /* Home product cards: no sticky hover state after a tap */
  .vx-gcard:hover { border-color: rgba(255, 255, 255, .035); }
  .vx-gcard:hover .vx-gcard__t { color: inherit; }
  .vx-gcard:hover .vx-gcard__art { opacity: 1; }
  .vx-gcard:hover .vx-gcard__go { opacity: 0; }
  .vx-gcard:active { border-color: rgba(255, 255, 255, .1); }
}

@media (max-width: 767px) {
  /* Docs / legal tables (cards on phones): long values drop under their label, left-aligned */
  body.vega .nd-table td.vm-td-stack { flex-direction: column; justify-content: flex-start; gap: 4px; text-align: left; }
  body.vega .nd-table td.vm-td-stack::before { max-width: none; }

  /* Cross rates: base-currency chips run edge to edge */
  body.vega .fx-m__bases { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* =====================================================================
   Phones: every overlay is a bottom sheet over a dimmed, frozen page (as on skin 2).
   Skin 2's dim layer is html:has(open) body::after at z 120 with sheets at z 121; skin 3's own
   popovers join it here. The page behind is pinned by nova-mobile.js's scroll lock, which
   vega-mobile.js feeds through a hidden flag while a skin 3 overlay is open.
   ===================================================================== */
@media (max-width: 767px) {
  /* History / orders filter selects: the desktop "below the field" offset pushed the sheet off-screen */
  body.vega .vhx .vhx-sel .nsel.is-open > .nsel__list { top: auto; left: 0; right: 0; min-width: 0; }
  body.vega .asset-select__menu:not([hidden]) { margin-top: 0; border-radius: 20px 20px 0 0; }

  /* Swap coin picker: a sheet like every other coin list (it used to cover the ticket only) */
  body.vega .vsw .vsw-menu:not([hidden]) { position: fixed; inset: auto 0 0 0; z-index: 121; max-height: calc(82dvh / var(--vz, 1)); padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); border: 0 !important; border-radius: 20px 20px 0 0; animation: m-sheet-up .25s ease; }

  /* Terminal metrics "More" and PnL period menu: anchored popovers become sheets */
  body.vega .vt-metrics__pop:not([hidden]), body.vega .vu-pa .pa-more__menu:not([hidden]) {
    position: fixed; inset: auto 0 0 0; z-index: 121; min-width: 0; width: auto; max-height: calc(70dvh / var(--vz, 1)); overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 26px 8px calc(12px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--v-line-2); border-radius: 20px 20px 0 0;
    background: var(--v-surface); box-shadow: none; animation: m-sheet-up .25s ease;
  }
  body.vega :is(.vt-metrics__pop, .vu-pa .pa-more__menu):not([hidden])::before { content: ""; position: absolute; top: 9px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--v-press); }
  body.vega .vt-metrics__pop .kx-head__m { height: 48px; padding: 0 12px; font-size: 15px; }
  body.vega .vu-pa .pa-more__menu button { height: 48px; padding: 0 16px; font-size: 16px; }
  html:has(.vsw-menu:not([hidden]), .vt-metrics__pop:not([hidden]), .vu-pa .pa-more__menu:not([hidden])) body::after {
    content: ""; display: block; position: fixed; inset: 0; z-index: 120; background: rgba(5, 6, 7, .72);
  }
  body.vega .vsw .vsw-card:has(.vsw-menu:not([hidden])) { z-index: auto; }

  /* Date range calendar: dim the page behind it as well */
  html:has(.hx-cal) body::after { content: ""; position: fixed; inset: 0; z-index: 120; background: rgba(5, 6, 7, .72); }
  body.vega .hx-cal { z-index: 121; }
}

@media (max-width: 767px) {
  /* Stock page order bar: same band as the terminal's, right above the tab bar */
  body.vega .vk-mbar.sk-m-bar, body.vega .sk-m-bar { bottom: calc(var(--vm-tabh) + env(safe-area-inset-bottom)); gap: 10px; padding: 10px 16px; border-top: 1px solid var(--v-line); background: var(--v-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.vega .sk-m-bar button { height: 46px; border-radius: 99px; font-size: 16px; font-weight: 700; }
  body.vega.sk-detail-page { padding-bottom: calc(68px + var(--vm-tabh) + env(safe-area-inset-bottom)); }

  /* (orders filters: one chip row with a round Reset, vega-history.css) */
}

@media (max-width: 767px) {
  /* Log in / Sign up pages: the switch to the other form is a plain text link under the main button */
  .va-card > .ap-pane > .va-head { display: contents; }
  .va-card > .ap-pane > .va-head > .va-title { margin-top: auto; }
  .va-card > .ap-pane > .va-head > .va-swap { order: 1; align-self: center; height: 44px; margin-top: 12px; padding: 0 12px; border-radius: 0; background: none; color: var(--v-brand); font: 500 15px/1 var(--v-font); }
  .va-card > .ap-pane > .va-head > .va-swap:hover, .va-card > .ap-pane > .va-head > .va-swap:active { background: none; color: var(--v-brand-hover, var(--v-brand)); }
  .va-card > .ap-pane > .va-note, .va-card > .ap-pane::after { order: 2; }
}

@media (max-width: 767px) {
  /* Auth pages: the desktop art panel comes back as a band under the logo — the dotted brand word
     drifting behind the typed line, then the form below it */
  .va { position: relative; }
  .va > .va-art { display: block; position: absolute; top: calc(64px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 0; flex: none; height: 220px; background: none; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); }
  .va > .va-art .va-art__word { width: 340cqmax; transform: translate(-50%, -50%) rotate(-9deg); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 42%, #000 58%, transparent 70%); mask-image: linear-gradient(90deg, transparent 30%, #000 42%, #000 58%, transparent 70%); }
  .va > .va-art .va-art__track { font-size: 50cqmin; }
  .va > .va-art .va-art__type { height: 32px; font-size: 25px; line-height: 32px; }
  .va > .va-art .va-art__caret { width: 2.5px; height: 30px; }
  .va > .va-side { position: relative; z-index: 1; }
  .va-card > .ap-pane { padding-top: 236px; }
}
@media (max-width: 359px) {
  .va > .va-art .va-art__type { font-size: 21px; }
}

@media (max-width: 767px) {
  [dir="rtl"] .vh-back svg { transform: scaleX(-1); }
}

@media (max-width: 767px) {
  /* Wallet: no coin search on phones (the user's call); the zero-balance toggle stays */
  body.vega .vu-w-search { display: none; }
}

@media (max-width: 767px) {
  /* Swap stage: "Instant swap" and the pair icons share one row, the live rate sits under them */
  body.vega .vsw-intro__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
  body.vega .vsw-title { display: block; grid-column: 1; grid-row: 1; min-width: 0; }
  body.vega .vsw-live { display: contents; }
  body.vega .vsw-pair__ico { grid-column: 2; grid-row: 1; justify-self: end; gap: 4px; }
  body.vega .vsw-pair__ico :is(img, svg) { width: 34px; height: 34px; }
  body.vega .vsw-live__t { grid-column: 1 / -1; grid-row: 2; margin-top: 18px; }
}

@media (max-width: 767px) {
  /* Account shell on phones: no group switch and no tab row — the user's call. Every section is in the
     tab bar, the menu (History, Orders, PNL analysis, Staking…) or the account menu (Profile, Security…). */
  body.vega .vlk-nav { display: none; }
  body.vega .vlk-main { padding-top: 20px; padding-bottom: 0; }
}

@media (max-width: 767px) {
  /* Skin 2's swipe handle carried skin 2's black fill: on skin 3's graphite sheets it read as a black band */
  body.vega .m-grab { background: transparent; }
  body.vega .m-grab__bar { background: var(--v-press); }
}

@media (max-width: 767px) {
  /* While any sheet / dialog / menu is open (nova-mobile.js pins the page and sets m-scroll-lock),
     the fixed bottom bars step aside so they never sit on top of the sheet */
  html.m-scroll-lock body.vega :is(.vtb, .vt-bar, .sk-m-bar) { visibility: hidden; }
}
@media (max-width: 767px) {
  /* KYC document / country pickers: above the dim layer like every other sheet */
  body.vega .lk-kyc__menu:not([hidden]), body.vega .vu-set .lk-kyc__menu:not([hidden]) { z-index: 121; }
}
@media (max-width: 767px) {
  /* one sheet shape for every picker: 20px top corners, a single top hairline */
  body.vega :is(.asset-select__menu, .lk-kyc__menu):not([hidden]), body.vega .nsel.is-open > .nsel__list { border: 0 !important; border-top: 1px solid var(--v-line-2) !important; border-radius: 20px 20px 0 0 !important; }
}

@media (max-width: 767px) {
  /* Tab bar: the brand's two-tone marks (white + lime) on every tab; the current one at full strength */
  .vtb__ico { height: 26px; }
  .vtb__ico img { display: block; width: 26px; height: 26px; opacity: .72; transition: opacity .15s; }
  .vtb__a.is-on .vtb__ico img { opacity: 1; }
  .vtb__a { color: var(--v-t3); }
  .vtb__a.is-on { color: var(--v-t1); font-weight: 600; }
}

/* Desktop language list: a round flag before every language */
.vh-lang__nm { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.vh-lang__flag { display: block; flex: none; width: 20px; height: 20px; border-radius: 50%; }
body.vega .vh .vh-lang__panel { width: 440px; }
body.vega .vh .vh-lang__item { gap: 10px; }
body.vega .vh .vh-lang__nm > span { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 767px) {
  /* Phone language picker: the bar's globe opens a bottom sheet (lang-sheet.ejs + vega-mobile.js) */
  .vh-mlang { display: inline-grid; }
  .vm-lang:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 130; }
  .vm-lang__scrim { position: absolute; inset: 0; background: rgba(5, 6, 7, .72); animation: v-fade .2s ease; }
  .vm-lang__panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: calc(86dvh / var(--vz, 1)); padding: 0 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--v-line-2); border-radius: 20px 20px 0 0; background: var(--v-surface); animation: m-sheet-up .25s ease; }
  .vm-lang__grab { flex: none; width: 36px; height: 4px; margin: 10px auto 0; border-radius: 99px; background: var(--v-press); }
  .vm-lang__head { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 10px 8px 6px 20px; }
  .vm-lang__head b { color: var(--v-t1); font: 700 20px/1.2 var(--v-font); letter-spacing: -.02em; }
  .vm-lang__x { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--v-t2); }
  .vm-lang__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px; }
  .vm-lang__item { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border-radius: 14px; color: var(--v-t1); font: 500 16px/1.2 var(--v-font); }
  .vm-lang__item img { display: block; flex: none; width: 28px; height: 28px; border-radius: 50%; }
  .vm-lang__item span { flex: 1 1 auto; min-width: 0; }
  .vm-lang__item svg { flex: none; color: var(--v-brand); }
  .vm-lang__item.is-on { background: var(--v-raised); font-weight: 600; }
  .vm-lang__item:active { background: var(--v-raised); }
}

.vtb-pill, .vtb-top { display: none; }
@media (max-width: 767px) {
  /* Rubber dock (vega-dock.js): a lime pill behind the current tab's icon that stretches between tabs;
     inside it the icon turns dark (a dark copy of the icons, clipped to the pill) */
  .vtb, .vtb .vtb__a { touch-action: pan-y; }
  .vtb.is-drag { touch-action: none; }
  .vtb-pill { display: block; position: absolute; left: 0; top: 0; z-index: 0; width: 58px; height: 32px; border-radius: 16px; background: var(--v-brand); pointer-events: none; will-change: transform, width, height; }
  .vtb > .vtb__a { position: relative; z-index: 1; }
  .vtb-top { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
  .vtb-top > img { position: absolute; display: block; filter: brightness(0); opacity: .92; }
  .vtb__a.is-on .vtb__ico img { opacity: 1; }
  .vtb__a:active .vtb__ico { transform: none; }
}

@media (max-width: 767px) {
  /* Stocks: no desktop bottom reserve under the last card (the tab bar / order bar padding already holds it) */
  body.vega .vk { padding-bottom: 0; }
  /* Market table fits the card: the side padding of the scroller made it 8px wider than its box */
  body.vega .vk-market > .vk-scroll { padding: 4px 0; overflow-x: hidden; }
  /* Order sheet head carried skin 2's black fill */
  body.vega .sk-m-sheethead { background: transparent; }
}
@media (max-width: 767px) {
  /* the right rounding lived on the action cell, which phones hide: give it to the last visible cell */
  body.vega .vk-market .vk-table--mkt td:nth-child(3) { border-radius: 0 18px 18px 0; padding-right: 14px; }
  body.vega .vk-market .vk-table--mkt td:first-child { padding-left: 14px; }
}


@media (max-width: 767px) {
  /* Home promo carousel: one card in the middle, its neighbours just peeking in at both sides, softly
     blurred and dimmed (vega-mobile.js sets --vm-d = distance from centre per card); swipe snaps */
  body.vega .vx-promo .vx-carousel__track { grid-auto-columns: calc(100vw - 80px); gap: 10px; margin: 0 -16px; padding: 4px 40px 8px; scroll-padding: 0 40px; scroll-snap-type: x mandatory; }
  body.vega .vx-promo .vx-pcard { scroll-snap-align: center; scroll-snap-stop: always; --vm-d: 0; transform: scale(calc(1 - var(--vm-d) * .06)); opacity: calc(1 - var(--vm-d) * .45); filter: blur(calc(var(--vm-d) * 2.2px)); will-change: transform, filter; }
  body.vega .vx-promo .vx-pcard:hover { border-color: rgba(255, 255, 255, .045); }
}

@media (max-width: 767px) {
  /* PnL: reserve the space the script fills in, so the page doesn't jump while it loads */
  body.vega .vu-pa .vpa-upd { min-height: 19px; }
  body.vega .vu-pa .vpa-sum .vp-today:empty { min-height: 22px; }
  body.vega .vu-pa .vpa-sum .vp-pers:empty { min-height: 204px; }
}

@media (max-width: 767px) {
  /* Coin / network picker sheets: phone-sized rows and type (they kept the desktop 48px rows, 12px balances) */
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__row { gap: 12px; min-height: 60px; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__row .asset-ico { width: 36px; height: 36px; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__sym strong { font-size: 16px; font-weight: 600; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__name { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__bal { margin-left: auto; gap: 3px; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__bal strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__bal span { color: var(--v-t3); font-size: 13px; font-variant-numeric: tabular-nums; }

  /* Skin 3 dialogs (vq / vr / vx / vu-rec) are bottom sheets on phones: same grab bar as the pickers
     (vega-mobile.js adds it and closes the sheet when it is dragged down) */
  body.vega .lk-sheet > .lk-sheet__panel > .m-grab { position: sticky; top: -24px; z-index: 5; margin: -16px 0 4px; padding: 10px 0 6px; background: transparent; }
}

@media (max-width: 767px) {
  /* Picker sheets: every option is its own rounded plate with air around it, so the selected /
     pressed fill never touches its neighbour or the sheet edge (skin 2 ran them edge to edge) */
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__list { display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
  body.vega .asset-select__menu:not(.vsw-menu) .asset-select__row { padding: 0 12px; border-radius: 14px; }
  body.vega .nsel.is-open > .nsel__list, body.vega .lk-kyc__menu:not([hidden]), body.vega .vu-set .lk-kyc__menu:not([hidden]) { gap: 4px; padding-left: 8px; padding-right: 8px; }
  body.vega .nsel.is-open > .nsel__list > .m-grab, body.vega .lk-kyc__menu > .m-grab { margin-left: -8px; margin-right: -8px; }
  body.vega .nsel__opt, body.vega .lk-kyc__menu button, body.vega .vu-set .lk-kyc__menu button { flex: none; height: auto; min-height: 52px; padding: 14px 12px; border-radius: 14px; font-size: 16px; }
}

@media (max-width: 767px) {
  /* Inner pages keep four icons on the right, so the collapsing title sits after the back chevron
     instead of the centre, and ends before the icon cluster */
  .vh--sub .vh-mtitle { left: 48px; max-width: calc(100% - 48px - var(--vm-right, 184px)); transform: none; text-align: left; }
}

@media (max-width: 767px) {
  /* Calendars (KYC date of birth, history / orders range) are full-width bottom sheets with thumb-sized
     cells; skin 3's desktop rules (320px wide, 34px days, 13px type) used to win over the phone sheet */
  body.vega .hx-cal, body.vega .idv-cal { left: 0; right: 0; width: auto; max-width: none; border-width: 1px 0 0 !important; border-radius: 20px 20px 0 0; }
  body.vega .hx-cal .hx-cal__head { height: 52px; }
  body.vega .hx-cal .hx-cal__title { font-size: 17px; }
  body.vega .hx-cal .hx-cal__nav { width: 44px; height: 44px; font-size: 22px; border-radius: 50%; }
  body.vega .hx-cal .hx-cal__wd { height: 34px; font-size: 13px; }
  body.vega .hx-cal .hx-cal__d { height: 46px; font-size: 16px; }
  body.vega .hx-cal .hx-cal__d span { width: 42px; height: 42px; border-radius: 12px; }
  body.vega .hx-cal .hx-cal__cells { gap: 6px 0; padding: 12px 0 8px; }
  body.vega .hx-cal .hx-cal__cell { height: 54px; font-size: 16px; }
  body.vega .hx-cal .hx-cal__cell span { min-width: 84px; height: 44px; border-radius: 12px; }
  body.vega .idv-cal .idv-cal__body { padding: 0; }
}

/* Home hero on phones fills the first screen: the "New: tokenized stocks" line and the promo cards start below
   the fold, never peeking under the hero (user, 2026-11-23). The tab bar (signed in) is taken off the height. */
@media (max-width: 767px) {
  body.vega .vx-hero { display: flex; flex-direction: column; justify-content: flex-start; min-height: calc(calc(100svh / var(--vz, 1)) - var(--vm-bar) - env(safe-area-inset-top)); box-sizing: border-box; }
  body.vega.v-has-tabbar .vx-hero { min-height: calc(calc(100svh / var(--vz, 1)) - var(--vm-bar) - env(safe-area-inset-top) - var(--vm-tabh) - 1px - env(safe-area-inset-bottom)); }
  body.vega .vx-hero > .v-wrap { width: 100%; }
}

/* Home, phones: referral strip above the header (user, 2026-11-23). Graphite band with a soft lime glow behind
   the gift, lime headline + grey line, a white "Invite / Sign up" pill; the whole band is the link; it cannot be
   closed (user, 2026-11-23). Desktop: not shown (user: "на пк не надо"). */
.vrb { display: none; }
@media (max-width: 767px) {
  .vrb:not([hidden]) {
    position: relative; z-index: 61; display: flex; align-items: center; gap: 2px;
    padding: calc(10px + env(safe-area-inset-top)) var(--vm-gut) 10px;
    background: radial-gradient(120px 90px at 34px 60%, rgba(171, 225, 39, .2), transparent 70%), var(--v-surface);
    color: var(--v-t1);
  }
  .vrb__a { display: flex; flex: 1 1 auto; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
  .vrb__art { flex: none; width: 34px; height: 34px; object-fit: contain; }
  .vrb__txt { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
  .vrb__txt b { overflow: hidden; color: var(--v-brand); font: 700 15px/1.2 var(--v-font); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
  .vrb__txt small { display: -webkit-box; overflow: hidden; color: var(--v-t2); font: 500 13px/1.3 var(--v-font); -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-wrap: pretty; }
  .vrb__cta { flex: none; display: inline-grid; place-items: center; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--v-t1); color: var(--v-bg); font: 700 13px/1 var(--v-font); white-space: nowrap; transition: transform .15s var(--v-ease, ease); }
  .vrb__a:active .vrb__cta { transform: scale(.95); }
  /* notch phones: the strip takes the top inset; the header below sticks just under the status bar, and a
     page-coloured band keeps the status bar area dark while the page scrolls */
  .vrb:not([hidden]) ~ .vh { top: env(safe-area-inset-top); padding-top: 0; height: var(--vm-bar); }
  body.vega:has(.vrb:not([hidden]))::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 62; height: env(safe-area-inset-top); background: var(--v-bg); pointer-events: none; }
  /* the gift moved from the hero's fee line into the strip */
  body.vega .vx-hero__perk img { display: none; }
}
