/* Apexora logo — square wordmark; size by context (max-height, not width) */
.apexora-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.apexora-logo--trade {
  max-height: 2rem;
  max-width: 5.5rem;
}
.apexora-logo--header {
  max-height: 2.25rem;
  max-width: 6.5rem;
}
@media (min-width: 640px) {
  .apexora-logo--header {
    max-height: 2.5rem;
    max-width: 7.5rem;
  }
  .apexora-logo--trade {
    max-height: 2.25rem;
    max-width: 6rem;
  }
}
.apexora-logo--hero {
  max-height: 9rem;
  max-width: 14rem;
  margin-left: auto;
  margin-right: auto;
  object-position: center center;
}
@media (min-width: 640px) {
  .apexora-logo--hero {
    max-height: 11rem;
    max-width: 18rem;
  }
}
.apexora-logo--modal {
  max-height: 4.5rem;
  max-width: 9rem;
  margin-left: auto;
  margin-right: auto;
  object-position: center center;
}
.trade-header-inner > a:first-child {
  flex-shrink: 1;
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
}

/* Trade terminal — locked viewport; chart flex-fills space between header and controls */
html.trade-viewport,
html.trade-viewport body.trade-page {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.trade-page {
  overflow: hidden;
  overscroll-behavior: none;
}

body.trade-page footer {
  display: none !important;
}

.trade-shell {
  background: #0f0f11;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100dvh;
  height: 100svh;
  max-height: 100dvh;
  max-height: 100svh;
  min-height: 0;
}

.trade-main-row {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.trade-board {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.trade-chart-area {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.trade-chart-area canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.trade-controls {
  flex: 0 0 auto;
  flex-shrink: 0;
  background: #141416;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

@media (max-width: 1023px) {
  html.pwa-standalone,
  html.pwa-standalone body.trade-page {
    height: 100%;
    min-height: 100dvh;
    min-height: 100svh;
    min-height: -webkit-fill-available;
  }

  .trade-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .trade-stake-row { padding-top: 0.375rem; padding-bottom: 0.375rem; }
  .trade-stake-row .input-field,
  .trade-stake-row #stake-input { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 1.125rem; }
  .trade-quick-row { padding-bottom: 0.375rem; }
  .trade-quick-row button { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.8125rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .trade-quick-btn { cursor: pointer; user-select: none; }
  .trade-action-row { gap: 0.375rem; }
  .trade-action-btn { padding-top: 0.625rem; padding-bottom: 0.625rem; font-size: 0.9375rem; }
  .trade-toolbar { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .demo-banner { padding-top: 0.25rem; padding-bottom: 0.25rem; font-size: 10px; }
  .chat-fab { bottom: calc(9.25rem + env(safe-area-inset-bottom, 0px)); }
  #toast-container { bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 1024px) {
  .trade-shell {
    height: 100dvh;
    height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
  }

  .chat-fab { display: none; }
}

.trade-header { flex-shrink: 0; border-bottom: 1px solid #2a2a2e; background: #1a1a1c; }
.trade-header-inner { display: flex; height: 3rem; align-items: center; justify-content: space-between; padding: 0 .75rem; }
@media (min-width: 640px) { .trade-header-inner { height: 3.5rem; padding: 0 1rem; } }
.trade-toolbar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #2a2a2e; background: #141416; padding: .375rem .75rem; }
.balance-pill { display: flex; align-items: center; gap: .375rem; border-radius: .5rem; background: #252528; padding: .25rem .5rem; text-decoration: none; color: inherit; cursor: pointer; }
@media (min-width: 640px) { .balance-pill { gap: .5rem; padding: .375rem .75rem; } }
.balance-avatar { display: flex; height: 1.75rem; width: 1.75rem; align-items: center; justify-content: center; border-radius: 9999px; background: #1a4d3a; color: #22c55e; }
@media (min-width: 640px) { .balance-avatar { height: 2rem; width: 2rem; } }
.demo-banner { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem .75rem; background: #3d3018; padding: .375rem .75rem; text-align: center; font-size: 11px; color: #e8c872; }
.demo-banner strong { color: #f0d060; font-weight: 600; }
.chat-desktop { display: none; min-height: 0; width: 18rem; flex-shrink: 0; align-self: stretch; flex-direction: column; overflow: hidden; }
@media (min-width: 1024px) { .chat-desktop { display: flex; } }
@media (min-width: 1280px) { .chat-desktop { width: 20rem; } }
.chat-fab { position: fixed; bottom: 5rem; right: .75rem; z-index: 40; display: flex; height: 2.75rem; width: 2.75rem; align-items: center; justify-content: center; border-radius: 9999px; background: #c49a2a; color: #000; box-shadow: 0 10px 25px rgba(0,0,0,.35); border: none; cursor: pointer; }
.chat-mobile-overlay { position: fixed; inset: 0; z-index: 50; }
.chat-mobile-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.chat-mobile-sheet { position: absolute; bottom: 0; left: 0; right: 0; z-index: 1; display: flex; height: min(85dvh, 640px); flex-direction: column; overflow: hidden; border-top-left-radius: 1rem; border-top-right-radius: 1rem; background: #0d0d0f; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.hidden { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.modal-panel { position: relative; max-height: 80vh; width: 100%; max-width: 28rem; overflow-y: auto; border-radius: .75rem; border: 1px solid var(--border); background: #1a1a1c; padding: 1.5rem; }
.toggle-track { position: relative; display: inline-flex; height: 1rem; width: 1.75rem; flex-shrink: 0; border-radius: 9999px; background: #3a3a3e; transition: background .2s; }
.toggle-track.toggle-on { background: #22c55e; }
.toggle-knob { position: absolute; top: 2px; left: 2px; height: .75rem; width: .75rem; border-radius: 9999px; background: #fff; transition: transform .2s; }
.toggle-knob.toggle-knob-on { transform: translateX(.875rem); }
.trade-footer-wrap { flex-shrink: 0; max-height: 40vh; overflow-y: auto; }
.pt-header { padding-top: 4rem; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.fixed { position: fixed; }
.backdrop-blur-xl { backdrop-filter: blur(24px); }
.bg-background\/80 { background: rgba(10,10,11,.8); }
.hidden { display: none !important; }
@media (min-width: 768px) { .md\\:flex { display: flex !important; } .md\\:hidden { display: none !important; } .md\\:grid-cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); } .md\\:items-end { align-items: flex-end; } .md\\:text-right { text-align: right; } }
@media (min-width: 640px) { .sm\\:inline { display: inline !important; } .sm\\:inline-block { display: inline-block !important; } .sm\\:hidden { display: none !important; } .sm\\:table-cell { display: table-cell !important; } .sm\\:grid-cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); } .sm\\:grid-cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); } .sm\\:grid-cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)); } .sm\\:flex-row { flex-direction: row; } }
@media (min-width: 1024px) { .lg\\:grid-cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); } .lg\\:grid-cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)); } }
.animate-pulse { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.overscroll-contain { overscroll-behavior: contain; }
.min-h-0 { min-height: 0; }
.shrink-0 { flex-shrink: 0; }
.gap-0\\.5 { gap: .125rem; }
.text-\\[10px\\] { font-size: 10px; }
.text-\\[11px\\] { font-size: 11px; }
.h-1\\.5 { height: .375rem; }
.w-1\\.5 { width: .375rem; }
.rounded-t-2xl { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
.border-gold\\/60 { border-color: rgba(212,175,55,.6); }
.bg-gold\\/5 { background: rgba(212,175,55,.05); }
.bg-gold\\/10 { background: rgba(212,175,55,.1); }
.bg-gold\\/20 { background: rgba(212,175,55,.2); }
.bg-surface-elevated\\/50 { background: rgba(28,28,31,.5); }
.border-gold\\/30 { border-color: rgba(212,175,55,.3); }
.help-card { transition: border-color .2s; }
.help-card:hover { border-color: rgba(212,175,55,.3); }
.prose-page h2 { color: var(--foreground); font-size: 1rem; font-weight: 600; margin-top: 1.5rem; }
.prose-page p, .prose-page li { color: var(--muted); line-height: 1.7; font-size: .875rem; }
.prose-page ol { list-style: decimal; padding-left: 1.25rem; }
.prose-page ul { list-style: disc; padding-left: 1.25rem; }

/* User account pages (dashboard, wallet, profile) */
.user-app { min-height: 100dvh; }
.user-app-bar { position: sticky; top: 0; z-index: 40; }
.account-avatar {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.12));
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #f0d060;
  font-size: 0.875rem;
  font-weight: 700;
}
.account-avatar-lg {
  height: 4.5rem;
  width: 4.5rem;
  font-size: 1.75rem;
}
.account-hero {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, rgba(28, 28, 31, 1) 100%);
}
.user-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Deposit success overlay */
body.deposit-overlay-open { overflow: hidden; }
.deposit-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.deposit-overlay.hidden { display: none !important; }
.deposit-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}
.deposit-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 22rem;
  animation: deposit-panel-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.deposit-overlay-inner {
  border-radius: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(165deg, #1f1f22 0%, #141416 55%, #0f0f11 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 175, 55, 0.12);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.deposit-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f5f5f5;
}
.deposit-subtitle,
.deposit-hint,
.deposit-amount-pending {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #9ca3af;
}
.deposit-amount-pending {
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #f0d060;
}
.deposit-spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: deposit-spin 0.85s linear infinite;
}
.deposit-success-badge {
  position: relative;
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
}
.deposit-check-svg {
  width: 100%;
  height: 100%;
}
.deposit-check-circle {
  stroke: #22c55e;
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
}
.deposit-check-mark {
  stroke: #22c55e;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}
.deposit-animate .deposit-check-circle {
  animation: deposit-circle-draw 0.55s ease forwards;
}
.deposit-animate .deposit-check-mark {
  animation: deposit-check-draw 0.4s 0.45s ease forwards;
}
.deposit-confetti {
  position: absolute;
  inset: -0.5rem;
  pointer-events: none;
  opacity: 0;
}
.deposit-animate .deposit-confetti {
  animation: deposit-confetti-pop 0.6s 0.5s ease forwards;
}
.deposit-animate .deposit-confetti::before,
.deposit-animate .deposit-confetti::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    -2.5rem -0.5rem 0 0 #d4af37,
    2.5rem -0.75rem 0 0 #22c55e,
    -2rem 1.5rem 0 0 #60a5fa,
    2rem 1.25rem 0 0 #f472b6,
    0 -2rem 0 0 #fbbf24,
    -1rem -1.75rem 0 0 #34d399,
    1.25rem -1.5rem 0 0 #a78bfa;
}
.deposit-success-title { color: #22c55e; }
.deposit-success-amount {
  margin: 0.75rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: #f0d060;
  letter-spacing: -0.02em;
}
.deposit-success-balance {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: #e5e7eb;
}
.deposit-success-receipt {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
}
.deposit-fail-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.45);
  color: #ef4444;
  font-size: 1.5rem;
  font-weight: 700;
}
.deposit-btn-primary,
.deposit-btn-secondary {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.deposit-btn-primary {
  background: linear-gradient(135deg, #d4af37, #c49a2a);
  color: #000;
}
.deposit-btn-primary:hover { filter: brightness(1.08); }
.deposit-btn-secondary {
  background: #252528;
  color: #9ca3af;
}
.deposit-btn-secondary:hover { color: #f5f5f5; }
.deposit-state.hidden { display: none !important; }
@keyframes deposit-spin { to { transform: rotate(360deg); } }
@keyframes deposit-panel-in {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes deposit-circle-draw { to { stroke-dashoffset: 0; } }
@keyframes deposit-check-draw { to { stroke-dashoffset: 0; } }
@keyframes deposit-confetti-pop {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.85; transform: scale(1); }
}
