/* =========================================================================
   Mobile app shell — native-app feel for phones & installed PWA.
   Additive only: hidden on desktop, and on the full-viewport trading
   terminals (which have their own dense layouts).
   ========================================================================= */
:root { --abn-h: 60px; }

/* The standalone app owns its chrome — but ONLY on phones. A desktop-installed
   PWA (wide) and every desktop browser keep the normal website header/layout. */
@media (max-width: 768px) {
  html.pwa-standalone { --topbar-h: 0px; }
  html.pwa-standalone body.app-body:not(.ux-embed-mode) .app-topbar { display: none !important; }
  html.pwa-standalone body.app-body:not(.ux-embed-mode) .app-shell { min-height: 100vh; }
  html.pwa-standalone body.app-body:not(.ux-embed-mode) .app-main { min-height: 100vh; }
}

/* ----- Bottom tab bar ----- */
.app-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1200;
  height: calc(var(--abn-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8, 10, 16, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}
.app-bottom-nav .abn-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--abn-h);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #8a93a6;
  font: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.app-bottom-nav .abn-item svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.85;
  fill: none;
  stroke: currentColor;
}
.app-bottom-nav .abn-item.is-active { color: #f3ba2f; }
.app-bottom-nav .abn-item:active { transform: scale(0.92); }

/* Show the bar on every app page on phones (the trading terminals become
   normal scrolling pages at this width, so the bar no longer overlaps —
   we just reserve space below the content for it). */
/* App-shell chrome (bottom tab bar, hidden website nav) is ONLY for the installed
   app — i.e. launched from /app, which runs in standalone display-mode. A normal
   mobile browser keeps the regular website. */
@media (max-width: 768px) {
  html.pwa-standalone body:not(.ux-embed-mode) .app-bottom-nav { display: flex; }
  /* Reserve space for the fixed bar. Loaded last + !important so it wins over
     the terminals' own `padding:0 !important` on .app-content. */
  html.pwa-standalone body:not(.ux-embed-mode) .app-content {
    padding-bottom: calc(var(--abn-h) + env(safe-area-inset-bottom) + 10px) !important;
  }
  /* App-like header: hide the desktop top-nav links (installed app only). */
  html.pwa-standalone .app-topbar-left { display: none !important; }
  html.pwa-standalone .app-topbar-right .btn { padding: 0 10px; }

  /* When the Menu drawer opens, it must sit above the bottom tab bar. */
  html.pwa-standalone .app-sidebar { z-index: 1300 !important; }
  html.pwa-standalone #appSidebarBackdrop { z-index: 1250 !important; }
}

/* ----- Trade-type switcher on the mobile terminals (Spot/Futures/Alpha/TradFi/Smart) ----- */
.ux-trade-switch { display: none; }
@media (max-width: 768px) {
  html.pwa-standalone .ux-trade-switch {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 10px;
    background: #070a11;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  .ux-trade-switch::-webkit-scrollbar { display: none; }
  .ux-trade-switch-btn {
    flex: 0 0 auto;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9aa6b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .ux-trade-switch-btn.active {
    color: #05070f;
    background: #f3ba2f;
    border-color: #f3ba2f;
  }
}

/* ----- Installed-PWA (standalone) refinements — phones only ----- */
@media (max-width: 768px) {
  html.pwa-standalone body .app-topbar {
    padding-top: env(safe-area-inset-top);
  }
  html.pwa-standalone .app-topbar-left a[href="/download-app"] { display: none; }
}

/* ----- Full-screen profile hub ----- */
.app-profile-screen { display: none; }
html.pwa-standalone .app-profile-screen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: #080b12;
  color: #f6f8fb;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
html.pwa-standalone .app-profile-screen[hidden] { display: none !important; }
html.pwa-standalone .app-profile-screen.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.app-profile-open { overflow: hidden !important; }
.app-profile-header {
  min-height: calc(58px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: end;
  gap: 8px;
  padding: env(safe-area-inset-top) 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,11,18,.96);
}
.app-profile-header h1 { margin: 0 0 7px; text-align: center; font-size: 1rem; }
.app-profile-header button,.app-profile-header>a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: #e8edf5;
}
.app-profile-header svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-profile-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px calc(28px + env(safe-area-inset-bottom));
}
.app-profile-identity { display: flex; align-items: center; gap: 14px; padding: 4px 4px 18px; }
.app-profile-avatar {
  width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(145deg,#f3ba2f,#d89400);
  color: #111; font-size: 1.05rem; font-weight: 900;
}
.app-profile-identity strong,.app-profile-identity span,.app-profile-identity small { display: block; }
.app-profile-identity strong { font-size: 1.08rem; }
.app-profile-identity span { max-width: 245px; margin-top: 4px; color: #9aa5b6; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-profile-identity small { margin-top: 4px; color: #667386; font-size: .66rem; }
.app-profile-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.app-profile-shortcuts a {
  min-width: 0; padding: 12px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; background: #101620; color: #f3f5f8; text-decoration: none;
}
.app-profile-shortcuts span,.app-profile-shortcuts small { display: block; }
.app-profile-shortcuts span { font-size: .78rem; font-weight: 800; }
.app-profile-shortcuts small { margin-top: 3px; color: #7f8b9b; font-size: .65rem; }
.app-profile-wallet {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; margin-bottom: 20px; border: 1px solid rgba(243,186,47,.18);
  border-radius: 8px; background: rgba(243,186,47,.06);
}
.app-profile-wallet span,.app-profile-wallet strong { display: block; }
.app-profile-wallet span { color: #8c98a9; font-size: .68rem; }
.app-profile-wallet strong { margin-top: 4px; font-size: .78rem; }
.app-profile-wallet-actions{display:flex;align-items:center;gap:8px}.app-profile-wallet-actions form{margin:0}
.app-profile-wallet a,.app-profile-wallet button { border:0;background:transparent;color:#f3ba2f;font:inherit;font-size:.72rem;font-weight:800;text-decoration:none;padding:0 }
.app-profile-wallet button{color:#ff6b7b}
.app-profile-menu-section h2 { margin: 0 8px 8px; color: #7f8a9b; font-size: .66rem; text-transform: uppercase; }
.app-profile-nav { padding: 0; }
.app-profile-nav .sb-section { padding-left: 8px; }
.app-profile-nav .sb-link,.app-profile-nav .sb-group>summary { min-height: 44px; border-radius: 7px; color: #b9c2cf; }
.app-profile-nav .sb-children { padding-left: 18px; }
.app-profile-actions { display: grid; margin-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.app-profile-actions a,.app-profile-actions button {
  width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; border: 0; border-bottom: 1px solid rgba(255,255,255,.07);
  background: transparent; color: #e4e9f0; text-align: left; text-decoration: none; font: inherit;
}
.app-profile-actions span { font-size: .78rem; font-weight: 750; }
.app-profile-actions small { color: #748092; font-size: .66rem; }
.app-profile-actions .is-danger span { color: #ff6b7b; }
[data-theme="light"] .app-profile-screen { background: #f5f7fa; color: #10141b; }
[data-theme="light"] .app-profile-header { background: rgba(245,247,250,.97); border-color: rgba(15,23,42,.1); }
[data-theme="light"] .app-profile-header button,[data-theme="light"] .app-profile-header>a { background: #e7ebf0; color: #202631; }
[data-theme="light"] .app-profile-shortcuts a { background: #fff; color: #121720; border-color: rgba(15,23,42,.1); }
[data-theme="light"] .app-profile-nav .sb-link,[data-theme="light"] .app-profile-nav .sb-group>summary { color: #3d4756; }
[data-theme="light"] .app-profile-actions a,[data-theme="light"] .app-profile-actions button { color: #17202d; border-color: rgba(15,23,42,.09); }

/* Comfortable touch targets on phones. */
@media (max-width: 768px) {
  .btn-sm { min-height: 40px; }
  a, button, .ux-nav-dropdown-trigger { -webkit-tap-highlight-color: transparent; }
}

/* ===== Installed-app Dashboard — Bitget-style home screen (standalone only) ===== */
/* Extra quick-entry icons only exist inside the installed app. */
html:not(.pwa-standalone) .app-quick-entry { display: none !important; }
/* The app-only quick entries never show on a wide (desktop) screen either. */
@media (min-width: 769px) { .app-quick-entry { display: none !important; } }
/* Balance privacy mask (works whenever the eye is toggled). */
.ux-balance-hidden [data-equity-display],
.ux-balance-hidden .ux-equity-main p { filter: blur(9px); -webkit-filter: blur(9px); user-select: none; }
.ux-eye { display: none; background: none; border: 0; color: inherit; opacity: .55; cursor: pointer; font-size: .95rem; margin-left: 8px; padding: 2px 4px; line-height: 1; }

@media (max-width: 768px) {
  html.pwa-standalone .ux-pro-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 0;
  }
  /* App flow: header → Total Assets hero → quick-entry icons → markets → history. */
  html.pwa-standalone .ux-pro-dashboard > * { order: 5; margin: 0; }
  html.pwa-standalone .ux-pro-dashboard .app-dashboard-header { order: 0; }
  html.pwa-standalone .ux-pro-dashboard .ux-topline { display: none; }
  html.pwa-standalone .ux-pro-dashboard .ux-wallet-shell { order: 1; }
  html.pwa-standalone .ux-pro-dashboard .ux-command-grid { order: 2; }
  html.pwa-standalone .ux-pro-dashboard .ux-content-grid { order: 3; }
  html.pwa-standalone .ux-pro-dashboard .ux-compact-stats { display: none; }

  /* Slim header. */
  html.pwa-standalone .ux-topline h1 { font-size: 1.3rem; margin: 0; }
  html.pwa-standalone .ux-topline .ux-mini-label { font-size: .66rem; opacity: .7; }
  html.pwa-standalone .ux-topline .ux-top-actions { display: none; }

  /* Total Assets hero card. */
  html.pwa-standalone .ux-wallet-shell { display: block; }
  html.pwa-standalone .ux-balance-panel { display: none; }
  html.pwa-standalone .ux-equity-card {
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(160deg, rgba(243, 186, 47, .16), rgba(20, 16, 6, .18) 46%, rgba(8, 10, 16, .35)), var(--ux-bg-card, #0b0e16);
    border: 1px solid var(--ux-border-soft, rgba(243, 186, 47, .2));
  }
  html.pwa-standalone .ux-account-row { margin-bottom: 8px; }
  html.pwa-standalone .ux-muted-title { font-size: .74rem; }
  html.pwa-standalone .ux-equity-value { display: flex; align-items: center; }
  html.pwa-standalone .ux-equity-value .mono { font-size: 2.1rem; letter-spacing: -.02em; }
  html.pwa-standalone .ux-today-pnl { width: 100%; grid-template-columns: 1fr auto auto; }
  html.pwa-standalone .ux-currency-switch { margin-top: 10px; }
  html.pwa-standalone .ux-currency-switch label { display: none; }
  /* Hero keeps Deposit + Withdraw as two big buttons. */
  html.pwa-standalone .ux-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
  html.pwa-standalone .ux-actions-row .btn { min-height: 46px; font-size: .9rem; flex: none; }
  html.pwa-standalone .ux-actions-row .btn:nth-child(n+3) { display: none; }

  /* Quick-entry icon grid (Bitget style): 4 across, icon-in-tile + label. */
  html.pwa-standalone .ux-command-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px 6px;
    background: none; padding: 0; border: 0;
  }
  html.pwa-standalone .ux-command-card {
    display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
    padding: 10px 2px; min-height: 0;
    background: none !important; border: 0 !important; box-shadow: none !important;
  }
  html.pwa-standalone .ux-command-card i {
    width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
    background: rgba(243, 186, 47, .12); color: var(--ux-primary, #f3ba2f);
    font-size: 1.15rem; font-style: normal; font-weight: 800;
  }
  html.pwa-standalone .ux-command-card b { font-size: .72rem; font-weight: 600; color: var(--ux-text-muted, #cfd6e4); }
  html.pwa-standalone .ux-command-card span { display: none; }

  /* Markets — Bitget rows with coloured change pills. */
  html.pwa-standalone .ux-content-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
  html.pwa-standalone .ux-market-card { border-radius: 18px; }
  html.pwa-standalone .ux-market-row { padding: 12px 2px; }
  html.pwa-standalone .ux-market-row em {
    min-width: 76px; text-align: center; padding: 7px 0; border-radius: 9px;
    font-style: normal; font-weight: 800; color: #fff !important;
  }
  html.pwa-standalone .ux-market-row em.up { background: var(--ux-profit, #16c784); }
  html.pwa-standalone .ux-market-row em.down { background: var(--ux-loss, #ea3943); }

html.pwa-standalone .ux-eye { display: inline-flex; align-items: center; font-size: 1.05rem; margin-left: 10px; }
}

/* ----- Installed-app trading terminal ----- */
.ux-mobile-balance { display: none; }

@media (max-width: 768px) {
  html.pwa-standalone body.ux-terminal-page {
    --ux-mobile-line: rgba(255, 255, 255, 0.075);
    --ux-mobile-panel: #0b0e13;
    overflow-x: hidden !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-terminal-page .app-shell,
  html.pwa-standalone body.ux-terminal-page .app-main,
  html.pwa-standalone body.ux-terminal-page .app-content {
    width: 100% !important;
    min-width: 0 !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-terminal-page .app-content {
    overflow: visible !important;
  }

  html.pwa-standalone body.ux-terminal-page .wrap-app.ux-exchange {
    position: relative !important;
    width: 100% !important;
    min-height: calc(100vh - var(--abn-h)) !important;
    margin: 0 !important;
    padding: env(safe-area-inset-top) 0 0 !important;
    overflow: visible !important;
    background: #05070a !important;
    color: #f4f6f8 !important;
  }

  /* Product modes form the compact terminal header used by mobile exchanges. */
  html.pwa-standalone body.ux-terminal-page .ux-trade-switch {
    min-height: 43px;
    gap: 22px;
    align-items: center;
    padding: 0 14px;
    background: #080b10;
    border-bottom: 1px solid var(--ux-mobile-line);
  }

  html.pwa-standalone body.ux-terminal-page .ux-trade-switch-btn {
    position: relative;
    height: 43px;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #7e8795;
    font-size: 0.78rem;
    font-weight: 700;
  }

  html.pwa-standalone body.ux-terminal-page .ux-trade-switch-btn.active {
    color: #f4f6f8;
    background: transparent;
  }

  html.pwa-standalone body.ux-terminal-page .ux-trade-switch-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: #f3ba2f;
  }

  /* Pair, price and the three figures traders scan first. */
  html.pwa-standalone body.ux-terminal-page .ux-marketbar {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 12px 9px !important;
    overflow: visible !important;
    background: #080b10 !important;
    border-bottom: 1px solid var(--ux-mobile-line) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-pair-main {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 9px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-menu-dot.ux-watch-toggle {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    border: 1px solid #242b36 !important;
    border-radius: 8px !important;
    background: #121720 !important;
    color: #d6dbe3 !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-pair-title {
    min-width: 0;
    gap: 0;
  }

  html.pwa-standalone body.ux-terminal-page .ux-symbol {
    overflow: hidden;
    color: #f5f7fa;
    font-size: 1rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-subtitle {
    overflow: hidden;
    color: #727c8b;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-last-price {
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-align: right;
  }

  html.pwa-standalone body.ux-terminal-page .ux-market-stats {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px;
    padding-left: 47px;
  }

  html.pwa-standalone body.ux-terminal-page .ux-stat {
    min-width: 0 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-stat:nth-child(n+4) {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-stat small {
    overflow: hidden;
    margin: 0 0 2px;
    color: #697382;
    font-size: 0.56rem;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-stat strong {
    display: block;
    overflow: hidden;
    color: #dce1e8;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-wallet-notice {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ok:not(.ux-wallet-notice),
  html.pwa-standalone body.ux-terminal-page .ux-alert {
    margin: 8px 10px !important;
    padding: 9px 10px !important;
    border-radius: 7px !important;
    font-size: 0.72rem !important;
  }

  /* Chart first, then Bitget-style ticket/book split, then account activity. */
  html.pwa-standalone body.ux-terminal-page .ux-terminal-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 58fr) minmax(132px, 42fr) !important;
    grid-template-rows: auto auto auto !important;
    gap: 0 !important;
    overflow: visible !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-panel {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ux-mobile-line) !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-toolbar {
    width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    flex: 0 0 38px !important;
    gap: 8px;
    padding: 0 9px !important;
    overflow: hidden !important;
    background: #080b10 !important;
    border-bottom-color: var(--ux-mobile-line) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-intervals {
    min-width: 0;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-intervals::-webkit-scrollbar {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-intervals button {
    min-width: 31px;
    height: 26px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 0.65rem;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-meta {
    flex: 0 0 auto;
    font-size: 0.61rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-wrap {
    width: 100% !important;
    height: 310px !important;
    min-height: 310px !important;
    flex: 0 0 310px !important;
    overflow: hidden !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-tv-chart,
  html.pwa-standalone body.ux-terminal-page .ux-tv-chart > div,
  html.pwa-standalone body.ux-terminal-page .ux-tv-chart iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-footer {
    height: 31px !important;
    min-height: 31px !important;
    flex: 0 0 31px !important;
    padding: 0 10px !important;
    font-size: 0.61rem !important;
    background: #080b10 !important;
    border-top-color: var(--ux-mobile-line) !important;
  }

  /* The selector is removed from the grid and becomes a focused overlay. */
  html.pwa-standalone body.ux-terminal-page .ux-watchlist-dropdown {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    z-index: 1350 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-watch-dropdown-menu {
    position: fixed !important;
    inset: calc(env(safe-area-inset-top) + 10px) 10px calc(var(--abn-h) + env(safe-area-inset-bottom) + 10px) 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 12px !important;
    background: #0b0f15 !important;
    border-color: #29313d !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-watch-dropdown-menu .ux-watch-search {
    padding: 10px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-watch-dropdown-menu .ux-watch-search input {
    height: 42px;
    border-radius: 8px;
    background: #151a22;
  }

  html.pwa-standalone body.ux-terminal-page .ux-watch-dropdown-menu .ux-tabs {
    padding: 6px 10px 10px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-watch-dropdown-menu .ux-watch-table {
    max-height: none !important;
  }

  /* Order form */
  html.pwa-standalone body.ux-terminal-page .ux-order-panel {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
    border-right: 1px solid var(--ux-mobile-line) !important;
    border-bottom: 1px solid var(--ux-mobile-line) !important;
    background: var(--ux-mobile-panel) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-panel-title {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 9px !important;
    font-size: 0.7rem !important;
    border-bottom-color: var(--ux-mobile-line) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-form-body {
    padding: 9px 8px 11px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-mobile-balance {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 24px;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: #737d8b;
    font-size: 0.59rem;
  }

  html.pwa-standalone body.ux-terminal-page .ux-mobile-balance b {
    overflow: hidden;
    color: #dce1e8;
    font-size: 0.63rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-mobile-balance a {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: rgba(243, 186, 47, 0.12);
    color: #f3ba2f;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-mode-switch {
    margin-bottom: 9px !important;
    border-radius: 6px !important;
    background: #171c24 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-mode-switch button {
    height: 35px !important;
    font-size: 0.7rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-form-tabs {
    gap: 12px !important;
    margin-bottom: 9px !important;
    overflow: hidden;
  }

  html.pwa-standalone body.ux-terminal-page .ux-form-tabs label {
    flex: 0 0 auto;
    font-size: 0.66rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-form-tabs label:nth-child(3) {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-field {
    margin-bottom: 9px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-exchange[data-order-type="Market"] #uxPriceField {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-field-label {
    min-width: 0;
    gap: 4px;
    margin-bottom: 4px !important;
    font-size: 0.58rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-field-label b {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-input-wrap {
    height: 38px !important;
    border-radius: 5px !important;
    background: #171c24 !important;
    border-color: #29313d !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-input-wrap input,
  html.pwa-standalone body.ux-terminal-page .ux-input-wrap select {
    min-width: 0;
    padding: 0 7px !important;
    font-size: 0.68rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-input-suffix {
    flex: 0 0 auto;
    padding: 0 7px !important;
    font-size: 0.58rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-slider {
    gap: 3px !important;
    margin: 3px 0 9px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-slider button {
    min-width: 0;
    height: 25px !important;
    padding: 0 2px;
    font-size: 0.56rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-order-kv {
    margin: 7px 0 10px !important;
    gap: 0 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-order-kv div {
    gap: 6px;
    font-size: 0.59rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-order-kv div:nth-child(n+2) {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-order-kv b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-submit-row {
    display: block !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-submit {
    width: 100%;
    height: 40px !important;
    border-radius: 6px !important;
    font-size: 0.76rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-exchange[data-order-side="Buy"] .ux-submit.sell,
  html.pwa-standalone body.ux-terminal-page .ux-exchange[data-order-side="Sell"] .ux-submit.buy {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-account-box {
    display: none !important;
  }

  /* Order book shares the action row without squeezing the inputs. */
  html.pwa-standalone body.ux-terminal-page .ux-orderbook-panel {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--ux-mobile-line) !important;
    background: var(--ux-mobile-panel) !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-head,
  html.pwa-standalone body.ux-terminal-page .ux-ob-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) !important;
    gap: 4px !important;
    padding: 0 5px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-head {
    height: 27px !important;
    font-size: 0.53rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-head span,
  html.pwa-standalone body.ux-terminal-page .ux-ob-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-head span:nth-child(3),
  html.pwa-standalone body.ux-terminal-page .ux-ob-row span:nth-child(4) {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-row {
    height: 23px !important;
    font-size: 0.57rem !important;
  }

  html.pwa-standalone body.ux-terminal-page #uxAsks .ux-ob-row:nth-child(n+7),
  html.pwa-standalone body.ux-terminal-page #uxBids .ux-ob-row:nth-child(n+7) {
    display: none !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-mid {
    height: 35px !important;
    padding: 0 6px !important;
    gap: 4px !important;
    font-size: 0.74rem !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-ob-mid small {
    font-size: 0.5rem;
  }

  html.pwa-standalone body.ux-terminal-page .ux-trades {
    display: none !important;
  }

  /* Positions and history remain fully usable without compressing columns. */
  html.pwa-standalone body.ux-terminal-page .ux-bottom-panel {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-height: 150px !important;
    height: auto !important;
    overflow: hidden !important;
    border: 0 !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tabs {
    width: 100%;
    height: 43px !important;
    gap: 20px !important;
    padding: 0 12px !important;
    overflow-x: auto;
    border-bottom-color: var(--ux-mobile-line) !important;
    scrollbar-width: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tabs::-webkit-scrollbar {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tabs button {
    position: relative;
    flex: 0 0 auto;
    height: 43px;
    padding: 0;
    color: #747e8d;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tabs button.active {
    color: #f4f6f8;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tabs button.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #f3ba2f;
  }

  html.pwa-standalone body.ux-terminal-page .ux-bottom-tab-panel {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.pwa-standalone body.ux-terminal-page .ux-position-table {
    min-width: 620px;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-terminal-page .ux-position-table th,
  html.pwa-standalone body.ux-terminal-page .ux-position-table td {
    padding: 9px 10px;
  }

  html.pwa-standalone body.ux-terminal-page .ux-empty {
    min-height: 112px;
    display: flex;
    align-items: center;
    padding: 16px 12px;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  html.pwa-standalone body.ux-terminal-page .ux-chart-wrap {
    height: 275px !important;
    min-height: 275px !important;
    flex-basis: 275px !important;
  }

  html.pwa-standalone body.ux-terminal-page .ux-chart-meta {
    display: none;
  }

  html.pwa-standalone body.ux-terminal-page .ux-market-stats {
    padding-left: 0;
  }

  html.pwa-standalone body.ux-terminal-page .ux-terminal-grid {
    grid-template-columns: minmax(0, 60fr) minmax(124px, 40fr) !important;
  }
}

/* ----- APK profile hub v2: installed app only ----- */
@media (max-width: 768px) {
  html.pwa-standalone .app-profile-screen {
    inset: 0 0 calc(var(--abn-h) + env(safe-area-inset-bottom)) 0;
    z-index: 1150;
    background: #080b10;
    transform: translateX(16px);
  }

  html.pwa-standalone .app-profile-screen.is-open {
    transform: translateX(0);
  }

  html.pwa-standalone body.app-profile-open {
    overflow: hidden !important;
  }

  html.pwa-standalone .app-profile-header {
    min-height: calc(54px + env(safe-area-inset-top));
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: end;
    gap: 7px;
    padding: env(safe-area-inset-top) 12px 8px;
    background: rgba(8, 11, 16, 0.98);
    border-bottom-color: rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone .app-profile-header h1 {
    margin: 0 0 6px;
    font-size: 0.92rem;
    letter-spacing: 0;
  }

  html.pwa-standalone .app-profile-header button,
  html.pwa-standalone .app-profile-header > a {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    background: #121720;
  }

  html.pwa-standalone .app-profile-scroll {
    padding: 0 12px 24px;
    background: #080b10;
  }

  html.pwa-standalone .app-profile-identity {
    min-width: 0;
    gap: 12px;
    margin: 0 -12px;
    padding: 16px 14px;
    background: #0b0f15;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border: 1px solid rgba(243, 186, 47, 0.35);
    background: #f3ba2f;
    box-shadow: 0 0 0 4px rgba(243, 186, 47, 0.07);
    font-size: 0.94rem;
  }

  html.pwa-standalone .app-profile-identity > div:last-child {
    min-width: 0;
  }

  html.pwa-standalone .app-profile-identity strong {
    overflow: hidden;
    font-size: 0.96rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .app-profile-identity span {
    max-width: 100%;
    margin-top: 3px;
    font-size: 0.69rem;
  }

  html.pwa-standalone .app-profile-identity small {
    margin-top: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.58rem;
  }

  html.pwa-standalone .app-profile-primary-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0 -4px;
    padding: 14px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-primary-actions a {
    min-width: 0;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 7px;
    color: #dfe5ec;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  html.pwa-standalone .app-profile-primary-actions a:active {
    background: rgba(255, 255, 255, 0.045);
  }

  html.pwa-standalone .app-profile-primary-actions i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #151b23;
    color: #f3ba2f;
    font-style: normal;
  }

  html.pwa-standalone .app-profile-primary-actions svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html.pwa-standalone .app-profile-primary-actions span {
    overflow: hidden;
    max-width: 100%;
    font-size: 0.61rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .app-profile-section-title,
  html.pwa-standalone .app-profile-menu-section > h2 {
    margin: 17px 4px 7px;
    color: #737f8f;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  html.pwa-standalone .app-profile-shortcuts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-shortcuts a {
    min-width: 0;
    min-height: 56px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 0;
    background: transparent;
    color: #e6ebf1;
    text-decoration: none;
  }

  html.pwa-standalone .app-profile-shortcuts a::after {
    content: "\203A";
    grid-column: 3;
    color: #566273;
    font-size: 1.1rem;
  }

  html.pwa-standalone .app-profile-shortcuts i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #141a22;
    color: #9aa7b7;
    font-style: normal;
  }

  html.pwa-standalone .app-profile-shortcuts svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html.pwa-standalone .app-profile-shortcuts span {
    min-width: 0;
  }

  html.pwa-standalone .app-profile-shortcuts b,
  html.pwa-standalone .app-profile-shortcuts small {
    display: block;
  }

  html.pwa-standalone .app-profile-shortcuts b {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .app-profile-shortcuts small {
    margin-top: 2px;
    color: #737f8e;
    font-size: 0.59rem;
  }

  html.pwa-standalone .app-profile-wallet {
    min-height: 58px;
    margin: 15px 0 0;
    padding: 10px 11px;
    border: 1px solid rgba(243, 186, 47, 0.16);
    border-radius: 7px;
    background: rgba(243, 186, 47, 0.045);
  }

  html.pwa-standalone .app-profile-wallet-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  html.pwa-standalone .app-profile-wallet-copy > i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #667282;
  }

  html.pwa-standalone .app-profile-wallet-copy > i.is-connected {
    background: #16c784;
    box-shadow: 0 0 8px rgba(22, 199, 132, 0.48);
  }

  html.pwa-standalone .app-profile-wallet-copy > div {
    min-width: 0;
  }

  html.pwa-standalone .app-profile-wallet strong {
    overflow: hidden;
    max-width: 150px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .app-profile-wallet-actions {
    flex: 0 0 auto;
    gap: 7px;
  }

  html.pwa-standalone .app-profile-wallet a,
  html.pwa-standalone .app-profile-wallet button {
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(243, 186, 47, 0.2);
    border-radius: 6px;
    background: rgba(243, 186, 47, 0.06);
    font-size: 0.61rem;
  }

  html.pwa-standalone .app-profile-wallet button {
    border-color: rgba(255, 107, 123, 0.2);
    background: rgba(255, 107, 123, 0.055);
  }

  html.pwa-standalone .app-profile-menu-section {
    margin-top: 0;
  }

  html.pwa-standalone .app-profile-nav {
    display: block;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-nav .sb-section {
    padding: 15px 4px 6px;
    color: #667282;
    font-family: inherit;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0;
  }

  html.pwa-standalone .app-profile-nav .sb-link,
  html.pwa-standalone .app-profile-nav .sb-group > summary {
    min-height: 48px;
    gap: 10px;
    padding: 7px 4px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 0;
    background: transparent;
    color: #c9d1dc;
    font-family: inherit;
    font-size: 0.71rem;
    font-weight: 650;
  }

  html.pwa-standalone .app-profile-nav .sb-link > svg:first-child,
  html.pwa-standalone .app-profile-nav .sb-group > summary > svg:first-child {
    width: 16px;
    height: 16px;
    color: #8794a4;
    opacity: 1;
  }

  html.pwa-standalone .app-profile-nav .sb-link.is-active {
    color: #f2f5f8;
    background: rgba(243, 186, 47, 0.055);
  }

  html.pwa-standalone .app-profile-nav .sb-link.is-active::before {
    width: 2px;
    background: #f3ba2f;
  }

  html.pwa-standalone .app-profile-nav .sb-group > summary .sb-chevron {
    color: #667282;
    opacity: 1;
  }

  html.pwa-standalone .app-profile-nav .sb-children {
    gap: 0;
    padding: 0 0 5px 24px;
    background: rgba(255, 255, 255, 0.012);
  }

  html.pwa-standalone .app-profile-nav .sb-children .sb-link {
    min-height: 41px;
    padding: 6px 4px;
    color: #929dac;
    font-size: 0.66rem;
  }

  html.pwa-standalone .app-profile-nav .sb-badge {
    border-radius: 4px;
    font-size: 0.48rem;
  }

  html.pwa-standalone .app-profile-actions {
    margin-top: 18px;
    border-top-color: rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-actions a,
  html.pwa-standalone .app-profile-actions button {
    position: relative;
    min-height: 56px;
    padding: 8px 24px 8px 4px;
    border-bottom-color: rgba(255, 255, 255, 0.065);
  }

  html.pwa-standalone .app-profile-actions a::after,
  html.pwa-standalone .app-profile-actions button::after {
    content: "\203A";
    position: absolute;
    right: 5px;
    color: #566273;
    font-size: 1.1rem;
  }

  html.pwa-standalone .app-profile-actions span,
  html.pwa-standalone .app-profile-actions b,
  html.pwa-standalone .app-profile-actions small {
    display: block;
  }

  html.pwa-standalone .app-profile-actions b {
    color: #dfe5ec;
    font-size: 0.72rem;
  }

  html.pwa-standalone .app-profile-actions small {
    margin-top: 2px;
    color: #737f8e;
    font-size: 0.59rem;
  }

  html.pwa-standalone .app-profile-actions .is-danger b {
    color: #ff6b7b;
  }

  html.pwa-standalone[data-theme="light"] .app-profile-screen,
  html.pwa-standalone[data-theme="light"] .app-profile-scroll {
    background: #f4f6f8;
    color: #121720;
  }

  html.pwa-standalone[data-theme="light"] .app-profile-header,
  html.pwa-standalone[data-theme="light"] .app-profile-identity {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.09);
  }

  html.pwa-standalone[data-theme="light"] .app-profile-header button,
  html.pwa-standalone[data-theme="light"] .app-profile-header > a,
  html.pwa-standalone[data-theme="light"] .app-profile-primary-actions i,
  html.pwa-standalone[data-theme="light"] .app-profile-shortcuts i {
    background: #e9edf1;
    color: #3b4654;
    border-color: rgba(15, 23, 42, 0.08);
  }

  html.pwa-standalone[data-theme="light"] .app-profile-primary-actions,
  html.pwa-standalone[data-theme="light"] .app-profile-shortcuts,
  html.pwa-standalone[data-theme="light"] .app-profile-shortcuts a,
  html.pwa-standalone[data-theme="light"] .app-profile-nav,
  html.pwa-standalone[data-theme="light"] .app-profile-nav .sb-link,
  html.pwa-standalone[data-theme="light"] .app-profile-nav .sb-group > summary,
  html.pwa-standalone[data-theme="light"] .app-profile-actions,
  html.pwa-standalone[data-theme="light"] .app-profile-actions a,
  html.pwa-standalone[data-theme="light"] .app-profile-actions button {
    border-color: rgba(15, 23, 42, 0.085);
  }

  html.pwa-standalone[data-theme="light"] .app-profile-primary-actions a,
  html.pwa-standalone[data-theme="light"] .app-profile-shortcuts a,
  html.pwa-standalone[data-theme="light"] .app-profile-nav .sb-link,
  html.pwa-standalone[data-theme="light"] .app-profile-nav .sb-group > summary,
  html.pwa-standalone[data-theme="light"] .app-profile-actions a,
  html.pwa-standalone[data-theme="light"] .app-profile-actions button,
  html.pwa-standalone[data-theme="light"] .app-profile-actions b {
    color: #202a36;
  }

  html.pwa-standalone[data-theme="light"] .app-profile-nav .sb-children {
    background: rgba(15, 23, 42, 0.018);
  }
}

/* ----- Installed-app launchpad ----- */
.uxlp-mobile-home-head,
.uxlp-mobile-detail-bar {
  display: none;
}

@media (max-width: 768px) {
  html.pwa-standalone body.ux-launchpad-page {
    overflow-x: hidden;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .app-shell,
  html.pwa-standalone body.ux-launchpad-page .app-main,
  html.pwa-standalone body.ux-launchpad-page .app-content {
    width: 100%;
    min-width: 0;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-shell {
    width: 100%;
    min-height: calc(100vh - var(--abn-h));
    padding: env(safe-area-inset-top) 0 14px;
    overflow: visible;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-tape,
  html.pwa-standalone body.ux-launchpad-page .uxlp-page-title,
  html.pwa-standalone body.ux-launchpad-page .pump-hero {
    display: none !important;
  }

  /* Compact app header: product identity plus wallet state. */
  html.pwa-standalone body.ux-launchpad-page .pump-topbar {
    position: relative;
    top: auto;
    z-index: 110;
    width: 100%;
    height: 52px;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 44%);
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #080b10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-brand {
    width: auto;
    min-width: 0;
    display: flex;
    gap: 7px;
    align-items: baseline;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-brand > span {
    font-size: 0.79rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-brand small {
    overflow: hidden;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar nav,
  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-chip.gold {
    display: none !important;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-top-actions {
    min-width: 0;
    display: block;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-wallet-dropdown {
    width: 100%;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-wallet-trigger {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 0.63rem;
    background: #121720;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-topbar .uxlp-wallet-menu {
    right: 0;
    left: auto;
    width: min(230px, calc(100vw - 24px));
    border-radius: 9px;
  }

  /* Mobile launch summary replaces the oversized desktop hero. */
  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 18px 12px 14px;
    background: #080b10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head span {
    display: block;
    margin-bottom: 4px;
    color: #f3ba2f;
    font-size: 0.61rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head h1,
  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head p {
    margin: 0;
    letter-spacing: 0;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head h1 {
    color: #f5f7fa;
    font-size: 1.45rem;
    line-height: 1.08;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-home-head p {
    margin-top: 3px;
    color: #929baa;
    font-size: 0.76rem;
    font-weight: 700;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-create {
    height: 38px;
    padding: 0 15px;
    border: 0;
    border-radius: 7px;
    background: #f3ba2f;
    color: #0a0b0d;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
  }

  /* Feed controls and filters become one compact mobile stack. */
  html.pwa-standalone body.ux-launchpad-page .pump-board {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel {
    order: 1;
    width: 100%;
    height: auto;
    padding: 9px 10px 8px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
    background: #080b10;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-create-card,
  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-search,
  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-tags,
  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .pump-wallet-card {
    display: none !important;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-tabs {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-tabs::-webkit-scrollbar {
    display: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-tabs button {
    flex: 1 0 auto;
    min-width: 66px;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: #141922;
    color: #858f9e;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-left-panel .uxlp-tabs button.active {
    background: #252b34;
    color: #f5f7fa;
    box-shadow: inset 0 -2px #f3ba2f;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-market {
    order: 2;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    padding: 0 10px 12px;
    border: 0;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-market .uxlp-mobile-detail-slot {
    width: 0;
    height: 0;
    margin: 0;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-market .uxlp-market-tools {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 14px 2px 11px;
    border-bottom: 0;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-market-title strong {
    color: #f4f6f8;
    font-size: 0.94rem;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-market-title small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    margin-top: 2px;
    color: #687382;
    font-size: 0.59rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-market-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-live-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 7px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-live-controls input,
  html.pwa-standalone body.ux-launchpad-page .uxlp-live-controls select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 9px;
    border-radius: 7px;
    background: #121720;
    border-color: #252d39;
    font-size: 0.62rem;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-view-icons {
    display: block;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-view-icons button {
    width: 34px;
    height: 34px;
    border-radius: 7px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-view-icons button:first-child {
    display: none;
  }

  /* Dense market rows keep live launches scannable with one hand. */
  html.pwa-standalone body.ux-launchpad-page .pump-token-grid {
    width: 100%;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 0;
    overflow: visible;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-rows: auto 7px;
    gap: 7px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 7px;
    background: #0b0f15;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card.active {
    border-color: rgba(243, 186, 47, 0.38);
    background: #10141a;
    box-shadow: inset 3px 0 #f3ba2f;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-badge {
    display: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-img {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.15rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-main b {
    color: #f2f4f7;
    font-size: 0.78rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-main em {
    margin-top: 2px;
    color: #747f8e;
    font-size: 0.62rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-meta {
    display: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-progress {
    grid-column: 2 / 4;
    grid-row: 2;
    width: 100%;
    height: 5px;
    border: 0;
    background: #1a2029;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-foot {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
    font-size: 0.7rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-token-card .uxlp-card-foot small {
    display: none;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-empty {
    min-height: 150px;
    border-radius: 7px;
    font-size: 0.72rem;
    text-align: center;
    padding: 16px;
  }

  /* Selecting a token opens a dedicated app screen above the feed. */
  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-detail-slot .uxlp-detail.pump-detail {
    position: fixed !important;
    inset: env(safe-area-inset-top) 0 calc(var(--abn-h) + env(safe-area-inset-bottom)) 0 !important;
    z-index: 1180 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    display: none !important;
    padding: 0 11px 24px !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #070a0f !important;
    border: 0 !important;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-detail-slot .uxlp-detail.pump-detail.is-mobile-open {
    display: block !important;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-detail-bar {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 -11px 12px;
    padding: 0 12px;
    background: rgba(7, 10, 15, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-detail-bar button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #262e39;
    border-radius: 50%;
    background: #121720;
    color: #f5f7fa;
    font: inherit;
    font-size: 1rem;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-mobile-detail-bar strong {
    color: #f4f6f8;
    font-size: 0.82rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-selected-head {
    gap: 10px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-selected-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-selected-head h2 {
    font-size: 1rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-selected-head p {
    font-size: 0.64rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-price-row {
    padding: 11px 0;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-price-row strong {
    font-size: 1.35rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-chart-card.pump-pro-chart {
    width: 100%;
    height: clamp(440px, 62vh, 560px);
    display: grid;
    grid-template-areas:
      "chart-head"
      "chart-tools"
      "chart-ohlc"
      "chart-stage"
      "chart-foot";
    grid-template-rows: auto auto auto minmax(280px, 1fr) auto;
    gap: 6px;
    margin: 11px 0;
    padding: 10px;
    border-radius: 7px;
    background: #111419;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-head {
    grid-area: chart-head;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-tools {
    grid-area: chart-tools;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-ohlc {
    grid-area: chart-ohlc;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-stage {
    grid-area: chart-stage;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-foot {
    grid-area: chart-foot;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-metric strong {
    font-size: 1.3rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-ath {
    margin-top: 8px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-tools {
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-tools::-webkit-scrollbar {
    display: none;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-tools button {
    flex: 0 0 auto;
    height: 26px;
    padding: 0 6px;
    font-size: 0.58rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-ohlc {
    font-size: 0.58rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart .pump-chart-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    overflow: hidden;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart #lpChart,
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart #lpGeckoFrame {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  /* When the GeckoTerminal embed is active, use a simple flex column (header +
     full-bleed chart) so the named grid-areas don't squeeze the iframe. */
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active {
    display: flex !important;
    flex-direction: column;
    height: clamp(440px, 64vh, 580px);
  }
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-tools,
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-ohlc,
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-foot {
    display: none !important;
  }
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-head {
    flex: 0 0 auto;
  }
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-stage {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
  }
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active #lpChart {
    display: none !important;
  }
  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active #lpGeckoFrame {
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
  }

  /* Match the Web3 mobile chart: Birdeye TradingView, edge-to-edge and fixed rails. */
  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-chart-card.pump-pro-chart.web3-mobile-chart {
    height: 450px;
    grid-template-areas:
      "chart-head"
      "chart-stage"
      "chart-foot";
    grid-template-rows: 82px minmax(0, 1fr) 34px;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #080d11;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-head {
    height: 82px;
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #1e2a33;
    background: #080d11;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-metric span {
    color: #8290a0;
    font-size: 0.62rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-metric strong {
    margin-top: 5px;
    font-size: 1.28rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-metric small {
    margin-top: 4px;
    font-size: 0.6rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-ath,
  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-tools,
  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-ohlc {
    display: none !important;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-stage {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #080d11;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart #lpGeckoFrame {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    background: #080d11;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-foot {
    height: 34px;
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border-top: 1px solid #1e2a33;
    color: #627283;
    font-size: 0.56rem;
    background: #080d11;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-foot span:first-child {
    width: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-foot span:first-child::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #1fd39a;
    box-shadow: 0 0 8px rgba(31, 211, 154, 0.5);
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .web3-mobile-chart .pump-chart-foot button {
    display: none !important;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-foot {
    flex-wrap: nowrap;
    gap: 7px;
    font-size: 0.58rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-chart-foot span:first-child {
    width: auto;
    min-width: 0;
    margin-right: auto;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin: 10px 0;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-info-grid div {
    padding: 9px;
    border-radius: 7px;
    background: #10151c;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-desc {
    max-height: 92px;
    margin: 0;
    padding: 9px;
    border-radius: 7px;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-flash {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #0c1118;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-flash h3 {
    font-size: 0.86rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-buy-tabs {
    border-radius: 6px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-buy-tabs button {
    height: 38px;
    font-size: 0.72rem;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-flash label > div {
    height: 44px;
    border-radius: 7px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-btn {
    height: 42px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  html.pwa-standalone body.ux-launchpad-page.uxlp-mobile-detail-open {
    overflow: hidden !important;
  }

  /* Secondary sections stay compact; setup guidance lives behind Create. */
  html.pwa-standalone body.ux-launchpad-page .uxlp-orders {
    margin: 4px 10px 14px;
    padding: 13px;
    border-radius: 8px;
    background: #0b0f15;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-orders h3 {
    font-size: 0.86rem;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-orders .table-wrap {
    overflow-x: auto;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-orders table {
    min-width: 620px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-create-section {
    display: none !important;
  }

  /* Token creation is a full app screen instead of a squeezed desktop dialog. */
  html.pwa-standalone body.ux-launchpad-page .uxlp-modal {
    place-items: stretch;
    padding: 0;
    background: #05070a;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-modal-card {
    width: 100%;
    height: 100%;
    max-height: none;
    padding: calc(env(safe-area-inset-top) + 58px) 12px calc(env(safe-area-inset-bottom) + 22px);
    border: 0;
    border-radius: 0;
    overflow-y: auto;
    box-shadow: none;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-modal-card h2 {
    margin-bottom: 5px;
    font-size: 1.35rem;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-modal-card > p {
    margin-bottom: 14px;
    font-size: 0.7rem;
    line-height: 1.45;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-modal-x {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 10px);
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-image-upload label {
    height: 155px;
    border-radius: 8px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-form-fields {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-form .wide {
    grid-column: 1;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-form input,
  html.pwa-standalone body.ux-launchpad-page .uxlp-form textarea,
  html.pwa-standalone body.ux-launchpad-page .uxlp-form select {
    margin-top: 5px;
    border-radius: 7px;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-wallet-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  html.pwa-standalone body.ux-launchpad-page .uxlp-wallet-actions .uxlp-btn {
    width: 100%;
    height: 44px;
    border-radius: 7px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-jupiter-modal {
    padding: 0;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-jupiter-card {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 360px) {
  html.pwa-standalone body.ux-launchpad-page .uxlp-live-controls {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .uxlp-chart-card.pump-pro-chart {
    height: 420px;
    grid-template-rows: auto auto auto minmax(250px, 1fr) auto;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart .pump-chart-stage {
    min-height: 250px;
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active {
    grid-template-rows: auto minmax(0, 1fr);
  }

  html.pwa-standalone body.ux-launchpad-page .pump-detail .pump-pro-chart.gecko-active .pump-chart-stage {
    min-height: 0;
  }
}

/* ----- Installed-app Smart Trade terminal ----- */
.st-mobile-watch-head,
.st-mobile-balance {
  display: none;
}

@media (max-width: 768px) {
  html.pwa-standalone body.ux-smart-page {
    overflow-x: hidden !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-smart-page .app-shell,
  html.pwa-standalone body.ux-smart-page .app-main,
  html.pwa-standalone body.ux-smart-page .app-content {
    width: 100% !important;
    min-width: 0 !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-smart-page .wrap-app.ux-smart {
    width: 100% !important;
    min-height: calc(100vh - var(--abn-h)) !important;
    margin: 0 !important;
    padding: env(safe-area-inset-top) 0 0 !important;
    overflow: visible !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-smart-page .st-shell {
    width: 100%;
    min-height: 0 !important;
    overflow: visible !important;
    background: #05070a;
  }

  html.pwa-standalone body.ux-smart-page .st-top {
    display: none !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-trade-switch {
    min-height: 43px;
    gap: 22px;
    align-items: center;
    padding: 0 14px;
    background: #080b10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-smart-page .ux-trade-switch-btn {
    position: relative;
    height: 43px;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #7e8795;
    font-size: 0.78rem;
    font-weight: 700;
  }

  html.pwa-standalone body.ux-smart-page .ux-trade-switch-btn.active {
    color: #f4f6f8;
    background: transparent;
  }

  html.pwa-standalone body.ux-smart-page .ux-trade-switch-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: #f3ba2f;
  }

  /* Pair and market stats mirror the app Spot/Futures terminal. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-strip {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #080b10 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-pair {
    grid-column: 1 / -1;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 10px 12px 8px !important;
    border: 0 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-menu-icon {
    width: 38px !important;
    min-width: 38px;
    height: 38px !important;
    display: grid;
    place-items: center;
    padding: 0 !important;
    border: 1px solid #242b36 !important;
    border-radius: 8px !important;
    background: #121720 !important;
    color: #d6dbe3 !important;
    font: inherit;
    font-size: 1rem !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-pair > div {
    min-width: 0 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-symbol-title {
    overflow: hidden !important;
    color: #f5f7fa !important;
    font-size: 1rem !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-symbol-title span:last-child {
    font-size: 0.56rem !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-pair small {
    display: block !important;
    overflow: hidden !important;
    max-width: 100% !important;
    font-size: 0.58rem !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-price {
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
    letter-spacing: 0 !important;
    text-align: right !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-strip > .st-stat {
    display: block !important;
    min-width: 0 !important;
    padding: 0 9px 9px !important;
    border: 0 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-strip > .st-stat:nth-child(n+5) {
    display: none !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-strip > .st-stat small {
    overflow: hidden;
    margin: 0 0 2px !important;
    color: #697382 !important;
    font-size: 0.54rem !important;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-strip > .st-stat b {
    display: block;
    overflow: hidden;
    font-size: 0.68rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Chart, order ticket/book, AI, strategies and activity. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-grid {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 58fr) minmax(132px, 42fr) !important;
    grid-template-rows: auto auto auto auto auto !important;
    grid-template-areas:
      "smart-chart smart-chart"
      "smart-order smart-book"
      "smart-ai smart-ai"
      "smart-bots smart-bots"
      "smart-history smart-history" !important;
    gap: 0 !important;
    overflow: visible !important;
    background: #05070a !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart {
    grid-area: smart-chart !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: 38px 310px 31px !important;
    overflow: hidden !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-toolbar {
    width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    gap: 8px;
    padding: 0 9px !important;
    overflow: hidden !important;
    background: #080b10 !important;
    border-bottom-color: rgba(255, 255, 255, 0.075) !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-intervals {
    min-width: 0;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-intervals::-webkit-scrollbar {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-intervals button {
    flex: 0 0 auto;
    min-width: 31px;
    height: 26px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 0.65rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-meta {
    flex: 0 0 auto;
    font-size: 0.59rem !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-box {
    position: relative !important;
    width: 100% !important;
    height: 310px !important;
    min-height: 310px !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-tv-chart,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-tv-chart > div,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-tv-chart iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-quote-float {
    display: none !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-footer {
    width: 100%;
    height: 31px !important;
    min-height: 31px !important;
    padding: 0 10px !important;
    color: #687382 !important;
    font-size: 0.59rem !important;
    background: #080b10 !important;
    border-top-color: rgba(255, 255, 255, 0.075) !important;
  }

  /* Market rail becomes an app selector instead of a tall page section. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch {
    position: fixed !important;
    inset: env(safe-area-inset-top) 0 calc(var(--abn-h) + env(safe-area-inset-bottom)) 0 !important;
    z-index: 1350 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 0 !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch.is-mobile-open {
    display: flex !important;
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-watch-head {
    height: 50px;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-watch-head strong {
    font-size: 0.84rem;
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-watch-head button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #28313d;
    border-radius: 50%;
    background: #121720;
    color: #f4f6f8;
    font: inherit;
    font-size: 1rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-tabs {
    flex: 0 0 auto !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px !important;
    background: #080b10;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-market-tabs a {
    min-height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-search {
    flex: 0 0 auto;
    padding: 0 10px 9px;
    border-bottom: 0;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-search input {
    height: 42px;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-tabs {
    flex: 0 0 auto;
    gap: 5px;
    padding: 0 10px 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-tabs button {
    flex: 1;
    height: 32px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 0.64rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-count {
    flex: 0 0 27px !important;
    height: 27px !important;
    padding: 0 10px;
    font-size: 0.59rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-watch-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-row {
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) auto 66px;
    gap: 8px;
    padding: 9px 12px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-row b {
    font-size: 0.74rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-row small,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-row .price,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-row .chg {
    font-size: 0.62rem;
  }

  html.pwa-standalone body.ux-smart-page.st-mobile-watch-open {
    overflow: hidden !important;
  }

  /* Split ticket/book row. The AI panel participates as its own full-width row. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-right {
    display: contents !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-right-section:first-child {
    grid-area: smart-order !important;
    min-width: 0;
    padding: 9px 8px 11px !important;
    overflow: visible !important;
    border-right: 1px solid rgba(255, 255, 255, 0.075) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    background: #0b0e13 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-right-section:first-child > .st-panel-title {
    height: 31px !important;
    padding: 0 1px 8px !important;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-balance {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 24px;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: #737d8b;
    font-size: 0.57rem;
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-balance b {
    overflow: hidden;
    color: #dce1e8;
    font-size: 0.61rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-smart-page .st-mobile-balance a {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: rgba(243, 186, 47, 0.12);
    color: #f3ba2f;
    font-size: 1rem;
    text-decoration: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-side-switch {
    margin: 0 0 9px;
    border-radius: 6px;
    background: #171c24;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-side-switch button {
    height: 35px;
    padding: 0;
    font-size: 0.69rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-form-tabs {
    gap: 11px;
    margin: 7px 0 9px;
    overflow: hidden;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-form-tabs label {
    flex: 0 0 auto;
    font-size: 0.63rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-form-tabs label:nth-child(3) {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-field {
    margin-bottom: 8px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart[data-order-type="Market"] #stPriceField {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-field label {
    gap: 4px;
    margin-bottom: 4px;
    font-size: 0.56rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-field label b {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-input,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-select {
    height: 38px;
    min-width: 0;
    padding: 0 7px;
    border-radius: 5px;
    background: #171c24;
    border-color: #29313d;
    font-size: 0.67rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-input-wrap .st-input {
    padding-right: 50px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-input-wrap .suffix {
    right: 7px;
    max-width: 46px;
    overflow: hidden;
    font-size: 0.56rem;
    text-overflow: ellipsis;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-pcts {
    gap: 3px;
    margin: 4px 0 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-pcts button {
    min-width: 0;
    height: 25px;
    padding: 0 2px;
    border-radius: 5px;
    font-size: 0.55rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-kv {
    gap: 0;
    margin: 7px 0 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-kv div {
    gap: 5px;
    font-size: 0.58rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-right-section:first-child .st-kv div:nth-child(n+2) {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-submit-row {
    display: block;
    margin-top: 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-submit-row .st-btn {
    width: 100%;
    height: 40px;
    padding: 0;
    border-radius: 6px;
    font-size: 0.75rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart[data-order-side="Buy"] .st-submit-row .red,
  html.pwa-standalone body.ux-smart-page .ux-smart[data-order-side="Sell"] .st-submit-row .green {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-account {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-orderbook {
    grid-area: smart-book !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    background: #0b0e13 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-orderbook > .st-panel-title {
    height: 36px;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-head,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4px;
    padding: 0 5px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-head {
    height: 27px;
    font-size: 0.51rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-row {
    height: 23px;
    font-size: 0.56rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-head span,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-head span:nth-child(3),
  html.pwa-standalone body.ux-smart-page .ux-smart .st-ob-row span:nth-child(4) {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart #stAsks .st-ob-row:nth-child(n+7),
  html.pwa-standalone body.ux-smart-page .ux-smart #stBids .st-ob-row:nth-child(n+7) {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-mid {
    min-height: 35px;
    padding: 8px 6px;
    font-size: 0.72rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-recent {
    display: none;
  }

  /* AI assistant gets a full-width action surface below trading. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-right-section:nth-child(2) {
    grid-area: smart-ai !important;
    min-width: 0;
    padding: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ai-card {
    padding: 11px;
    border: 0;
    border-radius: 7px;
    background: #0d1219;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ai-head {
    margin-bottom: 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ai-signal {
    font-size: 1.25rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart #stAiReason {
    font-size: 0.68rem !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-ai-card .st-kv {
    gap: 5px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 9px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-metric {
    min-width: 0;
    padding: 7px 5px;
    border-radius: 6px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-metric small {
    font-size: 0.52rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-metric b {
    display: block;
    overflow: hidden;
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Strategies and log remain available below the trading workflow. */
  html.pwa-standalone body.ux-smart-page .ux-smart .st-bots {
    grid-area: smart-bots !important;
    width: 100% !important;
    min-height: 0 !important;
    display: block !important;
    overflow: visible !important;
    border-top: 0 !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-create,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-list {
    width: 100%;
    min-height: 0;
    padding: 12px 10px;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-create > .st-panel-title,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-list > .st-panel-title {
    min-height: 34px;
    font-size: 0.78rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 7px;
    padding: 10px;
    border-radius: 7px;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-row > span:nth-child(3) {
    grid-column: 1;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-row > span:nth-child(4) {
    grid-column: 2;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-row > span:nth-child(5) {
    grid-column: 1 / -1;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-bot-row .st-btn {
    flex: 1;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.64rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-history {
    grid-area: smart-history !important;
    width: 100% !important;
    min-height: 150px !important;
    max-height: none !important;
    display: block !important;
    padding: 12px 10px !important;
    overflow: hidden !important;
    border-top: 0 !important;
    background: #080b10 !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-history > .st-panel-title {
    min-height: 34px;
    font-size: 0.78rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-history > div {
    width: 100%;
    overflow-x: auto !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-table {
    min-width: 680px;
    font-size: 0.66rem;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-table th,
  html.pwa-standalone body.ux-smart-page .ux-smart .st-table td {
    padding: 8px;
  }

  html.pwa-standalone body.ux-smart-page .st-toast {
    right: 10px;
    bottom: calc(var(--abn-h) + env(safe-area-inset-bottom) + 10px);
    left: 10px;
    max-width: none;
    padding: 11px 12px;
    border-radius: 7px;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart {
    grid-template-rows: 38px 275px 31px !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-box {
    height: 275px !important;
    min-height: 275px !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-chart-meta {
    display: none;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-grid {
    grid-template-columns: minmax(0, 60fr) minmax(124px, 40fr) !important;
  }

  html.pwa-standalone body.ux-smart-page .ux-smart .st-metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Markets — native app screen (installed app only) ===== */
@media (max-width: 768px) {
  html.pwa-standalone body.page-markets .app-topbar,
  html.pwa-standalone body.page-markets .site-footer { display: none !important; }
  html.pwa-standalone body.page-markets { background: var(--ux-bg-main, #05070f); }
  html.pwa-standalone body.page-markets main {
    display: block;
    padding-bottom: calc(var(--abn-h) + env(safe-area-inset-bottom) + 12px);
  }
  html.pwa-standalone body.page-markets .ux-market-page-v2 { padding: calc(10px + env(safe-area-inset-top)) 0 0 !important; }
  html.pwa-standalone body.page-markets .ux-market-wrap { padding: 0 12px !important; max-width: none; }

  /* Drop the marketing chrome — keep search, tabs and the coin list. */
  html.pwa-standalone body.page-markets .ux-market-copy .ux-kicker,
  html.pwa-standalone body.page-markets .ux-market-copy h1,
  html.pwa-standalone body.page-markets .ux-market-copy p,
  html.pwa-standalone body.page-markets .ux-market-feature-card,
  html.pwa-standalone body.page-markets .ux-market-stats,
  html.pwa-standalone body.page-markets .ux-market-toolbar,
  html.pwa-standalone body.page-markets .ux-market-grid,
  html.pwa-standalone body.page-markets .ux-market-table thead,
  html.pwa-standalone body.page-markets .ux-table-chart,
  html.pwa-standalone body.page-markets #marketClear { display: none !important; }

  html.pwa-standalone body.page-markets .ux-market-hero {
    display: block !important; grid-template-columns: none !important; gap: 0 !important; margin: 0 !important;
  }
  html.pwa-standalone body.page-markets .ux-market-hero::before {
    content: "Markets"; display: block;
    font-size: 1.4rem; font-weight: 800; color: var(--ux-text-main, #fff); margin: 2px 0 12px;
  }
  /* Search becomes a rounded pill. */
  html.pwa-standalone body.page-markets .ux-market-searchbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 12px; padding: 0 14px; height: 44px; border-radius: 12px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  }
  html.pwa-standalone body.page-markets .ux-market-searchbar > span { color: var(--ux-text-muted, #8793a8); }
  html.pwa-standalone body.page-markets .ux-market-searchbar input {
    flex: 1; height: 100%; background: none; border: 0; outline: none;
    color: var(--ux-text-main, #fff); font-size: 16px; padding: 0;
  }
  /* Category tabs scroll horizontally. */
  html.pwa-standalone body.page-markets .ux-market-tabs {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 6px; padding-bottom: 2px;
  }
  html.pwa-standalone body.page-markets .ux-market-tabs::-webkit-scrollbar { display: none; }
  html.pwa-standalone body.page-markets .ux-market-tabs button { flex: 0 0 auto; white-space: nowrap; }

  /* Coin list: the table renders as clean app rows (name · price · change pill). */
  html.pwa-standalone body.page-markets .ux-market-table-wrap {
    border: 0 !important; padding: 0 !important; background: none !important; overflow: visible !important;
  }
  html.pwa-standalone body.page-markets .ux-market-table,
  html.pwa-standalone body.page-markets .ux-market-table tbody { display: block !important; width: 100%; }
  html.pwa-standalone body.page-markets .ux-market-table tr {
    display: grid !important; grid-template-columns: 1fr auto 78px; gap: 10px; align-items: center;
    padding: 13px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  html.pwa-standalone body.page-markets .ux-market-table td { padding: 0 !important; border: 0 !important; background: none !important; }
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(5),
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(6) { display: none !important; }
  html.pwa-standalone body.page-markets .ux-symbol-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
  }
  html.pwa-standalone body.page-markets .ux-symbol-btn span { font-size: .96rem; font-weight: 800; color: var(--ux-text-main, #fff); }
  html.pwa-standalone body.page-markets .ux-symbol-btn small { font-size: .68rem; color: var(--ux-text-muted, #8793a8); }
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(2) {
    text-align: right; font-weight: 700; font-size: .92rem; color: var(--ux-text-main, #fff);
  }
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(3) {
    justify-self: end; min-width: 74px; text-align: center; padding: 7px 0 !important;
    border-radius: 8px; font-weight: 800; font-size: .8rem; color: #fff !important;
  }
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(3).up { background: var(--ux-profit, #16c784); }
  html.pwa-standalone body.page-markets .ux-market-table td:nth-child(3).down { background: var(--ux-loss, #ea3943); }
}
