:root {
  --upa-primary: #000000;
  --upa-accent: #F5C518;
  --upa-accent-2: #F5C518;
  --upa-input: #2c2c2e;
  --upa-green: #2ebd85;
  --upa-on-accent: #111111;
  --upa-red: #ef454a;
  --upa-muted: #8e8e93;
  --mc-bg: #1c1c1e;
  --mc-surface: #2c2c2e;
  --mc-surface-2: #3a3a3c;
  --mc-border: #48484a;
  --mc-text: #ffffff;
  --mc-text-muted: #a0a0a0;
  --mc-page-frame: #e8e8e8;
  --max-mobile: 430px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--mc-page-frame);
  color: #111;
  font-family: font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--upa-accent); text-decoration: none; }

.mobile-shell {
  max-width: var(--max-mobile);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--mc-bg);
  color: var(--mc-text);
  position: relative;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.18);
}

/* Light mode (optional toggle) — dark + yellow remains the default */
html:not([data-theme="dark"]) {
  color-scheme: light;
}

html:not([data-theme="dark"]) body {
  background: #f0f0f0;
  color: #111;
}

html:not([data-theme="dark"]) .mobile-shell {
  background: #fff;
  color: #111;
  box-shadow: 0 0 24px rgba(0, 0, 0, .08);
}

html:not([data-theme="dark"]) a {
  color: var(--upa-accent);
}

/* Accent filled controls need dark ink — link color must not override */
html:not([data-theme="dark"]) a.upa-btn,
html:not([data-theme="dark"]) a.fund-submit,
html:not([data-theme="dark"]) a.fund-support-btn,
html:not([data-theme="dark"]) a.home-assets__deposit,
html:not([data-theme="dark"]) a.assets-actions__btn--primary,
a.upa-btn,
a.fund-submit,
a.home-assets__deposit,
a.assets-actions__btn--primary {
  color: var(--upa-on-accent) !important;
}

.mobile-shell.has-tabbar { padding-bottom: 56px; }

.page-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  padding: 0 16px;
}

.page-header h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.page-header--logo {
  background: var(--upa-primary);
  border-bottom-color: var(--upa-primary);
}

.page-header--logo img {
  height: 28px;
  width: auto;
  display: block;
}

.page-header--logo .header-right a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-header--logo .header-right img {
  width: 22px;
  height: 22px;
}

.page-header .header-right {
  position: absolute;
  right: 16px;
}

.page-header .header-back {
  position: absolute;
  left: 12px;
  font-size: 22px;
  color: #333;
}

.page-body {
  padding: 0 0 16px;
  overflow-y: auto;
}

.upa-input-wrap {
  display: flex;
  align-items: center;
  background: var(--upa-input);
  border-radius: 8px;
  height: 46px;
  padding: 0 32px;
  position: relative;
  margin-bottom: 12px;
}

.upa-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  color: #333;
  font-size: 14px;
  outline: none;
}

.upa-input-wrap input::placeholder { color: #aaa; }

.upa-input-wrap .icon-left {
  position: absolute;
  left: 12px;
  color: #fff;
  opacity: .9;
}

.upa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.upa-btn:disabled { opacity: .6; cursor: not-allowed; }

.upa-btn-outline {
  background: transparent;
  border: 1px solid var(--upa-accent);
  color: var(--upa-accent);
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-mobile);
  height: 56px;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #9a9a9a;
  gap: 3px;
  text-decoration: none;
}

.tabbar a.active {
  color: var(--upa-accent);
  font-weight: 600;
}

.tabbar-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #9a9a9a;
}

.tabbar a.active .tabbar-icon-wrap {
  color: var(--upa-accent);
}

.tabbar-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.tabbar img { width: 24px; height: 24px; }

.exchange-page { padding: 16px; }

.exchange-pair-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 24px;
}

.exchange-currency-col { flex: 1; min-width: 0; }
.exchange-currency-col-right { text-align: right; }

.exchange-currency-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
}

.exchange-chevron { font-size: 12px; color: #999; }

.exchange-balance-label {
  font-size: 12px;
  color: var(--upa-muted);
  margin-top: 8px;
}

.exchange-balance-val {
  font-size: 14px;
  color: #333;
  margin-top: 2px;
}

.exchange-swap-btn {
  flex-shrink: 0;
  margin-top: 4px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--upa-primary);
  cursor: pointer;
}

.exchange-amount-wrap {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.exchange-amount-input {
  flex: 1;
  border: none;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.exchange-amount-input::placeholder { color: #ccc; }

.exchange-all-btn {
  border: none;
  background: none;
  color: var(--upa-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0 4px 12px;
}

.exchange-meta { margin-bottom: 24px; }

.exchange-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  padding: 6px 0;
}

.exchange-estimate-row { color: #333; font-weight: 500; }

.exchange-submit { margin-top: 8px; }

.exchange-picker { position: fixed; inset: 0; z-index: 100; }
.exchange-picker[hidden] { display: none; }

.exchange-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
}

.exchange-picker-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--max-mobile);
  margin: 0 auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.exchange-picker-title {
  margin: 0 0 12px;
  font-weight: 600;
  text-align: center;
}

.exchange-picker-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  cursor: pointer;
}

.deposit-page { padding: 0 0 24px; }

.deposit-page--categories .deposit-method-list {
  border-top: 1px solid #f0f0f0;
}

.deposit-category-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deposit-category-icon--bank {
  background: var(--upa-accent);
  border-radius: 8px;
}

.deposit-category-icon--crypto {
  background: var(--upa-accent);
  border-radius: 50%;
}

.deposit-page--categories .deposit-method-item {
  padding: 18px 16px;
}

.deposit-page--categories .deposit-method-label {
  font-weight: 400;
}

.deposit-bank-details {
  margin-bottom: 8px;
}

.deposit-notice {
  margin: 12px 16px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 13px;
  color: #666;
  text-align: center;
}

.deposit-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 16px 8px;
}

.deposit-method-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deposit-method-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.deposit-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.deposit-method-icon-lg { width: 32px; height: 32px; }

.deposit-method-label { flex: 1; font-size: 15px; font-weight: 500; }

.deposit-method-arrow { color: #ccc; font-size: 20px; }

.deposit-empty { text-align: center; color: #999; padding: 32px 16px; }

.deposit-detail { padding: 16px; }

.deposit-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.deposit-detail-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.deposit-qr-wrap { text-align: center; margin: 8px 0 24px; }

.deposit-qr { border-radius: 8px; }

.deposit-field { margin-bottom: 20px; }

.deposit-field-label {
  font-size: 13px;
  color: var(--upa-muted);
  margin-bottom: 8px;
}

.deposit-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.deposit-address {
  flex: 1;
  font-size: 14px;
  word-break: break-all;
  background: none;
  padding: 0;
}

.deposit-copy-btn {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.deposit-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  padding: 8px 0;
  font-size: 15px;
  outline: none;
}

.deposit-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border: 2px dashed #bebdfd;
  border-radius: 8px;
  background: #f9f9ff;
  cursor: pointer;
}

.deposit-upload-icon { font-size: 32px; }

.deposit-form .upa-btn { margin-top: 8px; }

/* ── Fund pages (deposit / withdraw) ── */
.fund-page {
  background: #f5f5f5;
  min-height: calc(100dvh - 44px);
  padding: 12px 16px 28px;
}
.fund-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.fund-card--tips { padding: 14px 16px; }
.fund-card--amount { padding: 0 16px 16px; overflow: hidden; }
.fund-card--select { padding: 0; }
.fund-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}
.fund-card__accent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
}
.fund-card__accent-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--upa-accent);
}
.fund-card__banner {
  margin: 0 -16px 14px;
  padding: 10px 16px;
  min-height: 36px;
  background: rgba(245, 197, 24, 0.12);
  font-size: 13px;
  font-weight: 600;
  color: #333;
  box-sizing: border-box;
}
.fund-card__banner:empty {
  padding: 0;
  min-height: 12px;
}
.fund-card__head-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.fund-tips {
  margin: 0;
  padding-left: 18px;
  color: #777;
  font-size: 13px;
  line-height: 1.55;
}
.fund-tips li + li { margin-top: 8px; }
.fund-currency-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fund-currency-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}
.fund-currency-list li:last-child .fund-currency-item { border-bottom: none; }
.fund-crypto-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f7f7f7;
}
.fund-currency-item__label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #111;
}
.fund-currency-item__chevron {
  color: #c8c8c8;
  font-size: 20px;
  line-height: 1;
}
.fund-network-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #fff3bf;
  color: #333;
  font-size: 11px;
  font-weight: 600;
}
.fund-network-pill {
  display: inline-flex;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fff3bf;
  font-size: 11px;
  font-weight: 600;
}
.fund-copy-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f3f3;
}
.fund-copy-row:last-child { border-bottom: none; }
.fund-copy-row__meta { flex: 1; min-width: 0; }
.fund-copy-row__label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}
.fund-copy-row__value {
  font-size: 15px;
  color: #111;
  font-weight: 500;
  word-break: break-all;
}
.fund-copy-row__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}
.fund-copy-btn {
  flex-shrink: 0;
  border: 1px solid #e8e8e8;
  background: #fff;
  color: #333;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fund-copy-btn.is-copied {
  border-color: var(--upa-accent);
  background: #fff8dd;
}
.fund-field-label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}
.fund-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #e6e6e6;
  padding: 10px 0;
  font-size: 16px;
  outline: none;
  background: transparent;
}
.fund-input--amount {
  border: none;
  font-size: 18px;
  font-weight: 600;
  padding: 8px 0;
}
.fund-amount-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.fund-amount-min {
  font-size: 12px;
  color: #999;
}
.fund-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e6e6e6;
}
.fund-amount-prefix {
  font-size: 20px;
  font-weight: 700;
  color: #111;
}
.fund-all-btn {
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fund-qr-wrap { text-align: center; margin: 8px 0 16px; }
.fund-qr { border-radius: 10px; background: #fff; }
.fund-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border: 2px dashed #c5c4f5;
  border-radius: 12px;
  background: #f8f7ff;
  cursor: pointer;
}
.fund-upload__icon { font-size: 30px; }
.fund-upload__icon.has-file { color: var(--upa-green); font-size: 22px; font-weight: 700; }
.fund-hint {
  margin: 8px 4px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #888;
  text-align: center;
}
.fund-support-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 16px;
  font-size: 13px;
  color: #555;
}
.fund-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.fund-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.fund-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fund-empty {
  text-align: center;
  color: #999;
  padding: 24px 8px;
  margin: 0;
}
.fund-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
}
.fund-select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #111;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.fund-select-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  color: #999;
  text-decoration: none;
  font-size: 14px;
}
.fund-warn-link {
  margin: 0 4px 12px;
  font-size: 13px;
}
.fund-warn-link a { color: var(--upa-accent); font-weight: 600; }
.withdraw-add-wallet {
  margin: 2px 4px 14px;
  font-size: 13px;
}
.withdraw-add-wallet a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--upa-accent);
  font-weight: 700;
  text-decoration: none;
}
.withdraw-add-wallet__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--upa-accent);
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.withdraw-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
}

.withdraw-wallet-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #2c2c2e;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.withdraw-wallet-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.withdraw-wallet-option__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #555;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  box-sizing: border-box;
}

.withdraw-wallet-option.is-selected {
  border-color: var(--upa-accent);
  background: rgba(245, 197, 24, 0.08);
}

.withdraw-wallet-option.is-selected .withdraw-wallet-option__check {
  border-color: var(--upa-accent);
  background: var(--upa-accent);
}

.withdraw-wallet-option.is-selected .withdraw-wallet-option__check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.withdraw-wallet-option__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.withdraw-wallet-option__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.withdraw-wallet-option__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 197, 24, 0.18);
  color: var(--upa-accent);
}

.withdraw-wallet-option__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #9a9aa3;
}

.withdraw-wallet-option__addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  color: #c8c8d0;
}

.fund-card--warn {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

html:not([data-theme="dark"]) .withdraw-wallet-option {
  background: #fff;
  border-color: #e8e8e8;
  color: #111;
}

html:not([data-theme="dark"]) .withdraw-wallet-option__title {
  color: #111;
}

html:not([data-theme="dark"]) .withdraw-wallet-option__addr {
  color: #555;
}

html:not([data-theme="dark"]) .withdraw-wallet-option.is-selected {
  background: rgba(245, 197, 24, 0.06);
}
.fund-fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #333;
}
.fund-fee-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #999;
}

.position-page { padding-bottom: 24px; }

.position-asset-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  border-bottom: 1px solid #f0f0f0;
}

.position-asset-tabs a {
  padding: 12px 8px;
  font-size: 15px;
  color: #666;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.position-asset-tabs a.active {
  color: var(--upa-primary);
  font-weight: 600;
  border-bottom-color: var(--upa-primary);
}

.position-segment {
  display: flex;
  margin: 16px;
  border: 1px solid var(--upa-primary);
  border-radius: 999px;
  overflow: hidden;
}

.position-segment a {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  text-decoration: none;
  color: var(--upa-primary);
  background: #fff;
}

.position-segment a.active {
  background: var(--upa-primary);
  color: #fff;
}

.position-list { padding: 0 16px; }

.position-card {
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 0;
}

.position-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.position-pair { font-size: 16px; font-weight: 700; color: #111; }

.position-code { font-size: 12px; color: #999; margin-top: 2px; }

.position-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 500;
}

.position-badge-long { background: #e8f8f0; color: var(--upa-green); }

.position-badge-short { background: #fde8eb; color: var(--upa-red); }

.position-prices {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.position-price-col { display: flex; flex-direction: column; gap: 4px; }

.position-price-col-right { text-align: right; align-items: flex-end; }

.position-label { font-size: 12px; color: var(--upa-muted); }

.position-value { font-size: 14px; color: #333; }

.position-duration { font-size: 12px; color: #666; margin-top: 2px; }

.position-amounts {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.position-amounts-right { text-align: right; }

.position-amount { font-size: 14px; color: #999; display: block; margin-top: 4px; }

.position-revenue { font-size: 14px; font-weight: 600; display: block; margin-top: 4px; }

.position-revenue-pending { color: #ccc; font-weight: 400; }

.position-time { font-size: 11px; color: #999; }

.position-empty { text-align: center; color: #999; padding: 32px 16px; }

.position-loaded { text-align: center; color: #ccc; font-size: 13px; padding: 24px 0; }

.notify-page { padding: 0 0 24px; min-height: 200px; }

.notify-list { list-style: none; margin: 0; padding: 0; }

.notify-item {
  display: block;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.notify-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.notify-item-title { font-size: 15px; font-weight: 600; flex: 1; }

.notify-time { font-size: 11px; color: var(--upa-muted); white-space: nowrap; }

.notify-item-preview {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.notify-empty { text-align: center; padding: 48px 24px; color: #999; }

.notify-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }

.notify-loaded { text-align: center; color: #ccc; font-size: 13px; padding: 24px; }

.notify-detail { padding: 16px; }

.notify-detail-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }

.notify-detail-body { font-size: 14px; line-height: 1.6; color: #333; margin-top: 16px; }

.notify-back-link {
  display: block;
  text-align: center;
  padding: 16px;
  font-size: 14px;
}

.static-page { padding: 16px 16px 32px; }

.static-body { font-size: 14px; line-height: 1.65; color: #333; }

.static-body h3 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: #111; }

.static-body p { margin: 0 0 12px; }

.static-body ul, .static-body ol { margin: 0 0 12px; padding-left: 20px; }

.static-body li { margin-bottom: 6px; }

.static-body a { color: var(--upa-primary); }

.static-muted { font-size: 12px; color: var(--upa-muted); }

.service-card {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.service-card h3 { margin: 0 0 8px; font-size: 15px; }

/* ── Support Center ── */
.support-page {
  min-height: 100dvh;
  margin: -0px;
  background: var(--mc-bg);
  padding-bottom: 40px;
}
.mobile-shell:has(.support-page),
.mobile-shell:has(.support-page) .page-body {
  background: var(--mc-bg);
}
.mobile-shell:has(.support-page) .page-body {
  padding: 0;
}
.support-page__top {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  padding: 0 8px;
  border-bottom: 1px solid var(--mc-border);
}
.support-page__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}
.support-page__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.support-page__card {
  margin: 18px 16px 0;
  background: var(--mc-surface-2);
  border: 1px solid var(--mc-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
}
.support-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid var(--mc-border);
}
.support-row:last-child { border-bottom: none; }
.support-row:active { background: rgba(255, 255, 255, 0.04); }
.support-row__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--upa-accent);
}
.support-row__icon svg { display: block; }
.support-row__label {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
}
.support-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.support-row__handle {
  font-size: 13px;
  font-weight: 500;
  color: var(--upa-accent);
}
.support-row__chevron {
  color: #666;
  font-size: 22px;
  line-height: 1;
}


.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-answer {
  padding: 0 16px 14px;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.banner-slide img {
  width: 100%;
  height: auto;
  min-height: 140px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.announce-bar {
  margin: 12px 16px;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
  display: flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
}

.announce-bar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.announce-bar-chevron { color: #ccc; font-size: 14px; }

.announce-bar-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}

.announce-bar-marquee {
  display: inline-flex;
  width: max-content;
  white-space: nowrap;
  animation: announce-marquee 18s linear infinite;
}

.announce-bar-marquee.is-static {
  animation: none;
  width: 100%;
}

.announce-bar-marquee.is-static .announce-bar-text:last-child {
  display: none;
}

.announce-bar-text {
  padding-right: 48px;
}

@keyframes announce-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .announce-bar-marquee { animation: none; }
}

.hot-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 0 16px 8px;
}

.hot-card {
  min-width: 130px;
  padding: 10px;
  border-radius: 10px;
  background: #f8f9fb;
  border: 1px solid #eef0f4;
}

.hot-card .sym { font-weight: 700; font-size: 14px; }
.hot-card .price { font-size: 16px; font-weight: 700; }
.hot-card .chg { font-size: 12px; }

.price-up { color: var(--upa-green); }
.price-down { color: var(--upa-red); }

.market-table .row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  align-items: center;
  font-size: 13px;
}

.market-table .head {
  color: #999;
  font-size: 11px;
}

.market-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--icon-size, 28px);
  height: var(--icon-size, 28px);
  border-radius: 50%;
  overflow: hidden;
  background: #f3f4f6;
}

.market-icon {
  display: block;
  object-fit: contain;
}

.market-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.market-name-text {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.admin-stat-card .val {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-stat-card .lbl {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.admin-stat-card .val.is-up { color: #059669; }
.admin-stat-card .val.is-down { color: #dc2626; }

.admin-stat-grid--trades {
  margin-bottom: 8px;
}

.admin-trades-stats__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.admin-trades-stats__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.admin-trades-stats__range {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.admin-trades-stats__hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #666;
}

.admin-trades-stats__subtitle {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.admin-trades-stats__empty {
  margin: 0;
  font-size: 13px;
  color: #888;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table--compact th,
.admin-table--compact td {
  padding: 8px 10px;
  font-size: 13px;
}

.admin-stat-card a {
  font-size: 11px;
  color: var(--upa-primary, #2563eb);
  text-decoration: none;
}

.admin-dash-section {
  margin-top: 24px;
}

.admin-dash-section h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.badge-up, .badge-down {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
}
.badge-up { background: var(--upa-green); }
.badge-down { background: var(--upa-red); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px;
  text-align: center;
  font-size: 11px;
}

.quick-grid .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 197, 24, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}

.quick-grid .icon img {
  width: 22px;
  height: 22px;
  display: block;
}

.assets-card {
  margin: 0 16px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%);
  color: #fff;
  border: 1px solid rgba(245, 197, 24, 0.2);
}

.assets-card .balance { font-size: 28px; font-weight: 700; margin: 8px 0; }

.list-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #111;
  font-size: 14px;
}

.list-cell:last-child { border-bottom: none; }

.card-block {
  margin: 12px 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
}

.wallet-bind-form {
  padding: 16px;
}

.wallet-bind-default {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.wallet-page {
  padding: 8px 0 24px;
  background: #fff;
  min-height: calc(100dvh - 44px);
}

.wallet-page__banner {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8d9;
  border: 1px solid #f5e6a3;
  color: #6b5a12;
  font-size: 13px;
  line-height: 1.4;
}

.wallet-bind-form {
  padding-bottom: 24px;
}

.wallet-bind-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px 18px;
  padding: 14px;
  border-radius: 12px;
  background: #f7f7f7;
}

.wallet-bind-hero__title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.wallet-bind-hero__hint {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

.wallet-bind-default {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: #333;
}

.wallet-bind-default input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.wallet-section {
  margin: 0 0 8px;
}

.wallet-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 4px;
  font-size: 13px;
  color: #888;
}

.wallet-section__head strong {
  color: #111;
  font-size: 14px;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: inherit;
  text-decoration: none;
  background: #fff;
  position: relative;
}

.wallet-row__select {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.wallet-row__delete {
  flex-shrink: 0;
  margin: 0;
}

.wallet-row__delete button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f3f3f3;
  color: #666;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wallet-row__delete button:hover {
  background: #ffe8e8;
  color: #c0392b;
}

.wallet-row--add:active {
  background: #fafafa;
}

.wallet-row__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  line-height: 1.05;
}

.wallet-row__glyph {
  font-size: 15px;
  font-weight: 700;
}

.wallet-row__net {
  font-size: 8px;
  font-weight: 600;
  opacity: .92;
  letter-spacing: .02em;
}

.wallet-row__icon--usdt { background: #26a17b; }
.wallet-row__icon--usdc { background: #2775ca; }
.wallet-row__icon--btc { background: #f7931a; }
.wallet-row__icon--eth { background: #627eea; }

.wallet-row__main {
  flex: 1;
  min-width: 0;
}

.wallet-row__title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-row__badge {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fff7ed;
  border-radius: 999px;
  padding: 2px 8px;
}

.wallet-row__address {
  margin-top: 4px;
  font-size: 12px;
  color: #666;
  word-break: break-all;
}

.wallet-row__label {
  margin-top: 2px;
  font-size: 12px;
  color: #999;
}

.wallet-row__plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--upa-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: var(--upa-accent);
  flex-shrink: 0;
}

.wallet-row--selectable {
  text-decoration: none;
  color: inherit;
}

.wallet-row__use {
  color: #888;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  padding-left: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme="dark"] .wallet-row {
  background: #1c1c1e;
  border-bottom-color: #222222;
}

html[data-theme="dark"] .wallet-row__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .wallet-row__plus {
  border-color: #2a2a2a;
  color: #f2f2f2;
}

.user-banner {
  margin: 12px 16px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #434459, #2d2e3d);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  color: #fff;
  font-size: 11px;
  border: 1px solid rgba(245, 197, 24, 0.2);
}

/* ── Personal Center ── */
.pc-page {
  background: #fff;
  min-height: calc(100dvh - 56px);
  padding-bottom: 24px;
}
.pc-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 48px;
  padding: 0 8px;
}
.pc-top__back,
.pc-top__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #222;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
}
.pc-top__title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #111;
}
.pc-profile {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 20px 22px;
  text-decoration: none;
  color: inherit;
}
.pc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
}
.pc-avatar__svg { width: 56px; height: 56px; display: block; }
.pc-avatar-upload.app-avatar-btn {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.pc-profile__avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pc-profile__avatar-hint {
  font-size: 10px;
  color: #999;
  text-align: center;
  max-width: 64px;
  line-height: 1.2;
}
html[data-theme="dark"] .pc-profile__avatar-hint {
  color: #8e8e93;
}
.pc-avatar-upload .app-avatar-btn__img,
.pc-avatar-upload .app-avatar-btn__placeholder {
  width: 56px;
  height: 56px;
}
.pc-avatar-upload .app-avatar-btn__placeholder svg {
  width: 32px;
  height: 32px;
}
.pc-avatar-upload .app-avatar-btn__camera {
  width: 18px;
  height: 18px;
  right: 0;
  bottom: 0;
}
.pc-avatar-upload .app-avatar-btn__camera svg {
  width: 10px;
  height: 10px;
}
.pc-profile__name {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  word-break: break-all;
}
.pc-profile__uid {
  margin-top: 4px;
  font-size: 12px;
  color: #9a9a9a;
}
.pc-credit {
  text-align: right;
  min-width: 72px;
}
.pc-credit__label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  color: #9a9a9a;
}
.pc-credit__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}
.pc-credit__icon svg { width: 14px; height: 14px; }
.pc-credit__value {
  margin-top: 2px;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pc-group {
  padding: 0 8px;
}
.pc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 12px;
  border: none;
  background: transparent;
  text-decoration: none;
  color: #111;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pc-row:active { background: #fafafa; }
.pc-row__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pc-row__icon svg { width: 36px; height: 36px; display: block; }
.pc-row__label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}
.pc-row__chevron {
  color: #c8c8c8;
  font-size: 20px;
  line-height: 1;
  padding-left: 4px;
}
.pc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f8ef;
  color: #1f9d57;
  font-size: 11px;
  font-weight: 600;
}
.pc-divider {
  height: 1px;
  margin: 8px 20px;
  background: #efefef;
}
.pc-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 28px 20px 8px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #ececec;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.pc-logout:active { background: #fafafa; }

.flash {
  margin: 8px 16px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}
.flash.error { background: #fee; color: #c00; }
.flash.success { background: #efe; color: #060; }

.form-group { margin-bottom: 14px; padding: 0 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  height: 44px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
}
.kyc-page { padding: 8px 0 24px; }
.kyc-page__status { font-size: 13px; margin: 0 16px 12px; color: #666; }
.kyc-page__hint { font-size: 13px; color: #888; margin: 12px 16px; }
.kyc-page .form-group { padding: 0 16px; }
.file-field__label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}
.file-field__control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.file-field__input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 0 !important;
}
.file-field__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.file-field__name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-field__name.is-selected {
  color: #111;
  font-weight: 600;
}

.sub-tabs {
  display: flex;
  gap: 20px;
  padding: 12px 20px;
  background: #f5f5f5;
}
.sub-tabs a, .sub-tabs button {
  border: none;
  background: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  padding: 0;
}
.sub-tabs .active { color: #000; font-weight: 700; }

.trade-modes {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
  align-items: center;
}
.trade-modes .mode {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  background: #f0f0f0;
  color: #666;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.trade-modes .mode.active { background: var(--upa-accent); color: var(--upa-on-accent); font-weight: 600; }
.trade-orders-icon {
  margin-left: auto;
  font-size: 18px;
  text-decoration: none;
  padding: 4px 8px;
}

.chart-box {
  margin: 8px 16px;
  height: 180px;
  background: linear-gradient(180deg, #fff8ee, #fff);
  border-radius: 8px;
  overflow: hidden;
}

.login-page { padding: 60px 40px 40px; background: linear-gradient(180deg, #434459 0%, #2d2e3d 45%, #fff 45%); min-height: 100dvh; }
.login-page .logo { display: block; margin: 0 auto 40px; width: 120px; border-radius: 24px; }
.login-page a { color: var(--upa-accent); }
.login-page label { color: #ccc !important; }

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: #1e293b;
  color: #fff;
  padding: 20px 0;
}
.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  color: #cbd5e1;
  font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: #334155; color: #fff; }
.admin-main { padding: 24px; background: #f8fafc; }
.admin-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.status-pending { color: #d97706; }
.status-approved, .status-won { color: #059669; }
.status-rejected, .status-lost { color: #dc2626; }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .admin-sidebar a { padding: 8px 12px; border-radius: 6px; }
}

.panel-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-filters input,
.panel-filters select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.panel-filters button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--upa-primary);
  color: #fff;
  cursor: pointer;
}

.agent-sidebar { background: #0f3d6e; }
.agent-sidebar .panel-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 6px;
}

.app-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.app-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.app-menu-btn .ui-icon--menu-bars {
  display: block;
}

.app-avatar-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-avatar-btn__img,
.app-avatar-btn__placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: #4A4A4A;
  color: #fff;
}
.app-avatar-btn__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-avatar-btn__placeholder svg {
  width: 22px;
  height: 22px;
}
.app-avatar-btn__camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  pointer-events: none;
}
.app-avatar-btn__camera svg {
  width: 8px;
  height: 8px;
  display: block;
}
.app-avatar-btn input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
html[data-theme="dark"] .app-avatar-btn__camera {
  border-color: #000;
}
html[data-theme="dark"] .app-avatar-btn__placeholder {
  background: #3a3a3a;
}

.app-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f3f3;
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  min-width: 0;
}

.app-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.app-search-icon {
  color: #999;
  font-size: 16px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.app-search-icon:focus-visible {
  outline: 2px solid var(--upa-accent, var(--upa-accent));
  outline-offset: 2px;
  border-radius: 4px;
}

.app-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.app-top-actions a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
}

.market-category-tabs {
  display: flex;
  gap: 16px;
  padding: 12px 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.market-category-tabs::-webkit-scrollbar { display: none; }

.market-category-tabs a,
.market-category-tabs span {
  flex-shrink: 0;
  font-size: 14px;
  color: #999;
  text-decoration: none;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}

.market-category-tabs .active {
  color: #111;
  font-weight: 700;
  border-bottom-color: var(--upa-accent);
}

.sub-tabs--pills {
  background: transparent;
  gap: 10px;
  padding: 12px 16px;
}

.sub-tabs--pills a {
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  color: #666;
}

.sub-tabs--pills .active {
  background: var(--upa-accent);
  border-color: var(--upa-accent);
  color: var(--upa-on-accent);
  font-weight: 600;
}

.sub-tabs .active {
  color: #111;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--upa-accent);
}

.tabbar a.active { color: var(--upa-accent); font-weight: 600; }
.tabbar a.active .tabbar-icon-wrap { color: var(--upa-accent); }

/* ── Reference UI (user frontend) ── */

.mobile-shell.has-tabbar { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
.mobile-shell.has-trade-actions { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.mobile-shell.has-tabbar.has-trade-actions {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.mobile-shell.has-tabbar.has-trade-actions .page-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}
.mobile-shell.has-tabbar.has-trade-actions .trade-top-bar,
.mobile-shell.has-tabbar.has-trade-actions .trade-summary,
.mobile-shell.has-tabbar.has-trade-actions .trade-timeframes,
.mobile-shell.has-tabbar.has-trade-actions .trade-ma-legend,
.mobile-shell.has-tabbar.has-trade-actions .trade-inline-countdown {
  flex-shrink: 0;
}
.mobile-shell.has-tabbar.has-trade-actions .chart-box--candles {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
}
.mobile-shell.has-tabbar.has-trade-actions .trade-market-panels {
  flex: 0 1 42%;
  min-height: 160px;
  max-height: 46%;
}

.market-table .row {
  grid-template-columns: 1.4fr 1fr 0.9fr;
}
.market-table .row > span:nth-child(2) { text-align: center; font-weight: 600; }
.market-table .row > span:nth-child(3) { text-align: right; }
.market-table .row.head > span:nth-child(2) { text-align: center; }
.market-table .row.head > span:nth-child(3) { text-align: right; }

.home-assets { padding: 12px 16px 0; }
.home-assets__label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; }
.home-assets__funds-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.home-assets__funds-btn:active {
  background: #ebebeb;
}
.home-assets__funds-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--upa-accent);
  color: var(--upa-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.home-assets__funds-icon .ui-icon--menu-bars {
  display: block;
}
.home-assets__funds-label {
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-assets__caret { font-size: 10px; color: #999; }
.home-assets__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.home-assets__balance { font-size: 28px; font-weight: 700; color: #111; }
.home-assets__deposit {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--upa-accent);
  color: var(--upa-on-accent) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
html:not([data-theme="dark"]) a.home-assets__deposit,
html[data-theme="dark"] a.home-assets__deposit {
  color: var(--upa-on-accent) !important;
}
.home-quick-grid {
  gap: 20px 8px;
  padding: 20px 16px 12px;
}

.home-quick-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #111;
  transition: transform 0.15s ease;
}

.home-quick-grid__item:active {
  transform: scale(0.96);
}

.home-quick-grid .icon {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent !important;
  margin: 0;
  color: #4A4A4A;
}

.home-quick-grid .home-quick-icon {
  width: 48px;
  height: 48px;
  display: block;
  color: #4A4A4A;
  --home-quick-icon: #4A4A4A;
}

.home-quick-grid__item span {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: #111;
  max-width: 72px;
}

.home-promo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 16px 16px;
  padding: 12px 14px;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-promo-card:hover {
  border-color: #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.home-promo-card__art {
  flex-shrink: 0;
  width: 72px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-promo-card__svg {
  width: 72px;
  height: 58px;
  display: block;
}

.home-promo-card__copy {
  flex: 1;
  min-width: 0;
}

.home-promo-card__copy strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
  line-height: 1.2;
}

.home-promo-card__copy span {
  display: block;
  font-size: 12px;
  color: #888;
  line-height: 1.35;
}

.home-promo-card__arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-promo-card__arrow svg {
  width: 16px;
  height: 16px;
}
.home-carousel { padding: 0 16px 8px; }
.home-carousel__viewport { overflow: hidden; width: 100%; }
.home-carousel__track {
  display: flex;
  width: 100%;
  transition: transform 0.4s ease;
  will-change: transform;
  touch-action: pan-y;
}
.home-carousel__slide {
  flex: 0 0 100%;
  display: flex;
  gap: 10px;
  min-width: 0;
  box-sizing: border-box;
}
.home-carousel__card {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 12px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.home-carousel__sym { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #666; margin-bottom: 6px; gap: 6px; }
.home-carousel__sym span:last-child { font-weight: 600; font-size: 11px; }
.home-carousel__price { font-size: 17px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.home-carousel__chart { height: 52px; margin: 0 -2px; }
.home-carousel__dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.home-carousel__dot {
  appearance: none; border: none; padding: 0; cursor: pointer;
  width: 18px; height: 4px; border-radius: 999px; background: #ddd;
}
.home-carousel__dot.is-active { background: #111; width: 22px; }
.sparkline { width: 100%; height: 100%; display: block; }
.home-banner { padding: 8px 16px 0; }
.home-banner__viewport {
  overflow: hidden;
  border-radius: 12px;
  height: 160px;
  background: #111;
}
.home-banner__track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}
.home-banner__slide {
  flex: 0 0 100%;
  height: 100%;
}
.home-banner__slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.home-banner__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.home-banner__dots button {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #ddd;
  border: none;
  padding: 0;
  cursor: pointer;
}
.home-banner__dots .is-active {
  background: #111;
  width: 22px;
}
.home-banner-fallback {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 16px 0;
  padding: 22px 20px;
  min-height: 148px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 90% at 85% 50%, rgba(45, 212, 191, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 80% at 95% 80%, rgba(236, 72, 153, 0.2), transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #111827 45%, #0b1220 100%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.28);
}
.home-banner-fallback__copy {
  position: relative;
  z-index: 1;
  max-width: 62%;
}
.home-banner-fallback__brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.home-banner-fallback__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.home-banner-fallback__brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.home-banner-fallback__slogan {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}
.home-banner-fallback__mark {
  position: absolute;
  right: -8px;
  bottom: -18px;
  width: 132px;
  height: 132px;
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}
.home-market-table { margin-top: 8px; padding-bottom: 8px; }
.home-market-table .row {
  padding-top: 11px;
  padding-bottom: 11px;
}
.market-empty { padding: 24px; text-align: center; color: #999; }

.trade-top-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; background: #fff;
}
.trade-top-bar__back, .trade-top-bar__menu, .trade-top-bar__star {
  border: none; background: none; font-size: 22px; color: #999; text-decoration: none; padding: 0; line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trade-top-bar__back, .trade-top-bar__menu { color: #333; }
.trade-top-bar__star {
  width: 32px;
  height: 32px;
  color: #b0b0b0;
  transition: color 0.15s ease, transform 0.15s ease;
}
.trade-top-bar__star .ui-icon { display: block; }
.trade-top-bar__star.is-active {
  color: var(--upa-accent);
  transform: scale(1.06);
}
.trade-top-bar__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.trade-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: var(--max-mobile);
  transform: translateX(-50%);
  z-index: 220;
  pointer-events: none;
}
.trade-drawer.is-open {
  pointer-events: auto;
}
.trade-drawer__scrim {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.28s ease;
  cursor: pointer;
}
.trade-drawer.is-open .trade-drawer__scrim {
  opacity: 1;
}
.trade-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(78%, 320px);
  max-width: 320px;
  background: #fff;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.trade-drawer.is-open .trade-drawer__panel {
  transform: translateX(0);
}
.trade-drawer__tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  padding: 12px 8px 0;
  border-bottom: 1px solid #f0f0f0;
  overflow-x: auto;
  scrollbar-width: none;
}
.trade-drawer__tabs::-webkit-scrollbar { display: none; }
.trade-drawer__tab {
  flex: 0 0 auto;
  appearance: none;
  background: none;
  border: none;
  padding: 8px 10px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.trade-drawer__tab.is-active {
  color: #111;
  border-bottom-color: var(--upa-accent);
}
.trade-drawer__filters {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  flex-shrink: 0;
}
.trade-drawer__filter {
  appearance: none;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #666;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.trade-drawer__filter.is-active {
  background: var(--upa-accent);
  border-color: var(--upa-accent);
  color: var(--upa-on-accent);
}
.trade-drawer__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 24px;
}
.trade-drawer__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid #f7f7f7;
}
.trade-drawer__link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 12px 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.trade-drawer__row.is-active {
  background: #fffbeb;
}
.trade-drawer__row[hidden] {
  display: none !important;
}
.trade-drawer__fav,
.market-row__fav {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: #c8c8c8;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.trade-drawer__fav:hover,
.market-row__fav:hover {
  color: var(--upa-accent);
  background: rgba(245, 197, 24, 0.1);
}
.trade-drawer__fav:focus-visible,
.market-row__fav:focus-visible {
  outline: 2px solid var(--upa-accent, var(--upa-accent));
  outline-offset: 2px;
}
.trade-drawer__fav .ui-icon,
.market-row__fav .ui-icon { display: block; }
.trade-drawer__fav.is-active,
.market-row__fav.is-active {
  color: var(--upa-accent);
}
.trade-drawer__fav.is-active:active,
.market-row__fav.is-active:active,
.trade-drawer__fav:active,
.market-row__fav:active {
  transform: scale(0.92);
}

.market-page-table { margin-top: 0; }

.market-page-head {
  display: grid !important;
  grid-template-columns: 1fr 96px 44px;
  gap: 4px;
  align-items: center;
  padding: 8px 12px 8px 16px !important;
}

.market-page-head__fav {
  width: 44px;
}

.market-page-table .market-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 0;
  align-items: center;
  padding: 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f5f5f5;
}

.market-page-table .market-row[hidden] {
  display: none !important;
}

.market-page-table .market-row__link {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
  align-items: center;
  padding: 12px 4px 12px 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.market-row__product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.market-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.market-row__pair {
  font-size: 14px;
  font-weight: 700;
  color: #c9a227;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-row__price {
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.market-page-table .market-row__fav {
  margin-right: 6px;
}

.market-page-table .badge-up,
.market-page-table .badge-down {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  color: inherit;
}

.market-page-table .badge-up {
  background: rgba(46, 189, 133, 0.14);
  color: var(--upa-green);
}

.market-page-table .badge-down {
  background: rgba(246, 70, 93, 0.12);
  color: var(--upa-red);
}

html[data-theme="dark"] .market-row__pair {
  color: var(--upa-accent);
}

html[data-theme="dark"] .market-page-table .market-row {
  border-bottom-color: #222222;
}

html[data-theme="dark"] .market-row__fav {
  color: #6b6b75;
}

html[data-theme="dark"] .market-row__fav.is-active {
  color: var(--upa-accent);
}

.trade-drawer__name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}
.trade-drawer__price {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trade-drawer__empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 32px 16px;
  margin: 0;
}

.trade-top-bar__divider { width: 1px; height: 18px; background: #e5e5e5; }
.trade-top-bar__pair { flex: 1; margin: 0; font-size: 16px; font-weight: 700; text-align: left; }
.trade-summary { display: flex; gap: 12px; padding: 12px 16px; }
.trade-summary__left { min-width: 120px; }
.trade-summary__price { font-size: 26px; font-weight: 700; line-height: 1.1; }
.trade-summary__stats {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 10px; color: #999;
}
.trade-summary__stats strong { display: block; color: #333; font-size: 11px; margin-top: 2px; }
.trade-timeframes {
  display: flex; gap: 12px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; align-items: center;
}
.trade-timeframes::-webkit-scrollbar { display: none; }
.trade-timeframes a {
  flex-shrink: 0; font-size: 12px; color: #999; text-decoration: none; padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}
.trade-timeframes a.active { color: #111; font-weight: 700; border-bottom-color: var(--upa-accent); }
.trade-ma-legend { display: flex; gap: 12px; padding: 0 16px 6px; font-size: 10px; min-height: 18px; }
.chart-box--candles {
  margin: 0;
  border-radius: 0;
  background: #ffffff;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 300px;
  max-height: none;
  position: relative;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.chart-box--candles.is-panning {
  cursor: grabbing;
}
.chart-box--candles canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.trade-inline-countdown {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  margin: 0;
  padding: 10px 16px;
  background: linear-gradient(90deg, #fffdf2 0%, #fff 55%);
  border-top: 1px solid #f0e6b8;
  border-bottom: 1px solid #f0f0f0;
}
.trade-inline-countdown[hidden] { display: none !important; }
.trade-inline-countdown__timer {
  display: flex; align-items: baseline; gap: 4px; grid-row: 1 / span 2;
}
.trade-inline-countdown__label {
  display: none; font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: .04em;
}
.trade-inline-countdown__value {
  font-size: 28px; font-weight: 800; color: #111; line-height: 1; min-width: 1.4em; text-align: right;
  font-variant-numeric: tabular-nums;
}
.trade-inline-countdown__unit { font-size: 12px; color: #999; font-weight: 600; }
.trade-inline-countdown__meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; color: #666;
}
.trade-inline-countdown__meta span:first-child { font-weight: 700; color: #111; font-size: 13px; }
.trade-inline-countdown__bar {
  grid-column: 1 / -1; height: 3px; background: #f0f0f0; border-radius: 999px; overflow: hidden; margin-top: 2px;
}
.trade-inline-countdown__bar span {
  display: block; height: 100%; background: var(--upa-accent); transition: width .4s linear;
}

.trade-market-panels {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  overflow: hidden;
}
.trade-market-panels__tabs {
  display: flex; gap: 0; flex-shrink: 0; border-bottom: 1px solid #f0f0f0; padding: 0 8px;
}
.trade-market-panels__tab {
  flex: 1; appearance: none; background: none; border: none; padding: 10px 4px;
  font-size: 12px; font-weight: 600; color: #999; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.trade-market-panels__tab.is-active { color: #111; border-bottom-color: var(--upa-accent); }
.trade-market-panels__pane {
  flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
}
.trade-market-panels__pane[hidden] { display: none !important; }
.trade-market-panels__pane.is-active { display: block; }

.trade-book__head,
.trade-tape__head {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px;
  padding: 8px 16px 4px; font-size: 10px; color: #bbb; position: sticky; top: 0; background: #fff; z-index: 1;
}
.trade-book__head span:nth-child(2),
.trade-book__head span:nth-child(3),
.trade-tape__head span:nth-child(2),
.trade-tape__head span:nth-child(3) { text-align: right; }

.trade-book__row,
.trade-tape__row {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px;
  padding: 3px 16px; font-size: 11px; font-variant-numeric: tabular-nums; position: relative;
}
.trade-book__row span:nth-child(2),
.trade-book__row span:nth-child(3),
.trade-tape__row span:nth-child(2),
.trade-tape__row span:nth-child(3) { text-align: right; color: #666; }
.trade-book__row::before {
  content: ""; position: absolute; top: 1px; bottom: 1px; right: 0;
  width: var(--depth, 0%); max-width: 70%; pointer-events: none;
}
.trade-book__row.is-ask::before { background: rgba(246, 70, 93, 0.1); }
.trade-book__row.is-bid::before { background: rgba(46, 189, 133, 0.12); }
.trade-book__mid {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 8px 16px; border-top: 1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5; background: #fafafa;
}
.trade-book__mid strong { font-size: 16px; font-weight: 800; }
.trade-book__mid span { font-size: 10px; color: #999; }

.trade-positions-panel { padding: 0 16px 12px; }
.trade-positions-panel__empty { text-align: center; color: #bbb; font-size: 12px; padding: 28px 8px; margin: 0; }
.trade-positions-panel__all {
  display: block; text-align: center; font-size: 12px; font-weight: 600; padding: 10px 0 4px; color: var(--upa-accent);
}

@media (min-width: 900px) {
  .mobile-shell.trade-shell.has-tabbar.has-trade-actions .chart-box--candles {
    flex: 1 1 auto;
    max-height: none;
    min-height: 360px;
  }
  .trade-inline-countdown__label { display: inline; margin-right: 6px; }
}

.orders-empty, .orders-end {
  text-align: center; color: #ccc; font-size: 13px; padding: 20px 0;
}

.trade-bottom-actions {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: var(--max-mobile); display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 10px 16px; background: #fff; border-top: 1px solid #f0f0f0; z-index: 90;
}
.trade-bottom-actions button {
  height: 44px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
}
.trade-bottom-actions__up { background: var(--upa-accent); color: var(--upa-on-accent); }
.trade-bottom-actions__down { background: var(--upa-red); }

.order-trade-card { padding: 14px 0; border-bottom: 1px solid #f5f5f5; }
.order-trade-card__head {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 10px;
}
.order-trade-card__pair { font-size: 15px; font-weight: 700; }
.order-trade-card__dir { font-size: 12px; font-weight: 600; }
.order-trade-card__dir.is-up { color: var(--upa-green); }
.order-trade-card__dir.is-down { color: var(--upa-red); }
.order-trade-card__pl { font-size: 13px; font-weight: 700; text-align: right; }
.order-trade-card__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px;
}
.order-trade-card__label { display: block; font-size: 10px; color: #999; margin-bottom: 4px; }
.order-trade-card__value { display: block; font-size: 12px; font-weight: 600; color: #333; }
.order-trade-card__foot {
  display: flex; justify-content: space-between; font-size: 10px; color: #bbb;
}
.order-trade-card__status { color: #999; }
.order-trade-card__progress { height: 3px; background: #f0f0f0; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.order-trade-card__progress span { display: block; height: 100%; background: var(--upa-accent); }

.orders-page { padding-bottom: 16px; }
.orders-tabs {
  display: flex; justify-content: center; gap: 28px; border-bottom: 1px solid #f0f0f0;
}
.orders-tabs a {
  padding: 12px 4px; font-size: 15px; color: #999; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.orders-tabs a.active { color: #111; font-weight: 700; border-bottom-color: var(--upa-accent); }
.orders-list { padding: 0 16px; }

.assets-hero { padding: 20px 16px 0; background: #fff; }
.assets-hero__head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #666; }
.assets-hero__eye {
  border: none; background: none; padding: 4px; cursor: pointer;
  color: #666; display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.assets-hero__eye:hover { color: #111; }
.assets-hero__eye.is-hidden-balance .ui-icon--eye { display: none; }
.assets-hero__eye:not(.is-hidden-balance) .ui-icon--eye-off { display: none; }
.assets-hero__balance { font-size: 34px; font-weight: 700; margin: 8px 0; color: #111; }
.assets-hero__balance.is-hidden, .is-hidden { filter: blur(6px); user-select: none; }
.assets-hero__sub {
  display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #999; margin-bottom: 16px;
}
.assets-hero__sub strong { color: #333; font-weight: 600; }
.assets-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.assets-actions__btn {
  height: 38px; border-radius: 8px; border: 1px solid #e5e5e5; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  color: #333; text-decoration: none;
}
.assets-actions__btn--primary {
  background: var(--upa-accent);
  border-color: var(--upa-accent);
  color: var(--upa-on-accent) !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}
.assets-stats {
  display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
}
.assets-stats > div { padding: 14px 16px; }
.assets-stats > div:first-child { border-right: 1px solid #f0f0f0; }
.assets-stats__label { font-size: 12px; color: #999; margin-bottom: 6px; }
.assets-stats__value { font-size: 18px; font-weight: 700; color: #111; }
.assets-help-btn {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid #ccc; background: #fff;
  font-size: 10px; line-height: 1; color: #999; padding: 0; cursor: pointer; vertical-align: middle;
}
.assets-positions { padding: 16px; }
.assets-positions h2 { margin: 0 0 8px; font-size: 15px; }
.assets-positions__empty { text-align: center; color: #999; padding: 24px 0; }
.assets-instruction-title { text-align: center; margin: 0 0 12px; font-size: 17px; }
.assets-instruction-list { margin: 0 0 16px; padding-left: 18px; color: #666; font-size: 13px; line-height: 1.5; }

.trade-modal[hidden] { display: none !important; }
.trade-modal { position: fixed; inset: 0; z-index: 200; }
.trade-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.trade-modal__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--max-mobile); margin: 0 auto;
  background: #fff; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 90vh; overflow-y: auto;
}
.trade-modal__sheet--compact { border-radius: 14px; left: 16px; right: 16px; bottom: auto; top: 50%; transform: translateY(-50%); padding: 22px 20px 18px; }
.trade-modal__head { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 12px; }
.trade-modal__head h2 { margin: 0; font-size: 17px; font-weight: 700; color: #111; }
.trade-modal__close {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  border: none; background: none; font-size: 24px; color: #999; cursor: pointer; line-height: 1;
}
.trade-modal__primary {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
}
.trade-modal__secondary {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  margin-top: 10px;
  background: #f5f5f5 !important;
  color: #333 !important;
  font-size: 15px;
  font-weight: 600;
}
.trade-countdown { position: relative; width: 148px; height: 148px; margin: 18px auto 22px; }
.trade-countdown__value {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 700; color: #111; letter-spacing: -0.02em;
}
.trade-countdown__ring { width: 148px; height: 148px; transform: rotate(-90deg); }
.trade-countdown__meta {
  text-align: center; color: #666; font-size: 13px; margin: 0 0 4px;
}
.trade-result { text-align: center; }
.trade-result__pnl-label {
  margin: 8px 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.trade-result__amount {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.trade-result.is-won .trade-result__amount { color: #16a34a; }
.trade-result.is-lost .trade-result__amount { color: #ef4444; }
.trade-result__rows {
  text-align: left; font-size: 14px; color: #666; margin-bottom: 18px;
  border-top: 1px solid #f0f0f0; padding-top: 12px;
}
.trade-result__rows div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px;
}
.trade-result__rows div:last-child { margin-bottom: 0; }
.trade-result__rows strong { color: #111; font-weight: 600; font-size: 14px; }

.trade-modal__meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 12px; color: #666; margin-bottom: 16px;
}
.trade-modal__meta strong { display: block; color: #111; font-size: 13px; margin-top: 2px; }
.trade-modal__section { margin-bottom: 14px; }
.trade-modal__section-title { font-size: 13px; color: #666; margin-bottom: 8px; }
.duration-cards-wrap {
  position: relative;
  overflow: visible;
}
.duration-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  cursor: grab;
  overscroll-behavior-x: contain;
}
.duration-cards.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.duration-cards::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) {
  .duration-cards {
    scrollbar-width: thin;
    scrollbar-color: #c8c8c8 transparent;
  }
  .duration-cards::-webkit-scrollbar {
    display: block;
    height: 6px;
  }
  .duration-cards::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 999px;
  }
  .duration-cards::-webkit-scrollbar-track {
    background: transparent;
  }
}
.duration-card {
  /* Show 3 cards so 30/60/90 are all tappable without scrolling */
  flex: 0 0 calc((100% - 16px) / 3);
  scroll-snap-align: start;
  min-width: calc((100% - 16px) / 3);
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.duration-cards-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  align-items: center;
  justify-content: center;
  padding: 0;
}
.duration-cards-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.duration-cards-nav--prev { left: -6px; }
.duration-cards-nav--next { right: -6px; }
@media (hover: hover) and (pointer: fine) {
  .duration-cards-nav:not([hidden]) {
    display: inline-flex;
  }
  .duration-cards-wrap {
    padding: 0 18px;
  }
}
.duration-cards-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.duration-cards-dot {
  appearance: none;
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #ddd;
  cursor: pointer;
}
.duration-cards-dot.is-active { background: var(--upa-accent); }
html[data-theme="dark"] .duration-cards-nav {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #f2f2f2;
}
html[data-theme="dark"] .duration-cards-dot {
  background: #333333;
}
html[data-theme="dark"] .duration-cards-dot.is-active {
  background: var(--upa-accent);
}
@media (hover: hover) and (pointer: fine) {
  html[data-theme="dark"] .duration-cards {
    scrollbar-color: #5a5b65 transparent;
  }
  html[data-theme="dark"] .duration-cards::-webkit-scrollbar-thumb {
    background: #5a5b65;
  }
}
.trade-market-closed {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: #b45309;
  background: #fff7ed;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.trade-bottom-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.duration-card {
  position: relative; border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px 8px; text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.duration-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.duration-card.is-selected { border-color: var(--upa-accent); background: rgba(245, 197, 24, 0.1); }
.duration-card__ribbon {
  position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 22px solid var(--upa-accent); border-left: 22px solid transparent; color: #111;
  font-size: 9px; line-height: 0.8; padding-right: 2px; display: none;
}
.duration-card.is-selected .duration-card__ribbon { display: block; }
.duration-card__dur { display: block; font-size: 11px; color: #666; }
.duration-card__income { display: block; font-size: 12px; font-weight: 700; margin-top: 4px; }
.trade-modal__amount-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.trade-modal__min { color: #999; font-size: 11px; }
.trade-amount-input {
  display: flex; align-items: center; gap: 8px; border: 1px solid #e5e5e5; border-radius: 8px; padding: 0 12px; height: 44px;
}
.trade-amount-input input { flex: 1; border: none; outline: none; font-size: 15px; min-width: 0; }
.trade-amount-clear { border: none; background: none; color: #ccc; font-size: 18px; cursor: pointer; }
.trade-amount-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.trade-amount-quick button {
  height: 34px; border: 1px solid #eee; border-radius: 6px; background: #fafafa; font-size: 12px; cursor: pointer;
}
.trade-modal__summary { font-size: 12px; color: #666; margin: 12px 0; }
.trade-modal__summary div { display: flex; justify-content: space-between; margin-bottom: 6px; }
.trade-modal__summary strong { color: #111; }
.trade-modal__submit { margin-top: 4px; }

.security-page {
  background: #fff;
  min-height: calc(100dvh - 44px);
  padding: 0 0 28px;
}
.security-card {
  background: #fff;
}
.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  color: inherit;
  text-decoration: none;
  min-height: 52px;
  box-sizing: border-box;
}
.security-row--link:active { background: #fafafa; }
.security-row__label {
  font-size: 15px;
  color: #111;
  font-weight: 500;
}
.security-row__value {
  font-size: 14px;
  color: #999;
  text-align: right;
  word-break: break-all;
}
.security-row__trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.security-row__status.is-unbound {
  color: #ef4444;
  font-size: 14px;
}
.security-row__chevron {
  color: #c8c8c8;
  font-size: 20px;
  line-height: 1;
}
.security-section-label {
  padding: 14px 16px 8px;
  font-size: 13px;
  color: #999;
  background: #f7f7f7;
}
.security-form {
  padding: 16px;
}
.security-hint {
  margin: 0 0 16px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.method-list-page { padding-top: 4px; }
.method-list-item {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #f0f0f0;
  text-decoration: none; color: inherit;
}
.method-list-item__icon {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff8dd; color: #c9a100; font-size: 18px;
}
.method-list-item__label { flex: 1; font-size: 15px; font-weight: 500; }
.method-list-item__arrow { color: #ccc; font-size: 20px; }

.fund-tabs {
  display: flex; justify-content: center; gap: 20px; border-bottom: 1px solid #f0f0f0;
}
.fund-tabs a {
  padding: 12px 6px; font-size: 14px; color: #999; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.fund-tabs a.active { color: #111; font-weight: 700; border-bottom-color: var(--upa-accent); }
.fund-list { padding: 0; }
.fund-item { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.fund-item__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.fund-item__sub, .fund-item__meta { margin-top: 6px; font-size: 11px; color: #999; }
.fund-empty { text-align: center; color: #999; padding: 32px 16px; }

.auth-page {
  min-height: 100dvh;
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 42%, #ffffff 100%);
  padding: 12px 22px 40px;
}
.auth-page__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  min-height: 40px;
}
.auth-page__back {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #111; text-decoration: none; line-height: 1; border-radius: 50%;
}
.auth-page__link {
  color: #333; font-size: 18px; font-weight: 600; text-decoration: none;
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
}
.auth-page__heading {
  flex: 1; text-align: center; font-size: 17px; font-weight: 700; margin: 0; color: #111;
}
.auth-page__top-spacer { width: 36px; }
.auth-page__brand {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 18px;
}
.auth-page__brand img {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  box-shadow: 0 8px 20px rgba(245, 197, 24, 0.25);
}
.auth-page__brand--compact { margin-bottom: 12px; }
.auth-page__brand--compact img { width: 48px; height: 48px; border-radius: 12px; }
.auth-page__brand-name {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; color: #111;
}
.auth-page__title { font-size: 22px; font-weight: 700; margin: 0 0 18px; color: #111; line-height: 1.35; }
.auth-page__intro {
  margin: 0 0 18px; font-size: 13px; color: #666; line-height: 1.5;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 20px;
  padding: 5px;
  background: #f3f3f3;
  border-radius: 12px;
}
.auth-tabs__tab {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0; border-radius: 9px;
  height: 40px; font-size: 14px; font-weight: 600; color: #888;
  cursor: pointer; font-family: inherit;
}
.auth-tabs__tab.is-active {
  color: #111; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.auth-tabs--underline {
  display: flex;
  gap: 28px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border-bottom: 1px solid #ececec;
  margin-bottom: 22px;
}
.auth-tabs--underline .auth-tabs__tab {
  flex: 0 0 auto;
  height: auto;
  padding: 0 2px 12px;
  border-radius: 0;
  color: #999;
  font-size: 16px;
  font-weight: 600;
  box-shadow: none;
  background: transparent;
  position: relative;
}
.auth-tabs--underline .auth-tabs__tab.is-active {
  color: #111;
  background: transparent;
  box-shadow: none;
}
.auth-tabs--underline .auth-tabs__tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--upa-accent);
}
.auth-phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.auth-phone-dial {
  flex: 0 0 56px;
  height: 48px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  background: #fff;
}
.auth-phone-row input {
  flex: 1;
  min-width: 0;
}
.auth-country-trigger {
  width: 100%;
  height: 48px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.auth-country-trigger__flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.auth-country-trigger__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-country-trigger__chevron {
  color: #aaa;
  font-size: 12px;
}
.auth-send-code--link {
  min-width: auto;
  border: none;
  background: transparent;
  color: var(--upa-accent);
  font-weight: 700;
  padding: 0 4px;
}
.auth-send-code--link:disabled {
  background: transparent;
  border: none;
  color: #aaa;
}
.auth-country-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: center;
}
.auth-country-sheet[hidden] { display: none !important; }
.auth-country-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.auth-country-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-mobile, 480px);
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.auth-country-sheet__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid #eee;
}
.auth-country-sheet__search-icon {
  color: #999;
  font-size: 18px;
  line-height: 1;
}
.auth-country-sheet__search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #f7f7f7;
}
.auth-country-sheet__cancel {
  border: none;
  background: none;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 4px;
}
.auth-country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.auth-country-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #f2f2f2;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.auth-country-item__flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.auth-country-item__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-country-item__dial {
  font-size: 13px;
  color: #888;
  flex-shrink: 0;
}
body.auth-country-open {
  overflow: hidden;
}
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  background: #f3f3f3;
  border-radius: 12px;
}
.auth-mode-tabs__tab {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0; border-radius: 9px;
  height: 40px; font-size: 13px; font-weight: 600; color: #888;
  cursor: pointer; font-family: inherit; padding: 0 8px;
}
.auth-mode-tabs__tab.is-active {
  color: #111; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.auth-field { margin-bottom: 16px; }
.auth-field[hidden],
.auth-otp-hint[hidden] { display: none !important; }
.auth-field label { display: block; font-size: 13px; color: #333; margin-bottom: 8px; font-weight: 600; }
.auth-field input {
  width: 100%; height: 48px; border: 1px solid #e6e6e6; border-radius: 12px;
  padding: 0 14px; font-size: 14px; background: #fff; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input:focus {
  border-color: var(--upa-accent);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.2);
}
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 46px; }
.auth-password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; padding: 6px;
  color: #888; display: inline-flex; align-items: center; justify-content: center;
  line-height: 0;
}
.auth-password-toggle:hover { color: #333; }
.ui-eye-swap { display: inline-flex; align-items: center; justify-content: center; }
.ui-eye-swap__hide { display: none; }
.ui-eye-swap[data-eye-state="visible"] .ui-eye-swap__show { display: none; }
.ui-eye-swap[data-eye-state="visible"] .ui-eye-swap__hide { display: inline-flex; }
.ui-icon { display: block; }
.auth-otp-row {
  display: flex; align-items: stretch; gap: 10px;
}
.auth-otp-row input {
  flex: 1; min-width: 0;
}
.auth-send-code {
  flex: 0 0 auto;
  min-width: 108px;
  height: 48px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 12px;
  font-family: inherit;
}
.auth-send-code:disabled {
  background: #ddd; border-color: #ddd; color: #888; cursor: not-allowed;
}
.auth-otp-hint {
  margin: 10px 0 0; font-size: 13px; color: #1a1a1a; line-height: 1.45;
  background: #fff8d9; border: 1px solid #f5e6a3; border-radius: 10px; padding: 10px 12px;
}
.auth-otp-hint[hidden] { display: none !important; }
.auth-submit { margin-top: 8px; height: 50px; border-radius: 28px; font-size: 16px; font-weight: 700; }
.auth-register-btn { margin-top: 12px; text-decoration: none; height: 46px; border-radius: 30px; }
.auth-forgot-wrap { text-align: right; margin-top: 14px; }
.auth-forgot-wrap--split { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-forgot {
  color: #888; font-size: 13px; text-decoration: none;
  border: none; background: none; cursor: pointer; padding: 0; font-family: inherit;
}
.auth-forgot:hover { color: #111; }
.auth-switch { margin-top: 22px; font-size: 13px; color: #666; }
.auth-switch a { color: #111; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.auth-switch--center { text-align: center; }

/* legacy absolute OTP layout fallback */
.auth-otp-wrap { position: relative; }
.auth-otp-wrap input { padding-right: 100px; }
.auth-otp-wrap .auth-send-code {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  min-width: auto; height: auto; border: none; background: none; color: var(--upa-accent);
  padding: 0; border-radius: 0;
}

body.modal-open { overflow: hidden; }
.badge-up, .badge-down { padding: 3px 10px; font-size: 11px; font-weight: 600; }
.badge-up { background: rgba(46, 189, 133, 0.15); color: var(--upa-green); }
.badge-down { background: rgba(246, 70, 93, 0.12); color: var(--upa-red); }

.app-top-actions a {
  border: 1px solid #e8e8e8; border-radius: 50%; font-size: 16px;
}

.app-top-actions .theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8e8e8;
  border-radius: 50%;
  background: transparent;
  color: #333;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

/* ==========================================================================
   RTL support (Arabic). Practical flips only — flex/grid layouts mostly
   mirror automatically once `dir="rtl"` is set on <html>; the rules below
   handle the remaining hardcoded left/right values.
   ========================================================================== */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .page-body,
html[dir="rtl"] .mobile-shell,
html[dir="rtl"] .auth-page {
  text-align: right;
}

html[dir="rtl"] .tabbar {
  direction: rtl;
}

html[dir="rtl"] .tabbar a.active .tabbar-icon-wrap {
  /* keep icon centering symmetric under RTL */
  margin-inline: auto;
}

html[dir="rtl"] .app-top-bar {
  direction: rtl;
}

html[dir="rtl"] .app-top-bar .app-top-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] ul,
html[dir="rtl"] ol {
  padding-right: 1.25em;
  padding-left: 0;
}

html[dir="rtl"] .trade-top-bar {
  direction: rtl;
}

html[dir="rtl"] .trade-top-bar__pair {
  text-align: right;
}

html[dir="rtl"] .trade-top-bar__back,
html[dir="rtl"] .trade-top-bar__menu,
html[dir="rtl"] .trade-top-bar__star {
  transform: scaleX(-1);
}

html[dir="rtl"] .auth-page__top {
  direction: rtl;
}

html[dir="rtl"] .auth-page__back {
  transform: scaleX(-1);
}

html[dir="rtl"] .auth-forgot-wrap {
  text-align: left;
}

html[dir="rtl"] .auth-switch {
  text-align: center;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea {
  text-align: right;
}

html[dir="rtl"] .admin-layout {
  direction: rtl;
}

/* ==========================================================================
   Language picker (dark list + circular flags — matches product reference)
   ========================================================================== */
body.lang-page-body {
  background: #2b2c36;
}

.mobile-shell--dark {
  background: #2b2c36;
  min-height: 100dvh;
  box-shadow: none;
}

.page-header--dark {
  background: #2b2c36;
  border-bottom: none;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 16px;
  height: 52px;
}

.page-header--dark h1 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  position: static;
  transform: none;
  text-align: left;
}

.page-header--dark .header-back {
  position: static;
  left: auto;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  margin: 0;
  padding: 0 4px 0 0;
  text-decoration: none;
}

.page-body--dark {
  background: #2b2c36;
  padding: 8px 0 32px;
  min-height: calc(100dvh - 52px);
}

.mobile-shell--dark .flash {
  margin: 8px 12px;
  border-radius: 8px;
}

.lang-picker {
  padding: 4px 12px 28px;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
}

.lang-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.lang-picker__item {
  margin: 0;
  width: 100%;
}

.lang-picker__form {
  margin: 0;
  display: block;
  width: 100%;
}

.lang-picker__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
  box-sizing: border-box;
}

.lang-picker__btn:hover,
.lang-picker__btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.lang-picker__btn.is-active {
  background: linear-gradient(90deg, var(--upa-accent) 0%, rgba(245, 197, 24, 0.55) 42%, rgba(245, 197, 24, 0.08) 100%);
  color: #fff;
  font-weight: 700;
}

.lang-picker__flag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  background: #1a1a22;
}

.lang-picker__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lang-picker__name {
  flex: 1;
  line-height: 1.3;
}

html[dir="rtl"] .lang-picker__btn {
  text-align: right;
  flex-direction: row-reverse;
}

/* ==========================================================================
   Night mode (data-theme="dark")
   ========================================================================== */
.theme-toggle {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
}

.theme-toggle__icon {
  display: none;
  line-height: 0;
}

html:not([data-theme="dark"]) .theme-toggle__icon--moon,
html[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

.pc-top__action.theme-toggle {
  border: none;
  background: transparent;
  color: #222;
  cursor: pointer;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

/* Night mode applies to the exchange shell; on desktop, keep a light page frame around it */
html[data-theme="dark"] body {
  background: #1c1c1e;
  color: #111;
}

html[data-theme="dark"] .mobile-shell {
  background: #1c1c1e;
  box-shadow: none;
  color: #ffffff;
}

@media (min-width: 480px) {
  html[data-theme="dark"] body {
    background: var(--mc-page-frame);
  }

  html[data-theme="dark"] .mobile-shell {
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.22);
  }
}

html[data-theme="dark"] .app-top-bar,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .pc-top {
  background: #1c1c1e;
  border-bottom-color: #1f1f1f;
}

html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .pc-top__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .pc-top__back,
html[data-theme="dark"] .pc-top__action,
html[data-theme="dark"] .pc-top__action.theme-toggle,
html[data-theme="dark"] .header-back {
  color: #f2f2f2;
}

html[data-theme="dark"] .app-search {
  background: #2c2c2e;
}

html[data-theme="dark"] .app-search input {
  color: #f2f2f2;
  background: transparent;
}

html[data-theme="dark"] .app-search input::placeholder {
  color: #8b8b96;
}

html[data-theme="dark"] .app-search-icon {
  color: #8b8b96;
}

html[data-theme="dark"] .app-top-actions a,
html[data-theme="dark"] .app-top-actions .theme-toggle {
  color: #f2f2f2;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .page-body,
html[data-theme="dark"] .pc-page,
html[data-theme="dark"] .deposit-page,
html[data-theme="dark"] .fund-page,
html[data-theme="dark"] .orders-page,
html[data-theme="dark"] .position-page,
html[data-theme="dark"] .assets-page {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .fund-page {
  background: #1c1c1e;
}

html[data-theme="dark"] .deposit-page--categories .deposit-method-list {
  background: #2c2c2e;
  border-top-color: #1a1a1a;
  border-radius: 12px;
  margin: 12px 16px;
  overflow: hidden;
}

/* —— Home —— */
html[data-theme="dark"] .home-assets__label,
html[data-theme="dark"] .home-assets__caret {
  color: #a0a0aa;
}

html[data-theme="dark"] .home-assets__funds-btn {
  background: #2c2c2e;
  color: #c8c8d0;
}

html[data-theme="dark"] .home-assets__funds-btn:active {
  background: #222;
}

html[data-theme="dark"] .home-assets__funds-label,
html[data-theme="dark"] .home-assets__funds-btn .home-assets__caret {
  color: #c8c8d0;
}

html[data-theme="dark"] .home-assets__balance {
  color: #f2f2f2;
}

html[data-theme="dark"] .home-quick-grid__item {
  color: #e8e8e8;
}

html[data-theme="dark"] .home-quick-grid .icon,
html[data-theme="dark"] .home-quick-grid .home-quick-icon {
  color: #9A9A9A;
  --home-quick-icon: #9A9A9A;
}

html[data-theme="dark"] .home-quick-grid__item span {
  color: #e8e8e8;
}

html[data-theme="dark"] .home-promo-card,
html[data-theme="dark"] .home-carousel__card,
html[data-theme="dark"] .home-banner-fallback {
  background: #2c2c2e;
  border-color: #222222;
  color: #e8e8e8;
  box-shadow: none;
}

html[data-theme="dark"] .home-promo-card__copy strong,
html[data-theme="dark"] .home-banner-fallback__brand {
  color: #f2f2f2;
}

html[data-theme="dark"] .home-promo-card__copy span,
html[data-theme="dark"] .home-banner-fallback__slogan {
  color: #a0a0aa;
}

html[data-theme="dark"] .home-carousel__sym {
  color: #a0a0aa;
}

html[data-theme="dark"] .home-carousel__dot {
  background: #333333;
}

html[data-theme="dark"] .home-carousel__dot.is-active {
  background: var(--upa-accent);
}

html[data-theme="dark"] .market-table .head,
html[data-theme="dark"] .market-page-head,
html[data-theme="dark"] .home-market-table .head {
  color: #9a9aa3;
}

html[data-theme="dark"] .market-table .row,
html[data-theme="dark"] .market-name-text,
html[data-theme="dark"] .section-title {
  color: #e8e8e8;
}

html[data-theme="dark"] .market-table .row {
  border-bottom-color: #1a1a1a;
}

html[data-theme="dark"] .market-category-tabs a,
html[data-theme="dark"] .market-category-tabs span,
html[data-theme="dark"] .market-filter-tabs a {
  color: #9a9aa3;
}

html[data-theme="dark"] .market-category-tabs .active,
html[data-theme="dark"] .market-category-tabs a.active,
html[data-theme="dark"] .market-filter-tabs a.active {
  color: #f2f2f2;
}

html[data-theme="dark"] .market-empty {
  color: #9a9aa3;
}

/* —— Personal center / lists —— */
html[data-theme="dark"] .pc-profile__name,
html[data-theme="dark"] .pc-profile__uid,
html[data-theme="dark"] .pc-credit,
html[data-theme="dark"] .pc-row__label {
  color: #e8e8e8;
}

html[data-theme="dark"] .pc-group,
html[data-theme="dark"] .pc-row,
html[data-theme="dark"] .home-card,
html[data-theme="dark"] .home-banner,
html[data-theme="dark"] .carousel-card,
html[data-theme="dark"] .market-row,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-block,
html[data-theme="dark"] .list-cell,
html[data-theme="dark"] .assets-card {
  background: #2c2c2e;
  border-color: #222222;
  color: #e8e8e8;
}

html[data-theme="dark"] .pc-row {
  border-bottom-color: #222222;
}

html[data-theme="dark"] .pc-row__chevron,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .upa-muted {
  color: #9a9aa3;
}

html[data-theme="dark"] .tabbar {
  background: #1c1c1e;
  border-top-color: #1f1f1f;
}

html[data-theme="dark"] .tabbar a {
  color: #b0b0ba;
}

html[data-theme="dark"] .tabbar a.active {
  color: var(--upa-accent);
}

html[data-theme="dark"] .tabbar a:not(.active) img,
html[data-theme="dark"] .tabbar a:not(.active) svg {
  opacity: 0.85;
  filter: brightness(1.55);
}

/* —— Forms / inputs —— */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #2c2c2e;
  color: #f2f2f2;
  border-color: #2a2a2a;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #8b8b96;
}

html[data-theme="dark"] .upa-input-wrap {
  background: #2c2c2e;
}

html[data-theme="dark"] .upa-input-wrap input {
  color: #f2f2f2;
  background: transparent;
}

html[data-theme="dark"] .flash {
  background: #2c2c2e;
  color: #e8e8e8;
}

html[data-theme="dark"] .market-icon-wrap {
  background: #2a2a2a;
}

/* —— Deposit / fund —— */
html[data-theme="dark"] .deposit-method-list,
html[data-theme="dark"] .fund-card,
html[data-theme="dark"] .fund-currency-list {
  background: #2c2c2e;
  border-color: #222222;
}

html[data-theme="dark"] .deposit-method-item,
html[data-theme="dark"] .fund-currency-item,
html[data-theme="dark"] .fund-copy-row,
html[data-theme="dark"] .fund-select-row {
  border-bottom-color: #222222;
  color: #e8e8e8;
}

html[data-theme="dark"] .deposit-method-label,
html[data-theme="dark"] .fund-currency-item__label,
html[data-theme="dark"] .fund-card__title,
html[data-theme="dark"] .fund-card__accent-title,
html[data-theme="dark"] .deposit-section-title,
html[data-theme="dark"] .deposit-detail-title,
html[data-theme="dark"] .fund-copy-row__value,
html[data-theme="dark"] .fund-amount-prefix {
  color: #f2f2f2;
}

html[data-theme="dark"] .deposit-method-arrow,
html[data-theme="dark"] .fund-currency-item__chevron,
html[data-theme="dark"] .fund-tips,
html[data-theme="dark"] .fund-copy-row__label,
html[data-theme="dark"] .fund-field-label,
html[data-theme="dark"] .fund-amount-min,
html[data-theme="dark"] .fund-hint,
html[data-theme="dark"] .fund-fee-note,
html[data-theme="dark"] .deposit-field-label,
html[data-theme="dark"] .deposit-empty,
html[data-theme="dark"] .deposit-notice {
  color: #9a9aa3;
}

html[data-theme="dark"] .fund-input,
html[data-theme="dark"] .deposit-input,
html[data-theme="dark"] .fund-select {
  background: #2c2c2e;
  color: #f2f2f2;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .fund-copy-btn,
html[data-theme="dark"] .fund-all-btn,
html[data-theme="dark"] .deposit-copy-btn {
  background: #2c2c2e;
  color: #e8e8e8;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .fund-card__banner {
  background: #222222;
  color: #e8e8e8;
}

html[data-theme="dark"] .fund-upload,
html[data-theme="dark"] .deposit-upload {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #9a9aa3;
}

/* —— Assets —— */
html[data-theme="dark"] .assets-hero {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .assets-hero__head,
html[data-theme="dark"] .assets-hero__eye,
html[data-theme="dark"] .assets-hero__sub,
html[data-theme="dark"] .assets-stats__label {
  color: #9a9aa3;
}

html[data-theme="dark"] .assets-hero__balance,
html[data-theme="dark"] .assets-hero__sub strong,
html[data-theme="dark"] .assets-stats__value,
html[data-theme="dark"] .assets-positions h2 {
  color: #f2f2f2;
}

html[data-theme="dark"] .assets-actions__btn {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #e8e8e8;
}

html[data-theme="dark"] .assets-actions__btn--primary {
  background: var(--upa-accent);
  border-color: var(--upa-accent);
  color: var(--upa-on-accent);
}

html[data-theme="dark"] .assets-stats {
  border-color: #1a1a1a;
}

html[data-theme="dark"] .assets-stats > div:first-child {
  border-right-color: #1a1a1a;
}

html[data-theme="dark"] .assets-help-btn {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #9a9aa3;
}

html[data-theme="dark"] .assets-positions__empty,
html[data-theme="dark"] .assets-instruction-list {
  color: #9a9aa3;
}

/* —— Orders / positions —— */
html[data-theme="dark"] .orders-tabs a,
html[data-theme="dark"] .position-asset-tabs a,
html[data-theme="dark"] .position-segment a {
  color: #9a9aa3;
}

html[data-theme="dark"] .orders-tabs a.active,
html[data-theme="dark"] .position-asset-tabs a.active,
html[data-theme="dark"] .position-segment a.active {
  color: #f2f2f2;
  background: transparent;
  border-bottom-color: var(--upa-accent);
}

html[data-theme="dark"] .position-segment a.active {
  background: var(--upa-primary);
  color: #fff;
  border-color: var(--upa-primary);
}

html[data-theme="dark"] .orders-empty,
html[data-theme="dark"] .orders-end,
html[data-theme="dark"] .position-empty,
html[data-theme="dark"] .position-loaded,
html[data-theme="dark"] .assets-positions__empty,
html[data-theme="dark"] .trade-positions-panel__empty,
html[data-theme="dark"] .market-empty,
html[data-theme="dark"] .fund-empty,
html[data-theme="dark"] .deposit-empty {
  color: #b8b8c0;
}

html[data-theme="dark"] .position-card {
  background: #2c2c2e;
  border-color: #222222;
}

html[data-theme="dark"] .position-pair,
html[data-theme="dark"] .position-value {
  color: #f2f2f2;
}

html[data-theme="dark"] .position-code,
html[data-theme="dark"] .position-label,
html[data-theme="dark"] .position-duration,
html[data-theme="dark"] .position-amount,
html[data-theme="dark"] .position-time {
  color: #9a9aa3;
}

html[data-theme="dark"] .position-badge-long {
  background: rgba(46, 189, 133, 0.18);
}

html[data-theme="dark"] .position-badge-short {
  background: rgba(246, 70, 93, 0.18);
}

/* —— Trade —— */
html[data-theme="dark"] .trade-top-bar,
html[data-theme="dark"] .trade-summary,
html[data-theme="dark"] .trade-timeframes,
html[data-theme="dark"] .trade-ma-legend,
html[data-theme="dark"] .trade-inline-countdown,
html[data-theme="dark"] .trade-market-panels,
html[data-theme="dark"] .trade-bottom-actions {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .trade-top-bar__back,
html[data-theme="dark"] .trade-top-bar__menu,
html[data-theme="dark"] .trade-top-bar__pair {
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-top-bar__star {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-top-bar__star.is-active {
  color: var(--upa-accent);
}

html[data-theme="dark"] .trade-top-bar__divider {
  background: #2a2a2a;
}

html[data-theme="dark"] .trade-summary__stats,
html[data-theme="dark"] .trade-summary__stats span {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-summary__stats strong {
  color: #e8e8e8;
}

html[data-theme="dark"] .trade-timeframes a,
html[data-theme="dark"] .trade-market-panels__tab {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-timeframes a.active,
html[data-theme="dark"] .trade-market-panels__tab.is-active {
  color: #f2f2f2;
}

html[data-theme="dark"] .chart-box,
html[data-theme="dark"] .chart-box--candles {
  background: #2c2c2e;
  border-color: #3a3a3c;
}

html[data-theme="dark"] .trade-book__head,
html[data-theme="dark"] .trade-tape__head,
html[data-theme="dark"] .trade-book__row span:nth-child(2),
html[data-theme="dark"] .trade-book__row span:nth-child(3),
html[data-theme="dark"] .trade-tape__row span:nth-child(2),
html[data-theme="dark"] .trade-tape__row span:nth-child(3),
html[data-theme="dark"] .trade-book__mid span,
html[data-theme="dark"] .trade-positions-panel__empty {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-book__mid strong {
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-inline-countdown__meta span:first-child,
html[data-theme="dark"] .trade-inline-countdown__value {
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-inline-countdown__unit,
html[data-theme="dark"] .trade-inline-countdown__label {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-modes .mode {
  background: #2c2c2e;
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-modes .mode.active {
  background: var(--upa-accent);
  color: var(--upa-on-accent);
}

/* —— Drawers / modals —— */
html[data-theme="dark"] .trade-drawer__panel,
html[data-theme="dark"] .modal-sheet,
html[data-theme="dark"] .trade-modal__sheet {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .trade-drawer__tab,
html[data-theme="dark"] .trade-drawer__filter {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-drawer__tab.is-active,
html[data-theme="dark"] .trade-drawer__filter.is-active {
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-drawer__row,
html[data-theme="dark"] .trade-drawer__link,
html[data-theme="dark"] .trade-drawer__name,
html[data-theme="dark"] .trade-drawer__price {
  color: #e8e8e8;
  border-color: #222222;
}

html[data-theme="dark"] .trade-drawer__empty {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-modal__head h2,
html[data-theme="dark"] .trade-modal__meta strong,
html[data-theme="dark"] .trade-modal__summary strong,
html[data-theme="dark"] .trade-result__rows strong,
html[data-theme="dark"] .assets-instruction-title {
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-modal__close,
html[data-theme="dark"] .trade-modal__section-title,
html[data-theme="dark"] .trade-modal__summary,
html[data-theme="dark"] .trade-modal__min,
html[data-theme="dark"] .duration-card__dur {
  color: #9a9aa3;
}

html[data-theme="dark"] .trade-modal__secondary {
  background: #2c2c2e !important;
  color: #e8e8e8 !important;
}

html[data-theme="dark"] .duration-card {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #e8e8e8;
}

html[data-theme="dark"] .duration-card.is-selected {
  background: rgba(245, 197, 24, 0.15);
  border-color: var(--upa-accent);
}

html[data-theme="dark"] .trade-amount-input {
  background: #2c2c2e;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .trade-amount-input input {
  background: transparent;
  color: #f2f2f2;
}

html[data-theme="dark"] .trade-amount-input input::placeholder {
  color: #8b8b96;
}

html[data-theme="dark"] .trade-amount-clear {
  color: #8b8b96;
}

html[data-theme="dark"] .trade-amount-quick button {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #e8e8e8;
}

html[data-theme="dark"] .exchange-amount-input,
html[data-theme="dark"] .exchange-card {
  background: #2c2c2e;
  color: #e8e8e8;
  border-color: #222222;
}

html[data-theme="dark"] .wallet-row {
  background: #2c2c2e;
  border-color: #222222;
}

html[data-theme="dark"] .wallet-row__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .wallet-row__plus {
  color: var(--upa-accent);
}

html[data-theme="dark"] .market-row__pair {
  color: var(--upa-accent);
}

html[data-theme="dark"] .market-page-table .market-row {
  border-bottom-color: #1a1a1a;
}

html[data-theme="dark"] .market-row__fav {
  color: #6a6b75;
}

html[data-theme="dark"] .market-row__fav.is-active {
  color: var(--upa-accent);
}

/* —— Auth (login / register / forgot) —— */
html[data-theme="dark"] .auth-page {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .auth-page__back,
html[data-theme="dark"] .auth-page__link,
html[data-theme="dark"] .auth-page__heading,
html[data-theme="dark"] .auth-page__brand-name,
html[data-theme="dark"] .auth-page__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-page__intro,
html[data-theme="dark"] .auth-forgot,
html[data-theme="dark"] .auth-switch {
  color: #9a9aa3;
}

html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .auth-mode-tabs {
  background: #2c2c2e;
}

html[data-theme="dark"] .auth-tabs__tab,
html[data-theme="dark"] .auth-mode-tabs__tab {
  color: #9a9aa3;
}

html[data-theme="dark"] .auth-tabs__tab.is-active,
html[data-theme="dark"] .auth-mode-tabs__tab.is-active {
  color: var(--upa-on-accent);
  background: var(--upa-accent);
  box-shadow: none;
}

html[data-theme="dark"] .auth-tabs--underline {
  background: transparent;
  border-bottom-color: #2a2a2a;
}

html[data-theme="dark"] .auth-tabs--underline .auth-tabs__tab {
  color: #9a9aa3;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .auth-tabs--underline .auth-tabs__tab.is-active {
  color: #f2f2f2;
  background: transparent;
}

html[data-theme="dark"] .auth-phone-dial,
html[data-theme="dark"] .auth-country-trigger {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-country-trigger__name,
html[data-theme="dark"] .auth-phone-dial {
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-send-code--link {
  background: transparent;
  border: none;
  color: var(--upa-accent);
}

html[data-theme="dark"] .auth-send-code--link:disabled {
  background: transparent;
  border: none;
  color: #8b8b96;
}

html[data-theme="dark"] .auth-country-sheet__panel {
  background: #2c2c2e;
}

html[data-theme="dark"] .auth-country-sheet__search {
  border-bottom-color: #2a2a2a;
}

html[data-theme="dark"] .auth-country-sheet__search input {
  background: #2c2c2e;
  border-color: #2a2a2a;
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-country-sheet__cancel {
  color: #c8c8d0;
}

html[data-theme="dark"] .auth-country-item {
  background: #2c2c2e;
  border-bottom-color: #1a1a1a;
}

html[data-theme="dark"] .auth-country-item__name {
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-country-item__dial {
  color: #9a9aa3;
}

html[data-theme="dark"] .auth-field label {
  color: #c8c8d0;
}

html[data-theme="dark"] .auth-field input,
html[data-theme="dark"] .auth-otp-row input {
  background: #2c2c2e;
  color: #f2f2f2;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .auth-field input::placeholder,
html[data-theme="dark"] .auth-otp-row input::placeholder {
  color: #8b8b96;
}

html[data-theme="dark"] .auth-password-toggle {
  color: #9a9aa3;
}

html[data-theme="dark"] .auth-password-toggle:hover {
  color: #f2f2f2;
}

html[data-theme="dark"] .auth-send-code {
  background: var(--upa-accent);
  color: #111;
  border-color: var(--upa-accent);
}

html[data-theme="dark"] .auth-send-code:disabled {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: #8b8b96;
}

html[data-theme="dark"] .auth-otp-hint {
  color: #e8e8e8;
  background: #2f2a18;
  border-color: #5a4e20;
}

html[data-theme="dark"] .auth-forgot {
  color: #b0b0ba;
}

html[data-theme="dark"] .auth-switch a {
  color: var(--upa-accent);
}

html[data-theme="dark"] .login-page {
  background: linear-gradient(180deg, #434459 0%, #2d2e3d 45%, #000000 45%);
  color: #e8e8e8;
}

html[data-theme="dark"] .wallet-page {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .wallet-page__banner {
  background: #2f2a18;
  border-color: #5a4e20;
  color: #e8d48a;
}

html[data-theme="dark"] .wallet-row {
  background: #1c1c1e;
  border-bottom-color: #1a1a1a;
}

html[data-theme="dark"] .wallet-row--add:active {
  background: #2c2c2e;
}

html[data-theme="dark"] .wallet-row__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .wallet-row__address,
html[data-theme="dark"] .wallet-row__label {
  color: #9a9aa3;
}

html[data-theme="dark"] .wallet-row__plus {
  border-color: #333333;
  color: #f2f2f2;
}

html[data-theme="dark"] .wallet-row__badge {
  background: rgba(245, 197, 24, 0.16);
  color: var(--upa-accent);
}

html[data-theme="dark"] .wallet-bind-hero {
  background: #2c2c2e;
}

html[data-theme="dark"] .wallet-bind-hero__title {
  color: #f2f2f2;
}

html[data-theme="dark"] .wallet-bind-hero__hint,
html[data-theme="dark"] .wallet-bind-default {
  color: #9a9aa3;
}

html[data-theme="dark"] .withdraw-add-wallet a {
  color: var(--upa-accent);
}

html[data-theme="dark"] .withdraw-add-wallet__plus {
  border-color: var(--upa-accent);
  color: var(--upa-accent);
}

/* —— Security Center —— */
html[data-theme="dark"] .security-page {
  background: #1c1c1e;
  color: #e8e8e8;
}

html[data-theme="dark"] .security-card {
  background: #1c1c1e;
}

html[data-theme="dark"] .security-row {
  border-bottom-color: #1a1a1a;
  color: #e8e8e8;
}

html[data-theme="dark"] .security-row--link:active {
  background: #2c2c2e;
}

html[data-theme="dark"] .security-row__label {
  color: #f2f2f2;
}

html[data-theme="dark"] .security-row__value {
  color: #9a9aa3;
}

html[data-theme="dark"] .security-row__chevron {
  color: #6a6b75;
}

html[data-theme="dark"] .security-section-label {
  background: #16171d;
  color: #9a9aa3;
}

html[data-theme="dark"] .security-hint {
  color: #9a9aa3;
}

html[data-theme="dark"] .form-group label {
  color: #c8c8d0;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
  background: #2c2c2e;
  color: #f2f2f2;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder {
  color: #8b8b96;
}

html[data-theme="dark"] .kyc-page__status,
html[data-theme="dark"] .file-field__label {
  color: #c8c8d0;
}

html[data-theme="dark"] .file-field__control {
  background: #2c2c2e;
  border-color: #2a2a2a;
}

html[data-theme="dark"] .file-field__btn {
  background: var(--upa-accent);
  color: var(--upa-on-accent);
}

html[data-theme="dark"] .file-field__name {
  color: #9a9aa3;
}

html[data-theme="dark"] .file-field__name.is-selected {
  color: #f2f2f2;
}

html[data-theme="dark"] .method-list-item {
  border-bottom-color: #1a1a1a;
  color: #e8e8e8;
}

html[data-theme="dark"] .method-list-item__label {
  color: #f2f2f2;
}

html[data-theme="dark"] .method-list-item__icon {
  background: #2f2a18;
  color: var(--upa-accent);
}

html[data-theme="dark"] .method-list-item__arrow {
  color: #6a6b75;
}

html[data-theme="dark"] .fund-tabs {
  border-bottom-color: #1a1a1a;
}

html[data-theme="dark"] .fund-tabs a {
  color: #9a9aa3;
}
/* 强行修正部分字母没有点的问题 */
* {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-language-override: "en" !important;
    font-feature-settings: "normal" !important;
}
/* 只让首页那个黄色的充值按钮恢复首字母大写 */
.home-shell button, 
button.btn-primary,
[class*="deposit"] {
    text-transform: capitalize !important;
}
/* ========================================================
   🎯 全站导航与分类菜单颜色统一微调补丁（保持字号与粗细不变）
   ======================================================== */

/* 1. 全站分类菜单：未选中状态全部变为灰色 */
.market-category-tabs a,
.market-tabs a,
.category-tabs a,
.market-category-tabs span {
    color: #999999 !important;
}

/* 全站分类菜单：选中的高亮状态变为纯黑色 */
.market-category-tabs .active,
.market-category-tabs span.active,
.market-tabs .active,
.category-tabs .active {
    color: #1c1c1e !important;
}

/* 2. 投资产品名称：强行覆盖原本的黄色，全站变纯黑色 */
.market-table .market-row span:first-child,
.market-table .market-row span:first-child *,
.market-table .market-row .market-name-cell,
.market-list .market-row .name {
    color: #1c1c1e !important;
}

/* 3. 最新价格：强行拦截实时跳动的红绿色类名，全站变纯黑色 */
.market-table .market-row .price-up,
.market-table .market-row .price-down,
.market-table .market-row span[data-live-change],
.market-list .price {
    color: #1c1c1e !important;
}

/* 4. 涨跌幅百分比胶囊（保持原有粗细字号，仅限红绿背景和白字） */
.market-table .market-row span[data-live-badge].price-up,
.market-list .change.up {
    background-color: #00b97a !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    min-width: 65px !important;
    text-align: center !important;
}
.market-table .market-row span[data-live-badge].price-down,
.market-list .change.down {
    background-color: #ff3b30 !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    min-width: 65px !important;
    text-align: center !important;
}

/* 5. 全站底部导航栏（Tabbar）：所有文本和图标保持高级灰色 */
.tabbar a, 
.tabbar a span,
.tabbar a.active,
.tabbar a.active span,
.tabbar a i,
.tabbar a svg {
    color: #999999 !important;
}
/* ========================================================
   🔥 终极绝对穿透补丁：强制锁定动态跳动的行情列表颜色
   ======================================================== */

/* 2. 强行锁定产品名称：不管 JS 怎么变，全站只要在行情列表里的名称一律死锁为纯黑色 */
.market-table .market-row *,
.market-list .market-row *,
.home-market-table * [data-search],
.market-row span:first-child,
.market-row .name {
    color: #1c1c1e !important;
}

/* 3. 强行锁定最新价格：彻底废除实时刷新脚本带有的 .price-up / .price-down 的颜色属性，死锁为纯黑色 */
.market-table .market-row [data-live-change],
.market-list .market-row [data-live-change],
.market-row .price-up,
.market-row .price-down,
.market-row .price,
.market-row span:nth-child(2),
[data-live-change] {
    color: #1c1c1e !important;
}

/* 4. 再次稳固涨跌幅百分比：防止被动态刷新的样式冲掉（确保红绿底色+白字稳定） */
.market-table .market-row [data-live-badge].price-up,
.market-list [data-live-badge].price-up,
span[data-live-badge].price-up {
    background-color: #00b97a !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    min-width: 65px !important;
    text-align: center !important;
}
.market-table .market-row [data-live-badge].price-down,
.market-list [data-live-badge].price-down,
span[data-live-badge].price-down {
    background-color: #ff3b30 !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    min-width: 65px !important;
    text-align: center !important;
}
/* ========================================================
   🎯 2. 全站底部导航栏（Tabbar）纯字体高亮微调
   ======================================================== */
/* 💡 默认状态（未选择）：仅将纯文字字体统一为舒服的高级灰色 */
.tabbar a, 
.tabbar a span {
    color: #999999 !important;
}

/* 💡 选中状态（Active）：当选择到当前页面后，字体和图标变深色一些 */
.tabbar a.active,
.tabbar a.active span {
    color: #1c1c1e !important;       /* 仅文字变成纯黑色 */
    font-size: 1.01em !important;     /* 仅文字极细微放大，图标细微放大 */
    font-weight: 600 !important;      /* 仅文字微调加粗 */
}
