/* ═══════════════════════════════════════════════════════════════
   mobile.css — Superclan on a phone (round 19), after Phantom: a tab
   bar at the bottom, a short header, sheets that rise from the bottom,
   big targets, nothing wider than the screen. js/ui-mobile.js draws the
   tab bar's state, More and #/home. Loaded last: on a phone it wins.
   "A phone": under 760 px wide, or a touch screen held sideways (under
   500 px tall). The same query is Mobile.MQ in js/ui-mobile.js.
   ═══════════════════════════════════════════════════════════════ */

.mtab{display:none}

/* ───────────── Home (#/home): a phone's first screen, laid out like the owner's reference (round 20); wide screens too ───────────── */
/* (hover looks only where there's a pointer that hovers: a phone keeps a tapped thing "hovered" until the next tap) */
.mh{max-width:640px;padding-top:6px}
.mh-top{display:flex;align-items:center;gap:14px;padding:10px 2px 4px}
.mh-tl{flex:1;min-width:0}
.mh-acct{display:flex;align-items:center;gap:8px;min-width:0;font-size:12.5px;color:var(--mute);white-space:nowrap;overflow:hidden}
.mh-mode{flex-shrink:0;height:20px;padding:0 8px;border-radius:99px;font-size:11px;font-weight:700;line-height:20px;letter-spacing:.02em;text-transform:uppercase}
.mh-mode.paper{color:var(--warn);background:var(--warn-soft)}
.mh-mode.live{color:var(--up);background:var(--up-soft)}
.mh-bal{margin:5px 0 2px;font:700 32px/1.1 var(--display);letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--text);white-space:nowrap}
.mh-bal[data-len="l"]{font-size:27px}                                 /* a bigger balance keeps to its line: $123,456.78 */
.mh-bal[data-len="xl"]{font-size:23px}                                /* $1,234,567.89 and up */
.mh-c{color:var(--faint)}
.mh-chg{min-height:18px;font-size:13px;color:var(--mute)}
.mh-chg span{font-weight:650}
.mh-chg .mh-24{font-weight:500;color:var(--mute)}
.mh-dep{flex-shrink:0;height:44px;min-width:116px;padding:0 20px;border-radius:13px;font-size:15px;font-weight:650;color:#fff;background:var(--brand);border:0;
  box-shadow:0 8px 22px -10px rgba(var(--brand-rgb),.9)}
.mh-dep:active{transform:scale(.97)}
.mh-note{display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;padding:11px 13px;border-radius:12px;font-size:12.5px;line-height:1.45;color:var(--text-2);background:var(--card);border:1px solid var(--line)}
.mh-note .ic{flex-shrink:0;margin-top:1px;color:var(--brand-text)}
.mh-sec{margin-top:22px}
.mh-sec[hidden]{display:none}
.mh-sh{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 2px 8px}
.mh-sh h2{display:flex;align-items:center;gap:7px;margin:0;font:650 15px/1.2 var(--display);letter-spacing:-.01em}
.mh-sh h2 .ic{color:var(--warn)}
.mh-sh .lnk{font-size:13px;font-weight:600}
/* the week's top traders: cards that scroll sideways */
.mh-tt{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 0 4px;scrollbar-width:none}
.mh-tt::-webkit-scrollbar{display:none}
.mh-tc{flex:0 0 auto;display:flex;flex-direction:column;gap:8px;width:150px;padding:10px 11px;border-radius:13px;background:var(--card);border:1px solid var(--line);color:var(--text);scroll-snap-align:start}
@media (hover:hover){ .mh-tc:hover{border-color:var(--line-2)} }
.mh-tc:active{transform:scale(.98)}
.mh-tcu{display:flex;align-items:center;gap:7px;min-width:0}
.mh-tcu b{min-width:0;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mh-tcp{display:flex;align-items:center;gap:8px;min-width:0}
.mh-tcp b{font-size:14px;font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mh-tcp .cl,.mh-tci{flex-shrink:0;width:22px;height:22px;font-size:10px}
.mh-tci{display:grid;place-items:center;border-radius:50%;color:var(--mute);background:var(--card-2)}
.mh-tc-shim{flex:0 0 150px;height:70px;border-radius:13px}
/* Watchlist / Tokens / Perps */
.mh-mk{margin-top:24px}
.mh-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid var(--line)}
.mh-tab{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;height:44px;font-size:15px;font-weight:600;color:var(--mute);transition:color .15s}
.mh-tab.on{color:var(--text)}
.mh-tab.on::after{content:"";position:absolute;left:18%;right:18%;bottom:-1px;height:2px;border-radius:2px;background:var(--brand)}
.mh-chips{display:flex;gap:8px;overflow-x:auto;margin-top:12px;padding-bottom:2px;scrollbar-width:none}
.mh-chips::-webkit-scrollbar{display:none}
.mh-chips:empty{display:none}
.mh-chip{flex-shrink:0;height:32px;padding:0 13px;border-radius:10px;font-size:13.5px;font-weight:600;color:var(--mute);background:transparent;border:1px solid var(--line-2);transition:background .15s,color .15s}
.mh-chip.on{color:var(--text);background:var(--card-2);border-color:var(--line-2)}
.mh-flt{flex-shrink:0;display:grid;place-items:center;width:36px;height:32px;border-radius:10px;color:var(--text-2);border:1px solid var(--line-2)}
.mh-flt.on{color:var(--brand-text);border-color:var(--brand-line);background:var(--brand-soft)}
.mh-tip{display:flex;align-items:center;gap:9px;margin:12px 0 4px;padding:10px 12px;border-radius:12px;font-size:12.5px;line-height:1.4;color:var(--text-2);background:var(--card);border:1px solid var(--line)}
.mh-tip .ic{flex-shrink:0;color:var(--brand-text)}
.mh-tip b{color:var(--brand-text);font-weight:600}
.mh-tchain{font-style:normal;margin-left:4px;padding:1px 7px;border-radius:99px;font-size:11.5px;color:var(--text);background:var(--card-2)}
.mh-list{margin-top:4px}
.mh-more{display:flex;align-items:center;justify-content:center;gap:4px;height:44px;margin-top:4px;font-size:13.5px;font-weight:600}
.mh-rs{height:58px;margin:8px 0;border-radius:12px}
/* rows */
.mh-row{display:flex;align-items:center;gap:12px;min-width:0;min-height:60px;padding:8px 6px;border-radius:14px;color:var(--text);transition:background .15s}
@media (hover:hover){ .mh-row:hover{background:var(--hover)} }
.mh-row:active{background:var(--card-2)}
.mh-row .av-wrap{flex-shrink:0}
.mh-row .av,.mh-row .cl{width:40px;height:40px;border-radius:50%;font-size:14px}
.mh-row .av img,.mh-row .cl img{border-radius:50%}
.mh-row .av-wrap .chain{width:15px;height:15px;right:-3px;bottom:-3px}
.mh-m{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.mh-m b{font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mh-m > span{font-size:12.5px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mh-r{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0;max-width:48%}
.mh-r b{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.mh-r span{font-size:12.5px;white-space:nowrap;font-variant-numeric:tabular-nums}
.mh-ch{font-weight:600}
.mh-side{font-style:normal;font-size:11.5px;font-weight:700;margin-left:4px}
.mh-lev{font-style:normal;margin-left:4px;padding:1px 5px;border-radius:5px;font-size:10.5px;font-weight:700;color:var(--brand-text);background:var(--brand-soft);vertical-align:1px}
.mh-empty{display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:10px;padding:22px 16px;text-align:center;border-radius:16px;background:var(--card);border:1px dashed var(--line-2)}
.mh-empty b{font-size:14.5px}
.mh-empty span{font-size:12.5px;color:var(--mute);line-height:1.5;max-width:320px}
.mh-empty .btn{margin-top:6px}
.mh-clan{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--card);border:1px solid var(--line);color:var(--text)}
@media (hover:hover){ .mh-clan:hover{border-color:var(--line-2)} }
.mh-clan > .ic{flex-shrink:0;color:var(--mute)}
.mh-clan.none > .ic:first-child{color:var(--brand-text)}
.mh-un{display:inline-block;min-width:18px;height:18px;margin-left:4px;padding:0 5px;border-radius:99px;font-style:normal;font-size:10.5px;line-height:18px;text-align:center;color:var(--brand-ink);background:var(--brand)}
.mh-role{display:flex;align-items:center;gap:8px;margin-top:8px;padding:10px 14px;border-radius:14px;font-size:13px;color:var(--text-2);background:color-mix(in srgb,var(--rc) 8%,var(--card));border:1px solid color-mix(in srgb,var(--rc) 30%,var(--line))}
.mh-role b{color:var(--rc)}
.mh-rl{display:inline-flex;align-items:center;gap:2px;margin-left:auto;font-weight:600;color:var(--text)}
.mh-p{margin:0;padding:12px 4px;font-size:13px;color:var(--mute)}
/* the chain picker */
.mh-chl{display:flex;flex-direction:column;gap:4px}
.mh-chb{display:flex;align-items:center;gap:12px;height:52px;padding:0 12px;border-radius:12px;font-size:15px;font-weight:600;color:var(--text);text-align:left}
.mh-chb > span:nth-child(2){flex:1}
.mh-chb.on{background:var(--card-2)}
.mh-chb .ic{color:var(--brand-text)}
.mh-cha{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;color:var(--mute);background:var(--card-2)}

/* ───────────── the first steps (ui-onboard.js, round 20): the terms, a username ───────────── */
.ob-terms .sheet-b,.ob-handle .sheet-b{padding:4px 22px 22px}
.ob-terms .sheet-h h3,.ob-handle .sheet-h h3{font-size:19px}
.ovl-bg.locked .sheet-h::before{display:none}
.ob-lead{margin:0 0 16px;font-size:14px;line-height:1.55;color:var(--text-2)}
.ob-lead a{color:var(--blue);font-weight:600}
.ob-age{display:flex;gap:12px;align-items:flex-start;padding:14px;border-radius:14px;font-size:13px;line-height:1.5;color:var(--text-2);background:var(--card-2);border:1px solid var(--line);cursor:pointer}
.ob-age input{flex-shrink:0;width:20px;height:20px;margin:1px 0 0;accent-color:var(--brand)}
.ob-go{width:100%;height:52px;margin-top:16px;border-radius:14px;font-size:16px;font-weight:650}
.ob-sub{margin:0 0 14px;font-size:13.5px;line-height:1.5;color:var(--mute)}
.ob-sub b{color:var(--text)}
.ob-field{display:flex;align-items:center;gap:2px;height:56px;padding:0 16px;border-radius:14px;background:var(--card-2);border:1px solid var(--line-2);transition:border-color .15s,box-shadow .15s}
.ob-field:focus-within{border-color:var(--brand-line);box-shadow:0 0 0 3px var(--brand-soft)}
.ob-at{color:var(--mute);font-size:17px;font-weight:600}
.ob-field input{flex:1;min-width:0;height:100%;padding:0;border:0;background:none;outline:0;color:var(--text);font-size:17px;font-weight:600}
.ob-st{display:flex;align-items:center;gap:5px;min-height:20px;margin:8px 2px 0;font-size:12.5px;color:var(--mute)}
.ob-st.ok{color:var(--up)}
.ob-st.bad{color:var(--down)}
.ob-new{display:inline-flex;align-items:center;gap:5px;margin-top:6px;font-size:13px}
.ob-f{display:flex;flex-direction:column;align-items:center;gap:12px}
.ob-skip{font-size:14px;color:var(--mute)!important}
.ob-fine{margin:14px 0 0;font-size:11.5px;line-height:1.5;color:var(--faint);text-align:center}
/* your username on Profile */
.pr-h{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:14px}
.pr-h b{color:var(--text-2);font-weight:600}
.pr-h .lnk{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600}

/* ───────────── More (a sheet of every other page): icons with their names, four to a row ───────────── */
.mm-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px 4px}
.mm-t{display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;padding:10px 2px 8px;border-radius:14px;text-align:center;transition:background .15s}
@media (hover:hover){ .mm-t:hover{background:var(--hover)} }
.mm-t:active .mm-ic{transform:scale(.92)}
.mm-ic{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;color:var(--brand-text);background:var(--card-2);border:1px solid var(--line-2);transition:transform .15s var(--ease),border-color .15s}
.mm-t.on .mm-ic{border-color:var(--brand-line);background:var(--brand-soft)}
.mm-t b{max-width:100%;font-size:12px;font-weight:600;line-height:1.2;color:var(--text-2);overflow-wrap:anywhere}

/* ───────────── Buy / Sell above the tab bar (token pages, the perps terminal) ───────────── */
.mqt{display:none}

/* ───────────── a phone: a touch screen under 760 px wide, or held sideways (round 24: never a computer, however narrow
   its window; the owner: "the desktop does not need the sidebar") ───────────── */
@media (hover:none) and (pointer:coarse) and (max-width:760px), (hover:none) and (pointer:coarse) and (max-height:500px){
  /* --foot-h: what the floating tab bar takes at the bottom (round 20): its height and its gap above the home bar */
  :root{--nav-h:calc(56px + env(safe-area-inset-top));--sub-h:0px;--tab-h:56px;--tab-b:max(10px, calc(env(safe-area-inset-bottom) - 12px));--foot-h:calc(var(--tab-h) + var(--tab-b))}
  html,body{overscroll-behavior:none}
  body{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  a,button,[role=button]{-webkit-tap-highlight-color:transparent}

  /* the header: the crest (Home), Paper / Live, search, your balance */
  .nav{flex-wrap:nowrap;height:var(--nav-h);align-content:normal;padding:env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));gap:10px;row-gap:0}
  .nav-tabs{display:none!important}
  .logo{flex-shrink:0}
  .logo .wordmark{display:none}
  .logo .logo-mark{width:32px;height:32px}
  .nav-r{gap:8px;margin-left:auto;min-width:0}
  #depositBtn,#watchBtn{display:none!important}
  .search-pill{flex-shrink:0;width:40px;height:40px;min-width:0;padding:0;justify-content:center;border-radius:50%}
  .search-pill .sp-t,.search-pill kbd{display:none}
  .mode{flex-shrink:0}
  .mode button{height:32px;min-width:0;padding:0 12px;font-size:13px}
  .wallet-pill{height:40px;min-width:0;padding:0 12px;gap:7px}
  .wallet-pill > span:last-child{display:none}
  #walletTxt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html[data-route="home"] #walletTxt{display:none}                    /* Home shows the balance big: the pill is the wallet menu */
  html[data-route="home"] .wallet-pill{width:40px;padding:0;justify-content:center;border-radius:50%}

  /* what the tab bar and Home take over */
  .subbar,.foot,.dock,.ws-edge{display:none!important}
  /* the page runs under the tab bar (it floats, glass) and keeps room to scroll its end above it */
  .view{left:0!important;right:0!important;bottom:0!important;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:calc(var(--foot-h) + 10px)}
  .page{padding:14px 14px 28px}
  .toasts{left:10px;right:10px;bottom:calc(var(--foot-h) + 10px);align-items:stretch}
  .toast{max-width:none}

  /* the tab bar (round 21, like the reference): a glass pill floating above the page, icons only (each tab's name stays
     for screen readers). Round 22 (the owner: "more visually appealing and unique"): one pill glides to the tab you're on
     and glows underneath with that tab's colour (--mt-tint, js/ui-mobile.js → TINT); the icons are the bar's own
     (js/ui-mobile.js → BAR_IC), lines that fill in white with a spark of colour on the tab you're on; the Clans tab is
     the clan chat, your clan's crest with a chat bubble */
  .mtab{position:fixed;left:50%;bottom:var(--tab-b);z-index:40;transform:translateX(-50%);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;
    width:min(calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)), 420px);height:var(--tab-h);padding:5px 6px;border-radius:28px;
    /* round 23, glass like the reference: the page shows through, blurred and a little brighter, under a light rim */
    background:linear-gradient(180deg,rgba(46,48,60,.5),rgba(18,19,26,.6));backdrop-filter:blur(22px) saturate(190%);-webkit-backdrop-filter:blur(22px) saturate(190%);
    border:1px solid rgba(255,255,255,.1);box-shadow:0 18px 40px -12px rgba(0,0,0,.75),inset 0 1px 0 rgba(255,255,255,.09),inset 0 -1px 0 rgba(0,0,0,.22);
    transition:--mt-tint .45s}
  @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){ .mtab{background:rgba(22,23,30,.95)} }
  .mtab.mt-back{animation:mt-back .38s var(--ease) backwards}        /* back after the keyboard (js/ui-mobile.js → back) */
  .mtab > a,.mtab > button{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;height:100%;
    color:var(--mute);-webkit-tap-highlight-color:transparent;transition:color .15s}
  .mtab > * > span:last-of-type{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .mtab [aria-current=page]{color:var(--text)}
  /* the pill: one tab wide (the bar's padding box less its padding, in five), moved along by whole tabs */
  .mt-pill{position:absolute;top:5px;bottom:5px;left:6px;width:calc((100% - 12px) / 5);transform:translateX(calc(var(--mt-i, 0) * 100%));pointer-events:none;
    transition:transform .5s var(--spring-snappy, var(--ease)),opacity .2s}
  .mtab:not(.mt-ready) .mt-pill{transition:none}
  .mt-pill > i{position:absolute;inset:0 5px;border-radius:22px;overflow:hidden;background:linear-gradient(180deg,rgba(255,255,255,.17),rgba(255,255,255,.07));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.15),inset 0 0 0 1px rgba(255,255,255,.05),0 2px 8px -2px rgba(0,0,0,.35)}
  .mtab.mt-none .mt-pill{opacity:0}                                  /* a page of no tab (search): the pill steps out */
  .mt-pill > i::after{content:"";position:absolute;inset:0;background:radial-gradient(70% 90% at 50% 115%, var(--mt-tint, transparent), transparent 75%);opacity:.38}
  .mt-ic{position:relative;display:grid;place-items:center;width:28px;height:28px;transition:transform .18s var(--spring)}
  .mtab > :active .mt-ic{transform:scale(.86)}
  .mtab > a:focus-visible,.mtab > button:focus-visible{outline:none}       /* the keyboard's ring takes the pill's shape */
  .mtab > a:focus-visible::after,.mtab > button:focus-visible::after{content:"";position:absolute;inset:0 5px;border-radius:22px;box-shadow:0 0 0 2px var(--brand);pointer-events:none}
  /* the icons: lines; on the tab you're on, white with a spark of colour */
  .mt-svg{display:block;width:26px;height:26px;overflow:visible;fill:currentColor;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transform-origin:50% 92%}
  .mt-svg *{transform-box:fill-box}
  .mt-svg .mt-b,.mt-svg .mt-a{fill-opacity:0;transition:fill-opacity .25s,fill .25s,stroke .25s}
  .mt-svg .mt-w{fill:none;transition:stroke .25s}
  .mtab [aria-current=page] .mt-svg .mt-b,.mtab [aria-current=page] .mt-svg .mt-a{fill-opacity:1}
  .mtab [aria-current=page] .mt-home .mt-a{fill:#ffcf6b;stroke:#ffcf6b}                   /* Home: the door lit */
  .mtab [aria-current=page] .mt-fl .mt-a{fill:#ff8a3d;stroke:#ff8a3d}                     /* Trenches: the flame's heart */
  .mtab [aria-current=page] .mt-cd .mt-c1 *{fill:var(--up);stroke:var(--up)}              /* Perps: a candle up, one down */
  .mtab [aria-current=page] .mt-cd .mt-c2 *{fill:var(--down);stroke:var(--down)}
  .mtab [aria-current=page] .mt-mo .mt-a{fill:var(--brand);stroke:var(--brand)}           /* More: a dot among the tiles */
  /* the clan chat: the Superclan crest in your clan's colour (js/util.js → brandMark), its faces down behind the wall,
     only their eyes over it, until you open it: then they stand up and the leader's crown goes on */
  .mt-ic[data-mti="clans"]{width:32px;height:32px}
  .mt-crest{display:block;width:32px;height:32px;filter:drop-shadow(0 2px 4px rgba(0,0,0,.35));transform-origin:50% 92%}
  .mt-crest .logo-mark{width:32px;height:32px}
  .mtab .mt-crest .lm-b{fill:var(--cc, var(--brand))}
  .mtab .mt-crest .lm-w{fill:var(--brand-deep)}
  .mt-crest .lm-f,.mt-crest .lm-k,.mt-crest .lm-bl{transform-box:fill-box}
  .mt-crest .lm-f{transform-origin:50% 100%;transition:transform .5s var(--spring-bouncy, var(--spring))}
  .mt-crest .lm-k{transform-origin:50% 100%;transition:opacity .2s}
  .mt-crest .lm-bl{transform-origin:50% 50%;animation:mt-blink 5.2s 3s infinite}                  /* now and then they blink */
  .mt-crest .lm-f1 .lm-bl{animation-duration:4.6s;animation-delay:3.6s}
  .mt-crest .lm-f3 .lm-bl{animation-duration:6.1s;animation-delay:4.4s}
  .mtab a:not([aria-current=page]) .mt-crest .lm-f{transform:translateY(7px)}
  .mtab a:not([aria-current=page]) .mt-crest .lm-k{opacity:0}
  /* its chat bubble; with unread messages, their count takes its place */
  .mt-bub{position:absolute;top:-3px;right:-10px;display:flex;align-items:center;justify-content:center;gap:1.7px;width:16px;height:12px;border-radius:6px 6px 6px 2px;
    background:#aeb1c0;box-shadow:0 0 0 2px rgb(24,25,32);transition:background-color .2s,transform .3s var(--spring),opacity .2s}
  .mt-bub > i{width:2.4px;height:2.4px;border-radius:50%;background:#14151b}
  .mtab [aria-current=page] .mt-bub{background:#fff}
  .mtab .mt-unread .mt-bub{opacity:0;transform:scale(.4)}
  .mt-dot{position:absolute;top:3px;left:calc(50% + 9px);z-index:1;min-width:17px;height:17px;padding:0 4px;border-radius:99px 99px 99px 4px;font-style:normal;font-size:10px;font-weight:700;line-height:17px;text-align:center;
    color:var(--brand-ink);background:var(--brand);box-shadow:0 0 0 2px rgb(24,25,32);animation:mt-bub .45s var(--spring-bouncy, var(--spring)) backwards}
  .mt-dot[hidden]{display:none}

  /* the entrance as the app opens (js/ui-mobile.js → enter): the bar rises, its icons pop in one after another, the pill
     lands under the tab you're on, the clan stands up behind its wall and its bubble types. On a first visit the bar
     waits under the terms (.mt-hold). Until the app has started (.mt-ready) the bar is out of sight, so the entrance is
     the first thing it does (the page paints before the scripts have run); with motion off it's simply there */
  .mtab.mt-hold{opacity:0;visibility:hidden;transform:translate(-50%, calc(100% + 28px))}
  @media (prefers-reduced-motion:no-preference){ body:not(.motion-reduced) .mtab:not(.mt-ready):not(.mt-boot){opacity:0} }
  .mtab.mt-boot{animation:mt-up .75s .05s var(--spring-bouncy, var(--spring)) backwards}
  .mt-boot .mt-ic{animation:mt-pop .6s var(--spring-bouncy, var(--spring)) backwards;animation-delay:calc(.24s + var(--n, 0) * 65ms)}
  .mt-boot .mt-pill > i{animation:mt-land .55s .62s var(--spring-bouncy, var(--spring)) backwards}
  .mt-boot .mt-crest .lm-f{animation:mt-rise .7s var(--spring-bouncy, var(--spring)) backwards}
  .mt-boot .mt-crest .lm-f1{animation-delay:.62s}
  .mt-boot .mt-crest .lm-f3{animation-delay:.7s}
  .mt-boot .mt-crest .lm-f2{animation-delay:.78s}
  .mt-boot .mt-crest .lm-k{animation:mt-crown .55s 1s var(--spring-bouncy, var(--spring)) backwards}
  .mt-boot .mt-bub{animation:mt-bub .55s 1.08s var(--spring-bouncy, var(--spring)) backwards}
  .mt-boot .mt-bub > i{animation:mt-type .8s 1.35s ease-in-out 2 backwards}
  .mt-boot .mt-bub > i:nth-child(2){animation-delay:1.47s}
  .mt-boot .mt-bub > i:nth-child(3){animation-delay:1.59s}
  /* a tab you open (js/ui-mobile.js → go): the house hops and its door lights, the flame flares, the candles tick, the
     clan stands up and its bubble types, the tiles pop */
  .mt-go .mt-home{animation:mt-hop .62s cubic-bezier(.3,.7,.4,1)}
  .mt-go .mt-home .mt-a{transform-origin:50% 100%;animation:mt-grow .42s .14s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-fl{animation:mt-flare .66s cubic-bezier(.3,.7,.4,1)}
  .mt-go .mt-fl .mt-a{transform-origin:50% 100%;animation:mt-grow .5s .1s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-cd .mt-c1{animation:mt-bob-u .6s cubic-bezier(.3,.7,.4,1)}
  .mt-go .mt-cd .mt-c2{animation:mt-bob-d .6s .07s cubic-bezier(.3,.7,.4,1)}
  .mt-go .mt-mo .mt-b,.mt-go .mt-mo .mt-a{transform-origin:50% 50%;animation:mt-tile .5s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-mo .mt-t2{animation-delay:.06s}
  .mt-go .mt-mo .mt-t3{animation-delay:.12s}
  .mt-go .mt-mo .mt-t4{animation-delay:.18s}
  .mt-go .mt-crest .lm-f{animation:mt-rise .62s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-crest .lm-f3{animation-delay:.07s}
  .mt-go .mt-crest .lm-f2{animation-delay:.14s}
  .mt-go .mt-crest .lm-k{animation:mt-crown .5s .34s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-bub{animation:mt-bub .5s .22s var(--spring-bouncy, var(--spring)) backwards}
  .mt-go .mt-bub > i{animation:mt-type .8s .5s ease-in-out 2 backwards}
  .mt-go .mt-bub > i:nth-child(2){animation-delay:.62s}
  .mt-go .mt-bub > i:nth-child(3){animation-delay:.74s}

  /* sheets rise from the bottom, with a handle, over the tab bar */
  .ovl-bg{align-items:flex-end;padding:0;z-index:60}
  .sheet,.sheet.wide,.sheet.mid{position:relative;max-width:none;width:100%;max-height:calc(100% - 24px - env(safe-area-inset-top));border-radius:20px 20px 0 0;border-bottom:0;
    padding-bottom:env(safe-area-inset-bottom);animation:mrise .34s var(--ease)}
  .sheet.fx-from{animation:mrise .34s var(--ease)}                     /* not the spring out of the button (fx.css): on a phone a sheet rises */
  .sheet-h{position:relative;padding-top:20px}
  .sheet-h::before{content:"";position:absolute;top:7px;left:50%;width:38px;height:4px;margin-left:-19px;border-radius:2px;background:var(--line-2)}
  .sheet-h .icon-btn.sm{width:36px;height:36px}
  .sheet-f{flex-wrap:wrap}
  .sheet-f .btn{flex:1 1 auto;min-height:44px}

  /* touch: fields big enough not to zoom, buttons big enough to hit */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px}
  .btn{min-height:36px}
  .btn-xs{min-height:30px}
  .icon-btn.sm{width:34px;height:34px}

  /* More */
  .mm-sheet .sheet-b{padding:10px 8px 14px}

  /* the search: the whole height, so the results stay above the keyboard */
  .sheet.sheet-search{height:calc(100% - 24px - env(safe-area-inset-top))}
  .sheet-search .search-in kbd{display:none}
  .sheet-search .sres{max-height:none}

  /* Buy / Sell above the tab bar */
  .mqt:not([hidden]){position:fixed;left:12px;right:12px;bottom:calc(var(--foot-h) + 10px);z-index:39;display:grid;grid-template-columns:1fr 1fr;gap:10px;
    padding:8px;border-radius:18px;background:rgba(14,15,20,.9);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--line-2);
    box-shadow:0 14px 34px -10px rgba(0,0,0,.8);animation:mrise .28s var(--ease)}
  .mqt button{height:46px;border-radius:12px;font-size:15.5px;font-weight:700;letter-spacing:.01em;color:var(--text);background:var(--card-2)}
  .mqt button.long{color:#04130b;background:var(--up)}
  .mqt button.short{color:#fff;background:var(--down)}
  .mqt button:active{transform:scale(.97)}
  body.has-mqt .view{padding-bottom:calc(var(--foot-h) + 86px)}
  body.has-mqt .toasts{bottom:calc(var(--foot-h) + 84px)}

  /* while the keyboard is up (js/ui-mobile.js → keyboard): no tab bar, no Buy / Sell bar */
  html.kb{--foot-h:0px}
  html.kb .mtab,html.kb .mqt{display:none!important}
  html.kb body.has-mqt .view{padding-bottom:10px}

  /* Settings → Trading: the three presets one under another, each a two-column form */
  .preset-grid{grid-template-columns:minmax(0,1fr)}
  .preset-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);align-items:center;gap:8px 12px}
  .preset-card > b,.preset-card .pc-two,.preset-card .pc-chk{grid-column:1 / -1}
  .preset-card label{font-size:12.5px}

  /* things to tap: at least about a fingertip */
  .seg button,.tfs button,.ptabs button,.chipbtn{height:34px}
  .seg button{padding:0 12px;font-size:13px;white-space:nowrap;flex-shrink:0}
  /* a row of choices stays one row, its own words on it, and scrolls inside itself when it's wider than the phone */
  .seg{flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none}
  .seg::-webkit-scrollbar{display:none}
  .sg-tabs button{gap:6px}
  .sg-tabs button span{display:inline}
  .otype button{min-height:32px}
  .icon-btn.xs{width:32px;height:32px}
  .star::before{content:"";position:absolute;inset:-8px -5px}           /* a bigger place to tap, the icon where it was */

  /* Home: the cards and the chips scroll to the screen's edges; Watchlist / Tokens / Perps stay at the top as the list
     scrolls under them (round 21, like the reference); the header's pill shows the balance once Home's own has gone */
  .mh-tt,.mh-chips{margin-left:-14px;margin-right:-14px;padding-left:14px;padding-right:14px}
  .mh-tabs{position:sticky;top:0;z-index:5;margin:0 -14px;padding:0 14px;background:var(--bg)}
  html[data-route="home"].mh-up #walletTxt{display:inline}
  html[data-route="home"].mh-up .wallet-pill{width:auto;padding:0 12px;border-radius:99px}

  /* Clans: the page's own title stays short on a phone */
  .hq-t p{display:none}
}
/* a phone held sideways: little height, so the pages that fill the screen (Trenches, Pulse, the multi-chart) scroll as a
   whole, each list keeping room for its rows */
@media (hover:none) and (pointer:coarse) and (max-height:500px){
  .page-fill{height:auto;min-height:100%}
  .page-fill .tscroll,.page-fill .pulse-grid,.page-fill .pcol{min-height:300px}
  .mm-grid{grid-template-columns:repeat(auto-fill,minmax(86px,1fr))}     /* More: two rows across the width, not five down a short screen */
}
@media (max-width:340px){ .mm-grid{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media (max-width:360px){
  .mh-bal{font-size:29px}
  .mh-bal[data-len="l"]{font-size:24px}
  .mh-bal[data-len="xl"]{font-size:20px}
  .mh-dep{min-width:0;padding:0 16px;height:42px}
  .mode button{padding:0 9px}
}
@keyframes mrise{from{transform:translateY(60px);opacity:.5}to{transform:none;opacity:1}}

/* ───────────── the tab bar's colour and motion (round 22) ───────────── */
/* the pill's glow fades from one tab's colour to the next (where the browser can animate a custom property) */
@property --mt-tint{syntax:'<color>';inherits:true;initial-value:transparent}
/* in your clan's colour, the crest's wall a shade darker */
@supports (color:color-mix(in srgb, red 50%, blue)){ .mtab .mt-crest[style] .lm-w{fill:color-mix(in srgb, var(--cc) 58%, #0b0c14)} }
@keyframes mt-back{from{transform:translate(-50%, 16px);opacity:0}}
@keyframes mt-up{from{transform:translate(-50%, calc(100% + 28px));opacity:0}}
@keyframes mt-pop{from{transform:translateY(12px) scale(.3);opacity:0}}
@keyframes mt-land{from{transform:scale(.45, .3);opacity:0}}
@keyframes mt-rise{from{transform:translateY(20px)}}
@keyframes mt-crown{from{transform:translateY(-12px) rotate(-26deg);opacity:0}}
@keyframes mt-bub{from{transform:scale(0) rotate(-30deg);opacity:0}}
@keyframes mt-type{0%,55%,100%{transform:none;opacity:.6}28%{transform:translateY(-2.2px);opacity:1}}
@keyframes mt-hop{0%{transform:none}20%{transform:translateY(1px) scale(1.13, .85)}48%{transform:translateY(-4.5px) scale(.94, 1.08)}74%{transform:translateY(0) scale(1.05, .96)}100%{transform:none}}
@keyframes mt-grow{from{transform:scaleY(0)}}
@keyframes mt-flare{0%{transform:scale(.72)}34%{transform:scale(1.15) rotate(-6deg)}58%{transform:scale(.96) rotate(4deg)}80%{transform:scale(1.02) rotate(-1.5deg)}100%{transform:none}}
@keyframes mt-bob-u{0%,100%{transform:none}38%{transform:translateY(-3.6px)}68%{transform:translateY(.9px)}}
@keyframes mt-bob-d{0%,100%{transform:none}38%{transform:translateY(3.6px)}68%{transform:translateY(-.9px)}}
@keyframes mt-tile{from{transform:scale(.15);opacity:0}}
@keyframes mt-blink{0%,92%,100%{transform:none}95%{transform:scaleY(.12)}}
@media (prefers-reduced-motion:reduce){
  .sheet,.sheet.fx-from{animation:none}
  .mtab,.mtab *{animation:none!important}
  .mtab,.mt-pill,.mt-ic,.mt-crest .lm-f{transition:none}
}
