/* The only page breakpoint. Agent 6. Below 1280px the grid is one column and the page scrolls.
   Under 768px the phone screen has four zones: topbar, hero (one tile), action (Long/Short), dock (tabs). */
:root {
  --v2-sa-t: env(safe-area-inset-top, 0px);
  --v2-sa-r: env(safe-area-inset-right, 0px);
  --v2-sa-b: env(safe-area-inset-bottom, 0px);
  --v2-sa-l: env(safe-area-inset-left, 0px);
  --v2-kb: 0px;
  --v2-vvh: 100dvh;
  --v2-vvt: 0px;
}
/* iOS home-screen apps that still draw under the status bar blur about 40px past the inset. */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    :root {
      --v2-sa-t: calc(env(safe-area-inset-top, 0px) + min(40px, env(safe-area-inset-top, 0px) * 100));
    }
  }
}
.v2-phone,
.v2-sheet-scrim,
.v2-sheet-x,
.v2-mstats-go {
  display: none;
}
@media (max-width: 1279px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body {
    min-width: 0;
    padding-bottom: var(--v2-sa-b);
    padding-left: var(--v2-sa-l);
    padding-right: var(--v2-sa-r);
  }
  .v2-nav {
    padding-top: var(--v2-sa-t);
  }
  .v2-grid {
    width: 100%;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .v2-grid > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  /* Wrap into 44px rows. .v2-btn { height:100% } would stretch each link to the
     full header height and steal taps on the stats tile. Cap every nav child.
     pu-9: fold links use height:100% in shell.css — pin the fold + links to 44
     so a wrapped wallet row cannot stretch Trade/Swap to 88px over stats. */
  .v2-nav,
  .v2-prof-nav {
    flex-wrap: wrap;
    align-content: flex-start;
    height: auto;
  }
  .v2-nav > .v2-logo,
  .v2-nav > .v2-navb,
  .v2-nav > .v2-cap,
  .v2-nav > .v2-spacer,
  .v2-nav > .v2-nav-fold,
  .v2-nav > .v2-theme,
  .v2-prof-nav > .v2-logo,
  .v2-prof-nav > .v2-cap,
  .v2-prof-nav > .v2-spacer,
  .v2-prof-nav > .v2-nav-fold,
  .v2-prof-nav > .v2-theme {
    height: 44px;
    max-height: 44px;
  }
  .v2-nav > .v2-spacer,
  .v2-prof-nav > .v2-spacer {
    flex: 1 1 auto;
    min-width: 0;
  }
  .v2-nav-fold > .v2-nav-links,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links {
    height: 44px;
    max-height: 44px;
    align-items: stretch;
  }
  .v2-nav-fold > .v2-nav-links .v2-navb,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links .v2-navb,
  .v2-navb {
    width: auto;
    flex: 1 1 auto;
    height: 44px;
    max-height: 44px;
    min-height: 44px;
  }
  .v2-statrow {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
  /* Funding "Next HH:MM:SS" stays on one line when the strip wraps (~1024px). */
  [data-tile="stats"] .v2-stat .v2-lbl {
    white-space: nowrap;
  }
  .v2-chart {
    height: var(--v2-chart-h);
  }
  .v2-book {
    height: var(--v2-book-h);
  }
  .v2-trades {
    display: none !important;
    height: 0;
  }
  /* pu-9/pu-2: beat book.css 33px desktop tabs on phone. */
  .v2-book-tabs .v2-btn,
  [data-tile="book"] .v2-book-tabs.x-tabs .v2-btn,
  [data-tile="book"] .v2-book-tabs .v2-btn {
    min-height: 44px;
    height: 44px;
  }
  .v2-account {
    min-height: 220px;
  }
}
/* Short landscape: stats and the chart title sit above the plot and leave a ~60px canvas.
   Drop them so the tile is one screen under the nav. The page itself still scrolls,
   so the book, ticket, positions, and account stay reachable on a sideways phone. */
@media (max-width: 1279px) and (orientation: landscape) and (max-height: 500px) {
  .v2-statrow {
    display: none;
  }
  .v2-chart > .v2-hd {
    display: none;
  }
  .v2-chart {
    height: calc(100dvh - var(--v2-nav-h));
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  /* height 100% on .v2-chart-cv stops the canvas from stretching with inset.
     The legend row below replaces the 28px chip clamp. Portrait is a different query. */
  .v2-chart .v2-chart-cv {
    width: auto;
    height: auto;
  }
  .v2-chart .v2-chart-ov {
    width: 100%;
    height: 100%;
  }
}
@media (max-width: 1279px) and (pointer: coarse), (max-width: 820px) {
  .v2-btn {
    min-height: 44px;
    min-width: 44px;
  }
  /* Beat desktop-dense specificity (min-width 1280 seg/side/pro/edge). */
  .v2-seg .v2-btn,
  .v2-side .v2-btn,
  .v2-ticket .v2-seg .v2-btn,
  .v2-ticket .v2-side .v2-btn,
  .v2-ticket .v2-side button,
  .v2-ticket .v2-otype-tile,
  .v2-ticket .v2-meta-tile,
  .v2-lev-bar,
  .v2-lev-x,
  .v2-lev-acts .v2-btn,
  .v2-ticket .v2-ck,
  .v2-qhint,
  .v2-scr-chip,
  .v2-scr-r,
  .v2-qord-x,
  .v2-qord-pin,
  .v2-qord .v2-ck,
  .v2-qord .v2-edge-btn,
  .v2-qord-acts .v2-btn,
  [data-tile="ticket"] .v2-pro-menu .v2-btn,
  [data-tile="ticket"] .v2-edge-btn,
  .v2-modal .v2-seg .v2-btn,
  .v2-modal [data-ask],
  /* pu-9: merged Book/Trades tabs — book.css ships 33px desktop height. */
  [data-tile="book"] .v2-book-tabs.x-tabs .v2-btn,
  [data-tile="book"] .v2-book-tabs .v2-btn {
    height: 44px;
    min-height: 44px;
  }
  .v2-hd {
    height: 44px;
    flex-basis: 44px;
  }
  .v2-power i {
    height: 44px;
  }
  /* Kit .x-sl ≤560px: two rows of five so each cell is a ≥44px-wide tap target. */
  @media (max-width: 560px) {
    .v2-power {
      grid-template-columns: repeat(5, minmax(44px, 1fr));
    }
  }
  /* Beat desktop field font (13px) so iOS does not zoom on focus. Kit: 16px values. */
  .v2-ticket .v2-field input,
  .v2-ticket .x-field input,
  .v2-field input,
  .x-field input,
  .v2-search input,
  #v2CmdQ,
  #v2MktQ,
  .x-cmd-field input,
  .v2-pop-q input {
    font-size: var(--fs-16);
  }
  /* Ticket fields stay kit 44px tall on phone / coarse pointer. */
  .v2-ticket .v2-field,
  .v2-ticket .x-field,
  .v2-ticket .v2-px-row,
  .v2-ticket .v2-sz-row,
  .v2-ticket .v2-meta-tile,
  .v2-ticket .v2-otype-tile,
  .v2-lev-bar,
  .v2-lev-x,
  .v2-lev-acts .v2-btn,
  .v2-ticket .v2-ck,
  .v2-ticket .v2-side .v2-btn {
    min-height: 44px;
  }
  /* Input height locked to 44 with U14 block below (body.v2-ticket-open…). */
  /* Profile / tab ⌘K cap must meet the 44px tap target (padding alone was ~43). */
  .v2-prof-nav > .v2-cap.x-cmd-btn,
  .v2-tab-nav > .v2-cap.x-cmd-btn,
  .x-cmd-btn {
    min-width: 44px;
    min-height: 44px;
  }
  /* Copy and chart rail are not covered by the bare .v2-btn min size.
     Match nav/acctmenu/profile specificity so width/height beat the 22px desktop rules. */
  .v2-copy,
  [data-tile="nav"] .v2-copy,
  .v2-ac-id .v2-copy,
  .v2-prof-src .v2-copy {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
  /* Phone-adjacent coarse / ≤820: market sheet rows stay ≥44. */
  .v2-pop[data-v2-pop="mkt"] .v2-pop-q {
    min-height: 44px;
  }
  .v2-pop[data-v2-pop="mkt"] .v2-pop-q input,
  .v2-pop[data-v2-pop="mkt"] #v2MktQ {
    min-height: 44px;
    font-size: var(--fs-16);
  }
  .v2-pop[data-v2-pop="mkt"] .v2-pop-list button {
    height: 44px;
    min-height: 44px;
  }
  .v2-mp-r {
    height: 44px;
  }
  .v2-mp-x {
    width: 44px;
    height: 44px;
  }
  .v2-mp-hd {
    height: 44px;
    flex-basis: 44px;
  }
  /* Narrow / coarse: drawing tools are a 44px horizontal strip above the plot.
     min-width: 0 keeps the strip from widening the page (overflow scrolls inside). */
  [data-tile="chart"] .v2-chart-lower {
    flex-direction: column;
    min-width: 0;
  }
  [data-tile="chart"] .v2-chart-tools {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex: 0 0 44px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  [data-tile="chart"] .v2-chart-tools::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tools .x-tip,
  [data-tile="chart"] .v2-chart-tools .v2-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  [data-tile="chart"] .v2-chart-gap {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    min-height: 0;
  }
  [data-tile="chart"] .v2-chart-tools .x-tip [role="tooltip"] {
    left: 0;
    right: auto;
    top: auto;
    bottom: calc(100% + 8px);
    max-width: 240px;
  }
  /* pu-9: desktop chips row is 33px; buttons are 44 here — grow the strip. */
  [data-tile="chart"] .v2-chart-chips {
    flex-wrap: nowrap;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    min-width: 0;
    max-width: 100%;
  }
  [data-tile="chart"] .v2-chart-chips::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tfs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1px;
    background: var(--v2-line);
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  [data-tile="chart"] .v2-chart-tfs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  /* Bottom edge shield catches a tap that WebKit would give to the Long bar. The rail is hidden, so there is no side gutter. */
  .v2-chart-edge {
    pointer-events: auto;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn,
  [data-tile="chart"] .v2-chart-chips .v2-btn {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 auto;
    padding: 0 8px;
    border: 0;
    background: var(--v2-header);
    text-transform: none;
  }
  /* Chart chips (timeframes, indicators): underline bar, not the filled block (see chart.css). */
  [data-tile="chart"] .v2-chart-tfs .v2-btn.on,
  [data-tile="chart"] .v2-chart-tfs .v2-btn.on:hover,
  [data-tile="chart"] .v2-chart-chips .v2-btn.on,
  [data-tile="chart"] .v2-chart-chips .v2-btn.on:hover {
    position: relative;
    background: var(--v2-header);
    color: var(--tx);
    font-weight: 400;
    box-shadow: none;
  }
  .v2-cxm-i {
    min-height: 44px;
  }
  .v2-chart-set-b .v2-btn,
  .v2-chart-set-b .v2-chart-set-row {
    min-height: 44px;
    height: 44px;
    min-width: 0;
    touch-action: manipulation;
  }
  .v2-chart-set .v2-hd {
    min-height: 44px;
    height: 44px;
  }
  .v2-chart-set-tabs.x-tabs button {
    min-height: 44px;
  }
  .v2-chart-set-ft .v2-chart-set-reset {
    min-height: 44px;
    height: 44px;
  }
  .v2-chart-set .v2-chart-set-x {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
  }
  /* U14: market selector is a bare <button>, not .v2-btn — lock 44×44. */
  .v2-mkt,
  [data-tile="stats"] button.v2-mkt {
    min-height: 44px;
    min-width: 44px;
  }
  /* Book tick + rows are buttons; dense desktop heights must not win on phone. */
  [data-tile="book"] .v2-hd .v2-tick,
  .v2-tick {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
  }
  /* Fixed 44px rows; sides scroll so levels do not overlap when the tile is short. */
  /* pu-9: 44px brows must scroll inside each side — not spill asks into bids. */
  [data-tile="book"] .v2-book-pane {
    min-height: 0;
    overflow: hidden;
  }
  [data-tile="book"] .v2-rows {
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  [data-tile="book"] .v2-brow {
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
  }
  /* Investigate chips / acts / address / header zoom. */
  .v2-chips .v2-btn,
  .v2-acts .v2-btn {
    height: 44px;
    min-height: 44px;
    min-width: 44px;
  }
  .v2-inv .v2-addr {
    height: 44px;
    min-height: 44px;
    line-height: 42px;
    font-size: var(--fs-16);
  }
  .v2-inv .v2-hd .v2-btn {
    height: 44px;
    min-height: 44px;
    min-width: 44px;
  }
  /* Profile equity window chips (desktop 22px). */
  .v2-prof-win {
    height: 44px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .v2-prof-win::-webkit-scrollbar {
    display: none;
  }
  .v2-prof-win .v2-btn {
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    flex: 0 0 auto;
  }
  .v2-prof-tile > .v2-hd {
    flex-wrap: wrap;
    row-gap: 0;
    min-height: 44px;
    height: auto;
    max-width: 100%;
    overflow: hidden;
  }
  /* Ticket fields: desktop padding yields ~37px; lock 44 for taps + iOS focus.
     Keep U14 selectors + kit .x-field (U8). */
  .v2-ticket .v2-field input,
  .v2-ticket .x-field input,
  .v2-field input,
  .x-field input,
  body.v2-ticket-open .v2-ticket .v2-field input,
  body.v2-ticket-open .v2-ticket .x-field input {
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
    font-size: var(--fs-16);
  }
  /* Positions share glyph. */
  .pshare {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  /* Investigate graph hd: keep − / + / Fit inside the tile. */
  .v2-inv .v2-hd {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .v2-inv .v2-hd::-webkit-scrollbar {
    display: none;
  }
  .v2-inv .v2-hd .v2-btn {
    flex: 0 0 44px;
  }
  .v2-inv .v2-zoom {
    flex: 0 0 auto;
    min-width: 0;
  }
  /* Wide tables scroll inside the tile — never the page. */
  .v2-prof-table,
  .v2-acct-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .v2-prof-tile .v2-body,
  .v2-account .v2-body,
  .v2-positions .v2-body {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
  }
  /* Connected wallet chip: ellipsis instead of clipping mid-glyph. */
  .v2-nav .v2-wallet-go,
  .v2-prof-nav .v2-wallet-go,
  .v2-inv .v2-wallet-go {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* Short landscape: one 44px TF/ind scroll row (no wrap into the canvas).
   Portrait (#268) is a different query and stays an overlay. */
@media (max-width: 1279px) and (orientation: landscape) and (max-height: 500px) {
  .v2-chart .v2-chart-chips {
    flex-wrap: nowrap;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    align-items: stretch;
    align-content: stretch;
  }
  .v2-chart .v2-chart-chips::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tfs {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    height: 44px;
    max-height: 44px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  [data-tile="chart"] .v2-chart-tfs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn,
  .v2-chart .v2-chart-chips > .v2-btn {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    width: auto;
    min-width: 44px;
    flex: 0 0 auto;
    padding: 0 8px;
    overflow: hidden;
  }
  .v2-chart .v2-chart-chips > .v2-chart-plus {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
  }
  [data-tile="chart"] .v2-chart-ohlc {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    margin-left: 0;
    overflow: hidden;
  }
}
@media (max-width: 767px) {
  html,
  body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    max-width: 100%;
  }
  body {
    display: flex;
    flex-direction: column;
    gap: var(--v2-rule);
    padding-bottom: 0;
    overscroll-behavior: none;
  }
  .v2-grid {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .v2-nav,
  .v2-statrow {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
  }
  /* Collapse tab links into Menu; keep Wallet on the nav row.
     Safe-area padding keeps the logo clear of the status bar. */
  /* One 44px row. Flex items wrap on their max-content basis before they shrink,
     so the 44px copy used to drop Wallet onto a second row. Basis 0 lets the
     address truncate instead. */
  .v2-nav {
    flex-wrap: nowrap;
    align-content: flex-start;
    height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    max-height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    min-height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    padding-top: var(--v2-sa-t);
    box-sizing: border-box;
    overflow: hidden;
    align-items: stretch;
  }
  .v2-nav-fold {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 100%;
    border-right: var(--v2-rule) solid var(--v2-line);
  }
  .v2-nav-more {
    display: flex;
    height: 100%;
    min-height: 44px;
    min-width: 64px;
    padding: 0 12px;
    background: var(--v2-header);
    border: 0;
    cursor: var(--cur-pointer);
  }
  .v2-nav-fold[open] .v2-nav-more,
  .v2-nav-more:hover {
    background: var(--acc-hi);
    color: var(--ink);
    font-weight: 700;
  }
  .v2-nav-fold > .v2-nav-links {
    display: none;
    position: fixed;
    z-index: 96;
    left: var(--v2-sa-l);
    right: var(--v2-sa-r);
    top: calc(var(--v2-sa-t) + var(--v2-nav-h));
    flex-direction: column;
    background: var(--v2-tile);
    border-bottom: var(--v2-rule) solid var(--v2-rose);
  }
  /* HTML starts open for desktop first paint; hide until JS marks the fold ready. */
  .v2-nav-fold.v2-nav-ready[open] > .v2-nav-links {
    display: flex;
  }
  .v2-nav-fold > .v2-nav-links .v2-navb {
    width: 100%;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    border-right: 0;
    border-bottom: var(--v2-rule) solid var(--v2-line);
    justify-content: flex-start;
    padding: 0 14px;
  }
  /* Discord cell (replaced the MAINNET cap, #203) folds with the other caps so the
     connected chip keeps its short-addr budget at 320–393. */
  .v2-nav > .v2-cap:not(.v2-wallet),
  .v2-nav > .v2-discord {
    display: none;
  }
  .v2-nav > .v2-spacer {
    display: none;
  }
  .v2-nav .v2-logo,
  .v2-nav-fold,
  .v2-nav .v2-wallet,
  .v2-nav .v2-wallet-go {
    height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
  }
  .v2-nav .v2-wallet,
  .v2-nav .v2-wallet-go {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-end;
    margin-left: auto;
    border-right: 0;
  }
  /* No wallet: the chip reads CONNECT; size it to its label so it is never cut. */
  .v2-nav .v2-wallet:not(.v2-wallet-fit),
  body.v2-land .v2-nav .v2-wallet:not(.v2-wallet-fit) {
    flex: 0 0 auto;
    max-width: none;
  }
  /* Connected chip overrides flex-end in acctmenu.css (.v2-wallet-fit) so the
     short addr is not clipped on the left. */
  .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go {
    justify-content: flex-start;
  }
  .v2-nav .v2-wallet-addr {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .v2-nav .v2-copy {
    flex: 0 0 44px;
  }
  .v2-nav .v2-wallet-go:has(.v2-wallet-addr:not([hidden])) > [data-i18n] {
    display: none;
  }
  .v2-logo {
    flex-shrink: 0;
  }
  .v2-statrow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Kit 22px values + sparks need more than the old 168px (16px) budget. */
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  [data-tile="stats"] .v2-stat {
    min-height: 72px;
  }
  /* Market search: full-width sheet (not the ~half-cell pop). 44px input + rows. */
  .v2-pop[data-v2-pop="mkt"] {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: calc(var(--v2-vvh, 100dvh) - var(--v2-sa-t) - var(--v2-sa-b) - 140px);
    border: var(--v2-rule) solid var(--acc);
    box-shadow: none;
  }
  .v2-pop[data-v2-pop="mkt"] .v2-pop-q {
    min-height: 44px;
    padding: 0 12px;
  }
  .v2-pop[data-v2-pop="mkt"] .v2-pop-q input,
  .v2-pop[data-v2-pop="mkt"] #v2MktQ {
    width: 100%;
    min-height: 44px;
    font-size: var(--fs-16);
  }
  .v2-pop[data-v2-pop="mkt"] .v2-pop-list button {
    height: 44px;
    min-height: 44px;
  }
  /* Select Market on phone: no MAX column, no key hints (no hotkeys on mobile). */
  .v2-mp-cols,
  .v2-pop-list .v2-mp-r > .v2-mp-pick {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 8px;
  }
  .v2-mp-lev,
  .v2-mp-ft {
    display: none;
  }
  .v2-mp .v2-mp-q .v2-pop-q {
    padding: 0 8px;
  }
  .v2-chart,
  .v2-book,
  .v2-trades,
  .v2-positions,
  .v2-account,
  .v2-ticket {
    display: none;
    height: auto;
    min-height: 0;
  }
  .v2-trades {
    display: none !important;
  }
  body[data-v2-panel="chart"] .v2-chart,
  body[data-v2-panel="book"] .v2-book,
  body[data-v2-panel="trades"] .v2-book,
  body[data-v2-panel="positions"] .v2-positions,
  body[data-v2-panel="account"] .v2-account {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  /* The legend strip must not scroll the chart tile. The tool rail scrolls on its own. */
  body[data-v2-panel="chart"] .v2-chart {
    overflow: hidden;
  }
  body[data-v2-panel="chart"] .v2-chart-tools {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
  }
  /* OHLC lives in the chart header (preview layout). */
  [data-tile="chart"] > .v2-hd .v2-chart-ohlc {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 60%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-left: auto;
    justify-content: flex-end;
    overflow: hidden;
    background: transparent;
  }
  .v2-chart-chips .v2-btn,
  .v2-chart-tfs .v2-btn[data-tf] {
    min-height: 44px;
    height: 44px;
  }
  .v2-chart-chips {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex-basis: 44px;
  }
  .v2-acct-tabs .v2-btn {
    min-height: 44px;
    height: 44px;
  }
  .v2-acct-tabs .v2-acct-sizeall {
    width: 44px;
  }
  /* Positions + Account on the phone: headers, tabs, and expand detail must fit the width. */
  body[data-v2-panel="positions"] .v2-positions .v2-hd,
  body[data-v2-panel="account"] .v2-account .v2-hd {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    gap: 4px;
  }
  body[data-v2-panel="positions"] .v2-acct-sp,
  body[data-v2-panel="positions"] .v2-acct-sw {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-v2-panel="positions"] .v2-positions .v2-body,
  body[data-v2-panel="account"] .v2-account .v2-body {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  /* pu-6: portfolio tabs + data-col position cards (Entry/Mark/Margin hidden). */
  body[data-v2-panel="positions"] .v2-acct-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .v2-btn {
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .x-fill {
    display: none;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .v2-acct-all {
    grid-column: 1 / -1;
    min-width: 0;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .v2-acct-closeall {
    flex: 1 1 auto;
    height: 44px;
    min-height: 44px;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .v2-acct-sizeall {
    flex: 0 0 44px;
    width: 44px;
    border-right: 1px solid var(--line);
  }
  /* Positions tab: CARDS switch and the bolt + CLOSE ALL share the last row. */
  body[data-v2-panel="positions"] .v2-acct-tabs:has(.v2-pos-view) .v2-acct-all {
    grid-column: auto;
  }
  body[data-v2-panel="positions"] .v2-acct-tabs .v2-pos-view {
    justify-content: center;
    border-right: 1px solid var(--line);
  }
  /* Card view on the phone: cards stack full width instead of a sideways hand. */
  .v2-pcards {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: minmax(0, 1fr);
    width: auto;
    padding: 12px 16px 16px 12px;
  }
  .v2-pcard-face {
    min-height: 0;
  }
  .v2-pcard-gap {
    display: none;
  }
  .v2-pcard-foot,
  .v2-pcard-foot .v2-btn,
  .v2-pcard-foot .pshare {
    height: 44px;
    min-height: 44px;
  }
  .v2-pcard-foot .pshare {
    width: 44px;
  }
  .v2-pcard-foot .v2-size-btn {
    width: 44px;
  }
  body[data-v2-panel="positions"] .v2-acct-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table thead {
    display: none;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tbody {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas:
      "mkt side act"
      "sz pnl liq";
    column-gap: 8px;
    row-gap: 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border-bottom: var(--v2-rule) solid var(--v2-line);
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td {
    border-bottom: 0;
    padding: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="mkt"] {
    grid-area: mkt;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="side"] {
    grid-area: side;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="sz"] {
    grid-area: sz;
    text-align: left;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="entry"],
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="mark"],
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="margin"] {
    display: none;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="liq"] {
    grid-area: liq;
    text-align: left;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="pnl"] {
    grid-area: pnl;
    text-align: left;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td[data-col="act"] {
    grid-area: act;
    width: auto;
    text-align: right;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-act {
    width: 64px;
    min-width: 64px;
    height: 44px;
    min-height: 44px;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-act.v2-size-btn {
    width: 44px;
    min-width: 44px;
  }
  /* Expanded detail: one column, full tile width, every receipt row reachable by scroll. */
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-detail {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-detail td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-pos-detail .v2-receipt,
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt .v2-lead {
    display: none;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt b,
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* TP and SL fields share the first line of the strip, half width each. */
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-receipt > div.v2-pos-tpsl {
    flex: 1 0 100%;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding-left: 0;
    border-left: 0;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] tr.v2-pos-detail .v2-tpsl-f {
    flex: 1 1 0;
    width: auto;
  }
  .v2-phone {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: var(--v2-rule);
    position: sticky;
    bottom: 0;
    z-index: 85;
    background: var(--v2-line);
    padding-bottom: var(--v2-sa-b);
  }
  /* Dock: Chart / Book / Positions / Account (trades live under Book tabs). */
  .v2-phone-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .v2-phone-act .v2-btn,
  .v2-phone-tabs .v2-btn {
    height: 44px;
    min-height: 44px;
    min-width: 0;
  }
  /* Active dock tab = bright label + accent underline bar (same as desktop tabs). */
  .v2-phone-tabs .v2-btn.on,
  .v2-phone-tabs .v2-btn.on:hover {
    position: relative;
    background: var(--v2-header);
    border-color: transparent;
    color: var(--tx);
    font-weight: 700;
    box-shadow: none;
  }
  .v2-phone-tabs .v2-btn.on::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    background: var(--acc);
    pointer-events: none;
  }
  .v2-phone-act [data-v2-side="long"],
  .v2-phone-act [data-v2-side="long"]:hover {
    background: var(--v2-buy-hi);
    border-color: var(--v2-buy);
    color: var(--ink);
    font-weight: 700;
    box-shadow: var(--v2-shadow-2) var(--bone);
  }
  .v2-phone-act [data-v2-side="short"],
  .v2-phone-act [data-v2-side="short"]:hover {
    background: var(--v2-sell);
    border-color: var(--v2-sell);
    color: var(--ink);
    font-weight: 700;
    box-shadow: var(--v2-shadow-2) var(--line);
  }
  .v2-phone-act [aria-pressed="true"] {
    outline: 1px solid var(--v2-text);
    outline-offset: -1px;
  }
  .v2-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--v2-veil);
  }
  body.v2-ticket-open .v2-sheet-scrim {
    display: block;
  }
  body.v2-ticket-open .v2-ticket {
    display: flex;
    position: fixed;
    z-index: 80;
    left: var(--v2-sa-l);
    right: var(--v2-sa-r);
    bottom: var(--v2-dock, 0px);
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 220px;
    max-height: min(68dvh, calc(100dvh - var(--v2-sa-t) - var(--v2-dock, 0px) - 8px));
    border-top: var(--v2-rule) solid var(--v2-rose);
    overflow: hidden;
    /* Sit fully above the Long/Short dock so submit is never covered. */
    padding-bottom: 0;
  }
  body.v2-ticket-open .v2-ticket .v2-body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 0;
  }
  /* Pin submit to the sheet footer so the dock never covers it. */
  body.v2-ticket-open .v2-ticket .v2-submit {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: auto;
    background: var(--v2-tile);
    border-top: var(--v2-rule) solid var(--v2-line);
    scroll-margin-bottom: 0;
  }
  body.v2-ticket-open .v2-sheet-x {
    display: flex;
    margin-left: auto;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
  }
  .v2-toast {
    bottom: calc(18px + 44px + var(--v2-rule) + 44px + var(--v2-sa-b));
    max-width: calc(100% - 24px - var(--v2-sa-l) - var(--v2-sa-r));
  }
  /* Ticket sheet submit sits above the phone dock; keep the toast clear of it (H). */
  body.v2-ticket-open .v2-toast {
    bottom: calc(18px + var(--v2-dock, 0px) + 44px + var(--v2-rule) + 8px + var(--v2-sa-b));
  }
  .v2-modal {
    width: min(360px, calc(100vw - var(--v2-sa-l) - var(--v2-sa-r) - 16px));
    max-height: calc(var(--v2-vvh) - var(--v2-sa-t) - var(--v2-sa-b) - 16px);
    overflow: auto;
  }
  .v2-sharepop {
    width: calc(100vw - var(--v2-sa-l) - var(--v2-sa-r) - 16px);
    max-height: calc(var(--v2-vvh) - var(--v2-sa-t) - var(--v2-sa-b) - 16px);
    overflow: auto;
  }
  .v2-share-mascot .v2-btn,
  .v2-share-opts .v2-btn,
  .v2-share-b .v2-btn {
    height: 44px;
    min-height: 44px;
  }
  input,
  textarea,
  select {
    font-size: var(--fs-16);
    scroll-margin-bottom: 24px;
  }
  html.v2-kb body {
    padding-bottom: var(--v2-kb);
  }
  html.v2-kb .v2-phone {
    padding-bottom: 0;
    visibility: hidden;
    pointer-events: none;
  }
  html.v2-kb body.v2-ticket-open .v2-ticket {
    bottom: var(--v2-kb);
    min-height: 0;
    max-height: calc(var(--v2-vvh) - var(--v2-sa-t) - 8px);
    padding-bottom: 0;
  }
  html.v2-kb .v2-toast {
    bottom: calc(18px + var(--v2-kb));
  }
  html.v2-kb body.v2-ticket-open .v2-toast {
    bottom: calc(18px + var(--v2-kb) + 44px + var(--v2-rule));
  }
  html.v2-kb .v2-veil {
    align-items: flex-end;
    padding-bottom: var(--v2-kb);
  }
  /* Positions needs the expanded receipt on screen. Chart, book, and trades stay one screen. */
  html:has(body[data-v2-panel="positions"]),
  html:has(body[data-v2-panel="account"]) {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body[data-v2-panel="positions"],
  body[data-v2-panel="account"] {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
    overflow: visible;
    overscroll-behavior: auto;
  }
  /* Grow to the dock so a short list never leaves the dock floating mid-screen. */
  body[data-v2-panel="positions"] .v2-grid,
  body[data-v2-panel="account"] .v2-grid {
    overflow: visible;
    height: auto;
    flex: 1 0 auto;
  }
  body[data-v2-panel="positions"] .v2-nav,
  body[data-v2-panel="account"] .v2-nav {
    position: sticky;
    top: 0;
    z-index: 40;
  }
  body[data-v2-panel="positions"] .v2-positions,
  body[data-v2-panel="account"] .v2-account {
    flex: 1 0 auto;
    height: auto;
    overflow: visible;
  }
  body[data-v2-panel="positions"] .v2-positions {
    min-height: 280px;
  }
  body[data-v2-panel="account"] .v2-account {
    min-height: 220px;
  }
  body[data-v2-panel="positions"] .v2-positions .v2-body,
  body[data-v2-panel="account"] .v2-account .v2-body,
  body[data-v2-panel="positions"] .v2-acct-scroll {
    overflow: visible;
    height: auto;
    flex: none;
    max-height: none;
  }
  body[data-v2-panel="positions"] .v2-positions .v2-acct-scroll {
    min-height: 160px;
  }
  body[data-v2-panel="positions"] tr.v2-pos-detail {
    scroll-margin-top: calc(var(--v2-nav-h) + 8px);
    scroll-margin-bottom: 120px;
  }
  /* Landing is a scrolling document; keep the phone dock rules off it. */
  body.v2-land {
    display: block;
    height: auto;
    overflow: visible;
    max-width: none;
    overscroll-behavior: auto;
  }
}

/* Narrow phones: free width for the short-addr chip (Trade also has a 44px copy). */
@media (max-width: 340px) {
  .v2-nav .v2-logo,
  .v2-prof-nav .v2-logo {
    padding: 0 8px;
    gap: 4px;
  }
  .v2-nav-more,
  .v2-prof-nav .v2-nav-more {
    min-width: 52px;
    padding: 0 8px;
  }
}

@media (max-width: 900px) {
  /* 431–900, including a phone on its side (844×390). Logo stays 44px tall
     (a 100% basis with no height collapsed it to the 12px line) but shares
     the links row. Wallet stays on that row too: flex-basis 100% dropped it
     onto a third line and grew the header from 61px to 135px. ≤767 overrides. */
  body.v2-tab .v2-tab-nav {
    flex-wrap: wrap;
    height: auto;
    align-content: flex-start;
  }
  body.v2-tab .v2-tab-nav .v2-logo {
    flex: 0 0 auto;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold {
    display: flex;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: var(--v2-nav-h);
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
    height: var(--v2-nav-h);
    max-width: 100%;
  }
  body.v2-tab .v2-tab-nav .v2-navb {
    width: auto;
    flex: 1 1 auto;
    min-width: max-content;
    min-height: 44px;
    height: 44px;
    max-height: 44px;
  }
  body.v2-tab .v2-tab-nav .v2-spacer {
    display: none;
  }
  /* Mid widths: drop Search/Net so Investigate cannot cover ⌘K (also covered at 768+). */
  body.v2-tab .v2-tab-nav > .v2-cap:not(.v2-wallet),
  body.v2-tab .v2-tab-nav > .v2-discord {
    display: none;
  }
  body.v2-tab .v2-tab-nav > .v2-theme {
    flex: 0 0 44px;
    width: 44px;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
  body.v2-tab .v2-tab-nav .v2-wallet {
    flex: 0 0 auto;
    justify-content: center;
    min-width: 0;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    border-top: 0;
  }
  body.v2-tab .v2-tab-nav .v2-wallet-go {
    min-width: 44px;
    max-width: 100%;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* v2 landing breakpoints (default at /v2/). */
@media (max-width: 900px) {
  body.v2-land .v2l-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  body.v2-land .v2l-bar .v2l-brand {
    grid-column: span 2;
  }
  body.v2-land .v2l-hero,
  body.v2-land .v2l-cust {
    grid-template-columns: 1fr;
  }
  body.v2-land .v2l-hero {
    min-height: 0;
    grid-template-rows: auto;
  }
  body.v2-land .v2l-h-main {
    grid-row: auto;
  }
  body.v2-land canvas#v2lCandles {
    flex: none;
    height: 240px;
  }
  body.v2-land .v2l-feat {
    grid-template-columns: repeat(2, 1fr);
  }
  body.v2-land .v2l-f-trade,
  body.v2-land .v2l-f-swap,
  body.v2-land .v2l-f-bridge,
  body.v2-land .v2l-f-inv {
    grid-column: span 2;
    grid-row: auto;
  }
  body.v2-land .v2l-feat .v2l-hatch {
    display: none;
  }
  body.v2-land .v2l-nums {
    grid-template-columns: repeat(2, 1fr);
  }
  body.v2-land .v2l-foot {
    grid-template-columns: 1fr 1fr 1fr;
  }
  body.v2-land .v2l-foot > :nth-child(-n + 2) {
    grid-column: span 3;
  }
}
@media (max-width: 520px) {
  /* Boot status line: tighter tracking on narrow viewports (V4 reference). */
  .v2-boot-lbl {
    letter-spacing: 0;
    max-width: none;
  }
  body.v2-land .v2l-bar {
    grid-template-columns: 1fr 1fr;
  }
  body.v2-land .v2l-bar .v2l-brand {
    grid-column: span 2;
  }
  body.v2-land .v2l-bar .v2l-cta {
    grid-column: span 2;
  }
  body.v2-land .v2l-btns {
    grid-template-columns: 1fr;
  }
  body.v2-land .v2l-f-row {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Chart settings: MAIN / TRADING sections stack in one column. */
  .v2-chart-set-p {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.v2-land .v2l-tick-track,
  body.v2-land .v2l-blink {
    animation: none;
  }
  body.v2-land {
    scroll-behavior: auto;
  }
}
/* Profile page: one column, scroll. Account menu full-width on a phone. */
@media (max-width: 1279px) {
  /* Whole phone range, not only ≤820: <16px ticket fields zoom iOS on focus. */
  .v2-ticket .v2-field input,
  .v2-ticket .x-field input,
  .v2-search input,
  #v2CmdQ,
  #v2MktQ,
  .x-cmd-field input,
  .v2-pop-q input {
    font-size: var(--fs-16);
  }
  .v2-ticket .v2-field,
  .v2-ticket .x-field,
  .v2-ticket .v2-px-row,
  .v2-ticket .v2-sz-row,
  .v2-qord .v2-field,
  .v2-qord .v2-qord-sz,
  .v2-qhint,
  .v2-scr-chip,
  .v2-scr-r,
  .v2-qord-x,
  .v2-qord-pin,
  .v2-qord .v2-ck,
  .v2-qord-acts .v2-btn {
    min-height: 44px;
  }
  body.v2-profile {
    min-width: 0;
  }
  .v2-prof {
    grid-template-columns: minmax(0, 1fr);
  }
  .v2-prof-nav {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--v2-nav-h);
  }
  .v2-prof-stats {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
  .v2-prof-eq,
  .v2-prof-pos,
  .v2-prof-ord,
  .v2-prof-fills,
  .v2-prof-fund,
  .v2-prof-spot,
  .v2-prof-vault {
    grid-column: 1 / -1;
  }
}
@media (max-width: 767px) {
  .v2-prof-nav {
    flex-wrap: nowrap;
    height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    min-height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    overflow: visible;
    padding-top: var(--v2-sa-t);
    box-sizing: border-box;
  }
  .v2-prof-nav .v2-logo,
  .v2-prof-nav .v2-nav-fold,
  .v2-prof-nav .v2-wallet,
  .v2-prof-nav .v2-wallet-go {
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
  }
  .v2-prof-nav .v2-nav-fold {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 100%;
    border-right: var(--v2-rule) solid var(--v2-line);
  }
  .v2-prof-nav .v2-nav-more {
    display: flex;
    height: 100%;
    min-height: 44px;
    min-width: 64px;
    padding: 0 12px;
    background: var(--v2-header);
    border: 0;
    cursor: var(--cur-pointer);
  }
  .v2-prof-nav .v2-nav-fold[open] .v2-nav-more,
  .v2-prof-nav .v2-nav-more:hover {
    background: var(--acc-hi);
    color: var(--ink);
    font-weight: 700;
  }
  .v2-prof-nav .v2-nav-fold > .v2-nav-links {
    display: none;
    position: fixed;
    z-index: 96;
    left: var(--v2-sa-l);
    right: var(--v2-sa-r);
    top: calc(var(--v2-sa-t) + var(--v2-nav-h));
    flex-direction: column;
    background: var(--v2-tile);
    border-bottom: var(--v2-rule) solid var(--v2-rose);
  }
  .v2-prof-nav .v2-nav-fold.v2-nav-ready[open] > .v2-nav-links {
    display: flex;
  }
  .v2-prof-nav .v2-nav-fold > .v2-nav-links .v2-navb {
    width: 100%;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    border-right: 0;
    border-bottom: var(--v2-rule) solid var(--v2-line);
    justify-content: flex-start;
    padding: 0 14px;
  }
  .v2-prof-nav .v2-spacer {
    display: none;
  }
  /* pu-9: match Trade — collapse net/⌘K caps so Wallet keeps a clear 44px hit. */
  .v2-prof-nav > .v2-cap:not(.v2-wallet),
  .v2-prof-nav > .v2-discord {
    display: none;
  }
  .v2-prof-nav .v2-wallet,
  .v2-prof-nav .v2-wallet-go {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-end;
    margin-left: auto;
    border-right: 0;
  }
  .v2-prof-nav .v2-wallet-addr {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .v2-prof-nav .v2-wallet-go:has(.v2-wallet-addr:not([hidden])) > [data-i18n] {
    display: none;
  }
  .v2-prof-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .v2-ac {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  /* pu-9: placePanel() writes inline width≤280 — beat it so the sheet fills the phone. */
  .v2-ac-panel,
  .v2-ac-panel.x-ddm {
    left: var(--v2-sa-l, 0px) !important;
    right: var(--v2-sa-r, 0px) !important;
    width: auto !important;
    max-width: none;
    max-height: none;
    height: calc(var(--v2-vvh, 100dvh) - var(--v2-sa-t, 0px) - var(--v2-nav-h));
    top: calc(var(--v2-sa-t, 0px) + var(--v2-nav-h)) !important;
    border: 0;
    border-top: var(--v2-rule) solid var(--v2-rose);
    box-shadow: none;
  }
  .v2-ac-row,
  .v2-ac-x,
  .v2-prof-nav .v2-navb,
  .v2-prof-nav .v2-wallet-go {
    min-height: 44px;
    height: 44px;
  }
}
@media (max-width: 1279px) {
  body.v2-inv {
    min-width: 0;
    height: auto;
    overflow: auto;
  }
  html:has(body.v2-inv) {
    height: auto;
    overflow: auto;
  }
  .v2-inv-grid {
    width: 100%;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .v2-inv-grid > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .v2-inv .v2-nav {
    height: auto;
  }
  /* Addr on row 1, Trace on row 2. Do not use height:100% on Trace — with
     wrap it becomes the full strip height and overflows under SUBJECT/NET. */
  .v2-inv-trace {
    height: auto;
    flex-wrap: wrap;
    align-items: stretch;
    overflow: visible;
  }
  .v2-inv-trace .v2-addr,
  .v2-inv .v2-addr {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
    margin: 6px 8px;
  }
  .v2-inv-trace [data-act="trace"] {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    border-left: 0;
    border-top: var(--v2-rule) solid var(--v2-line);
  }
  .v2-inv .v2-statrow {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
    z-index: 0;
  }
  .v2-inv-graph,
  .v2-inv-inspect,
  .v2-inv-time {
    min-height: 280px;
  }
  .v2-inv-notes {
    min-height: 160px;
  }
}
@media (max-width: 767px) {
  /* Phone account header has room: one wider fixed box for exchange and wallet alike. */
  [data-tile="account"] .v2-acct-sw {
    width: 198px;
    max-width: 60%;
  }
  html:has(body.v2-inv),
  body.v2-inv {
    height: auto;
    overflow: auto;
    min-width: 0;
  }
  /* Welcome / SINCE tag: stay narrow so it sits in the market value band, not Mark. */
  .v2-boot-xtag {
    max-width: min(280px, calc(100vw - 28px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .v2-flow.on {
    animation: none;
  }
  /* Busy cursor animation (cursors.js) already honors prefers-reduced-motion. */
}
/* Touch / coarse pointers: system cursors only (data-URI set is for fine pointers). */
@media (pointer: coarse), (hover: none) {
  html,
  html * {
    cursor: auto !important;
  }
  html
    :is(
      a,
      button,
      summary,
      label,
      select,
      [role="button"],
      [role="tab"],
      [role="option"],
      .x-chip,
      .x-btn,
      .v2-btn,
      .v2-navb,
      .v2-cap,
      .v2-logo,
      .v2-wallet-go,
      .v2l-cta,
      .v2l-brand,
      .v2l-btn,
      .v2-copy,
      .v2-node,
      .v2-mkt,
      .v2-brow,
      .v2-tick,
      .v2-ac-row,
      .v2-pos-row,
      .v2-nav-more
    ) {
    cursor: pointer !important;
  }
  html :is(input, textarea, [contenteditable="true"], [contenteditable=""]) {
    cursor: text !important;
  }
  html :is(input[type="checkbox"], input[type="radio"]) {
    cursor: pointer !important;
  }
  html :is(button:disabled, [aria-disabled="true"], .is-disabled, .v2-disabled) {
    cursor: not-allowed !important;
  }
  html :is(.cur-cross, canvas.cur-cross) {
    cursor: crosshair !important;
  }
  html :is(.cur-draw) {
    cursor: crosshair !important;
  }
  html :is(.cur-grab, .v2-grab, [data-v2-cursor="grab"]) {
    cursor: grab !important;
  }
  html :is(.cur-grabbing, .cur-grabbing *, .v2-grabbing, .v2-grab:active, [data-v2-cursor="grabbing"]) {
    cursor: grabbing !important;
  }
  html :is(.cur-ew, .x-sl, .x-lvs, [role="slider"]) {
    cursor: ew-resize !important;
  }
  html :is(.cur-ns, .v2-chart-cv.is-price-axis, .v2-chart-cv.is-price-axis *) {
    cursor: ns-resize !important;
  }
  html :is(.cur-move) {
    cursor: move !important;
  }
  html :is(.cur-zoom) {
    cursor: zoom-in !important;
  }
  html :is(.cur-copy, [data-copy]) {
    cursor: copy !important;
  }
  html :is(.cur-help, [data-help], abbr[title]) {
    cursor: help !important;
  }
  html.cur-busy,
  html.cur-busy * {
    cursor: progress !important;
  }
}
/* Portrait phones: one 44px row for timeframes + indicator chips, scrolled sideways.
   The legend overlays the plot so it does not add a second row or spill past 320px.
   Short landscape (PR #256) clamps chips on its own query; this block does not match it.
   A fixed 24px nowrap chip row (PR #261) stays the desktop/tablet rule; these selectors win here. */
@media (max-width: 767px) and (orientation: portrait) {
  [data-tile="chart"] .v2-chart-chips {
    flex-wrap: nowrap;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    position: relative;
    min-width: 0;
    max-width: 100%;
  }
  [data-tile="chart"] .v2-chart-chips::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tfs {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: stretch;
    min-width: 0;
    height: 44px;
    max-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  [data-tile="chart"] .v2-chart-tfs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn[data-tf] {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn[data-ind] {
    width: auto;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 8px;
    text-transform: uppercase;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-chart-plus {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn[data-ind]:not(.on),
  [data-tile="chart"] .v2-chart-tfs .v2-chart-plus:not(.on) {
    background: var(--v2-tile);
  }
  /* pu-9: OHLC lives in the tile header (preview). Do not pull it under the chips. */
  [data-tile="chart"] > .v2-hd .v2-chart-ohlc {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 55%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 0 0 auto;
    padding: 0 4px;
    overflow: hidden;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }
  [data-tile="chart"] .v2-chart-msg {
    top: 8px;
    max-width: calc(100% - 16px);
    flex-wrap: wrap;
  }
}

/* Swap / Bridge phone nav. After the 900px wrap so ≤767 wins.
   Same row as Trade (.v2-nav) and Profile (.v2-prof-nav): logo, Menu, Wallet.
   Scoped to .v2-tab-nav so those two bars can change on their own. */
@media (max-width: 767px) {
  body.v2-tab .v2-tab-nav {
    flex-wrap: nowrap;
    align-items: stretch;
    align-content: flex-start;
    height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    min-height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    max-height: calc(var(--v2-nav-h) + var(--v2-sa-t));
    margin: 0;
    max-width: none;
    width: 100%;
    padding-top: var(--v2-sa-t);
    box-sizing: border-box;
    overflow: hidden;
    border: 0;
    background: var(--v2-header);
  }
  body.v2-tab .v2-tab-main {
    margin-top: 0;
    border-top: var(--v2-rule) solid var(--v2-line);
  }
  body.v2-tab .v2-tab-nav .v2-logo,
  body.v2-tab .v2-tab-nav .v2-nav-fold,
  body.v2-tab .v2-tab-nav .v2-wallet,
  body.v2-tab .v2-tab-nav .v2-wallet-go {
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
  body.v2-tab .v2-tab-nav .v2-logo {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    border-right: var(--v2-rule) solid var(--v2-line);
    border-bottom: 0;
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: var(--v2-nav-h);
    border-right: var(--v2-rule) solid var(--v2-line);
  }
  body.v2-tab .v2-tab-nav .v2-nav-more {
    display: flex;
    height: 100%;
    min-height: 44px;
    min-width: 64px;
    padding: 0 12px;
    background: var(--v2-header);
    border: 0;
    cursor: var(--cur-pointer);
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold[open] .v2-nav-more,
  body.v2-tab .v2-tab-nav .v2-nav-more:hover {
    background: var(--acc-hi);
    color: var(--ink);
    font-weight: 700;
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links {
    display: none;
    position: fixed;
    z-index: 96;
    left: var(--v2-sa-l);
    right: var(--v2-sa-r);
    top: calc(var(--v2-sa-t) + var(--v2-nav-h));
    flex-direction: column;
    flex-wrap: nowrap;
    height: auto;
    max-width: none;
    background: var(--v2-tile);
    border-bottom: var(--v2-rule) solid var(--v2-rose);
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold.v2-nav-ready[open] > .v2-nav-links {
    display: flex;
  }
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links .v2-navb {
    width: 100%;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: none;
    min-width: 0;
    border-right: 0;
    border-bottom: var(--v2-rule) solid var(--v2-line);
    justify-content: flex-start;
    padding: 0 14px;
  }
  body.v2-tab .v2-tab-nav .v2-spacer {
    display: none;
  }
  /* Match Trade/Profile phone: drop Search/Net so nav links never cover ⌘K. */
  body.v2-tab .v2-tab-nav > .v2-cap:not(.v2-wallet),
  body.v2-tab .v2-tab-nav > .v2-discord {
    display: none;
  }
  body.v2-tab .v2-tab-nav .v2-wallet,
  body.v2-tab .v2-tab-nav .v2-wallet-go {
    flex: 1 1 0;
    min-width: 44px;
    overflow: hidden;
    justify-content: flex-end;
    margin-left: auto;
    border-top: 0;
    border-right: 0;
  }
  body.v2-tab .v2-tab-nav .v2-wallet {
    padding-right: 14px;
    padding-left: 8px;
  }
  body.v2-tab .v2-tab-nav .v2-wallet-go {
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body.v2-tab .v2-tab-nav .v2-wallet-addr {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.v2-tab .v2-tab-nav .v2-wallet-go:has(.v2-wallet-addr:not([hidden])) > [data-i18n] {
    display: none;
  }
}

/* Short landscape phones (667×375, 844×390). The one-row nav is max-width 767px,
   so a sideways phone wraps Wallet onto a second row. Keep a single 44px row and
   scroll the links. Portrait and desktop do not match this query. */
@media (max-width: 1279px) and (orientation: landscape) and (max-height: 500px) {
  .v2-nav,
  .v2-prof-nav,
  .v2-inv .v2-nav,
  body.v2-tab .v2-tab-nav {
    flex-wrap: nowrap;
    align-items: stretch;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    overflow: hidden;
  }
  /* Hide Search/Net caps so Bridge / Investigate cannot cover ⌘K at 667×375. */
  .v2-nav > .v2-cap:not(.v2-wallet),
  .v2-prof-nav > .v2-cap:not(.v2-wallet),
  .v2-inv .v2-nav > .v2-cap:not(.v2-wallet),
  body.v2-tab .v2-tab-nav > .v2-cap:not(.v2-wallet) {
    display: none;
  }
  .v2-nav > .v2-spacer,
  .v2-prof-nav .v2-spacer,
  body.v2-tab .v2-tab-nav .v2-spacer {
    flex: 1 1 0;
    min-width: 0;
  }
  .v2-nav-fold,
  .v2-prof-nav .v2-nav-fold,
  body.v2-tab .v2-tab-nav .v2-nav-fold {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: var(--v2-nav-h);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  .v2-nav-fold::-webkit-scrollbar,
  .v2-prof-nav .v2-nav-fold::-webkit-scrollbar,
  body.v2-tab .v2-tab-nav .v2-nav-fold::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  .v2-nav-fold > .v2-nav-links,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links,
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: max-content;
    min-width: 0;
    max-width: none;
    height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    overflow: visible;
  }
  .v2-nav-fold > .v2-nav-links .v2-navb,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links .v2-navb,
  body.v2-tab .v2-tab-nav .v2-navb {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
  .v2-nav > .v2-logo,
  .v2-nav > .v2-cap,
  .v2-nav > .v2-wallet,
  .v2-nav > .v2-wallet.v2-wallet-fit,
  .v2-prof-nav .v2-logo,
  .v2-prof-nav .v2-wallet,
  .v2-prof-nav .v2-wallet.v2-wallet-fit,
  .v2-inv .v2-nav .v2-wallet.v2-wallet-fit,
  body.v2-tab .v2-tab-nav .v2-logo,
  body.v2-tab .v2-tab-nav .v2-wallet,
  body.v2-tab .v2-tab-nav .v2-wallet.v2-wallet-fit,
  body.v2-tab .v2-tab-nav .v2-wallet-go {
    flex: 0 0 auto;
    max-width: none;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
}

/* Indicator picker rows. Desktop stays 30px in chart.css. Phones and coarse
   pointers use the same 44px tap target as the other v2 controls. */
@media (max-width: 1279px) and (pointer: coarse), (max-width: 820px) {
  .v2-chart-pick .v2-btn {
    height: 44px;
    min-height: 44px;
  }
}
/* Connect / Enable trading on a phone: Cancel, Enable, Open wallet are tap targets too. */
@media (max-width: 1279px) and (pointer: coarse), (max-width: 820px) {
  #tdModal .btn,
  #tdModal .btnw,
  #tdModal .tpgo {
    height: 44px;
    min-height: 44px;
  }
}

/* Desktop dense chrome (anh): seg 30px, side 42px. Kit 44px is the default below
   1280 / on touch; this min-width block is the only place those dense heights live. */
@media (min-width: 1280px) {
  .v2-seg .v2-btn {
    height: 30px;
    min-height: 30px;
  }
  .v2-side .v2-btn {
    height: 42px;
    min-height: 42px;
  }
  /* Place-order otype + meta tiles stay kit 44. */
  .v2-ticket .v2-otype-tile,
  .v2-ticket .v2-meta-tile {
    height: 44px;
    min-height: 44px;
  }
  [data-tile="ticket"] .v2-pro-menu .v2-btn {
    height: 30px;
    min-height: 30px;
  }
  [data-tile="ticket"] .v2-edge-btn {
    min-height: 42px;
  }
  /* Chart VIEW chip: book + ticket leave the grid, chart spans all 12 columns.
     Desktop only; below 1280 the panels are tabs/sheets and the chip is hidden. */
  body[data-v2-view="wide"]:not([data-v2-viewanim]) .v2-book,
  body[data-v2-view="wide"]:not([data-v2-viewanim]) .v2-ticket {
    display: none;
  }
  body[data-v2-view="wide"] .v2-chart {
    grid-column: 1 / 13;
  }
  /* VIEW wide also lifts the chart into the stats band: the stats row collapses to one
     33px line per tile (label · value). Sparklines, ratio bars and sub-labels hide.
     --v2-stat-full keeps the token height for the slide below (read at body, above the
     .v2-grid override). */
  body[data-v2-view="wide"] {
    --v2-stat-full: var(--v2-stat-h);
  }
  body[data-v2-view="wide"] .v2-grid {
    --v2-stat-h: 33px;
  }
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] > .v2-stat:not([hidden]),
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] button.v2-mkt {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] > .v2-stat:not([hidden]) {
    padding: 0 12px;
  }
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .v2-lbl ~ .v2-lbl,
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .x-spk,
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .x-hs,
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .v2-ratio {
    display: none;
  }
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .v2-stat .v2-val,
  body[data-v2-view="wide"]:not([data-v2-viewanim]) [data-tile="stats"] .v2-mark-val {
    font-size: var(--fs-22);
    line-height: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* VIEW slide (chart.js): the wide chart sits over book + ticket and its right edge steps
     across them as a block slide. 6 steps, 240ms. Reduced motion skips it in JS. */
  body[data-v2-viewanim] .v2-chart {
    z-index: 2;
    animation: v2-view-grow 240ms var(--st-6) both;
  }
  body[data-v2-viewanim="shrink"] .v2-chart {
    animation-name: v2-view-shrink;
  }
  /* Upward half of the slide: the grid row is already 33px (one canvas resize), and the
     full stats strip overlays the chart top at its token height, its bottom edge stepping
     between the full and compact heights. The compact content swaps in when it ends. */
  body[data-v2-viewanim] [data-tile="stats"] {
    position: relative;
    z-index: 3;
    align-self: start;
    height: var(--v2-stat-full);
    animation: v2-view-lift 240ms var(--st-6) both;
  }
  body[data-v2-viewanim="shrink"] [data-tile="stats"] {
    animation-name: v2-view-drop;
  }
  @keyframes v2-view-lift {
    from {
      clip-path: inset(0 0 0 0);
    }
    to {
      clip-path: inset(0 0 calc(var(--v2-stat-full) - var(--v2-stat-h)) 0);
    }
  }
  @keyframes v2-view-drop {
    from {
      clip-path: inset(0 0 calc(var(--v2-stat-full) - var(--v2-stat-h)) 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }
  @keyframes v2-view-grow {
    from {
      clip-path: inset(0 var(--v2-view-cut, 0px) 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }
  @keyframes v2-view-shrink {
    from {
      clip-path: inset(0 0 0 0);
    }
    to {
      clip-path: inset(0 var(--v2-view-cut, 0px) 0 0);
    }
  }
  /* Portfolio fold (layout.js): the arrow shows on desktop only. Folded, the portfolio keeps its
     title strip (layout.js sizes the row) and the chevron points up; VIEW wide folds the account
     with it because both share one bottom cut. */
  .v2-posfold {
    display: flex;
  }
  body[data-v2-pos-folded] .v2-posfold .x-ico {
    transform: rotate(180deg);
  }
  body[data-v2-pos-folded] .v2-positions > .v2-body,
  body[data-v2-pos-folded][data-v2-view="wide"]:not([data-v2-super]) .v2-account > .v2-body {
    display: none;
  }
  /* Panel layout (layout.js): data-v2-lay carries the stored split or the fit default. */
  .v2-rsz:not([hidden]) {
    display: block;
  }
  .v2-grid[data-v2-lay] {
    grid-template-columns: var(--v2-lay-cols);
    grid-template-rows: var(--v2-nav-h) var(--v2-stat-h) var(--v2-lay-rows);
  }
  .v2-grid[data-v2-lay] > .v2-chart {
    grid-area: var(--v2-lay-chart);
  }
  .v2-grid[data-v2-lay] > .v2-book {
    grid-area: var(--v2-lay-book);
  }
  .v2-grid[data-v2-lay] > .v2-ticket {
    grid-area: var(--v2-lay-ticket);
  }
  .v2-grid[data-v2-lay] > .v2-positions {
    grid-area: var(--v2-lay-positions);
  }
  .v2-grid[data-v2-lay] > .v2-account {
    grid-area: var(--v2-lay-account);
  }
  /* First paint before layout.js runs: the same fit default in CSS (layout.js FIT), so the
     panels do not jump when it sets data-v2-lay. Bottom heights are shares of the space under
     the market strip (--v2-fit-m); the taller bottom spans two rows (portfolio from 866px high). */
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) {
    --v2-fit-m: calc(100vh - var(--v2-nav-h) - var(--v2-stat-h) - 2px);
    --v2-fit-bl: clamp(176px, calc(var(--v2-fit-m) * 0.3), 396px);
    --v2-fit-br: clamp(220px, calc(var(--v2-fit-m) * 0.22), 308px);
    grid-template-columns: minmax(0, 1fr) clamp(220px, 15%, 330px) clamp(286px, 17%, 396px);
    grid-template-rows:
      var(--v2-nav-h) var(--v2-stat-h) minmax(0, 1fr) max(0px, calc(var(--v2-fit-br) - var(--v2-fit-bl) - 1px))
      var(--v2-fit-bl);
  }
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-chart {
    grid-area: 3 / 1 / 5 / 2;
  }
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-book {
    grid-area: 3 / 2 / 5 / 3;
  }
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-ticket {
    grid-area: 3 / 3 / 4 / 4;
  }
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-positions {
    grid-area: 5 / 1 / 6 / 3;
  }
  body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-account {
    grid-area: 4 / 3 / 6 / 4;
  }
  @media (min-height: 866px) {
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) {
      grid-template-rows:
        var(--v2-nav-h) var(--v2-stat-h) minmax(0, 1fr) max(0px, calc(var(--v2-fit-bl) - var(--v2-fit-br) - 1px))
        var(--v2-fit-br);
    }
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-chart {
      grid-area: 3 / 1 / 4 / 2;
    }
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-book {
      grid-area: 3 / 2 / 4 / 3;
    }
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-ticket {
      grid-area: 3 / 3 / 5 / 4;
    }
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-positions {
      grid-area: 4 / 1 / 6 / 3;
    }
    body:not([data-v2-view="wide"]):not([data-v2-super]) .v2-grid:not([data-v2-lay]) > .v2-account {
      grid-area: 5 / 3 / 6 / 4;
    }
  }
  /* Confirm stays kit primary height (not dense 30). */
  [data-tile="ticket"] .v2-submit .v2-btn,
  .v2-ticket .v2-submit .v2-btn {
    height: 46px;
    min-height: 44px;
  }
}

@media (max-width: 1279px) {
  .v2-chart-chips .v2-chart-view {
    display: none;
  }
}

/* U11 menus: kit stack breakpoint. Account rows + chart context items ≥44 on narrow. */
@media (max-width: 767px) {
  .v2-ac-row {
    min-height: 44px;
    padding: 0 4px;
  }
  .v2-cxm-i {
    min-height: 44px;
  }
}

/* ===== pu-9: preview terminal grid — <768 phone + 768 tablet =====
   Preview order: nav → stats → chart → book → ticket → positions → account.
   Phone (≤767) keeps the one-panel switcher + Long/Short sheet; tabs are
   Chart / Book / Positions / Account. Tablet (≥768, <1280) pairs book|ticket. */
@media (max-width: 1279px) {
  /* Preview panel order (DOM has trades after account; keep it last/hidden). */
  .v2-grid > .v2-nav {
    order: 1;
  }
  .v2-grid > .v2-statrow {
    order: 2;
  }
  .v2-grid > .v2-chart {
    order: 3;
  }
  .v2-grid > .v2-book {
    order: 4;
  }
  .v2-grid > .v2-ticket {
    order: 5;
  }
  .v2-grid > .v2-positions {
    order: 6;
  }
  .v2-grid > .v2-account {
    order: 7;
  }
  .v2-grid > .v2-trades {
    order: 99;
  }
  .v2-grid,
  .v2-grid > * {
    min-width: 0;
    max-width: 100%;
  }
  html,
  body {
    overflow-x: hidden;
  }
}

/* pu-9: 768–1279 — preview tablet: chart full, book|ticket, then pos, then acct. */
@media (min-width: 768px) and (max-width: 1279px) {
  /* Keep topbar one 44px row so Wallet never lands on the stats strip. */
  .v2-nav,
  .v2-prof-nav,
  body.v2-tab .v2-tab-nav {
    flex-wrap: nowrap;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    overflow: hidden;
  }
  .v2-nav > .v2-cap.x-cmd-btn,
  .v2-nav > .v2-cap.v2-net,
  .v2-prof-nav > .v2-cap.x-cmd-btn,
  .v2-prof-nav > .v2-cap.v2-net,
  body.v2-tab .v2-tab-nav > .v2-cap.x-cmd-btn,
  body.v2-tab .v2-tab-nav > .v2-cap.v2-net {
    display: none;
  }
  .v2-nav .v2-nav-fold,
  .v2-prof-nav .v2-nav-fold {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .v2-nav .v2-nav-more,
  .v2-prof-nav .v2-nav-more {
    display: none;
  }
  .v2-nav .v2-nav-fold > .v2-nav-links,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links {
    display: flex;
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    height: var(--v2-nav-h);
  }
  .v2-nav .v2-wallet,
  .v2-nav .v2-wallet-go,
  .v2-prof-nav .v2-wallet,
  .v2-prof-nav .v2-wallet-go {
    flex: 0 0 auto;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
  }
  .v2-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: none;
    gap: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow-x: hidden;
  }
  .v2-grid > .v2-nav,
  .v2-grid > .v2-statrow,
  .v2-grid > .v2-chart,
  .v2-grid > .v2-positions,
  .v2-grid > .v2-account {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .v2-grid > .v2-book {
    grid-column: 1 / 2 !important;
    grid-row: auto !important;
    min-width: 0;
    max-width: 100%;
    height: 520px;
    max-height: 520px;
    overflow: hidden;
  }
  .v2-grid > .v2-ticket {
    grid-column: 2 / 3 !important;
    grid-row: auto !important;
    display: flex;
    min-width: 0;
    max-width: 100%;
    height: 520px;
    max-height: 520px;
    overflow: hidden;
  }
  .v2-grid > .v2-ticket .v2-body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .v2-grid > .v2-book .v2-body,
  .v2-grid > .v2-book .v2-book-pane {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
  .v2-grid > .v2-book .v2-rows {
    min-width: 0;
    min-height: 0;
    flex: 1 1 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .v2-grid > .v2-chart {
    height: 560px;
    max-height: 560px;
    overflow: hidden;
  }
  .v2-grid > .v2-chart .v2-body,
  .v2-grid > .v2-chart .v2-chart-chips {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .v2-grid > .v2-positions {
    min-height: 300px;
  }
  .v2-grid > .v2-account {
    min-height: 220px;
  }
  .v2-grid > .v2-trades {
    display: none !important;
    grid-column: 1 / -1 !important;
  }
  /* 44px taps on the tablet stack (beat book.css / chart.css 33px denseness). */
  .v2-btn,
  [data-tile="book"] .v2-book-tabs.x-tabs .v2-btn,
  [data-tile="book"] .v2-book-tabs .v2-btn,
  .v2-book-tabs .v2-btn,
  .v2-side .v2-btn,
  .v2-seg .v2-btn,
  .v2-acct-tabs .v2-btn,
  .v2-mkt,
  [data-tile="stats"] button.v2-mkt,
  .v2-tick,
  [data-tile="book"] .v2-hd .v2-tick {
    min-height: 44px;
    height: 44px;
  }
  .v2-acct-tabs .v2-acct-sizeall {
    width: 44px;
  }
  .v2-acct-table td.v2-act .v2-size-btn,
  .v2-pcard-foot .v2-size-btn {
    width: 44px;
    min-width: 44px;
  }
  [data-tile="chart"] .v2-chart-chips,
  [data-tile="chart"] .v2-chart-tfs {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex-basis: 44px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  [data-tile="chart"] .v2-chart-chips .v2-btn,
  [data-tile="chart"] .v2-chart-tfs .v2-btn {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
  }
  /* Book rows stay flexible at tablet — 20×44px cannot fit a 520px ask|bid split. */
  [data-tile="book"] .v2-rows {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* pu-2: lock BOOK/TRADES tab height (not only min-height) on tablet. */
  [data-tile="book"] .v2-book-tabs .v2-btn {
    height: 44px;
  }
  .v2-ticket .v2-field input,
  .v2-field input,
  [data-tile="ticket"] .v2-field input {
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
    font-size: var(--fs-16);
  }
  /* One-row nav at tablet width so the wallet chip does not sit on the stats. */
  .v2-nav {
    flex-wrap: nowrap;
    height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    overflow: hidden;
  }
  .v2-nav > .v2-logo,
  .v2-nav > .v2-navb,
  .v2-nav > .v2-cap,
  .v2-nav > .v2-wallet,
  .v2-nav > .v2-wallet-go {
    height: var(--v2-nav-h);
    max-height: var(--v2-nav-h);
    min-height: var(--v2-nav-h);
  }
}

/* pu-9: phone ≤767 — no page h-scroll; panels stay in-tile. */
@media (max-width: 767px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .v2-grid,
  .v2-nav,
  .v2-statrow,
  .v2-chart,
  .v2-book,
  .v2-ticket,
  .v2-positions,
  .v2-account,
  .v2-phone {
    max-width: 100%;
    min-width: 0;
  }
  .v2-phone-act .v2-btn,
  .v2-phone-tabs .v2-btn {
    min-height: 44px;
    height: 44px;
  }
}

/* pu-5: wallet chip + account menu taps ≥44px */
@media (max-width: 767px) {
  .v2-nav .v2-wallet,
  .v2-nav .v2-wallet-go,
  .v2-prof-nav .v2-wallet,
  .v2-prof-nav .v2-wallet-go,
  .v2-tab-nav .v2-wallet,
  .v2-tab-nav .v2-wallet-go {
    min-height: 44px;
  }
  .v2-ac-x,
  .v2-ac-id .v2-copy {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

/* Adjust leverage: bottom sheet. Keep the 4px rose shadow inside the viewport. */
@media (max-width: 767px) {
  .v2-lev-veil {
    align-items: flex-end;
    justify-content: center;
    padding: 8px 8px calc(8px + var(--v2-sa-b, 0px));
  }
  .v2-lev-veil .v2-lev-mod {
    width: 100%;
    max-width: none;
    max-height: calc(var(--v2-vvh, 100%) - var(--v2-sa-t, 0px) - var(--v2-sa-b, 0px) - 16px);
    overflow: auto;
  }
  .v2-lev-x,
  .v2-lev-acts .v2-btn,
  .v2-lev-bar {
    min-height: 44px;
  }
  .v2-lev-x {
    min-width: 44px;
  }
  html.v2-kb .v2-lev-veil {
    padding-bottom: calc(8px + var(--v2-kb, 0px));
  }
}

/* Chart grid (chart/grid.js), super mode (chart/super.js) and VIEW are desktop-only: no layout chip, menu,
   extra panels, SUPER / VIEW chip or super page below 1280px. */
@media (max-width: 1279px) {
  .v2-sup-chip,
  .v2-view-chip,
  .v2-super-bar,
  .v2-super,
  .v2-chart-chips .v2-chart-grid,
  .v2-cgrid-menu,
  .v2-cgrid-coins,
  .v2-cpanel {
    display: none;
  }
}

/* /tournament: stack the bento. Phone still uses the shared Menu fold (≤430). */
@media (max-width: 1279px) {
  html:has(body.v2-tour),
  body.v2-tour {
    min-width: 0;
    height: auto;
    overflow: auto;
    display: block;
  }
  .v2-tour-grid {
    width: 100%;
    height: auto;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .v2-tour-grid > .v2-nav,
  .v2-tour-hero,
  .tn-main,
  .tn-charts {
    grid-column: 1;
    grid-row: auto;
  }
  /* Shared chart on top, then the seats as one column of 44px-tap tiles. */
  .tn-main {
    min-height: 360px;
  }
  .tn-charts {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }
  .tn-chart {
    flex: 0 0 auto;
  }
  .tn-cv {
    min-height: 300px;
  }
}
@media (max-width: 767px) {
  .v2-tour-hero .v2-body {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 12px;
    white-space: normal;
  }
  .tn-fx-big {
    font-size: var(--fs-33);
  }
  .tn-fx-leader .tn-fx-big,
  .tn-fx-sprint .tn-fx-big {
    font-size: var(--fs-22);
  }
  .tn-race-replay {
    min-height: 44px;
  }
  .tn-fx-sub {
    font-family: var(--pix);
    font-size: var(--fs-11);
  }
  /* Keep "Paper · nothing signed" on a phone; clip with an ellipsis if the row is short. */
  .v2-tour-hero .v2-hd .tn-paper {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Live / Bracket tabs take 44px taps; bracket rounds stack top to bottom. */
  .tn-tabs .v2-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
  }
  .tn-brk-cols {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }
  .tn-brk-col {
    max-width: none;
  }
  .tn-brk-col + .tn-brk-col::before {
    top: -23px;
    left: 22px;
    width: 2px;
    height: 22px;
  }
}

/* /tournament/admin: one column. The bar wraps so room and lock stay 44px. */
@media (max-width: 767px) {
  .tn-bar {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
  }
  .tn-desk {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Setup, codes and round controls first on a phone; the room table follows. */
  .tn-desk > .tn-col:last-child {
    order: -1;
  }
  .tn-room {
    flex: 1 1 120px;
    width: auto;
  }
  .tn-syms,
  .tn-row {
    flex-wrap: wrap;
  }
  .tn-syms .tn-field,
  .tn-row .tn-field {
    flex: 1 1 140px;
  }
}

/* 404: one column on a phone. The hatch tile becomes a bottom strip. */
@media (max-width: 767px) {
  body.v2-nf .v2-nf-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 88px;
  }
  body.v2-nf .v2-nf-side .v2-hd {
    display: none;
  }
  body.v2-nf .v2-nf-cta .v2-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Rail collapse arrow is desktop-only. Narrow screens keep the scrolling tool strip. */
@media (prefers-reduced-motion: reduce) {
  .v2-tip-delay [role="tooltip"] {
    transition: none;
  }
}
@media (max-width: 1279px) and (pointer: coarse), (max-width: 820px) {
  .v2-chart-chips .v2-chart-rail {
    display: none;
  }
}

/* Phone: the drawing strip folds to one pen cell in the plot's top-left corner, so the plot
   keeps the strip's 44px row. The pen opens the full strip (pen = filled block) and folds it. */
@media (max-width: 767px) {
  [data-tile="chart"] .v2-chart-tools .v2-chart-pen {
    display: inline-flex;
    border-right: 1px solid var(--line);
  }
  [data-tile="chart"] .v2-chart-tools.v2-tools-fold {
    position: absolute;
    top: 0;
    left: 0;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    flex: none;
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  [data-tile="chart"] .v2-chart-tools.v2-tools-fold > :not(.v2-chart-pen) {
    display: none;
  }
  [data-tile="chart"] .v2-chart-tools.v2-tools-fold .v2-chart-pen {
    border-right: 0;
  }
}

/* Phone hero strip: the stats row folds to one 44px line (market · mark · 24h)
   so the chart sits right under the topbar. STATS opens the full 2-column grid. */
@media (max-width: 767px) {
  .v2-grid > .v2-statrow:not(.v2-mstats-on) {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    overflow: hidden;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    gap: 8px;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat:nth-of-type(n + 4) {
    display: none;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat.v2-selector {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat:not(.v2-selector) {
    padding: 0 8px;
  }
  .v2-statrow:not(.v2-mstats-on) button.v2-mkt {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    height: 44px;
    padding: 0 12px;
  }
  .v2-statrow:not(.v2-mstats-on) .v2-mk-row {
    align-self: center;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat > .v2-lbl,
  .v2-statrow:not(.v2-mstats-on) button.v2-mkt > .v2-lbl,
  .v2-statrow:not(.v2-mstats-on) .x-spk,
  .v2-statrow:not(.v2-mstats-on) .x-hs {
    display: none;
  }
  .v2-statrow:not(.v2-mstats-on) .v2-mk-row .v2-val {
    font-size: var(--fs-22);
    line-height: 1.25;
  }
  /* Mark + 24h read as data in the strip: mono, tabular. */
  .v2-statrow:not(.v2-mstats-on) > .v2-stat:not(.v2-selector) .v2-val {
    font-family: var(--mono);
    font-size: var(--fs-13);
    font-variant-numeric: tabular-nums slashed-zero;
    line-height: 1.25;
    -webkit-font-smoothing: auto;
  }
  .v2-statrow:not(.v2-mstats-on) > .v2-stat--mark .v2-val {
    font-size: var(--fs-16);
    font-weight: 700;
  }
  .v2-statrow.v2-mstats-on {
    max-height: none;
    overflow: visible;
  }
  .v2-mstats-go {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 66px;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    background: var(--v2-header);
    color: var(--v2-muted);
  }
  .v2-statrow.v2-mstats-on .v2-mstats-go {
    grid-column: 1 / -1;
    background: var(--acc-hi);
    color: var(--ink);
  }
  /* Positions / Account are not about one market: drop the strip, give the list the room. */
  body[data-v2-panel="positions"] .v2-grid > .v2-statrow,
  body[data-v2-panel="account"] .v2-grid > .v2-statrow {
    display: none;
  }
}
/* Sideways phone: the strip costs a quarter of the height. Keep the chart, drop the strip. */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 500px) {
  .v2-grid > .v2-statrow:not(.v2-mstats-on) {
    display: none;
  }
}

/* Account wallet list: 44px taps on touch (pick + disconnect). */
@media (pointer: coarse) {
  .v2-acct-pop .v2-pop-list .v2-acct-wrow > button,
  .v2-acct-pop .v2-pop-list .v2-acct-wadd {
    height: 44px;
    min-height: 44px;
  }
  .v2-acct-pop .v2-pop-list .v2-acct-rn,
  .v2-acct-pop .v2-pop-list .v2-acct-wx {
    flex-basis: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .v2-acct-pop .v2-pop-list .v2-acct-wx {
    width: 44px;
  }
  /* Chart LIVE jump: 44px tap. */
  .v2-chart-live {
    height: 44px;
    min-height: 44px;
  }
}

/* Phone: theme cell leaves the bar and sits in the Menu fold as 44px rows. */
@media (max-width: 430px) {
  .v2-nav > .v2-theme,
  .v2-prof-nav > .v2-theme,
  .v2-tab-nav > .v2-theme,
  .v2-inv .v2-nav > .v2-theme {
    display: none;
  }
  .v2-nav-fold > .v2-nav-links > .v2-theme-fold,
  .v2-prof-nav .v2-nav-fold > .v2-nav-links > .v2-theme-fold,
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links > .v2-theme-fold {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    flex: 0 0 44px;
    height: 44px;
    min-height: 44px;
    max-height: none;
    min-width: 0;
    padding: 0 14px;
    border: 0;
    border-bottom: var(--v2-rule) solid var(--v2-line);
    box-shadow: none;
  }
  .v2-nav-fold > .v2-nav-links > .v2-theme-fold-list:not([hidden]),
  .v2-prof-nav .v2-nav-fold > .v2-nav-links > .v2-theme-fold-list:not([hidden]),
  body.v2-tab .v2-tab-nav .v2-nav-fold > .v2-nav-links > .v2-theme-fold-list:not([hidden]) {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--tile);
  }
  .v2-theme-fold-list .v2-theme-row {
    min-height: 44px;
    height: 44px;
    padding: 0 14px 0 28px;
  }
}

/* Quick order: phone is a docked bottom panel, not a floating window. */
@media (max-width: 767px) {
  .v2-qord.on {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100%;
    max-height: min(70vh, 420px);
  }
  .v2-qord > .v2-hd {
    cursor: default;
    touch-action: auto;
  }
  .v2-qord-pin,
  .v2-qord-x,
  .v2-qord .v2-ck,
  .v2-qord .v2-edge-btn,
  .v2-qord-acts .v2-btn {
    min-height: 44px;
    height: 44px;
  }
}

/* /spin: stack wheel, ID tile and how-to strip. body.v2-tour already lets the page scroll. */
@media (max-width: 1279px) {
  .v2-spin-grid {
    height: auto;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .v2-spin-grid > .v2-nav,
  .sp-hero,
  .sp-stage,
  .sp-side,
  .sp-how {
    grid-column: 1;
    grid-row: auto;
  }
  .sp-hero {
    flex-wrap: wrap;
  }
  .sp-ticker {
    flex-basis: 100%;
    height: 34px;
  }
  .sp-stage-body {
    height: auto;
    min-height: 560px;
  }
  .sp-wheel-box {
    flex: 0 0 auto;
    container-type: normal;
  }
  .sp-wheel {
    width: min(100%, 520px);
  }
  .sp-side-body {
    height: auto;
    overflow: visible;
  }
}
@media (max-width: 767px) {
  .sp-title {
    flex-basis: 100%;
    border-right: 0;
    border-bottom: var(--v2-rule) solid var(--line);
  }
  .sp-stat {
    flex: 1 1 0;
    padding: 10px 12px;
  }
  .sp-stat:last-of-type {
    border-right: 0;
  }
  .sp-v {
    font-size: var(--fs-11);
  }
  .sp-stage-body {
    min-height: 0;
    padding-top: 56px;
  }
  .sp-big {
    width: 100%;
    min-width: 0;
  }
  .sp-snd,
  .sp-pos button,
  .sp-cid button {
    min-height: 44px;
  }
  .sp-snd {
    min-width: 44px;
  }
  .sp-go {
    flex-basis: 88px;
  }
  .sp-field input {
    height: 48px;
  }
  .sp-how {
    flex-direction: column;
  }
  .sp-step {
    border-right: 0;
    border-bottom: var(--v2-rule) solid var(--line);
  }
  .sp-step:last-child {
    border-bottom: 0;
  }
  .sp-jackpot {
    font-size: var(--fs-33);
  }
}

/* Position chart popup (chart/popchart.js): 44px header taps on touch. */
@media (pointer: coarse) {
  .v2-pchart .v2-pchart-hd {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex-basis: 44px;
  }
  .v2-pchart-hd .v2-btn {
    height: 44px;
    min-height: 44px;
  }
}

/* New-version bar (topbar.css): phones keep the label and the two buttons, drop the sentence. */
@media (max-width: 560px) {
  .v2-fresh-msg {
    display: none;
  }
  .v2-fresh .x-lab {
    flex: 1 1 auto;
  }
}

/* Boot Roadster ride (boot.css): two-row HUD on tablets; phones drop the progress strip,
   the skip footnote and shrink the caption so the car stays in view. */
@media (max-width: 1279px) {
  .v2-ride-hud {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .v2-ride-hud > div:nth-child(2) {
    border-right: 0;
  }
  .v2-ride-hud > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 767px) {
  .v2-ride-top {
    grid-template-columns: 1fr auto auto;
  }
  .v2-ride-prog,
  .v2-ride-foot {
    display: none;
  }
  .v2-ride-cap {
    left: 16px;
    right: 16px;
    top: 60px;
    max-width: none;
  }
  .v2-ride-cap h2 {
    font-size: var(--fs-33);
  }
  .v2-ride-cap p {
    font-size: var(--fs-13);
  }
  .v2-ride-hud {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .v2-ride-v {
    font-size: var(--fs-22);
  }
  .v2-ride-stamp {
    font-size: var(--fs-33);
  }
}
