/* AscendEx — Smooth motion & polished exchange UI */

:root[data-theme="ascendex"] {
  --ex-surface: rgba(18, 18, 26, 0.92);
  --ex-border: rgba(255, 255, 255, 0.08);
  --ex-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Animated ambient background ── */
@keyframes exOrbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .55; }
  50% { transform: translate(30px, -20px) scale(1.08); opacity: .75; }
}
@keyframes exOrbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .35; }
  50% { transform: translate(-25px, 15px) scale(1.06); opacity: .5; }
}
@keyframes exGridFade {
  0%, 100% { opacity: .25; }
  50% { opacity: .4; }
}

:root[data-theme="ascendex"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(124,109,240,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,109,240,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 25%, #000 15%, transparent 72%);
  animation: exGridFade 8s ease-in-out infinite;
}

:root[data-theme="ascendex"] #app {
  position: relative;
  z-index: 1;
}

:root[data-theme="ascendex"] #app::before {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,109,240,.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: exOrbDrift1 12s ease-in-out infinite;
}

:root[data-theme="ascendex"] #app::after {
  content: "";
  position: fixed;
  width: 220px;
  height: 220px;
  bottom: 120px;
  left: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,168,.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: exOrbDrift2 14s ease-in-out infinite;
}

/* ── Cards — subtle glass, no heavy 3D ── */
.ex3d-card,
:root[data-theme="ascendex"] .glass:not(.navbar-v2) {
  position: relative;
  background: var(--ex-surface) !important;
  border: 1px solid var(--ex-border) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .35s var(--ex-ease), box-shadow .35s var(--ex-ease), border-color .35s var(--ex-ease);
}

.ex3d-card::before,
:root[data-theme="ascendex"] .glass:not(.navbar-v2)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.01) 50%, rgba(124,109,240,.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.ex3d-card-shine { display: none; }

/* ── Screen & card motion ── */
.section-screen.screen {
  animation: exScreenIn .4s var(--ex-ease) both;
}
@keyframes exScreenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.ex-wallet-card,
.profile-section,
.explore-news-card,
.rating-trade-row-v2,
.coin-row,
.settings-row {
  transition: transform .3s var(--ex-ease), box-shadow .3s var(--ex-ease);
}

.ex-wallet-card:active,
.coin-row:active,
.rating-trade-row-v2:active {
  transform: scale(.985);
}

/* ── Profile wallet card ── */
.profile-shell { gap: 14px !important; padding-left: 16px !important; padding-right: 16px !important; }

.ex-wallet-card {
  border-radius: 18px !important;
  padding: 0 !important;
  overflow: hidden;
}

.ex-wallet-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(124,109,240,.07) 0%, transparent 100%);
}

.ex-wallet-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ex-wallet-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,109,240,.12);
  border: 1px solid rgba(157,147,245,.22);
  flex-shrink: 0;
  overflow: hidden;
}

.ex-wallet-avatar .ax-tri-logo,
.ex-wallet-avatar svg {
  width: 20px !important;
  height: 20px !important;
  display: block;
}

.ex-wallet-identity-text {
  flex: 1;
  min-width: 0;
}

.ex-wallet-tag {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7c6df0;
  line-height: 1;
  margin-bottom: 3px;
}

.ex-wallet-name,
.ex-wallet-card .profile-name {
  margin: 0;
  font-size: 17px !important;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fafafa;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-wallet-balance-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.05);
}

.ex-wallet-bal-main {
  min-width: 0;
}

.ex-wallet-bal-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #6b6b78;
  margin-bottom: 4px;
}

.ex-wallet-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
  min-width: 0;
}

.ex-wallet-amount span {
  font-size: clamp(18px, 5.5vw, 22px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-wallet-amount em {
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  color: #9d93f5;
  flex-shrink: 0;
}

.ex-wallet-bal-pending {
  text-align: right;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  min-width: 72px;
}

.ex-wallet-bal-pending span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #6b6b78;
  margin-bottom: 4px;
  white-space: nowrap;
}

.ex-wallet-bal-pending b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #a89fd4;
  white-space: nowrap;
}

.ex-wallet-id {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.15);
  color: #8b8b98;
  font-size: 11px;
  cursor: pointer;
  transition: background .25s var(--ex-ease), border-color .25s var(--ex-ease);
}
.ex-wallet-id:active { background: rgba(124,109,240,.12); }

.ex-wallet-id > span {
  flex-shrink: 0;
  font-weight: 600;
  color: #6b6b78;
}

.ex-wallet-id code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #d4d4d8;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-wallet-id em {
  flex-shrink: 0;
  font-style: normal;
  font-size: 10px;
  color: #9d93f5;
  font-weight: 700;
}

.ex-wallet-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 0;
}

.ex-wallet-badges .wallet-status-chip {
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
}

.ex-wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 16px;
}

/* ── Action buttons — smooth, not chunky 3D ── */
.ex3d-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 12px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform .25s var(--ex-ease), box-shadow .25s var(--ex-ease), filter .25s var(--ex-ease);
  -webkit-tap-highlight-color: transparent;
}
.ex3d-btn::after { display: none; }
.ex3d-btn:active { transform: scale(.96); }

.ex3d-btn-green {
  background: rgba(74,158,130,.14);
  border: 1px solid rgba(126,184,160,.28);
  color: #8ec4ae;
  box-shadow: none;
}
.ex3d-btn-green .ex3d-btn-ico {
  background: rgba(126,184,160,.15);
}
.ex3d-btn-green .ex3d-btn-ico svg { stroke: #8ec4ae; }

.ex3d-btn-purple {
  background: rgba(124,109,240,.12);
  border: 1px solid rgba(168,159,212,.25);
  color: #c4b5fd;
  box-shadow: none;
}
.ex3d-btn-purple .ex3d-btn-ico {
  background: rgba(168,159,212,.12);
}
.ex3d-btn-purple .ex3d-btn-ico svg { stroke: #c4b5fd; }

.ex3d-btn-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex3d-btn-ico svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ── Stats grid ── */
.ex3d-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px !important;
  border-radius: 16px !important;
}
.ex3d-stat-grid .profile-stat {
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.05);
  text-align: center;
  transition: background .3s var(--ex-ease);
}
.ex3d-stat-grid .profile-stat span {
  display: block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b6b78;
  margin-bottom: 5px;
}
.ex3d-stat-grid .profile-stat b {
  font-size: 16px;
  font-weight: 800;
  color: #ececf1;
}
.ex3d-stat-grid .profile-stat.win b { color: #7eb8a0; }
.ex3d-stat-grid .profile-stat.open b { color: #a89fd4; }

.ex3d-section-head h3 {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: #8b8b98 !important;
}

/* ── NAVBAR — fixed, visible, no glass overlay ── */
.navbar-v2,
.navbar-v2.glass {
  position: fixed !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 480px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom)) !important;
  z-index: 60 !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 2px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(9,9,15,.97) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 -8px 32px rgba(0,0,0,.4) !important;
}

.navbar-v2::before,
.navbar-v2.glass::before {
  display: none !important;
  content: none !important;
}

.navbar-v2 .nav {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px;
  color: #8b8b98;
  font-size: 9px;
  font-weight: 700;
  transition: color .3s var(--ex-ease), transform .25s var(--ex-ease);
}

.navbar-v2 .nav.active {
  color: #c4b5fd;
}

.navbar-v2 .nav-ico {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform .3s var(--ex-ease), background .3s var(--ex-ease);
}

.navbar-v2 .nav.active .nav-ico {
  transform: translateY(-1px);
  background: rgba(124,109,240,.12);
}

.navbar-v2 .nav span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.nav-indicator {
  position: absolute !important;
  top: 6px !important;
  left: 0 !important;
  height: calc(100% - 14px - env(safe-area-inset-bottom)) !important;
  border-radius: 10px !important;
  background: rgba(124,109,240,.16) !important;
  border: 1px solid rgba(124,109,240,.22) !important;
  box-shadow: none !important;
  z-index: 1 !important;
  transition: transform .38s var(--ex-ease), width .38s var(--ex-ease) !important;
  pointer-events: none !important;
}

/* ── Page titles ── */
.section-screen .page-head h1 {
  background: linear-gradient(135deg, #fff 20%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Bottom padding — single layer, no scroll gaps ── */
:root[data-theme="ascendex"] #app {
  padding-bottom: 0 !important;
  min-height: auto !important;
}

:root[data-theme="ascendex"] .section-screen.active {
  padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  min-height: 0 !important;
}

:root[data-theme="ascendex"] #screen-markets.active {
  padding-bottom: calc(var(--markets-scroll-pad, 112px) + env(safe-area-inset-bottom)) !important;
}

:root[data-theme="ascendex"] #screen-amount.active,
:root[data-theme="ascendex"] #screen-direction.active,
:root[data-theme="ascendex"] #screen-time.active,
:root[data-theme="ascendex"] #screen-live.active,
:root[data-theme="ascendex"] #screen-result.active {
  padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
}

:root[data-theme="ascendex"] .profile-shell {
  padding-bottom: 12px !important;
}

:root[data-theme="ascendex"] .explore-news-feed {
  padding-bottom: 16px;
}

/* ── Buttons & interactive ── */
:root[data-theme="ascendex"] .btn-main {
  background: linear-gradient(135deg, #8b7cf6, #6355d8) !important;
  box-shadow: 0 4px 16px rgba(124,109,240,.25) !important;
  border: none !important;
  transition: transform .25s var(--ex-ease), box-shadow .25s var(--ex-ease) !important;
}
:root[data-theme="ascendex"] .btn-main:active {
  transform: scale(.97) !important;
}

.explore-seg,
.rating-tab,
.explore-seg-indicator {
  transition: all .3s var(--ex-ease) !important;
}

/* ── Trade overlay ── */
.trade-detail-card {
  background: rgba(18,18,26,.98) !important;
  border: 1px solid var(--ex-border) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.5) !important;
  animation: exSheetUp .35s var(--ex-ease) both;
}
@keyframes exSheetUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* ── Profile enter animations ── */
@keyframes exFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes exBorderSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes exBalanceGlow {
  0%, 100% { opacity: .92; }
  50% { opacity: 1; text-shadow: 0 0 18px rgba(168,159,212,.28); }
}

.ex-wallet-card.ex3d-card {
  overflow: hidden;
}
.ex-wallet-card.ex3d-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(124,109,240,.28) 35%, rgba(126,184,160,.18) 55%, transparent 100%);
  background-size: 220% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  animation: exBorderSweep 5s linear infinite;
}

.profile-shell.ex-profile-enter .cabinet-identity {
  animation: exFadeUp .52s var(--ex-ease) both;
}
.profile-shell.ex-profile-enter .cabinet-balance {
  animation: exFadeUp .52s var(--ex-ease) .06s both;
}
.profile-shell.ex-profile-enter .cabinet-status {
  animation: exFadeUp .52s var(--ex-ease) .1s both;
}
.profile-shell.ex-profile-enter .cabinet-actions {
  animation: exFadeUp .52s var(--ex-ease) .14s both;
}
.profile-shell.ex-profile-enter .ex-profile-block:nth-child(5) {
  animation: exFadeUp .52s var(--ex-ease) .18s both;
}
.profile-shell.ex-profile-enter .ex-profile-block:nth-child(6) {
  animation: exFadeUp .52s var(--ex-ease) .22s both;
}
.profile-shell.ex-profile-enter .ex-profile-block:nth-child(7) {
  animation: exFadeUp .52s var(--ex-ease) .26s both;
}
.profile-shell.ex-profile-enter .cabinet-balance .cabinet-bal-value span {
  animation: exBalanceGlow 3.2s ease-in-out infinite;
}

.profile-recent-ops.ex-ops-enter .profile-op-row {
  animation: exFadeUp .42s var(--ex-ease) both;
}
.profile-recent-ops.ex-ops-enter .profile-op-row:nth-child(1) { animation-delay: .04s; }
.profile-recent-ops.ex-ops-enter .profile-op-row:nth-child(2) { animation-delay: .1s; }
.profile-recent-ops.ex-ops-enter .profile-op-row:nth-child(3) { animation-delay: .16s; }
.profile-recent-ops.ex-ops-enter .profile-op-row:nth-child(4) { animation-delay: .22s; }
.profile-recent-ops.ex-ops-enter .profile-op-row:nth-child(5) { animation-delay: .28s; }

@media (max-width: 360px) {
  .ex-wallet-balance-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ex-wallet-bal-pending {
    padding-left: 0;
    border-left: none;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.05);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .ex-wallet-bal-pending span,
  .ex-wallet-bal-pending b { display: inline; margin: 0; }
}

/* ── Payment history — muted professional palette ── */
:root[data-theme="ascendex"] .hist-item {
  background: rgba(16, 16, 24, 0.92) !important;
  border-color: rgba(255,255,255,.06) !important;
}
:root[data-theme="ascendex"] .hist-item.hist-dep {
  border-left-color: rgba(126, 184, 160, 0.32) !important;
  background: linear-gradient(90deg, rgba(126,184,160,.05), rgba(16,16,24,.92)) !important;
}
:root[data-theme="ascendex"] .hist-item.hist-wd {
  border-left-color: rgba(168, 159, 212, 0.28) !important;
  background: linear-gradient(90deg, rgba(168,159,212,.04), rgba(16,16,24,.92)) !important;
}
:root[data-theme="ascendex"] .hist-item.hist-wd.hist-rejected,
:root[data-theme="ascendex"] .hist-item.hist-dep.hist-rejected {
  border-left-color: rgba(184, 136, 146, 0.32) !important;
  background: linear-gradient(90deg, rgba(184,136,146,.05), rgba(16,16,24,.92)) !important;
}
:root[data-theme="ascendex"] .hist-icon {
  background: rgba(255,255,255,.04) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05) !important;
}
:root[data-theme="ascendex"] .hist-dep .hist-icon { background: rgba(126,184,160,.08) !important; }
:root[data-theme="ascendex"] .hist-wd .hist-icon { background: rgba(168,159,212,.07) !important; }
:root[data-theme="ascendex"] .hist-type { color: #e4e4e7 !important; }
:root[data-theme="ascendex"] .hist-amt.plus,
:root[data-theme="ascendex"] .hist-item.hist-dep .hist-amt.plus { color: #7eb8a0 !important; }
:root[data-theme="ascendex"] .hist-amt.minus { color: #a89fd4 !important; }
:root[data-theme="ascendex"] .hist-amt.minus-fail,
:root[data-theme="ascendex"] .hist-item.hist-wd.hist-rejected .hist-amt.minus-fail { color: #b88892 !important; }
:root[data-theme="ascendex"] .hist-badge.approved {
  background: rgba(126,184,160,.1) !important;
  color: #7eb8a0 !important;
}
:root[data-theme="ascendex"] .hist-badge.rejected {
  background: rgba(184,136,146,.1) !important;
  color: #b88892 !important;
}
:root[data-theme="ascendex"] .hist-badge.pending {
  background: rgba(124,109,240,.1) !important;
  color: #a89fd4 !important;
}
:root[data-theme="ascendex"] .hist-badge.expired {
  background: rgba(255,255,255,.04) !important;
  color: #8b8b98 !important;
}

:root[data-theme="ascendex"] .hist-sum-card {
  background: rgba(0,0,0,.18) !important;
  border: 1px solid rgba(255,255,255,.05);
}
:root[data-theme="ascendex"] .hist-sum-card.dep strong { color: #7eb8a0 !important; }
:root[data-theme="ascendex"] .hist-sum-card.wd strong { color: #a89fd4 !important; }
:root[data-theme="ascendex"] .hist-sum-card .hist-sum-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.2) !important;
  border: 1px solid rgba(255,255,255,.06);
  mask: none !important;
  -webkit-mask: none !important;
}
:root[data-theme="ascendex"] .hist-sum-card.dep .hist-sum-icon { color: #7eb8a0; }
:root[data-theme="ascendex"] .hist-sum-card.wd .hist-sum-icon { color: #a89fd4; }

:root[data-theme="ascendex"] .hist-item {
  grid-template-columns: 40px minmax(0, 1fr) auto !important;
  align-items: center !important;
}
:root[data-theme="ascendex"] .hist-main { min-width: 0; overflow: hidden; }
:root[data-theme="ascendex"] .hist-side {
  min-width: 86px;
  flex-shrink: 0;
  text-align: right;
}
:root[data-theme="ascendex"] .hist-amt {
  white-space: nowrap;
  font-size: 13px !important;
}
:root[data-theme="ascendex"] .hist-type {
  color: #e4e4e7 !important;
  font-size: 12px !important;
}
:root[data-theme="ascendex"] .hist-meta {
  font-size: 10px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root[data-theme="ascendex"] .hist-icon-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
:root[data-theme="ascendex"] .hist-icon-wrap svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}
:root[data-theme="ascendex"] .hist-icon-wrap.dep {
  background: rgba(126,184,160,.1) !important;
  color: #7eb8a0;
}
:root[data-theme="ascendex"] .hist-icon-wrap.wd {
  background: rgba(168,159,212,.1) !important;
  color: #a89fd4;
}
:root[data-theme="ascendex"] .hist-icon-wrap.pending {
  background: rgba(124,109,240,.1) !important;
  color: #a89fd4;
}
:root[data-theme="ascendex"] .hist-icon-wrap.rejected {
  background: rgba(184,136,146,.1) !important;
  color: #b88892;
}
:root[data-theme="ascendex"] .hist-icon-wrap .hist-icon-svg { display: none !important; }

:root[data-theme="ascendex"] .history-summary {
  margin: 0 0 12px !important;
}
:root[data-theme="ascendex"] .history-list {
  padding: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
}

:root[data-theme="ascendex"] .profile-op-row.dep .profile-op-amt { color: #7eb8a0 !important; }
:root[data-theme="ascendex"] .profile-op-row.wd .profile-op-amt { color: #a89fd4 !important; }

/* ── Pair switcher v2 ── */
:root[data-theme="ascendex"] .pair-switcher-menu {
  max-height: 220px !important;
  padding: 4px !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}
:root[data-theme="ascendex"] .pair-switcher-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  grid-template-columns: none !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  min-height: 0 !important;
}
:root[data-theme="ascendex"] .pair-switcher-item .coin-icon {
  width: 30px !important;
  height: 30px !important;
  flex-shrink: 0;
}
:root[data-theme="ascendex"] .pair-switcher-item .coin-icon img {
  width: 30px !important;
  height: 30px !important;
}
:root[data-theme="ascendex"] .psi-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
:root[data-theme="ascendex"] .psi-pair {
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:root[data-theme="ascendex"] .psi-meta {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #6b6b78 !important;
}
:root[data-theme="ascendex"] .psi-chg {
  font-style: normal;
  font-weight: 700;
}
:root[data-theme="ascendex"] .psi-chg.up { color: #7eb8a0 !important; }
:root[data-theme="ascendex"] .psi-chg.down { color: #c97a7a !important; }
:root[data-theme="ascendex"] .psi-check {
  font-size: 11px;
  font-weight: 800;
  color: #a78bfa;
  flex-shrink: 0;
}

/* ── Live trade screen ── */
:root[data-theme="ascendex"] .live-trade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 14px 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(16, 16, 24, 0.9);
}
:root[data-theme="ascendex"] .live-trade-meta { min-width: 0; flex: 1; }
:root[data-theme="ascendex"] .live-pair {
  font-size: 15px;
  font-weight: 800;
  color: #f4f4f5;
  margin-bottom: 4px;
}
:root[data-theme="ascendex"] .live-entry-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 10px;
  color: #6b6b78;
}
:root[data-theme="ascendex"] .live-entry-row b {
  font-size: 11px;
  font-weight: 800;
  color: #c4b5fd;
}
:root[data-theme="ascendex"] .live-now-price.up { color: #7eb8a0 !important; }
:root[data-theme="ascendex"] .live-now-price.down { color: #c97a7a !important; }
:root[data-theme="ascendex"] .live-price-sep { opacity: 0.4; }
:root[data-theme="ascendex"] .live-chart-wrap {
  margin-top: 8px;
}
:root[data-theme="ascendex"] .live-trade-stats {
  margin: 8px 14px 12px !important;
  background: rgba(16, 16, 24, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 14px !important;
}
:root[data-theme="ascendex"] #live-trade-chart .tv-chart-row-toolbar.hidden {
  display: none !important;
}
:root[data-theme="ascendex"] #live-trade-chart .tv-chart-ohlc.live-compact {
  padding: 6px 10px !important;
  min-height: 0 !important;
}

/* ── Result screen v3 (compact) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
:root[data-theme="ascendex"] #screen-result.active {
  padding: 20px 16px calc(88px + env(safe-area-inset-bottom)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 120px);
}
:root[data-theme="ascendex"] #screen-result.active {
  animation: none;
}
:root[data-theme="ascendex"] .result-wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
:root[data-theme="ascendex"] .result-card-v3 {
  width: 100%;
  padding: 24px 20px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 14, 20, 0.96);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  animation: axResultIn 0.35s cubic-bezier(0.25, 0.9, 0.35, 1) both;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}
@keyframes axResultIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
:root[data-theme="ascendex"] .result-card-v3.win {
  border-color: rgba(126, 184, 160, 0.22);
}
:root[data-theme="ascendex"] .result-card-v3.lose {
  border-color: rgba(201, 122, 122, 0.2);
}
:root[data-theme="ascendex"] .result-v3-badge {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 14px;
  margin: 0 auto 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}
:root[data-theme="ascendex"] .result-v3-icon {
  font-size: 10px;
  line-height: 1;
}
:root[data-theme="ascendex"] .result-v3-label {
  line-height: 1;
}
:root[data-theme="ascendex"] .result-v3-badge.win {
  color: #8fd4b8;
  border-color: rgba(126, 184, 160, 0.28);
  background: rgba(126, 184, 160, 0.08);
}
:root[data-theme="ascendex"] .result-v3-badge.lose {
  color: #d48f8f;
  border-color: rgba(201, 122, 122, 0.24);
  background: rgba(201, 122, 122, 0.08);
}
:root[data-theme="ascendex"] .result-card-v3 .result-amount {
  font-size: 34px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px !important;
  padding: 0 !important;
  text-shadow: none !important;
  animation: none !important;
}
:root[data-theme="ascendex"] .result-card-v3 .result-amount.win { color: #8fd4b8 !important; }
:root[data-theme="ascendex"] .result-card-v3 .result-amount.lose { color: #d48f8f !important; }
:root[data-theme="ascendex"] .result-card-v3 .result-balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin: 0 0 16px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}
:root[data-theme="ascendex"] .result-card-v3 .result-balance-line b {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
:root[data-theme="ascendex"] .result-card-v3 .result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}
:root[data-theme="ascendex"] .result-card-v3 .result-actions .btn-main,
:root[data-theme="ascendex"] .result-card-v3 .result-actions .btn-ghost {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
