/* The only page breakpoint. Agent 6. Below 1280px the grid is one column and the page scrolls.
   At 430px and under, the phone screen keeps one tile, a sticky Long/Short row, and a segmented switcher. */
: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 {
  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. */
  .v2-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 {
    height: 44px;
    max-height: 44px;
  }
  .v2-nav > .v2-spacer {
    flex: 1 1 auto;
    min-width: 0;
  }
  .v2-navb {
    width: auto;
    flex: 1 1 auto;
  }
  .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 {
    height: var(--v2-trades-h);
  }
  .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,
  [data-tile="ticket"] .v2-pro-kind,
  [data-tile="ticket"] .v2-pro-menu .v2-btn,
  [data-tile="ticket"] .v2-edge-btn,
  .v2-modal .v2-seg .v2-btn,
  .v2-modal [data-ask] {
    height: 44px;
    min-height: 44px;
  }
  .v2-hd {
    height: 44px;
    flex-basis: 44px;
  }
  .v2-power i {
    height: 44px;
  }
  /* Beat .v2-field input's font shorthand (14px) so iOS does not zoom on focus. */
  .v2-ticket .v2-field input,
  .v2-field input,
  .v2-search input {
    font-size: var(--fs-16);
  }
  /* 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;
  }
  /* Owner: no drawing tools on mobile/coarse — hide the left rail and give the
     width back to the chart. Timeframes reparent into .v2-chart-tfs (chart.js). */
  [data-tile="chart"] .v2-chart-tools {
    display: none;
    width: 0;
    flex: 0 0 0;
  }
  [data-tile="chart"] .v2-chart-tfs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1px;
    background: var(--v2-line);
  }
  /* 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 {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 auto;
    padding: 0 8px;
    border: 0;
    background: var(--v2-header);
    text-transform: none;
  }
  [data-tile="chart"] .v2-chart-tfs .v2-btn.on,
  [data-tile="chart"] .v2-chart-tfs .v2-btn.on:hover {
    background: var(--v2-rose);
    color: var(--ink);
    font-weight: 700;
  }
  .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 .v2-chart-set-x {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
  }
}
/* Short landscape legend. After the coarse 44px rules so this wins on the
   timeframe buttons. One 28px control row (labels fit, + stays on screen)
   and a 24px in-flow O/H/L/C row. Both heights are fixed so candles do not
   move the plot. 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: wrap;
    flex: 0 0 53px;
    height: 53px;
    min-height: 53px;
    max-height: 53px;
    overflow: hidden;
    align-content: flex-start;
  }
  [data-tile="chart"] .v2-chart-tfs {
    flex: 0 1 auto;
    min-width: 0;
    height: 28px;
    max-height: 28px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    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: 28px;
    min-height: 28px;
    max-height: 28px;
    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;
    flex: 0 0 44px;
    padding: 0;
  }
  [data-tile="chart"] .v2-chart-ohlc {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    margin-left: 0;
    overflow: hidden;
  }
}
@media (max-width: 430px) {
  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: pointer;
  }
  .v2-nav-fold[open] .v2-nav-more,
  .v2-nav-more:hover {
    background: var(--v2-rose);
    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;
  }
  .v2-nav > .v2-cap:not(.v2-wallet) {
    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;
  }
  /* 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));
    max-height: 168px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .v2-chart,
  .v2-book,
  .v2-trades,
  .v2-positions,
  .v2-account,
  .v2-ticket {
    display: none;
    height: auto;
    min-height: 0;
  }
  body[data-v2-panel="chart"] .v2-chart,
  body[data-v2-panel="book"] .v2-book,
  body[data-v2-panel="trades"] .v2-trades,
  body[data-v2-panel="positions"] .v2-positions,
  body[data-v2-panel="positions"] .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: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  /* Own 24px legend row: full O/H/L/C + mark stay visible; height reserved for CLS.
     Portrait phones that adopt a chip-row legend strip (e.g. #268) override below. */
  [data-tile="chart"] .v2-chart-ohlc {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    margin-left: 0;
    justify-content: flex-start;
    overflow: hidden;
  }
  /* 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="positions"] .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="positions"] .v2-account .v2-body {
    min-width: 0;
    max-width: 100%;
    overflow: 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-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Position rows become a compact grid; Entry/Mark drop so the row fits ~375px. */
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table {
    width: 100%;
    max-width: 100%;
    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:nth-child(1) {
    grid-area: mkt;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(2) {
    grid-area: side;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(3) {
    grid-area: sz;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(4),
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(5) {
    display: none;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(6) {
    grid-area: pnl;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(7) {
    grid-area: liq;
  }
  body[data-v2-panel="positions"] [data-tile="positions"] .v2-acct-table tr.v2-pos-row td:nth-child(8) {
    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;
  }
  /* 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;
  }
  .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);
  }
  .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;
  }
  .v2-phone-act [data-v2-side="long"],
  .v2-phone-act [data-v2-side="long"]:hover {
    background: var(--v2-buy);
    border-color: var(--v2-buy);
    color: var(--ink);
    font-weight: 700;
    box-shadow: 2px 2px 0 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: 2px 2px 0 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: 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: 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-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"]) {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body[data-v2-panel="positions"] {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
    overflow: visible;
    overscroll-behavior: auto;
  }
  body[data-v2-panel="positions"] .v2-grid {
    overflow: visible;
    height: auto;
    flex: none;
  }
  body[data-v2-panel="positions"] .v2-nav {
    position: sticky;
    top: 0;
    z-index: 40;
  }
  body[data-v2-panel="positions"] .v2-positions,
  body[data-v2-panel="positions"] .v2-account {
    flex: none;
    height: auto;
    overflow: visible;
  }
  body[data-v2-panel="positions"] .v2-positions {
    min-height: 280px;
  }
  body[data-v2-panel="positions"] .v2-account {
    min-height: 220px;
  }
  body[data-v2-panel="positions"] .v2-positions .v2-body,
  body[data-v2-panel="positions"] .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-x: hidden;
    overflow-y: auto;
    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. ≤430 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;
  }
  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,
  body.v2-land .v2l-wl {
    grid-template-columns: 1fr;
  }
  body.v2-land .v2l-h-main {
    grid-row: auto;
  }
  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) {
  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;
  }
}
@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: a 14px ticket field zooms iOS on focus. */
  .v2-ticket .v2-field input,
  .v2-search input {
    font-size: var(--fs-16);
  }
  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: 430px) {
  .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: pointer;
  }
  .v2-prof-nav .v2-nav-fold[open] .v2-nav-more,
  .v2-prof-nav .v2-nav-more:hover {
    background: var(--v2-rose);
    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;
  }
  .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;
  }
  .v2-ac-panel {
    width: 100%;
    max-height: none;
    height: 100%;
    border: 0;
    border-top: var(--v2-rule) solid var(--v2-rose);
  }
  .v2-ac-row,
  .v2-prof-nav .v2-navb,
  .v2-prof-nav .v2-wallet-go {
    min-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;
  }
  .v2-inv-trace {
    height: auto;
    flex-wrap: wrap;
  }
  .v2-inv .v2-addr {
    grid-column: 1 / -1;
    height: 36px;
  }
  .v2-inv .v2-statrow {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .v2-inv-graph,
  .v2-inv-inspect,
  .v2-inv-time {
    min-height: 280px;
  }
  .v2-inv-notes {
    min-height: 160px;
  }
}
@media (max-width: 430px) {
  html:has(body.v2-inv),
  body.v2-inv {
    height: auto;
    overflow: auto;
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .v2-flow.on {
    animation: none;
  }
  /* Pixel cursors in cursors.css are static PNGs (no cursor animation to disable). */
}
/* Touch / coarse pointers: system cursors only (custom images are for fine pointers). */
@media (pointer: coarse), (hover: none) {
  .v2,
  .v2 * {
    cursor: auto;
  }
  .v2
    :where(
      a,
      button,
      summary,
      label,
      select,
      [role="button"],
      .v2-btn,
      .v2-unit-tog,
      .v2-power > *,
      .v2-segbar > *,
      .v2-navb,
      .v2-cap,
      .v2-logo,
      .v2-wallet-go,
      .v2l-cta,
      .v2l-brand,
      .v2l-btn,
      .v2l-form button,
      .v2-tab-bar a,
      .v2-tab-main .cta,
      .v2-chart-tools .v2-btn,
      .v2-chart-chips .v2-btn,
      .v2-chart-msg .v2-btn,
      .v2-chart-pane :is(button, a, .v2-btn, [role="button"]),
      .v2-node,
      .v2-mkt,
      .v2-copy,
      .v2-brow,
      .v2-tick,
      .v2-ac-row,
      .v2-pos-row,
      .v2-nav-more,
      .pshare,
      .wli,
      #tdModal .btn,
      #tdModal .btnw,
      #tdModal .tpgo
    ) {
    cursor: pointer;
  }
  .v2 :where(input, textarea, [contenteditable="true"], [contenteditable=""], .v2-field input, .v2-search input, .v2-addr) {
    cursor: text;
  }
  .v2 :where(.v2-chart-pane, .v2-chart-cv),
  .v2 :where(.v2-chart-cv *) {
    cursor: crosshair;
  }
  .v2 .v2-chart-cv.is-price-axis,
  .v2 .v2-chart-cv.is-price-axis * {
    cursor: ns-resize;
  }
  .v2 .v2-chart-pane :where(button, a, .v2-btn, [role="button"]) {
    cursor: pointer;
  }
  .v2 :where(.v2-grab, [data-v2-cursor="grab"]) {
    cursor: grab;
  }
  .v2 :where(.v2-grabbing, .v2-grab:active, [data-v2-cursor="grabbing"]) {
    cursor: grabbing;
  }
  .v2 :is(:disabled, [disabled], [aria-disabled="true"], .v2-disabled) {
    cursor: not-allowed;
  }
}
/* 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: 430px) 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: visible;
    position: relative;
  }
  [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);
  }
  [data-tile="chart"] .v2-chart-ohlc {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    max-width: 100%;
    height: 18px;
    /* Clear the in-flow 24px row min/max from the 430px rule so this strip stays 18px. */
    min-height: 18px;
    max-height: 18px;
    min-width: 0;
    margin: 0;
    flex: none;
    padding: 0 6px;
    gap: 4px;
    letter-spacing: 0;
    font-size: var(--v2-fs-axis);
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
    pointer-events: none;
    background: var(--v2-tile);
    box-shadow: inset 0 -1px 0 var(--v2-line);
  }
  /* Loading, error, and Retry share this line. Keep it 8px below the 18px legend strip. */
  [data-tile="chart"] .v2-chart-msg {
    top: calc(18px + 8px);
    max-width: calc(100% - 16px);
    flex-wrap: wrap;
  }
}

/* Swap / Bridge phone nav. After the 900px wrap so ≤430 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: 430px) {
  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: 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(--v2-rose);
    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;
  }
  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 430px,
   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;
  }
  .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;
  }
}

/* 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;
  }
  [data-tile="ticket"] .v2-pro-kind,
  [data-tile="ticket"] .v2-pro-menu .v2-btn {
    height: 30px;
    min-height: 30px;
  }
  [data-tile="ticket"] .v2-edge-btn {
    min-height: 42px;
  }
}

/* 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;
  }
}
