:root {
  --bg: #000000;
  --ink: #f5f5f5;
  --muted: #8a8a8a;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

body {
  overflow: hidden;
  background: #000000;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  background: #000000;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000000;
}

.screen[hidden],
[hidden] {
  display: none !important;
}

.pin-screen {
  padding: max(56px, calc(env(safe-area-inset-top) + 28px)) 24px
    max(12px, env(safe-area-inset-bottom));
  animation: fadeUp 0.45s ease both;
}

.pin-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-panel.shake {
  animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

h1 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #f2f2f2;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.25px rgba(255, 255, 255, 0.35);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dot.filled {
  background: #ffffff;
  box-shadow: none;
  transform: scale(1.08);
}

.error {
  min-height: 1em;
  margin: 0 0 6px;
  color: #b5b5b5;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.error.is-visible {
  opacity: 1;
  transform: none;
}

.keypad {
  margin-top: auto;
  width: min(100%, 280px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 10px;
  padding-bottom: 28px;
  transform: translateY(-36px);
}

.key {
  appearance: none;
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 56px;
  margin: 0 auto;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 400;
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  background: transparent;
  box-shadow: none;
  outline: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.key:active {
  opacity: 0.55;
  transform: scale(0.96);
}

.key.spacer {
  visibility: hidden;
  pointer-events: none;
}

.home-screen {
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #000000;
  animation: fadeUp 0.35s ease both;
  overflow: hidden;
}

.tab-pages {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  overflow: hidden;
  background: #000000;
}

.tab-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: max(20px, calc(env(safe-area-inset-top) + 12px)) 18px 18px;
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  background: #000000;
}

.tab-page.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#page-balance.tab-page {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 12px));
}

#page-history.tab-page {
  /* Scroll the whole history tab — nested flex scroll clips on iOS */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
  padding-bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px));
}

/* Balance */
.balance-card {
  appearance: none;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  width: 100%;
  align-self: stretch;
  margin-top: 8px;
  padding: 20px 22px;
  background: #0f0f0f;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.balance-card:active {
  transform: translateY(0);
  background: #141414;
  border-color: #3a3a3a;
}

.balance-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 10px;
}

.balance-refresh-hint {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #5a5a5a;
  opacity: 0.9;
}

.balance-card.is-refreshing .balance-refresh-hint {
  color: #bdbdbd;
}

.balance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 2.5rem;
}

.balance-amount {
  display: block;
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  transition: opacity 0.18s ease;
  word-break: break-all;
}

.balance-multi {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.balance-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.balance-line span {
  color: #8a8a8a;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.balance-line strong {
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  word-break: break-all;
  text-align: left;
}

.balance-loader {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #333333;
  border-top-color: #ffffff;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.balance-loader.is-on {
  opacity: 1;
  animation: spin 0.55s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.balance-hint {
  margin: auto 0 8px;
  text-align: center;
  color: #666666;
  font-size: 0.82rem;
}

/* Profile */
.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}

.avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.avatar-fallback {
  color: transparent;
  font-size: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 50%;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-meta {
  min-width: 0;
  padding-top: 2px;
}

.profile-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user {
  appearance: none;
  display: inline-block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: #9a9a9a;
  text-align: left;
  cursor: default;
}

.profile-user.is-link {
  color: #2aabee;
  cursor: pointer;
}

.profile-user.is-link:active {
  opacity: 0.75;
}

.profile-id {
  appearance: none;
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  color: #6f6f6f;
  text-align: left;
  cursor: pointer;
}

.profile-id:active {
  color: #ffffff;
}

.wallet-block {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  margin-top: 22px;
  margin-bottom: 0;
  padding-top: 18px;
  border-top: 1px solid #1a1a1a;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.wallet-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.wallet-value {
  appearance: none;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 12px 12px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #111111;
  color: #eaeaea;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.wallet-value.is-masked {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  max-height: none;
  letter-spacing: 0.12em;
}

.wallet-value:active {
  background: #181818;
}

.wallet-eye {
  appearance: none;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #111111;
  color: #d0d0d0;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.wallet-eye svg {
  width: 20px;
  height: 20px;
  grid-area: 1 / 1;
}

.wallet-eye .icon-show,
.wallet-eye .icon-hide {
  display: none;
}

.wallet-eye.is-hidden .icon-show {
  display: block;
}

.wallet-eye.is-visible .icon-hide {
  display: block;
}

.wallet-eye:active {
  background: #181818;
}

.toast {
  margin: 14px 0 0;
  text-align: center;
  color: #bdbdbd;
  font-size: 0.82rem;
  min-height: 1.1em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.is-on {
  opacity: 1;
}

.flash-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 12000;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(22, 22, 22, 0.94);
  border: 1px solid #333;
  color: #f2f2f2;
  font-family: "Outfit", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(-50%) translateY(18px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.flash-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.change-pin-btn {
  appearance: none;
  margin-top: 20px;
  width: 100%;
  flex-shrink: 0;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px 16px;
  background: #111111;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.change-pin-btn:active {
  background: #1a1a1a;
  transform: scale(0.99);
}

.auth-hint {
  margin: 0;
  text-align: center;
  font-size: 0.7rem;
  color: #6a6a6a;
  line-height: 1.3;
}

.tabbar {
  position: sticky;
  bottom: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 2px;
  padding: 10px 8px max(12px, env(safe-area-inset-bottom));
  background: #000000;
  border-top: 1px solid #1a1a1a;
  z-index: 5;
}

.tabbar .tab {
  font-size: 0.62rem;
  padding: 6px 2px;
  gap: 3px;
}

.stocks-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #0d0d0d;
}

.stocks-count-label {
  color: #eaeaea;
  font-size: 0.85rem;
  font-weight: 500;
}

.stocks-count-bar .trading-sec-count {
  color: #9a9a9a;
  font-size: 0.85rem;
}

.trading-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.trading-head {
  flex-shrink: 0;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.trading-head-main {
  min-width: 0;
  flex: 1;
}

.trading-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.trading-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #7a7a7a;
}

.trading-head-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 52%;
  min-width: 0;
}

@media (max-width: 640px) {
  .tab-page {
    padding: max(14px, calc(env(safe-area-inset-top) + 8px)) 12px 12px;
  }

  .trading-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .trading-head-right {
    max-width: 100%;
    width: 100%;
    align-items: stretch;
  }

  .trading-sort,
  .seg-control {
    width: 100%;
  }

  .trading-sort .seg-group {
    flex: 1;
    min-width: 0;
  }

  .trading-sort .seg-group .seg-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    font-size: 0.68rem;
  }

  .trading-added {
    text-align: left;
  }

  .seg-group-row {
    flex-wrap: nowrap;
  }

  .seg-group-row .seg-btn {
    padding: 9px 4px;
    font-size: 0.72rem;
  }

  .trading-title {
    font-size: 1.1rem;
  }

  .trading-sub {
    font-size: 0.72rem;
  }

  .trading-sec {
    padding: 7px 2px;
    font-size: 0.68rem;
  }

  .trading-row {
    grid-template-columns: 24px minmax(0, 1fr) minmax(64px, auto) minmax(40px, 0.7fr);
    gap: 6px;
    padding: 8px 8px;
  }

  .trading-price {
    font-size: 0.72rem;
  }

  .trading-chg {
    font-size: 0.62rem;
  }
}

.trading-sort {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trading-added {
  margin: 0;
  max-width: 100%;
  text-align: right;
  font-size: 0.62rem;
  line-height: 1.25;
  color: #6a6a6a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.is-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.seg-control {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.trading-sort .seg-group .seg-btn {
  padding: 7px 8px;
  font-size: 0.64rem;
}

@media (max-width: 380px) {
  .trading-sort .seg-group .seg-btn {
    padding: 6px 5px;
    font-size: 0.58rem;
  }
}

.seg-group {
  display: inline-flex;
  align-items: stretch;
  padding: 3px;
  gap: 2px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #0a0a0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.seg-group-row {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  margin: 0 0 12px;
  box-sizing: border-box;
}

.seg-group-row .seg-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  font-size: 0.78rem;
}

.seg-btn {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: transparent;
  color: #8a8a8a;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.seg-btn:hover {
  color: #d0d0d0;
}

.seg-btn.is-active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.seg-btn:active {
  transform: scale(0.98);
}

.seg-dir {
  appearance: none;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #2a2a2a;
  border-radius: 11px;
  background: linear-gradient(180deg, #161616 0%, #0e0e0e 100%);
  color: #f0f0f0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.seg-dir:hover {
  border-color: #3a3a3a;
}

.seg-dir:active {
  background: #1a1a1a;
}

.trading-price {
  transition: color 0.2s ease;
}

.trading-price.flash-up {
  animation: priceFlashUp 0.7s ease;
}

.trading-price.flash-down {
  animation: priceFlashDown 0.7s ease;
}

@keyframes priceFlashUp {
  0% { color: #3dcf8e; }
  100% { color: #ffffff; }
}

@keyframes priceFlashDown {
  0% { color: #ef6b6b; }
  100% { color: #ffffff; }
}

.trading-sections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.trading-sec {
  appearance: none;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 8px 4px;
  background: #0d0d0d;
  color: #8a8a8a;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
}

.trading-sec-label {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trading-sec-count {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 400;
  color: #5a5a5a;
  line-height: 1;
}

.trading-sec.is-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.trading-sec.is-active .trading-sec-count {
  color: #9a9a9a;
}

.trading-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #0d0d0d;
  color: #f0f0f0;
  font-size: 0.92rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.trading-search::placeholder {
  color: #6a6a6a;
}

.trading-search:focus {
  border-color: #3a3a3a;
}

.trading-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}

.trading-pinned {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.trading-pinned:empty {
  display: none;
  margin: 0;
}

.trading-virt {
  position: relative;
  width: 100%;
}

.trading-virt-space {
  width: 1px;
  pointer-events: none;
}

.trading-virt-window {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  will-change: transform;
}

.trading-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.15fr) minmax(72px, auto) minmax(52px, 0.75fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  background: #0d0d0d;
  min-width: 0;
  height: 64px;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.trading-row:active {
  background: #121212;
}

.trading-row.is-pinned {
  border-color: #3a3420;
  background: #12100a;
}

.trading-star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 28px;
  height: 28px;
  font-size: 1.35rem;
  line-height: 1;
  color: #3a3a3a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trading-star.is-on {
  color: #f0c14b;
}

.trading-star:active {
  transform: scale(0.92);
}

.trading-meta {
  min-width: 0;
}

.trading-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trading-symbol {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: #7a7a7a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trading-spark {
  width: 100%;
  height: 28px;
  display: block;
  overflow: visible;
}

.trading-price-wrap {
  text-align: left;
  min-width: 0;
  justify-self: start;
}

.trading-price {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.trading-chg {
  margin: 2px 0 0;
  font-size: 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.trading-chg.up { color: #3dcf8e; }
.trading-chg.down { color: #ef6b6b; }
.trading-chg.flat { color: #7a7a7a; }

.trading-status {
  flex-shrink: 0;
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: #6a6a6a;
  text-align: center;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.tab-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.tab-icon svg {
  width: 20px;
  height: 20px;
}

.tab.is-active {
  color: #ffffff;
}

.tab:active {
  transform: scale(0.96);
}

/* Onboarding — one step at a time, sequential reveal */
.onboarding-screen {
  align-items: stretch;
  justify-content: stretch;
  padding: max(28px, calc(env(safe-area-inset-top) + 20px)) 24px
    max(24px, env(safe-area-inset-bottom));
}

.onboard-stage {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.onboard-step {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.onboard-step.is-active {
  display: flex;
}

.onboard-center {
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.onboard-logo {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.onboard-logo.small {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}

.onboard-title {
  margin: 22px 0 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.onboard-sub {
  margin: 8px 0 0;
  color: #8a8a8a;
  font-size: 0.98rem;
}

.onboard-text {
  margin: 18px 0 0;
  color: #b5b5b5;
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 34ch;
}

.onboard-check {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #9a9a9a;
  font-size: 0.9rem;
  cursor: pointer;
}

.onboard-check input {
  width: 18px;
  height: 18px;
  accent-color: #ffffff;
}

.onboard-btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.onboard-btn:active {
  opacity: 0.88;
  transform: scale(0.99);
}

.onboard-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.seq {
  opacity: 0;
  transform: translateY(12px);
}

.seq.is-in {
  animation: seqIn 0.42s ease forwards;
}

@keyframes seqIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.primary-btn,
.ghost-btn,
.danger-btn,
.seg-btn,
.tab,
.hi-summary,
.trade-stop-btn,
.chart-buy-btn,
.chart-sell-btn,
.trading-row,
.legal-link {
  touch-action: manipulation;
}

.primary-btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn:active {
  opacity: 0.88;
}

.primary-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
  letter-spacing: 0.02em;
}

.balance-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.transfer-btn {
  margin-top: 0;
}

.send-stocks-btn {
  width: 100%;
}

.stock-portfolio {
  margin-top: 22px;
  min-width: 0;
}

.stock-portfolio-head {
  margin-bottom: 10px;
}

.stock-portfolio-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f2f2f2;
  letter-spacing: -0.02em;
}

.stock-portfolio-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: #7a7a7a;
}

.stock-portfolio-sub.is-up {
  color: #0ecb81;
}

.stock-portfolio-sub.is-down {
  color: #f6465d;
}

.stock-portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stock-hold-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #222;
  border-radius: 14px;
  background: #0c0c0c;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}

.stock-hold-card:active {
  background: #121212;
}

.stock-hold-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.stock-hold-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stock-hold-sym {
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}

.stock-hold-meta {
  font-size: 0.72rem;
  color: #8a8a8a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.stock-hold-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 0;
  flex-shrink: 0;
}

.stock-hold-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 500;
  color: #f0f0f0;
  white-space: nowrap;
}

.stock-hold-pnl {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.stock-hold-cost {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: #7a7a7a;
  white-space: nowrap;
}

.stock-hold-last {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: #848e9c;
  white-space: nowrap;
}

.stock-portfolio-sub {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.stock-hold-pnl.is-up {
  color: #0ecb81;
}

.stock-hold-pnl.is-down {
  color: #f6465d;
}

.stock-hold-spark {
  width: 100%;
  height: 28px;
  display: block;
}

.stock-buy-card {
  width: min(100%, 400px);
}

.stock-buy-price {
  margin: -6px 0 12px;
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: #cfcfcf;
  font-size: 0.9rem;
}

.stock-buy-avail {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #8a8a8a;
}

.stock-buy-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.stock-buy-col .field-input {
  margin-top: 4px;
}

.stock-buy-preview {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: #a8a8a8;
  line-height: 1.4;
  min-height: 2.4em;
}

.ghost-btn {
  appearance: none;
  flex: 1;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 12px;
  background: #111111;
  color: #ffffff;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}

.danger-btn {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  flex-shrink: 0;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  padding: 14px 16px;
  background: #1a1010;
  color: #f0d0d0;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.profile-scroll {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  min-height: 0;
  padding-bottom: 28px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-card {
  margin-top: 20px;
  margin-bottom: 4px;
  border: 1px solid #222222;
  border-radius: 16px;
  background: #0f0f0f;
  overflow: hidden;
  position: relative;
  z-index: 0;
  flex-shrink: 0;
}

.history-card.is-open {
  animation: historyPulse 0.28s ease;
}

@keyframes historyPulse {
  from {
    transform: scale(0.985);
    opacity: 0.92;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.history-head {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.history-head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.history-preview {
  font-size: 0.78rem;
  color: #8a8a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-chevron {
  color: #8a8a8a;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.history-card.is-open .history-chevron {
  transform: rotate(180deg);
}

.history-body {
  border-top: 1px solid #1c1c1c;
  padding: 12px 12px 14px;
  animation: historyBodyIn 0.22s ease;
}

@keyframes historyBodyIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.h-filter {
  appearance: none;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 7px 10px;
  background: #141414;
  color: #8a8a8a;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.h-filter.is-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.history-page {
  flex: none;
  min-height: min-content;
  height: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: visible;
}

.history-page-head {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.history-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #ffffff;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.history-list-page {
  flex: none;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-bottom: 12px;
}

#page-history .history-filters {
  flex-shrink: 0;
  flex-wrap: wrap;
}

#page-history .danger-btn {
  margin-top: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.history-empty {
  margin: 0;
  color: #555555;
  font-size: 0.85rem;
  padding: 8px 2px;
}

.history-item {
  appearance: none;
  display: block;
  width: 100%;
  border: 1px solid #242424;
  border-radius: 12px;
  padding: 0;
  background: #121212;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
}

.history-item.is-open {
  border-color: #3a3a3a;
  background: #161616;
}

.history-item .hi-summary {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.history-item .hi-summary-left {
  min-width: 0;
  flex: 1;
}

.history-item .hi-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 0.86rem;
}

.history-item .hi-chevron {
  color: #777777;
  font-size: 0.75rem;
}

.history-item .hi-type {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.history-item .hi-wallet-mask {
  margin: 5px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #7a7a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .hi-user-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #2aabee;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.history-item .hi-hide {
  appearance: none;
  margin-top: 4px;
  width: 100%;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 10px;
  background: #101010;
  color: #cfcfcf;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.history-item .hi-party-val {
  font-family: inherit !important;
  font-size: 0.8rem !important;
  word-break: break-word;
}

.history-item .hi-details {
  border-top: 1px solid #222222;
  padding: 10px 12px 12px;
  animation: historyBodyIn 0.2s ease;
}

.history-item .hi-wallet,
.history-item .hi-party,
.history-item .hi-time,
.history-item .hi-comment {
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.78rem;
}

.history-item .hi-wallet:last-child,
.history-item .hi-party:last-child,
.history-item .hi-time:last-child,
.history-item .hi-comment:last-child {
  margin-bottom: 0;
}

.history-item .hi-details span {
  color: #6f6f6f;
}

.history-item .hi-details strong {
  color: #eaeaea;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}

.history-item .hi-party strong,
.history-item .hi-time strong,
.history-item .hi-comment strong {
  font-family: inherit;
  font-size: 0.8rem;
}

.anon-row {
  margin: 14px 0 4px;
  padding: 12px 12px;
  border: 1px solid #242424;
  border-radius: 12px;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anon-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anon-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
}

.anon-sub {
  font-size: 0.72rem;
  color: #777777;
}

.switch {
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: #2a2a2a;
  cursor: pointer;
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
}

.switch.is-on {
  background: #ffffff;
}

.switch.is-on::after {
  transform: translateX(18px);
  background: #000000;
}

.transfer-screen {
  align-items: stretch;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: max(12px, calc(env(safe-area-inset-top) + 8px)) 16px 0;
}

.tx-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.tx-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.tx-back {
  appearance: none;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.tx-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.amount-display {
  margin: 0 0 10px;
  min-height: 2.4rem;
  padding: 12px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: #111111;
  color: #ffffff;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  word-break: break-all;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.amount-symbol {
  color: #9a9a9a;
  font-size: 1.05rem;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.amount-digits {
  color: #ffffff;
}

.amount-keypad {
  margin: 0 auto 12px;
  width: min(100%, 260px);
  transform: none;
  padding-bottom: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 8px;
}

.amount-keypad .key {
  height: 46px;
  font-size: 1.2rem;
}

.amount-keypad .key-soft {
  color: #cfcfcf;
}

.tx-step {
  display: none;
  flex-direction: column;
  width: 100%;
}

.tx-step.is-active {
  display: flex;
  padding-bottom: 8px;
}

.field-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.field-input {
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.field-area {
  resize: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-all;
}

.field-error {
  margin: -6px 0 12px;
  color: #cfcfcf;
  font-size: 0.8rem;
}

.tx-to {
  margin: 0 0 14px;
  color: #9a9a9a;
  font-size: 0.82rem;
  word-break: break-all;
}

.tx-to span {
  color: #d0d0d0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.currency-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  appearance: none;
  flex: 1;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 10px 8px;
  background: #111111;
  color: #9a9a9a;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.pill.is-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.confirm-card {
  border: 1px solid #222222;
  border-radius: 14px;
  padding: 14px;
  background: #0f0f0f;
  margin-bottom: 16px;
}

.confirm-card p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.confirm-card p:last-child {
  margin-bottom: 0;
}

.confirm-card span {
  color: #7a7a7a;
}

.confirm-card strong {
  color: #ffffff;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.success-box {
  margin: auto 0;
  text-align: center;
}

.success-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #ffffff;
}

.success-sub {
  margin: 10px 0 0;
  color: #8a8a8a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 340px);
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 18px;
  background: #0f0f0f;
}

.themed-sheet {
  position: relative;
  overflow: hidden;
  background: #050505;
}

.themed-sheet-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #050505;
}

.themed-sheet-bg.is-photo {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.themed-sheet-bg.is-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.62) 100%);
  pointer-events: none;
}

.themed-sheet-body {
  position: relative;
  z-index: 1;
}

.site-legal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px 2px;
  background: #000000;
  border-top: 1px solid #141414;
}

.profile-legal {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #1a1a1a;
  text-align: center;
}

.legal-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7a7a7a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 6px 8px;
}

.legal-link:active {
  color: #c8c8c8;
}

.privacy-card {
  width: min(100%, 420px);
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.privacy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.privacy-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0f0f0;
}

.privacy-close-x {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  flex-shrink: 0;
}

.privacy-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 14px;
  padding-right: 4px;
}

.privacy-body p {
  margin: 0 0 12px;
  color: #c8c8c8;
  font-size: 0.82rem;
  line-height: 1.45;
}

.privacy-body p:last-child {
  margin-bottom: 0;
}

.history-item-trade .hi-trade-detail {
  margin: 0;
  padding: 8px 12px 10px;
  color: #8a8a8a;
  font-size: 0.72rem;
  line-height: 1.4;
  border-top: 1px solid #1e1e1e;
}

.modal-text {
  margin: 0 0 16px;
  color: #eaeaea;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .danger-btn {
  flex: 1;
  margin-top: 0;
}

.tx-step .primary-btn {
  margin-top: 8px;
  flex-shrink: 0;
}

.settings-block {
  width: 100%;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pin-status {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #bdbdbd;
  font-size: 0.82rem;
  line-height: 1.35;
}

.pin-check {
  color: #ffffff;
  font-weight: 700;
  flex-shrink: 0;
}

.pin-remember-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #d0d0d0;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 8px 0 12px;
}

.pin-remember-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.pin-setup-step {
  margin: -6px 0 12px;
  text-align: center;
  color: #8a8a8a;
  font-size: 0.78rem;
}

.pin-warn-body {
  margin: 0 0 12px;
  color: #bdbdbd;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.pin-warn-timer {
  margin: 0 0 14px;
  text-align: center;
  color: #8a8a8a;
  font-size: 0.85rem;
}

.support-block {
  margin-bottom: 4px;
}

.support-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 12px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #111111;
  text-align: center;
}

.support-link:active {
  background: #1a1a1a;
}

.currency-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.currency-picker {
  position: relative;
  margin-bottom: 14px;
  z-index: 20;
}

.currency-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  appearance: none;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: linear-gradient(180deg, #161616 0%, #0e0e0e 100%);
  color: #f2f2f2;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.currency-picker-btn:active,
.currency-picker.is-open .currency-picker-btn {
  border-color: #4a4a4a;
  background: #141414;
}

.currency-picker-code {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 2.6em;
}

.currency-picker-bal {
  flex: 1;
  color: #8a8a8a;
  font-size: 0.86rem;
  font-family: "IBM Plex Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-picker-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.18s ease;
}

.currency-picker.is-open .currency-picker-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.currency-picker-menu {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px;
  position: absolute;
  left: 0;
  right: 0;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: #0c0c0c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
  animation: currencyMenuIn 0.16s ease;
}

.currency-picker-menu[hidden] {
  display: none !important;
}

@keyframes currencyMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.currency-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #eaeaea;
  padding: 12px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.currency-picker-item:active,
.currency-picker-item.is-active {
  background: #1a1a1a;
}

.currency-picker-item .cpi-code {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.currency-picker-item .cpi-bal {
  color: #8a8a8a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.currency-picker-item .cpi-sym {
  color: #666;
  font-size: 0.8rem;
  min-width: 2.2em;
  text-align: right;
}

.balance-multi {
  max-height: min(48vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.balance-multi::-webkit-scrollbar,
.tx-scroll::-webkit-scrollbar,
.profile-scroll::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.lang-switch {
  display: flex;
  align-items: stretch;
  padding: 3px;
  gap: 2px;
  margin: 4px 0 2px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #0a0a0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lang-btn {
  appearance: none;
  flex: 1;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8a8a8a;
  padding: 11px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.lang-btn:hover {
  color: #d0d0d0;
}

.lang-btn.is-active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.captcha-code {
  margin: 0;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
  letter-spacing: 0.28em;
  color: #ffffff;
  padding: 10px 12px;
  border: 1px dashed #333;
  border-radius: 12px;
  background: #0c0c0c;
}

.captcha-honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}

.captcha-screen {
  justify-content: center;
  padding: max(40px, calc(env(safe-area-inset-top) + 20px)) 22px
    max(24px, env(safe-area-inset-bottom));
}

.captcha-panel {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.captcha-panel .auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  align-self: center;
  margin-bottom: 4px;
}

.captcha-q {
  margin: 4px 0 0;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.6rem;
  font-weight: 600;
  color: #ffffff;
}

.human-box {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  margin: 18px auto 12px;
  padding: 16px 18px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #222;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.human-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.human-box-ui {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.5px solid #5a5a5a;
  background: #0a0a0a;
  flex-shrink: 0;
  position: relative;
}

.human-box input:checked + .human-box-ui {
  border-color: #e8e8e8;
  background: #1a1a1a;
}

.human-box input:checked + .human-box-ui::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.human-box-text {
  color: #eaeaea;
  font-size: 0.95rem;
  font-weight: 500;
}

#captcha-continue:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* New Belarusian ruble (BYN) — crossed Cyrillic Б */
.byn-glyph {
  position: relative;
  display: inline-block;
  font-weight: 700;
  font-family: "Outfit", "Segoe UI", sans-serif;
  padding: 0 0.14em 0 0;
  line-height: 1;
  letter-spacing: 0.02em;
}

.byn-glyph::before,
.byn-glyph::after {
  content: "";
  position: absolute;
  left: 0.04em;
  width: 0.62em;
  border-top: 2px solid currentColor;
  pointer-events: none;
}

.byn-glyph::before {
  top: 48%;
}

.byn-glyph::after {
  top: 66%;
}

.history-item-compact .hi-summary {
  padding: 12px 14px;
}

.history-item-compact .hi-comment-inline {
  margin: 4px 0 0;
  color: #8a8a8a;
  font-size: 0.75rem;
  line-height: 1.3;
  word-break: break-word;
}

.history-item-stock {
  border-color: #2a2618;
  background: #100e08;
}

.history-item-stock.is-buy .hi-type {
  color: #f0c14b;
}

.history-item-stock .hi-summary-right strong.is-up {
  color: #3dd68c;
}

.history-item-stock .hi-summary-right strong.is-down {
  color: #ff5c5c;
}

.history-item-stock.is-sell .hi-type {
  color: #3dd68c;
}

.history-item-stock .hi-summary-right strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.settings-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.settings-sub {
  margin: 0;
  font-size: 0.8rem;
  color: #6a6a6a;
}

.settings-row {
  margin: 4px 0 2px;
}

.pin-unlock-screen {
  justify-content: center;
  padding: max(40px, calc(env(safe-area-inset-top) + 20px)) 22px
    max(24px, env(safe-area-inset-bottom));
}

.pin-unlock-panel {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.pin-unlock-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  align-self: center;
  margin-bottom: 6px;
}

.pin-unlock-title {
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.pin-unlock-sub {
  margin: 0 0 8px;
  text-align: center;
  color: #8a8a8a;
  font-size: 0.85rem;
}

.pin-unlock-input {
  text-align: center;
  letter-spacing: 0.18em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.1rem;
}

/* Auth / standalone site */
input,
textarea,
.field-input {
  -webkit-user-select: text;
  user-select: text;
}

.auth-screen {
  padding: max(48px, calc(env(safe-area-inset-top) + 24px)) 22px
    max(24px, env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 24px;
  animation: fadeUp 0.4s ease both;
}

.auth-hero {
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 18px;
}

.auth-brand {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.auth-tag {
  margin: 8px 0 0;
  color: #8a8a8a;
  font-size: 0.95rem;
}

.auth-actions {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-secondary {
  width: 100%;
  margin-top: 0;
}

.auth-top {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  margin-bottom: 8px;
}

.auth-top h2 {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 500;
  color: #f2f2f2;
}

.auth-form,
.reg-step {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.reg-step[hidden] {
  display: none !important;
}

.field-hint {
  margin: -4px 0 14px;
  color: #666666;
  font-size: 0.78rem;
  line-height: 1.35;
}

.auth-form .field-input,
.reg-step .field-input,
.modal-card .field-input {
  margin-bottom: 14px;
}

.auth-form .primary-btn,
.reg-step .primary-btn {
  margin-top: auto;
}

.reg-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 18px;
}

.reg-avatar-preview {
  width: 84px;
  height: 84px;
}

.reg-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.profile-avatar-btn {
  width: 100%;
  margin-top: 14px;
}

.logout-btn {
  margin-top: 10px;
}

.modal-card .field-label {
  text-align: left;
}

.modal-card .field-input {
  margin-bottom: 10px;
}

.modal-actions .primary-btn,
.modal-actions .ghost-btn {
  flex: 1;
  margin-top: 0;
}

.auth-secondary.ghost-btn,
.file-btn.ghost-btn {
  flex: none;
  width: 100%;
  background: transparent;
}

.chart-screen {
  align-items: stretch;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: max(10px, calc(env(safe-area-inset-top) + 6px)) 12px max(10px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.chart-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.trade-mode-seg {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  margin: 0 0 12px;
  box-sizing: border-box;
}

.trade-mode-seg .seg-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.01em;
}

.trade-bs-bar {
  display: none !important;
}

.trade-bs-bar[hidden] {
  display: none !important;
}

.trade-bs-btn {
  margin: 0;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: #141414;
  color: #f0f0f0;
}

.trade-bs-btn.is-buy {
  background: rgba(14, 203, 129, 0.16);
  border-color: rgba(14, 203, 129, 0.45);
  color: #3dd68c;
}

.trade-bs-btn.is-sell {
  background: rgba(255, 92, 92, 0.12);
  border-color: rgba(255, 92, 92, 0.4);
  color: #ff7a7a;
}

.sim-trade-side {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a8a8a;
}

.sim-trade-side.is-up {
  color: #3dd68c;
}

.sim-trade-side.is-down {
  color: #ff7a7a;
}

.trade-stop-bar {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  margin-top: 10px;
  padding: 0 0 max(4px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-stop-bar[hidden] {
  display: none !important;
}

.trade-stop-meta {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #0d0d0d;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.trade-stop-meta.is-up {
  color: #3dd68c;
  border-color: rgba(14, 203, 129, 0.35);
}

.trade-stop-meta.is-down {
  color: #ff7a7a;
  border-color: rgba(255, 92, 92, 0.35);
}

.trade-stop-btn {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 92, 92, 0.45);
  background: linear-gradient(180deg, #3a1212 0%, #1a0a0a 100%);
  color: #ff8f8f;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.trade-stop-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chart-buy-btn.is-sim-up {
  background: #0ecb81;
  border-color: #0ecb81;
  color: #04140c;
}

.chart-sell-btn.is-sim-down {
  background: rgba(255, 92, 92, 0.18);
  border-color: rgba(255, 92, 92, 0.5);
  color: #ff8f8f;
}

.profit-bg-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #7a7a7a;
}

.profit-bg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.profit-bg-actions .ghost-btn,
.profit-bg-actions .file-btn {
  flex: 1 1 140px;
  width: auto;
  margin: 0;
}

.profit-bg-colors {
  margin-top: 4px;
  opacity: 0.85;
}

.profit-card-bg.is-photo {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.profit-card-bg.is-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.chart-heading {
  flex: 1;
  min-width: 0;
}

.chart-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #7a7a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-type-seg {
  flex-shrink: 0;
}

.chart-type-seg .seg-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-tf-scroll {
  flex-shrink: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chart-tf-scroll::-webkit-scrollbar {
  display: none;
}

.chart-tf-seg {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.chart-tf-seg .seg-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px;
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-align: center;
}

.chart-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid #1e2329;
  border-radius: 14px;
  background: #0b0e11;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.chart-top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chart-zoom {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #0a0a0a;
}

.chart-zoom-btn {
  appearance: none;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f0f0f0;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-zoom-btn:hover {
  background: #161616;
}

.chart-zoom-btn:active {
  background: #ffffff;
  color: #000000;
}

@media (max-width: 640px) {
  .chart-screen {
    padding: max(8px, calc(env(safe-area-inset-top) + 4px)) 10px max(8px, env(safe-area-inset-bottom));
  }

  .chart-top {
    gap: 8px;
  }

  .chart-title {
    font-size: 0.95rem;
  }

  .chart-tf-seg .seg-btn {
    padding: 7px 8px;
    font-size: 0.68rem;
  }

  .chart-price-bar {
    padding: 12px 14px;
  }

  .chart-price-value {
    font-size: 0.95rem;
  }
}

.chart-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-lw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Hide TradingView attribution watermark from lightweight-charts */
.chart-lw a#tv-attr-logo,
.chart-lw a[href*="tradingview"],
.chart-stage a[href*="tradingview"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

.hi-side {
  font-weight: 700;
  margin-right: 4px;
}

.hi-side.is-buy-side {
  color: #0ecb81;
}

.hi-side.is-sell-side {
  color: #f6465d;
}

.asset-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid #222;
  border-radius: 12px;
  background: #0a0a0a;
}

.asset-pick-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #f0f0f0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.asset-pick-btn:hover {
  background: #141414;
}

.asset-pick-btn.is-active {
  background: #1a1a1a;
  border-color: #2a2a2a;
}

.asset-pick-sym {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.asset-pick-qty {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: #848e9c;
}

.history-item-axiom {
  border: 1px solid #1e2329;
  border-radius: 12px;
  background: #0b0e11;
  overflow: hidden;
}

.history-item-axiom .hi-axiom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.ax-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.ax-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ax-badge.is-buy {
  color: #0ecb81;
  background: rgba(14, 203, 129, 0.12);
}

.ax-badge.is-sell {
  color: #f6465d;
  background: rgba(246, 70, 93, 0.12);
}

.ax-sym {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f5f5f5;
  letter-spacing: -0.02em;
}

.ax-meta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  color: #848e9c;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

@media (max-width: 640px) {
  .history-item-axiom .hi-axiom {
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
  }

  .ax-left {
    flex: 1;
    min-width: 0;
  }

  .ax-right {
    max-width: 46%;
  }

  .ax-right strong {
    font-size: 0.86rem;
    overflow-wrap: anywhere;
  }

  .ax-sym {
    font-size: 0.9rem;
  }
}

.profit-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
}

.profit-overlay[hidden] {
  display: none !important;
}

.profit-card {
  position: relative;
  width: min(100%, 360px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 18px 16px;
  color: #f5f5f5;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  background: #050505;
}

.profit-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #050505;
}

.profit-card > *:not(.profit-card-bg) {
  position: relative;
  z-index: 1;
}

.profit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
}

.profit-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.profit-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.profit-brand-name,
.profit-brand-mark {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.profit-brand-mark {
  opacity: 0.92;
  flex-shrink: 0;
}

.profit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: #0ecb81;
  color: #04140c;
  margin-bottom: 18px;
  box-shadow: 0 0 0 1px rgba(14, 203, 129, 0.35), 0 10px 28px rgba(14, 203, 129, 0.25);
}

.profit-pill.is-down {
  background: #f6465d;
  color: #1a0508;
  box-shadow: 0 0 0 1px rgba(246, 70, 93, 0.35), 0 10px 28px rgba(246, 70, 93, 0.22);
}

.profit-pill-cur {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.profit-pill-amt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.profit-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.profit-stat {
  min-width: 0;
}

.profit-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 4px;
}

.profit-stat-val {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f0f0f0;
  overflow-wrap: anywhere;
}

.profit-stat-val.is-up {
  color: #0ecb81;
}

.profit-stat-val.is-down {
  color: #f6465d;
}

.profit-sym-line {
  margin: 0 0 18px;
  font-size: 0.78rem;
  color: #848e9c;
}

.profit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profit-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.profit-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.profit-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profit-avatar-fb {
  font-size: 0.85rem;
  font-weight: 700;
  color: #bbb;
}

.profit-user-meta {
  min-width: 0;
}

.profit-user-name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profit-user-sub {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: #6a6a6a;
}

.profit-close-btn {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f0f0f0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.stock-hold-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

.ax-right {
  flex-shrink: 0;
  text-align: right;
}

.ax-right strong {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
}

.ax-right strong.is-up {
  color: #0ecb81;
}

.ax-right strong.is-down {
  color: #f6465d;
}

.history-item-bn .hi-type {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.history-item-bn .hi-wallet-mask {
  font-size: 0.72rem;
  color: #848e9c;
}

.chart-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a6a6a;
  font-size: 0.85rem;
  pointer-events: none;
}

.chart-price-bar {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: #0d0d0d;
  min-width: 0;
  isolation: isolate;
}

.chart-price-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  /* Keep price text from covering Buy/Trade hit targets */
  pointer-events: none;
}

.chart-trade-actions {
  position: relative;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  pointer-events: auto;
}

.chart-buy-btn,
.chart-sell-btn {
  position: relative;
  z-index: 7;
  flex-shrink: 0;
  width: auto;
  min-width: 76px;
  margin: 0;
  padding: 10px 14px;
  pointer-events: auto;
}

.chart-sell-btn {
  flex: 0 0 auto;
}

.chart-price-change {
  margin-top: 2px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.chart-price-change.is-up {
  color: #3dd68c;
}

.chart-price-change.is-down {
  color: #ff5c5c;
}

.stock-sell-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.stock-sell-quick .seg-btn {
  width: 100%;
  padding: 8px 4px;
  font-size: 0.75rem;
}

.chart-price-label {
  color: #8a8a8a;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.chart-price-value {
  color: #ffffff;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  transition: color 0.15s ease;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-price-change {
  font-size: 0.85rem;
  font-weight: 600;
}
