/* =====================================================================
   Forex AI — Neon Dark PWA (style inspired by modern fintech apps)
   Content = our app. Look = dark charcoal + neon lime.
   ===================================================================== */

:root {
  /* Fallbacks — overridden by admin Theme settings via <style id="app-theme-vars"> */
  --brand-primary: #b8ff2e;
  --brand-secondary: #8fd914;
  --brand-success: #16a34a;
  --brand-danger: #ff5c6c;
  --brand-primary-rgb: 184, 255, 46;
  --brand-secondary-rgb: 143, 217, 20;
  --neon: var(--brand-primary);
  --neon-deep: #8fd914;
  --neon-ink: #0a1400;
  --brand-gradient: linear-gradient(135deg, #8fd914 0%, #b8ff2e 55%, #d4ff6a 100%);
  --brand-gradient-hero: linear-gradient(145deg, #8fd914 0%, #b8ff2e 48%, #d8ff70 100%);

  --app-topbar-h: 58px;
  --app-bottom-h: 72px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Light mode (default) */
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-muted: #eef1f5;
  --ink: #0f172a;
  --muted: #64748b;
  --border-soft: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.14);
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --tabbar-bg: rgba(255, 255, 255, 0.96);
  --icon-btn-bg: #f4f6f8;
  --fab-ring: #eef1f5;
  --link-accent: var(--brand-primary);
  color-scheme: light;
}

/* Dark mode — whole app (guest + logged-in) */
html[data-bs-theme="dark"] {
  --surface: #151b24;
  --surface-2: #1b2330;
  --surface-muted: #0a0d12;
  --ink: #f4f7fb;
  --muted: #8b97a8;
  --border-soft: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 28px 56px rgba(0, 0, 0, 0.45);
  --topbar-bg: rgba(10, 13, 18, 0.88);
  --tabbar-bg: rgba(12, 16, 22, 0.96);
  --icon-btn-bg: #1a2230;
  --fab-ring: #0a0d12;
  --link-accent: var(--neon);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(680px 320px at 110% -8%, rgba(var(--brand-primary-rgb), 0.08), transparent 55%),
    radial-gradient(520px 280px at -10% 30%, rgba(var(--brand-secondary-rgb), 0.05), transparent 50%),
    var(--surface-muted);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

body.app-logged-in {
  padding-bottom: calc(var(--app-bottom-h) + var(--safe-bottom) + 0.25rem);
}

main { flex: 1; width: 100%; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

a { transition: color 0.15s var(--ease); color: var(--link-accent); }
.text-muted { color: var(--muted) !important; }

/* ---------------------------------------------------------------------
   TOPBAR
   --------------------------------------------------------------------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--app-topbar-h);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
}

body.app-logged-in .app-topbar {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}
body.app-logged-in {
  --app-topbar-h: 64px;
}
@media (min-width: 576px) {
  body.app-logged-in .app-topbar {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
  }
}

.app-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
  min-width: 0;
}
.app-topbar .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-gradient);
  color: var(--neon-ink);
  flex-shrink: 0;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(var(--brand-primary-rgb), 0.28);
  overflow: hidden;
}
.app-topbar .brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.app-topbar .brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
body.app-logged-in .app-topbar .brand-text { display: none; }

.app-greet {
  display: none;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
  text-decoration: none;
  color: inherit;
}
body.app-logged-in .app-greet { display: flex; }
.app-greet .nm {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--ink);
}
.app-greet .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem 0.45rem;
  margin-top: 0.12rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-greet .st {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.app-greet .st.is-on {
  color: #166534;
  background: rgba(22, 163, 74, 0.16);
}
.app-greet .st.is-off {
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
}
html[data-bs-theme="dark"] .app-greet .st.is-on {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}
html[data-bs-theme="dark"] .app-greet .st.is-off {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
}

.app-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--icon-btn-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.app-icon-btn:hover {
  transform: translateY(-1px);
  color: var(--neon-ink);
  background: var(--neon);
  border-color: transparent;
}
.app-icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-danger);
  border: 2px solid var(--surface-muted);
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--neon-ink);
  background: var(--brand-gradient);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(var(--brand-primary-rgb), 0.3);
}

.app-desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}
.app-desktop-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}
.app-desktop-nav a:hover,
.app-desktop-nav a.active {
  color: var(--neon-ink);
  background: var(--neon);
}
@media (min-width: 992px) {
  .app-desktop-nav { display: flex; }
  .app-topbar .brand-text { max-width: 280px; }
  body.app-logged-in .app-topbar .brand-text { display: inline; max-width: 200px; }
  body.app-logged-in { padding-bottom: 0; }
}

/* ---------------------------------------------------------------------
   BOTTOM TAB BAR + CENTER FAB
   --------------------------------------------------------------------- */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  height: calc(var(--app-bottom-h) + var(--safe-bottom));
  padding: 0.25rem 0.5rem var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: var(--tabbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
}
.app-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 14px;
  padding: 0.4rem 0.15rem 0.55rem;
  transition: color 0.15s var(--ease);
}
.app-tabbar a i { font-size: 1.25rem; line-height: 1; }
.app-tabbar a.active,
.app-tabbar a:hover { color: var(--link-accent); background: transparent; }

.app-tabbar .tab-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: var(--neon-ink) !important;
  box-shadow: 0 10px 28px rgba(var(--brand-primary-rgb), 0.45);
  transform: translateY(-18px);
  display: grid;
  place-items: center;
  justify-self: center;
  padding: 0;
  border: 4px solid var(--fab-ring);
}
.app-tabbar .tab-fab span { display: none; }
.app-tabbar .tab-fab i { font-size: 1.55rem; }
.app-tabbar .tab-fab:hover {
  filter: brightness(1.05);
  color: var(--neon-ink) !important;
}

@media (min-width: 992px) {
  .app-tabbar { display: none; }
}

/* ---------------------------------------------------------------------
   BUTTONS / FORMS / CARDS
   --------------------------------------------------------------------- */
.btn {
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}
.btn-lg { border-radius: 999px; padding-left: 1.4rem; padding-right: 1.4rem; }
.btn-primary {
  background: var(--brand-gradient) !important;
  border: none !important;
  color: var(--neon-ink) !important;
  box-shadow: 0 8px 20px rgba(var(--brand-primary-rgb), 0.32);
}
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.05); transform: translateY(-1px); }
.btn-outline-primary {
  border: 1.5px solid rgba(var(--brand-primary-rgb), 0.4) !important;
  color: var(--neon) !important;
  background: transparent !important;
}
.btn-outline-primary:hover { background: rgba(var(--brand-primary-rgb), 0.1) !important; }

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-soft);
  padding: 0.7rem 1rem;
  background: var(--surface);
  color: var(--ink);
}
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.18);
}

/* ---------------------------------------------------------------------
 * Native <option> readability fix (applies app-wide + admin).
 * The browser renders the drop-down list with its own surface, which
 * ignores our styled parent <select>. Without these explicit rules the
 * options inherit the select's color only, so on dark theme (light text)
 * we end up with white text on the browser's white popup = invisible.
 * `color-scheme` lets the browser pick a matching native popup style.
 * ---------------------------------------------------------------------*/
select, .form-select {
  color-scheme: light;
}
select option,
select optgroup,
.form-select option,
.form-select optgroup {
  background-color: #ffffff;
  color: #0f172a;
}
select option:disabled,
.form-select option:disabled {
  color: #94a3b8;
}
select option:checked,
.form-select option:checked {
  background-color: #e0e7ff;
  color: #0f172a;
}

html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] .form-select {
  color-scheme: dark;
}
html[data-bs-theme="dark"] select option,
html[data-bs-theme="dark"] select optgroup,
html[data-bs-theme="dark"] .form-select option,
html[data-bs-theme="dark"] .form-select optgroup {
  background-color: #1f2937;
  color: #e5e7eb;
}
html[data-bs-theme="dark"] select option:disabled,
html[data-bs-theme="dark"] .form-select option:disabled {
  color: #64748b;
}
html[data-bs-theme="dark"] select option:checked,
html[data-bs-theme="dark"] .form-select option:checked {
  background-color: color-mix(in srgb, var(--brand-primary, #b8ff2e) 30%, #1f2937);
  color: #ffffff;
}
.form-label { font-weight: 700; font-size: 0.85rem; color: var(--muted); }

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

/* ---------------------------------------------------------------------
   DASHBOARD
   --------------------------------------------------------------------- */
/* App content gutters — left/right breathing room on all screens */
body.app-logged-in .container,
body.app-logged-in .container-fluid {
  padding-left: 1.15rem !important;
  padding-right: 1.15rem !important;
}
@media (min-width: 576px) {
  body.app-logged-in .container {
    padding-left: 1.35rem !important;
    padding-right: 1.35rem !important;
  }
}
@media (min-width: 992px) {
  body.app-logged-in .container {
    max-width: 920px;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

.app-page { padding: 1rem 0 1.75rem; }

.app-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.app-page-head h1,
.app-page-head h2,
.app-page-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.app-page-head .sub {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

body.app-logged-in .alert {
  border-radius: 16px;
  margin-left: 0;
  margin-right: 0;
}

.welcome-row { display: none; } /* greeting moved to topbar */

/* Hero neon wallet card */
.hero-balance {
  position: relative;
  background: var(--brand-gradient-hero);
  color: var(--neon-ink);
  border-radius: 28px;
  padding: 1.2rem 1.15rem 1.3rem;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(var(--brand-primary-rgb), 0.28);
}
.hero-balance::before {
  content: "";
  position: absolute;
  top: -80px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.45), transparent 62%);
  pointer-events: none;
}
.hero-balance::after {
  content: "";
  position: absolute;
  bottom: -40px; left: -30px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(10,20,0,0.12), transparent 65%);
  pointer-events: none;
}
.hero-balance > * { position: relative; z-index: 1; }

.hero-balance .balance-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--neon-ink) 62%, transparent);
  margin-bottom: 0.15rem;
}
.hero-balance .balance-value {
  font-size: clamp(2.1rem, 9vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--neon-ink);
  margin-bottom: 0.85rem;
}

.hero-mini-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.hero-mini {
  background: rgba(10, 20, 0, 0.22);
  border-radius: 16px;
  padding: 0.7rem 0.8rem;
  backdrop-filter: blur(6px);
}
.hero-mini .k {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(10, 20, 0, 0.65);
  margin-bottom: 0.15rem;
}
.hero-mini .v {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.balance-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}
.balance-actions.actions-4 { grid-template-columns: repeat(4, 1fr); }
.balance-actions a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--neon-ink);
  font-size: 0.68rem;
  font-weight: 700;
}
.balance-actions a i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 20, 0, 0.18);
  font-size: 1.12rem;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.balance-actions a:hover i {
  background: var(--neon-ink);
  color: var(--neon);
  transform: translateY(-2px);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.35rem 0 0.7rem;
}
.wallet-cards .section-title {
  margin: 1.1rem 0 0.65rem;
}
.section-title h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}
.section-title .link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-decoration: none;
}

.wallet-cards .token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.wallet-cards .token-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 0.85rem 0.9rem 0.7rem;
  min-height: 152px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.token-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 0.95rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.wallet-cards .token-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.token-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.wallet-cards .token-card .row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.token-card .row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.wallet-cards .token-card .t-name {
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--ink);
  min-width: 0;
}
.token-card .t-name {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wallet-cards .token-card .t-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
}
.token-card .t-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--neon);
}
.wallet-cards .token-card .t-pct {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.token-card .t-pct {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--neon);
}
.token-card .t-pct.down {
  background: rgba(255, 92, 108, 0.15);
  color: var(--brand-danger);
}
.wallet-cards .token-card .t-value {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.token-card .t-value {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wallet-cards .token-card .t-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.12rem;
}
.token-card .t-sub { font-size: 0.7rem; color: var(--muted); }
.wallet-cards .token-card__foot {
  margin-top: auto;
  padding-top: 0.45rem;
  min-height: 44px;
  display: flex;
  align-items: flex-end;
}
.wallet-activity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  width: 100%;
  height: 42px;
  padding: 7px 10px 6px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(var(--brand-primary-rgb), 0.07) 0%,
    rgba(var(--brand-primary-rgb), 0.02) 100%
  );
  border: 1px solid rgba(var(--brand-primary-rgb), 0.08);
}
.wallet-activity__bar {
  flex: 1;
  max-width: 7px;
  height: var(--h, 40%);
  border-radius: 5px 5px 2px 2px;
  transform-origin: bottom center;
  background: linear-gradient(
    180deg,
    rgba(var(--brand-primary-rgb), 0.85) 0%,
    rgba(var(--brand-primary-rgb), 0.35) 100%
  );
  box-shadow: 0 -1px 0 rgba(var(--brand-primary-rgb), 0.25) inset;
  animation: walletBarRise 0.5s cubic-bezier(0.34, 1.25, 0.64, 1) backwards;
  animation-delay: var(--d, 0s);
}
.wallet-activity--calm .wallet-activity__bar {
  background: linear-gradient(
    180deg,
    rgba(var(--brand-primary-rgb), 0.55) 0%,
    rgba(var(--brand-primary-rgb), 0.18) 100%
  );
}
.wallet-activity--calm {
  background: linear-gradient(
    180deg,
    rgba(var(--brand-primary-rgb), 0.05) 0%,
    rgba(var(--brand-primary-rgb), 0.01) 100%
  );
}
@keyframes walletBarRise {
  from { transform: scaleY(0.15); opacity: 0.35; }
  to { transform: scaleY(1); opacity: 1; }
}
.wallet-bot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: 100%;
  padding: 0.42rem 0.65rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.wallet-bot-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.wallet-bot-chip--off .wallet-bot-chip__dot {
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}
.wallet-cards .token-card__foot--status {
  align-items: center;
  min-height: 34px;
  padding-top: 0.55rem;
}
.wallet-cards .token-card .spark {
  width: 100%;
  margin: 0;
}
.wallet-cards .token-card .spark svg {
  display: block;
  width: 100%;
  height: 38px;
}
.token-card .spark { margin-top: 0.35rem; }
.spark svg { display: block; width: 100%; height: 34px; }
.wallet-cards .spark--idle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.promo-card {
  background:
    radial-gradient(500px 220px at 100% 0, rgba(var(--brand-primary-rgb),0.16), transparent 60%),
    linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--ink);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
  border-radius: 22px;
  padding: 1rem 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.promo-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-primary-rgb), 0.16);
  color: var(--link-accent);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.promo-card .txt { flex: 1; min-width: 0; }
.promo-card .title { font-weight: 800; color: var(--ink); }
.promo-card .sub { font-size: 0.75rem; color: var(--muted); }
.promo-card .btn { flex-shrink: 0; }

/* Binary invite — modern share card */
.binary-invite {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
  background: linear-gradient(155deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-sm);
}
.binary-invite__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(var(--brand-primary-rgb), 0.14), transparent 70%),
    radial-gradient(180px 100px at 100% 100%, rgba(var(--brand-primary-rgb), 0.1), transparent 65%);
}
.binary-invite__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.binary-invite__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.binary-invite__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: var(--brand-primary);
  background: rgba(var(--brand-primary-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-primary-rgb), 0.2);
  flex-shrink: 0;
}
.binary-invite__title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.binary-invite__tagline {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.binary-invite__share {
  border: 0;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.35);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.binary-invite__share:active {
  transform: scale(0.96);
}
.binary-invite__share.binary-invite__btn--done {
  background: var(--brand-success);
  box-shadow: none;
}
.binary-invite__legs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.45rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}
.binary-invite__leg {
  border-radius: 16px;
  padding: 0.65rem 0.55rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
}
html[data-bs-theme="dark"] .binary-invite__leg {
  background: rgba(255, 255, 255, 0.04);
}
.binary-invite__leg--left {
  border-color: rgba(59, 130, 246, 0.22);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
}
.binary-invite__leg--right {
  border-color: rgba(var(--brand-primary-rgb), 0.28);
  background: linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.1), rgba(var(--brand-primary-rgb), 0.02));
}
.binary-invite__leg-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}
.binary-invite__leg--left .binary-invite__leg-icon { color: #3b82f6; }
.binary-invite__leg--right .binary-invite__leg-icon { color: var(--brand-primary); }
.binary-invite__leg-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.binary-invite__leg-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.binary-invite__leg-sub {
  font-size: 0.62rem;
  color: var(--muted);
}
.binary-invite__leg-bv {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.binary-invite__leg-bv::before {
  content: "Business";
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.05rem;
}
.binary-invite__leg--left .binary-invite__leg-bv { color: #2563eb; }
.binary-invite__leg--right .binary-invite__leg-bv { color: var(--brand-primary); }
.binary-invite__bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  opacity: 0.7;
  padding-top: 0.5rem;
}
.binary-invite__bridge span {
  display: block;
  width: 1px;
  height: 10px;
  background: var(--border-soft);
}
.binary-invite__code {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.7rem;
  border-radius: 12px;
  background: rgba(var(--brand-primary-rgb), 0.06);
  border: 1px dashed rgba(var(--brand-primary-rgb), 0.25);
}
.binary-invite__code-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.binary-invite__code-value {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.binary-invite__code-copy {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--brand-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.binary-invite__actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.binary-invite__btn {
  border: 1px solid rgba(var(--brand-primary-rgb), 0.28);
  border-radius: 12px;
  padding: 0.55rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.binary-invite__btn--left:hover,
.binary-invite__btn--right:hover {
  background: rgba(var(--brand-primary-rgb), 0.08);
}
.binary-invite__btn--done {
  background: rgba(var(--brand-primary-rgb), 0.15) !important;
  border-color: rgba(var(--brand-primary-rgb), 0.4) !important;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  padding: 1.05rem 1.1rem;
  color: var(--ink);
}
.detail-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.detail-card .head .title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 0.95rem;
}
.detail-card .head .title i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--neon);
}
.detail-card .head .link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon);
  text-decoration: none;
}
.detail-card .big-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.detail-card .value-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.detail-card .value-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--neon);
}
.detail-card .value-badge.down {
  background: rgba(255, 92, 108, 0.15);
  color: var(--brand-danger);
}

.live-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.55);
  animation: livePulseDot 1.6s ease-out infinite;
  vertical-align: middle;
  margin-right: 0.25rem;
}
@keyframes livePulseDot {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(var(--brand-primary-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0); }
}
.live-trade-sim {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 0.75rem 0.85rem 0.65rem;
  background: linear-gradient(180deg, rgba(var(--brand-primary-rgb), 0.06), transparent);
}
.live-trade-sim__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}
.live-trade-sim__status {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--brand-primary);
}
.live-trade-sim__pair {
  margin-left: auto;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}
.live-trade-sim__signal {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.live-trade-sim__signal.is-buy {
  background: rgba(var(--brand-primary-rgb), 0.16);
  color: var(--brand-primary);
}
.live-trade-sim__signal.is-sell {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}
.live-trade-sim__price-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}
.live-trade-sim__price {
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.live-trade-sim__chg {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-primary);
}
.live-trade-sim__chg.is-down { color: #ef4444; }
.live-trade-sim__chart-wrap {
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(var(--brand-primary-rgb), 0.04);
}
.live-trade-sim__chart {
  width: 100%;
  height: 100%;
  display: block;
}
.live-trade-sim__foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}
.live-trade-idle {
  text-align: center;
  padding: 1.25rem 0.75rem;
  border: 1px dashed var(--border-soft);
  border-radius: 16px;
  background: var(--surface-muted);
}
.live-trade-idle__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary);
  font-size: 1.35rem;
}
.live-trade-idle__title { font-weight: 800; font-size: 0.9rem; }
.live-trade-idle__sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.bot-activity-mini {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 0.65rem 0.75rem 0.5rem;
  background: rgba(var(--brand-primary-rgb), 0.04);
}
.bot-activity-mini__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.bot-activity-mini__row i { color: var(--brand-primary); }
.bot-activity-mini__status {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bot-activity-mini__chart {
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.85;
}
.bot-activity-mini__chart svg {
  width: 100%;
  height: 100%;
  display: block;
}
.spark--live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.spark--idle {
  font-size: 0.68rem;
  color: var(--muted);
}

.timeframe {
  display: inline-flex;
  padding: 0.2rem;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  gap: 0.15rem;
}
.timeframe button {
  border: 0;
  background: transparent;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.timeframe button.is-active {
  background: var(--brand-gradient);
  color: var(--neon-ink);
  box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.35);
}

.level-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.16);
}
.level-row:first-of-type { border-top: 0; }
.level-row .lvl-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--neon);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
}
.level-row .meta { flex: 1; min-width: 0; }
.level-row .meta .name { font-size: 0.85rem; font-weight: 700; }
.level-row .meta .sub { font-size: 0.7rem; color: var(--muted); }
.level-row .val { font-weight: 800; font-size: 0.95rem; }

.withdraw-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 0.7rem;
  margin: 0.65rem 0;
}
.withdraw-stats .cell { text-align: center; }
.withdraw-stats .cell .k {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.withdraw-stats .cell .v { font-weight: 800; margin-top: 0.2rem; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(var(--brand-primary-rgb), 0.45);
}
.progress-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.btn-withdraw {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--brand-gradient);
  color: var(--neon-ink) !important;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.3);
}
.btn-withdraw:hover { filter: brightness(1.05); }

.invest-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-soft);
}
.invest-item:first-of-type { border-top: 0; }
.invest-item .badge-round {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--neon);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.invest-item .meta { flex: 1; min-width: 0; }
.invest-item .name { font-weight: 800; font-size: 0.9rem; }
.invest-item .sub { font-size: 0.72rem; color: var(--muted); }
.invest-item .earn {
  font-weight: 800;
  color: var(--neon);
  font-size: 0.9rem;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.chip-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 0.85rem 0.95rem;
  color: inherit;
}
.chip-card .k {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.chip-card .v { font-weight: 800; margin-top: 0.25rem; font-size: 1.05rem; }
.chip-card .sub { font-size: 0.7rem; color: var(--muted); }

.chat-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--app-bottom-h) + var(--safe-bottom) + 0.85rem);
  z-index: 1050;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--neon-ink) !important;
  background: var(--brand-gradient);
  box-shadow: 0 14px 28px rgba(var(--brand-primary-rgb), 0.4);
  font-size: 1.3rem;
  text-decoration: none;
}
@media (min-width: 992px) {
  .chat-fab { bottom: 1.5rem; }
}

/* Compat / landing */
.stat-card, .app-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.stat-icon-primary { background: rgba(var(--brand-primary-rgb), 0.14); color: var(--neon-deep); }
.stat-icon-success { background: rgba(var(--brand-primary-rgb), 0.14); color: var(--neon-deep); }
.stat-icon-info { background: rgba(8, 145, 178, 0.12); color: #0891b2; }
.stat-icon-warning { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.stat-icon-danger { background: rgba(255, 92, 108, 0.12); color: var(--brand-danger); }

.badge { font-weight: 700; border-radius: 999px; }
.alert { border-radius: var(--radius-md); border: none; }

/* =====================================================================
   Landing — AI trading look (desktop + mobile), admin brand colors
   Light / dark via html[data-bs-theme]
   ===================================================================== */
body.page-landing {
  --land-bg: #070b12;
  --land-surface: #0b111a;
  --land-surface-2: #101826;
  --land-text: #f4f7fb;
  --land-muted: #94a3b8;
  --land-border: rgba(255, 255, 255, 0.08);
  --land-panel: rgba(14, 20, 30, 0.72);
  --land-nav: #f4f7fb;
  --land-hero-fg: #f4f7fb;
  --land-hero-muted: rgba(203, 213, 225, 0.88);
  --land-hero-bg:
    radial-gradient(900px 480px at 12% 20%, rgba(var(--brand-primary-rgb), 0.22), transparent 60%),
    radial-gradient(700px 420px at 88% 70%, rgba(var(--brand-secondary-rgb), 0.14), transparent 55%),
    linear-gradient(160deg, #05080e 0%, #0a1018 48%, #0d1520 100%);
  background: var(--land-bg);
  color: var(--land-text);
  transition: background-color 0.25s ease, color 0.25s ease;
}
html[data-bs-theme="light"] body.page-landing {
  --land-bg: #eef2f7;
  --land-surface: #ffffff;
  --land-surface-2: #f7f9fc;
  --land-text: #0f172a;
  --land-muted: #64748b;
  --land-border: rgba(15, 23, 42, 0.08);
  --land-panel: rgba(255, 255, 255, 0.78);
  --land-nav: #0f172a;
  --land-hero-fg: var(--neon-ink);
  --land-hero-muted: color-mix(in srgb, var(--neon-ink) 72%, transparent);
  --land-hero-bg:
    radial-gradient(900px 480px at 12% 20%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(700px 420px at 88% 70%, rgba(0, 0, 0, 0.08), transparent 55%),
    var(--brand-gradient-hero);
}
body.page-landing main {
  padding: 0;
  max-width: none;
  width: 100%;
}
body.page-landing .app-topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 80;
  pointer-events: auto;
  background: transparent;
  border-bottom: 1px solid transparent;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}
body.page-landing .app-topbar .brand-text,
body.page-landing .app-desktop-nav a {
  color: var(--land-hero-fg);
}
body.page-landing .app-desktop-nav a:hover { color: var(--brand-primary); }
html[data-bs-theme="light"] body.page-landing .app-desktop-nav a:hover {
  color: var(--neon-deep);
}
body.page-landing .app-topbar .brand-mark {
  background: color-mix(in srgb, var(--land-hero-fg) 12%, transparent);
  color: var(--land-hero-fg);
}
body.page-landing .app-icon-btn {
  position: relative;
  z-index: 81;
  pointer-events: auto;
  cursor: pointer;
  background: color-mix(in srgb, var(--land-hero-fg) 12%, transparent);
  color: var(--land-hero-fg);
}
body.page-landing .app-topbar .btn-primary {
  border-radius: 999px !important;
  padding-inline: 1rem !important;
}

.land-wrap,
.land-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

/* ---- Hero ---- */
.land-hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  overflow: hidden;
  color: var(--land-hero-fg);
  background: var(--land-hero-bg);
  padding: calc(var(--app-topbar-h) + 1.75rem) 0 0;
}
.land-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 40% 30%, black 10%, transparent 70%);
}
.land-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: landOrb 10s ease-in-out infinite alternate;
}
.land-orb--a {
  width: 280px; height: 280px;
  left: -40px; top: 12%;
  background: rgba(var(--brand-primary-rgb), 0.45);
}
.land-orb--b {
  width: 340px; height: 340px;
  right: -60px; bottom: 8%;
  background: rgba(var(--brand-secondary-rgb), 0.28);
  animation-delay: -3s;
}
.land-hero__scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  top: 30%;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.55), transparent);
  animation: landScan 5.5s linear infinite;
  opacity: 0.5;
}

.land-shell {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
  align-items: center;
}

.land-hero__brand {
  margin: 0 0 0.9rem;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.94;
  color: var(--land-hero-fg);
  text-wrap: balance;
}
.land-hero__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--land-hero-fg);
  opacity: 0.92;
}
.land-hero__lead {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(0.98rem, 1.3vw, 1.12rem);
  line-height: 1.6;
  color: var(--land-hero-muted);
}
.land-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}
.land-btn {
  border-radius: 999px !important;
  padding: 0.78rem 1.45rem !important;
  font-weight: 700 !important;
}
.land-hero .btn-primary.land-btn {
  background: #fff !important;
  border: none !important;
  color: var(--neon-deep) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.land-hero .btn-primary.land-btn:hover {
  filter: brightness(0.98);
  color: var(--neon-deep) !important;
}
html[data-bs-theme="dark"] .land-hero .btn-primary.land-btn {
  background: var(--brand-gradient) !important;
  color: var(--neon-ink) !important;
  box-shadow: 0 10px 30px rgba(var(--brand-primary-rgb), 0.28);
}
html[data-bs-theme="dark"] .land-hero .btn-primary.land-btn:hover {
  filter: brightness(1.06);
  color: var(--neon-ink) !important;
}
.land-btn--ghost {
  background: color-mix(in srgb, var(--land-hero-fg) 10%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--land-hero-fg) 28%, transparent) !important;
  color: var(--land-hero-fg) !important;
}
.land-btn--ghost:hover {
  background: color-mix(in srgb, var(--land-hero-fg) 18%, transparent) !important;
  color: var(--land-hero-fg) !important;
}
.land-btn--ghost-dark {
  background: transparent !important;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.4) !important;
  color: var(--brand-primary) !important;
}
html[data-bs-theme="dark"] .land-btn--ghost-dark { color: var(--neon) !important; }

/* ---- AI terminal visual (full plane on desktop) ---- */
.land-hero__stage {
  width: 100%;
  min-width: 0;
}
.land-terminal {
  position: relative;
  width: 100%;
  min-height: 360px;
  padding: 1.15rem 1.15rem 0;
  color: #e8eef7;
  background:
    linear-gradient(180deg, rgba(14, 20, 30, 0.92), rgba(8, 12, 18, 0.98)),
    rgba(8, 12, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(var(--brand-primary-rgb), 0.08),
    0 28px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.land-terminal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand-gradient);
}
.land-terminal__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.land-terminal__pair strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.land-terminal__pair em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.9);
  margin-top: 0.2rem;
}
.land-terminal__signal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(var(--brand-primary-rgb), 0.14);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.4);
  color: var(--brand-primary);
  white-space: nowrap;
}
.land-terminal__signal .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.55);
  animation: landPulse 1.8s ease-out infinite;
}
.land-terminal__price-main {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.land-terminal__price-chg {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.land-terminal__chart {
  position: relative;
  height: 150px;
  margin: 1.1rem 0 0.9rem;
}
.land-candles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 0.15rem;
  opacity: 0.35;
}
.land-candles i {
  flex: 1;
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--brand-primary), rgba(var(--brand-primary-rgb), 0.25));
  animation: landCandle 2.8s ease-in-out infinite;
}
.land-candles i:nth-child(odd) { animation-delay: 0.2s; background: linear-gradient(180deg, #94a3b8, rgba(148, 163, 184, 0.2)); }
.land-candles i:nth-child(3n) { animation-delay: 0.45s; }
.land-spark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.land-spark__line {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: landDraw 1.7s var(--ease) 0.25s forwards;
}
.land-terminal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.85rem 0 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.land-terminal__stats span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 0.2rem;
}
.land-terminal__stats strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.land-ticker {
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  margin: 0 -1.15rem;
}
.land-ticker__track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  padding: 0.7rem 1.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.8);
  animation: landTicker 22s linear infinite;
}
.land-ticker__track span:nth-child(4n) { color: #f87171; }

.land-anim {
  opacity: 0;
  transform: translateY(16px);
  animation: landRise 0.7s var(--ease) forwards;
}
.land-anim--1 { animation-delay: 0.05s; }
.land-anim--2 { animation-delay: 0.14s; }
.land-anim--3 { animation-delay: 0.22s; }
.land-anim--4 { animation-delay: 0.3s; }
.land-anim--5 { animation-delay: 0.38s; }

@keyframes landRise { to { opacity: 1; transform: none; } }
@keyframes landOrb {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(18px) scale(1.08); }
}
@keyframes landScan {
  0% { top: 12%; opacity: 0; }
  15% { opacity: 0.55; }
  85% { opacity: 0.35; }
  100% { top: 88%; opacity: 0; }
}
@keyframes landPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(var(--brand-primary-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0); }
}
@keyframes landCandle {
  0%, 100% { transform: scaleY(1); transform-origin: bottom; }
  50% { transform: scaleY(0.88); transform-origin: bottom; }
}
@keyframes landDraw { to { stroke-dashoffset: 0; } }
@keyframes landTicker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- Features / Why / About / How / CTA / Footer ---- */
.land-section {
  background: var(--land-bg);
  color: var(--land-text);
}
.land-features { padding: 5rem 0 3rem; }
.land-why { padding: 3rem 0 4rem; background: var(--land-surface-2); }
.land-about { padding: 2rem 0 4rem; }
.land-how { padding: 2rem 0 4rem; background: var(--land-surface-2); }
.land-cta { padding: 1rem 0 4rem; }

.land-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary);
}
.land-section-head {
  max-width: 40rem;
  margin-bottom: 2.25rem;
}
.land-section-head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.land-section-head h2 {
  margin: 0 0 0.55rem;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--land-text);
}
.land-section-head > p:last-child {
  margin: 0;
  color: var(--land-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Bento features */
.land-bento {
  display: grid;
  gap: 1rem;
}
.land-bento__item {
  position: relative;
  padding: 1.35rem 1.35rem 1.45rem;
  border-radius: 22px;
  background: var(--land-surface);
  border: 1px solid var(--land-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.land-bento__item::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0.85;
}
.land-bento__item:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--brand-primary-rgb), 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}
.land-bento__item--lg {
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(var(--brand-primary-rgb), 0.18), transparent 60%),
    var(--land-surface);
}
.land-bento__icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--brand-primary);
}
.land-bento__item h3 {
  margin: 0 0 0.4rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--land-text);
}
.land-bento__item p {
  margin: 0;
  color: var(--land-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Why cards */
.land-why-grid {
  display: grid;
  gap: 1rem;
}
.land-why-card {
  position: relative;
  padding: 1.5rem 1.35rem 1.4rem;
  border-radius: 22px;
  background: var(--land-surface);
  border: 1px solid var(--land-border);
  overflow: hidden;
}
.land-why-card__num {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(var(--brand-primary-rgb), 0.18);
  line-height: 1;
}
.land-why-card > i {
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--brand-primary);
}
.land-why-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--land-text);
}
.land-why-card p {
  margin: 0;
  color: var(--land-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* About panel */
.land-about__panel {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 28px;
  background:
    radial-gradient(600px 260px at 0% 0%, rgba(var(--brand-primary-rgb), 0.16), transparent 55%),
    var(--land-surface);
  border: 1px solid var(--land-border);
}
.land-about__panel .land-section-head { margin-bottom: 0; }
.land-about__body {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--land-muted);
  max-width: 46rem;
}
.land-about__body p { margin: 0; color: inherit; }

/* Steps */
.land-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.land-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 1.2rem;
  border-radius: 20px;
  background: var(--land-surface);
  border: 1px solid var(--land-border);
}
.land-step__num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
  min-width: 2.2rem;
}
.land-step__body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
  color: var(--land-text);
}
.land-step__body p {
  margin: 0;
  color: var(--land-muted);
  font-size: 0.95rem;
}

/* CTA */
.land-cta__panel {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 28px;
  background: var(--brand-gradient-hero);
  color: var(--neon-ink);
  box-shadow: 0 20px 50px rgba(var(--brand-primary-rgb), 0.22);
}
.land-cta__panel h2 {
  margin: 0 0 0.4rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  color: var(--neon-ink);
}
.land-cta__panel p {
  margin: 0;
  color: color-mix(in srgb, var(--neon-ink) 78%, transparent);
  max-width: 36rem;
}
.land-cta .btn-primary.land-btn {
  background: #fff !important;
  color: var(--neon-deep) !important;
  border: none !important;
}
.land-cta .land-btn--ghost-dark {
  border-color: color-mix(in srgb, var(--neon-ink) 35%, transparent) !important;
  color: var(--neon-ink) !important;
}

/* Footer */
.land-footer {
  padding: 3.25rem 0 2rem;
  border-top: 1px solid var(--land-border);
  background: var(--land-surface);
  color: var(--land-text);
}
.land-footer__grid {
  display: grid;
  gap: 2rem;
}
.land-footer__name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.land-footer__name img {
  width: 36px; height: 36px;
  border-radius: 10px;
  object-fit: cover;
}
.land-footer__name strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  color: var(--land-text);
}
.land-footer__brand > p {
  margin: 0 0 1rem;
  color: var(--land-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 22rem;
}
.land-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.land-footer__social a {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--land-text);
  text-decoration: none;
  border: 1px solid var(--land-border);
}
.land-footer__social a:hover {
  color: var(--neon-ink);
  background: var(--brand-primary);
  border-color: transparent;
}
.land-footer h4 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--land-muted);
}
.land-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.land-footer li { margin-bottom: 0.55rem; }
.land-footer a,
.land-footer__contact span {
  color: var(--land-text);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.88;
}
.land-footer a:hover { color: var(--brand-primary); opacity: 1; }
.land-footer__contact i {
  color: var(--brand-primary);
  margin-right: 0.4rem;
}
.land-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--land-border);
  font-size: 0.82rem;
  color: var(--land-muted);
}

/* Desktop / large screens */
@media (min-width: 768px) {
  .land-bento {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
  .land-bento__item--lg {
    grid-column: span 2;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 1.25rem;
    align-items: start;
    min-height: 180px;
    padding: 1.75rem;
  }
  .land-bento__item--lg .land-bento__icon {
    grid-row: span 2;
    width: 64px; height: 64px;
    font-size: 1.6rem;
    margin-bottom: 0;
  }
  .land-why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
  .land-about__panel {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 2.5rem;
  }
  .land-footer__grid {
    grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
    gap: 2rem;
  }
  .land-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .land-step {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-height: 100%;
  }
  .land-cta__panel {
    grid-template-columns: 1.3fr auto;
    align-items: center;
  }
}
@media (min-width: 1100px) {
  .land-bento {
    grid-template-columns: 1.35fr 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .land-bento__item--lg {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .land-bento__item--lg .land-bento__icon {
    grid-row: auto;
    margin-bottom: 1.25rem;
  }
  .land-why-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .land-hero {
    display: flex;
    align-items: stretch;
    padding: 0;
    min-height: 100vh;
    min-height: 100svh;
  }
  .land-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: var(--app-topbar-h);
    padding-bottom: 2.5rem;
  }
  .land-hero__copy {
    padding: 1rem 0 1rem;
  }
  .land-terminal {
    min-height: min(68vh, 560px);
    height: 100%;
    max-height: 620px;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    padding: 1.5rem 1.5rem 0;
  }
  .land-terminal__chart { flex: 1; min-height: 200px; height: auto; }
  .land-ticker { margin: 0 -1.5rem; }
}

@media (min-width: 1200px) {
  .land-hero__brand { font-size: 5rem; }
  .land-terminal { padding: 1.75rem 1.75rem 0; }
  .land-ticker { margin: 0 -1.75rem; }
}

/* Legacy aliases */
.hero-app { background: #070b12; color: #fff; }
.feature-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--brand-primary); font-size: 1.2rem;
}

.auth-card {
  max-width: 440px;
  margin: 1.5rem auto;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
  position: relative;
  background: var(--surface) !important;
  color: var(--ink);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-gradient);
}

.pwa-install {
  display: none;
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(var(--app-bottom-h) + var(--safe-bottom) + 0.75rem);
  z-index: 1050;
  background: #121820;
  color: #fff;
  border-radius: 18px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-lg);
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
}
.pwa-install.is-visible { display: flex; }

footer.app-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 1.25rem 0;
  margin-top: auto;
}
body.app-logged-in footer.app-footer { display: none; }

body.app-logged-in .table {
  --bs-table-color: var(--ink);
  color: var(--ink);
}
body.app-logged-in .table thead th { color: var(--muted); border-color: var(--border-soft); }
body.app-logged-in .table td { border-color: var(--border-soft); }

@media (max-width: 575.98px) {
  .auth-card { margin: 0.75rem auto; border-radius: var(--radius-lg) !important; }
  .balance-actions a { font-size: 0.62rem; }
  .balance-actions a i { width: 42px; height: 42px; }
}

/* Production polish — shared user pages in dark shell */
body.app-logged-in .nav-tabs {
  border-bottom-color: var(--border-soft);
  gap: 0.25rem;
  flex-wrap: wrap;
}
body.app-logged-in .nav-tabs .nav-link {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
}
body.app-logged-in .nav-tabs .nav-link.active {
  background: var(--brand-gradient);
  color: var(--neon-ink);
}
body.app-logged-in .table-responsive {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
body.app-logged-in .table {
  margin-bottom: 0;
}
body.app-logged-in .list-group-item {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-soft);
}
body.app-logged-in .pagination .page-link {
  background: var(--surface);
  border-color: var(--border-soft);
  color: var(--ink);
}
body.app-logged-in .pagination .page-item.active .page-link {
  background: var(--brand-gradient);
  border-color: transparent;
  color: var(--neon-ink);
}

/* ---------------------------------------------------------------------
   USER SIDEBAR (modern slide-out drawer)
   --------------------------------------------------------------------- */
.app-menu-btn {
  flex-shrink: 0;
}
.app-menu-btn i {
  font-size: 1.35rem;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1045;
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.app-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: min(330px, 88vw);
  height: 100vh;         /* fallback for older browsers */
  height: 100dvh;        /* dynamic viewport — accounts for mobile URL bar */
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(var(--brand-primary-rgb), 0.16), transparent 55%),
    radial-gradient(360px 200px at 0% 100%, rgba(59, 130, 246, 0.12), transparent 50%),
    linear-gradient(180deg, #0d1219 0%, #121a24 55%, #0b1017 100%);
  color: #eef2f7;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(-105%);
  transition: transform 0.28s var(--ease);
  overflow: hidden;
}
.app-sidebar.is-open {
  transform: translateX(0);
}
.app-sidebar__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 30%);
}

.app-sidebar__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 1rem 1rem 0.75rem;
  flex-shrink: 0;
  padding-top: max(1rem, env(safe-area-inset-top));
}
.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.app-sidebar__brand strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.app-sidebar__brand small {
  display: block;
  font-size: 0.68rem;
  color: rgba(238, 242, 247, 0.55);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-sidebar__brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-gradient);
  color: var(--neon-ink);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(var(--brand-primary-rgb), 0.3);
}
.app-sidebar__brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-sidebar__close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.app-sidebar__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-sidebar__user {
  position: relative;
  margin: 0.25rem 0.85rem 0.85rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.app-sidebar__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--neon-ink);
  background: var(--brand-gradient);
  flex-shrink: 0;
}
.app-sidebar__user-meta { min-width: 0; flex: 1; }
.app-sidebar__user-name {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar__user-ref {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: rgba(var(--brand-primary-rgb), 0.9);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.app-sidebar__user-go {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.app-sidebar__user-go:hover { color: #fff; background: rgba(255,255,255,0.12); }

.app-sidebar__nav {
  position: relative;
  flex: 1 1 auto;
  min-height: 0; /* critical: allows flex child to shrink below content size so foot stays visible */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.app-sidebar__section { margin-bottom: 1rem; }
.app-sidebar__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 242, 247, 0.42);
  padding: 0.35rem 0.7rem 0.45rem;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  margin-bottom: 0.2rem;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(238, 242, 247, 0.88);
  font-weight: 650;
  font-size: 0.9rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.app-sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: translateX(2px);
}
.app-sidebar__link.is-active {
  background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.18), rgba(var(--brand-primary-rgb), 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(var(--brand-primary-rgb), 0.22);
}
.app-sidebar__link.is-active .app-sidebar__ico {
  background: var(--brand-gradient);
  color: var(--neon-ink);
}
.app-sidebar__ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(238, 242, 247, 0.9);
  font-size: 1rem;
  flex-shrink: 0;
}
.app-sidebar__txt { flex: 1; min-width: 0; }
.app-sidebar__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #ff5c6c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.app-sidebar__foot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.85rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
/* Very-short viewports (landscape phones, small tablets) — compact the sidebar
   so Theme / Logout stay reachable without needing to scroll the whole page. */
@media (max-height: 560px) {
  .app-sidebar__head    { padding: 0.55rem 0.85rem 0.4rem; }
  .app-sidebar__user    { margin: 0.15rem 0.6rem 0.5rem; padding: 0.55rem 0.65rem; }
  .app-sidebar__avatar  { width: 36px; height: 36px; font-size: 0.9rem; }
  .app-sidebar__foot    { padding: 0.55rem 0.7rem; padding-bottom: max(0.55rem, env(safe-area-inset-bottom)); }
  .app-sidebar__theme,
  .app-sidebar__logout  { padding: 0.5rem 0.4rem; font-size: 0.78rem; }
}
.app-sidebar__theme,
.app-sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 0.5rem;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.app-sidebar__theme:hover,
.app-sidebar__logout:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.app-sidebar__logout {
  background: rgba(255, 92, 108, 0.12);
  border-color: rgba(255, 92, 108, 0.28);
  color: #ff8a96;
}
.app-sidebar__logout:hover {
  background: rgba(255, 92, 108, 0.2);
  color: #ffb0b8;
}

html[data-bs-theme="light"] .app-sidebar {
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(var(--brand-primary-rgb), 0.2), transparent 55%),
    radial-gradient(360px 200px at 0% 100%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(180deg, #101722 0%, #151d29 100%);
}

body.sidebar-open {
  overflow: hidden;
}

/* =====================================================================
   PWA APP SHELL — native mobile feel (standalone + phone)
   ===================================================================== */
html {
  height: 100%;
  height: -webkit-fill-available;
}
body.app-logged-in {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Notch / home-indicator safe areas */
body.app-logged-in .app-topbar {
  padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
  padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
  min-height: calc(var(--app-topbar-h) + env(safe-area-inset-top, 0px));
}
body.app-logged-in .app-tabbar {
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
  height: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px));
}
body.app-logged-in {
  padding-bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px) + 0.5rem);
}

/* Standalone PWA window (installed app) */
@media (display-mode: standalone), (display-mode: fullscreen) {
  body.app-logged-in {
    background: var(--surface-muted);
  }
  body.app-logged-in .app-topbar {
    border-bottom-color: transparent;
    box-shadow: 0 1px 0 var(--border-soft);
  }
  body.app-logged-in .pwa-install { display: none !important; }
  body.app-logged-in footer.app-footer { display: none !important; }
  body.app-logged-in .chat-fab {
    bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
}

/* Phone-width app layout */
@media (max-width: 991.98px) {
  body.app-logged-in main > .container.app-page,
  body.app-logged-in main > .container {
    max-width: 100%;
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }
  body.app-logged-in .app-page {
    padding-top: 0.75rem;
    padding-bottom: 1.25rem;
  }
  body.app-logged-in .app-page-head {
    margin-bottom: 0.85rem;
  }
  body.app-logged-in .app-page-head h3 {
    font-size: 1.2rem;
  }

  /* Cards feel like native list cells */
  body.app-logged-in .ui-section-card,
  body.app-logged-in .stat-card,
  body.app-logged-in .card.stat-card {
    border-radius: 20px;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow-sm);
  }
  body.app-logged-in .ui-hero,
  body.app-logged-in .wallet-hero,
  body.app-logged-in .mkt-hero,
  body.app-logged-in .hero-balance,
  body.app-logged-in .ai-console {
    border-radius: 22px;
    margin-bottom: 0.85rem;
  }

  /* Compact forms for thumbs */
  body.app-logged-in .form-control,
  body.app-logged-in .form-select {
    min-height: 48px;
    font-size: 16px; /* prevents iOS zoom */
    border-radius: 14px;
  }
  body.app-logged-in .btn {
    min-height: 44px;
  }
  body.app-logged-in .btn-lg {
    min-height: 50px;
    width: 100%;
  }

  /* Trade cards stack cleanly on narrow screens */
  body.app-logged-in .trade-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.95rem;
  }
  body.app-logged-in .trade-ring {
    width: 78px;
    height: 78px;
    align-self: flex-start;
  }
  body.app-logged-in .trade-amount { font-size: 1.25rem; }
  body.app-logged-in .cd-seg { min-width: 42px; flex: 1; }

  /* Hide hover lift on touch devices */
  body.app-logged-in .trade-card:hover,
  body.app-logged-in .ui-tile:hover {
    transform: none;
  }
}

/* AI Trade console — brand gradient (matches rest of PWA), not separate dark theme */
.ai-console {
  background: var(--brand-gradient-hero) !important;
  color: var(--neon-ink) !important;
  box-shadow: 0 18px 40px rgba(var(--brand-primary-rgb), 0.28) !important;
}
.ai-console::after { opacity: 0.22 !important; }
.ai-console__sub { opacity: 0.7 !important; color: inherit !important; }
.ai-live {
  background: rgba(10, 20, 0, 0.12) !important;
  color: var(--neon-ink) !important;
}
.ai-metric {
  background: rgba(10, 20, 0, 0.1) !important;
  border-color: rgba(10, 20, 0, 0.08) !important;
  color: var(--neon-ink) !important;
}
.ai-metric__v.pos { color: #14532d !important; }
.ai-metric__v.warn { color: #92400e !important; }

.ai-fund,
.ai-shell .ui-section-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

/* Quick-action strip used on wallet */
body.app-logged-in .wallet-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
body.app-logged-in .wallet-next-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
body.app-logged-in .wallet-next-grid a i {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-gradient);
  color: var(--neon-ink);
  font-size: 1.1rem;
}

/* Tab bar active state — app-like pill */
.app-tabbar a.active {
  color: var(--neon-ink);
}
.app-tabbar a.active i {
  background: var(--brand-gradient);
  color: var(--neon-ink);
  width: 42px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  margin-bottom: 0.1rem;
}
.app-tabbar .tab-fab.active i {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
}

/* Prevent double-tap zoom on controls */
body.app-logged-in button,
body.app-logged-in a,
body.app-logged-in .btn {
  touch-action: manipulation;
}

/* =====================================================================
   ONE MOBILE UI EVERYWHERE (desktop = same as phone app)
   Logged-in user area always renders as a ~430px mobile PWA shell.
   ===================================================================== */
:root {
  --app-phone-w: 430px;
}

/* Kill desktop divergences for logged-in users */
@media (min-width: 992px) {
  body.app-logged-in { padding-bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px) + 0.5rem) !important; }
  body.app-logged-in .app-tabbar { display: grid !important; }
  body.app-logged-in .app-desktop-nav { display: none !important; }
  body.app-logged-in .app-topbar .brand-text { display: none !important; }
  body.app-logged-in .chat-fab {
    bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px) + 0.85rem) !important;
  }
  body.app-logged-in .container {
    max-width: 100% !important;
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }
}

/* Centered phone frame on wide screens */
@media (min-width: 480px) {
  body.app-logged-in {
    background:
      radial-gradient(600px 280px at 50% -10%, rgba(var(--brand-primary-rgb), 0.12), transparent 60%),
      #0b1018 !important;
  }
  html[data-bs-theme="light"] body.app-logged-in {
    background:
      radial-gradient(600px 280px at 50% -10%, rgba(var(--brand-primary-rgb), 0.14), transparent 60%),
      #dce3ec !important;
  }

  body.app-logged-in .app-topbar {
    width: 100%;
    max-width: var(--app-phone-w);
    margin-left: auto;
    margin-right: auto;
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    background: var(--topbar-bg) !important;
  }

  body.app-logged-in main {
    width: 100%;
    max-width: var(--app-phone-w);
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100dvh - var(--app-topbar-h) - var(--app-bottom-h));
    background: var(--surface-muted);
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 30px 80px rgba(0,0,0,0.18);
  }

  body.app-logged-in .app-tabbar {
    left: 50% !important;
    right: auto !important;
    width: 100%;
    max-width: var(--app-phone-w);
    transform: translateX(-50%);
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
  }

  body.app-logged-in .chat-fab {
    left: calc(50% + (var(--app-phone-w) / 2) - 4.25rem);
    right: auto;
  }

  body.app-logged-in .pwa-install {
    left: 50%;
    right: auto;
    width: calc(var(--app-phone-w) - 2rem);
    max-width: calc(100vw - 2rem);
    transform: translateX(-50%);
  }
}

/* Always single-column content inside the app (no desktop side-by-side) */
body.app-logged-in main .row > [class*="col-"] {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Keep mobile-scale grids (2-col wallets etc.), never expand to desktop 3/4 cols */
body.app-logged-in .ui-tile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body.app-logged-in .trade-grid {
  grid-template-columns: 1fr !important;
}
body.app-logged-in .trade-card {
  flex-direction: column;
  align-items: stretch;
}

/* Compact page spacing — same on all widths */
body.app-logged-in .app-page {
  padding-top: 0.75rem;
  padding-bottom: 1.25rem;
}
body.app-logged-in main > .container,
body.app-logged-in main > .container.app-page {
  max-width: 100% !important;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
}

/* Forms / buttons — phone sizes always */
body.app-logged-in .form-control,
body.app-logged-in .form-select {
  min-height: 48px;
  font-size: 16px;
  border-radius: 14px;
}
body.app-logged-in .btn-lg {
  min-height: 50px;
  width: 100%;
}

/* Tables scroll inside phone frame */
body.app-logged-in .table-responsive {
  margin-left: -0.15rem;
  margin-right: -0.15rem;
}

/* Trading / market — keep phone metrics */
body.app-logged-in .ai-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body.app-logged-in .mkt-pulse {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
body.app-logged-in .wallet-switcher {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Sidebar stays full-viewport overlay (not constrained to phone width) */
body.app-logged-in .app-sidebar,
body.app-logged-in .app-sidebar-backdrop {
  max-width: none !important;
}

/* =====================================================================
   Landing page inside logged-in PWA shell (430px phone frame)
   ===================================================================== */
body.app-logged-in.page-landing {
  background: var(--land-bg) !important;
}

body.app-logged-in.page-landing .app-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  inset: auto;
  max-width: var(--app-phone-w);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  background: color-mix(in srgb, var(--land-bg) 82%, transparent) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--land-border);
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

body.app-logged-in.page-landing .app-icon-btn {
  background: color-mix(in srgb, var(--land-hero-fg) 10%, transparent);
  color: var(--land-hero-fg);
  border: 1px solid color-mix(in srgb, var(--land-hero-fg) 14%, transparent);
}

body.app-logged-in.page-landing main {
  background: var(--land-bg) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 30px 80px rgba(0, 0, 0, 0.22);
  padding-bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px));
}

body.app-logged-in.page-landing .land-hero {
  display: block;
  min-height: auto;
  padding: 1.1rem 0 0;
}

body.app-logged-in.page-landing .land-shell {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-height: auto !important;
  padding-top: 0;
  padding-bottom: 1.5rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

body.app-logged-in.page-landing .land-hero__copy {
  padding: 0;
  text-align: left;
}

body.app-logged-in.page-landing .land-hero__brand {
  font-size: clamp(2rem, 9vw, 2.65rem) !important;
  margin-bottom: 0.65rem;
  line-height: 1;
}

body.app-logged-in.page-landing .land-hero__title {
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  margin-bottom: 0.65rem;
  white-space: pre-line;
}

body.app-logged-in.page-landing .land-hero__lead {
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: none;
}

body.app-logged-in.page-landing .land-hero__actions {
  margin-top: 1.15rem;
}

body.app-logged-in.page-landing .land-hero__actions .land-btn {
  width: 100%;
  justify-content: center;
}

body.app-logged-in.page-landing .land-hero__stage {
  order: 3;
}

body.app-logged-in.page-landing .land-terminal {
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 1rem 1rem 0;
  border-radius: 20px;
}

body.app-logged-in.page-landing .land-terminal__chart {
  height: 130px;
  min-height: 130px;
  flex: none;
}

body.app-logged-in.page-landing .land-terminal__price-main {
  font-size: 1.65rem;
}

body.app-logged-in.page-landing .land-terminal__stats strong {
  font-size: 0.95rem;
}

body.app-logged-in.page-landing .land-ticker {
  margin: 0 -1rem;
}

body.app-logged-in.page-landing .land-section {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

body.app-logged-in.page-landing .land-wrap {
  padding-left: 0;
  padding-right: 0;
}

body.app-logged-in.page-landing .land-bento {
  grid-template-columns: 1fr !important;
}

body.app-logged-in.page-landing .land-why-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.app-logged-in.page-landing .chat-fab {
  bottom: calc(var(--app-bottom-h) + env(safe-area-inset-bottom, 0px) + 0.85rem) !important;
}

/* Never use desktop split layout inside the phone shell */
@media (min-width: 992px) {
  body.app-logged-in.page-landing .land-hero {
    display: block;
    min-height: auto;
    padding-top: 1.1rem;
  }

  body.app-logged-in.page-landing .land-shell {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    min-height: auto !important;
    padding-top: 0;
  }

  body.app-logged-in.page-landing .land-terminal {
    min-height: 0;
    height: auto;
    max-height: none;
    display: block;
  }

  body.app-logged-in.page-landing .land-terminal__chart {
    flex: none;
    min-height: 130px;
    height: 130px;
  }
}

@media (min-width: 1200px) {
  body.app-logged-in.page-landing .land-hero__brand {
    font-size: clamp(2rem, 9vw, 2.65rem) !important;
  }
}

/* =====================================================================
   Team page — binary tree, match rewards, referrals
   ===================================================================== */
.page-team .binary-invite { margin-bottom: 0.85rem; }
.page-team .ui-hero { margin-bottom: 0.85rem; }

.page-team .team-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.page-team .team-quick__item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 0.7rem 0.75rem;
  box-shadow: var(--shadow-sm);
}
.page-team .team-quick__label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-team .team-quick__value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 0.15rem;
}

.page-team .team-match__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.page-team .team-match__score {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}
.page-team .team-match__score span {
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary);
  font-weight: 800;
}
.page-team .team-match__hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}
.page-team .team-match__next {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(var(--brand-primary-rgb), 0.06);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.12);
  margin-bottom: 0.75rem;
}
.page-team .team-match__next-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.page-team .team-match__next-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
}
.page-team .team-match__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--brand-primary-rgb), 0.12);
  overflow: hidden;
  margin-top: 0.45rem;
}
.page-team .team-match__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-gradient);
}
.page-team .team-match__tiers {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}
.page-team .team-match__tier {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  font-size: 0.78rem;
}
.page-team .team-match__tier--earned {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.06);
}
.page-team .team-match__tier--eligible {
  border-color: rgba(var(--brand-primary-rgb), 0.35);
  background: rgba(var(--brand-primary-rgb), 0.08);
}
.page-team .team-match__tier-target { font-weight: 800; color: var(--ink); }
.page-team .team-match__tier-reward { font-weight: 800; color: var(--brand-primary); }
.page-team .team-match__tier-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.page-team .team-match__tier--earned .team-match__tier-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.page-team .team-match__tier--eligible .team-match__tier-badge {
  background: rgba(var(--brand-primary-rgb), 0.15);
  color: var(--brand-primary);
}
.page-team .team-match__tier--locked .team-match__tier-badge {
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
}

.page-team .level-bar {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border-soft);
}
.page-team .level-bar:last-child { border-bottom: 0; }
.page-team .level-bar__lvl {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 0.78rem;
}
.page-team .level-bar__title { font-weight: 700; font-size: 0.82rem; color: var(--ink); }
.page-team .level-bar__meter {
  height: 5px;
  border-radius: 999px;
  background: rgba(var(--brand-primary-rgb), 0.1);
  overflow: hidden;
  margin-top: 5px;
}
.page-team .level-bar__meter > span {
  display: block;
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 999px;
}
.page-team .level-bar__sub { font-size: 0.68rem; color: var(--muted); margin-top: 3px; }

.page-team .btree-wrap {
  overflow-x: auto;
  padding: 0.5rem 0.15rem 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.page-team .btree-root {
  display: flex;
  justify-content: center;
  min-width: max-content;
  padding: 0.15rem 0.35rem;
}
.page-team .btree-toolbar__hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.page-team .bt-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.3rem;
  position: relative;
}
.page-team .bt-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.page-team .bt-dot:hover,
.page-team .bt-dot:focus-visible {
  transform: scale(1.08);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.18);
  outline: none;
}
.page-team .bt-dot.is-active { border-color: #16a34a; color: #16a34a; }
.page-team .bt-dot.is-inactive { border-color: var(--muted); color: var(--muted); }
.page-team .bt-dot--empty {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  box-shadow: none;
}
.page-team .bt-dot--empty:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.page-team .bt-leg {
  margin-top: 2px;
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.page-team .bt-node[data-side="left"] > .bt-leg { color: #3b82f6; }
.page-team .bt-node[data-side="right"] > .bt-leg { color: var(--brand-primary); }
.page-team .bt-more {
  margin-top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-primary-rgb), 0.14);
  color: var(--brand-primary);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}
.page-team .bt-more:hover {
  background: var(--brand-primary);
  color: var(--neon-ink, #0a1400);
}
.page-team .bt-more.is-loading { opacity: 0.55; pointer-events: none; }
.page-team .bt-more.is-loading i { animation: btSpin 0.7s linear infinite; }
@keyframes btSpin { to { transform: rotate(360deg); } }

.page-team .bt-branch {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  position: relative;
}
.page-team .bt-branch::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 25%;
  right: 25%;
  height: 0.5rem;
  border-top: 1.5px solid var(--muted);
  border-left: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  opacity: 0.45;
  pointer-events: none;
}
.page-team .bt-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.page-team .bt-side::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 50%;
  width: 1.5px;
  height: 0.5rem;
  background: var(--muted);
  opacity: 0.45;
  transform: translateX(-50%);
}

.page-team .ui-section-card { margin-bottom: 0.85rem; }

/* Modal is fixed — also style when rendered from team page */
.bt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.bt-modal-backdrop.is-open { display: flex; }
.page-team .bt-modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-soft);
  border-radius: 20px 20px 16px 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: btSheet 0.2s ease-out;
}
@keyframes btSheet {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.page-team .bt-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.page-team .bt-modal__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: var(--neon-ink, #0a1400);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.page-team .bt-modal__title {
  font-weight: 800;
  font-size: 1rem;
  margin: 0;
  color: var(--ink);
}
.page-team .bt-modal__sub { font-size: 0.76rem; color: var(--muted); }
.page-team .bt-modal__close {
  margin-left: auto;
  border: 0;
  background: var(--icon-btn-bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.05rem;
}
.page-team .bt-modal__body { padding: 0.85rem 1rem 1rem; }
.page-team .bt-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.page-team .bt-stat {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
}
.page-team .bt-stat__label {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-team .bt-stat__value {
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 2px;
  word-break: break-all;
  color: var(--ink);
}
.page-team .bt-modal__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.page-team .bt-modal__loading,
.page-team .bt-modal__error {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.page-team .ui-feed-row .leg-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  margin-left: 4px;
  vertical-align: middle;
}
.page-team .ui-feed-row .leg-badge--left {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
.page-team .ui-feed-row .leg-badge--right {
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
}

/* =====================================================================
   Global user app — page headers & clarity
   ===================================================================== */
body.app-logged-in .app-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
body.app-logged-in .app-page-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
body.app-logged-in .app-page-head .sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.45;
  max-width: 28rem;
}
body.app-logged-in .ui-section-card__head {
  margin-bottom: 0.65rem;
}
body.app-logged-in .ui-empty {
  text-align: center;
  padding: 1.25rem 0.5rem;
  color: var(--muted);
}
body.app-logged-in .ui-empty i {
  font-size: 2rem;
  opacity: 0.45;
  display: block;
  margin-bottom: 0.5rem;
}
body.app-logged-in .ui-empty__title {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.92rem;
}
body.app-logged-in .ui-empty__sub {
  font-size: 0.74rem;
  margin-top: 0.25rem;
  line-height: 1.45;
}
body.app-logged-in .detail-card .head .title,
body.app-logged-in .invest-item .meta .name {
  font-weight: 800;
}
body.app-logged-in .detail-card .value-sub,
body.app-logged-in .invest-item .meta .sub {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.45;
}
