/* One viewport-sized shell for every mobile route. Long content grows naturally. */
html[data-surface=mobile] body.mobile-app{--mobile-control-height:42px;--mobile-control-inner-height:34px}
/* The shared brand and quote strip remain present on every route. */
html[data-surface=mobile] body.mobile-app .mobile-device>.mobile-sticky-header,
html[data-surface=mobile] body.mobile-app .mobile-device>.mobile-live-dock{display:block!important}
html[data-surface=mobile] body.mobile-app .mobile-sticky-header>.mobile-topbar{display:flex!important}
html[data-surface=mobile] body.mobile-app .mobile-device{
 --mobile-frame-height:calc(100dvh - 52px);
 --mobile-nav-space:76px;
 display:flex;
 flex-direction:column;
 box-sizing:border-box;
 min-height:var(--mobile-frame-height);
 padding-bottom:var(--mobile-nav-space);
}
html[data-surface=mobile] body.mobile-app .mobile-device>.mobile-sticky-header,
html[data-surface=mobile] body.mobile-app .mobile-device>.mobile-live-dock,
html[data-surface=mobile] body.mobile-app .mobile-device>.mobile-footer{flex-shrink:0}
html[data-surface=mobile] body.mobile-app #main{
 display:flex;
 flex-direction:column;
 flex:1 0 auto;
 min-height:0;
 box-sizing:border-box;
 overflow:visible;
}
html[data-surface=mobile] body.mobile-app #main>:only-child{flex:1 0 auto}
html[data-surface=mobile] body.mobile-app #main .dm-wizard{min-height:0}
/* Single-line control frames match the existing source/copy switch (42px). */
html[data-surface=mobile] body.mobile-app #main :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=file]):not([type=color]),select){
 box-sizing:border-box;min-height:var(--mobile-control-height)!important;height:var(--mobile-control-height);padding:8px 12px!important;line-height:24px;font-size:16px;
}
html[data-surface=mobile] body.mobile-app #main :is(.mc-role-switch,.psc-categories){
 box-sizing:border-box;min-height:var(--mobile-control-height);padding:3px;border:1px solid var(--border);border-radius:12px;
}
html[data-surface=mobile] body.mobile-app #main :is(.mc-role-switch a,.psc-categories button){
 box-sizing:border-box;display:flex;align-items:center;justify-content:center;min-height:var(--mobile-control-inner-height);padding:6px 10px;line-height:20px;font-size:12px;border-radius:9px;
}
html[data-surface=mobile] body.mobile-app #main :is(.psc-search,.dm-large-input){box-sizing:border-box;min-height:var(--mobile-control-height);padding:0 10px;border:1px solid var(--border);border-radius:12px}
html[data-surface=mobile] body.mobile-app #main :is(.psc-search,.dm-large-input) input{min-height:var(--mobile-control-inner-height)!important;height:var(--mobile-control-inner-height)!important;padding:4px 0!important;line-height:24px}
html[data-surface=mobile] body.mobile-app #main .psc-search button{min-height:var(--mobile-control-inner-height);padding:4px 8px;line-height:24px;border-radius:9px}
html[data-surface=mobile] body.mobile-app #main .psc-search .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html[data-surface=mobile] body.mobile-app #main :is(.dm-next button,.mc-connect-submit,.mc-primary,.mc-soft,.pp-primary,.pp-soft,.button){box-sizing:border-box;min-height:var(--mobile-control-height);padding:8px 12px;line-height:24px}
/* Labels inside account fields stay visible while their frame becomes compact. */
html[data-surface=mobile] body.mobile-app #main .mc-terminal .mc-mt-field{box-sizing:border-box;min-height:var(--mobile-control-height);padding:3px 12px!important;font-size:10px!important;line-height:12px;border-radius:12px}
html[data-surface=mobile] body.mobile-app #main .mc-terminal .mc-mt-field input{min-height:22px!important;height:22px!important;padding:0!important;line-height:22px;font-size:16px!important}
html[data-surface=mobile] body.mobile-app #main .mc-terminal .mc-password{padding-right:48px!important}
html[data-surface=mobile] body.mobile-app #main .mc-terminal .mc-password button{top:50%;transform:translateY(-50%)}
/* Pages that intentionally have no bottom navigation do not reserve its space. */
html[data-surface=mobile] body.mobile-app .mobile-device:not(:has(.mobile-bottom-nav a)){--mobile-nav-space:0px}
html[data-surface=mobile] body.mobile-app:is([data-mobile-route=trader],[data-mobile-route=strategy]) .mobile-device,
html[data-surface=mobile] body.mobile-app:has(.mch-market) .mobile-device{--mobile-nav-space:0px}
@media(max-width:520px){
 html[data-surface=mobile] body.mobile-app .mobile-device{
  --mobile-frame-height:100dvh;
  --mobile-nav-space:calc(69px + env(safe-area-inset-bottom));
 }
}
