/* =========================================================================
   BinaryBot dashboard (/home/, and "/" for logged-in visitors)
   -------------------------------------------------------------------------
   Replaces style.css. Layout classes are all db-*; everything app.js touches
   keeps its original id / class (see the JS CONTRACT notes in index.html),
   and the reused pieces - modals, account rows, skeletons, log rows, the
   auto-trader status pill - are carried over from style.css.
   Icons are an inline SVG sprite (no icon font) to keep the page light.
   ========================================================================= */

@property --db-ang {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --db-sidebar-w: 256px;
  --db-topbar-h: 66px;
  --db-navy: #0b1733;
  --db-navy-line: rgba(255, 255, 255, 0.07);
  --db-bg: #eef2f7;
  --db-card: #ffffff;
  --db-line: #e6ebf2;
  --db-text: #0f172a;
  --db-muted: #64748b;
  --db-soft: #94a3b8;
  --db-radius: 16px;
  --db-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -16px rgba(16, 24, 40, 0.18);
  --db-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --db-tabbar-h: 62px;
  --db-safe-b: env(safe-area-inset-bottom, 0px);
  --db-ease: cubic-bezier(0.22, 1, 0.36, 1);

  --modal-bg: #ffffff;
  --modal-text: #1a1d29;
  --modal-text-secondary: #6b7280;
  --modal-border: #e5e7eb;
  --modal-input-focus: #2563eb;
  --modal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Android WebViews that already sit between the system bars (our Android app, most in-app
   browsers) can still report the bars' insets, so the gesture-bar gap under the tab bar was
   added twice. A normal browser tab is never under the status bar, so a top inset there means
   the insets are not real: ignore the bottom one too. iOS and installed (standalone) modes,
   where the page really is under the bars, keep the real value. */
@media (display-mode: browser) {
  @supports not (-webkit-touch-callout: none) {
    :root {
      --db-safe-b: max(0px, env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) * 100);
    }
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

input {
  -webkit-appearance: none;
  border: none;
  font: inherit;
}

img {
  max-width: 100%;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  font: 400 14px/1.5 var(--db-font);
  color: var(--db-text);
  background: var(--db-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* SVG icon (sprite) */
.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.125em;
}

/* ---------- Load-in motion ---------- */
@keyframes db-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes db-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes db-slide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.db-anim {
  animation: db-rise 0.55s var(--db-ease) backwards;
  animation-delay: calc(var(--d, 0) * 1ms);
}

.db-fresh {
  animation: db-fade 0.45s ease both;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.db-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--db-sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0c1a3a 0%, #0a1530 100%);
  border-right: 1px solid var(--db-navy-line);
  color: #cbd5e1;
  transition: transform 0.3s var(--db-ease);
}

.db-brand {
  display: flex;
  align-items: center;
  height: calc(var(--db-topbar-h) + 10px);
  padding: 0 22px;
  flex-shrink: 0;
}

.db-brand img {
  height: 46px;
  width: auto;
}

.db-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.db-nav ul {
  display: flex;
  flex-direction: column;
}

.db-nav li {
  animation: db-slide 0.45s var(--db-ease) backwards;
}

.db-nav li:nth-child(2) {
  animation-delay: 30ms;
}

.db-nav li:nth-child(3) {
  animation-delay: 60ms;
}

.db-nav li:nth-child(4) {
  animation-delay: 90ms;
}

.db-nav li:nth-child(5) {
  animation-delay: 120ms;
}

.db-nav li:nth-child(6) {
  animation-delay: 150ms;
}

.db-nav a,
.db-nav .db-nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 400;
  color: #cbd5e1;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.db-nav a:hover,
.db-nav .db-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.db-nav .db-ico {
  font-size: 1.02rem;
  color: #e2e8f0;
  width: 20px;
}

.db-nav .db-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.db-spark {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.db-tag {
  font-style: normal;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.35;
}

.db-tag.pro {
  background: linear-gradient(135deg, #ffd54a, #f59e0b);
  color: #1a1200;
}

.db-tag.free {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.db-nav-heading {
  margin: 22px 4px 10px;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
}

body:not(.logged-in) .db-acc-item {
  display: none;
  margin-top: 0.5em;
}

/* My Accounts accordion */
.db-nav .db-caret {
  margin-left: auto;
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform 0.25s var(--db-ease);
}

.db-nav-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.db-nav-btn[aria-expanded="true"] .db-caret {
  transform: rotate(180deg);
}

.db-side-accounts {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--db-ease);
}

.db-side-accounts.is-open {
  grid-template-rows: 1fr;
}

.db-side-accounts>div {
  overflow: hidden;
  min-height: 0;
}

.db-side-accounts-inner {
  padding: 6px 2px 8px 8px;
}

.db-sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--db-navy-line);
  flex-shrink: 0;
}

.db-sidebar-foot .logout-btn {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.875rem;
  font-weight: 500;
  color: #e2e8f0;
}

body.logged-in .db-sidebar-foot .logout-btn {
  display: flex;
}

.db-sidebar-foot .logout-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.db-sidebar-foot .logout-btn[style*="display: block"],
.db-sidebar-foot .logout-btn[style*="display: inline"] {
  display: flex !important;
}

.collapse-btn {
  display: none !important;
}

/* =========================================================================
   MAIN + TOP BAR
   ========================================================================= */
.db-main {
  margin-left: var(--db-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.db-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--db-topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: var(--db-navy);
  border-bottom: 1px solid var(--db-navy-line);
  color: #fff;
}

.toggle-mob-menu {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.06);
}

.db-acct {
  display: none;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.2;
}

body.logged-in .db-acct {
  display: flex;
}

.db-acct-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

#account_balance {
  font-size: 0.8rem;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

#account_id {
  font-size: 1.12rem;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.real-acc,
.virtual-acc {
  display: none;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.35;
}

.virtual-acc {
  background: #fbbf24;
  color: #1a1200;
}

.real-acc {
  background: #22c55e;
  color: #fff;
}

.db-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not(.logged-in) .db-topbar-right {
  flex: 1;
  margin-left: 0;
}

/* Logged out: full-width login CTA */
#login_div {
  display: none;
}

body:not(.logged-in) #login_div {
  display: block;
  flex: 1;
}

#logintobtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: filter 0.2s ease, transform 0.2s ease;
}

#logintobtn:hover {
  filter: brightness(1.08);
}

.db-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 1.1rem;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.db-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.db-bell-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--db-navy);
}

.db-bell-dot[hidden] {
  display: none;
}

/* Account chip */
.db-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 10px 5px 6px;
  border-radius: 14px;
  color: #fff;
  text-align: left;
  transition: background 0.2s ease;
}

.db-user:hover,
.db-user[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
}

body:not(.logged-in) .db-user {
  display: none;
}

.db-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.db-avatar .ic {
  font-size: 1rem;
}

.db-avatar.is-demo {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
  color: #1a1200;
}

.db-avatar.is-real {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.db-avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--db-navy);
}

.db-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
  min-width: 0;
}

.db-user-text b {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.db-user-text small {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
}

.db-user .db-chev {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-left: 8px;
  transition: transform 0.25s var(--db-ease);
}

.db-user[aria-expanded="true"] .db-chev {
  transform: rotate(180deg);
}

/* loading state (until app.js writes the account) */
.db-user.is-loading {
  pointer-events: none;
}

.db-user.is-loading .db-avatar {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  overflow: hidden;
}

.db-user.is-loading .db-avatar>* {
  visibility: hidden;
}

.db-user.is-loading .db-avatar::after {
  display: none;
}

.db-user.is-loading .db-avatar::before,
.db-sk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: translateX(-100%);
  animation: db-shimmer 1.4s infinite;
}

.db-sk {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

@keyframes db-shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Popovers / sheets (lifted to <body> by the UI script) ---------- */
.db-pop {
  position: fixed;
  top: calc(var(--db-topbar-h) - 6px);
  right: 24px;
  z-index: 9002;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #0f1d3f;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 48px -16px rgba(2, 6, 23, 0.55);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.28s var(--db-ease), visibility 0.28s;
}

.db-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.db-pop-grab {
  display: none;
}

.db-pop-title {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin: 2px 4px 10px;
}

.db-pop-bell {
  right: 196px;
  width: 300px;
}

.db-news {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-news a {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.db-news a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.db-news-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.db-news b {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.db-news span {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
}

.sidebar-account-details {
  display: none;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

body.logged-in .sidebar-account-details {
  display: block;
}

#account_balance_sidebar {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: #94a3b8;
}

#account_id_sidebar {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

#account_lits_con {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 280px;
  overflow-y: auto;
}

#account_lits_con li {
  list-style: none;
  animation: db-rise 0.4s var(--db-ease) backwards;
}

#account_lits_con li:nth-child(2) {
  animation-delay: 40ms;
}

#account_lits_con li:nth-child(3) {
  animation-delay: 80ms;
}

#account_lits_con li:nth-child(4) {
  animation-delay: 120ms;
}

#account_lits_con li>a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  font-size: 0.8rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#account_lits_con li>a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

#account_lits_con li.account-active>a {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.08));
  border-color: rgba(96, 165, 250, 0.5);
}

#account_lits_con li.account-active .account-loginid {
  color: #93c5fd;
}

#account_lits_con li.account-active .account-check {
  opacity: 1;
}

.db-pop-logout {
  display: none;
  margin-top: 10px;
}

body.logged-in .db-pop-logout {
  display: flex;
}

.db-pop-logout a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-weight: 500;
  font-size: 0.8rem;
}

.db-pop-logout a:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.account-avatar.is-real {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.1));
  color: #10b981;
}

.account-avatar.is-demo {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(245, 158, 11, 0.1));
  color: #f59e0b;
}

.account-avatar-icon {
  display: block;
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.account-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  gap: 1px;
}

.account-line-1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-loginid {
  font-size: 0.78rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.account-type-pill {
  font-size: 0.52rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.4;
}

.account-type-pill.pill-real {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.account-type-pill.pill-demo {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.account-currency {
  font-size: 0.64rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.45);
}

.account-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #60a5fa;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.currency-icon {
  width: 1.1em;
  height: 1.1em;
}

/* =========================================================================
   CONTENT (full width; footer pinned to the bottom)
   ========================================================================= */
.db-content {
  flex: 1;
  padding: 18px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* ---------- Hero (compact) ---------- */
.db-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(250px, 300px);
  align-items: center;
  gap: 24px;
  padding: 20px 30px;
  border-radius: var(--db-radius);
  color: #fff;
  background:
    radial-gradient(360px 200px at 52% 55%, rgba(59, 130, 246, 0.32), transparent 70%),
    linear-gradient(120deg, #081330 0%, #0f2455 52%, #081330 100%);
  box-shadow: 0 20px 40px -24px rgba(11, 23, 51, 0.7);
}

.db-hero>* {
  min-width: 0;
}

.db-hero-candles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  pointer-events: none;
}

.db-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.db-hero-eyebrow {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #93a4c3;
  margin-bottom: 6px;
}

.db-hero h1 {
  font-size: clamp(1.4rem, 1.9vw, 1.95rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.db-hero h1 .db-accent {
  color: #60a5fa;
}

.db-hero-lead {
  font-size: 0.82rem;
  color: #c3cee2;
  max-width: 460px;
  margin-bottom: 14px;
}

.db-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.db-btn:hover {
  transform: translateY(-1px);
}

.db-btn:active {
  transform: translateY(0) scale(0.98);
}

.db-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(59, 130, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.db-btn-primary:hover {
  filter: brightness(1.08);
}

.db-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.db-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.db-hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.db-bubble {
  position: relative;
  width: 168px;
  height: 168px;
  flex-shrink: 0;
}

.db-bubble svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 16px 26px rgba(2, 6, 23, 0.55));
}

.db-bot {
  animation: db-float 5.5s ease-in-out infinite;
  transform-origin: 50% 60%;
  transform-box: fill-box;
}

@keyframes db-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.db-eye {
  animation: db-blink 5s infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes db-blink {

  0%,
  92%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0.12);
  }
}

.db-chips {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.db-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(30, 58, 138, 0.28) 55%, rgba(15, 23, 42, 0.35) 100%);
  border: 1px solid rgba(147, 197, 253, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -8px 16px -12px rgba(59, 130, 246, 0.6), 0 10px 20px -14px rgba(2, 6, 23, 0.9);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.db-chip:hover {
  border-color: rgba(147, 197, 253, 0.55);
  transform: translateX(2px);
}

.db-chip .ic {
  font-size: 1.05rem;
  color: #60a5fa;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.55));
}

.db-chip.is-green .ic {
  color: #34d399;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.55));
}

.db-card {
  background: var(--db-card);
  border: 1px solid var(--db-line);
  border-radius: var(--db-radius);
  box-shadow: var(--db-shadow);
}

/* ---------- AI Auto Trader panel (inside the hero) ---------- */
.db-hero-trader {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.16) 0%, rgba(15, 23, 42, 0.45) 100%);
  border: 1px solid rgba(147, 197, 253, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px -22px rgba(2, 6, 23, 0.9);
}

.at-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.at-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.at-logo-spark {
  width: 20px;
  height: 20px;
  fill: #e0f2fe;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.6));
}

.at-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.at-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.at-meta {
  font-size: 0.66rem;
  color: #93a4c3;
  white-space: nowrap;
}

.tx-card-profit.at-pl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.at-pl.at-pos {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.at-pl.at-neg {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.at-pl-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93a4c3;
  font-weight: 500;
}

.at-pl-value {
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.at-pos .at-pl-num {
  color: #4ade80;
}

.at-neg .at-pl-num {
  color: #f87171;
}

/* status pill (app.js sets className = "at-status <state>") */
.at-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  white-space: nowrap;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.at-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.at-status.idle { color: #94a3b8; }
.at-status.starting { color: #38bdf8; }
.at-status.running { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); background: rgba(34, 197, 94, 0.12); }
.at-status.running .at-status-dot { animation: at-dot-pulse 1400ms infinite; }
.at-status.paused { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.1); }

@keyframes at-dot-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  75% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, transparent); }
}

.live-indicator-analyzing,
.live-indicator-open-trade {
  display: none !important;
}

/* ---------- Hero Start / Stop (the real #StartAutoTrading / #StopAutoTrading) ---------- */
.db-btn-ai {
  position: relative;
  isolation: isolate;
  min-width: 200px;
  min-height: 44px;
  padding: 0 24px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 14px 30px -14px rgba(59, 130, 246, 1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.db-btn-ai:hover {
  filter: brightness(1.08);
}

/* running border */
.db-btn-ai::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 2px;
  pointer-events: none;
  background: conic-gradient(from var(--db-ang), transparent 0deg, transparent 200deg, rgba(103, 232, 249, 0.35) 250deg, #67e8f9 305deg, #ffffff 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: db-orbit 2.6s linear infinite;
}

/* soft light sweep */
.db-btn-ai::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat;
  animation: db-sweep 3.4s ease-in-out infinite;
}

@keyframes db-sweep {
  0%, 55% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.db-ai-ic {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.75));
}

.db-ai-twinkle,
.db-ai-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: db-twinkle 2.2s ease-in-out infinite;
}

.db-ai-dot {
  animation-delay: 1.1s;
}

@keyframes db-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

.db-btn-stop {
  min-width: 200px;
  min-height: 44px;
  padding: 0 24px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 14px 30px -14px rgba(239, 68, 68, 1);
  animation: db-stop-pulse 1.8s ease-in-out infinite;
}

.db-btn-stop svg.icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

@keyframes db-stop-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55), 0 14px 30px -14px rgba(239, 68, 68, 1); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0), 0 14px 30px -14px rgba(239, 68, 68, 1); }
}

.disabledbtn {
  pointer-events: none;
  cursor: default;
  opacity: 0.6;
}

/* logged-out: the button opens the login dialog instead of being greyed out */
body:not(.logged-in) #StartAutoTrading.disabledbtn {
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
}

/* ---------- Activity log row (full width) ---------- */
.db-log-row .db-log-wrap {
  height: 188px;
}

/* ---------- Activity log ---------- */
.db-log-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.db-log {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 14px 16px 10px;
  border-radius: var(--db-radius);
  background: linear-gradient(180deg, #0b1733 0%, #0a142c 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 36px -22px rgba(2, 6, 23, 0.8);
  color: #cbd5e1;
}

.db-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.db-log-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.db-log-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: at-dot-pulse 2s infinite;
  color: #22c55e;
}

.db-log-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.db-log-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #4ade80;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.db-log-close {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.95rem;
  align-items: center;
  justify-content: center;
}

.db-log-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.msgoutput {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 2px 4px;
  text-align: left;
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.6;
  letter-spacing: -0.2px;
  font-family: "SF Mono", "JetBrains Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.msgoutput>div {
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msgoutput>div:first-child {
  animation: db-rise 0.35s var(--db-ease) backwards;
}

.msgoutput>div b {
  font-weight: 600;
}

.msgoutput::-webkit-scrollbar {
  width: 6px;
}

.msgoutput::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 8px;
}

.lg-ic {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  fill: currentColor;
  vertical-align: -0.15em;
  margin-right: 5px;
}

.lg-sep {
  color: #64748b;
  margin: 0 5px;
  font-style: normal;
}

.db-log-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  flex-shrink: 0;
}

.db-log-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #cbd5e1;
  padding: 4px 6px;
  border-radius: 6px;
}

.db-log-more:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.db-log-more .ic {
  transition: transform 0.2s ease;
}

.db-log-more:hover .ic {
  transform: translateX(3px);
}

.db-log.is-expanded {
  position: fixed;
  z-index: 9001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, 94vw);
  height: min(640px, 84vh);
  box-shadow: 0 40px 80px -20px rgba(2, 6, 23, 0.9);
  animation: db-fade 0.25s ease both;
}

.db-log.is-expanded .msgoutput {
  font-size: 0.78rem;
}

.db-log.is-expanded .msgoutput>div {
  white-space: normal;
}

.db-log.is-expanded .db-log-close {
  display: inline-flex;
}

.db-log.is-expanded .db-log-foot {
  display: none;
}

.db-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.db-backdrop.is-on {
  opacity: 1;
  visibility: visible;
}

/* ---------- Trading tools ---------- */
.db-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.db-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-section-title .db-cube {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.db-section-title h2 {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--db-text);
  line-height: 1.2;
}

.db-section-title p {
  font-size: 0.76rem;
  color: var(--db-muted);
}

.db-pager {
  display: inline-flex;
  border-radius: 10px;
  background: var(--db-card);
  border: 1px solid var(--db-line);
  box-shadow: var(--db-shadow);
  overflow: hidden;
}

.db-pager button {
  width: 40px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--db-text);
  font-size: 0.78rem;
  transition: background 0.2s ease;
}

.db-pager button+button {
  border-left: 1px solid var(--db-line);
}

.db-pager button:hover:not(:disabled) {
  background: #f1f5f9;
}

.db-pager button:disabled {
  color: #cbd5e1;
  cursor: default;
}

.db-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 16px;
  padding-top: 9px;
}

.db-tools>* {
  min-width: 0;
}

.db-tool {
  --ac: #1e293b;
  --tint: #f1f5f9;
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  padding: 16px 16px 0;
  border-radius: 14px;
  background:
    radial-gradient(220px 130px at 100% 0%, color-mix(in srgb, var(--ac) 9%, transparent), transparent 72%),
    linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid var(--db-line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 26px -18px rgba(16, 24, 40, 0.22);
  transition: transform 0.25s var(--db-ease), box-shadow 0.25s ease, border-color 0.25s ease;
  animation: db-rise 0.5s var(--db-ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}

/* faint dotted texture + accent sparkline in the corner */
.db-tool::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 41px;
  width: 40%;
  height: 30px;
  z-index: -1;
  pointer-events: none;
  background: color-mix(in srgb, var(--ac) 13%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46' preserveAspectRatio='none'%3E%3Cpath d='M2 40 L22 33 L38 36 L56 24 L74 28 L92 15 L110 20 L128 9 L146 12 L158 4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46' preserveAspectRatio='none'%3E%3Cpath d='M2 40 L22 33 L38 36 L56 24 L74 28 L92 15 L110 20 L128 9 L146 12 L158 4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  transition: background 0.3s ease;
}

.db-tool:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ac) 28%, #e6ebf2);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 20px 36px -20px color-mix(in srgb, var(--ac) 45%, rgba(16, 24, 40, 0.35));
}

.db-tool:hover::after {
  background: color-mix(in srgb, var(--ac) 26%, transparent);
}

.db-tool.is-hidden {
  display: none;
}

.db-tool-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.db-tool-ic {
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -4px 8px rgba(0, 0, 0, 0.18), 0 10px 18px -10px var(--ac);
}

.db-tool-ic::before {
  content: '';
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.bi {
  position: relative;
  width: 34px;
  height: 34px;
  display: block;
}

.db-tool-text {
  flex: 1;
  min-width: 0;
}

.db-tool h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--db-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-tool p {
  font-size: 0.72rem;
  color: var(--db-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-tool-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--db-text);
  font-size: 0.74rem;
  box-shadow: 0 2px 6px -3px rgba(15, 23, 42, 0.2);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--db-ease);
}

.db-tool:hover .db-tool-arrow {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
  transform: translateX(2px);
}

.db-tool-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px -16px 0;
  padding: 10px 16px;
  border-top: 1px solid color-mix(in srgb, var(--ac) 10%, #eef2f7);
  border-radius: 0 0 13px 13px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 7%, #fff) 0%, rgba(255, 255, 255, 0) 75%);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ac);
}

.db-tool-cta .ic {
  font-size: 0.7rem;
  transition: transform 0.25s var(--db-ease);
}

.db-tool:hover .db-tool-cta .ic {
  transform: translateX(4px);
}

/* Popular: thin running border on the badge only */
.db-badge.b-popular {
  isolation: isolate;
}

.db-badge.b-popular::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(from var(--db-ang), transparent 0deg, transparent 200deg, rgba(244, 63, 94, 0.3) 250deg, #f43f5e 310deg, #fb7185 340deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: db-orbit 2.4s linear infinite;
}

@keyframes db-orbit {
  to {
    --db-ang: 360deg;
  }
}

/* badges */
.db-badge {
  position: absolute;
  top: -9px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.3;
  box-shadow: 0 0 0 2px var(--db-card), 0 4px 10px -4px rgba(15, 23, 42, 0.25);
}

.db-badge .ic {
  font-size: 0.6rem;
}

.b-popular {
  background: #ffe4e6;
  color: #e11d48;
}

.b-new {
  background: #e0e7ff;
  color: #4338ca;
  animation: db-shake 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes db-shake {

  0%,
  78%,
  100% {
    transform: rotate(0);
  }

  82% {
    transform: rotate(-9deg) scale(1.06);
  }

  86% {
    transform: rotate(8deg) scale(1.06);
  }

  90% {
    transform: rotate(-6deg);
  }

  94% {
    transform: rotate(4deg);
  }

  97% {
    transform: rotate(-2deg);
  }
}

/* On Fire: hot gradient pill, flickering flame, glow pulse and rising embers */
.b-fire {
  overflow: visible;
  background: linear-gradient(90deg, #f97316, #ef4444, #f59e0b, #f97316);
  background-size: 300% 100%;
  color: #fff;
  text-shadow: 0 1px 1px rgba(127, 29, 29, 0.45);
  animation: db-fire-flow 3s linear infinite, db-fire-glow 1.6s ease-in-out infinite;
}

.b-fire .fire-ic {
  display: inline-flex;
  color: #fef08a;
  transform-origin: 50% 100%;
  animation: db-flame 0.9s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 3px rgba(254, 240, 138, 0.9));
}

.b-fire .ember {
  position: absolute;
  bottom: 60%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 4px 1px rgba(249, 115, 22, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: db-ember 1.8s ease-out infinite;
}

.b-fire .ember:nth-of-type(1) { left: 14%; animation-delay: 0s; }
.b-fire .ember:nth-of-type(2) { left: 48%; animation-delay: 0.6s; }
.b-fire .ember:nth-of-type(3) { left: 80%; animation-delay: 1.2s; }

@keyframes db-fire-flow {
  to { background-position: 300% 0; }
}

@keyframes db-fire-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--db-card), 0 0 6px 0 rgba(249, 115, 22, 0.45); }
  50% { box-shadow: 0 0 0 2px var(--db-card), 0 0 14px 3px rgba(239, 68, 68, 0.6); }
}

@keyframes db-flame {
  0% { transform: scale(1, 1) rotate(-4deg); }
  50% { transform: scale(1.08, 1.18) rotate(3deg); }
  100% { transform: scale(0.95, 1.08) rotate(-2deg); }
}

@keyframes db-ember {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(3px, -16px) scale(0.3); opacity: 0; }
}

.b-hot {
  background: #ffedd5;
  color: #ea580c;
}

.b-trending {
  background: #dcfce7;
  color: #15803d;
}

.b-pro {
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #78350f;
}

.b-ai {
  background: #ede9fe;
  color: #6d28d9;
}

.b-fast {
  background: #cffafe;
  color: #0e7490;
}

.b-classic {
  background: #f1f5f9;
  color: #475569;
}

.b-top {
  background: #fef9c3;
  color: #a16207;
}

.c-maroon {
  background: linear-gradient(135deg, #8b1330, #4a0613);
}

.c-blue {
  background: linear-gradient(135deg, #2574e6, #1150b8);
}

.c-black {
  background: linear-gradient(135deg, #2b2b2e, #111113);
}

.c-green {
  background: linear-gradient(135deg, #2e9a3e, #1f7a2c);
}

.c-teal {
  background: linear-gradient(135deg, #2a6f8f, #164a66);
}

.c-red {
  background: linear-gradient(135deg, #ea5a4f, #c0392b);
}

.c-emerald {
  background: linear-gradient(135deg, #1f8f3a, #166b2b);
}

.c-charcoal {
  background: linear-gradient(135deg, #3a3a3d, #1f1f22);
}

.c-violet {
  background: linear-gradient(135deg, #7552e0, #4c2fb0);
}

.c-indigo {
  background: linear-gradient(135deg, #5850ec, #3730a3);
}

.c-olive {
  background: linear-gradient(135deg, #43864a, #2a5a2c);
}

.db-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.db-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 34px;
  border-radius: 999px;
  background: #e8edf5;
  border: 1px solid #dde4ee;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--db-text);
  transition: background 0.2s ease, transform 0.2s ease;
}

.db-more:hover {
  background: #dfe6f0;
  transform: translateY(-1px);
}

.db-more[hidden] {
  display: none;
}

/* ---------- Footer (compact, bottom of the page) ---------- */
.db-foot {
  margin: auto -24px 0;
  padding: 8px 24px;
  border-top: 1px solid var(--db-line);
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 18px;
  font-size: 0.66rem;
  color: var(--db-muted);
}

.db-content>.db-foot {
  margin-top: auto;
}

.db-foot-links,
.db-foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
}

.db-foot a {
  color: var(--db-muted);
  transition: color 0.2s ease;
}

.db-foot a:hover {
  color: var(--db-text);
}

.db-foot-risk {
  flex-basis: 100%;
  font-size: 0.58rem;
  color: var(--db-soft);
  line-height: 1.45;
}

.db-spacer {
  flex: 0 0 8px;
}

.db-tabbar {
  display: none;
}

/* =========================================================================
   DIALOGS - original light colours; dashboard font (Poppins) and shapes only.
   Toasts keep their own shared styling (/css/bb-toast.css).
   ========================================================================= */
.modal-window {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.modal-window:target {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal-window>div {
  width: 92%;
  max-width: 420px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  padding: 26px 26px 24px;
  font-family: var(--db-font);
  color: var(--modal-text);
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.35);
  transition: transform 0.4s var(--db-ease), opacity 0.3s ease;
}

.modal-window:target>div {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--modal-text-secondary);
  font-size: 1.3rem;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  color: var(--modal-text);
  background: #f3f4f6;
}

.modal-window div:not(:last-of-type) {
  margin-bottom: 14px;
}

.modal-heading {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 36px 18px 0;
  color: var(--modal-text);
  line-height: 1.3;
}

.modal-description {
  color: var(--modal-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.modal-form-group {
  margin-bottom: 14px;
}

.modal-label {
  display: block;
  color: var(--modal-text);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.settingsinput {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--db-font);
  color: var(--modal-text);
  background: var(--modal-bg);
  border: 2px solid var(--modal-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settingsinput:focus {
  border-color: var(--modal-input-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.settingsinput::placeholder {
  color: var(--modal-text-secondary);
}

.modal-actions {
  margin-top: 20px;
}

.modal-actions-flex {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  background: #1e3a8a;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -8px rgba(37, 99, 235, 0.85);
  color: #fff;
}

.modal-primary-btn img {
  filter: brightness(0) invert(1);
}

.modal-secondary-btn,
.modal-danger-btn {
  flex: 1;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-secondary-btn {
  color: var(--modal-text);
  background: #f9fafb;
  border: 1px solid var(--modal-border);
}

.modal-secondary-btn:hover {
  background: #e5e7eb;
  color: var(--modal-text);
}

.modal-danger-btn {
  color: #fff;
  background: #1e3a8a;
  box-shadow: 0 8px 20px -8px rgba(30, 58, 138, 0.6);
}

.modal-danger-btn:hover {
  background: #16306e;
  color: #fff;
}

/* Deriv login dialog */
.oauth-modal {
  background: rgba(0, 0, 0, 0.6);
}

.modal-window.oauth-modal>div {
  max-width: 460px;
  text-align: center;
  padding: 30px 26px 26px;
}

.oauth-modal .modal-close {
  background: #f3f4f6;
  border-radius: 50%;
}

.oauth-modal-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 500;
  color: #111827;
  margin: 0 0 6px;
  line-height: 1.35;
}

.oauth-modal-logo {
  height: 28px;
  width: auto;
}

.oauth-modal-subtitle {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0 auto 20px;
}

.oauth-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0 !important;
}

.oauth-modal-btn {
  position: relative;
  flex: 1 1 auto;
  min-width: max-content;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  font-family: var(--db-font);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.oauth-modal-btn-primary {
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  box-shadow: 0 6px 18px -6px rgba(22, 33, 62, 0.6);
}

.oauth-modal-btn-secondary {
  background: linear-gradient(135deg, #ef4444 0%, #f5576c 100%);
  box-shadow: 0 6px 18px -6px rgba(245, 87, 108, 0.55);
}

.oauth-modal-btn:hover {
  transform: translateY(-2px);
}

.oauth-modal-btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.oauth-modal-btn.loading .oauth-modal-btn-label,
.oauth-modal-btn.loading .ic {
  visibility: hidden;
}

.oauth-modal-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: oauth-modal-spin 1s linear infinite;
}

@keyframes oauth-modal-spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
   SKELETONS
   ========================================================================= */
@keyframes skeleton-pulse {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200px 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}

.skeleton-text {
  height: 12px;
  width: 96px;
}

.skeleton-text-lg {
  height: 18px;
  width: 130px;
}

.skeleton-account-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.skeleton-account-item .skeleton-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.skeleton-account-item .skeleton-line {
  height: 12px;
  width: 150px;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

@media (max-width: 1400px) {
  .db-chips {
    display: none;
  }

  .db-hero {
    grid-template-columns: minmax(0, 1fr) auto minmax(240px, 280px);
  }
}

@media (max-width: 1180px) {
  .db-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .db-hero-art {
    display: none;
  }

  .db-hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }
}

@media (max-width: 1024px) {
  .db-sidebar {
    transform: translateX(-100%);
    z-index: 80;
  }

  .mob-menu-opened .db-sidebar {
    transform: translateX(0);
  }

  .mob-menu-opened .menu-overlay {
    opacity: 1;
    visibility: visible;
    z-index: 75;
  }

  .mob-menu-opened {
    overflow: hidden;
  }

  .db-main {
    margin-left: 0;
  }

  .toggle-mob-menu {
    display: inline-flex;
  }

  .db-topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .db-content {
    padding: 16px 16px 0;
  }

  .db-foot {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .db-hero {
    grid-template-columns: 1fr;
  }

  .db-hero-trader {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .db-pop,
  .db-pop-bell {
    right: 16px;
  }
}

/* Phone: compact, native-feel layout with a bottom tab bar */
@media (max-width: 760px) {
  :root {
    --db-topbar-h: 56px;
  }

  body {
    font-size: 13px;
    background: #f2f5f9;
  }

  .db-main {
    padding-bottom: calc(var(--db-tabbar-h) + var(--db-safe-b));
  }

  .toggle-mob-menu {
    display: none;
  }

  .db-topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .db-acct-line {
    gap: 6px;
  }

  #account_balance {
    font-size: 0.7rem;
  }

  #account_id {
    font-size: 0.96rem;
    margin-top: 1px;
  }

  .real-acc,
  .virtual-acc {
    font-size: 0.55rem;
    padding: 1px 6px;
  }

  .db-topbar-right {
    gap: 4px;
  }

  .db-icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .db-bell-dot {
    top: 8px;
    right: 9px;
  }

  .db-user {
    padding: 3px;
    gap: 0;
  }

  .db-user-text,
  .db-user .db-chev {
    display: none;
  }

  .db-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.76rem;
  }

  .db-avatar::after {
    width: 9px;
    height: 9px;
  }

  #logintobtn {
    min-height: 38px;
    font-size: 0.78rem;
    border-radius: 10px;
  }

  .db-content {
    padding: 10px 12px 0;
    gap: 12px;
  }

  .db-foot {
    margin: auto -12px 0;
    padding: 8px 12px 10px;
    font-size: 0.62rem;
    justify-content: flex-start;
  }

  .db-foot-risk {
    font-size: 0.56rem;
  }

  .db-hero {
    padding: 16px 14px;
    border-radius: 14px;
    gap: 0;
  }

  .db-hero-art {
    display: none;
  }

  .db-hero-eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    margin-bottom: 4px;
  }

  .db-hero h1 {
    font-size: 1.28rem;
    margin-bottom: 6px;
  }

  .db-hero-lead {
    font-size: 0.74rem;
    margin-bottom: 12px;
  }

  .db-hero-cta {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .db-hero-cta .db-btn {
    flex: 1 1 0;
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.76rem;
    border-radius: 10px;
  }

  .db-card,
  .db-log {
    border-radius: 14px;
  }

  .db-hero-cta {
    flex-wrap: wrap;
  }

  .db-btn-ai,
  .db-btn-stop {
    min-width: 0;
    flex: 1 1 100% !important;
    min-height: 42px !important;
    font-size: 0.82rem !important;
  }

  .db-hero-trader {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
  }

  .db-hero-trader .at-head {
    align-items: center;
  }

  .at-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .at-logo-spark {
    width: 16px;
    height: 16px;
  }

  .at-title {
    font-size: 0.82rem;
  }

  .at-meta {
    font-size: 0.6rem;
  }

  .at-status {
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .tx-card-profit.at-pl {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
  }

  .at-pl-value {
    font-size: 1.05rem;
  }

  .modal-window>div {
    padding: 22px 18px 18px;
  }

  .db-log-wrap {
    height: 190px;
  }

  .db-log {
    padding: 12px 12px 8px;
  }

  .db-log-title {
    font-size: 0.64rem;
  }

  .msgoutput {
    font-size: 0.64rem;
  }

  .db-log-more {
    font-size: 0.68rem;
  }

  .db-log.is-expanded {
    width: 100vw;
    height: 82vh;
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    border-radius: 18px 18px 0 0;
  }

  .db-section-head {
    margin-bottom: 8px;
  }

  .db-section-title {
    gap: 9px;
  }

  .db-section-title .db-cube {
    width: 26px;
    height: 26px;
  }

  .db-section-title h2 {
    font-size: 0.98rem;
  }

  .db-section-title p {
    display: none;
  }

  .db-pager {
    display: none;
  }

  .db-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }

  .db-tool {
    padding: 11px 11px 0;
    border-radius: 12px;
  }

  .db-tool::after {
    bottom: 34px;
    height: 30px;
    width: 70%;
  }

  .bi {
    width: 19px;
    height: 19px;
  }

  .db-tool:hover {
    transform: none;
  }

  .db-tool-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .db-tool-ic {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
    border-radius: 9px;
  }

  .db-tool-arrow {
    width: 26px;
    height: 26px;
    font-size: 0.64rem;
    margin-left: auto;
  }

  .db-tool-text {
    flex: 1 0 100%;
    order: 3;
  }

  .db-tool h3 {
    font-size: 0.78rem;
  }

  .db-tool p {
    font-size: 0.64rem;
  }

  .db-tool-cta {
    margin: 12px -11px 0;
    padding: 8px 11px;
    font-size: 0.68rem;
    border-radius: 0 0 11px 11px;
  }

  .db-badge {
    top: -8px;
    right: 8px;
    font-size: 0.5rem;
    padding: 2px 6px;
  }

  .db-more {
    min-height: 38px;
    padding: 0 22px;
    font-size: 0.76rem;
  }

  .db-pop,
  .db-pop-bell {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(18px + var(--db-safe-b));
    transform: translateY(100%);
    opacity: 1;
    transform-origin: bottom;
  }

  .db-pop.is-open {
    transform: translateY(0);
  }

  .db-pop-grab {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 4px auto 12px;
  }

  #account_lits_con {
    max-height: 46vh;
  }

  #account_lits_con li>a {
    padding: 10px 12px;
  }

  .db-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    height: calc(var(--db-tabbar-h) + var(--db-safe-b));
    padding-bottom: var(--db-safe-b);
    background: var(--db-navy);
    border-top: 1px solid var(--db-navy-line);
  }

  .db-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.6rem;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.2s ease;
  }

  .db-tab .ic {
    font-size: 1.05rem;
  }

  .db-tab.is-active {
    color: #60a5fa;
  }

  .db-tab-orb {
    width: 42px;
    height: 42px;
    margin-top: -18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(59, 130, 246, 0.9), 0 0 0 4px #0b1733;
  }

  .db-tab-orb .ic {
    font-size: 0.95rem;
  }

  .modal-window>div {
    padding: 1.5rem 1.2rem;
  }

  .modal-heading {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .db-tools {
    gap: 16px 8px;
  }

  .db-hero h1 {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Account chip avatar icon ($ real / flask demo) - same glyphs as the account rows */
.db-avatar .db-av-ic {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

@media (max-width: 760px) {
  .db-avatar .db-av-ic {
    width: 15px;
    height: 15px;
  }
}

/* ---------- Phone/tablet: robot as a soft hero background ---------- */
@media (max-width: 1024px) {
  .db-hero-art {
    display: block;
    position: absolute;
    top: -6px;
    right: -26px;
    z-index: 0;
    opacity: 0.32;
    pointer-events: none;
  }

  .db-hero-art .db-chips {
    display: none;
  }

  .db-hero-art .db-bubble {
    width: 190px;
    height: 190px;
  }

  .db-hero-copy,
  .db-hero-trader {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 760px) {
  .db-hero-art {
    top: -4px;
    right: -34px;
    opacity: 0.3;
  }

  .db-hero-art .db-bubble {
    width: 168px;
    height: 168px;
  }

  /* console: hidden until a run starts or the Console tab is tapped */
  .db-log-row {
    display: none;
  }

  body.db-console-open .db-log-row {
    display: block;
    animation: db-rise 0.35s var(--db-ease) backwards;
  }

  .db-tab {
    position: relative;
  }

  .db-tab-dot {
    position: absolute;
    top: 9px;
    left: calc(50% + 6px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px #0b1733;
  }

  .db-tab-dot[hidden] {
    display: none;
  }
}

/* Robot icons: slightly larger so each bot's feature stays legible */
@media (max-width: 760px) {
  .db-tool-ic {
    width: 40px !important;
    height: 40px !important;
  }

  .bi {
    width: 28px !important;
    height: 28px !important;
  }
}
/* Function badge on each bot tile */
.db-tool-ic {
  overflow: visible !important;
}

.db-tool-ic::before {
  border-radius: inherit;
}

.db-fx {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ac);
  box-shadow: 0 0 0 2px #fff, 0 4px 10px -3px rgba(15, 23, 42, 0.35);
  transition: transform 0.25s var(--db-ease);
}

.db-fx svg {
  width: 13px;
  height: 13px;
  display: block;
}

.db-tool:hover .db-fx {
  transform: scale(1.12) rotate(-6deg);
}

.db-tool-head {
  gap: 14px;
}

@media (max-width: 760px) {
  .db-fx {
    width: 18px;
    height: 18px;
    right: -5px;
    bottom: -5px;
  }

  .db-fx svg {
    width: 11px;
    height: 11px;
  }
}
/* Account block tap target + new/popular bell list */
.db-acct-chev {
  display: none;
}

@media (max-width: 1024px) {
  body.logged-in .db-acct {
    cursor: pointer;
    padding: 4px 8px 4px 0;
    border-radius: 10px;
    -webkit-user-select: none;
    user-select: none;
  }

  body.logged-in .db-acct:active {
    opacity: 0.75;
  }

  body.logged-in .db-acct-chev {
    display: block;
    align-self: center;
    margin-left: -6px;
    font-size: 0.7rem;
    color: #94a3b8;
  }
}

.db-pop-title-2 {
  margin-top: 14px;
}

.db-news-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 6px rgba(0, 0, 0, 0.18);
}

.db-news-ic .bi {
  width: 24px;
  height: 24px;
}

.db-news b {
  display: flex;
  align-items: center;
  gap: 6px;
}

.db-news-tag {
  font-style: normal;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.5;
}

.db-news-tag.b-new {
  animation: none;
}

/* =========================================================================
   GIFT PACK BANNER (gift.js) - invite for traders NOT yet tagged to us.
   Default: a slim card inside the hero copy, between the lead and the buttons.
   Wide desktop: a panel at the hero's right edge that never makes it taller.
   ========================================================================= */
.db-gift {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 2px;
  max-width: 480px;
  max-height: 180px;
  margin: 0 0 14px;
  padding: 9px 6px 9px 14px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(196, 181, 253, 0.6);
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(150px 110px at 76% 50%, rgba(192, 132, 252, 0.42), transparent 70%),
    linear-gradient(115deg, #1c0d4f 0%, #33168a 55%, #5220ad 100%);
  box-shadow: 0 16px 30px -18px rgba(76, 29, 149, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: max-height 0.6s var(--db-ease), margin 0.6s var(--db-ease), padding 0.6s var(--db-ease),
    opacity 0.45s ease, transform 0.6s var(--db-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

.db-gift:not(.is-in) {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

/* It arrives under the pointer: taps land only once it has settled. */
.db-gift:not(.is-ready) {
  pointer-events: none;
}

.db-gift:hover {
  border-color: rgba(221, 214, 254, 0.9);
  box-shadow: 0 18px 34px -16px rgba(124, 58, 237, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* The whole banner is one link, stretched over it; the x sits above it. */
.db-gift-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.db-gift-hit:focus-visible {
  outline: 2px solid #fcd34d;
  outline-offset: -3px;
}

.db-gift-x {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 8, 48, 0.55);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.62rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.db-gift-x:hover {
  background: rgba(15, 8, 48, 0.85);
  color: #fff;
  transform: scale(1.08);
}

.db-gift-x:focus-visible {
  outline: 2px solid #fcd34d;
  outline-offset: 2px;
}

.db-gift-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.db-gift-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f5f3ff;
  background: rgba(46, 16, 101, 0.75);
  border: 1px solid rgba(196, 181, 253, 0.6);
}

.db-gift-pill .ic {
  font-size: 0.82rem;
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.db-gift-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.005em;
}

.db-gift-title b {
  display: block;
  margin-top: 1px;
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fcd34d;
  background: linear-gradient(180deg, #fff1a8 0%, #ffd23f 45%, #f7a21b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.35));
}

.db-gift-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.32;
  color: #e4defc;
}

.db-gift-spark {
  width: 0.95em;
  height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.1em;
  fill: #fcd34d;
  animation: db-gift-twinkle 2.4s ease-in-out infinite;
}

.db-gift-art {
  width: 118px;
  height: 106px;
  margin: -12px -4px -12px -6px;
  overflow: visible;
}

.db-gift-box {
  animation: db-gift-float 3.4s ease-in-out infinite;
}

.db-gift-tw {
  transform-box: fill-box;
  transform-origin: center;
  animation: db-gift-twinkle 2.4s ease-in-out infinite;
}

.db-gift-chev {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.25s var(--db-ease);
}

.db-gift:hover .db-gift-chev {
  transform: translateX(3px);
}

/* The yellow button is the wide panel's call to action; the card taps whole. */
.db-gift-btn {
  display: none;
}

@keyframes db-gift-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes db-gift-twinkle {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.7);
  }
}

@keyframes db-gift-shine {

  0%,
  60% {
    transform: translateX(-120%) skewX(-20deg);
  }

  100% {
    transform: translateX(420%) skewX(-20deg);
  }
}

@media (max-width: 1024px) {
  .db-gift {
    max-width: none;
  }
}

/* Phones: same card, sized to the phone mockup */
@media (max-width: 760px) {
  /* The copy's 540px desktop cap left the card and buttons short of the
     full-width AI Auto Trader on large phones; use the whole hero width. */
  .db-hero-copy {
    max-width: none;
  }

  .db-gift {
    margin-bottom: 12px;
    padding: 8px 4px 8px 12px;
    border-radius: 12px;
  }

  .db-gift-pill {
    font-size: 0.56rem;
    padding: 1px 9px;
  }

  .db-gift-title {
    font-size: 0.98rem;
  }

  .db-gift-title b {
    font-size: 1.24rem;
  }

  .db-gift-sub {
    font-size: 0.66rem;
  }

  .db-gift-art {
    width: 108px;
    height: 97px;
    margin: -12px -4px -12px -8px;
  }
}

@media (max-width: 374px) {
  .db-gift {
    padding-left: 10px;
  }

  .db-gift-title {
    font-size: 0.88rem;
  }

  .db-gift-title b {
    font-size: 1.06rem;
  }

  .db-gift-sub {
    font-size: 0.62rem;
  }

  .db-gift-art {
    width: 88px;
    height: 79px;
    margin: -8px -4px -8px -8px;
  }

  .db-gift-chev {
    font-size: 0.85rem;
  }
}

/* ---- Hero lead: never more than two lines on tablet/desktop ----
   The font eases down with the copy column (cqi = 1% of .db-hero-copy's
   width) so the text fits in two lines; the clamp is only the hard stop. */
@media (min-width: 761px) {
  .db-hero-copy {
    container-type: inline-size;
  }

  .db-hero-lead {
    font-size: clamp(0.7rem, 3.15cqi, 0.82rem);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
}

/* A little more width for the copy where robot and trader sit beside it. */
@media (min-width: 1181px) and (max-width: 1400px) {
  .db-hero {
    grid-template-columns: minmax(0, 1fr) auto minmax(236px, 260px);
  }
}

/* =========================================================================
   Gift banner above phone size: it never makes the hero taller.
     761-1024    tablet: copy | panel in row 1, AI Auto Trader below (as ever)
     1025-1249   small laptop: a slim strip under a compact AI Auto Trader
     1250-1365   copy | AI Auto Trader | panel
     1366-1499   copy | robot (small) | AI Auto Trader | panel
     1500+       copy | robot | AI Auto Trader | panel (chips from 1880)
   Phones keep the card inside the copy (base rules above).
   ========================================================================= */

/* ---- The panel: starts in the column gap, fades in from the hero's navy,
        violet sweep arcing in from the right; art absolutely placed so the
        panel is only as tall as the hero already is ---- */
@media (min-width: 761px) and (max-width: 1024px), (min-width: 1250px) {
  .db-hero.has-gift {
    --gift-gap: 18px;
  }

  .db-hero.has-gift .db-chips {
    display: none;
  }

  .db-hero>.db-gift {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    align-self: stretch;
    max-width: none;
    max-height: none;
    margin: -20px -30px -20px calc(-1 * var(--gift-gap));
    padding: 14px 18px 16px calc(26px + var(--gift-gap));
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: opacity 0.5s ease, transform 0.7s var(--db-ease);
  }

  .db-hero>.db-gift::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(170px 140px at 80% 34%, rgba(186, 120, 255, 0.5), transparent 70%),
      radial-gradient(112% 118% at 115% 50%, #4a2ab6 0%, #3c1fa0 52%, #34198f 80%, rgba(52, 25, 143, 0.55) 91%, rgba(52, 25, 143, 0) 100%),
      linear-gradient(180deg, #1c1f63 0%, #191a58 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 34px, #000 78px);
    mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 34px, #000 78px);
  }

  .db-hero>.db-gift:not(.is-in) {
    max-height: none;
    margin: -20px -30px -20px calc(-1 * var(--gift-gap));
    padding: 14px 18px 16px calc(26px + var(--gift-gap));
    transform: translateX(28px);
  }

  .db-hero>.db-gift:hover {
    box-shadow: none;
  }

  .db-hero>.db-gift .db-gift-copy {
    width: max-content;
    max-width: 64%;
  }

  .db-hero>.db-gift .db-gift-pill {
    align-self: center;
    margin-bottom: 7px;
    font-size: 0.6rem;
    padding: 3px 12px;
  }

  .db-hero>.db-gift .db-gift-title {
    font-size: 1.2rem;
  }

  .db-hero>.db-gift .db-gift-title b {
    font-size: 1.44rem;
  }

  .db-hero>.db-gift .db-gift-sub {
    margin-top: 6px;
    font-size: 0.74rem;
  }

  .db-hero>.db-gift .db-gift-art {
    position: absolute;
    z-index: 0;
    top: 2px;
    right: -2px;
    width: 52%;
    height: auto;
    aspect-ratio: 10 / 9;
    margin: 0;
  }

  .db-hero>.db-gift .db-gift-chev {
    display: none;
  }

  /* Clear of the hero's rounded corner. */
  .db-hero>.db-gift .db-gift-x {
    top: 12px;
    right: 14px;
  }

  .db-hero>.db-gift .db-gift-btn {
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 88%;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    color: #1a1446;
    background: linear-gradient(180deg, #ffe27a 0%, #ffcf3f 45%, #f7a81b 100%);
    box-shadow: 0 12px 24px -12px rgba(245, 158, 11, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 0 rgba(180, 83, 9, 0.35);
    transition: transform 0.2s ease, filter 0.2s ease;
  }

  .db-hero>.db-gift .db-gift-btn .ic {
    font-size: 1rem;
  }

  .db-hero>.db-gift .db-gift-btn .ic:first-child {
    font-size: 1.3rem;
  }

  .db-hero>.db-gift .db-gift-btn::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 28%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: db-gift-shine 3.6s ease-in-out infinite;
  }

  .db-hero>.db-gift:hover .db-gift-btn {
    transform: translateY(-1px);
    filter: brightness(1.05);
  }
}

/* ---- The narrower panel (tablet and 1250-1499 laptops) ---- */
@media (min-width: 761px) and (max-width: 1024px), (min-width: 1250px) and (max-width: 1499px) {
  .db-hero>.db-gift {
    gap: 10px;
  }

  .db-hero>.db-gift .db-gift-pill {
    margin-bottom: 6px;
  }

  .db-hero>.db-gift .db-gift-title {
    font-size: 1rem;
  }

  .db-hero>.db-gift .db-gift-title b {
    font-size: 1.16rem;
  }

  /* Its two lines are set by the <br>; don't let the sparkle wrap to a third. */
  .db-hero>.db-gift .db-gift-sub {
    margin-top: 5px;
    font-size: 0.66rem;
    white-space: nowrap;
  }

  .db-hero>.db-gift .db-gift-art {
    width: 42%;
  }

  .db-hero>.db-gift .db-gift-btn {
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.76rem;
  }

  .db-hero>.db-gift .db-gift-btn .ic:first-child {
    font-size: 1.1rem;
  }
}

/* ---- Tablet: the panel takes the top-right beside the copy; the AI Auto
        Trader keeps its full-width row below. The robot is only a faint
        background here, and the panel covers that corner. ---- */
@media (min-width: 761px) and (max-width: 1024px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) minmax(236px, 280px);
    --gift-gap: 24px;
  }

  .db-hero.has-gift .db-hero-art {
    display: none;
  }

  .db-hero.has-gift>.db-hero-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .db-hero.has-gift>.db-gift {
    grid-column: 2;
    grid-row: 1;
  }

  .db-hero.has-gift>.db-hero-trader {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  /* Row 1 only, so it fades out toward the trader row too. */
  .db-hero>.db-gift,
  .db-hero>.db-gift:not(.is-in) {
    margin-bottom: 0;
  }

  .db-hero>.db-gift::before {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 34px, #000 78px), linear-gradient(0deg, transparent 0, #000 36px);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 34px, #000 78px), linear-gradient(0deg, transparent 0, #000 36px);
    mask-composite: intersect;
  }
}

/* ---- Small laptops: no room for another column, so the AI Auto Trader goes
        compact and a slim gift strip sits under it, both beside the copy. ---- */
@media (min-width: 1025px) and (max-width: 1249px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    grid-template-rows: minmax(0, 1fr) auto;
    row-gap: 6px;
  }

  .db-hero.has-gift .db-hero-art {
    display: none;
  }

  .db-hero.has-gift>.db-hero-copy {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .db-hero.has-gift>.db-hero-trader {
    grid-column: 2;
    grid-row: 1;
    gap: 7px;
    padding: 9px 12px;
  }

  .db-hero.has-gift .tx-card-profit.at-pl {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
  }

  .db-hero.has-gift .at-pl-value {
    font-size: 1.05rem;
  }

  .db-hero.has-gift>.db-gift {
    grid-column: 2;
    grid-row: 2;
  }

  .db-hero>.db-gift,
  .db-hero>.db-gift:not(.is-in) {
    max-width: none;
    margin: 0;
    padding: 6px 4px 6px 12px;
    border-radius: 12px;
  }

  .db-hero>.db-gift:not(.is-in) {
    max-height: none;
    transform: translateY(8px);
  }

  .db-hero>.db-gift .db-gift-pill,
  .db-hero>.db-gift .db-gift-sub {
    display: none;
  }

  .db-hero>.db-gift .db-gift-title {
    font-size: 0.78rem;
  }

  .db-hero>.db-gift .db-gift-title b {
    font-size: 1.02rem;
  }

  .db-hero>.db-gift .db-gift-art {
    width: 66px;
    height: 59px;
    margin: -8px -2px -8px 0;
  }

  .db-hero>.db-gift .db-gift-x {
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    font-size: 0.52rem;
  }
}

/* ---- 1250-1365: copy | AI Auto Trader | panel (the robot steps aside) ---- */
@media (min-width: 1250px) and (max-width: 1365px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) 250px 250px;
    column-gap: 14px;
    --gift-gap: 14px;
  }

  .db-hero.has-gift .db-hero-art {
    display: none;
  }
}

/* ---- 1366-1499: copy | robot (small) | AI Auto Trader | panel ---- */
@media (min-width: 1366px) and (max-width: 1499px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) auto 250px 256px;
    column-gap: 14px;
    --gift-gap: 14px;
  }

  .db-hero.has-gift .db-bubble {
    width: 88px;
    height: 88px;
  }
}

@media (min-width: 1250px) and (max-width: 1499px) {
  .db-hero.has-gift .db-btn-ai {
    min-width: 164px;
  }
}

/* ---- 1500+: copy | robot | AI Auto Trader | panel ---- */
@media (min-width: 1500px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) auto 250px minmax(320px, 332px);
    column-gap: 18px;
    --gift-gap: 18px;
  }

  .db-hero.has-gift .db-bubble {
    width: 120px;
    height: 120px;
  }

  .db-hero.has-gift .db-btn-ai {
    min-width: 172px;
  }
}

/* Very wide screens: full-size robot, roomier columns. */
@media (min-width: 1760px) {
  .db-hero.has-gift {
    grid-template-columns: minmax(0, 1fr) auto minmax(250px, 290px) minmax(350px, 390px);
    column-gap: 24px;
    --gift-gap: 24px;
  }

  .db-hero.has-gift .db-bubble {
    width: 168px;
    height: 168px;
  }

  .db-hero.has-gift .db-btn-ai {
    min-width: 200px;
  }

  .db-hero>.db-gift .db-gift-title b {
    font-size: 1.6rem;
  }
}

/* ...and the robot's chips too, as in the design. */
@media (min-width: 1880px) {
  .db-hero.has-gift .db-chips {
    display: flex;
  }
}
